@fugood/bricks-cli 2.25.0-beta.25 → 2.25.0-beta.30
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/10.js +1 -1
- package/lib/117.js +231 -231
- package/lib/178.js +1 -1
- package/lib/index.js +3 -3
- package/package.json +2 -2
package/lib/117.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
export const __rspack_esm_id=117;export const __rspack_esm_ids=[117];export const __webpack_modules__={98372(e,i,t){t.r(i),t.d(i,{startStdioServer:()=>t0});var n,a,o,r,s,d,c={};t.r(c),t.d(c,{lI:()=>ed,F3:()=>er,mJ:()=>es,AW:()=>eu,$V:()=>el,J6:()=>ep,Wt:()=>em,qq:()=>ec,gw:()=>e_,Yi:()=>eo});var l={};t.r(l),t.d(l,{applicationFragment:()=>ed,applicationShortFragment:()=>ey,deviceFragment:()=>er,deviceGroupFragment:()=>es,deviceShortFragment:()=>e$,instanceVersionFragment:()=>eu,mediaBoxFragment:()=>eh,mediaFileFragment:()=>eb,mediaWorkspaceFragment:()=>ev,moduleFragment:()=>el,moduleShortFragment:()=>ep,operationFragment:()=>em,publicApplicationBasicInfoFragment:()=>ec,userFavoriteFragment:()=>e_,workspaceFragment:()=>eg,workspaceShortFragment:()=>ef});var p={};t.r(p),t.d(p,{application:()=>eK,applicationByDevice:()=>eP,applicationReleaseVersion:()=>eU,applicationReleaseVersions:()=>eE,applicationTestsByDevice:()=>eO,applications:()=>eY,checkBindDevicePasscode:()=>eF,deviceUsage:()=>eL,devices:()=>eG,devicesByGroup:()=>eq,devicesByUniqueId:()=>eN,me:()=>ew,module:()=>eC,moduleReleaseVersion:()=>eR,moduleReleaseVersions:()=>eM,modules:()=>eT,publicModules:()=>ex,publicModulesByIdList:()=>eB,workspace:()=>ej,workspacePricingPlans:()=>eW,workspaces:()=>eV});var u={};t.r(u),t.d(u,{addUserFavorite:()=>iC,assignGroupPermissions:()=>iD,bindApplication:()=>ia,bindApplicationWithDeviceGroup:()=>is,changeWorkspaceAdditionalLimitSpending:()=>iB,changeWorkspaceSubscriptionPlan:()=>ix,controlDevice:()=>e2,createApplication:()=>ie,createApplicationWithShareVersion:()=>ii,createConfigChangeOperation:()=>ih,createDevice:()=>eQ,createDeviceGroup:()=>e5,createDeviceGroupWithApp:()=>il,createModule:()=>i_,createVirtualDevice:()=>eZ,createWorkspace:()=>eH,createWorkspaceOTP:()=>iE,dispatchDeviceGroupAction:()=>e3,doOperation:()=>ib,duplicateApplication:()=>iu,duplicateModule:()=>i$,forkApplication:()=>ip,moveApplication:()=>ic,moveDevice:()=>e1,moveModule:()=>iy,registerFCMNotification:()=>iA,registerRemoteDebug:()=>iS,removeApplication:()=>im,removeDevice:()=>e6,removeDeviceGroup:()=>e8,removeModule:()=>iv,removeOperation:()=>ik,removeUserFavorite:()=>iT,removeWorkspace:()=>e7,revokeWorkspaceOTP:()=>iU,shareAccessToken:()=>iw,shareApplication:()=>id,toggleShortEditApplication:()=>io,updateApplication:()=>it,updateApplicationViewportPreset:()=>ir,updateDevice:()=>e0,updateDeviceGroup:()=>e9,updateModule:()=>ig,updateOperation:()=>iI,updateVirtualDevice:()=>e4,updateWorkspace:()=>eJ,updateWorkspaceTokens:()=>eX});var m={};t.r(m),t.d(m,{application:()=>iF,applicationByDevice:()=>iN,applications:()=>iO,device:()=>iV,deviceUsage:()=>iK,devices:()=>ij,devicesByApplication:()=>iY,mediaBox:()=>iz,mediaBoxes:()=>iL,mediaFile:()=>iJ,mediaFiles:()=>iH,mediaWorkspace:()=>iG,module:()=>iW,modules:()=>iq,workspace:()=>iP});var _={};t.r(_),t.d(_,{bindApplication:()=>iZ,copyMediaFiles:()=>i3,createApplication:()=>iX,createModule:()=>i1,deleteMediaBoxFiles:()=>i7,deleteMediaFiles:()=>i8,requestFileUpload:()=>i6,setMediaFileAsBoxPreview:()=>i9,unbindApplication:()=>i0,updateApplication:()=>iQ,updateMediaFile:()=>i2,updateMediaFiles:()=>i5,updateModule:()=>i4});var g={};t.r(g),t.d(g,{mediaBox:()=>tv,mediaBoxes:()=>ty,mediaFile:()=>tb,mediaFiles:()=>th,mediaWorkspace:()=>t$,mediaWorkspaces:()=>tf});var f={};t.r(f),t.d(f,{assignGroupPermissions:()=>tU,copyMediaFiles:()=>tB,createMediaBox:()=>tD,createMediaWorkspace:()=>tI,deleteMediaFiles:()=>tx,moveMediaBox:()=>tA,requestFileUpload:()=>tw,setMediaFileAsBoxPreview:()=>tE,updateMediaBox:()=>tS,updateMediaFile:()=>tC,updateMediaFiles:()=>tT,updateMediaWorkspace:()=>tk});var y={};t.r(y),t.d(y,{mediaBox:()=>tR,mediaFile:()=>tO,mediaFiles:()=>tP});var $={};t.r($),t.d($,{deleteMediaFiles:()=>tW,requestFileUpload:()=>tF,updateMediaFile:()=>tN,updateMediaFiles:()=>tq});var v=t(99436),h=t(25326),b=t(66029),I={info:"info",manage_signature:"sign",query_application:"qa",query_device:"qd",query_device_group:"qdg",query_module:"qm",query_activity_log:"qal",create_application:"ca",create_device:"cd",create_device_group:"cdg",create_module:"cm",update_application:"ua",bind_application:"ba",short_edit_application:"uas",canvas_control_application:"uacc",update_device:"ud",update_device_group:"udg",update_module:"um",short_edit_module:"ums",remove_application:"ra",remove_device:"rd",remove_device_group:"rdg",remove_module:"rm",control_device:"ctld",control_application_device:"ctlad",control_device_group:"ctldg",query_media_flow:"qmf",write_media_flow:"wmf",access_unstable_feature:"UNSTABLE"},k=Object.entries(I).reduce((e,[i,t])=>(e[t]=i,e),{}),D=["HS256","RS256"],A=["https://auth0.bricks.tools/","https://mybigday.auth0.com/"],S=t(84867);let w='# Getting Started with BRICKS\n\nBRICKS (方塊磚) is a comprehensive platform for creating interactive multimedia display applications specifically designed for digital signage screens. It enables users to design complete applications without programming, using a visual, component-based approach.\n\n**Important**: Users interact through a visual GUI editor, not raw configuration files. Always describe features in user-friendly terms:\n- "text display" not "BRICK_TEXT"\n- "image" not "BRICK_IMAGE"\n- "canvas name" not "CANVAS_xxx"\n- "data storage" not "PROPERTY_BANK"\n- Focus on what users see and do, not technical implementation details\n\n## Core Philosophy\n\nBRICKS operates as a **Launcher system** that reads configuration files from the cloud (or cached locally) and must maintain normal operation even when offline. The system periodically reports health status and supports watchdog timers for automatic restart or maintenance mode activation.\n\n## Fundamental Architecture\n\n### The Three Core Elements\n\n#### 1. Canvas (畫布)\n- **Definition**: The visual container that defines what users see on screen\n- **Behavior**: Screen transitions occur by switching between different canvases\n- **Smart Transitions**: When switching canvases, BRICKS automatically compares shared elements and smoothly animates their position/size changes\n- **Properties**:\n - `Showing Timeout`: Auto-advance to next canvas after specified time\n - `Next Canvas ID`: Target canvas for timeout transitions\n - `Background Color`: Canvas background\n - `Dismiss Keyboard On Press`: Touch behavior for keyboard dismissal\n- **Events**: `CANVAS_FIRST_ENTER`, `CANVAS_ENTER`, `CANVAS_SHOWING_TIMEOUT`, `CANVAS_EXIT`\n\n#### 2. Brick (方塊)\n- **Definition**: Visual components that display content and handle user interactions\n- **Animation System**: All bricks support three animation phases:\n - **Enter Animation**: How the brick appears on screen\n - **Display Animation**: Ongoing animations while visible\n - **Exit Animation**: How the brick disappears\n- **Positioning**: Uses grid-based positioning system for resolution independence\n- **Interaction**: Can respond to touch events and trigger system actions\n\nAvailable template:\n[:BRICK_IDS:]\n\n#### 3. Generator (處理器)\n- **Definition**: Invisible processing units that handle non-visual functionality\n- **Purpose**: Handle hardware interactions (camera, sensors), data processing, network communication\n- **Input**: Receives parameters exclusively through Property Bank\n- **Output**: Returns results exclusively through Property Bank\n- **Triggers**: Activated by Events connected to their Actions\n\nAvailable template:\n[:GENERATOR_IDS:]\n\n### Data (Property Bank, 參數庫)\nThe central data management system that serves as the backbone of BRICKS applications:\n\n#### Key Features\n- **KEY-VALUE Structure**: Simple, accessible data storage\n- **Dual Events**: Each property supports both "Update" and "Value Change" events\n- **Auto-Refresh**: UI elements automatically update when linked data changes\n- **Cross-Subspace Communication**: Properties can be shared between different subspaces\n- **Data Types**: `string`, `number`, `bool`, `object`, `array`, `any`\n- **Special Kinds**: `color`, `datetime`, `id`, `media-resource-*`, `lottie-file-uri`\n- **Units**: `grid`, `px`, `ms` for different measurement types\n\n#### Routing Options\n- **read-only**: Cannot be changed from other subspaces\n- **Default**: Accepts changes from other subspaces\n\nTerminology note: We refer to the central data system as "Data" in docs and UI. Internally, it remains "Property Bank" and uses `PROPERTY_BANK_*` identifiers.\n\n### Event System\nBRICKS uses a comprehensive event-driven architecture:\n\n#### Event Sources\n- **System Events**: Property Bank changes, timer events, canvas transitions\n- **Brick Events**: User interactions (press, focus, value changes)\n- **Generator Events**: Hardware responses, network callbacks, processing completions\n\n#### Event Handling\n- **Sequential Processing**: Events trigger Actions in defined order\n- **Parameter Passing**: All parameters passed through Property Bank\n- **Action Types**: System actions or Generator actions\n\n### Subspace (子空間)\nAdvanced modularity system for complex applications:\n\n#### Concept\n- **Nested Systems**: Complete BRICKS system within a brick\n- **Independent Operation**: Own canvases, bricks, and property banks\n- **Modular Behavior**: Can be positioned, scaled, and animated like regular bricks\n\n#### Communication\n- **Input**: External Property Bank values copied to internal Property Bank\n- **Output**: Internal Property Bank changes trigger external events\n- **Data Flow**: Call-by-value copying maintains isolation while enabling communication\n\n## Grid System\n\n### Resolution Independence\n- **Default Grid**: 96\xd754 units (optimized for HD displays)\n- **Automatic Scaling**: Grid units convert to pixels based on device resolution\n- **Calculation**: `grid_unit_size_px = device_width_px / app_grid_width`\n\n### Examples\n| Device Resolution | App Grid Size | Grid Unit Size |\n|------------------|---------------|----------------|\n| 1920\xd71080 | 96\xd754 | 20px |\n| 3840\xd72160 | 96\xd754 | 40px |\n| 1280\xd7720 | 96\xd754 | 13.33px |\n\n### Positioning Features\n- **Overflow Support**: Elements can extend beyond visible area\n- **Partial Display**: Elements at negative positions show partial content\n- **Performance Optimization**: Completely off-screen elements are automatically ignored\n\n## Configuration Structure\n\n### Hierarchy\n```\nApplication (應用程式)\n├── Root Subspace\n├── Subspace Map\n│ ├── Canvas Map\n│ ├── Brick Map\n│ └── Generator Map\n├── Property Bank\n├── Property Bank Calc\n├── Event Map\n└── Automation Map\n```\n\n### Item property\nProperties can set constant value or link data like this\n\n```js\n{\n "example1": 123,\n "example2": "PROPERTY_BANK#<Data Node ID>", // Link Data\n "example3": {\n "PROPERTY_BANK#<Data Node ID>", // Link Data in object, we recommend direct link without middle object data\n }\n}\n```\n\n### Item outlet\nData output from brick or generator, you can link it to data\n\n```js\n{\n OUTLET_NAME: \'<Data Node ID>\'\n}\n```\n\n### Event actions\nOn handling event can do actions with this schema\n\n```js\n[\n {\n "action": "string",\n "handler": "string",\n "parameter_list": [\n {\n "input_to_receiver": "string", // Argument\n "result_from_sender": "string" // Link data\n }\n ],\n "wait_async": "boolean"\n }\n]\n```\n\n- `handler: SYSTEM`\n[:SYSTEM_ACTIONS:]\n- `handler: GENERATOR_<UUID>`\n- `handler: BRICK_<UUID>`\n\n## Development Workflow\n\n### 1. Design Phase\n- Define grid layout (usually 96\xd754)\n- Plan canvas flow and transitions\n- Identify required data flows\n\n### 2. Implementation\n- Use `create_item` to constuct config\n- Create subspaces for different app sections\n- Add canvases for each screen/state\n- Place and configure bricks for UI elements\n- Add generators for processing logic\n- Connect events to actions\n\n### 3. Data Management\n- Set up Property Bank structure\n- Configure property types and routing\n- Link UI elements to data sources\n- Implement data processing flows\n\n#### Mental Model\n- Reactive architecture: events trigger actions; actions update Data; UI and generators react to Data changes.\n- Calculations: optional graphs transform Data using Data Calculation (command/data nodes or script).\n- Always read/write via Data. Generators receive input from Data and write outputs back to Data.\n\n#### Common Patterns\n- Event → Action → Data update or Outlet → Data update\n- Data change → Triggers downstream calculations → Updates target Data\n- Cross-subspace routing: respect `read-only` vs `default`\n\n### 4. Testing & Deployment\n- Use automation maps for testing\n- Validate configuration schema\n- Deploy to target devices\n- Monitor system health\n\n## Best Practices\n\n### Performance\n- Use 96\xd754 grid for standard content\n- Minimize off-screen elements\n- Optimize property bank access patterns\n- Cache media resources appropriately\n\n### User Experience\n- Always use enter/exit animations (avoid sudden appearances)\n- Maintain consistent transition timing\n- Design for offline operation\n- Implement proper error handling\n\n### Architecture\n- Keep subspaces focused and modular\n- Use generators for all non-visual processing\n- Minimize cross-subspace dependencies\n- Design for reusability through modules\n\n## Network & Offline Behavior\n\n### Online Operation\n- Configuration sync from cloud\n- Media resource loading\n- Real-time data updates\n- Health status reporting\n\n### Offline Requirements\n- **Display Continuity**: All display and reading functions must work offline\n- **Data Caching**: Write operations cached locally and synced when online\n- **Resource Management**: Media and assets preloaded during online periods\n- **Graceful Degradation**: Non-essential features disabled, core functionality maintained\n\nThis comprehensive foundation enables the creation of sophisticated, interactive digital signage applications that are both powerful and maintainable.\n\n## Local Sync\n\nLocal Sync enables near real-time intranet communication between devices for seamless multi-screen display splicing.\n\n- Data Sync: Synchronize selected data (Property Bank/Data nodes) across devices so UI updates remain consistent.\n- Canvas Sync: Optionally synchronize active canvas to orchestrate state transitions across screens.\n- Typical Use: Video walls, tiled displays, or clustered players that must behave as one.\n- Transport: LAN/intranet only; optimized for low latency and reliability inside the local network.\n- Resilience: Designed to tolerate temporary disconnections; devices rejoin and resynchronize state.\n\nConfiguration hints (high level):\n- Subspaces can define local sync behavior (e.g., whether to sync canvas changes).\n- Generators may opt into specific local sync run modes.\n- Keep payloads small and data normalized for best performance.';var C=t(20181),T=(e,i={})=>({content:[C.Buffer.isBuffer(e)?{...i,blob:e.toString("base64"),type:"blob"}:{...i,text:"string"==typeof e?e:JSON.stringify(e,null,2),type:"text"}],isError:!1}),x=t(68832),B=t(79657),E=t(79861),U=t(46123),M=t(80211),R=t(45907),P=t(99548),O=t(96423),F=M.ajv.getSchema("http://display.bricks.tools/root.schema.json5"),N=(0,O.A)(["subspace_map.*.property_bank_calc_map.*.script_config"]);function q(e){var i=[];try{var t=M(e);i.push(...(0,P.L)({errors:t,schema:F,data:e}).map(({path:e,message:i})=>`${e}: ${i}`));try{i.push(...R(e).map(({field:e,message:i})=>`${e}: ${i}`))}catch(e){i.push(`Component reference validation failed: ${e.message}`)}return N(e).forEach(t=>{var n=t.slice(0,-1),a=U(e,n),o=n.join(".");if(0===Object.keys(a.map).length)i.push(`${o}.map is empty`);else{var r=a.script_config,s=r.inputs,d=r.output,c=r.outputs,l=r.error;s&&Object.keys(s).forEach(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`)}),l&&!a.map[l]&&i.push(`${o}.map.${l} is missing`)}}),{valid:0===i.length,errors:i}}catch(e){return{valid:!1,errors:[`Validation failed: ${e.message}`]}}}var W=t(49741),j=t(63981),V=(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]??V(t,i)])):e,Y=V(W.t),K=Object.entries(W.systemActions).map(([e,{propertyNameType:i,property:t}])=>` - \`${e}\`: ${Y[e]}
|
|
1
|
+
export const __rspack_esm_id=117;export const __rspack_esm_ids=[117];export const __webpack_modules__={98372(e,i,t){t.r(i),t.d(i,{startStdioServer:()=>tJ});var n,a,o,r,s,d,c={};t.r(c),t.d(c,{applicationFragment:()=>es,applicationShortFragment:()=>ef,deviceFragment:()=>eo,deviceGroupFragment:()=>er,deviceShortFragment:()=>ey,instanceVersionFragment:()=>ep,mediaBoxFragment:()=>ev,mediaFileFragment:()=>eh,mediaWorkspaceFragment:()=>e$,moduleFragment:()=>ec,moduleShortFragment:()=>el,operationFragment:()=>eu,publicApplicationBasicInfoFragment:()=>ed,userFavoriteFragment:()=>em,workspaceFragment:()=>e_,workspaceShortFragment:()=>eg});var l={};t.r(l),t.d(l,{application:()=>eW,applicationByDevice:()=>eE,applicationReleaseVersion:()=>eT,applicationReleaseVersions:()=>eC,applicationTestsByDevice:()=>eU,applications:()=>eq,checkBindDevicePasscode:()=>eM,deviceUsage:()=>eV,devices:()=>ej,devicesByGroup:()=>eP,devicesByUniqueId:()=>eR,me:()=>ek,module:()=>eD,moduleReleaseVersion:()=>eB,moduleReleaseVersions:()=>ex,modules:()=>eA,publicModules:()=>eS,publicModulesByIdList:()=>ew,workspace:()=>eF,workspacePricingPlans:()=>eO,workspaces:()=>eN});var p={};t.r(p),t.d(p,{addUserFavorite:()=>iD,assignGroupPermissions:()=>ih,bindApplication:()=>e7,bindApplicationWithDeviceGroup:()=>it,changeWorkspaceAdditionalLimitSpending:()=>iw,changeWorkspaceSubscriptionPlan:()=>iS,controlDevice:()=>e0,createApplication:()=>e9,createApplicationWithShareVersion:()=>e3,createConfigChangeOperation:()=>ig,createDevice:()=>ez,createDeviceGroup:()=>e1,createDeviceGroupWithApp:()=>ir,createModule:()=>il,createVirtualDevice:()=>eH,createWorkspace:()=>eY,createWorkspaceOTP:()=>iC,dispatchDeviceGroupAction:()=>e6,doOperation:()=>iy,duplicateApplication:()=>id,duplicateModule:()=>im,forkApplication:()=>is,moveApplication:()=>io,moveDevice:()=>eX,moveModule:()=>iu,registerFCMNotification:()=>ib,registerRemoteDebug:()=>iI,removeApplication:()=>ic,removeDevice:()=>eZ,removeDeviceGroup:()=>e2,removeModule:()=>i_,removeOperation:()=>iv,removeUserFavorite:()=>iA,removeWorkspace:()=>e5,revokeWorkspaceOTP:()=>iT,shareAccessToken:()=>ik,shareApplication:()=>ia,toggleShortEditApplication:()=>ie,updateApplication:()=>e8,updateApplicationViewportPreset:()=>ii,updateDevice:()=>eJ,updateDeviceGroup:()=>e4,updateModule:()=>ip,updateOperation:()=>i$,updateVirtualDevice:()=>eQ,updateWorkspace:()=>eG,updateWorkspaceTokens:()=>eL});var u={};t.r(u),t.d(u,{application:()=>iM,applicationByDevice:()=>iR,applications:()=>iU,device:()=>iN,deviceUsage:()=>iW,devices:()=>iF,devicesByApplication:()=>iq,mediaBox:()=>iK,mediaBoxes:()=>iV,mediaFile:()=>iG,mediaFiles:()=>iY,mediaWorkspace:()=>ij,module:()=>iO,modules:()=>iP,workspace:()=>iE});var m={};t.r(m),t.d(m,{bindApplication:()=>iH,copyMediaFiles:()=>i6,createApplication:()=>iL,createModule:()=>iX,deleteMediaBoxFiles:()=>i5,deleteMediaFiles:()=>i2,requestFileUpload:()=>iZ,setMediaFileAsBoxPreview:()=>i4,unbindApplication:()=>iJ,updateApplication:()=>iz,updateMediaFile:()=>i0,updateMediaFiles:()=>i1,updateModule:()=>iQ});var _={};t.r(_),t.d(_,{mediaBox:()=>tg,mediaBoxes:()=>tm,mediaFile:()=>ty,mediaFiles:()=>tf,mediaWorkspace:()=>t_,mediaWorkspaces:()=>tu});var g={};t.r(g),t.d(g,{assignGroupPermissions:()=>tT,copyMediaFiles:()=>tw,createMediaBox:()=>th,createMediaWorkspace:()=>t$,deleteMediaFiles:()=>tS,moveMediaBox:()=>tb,requestFileUpload:()=>tk,setMediaFileAsBoxPreview:()=>tC,updateMediaBox:()=>tI,updateMediaFile:()=>tD,updateMediaFiles:()=>tA,updateMediaWorkspace:()=>tv});var f={};t.r(f),t.d(f,{mediaBox:()=>tB,mediaFile:()=>tU,mediaFiles:()=>tE});var y={};t.r(y),t.d(y,{deleteMediaFiles:()=>tO,requestFileUpload:()=>tM,updateMediaFile:()=>tR,updateMediaFiles:()=>tP});var $=t(99436),v=t(25326),h=t(66029),b={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"},I=Object.entries(b).reduce((e,[i,t])=>(e[t]=i,e),{}),k=["HS256","RS256"],D=["https://auth0.bricks.tools/","https://mybigday.auth0.com/"],A=t(84867);let S='# Getting Started with BRICKS\n\nBRICKS (方塊磚) is a comprehensive platform for creating interactive multimedia display applications specifically designed for digital signage screens. It enables users to design complete applications without programming, using a visual, component-based approach.\n\n**Important**: Users interact through a visual GUI editor, not raw configuration files. Always describe features in user-friendly terms:\n- "text display" not "BRICK_TEXT"\n- "image" not "BRICK_IMAGE"\n- "canvas name" not "CANVAS_xxx"\n- "data storage" not "PROPERTY_BANK"\n- Focus on what users see and do, not technical implementation details\n\n## Core Philosophy\n\nBRICKS operates as a **Launcher system** that reads configuration files from the cloud (or cached locally) and must maintain normal operation even when offline. The system periodically reports health status and supports watchdog timers for automatic restart or maintenance mode activation.\n\n## Fundamental Architecture\n\n### The Three Core Elements\n\n#### 1. Canvas (畫布)\n- **Definition**: The visual container that defines what users see on screen\n- **Behavior**: Screen transitions occur by switching between different canvases\n- **Smart Transitions**: When switching canvases, BRICKS automatically compares shared elements and smoothly animates their position/size changes\n- **Properties**:\n - `Showing Timeout`: Auto-advance to next canvas after specified time\n - `Next Canvas ID`: Target canvas for timeout transitions\n - `Background Color`: Canvas background\n - `Dismiss Keyboard On Press`: Touch behavior for keyboard dismissal\n- **Events**: `CANVAS_FIRST_ENTER`, `CANVAS_ENTER`, `CANVAS_SHOWING_TIMEOUT`, `CANVAS_EXIT`\n\n#### 2. Brick (方塊)\n- **Definition**: Visual components that display content and handle user interactions\n- **Animation System**: All bricks support three animation phases:\n - **Enter Animation**: How the brick appears on screen\n - **Display Animation**: Ongoing animations while visible\n - **Exit Animation**: How the brick disappears\n- **Positioning**: Uses grid-based positioning system for resolution independence\n- **Interaction**: Can respond to touch events and trigger system actions\n\nAvailable template:\n[:BRICK_IDS:]\n\n#### 3. Generator (處理器)\n- **Definition**: Invisible processing units that handle non-visual functionality\n- **Purpose**: Handle hardware interactions (camera, sensors), data processing, network communication\n- **Input**: Receives parameters exclusively through Property Bank\n- **Output**: Returns results exclusively through Property Bank\n- **Triggers**: Activated by Events connected to their Actions\n\nAvailable template:\n[:GENERATOR_IDS:]\n\n### Data (Property Bank, 參數庫)\nThe central data management system that serves as the backbone of BRICKS applications:\n\n#### Key Features\n- **KEY-VALUE Structure**: Simple, accessible data storage\n- **Dual Events**: Each property supports both "Update" and "Value Change" events\n- **Auto-Refresh**: UI elements automatically update when linked data changes\n- **Cross-Subspace Communication**: Properties can be shared between different subspaces\n- **Data Types**: `string`, `number`, `bool`, `object`, `array`, `any`\n- **Special Kinds**: `color`, `datetime`, `id`, `media-resource-*`, `lottie-file-uri`\n- **Units**: `grid`, `px`, `ms` for different measurement types\n\n#### Routing Options\n- **read-only**: Cannot be changed from other subspaces\n- **Default**: Accepts changes from other subspaces\n\nTerminology note: We refer to the central data system as "Data" in docs and UI. Internally, it remains "Property Bank" and uses `PROPERTY_BANK_*` identifiers.\n\n### Event System\nBRICKS uses a comprehensive event-driven architecture:\n\n#### Event Sources\n- **System Events**: Property Bank changes, timer events, canvas transitions\n- **Brick Events**: User interactions (press, focus, value changes)\n- **Generator Events**: Hardware responses, network callbacks, processing completions\n\n#### Event Handling\n- **Sequential Processing**: Events trigger Actions in defined order\n- **Parameter Passing**: All parameters passed through Property Bank\n- **Action Types**: System actions or Generator actions\n\n### Subspace (子空間)\nAdvanced modularity system for complex applications:\n\n#### Concept\n- **Nested Systems**: Complete BRICKS system within a brick\n- **Independent Operation**: Own canvases, bricks, and property banks\n- **Modular Behavior**: Can be positioned, scaled, and animated like regular bricks\n\n#### Communication\n- **Input**: External Property Bank values copied to internal Property Bank\n- **Output**: Internal Property Bank changes trigger external events\n- **Data Flow**: Call-by-value copying maintains isolation while enabling communication\n\n## Grid System\n\n### Resolution Independence\n- **Default Grid**: 96\xd754 units (optimized for HD displays)\n- **Automatic Scaling**: Grid units convert to pixels based on device resolution\n- **Calculation**: `grid_unit_size_px = device_width_px / app_grid_width`\n\n### Examples\n| Device Resolution | App Grid Size | Grid Unit Size |\n|------------------|---------------|----------------|\n| 1920\xd71080 | 96\xd754 | 20px |\n| 3840\xd72160 | 96\xd754 | 40px |\n| 1280\xd7720 | 96\xd754 | 13.33px |\n\n### Positioning Features\n- **Overflow Support**: Elements can extend beyond visible area\n- **Partial Display**: Elements at negative positions show partial content\n- **Performance Optimization**: Completely off-screen elements are automatically ignored\n\n## Configuration Structure\n\n### Hierarchy\n```\nApplication (應用程式)\n├── Root Subspace\n├── Subspace Map\n│ ├── Canvas Map\n│ ├── Brick Map\n│ └── Generator Map\n├── Property Bank\n├── Property Bank Calc\n├── Event Map\n└── Automation Map\n```\n\n### Item property\nProperties can set constant value or link data like this\n\n```js\n{\n "example1": 123,\n "example2": "PROPERTY_BANK#<Data Node ID>", // Link Data\n "example3": {\n "PROPERTY_BANK#<Data Node ID>", // Link Data in object, we recommend direct link without middle object data\n }\n}\n```\n\n### Item outlet\nData output from brick or generator, you can link it to data\n\n```js\n{\n OUTLET_NAME: \'<Data Node ID>\'\n}\n```\n\n### Event actions\nOn handling event can do actions with this schema\n\n```js\n[\n {\n "action": "string",\n "handler": "string",\n "parameter_list": [\n {\n "input_to_receiver": "string", // Argument\n "result_from_sender": "string" // Link data\n }\n ],\n "wait_async": "boolean"\n }\n]\n```\n\n- `handler: SYSTEM`\n[:SYSTEM_ACTIONS:]\n- `handler: GENERATOR_<UUID>`\n- `handler: BRICK_<UUID>`\n\n## Development Workflow\n\n### 1. Design Phase\n- Define grid layout (usually 96\xd754)\n- Plan canvas flow and transitions\n- Identify required data flows\n\n### 2. Implementation\n- Use `create_item` to constuct config\n- Create subspaces for different app sections\n- Add canvases for each screen/state\n- Place and configure bricks for UI elements\n- Add generators for processing logic\n- Connect events to actions\n\n### 3. Data Management\n- Set up Property Bank structure\n- Configure property types and routing\n- Link UI elements to data sources\n- Implement data processing flows\n\n#### Mental Model\n- Reactive architecture: events trigger actions; actions update Data; UI and generators react to Data changes.\n- Calculations: optional graphs transform Data using Data Calculation (command/data nodes or script).\n- Always read/write via Data. Generators receive input from Data and write outputs back to Data.\n\n#### Common Patterns\n- Event → Action → Data update or Outlet → Data update\n- Data change → Triggers downstream calculations → Updates target Data\n- Cross-subspace routing: respect `read-only` vs `default`\n\n### 4. Testing & Deployment\n- Use automation maps for testing\n- Validate configuration schema\n- Deploy to target devices\n- Monitor system health\n\n## Best Practices\n\n### Performance\n- Use 96\xd754 grid for standard content\n- Minimize off-screen elements\n- Optimize property bank access patterns\n- Cache media resources appropriately\n\n### User Experience\n- Always use enter/exit animations (avoid sudden appearances)\n- Maintain consistent transition timing\n- Design for offline operation\n- Implement proper error handling\n\n### Architecture\n- Keep subspaces focused and modular\n- Use generators for all non-visual processing\n- Minimize cross-subspace dependencies\n- Design for reusability through modules\n\n## Network & Offline Behavior\n\n### Online Operation\n- Configuration sync from cloud\n- Media resource loading\n- Real-time data updates\n- Health status reporting\n\n### Offline Requirements\n- **Display Continuity**: All display and reading functions must work offline\n- **Data Caching**: Write operations cached locally and synced when online\n- **Resource Management**: Media and assets preloaded during online periods\n- **Graceful Degradation**: Non-essential features disabled, core functionality maintained\n\nThis comprehensive foundation enables the creation of sophisticated, interactive digital signage applications that are both powerful and maintainable.\n\n## Local Sync\n\nLocal Sync enables near real-time intranet communication between devices for seamless multi-screen display splicing.\n\n- Data Sync: Synchronize selected data (Property Bank/Data nodes) across devices so UI updates remain consistent.\n- Canvas Sync: Optionally synchronize active canvas to orchestrate state transitions across screens.\n- Typical Use: Video walls, tiled displays, or clustered players that must behave as one.\n- Transport: LAN/intranet only; optimized for low latency and reliability inside the local network.\n- Resilience: Designed to tolerate temporary disconnections; devices rejoin and resynchronize state.\n\nConfiguration hints (high level):\n- Subspaces can define local sync behavior (e.g., whether to sync canvas changes).\n- Generators may opt into specific local sync run modes.\n- Keep payloads small and data normalized for best performance.';var w=t(20181),C=(e,i={})=>({content:[w.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}),T=t(68832),x=t(79657),B=t(79861),E=t(46123),U=t(80211),M=t(45907),R=t(99548),P=t(96423),O=U.ajv.getSchema("http://display.bricks.tools/root.schema.json5"),F=(0,P.A)(["subspace_map.*.property_bank_calc_map.*.script_config"]);function N(e){var i=[];try{var t=U(e);i.push(...(0,R.L)({errors:t,schema:O,data:e}).map(({path:e,message:i})=>`${e}: ${i}`));try{i.push(...M(e).map(({field:e,message:i})=>`${e}: ${i}`))}catch(e){i.push(`Component reference validation failed: ${e.message}`)}return F(e).forEach(t=>{var n=t.slice(0,-1),a=E(e,n),o=n.join(".");if(0===Object.keys(a.map).length)i.push(`${o}.map is empty`);else{var r=a.script_config,s=r.inputs,d=r.output,c=r.outputs,l=r.error;s&&Object.keys(s).forEach(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`)}),l&&!a.map[l]&&i.push(`${o}.map.${l} is missing`)}}),{valid:0===i.length,errors:i}}catch(e){return{valid:!1,errors:[`Validation failed: ${e.message}`]}}}var q=t(49741),W=t(63981),j=(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]??j(t,i)])):e,V=j(q.t),K=Object.entries(q.systemActions).map(([e,{propertyNameType:i,property:t}])=>` - \`${e}\`: ${V[e]}
|
|
2
2
|
${((e,i)=>{switch(e){case"defined_properties":return Object.entries(i).map(([e,i])=>` - \`${e}\`: ${JSON.stringify(i)}`).join("\n");case"property_bank":return" - `PROPERTY_BANK_DATA_NODE_*`: Value";default:return""}})(i,t)}
|
|
3
|
-
`.trim()).join("\n"),
|
|
3
|
+
`.trim()).join("\n"),Y=Object.keys(W.brickMapping).map(e=>`- \`${e}\``).join("\n"),G=Object.keys(W.generatorMapping).map(e=>`- \`${e}\``).join("\n");let L=S.replace("[:SYSTEM_ACTIONS:]",K).replace("[:BRICK_IDS:]",Y).replace("[:GENERATOR_IDS:]",G);var z=t(44668),H=t(5018),J=t(63315),X=t(30409),Q=t(40906),Z=t(79760),ee=t(22268),ei=t(7068),et=t(26197),en=t(94370);let ea=(0,en.default)`
|
|
4
4
|
fragment workspaceArguments on Workspace {
|
|
5
5
|
__typename
|
|
6
6
|
_id
|
|
@@ -93,7 +93,7 @@ ${((e,i)=>{switch(e){case"defined_properties":return Object.entries(i).map(([e,i
|
|
|
93
93
|
updated_at
|
|
94
94
|
}
|
|
95
95
|
}
|
|
96
|
-
`,
|
|
96
|
+
`,eo=(0,en.default)`
|
|
97
97
|
fragment deviceArguments on Device {
|
|
98
98
|
__typename
|
|
99
99
|
_id
|
|
@@ -245,7 +245,7 @@ ${((e,i)=>{switch(e){case"defined_properties":return Object.entries(i).map(([e,i
|
|
|
245
245
|
}
|
|
246
246
|
}
|
|
247
247
|
}
|
|
248
|
-
`,
|
|
248
|
+
`,er=(0,en.default)`
|
|
249
249
|
fragment deviceGroupArguments on DeviceGroup {
|
|
250
250
|
__typename
|
|
251
251
|
_id
|
|
@@ -283,7 +283,7 @@ ${((e,i)=>{switch(e){case"defined_properties":return Object.entries(i).map(([e,i
|
|
|
283
283
|
device_target_name
|
|
284
284
|
}
|
|
285
285
|
}
|
|
286
|
-
`,
|
|
286
|
+
`,es=(0,en.default)`
|
|
287
287
|
fragment applicationArguments on Application {
|
|
288
288
|
__typename
|
|
289
289
|
_id
|
|
@@ -432,7 +432,7 @@ ${((e,i)=>{switch(e){case"defined_properties":return Object.entries(i).map(([e,i
|
|
|
432
432
|
scope
|
|
433
433
|
}
|
|
434
434
|
}
|
|
435
|
-
`,
|
|
435
|
+
`,ed=(0,en.default)`
|
|
436
436
|
fragment publicApplicationBasicInfoArguments on PublicApplicationBasicInfo {
|
|
437
437
|
_id
|
|
438
438
|
owner {
|
|
@@ -476,7 +476,7 @@ ${((e,i)=>{switch(e){case"defined_properties":return Object.entries(i).map(([e,i
|
|
|
476
476
|
}
|
|
477
477
|
}
|
|
478
478
|
}
|
|
479
|
-
`,
|
|
479
|
+
`,ec=(0,en.default)`
|
|
480
480
|
fragment moduleArguments on Module {
|
|
481
481
|
__typename
|
|
482
482
|
_id
|
|
@@ -520,7 +520,7 @@ ${((e,i)=>{switch(e){case"defined_properties":return Object.entries(i).map(([e,i
|
|
|
520
520
|
last_screenshot_id
|
|
521
521
|
}
|
|
522
522
|
}
|
|
523
|
-
`,
|
|
523
|
+
`,el=(0,en.default)`
|
|
524
524
|
fragment moduleShortArguments on Module {
|
|
525
525
|
__typename
|
|
526
526
|
_id
|
|
@@ -544,7 +544,7 @@ ${((e,i)=>{switch(e){case"defined_properties":return Object.entries(i).map(([e,i
|
|
|
544
544
|
last_screenshot_id
|
|
545
545
|
}
|
|
546
546
|
}
|
|
547
|
-
`,
|
|
547
|
+
`,ep=(0,en.default)`
|
|
548
548
|
fragment instanceVersionArguments on ConfigVersion {
|
|
549
549
|
__typename
|
|
550
550
|
_id
|
|
@@ -555,7 +555,7 @@ ${((e,i)=>{switch(e){case"defined_properties":return Object.entries(i).map(([e,i
|
|
|
555
555
|
instance_id
|
|
556
556
|
entry
|
|
557
557
|
}
|
|
558
|
-
`,
|
|
558
|
+
`,eu=(0,en.default)`
|
|
559
559
|
fragment operationArguments on Operation {
|
|
560
560
|
__typename
|
|
561
561
|
_id
|
|
@@ -568,7 +568,7 @@ ${((e,i)=>{switch(e){case"defined_properties":return Object.entries(i).map(([e,i
|
|
|
568
568
|
expired_datetime
|
|
569
569
|
payload
|
|
570
570
|
}
|
|
571
|
-
`,
|
|
571
|
+
`,em=(0,en.default)`
|
|
572
572
|
fragment userFavoriteArguments on UserFavorite {
|
|
573
573
|
_id
|
|
574
574
|
instance_type
|
|
@@ -579,7 +579,7 @@ ${((e,i)=>{switch(e){case"defined_properties":return Object.entries(i).map(([e,i
|
|
|
579
579
|
}
|
|
580
580
|
last_modify_datetime
|
|
581
581
|
}
|
|
582
|
-
`;var
|
|
582
|
+
`;var e_=(0,en.default)`
|
|
583
583
|
fragment mcpWorkspaceArguments on Workspace {
|
|
584
584
|
__typename
|
|
585
585
|
_id
|
|
@@ -662,25 +662,25 @@ ${((e,i)=>{switch(e){case"defined_properties":return Object.entries(i).map(([e,i
|
|
|
662
662
|
updated_at
|
|
663
663
|
}
|
|
664
664
|
}
|
|
665
|
-
`,
|
|
665
|
+
`,eg=(0,en.default)`
|
|
666
666
|
fragment mcpWorkspaceShortArguments on Workspace {
|
|
667
667
|
_id
|
|
668
668
|
name
|
|
669
669
|
description
|
|
670
670
|
}
|
|
671
|
-
`,
|
|
671
|
+
`,ef=(0,en.default)`
|
|
672
672
|
fragment mcpApplicationShortArguments on Application {
|
|
673
673
|
_id
|
|
674
674
|
name
|
|
675
675
|
description
|
|
676
676
|
}
|
|
677
|
-
`,
|
|
677
|
+
`,ey=(0,en.default)`
|
|
678
678
|
fragment mcpDeviceShortArguments on Device {
|
|
679
679
|
_id
|
|
680
680
|
name
|
|
681
681
|
description
|
|
682
682
|
}
|
|
683
|
-
`,
|
|
683
|
+
`,e$=(0,en.default)`
|
|
684
684
|
fragment workspaceMediaWorkspaceArguments on MediaWorkspace {
|
|
685
685
|
id
|
|
686
686
|
name
|
|
@@ -692,7 +692,7 @@ ${((e,i)=>{switch(e){case"defined_properties":return Object.entries(i).map(([e,i
|
|
|
692
692
|
size
|
|
693
693
|
sizeLimit
|
|
694
694
|
}
|
|
695
|
-
`,
|
|
695
|
+
`,ev=(0,en.default)`
|
|
696
696
|
fragment workspaceMediaBoxArguments on MediaBox {
|
|
697
697
|
id
|
|
698
698
|
name
|
|
@@ -714,7 +714,7 @@ ${((e,i)=>{switch(e){case"defined_properties":return Object.entries(i).map(([e,i
|
|
|
714
714
|
updatedAt
|
|
715
715
|
size
|
|
716
716
|
}
|
|
717
|
-
`,
|
|
717
|
+
`,eh=(0,en.default)`
|
|
718
718
|
fragment workspaceMediaFileArguments on MediaFile {
|
|
719
719
|
id
|
|
720
720
|
name
|
|
@@ -797,70 +797,70 @@ ${((e,i)=>{switch(e){case"defined_properties":return Object.entries(i).map(([e,i
|
|
|
797
797
|
systemTags
|
|
798
798
|
}
|
|
799
799
|
}
|
|
800
|
-
`,
|
|
800
|
+
`,eb={query:"query",mutation:"mutate"},eI=z(function e(i,t,n,a,o){H(this,e),this.baseUrl=i,this.token=t,this.endpoint=n;var r=(0,Z.$)({uri:`${i}${n}`}),s=(0,et.o)((e,{headers:i})=>({headers:{...i,authorization:`Bearer ${t}`}}));this.apolloClient=new ee.R({link:s.concat(r),cache:new ei.D,defaultOptions:{watchQuery:{errorPolicy:"all",fetchPolicy:"no-cache"},query:{errorPolicy:"all",fetchPolicy:"no-cache"}}}),this.fragments=c,this.queries=a,this.mutations=o,this.generateMethods()},[{key:"generateMethods",value:function(){var e=this,i=i=>([t,n])=>{if(this[t])throw Error(`Overwriting client.${t}`);this[t]=$(function*(a={},o={}){try{var r=e.apolloClient[eb[i]],s=yield r({[i]:n,variables:a,...o}),d=s.data,c=s.errors;if(n.needResetStore)try{yield e.apolloClient.resetStore()}catch(e){console.error(e)}if(c)throw Error(c.map(({message:e})=>e).join("\n"));return d[t]}catch(e){if(e.cause)if(e.cause.result?.errors)throw Error(e.cause.result.errors.map(({message:e})=>e).join("\n"));else console.error(e.cause);throw e}})};Object.entries(this.queries).forEach(i("query")),Object.entries(this.mutations).forEach(i("mutation"))}},{key:"query",value:(n=$(function*(e,i={}){var t=yield this.apolloClient.query({query:e,variables:i,fetchPolicy:"no-cache"}),n=t.data,a=t.errors,o=t.error,r=t.message;if(o&&r)throw Error(r);if(a&&a.length>0)throw Error(a.map(({message:e})=>e).join("\n"));return n}),function(e){return n.apply(this,arguments)})},{key:"mutate",value:(a=$(function*(e,i={}){var t=yield this.apolloClient.mutate({mutation:e,variables:i}),n=t.data,a=t.errors,o=t.error,r=t.message;if(o&&r)throw Error(r);if(a&&a.length>0)throw Error(a.map(({message:e})=>e).join("\n"));return n}),function(e){return a.apply(this,arguments)})}]);let ek=(0,en.default)`
|
|
801
801
|
query ControllerClient_me {
|
|
802
802
|
me {
|
|
803
803
|
_id
|
|
804
804
|
id_from_user
|
|
805
805
|
}
|
|
806
806
|
}
|
|
807
|
-
`,
|
|
807
|
+
`,eD=(0,en.default)`
|
|
808
808
|
query ControllerClient_module($id: ID!) {
|
|
809
809
|
module(id: $id) {
|
|
810
810
|
...moduleArguments
|
|
811
811
|
}
|
|
812
812
|
}
|
|
813
|
-
${
|
|
814
|
-
`,
|
|
813
|
+
${ec}
|
|
814
|
+
`,eA=(0,en.default)`
|
|
815
815
|
query ControllerClient_modules($workspaceId: ID, $limit: Int) {
|
|
816
816
|
modules(workspaceId: $workspaceId, paginate: { limit: $limit }) {
|
|
817
817
|
...moduleShortArguments
|
|
818
818
|
}
|
|
819
819
|
}
|
|
820
|
-
${
|
|
821
|
-
`,
|
|
820
|
+
${el}
|
|
821
|
+
`,eS=(0,en.default)`
|
|
822
822
|
query ControllerClient_publicModules($keyword: String!, $limit: Int) {
|
|
823
823
|
publicModules(keyword: $keyword, paginate: { limit: $limit }) {
|
|
824
824
|
...moduleShortArguments
|
|
825
825
|
}
|
|
826
826
|
}
|
|
827
|
-
${
|
|
828
|
-
`,
|
|
827
|
+
${el}
|
|
828
|
+
`,ew=(0,en.default)`
|
|
829
829
|
query ControllerClient_publicModulesByIdList($idList: [ID]) {
|
|
830
830
|
publicModulesByIdList(idList: $idList) {
|
|
831
831
|
...moduleShortArguments
|
|
832
832
|
}
|
|
833
833
|
}
|
|
834
|
-
${
|
|
835
|
-
`,
|
|
834
|
+
${el}
|
|
835
|
+
`,eC=(0,en.default)`
|
|
836
836
|
query ControllerClient_applicationReleaseVersions($id: ID!) {
|
|
837
837
|
applicationReleaseVersions(id: $id) {
|
|
838
838
|
...instanceVersionArguments
|
|
839
839
|
}
|
|
840
840
|
}
|
|
841
|
-
${
|
|
842
|
-
`,
|
|
841
|
+
${ep}
|
|
842
|
+
`,eT=(0,en.default)`
|
|
843
843
|
query ControllerClient_applicationReleaseVersion($id: ID!, $versionId: ID!) {
|
|
844
844
|
applicationReleaseVersion(id: $id, versionId: $versionId) {
|
|
845
845
|
...applicationReleaseVersionArguments
|
|
846
846
|
}
|
|
847
847
|
}
|
|
848
|
-
${
|
|
849
|
-
`,
|
|
848
|
+
${ep}
|
|
849
|
+
`,ex=(0,en.default)`
|
|
850
850
|
query ControllerClient_moduleReleaseVersions($id: ID!) {
|
|
851
851
|
moduleReleaseVersions(id: $id) {
|
|
852
852
|
...instanceVersionArguments
|
|
853
853
|
}
|
|
854
854
|
}
|
|
855
|
-
${
|
|
856
|
-
`,
|
|
855
|
+
${ep}
|
|
856
|
+
`,eB=(0,en.default)`
|
|
857
857
|
query ControllerClient_moduleReleaseVersion($id: ID!, $versionId: ID!) {
|
|
858
858
|
moduleReleaseVersion(id: $id, versionId: $versionId) {
|
|
859
859
|
...instanceVersionArguments
|
|
860
860
|
}
|
|
861
861
|
}
|
|
862
|
-
${
|
|
863
|
-
`,
|
|
862
|
+
${ep}
|
|
863
|
+
`,eE=(0,en.default)`
|
|
864
864
|
query ControllerClient_applicationByDevice(
|
|
865
865
|
$deviceId: ID!
|
|
866
866
|
$debug: Boolean
|
|
@@ -877,8 +877,8 @@ ${((e,i)=>{switch(e){case"defined_properties":return Object.entries(i).map(([e,i
|
|
|
877
877
|
config_tests
|
|
878
878
|
}
|
|
879
879
|
}
|
|
880
|
-
${
|
|
881
|
-
`,
|
|
880
|
+
${es}
|
|
881
|
+
`,eU=(0,en.default)`
|
|
882
882
|
query ControllerClient_applicationTestsByDevice($deviceId: ID!) {
|
|
883
883
|
applicationTestsByDevice: applicationByDevice(
|
|
884
884
|
deviceId: $deviceId
|
|
@@ -891,18 +891,18 @@ ${((e,i)=>{switch(e){case"defined_properties":return Object.entries(i).map(([e,i
|
|
|
891
891
|
config_tests
|
|
892
892
|
}
|
|
893
893
|
}
|
|
894
|
-
`,
|
|
894
|
+
`,eM=(0,en.default)`
|
|
895
895
|
query ControllerClient_checkBindDevicePasscode($passcode: String!) {
|
|
896
896
|
checkBindDevicePasscode(passcode: $passcode)
|
|
897
897
|
}
|
|
898
|
-
`,
|
|
898
|
+
`,eR=(0,en.default)`
|
|
899
899
|
query ControllerClient_devicesByUniqueId($uniqueID: String!, $unbindApplication: Boolean) {
|
|
900
900
|
devicesByUniqueId(uniqueID: $uniqueID, unbindApplication: $unbindApplication) {
|
|
901
901
|
...deviceArguments
|
|
902
902
|
}
|
|
903
903
|
}
|
|
904
|
-
${
|
|
905
|
-
`,
|
|
904
|
+
${eo}
|
|
905
|
+
`,eP=(0,en.default)`
|
|
906
906
|
query ControllerClient_devicesByGroup($id: ID!) {
|
|
907
907
|
devicesByGroup(id: $id) {
|
|
908
908
|
device {
|
|
@@ -953,46 +953,46 @@ ${((e,i)=>{switch(e){case"defined_properties":return Object.entries(i).map(([e,i
|
|
|
953
953
|
target_name
|
|
954
954
|
}
|
|
955
955
|
}
|
|
956
|
-
`,
|
|
956
|
+
`,eO=(0,en.default)`
|
|
957
957
|
query ControllerClient_workspacePricingPlans {
|
|
958
958
|
workspacePricingPlans
|
|
959
959
|
}
|
|
960
|
-
`;var
|
|
960
|
+
`;var eF=(0,en.default)`
|
|
961
961
|
query User_workspace($id: ID!) {
|
|
962
962
|
workspace(id: $id) {
|
|
963
963
|
...mcpWorkspaceArguments
|
|
964
964
|
}
|
|
965
965
|
}
|
|
966
|
-
${
|
|
967
|
-
`,
|
|
966
|
+
${e_}
|
|
967
|
+
`,eN=(0,en.default)`
|
|
968
968
|
query User_workspaces($paginate: Paginate) {
|
|
969
969
|
workspaces(paginate: $paginate) {
|
|
970
970
|
...mcpWorkspaceShortArguments
|
|
971
971
|
}
|
|
972
972
|
}
|
|
973
|
-
${
|
|
974
|
-
`,
|
|
973
|
+
${eg}
|
|
974
|
+
`,eq=(0,en.default)`
|
|
975
975
|
query User_applications {
|
|
976
976
|
applications {
|
|
977
977
|
...mcpApplicationShortArguments
|
|
978
978
|
}
|
|
979
979
|
}
|
|
980
|
-
${
|
|
981
|
-
`,
|
|
980
|
+
${ef}
|
|
981
|
+
`,eW=(0,en.default)`
|
|
982
982
|
query User_application($id: ID!) {
|
|
983
983
|
application(id: $id) {
|
|
984
984
|
...applicationArguments
|
|
985
985
|
}
|
|
986
986
|
}
|
|
987
|
-
${
|
|
988
|
-
`,
|
|
987
|
+
${es}
|
|
988
|
+
`,ej=(0,en.default)`
|
|
989
989
|
query User_devices {
|
|
990
990
|
devices {
|
|
991
991
|
...mcpDeviceShortArguments
|
|
992
992
|
}
|
|
993
993
|
}
|
|
994
|
-
${
|
|
995
|
-
`,
|
|
994
|
+
${ey}
|
|
995
|
+
`,eV=(0,en.default)`
|
|
996
996
|
query User_deviceUsage($deviceId: ID, $startDate: Date, $endDate: Date) {
|
|
997
997
|
deviceUsage(deviceId: $deviceId, startDate: $startDate, endDate: $endDate) {
|
|
998
998
|
_id
|
|
@@ -1011,14 +1011,14 @@ ${((e,i)=>{switch(e){case"defined_properties":return Object.entries(i).map(([e,i
|
|
|
1011
1011
|
}
|
|
1012
1012
|
}
|
|
1013
1013
|
}
|
|
1014
|
-
`;let
|
|
1014
|
+
`;let eK=e=>(e.needResetStore=!0,e),eY=eK((0,en.default)`
|
|
1015
1015
|
mutation ControllerClient_createWorkspace($name: String, $description: String) {
|
|
1016
1016
|
createWorkspace(name: $name, description: $description) {
|
|
1017
1017
|
...workspaceArguments
|
|
1018
1018
|
}
|
|
1019
1019
|
}
|
|
1020
|
-
${
|
|
1021
|
-
`),
|
|
1020
|
+
${ea}
|
|
1021
|
+
`),eG=eK((0,en.default)`
|
|
1022
1022
|
mutation ControllerClient_updateWorkspace(
|
|
1023
1023
|
$id: ID!
|
|
1024
1024
|
$name: String
|
|
@@ -1046,8 +1046,8 @@ ${((e,i)=>{switch(e){case"defined_properties":return Object.entries(i).map(([e,i
|
|
|
1046
1046
|
...workspaceArguments
|
|
1047
1047
|
}
|
|
1048
1048
|
}
|
|
1049
|
-
${
|
|
1050
|
-
`),
|
|
1049
|
+
${ea}
|
|
1050
|
+
`),eL=eK((0,en.default)`
|
|
1051
1051
|
mutation ControllerClient_updateWorkspaceTokens(
|
|
1052
1052
|
$id: ID!
|
|
1053
1053
|
$tokens: [WorkspaceTokenInput]
|
|
@@ -1063,8 +1063,8 @@ ${((e,i)=>{switch(e){case"defined_properties":return Object.entries(i).map(([e,i
|
|
|
1063
1063
|
}
|
|
1064
1064
|
}
|
|
1065
1065
|
}
|
|
1066
|
-
${
|
|
1067
|
-
`),
|
|
1066
|
+
${ea}
|
|
1067
|
+
`),ez=eK((0,en.default)`
|
|
1068
1068
|
mutation ControllerClient_createDevice(
|
|
1069
1069
|
$workspaceId: ID
|
|
1070
1070
|
$name: String
|
|
@@ -1086,8 +1086,8 @@ ${((e,i)=>{switch(e){case"defined_properties":return Object.entries(i).map(([e,i
|
|
|
1086
1086
|
...deviceArguments
|
|
1087
1087
|
}
|
|
1088
1088
|
}
|
|
1089
|
-
${
|
|
1090
|
-
`),
|
|
1089
|
+
${eo}
|
|
1090
|
+
`),eH=eK((0,en.default)`
|
|
1091
1091
|
mutation ControllerClient_createVirtualDevice(
|
|
1092
1092
|
$workspaceId: ID
|
|
1093
1093
|
$name: String
|
|
@@ -1103,8 +1103,8 @@ ${((e,i)=>{switch(e){case"defined_properties":return Object.entries(i).map(([e,i
|
|
|
1103
1103
|
...deviceArguments
|
|
1104
1104
|
}
|
|
1105
1105
|
}
|
|
1106
|
-
${
|
|
1107
|
-
`),
|
|
1106
|
+
${eo}
|
|
1107
|
+
`),eJ=eK((0,en.default)`
|
|
1108
1108
|
mutation ControllerClient_updateDevice(
|
|
1109
1109
|
$id: ID!
|
|
1110
1110
|
$name: String
|
|
@@ -1140,8 +1140,8 @@ ${((e,i)=>{switch(e){case"defined_properties":return Object.entries(i).map(([e,i
|
|
|
1140
1140
|
...deviceArguments
|
|
1141
1141
|
}
|
|
1142
1142
|
}
|
|
1143
|
-
${
|
|
1144
|
-
`),
|
|
1143
|
+
${eo}
|
|
1144
|
+
`),eX=eK((0,en.default)`
|
|
1145
1145
|
mutation ControllerClient_moveDevice(
|
|
1146
1146
|
$id: ID!
|
|
1147
1147
|
$workspaceId: ID!
|
|
@@ -1159,8 +1159,8 @@ ${((e,i)=>{switch(e){case"defined_properties":return Object.entries(i).map(([e,i
|
|
|
1159
1159
|
...deviceArguments
|
|
1160
1160
|
}
|
|
1161
1161
|
}
|
|
1162
|
-
${
|
|
1163
|
-
`),
|
|
1162
|
+
${eo}
|
|
1163
|
+
`),eQ=eK((0,en.default)`
|
|
1164
1164
|
mutation ControllerClient_updateVirtualDevice(
|
|
1165
1165
|
$id: ID!
|
|
1166
1166
|
$tokens: [DeviceTokenInput]
|
|
@@ -1176,19 +1176,19 @@ ${((e,i)=>{switch(e){case"defined_properties":return Object.entries(i).map(([e,i
|
|
|
1176
1176
|
}
|
|
1177
1177
|
}
|
|
1178
1178
|
}
|
|
1179
|
-
${
|
|
1180
|
-
`),
|
|
1179
|
+
${eo}
|
|
1180
|
+
`),eZ=eK((0,en.default)`
|
|
1181
1181
|
mutation ControllerClient_removeDevice($id: ID!) {
|
|
1182
1182
|
removeDevice(id: $id)
|
|
1183
1183
|
}
|
|
1184
|
-
`),
|
|
1184
|
+
`),e0=eK((0,en.default)`
|
|
1185
1185
|
mutation ControllerClient_controlDevice($id: ID!, $type: String!, $eventPayload: JSON) {
|
|
1186
1186
|
controlDevice(id: $id, type: $type, eventPayload: $eventPayload) {
|
|
1187
1187
|
...deviceArguments
|
|
1188
1188
|
}
|
|
1189
1189
|
}
|
|
1190
|
-
${
|
|
1191
|
-
`),
|
|
1190
|
+
${eo}
|
|
1191
|
+
`),e1=eK((0,en.default)`
|
|
1192
1192
|
mutation ControllerClient_createDeviceGroup(
|
|
1193
1193
|
$workspaceId: ID!
|
|
1194
1194
|
$name: String!
|
|
@@ -1198,8 +1198,8 @@ ${((e,i)=>{switch(e){case"defined_properties":return Object.entries(i).map(([e,i
|
|
|
1198
1198
|
...deviceGroupArguments
|
|
1199
1199
|
}
|
|
1200
1200
|
}
|
|
1201
|
-
${
|
|
1202
|
-
`),
|
|
1201
|
+
${er}
|
|
1202
|
+
`),e4=eK((0,en.default)`
|
|
1203
1203
|
mutation ControllerClient_updateDeviceGroup(
|
|
1204
1204
|
$id: ID!
|
|
1205
1205
|
$name: String
|
|
@@ -1223,23 +1223,23 @@ ${((e,i)=>{switch(e){case"defined_properties":return Object.entries(i).map(([e,i
|
|
|
1223
1223
|
...deviceGroupArguments
|
|
1224
1224
|
}
|
|
1225
1225
|
}
|
|
1226
|
-
${
|
|
1227
|
-
`),
|
|
1226
|
+
${er}
|
|
1227
|
+
`),e6=eK((0,en.default)`
|
|
1228
1228
|
mutation ControllerClient_dispatchDeviceGroupAction($id: ID!, $action: String!) {
|
|
1229
1229
|
dispatchDeviceGroupAction(id: $id, action: $action) {
|
|
1230
1230
|
devices
|
|
1231
1231
|
dispatched
|
|
1232
1232
|
}
|
|
1233
1233
|
}
|
|
1234
|
-
`),
|
|
1234
|
+
`),e2=eK((0,en.default)`
|
|
1235
1235
|
mutation ControllerClient_removeDeviceGroup($id: ID!) {
|
|
1236
1236
|
removeDeviceGroup(id: $id)
|
|
1237
1237
|
}
|
|
1238
|
-
`),
|
|
1238
|
+
`),e5=eK((0,en.default)`
|
|
1239
1239
|
mutation ControllerClient_removeWorkspace($id: ID!) {
|
|
1240
1240
|
removeWorkspace(id: $id)
|
|
1241
1241
|
}
|
|
1242
|
-
`),
|
|
1242
|
+
`),e9=eK((0,en.default)`
|
|
1243
1243
|
mutation ControllerClient_createApplication(
|
|
1244
1244
|
$workspaceId: ID
|
|
1245
1245
|
$name: String
|
|
@@ -1259,8 +1259,8 @@ ${((e,i)=>{switch(e){case"defined_properties":return Object.entries(i).map(([e,i
|
|
|
1259
1259
|
...applicationArguments
|
|
1260
1260
|
}
|
|
1261
1261
|
}
|
|
1262
|
-
${
|
|
1263
|
-
`),
|
|
1262
|
+
${es}
|
|
1263
|
+
`),e3=eK((0,en.default)`
|
|
1264
1264
|
mutation ControllerClient_createApplicationWithShareVersion(
|
|
1265
1265
|
$workspaceId: ID
|
|
1266
1266
|
$name: String
|
|
@@ -1276,8 +1276,8 @@ ${((e,i)=>{switch(e){case"defined_properties":return Object.entries(i).map(([e,i
|
|
|
1276
1276
|
...applicationArguments
|
|
1277
1277
|
}
|
|
1278
1278
|
}
|
|
1279
|
-
${
|
|
1280
|
-
`),
|
|
1279
|
+
${es}
|
|
1280
|
+
`),e8=eK((0,en.default)`
|
|
1281
1281
|
mutation ControllerClient_updateApplication(
|
|
1282
1282
|
$id: ID!
|
|
1283
1283
|
$name: String
|
|
@@ -1321,8 +1321,8 @@ ${((e,i)=>{switch(e){case"defined_properties":return Object.entries(i).map(([e,i
|
|
|
1321
1321
|
...applicationArguments
|
|
1322
1322
|
}
|
|
1323
1323
|
}
|
|
1324
|
-
${
|
|
1325
|
-
`),
|
|
1324
|
+
${es}
|
|
1325
|
+
`),e7=eK((0,en.default)`
|
|
1326
1326
|
mutation ControllerClient_bindApplication(
|
|
1327
1327
|
$id: ID!
|
|
1328
1328
|
$devices: [ID]
|
|
@@ -1344,12 +1344,12 @@ ${((e,i)=>{switch(e){case"defined_properties":return Object.entries(i).map(([e,i
|
|
|
1344
1344
|
...applicationArguments
|
|
1345
1345
|
}
|
|
1346
1346
|
}
|
|
1347
|
-
${
|
|
1348
|
-
`),
|
|
1347
|
+
${es}
|
|
1348
|
+
`),ie=eK((0,en.default)`
|
|
1349
1349
|
mutation ControllerClient_toggleShortEditApplication($id: ID!, $enabled: Boolean!) {
|
|
1350
1350
|
toggleShortEditApplication(id: $id, enabled: $enabled)
|
|
1351
1351
|
}
|
|
1352
|
-
`),
|
|
1352
|
+
`),ii=eK((0,en.default)`
|
|
1353
1353
|
mutation ControllerClient_updateApplicationViewportPreset(
|
|
1354
1354
|
$id: ID!
|
|
1355
1355
|
$newViewportPresets: [ApplicationViewportPresetInput]
|
|
@@ -1365,8 +1365,8 @@ ${((e,i)=>{switch(e){case"defined_properties":return Object.entries(i).map(([e,i
|
|
|
1365
1365
|
...applicationArguments
|
|
1366
1366
|
}
|
|
1367
1367
|
}
|
|
1368
|
-
${
|
|
1369
|
-
`),
|
|
1368
|
+
${es}
|
|
1369
|
+
`),it=eK((0,en.default)`
|
|
1370
1370
|
mutation ControllerClient_bindApplicationWithDeviceGroup(
|
|
1371
1371
|
$id: ID!
|
|
1372
1372
|
$bindDeviceGroup: ApplicationBindDeviceGroupInput
|
|
@@ -1382,8 +1382,8 @@ ${((e,i)=>{switch(e){case"defined_properties":return Object.entries(i).map(([e,i
|
|
|
1382
1382
|
...applicationArguments
|
|
1383
1383
|
}
|
|
1384
1384
|
}
|
|
1385
|
-
${
|
|
1386
|
-
`),
|
|
1385
|
+
${es}
|
|
1386
|
+
`),ia=eK((0,en.default)`
|
|
1387
1387
|
mutation ControllerClient_shareApplication(
|
|
1388
1388
|
$id: ID!
|
|
1389
1389
|
$shareSetting: ApplicationShareSettingInput
|
|
@@ -1403,15 +1403,15 @@ ${((e,i)=>{switch(e){case"defined_properties":return Object.entries(i).map(([e,i
|
|
|
1403
1403
|
...applicationArguments
|
|
1404
1404
|
}
|
|
1405
1405
|
}
|
|
1406
|
-
${
|
|
1407
|
-
`),
|
|
1406
|
+
${es}
|
|
1407
|
+
`),io=eK((0,en.default)`
|
|
1408
1408
|
mutation ControllerClient_moveApplication($id: ID!, $workspaceId: ID!) {
|
|
1409
1409
|
moveApplication(id: $id, workspaceId: $workspaceId) {
|
|
1410
1410
|
...applicationArguments
|
|
1411
1411
|
}
|
|
1412
1412
|
}
|
|
1413
|
-
${
|
|
1414
|
-
`),
|
|
1413
|
+
${es}
|
|
1414
|
+
`),ir=eK((0,en.default)`
|
|
1415
1415
|
mutation ControllerClient_createDeviceGroupWithApp(
|
|
1416
1416
|
$applicationId: ID!
|
|
1417
1417
|
$name: String!
|
|
@@ -1436,15 +1436,15 @@ ${((e,i)=>{switch(e){case"defined_properties":return Object.entries(i).map(([e,i
|
|
|
1436
1436
|
}
|
|
1437
1437
|
}
|
|
1438
1438
|
}
|
|
1439
|
-
${
|
|
1440
|
-
`),
|
|
1439
|
+
${es}
|
|
1440
|
+
`),is=eK((0,en.default)`
|
|
1441
1441
|
mutation ControllerClient_forkApplication($id: ID!) {
|
|
1442
1442
|
forkApplication(id: $id) {
|
|
1443
1443
|
...applicationArguments
|
|
1444
1444
|
}
|
|
1445
1445
|
}
|
|
1446
|
-
${
|
|
1447
|
-
`),
|
|
1446
|
+
${es}
|
|
1447
|
+
`),id=eK((0,en.default)`
|
|
1448
1448
|
mutation ControllerClient_duplicateApplication(
|
|
1449
1449
|
$id: ID!
|
|
1450
1450
|
$includeVersions: Boolean
|
|
@@ -1458,12 +1458,12 @@ ${((e,i)=>{switch(e){case"defined_properties":return Object.entries(i).map(([e,i
|
|
|
1458
1458
|
...applicationArguments
|
|
1459
1459
|
}
|
|
1460
1460
|
}
|
|
1461
|
-
${
|
|
1462
|
-
`),
|
|
1461
|
+
${es}
|
|
1462
|
+
`),ic=eK((0,en.default)`
|
|
1463
1463
|
mutation ControllerClient_removeApplication($id: ID!) {
|
|
1464
1464
|
removeApplication(id: $id)
|
|
1465
1465
|
}
|
|
1466
|
-
`),
|
|
1466
|
+
`),il=eK((0,en.default)`
|
|
1467
1467
|
mutation ControllerClient_createModule(
|
|
1468
1468
|
$workspaceId: ID
|
|
1469
1469
|
$name: String
|
|
@@ -1489,8 +1489,8 @@ ${((e,i)=>{switch(e){case"defined_properties":return Object.entries(i).map(([e,i
|
|
|
1489
1489
|
...moduleArguments
|
|
1490
1490
|
}
|
|
1491
1491
|
}
|
|
1492
|
-
${
|
|
1493
|
-
`),
|
|
1492
|
+
${ec}
|
|
1493
|
+
`),ip=eK((0,en.default)`
|
|
1494
1494
|
mutation ControllerClient_updateModule(
|
|
1495
1495
|
$id: ID!
|
|
1496
1496
|
$name: String
|
|
@@ -1520,26 +1520,26 @@ ${((e,i)=>{switch(e){case"defined_properties":return Object.entries(i).map(([e,i
|
|
|
1520
1520
|
...moduleArguments
|
|
1521
1521
|
}
|
|
1522
1522
|
}
|
|
1523
|
-
${
|
|
1524
|
-
`),
|
|
1523
|
+
${ec}
|
|
1524
|
+
`),iu=eK((0,en.default)`
|
|
1525
1525
|
mutation ControllerClient_moveModule($id: ID!, $workspaceId: ID!) {
|
|
1526
1526
|
moveModule(id: $id, workspaceId: $workspaceId) {
|
|
1527
1527
|
...moduleArguments
|
|
1528
1528
|
}
|
|
1529
1529
|
}
|
|
1530
|
-
${
|
|
1531
|
-
`),
|
|
1530
|
+
${ec}
|
|
1531
|
+
`),im=eK((0,en.default)`
|
|
1532
1532
|
mutation ControllerClient_duplicateModule($id: ID!) {
|
|
1533
1533
|
duplicateModule(id: $id) {
|
|
1534
1534
|
...moduleArguments
|
|
1535
1535
|
}
|
|
1536
1536
|
}
|
|
1537
|
-
${
|
|
1538
|
-
`),
|
|
1537
|
+
${ec}
|
|
1538
|
+
`),i_=eK((0,en.default)`
|
|
1539
1539
|
mutation ControllerClient_removeModule($id: ID!) {
|
|
1540
1540
|
removeModule(id: $id)
|
|
1541
1541
|
}
|
|
1542
|
-
`),
|
|
1542
|
+
`),ig=eK((0,en.default)`
|
|
1543
1543
|
mutation ControllerClient_createConfigChangeOperation(
|
|
1544
1544
|
$applicationId: ID!
|
|
1545
1545
|
$config: JSON!
|
|
@@ -1549,12 +1549,12 @@ ${((e,i)=>{switch(e){case"defined_properties":return Object.entries(i).map(([e,i
|
|
|
1549
1549
|
...operationArguments
|
|
1550
1550
|
}
|
|
1551
1551
|
}
|
|
1552
|
-
${
|
|
1553
|
-
`),
|
|
1552
|
+
${eu}
|
|
1553
|
+
`),iy=eK((0,en.default)`
|
|
1554
1554
|
mutation ControllerClient_doOperation($id: ID!, $applicationId: ID!) {
|
|
1555
1555
|
doOperation(id: $id, applicationId: $applicationId)
|
|
1556
1556
|
}
|
|
1557
|
-
`),
|
|
1557
|
+
`),i$=eK((0,en.default)`
|
|
1558
1558
|
mutation ControllerClient_updateOperation(
|
|
1559
1559
|
$id: ID!
|
|
1560
1560
|
$applicationId: ID!
|
|
@@ -1565,12 +1565,12 @@ ${((e,i)=>{switch(e){case"defined_properties":return Object.entries(i).map(([e,i
|
|
|
1565
1565
|
...operationArguments
|
|
1566
1566
|
}
|
|
1567
1567
|
}
|
|
1568
|
-
${
|
|
1569
|
-
`),
|
|
1568
|
+
${eu}
|
|
1569
|
+
`),iv=eK((0,en.default)`
|
|
1570
1570
|
mutation ControllerClient_removeOperation($id: ID!, $applicationId: ID!) {
|
|
1571
1571
|
removeOperation(id: $id, applicationId: $applicationId)
|
|
1572
1572
|
}
|
|
1573
|
-
`),
|
|
1573
|
+
`),ih=eK((0,en.default)`
|
|
1574
1574
|
mutation ControllerClient_assignGroupPermissions(
|
|
1575
1575
|
$roleId: String!
|
|
1576
1576
|
$instanceType: String!
|
|
@@ -1584,18 +1584,18 @@ ${((e,i)=>{switch(e){case"defined_properties":return Object.entries(i).map(([e,i
|
|
|
1584
1584
|
permissions: $permissions
|
|
1585
1585
|
)
|
|
1586
1586
|
}
|
|
1587
|
-
`),
|
|
1587
|
+
`),ib=(0,en.default)`
|
|
1588
1588
|
mutation ControllerClient_registerFCMNotification($workspaceId: ID!, $token: String!) {
|
|
1589
1589
|
registerFCMNotification(workspaceId: $workspaceId, token: $token)
|
|
1590
1590
|
}
|
|
1591
|
-
`,
|
|
1591
|
+
`,iI=(0,en.default)`
|
|
1592
1592
|
mutation ControllerClient_registerRemoteDebug($deviceId: ID!) {
|
|
1593
1593
|
registerRemoteDebug(deviceId: $deviceId) {
|
|
1594
1594
|
deviceId
|
|
1595
1595
|
token
|
|
1596
1596
|
}
|
|
1597
1597
|
}
|
|
1598
|
-
`,
|
|
1598
|
+
`,ik=(0,en.default)`
|
|
1599
1599
|
mutation ControllerClient_shareAccessToken(
|
|
1600
1600
|
$workspaceId: ID
|
|
1601
1601
|
$passcode: String!
|
|
@@ -1603,7 +1603,7 @@ ${((e,i)=>{switch(e){case"defined_properties":return Object.entries(i).map(([e,i
|
|
|
1603
1603
|
) {
|
|
1604
1604
|
shareAccessToken(workspaceId: $workspaceId, passcode: $passcode, refreshToken: $refreshToken)
|
|
1605
1605
|
}
|
|
1606
|
-
`,
|
|
1606
|
+
`,iD=eK((0,en.default)`
|
|
1607
1607
|
mutation ControllerClient_addUserFavorite($instanceType: InstanceType!, $instanceId: ID!) {
|
|
1608
1608
|
addUserFavorite(instanceType: $instanceType, instanceId: $instanceId) {
|
|
1609
1609
|
_id
|
|
@@ -1616,11 +1616,11 @@ ${((e,i)=>{switch(e){case"defined_properties":return Object.entries(i).map(([e,i
|
|
|
1616
1616
|
last_modify_datetime
|
|
1617
1617
|
}
|
|
1618
1618
|
}
|
|
1619
|
-
`),
|
|
1619
|
+
`),iA=eK((0,en.default)`
|
|
1620
1620
|
mutation ControllerClient_removeUserFavorite($instanceType: InstanceType!, $instanceId: ID!) {
|
|
1621
1621
|
removeUserFavorite(instanceType: $instanceType, instanceId: $instanceId)
|
|
1622
1622
|
}
|
|
1623
|
-
`),
|
|
1623
|
+
`),iS=eK((0,en.default)`
|
|
1624
1624
|
mutation ControllerClient_changeWorkspaceSubscriptionPlan(
|
|
1625
1625
|
$workspaceId: ID!
|
|
1626
1626
|
$type: String!
|
|
@@ -1628,7 +1628,7 @@ ${((e,i)=>{switch(e){case"defined_properties":return Object.entries(i).map(([e,i
|
|
|
1628
1628
|
) {
|
|
1629
1629
|
changeWorkspaceSubscriptionPlan(workspaceId: $workspaceId, type: $type, period: $period)
|
|
1630
1630
|
}
|
|
1631
|
-
`),
|
|
1631
|
+
`),iw=eK((0,en.default)`
|
|
1632
1632
|
mutation ControllerClient_changeWorkspaceAdditionalLimitSpending(
|
|
1633
1633
|
$workspaceId: ID!
|
|
1634
1634
|
$boundDevicesLimit: Float
|
|
@@ -1640,7 +1640,7 @@ ${((e,i)=>{switch(e){case"defined_properties":return Object.entries(i).map(([e,i
|
|
|
1640
1640
|
groupMembersLimit: $groupMembersLimit
|
|
1641
1641
|
)
|
|
1642
1642
|
}
|
|
1643
|
-
`),
|
|
1643
|
+
`),iC=(0,en.default)`
|
|
1644
1644
|
mutation ControllerClient_createWorkspaceOTP(
|
|
1645
1645
|
$workspaceId: ID!
|
|
1646
1646
|
$tokenTypes: [WorkspaceTokenType]!
|
|
@@ -1652,32 +1652,32 @@ ${((e,i)=>{switch(e){case"defined_properties":return Object.entries(i).map(([e,i
|
|
|
1652
1652
|
expired_datetime
|
|
1653
1653
|
}
|
|
1654
1654
|
}
|
|
1655
|
-
`,
|
|
1655
|
+
`,iT=(0,en.default)`
|
|
1656
1656
|
mutation ControllerClient_revokeWorkspaceOTP($id: ID!) {
|
|
1657
1657
|
revokeWorkspaceOTP(id: $id)
|
|
1658
1658
|
}
|
|
1659
|
-
`;function
|
|
1659
|
+
`;function ix(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(e){}return(ix=function(){return!!e})()}var iB=function(e){function i(e,t){var n,a,o;return H(this,i),a=i,o=[e,t,"/api/graphql",l,p],a=X(a),(n=J(this,ix()?Reflect.construct(a,o||[],X(this).constructor):a.apply(this,o))).tokenType="user",n}return Q(i,e),z(i)}(eI),iE=(0,en.default)`
|
|
1660
1660
|
query Workspace_workspace {
|
|
1661
1661
|
workspace {
|
|
1662
1662
|
...mcpWorkspaceArguments
|
|
1663
1663
|
}
|
|
1664
1664
|
}
|
|
1665
|
-
${
|
|
1666
|
-
`,
|
|
1665
|
+
${e_}
|
|
1666
|
+
`,iU=(0,en.default)`
|
|
1667
1667
|
query Workspace_applications($keyword: String, $paginate: Paginate) {
|
|
1668
1668
|
applications(keyword: $keyword, paginate: $paginate) {
|
|
1669
1669
|
...mcpApplicationShortArguments
|
|
1670
1670
|
}
|
|
1671
1671
|
}
|
|
1672
|
-
${
|
|
1673
|
-
`,
|
|
1672
|
+
${ef}
|
|
1673
|
+
`,iM=(0,en.default)`
|
|
1674
1674
|
query Workspace_application($id: ID!, $composed: Boolean, $debug: Boolean) {
|
|
1675
1675
|
application(id: $id, composed: $composed, debug: $debug) {
|
|
1676
1676
|
...applicationArguments
|
|
1677
1677
|
}
|
|
1678
1678
|
}
|
|
1679
|
-
${
|
|
1680
|
-
`,
|
|
1679
|
+
${es}
|
|
1680
|
+
`,iR=(0,en.default)`
|
|
1681
1681
|
query Workspace_applicationByDevice(
|
|
1682
1682
|
$deviceId: ID!
|
|
1683
1683
|
$composeModule: Boolean
|
|
@@ -1693,43 +1693,43 @@ ${((e,i)=>{switch(e){case"defined_properties":return Object.entries(i).map(([e,i
|
|
|
1693
1693
|
...applicationArguments
|
|
1694
1694
|
}
|
|
1695
1695
|
}
|
|
1696
|
-
${
|
|
1697
|
-
`,
|
|
1696
|
+
${es}
|
|
1697
|
+
`,iP=(0,en.default)`
|
|
1698
1698
|
query Workspace_modules($keyword: String, $paginate: Paginate) {
|
|
1699
1699
|
modules(keyword: $keyword, paginate: $paginate) {
|
|
1700
1700
|
...moduleShortArguments
|
|
1701
1701
|
}
|
|
1702
1702
|
}
|
|
1703
|
-
${
|
|
1704
|
-
`,
|
|
1703
|
+
${el}
|
|
1704
|
+
`,iO=(0,en.default)`
|
|
1705
1705
|
query Workspace_module($id: ID!) {
|
|
1706
1706
|
module(id: $id) {
|
|
1707
1707
|
...moduleArguments
|
|
1708
1708
|
}
|
|
1709
1709
|
}
|
|
1710
|
-
${
|
|
1711
|
-
`,
|
|
1710
|
+
${ec}
|
|
1711
|
+
`,iF=(0,en.default)`
|
|
1712
1712
|
query Workspace_devices($keyword: String, $paginate: Paginate) {
|
|
1713
1713
|
devices(keyword: $keyword, paginate: $paginate) {
|
|
1714
1714
|
...deviceArguments
|
|
1715
1715
|
}
|
|
1716
1716
|
}
|
|
1717
|
-
${
|
|
1718
|
-
`,
|
|
1717
|
+
${eo}
|
|
1718
|
+
`,iN=(0,en.default)`
|
|
1719
1719
|
query Workspace_device($id: ID) {
|
|
1720
1720
|
device(id: $id) {
|
|
1721
1721
|
...deviceArguments
|
|
1722
1722
|
}
|
|
1723
1723
|
}
|
|
1724
|
-
${
|
|
1725
|
-
`,
|
|
1724
|
+
${eo}
|
|
1725
|
+
`,iq=(0,en.default)`
|
|
1726
1726
|
query Workspace_devicesByApplication($id: ID!) {
|
|
1727
1727
|
devicesByApplication(id: $id) {
|
|
1728
1728
|
...deviceArguments
|
|
1729
1729
|
}
|
|
1730
1730
|
}
|
|
1731
|
-
${
|
|
1732
|
-
`,
|
|
1731
|
+
${eo}
|
|
1732
|
+
`,iW=(0,en.default)`
|
|
1733
1733
|
query Workspace_deviceUsage($deviceId: ID, $startDate: Date, $endDate: Date) {
|
|
1734
1734
|
deviceUsage(deviceId: $deviceId, startDate: $startDate, endDate: $endDate) {
|
|
1735
1735
|
_id
|
|
@@ -1748,28 +1748,28 @@ ${((e,i)=>{switch(e){case"defined_properties":return Object.entries(i).map(([e,i
|
|
|
1748
1748
|
}
|
|
1749
1749
|
}
|
|
1750
1750
|
}
|
|
1751
|
-
`,
|
|
1751
|
+
`,ij=(0,en.default)`
|
|
1752
1752
|
query Workspace_mediaWorkspace {
|
|
1753
1753
|
mediaWorkspace {
|
|
1754
1754
|
...workspaceMediaWorkspaceArguments
|
|
1755
1755
|
}
|
|
1756
1756
|
}
|
|
1757
|
-
${
|
|
1758
|
-
`,
|
|
1757
|
+
${e$}
|
|
1758
|
+
`,iV=(0,en.default)`
|
|
1759
1759
|
query Workspace_mediaBoxes {
|
|
1760
1760
|
mediaBoxes {
|
|
1761
1761
|
...workspaceMediaBoxArguments
|
|
1762
1762
|
}
|
|
1763
1763
|
}
|
|
1764
|
-
${
|
|
1765
|
-
`,
|
|
1764
|
+
${ev}
|
|
1765
|
+
`,iK=(0,en.default)`
|
|
1766
1766
|
query Workspace_mediaBox($boxId: ID!) {
|
|
1767
1767
|
mediaBox(id: $boxId) {
|
|
1768
1768
|
...workspaceMediaBoxArguments
|
|
1769
1769
|
}
|
|
1770
1770
|
}
|
|
1771
|
-
${
|
|
1772
|
-
`,
|
|
1771
|
+
${ev}
|
|
1772
|
+
`,iY=(0,en.default)`
|
|
1773
1773
|
query Workspace_mediaFiles(
|
|
1774
1774
|
$boxId: ID!
|
|
1775
1775
|
$includeTypes: [String]
|
|
@@ -1787,15 +1787,15 @@ ${((e,i)=>{switch(e){case"defined_properties":return Object.entries(i).map(([e,i
|
|
|
1787
1787
|
...workspaceMediaFileArguments
|
|
1788
1788
|
}
|
|
1789
1789
|
}
|
|
1790
|
-
${
|
|
1791
|
-
`,
|
|
1790
|
+
${eh}
|
|
1791
|
+
`,iG=(0,en.default)`
|
|
1792
1792
|
query Workspace_mediaFile($id: ID!) {
|
|
1793
1793
|
mediaFile(id: $id) {
|
|
1794
1794
|
...workspaceMediaFileArguments
|
|
1795
1795
|
}
|
|
1796
1796
|
}
|
|
1797
|
-
${
|
|
1798
|
-
`,
|
|
1797
|
+
${eh}
|
|
1798
|
+
`,iL=(0,en.default)`
|
|
1799
1799
|
mutation Workspace_createApplication(
|
|
1800
1800
|
$name: String
|
|
1801
1801
|
$description: String
|
|
@@ -1812,8 +1812,8 @@ ${((e,i)=>{switch(e){case"defined_properties":return Object.entries(i).map(([e,i
|
|
|
1812
1812
|
config
|
|
1813
1813
|
}
|
|
1814
1814
|
}
|
|
1815
|
-
${
|
|
1816
|
-
`,
|
|
1815
|
+
${ef}
|
|
1816
|
+
`,iz=(0,en.default)`
|
|
1817
1817
|
mutation Workspace_updateApplication(
|
|
1818
1818
|
$id: ID!
|
|
1819
1819
|
$config: String
|
|
@@ -1833,8 +1833,8 @@ ${((e,i)=>{switch(e){case"defined_properties":return Object.entries(i).map(([e,i
|
|
|
1833
1833
|
has_unreleased_changes
|
|
1834
1834
|
}
|
|
1835
1835
|
}
|
|
1836
|
-
${
|
|
1837
|
-
`,
|
|
1836
|
+
${ef}
|
|
1837
|
+
`,iH=(0,en.default)`
|
|
1838
1838
|
mutation Workspace_bindApplication($id: ID!, $bindDevices: [ID], $deviceFrames: JSON) {
|
|
1839
1839
|
bindApplication(id: $id, bindDevices: $bindDevices, deviceFrames: $deviceFrames) {
|
|
1840
1840
|
_id
|
|
@@ -1845,7 +1845,7 @@ ${((e,i)=>{switch(e){case"defined_properties":return Object.entries(i).map(([e,i
|
|
|
1845
1845
|
}
|
|
1846
1846
|
}
|
|
1847
1847
|
}
|
|
1848
|
-
`,
|
|
1848
|
+
`,iJ=(0,en.default)`
|
|
1849
1849
|
mutation Workspace_unbindApplication($id: ID!, $unbindDevices: [ID]) {
|
|
1850
1850
|
bindApplication(id: $id, unbindDevices: $unbindDevices) {
|
|
1851
1851
|
_id
|
|
@@ -1856,7 +1856,7 @@ ${((e,i)=>{switch(e){case"defined_properties":return Object.entries(i).map(([e,i
|
|
|
1856
1856
|
}
|
|
1857
1857
|
}
|
|
1858
1858
|
}
|
|
1859
|
-
`,
|
|
1859
|
+
`,iX=(0,en.default)`
|
|
1860
1860
|
mutation Workspace_createModule(
|
|
1861
1861
|
$name: String
|
|
1862
1862
|
$description: String
|
|
@@ -1878,8 +1878,8 @@ ${((e,i)=>{switch(e){case"defined_properties":return Object.entries(i).map(([e,i
|
|
|
1878
1878
|
...moduleArguments
|
|
1879
1879
|
}
|
|
1880
1880
|
}
|
|
1881
|
-
${
|
|
1882
|
-
`,
|
|
1881
|
+
${ec}
|
|
1882
|
+
`,iQ=(0,en.default)`
|
|
1883
1883
|
mutation Workspace_updateModule(
|
|
1884
1884
|
$id: ID!
|
|
1885
1885
|
$config: String
|
|
@@ -1897,8 +1897,8 @@ ${((e,i)=>{switch(e){case"defined_properties":return Object.entries(i).map(([e,i
|
|
|
1897
1897
|
...moduleArguments
|
|
1898
1898
|
}
|
|
1899
1899
|
}
|
|
1900
|
-
${
|
|
1901
|
-
`,
|
|
1900
|
+
${ec}
|
|
1901
|
+
`,iZ=(0,en.default)`
|
|
1902
1902
|
mutation Workspace_createMediaFileUploadRequest(
|
|
1903
1903
|
$name: String!
|
|
1904
1904
|
$description: String!
|
|
@@ -1929,7 +1929,7 @@ ${((e,i)=>{switch(e){case"defined_properties":return Object.entries(i).map(([e,i
|
|
|
1929
1929
|
}
|
|
1930
1930
|
}
|
|
1931
1931
|
}
|
|
1932
|
-
`,
|
|
1932
|
+
`,i0=(0,en.default)`
|
|
1933
1933
|
mutation Workspace_updateMediaFile(
|
|
1934
1934
|
$id: ID!
|
|
1935
1935
|
$name: String
|
|
@@ -1951,7 +1951,7 @@ ${((e,i)=>{switch(e){case"defined_properties":return Object.entries(i).map(([e,i
|
|
|
1951
1951
|
updatedAt
|
|
1952
1952
|
}
|
|
1953
1953
|
}
|
|
1954
|
-
`,
|
|
1954
|
+
`,i1=(0,en.default)`
|
|
1955
1955
|
mutation Workspace_updateMediaFiles(
|
|
1956
1956
|
$fileIds: [ID!]!
|
|
1957
1957
|
$name: String
|
|
@@ -1960,23 +1960,23 @@ ${((e,i)=>{switch(e){case"defined_properties":return Object.entries(i).map(([e,i
|
|
|
1960
1960
|
) {
|
|
1961
1961
|
updateMediaFiles(fileIds: $fileIds, name: $name, description: $description, userTags: $userTags)
|
|
1962
1962
|
}
|
|
1963
|
-
`,
|
|
1963
|
+
`,i4=(0,en.default)`
|
|
1964
1964
|
mutation Workspace_setMediaFileAsBoxPreview($id: ID!) {
|
|
1965
1965
|
setMediaFileAsBoxPreview(id: $id)
|
|
1966
1966
|
}
|
|
1967
|
-
`,
|
|
1967
|
+
`,i6=(0,en.default)`
|
|
1968
1968
|
mutation Workspace_copyMediaFiles($fromBoxId: ID!, $toBoxId: ID!, $fileIds: [ID!]!) {
|
|
1969
1969
|
copyMediaFiles(fromBoxId: $fromBoxId, toBoxId: $toBoxId, fileIds: $fileIds)
|
|
1970
1970
|
}
|
|
1971
|
-
`,
|
|
1971
|
+
`,i2=(0,en.default)`
|
|
1972
1972
|
mutation Workspace_deleteMediaFiles($boxId: ID!, $fileIds: [ID!]!) {
|
|
1973
1973
|
deleteMediaFiles(boxId: $boxId, fileIds: $fileIds)
|
|
1974
1974
|
}
|
|
1975
|
-
`,
|
|
1975
|
+
`,i5=(0,en.default)`
|
|
1976
1976
|
mutation Workspace_deleteMediaBoxFiles($boxId: ID!, $includeTypes: [String]) {
|
|
1977
1977
|
deleteMediaBoxFiles(boxId: $boxId, includeTypes: $includeTypes)
|
|
1978
1978
|
}
|
|
1979
|
-
`;function
|
|
1979
|
+
`;function i9(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(e){}return(i9=function(){return!!e})()}var i3=function(e){function i(e,t){var n,a,o;return H(this,i),a=i,o=[e,t,"/api/graphql-workspace",u,m],a=X(a),(n=J(this,i9()?Reflect.construct(a,o||[],X(this).constructor):a.apply(this,o))).tokenType="workspace",n}return Q(i,e),z(i)}(eI),i8=t(19074),i7=t(36054),te=t(78342),ti=t(74114),tt=t(42028),tn=t(99815),ta=t(79556),to=t(17681),tr=t.n(to),ts=t(10655);let td=(0,en.default)`
|
|
1980
1980
|
fragment mediaWorkspaceArguments on MediaWorkspace {
|
|
1981
1981
|
__typename
|
|
1982
1982
|
id
|
|
@@ -1990,7 +1990,7 @@ ${((e,i)=>{switch(e){case"defined_properties":return Object.entries(i).map(([e,i
|
|
|
1990
1990
|
sizeLimit
|
|
1991
1991
|
aiFeaturesEnabled
|
|
1992
1992
|
}
|
|
1993
|
-
`,
|
|
1993
|
+
`,tc=(0,en.default)`
|
|
1994
1994
|
fragment boxArguments on MediaBox {
|
|
1995
1995
|
__typename
|
|
1996
1996
|
id
|
|
@@ -2015,7 +2015,7 @@ ${((e,i)=>{switch(e){case"defined_properties":return Object.entries(i).map(([e,i
|
|
|
2015
2015
|
previewUrl
|
|
2016
2016
|
size
|
|
2017
2017
|
}
|
|
2018
|
-
`,
|
|
2018
|
+
`,tl=(0,en.default)`
|
|
2019
2019
|
fragment fileArguments on MediaFile {
|
|
2020
2020
|
__typename
|
|
2021
2021
|
id
|
|
@@ -2072,7 +2072,7 @@ ${((e,i)=>{switch(e){case"defined_properties":return Object.entries(i).map(([e,i
|
|
|
2072
2072
|
createdAt
|
|
2073
2073
|
updatedAt
|
|
2074
2074
|
}
|
|
2075
|
-
`,
|
|
2075
|
+
`,tp=(0,en.default)`
|
|
2076
2076
|
fragment fileShortArguments on MediaFile {
|
|
2077
2077
|
__typename
|
|
2078
2078
|
id
|
|
@@ -2120,35 +2120,35 @@ ${((e,i)=>{switch(e){case"defined_properties":return Object.entries(i).map(([e,i
|
|
|
2120
2120
|
createdAt
|
|
2121
2121
|
updatedAt
|
|
2122
2122
|
}
|
|
2123
|
-
`,
|
|
2123
|
+
`,tu=(0,en.default)`
|
|
2124
2124
|
query MediaClient_workspaces {
|
|
2125
2125
|
mediaWorkspaces {
|
|
2126
2126
|
...mediaWorkspaceArguments
|
|
2127
2127
|
}
|
|
2128
2128
|
}
|
|
2129
|
-
${
|
|
2130
|
-
`,
|
|
2129
|
+
${td}
|
|
2130
|
+
`,tm=(0,en.default)`
|
|
2131
2131
|
query MediaClient_boxes($workspaceId: UUID, $filter: String) {
|
|
2132
2132
|
mediaBoxes(workspaceId: $workspaceId, filter: $filter) {
|
|
2133
2133
|
...boxArguments
|
|
2134
2134
|
}
|
|
2135
2135
|
}
|
|
2136
|
-
${
|
|
2137
|
-
`,
|
|
2136
|
+
${tc}
|
|
2137
|
+
`,t_=(0,en.default)`
|
|
2138
2138
|
query MediaClient_workspace($workspaceId: UUID!) {
|
|
2139
2139
|
mediaWorkspace(id: $workspaceId) {
|
|
2140
2140
|
...mediaWorkspaceArguments
|
|
2141
2141
|
}
|
|
2142
2142
|
}
|
|
2143
|
-
${
|
|
2144
|
-
`,
|
|
2143
|
+
${td}
|
|
2144
|
+
`,tg=(0,en.default)`
|
|
2145
2145
|
query MediaClient_box($boxId: UUID!) {
|
|
2146
2146
|
mediaBox(boxId: $boxId) {
|
|
2147
2147
|
...boxArguments
|
|
2148
2148
|
}
|
|
2149
2149
|
}
|
|
2150
|
-
${
|
|
2151
|
-
`,
|
|
2150
|
+
${tc}
|
|
2151
|
+
`,tf=(0,en.default)`
|
|
2152
2152
|
query MediaClient_files(
|
|
2153
2153
|
$boxId: UUID!
|
|
2154
2154
|
$includeTypes: [FileType!]
|
|
@@ -2166,29 +2166,29 @@ ${((e,i)=>{switch(e){case"defined_properties":return Object.entries(i).map(([e,i
|
|
|
2166
2166
|
...fileShortArguments
|
|
2167
2167
|
}
|
|
2168
2168
|
}
|
|
2169
|
-
${
|
|
2170
|
-
`,
|
|
2169
|
+
${tp}
|
|
2170
|
+
`,ty=(0,en.default)`
|
|
2171
2171
|
query MediaClient_file($fileId: UUID!) {
|
|
2172
2172
|
mediaFile(fileId: $fileId) {
|
|
2173
2173
|
...fileArguments
|
|
2174
2174
|
}
|
|
2175
2175
|
}
|
|
2176
|
-
${
|
|
2177
|
-
`,
|
|
2176
|
+
${tl}
|
|
2177
|
+
`,t$=(0,en.default)`
|
|
2178
2178
|
mutation MediaClient_createMediaWorkspace($name: String!, $description: String!) {
|
|
2179
2179
|
createMediaWorkspace(name: $name, description: $description) {
|
|
2180
2180
|
...mediaWorkspaceArguments
|
|
2181
2181
|
}
|
|
2182
2182
|
}
|
|
2183
|
-
${
|
|
2184
|
-
`,
|
|
2183
|
+
${td}
|
|
2184
|
+
`,tv=(0,en.default)`
|
|
2185
2185
|
mutation MediaClient_updateMediaWorkspace($id: UUID!, $name: String, $description: String) {
|
|
2186
2186
|
updateMediaWorkspace(id: $id, name: $name, description: $description) {
|
|
2187
2187
|
...mediaWorkspaceArguments
|
|
2188
2188
|
}
|
|
2189
2189
|
}
|
|
2190
|
-
${
|
|
2191
|
-
`,
|
|
2190
|
+
${td}
|
|
2191
|
+
`,th=(0,en.default)`
|
|
2192
2192
|
mutation MediaClient_createMediaBox(
|
|
2193
2193
|
$name: String!
|
|
2194
2194
|
$description: String!
|
|
@@ -2206,15 +2206,15 @@ ${((e,i)=>{switch(e){case"defined_properties":return Object.entries(i).map(([e,i
|
|
|
2206
2206
|
...boxArguments
|
|
2207
2207
|
}
|
|
2208
2208
|
}
|
|
2209
|
-
${
|
|
2210
|
-
`,
|
|
2209
|
+
${tc}
|
|
2210
|
+
`,tb=(0,en.default)`
|
|
2211
2211
|
mutation MediaClient_moveMediaBox($id: UUID!, $workspaceId: UUID) {
|
|
2212
2212
|
moveMediaBox(id: $id, workspaceId: $workspaceId) {
|
|
2213
2213
|
...boxArguments
|
|
2214
2214
|
}
|
|
2215
2215
|
}
|
|
2216
|
-
${
|
|
2217
|
-
`,
|
|
2216
|
+
${tc}
|
|
2217
|
+
`,tI=(0,en.default)`
|
|
2218
2218
|
mutation MediaClient_updateMediaBox(
|
|
2219
2219
|
$id: UUID!
|
|
2220
2220
|
$name: String
|
|
@@ -2234,8 +2234,8 @@ ${((e,i)=>{switch(e){case"defined_properties":return Object.entries(i).map(([e,i
|
|
|
2234
2234
|
...boxArguments
|
|
2235
2235
|
}
|
|
2236
2236
|
}
|
|
2237
|
-
${
|
|
2238
|
-
`,
|
|
2237
|
+
${tc}
|
|
2238
|
+
`,tk=(0,en.default)`
|
|
2239
2239
|
mutation MediaClient_requestFileUpload(
|
|
2240
2240
|
$name: String!
|
|
2241
2241
|
$description: String!
|
|
@@ -2257,8 +2257,8 @@ ${((e,i)=>{switch(e){case"defined_properties":return Object.entries(i).map(([e,i
|
|
|
2257
2257
|
...fileArguments
|
|
2258
2258
|
}
|
|
2259
2259
|
}
|
|
2260
|
-
${
|
|
2261
|
-
`,
|
|
2260
|
+
${tl}
|
|
2261
|
+
`,tD=(0,en.default)`
|
|
2262
2262
|
mutation MediaClient_updateMediaFile(
|
|
2263
2263
|
$fileId: UUID!
|
|
2264
2264
|
$name: String!
|
|
@@ -2276,8 +2276,8 @@ ${((e,i)=>{switch(e){case"defined_properties":return Object.entries(i).map(([e,i
|
|
|
2276
2276
|
...fileArguments
|
|
2277
2277
|
}
|
|
2278
2278
|
}
|
|
2279
|
-
${
|
|
2280
|
-
`,
|
|
2279
|
+
${tl}
|
|
2280
|
+
`,tA=(0,en.default)`
|
|
2281
2281
|
mutation MediaClient_updateMediaFiles(
|
|
2282
2282
|
$fileIds: [UUID!]!
|
|
2283
2283
|
$name: String
|
|
@@ -2286,19 +2286,19 @@ ${((e,i)=>{switch(e){case"defined_properties":return Object.entries(i).map(([e,i
|
|
|
2286
2286
|
) {
|
|
2287
2287
|
updateMediaFiles(fileIds: $fileIds, name: $name, description: $description, userTags: $userTags)
|
|
2288
2288
|
}
|
|
2289
|
-
`,
|
|
2289
|
+
`,tS=(0,en.default)`
|
|
2290
2290
|
mutation MediaClient_deleteMediaFiles($boxId: UUID!, $list: [UUID!]!) {
|
|
2291
2291
|
deleteMediaFiles(boxId: $boxId, list: $list)
|
|
2292
2292
|
}
|
|
2293
|
-
`,
|
|
2293
|
+
`,tw=(0,en.default)`
|
|
2294
2294
|
mutation MediaClient_copyMediaFiles($fromBoxId: UUID!, $toBoxId: UUID!, $list: [UUID!]!) {
|
|
2295
2295
|
copyMediaFiles(fromBoxId: $fromBoxId, toBoxId: $toBoxId, list: $list)
|
|
2296
2296
|
}
|
|
2297
|
-
`,
|
|
2297
|
+
`,tC=(0,en.default)`
|
|
2298
2298
|
mutation MediaClient_setMediaFileAsBoxPreview($id: UUID!) {
|
|
2299
2299
|
setMediaFileAsBoxPreview(id: $id)
|
|
2300
2300
|
}
|
|
2301
|
-
`,
|
|
2301
|
+
`,tT=(0,en.default)`
|
|
2302
2302
|
mutation MediaClient_assignGroupPermissions(
|
|
2303
2303
|
$roleId: String!
|
|
2304
2304
|
$instanceType: InstanceType!
|
|
@@ -2312,7 +2312,7 @@ ${((e,i)=>{switch(e){case"defined_properties":return Object.entries(i).map(([e,i
|
|
|
2312
2312
|
permissions: $permissions
|
|
2313
2313
|
)
|
|
2314
2314
|
}
|
|
2315
|
-
`,
|
|
2315
|
+
`,tx=(0,en.default)`
|
|
2316
2316
|
subscription MediaClient_listenBoxChanged($boxId: UUID!, $types: [ChangeType!]) {
|
|
2317
2317
|
mediaBoxChanged(boxId: $boxId, types: $types) {
|
|
2318
2318
|
createType
|
|
@@ -2326,15 +2326,15 @@ ${((e,i)=>{switch(e){case"defined_properties":return Object.entries(i).map(([e,i
|
|
|
2326
2326
|
}
|
|
2327
2327
|
}
|
|
2328
2328
|
}
|
|
2329
|
-
${
|
|
2330
|
-
`,
|
|
2329
|
+
${tl}
|
|
2330
|
+
`,tB=(0,en.default)`
|
|
2331
2331
|
query MediaClient_box($boxId: UUID!, $passcode: String!) {
|
|
2332
2332
|
mediaBox(boxId: $boxId, passcode: $passcode) {
|
|
2333
2333
|
...boxArguments
|
|
2334
2334
|
}
|
|
2335
2335
|
}
|
|
2336
|
-
${
|
|
2337
|
-
`,
|
|
2336
|
+
${tc}
|
|
2337
|
+
`,tE=(0,en.default)`
|
|
2338
2338
|
query MediaClient_files(
|
|
2339
2339
|
$boxId: UUID!
|
|
2340
2340
|
$passcode: String!
|
|
@@ -2354,15 +2354,15 @@ ${((e,i)=>{switch(e){case"defined_properties":return Object.entries(i).map(([e,i
|
|
|
2354
2354
|
...fileShortArguments
|
|
2355
2355
|
}
|
|
2356
2356
|
}
|
|
2357
|
-
${
|
|
2358
|
-
`,
|
|
2357
|
+
${tp}
|
|
2358
|
+
`,tU=(0,en.default)`
|
|
2359
2359
|
query MediaClient_file($fileId: UUID!, $passcode: String!) {
|
|
2360
2360
|
mediaFile(fileId: $fileId, passcode: $passcode) {
|
|
2361
2361
|
...fileArguments
|
|
2362
2362
|
}
|
|
2363
2363
|
}
|
|
2364
|
-
${
|
|
2365
|
-
`,
|
|
2364
|
+
${tl}
|
|
2365
|
+
`,tM=(0,en.default)`
|
|
2366
2366
|
mutation MediaClient_requestFileUpload(
|
|
2367
2367
|
$name: String!
|
|
2368
2368
|
$description: String!
|
|
@@ -2386,8 +2386,8 @@ ${((e,i)=>{switch(e){case"defined_properties":return Object.entries(i).map(([e,i
|
|
|
2386
2386
|
...fileArguments
|
|
2387
2387
|
}
|
|
2388
2388
|
}
|
|
2389
|
-
${
|
|
2390
|
-
`,
|
|
2389
|
+
${tl}
|
|
2390
|
+
`,tR=(0,en.default)`
|
|
2391
2391
|
mutation MediaClient_updateMediaFile(
|
|
2392
2392
|
$boxId: UUID!
|
|
2393
2393
|
$passcode: String!
|
|
@@ -2409,8 +2409,8 @@ ${((e,i)=>{switch(e){case"defined_properties":return Object.entries(i).map(([e,i
|
|
|
2409
2409
|
...fileArguments
|
|
2410
2410
|
}
|
|
2411
2411
|
}
|
|
2412
|
-
${
|
|
2413
|
-
`,
|
|
2412
|
+
${tl}
|
|
2413
|
+
`,tP=(0,en.default)`
|
|
2414
2414
|
mutation MediaClient_updateMediaFiles(
|
|
2415
2415
|
$boxId: UUID!
|
|
2416
2416
|
$passcode: String!
|
|
@@ -2428,11 +2428,11 @@ ${((e,i)=>{switch(e){case"defined_properties":return Object.entries(i).map(([e,i
|
|
|
2428
2428
|
userTags: $userTags
|
|
2429
2429
|
)
|
|
2430
2430
|
}
|
|
2431
|
-
`,
|
|
2431
|
+
`,tO=(0,en.default)`
|
|
2432
2432
|
mutation MediaClient_deleteMediaFiles($boxId: UUID!, $passcode: String!, $list: [UUID!]!) {
|
|
2433
2433
|
deleteMediaFiles(boxId: $boxId, passcode: $passcode, list: $list)
|
|
2434
2434
|
}
|
|
2435
|
-
`,
|
|
2435
|
+
`,tF=(0,en.default)`
|
|
2436
2436
|
subscription MediaClient_listenBoxChanged(
|
|
2437
2437
|
$boxId: UUID!
|
|
2438
2438
|
$passcode: String!
|
|
@@ -2450,8 +2450,8 @@ ${((e,i)=>{switch(e){case"defined_properties":return Object.entries(i).map(([e,i
|
|
|
2450
2450
|
}
|
|
2451
2451
|
}
|
|
2452
2452
|
}
|
|
2453
|
-
${
|
|
2454
|
-
`,
|
|
2453
|
+
${tl}
|
|
2454
|
+
`,tN={query:"query",mutation:"mutate"},tq=(e,i,t)=>([n,a])=>{if(e[n])throw Error(`Overwriting client.${n}`);e[n]=async(o,r={})=>{let s,d,c={[i]:a,variables:o,...r};if(t&&(c.variables={...t,...c.variables}),r.readQuery)s=e.readQuery(c);else if(r.writeQuery)e.writeQuery({...c,data:r.writeQuery});else{let t=await e[tN[i]](c);({data:s,errors:d}=t||{})}if(d)throw Error(d.map(e=>e.message).join("\n"));return s?s[n]:null}},tW=e=>({data:i,errors:t})=>{var n;let a=(n=!i?.mediaBoxChanged&&"Missing mediaBoxChanged payload",t?.length?Error(t.map(e=>e.message).join("\n")):n?Error(n):null);return a?e(a):e(null,i.mediaBoxChanged)};var tj=`
|
|
2455
2455
|
query AL_events($filter: EventsFilter!) {
|
|
2456
2456
|
events(filter: $filter) {
|
|
2457
2457
|
device_id
|
|
@@ -2463,13 +2463,13 @@ ${((e,i)=>{switch(e){case"defined_properties":return Object.entries(i).map(([e,i
|
|
|
2463
2463
|
timestamp
|
|
2464
2464
|
}
|
|
2465
2465
|
}
|
|
2466
|
-
`,
|
|
2466
|
+
`,tV=`
|
|
2467
2467
|
query AL_screenshots($filter: ScreenshotFilter!) {
|
|
2468
2468
|
screenshots(filter: $filter) {
|
|
2469
2469
|
timestamp
|
|
2470
2470
|
}
|
|
2471
2471
|
}
|
|
2472
|
-
`,tz=H(function e(i,t){J(this,e),this.baseUrl=i,this.token=t,this.graphqlUrl=`${i}/api/graphql`},[{key:"graphql",value:(o=v(function*(e,i){var t=yield(0,B.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 Error(`Activity-log query failed (${t.status}): ${n}`)}var a=yield t.json();if(a.errors?.length)throw Error(a.errors.map(e=>e.message).join("\n"));return a.data}),function(e,i){return o.apply(this,arguments)})},{key:"events",value:(r=v(function*(e,{limit:i,offset:t}={}){var n={...e};return null!=i&&(n.limit=i),null!=t&&(n.offset=t),(yield this.graphql(tG,{filter:n})).events}),function(e){return r.apply(this,arguments)})},{key:"screenshots",value:(s=v(function*(e){return(yield this.graphql(tL,{filter:e})).screenshots}),function(e){return s.apply(this,arguments)})},{key:"downloadScreenshot",value:(d=v(function*(e,i,t){var n=`${this.baseUrl}/api/v1/${encodeURIComponent(e)}/${encodeURIComponent(i)}/screenshot?ts=${encodeURIComponent(t)}`,a=yield(0,B.Ay)(n,{headers:{Authorization:`Bearer ${this.token}`}});if(!a.ok){var o=yield a.text().catch(()=>"");throw Error(`Screenshot fetch failed (${a.status}): ${o}`)}return Buffer.from((yield a.arrayBuffer()))}),function(e,i,t){return d.apply(this,arguments)})}]);process.env.STAGE,process.env.URL_BASE;var tH="bricks-mcp",tJ={bricks:process.env.BRICKS_API_SERVER||"https://display-beta.bricks.tools",media:process.env.MEDIA_API_SERVER||"https://media-beta.bricks.tools",activityLog:process.env.ACTIVITY_LOG_API_SERVER||"https://activity-log-beta.bricks.tools"};process.env.AUTH0_DOMAIN,process.env.CACHE_URL;var tX=t(1639);let tQ=({type:e,title:i,template_key:t})=>{var n,a,o=(0,tX.M4)(e);switch(e){case"subspace":n={title:i,layout:{width:"number",height:"number"},root_canvas_id:"CANVAS_<UUID>",canvas_map:{},brick_map:{},animation_map:{},generator_map:{},property_bank_map:{},property_bank_calc_map:{}},a={"canvas_map.CANVAS_<UUID>.item_list":[{type:"subspace",subspace_id:"SUBSPACE_<UUID>",$note:"If not a root subspace, it can be linked to canvas in other subspace"}]};break;case"canvas":var r=V(j.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,tX.M4)("property_bank")]:{title:`Canvas ID: ${i}`,type:"string",value:o,routing:"read-only",kind:"auto-generated-item-id",idType:"canvas"}}};break;case"brick":var s=V(j.dK.Basic),d=V(j.brickMapping[t]);if(!d)throw Error(`Brick ${t} not found`);var c={...d,propTypes:{...s.propTypes,...d.propTypes},brickPropDescriptions:{...s.brickPropDescriptions,...d.brickPropDescriptions},eventTypes:{...s.eventTypes,...d.eventTypes},brickEventDescriptions:{...s.brickEventDescriptions,...d.brickEventDescriptions}};n={title:i,template_key:t,property:{$definitions:Object.fromEntries(Object.entries(c.propTypes).map(([e,i])=>[e,{...i,description:c.brickPropDescriptions[e]}]))},event_map:{$definitions:Object.fromEntries(Object.entries(c.eventTypes).map(([e])=>[e,{description:c.brickEventDescriptions[e]}]))},outlet:{$definitions:Object.fromEntries(Object.entries(c.outletTypes).map(([e])=>[e,{description:c.brickOutletDescriptions[e]}]))},state_group:{"BRICK_STATE_GROUP_<UUID>":{}}},a={canvas_map:{"CANVAS_<UUID WHICH NEED DISPLAY THIS BRICK>":{item_list:[{type:"brick",brick_id:o,frame:{x:"number",y:"number",width:"number",height:"number",standby_mode:"custom|top|left|right|bottom",standby_delay:"number",standby_easing:{default:{method:"ease",duration:"number"}}}}]}}};break;case"state_group":n={title:i,description:"State Group Description",conds:[{type:"property_bank|inner_state",key:"PROPERTY_BANK#<Data Node ID>|[current_canvas|BRICK_<OUTLET NAME>]|",method:"==|!=|>|>=|<|<=",value:"value_to_compare"}],override:{property:!1,event:!1,outlet:!1},commented:!1,break:!1,property:{},outlet:{},animation:{}};case"generator":var l=V(j.generatorMapping[t]);if(!l)throw Error(`Generator ${t} not found`);n={title:i,template_key:t,property:{$definitions:Object.fromEntries(Object.entries(l.propTypes).map(([e,i])=>[e,{...i,description:l.brickPropDescriptions[e]}]))},event_map:{$definitions:Object.fromEntries(Object.entries(l.eventTypes).map(([e])=>[e,{description:l.brickEventDescriptions[e]}]))},outlet:{$definitions:Object.fromEntries(Object.entries(l.outletTypes).map(([e])=>[e,{description:l.brickOutletDescriptions[e]}]))}};break;case"animation":n={title:i,type:"timing|decay|spring",property:"opacity|transform.translateX|transform.scale|etc",config:{$note:"Config for the animation"},compose_type:"parallel|sequence",item_list:[{animation_id:"ANIMATION_<SUB ANIMATION UUID>"}]};break;case"property_bank":n={title:i,description:"Property Bank Description",linkedFrom:"SUBSPACE_<UUID WHICH IS CROSS SUBSPACE>",type:"string|number|bool|object|array|any",kind:"color|datetime|id|media-resource-*|lottie-file-uri",unit:"grid|px|ms",routing:"read-only|default",value:"fit-to-type",event_map:{$note:`Available events: ${Object.keys(j.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,tX.M4)("property_bank_command"),u=(0,tX.M4)("property_bank_command"),m=(0,tX.M4)("property_bank_command"),_="const { arg_name } = inputs;\n\nreturn { arg_name };";n={title:i,map:{$note:"Required, actual implementation","PROPERTY_BANK_DATA_NODE_<UUID>":{type:"data-node",properties:{},in:{change:null},out:{value:[{id:"PROPERTY_BANK_COMMAND_NODE_<UUID>",port:"value"}]},$note:"Use this to input data to the sandbox"},"PROPERTY_BANK_COMMAND_NODE_<UUID FIRST>":{type:"command-node-object",title:"Command: OBJECT_SET",properties:{command:"OBJECT_SET",args:{path:"arg_name"}},in:{obj:null,path:null,value:[{id:"PROPERTY_BANK_DATA_NODE_<UUID>",port:"value"}]},out:{result:[{id:`PROPERTY_BANK_COMMAND_NODE_<UUID NEXT> | ${p}`,port:"obj | inputs"}]}},"PROPERTY_BANK_COMMAND_NODE_<UUID SECOND>":{type:"command-node-object",title:"Command: OBJECT_SET",properties:{command:"OBJECT_SET",args:{path:"arg_name"}},in:{obj:[{id:"PROPERTY_BANK_COMMAND_NODE_<UUID PREVIOUS>",port:"result"}],path:null,value:[{id:"PROPERTY_BANK_DATA_NODE_<UUID SECOND>",port:"value"}]},out:{result:[{id:`PROPERTY_BANK_COMMAND_NODE_<UUID NEXT> | ${p}`,port:"obj | inputs"}]}},[p]:{type:"command-node-sandbox",title:"Command: SANDBOX_RUN_JAVASCRIPT",properties:{command:"SANDBOX_RUN_JAVASCRIPT",args:{code:_,enable_async:!1}},in:{code:null,inputs:[{id:"PROPERTY_BANK_COMMAND_NODE_<UUID FINAL>",port:"result"}]},out:{result:[{id:m,port:"result"},{id:u,port:"result"}]}},[m]:{type:"command-node-sandbox",title:"Command: SANDBOX_GET_ERROR",properties:{command:"SANDBOX_GET_ERROR"},in:{result:[{id:p,port:"result"}]},out:{result:[{id:"PROPERTY_BANK_DATA_NODE_<UUID RECEIVE ERROR>",port:"change"}],$note:"Set `result` as null if there is no error"}},[u]:{type:"command-node-sandbox",title:"Command: SANDBOX_GET_RETURN_VALUE",properties:{command:"SANDBOX_GET_RETURN_VALUE"},in:{result:[{id:p,port:"result"}]},out:{result:[{id:"PROPERTY_BANK_DATA_NODE_<UUID RECEIVE RESULT> | PROPERTY_BANK_COMMAND_NODE_<UUID PARSE RESULT> | null",port:"change"}]}},"PROPERTY_BANK_DATA_NODE_<UUID RECEIVE RESULT>":{type:"data-node",properties:{},in:{change:[{id:u,port:"result"}]},out:{value:null},$note:"Put full result into data node"},"PROPERTY_BANK_COMMAND_NODE_<UUID PARSE RESULT>":{type:"command-node-object",title:"Command: OBJECT_GET",properties:{command:"OBJECT_GET",args:{path:"obj_key"}},in:{obj:[{id:u,port:"obj"}]},out:{result:[{id:"PROPERTY_BANK_DATA_NODE_<UUID RECEIVE PARTIAL RESULT>",port:"change"}]},$note:"Parse result object into data node"},"PROPERTY_BANK_DATA_NODE_<UUID RECEIVE PARTIAL RESULT>":{type:"data-node",properties:{},in:{change:[{id:"PROPERTY_BANK_COMMAND_NODE_<UUID PARSE RESULT>",port:"result"}]},out:{value:null},$note:"Put partial result into data node"}},editor_info:{},type:"script",script_config:{title:i,enable_async:!1,inputs:{"PROPERTY_BANK_DATA_NODE_<UUID>":"arg_name"},disabled_triggers:{},error:"PROPERTY_BANK_DATA_NODE_<UUID RECEIVE ERROR> | null",output:"PROPERTY_BANK_DATA_NODE_<UUID RECEIVE RESULT> | null",outputs:{obj_key:"PROPERTY_BANK_DATA_NODE_<UUID RECEIVE PARTIAL RESULT>"},code:_,$note:"Required, info for GUI editor"}}}return T({id:o,example:n,extraInfo:a})};var tZ="2.25.0-beta.25";function t0(){return t1.apply(this,arguments)}function t1(){return(t1=v(function*(e={}){var i,t=e.token||process.env.BRICKS_API_TOKEN;if(!t)throw console.error("Error: API token is required"),console.error("Please provide a token via options or set BRICKS_API_TOKEN environment variable"),Error("API token is required");var n=function(e){try{var i=e.queryStringParameters?.token;if(!i){var t=new Headers(e.headers);i=t.get("authorization")?.replace("Bearer ","")}if(!i)return{success:!1,message:"Authentication failed: No token provided"};var n=function(e){try{var i=e.split(".");if(i.length<3)return null;var t=JSON.parse(Buffer.from(i[0],"base64url").toString());if(!D.includes(t?.alg))return null;return JSON.parse(Buffer.from(i[1],"base64url").toString())}catch{return null}}(i);if(!n)return{success:!1,message:"Authentication failed: Invalid token"};var a=A.includes(n.iss)?"user":"workspace";if("workspace"===a){var o=Array.isArray(n.t)?n.t:[];n.permissions=o.reduce((e,i)=>{var t=k[i];return t&&e.push(t),e},[])}else n.permissions=Object.keys(I);return{success:!0,token:i,tokenInfo:n,tokenType:a}}catch(e){return{success:!1,message:`Authentication failed: ${e.message}`}}}({queryStringParameters:{token:t}});if(!n.success)throw console.error("Error: Invalid BRICKS_API_TOKEN"),console.error(n.message),Error("Invalid BRICKS_API_TOKEN");var a=new h._({name:tH,version:tZ}),o={...n,client:function(e,i,t){switch(t){case"user":return new iR(e,i);case"workspace":return new ti(e,i);default:throw Error(`Invalid token type: ${t}.`)}}(tJ.bricks,n.token,n.tokenType)};a.prompt("getting-started","Getting started with BRICKS",{},v(function*(){return{messages:[{role:"user",content:{type:"text",text:`Welcome to BRICKS — start here.
|
|
2472
|
+
`,tK=z(function e(i,t){H(this,e),this.baseUrl=i,this.token=t,this.graphqlUrl=`${i}/api/graphql`},[{key:"graphql",value:(o=$(function*(e,i){var t=yield(0,x.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 Error(`Activity-log query failed (${t.status}): ${n}`)}var a=yield t.json();if(a.errors?.length)throw Error(a.errors.map(e=>e.message).join("\n"));return a.data}),function(e,i){return o.apply(this,arguments)})},{key:"events",value:(r=$(function*(e,{limit:i,offset:t}={}){var n={...e};return null!=i&&(n.limit=i),null!=t&&(n.offset=t),(yield this.graphql(tj,{filter:n})).events}),function(e){return r.apply(this,arguments)})},{key:"screenshots",value:(s=$(function*(e){return(yield this.graphql(tV,{filter:e})).screenshots}),function(e){return s.apply(this,arguments)})},{key:"downloadScreenshot",value:(d=$(function*(e,i,t){var n=`${this.baseUrl}/api/v1/${encodeURIComponent(e)}/${encodeURIComponent(i)}/screenshot?ts=${encodeURIComponent(t)}`,a=yield(0,x.Ay)(n,{headers:{Authorization:`Bearer ${this.token}`}});if(!a.ok){var o=yield a.text().catch(()=>"");throw Error(`Screenshot fetch failed (${a.status}): ${o}`)}return Buffer.from((yield a.arrayBuffer()))}),function(e,i,t){return d.apply(this,arguments)})}]);process.env.STAGE,process.env.URL_BASE;var tY="bricks-mcp",tG={bricks:process.env.BRICKS_API_SERVER||"https://display-beta.bricks.tools",media:process.env.MEDIA_API_SERVER||"https://media-beta.bricks.tools",activityLog:process.env.ACTIVITY_LOG_API_SERVER||"https://activity-log-beta.bricks.tools"};process.env.AUTH0_DOMAIN,process.env.CACHE_URL;var tL=t(1639);let tz=({type:e,title:i,template_key:t})=>{var n,a,o=(0,tL.M4)(e);switch(e){case"subspace":n={title:i,layout:{width:"number",height:"number"},root_canvas_id:"CANVAS_<UUID>",canvas_map:{},brick_map:{},animation_map:{},generator_map:{},property_bank_map:{},property_bank_calc_map:{}},a={"canvas_map.CANVAS_<UUID>.item_list":[{type:"subspace",subspace_id:"SUBSPACE_<UUID>",$note:"If not a root subspace, it can be linked to canvas in other subspace"}]};break;case"canvas":var r=j(W.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,tL.M4)("property_bank")]:{title:`Canvas ID: ${i}`,type:"string",value:o,routing:"read-only",kind:"auto-generated-item-id",idType:"canvas"}}};break;case"brick":var s=j(W.dK.Basic),d=j(W.brickMapping[t]);if(!d)throw Error(`Brick ${t} not found`);var c={...d,propTypes:{...s.propTypes,...d.propTypes},brickPropDescriptions:{...s.brickPropDescriptions,...d.brickPropDescriptions},eventTypes:{...s.eventTypes,...d.eventTypes},brickEventDescriptions:{...s.brickEventDescriptions,...d.brickEventDescriptions}};n={title:i,template_key:t,property:{$definitions:Object.fromEntries(Object.entries(c.propTypes).map(([e,i])=>[e,{...i,description:c.brickPropDescriptions[e]}]))},event_map:{$definitions:Object.fromEntries(Object.entries(c.eventTypes).map(([e])=>[e,{description:c.brickEventDescriptions[e]}]))},outlet:{$definitions:Object.fromEntries(Object.entries(c.outletTypes).map(([e])=>[e,{description:c.brickOutletDescriptions[e]}]))},state_group:{"BRICK_STATE_GROUP_<UUID>":{}}},a={canvas_map:{"CANVAS_<UUID WHICH NEED DISPLAY THIS BRICK>":{item_list:[{type:"brick",brick_id:o,frame:{x:"number",y:"number",width:"number",height:"number",standby_mode:"custom|top|left|right|bottom",standby_delay:"number",standby_easing:{default:{method:"ease",duration:"number"}}}}]}}};break;case"state_group":n={title:i,description:"State Group Description",conds:[{type:"property_bank|inner_state",key:"PROPERTY_BANK#<Data Node ID>|[current_canvas|BRICK_<OUTLET NAME>]|",method:"==|!=|>|>=|<|<=",value:"value_to_compare"}],override:{property:!1,event:!1,outlet:!1},commented:!1,break:!1,property:{},outlet:{},animation:{}};case"generator":var l=j(W.generatorMapping[t]);if(!l)throw Error(`Generator ${t} not found`);n={title:i,template_key:t,property:{$definitions:Object.fromEntries(Object.entries(l.propTypes).map(([e,i])=>[e,{...i,description:l.brickPropDescriptions[e]}]))},event_map:{$definitions:Object.fromEntries(Object.entries(l.eventTypes).map(([e])=>[e,{description:l.brickEventDescriptions[e]}]))},outlet:{$definitions:Object.fromEntries(Object.entries(l.outletTypes).map(([e])=>[e,{description:l.brickOutletDescriptions[e]}]))}};break;case"animation":n={title:i,type:"timing|decay|spring",property:"opacity|transform.translateX|transform.scale|etc",config:{$note:"Config for the animation"},compose_type:"parallel|sequence",item_list:[{animation_id:"ANIMATION_<SUB ANIMATION UUID>"}]};break;case"property_bank":n={title:i,description:"Property Bank Description",linkedFrom:"SUBSPACE_<UUID WHICH IS CROSS SUBSPACE>",type:"string|number|bool|object|array|any",kind:"color|datetime|id|media-resource-*|lottie-file-uri",unit:"grid|px|ms",routing:"read-only|default",value:"fit-to-type",event_map:{$note:`Available events: ${Object.keys(W.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,tL.M4)("property_bank_command"),u=(0,tL.M4)("property_bank_command"),m=(0,tL.M4)("property_bank_command"),_="const { arg_name } = inputs;\n\nreturn { arg_name };";n={title:i,map:{$note:"Required, actual implementation","PROPERTY_BANK_DATA_NODE_<UUID>":{type:"data-node",properties:{},in:{change:null},out:{value:[{id:"PROPERTY_BANK_COMMAND_NODE_<UUID>",port:"value"}]},$note:"Use this to input data to the sandbox"},"PROPERTY_BANK_COMMAND_NODE_<UUID FIRST>":{type:"command-node-object",title:"Command: OBJECT_SET",properties:{command:"OBJECT_SET",args:{path:"arg_name"}},in:{obj:null,path:null,value:[{id:"PROPERTY_BANK_DATA_NODE_<UUID>",port:"value"}]},out:{result:[{id:`PROPERTY_BANK_COMMAND_NODE_<UUID NEXT> | ${p}`,port:"obj | inputs"}]}},"PROPERTY_BANK_COMMAND_NODE_<UUID SECOND>":{type:"command-node-object",title:"Command: OBJECT_SET",properties:{command:"OBJECT_SET",args:{path:"arg_name"}},in:{obj:[{id:"PROPERTY_BANK_COMMAND_NODE_<UUID PREVIOUS>",port:"result"}],path:null,value:[{id:"PROPERTY_BANK_DATA_NODE_<UUID SECOND>",port:"value"}]},out:{result:[{id:`PROPERTY_BANK_COMMAND_NODE_<UUID NEXT> | ${p}`,port:"obj | inputs"}]}},[p]:{type:"command-node-sandbox",title:"Command: SANDBOX_RUN_JAVASCRIPT",properties:{command:"SANDBOX_RUN_JAVASCRIPT",args:{code:_,enable_async:!1}},in:{code:null,inputs:[{id:"PROPERTY_BANK_COMMAND_NODE_<UUID FINAL>",port:"result"}]},out:{result:[{id:m,port:"result"},{id:u,port:"result"}]}},[m]:{type:"command-node-sandbox",title:"Command: SANDBOX_GET_ERROR",properties:{command:"SANDBOX_GET_ERROR"},in:{result:[{id:p,port:"result"}]},out:{result:[{id:"PROPERTY_BANK_DATA_NODE_<UUID RECEIVE ERROR>",port:"change"}],$note:"Set `result` as null if there is no error"}},[u]:{type:"command-node-sandbox",title:"Command: SANDBOX_GET_RETURN_VALUE",properties:{command:"SANDBOX_GET_RETURN_VALUE"},in:{result:[{id:p,port:"result"}]},out:{result:[{id:"PROPERTY_BANK_DATA_NODE_<UUID RECEIVE RESULT> | PROPERTY_BANK_COMMAND_NODE_<UUID PARSE RESULT> | null",port:"change"}]}},"PROPERTY_BANK_DATA_NODE_<UUID RECEIVE RESULT>":{type:"data-node",properties:{},in:{change:[{id:u,port:"result"}]},out:{value:null},$note:"Put full result into data node"},"PROPERTY_BANK_COMMAND_NODE_<UUID PARSE RESULT>":{type:"command-node-object",title:"Command: OBJECT_GET",properties:{command:"OBJECT_GET",args:{path:"obj_key"}},in:{obj:[{id:u,port:"obj"}]},out:{result:[{id:"PROPERTY_BANK_DATA_NODE_<UUID RECEIVE PARTIAL RESULT>",port:"change"}]},$note:"Parse result object into data node"},"PROPERTY_BANK_DATA_NODE_<UUID RECEIVE PARTIAL RESULT>":{type:"data-node",properties:{},in:{change:[{id:"PROPERTY_BANK_COMMAND_NODE_<UUID PARSE RESULT>",port:"result"}]},out:{value:null},$note:"Put partial result into data node"}},editor_info:{},type:"script",script_config:{title:i,enable_async:!1,inputs:{"PROPERTY_BANK_DATA_NODE_<UUID>":"arg_name"},disabled_triggers:{},error:"PROPERTY_BANK_DATA_NODE_<UUID RECEIVE ERROR> | null",output:"PROPERTY_BANK_DATA_NODE_<UUID RECEIVE RESULT> | null",outputs:{obj_key:"PROPERTY_BANK_DATA_NODE_<UUID RECEIVE PARTIAL RESULT>"},code:_,$note:"Required, info for GUI editor"}}}return C({id:o,example:n,extraInfo:a})};var tH="2.25.0-beta.30";function tJ(){return tX.apply(this,arguments)}function tX(){return(tX=$(function*(e={}){var i,t=e.token||process.env.BRICKS_API_TOKEN;if(!t)throw console.error("Error: API token is required"),console.error("Please provide a token via options or set BRICKS_API_TOKEN environment variable"),Error("API token is required");var n=function(e){try{var i=e.queryStringParameters?.token;if(!i){var t=new Headers(e.headers);i=t.get("authorization")?.replace("Bearer ","")}if(!i)return{success:!1,message:"Authentication failed: No token provided"};var n=function(e){try{var i=e.split(".");if(i.length<3)return null;var t=JSON.parse(Buffer.from(i[0],"base64url").toString());if(!k.includes(t?.alg))return null;return JSON.parse(Buffer.from(i[1],"base64url").toString())}catch{return null}}(i);if(!n)return{success:!1,message:"Authentication failed: Invalid token"};var a=D.includes(n.iss)?"user":"workspace";if("workspace"===a){var o=Array.isArray(n.t)?n.t:[];n.permissions=o.reduce((e,i)=>{var t=I[i];return t&&e.push(t),e},[])}else n.permissions=Object.keys(b);return{success:!0,token:i,tokenInfo:n,tokenType:a}}catch(e){return{success:!1,message:`Authentication failed: ${e.message}`}}}({queryStringParameters:{token:t}});if(!n.success)throw console.error("Error: Invalid BRICKS_API_TOKEN"),console.error(n.message),Error("Invalid BRICKS_API_TOKEN");var a=new v._({name:tY,version:tH}),o={...n,client:function(e,i,t){switch(t){case"user":return new iB(e,i);case"workspace":return new i3(e,i);default:throw Error(`Invalid token type: ${t}.`)}}(tG.bricks,n.token,n.tokenType)};a.prompt("getting-started","Getting started with BRICKS",{},$(function*(){return{messages:[{role:"user",content:{type:"text",text:`Welcome to BRICKS — start here.
|
|
2473
2473
|
|
|
2474
2474
|
Before doing any complex work (application design, deployments, etc.),
|
|
2475
2475
|
always consult the official docs rather than guessing.
|
|
@@ -2507,7 +2507,7 @@ Quick actions:
|
|
|
2507
2507
|
- "Deploy an application to a device" → use the \`deploy-to-device\` prompt
|
|
2508
2508
|
|
|
2509
2509
|
Try asking:
|
|
2510
|
-
- "Draft a plan to create an app with a text display and deploy it; ask any missing questions first"`}}]}})),a.prompt("create-application","Create a new BRICKS application with guided setup",{app_name:
|
|
2510
|
+
- "Draft a plan to create an app with a text display and deploy it; ask any missing questions first"`}}]}})),a.prompt("create-application","Create a new BRICKS application with guided setup",{app_name:A.Yj().describe("Name for the new application"),description:A.Yj().describe("Short description for the new application").optional()},(i=$(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}".
|
|
2511
2511
|
|
|
2512
2512
|
${t?`Goal: ${t}`:""}
|
|
2513
2513
|
|
|
@@ -2540,4 +2540,4 @@ What I'll produce first:
|
|
|
2540
2540
|
- Short recap of requirements
|
|
2541
2541
|
- Clarifying questions (only what's necessary)
|
|
2542
2542
|
- High-level architecture plan
|
|
2543
|
-
- Minimal config skeleton that validates against the schema`}}]}}),function(e){return i.apply(this,arguments)})),a.resource("getting-started-docs","file://docs/getting-started.md",{mimeType:"text/markdown",title:"Getting Started with BRICKS",description:"Comprehensive guide to BRICKS architecture, concepts, and development workflow"},v(function*(){return T(w,{uri:"file://docs/getting-started.md",mimeType:"text/markdown"})})),function(e,i){var t,n="user"===i.tokenType,a=((e,i=null)=>({name:t,description:n,inputSchema:a,permission:o},r)=>{(!o||i.tokenInfo.permissions?.includes(o)||0)&&e.tool(t,n,a,r)})(e,i),o=e=>({...e,...n?{workspace_id:S.Yj().describe("Workspace ID")}:{}}),r=i.client,s=n?function(e){var i=e.endpoint,t=e.accessToken;if(!i)throw Error("Media API endpoint is required");if(!t)throw Error("Access token is required");return((e={})=>{let i=(({endpoint:e="http://localhost:3002",accessToken:i,boxId:t,passcode:n,enableSubscription:a=!0,enableRetry:o=!0,subscriptionOnConnectionOrError:r,onNetworkError:s}={})=>{let d,c,l,p=t&&n,u=`${e}/api/graphql`;return p&&(u=`${e}/api/graphql_with_passcode`),d=function({endpointURL:e,subscriptionEndpointURL:i,accessToken:t,boxId:n,passcode:a,origin:o,enableSubscription:r,enableRetry:s=!0,subscriptionOnConnectionOrError:d,onNetworkError:c=()=>{}}){let l,p,u,m,_={};o&&(_.origin=o),n&&a||(_.authorization=`Bearer ${t}`);let g=new to.z({uri:e,headers:_}),f=()=>{m&&(clearTimeout(m),m=void 0)};r&&(l=(0,ts.UU)({url:i,lazy:!0,connectionParams:_,retryAttempts:1/0,shouldRetry:()=>!0,keepAlive:1e4,on:{error:e=>{f(),d?.(e)},opened:e=>{d?.(),u=e,f()},ping:e=>{e||(f(),m=setTimeout(()=>{u&&u.readyState===WebSocket.OPEN&&u.close(4205,"Client Restart")},5e3))},pong:e=>{e&&f()},closed:()=>{f()}}}),p=new tr.c(l));let y=tt.C.from([(0,td.S)(({networkError:e,operation:i})=>{if(e){c(e,i);let t=e?.message||"";if("Aborted"===t||e?.name==="AbortError"||t.includes("Too many requests")||e?.response?.status===429||e?.statusCode===429||e?.status===429||"Timeout exceeded"===t||e?.timeout||e?.statusCode===403||e?.status===403)return new tn.c(e=>e.complete())}}),s&&new ta.z({attempts:{max:3,retryIf:e=>{let i="string"==typeof e?.message?e.message:"string"==typeof e?e:"";return!(!e||i.includes("Too many requests")||e?.response?.status===429||e?.statusCode===429||e?.status===429||e?.statusCode===403||e?.status===403||e?.timeout||"Timeout exceeded"===i)&&"Aborted"!==i&&e?.name!=="AbortError"}}}),new(tl())(3e4),r?tt.C.split(({query:e})=>{let{kind:i,operation:t}=(0,tp.Vn)(e);return"OperationDefinition"===i&&"subscription"===t},p,g):g].filter(Boolean));return y.closeSubscriptionClient=()=>r&&l.dispose(),y}({endpointURL:u,subscriptionEndpointURL:u.replace("http:","ws:"),accessToken:i,enableSubscription:!p&&a,enableRetry:o,subscriptionOnConnectionOrError:r,onNetworkError:s}),c=new et.D,(l=new ei.R({link:d,cache:c,defaultOptions:{watchQuery:{fetchPolicy:"no-cache",errorPolicy:"ignore"},query:{fetchPolicy:"no-cache",errorPolicy:"all"}}})).close=()=>d.closeSubscriptionClient(),l})(e);if(e.boxId&&e.passcode){i.type="passcode",i.queries=y,i.mutations=$;let t={boxId:e.boxId,passcode:e.passcode};Object.entries(y).forEach(tY(i,"query",t)),Object.entries($).forEach(tY(i,"mutation",t)),i.listenBoxChanged=(e,n)=>i.subscribe({query:tj,variables:{...t,...e}}).subscribe({next:tK(n),error(e){n(e)}})}else i.accessToken=e.accessToken,i.type="token",i.queries=g,i.mutations=f,Object.entries(g).forEach(tY(i,"query")),Object.entries(f).forEach(tY(i,"mutation")),i.listenBoxChanged=(e,t)=>i.subscribe({query:tM,variables:e}).subscribe({next:tK(t),error(e){t(e)}});return i})({endpoint:i,accessToken:t,enableSubscription:!1,enableRetry:!0})}({endpoint:tJ.media,accessToken:i.token}):r;if(n&&e.tool("list_workspaces","List all workspaces",{},v(function*(){return T((yield r.workspaces()))})),a({name:"get_workspace_overview",description:"Get comprehensive overview of the BRICKS workspace including stats and summary",inputSchema:o({}),permission:"info"},(d=v(function*({workspace_id:e}){var i=x((yield Promise.all([r.workspace({id:e}),r.applications({workspaceId:e,paginate:{limit:50,offset:0}}),r.modules({workspaceId:e,paginate:{limit:50,offset:0}}),r.devices({workspaceId:e,paginate:{limit:50,offset:0}}),n?s.mediaWorkspace({workspaceId:e}).catch(()=>null):s.mediaWorkspace().catch(()=>null),n?s.mediaBoxes({workspaceId:e}).catch(()=>[]):s.mediaBoxes().catch(()=>[])])),6),t=i[0],a=i[1],o=i[2],d=i[3],c=i[4],l=i[5];if(!t)throw Error("Authentication failed, please check your token");return T({workspace:t,stats:{applications:a?.length??"No permission",modules:o?.length??"No permission",devices:d?.length??"No permission",running_apps:a?.filter(e=>e.status?.running).length??"No permission",media_boxes:l?.length??"No permission",media_enabled:!!c,notes:"Note: The stats are based on the first 50 applications, modules, and devices in the workspace."},recent_activity:{latest_apps: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:c?{workspace_id:c.id,name:c.name,size_used:c.size,size_limit:c.sizeLimit,boxes:l?.slice(0,5).map(e=>({id:e.id,name:e.name,size:e.size,description:e.description}))||[]}:{enabled:!1,note:"Media workspace is not enabled for this workspace"}})}),function(e){return d.apply(this,arguments)})),a({name:"get_applications",description:"List all applications in the workspace",inputSchema:o({limit:S.ai().describe("Maximum number of applications to return").optional().default(50),offset:S.ai().describe("Number of applications to skip").optional().default(0)}),permission:"query_application"},(c=v(function*({workspace_id:e,limit:i=50,offset:t=0}){return T((yield r.applications({workspaceId:e,paginate:{limit:i,offset:t}})))}),function(e){return c.apply(this,arguments)})),a({name:"get_application",description:"Get detailed info and config of a specific application",inputSchema:o({id:S.Yj().describe("Application ID")}),permission:"query_application"},(l=v(function*({workspace_id:e,id:i}){return T((yield r.application({workspaceId:e,id:i})))}),function(e){return l.apply(this,arguments)})),a({name:"get_modules",description:"List all modules in the workspace",inputSchema:o({limit:S.ai().describe("Maximum number of modules to return").optional().default(50),offset:S.ai().describe("Number of modules to skip").optional().default(0)}),permission:"query_module"},(p=v(function*({workspace_id:e,limit:i=50,offset:t=0}){return T((yield r.modules({workspaceId:e,paginate:{limit:i,offset:t}})))}),function(e){return p.apply(this,arguments)})),a({name:"get_module",description:"Get detailed info and config of a specific module",inputSchema:o({id:S.Yj().describe("Module ID")}),permission:"query_module"},(u=v(function*({workspace_id:e,id:i}){return T((yield r.module({workspaceId:e,id:i})))}),function(e){return u.apply(this,arguments)})),a({name:"update_module_info",description:"Update a specific module info",inputSchema:o({id:S.Yj().describe("Module ID"),name:S.Yj().describe("Module name"),description:S.Yj().describe("Module description")}),permission:"update_module"},(m=v(function*({workspace_id:e,id:i,name:t,description:n}){return T((yield r.updateModule({workspaceId:e,id:i,name:t,description:n})))}),function(e){return m.apply(this,arguments)})),a({name:"update_module_config",description:"Update a specific module configuration",inputSchema:o({id:S.Yj().describe("Module ID"),config:S.Ik({}).passthrough().describe("New configuration object, see file://docs/config-schema.md for schema reference")}),permission:"update_module"},(_=v(function*({workspace_id:e,id:i,config:t}){var n=yield q(t);if(!n.valid)throw Error(`Config validation failed: ${n.errors.join(", ")}`);return T((yield r.updateModule({workspaceId:e,id:i,config:JSON.stringify(t),validateConfig:!0})))}),function(e){return _.apply(this,arguments)})),a({name:"get_devices",description:"List all devices in the workspace",inputSchema:o({limit:S.ai().describe("Maximum number of devices to return").optional().default(50),offset:S.ai().describe("Number of devices to skip").optional().default(0)}),permission:"query_device"},(h=v(function*({workspace_id:e,limit:i=50,offset:t=0}){return T((yield r.devices({workspaceId:e,paginate:{limit:i,offset:t}})))}),function(e){return h.apply(this,arguments)})),a({name:"create_application",description:"Create a new BRICKS application with default grid layout",inputSchema:o({name:S.Yj().describe("Application name"),description:S.Yj().describe("Application description").optional(),grid_width:S.ai().describe("Grid width in units").optional().default(96),grid_height:S.ai().describe("Grid height in units").optional().default(54)}),permission:"create_application"},(b=v(function*({workspace_id:e,name:i,description:t,grid_width:n,grid_height:a}){return T((yield r.createApplication({workspaceId:e,name:i,description:t,gridWidth:n,gridHeight:a})))}),function(e){return b.apply(this,arguments)})),a({name:"update_application_info",description:"Update application info",inputSchema:{id:S.Yj().describe("Application ID"),name:S.Yj().describe("Application name"),description:S.Yj().describe("Application description")},permission:"update_application"},(I=v(function*({id:e,name:i,description:t}){return T((yield r.updateApplication({id:e,name:i,description:t})))}),function(e){return I.apply(this,arguments)})),a({name:"update_application_config",description:"Update application configuration with validation",inputSchema:{id:S.Yj().describe("Application ID"),config:S.Ik({}).passthrough().describe("New application configuration. Please read `getting-started` for BRICKS concepts before changing")},permission:"update_application"},(k=v(function*({id:e,config:i}){var t=yield q(i);if(!t.valid)throw Error(`Config validation failed: ${t.errors.join(", ")}`);return T((yield r.updateApplication({id:e,config:JSON.stringify(i)})))}),function(e){return k.apply(this,arguments)})),a({name:"bind_application",description:"Bind application to device with viewport configuration",inputSchema:{app_id:S.Yj().describe("Application ID"),viewports:S.YO(S.Ik({device_id:S.Yj().describe("Device ID"),x:S.ai().describe("X coordinate"),y:S.ai().describe("Y coordinate"),width:S.ai().describe("Width"),height:S.ai().describe("Height"),rotate:S.ai().describe("Rotation"),rotateType:S.Yj().describe("Rotation type")})).describe("Viewport configuration")},permission:"bind_application"},(D=v(function*({app_id:e,viewports:i}){return T((yield r.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 D.apply(this,arguments)})),a({name:"unbind_application",description:"Unbind application from device",inputSchema:{app_id:S.Yj().describe("Application ID"),device_id:S.Yj().describe("Device ID")},permission:"bind_application"},(A=v(function*({app_id:e,device_id:i}){return T((yield r.bindApplication({id:e,unbindDevices:[i]})))}),function(e){return A.apply(this,arguments)})),n&&a({name:"list_media_workspaces",description:"List all media workspaces",inputSchema:{},permission:"query_media_flow"},v(function*(){return T((yield s.mediaWorkspaces()))})),a({name:"get_media_workspace",description:"Get media workspace information and status",inputSchema:o({}),permission:"query_media_flow"},(w=v(function*({workspace_id:e}){return T((yield s.mediaWorkspace({workspaceId:e})))}),function(e){return w.apply(this,arguments)})),a({name:"list_media_boxes",description:"List all media boxes in the workspace",inputSchema:o({}),permission:"query_media_flow"},(U=v(function*({workspace_id:e}){return T((yield s.mediaBoxes({workspaceId:e})))}),function(e){return U.apply(this,arguments)})),a({name:"get_media_box",description:"Get detailed information about a specific media box",inputSchema:{box_id:S.Yj().describe("Media box ID")},permission:"query_media_flow"},(M=v(function*({box_id:e}){return T((yield s.mediaBox({boxId:e})))}),function(e){return M.apply(this,arguments)})),a({name:"list_media_files",description:"List media files in a specific box with filtering options",inputSchema:{box_id:S.Yj().describe("Media box ID"),include_types:S.YO(S.Yj()).optional().describe('Filter by file types (e.g., ["image", "video", "audio"])'),user_tags:S.YO(S.Yj()).optional().describe("Filter by user tags"),limit:S.ai().optional().default(50).describe("Maximum number of files to return"),offset:S.ai().optional().default(0).describe("Number of files to skip")},permission:"query_media_flow"},(R=v(function*({box_id:e,include_types:i,user_tags:t,limit:n,offset:a}){return T((yield s.mediaFiles({boxId:e,includeTypes:i,userTags:t,limit:n,offset:a})))}),function(e){return R.apply(this,arguments)})),a({name:"get_media_file_meta",description:"Get detailed information about a specific media file",inputSchema:{file_id:S.Yj().describe("Media file ID")},permission:"query_media_flow"},(P=v(function*({file_id:e}){return T((yield s.mediaFile({fileId:e})))}),function(e){return P.apply(this,arguments)})),a({name:"media_box_upload",description:"Upload a file to a media box from URL or base64 data",inputSchema:{box_id:S.Yj().describe("Target media box ID"),name:S.Yj().describe("File name"),description:S.Yj().optional().default("").describe("File description"),file_type:S.k5(["image","video","audio","file"]).describe("File type"),source_url:S.Yj().optional().describe("URL to download the file from"),base64_data:S.Yj().optional().describe("Base64 encoded file data"),user_tags:S.YO(S.Yj()).optional().default([]).describe("User-defined tags for the file")},permission:"write_media_flow"},(O=v(function*({box_id:e,name:i,description:t,source_url:a,base64_data:o,file_type:r,user_tags:d}){if(!a&&!o)throw Error("Either source_url or base64_data must be provided");if(a&&o)throw Error("Provide either source_url OR base64_data, not both");var c=a?null:"application/octet-stream",l=a?yield(0,B.Ay)(a,{agent:(0,E.fJ)(a)}).then(e=>(c=e.headers.get("content-type"),e.blob())):new Blob([C.Buffer.from(o,"base64")],{type:c}),p=yield s.requestFileUpload({name:i,description:t,boxId:e,fileType:n?r.toUpperCase():r,contentType:c,userTags:d,meta:{}}),u=JSON.parse(p?.meta.uploadInfo),m=new FormData;m.append("file",l),m.append("Content-Type",c),m.append("AWSAccessKeyId",u.AWSAccessKeyId),m.append("Signature",u.Signature),m.append("Policy",u.Policy),m.append("acl",u.acl),m.append("key",u.key);var _=yield(0,B.Ay)(u.url,{method:"POST",body:m}).then(e=>e.ok).catch(()=>!1);return T({file_id:p.id,upload_success:_,upload_info:{content_type:c,file_type:r,source_type:a?"url":"base64",processing_note:"File will be processed automatically. Use get_media_file to check processing status."}})}),function(e){return O.apply(this,arguments)})),a({name:"update_media_file_meta",description:"Update media file information",inputSchema:{file_id:S.Yj().describe("Media file ID"),name:S.Yj().optional().describe("New file name"),description:S.Yj().optional().describe("New file description"),user_tags:S.YO(S.Yj()).optional().describe("New user tags")},permission:"write_media_flow"},(F=v(function*({file_id:e,name:i,description:t,user_tags:n}){return T((yield s.updateMediaFile({fileId:e,name:i,description:t,userTags:n,requestUploadAgain:!1})))}),function(e){return F.apply(this,arguments)})),a({name:"copy_media_files",description:"Copy media files from one box to another",inputSchema:{from_box_id:S.Yj().describe("Source media box ID"),to_box_id:S.Yj().describe("Target media box ID"),file_ids:S.YO(S.Yj()).describe("Array of media file IDs to copy")},permission:"write_media_flow"},(N=v(function*({from_box_id:e,to_box_id:i,file_ids:t}){return T((yield s.copyMediaFiles({fromBoxId:e,toBoxId:i,list:t})))}),function(e){return N.apply(this,arguments)})),a({name:"delete_media_files",description:"Delete specific media files from a box",inputSchema:{box_id:S.Yj().describe("Media box ID"),file_ids:S.YO(S.Yj()).describe("Array of media file IDs to delete")},permission:"write_media_flow"},(W=v(function*({box_id:e,file_ids:i}){return T((yield s.deleteMediaFiles({boxId:e,list:i})))}),function(e){return W.apply(this,arguments)})),a({name:"cleanup_media_box",description:"Delete all files in a media box, optionally filtered by type",inputSchema:{box_id:S.Yj().describe("Media box ID"),include_types:S.YO(S.Yj()).optional().describe('Only delete files of these types (e.g., ["image", "video"])')},permission:"write_media_flow"},(j=v(function*({box_id:e,include_types:i}){if("deleteMediaBoxFiles"in s)return T((yield s.deleteMediaBoxFiles({boxId:e,includeTypes:i})));var t=yield s.mediaFiles({boxId:e,includeTypes:i});return T((yield s.deleteMediaFiles({boxId:e,list:t.map(e=>e.id)})))}),function(e){return j.apply(this,arguments)})),e.tool("calculate_grid_layout","Calculate grid layout and pixel conversions for different device resolutions",{device_width:S.ai().describe("Device width in pixels"),device_height:S.ai().describe("Device height in pixels"),app_grid_width:S.ai().describe("Application grid width").optional().default(96),app_grid_height:S.ai().describe("Application grid height").optional().default(54)},(V=v(function*({device_width:e,device_height:i,app_grid_width:t,app_grid_height:n}){var a,o=(a=e/t,{deviceBrickWidth:e/a,deviceBrickHeight:i/a,deviceBrickUnit:a}),r=function(e,i,t=96){var n=e/t;return i>e&&(n=i/t),{deviceBrickWidth:Math.round(e/n),deviceBrickHeight:Math.round(i/n),deviceBrickUnit:n}}(e,i,t);return T({device_resolution:{width:e,height:i,aspect_ratio:(e/i).toFixed(2)},current_grid:{width:t,height:n,unit_size_px:o.deviceBrickUnit.toFixed(2),total_pixels:{width:o.deviceBrickWidth.toFixed(2),height:o.deviceBrickHeight.toFixed(2)}},recommended_grid:{width:r.deviceBrickWidth,height:r.deviceBrickHeight,unit_size_px:r.deviceBrickUnit.toFixed(2),note:"Optimized for device aspect ratio"}})}),function(e){return V.apply(this,arguments)})),e.tool("create_item","Use this tool to create new item that you can put in application configuration",{type:S.k5(["subspace","canvas","brick","generator","property_bank","property_bank_calc","property_bank_command","animation","state_group","automation_map"]).describe("Item type"),title:S.Yj().describe("Item title"),template_key:S.Yj().optional().describe("Template key for brick or generator")},tQ),e.tool("getting_started","Get documentation content for getting started",{},v(function*(){return T(z)})),!n){var d,c,l,p,u,m,_,h,b,I,k,D,A,w,U,M,R,P,O,F,N,W,j,V,Y,K,G,L=()=>new tz(tJ.activityLog,i.token);a({name:"activity_log_events",description:"Query activity log events. Returns raw events (general, data, local_sync) with filtering. Max 30-day range.",inputSchema:o({start_time:S.Yj().describe("Start time (ISO 8601)"),end_time:S.Yj().describe("End time (ISO 8601)"),device_id:S.Yj().optional().describe("Filter by device ID"),event_type:S.k5(["general","data","local_sync"]).optional().describe("Filter by event type"),event_name:S.Yj().optional().describe("Filter by event name (e.g. BRICK_xxx_ON_PRESS)"),subspace_id:S.Yj().optional().describe("Filter by subspace ID"),sender:S.Yj().optional().describe("Filter by sender"),limit:S.ai().optional().default(50).describe("Max events to return per page"),offset:S.ai().optional().default(0).describe("Number of events to skip (for pagination)")}),permission:"query_activity_log"},(Y=v(function*({start_time:e,end_time:i,device_id:t,event_type:n,event_name:a,subspace_id:o,sender:r,limit:s=50,offset:d=0}){var c=L(),l={start_time:e,end_time:i};return t&&(l.device_id=t),n&&(l.event_type=n),a&&(l.event_name=a),o&&(l.subspace_id=o),r&&(l.sender=r),T((yield c.events(l,{limit:s,offset:d})))}),function(e){return Y.apply(this,arguments)})),a({name:"activity_log_screenshots",description:"List available screenshot timestamps for a device in a time range.",inputSchema:o({device_id:S.Yj().describe("Device ID (required)"),start_time:S.Yj().describe("Start time (ISO 8601)"),end_time:S.Yj().describe("End time (ISO 8601)")}),permission:"query_activity_log"},(K=v(function*({device_id:e,start_time:i,end_time:t}){var n=L();return T((yield n.screenshots({device_id:e,start_time:i,end_time:t})))}),function(e){return K.apply(this,arguments)})),a({name:"activity_log_screenshot",description:"Download a device screenshot at a specific timestamp. Returns JPEG image as blob.",inputSchema:o({device_id:S.Yj().describe("Device ID"),ts:S.Yj().describe("Screenshot timestamp (ISO 8601 or epoch ms)")}),permission:"query_activity_log"},(G=v(function*({workspace_id:e,device_id:t,ts:n}){var a=e||i.tokenInfo?.w_id;if(!a)throw Error("Could not determine workspace ID");var o=L(),r=/^\d+$/.test(n)?n:new Date(n).getTime();return T((yield o.downloadScreenshot(a,t,r)),{mimeType:"image/jpeg"})}),function(e){return G.apply(this,arguments)}))}a({name:"get_device_usage",description:"Get device usage metrics (uptime, memory, disk) for a date range. Data from BRICKS main server.",inputSchema:o({device_id:S.Yj().describe("Device ID"),start_date:S.Yj().optional().describe("Start date/time in ISO 8601 format (default: start of today)"),end_date:S.Yj().optional().describe("End date/time in ISO 8601 format (default: now)")}),permission:"query_device"},(t=v(function*({device_id:e,start_date:i,end_date:t}){var n=new Date,a=new Date(n.getFullYear(),n.getMonth(),n.getDate()).toISOString();return T((yield r.deviceUsage({deviceId:e,startDate:i?new Date(i).toISOString():a,endDate:t?new Date(t).toISOString():n.toISOString()})))}),function(e){return t.apply(this,arguments)}))}(a,o);var r=new b.S;try{yield a.connect(r),console.error("BRICKS MCP Server running on STDIO"),console.error(`Server: ${tH} v${tZ}`),console.error(`Token Type: ${n.tokenType}`),console.error(`Permissions: ${n.tokenInfo.permissions.join(", ")}`),console.error("Ready to accept requests...")}catch(e){throw console.error("Failed to start MCP server:",e),e}})).apply(this,arguments)}}};
|
|
2543
|
+
- Minimal config skeleton that validates against the schema`}}]}}),function(e){return i.apply(this,arguments)})),a.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"},$(function*(){return C(S,{uri:"file://docs/getting-started.md",mimeType:"text/markdown"})})),function(e,i){var t,n="user"===i.tokenType,a=((e,i=null)=>({name:t,description:n,inputSchema:a,permission:o},r)=>{(!o||i.tokenInfo.permissions?.includes(o)||0)&&e.tool(t,n,a,r)})(e,i),o=e=>({...e,...n?{workspace_id:A.Yj().describe("Workspace ID")}:{}}),r=i.client,s=n?function(e){var i=e.endpoint,t=e.accessToken;if(!i)throw Error("Media API endpoint is required");if(!t)throw Error("Access token is required");return((e={})=>{let i=(({endpoint:e="http://localhost:3002",accessToken:i,boxId:t,passcode:n,enableSubscription:a=!0,enableRetry:o=!0,subscriptionOnConnectionOrError:r,onNetworkError:s}={})=>{let d,c,l,p=t&&n,u=`${e}/api/graphql`;return p&&(u=`${e}/api/graphql_with_passcode`),d=function({endpointURL:e,subscriptionEndpointURL:i,accessToken:t,boxId:n,passcode:a,origin:o,enableSubscription:r,enableRetry:s=!0,subscriptionOnConnectionOrError:d,onNetworkError:c=()=>{}}){let l,p,u,m,_={};o&&(_.origin=o),n&&a||(_.authorization=`Bearer ${t}`);let g=new ti.z({uri:e,headers:_}),f=()=>{m&&(clearTimeout(m),m=void 0)};r&&(l=(0,tn.UU)({url:i,lazy:!0,connectionParams:_,retryAttempts:1/0,shouldRetry:()=>!0,keepAlive:1e4,on:{error:e=>{f(),d?.(e)},opened:e=>{d?.(),u=e,f()},ping:e=>{e||(f(),m=setTimeout(()=>{u&&u.readyState===WebSocket.OPEN&&u.close(4205,"Client Restart")},5e3))},pong:e=>{e&&f()},closed:()=>{f()}}}),p=new tt.c(l));let y=i8.C.from([(0,ta.S)(({networkError:e,operation:i})=>{if(e){c(e,i);let t=e?.message||"";if("Aborted"===t||e?.name==="AbortError"||t.includes("Too many requests")||e?.response?.status===429||e?.statusCode===429||e?.status===429||"Timeout exceeded"===t||e?.timeout||e?.statusCode===403||e?.status===403)return new i7.c(e=>e.complete())}}),s&&new te.z({attempts:{max:3,retryIf:e=>{let i="string"==typeof e?.message?e.message:"string"==typeof e?e:"";return!(!e||i.includes("Too many requests")||e?.response?.status===429||e?.statusCode===429||e?.status===429||e?.statusCode===403||e?.status===403||e?.timeout||"Timeout exceeded"===i)&&"Aborted"!==i&&e?.name!=="AbortError"}}}),new(tr())(3e4),r?i8.C.split(({query:e})=>{let{kind:i,operation:t}=(0,ts.Vn)(e);return"OperationDefinition"===i&&"subscription"===t},p,g):g].filter(Boolean));return y.closeSubscriptionClient=()=>r&&l.dispose(),y}({endpointURL:u,subscriptionEndpointURL:u.replace("http:","ws:"),accessToken:i,enableSubscription:!p&&a,enableRetry:o,subscriptionOnConnectionOrError:r,onNetworkError:s}),c=new ei.D,(l=new ee.R({link:d,cache:c,defaultOptions:{watchQuery:{fetchPolicy:"no-cache",errorPolicy:"ignore"},query:{fetchPolicy:"no-cache",errorPolicy:"all"}}})).close=()=>d.closeSubscriptionClient(),l})(e);if(e.boxId&&e.passcode){i.type="passcode",i.queries=f,i.mutations=y;let t={boxId:e.boxId,passcode:e.passcode};Object.entries(f).forEach(tq(i,"query",t)),Object.entries(y).forEach(tq(i,"mutation",t)),i.listenBoxChanged=(e,n)=>i.subscribe({query:tF,variables:{...t,...e}}).subscribe({next:tW(n),error(e){n(e)}})}else i.accessToken=e.accessToken,i.type="token",i.queries=_,i.mutations=g,Object.entries(_).forEach(tq(i,"query")),Object.entries(g).forEach(tq(i,"mutation")),i.listenBoxChanged=(e,t)=>i.subscribe({query:tx,variables:e}).subscribe({next:tW(t),error(e){t(e)}});return i})({endpoint:i,accessToken:t,enableSubscription:!1,enableRetry:!0})}({endpoint:tG.media,accessToken:i.token}):r;if(n&&e.tool("list_workspaces","List all workspaces",{},$(function*(){return C((yield r.workspaces()))})),a({name:"get_workspace_overview",description:"Get comprehensive overview of the BRICKS workspace including stats and summary",inputSchema:o({}),permission:"info"},(d=$(function*({workspace_id:e}){var i=T((yield Promise.all([r.workspace({id:e}),r.applications({workspaceId:e,paginate:{limit:50,offset:0}}),r.modules({workspaceId:e,paginate:{limit:50,offset:0}}),r.devices({workspaceId:e,paginate:{limit:50,offset:0}}),n?s.mediaWorkspace({workspaceId:e}).catch(()=>null):s.mediaWorkspace().catch(()=>null),n?s.mediaBoxes({workspaceId:e}).catch(()=>[]):s.mediaBoxes().catch(()=>[])])),6),t=i[0],a=i[1],o=i[2],d=i[3],c=i[4],l=i[5];if(!t)throw Error("Authentication failed, please check your token");return C({workspace:t,stats:{applications:a?.length??"No permission",modules:o?.length??"No permission",devices:d?.length??"No permission",running_apps:a?.filter(e=>e.status?.running).length??"No permission",media_boxes:l?.length??"No permission",media_enabled:!!c,notes:"Note: The stats are based on the first 50 applications, modules, and devices in the workspace."},recent_activity:{latest_apps: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:c?{workspace_id:c.id,name:c.name,size_used:c.size,size_limit:c.sizeLimit,boxes:l?.slice(0,5).map(e=>({id:e.id,name:e.name,size:e.size,description:e.description}))||[]}:{enabled:!1,note:"Media workspace is not enabled for this workspace"}})}),function(e){return d.apply(this,arguments)})),a({name:"get_applications",description:"List all applications in the workspace",inputSchema:o({limit:A.ai().describe("Maximum number of applications to return").optional().default(50),offset:A.ai().describe("Number of applications to skip").optional().default(0)}),permission:"query_application"},(c=$(function*({workspace_id:e,limit:i=50,offset:t=0}){return C((yield r.applications({workspaceId:e,paginate:{limit:i,offset:t}})))}),function(e){return c.apply(this,arguments)})),a({name:"get_application",description:"Get detailed info and config of a specific application",inputSchema:o({id:A.Yj().describe("Application ID")}),permission:"query_application"},(l=$(function*({workspace_id:e,id:i}){return C((yield r.application({workspaceId:e,id:i})))}),function(e){return l.apply(this,arguments)})),a({name:"get_modules",description:"List all modules in the workspace",inputSchema:o({limit:A.ai().describe("Maximum number of modules to return").optional().default(50),offset:A.ai().describe("Number of modules to skip").optional().default(0)}),permission:"query_module"},(p=$(function*({workspace_id:e,limit:i=50,offset:t=0}){return C((yield r.modules({workspaceId:e,paginate:{limit:i,offset:t}})))}),function(e){return p.apply(this,arguments)})),a({name:"get_module",description:"Get detailed info and config of a specific module",inputSchema:o({id:A.Yj().describe("Module ID")}),permission:"query_module"},(u=$(function*({workspace_id:e,id:i}){return C((yield r.module({workspaceId:e,id:i})))}),function(e){return u.apply(this,arguments)})),a({name:"update_module_info",description:"Update a specific module info",inputSchema:o({id:A.Yj().describe("Module ID"),name:A.Yj().describe("Module name"),description:A.Yj().describe("Module description")}),permission:"update_module"},(m=$(function*({workspace_id:e,id:i,name:t,description:n}){return C((yield r.updateModule({workspaceId:e,id:i,name:t,description:n})))}),function(e){return m.apply(this,arguments)})),a({name:"update_module_config",description:"Update a specific module configuration",inputSchema:o({id:A.Yj().describe("Module ID"),config:A.Ik({}).passthrough().describe("New configuration object, see file://docs/config-schema.md for schema reference")}),permission:"update_module"},(v=$(function*({workspace_id:e,id:i,config:t}){var n=yield N(t);if(!n.valid)throw Error(`Config validation failed: ${n.errors.join(", ")}`);return C((yield r.updateModule({workspaceId:e,id:i,config:JSON.stringify(t),validateConfig:!0})))}),function(e){return v.apply(this,arguments)})),a({name:"get_devices",description:"List all devices in the workspace",inputSchema:o({limit:A.ai().describe("Maximum number of devices to return").optional().default(50),offset:A.ai().describe("Number of devices to skip").optional().default(0)}),permission:"query_device"},(h=$(function*({workspace_id:e,limit:i=50,offset:t=0}){return C((yield r.devices({workspaceId:e,paginate:{limit:i,offset:t}})))}),function(e){return h.apply(this,arguments)})),a({name:"create_application",description:"Create a new BRICKS application with default grid layout",inputSchema:o({name:A.Yj().describe("Application name"),description:A.Yj().describe("Application description").optional(),grid_width:A.ai().describe("Grid width in units").optional().default(96),grid_height:A.ai().describe("Grid height in units").optional().default(54)}),permission:"create_application"},(b=$(function*({workspace_id:e,name:i,description:t,grid_width:n,grid_height:a}){return C((yield r.createApplication({workspaceId:e,name:i,description:t,gridWidth:n,gridHeight:a})))}),function(e){return b.apply(this,arguments)})),a({name:"update_application_info",description:"Update application info",inputSchema:{id:A.Yj().describe("Application ID"),name:A.Yj().describe("Application name"),description:A.Yj().describe("Application description")},permission:"update_application"},(I=$(function*({id:e,name:i,description:t}){return C((yield r.updateApplication({id:e,name:i,description:t})))}),function(e){return I.apply(this,arguments)})),a({name:"update_application_config",description:"Update application configuration with validation",inputSchema:{id:A.Yj().describe("Application ID"),config:A.Ik({}).passthrough().describe("New application configuration. Please read `getting-started` for BRICKS concepts before changing")},permission:"update_application"},(k=$(function*({id:e,config:i}){var t=yield N(i);if(!t.valid)throw Error(`Config validation failed: ${t.errors.join(", ")}`);return C((yield r.updateApplication({id:e,config:JSON.stringify(i)})))}),function(e){return k.apply(this,arguments)})),a({name:"bind_application",description:"Bind application to device with viewport configuration",inputSchema:{app_id:A.Yj().describe("Application ID"),viewports:A.YO(A.Ik({device_id:A.Yj().describe("Device ID"),x:A.ai().describe("X coordinate"),y:A.ai().describe("Y coordinate"),width:A.ai().describe("Width"),height:A.ai().describe("Height"),rotate:A.ai().describe("Rotation"),rotateType:A.Yj().describe("Rotation type")})).describe("Viewport configuration")},permission:"bind_application"},(D=$(function*({app_id:e,viewports:i}){return C((yield r.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 D.apply(this,arguments)})),a({name:"unbind_application",description:"Unbind application from device",inputSchema:{app_id:A.Yj().describe("Application ID"),device_id:A.Yj().describe("Device ID")},permission:"bind_application"},(S=$(function*({app_id:e,device_id:i}){return C((yield r.bindApplication({id:e,unbindDevices:[i]})))}),function(e){return S.apply(this,arguments)})),n&&a({name:"list_media_workspaces",description:"List all media workspaces",inputSchema:{},permission:"query_media_flow"},$(function*(){return C((yield s.mediaWorkspaces()))})),a({name:"get_media_workspace",description:"Get media workspace information and status",inputSchema:o({}),permission:"query_media_flow"},(E=$(function*({workspace_id:e}){return C((yield s.mediaWorkspace({workspaceId:e})))}),function(e){return E.apply(this,arguments)})),a({name:"list_media_boxes",description:"List all media boxes in the workspace",inputSchema:o({}),permission:"query_media_flow"},(U=$(function*({workspace_id:e}){return C((yield s.mediaBoxes({workspaceId:e})))}),function(e){return U.apply(this,arguments)})),a({name:"get_media_box",description:"Get detailed information about a specific media box",inputSchema:{box_id:A.Yj().describe("Media box ID")},permission:"query_media_flow"},(M=$(function*({box_id:e}){return C((yield s.mediaBox({boxId:e})))}),function(e){return M.apply(this,arguments)})),a({name:"list_media_files",description:"List media files in a specific box with filtering options",inputSchema:{box_id:A.Yj().describe("Media box ID"),include_types:A.YO(A.Yj()).optional().describe('Filter by file types (e.g., ["image", "video", "audio"])'),user_tags:A.YO(A.Yj()).optional().describe("Filter by user tags"),limit:A.ai().optional().default(50).describe("Maximum number of files to return"),offset:A.ai().optional().default(0).describe("Number of files to skip")},permission:"query_media_flow"},(R=$(function*({box_id:e,include_types:i,user_tags:t,limit:n,offset:a}){return C((yield s.mediaFiles({boxId:e,includeTypes:i,userTags:t,limit:n,offset:a})))}),function(e){return R.apply(this,arguments)})),a({name:"get_media_file_meta",description:"Get detailed information about a specific media file",inputSchema:{file_id:A.Yj().describe("Media file ID")},permission:"query_media_flow"},(P=$(function*({file_id:e}){return C((yield s.mediaFile({fileId:e})))}),function(e){return P.apply(this,arguments)})),a({name:"media_box_upload",description:"Upload a file to a media box from URL or base64 data",inputSchema:{box_id:A.Yj().describe("Target media box ID"),name:A.Yj().describe("File name"),description:A.Yj().optional().default("").describe("File description"),file_type:A.k5(["image","video","audio","file"]).describe("File type"),source_url:A.Yj().optional().describe("URL to download the file from"),base64_data:A.Yj().optional().describe("Base64 encoded file data"),user_tags:A.YO(A.Yj()).optional().default([]).describe("User-defined tags for the file")},permission:"write_media_flow"},(O=$(function*({box_id:e,name:i,description:t,source_url:a,base64_data:o,file_type:r,user_tags:d}){if(!a&&!o)throw Error("Either source_url or base64_data must be provided");if(a&&o)throw Error("Provide either source_url OR base64_data, not both");var c=a?null:"application/octet-stream",l=a?yield(0,x.Ay)(a,{agent:(0,B.fJ)(a)}).then(e=>(c=e.headers.get("content-type"),e.blob())):new Blob([w.Buffer.from(o,"base64")],{type:c}),p=yield s.requestFileUpload({name:i,description:t,boxId:e,fileType:n?r.toUpperCase():r,contentType:c,userTags:d,meta:{}}),u=JSON.parse(p?.meta.uploadInfo),m=new FormData;m.append("file",l),m.append("Content-Type",c),m.append("AWSAccessKeyId",u.AWSAccessKeyId),m.append("Signature",u.Signature),m.append("Policy",u.Policy),m.append("acl",u.acl),m.append("key",u.key);var _=yield(0,x.Ay)(u.url,{method:"POST",body:m}).then(e=>e.ok).catch(()=>!1);return C({file_id:p.id,upload_success:_,upload_info:{content_type:c,file_type:r,source_type:a?"url":"base64",processing_note:"File will be processed automatically. Use get_media_file to check processing status."}})}),function(e){return O.apply(this,arguments)})),a({name:"update_media_file_meta",description:"Update media file information",inputSchema:{file_id:A.Yj().describe("Media file ID"),name:A.Yj().optional().describe("New file name"),description:A.Yj().optional().describe("New file description"),user_tags:A.YO(A.Yj()).optional().describe("New user tags")},permission:"write_media_flow"},(F=$(function*({file_id:e,name:i,description:t,user_tags:n}){return C((yield s.updateMediaFile({fileId:e,name:i,description:t,userTags:n,requestUploadAgain:!1})))}),function(e){return F.apply(this,arguments)})),a({name:"copy_media_files",description:"Copy media files from one box to another",inputSchema:{from_box_id:A.Yj().describe("Source media box ID"),to_box_id:A.Yj().describe("Target media box ID"),file_ids:A.YO(A.Yj()).describe("Array of media file IDs to copy")},permission:"write_media_flow"},(q=$(function*({from_box_id:e,to_box_id:i,file_ids:t}){return C((yield s.copyMediaFiles({fromBoxId:e,toBoxId:i,list:t})))}),function(e){return q.apply(this,arguments)})),a({name:"delete_media_files",description:"Delete specific media files from a box",inputSchema:{box_id:A.Yj().describe("Media box ID"),file_ids:A.YO(A.Yj()).describe("Array of media file IDs to delete")},permission:"write_media_flow"},(W=$(function*({box_id:e,file_ids:i}){return C((yield s.deleteMediaFiles({boxId:e,list:i})))}),function(e){return W.apply(this,arguments)})),a({name:"cleanup_media_box",description:"Delete all files in a media box, optionally filtered by type",inputSchema:{box_id:A.Yj().describe("Media box ID"),include_types:A.YO(A.Yj()).optional().describe('Only delete files of these types (e.g., ["image", "video"])')},permission:"write_media_flow"},(j=$(function*({box_id:e,include_types:i}){if("deleteMediaBoxFiles"in s)return C((yield s.deleteMediaBoxFiles({boxId:e,includeTypes:i})));var t=yield s.mediaFiles({boxId:e,includeTypes:i});return C((yield s.deleteMediaFiles({boxId:e,list:t.map(e=>e.id)})))}),function(e){return j.apply(this,arguments)})),e.tool("calculate_grid_layout","Calculate grid layout and pixel conversions for different device resolutions",{device_width:A.ai().describe("Device width in pixels"),device_height:A.ai().describe("Device height in pixels"),app_grid_width:A.ai().describe("Application grid width").optional().default(96),app_grid_height:A.ai().describe("Application grid height").optional().default(54)},(V=$(function*({device_width:e,device_height:i,app_grid_width:t,app_grid_height:n}){var a,o=(a=e/t,{deviceBrickWidth:e/a,deviceBrickHeight:i/a,deviceBrickUnit:a}),r=function(e,i,t=96){var n=e/t;return i>e&&(n=i/t),{deviceBrickWidth:Math.round(e/n),deviceBrickHeight:Math.round(i/n),deviceBrickUnit:n}}(e,i,t);return C({device_resolution:{width:e,height:i,aspect_ratio:(e/i).toFixed(2)},current_grid:{width:t,height:n,unit_size_px:o.deviceBrickUnit.toFixed(2),total_pixels:{width:o.deviceBrickWidth.toFixed(2),height:o.deviceBrickHeight.toFixed(2)}},recommended_grid:{width:r.deviceBrickWidth,height:r.deviceBrickHeight,unit_size_px:r.deviceBrickUnit.toFixed(2),note:"Optimized for device aspect ratio"}})}),function(e){return V.apply(this,arguments)})),e.tool("create_item","Use this tool to create new item that you can put in application configuration",{type:A.k5(["subspace","canvas","brick","generator","property_bank","property_bank_calc","property_bank_command","animation","state_group","automation_map"]).describe("Item type"),title:A.Yj().describe("Item title"),template_key:A.Yj().optional().describe("Template key for brick or generator")},tz),e.tool("getting_started","Get documentation content for getting started",{},$(function*(){return C(L)})),!n){var d,c,l,p,u,m,v,h,b,I,k,D,S,E,U,M,R,P,O,F,q,W,j,V,K,Y,G,z=()=>new tK(tG.activityLog,i.token);a({name:"activity_log_events",description:"Query activity log events. Returns raw events (general, data, local_sync) with filtering. Max 30-day range.",inputSchema:o({start_time:A.Yj().describe("Start time (ISO 8601)"),end_time:A.Yj().describe("End time (ISO 8601)"),device_id:A.Yj().optional().describe("Filter by device ID"),event_type:A.k5(["general","data","local_sync"]).optional().describe("Filter by event type"),event_name:A.Yj().optional().describe("Filter by event name (e.g. BRICK_xxx_ON_PRESS)"),subspace_id:A.Yj().optional().describe("Filter by subspace ID"),sender:A.Yj().optional().describe("Filter by sender"),limit:A.ai().optional().default(50).describe("Max events to return per page"),offset:A.ai().optional().default(0).describe("Number of events to skip (for pagination)")}),permission:"query_activity_log"},(K=$(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=z(),l={start_time:e,end_time:i};return t&&(l.device_id=t),n&&(l.event_type=n),a&&(l.event_name=a),o&&(l.subspace_id=o),r&&(l.sender=r),C((yield c.events(l,{limit:s,offset:d})))}),function(e){return K.apply(this,arguments)})),a({name:"activity_log_screenshots",description:"List available screenshot timestamps for a device in a time range.",inputSchema:o({device_id:A.Yj().describe("Device ID (required)"),start_time:A.Yj().describe("Start time (ISO 8601)"),end_time:A.Yj().describe("End time (ISO 8601)")}),permission:"query_activity_log"},(Y=$(function*({device_id:e,start_time:i,end_time:t}){var n=z();return C((yield n.screenshots({device_id:e,start_time:i,end_time:t})))}),function(e){return Y.apply(this,arguments)})),a({name:"activity_log_screenshot",description:"Download a device screenshot at a specific timestamp. Returns JPEG image as blob.",inputSchema:o({device_id:A.Yj().describe("Device ID"),ts:A.Yj().describe("Screenshot timestamp (ISO 8601 or epoch ms)")}),permission:"query_activity_log"},(G=$(function*({workspace_id:e,device_id:t,ts:n}){var a=e||i.tokenInfo?.w_id;if(!a)throw Error("Could not determine workspace ID");var o=z(),r=/^\d+$/.test(n)?n:new Date(n).getTime();return C((yield o.downloadScreenshot(a,t,r)),{mimeType:"image/jpeg"})}),function(e){return G.apply(this,arguments)}))}a({name:"get_device_usage",description:"Get device usage metrics (uptime, memory, disk) for a date range. Data from BRICKS main server.",inputSchema:o({device_id:A.Yj().describe("Device ID"),start_date:A.Yj().optional().describe("Start date/time in ISO 8601 format (default: start of today)"),end_date:A.Yj().optional().describe("End date/time in ISO 8601 format (default: now)")}),permission:"query_device"},(t=$(function*({device_id:e,start_date:i,end_date:t}){var n=new Date,a=new Date(n.getFullYear(),n.getMonth(),n.getDate()).toISOString();return C((yield r.deviceUsage({deviceId:e,startDate:i?new Date(i).toISOString():a,endDate:t?new Date(t).toISOString():n.toISOString()})))}),function(e){return t.apply(this,arguments)}))}(a,o);var r=new h.S;try{yield a.connect(r),console.error("BRICKS MCP Server running on STDIO"),console.error(`Server: ${tY} v${tH}`),console.error(`Token Type: ${n.tokenType}`),console.error(`Permissions: ${n.tokenInfo.permissions.join(", ")}`),console.error("Ready to accept requests...")}catch(e){throw console.error("Failed to start MCP server:",e),e}})).apply(this,arguments)}}};
|