@fugood/bricks-cli 2.24.8 → 2.24.10
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/153.js +1 -0
- package/lib/236.js +1 -0
- package/lib/703.js +1 -0
- package/lib/737.js +226 -226
- package/lib/779.js +1 -1
- package/lib/886.js +1 -0
- package/lib/890.js +1 -1
- package/lib/index.js +21 -21
- package/package.json +1 -1
- package/lib/300.js +0 -1
- package/lib/425.js +0 -1
- package/lib/465.js +0 -1
- package/lib/573.js +0 -1
package/lib/737.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
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`
|
|
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:()=>jn}),t.r(i);var n={};t.r(n),t.d(n,{lI:()=>oe,F3:()=>ne,mJ:()=>ae,AW:()=>ce,$V:()=>se,J6:()=>de,Wt:()=>le,qq:()=>re,gw:()=>pe,Yi:()=>te});var a={};t.r(a),t.d(a,{applicationFragment:()=>oe,applicationShortFragment:()=>fe,deviceFragment:()=>ne,deviceGroupFragment:()=>ae,deviceShortFragment:()=>ye,instanceVersionFragment:()=>ce,mediaBoxFragment:()=>ve,mediaFileFragment:()=>he,mediaWorkspaceFragment:()=>$e,moduleFragment:()=>se,moduleShortFragment:()=>de,operationFragment:()=>le,publicApplicationBasicInfoFragment:()=>re,userFavoriteFragment:()=>pe,workspaceFragment:()=>_e,workspaceShortFragment:()=>ge});var o={};t.r(o),t.d(o,{application:()=>He,applicationByDevice:()=>Oe,applicationReleaseVersion:()=>Be,applicationReleaseVersions:()=>Ee,applicationTestsByDevice:()=>Me,applications:()=>ze,checkBindDevicePasscode:()=>Pe,deviceUsage:()=>Xe,devices:()=>Je,devicesByGroup:()=>Ne,devicesByUniqueId:()=>Fe,me:()=>Ae,module:()=>Se,moduleReleaseVersion:()=>Re,moduleReleaseVersions:()=>Ue,modules:()=>Ce,publicModules:()=>Te,publicModulesByIdList:()=>xe,workspace:()=>Ge,workspacePricingPlans:()=>qe,workspaces:()=>Le});var r={};t.r(r),t.d(r,{addUserFavorite:()=>qi,assignGroupPermissions:()=>Mi,bindApplication:()=>yi,bindApplicationWithDeviceGroup:()=>hi,changeWorkspaceAdditionalLimitSpending:()=>Vi,changeWorkspaceSubscriptionPlan:()=>ji,controlDevice:()=>di,createApplication:()=>_i,createApplicationWithShareVersion:()=>gi,createConfigChangeOperation:()=>Bi,createDevice:()=>ti,createDeviceGroup:()=>ci,createDeviceGroupWithApp:()=>ki,createModule:()=>Si,createVirtualDevice:()=>ni,createWorkspace:()=>Ze,createWorkspaceOTP:()=>Yi,dispatchDeviceGroupAction:()=>pi,doOperation:()=>Ui,duplicateApplication:()=>wi,duplicateModule:()=>xi,forkApplication:()=>Di,moveApplication:()=>Ii,moveDevice:()=>oi,moveModule:()=>Ti,registerFCMNotification:()=>Pi,registerRemoteDebug:()=>Fi,removeApplication:()=>Ai,removeDevice:()=>si,removeDeviceGroup:()=>ui,removeModule:()=>Ei,removeOperation:()=>Oi,removeUserFavorite:()=>Wi,removeWorkspace:()=>mi,revokeWorkspaceOTP:()=>Ki,shareAccessToken:()=>Ni,shareApplication:()=>bi,toggleShortEditApplication:()=>$i,updateApplication:()=>fi,updateApplicationViewportPreset:()=>vi,updateDevice:()=>ai,updateDeviceGroup:()=>li,updateModule:()=>Ci,updateOperation:()=>Ri,updateVirtualDevice:()=>ri,updateWorkspace:()=>ei,updateWorkspaceTokens:()=>ii});var s={};t.r(s),t.d(s,{application:()=>ot,applicationByDevice:()=>rt,applications:()=>at,device:()=>lt,deviceUsage:()=>ut,devices:()=>ct,devicesByApplication:()=>pt,mediaBox:()=>gt,mediaBoxes:()=>_t,mediaFile:()=>yt,mediaFiles:()=>ft,mediaWorkspace:()=>mt,module:()=>dt,modules:()=>st,workspace:()=>nt});var d={};t.r(d),t.d(d,{bindApplication:()=>It,copyMediaFiles:()=>xt,createApplication:()=>ht,createModule:()=>Dt,deleteMediaBoxFiles:()=>Bt,deleteMediaFiles:()=>Et,requestFileUpload:()=>At,setMediaFileAsBoxPreview:()=>Tt,unbindApplication:()=>kt,updateApplication:()=>bt,updateMediaFile:()=>St,updateMediaFiles:()=>Ct,updateModule:()=>wt});var c={};t.r(c),t.d(c,{mediaBox:()=>tn,mediaBoxes:()=>Zt,mediaFile:()=>an,mediaFiles:()=>nn,mediaWorkspace:()=>en,mediaWorkspaces:()=>Qt});var l={};t.r(l),t.d(l,{assignGroupPermissions:()=>fn,copyMediaFiles:()=>_n,createMediaBox:()=>sn,createMediaWorkspace:()=>on,deleteMediaFiles:()=>mn,moveMediaBox:()=>dn,requestFileUpload:()=>ln,setMediaFileAsBoxPreview:()=>gn,updateMediaBox:()=>cn,updateMediaFile:()=>pn,updateMediaFiles:()=>un,updateMediaWorkspace:()=>rn});var p={};t.r(p),t.d(p,{mediaBox:()=>$n,mediaFile:()=>hn,mediaFiles:()=>vn});var u={};t.r(u),t.d(u,{deleteMediaFiles:()=>Dn,requestFileUpload:()=>bn,updateMediaFile:()=>In,updateMediaFiles:()=>kn});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(69771),x=t(91611),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"]),O=e=>e&&"object"==typeof e?e:{};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("."),r=O(a?.map),s=O(a?.script_config);if(0===Object.keys(r).length)i.push(`${o}.map is empty`);else{var d=s.inputs,c=s.output,l=s.outputs,p=s.error,u=O(d),m=O(l);d&&Object.keys(u).forEach(e=>{r[e]||i.push(`${o}.map.${e} is missing`)}),c&&!r[c]&&i.push(`${o}.map.${c} is missing`),l&&Object.values(m).forEach(e=>{r[e]||i.push(`${o}.map.${e} is missing`)}),p&&!r[p]&&i.push(`${o}.map.${p} is missing`)}}),{valid:0===i.length,errors:i}}catch(e){return{valid:!1,errors:[`Validation failed: ${e.message}`]}}}var P=t(81973),F=t(94513),N=(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]??N(t,i)])):e,q=N(P.systemActionDescriptions),W=Object.entries(P.systemActions).map(([e,{propertyNameType:i,property:t}])=>` - \`${e}\`: ${q[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"),j=Object.keys(F.eW).map(e=>`- \`${e}\``).join("\n"),V=Object.keys(F.wj).map(e=>`- \`${e}\``).join("\n");const Y=I.replace("[:SYSTEM_ACTIONS:]",W).replace("[:BRICK_IDS:]",j).replace("[:GENERATOR_IDS:]",V);var K=(e,i)=>!i||e.tokenInfo.permissions?.includes(i)||!1,G=t(44668),L=t(5018),z=t(63315),H=t(30409),J=t(40906),X=t(79760),Q=t(56078),Z=t(29222),ee=t(26197),ie=t(94370);const te=ie.default`
|
|
2
2
|
fragment workspaceArguments on Workspace {
|
|
3
3
|
__typename
|
|
4
4
|
_id
|
|
@@ -91,7 +91,7 @@ export const __webpack_esm_id__=737;export const __webpack_esm_ids__=[737];expor
|
|
|
91
91
|
updated_at
|
|
92
92
|
}
|
|
93
93
|
}
|
|
94
|
-
`,
|
|
94
|
+
`,ne=ie.default`
|
|
95
95
|
fragment deviceArguments on Device {
|
|
96
96
|
__typename
|
|
97
97
|
_id
|
|
@@ -243,7 +243,7 @@ export const __webpack_esm_id__=737;export const __webpack_esm_ids__=[737];expor
|
|
|
243
243
|
}
|
|
244
244
|
}
|
|
245
245
|
}
|
|
246
|
-
`,
|
|
246
|
+
`,ae=ie.default`
|
|
247
247
|
fragment deviceGroupArguments on DeviceGroup {
|
|
248
248
|
__typename
|
|
249
249
|
_id
|
|
@@ -281,7 +281,7 @@ export const __webpack_esm_id__=737;export const __webpack_esm_ids__=[737];expor
|
|
|
281
281
|
device_target_name
|
|
282
282
|
}
|
|
283
283
|
}
|
|
284
|
-
`,
|
|
284
|
+
`,oe=ie.default`
|
|
285
285
|
fragment applicationArguments on Application {
|
|
286
286
|
__typename
|
|
287
287
|
_id
|
|
@@ -430,7 +430,7 @@ export const __webpack_esm_id__=737;export const __webpack_esm_ids__=[737];expor
|
|
|
430
430
|
scope
|
|
431
431
|
}
|
|
432
432
|
}
|
|
433
|
-
`,
|
|
433
|
+
`,re=ie.default`
|
|
434
434
|
fragment publicApplicationBasicInfoArguments on PublicApplicationBasicInfo {
|
|
435
435
|
_id
|
|
436
436
|
owner {
|
|
@@ -474,7 +474,7 @@ export const __webpack_esm_id__=737;export const __webpack_esm_ids__=[737];expor
|
|
|
474
474
|
}
|
|
475
475
|
}
|
|
476
476
|
}
|
|
477
|
-
`,
|
|
477
|
+
`,se=ie.default`
|
|
478
478
|
fragment moduleArguments on Module {
|
|
479
479
|
__typename
|
|
480
480
|
_id
|
|
@@ -518,7 +518,7 @@ export const __webpack_esm_id__=737;export const __webpack_esm_ids__=[737];expor
|
|
|
518
518
|
last_screenshot_id
|
|
519
519
|
}
|
|
520
520
|
}
|
|
521
|
-
`,
|
|
521
|
+
`,de=ie.default`
|
|
522
522
|
fragment moduleShortArguments on Module {
|
|
523
523
|
__typename
|
|
524
524
|
_id
|
|
@@ -542,7 +542,7 @@ export const __webpack_esm_id__=737;export const __webpack_esm_ids__=[737];expor
|
|
|
542
542
|
last_screenshot_id
|
|
543
543
|
}
|
|
544
544
|
}
|
|
545
|
-
`,
|
|
545
|
+
`,ce=ie.default`
|
|
546
546
|
fragment instanceVersionArguments on ConfigVersion {
|
|
547
547
|
__typename
|
|
548
548
|
_id
|
|
@@ -553,7 +553,7 @@ export const __webpack_esm_id__=737;export const __webpack_esm_ids__=[737];expor
|
|
|
553
553
|
instance_id
|
|
554
554
|
entry
|
|
555
555
|
}
|
|
556
|
-
`,
|
|
556
|
+
`,le=ie.default`
|
|
557
557
|
fragment operationArguments on Operation {
|
|
558
558
|
__typename
|
|
559
559
|
_id
|
|
@@ -566,7 +566,7 @@ export const __webpack_esm_id__=737;export const __webpack_esm_ids__=[737];expor
|
|
|
566
566
|
expired_datetime
|
|
567
567
|
payload
|
|
568
568
|
}
|
|
569
|
-
`,pe=
|
|
569
|
+
`,pe=ie.default`
|
|
570
570
|
fragment userFavoriteArguments on UserFavorite {
|
|
571
571
|
_id
|
|
572
572
|
instance_type
|
|
@@ -577,7 +577,7 @@ export const __webpack_esm_id__=737;export const __webpack_esm_ids__=[737];expor
|
|
|
577
577
|
}
|
|
578
578
|
last_modify_datetime
|
|
579
579
|
}
|
|
580
|
-
`;var
|
|
580
|
+
`;var ue,me,_e=ie.default`
|
|
581
581
|
fragment mcpWorkspaceArguments on Workspace {
|
|
582
582
|
__typename
|
|
583
583
|
_id
|
|
@@ -660,25 +660,25 @@ export const __webpack_esm_id__=737;export const __webpack_esm_ids__=[737];expor
|
|
|
660
660
|
updated_at
|
|
661
661
|
}
|
|
662
662
|
}
|
|
663
|
-
`,
|
|
663
|
+
`,ge=ie.default`
|
|
664
664
|
fragment mcpWorkspaceShortArguments on Workspace {
|
|
665
665
|
_id
|
|
666
666
|
name
|
|
667
667
|
description
|
|
668
668
|
}
|
|
669
|
-
`,
|
|
669
|
+
`,fe=ie.default`
|
|
670
670
|
fragment mcpApplicationShortArguments on Application {
|
|
671
671
|
_id
|
|
672
672
|
name
|
|
673
673
|
description
|
|
674
674
|
}
|
|
675
|
-
`,
|
|
675
|
+
`,ye=ie.default`
|
|
676
676
|
fragment mcpDeviceShortArguments on Device {
|
|
677
677
|
_id
|
|
678
678
|
name
|
|
679
679
|
description
|
|
680
680
|
}
|
|
681
|
-
|
|
681
|
+
`,$e=ie.default`
|
|
682
682
|
fragment workspaceMediaWorkspaceArguments on MediaWorkspace {
|
|
683
683
|
id
|
|
684
684
|
name
|
|
@@ -690,7 +690,7 @@ export const __webpack_esm_id__=737;export const __webpack_esm_ids__=[737];expor
|
|
|
690
690
|
size
|
|
691
691
|
sizeLimit
|
|
692
692
|
}
|
|
693
|
-
|
|
693
|
+
`,ve=ie.default`
|
|
694
694
|
fragment workspaceMediaBoxArguments on MediaBox {
|
|
695
695
|
id
|
|
696
696
|
name
|
|
@@ -712,7 +712,7 @@ export const __webpack_esm_id__=737;export const __webpack_esm_ids__=[737];expor
|
|
|
712
712
|
updatedAt
|
|
713
713
|
size
|
|
714
714
|
}
|
|
715
|
-
`,
|
|
715
|
+
`,he=ie.default`
|
|
716
716
|
fragment workspaceMediaFileArguments on MediaFile {
|
|
717
717
|
id
|
|
718
718
|
name
|
|
@@ -795,70 +795,70 @@ export const __webpack_esm_id__=737;export const __webpack_esm_ids__=[737];expor
|
|
|
795
795
|
systemTags
|
|
796
796
|
}
|
|
797
797
|
}
|
|
798
|
-
`,
|
|
798
|
+
`,be={query:"query",mutation:"mutate"},Ie=G(function e(i,t,n,o,r){L(this,e),this.baseUrl=i,this.token=t,this.endpoint=n;var s=(0,X.$)({uri:`${i}${n}`}),d=(0,ee.o)((e,{headers:i})=>({headers:{...i,authorization:`Bearer ${t}`}}));this.apolloClient=new Q.R({link:d.concat(s),cache:new Z.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[be[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:(me=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 me.apply(this,arguments)})},{key:"mutate",value:(ue=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 ue.apply(this,arguments)})}]);const{$V:ke,J6:De,AW:we}=n,Ae=ie.default`
|
|
799
799
|
query ControllerClient_me {
|
|
800
800
|
me {
|
|
801
801
|
_id
|
|
802
802
|
id_from_user
|
|
803
803
|
}
|
|
804
804
|
}
|
|
805
|
-
`,
|
|
805
|
+
`,Se=ie.default`
|
|
806
806
|
query ControllerClient_module($id: ID!) {
|
|
807
807
|
module(id: $id) {
|
|
808
808
|
...moduleArguments
|
|
809
809
|
}
|
|
810
810
|
}
|
|
811
|
-
${
|
|
812
|
-
`,
|
|
811
|
+
${ke}
|
|
812
|
+
`,Ce=ie.default`
|
|
813
813
|
query ControllerClient_modules($workspaceId: ID, $limit: Int) {
|
|
814
814
|
modules(workspaceId: $workspaceId, paginate: { limit: $limit }) {
|
|
815
815
|
...moduleShortArguments
|
|
816
816
|
}
|
|
817
817
|
}
|
|
818
|
-
${
|
|
819
|
-
`,
|
|
818
|
+
${De}
|
|
819
|
+
`,Te=ie.default`
|
|
820
820
|
query ControllerClient_publicModules($keyword: String!, $limit: Int) {
|
|
821
821
|
publicModules(keyword: $keyword, paginate: { limit: $limit }) {
|
|
822
822
|
...moduleShortArguments
|
|
823
823
|
}
|
|
824
824
|
}
|
|
825
|
-
${
|
|
826
|
-
`,
|
|
825
|
+
${De}
|
|
826
|
+
`,xe=ie.default`
|
|
827
827
|
query ControllerClient_publicModulesByIdList($idList: [ID]) {
|
|
828
828
|
publicModulesByIdList(idList: $idList) {
|
|
829
829
|
...moduleShortArguments
|
|
830
830
|
}
|
|
831
831
|
}
|
|
832
|
-
${
|
|
833
|
-
`,
|
|
832
|
+
${De}
|
|
833
|
+
`,Ee=ie.default`
|
|
834
834
|
query ControllerClient_applicationReleaseVersions($id: ID!) {
|
|
835
835
|
applicationReleaseVersions(id: $id) {
|
|
836
836
|
...instanceVersionArguments
|
|
837
837
|
}
|
|
838
838
|
}
|
|
839
|
-
${
|
|
840
|
-
`,
|
|
839
|
+
${we}
|
|
840
|
+
`,Be=ie.default`
|
|
841
841
|
query ControllerClient_applicationReleaseVersion($id: ID!, $versionId: ID!) {
|
|
842
842
|
applicationReleaseVersion(id: $id, versionId: $versionId) {
|
|
843
843
|
...applicationReleaseVersionArguments
|
|
844
844
|
}
|
|
845
845
|
}
|
|
846
|
-
${
|
|
847
|
-
`,
|
|
846
|
+
${we}
|
|
847
|
+
`,Ue=ie.default`
|
|
848
848
|
query ControllerClient_moduleReleaseVersions($id: ID!) {
|
|
849
849
|
moduleReleaseVersions(id: $id) {
|
|
850
850
|
...instanceVersionArguments
|
|
851
851
|
}
|
|
852
852
|
}
|
|
853
|
-
${
|
|
854
|
-
`,
|
|
853
|
+
${we}
|
|
854
|
+
`,Re=ie.default`
|
|
855
855
|
query ControllerClient_moduleReleaseVersion($id: ID!, $versionId: ID!) {
|
|
856
856
|
moduleReleaseVersion(id: $id, versionId: $versionId) {
|
|
857
857
|
...instanceVersionArguments
|
|
858
858
|
}
|
|
859
859
|
}
|
|
860
|
-
${
|
|
861
|
-
`,
|
|
860
|
+
${we}
|
|
861
|
+
`,Oe=ie.default`
|
|
862
862
|
query ControllerClient_applicationByDevice(
|
|
863
863
|
$deviceId: ID!
|
|
864
864
|
$debug: Boolean
|
|
@@ -875,8 +875,8 @@ export const __webpack_esm_id__=737;export const __webpack_esm_ids__=[737];expor
|
|
|
875
875
|
config_tests
|
|
876
876
|
}
|
|
877
877
|
}
|
|
878
|
-
${
|
|
879
|
-
`,Me=
|
|
878
|
+
${oe}
|
|
879
|
+
`,Me=ie.default`
|
|
880
880
|
query ControllerClient_applicationTestsByDevice($deviceId: ID!) {
|
|
881
881
|
applicationTestsByDevice: applicationByDevice(
|
|
882
882
|
deviceId: $deviceId
|
|
@@ -889,18 +889,18 @@ export const __webpack_esm_id__=737;export const __webpack_esm_ids__=[737];expor
|
|
|
889
889
|
config_tests
|
|
890
890
|
}
|
|
891
891
|
}
|
|
892
|
-
`,
|
|
892
|
+
`,Pe=ie.default`
|
|
893
893
|
query ControllerClient_checkBindDevicePasscode($passcode: String!) {
|
|
894
894
|
checkBindDevicePasscode(passcode: $passcode)
|
|
895
895
|
}
|
|
896
|
-
`,
|
|
896
|
+
`,Fe=ie.default`
|
|
897
897
|
query ControllerClient_devicesByUniqueId($uniqueID: String!, $unbindApplication: Boolean) {
|
|
898
898
|
devicesByUniqueId(uniqueID: $uniqueID, unbindApplication: $unbindApplication) {
|
|
899
899
|
...deviceArguments
|
|
900
900
|
}
|
|
901
901
|
}
|
|
902
|
-
${
|
|
903
|
-
`,
|
|
902
|
+
${ne}
|
|
903
|
+
`,Ne=ie.default`
|
|
904
904
|
query ControllerClient_devicesByGroup($id: ID!) {
|
|
905
905
|
devicesByGroup(id: $id) {
|
|
906
906
|
device {
|
|
@@ -951,46 +951,46 @@ export const __webpack_esm_id__=737;export const __webpack_esm_ids__=[737];expor
|
|
|
951
951
|
target_name
|
|
952
952
|
}
|
|
953
953
|
}
|
|
954
|
-
`,
|
|
954
|
+
`,qe=ie.default`
|
|
955
955
|
query ControllerClient_workspacePricingPlans {
|
|
956
956
|
workspacePricingPlans
|
|
957
957
|
}
|
|
958
|
-
`;var
|
|
958
|
+
`;var We=ye,je=fe,Ve=oe,Ye=ge,Ke=_e,Ge=ie.default`
|
|
959
959
|
query User_workspace($id: ID!) {
|
|
960
960
|
workspace(id: $id) {
|
|
961
961
|
...mcpWorkspaceArguments
|
|
962
962
|
}
|
|
963
963
|
}
|
|
964
|
-
${
|
|
965
|
-
`,
|
|
964
|
+
${Ke}
|
|
965
|
+
`,Le=ie.default`
|
|
966
966
|
query User_workspaces($paginate: Paginate) {
|
|
967
967
|
workspaces(paginate: $paginate) {
|
|
968
968
|
...mcpWorkspaceShortArguments
|
|
969
969
|
}
|
|
970
970
|
}
|
|
971
|
-
${
|
|
972
|
-
`,
|
|
971
|
+
${Ye}
|
|
972
|
+
`,ze=ie.default`
|
|
973
973
|
query User_applications {
|
|
974
974
|
applications {
|
|
975
975
|
...mcpApplicationShortArguments
|
|
976
976
|
}
|
|
977
977
|
}
|
|
978
|
-
${
|
|
979
|
-
`,
|
|
978
|
+
${je}
|
|
979
|
+
`,He=ie.default`
|
|
980
980
|
query User_application($id: ID!) {
|
|
981
981
|
application(id: $id) {
|
|
982
982
|
...applicationArguments
|
|
983
983
|
}
|
|
984
984
|
}
|
|
985
|
-
${
|
|
986
|
-
`,
|
|
985
|
+
${Ve}
|
|
986
|
+
`,Je=ie.default`
|
|
987
987
|
query User_devices {
|
|
988
988
|
devices {
|
|
989
989
|
...mcpDeviceShortArguments
|
|
990
990
|
}
|
|
991
991
|
}
|
|
992
|
-
${
|
|
993
|
-
`,
|
|
992
|
+
${We}
|
|
993
|
+
`,Xe=ie.default`
|
|
994
994
|
query User_deviceUsage($deviceId: ID, $startDate: Date, $endDate: Date) {
|
|
995
995
|
deviceUsage(deviceId: $deviceId, startDate: $startDate, endDate: $endDate) {
|
|
996
996
|
_id
|
|
@@ -1009,14 +1009,14 @@ export const __webpack_esm_id__=737;export const __webpack_esm_ids__=[737];expor
|
|
|
1009
1009
|
}
|
|
1010
1010
|
}
|
|
1011
1011
|
}
|
|
1012
|
-
`;const
|
|
1012
|
+
`;const Qe=e=>(e.needResetStore=!0,e),Ze=Qe(ie.default`
|
|
1013
1013
|
mutation ControllerClient_createWorkspace($name: String, $description: String) {
|
|
1014
1014
|
createWorkspace(name: $name, description: $description) {
|
|
1015
1015
|
...workspaceArguments
|
|
1016
1016
|
}
|
|
1017
1017
|
}
|
|
1018
|
-
${
|
|
1019
|
-
`),
|
|
1018
|
+
${te}
|
|
1019
|
+
`),ei=Qe(ie.default`
|
|
1020
1020
|
mutation ControllerClient_updateWorkspace(
|
|
1021
1021
|
$id: ID!
|
|
1022
1022
|
$name: String
|
|
@@ -1044,8 +1044,8 @@ export const __webpack_esm_id__=737;export const __webpack_esm_ids__=[737];expor
|
|
|
1044
1044
|
...workspaceArguments
|
|
1045
1045
|
}
|
|
1046
1046
|
}
|
|
1047
|
-
${
|
|
1048
|
-
`),
|
|
1047
|
+
${te}
|
|
1048
|
+
`),ii=Qe(ie.default`
|
|
1049
1049
|
mutation ControllerClient_updateWorkspaceTokens(
|
|
1050
1050
|
$id: ID!
|
|
1051
1051
|
$tokens: [WorkspaceTokenInput]
|
|
@@ -1061,8 +1061,8 @@ export const __webpack_esm_id__=737;export const __webpack_esm_ids__=[737];expor
|
|
|
1061
1061
|
}
|
|
1062
1062
|
}
|
|
1063
1063
|
}
|
|
1064
|
-
${
|
|
1065
|
-
`),
|
|
1064
|
+
${te}
|
|
1065
|
+
`),ti=Qe(ie.default`
|
|
1066
1066
|
mutation ControllerClient_createDevice(
|
|
1067
1067
|
$workspaceId: ID
|
|
1068
1068
|
$name: String
|
|
@@ -1084,8 +1084,8 @@ export const __webpack_esm_id__=737;export const __webpack_esm_ids__=[737];expor
|
|
|
1084
1084
|
...deviceArguments
|
|
1085
1085
|
}
|
|
1086
1086
|
}
|
|
1087
|
-
${
|
|
1088
|
-
`),
|
|
1087
|
+
${ne}
|
|
1088
|
+
`),ni=Qe(ie.default`
|
|
1089
1089
|
mutation ControllerClient_createVirtualDevice(
|
|
1090
1090
|
$workspaceId: ID
|
|
1091
1091
|
$name: String
|
|
@@ -1101,8 +1101,8 @@ export const __webpack_esm_id__=737;export const __webpack_esm_ids__=[737];expor
|
|
|
1101
1101
|
...deviceArguments
|
|
1102
1102
|
}
|
|
1103
1103
|
}
|
|
1104
|
-
${
|
|
1105
|
-
`),
|
|
1104
|
+
${ne}
|
|
1105
|
+
`),ai=Qe(ie.default`
|
|
1106
1106
|
mutation ControllerClient_updateDevice(
|
|
1107
1107
|
$id: ID!
|
|
1108
1108
|
$name: String
|
|
@@ -1138,8 +1138,8 @@ export const __webpack_esm_id__=737;export const __webpack_esm_ids__=[737];expor
|
|
|
1138
1138
|
...deviceArguments
|
|
1139
1139
|
}
|
|
1140
1140
|
}
|
|
1141
|
-
${
|
|
1142
|
-
`),
|
|
1141
|
+
${ne}
|
|
1142
|
+
`),oi=Qe(ie.default`
|
|
1143
1143
|
mutation ControllerClient_moveDevice(
|
|
1144
1144
|
$id: ID!
|
|
1145
1145
|
$workspaceId: ID!
|
|
@@ -1157,8 +1157,8 @@ export const __webpack_esm_id__=737;export const __webpack_esm_ids__=[737];expor
|
|
|
1157
1157
|
...deviceArguments
|
|
1158
1158
|
}
|
|
1159
1159
|
}
|
|
1160
|
-
${
|
|
1161
|
-
`),
|
|
1160
|
+
${ne}
|
|
1161
|
+
`),ri=Qe(ie.default`
|
|
1162
1162
|
mutation ControllerClient_updateVirtualDevice(
|
|
1163
1163
|
$id: ID!
|
|
1164
1164
|
$tokens: [DeviceTokenInput]
|
|
@@ -1174,19 +1174,19 @@ export const __webpack_esm_id__=737;export const __webpack_esm_ids__=[737];expor
|
|
|
1174
1174
|
}
|
|
1175
1175
|
}
|
|
1176
1176
|
}
|
|
1177
|
-
${
|
|
1178
|
-
`),
|
|
1177
|
+
${ne}
|
|
1178
|
+
`),si=Qe(ie.default`
|
|
1179
1179
|
mutation ControllerClient_removeDevice($id: ID!) {
|
|
1180
1180
|
removeDevice(id: $id)
|
|
1181
1181
|
}
|
|
1182
|
-
`),
|
|
1182
|
+
`),di=Qe(ie.default`
|
|
1183
1183
|
mutation ControllerClient_controlDevice($id: ID!, $type: String!, $eventPayload: JSON) {
|
|
1184
1184
|
controlDevice(id: $id, type: $type, eventPayload: $eventPayload) {
|
|
1185
1185
|
...deviceArguments
|
|
1186
1186
|
}
|
|
1187
1187
|
}
|
|
1188
|
-
${
|
|
1189
|
-
`),
|
|
1188
|
+
${ne}
|
|
1189
|
+
`),ci=Qe(ie.default`
|
|
1190
1190
|
mutation ControllerClient_createDeviceGroup(
|
|
1191
1191
|
$workspaceId: ID!
|
|
1192
1192
|
$name: String!
|
|
@@ -1196,8 +1196,8 @@ export const __webpack_esm_id__=737;export const __webpack_esm_ids__=[737];expor
|
|
|
1196
1196
|
...deviceGroupArguments
|
|
1197
1197
|
}
|
|
1198
1198
|
}
|
|
1199
|
-
${
|
|
1200
|
-
`),
|
|
1199
|
+
${ae}
|
|
1200
|
+
`),li=Qe(ie.default`
|
|
1201
1201
|
mutation ControllerClient_updateDeviceGroup(
|
|
1202
1202
|
$id: ID!
|
|
1203
1203
|
$name: String
|
|
@@ -1221,23 +1221,23 @@ export const __webpack_esm_id__=737;export const __webpack_esm_ids__=[737];expor
|
|
|
1221
1221
|
...deviceGroupArguments
|
|
1222
1222
|
}
|
|
1223
1223
|
}
|
|
1224
|
-
${
|
|
1225
|
-
`),pi=
|
|
1224
|
+
${ae}
|
|
1225
|
+
`),pi=Qe(ie.default`
|
|
1226
1226
|
mutation ControllerClient_dispatchDeviceGroupAction($id: ID!, $action: String!) {
|
|
1227
1227
|
dispatchDeviceGroupAction(id: $id, action: $action) {
|
|
1228
1228
|
devices
|
|
1229
1229
|
dispatched
|
|
1230
1230
|
}
|
|
1231
1231
|
}
|
|
1232
|
-
`),
|
|
1232
|
+
`),ui=Qe(ie.default`
|
|
1233
1233
|
mutation ControllerClient_removeDeviceGroup($id: ID!) {
|
|
1234
1234
|
removeDeviceGroup(id: $id)
|
|
1235
1235
|
}
|
|
1236
|
-
`),
|
|
1236
|
+
`),mi=Qe(ie.default`
|
|
1237
1237
|
mutation ControllerClient_removeWorkspace($id: ID!) {
|
|
1238
1238
|
removeWorkspace(id: $id)
|
|
1239
1239
|
}
|
|
1240
|
-
`),
|
|
1240
|
+
`),_i=Qe(ie.default`
|
|
1241
1241
|
mutation ControllerClient_createApplication(
|
|
1242
1242
|
$workspaceId: ID
|
|
1243
1243
|
$name: String
|
|
@@ -1257,8 +1257,8 @@ export const __webpack_esm_id__=737;export const __webpack_esm_ids__=[737];expor
|
|
|
1257
1257
|
...applicationArguments
|
|
1258
1258
|
}
|
|
1259
1259
|
}
|
|
1260
|
-
${
|
|
1261
|
-
`),
|
|
1260
|
+
${oe}
|
|
1261
|
+
`),gi=Qe(ie.default`
|
|
1262
1262
|
mutation ControllerClient_createApplicationWithShareVersion(
|
|
1263
1263
|
$workspaceId: ID
|
|
1264
1264
|
$name: String
|
|
@@ -1274,8 +1274,8 @@ export const __webpack_esm_id__=737;export const __webpack_esm_ids__=[737];expor
|
|
|
1274
1274
|
...applicationArguments
|
|
1275
1275
|
}
|
|
1276
1276
|
}
|
|
1277
|
-
${
|
|
1278
|
-
`),
|
|
1277
|
+
${oe}
|
|
1278
|
+
`),fi=Qe(ie.default`
|
|
1279
1279
|
mutation ControllerClient_updateApplication(
|
|
1280
1280
|
$id: ID!
|
|
1281
1281
|
$name: String
|
|
@@ -1319,8 +1319,8 @@ export const __webpack_esm_id__=737;export const __webpack_esm_ids__=[737];expor
|
|
|
1319
1319
|
...applicationArguments
|
|
1320
1320
|
}
|
|
1321
1321
|
}
|
|
1322
|
-
${
|
|
1323
|
-
`),
|
|
1322
|
+
${oe}
|
|
1323
|
+
`),yi=Qe(ie.default`
|
|
1324
1324
|
mutation ControllerClient_bindApplication(
|
|
1325
1325
|
$id: ID!
|
|
1326
1326
|
$devices: [ID]
|
|
@@ -1342,12 +1342,12 @@ export const __webpack_esm_id__=737;export const __webpack_esm_ids__=[737];expor
|
|
|
1342
1342
|
...applicationArguments
|
|
1343
1343
|
}
|
|
1344
1344
|
}
|
|
1345
|
-
${
|
|
1346
|
-
`)
|
|
1345
|
+
${oe}
|
|
1346
|
+
`),$i=Qe(ie.default`
|
|
1347
1347
|
mutation ControllerClient_toggleShortEditApplication($id: ID!, $enabled: Boolean!) {
|
|
1348
1348
|
toggleShortEditApplication(id: $id, enabled: $enabled)
|
|
1349
1349
|
}
|
|
1350
|
-
`)
|
|
1350
|
+
`),vi=Qe(ie.default`
|
|
1351
1351
|
mutation ControllerClient_updateApplicationViewportPreset(
|
|
1352
1352
|
$id: ID!
|
|
1353
1353
|
$newViewportPresets: [ApplicationViewportPresetInput]
|
|
@@ -1363,8 +1363,8 @@ export const __webpack_esm_id__=737;export const __webpack_esm_ids__=[737];expor
|
|
|
1363
1363
|
...applicationArguments
|
|
1364
1364
|
}
|
|
1365
1365
|
}
|
|
1366
|
-
${
|
|
1367
|
-
`),
|
|
1366
|
+
${oe}
|
|
1367
|
+
`),hi=Qe(ie.default`
|
|
1368
1368
|
mutation ControllerClient_bindApplicationWithDeviceGroup(
|
|
1369
1369
|
$id: ID!
|
|
1370
1370
|
$bindDeviceGroup: ApplicationBindDeviceGroupInput
|
|
@@ -1380,8 +1380,8 @@ export const __webpack_esm_id__=737;export const __webpack_esm_ids__=[737];expor
|
|
|
1380
1380
|
...applicationArguments
|
|
1381
1381
|
}
|
|
1382
1382
|
}
|
|
1383
|
-
${
|
|
1384
|
-
`),
|
|
1383
|
+
${oe}
|
|
1384
|
+
`),bi=Qe(ie.default`
|
|
1385
1385
|
mutation ControllerClient_shareApplication(
|
|
1386
1386
|
$id: ID!
|
|
1387
1387
|
$shareSetting: ApplicationShareSettingInput
|
|
@@ -1401,15 +1401,15 @@ export const __webpack_esm_id__=737;export const __webpack_esm_ids__=[737];expor
|
|
|
1401
1401
|
...applicationArguments
|
|
1402
1402
|
}
|
|
1403
1403
|
}
|
|
1404
|
-
${
|
|
1405
|
-
`),
|
|
1404
|
+
${oe}
|
|
1405
|
+
`),Ii=Qe(ie.default`
|
|
1406
1406
|
mutation ControllerClient_moveApplication($id: ID!, $workspaceId: ID!) {
|
|
1407
1407
|
moveApplication(id: $id, workspaceId: $workspaceId) {
|
|
1408
1408
|
...applicationArguments
|
|
1409
1409
|
}
|
|
1410
1410
|
}
|
|
1411
|
-
${
|
|
1412
|
-
`),
|
|
1411
|
+
${oe}
|
|
1412
|
+
`),ki=Qe(ie.default`
|
|
1413
1413
|
mutation ControllerClient_createDeviceGroupWithApp(
|
|
1414
1414
|
$applicationId: ID!
|
|
1415
1415
|
$name: String!
|
|
@@ -1434,15 +1434,15 @@ export const __webpack_esm_id__=737;export const __webpack_esm_ids__=[737];expor
|
|
|
1434
1434
|
}
|
|
1435
1435
|
}
|
|
1436
1436
|
}
|
|
1437
|
-
${
|
|
1438
|
-
`),
|
|
1437
|
+
${oe}
|
|
1438
|
+
`),Di=Qe(ie.default`
|
|
1439
1439
|
mutation ControllerClient_forkApplication($id: ID!) {
|
|
1440
1440
|
forkApplication(id: $id) {
|
|
1441
1441
|
...applicationArguments
|
|
1442
1442
|
}
|
|
1443
1443
|
}
|
|
1444
|
-
${
|
|
1445
|
-
`),
|
|
1444
|
+
${oe}
|
|
1445
|
+
`),wi=Qe(ie.default`
|
|
1446
1446
|
mutation ControllerClient_duplicateApplication(
|
|
1447
1447
|
$id: ID!
|
|
1448
1448
|
$includeVersions: Boolean
|
|
@@ -1456,12 +1456,12 @@ export const __webpack_esm_id__=737;export const __webpack_esm_ids__=[737];expor
|
|
|
1456
1456
|
...applicationArguments
|
|
1457
1457
|
}
|
|
1458
1458
|
}
|
|
1459
|
-
${
|
|
1460
|
-
`),
|
|
1459
|
+
${oe}
|
|
1460
|
+
`),Ai=Qe(ie.default`
|
|
1461
1461
|
mutation ControllerClient_removeApplication($id: ID!) {
|
|
1462
1462
|
removeApplication(id: $id)
|
|
1463
1463
|
}
|
|
1464
|
-
`),
|
|
1464
|
+
`),Si=Qe(ie.default`
|
|
1465
1465
|
mutation ControllerClient_createModule(
|
|
1466
1466
|
$workspaceId: ID
|
|
1467
1467
|
$name: String
|
|
@@ -1487,8 +1487,8 @@ export const __webpack_esm_id__=737;export const __webpack_esm_ids__=[737];expor
|
|
|
1487
1487
|
...moduleArguments
|
|
1488
1488
|
}
|
|
1489
1489
|
}
|
|
1490
|
-
${
|
|
1491
|
-
`),
|
|
1490
|
+
${se}
|
|
1491
|
+
`),Ci=Qe(ie.default`
|
|
1492
1492
|
mutation ControllerClient_updateModule(
|
|
1493
1493
|
$id: ID!
|
|
1494
1494
|
$name: String
|
|
@@ -1518,26 +1518,26 @@ export const __webpack_esm_id__=737;export const __webpack_esm_ids__=[737];expor
|
|
|
1518
1518
|
...moduleArguments
|
|
1519
1519
|
}
|
|
1520
1520
|
}
|
|
1521
|
-
${
|
|
1522
|
-
`),
|
|
1521
|
+
${se}
|
|
1522
|
+
`),Ti=Qe(ie.default`
|
|
1523
1523
|
mutation ControllerClient_moveModule($id: ID!, $workspaceId: ID!) {
|
|
1524
1524
|
moveModule(id: $id, workspaceId: $workspaceId) {
|
|
1525
1525
|
...moduleArguments
|
|
1526
1526
|
}
|
|
1527
1527
|
}
|
|
1528
|
-
${
|
|
1529
|
-
`),
|
|
1528
|
+
${se}
|
|
1529
|
+
`),xi=Qe(ie.default`
|
|
1530
1530
|
mutation ControllerClient_duplicateModule($id: ID!) {
|
|
1531
1531
|
duplicateModule(id: $id) {
|
|
1532
1532
|
...moduleArguments
|
|
1533
1533
|
}
|
|
1534
1534
|
}
|
|
1535
|
-
${
|
|
1536
|
-
`),
|
|
1535
|
+
${se}
|
|
1536
|
+
`),Ei=Qe(ie.default`
|
|
1537
1537
|
mutation ControllerClient_removeModule($id: ID!) {
|
|
1538
1538
|
removeModule(id: $id)
|
|
1539
1539
|
}
|
|
1540
|
-
`),
|
|
1540
|
+
`),Bi=Qe(ie.default`
|
|
1541
1541
|
mutation ControllerClient_createConfigChangeOperation(
|
|
1542
1542
|
$applicationId: ID!
|
|
1543
1543
|
$config: JSON!
|
|
@@ -1547,12 +1547,12 @@ export const __webpack_esm_id__=737;export const __webpack_esm_ids__=[737];expor
|
|
|
1547
1547
|
...operationArguments
|
|
1548
1548
|
}
|
|
1549
1549
|
}
|
|
1550
|
-
${
|
|
1551
|
-
`),
|
|
1550
|
+
${le}
|
|
1551
|
+
`),Ui=Qe(ie.default`
|
|
1552
1552
|
mutation ControllerClient_doOperation($id: ID!, $applicationId: ID!) {
|
|
1553
1553
|
doOperation(id: $id, applicationId: $applicationId)
|
|
1554
1554
|
}
|
|
1555
|
-
`),
|
|
1555
|
+
`),Ri=Qe(ie.default`
|
|
1556
1556
|
mutation ControllerClient_updateOperation(
|
|
1557
1557
|
$id: ID!
|
|
1558
1558
|
$applicationId: ID!
|
|
@@ -1563,12 +1563,12 @@ export const __webpack_esm_id__=737;export const __webpack_esm_ids__=[737];expor
|
|
|
1563
1563
|
...operationArguments
|
|
1564
1564
|
}
|
|
1565
1565
|
}
|
|
1566
|
-
${
|
|
1567
|
-
`),
|
|
1566
|
+
${le}
|
|
1567
|
+
`),Oi=Qe(ie.default`
|
|
1568
1568
|
mutation ControllerClient_removeOperation($id: ID!, $applicationId: ID!) {
|
|
1569
1569
|
removeOperation(id: $id, applicationId: $applicationId)
|
|
1570
1570
|
}
|
|
1571
|
-
`),Mi=
|
|
1571
|
+
`),Mi=Qe(ie.default`
|
|
1572
1572
|
mutation ControllerClient_assignGroupPermissions(
|
|
1573
1573
|
$roleId: String!
|
|
1574
1574
|
$instanceType: String!
|
|
@@ -1582,18 +1582,18 @@ export const __webpack_esm_id__=737;export const __webpack_esm_ids__=[737];expor
|
|
|
1582
1582
|
permissions: $permissions
|
|
1583
1583
|
)
|
|
1584
1584
|
}
|
|
1585
|
-
`),
|
|
1585
|
+
`),Pi=ie.default`
|
|
1586
1586
|
mutation ControllerClient_registerFCMNotification($workspaceId: ID!, $token: String!) {
|
|
1587
1587
|
registerFCMNotification(workspaceId: $workspaceId, token: $token)
|
|
1588
1588
|
}
|
|
1589
|
-
`,
|
|
1589
|
+
`,Fi=ie.default`
|
|
1590
1590
|
mutation ControllerClient_registerRemoteDebug($deviceId: ID!) {
|
|
1591
1591
|
registerRemoteDebug(deviceId: $deviceId) {
|
|
1592
1592
|
deviceId
|
|
1593
1593
|
token
|
|
1594
1594
|
}
|
|
1595
1595
|
}
|
|
1596
|
-
`,
|
|
1596
|
+
`,Ni=ie.default`
|
|
1597
1597
|
mutation ControllerClient_shareAccessToken(
|
|
1598
1598
|
$workspaceId: ID
|
|
1599
1599
|
$passcode: String!
|
|
@@ -1601,7 +1601,7 @@ export const __webpack_esm_id__=737;export const __webpack_esm_ids__=[737];expor
|
|
|
1601
1601
|
) {
|
|
1602
1602
|
shareAccessToken(workspaceId: $workspaceId, passcode: $passcode, refreshToken: $refreshToken)
|
|
1603
1603
|
}
|
|
1604
|
-
`,
|
|
1604
|
+
`,qi=Qe(ie.default`
|
|
1605
1605
|
mutation ControllerClient_addUserFavorite($instanceType: InstanceType!, $instanceId: ID!) {
|
|
1606
1606
|
addUserFavorite(instanceType: $instanceType, instanceId: $instanceId) {
|
|
1607
1607
|
_id
|
|
@@ -1614,11 +1614,11 @@ export const __webpack_esm_id__=737;export const __webpack_esm_ids__=[737];expor
|
|
|
1614
1614
|
last_modify_datetime
|
|
1615
1615
|
}
|
|
1616
1616
|
}
|
|
1617
|
-
`),
|
|
1617
|
+
`),Wi=Qe(ie.default`
|
|
1618
1618
|
mutation ControllerClient_removeUserFavorite($instanceType: InstanceType!, $instanceId: ID!) {
|
|
1619
1619
|
removeUserFavorite(instanceType: $instanceType, instanceId: $instanceId)
|
|
1620
1620
|
}
|
|
1621
|
-
`),
|
|
1621
|
+
`),ji=Qe(ie.default`
|
|
1622
1622
|
mutation ControllerClient_changeWorkspaceSubscriptionPlan(
|
|
1623
1623
|
$workspaceId: ID!
|
|
1624
1624
|
$type: String!
|
|
@@ -1626,7 +1626,7 @@ export const __webpack_esm_id__=737;export const __webpack_esm_ids__=[737];expor
|
|
|
1626
1626
|
) {
|
|
1627
1627
|
changeWorkspaceSubscriptionPlan(workspaceId: $workspaceId, type: $type, period: $period)
|
|
1628
1628
|
}
|
|
1629
|
-
`),
|
|
1629
|
+
`),Vi=Qe(ie.default`
|
|
1630
1630
|
mutation ControllerClient_changeWorkspaceAdditionalLimitSpending(
|
|
1631
1631
|
$workspaceId: ID!
|
|
1632
1632
|
$boundDevicesLimit: Float
|
|
@@ -1638,7 +1638,7 @@ export const __webpack_esm_id__=737;export const __webpack_esm_ids__=[737];expor
|
|
|
1638
1638
|
groupMembersLimit: $groupMembersLimit
|
|
1639
1639
|
)
|
|
1640
1640
|
}
|
|
1641
|
-
`),
|
|
1641
|
+
`),Yi=ie.default`
|
|
1642
1642
|
mutation ControllerClient_createWorkspaceOTP(
|
|
1643
1643
|
$workspaceId: ID!
|
|
1644
1644
|
$tokenTypes: [WorkspaceTokenType]!
|
|
@@ -1650,32 +1650,32 @@ export const __webpack_esm_id__=737;export const __webpack_esm_ids__=[737];expor
|
|
|
1650
1650
|
expired_datetime
|
|
1651
1651
|
}
|
|
1652
1652
|
}
|
|
1653
|
-
`,
|
|
1653
|
+
`,Ki=ie.default`
|
|
1654
1654
|
mutation ControllerClient_revokeWorkspaceOTP($id: ID!) {
|
|
1655
1655
|
revokeWorkspaceOTP(id: $id)
|
|
1656
1656
|
}
|
|
1657
|
-
`;function
|
|
1657
|
+
`;function Gi(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(e){}return(Gi=function(){return!!e})()}var Li=function(e){function i(e,t){var n,a,s,d;return L(this,i),a=this,d=[e,t,"/api/graphql",o,r],s=H(s=i),(n=z(a,Gi()?Reflect.construct(s,d||[],H(a).constructor):s.apply(a,d))).tokenType="user",n}return J(i,e),G(i)}(Ie),zi=_e,Hi=ne,Ji=oe,Xi=fe,Qi=se,Zi=de,et=$e,it=ve,tt=he,nt=ie.default`
|
|
1658
1658
|
query Workspace_workspace {
|
|
1659
1659
|
workspace {
|
|
1660
1660
|
...mcpWorkspaceArguments
|
|
1661
1661
|
}
|
|
1662
1662
|
}
|
|
1663
|
-
${
|
|
1664
|
-
`,
|
|
1663
|
+
${zi}
|
|
1664
|
+
`,at=ie.default`
|
|
1665
1665
|
query Workspace_applications($keyword: String, $paginate: Paginate) {
|
|
1666
1666
|
applications(keyword: $keyword, paginate: $paginate) {
|
|
1667
1667
|
...mcpApplicationShortArguments
|
|
1668
1668
|
}
|
|
1669
1669
|
}
|
|
1670
|
-
${
|
|
1671
|
-
`,
|
|
1670
|
+
${Xi}
|
|
1671
|
+
`,ot=ie.default`
|
|
1672
1672
|
query Workspace_application($id: ID!, $composed: Boolean, $debug: Boolean) {
|
|
1673
1673
|
application(id: $id, composed: $composed, debug: $debug) {
|
|
1674
1674
|
...applicationArguments
|
|
1675
1675
|
}
|
|
1676
1676
|
}
|
|
1677
|
-
${
|
|
1678
|
-
`,
|
|
1677
|
+
${Ji}
|
|
1678
|
+
`,rt=ie.default`
|
|
1679
1679
|
query Workspace_applicationByDevice(
|
|
1680
1680
|
$deviceId: ID!
|
|
1681
1681
|
$composeModule: Boolean
|
|
@@ -1691,43 +1691,43 @@ export const __webpack_esm_id__=737;export const __webpack_esm_ids__=[737];expor
|
|
|
1691
1691
|
...applicationArguments
|
|
1692
1692
|
}
|
|
1693
1693
|
}
|
|
1694
|
-
${
|
|
1695
|
-
`,
|
|
1694
|
+
${Ji}
|
|
1695
|
+
`,st=ie.default`
|
|
1696
1696
|
query Workspace_modules($keyword: String, $paginate: Paginate) {
|
|
1697
1697
|
modules(keyword: $keyword, paginate: $paginate) {
|
|
1698
1698
|
...moduleShortArguments
|
|
1699
1699
|
}
|
|
1700
1700
|
}
|
|
1701
|
-
${
|
|
1702
|
-
`,
|
|
1701
|
+
${Zi}
|
|
1702
|
+
`,dt=ie.default`
|
|
1703
1703
|
query Workspace_module($id: ID!) {
|
|
1704
1704
|
module(id: $id) {
|
|
1705
1705
|
...moduleArguments
|
|
1706
1706
|
}
|
|
1707
1707
|
}
|
|
1708
|
-
${
|
|
1709
|
-
`,
|
|
1708
|
+
${Qi}
|
|
1709
|
+
`,ct=ie.default`
|
|
1710
1710
|
query Workspace_devices($keyword: String, $paginate: Paginate) {
|
|
1711
1711
|
devices(keyword: $keyword, paginate: $paginate) {
|
|
1712
1712
|
...deviceArguments
|
|
1713
1713
|
}
|
|
1714
1714
|
}
|
|
1715
|
-
${
|
|
1716
|
-
`,
|
|
1715
|
+
${Hi}
|
|
1716
|
+
`,lt=ie.default`
|
|
1717
1717
|
query Workspace_device($id: ID) {
|
|
1718
1718
|
device(id: $id) {
|
|
1719
1719
|
...deviceArguments
|
|
1720
1720
|
}
|
|
1721
1721
|
}
|
|
1722
|
-
${
|
|
1723
|
-
`,pt=
|
|
1722
|
+
${Hi}
|
|
1723
|
+
`,pt=ie.default`
|
|
1724
1724
|
query Workspace_devicesByApplication($id: ID!) {
|
|
1725
1725
|
devicesByApplication(id: $id) {
|
|
1726
1726
|
...deviceArguments
|
|
1727
1727
|
}
|
|
1728
1728
|
}
|
|
1729
|
-
${
|
|
1730
|
-
`,
|
|
1729
|
+
${Hi}
|
|
1730
|
+
`,ut=ie.default`
|
|
1731
1731
|
query Workspace_deviceUsage($deviceId: ID, $startDate: Date, $endDate: Date) {
|
|
1732
1732
|
deviceUsage(deviceId: $deviceId, startDate: $startDate, endDate: $endDate) {
|
|
1733
1733
|
_id
|
|
@@ -1746,28 +1746,28 @@ export const __webpack_esm_id__=737;export const __webpack_esm_ids__=[737];expor
|
|
|
1746
1746
|
}
|
|
1747
1747
|
}
|
|
1748
1748
|
}
|
|
1749
|
-
`,
|
|
1749
|
+
`,mt=ie.default`
|
|
1750
1750
|
query Workspace_mediaWorkspace {
|
|
1751
1751
|
mediaWorkspace {
|
|
1752
1752
|
...workspaceMediaWorkspaceArguments
|
|
1753
1753
|
}
|
|
1754
1754
|
}
|
|
1755
|
-
${
|
|
1756
|
-
`,
|
|
1755
|
+
${et}
|
|
1756
|
+
`,_t=ie.default`
|
|
1757
1757
|
query Workspace_mediaBoxes {
|
|
1758
1758
|
mediaBoxes {
|
|
1759
1759
|
...workspaceMediaBoxArguments
|
|
1760
1760
|
}
|
|
1761
1761
|
}
|
|
1762
|
-
${
|
|
1763
|
-
`,
|
|
1762
|
+
${it}
|
|
1763
|
+
`,gt=ie.default`
|
|
1764
1764
|
query Workspace_mediaBox($boxId: ID!) {
|
|
1765
1765
|
mediaBox(id: $boxId) {
|
|
1766
1766
|
...workspaceMediaBoxArguments
|
|
1767
1767
|
}
|
|
1768
1768
|
}
|
|
1769
|
-
${
|
|
1770
|
-
`,
|
|
1769
|
+
${it}
|
|
1770
|
+
`,ft=ie.default`
|
|
1771
1771
|
query Workspace_mediaFiles(
|
|
1772
1772
|
$boxId: ID!
|
|
1773
1773
|
$includeTypes: [String]
|
|
@@ -1785,15 +1785,15 @@ export const __webpack_esm_id__=737;export const __webpack_esm_ids__=[737];expor
|
|
|
1785
1785
|
...workspaceMediaFileArguments
|
|
1786
1786
|
}
|
|
1787
1787
|
}
|
|
1788
|
-
${
|
|
1789
|
-
`,
|
|
1788
|
+
${tt}
|
|
1789
|
+
`,yt=ie.default`
|
|
1790
1790
|
query Workspace_mediaFile($id: ID!) {
|
|
1791
1791
|
mediaFile(id: $id) {
|
|
1792
1792
|
...workspaceMediaFileArguments
|
|
1793
1793
|
}
|
|
1794
1794
|
}
|
|
1795
|
-
${
|
|
1796
|
-
|
|
1795
|
+
${tt}
|
|
1796
|
+
`,$t=fe,vt=se,ht=ie.default`
|
|
1797
1797
|
mutation Workspace_createApplication(
|
|
1798
1798
|
$name: String
|
|
1799
1799
|
$description: String
|
|
@@ -1810,8 +1810,8 @@ export const __webpack_esm_id__=737;export const __webpack_esm_ids__=[737];expor
|
|
|
1810
1810
|
config
|
|
1811
1811
|
}
|
|
1812
1812
|
}
|
|
1813
|
-
${
|
|
1814
|
-
`,
|
|
1813
|
+
${$t}
|
|
1814
|
+
`,bt=ie.default`
|
|
1815
1815
|
mutation Workspace_updateApplication(
|
|
1816
1816
|
$id: ID!
|
|
1817
1817
|
$config: String
|
|
@@ -1831,8 +1831,8 @@ export const __webpack_esm_id__=737;export const __webpack_esm_ids__=[737];expor
|
|
|
1831
1831
|
has_unreleased_changes
|
|
1832
1832
|
}
|
|
1833
1833
|
}
|
|
1834
|
-
${
|
|
1835
|
-
`,
|
|
1834
|
+
${$t}
|
|
1835
|
+
`,It=ie.default`
|
|
1836
1836
|
mutation Workspace_bindApplication($id: ID!, $bindDevices: [ID], $deviceFrames: JSON) {
|
|
1837
1837
|
bindApplication(id: $id, bindDevices: $bindDevices, deviceFrames: $deviceFrames) {
|
|
1838
1838
|
_id
|
|
@@ -1843,7 +1843,7 @@ export const __webpack_esm_id__=737;export const __webpack_esm_ids__=[737];expor
|
|
|
1843
1843
|
}
|
|
1844
1844
|
}
|
|
1845
1845
|
}
|
|
1846
|
-
`,
|
|
1846
|
+
`,kt=ie.default`
|
|
1847
1847
|
mutation Workspace_unbindApplication($id: ID!, $unbindDevices: [ID]) {
|
|
1848
1848
|
bindApplication(id: $id, unbindDevices: $unbindDevices) {
|
|
1849
1849
|
_id
|
|
@@ -1854,7 +1854,7 @@ export const __webpack_esm_id__=737;export const __webpack_esm_ids__=[737];expor
|
|
|
1854
1854
|
}
|
|
1855
1855
|
}
|
|
1856
1856
|
}
|
|
1857
|
-
`,
|
|
1857
|
+
`,Dt=ie.default`
|
|
1858
1858
|
mutation Workspace_createModule(
|
|
1859
1859
|
$name: String
|
|
1860
1860
|
$description: String
|
|
@@ -1876,8 +1876,8 @@ export const __webpack_esm_id__=737;export const __webpack_esm_ids__=[737];expor
|
|
|
1876
1876
|
...moduleArguments
|
|
1877
1877
|
}
|
|
1878
1878
|
}
|
|
1879
|
-
${
|
|
1880
|
-
`,
|
|
1879
|
+
${vt}
|
|
1880
|
+
`,wt=ie.default`
|
|
1881
1881
|
mutation Workspace_updateModule(
|
|
1882
1882
|
$id: ID!
|
|
1883
1883
|
$config: String
|
|
@@ -1895,8 +1895,8 @@ export const __webpack_esm_id__=737;export const __webpack_esm_ids__=[737];expor
|
|
|
1895
1895
|
...moduleArguments
|
|
1896
1896
|
}
|
|
1897
1897
|
}
|
|
1898
|
-
${
|
|
1899
|
-
`,
|
|
1898
|
+
${vt}
|
|
1899
|
+
`,At=ie.default`
|
|
1900
1900
|
mutation Workspace_createMediaFileUploadRequest(
|
|
1901
1901
|
$name: String!
|
|
1902
1902
|
$description: String!
|
|
@@ -1927,7 +1927,7 @@ export const __webpack_esm_id__=737;export const __webpack_esm_ids__=[737];expor
|
|
|
1927
1927
|
}
|
|
1928
1928
|
}
|
|
1929
1929
|
}
|
|
1930
|
-
`,
|
|
1930
|
+
`,St=ie.default`
|
|
1931
1931
|
mutation Workspace_updateMediaFile(
|
|
1932
1932
|
$id: ID!
|
|
1933
1933
|
$name: String
|
|
@@ -1949,7 +1949,7 @@ export const __webpack_esm_id__=737;export const __webpack_esm_ids__=[737];expor
|
|
|
1949
1949
|
updatedAt
|
|
1950
1950
|
}
|
|
1951
1951
|
}
|
|
1952
|
-
`,
|
|
1952
|
+
`,Ct=ie.default`
|
|
1953
1953
|
mutation Workspace_updateMediaFiles(
|
|
1954
1954
|
$fileIds: [ID!]!
|
|
1955
1955
|
$name: String
|
|
@@ -1958,23 +1958,23 @@ export const __webpack_esm_id__=737;export const __webpack_esm_ids__=[737];expor
|
|
|
1958
1958
|
) {
|
|
1959
1959
|
updateMediaFiles(fileIds: $fileIds, name: $name, description: $description, userTags: $userTags)
|
|
1960
1960
|
}
|
|
1961
|
-
`,
|
|
1961
|
+
`,Tt=ie.default`
|
|
1962
1962
|
mutation Workspace_setMediaFileAsBoxPreview($id: ID!) {
|
|
1963
1963
|
setMediaFileAsBoxPreview(id: $id)
|
|
1964
1964
|
}
|
|
1965
|
-
`,
|
|
1965
|
+
`,xt=ie.default`
|
|
1966
1966
|
mutation Workspace_copyMediaFiles($fromBoxId: ID!, $toBoxId: ID!, $fileIds: [ID!]!) {
|
|
1967
1967
|
copyMediaFiles(fromBoxId: $fromBoxId, toBoxId: $toBoxId, fileIds: $fileIds)
|
|
1968
1968
|
}
|
|
1969
|
-
`,
|
|
1969
|
+
`,Et=ie.default`
|
|
1970
1970
|
mutation Workspace_deleteMediaFiles($boxId: ID!, $fileIds: [ID!]!) {
|
|
1971
1971
|
deleteMediaFiles(boxId: $boxId, fileIds: $fileIds)
|
|
1972
1972
|
}
|
|
1973
|
-
`,
|
|
1973
|
+
`,Bt=ie.default`
|
|
1974
1974
|
mutation Workspace_deleteMediaBoxFiles($boxId: ID!, $includeTypes: [String]) {
|
|
1975
1975
|
deleteMediaBoxFiles(boxId: $boxId, includeTypes: $includeTypes)
|
|
1976
1976
|
}
|
|
1977
|
-
`;function
|
|
1977
|
+
`;function Ut(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(e){}return(Ut=function(){return!!e})()}var Rt=function(e){function i(e,t){var n,a,o,r;return L(this,i),a=this,r=[e,t,"/api/graphql-workspace",s,d],o=H(o=i),(n=z(a,Ut()?Reflect.construct(o,r||[],H(a).constructor):o.apply(a,r))).tokenType="workspace",n}return J(i,e),G(i)}(Ie),Ot=t(19074),Mt=t(36054),Pt=t(5010),Ft=t(70807),Nt=t(42028),qt=t(35928),Wt=t(79556),jt=t(17681),Vt=t.n(jt),Yt=t(52067);const Kt=403,Gt=429;const Lt=ie.default`
|
|
1978
1978
|
fragment mediaWorkspaceArguments on MediaWorkspace {
|
|
1979
1979
|
__typename
|
|
1980
1980
|
id
|
|
@@ -1988,7 +1988,7 @@ export const __webpack_esm_id__=737;export const __webpack_esm_ids__=[737];expor
|
|
|
1988
1988
|
sizeLimit
|
|
1989
1989
|
aiFeaturesEnabled
|
|
1990
1990
|
}
|
|
1991
|
-
`,
|
|
1991
|
+
`,zt=ie.default`
|
|
1992
1992
|
fragment boxArguments on MediaBox {
|
|
1993
1993
|
__typename
|
|
1994
1994
|
id
|
|
@@ -2013,7 +2013,7 @@ export const __webpack_esm_id__=737;export const __webpack_esm_ids__=[737];expor
|
|
|
2013
2013
|
previewUrl
|
|
2014
2014
|
size
|
|
2015
2015
|
}
|
|
2016
|
-
`,
|
|
2016
|
+
`,Ht=ie.default`
|
|
2017
2017
|
fragment fileArguments on MediaFile {
|
|
2018
2018
|
__typename
|
|
2019
2019
|
id
|
|
@@ -2070,7 +2070,7 @@ export const __webpack_esm_id__=737;export const __webpack_esm_ids__=[737];expor
|
|
|
2070
2070
|
createdAt
|
|
2071
2071
|
updatedAt
|
|
2072
2072
|
}
|
|
2073
|
-
`,
|
|
2073
|
+
`,Jt=ie.default`
|
|
2074
2074
|
fragment fileShortArguments on MediaFile {
|
|
2075
2075
|
__typename
|
|
2076
2076
|
id
|
|
@@ -2118,35 +2118,35 @@ export const __webpack_esm_id__=737;export const __webpack_esm_ids__=[737];expor
|
|
|
2118
2118
|
createdAt
|
|
2119
2119
|
updatedAt
|
|
2120
2120
|
}
|
|
2121
|
-
`,
|
|
2121
|
+
`,Xt=e=>{const i=function({endpointURL:e,subscriptionEndpointURL:i,accessToken:t,boxId:n,passcode:a,origin:o,enableSubscription:r,enableRetry:s=!0,subscriptionOnConnectionOrError:d,onNetworkError:c=()=>{}}){const l=n&&a,p={};o&&(p.origin=o),l||(p.authorization=`Bearer ${t}`);const u=new Ft.z({uri:e,headers:p});let m,_,g,f;const y=()=>{f&&(clearTimeout(f),f=void 0)};r&&(m=(0,qt.UU)({url:i,lazy:!0,connectionParams:p,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 Nt.c(m));const $=Ot.C.from([(0,Wt.S)(({networkError:e,operation:i})=>{if(e){c(e,i);const t=e?.message||"";if("Aborted"===t||"AbortError"===e?.name||t.includes("Too many requests")||e?.response?.status===Gt||e?.statusCode===Gt||e?.status===Gt||"Timeout exceeded"===t||e?.timeout||e?.statusCode===Kt||e?.status===Kt)return new Mt.c(e=>e.complete())}}),s&&new Pt.z({attempts:{max:3,retryIf:e=>{const i="string"==typeof e?.message?e.message:"string"==typeof e?e:"";return!!e&&!i.includes("Too many requests")&&e?.response?.status!==Gt&&e?.statusCode!==Gt&&e?.status!==Gt&&e?.statusCode!==Kt&&e?.status!==Kt&&!e?.timeout&&"Timeout exceeded"!==i&&"Aborted"!==i&&"AbortError"!==e?.name}}}),new(Vt())(3e4),r?Ot.C.split(({query:e})=>{const{kind:i,operation:t}=(0,Yt.Vn)(e);return"OperationDefinition"===i&&"subscription"===t},_,u):u].filter(Boolean));return $.closeSubscriptionClient=()=>r&&m.dispose(),$}(e),t=new Z.D,n=new Q.R({link:i,cache:t,defaultOptions:{watchQuery:{fetchPolicy:"no-cache",errorPolicy:"ignore"},query:{fetchPolicy:"no-cache",errorPolicy:"all"}}});return n.close=()=>i.closeSubscriptionClient(),n},Qt=ie.default`
|
|
2122
2122
|
query MediaClient_workspaces {
|
|
2123
2123
|
mediaWorkspaces {
|
|
2124
2124
|
...mediaWorkspaceArguments
|
|
2125
2125
|
}
|
|
2126
2126
|
}
|
|
2127
|
-
${
|
|
2128
|
-
`,
|
|
2127
|
+
${Lt}
|
|
2128
|
+
`,Zt=ie.default`
|
|
2129
2129
|
query MediaClient_boxes($workspaceId: UUID, $filter: String) {
|
|
2130
2130
|
mediaBoxes(workspaceId: $workspaceId, filter: $filter) {
|
|
2131
2131
|
...boxArguments
|
|
2132
2132
|
}
|
|
2133
2133
|
}
|
|
2134
|
-
${
|
|
2135
|
-
`,
|
|
2134
|
+
${zt}
|
|
2135
|
+
`,en=ie.default`
|
|
2136
2136
|
query MediaClient_workspace($workspaceId: UUID!) {
|
|
2137
2137
|
mediaWorkspace(id: $workspaceId) {
|
|
2138
2138
|
...mediaWorkspaceArguments
|
|
2139
2139
|
}
|
|
2140
2140
|
}
|
|
2141
|
-
${
|
|
2142
|
-
`,
|
|
2141
|
+
${Lt}
|
|
2142
|
+
`,tn=ie.default`
|
|
2143
2143
|
query MediaClient_box($boxId: UUID!) {
|
|
2144
2144
|
mediaBox(boxId: $boxId) {
|
|
2145
2145
|
...boxArguments
|
|
2146
2146
|
}
|
|
2147
2147
|
}
|
|
2148
|
-
${
|
|
2149
|
-
`,
|
|
2148
|
+
${zt}
|
|
2149
|
+
`,nn=ie.default`
|
|
2150
2150
|
query MediaClient_files(
|
|
2151
2151
|
$boxId: UUID!
|
|
2152
2152
|
$includeTypes: [FileType!]
|
|
@@ -2164,29 +2164,29 @@ export const __webpack_esm_id__=737;export const __webpack_esm_ids__=[737];expor
|
|
|
2164
2164
|
...fileShortArguments
|
|
2165
2165
|
}
|
|
2166
2166
|
}
|
|
2167
|
-
${
|
|
2168
|
-
`,
|
|
2167
|
+
${Jt}
|
|
2168
|
+
`,an=ie.default`
|
|
2169
2169
|
query MediaClient_file($fileId: UUID!) {
|
|
2170
2170
|
mediaFile(fileId: $fileId) {
|
|
2171
2171
|
...fileArguments
|
|
2172
2172
|
}
|
|
2173
2173
|
}
|
|
2174
|
-
${
|
|
2175
|
-
`,
|
|
2174
|
+
${Ht}
|
|
2175
|
+
`,on=ie.default`
|
|
2176
2176
|
mutation MediaClient_createMediaWorkspace($name: String!, $description: String!) {
|
|
2177
2177
|
createMediaWorkspace(name: $name, description: $description) {
|
|
2178
2178
|
...mediaWorkspaceArguments
|
|
2179
2179
|
}
|
|
2180
2180
|
}
|
|
2181
|
-
${
|
|
2182
|
-
`,
|
|
2181
|
+
${Lt}
|
|
2182
|
+
`,rn=ie.default`
|
|
2183
2183
|
mutation MediaClient_updateMediaWorkspace($id: UUID!, $name: String, $description: String) {
|
|
2184
2184
|
updateMediaWorkspace(id: $id, name: $name, description: $description) {
|
|
2185
2185
|
...mediaWorkspaceArguments
|
|
2186
2186
|
}
|
|
2187
2187
|
}
|
|
2188
|
-
${
|
|
2189
|
-
`,
|
|
2188
|
+
${Lt}
|
|
2189
|
+
`,sn=ie.default`
|
|
2190
2190
|
mutation MediaClient_createMediaBox(
|
|
2191
2191
|
$name: String!
|
|
2192
2192
|
$description: String!
|
|
@@ -2204,15 +2204,15 @@ export const __webpack_esm_id__=737;export const __webpack_esm_ids__=[737];expor
|
|
|
2204
2204
|
...boxArguments
|
|
2205
2205
|
}
|
|
2206
2206
|
}
|
|
2207
|
-
${
|
|
2208
|
-
`,
|
|
2207
|
+
${zt}
|
|
2208
|
+
`,dn=ie.default`
|
|
2209
2209
|
mutation MediaClient_moveMediaBox($id: UUID!, $workspaceId: UUID) {
|
|
2210
2210
|
moveMediaBox(id: $id, workspaceId: $workspaceId) {
|
|
2211
2211
|
...boxArguments
|
|
2212
2212
|
}
|
|
2213
2213
|
}
|
|
2214
|
-
${
|
|
2215
|
-
`,
|
|
2214
|
+
${zt}
|
|
2215
|
+
`,cn=ie.default`
|
|
2216
2216
|
mutation MediaClient_updateMediaBox(
|
|
2217
2217
|
$id: UUID!
|
|
2218
2218
|
$name: String
|
|
@@ -2232,8 +2232,8 @@ export const __webpack_esm_id__=737;export const __webpack_esm_ids__=[737];expor
|
|
|
2232
2232
|
...boxArguments
|
|
2233
2233
|
}
|
|
2234
2234
|
}
|
|
2235
|
-
${
|
|
2236
|
-
`,
|
|
2235
|
+
${zt}
|
|
2236
|
+
`,ln=ie.default`
|
|
2237
2237
|
mutation MediaClient_requestFileUpload(
|
|
2238
2238
|
$name: String!
|
|
2239
2239
|
$description: String!
|
|
@@ -2255,8 +2255,8 @@ export const __webpack_esm_id__=737;export const __webpack_esm_ids__=[737];expor
|
|
|
2255
2255
|
...fileArguments
|
|
2256
2256
|
}
|
|
2257
2257
|
}
|
|
2258
|
-
${
|
|
2259
|
-
`,pn=
|
|
2258
|
+
${Ht}
|
|
2259
|
+
`,pn=ie.default`
|
|
2260
2260
|
mutation MediaClient_updateMediaFile(
|
|
2261
2261
|
$fileId: UUID!
|
|
2262
2262
|
$name: String!
|
|
@@ -2274,8 +2274,8 @@ export const __webpack_esm_id__=737;export const __webpack_esm_ids__=[737];expor
|
|
|
2274
2274
|
...fileArguments
|
|
2275
2275
|
}
|
|
2276
2276
|
}
|
|
2277
|
-
${
|
|
2278
|
-
`,
|
|
2277
|
+
${Ht}
|
|
2278
|
+
`,un=ie.default`
|
|
2279
2279
|
mutation MediaClient_updateMediaFiles(
|
|
2280
2280
|
$fileIds: [UUID!]!
|
|
2281
2281
|
$name: String
|
|
@@ -2284,19 +2284,19 @@ export const __webpack_esm_id__=737;export const __webpack_esm_ids__=[737];expor
|
|
|
2284
2284
|
) {
|
|
2285
2285
|
updateMediaFiles(fileIds: $fileIds, name: $name, description: $description, userTags: $userTags)
|
|
2286
2286
|
}
|
|
2287
|
-
`,
|
|
2287
|
+
`,mn=ie.default`
|
|
2288
2288
|
mutation MediaClient_deleteMediaFiles($boxId: UUID!, $list: [UUID!]!) {
|
|
2289
2289
|
deleteMediaFiles(boxId: $boxId, list: $list)
|
|
2290
2290
|
}
|
|
2291
|
-
`,
|
|
2291
|
+
`,_n=ie.default`
|
|
2292
2292
|
mutation MediaClient_copyMediaFiles($fromBoxId: UUID!, $toBoxId: UUID!, $list: [UUID!]!) {
|
|
2293
2293
|
copyMediaFiles(fromBoxId: $fromBoxId, toBoxId: $toBoxId, list: $list)
|
|
2294
2294
|
}
|
|
2295
|
-
`,
|
|
2295
|
+
`,gn=ie.default`
|
|
2296
2296
|
mutation MediaClient_setMediaFileAsBoxPreview($id: UUID!) {
|
|
2297
2297
|
setMediaFileAsBoxPreview(id: $id)
|
|
2298
2298
|
}
|
|
2299
|
-
`,
|
|
2299
|
+
`,fn=ie.default`
|
|
2300
2300
|
mutation MediaClient_assignGroupPermissions(
|
|
2301
2301
|
$roleId: String!
|
|
2302
2302
|
$instanceType: InstanceType!
|
|
@@ -2310,7 +2310,7 @@ export const __webpack_esm_id__=737;export const __webpack_esm_ids__=[737];expor
|
|
|
2310
2310
|
permissions: $permissions
|
|
2311
2311
|
)
|
|
2312
2312
|
}
|
|
2313
|
-
`,
|
|
2313
|
+
`,yn=ie.default`
|
|
2314
2314
|
subscription MediaClient_listenBoxChanged($boxId: UUID!, $types: [ChangeType!]) {
|
|
2315
2315
|
mediaBoxChanged(boxId: $boxId, types: $types) {
|
|
2316
2316
|
createType
|
|
@@ -2324,15 +2324,15 @@ export const __webpack_esm_id__=737;export const __webpack_esm_ids__=[737];expor
|
|
|
2324
2324
|
}
|
|
2325
2325
|
}
|
|
2326
2326
|
}
|
|
2327
|
-
${
|
|
2328
|
-
|
|
2327
|
+
${Ht}
|
|
2328
|
+
`,$n=ie.default`
|
|
2329
2329
|
query MediaClient_box($boxId: UUID!, $passcode: String!) {
|
|
2330
2330
|
mediaBox(boxId: $boxId, passcode: $passcode) {
|
|
2331
2331
|
...boxArguments
|
|
2332
2332
|
}
|
|
2333
2333
|
}
|
|
2334
|
-
${
|
|
2335
|
-
|
|
2334
|
+
${zt}
|
|
2335
|
+
`,vn=ie.default`
|
|
2336
2336
|
query MediaClient_files(
|
|
2337
2337
|
$boxId: UUID!
|
|
2338
2338
|
$passcode: String!
|
|
@@ -2352,15 +2352,15 @@ export const __webpack_esm_id__=737;export const __webpack_esm_ids__=[737];expor
|
|
|
2352
2352
|
...fileShortArguments
|
|
2353
2353
|
}
|
|
2354
2354
|
}
|
|
2355
|
-
${
|
|
2356
|
-
`,
|
|
2355
|
+
${Jt}
|
|
2356
|
+
`,hn=ie.default`
|
|
2357
2357
|
query MediaClient_file($fileId: UUID!, $passcode: String!) {
|
|
2358
2358
|
mediaFile(fileId: $fileId, passcode: $passcode) {
|
|
2359
2359
|
...fileArguments
|
|
2360
2360
|
}
|
|
2361
2361
|
}
|
|
2362
|
-
${
|
|
2363
|
-
`,
|
|
2362
|
+
${Ht}
|
|
2363
|
+
`,bn=ie.default`
|
|
2364
2364
|
mutation MediaClient_requestFileUpload(
|
|
2365
2365
|
$name: String!
|
|
2366
2366
|
$description: String!
|
|
@@ -2384,8 +2384,8 @@ export const __webpack_esm_id__=737;export const __webpack_esm_ids__=[737];expor
|
|
|
2384
2384
|
...fileArguments
|
|
2385
2385
|
}
|
|
2386
2386
|
}
|
|
2387
|
-
${
|
|
2388
|
-
`,
|
|
2387
|
+
${Ht}
|
|
2388
|
+
`,In=ie.default`
|
|
2389
2389
|
mutation MediaClient_updateMediaFile(
|
|
2390
2390
|
$boxId: UUID!
|
|
2391
2391
|
$passcode: String!
|
|
@@ -2407,8 +2407,8 @@ export const __webpack_esm_id__=737;export const __webpack_esm_ids__=[737];expor
|
|
|
2407
2407
|
...fileArguments
|
|
2408
2408
|
}
|
|
2409
2409
|
}
|
|
2410
|
-
${
|
|
2411
|
-
`,
|
|
2410
|
+
${Ht}
|
|
2411
|
+
`,kn=ie.default`
|
|
2412
2412
|
mutation MediaClient_updateMediaFiles(
|
|
2413
2413
|
$boxId: UUID!
|
|
2414
2414
|
$passcode: String!
|
|
@@ -2426,11 +2426,11 @@ export const __webpack_esm_id__=737;export const __webpack_esm_ids__=[737];expor
|
|
|
2426
2426
|
userTags: $userTags
|
|
2427
2427
|
)
|
|
2428
2428
|
}
|
|
2429
|
-
`,
|
|
2429
|
+
`,Dn=ie.default`
|
|
2430
2430
|
mutation MediaClient_deleteMediaFiles($boxId: UUID!, $passcode: String!, $list: [UUID!]!) {
|
|
2431
2431
|
deleteMediaFiles(boxId: $boxId, passcode: $passcode, list: $list)
|
|
2432
2432
|
}
|
|
2433
|
-
`,
|
|
2433
|
+
`,wn=ie.default`
|
|
2434
2434
|
subscription MediaClient_listenBoxChanged(
|
|
2435
2435
|
$boxId: UUID!
|
|
2436
2436
|
$passcode: String!
|
|
@@ -2448,5 +2448,5 @@ export const __webpack_esm_id__=737;export const __webpack_esm_ids__=[737];expor
|
|
|
2448
2448
|
}
|
|
2449
2449
|
}
|
|
2450
2450
|
}
|
|
2451
|
-
${
|
|
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.24.8";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)}}};
|
|
2451
|
+
${Ht}
|
|
2452
|
+
`,An={query:"query",mutation:"mutate"},Sn=(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[An[i]](c);({data:s,errors:d}=t||{})}if(d)throw new Error(d.map(e=>e.message).join("\n"));return s?s[n]:null}},Cn=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)},Tn=(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`),Xt({endpointURL:c,subscriptionEndpointURL:c.replace("http:","ws:"),accessToken:i,enableSubscription:!d&&a,enableRetry:o,subscriptionOnConnectionOrError:r,onNetworkError:s})})(e);if(e.boxId&&e.passcode){i.type="passcode",i.queries=p,i.mutations=u;const t={boxId:e.boxId,passcode:e.passcode};Object.entries(p).forEach(Sn(i,"query",t)),Object.entries(u).forEach(Sn(i,"mutation",t)),i.listenBoxChanged=(e,n)=>{const a=i.subscribe({query:wn,variables:{...t,...e}}).subscribe({next:Cn(n),error(e){n(e)}});return a}}else i.accessToken=e.accessToken,i.type="token",i.queries=c,i.mutations=l,Object.entries(c).forEach(Sn(i,"query")),Object.entries(l).forEach(Sn(i,"mutation")),i.listenBoxChanged=(e,t)=>{const n=i.subscribe({query:yn,variables:e}).subscribe({next:Cn(t),error(e){t(e)}});return n};return i};var xn,En,Bn,Un,Rn=G(function e(i,t){L(this,e),this.baseUrl=i,this.token=t,this.graphqlUrl=`${i}/api/graphql`},[{key:"graphql",value:(Un=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 Un.apply(this,arguments)})},{key:"events",value:(Bn=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 Bn.apply(this,arguments)})},{key:"screenshots",value:(En=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 En.apply(this,arguments)})},{key:"downloadScreenshot",value:(xn=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 xn.apply(this,arguments)})}]);function On(e,i,t){switch(t){case"user":return new Li(e,i);case"workspace":return new Rt(e,i);default:throw new Error(`Invalid token type: ${t}.`)}}process.env.STAGE,process.env.URL_BASE;var Mn="bricks-mcp",Pn={bricks:process.env.BRICKS_API_SERVER||"https://display-beta.bricks.tools",media:process.env.MEDIA_API_SERVER||"https://media-beta.bricks.tools",activityLog:process.env.ACTIVITY_LOG_API_SERVER||"https://activity-log-beta.bricks.tools"},Fn=(process.env.AUTH0_DOMAIN,process.env.CACHE_URL,t(17199));const Nn=({type:e,title:i,template_key:t})=>{var n,a,o=(0,Fn.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=N(F.Ji);n={title:i,item_list:[],property:{$definitions:Object.fromEntries(Object.entries(r.propTypes).map(([e,i])=>[e,{...i,description:r.brickPropDescriptions[e]}]))},event_map:{$definitions:Object.fromEntries(Object.entries(r.eventTypes).map(([e])=>[e,{description:r.brickEventDescriptions[e]}]))}},a={property_bank_map:{[(0,Fn.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=N(F.dK.Basic),d=N(F.eW[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:{}};break;case"generator":var l=N(F.wj[t]);if(!l)throw new Error(`Generator ${t} not found`);n={title:i,template_key:t,property:{$definitions:Object.fromEntries(Object.entries(l.propTypes).map(([e,i])=>[e,{...i,description:l.brickPropDescriptions[e]}]))},event_map:{$definitions:Object.fromEntries(Object.entries(l.eventTypes).map(([e])=>[e,{description:l.brickEventDescriptions[e]}]))},outlet:{$definitions:Object.fromEntries(Object.entries(l.outletTypes).map(([e])=>[e,{description:l.brickOutletDescriptions[e]}]))}};break;case"animation":n={title:i,type:"timing|decay|spring",property:"opacity|transform.translateX|transform.scale|etc",config:{$note:"Config for the animation"},compose_type:"parallel|sequence",item_list:[{animation_id:"ANIMATION_<SUB ANIMATION UUID>"}]};break;case"property_bank":n={title:i,description:"Property Bank Description",linkedFrom:"SUBSPACE_<UUID WHICH IS CROSS SUBSPACE>",type:"string|number|bool|object|array|any",kind:"color|datetime|id|media-resource-*|lottie-file-uri",unit:"grid|px|ms",routing:"read-only|default",value:"fit-to-type",event_map:{$note:`Available events: ${Object.keys(F.qJ.eventTypes).join(", ")}`},local_sync:{update_mode:"all|main-only|minor-only|dont-sync"},$remote_update_additional:{$note:"Configure remote update behavior",enable_remote_update:!0,bank_type:"create|create-device-specific"}};break;case"property_bank_command":break;case"property_bank_calc":var p=(0,Fn.makeId)("property_bank_command"),u=(0,Fn.makeId)("property_bank_command"),m=(0,Fn.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> | ${p}`,port:"obj | inputs"}]}},"PROPERTY_BANK_COMMAND_NODE_<UUID SECOND>":{type:"command-node-object",title:"Command: OBJECT_SET",properties:{command:"OBJECT_SET",args:{path:"arg_name"}},in:{obj:[{id:"PROPERTY_BANK_COMMAND_NODE_<UUID PREVIOUS>",port:"result"}],path:null,value:[{id:"PROPERTY_BANK_DATA_NODE_<UUID SECOND>",port:"value"}]},out:{result:[{id:`PROPERTY_BANK_COMMAND_NODE_<UUID NEXT> | ${p}`,port:"obj | inputs"}]}},[p]:{type:"command-node-sandbox",title:"Command: SANDBOX_RUN_JAVASCRIPT",properties:{command:"SANDBOX_RUN_JAVASCRIPT",args:{code:_,enable_async:!1}},in:{code:null,inputs:[{id:"PROPERTY_BANK_COMMAND_NODE_<UUID FINAL>",port:"result"}]},out:{result:[{id:m,port:"result"},{id:u,port:"result"}]}},[m]:{type:"command-node-sandbox",title:"Command: SANDBOX_GET_ERROR",properties:{command:"SANDBOX_GET_ERROR"},in:{result:[{id:p,port:"result"}]},out:{result:[{id:"PROPERTY_BANK_DATA_NODE_<UUID RECEIVE ERROR>",port:"change"}],$note:"Set `result` as null if there is no error"}},[u]:{type:"command-node-sandbox",title:"Command: SANDBOX_GET_RETURN_VALUE",properties:{command:"SANDBOX_GET_RETURN_VALUE"},in:{result:[{id:p,port:"result"}]},out:{result:[{id:"PROPERTY_BANK_DATA_NODE_<UUID RECEIVE RESULT> | PROPERTY_BANK_COMMAND_NODE_<UUID PARSE RESULT> | null",port:"change"}]}},"PROPERTY_BANK_DATA_NODE_<UUID RECEIVE RESULT>":{type:"data-node",properties:{},in:{change:[{id:u,port:"result"}]},out:{value:null},$note:"Put full result into data node"},"PROPERTY_BANK_COMMAND_NODE_<UUID PARSE RESULT>":{type:"command-node-object",title:"Command: OBJECT_GET",properties:{command:"OBJECT_GET",args:{path:"obj_key"}},in:{obj:[{id:u,port:"obj"}]},out:{result:[{id:"PROPERTY_BANK_DATA_NODE_<UUID RECEIVE PARTIAL RESULT>",port:"change"}]},$note:"Parse result object into data node"},"PROPERTY_BANK_DATA_NODE_<UUID RECEIVE PARTIAL RESULT>":{type:"data-node",properties:{},in:{change:[{id:"PROPERTY_BANK_COMMAND_NODE_<UUID PARSE RESULT>",port:"result"}]},out:{value:null},$note:"Put partial result into data node"}},editor_info:{},type:"script",script_config:{title:i,enable_async:!1,inputs:{"PROPERTY_BANK_DATA_NODE_<UUID>":"arg_name"},disabled_triggers:{},error:"PROPERTY_BANK_DATA_NODE_<UUID RECEIVE ERROR> | null",output:"PROPERTY_BANK_DATA_NODE_<UUID RECEIVE RESULT> | null",outputs:{obj_key:"PROPERTY_BANK_DATA_NODE_<UUID RECEIVE PARTIAL RESULT>"},code:_,$note:"Required, info for GUI editor"}}}return D({id:o,example:n,extraInfo:a})};function qn(e,i){var t,n,a,o,r,s,d,c,l,p,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)=>{K(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 Tn({endpoint:i,accessToken:t,enableSubscription:!1,enableRetry:!0})}({endpoint:Pn.media,accessToken:i.token}):W;if(F&&e.tool("list_workspaces","List all workspaces",{},m(function*(){return D(yield W.workspaces())})),N({name:"get_workspace_overview",description:"Get comprehensive overview of the BRICKS workspace including stats and summary",inputSchema:q({}),permission:"info"},(t=m(function*({workspace_id:e}){var i=yield Promise.all([W.workspace({id:e}),W.applications({workspaceId:e,paginate:{limit:50,offset:0}}),W.modules({workspaceId:e,paginate:{limit:50,offset:0}}),W.devices({workspaceId:e,paginate:{limit:50,offset:0}}),F?j.mediaWorkspace({workspaceId:e}).catch(()=>null):j.mediaWorkspace().catch(()=>null),F?j.mediaBoxes({workspaceId:e}).catch(()=>[]):j.mediaBoxes().catch(()=>[])]),t=w(i,6),n=t[0],a=t[1],o=t[2],r=t[3],s=t[4],d=t[5];if(!n)throw new Error("Authentication failed, please check your token");return D({workspace:n,stats:{applications:a?.length??"No permission",modules:o?.length??"No permission",devices:r?.length??"No permission",running_apps:a?.filter(e=>e.status?.running).length??"No permission",media_boxes:d?.length??"No permission",media_enabled:!!s,notes:"Note: The stats are based on the first 50 applications, modules, and devices in the workspace."},recent_activity:{latest_apps:a?.slice(0,5).map(e=>({id:e._id,name:e.name,status:e.status?.running?"running":"stopped",last_update:e.last_modify_datetime}))||[]},media_info:s?{workspace_id:s.id,name:s.name,size_used:s.size,size_limit:s.sizeLimit,boxes:d?.slice(0,5).map(e=>({id:e.id,name:e.name,size:e.size,description:e.description}))||[]}:{enabled:!1,note:"Media workspace is not enabled for this workspace"}})}),function(e){return t.apply(this,arguments)})),N({name:"get_applications",description:"List all applications in the workspace",inputSchema:q({limit:b.ai().describe("Maximum number of applications to return").optional().default(50),offset:b.ai().describe("Number of applications to skip").optional().default(0)}),permission:"query_application"},(n=m(function*({workspace_id:e,limit:i=50,offset:t=0}){return D(yield W.applications({workspaceId:e,paginate:{limit:i,offset:t}}))}),function(e){return n.apply(this,arguments)})),N({name:"get_application",description:"Get detailed info and config of a specific application",inputSchema:q({id:b.Yj().describe("Application ID")}),permission:"query_application"},(a=m(function*({workspace_id:e,id:i}){return D(yield W.application({workspaceId:e,id:i}))}),function(e){return a.apply(this,arguments)})),N({name:"get_modules",description:"List all modules in the workspace",inputSchema:q({limit:b.ai().describe("Maximum number of modules to return").optional().default(50),offset:b.ai().describe("Number of modules to skip").optional().default(0)}),permission:"query_module"},(o=m(function*({workspace_id:e,limit:i=50,offset:t=0}){return D(yield W.modules({workspaceId:e,paginate:{limit:i,offset:t}}))}),function(e){return o.apply(this,arguments)})),N({name:"get_module",description:"Get detailed info and config of a specific module",inputSchema:q({id:b.Yj().describe("Module ID")}),permission:"query_module"},(r=m(function*({workspace_id:e,id:i}){return D(yield W.module({workspaceId:e,id:i}))}),function(e){return r.apply(this,arguments)})),N({name:"update_module_info",description:"Update a specific module info",inputSchema:q({id:b.Yj().describe("Module ID"),name:b.Yj().describe("Module name"),description:b.Yj().describe("Module description")}),permission:"update_module"},(s=m(function*({workspace_id:e,id:i,name:t,description:n}){return D(yield W.updateModule({workspaceId:e,id:i,name:t,description:n}))}),function(e){return s.apply(this,arguments)})),N({name:"update_module_config",description:"Update a specific module configuration",inputSchema:q({id:b.Yj().describe("Module ID"),config:b.Ik({}).passthrough().describe("New configuration object, see file://docs/config-schema.md for schema reference")}),permission:"update_module"},(d=m(function*({workspace_id:e,id:i,config:t}){var n=yield M(t);if(!n.valid)throw new Error(`Config validation failed: ${n.errors.join(", ")}`);return D(yield W.updateModule({workspaceId:e,id:i,config:JSON.stringify(t),validateConfig:!0}))}),function(e){return d.apply(this,arguments)})),N({name:"get_devices",description:"List all devices in the workspace",inputSchema:q({limit:b.ai().describe("Maximum number of devices to return").optional().default(50),offset:b.ai().describe("Number of devices to skip").optional().default(0)}),permission:"query_device"},(c=m(function*({workspace_id:e,limit:i=50,offset:t=0}){return D(yield W.devices({workspaceId:e,paginate:{limit:i,offset:t}}))}),function(e){return c.apply(this,arguments)})),N({name:"create_application",description:"Create a new BRICKS application with default grid layout",inputSchema:q({name:b.Yj().describe("Application name"),description:b.Yj().describe("Application description").optional(),grid_width:b.ai().describe("Grid width in units").optional().default(96),grid_height:b.ai().describe("Grid height in units").optional().default(54)}),permission:"create_application"},(l=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 l.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"},(p=m(function*({id:e,name:i,description:t}){return D(yield W.updateApplication({id:e,name:i,description:t}))}),function(e){return p.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,bindDevices:i.map(e=>e.device_id),deviceFrames:i.reduce((e,i)=>({...e,[i.device_id]:{x:i.x,y:i.y,width:i.width,height:i.height,rotate:i.rotate,rotateType:i.rotateType}}),{})}))}),function(e){return _.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")||"application/octet-stream",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:{}}),l=!1;try{var p=JSON.parse(c?.meta.uploadInfo),u=new FormData;u.append("file",d),u.append("Content-Type",s),u.append("AWSAccessKeyId",p.AWSAccessKeyId),u.append("Signature",p.Signature),u.append("Policy",p.Policy),u.append("acl",p.acl),u.append("key",p.key),l=yield(0,A.Ay)(p.url,{method:"POST",body:u}).then(e=>e.ok).catch(()=>!1)}catch{l=!1}return D({file_id:c.id,upload_success:l,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")},Nn),e.tool("getting_started","Get documentation content for getting started",{},m(function*(){return D(Y)})),!F){var V=()=>{return e=Pn.activityLog,t=i.token,new Rn(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=V(),l={start_time:e,end_time:i};t&&(l.device_id=t),n&&(l.event_type=n),a&&(l.event_name=a),o&&(l.subspace_id=o),r&&(l.sender=r);var p=yield c.events(l,{limit:s,offset:d});return D(p)}),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=V(),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=V(),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 Wn="2.24.10";function jn(){return Vn.apply(this,arguments)}function Vn(){return Vn=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:Wn}),r={...t,client:On(Pn.bricks,t.token,t.tokenType)};(n=o).prompt("getting-started","Getting started with BRICKS",{},m(function*(){return{messages:[{role:"user",content:{type:"text",text:'Welcome to BRICKS — start here.\n\nBefore doing any complex work (application design, deployments, etc.),\nalways consult the official docs rather than guessing.\n\nIMPORTANT: BRICKS users interact through a GUI editor, not raw config files.\nNever show users JSON config details, schema fields, or technical implementation.\nFocus on user-friendly descriptions of what the app will do and how it will look.\n\nGolden rules for working with BRICKS:\n1) Read before you act\n - Open these resources first, then proceed:\n - `getting-started` — overview & architecture\n - `config-schema` — canonical schema for apps, subspaces, bricks, generators, etc.\n - `components-index` — available bricks/generators\n2) Source of truth\n - Rely on the docs above; do not invent fields not present in the schema\n3) No guessing\n - If names, constraints, or device details are missing, ask to fetch them first\n4) Plan then execute\n - Propose a clear step-by-step plan and wait for approval before writing or mutating data\n5) User-friendly communication\n - Describe features in terms of what users see and do, not technical config\n - Use visual/functional language: "text display", "button", "screen transition"\n - Avoid exposing JSON, IDs, or schema details to end users\n\nBRICKS essentials:\n- Applications: interactive digital signage experiences\n- Devices: deployment targets (screens/players)\n- Modules: Reusable module across applications\n- Grid system: default 96×54; 1 unit = device_width/96 (e.g., 20px at 1920×1080)\n- Key primitives: Subspaces, Canvas, Bricks, Generators, Property Banks (Data)\n\nQuick actions:\n- "Create a new application" → use the `create-application` prompt\n- "Deploy an application to a device" → use the `deploy-to-device` prompt\n\nTry asking:\n- "Draft a plan to create an app with a text display and deploy it; ask any missing questions first"'}}]}})),n.prompt("create-application","Create a new BRICKS application with guided setup",{app_name:b.Yj().describe("Name for the new application"),description:b.Yj().describe("Short description for the new application").optional()},(a=m(function*(e){var i=e?.app_name||"New Application",t=e?.description||"";return{messages:[{role:"user",content:{type:"text",text:`Help me create a new BRICKS application called "${i}".\n\n${t?`Goal: ${t}`:""}\n\nIMPORTANT: Users see a visual GUI editor, not raw config. Describe features in user-friendly terms:\n- "text display" not "BRICK_TEXT"\n- "image" not "BRICK_IMAGE"\n- "canvas name" not "CANVAS_xxx"\n- "data storage" not "PROPERTY_BANK"\n- Focus on what users see and do, not technical implementation\n\nHow we'll proceed (no guessing, schema-first):\n1) Confirm intent\n - Restate objectives and success criteria in 1–3 bullets\n2) Consult docs (as needed)\n - getting-started, config-schema, components-index\n - Ensure proposed fields exist in the schema\n3) Ask missing questions before changes\n - Target device(s) and resolution(s)\n - Layout needs (pages/screens), content types, data sources\n - Localization, scheduling, or interaction needs\n4) Propose a minimal viable design (After confirming intent)\n - App structure: screens → visual elements\n - Initial component selection with rationale\n - Grid usage: default 96×54 (≈20px at 1920×1080)\n5) Produce a schema-valid skeleton (no side effects yet)\n - Include only fields defined by config-schema\n - Use clear placeholders for text/assets/URLs/ids\n\nWhat I'll produce first:\n- Short recap of requirements\n- Clarifying questions (only what's necessary)\n- High-level architecture plan\n- Minimal config skeleton that validates against the schema`}}]}}),function(e){return a.apply(this,arguments)})),function(e){e.resource("getting-started-docs","file://docs/getting-started.md",{mimeType:"text/markdown",title:"Getting Started with BRICKS",description:"Comprehensive guide to BRICKS architecture, concepts, and development workflow"},m(function*(){return D(I,{uri:"file://docs/getting-started.md",mimeType:"text/markdown"})}))}(o),qn(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${Wn}`),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}}),Vn.apply(this,arguments)}}};
|