@fugood/bricks-cli 2.25.10 → 2.25.12
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/README.md +39 -5
- package/lib/1178.js +1 -1
- package/lib/1215.js +1 -1
- package/lib/1374.js +4 -0
- package/lib/1708.js +4 -4
- package/lib/2467.js +1 -1
- package/lib/2486.js +1 -1
- package/lib/2517.js +8 -0
- package/lib/2557.js +1 -1
- package/lib/2700.js +1 -0
- package/lib/3223.js +1 -1
- package/lib/3690.js +1 -1
- package/lib/3774.js +2 -2
- package/lib/4456.js +2 -2
- package/lib/4485.js +1 -0
- package/lib/5140.js +1 -1
- package/lib/5658.js +1 -1
- package/lib/6194.js +1 -1
- package/lib/6818.js +1 -1
- package/lib/7294.js +1 -1
- package/lib/7494.js +12 -3
- package/lib/7511.js +3 -1
- package/lib/831.js +1 -1
- package/lib/907.js +148 -51
- package/lib/9320.js +23 -2
- package/lib/9439.js +288 -229
- package/lib/9663.js +1 -1
- package/lib/devtools.js +1 -1
- package/lib/index.js +109 -100
- package/lib/lib.js +202 -96
- package/package.json +4 -4
- package/lib/3593.js +0 -1
- package/lib/563.js +0 -4
- package/lib/6645.js +0 -1
- package/lib/7574.js +0 -1
- package/lib/7648.js +0 -1
- package/lib/9590.js +0 -7
package/lib/9439.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
export const __rspack_esm_id=9439;export const __rspack_esm_ids=[9439];export const __webpack_modules__={70114(e,i,t){t.r(i),t.d(i,{startStdioServer:()=>t3});var n,a,o,r,s,d,c,l,p={};t.r(p),t.d(p,{applicationFragment:()=>ep,applicationShortFragment:()=>eh,deviceFragment:()=>ec,deviceGroupFragment:()=>el,deviceShortFragment:()=>eb,instanceVersionFragment:()=>eg,mediaBoxFragment:()=>ek,mediaFileFragment:()=>eD,mediaWorkspaceFragment:()=>eI,moduleFragment:()=>em,moduleShortFragment:()=>e_,operationFragment:()=>ef,publicApplicationBasicInfoFragment:()=>eu,userFavoriteFragment:()=>ey,workspaceFragment:()=>e$,workspaceShortFragment:()=>ev});var u={};t.r(u),t.d(u,{application:()=>eK,applicationByDevice:()=>eP,applicationReleaseVersion:()=>eU,applicationReleaseVersions:()=>eB,applicationTestsByDevice:()=>eO,applications:()=>eY,checkBindDevicePasscode:()=>eF,deviceUsage:()=>eL,devices:()=>eG,devicesByGroup:()=>eq,devicesByUniqueId:()=>eN,me:()=>eS,module:()=>eC,moduleReleaseVersion:()=>eR,moduleReleaseVersions:()=>eM,modules:()=>eT,publicModules:()=>ex,publicModulesByIdList:()=>eE,workspace:()=>eW,workspacePricingPlans:()=>ej,workspaces:()=>eV});var m={};t.r(m),t.d(m,{addUserFavorite:()=>iC,assignGroupPermissions:()=>iD,bindApplication:()=>ia,bindApplicationWithDeviceGroup:()=>is,changeWorkspaceAdditionalLimitSpending:()=>iE,changeWorkspaceSubscriptionPlan:()=>ix,controlDevice:()=>e5,createApplication:()=>ie,createApplicationWithShareVersion:()=>ii,createConfigChangeOperation:()=>ih,createDevice:()=>eQ,createDeviceGroup:()=>e9,createDeviceGroupWithApp:()=>il,createModule:()=>i_,createVirtualDevice:()=>eZ,createWorkspace:()=>ez,createWorkspaceOTP:()=>iB,dispatchDeviceGroupAction:()=>e3,doOperation:()=>ib,duplicateApplication:()=>iu,duplicateModule:()=>i$,forkApplication:()=>ip,moveApplication:()=>ic,moveDevice:()=>e1,moveModule:()=>iy,registerFCMNotification:()=>iA,registerRemoteDebug:()=>iw,removeApplication:()=>im,removeDevice:()=>e6,removeDeviceGroup:()=>e8,removeModule:()=>iv,removeOperation:()=>ik,removeUserFavorite:()=>iT,removeWorkspace:()=>e7,revokeWorkspaceOTP:()=>iU,shareAccessToken:()=>iS,shareApplication:()=>id,toggleShortEditApplication:()=>io,updateApplication:()=>it,updateApplicationViewportPreset:()=>ir,updateDevice:()=>e0,updateDeviceGroup:()=>e2,updateModule:()=>ig,updateOperation:()=>iI,updateVirtualDevice:()=>e4,updateWorkspace:()=>eJ,updateWorkspaceTokens:()=>eX});var _={};t.r(_),t.d(_,{application:()=>iF,applicationByDevice:()=>iN,applications:()=>iO,device:()=>iV,deviceUsage:()=>iK,devices:()=>iW,devicesByApplication:()=>iY,mediaBox:()=>iH,mediaBoxes:()=>iL,mediaFile:()=>iJ,mediaFiles:()=>iz,mediaWorkspace:()=>iG,module:()=>ij,modules:()=>iq,workspace:()=>iP});var g={};t.r(g),t.d(g,{bindApplication:()=>iZ,copyMediaFiles:()=>i3,createApplication:()=>iX,createModule:()=>i1,deleteMediaBoxFiles:()=>i7,deleteMediaFiles:()=>i8,requestFileUpload:()=>i6,setMediaFileAsBoxPreview:()=>i2,unbindApplication:()=>i0,updateApplication:()=>iQ,updateMediaFile:()=>i5,updateMediaFiles:()=>i9,updateModule:()=>i4});var f={};t.r(f),t.d(f,{mediaBox:()=>tD,mediaBoxes:()=>tI,mediaFile:()=>tw,mediaFiles:()=>tA,mediaWorkspace:()=>tk,mediaWorkspaces:()=>tb});var y={};t.r(y),t.d(y,{assignGroupPermissions:()=>tF,copyMediaFiles:()=>tP,createMediaBox:()=>tT,createMediaWorkspace:()=>tS,deleteMediaFiles:()=>tR,moveMediaBox:()=>tx,requestFileUpload:()=>tB,setMediaFileAsBoxPreview:()=>tO,updateMediaBox:()=>tE,updateMediaFile:()=>tU,updateMediaFiles:()=>tM,updateMediaWorkspace:()=>tC});var $={};t.r($),t.d($,{mediaBox:()=>tq,mediaFile:()=>tW,mediaFiles:()=>tj});var v={};t.r(v),t.d(v,{deleteMediaFiles:()=>tG,requestFileUpload:()=>tV,updateMediaFile:()=>tY,updateMediaFiles:()=>tK});var h=t(99436),b=t(42820),I=t(66029),k={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"},D=Object.entries(k).reduce((e,[i,t])=>(e[t]=i,e),{}),A=["HS256","RS256"],w=["https://auth0.bricks.tools/","https://mybigday.auth0.com/"],S=t(84867);let C='# 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 T=t(20181),x=(e,i={})=>({content:[T.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}),E=t(68832),B=t(79657),U=t(79861),M=t(58976),R=t(46123),P=t(69771),O=t(91611),F=t(99548),N=t(96423),q=P.ajv.getSchema("http://display.bricks.tools/root.schema.json5"),j=(0,N.A)(["subspace_map.*.property_bank_calc_map.*.script_config"]),W=e=>e&&"object"==typeof e?e:{};function V(e){var i=[];try{var t=P(e);i.push(...(0,F.L)({errors:t,schema:q,data:e}).map(({path:e,message:i})=>`${e}: ${i}`));try{i.push(...O(e).map(({field:e,message:i})=>`${e}: ${i}`))}catch(e){i.push(`Component reference validation failed: ${e.message}`)}return j(e).forEach(t=>{var n=t.slice(0,-1),a=R(e,n),o=n.join("."),r=W(a?.map),s=W(a?.script_config);if(0===Object.keys(r).length)i.push(`${o}.map is empty`);else{var d=s.inputs,c=s.output,l=s.outputs,p=s.error,u=W(d),m=W(l);d&&Object.keys(u).forEach(e=>{r[e]||i.push(`${o}.map.${e} is missing`)}),c&&!r[c]&&i.push(`${o}.map.${c} is missing`),l&&Object.values(m).flat().forEach(e=>{r[e]||i.push(`${o}.map.${e} is missing`)}),p&&!r[p]&&i.push(`${o}.map.${p} is missing`)}}),{valid:0===i.length,errors:i}}catch(e){return{valid:!1,errors:[`Validation failed: ${e.message}`]}}}var Y=t(81973),K=t(94513),G=(e,i="en-us")=>"object"==typeof e&&null!==e?Object.fromEntries(Object.entries(e).map(([e,t])=>[e,"object"!=typeof t||null===t||Array.isArray(t)?t:t[i]??G(t,i)])):e,L=G(Y.t),H=Object.entries(Y.systemActions).map(([e,{propertyNameType:i,property:t}])=>` - \`${e}\`: ${L[e]}
|
|
1
|
+
export const __rspack_esm_id=9439;export const __rspack_esm_ids=[9439];export const __webpack_modules__={70114(e,i,t){t.r(i),t.d(i,{startStdioServer:()=>na});var n,a,o,r,s,d,c,l,p={};t.r(p),t.d(p,{applicationFragment:()=>em,applicationShortFragment:()=>eI,deviceApplicationStatusFragment:()=>ec,deviceDetailFragment:()=>ep,deviceFragment:()=>el,deviceGroupFragment:()=>eu,deviceShortFragment:()=>ek,instanceVersionFragment:()=>ey,mediaBoxFragment:()=>eA,mediaFileFragment:()=>eS,mediaWorkspaceFragment:()=>eD,moduleFragment:()=>eg,moduleShortFragment:()=>ef,operationFragment:()=>e$,publicApplicationBasicInfoFragment:()=>e_,userFavoriteFragment:()=>ev,workspaceFragment:()=>eh,workspaceShortFragment:()=>eb});var u={};t.r(u),t.d(u,{application:()=>eL,applicationByDevice:()=>eF,applicationReleaseVersion:()=>eM,applicationReleaseVersions:()=>eR,applicationTestsByDevice:()=>eN,applications:()=>eG,checkBindDevicePasscode:()=>eq,deviceUsage:()=>eH,devices:()=>ez,devicesByGroup:()=>eW,devicesByUniqueId:()=>ej,me:()=>eT,module:()=>ex,moduleReleaseVersion:()=>eP,moduleReleaseVersions:()=>eO,modules:()=>eE,publicModules:()=>eB,publicModulesByIdList:()=>eU,workspace:()=>eY,workspacePricingPlans:()=>eV,workspaces:()=>eK});var m={};t.r(m),t.d(m,{addUserFavorite:()=>ix,assignGroupPermissions:()=>iS,bindApplication:()=>ir,bindApplicationWithDeviceGroup:()=>ic,changeWorkspaceAdditionalLimitSpending:()=>iU,changeWorkspaceSubscriptionPlan:()=>iB,controlDevice:()=>e2,createApplication:()=>it,createApplicationWithShareVersion:()=>ia,createConfigChangeOperation:()=>iI,createDevice:()=>e0,createDeviceGroup:()=>e3,createDeviceGroupWithApp:()=>iu,createModule:()=>iy,createVirtualDevice:()=>e1,createWorkspace:()=>eX,createWorkspaceOTP:()=>iR,dispatchDeviceGroupAction:()=>e7,doOperation:()=>ik,duplicateApplication:()=>i_,duplicateModule:()=>ih,forkApplication:()=>im,moveApplication:()=>ip,moveDevice:()=>e6,moveModule:()=>iv,registerFCMNotification:()=>iw,registerRemoteDebug:()=>iC,removeApplication:()=>ig,removeDevice:()=>e9,removeDeviceGroup:()=>ie,removeModule:()=>ib,removeOperation:()=>iA,removeUserFavorite:()=>iE,removeWorkspace:()=>ii,revokeWorkspaceOTP:()=>iM,shareAccessToken:()=>iT,shareApplication:()=>il,toggleShortEditApplication:()=>is,updateApplication:()=>io,updateApplicationViewportPreset:()=>id,updateDevice:()=>e4,updateDeviceGroup:()=>e8,updateModule:()=>i$,updateOperation:()=>iD,updateVirtualDevice:()=>e5,updateWorkspace:()=>eQ,updateWorkspaceTokens:()=>eZ});var _={};t.r(_),t.d(_,{application:()=>ij,applicationByDevice:()=>iW,applications:()=>iq,device:()=>iG,deviceUsage:()=>iz,devices:()=>iK,devicesByApplication:()=>iL,mediaBox:()=>iX,mediaBoxes:()=>iJ,mediaFile:()=>iZ,mediaFiles:()=>iQ,mediaWorkspace:()=>iH,module:()=>iY,modules:()=>iV,workspace:()=>iN});var g={};t.r(g),t.d(g,{bindApplication:()=>i4,copyMediaFiles:()=>te,createApplication:()=>i0,createModule:()=>i5,deleteMediaBoxFiles:()=>tt,deleteMediaFiles:()=>ti,requestFileUpload:()=>i2,setMediaFileAsBoxPreview:()=>i7,unbindApplication:()=>i6,updateApplication:()=>i1,updateMediaFile:()=>i3,updateMediaFiles:()=>i8,updateModule:()=>i9});var f={};t.r(f),t.d(f,{mediaBox:()=>tE,mediaBoxes:()=>tT,mediaFile:()=>tU,mediaFiles:()=>tB,mediaWorkspace:()=>tx,mediaWorkspaces:()=>tC});var y={};t.r(y),t.d(y,{assignGroupPermissions:()=>tK,copyMediaFiles:()=>tV,createMediaBox:()=>tO,createMediaWorkspace:()=>tR,deleteMediaFiles:()=>tW,moveMediaBox:()=>tP,requestFileUpload:()=>tN,setMediaFileAsBoxPreview:()=>tY,updateMediaBox:()=>tF,updateMediaFile:()=>tq,updateMediaFiles:()=>tj,updateMediaWorkspace:()=>tM});var $={};t.r($),t.d($,{mediaBox:()=>tL,mediaFile:()=>tH,mediaFiles:()=>tz});var v={};t.r(v),t.d(v,{deleteMediaFiles:()=>tZ,requestFileUpload:()=>tJ,updateMediaFile:()=>tX,updateMediaFiles:()=>tQ});var h=t(99436),b=t(42820),I=t(66029),k={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"},D=Object.entries(k).reduce((e,[i,t])=>(e[t]=i,e),{}),A=["HS256","RS256"],S=["https://auth0.bricks.tools/","https://mybigday.auth0.com/"],w=t(84867);let C='# 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 T=t(68832),x=t(20181),E=t(79657),B=t(79861),U=t(58976),R=t(46123),M=t(69771),O=t(91611),P=t(99548),F=t(96423),N=M.ajv.getSchema("http://display.bricks.tools/root.schema.json5"),q=(0,F.A)(["subspace_map.*.property_bank_calc_map.*.script_config"]),j=e=>e&&"object"==typeof e?e:{};function W(e){var i=[];try{var t=M(e);i.push(...(0,P.L)({errors:t,schema:N,data:e}).map(({path:e,message:i})=>`${e}: ${i}`));try{i.push(...O(e).map(({field:e,message:i})=>`${e}: ${i}`))}catch(e){i.push(`Component reference validation failed: ${e.message}`)}return q(e).forEach(t=>{var n=t.slice(0,-1),a=R(e,n),o=n.join("."),r=j(a?.map),s=j(a?.script_config);if(0===Object.keys(r).length)i.push(`${o}.map is empty`);else{var d=s.inputs,c=s.output,l=s.outputs,p=s.error,u=j(d),m=j(l);d&&Object.keys(u).forEach(e=>{r[e]||i.push(`${o}.map.${e} is missing`)}),c&&!r[c]&&i.push(`${o}.map.${c} is missing`),l&&Object.values(m).flat().forEach(e=>{r[e]||i.push(`${o}.map.${e} is missing`)}),p&&!r[p]&&i.push(`${o}.map.${p} is missing`)}}),{valid:0===i.length,errors:i}}catch(e){return{valid:!1,errors:[`Validation failed: ${e.message}`]}}}var V=t(81973),Y=t(94513),K=(e,i="en-us")=>"object"==typeof e&&null!==e?Object.fromEntries(Object.entries(e).map(([e,t])=>[e,"object"!=typeof t||null===t||Array.isArray(t)?t:t[i]??K(t,i)])):e,G=K(V.t),L=Object.entries(V.systemActions).map(([e,{propertyNameType:i,property:t}])=>` - \`${e}\`: ${G[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"),z=Object.keys(
|
|
3
|
+
`.trim()).join("\n"),z=Object.keys(Y.eW).map(e=>`- \`${e}\``).join("\n"),H=Object.keys(Y.wj).map(e=>`- \`${e}\``).join("\n");let J=C.replace("[:SYSTEM_ACTIONS:]",L).replace("[:BRICK_IDS:]",z).replace("[:GENERATOR_IDS:]",H);var X=(e,i={})=>({content:[x.Buffer.isBuffer(e)?{...i,data:e.toString("base64"),type:"image"}:{...i,text:"string"==typeof e?e:JSON.stringify(e,null,2),type:"text"}],isError:!1}),Q=t(44668),Z=t(5018),ee=t(63315),ei=t(30409),et=t(40906),en=t(79760),ea=t(22268),eo=t(7068),er=t(26197),es=t(94370);let ed=(0,es.default)`
|
|
4
4
|
fragment workspaceArguments on Workspace {
|
|
5
5
|
__typename
|
|
6
6
|
_id
|
|
@@ -94,6 +94,34 @@ ${((e,i)=>{switch(e){case"defined_properties":return Object.entries(i).map(([e,i
|
|
|
94
94
|
}
|
|
95
95
|
}
|
|
96
96
|
`,ec=(0,es.default)`
|
|
97
|
+
fragment deviceApplicationStatusArguments on DeviceApplicationStatus {
|
|
98
|
+
status
|
|
99
|
+
reason
|
|
100
|
+
assigned {
|
|
101
|
+
application_id
|
|
102
|
+
name
|
|
103
|
+
config_timestamp
|
|
104
|
+
commit_id
|
|
105
|
+
lazy_update
|
|
106
|
+
}
|
|
107
|
+
reported {
|
|
108
|
+
_id
|
|
109
|
+
name
|
|
110
|
+
config_timestamp
|
|
111
|
+
commit_id
|
|
112
|
+
state
|
|
113
|
+
error_stage
|
|
114
|
+
error_code
|
|
115
|
+
error_message
|
|
116
|
+
ready {
|
|
117
|
+
config_timestamp
|
|
118
|
+
commit_id
|
|
119
|
+
}
|
|
120
|
+
}
|
|
121
|
+
reported_at
|
|
122
|
+
confirmed_at
|
|
123
|
+
}
|
|
124
|
+
`,el=(0,es.default)`
|
|
97
125
|
fragment deviceArguments on Device {
|
|
98
126
|
__typename
|
|
99
127
|
_id
|
|
@@ -246,7 +274,17 @@ ${((e,i)=>{switch(e){case"defined_properties":return Object.entries(i).map(([e,i
|
|
|
246
274
|
}
|
|
247
275
|
}
|
|
248
276
|
}
|
|
249
|
-
`,
|
|
277
|
+
`,ep=(0,es.default)`
|
|
278
|
+
fragment deviceDetailArguments on Device {
|
|
279
|
+
advanced_setting {
|
|
280
|
+
offline_indicator
|
|
281
|
+
}
|
|
282
|
+
application_status {
|
|
283
|
+
...deviceApplicationStatusArguments
|
|
284
|
+
}
|
|
285
|
+
}
|
|
286
|
+
${ec}
|
|
287
|
+
`,eu=(0,es.default)`
|
|
250
288
|
fragment deviceGroupArguments on DeviceGroup {
|
|
251
289
|
__typename
|
|
252
290
|
_id
|
|
@@ -284,7 +322,7 @@ ${((e,i)=>{switch(e){case"defined_properties":return Object.entries(i).map(([e,i
|
|
|
284
322
|
device_target_name
|
|
285
323
|
}
|
|
286
324
|
}
|
|
287
|
-
`,
|
|
325
|
+
`,em=(0,es.default)`
|
|
288
326
|
fragment applicationArguments on Application {
|
|
289
327
|
__typename
|
|
290
328
|
_id
|
|
@@ -338,6 +376,7 @@ ${((e,i)=>{switch(e){case"defined_properties":return Object.entries(i).map(([e,i
|
|
|
338
376
|
update_screenshot
|
|
339
377
|
}
|
|
340
378
|
sync_key
|
|
379
|
+
separate_local_sync
|
|
341
380
|
}
|
|
342
381
|
used_workspace {
|
|
343
382
|
_id
|
|
@@ -433,7 +472,7 @@ ${((e,i)=>{switch(e){case"defined_properties":return Object.entries(i).map(([e,i
|
|
|
433
472
|
scope
|
|
434
473
|
}
|
|
435
474
|
}
|
|
436
|
-
`,
|
|
475
|
+
`,e_=(0,es.default)`
|
|
437
476
|
fragment publicApplicationBasicInfoArguments on PublicApplicationBasicInfo {
|
|
438
477
|
_id
|
|
439
478
|
owner {
|
|
@@ -477,7 +516,7 @@ ${((e,i)=>{switch(e){case"defined_properties":return Object.entries(i).map(([e,i
|
|
|
477
516
|
}
|
|
478
517
|
}
|
|
479
518
|
}
|
|
480
|
-
`,
|
|
519
|
+
`,eg=(0,es.default)`
|
|
481
520
|
fragment moduleArguments on Module {
|
|
482
521
|
__typename
|
|
483
522
|
_id
|
|
@@ -521,7 +560,7 @@ ${((e,i)=>{switch(e){case"defined_properties":return Object.entries(i).map(([e,i
|
|
|
521
560
|
last_screenshot_id
|
|
522
561
|
}
|
|
523
562
|
}
|
|
524
|
-
`,
|
|
563
|
+
`,ef=(0,es.default)`
|
|
525
564
|
fragment moduleShortArguments on Module {
|
|
526
565
|
__typename
|
|
527
566
|
_id
|
|
@@ -545,7 +584,7 @@ ${((e,i)=>{switch(e){case"defined_properties":return Object.entries(i).map(([e,i
|
|
|
545
584
|
last_screenshot_id
|
|
546
585
|
}
|
|
547
586
|
}
|
|
548
|
-
`,
|
|
587
|
+
`,ey=(0,es.default)`
|
|
549
588
|
fragment instanceVersionArguments on ConfigVersion {
|
|
550
589
|
__typename
|
|
551
590
|
_id
|
|
@@ -556,7 +595,7 @@ ${((e,i)=>{switch(e){case"defined_properties":return Object.entries(i).map(([e,i
|
|
|
556
595
|
instance_id
|
|
557
596
|
entry
|
|
558
597
|
}
|
|
559
|
-
`,
|
|
598
|
+
`,e$=(0,es.default)`
|
|
560
599
|
fragment operationArguments on Operation {
|
|
561
600
|
__typename
|
|
562
601
|
_id
|
|
@@ -569,7 +608,7 @@ ${((e,i)=>{switch(e){case"defined_properties":return Object.entries(i).map(([e,i
|
|
|
569
608
|
expired_datetime
|
|
570
609
|
payload
|
|
571
610
|
}
|
|
572
|
-
`,
|
|
611
|
+
`,ev=(0,es.default)`
|
|
573
612
|
fragment userFavoriteArguments on UserFavorite {
|
|
574
613
|
_id
|
|
575
614
|
instance_type
|
|
@@ -580,7 +619,7 @@ ${((e,i)=>{switch(e){case"defined_properties":return Object.entries(i).map(([e,i
|
|
|
580
619
|
}
|
|
581
620
|
last_modify_datetime
|
|
582
621
|
}
|
|
583
|
-
`;var
|
|
622
|
+
`;var eh=(0,es.default)`
|
|
584
623
|
fragment mcpWorkspaceArguments on Workspace {
|
|
585
624
|
__typename
|
|
586
625
|
_id
|
|
@@ -663,25 +702,25 @@ ${((e,i)=>{switch(e){case"defined_properties":return Object.entries(i).map(([e,i
|
|
|
663
702
|
updated_at
|
|
664
703
|
}
|
|
665
704
|
}
|
|
666
|
-
`,
|
|
705
|
+
`,eb=(0,es.default)`
|
|
667
706
|
fragment mcpWorkspaceShortArguments on Workspace {
|
|
668
707
|
_id
|
|
669
708
|
name
|
|
670
709
|
description
|
|
671
710
|
}
|
|
672
|
-
`,
|
|
711
|
+
`,eI=(0,es.default)`
|
|
673
712
|
fragment mcpApplicationShortArguments on Application {
|
|
674
713
|
_id
|
|
675
714
|
name
|
|
676
715
|
description
|
|
677
716
|
}
|
|
678
|
-
`,
|
|
717
|
+
`,ek=(0,es.default)`
|
|
679
718
|
fragment mcpDeviceShortArguments on Device {
|
|
680
719
|
_id
|
|
681
720
|
name
|
|
682
721
|
description
|
|
683
722
|
}
|
|
684
|
-
`,
|
|
723
|
+
`,eD=(0,es.default)`
|
|
685
724
|
fragment workspaceMediaWorkspaceArguments on MediaWorkspace {
|
|
686
725
|
id
|
|
687
726
|
name
|
|
@@ -693,7 +732,7 @@ ${((e,i)=>{switch(e){case"defined_properties":return Object.entries(i).map(([e,i
|
|
|
693
732
|
size
|
|
694
733
|
sizeLimit
|
|
695
734
|
}
|
|
696
|
-
`,
|
|
735
|
+
`,eA=(0,es.default)`
|
|
697
736
|
fragment workspaceMediaBoxArguments on MediaBox {
|
|
698
737
|
id
|
|
699
738
|
name
|
|
@@ -715,7 +754,7 @@ ${((e,i)=>{switch(e){case"defined_properties":return Object.entries(i).map(([e,i
|
|
|
715
754
|
updatedAt
|
|
716
755
|
size
|
|
717
756
|
}
|
|
718
|
-
`,
|
|
757
|
+
`,eS=(0,es.default)`
|
|
719
758
|
fragment workspaceMediaFileArguments on MediaFile {
|
|
720
759
|
id
|
|
721
760
|
name
|
|
@@ -798,70 +837,70 @@ ${((e,i)=>{switch(e){case"defined_properties":return Object.entries(i).map(([e,i
|
|
|
798
837
|
systemTags
|
|
799
838
|
}
|
|
800
839
|
}
|
|
801
|
-
`,
|
|
840
|
+
`,ew={query:"query",mutation:"mutate"},eC=Q(function e(i,t,n,a,o){var r,s,d=this;Z(this,e),this.baseUrl=i,this.auth="string"==typeof t?{token:t,getHeaders:(r=h(function*(){return{authorization:`Bearer ${t}`}}),function(){return r.apply(this,arguments)})}:t,this.token=this.auth?.token,this.endpoint=n;var c=(0,en.$)({uri:`${i}${n}`}),l=(0,er.o)((s=h(function*(e,{headers:i}){return{headers:{...i,...d.auth?yield d.auth.getHeaders():{}}}}),function(e,i){return s.apply(this,arguments)}));this.apolloClient=new ea.R({link:l.concat(c),cache:new eo.D,defaultOptions:{watchQuery:{errorPolicy:"all",fetchPolicy:"no-cache"},query:{errorPolicy:"all",fetchPolicy:"no-cache"}}}),this.fragments=p,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]=h(function*(a={},o={}){try{var r=e.apolloClient[ew[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=h(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=h(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 eT=(0,es.default)`
|
|
802
841
|
query ControllerClient_me {
|
|
803
842
|
me {
|
|
804
843
|
_id
|
|
805
844
|
id_from_user
|
|
806
845
|
}
|
|
807
846
|
}
|
|
808
|
-
`,
|
|
847
|
+
`,ex=(0,es.default)`
|
|
809
848
|
query ControllerClient_module($id: ID!) {
|
|
810
849
|
module(id: $id) {
|
|
811
850
|
...moduleArguments
|
|
812
851
|
}
|
|
813
852
|
}
|
|
814
|
-
${
|
|
815
|
-
`,
|
|
853
|
+
${eg}
|
|
854
|
+
`,eE=(0,es.default)`
|
|
816
855
|
query ControllerClient_modules($workspaceId: ID, $limit: Int) {
|
|
817
856
|
modules(workspaceId: $workspaceId, paginate: { limit: $limit }) {
|
|
818
857
|
...moduleShortArguments
|
|
819
858
|
}
|
|
820
859
|
}
|
|
821
|
-
${
|
|
822
|
-
`,
|
|
860
|
+
${ef}
|
|
861
|
+
`,eB=(0,es.default)`
|
|
823
862
|
query ControllerClient_publicModules($keyword: String!, $limit: Int) {
|
|
824
863
|
publicModules(keyword: $keyword, paginate: { limit: $limit }) {
|
|
825
864
|
...moduleShortArguments
|
|
826
865
|
}
|
|
827
866
|
}
|
|
828
|
-
${
|
|
829
|
-
`,
|
|
867
|
+
${ef}
|
|
868
|
+
`,eU=(0,es.default)`
|
|
830
869
|
query ControllerClient_publicModulesByIdList($idList: [ID]) {
|
|
831
870
|
publicModulesByIdList(idList: $idList) {
|
|
832
871
|
...moduleShortArguments
|
|
833
872
|
}
|
|
834
873
|
}
|
|
835
|
-
${
|
|
836
|
-
`,
|
|
874
|
+
${ef}
|
|
875
|
+
`,eR=(0,es.default)`
|
|
837
876
|
query ControllerClient_applicationReleaseVersions($id: ID!) {
|
|
838
877
|
applicationReleaseVersions(id: $id) {
|
|
839
878
|
...instanceVersionArguments
|
|
840
879
|
}
|
|
841
880
|
}
|
|
842
|
-
${
|
|
843
|
-
`,
|
|
881
|
+
${ey}
|
|
882
|
+
`,eM=(0,es.default)`
|
|
844
883
|
query ControllerClient_applicationReleaseVersion($id: ID!, $versionId: ID!) {
|
|
845
884
|
applicationReleaseVersion(id: $id, versionId: $versionId) {
|
|
846
885
|
...applicationReleaseVersionArguments
|
|
847
886
|
}
|
|
848
887
|
}
|
|
849
|
-
${
|
|
850
|
-
`,
|
|
888
|
+
${ey}
|
|
889
|
+
`,eO=(0,es.default)`
|
|
851
890
|
query ControllerClient_moduleReleaseVersions($id: ID!) {
|
|
852
891
|
moduleReleaseVersions(id: $id) {
|
|
853
892
|
...instanceVersionArguments
|
|
854
893
|
}
|
|
855
894
|
}
|
|
856
|
-
${
|
|
857
|
-
`,
|
|
895
|
+
${ey}
|
|
896
|
+
`,eP=(0,es.default)`
|
|
858
897
|
query ControllerClient_moduleReleaseVersion($id: ID!, $versionId: ID!) {
|
|
859
898
|
moduleReleaseVersion(id: $id, versionId: $versionId) {
|
|
860
899
|
...instanceVersionArguments
|
|
861
900
|
}
|
|
862
901
|
}
|
|
863
|
-
${
|
|
864
|
-
`,
|
|
902
|
+
${ey}
|
|
903
|
+
`,eF=(0,es.default)`
|
|
865
904
|
query ControllerClient_applicationByDevice(
|
|
866
905
|
$deviceId: ID!
|
|
867
906
|
$debug: Boolean
|
|
@@ -878,8 +917,8 @@ ${((e,i)=>{switch(e){case"defined_properties":return Object.entries(i).map(([e,i
|
|
|
878
917
|
config_tests
|
|
879
918
|
}
|
|
880
919
|
}
|
|
881
|
-
${
|
|
882
|
-
`,
|
|
920
|
+
${em}
|
|
921
|
+
`,eN=(0,es.default)`
|
|
883
922
|
query ControllerClient_applicationTestsByDevice($deviceId: ID!) {
|
|
884
923
|
applicationTestsByDevice: applicationByDevice(
|
|
885
924
|
deviceId: $deviceId
|
|
@@ -892,18 +931,18 @@ ${((e,i)=>{switch(e){case"defined_properties":return Object.entries(i).map(([e,i
|
|
|
892
931
|
config_tests
|
|
893
932
|
}
|
|
894
933
|
}
|
|
895
|
-
`,
|
|
934
|
+
`,eq=(0,es.default)`
|
|
896
935
|
query ControllerClient_checkBindDevicePasscode($passcode: String!) {
|
|
897
936
|
checkBindDevicePasscode(passcode: $passcode)
|
|
898
937
|
}
|
|
899
|
-
`,
|
|
938
|
+
`,ej=(0,es.default)`
|
|
900
939
|
query ControllerClient_devicesByUniqueId($uniqueID: String!, $unbindApplication: Boolean) {
|
|
901
940
|
devicesByUniqueId(uniqueID: $uniqueID, unbindApplication: $unbindApplication) {
|
|
902
941
|
...deviceArguments
|
|
903
942
|
}
|
|
904
943
|
}
|
|
905
|
-
${
|
|
906
|
-
`,
|
|
944
|
+
${el}
|
|
945
|
+
`,eW=(0,es.default)`
|
|
907
946
|
query ControllerClient_devicesByGroup($id: ID!) {
|
|
908
947
|
devicesByGroup(id: $id) {
|
|
909
948
|
device {
|
|
@@ -954,46 +993,46 @@ ${((e,i)=>{switch(e){case"defined_properties":return Object.entries(i).map(([e,i
|
|
|
954
993
|
target_name
|
|
955
994
|
}
|
|
956
995
|
}
|
|
957
|
-
`,
|
|
996
|
+
`,eV=(0,es.default)`
|
|
958
997
|
query ControllerClient_workspacePricingPlans {
|
|
959
998
|
workspacePricingPlans
|
|
960
999
|
}
|
|
961
|
-
`;var
|
|
1000
|
+
`;var eY=(0,es.default)`
|
|
962
1001
|
query User_workspace($id: ID!) {
|
|
963
1002
|
workspace(id: $id) {
|
|
964
1003
|
...mcpWorkspaceArguments
|
|
965
1004
|
}
|
|
966
1005
|
}
|
|
967
|
-
${
|
|
968
|
-
`,
|
|
1006
|
+
${eh}
|
|
1007
|
+
`,eK=(0,es.default)`
|
|
969
1008
|
query User_workspaces($paginate: Paginate) {
|
|
970
1009
|
workspaces(paginate: $paginate) {
|
|
971
1010
|
...mcpWorkspaceShortArguments
|
|
972
1011
|
}
|
|
973
1012
|
}
|
|
974
|
-
${
|
|
975
|
-
`,
|
|
1013
|
+
${eb}
|
|
1014
|
+
`,eG=(0,es.default)`
|
|
976
1015
|
query User_applications {
|
|
977
1016
|
applications {
|
|
978
1017
|
...mcpApplicationShortArguments
|
|
979
1018
|
}
|
|
980
1019
|
}
|
|
981
|
-
${
|
|
982
|
-
`,
|
|
1020
|
+
${eI}
|
|
1021
|
+
`,eL=(0,es.default)`
|
|
983
1022
|
query User_application($id: ID!) {
|
|
984
1023
|
application(id: $id) {
|
|
985
1024
|
...applicationArguments
|
|
986
1025
|
}
|
|
987
1026
|
}
|
|
988
|
-
${
|
|
989
|
-
`,
|
|
1027
|
+
${em}
|
|
1028
|
+
`,ez=(0,es.default)`
|
|
990
1029
|
query User_devices {
|
|
991
1030
|
devices {
|
|
992
1031
|
...mcpDeviceShortArguments
|
|
993
1032
|
}
|
|
994
1033
|
}
|
|
995
|
-
${
|
|
996
|
-
`,
|
|
1034
|
+
${ek}
|
|
1035
|
+
`,eH=(0,es.default)`
|
|
997
1036
|
query User_deviceUsage($deviceId: ID, $startDate: Date, $endDate: Date) {
|
|
998
1037
|
deviceUsage(deviceId: $deviceId, startDate: $startDate, endDate: $endDate) {
|
|
999
1038
|
_id
|
|
@@ -1012,14 +1051,14 @@ ${((e,i)=>{switch(e){case"defined_properties":return Object.entries(i).map(([e,i
|
|
|
1012
1051
|
}
|
|
1013
1052
|
}
|
|
1014
1053
|
}
|
|
1015
|
-
`;let
|
|
1054
|
+
`;let eJ=e=>(e.needResetStore=!0,e),eX=eJ((0,es.default)`
|
|
1016
1055
|
mutation ControllerClient_createWorkspace($name: String, $description: String) {
|
|
1017
1056
|
createWorkspace(name: $name, description: $description) {
|
|
1018
1057
|
...workspaceArguments
|
|
1019
1058
|
}
|
|
1020
1059
|
}
|
|
1021
1060
|
${ed}
|
|
1022
|
-
`),eJ
|
|
1061
|
+
`),eQ=eJ((0,es.default)`
|
|
1023
1062
|
mutation ControllerClient_updateWorkspace(
|
|
1024
1063
|
$id: ID!
|
|
1025
1064
|
$name: String
|
|
@@ -1048,7 +1087,7 @@ ${((e,i)=>{switch(e){case"defined_properties":return Object.entries(i).map(([e,i
|
|
|
1048
1087
|
}
|
|
1049
1088
|
}
|
|
1050
1089
|
${ed}
|
|
1051
|
-
`),
|
|
1090
|
+
`),eZ=eJ((0,es.default)`
|
|
1052
1091
|
mutation ControllerClient_updateWorkspaceTokens(
|
|
1053
1092
|
$id: ID!
|
|
1054
1093
|
$tokens: [WorkspaceTokenInput]
|
|
@@ -1065,7 +1104,7 @@ ${((e,i)=>{switch(e){case"defined_properties":return Object.entries(i).map(([e,i
|
|
|
1065
1104
|
}
|
|
1066
1105
|
}
|
|
1067
1106
|
${ed}
|
|
1068
|
-
`),
|
|
1107
|
+
`),e0=eJ((0,es.default)`
|
|
1069
1108
|
mutation ControllerClient_createDevice(
|
|
1070
1109
|
$workspaceId: ID
|
|
1071
1110
|
$name: String
|
|
@@ -1087,8 +1126,8 @@ ${((e,i)=>{switch(e){case"defined_properties":return Object.entries(i).map(([e,i
|
|
|
1087
1126
|
...deviceArguments
|
|
1088
1127
|
}
|
|
1089
1128
|
}
|
|
1090
|
-
${
|
|
1091
|
-
`),
|
|
1129
|
+
${el}
|
|
1130
|
+
`),e1=eJ((0,es.default)`
|
|
1092
1131
|
mutation ControllerClient_createVirtualDevice(
|
|
1093
1132
|
$workspaceId: ID
|
|
1094
1133
|
$name: String
|
|
@@ -1104,8 +1143,8 @@ ${((e,i)=>{switch(e){case"defined_properties":return Object.entries(i).map(([e,i
|
|
|
1104
1143
|
...deviceArguments
|
|
1105
1144
|
}
|
|
1106
1145
|
}
|
|
1107
|
-
${
|
|
1108
|
-
`),
|
|
1146
|
+
${el}
|
|
1147
|
+
`),e4=eJ((0,es.default)`
|
|
1109
1148
|
mutation ControllerClient_updateDevice(
|
|
1110
1149
|
$id: ID!
|
|
1111
1150
|
$name: String
|
|
@@ -1118,6 +1157,7 @@ ${((e,i)=>{switch(e){case"defined_properties":return Object.entries(i).map(([e,i
|
|
|
1118
1157
|
$preload: PreloadInput
|
|
1119
1158
|
$applicationUpdate: ApplicationUpdateInput
|
|
1120
1159
|
$lock: DeviceLockInput
|
|
1160
|
+
$advancedSetting: AdvancedSettingInput
|
|
1121
1161
|
$enableWebLanDiscovery: Boolean
|
|
1122
1162
|
$env: DeviceEnvInput
|
|
1123
1163
|
$accessControl: DeviceAccessControlInput
|
|
@@ -1135,16 +1175,19 @@ ${((e,i)=>{switch(e){case"defined_properties":return Object.entries(i).map(([e,i
|
|
|
1135
1175
|
preload: $preload
|
|
1136
1176
|
applicationUpdate: $applicationUpdate
|
|
1137
1177
|
lock: $lock
|
|
1178
|
+
advancedSetting: $advancedSetting
|
|
1138
1179
|
enableWebLanDiscovery: $enableWebLanDiscovery
|
|
1139
1180
|
env: $env
|
|
1140
1181
|
accessControl: $accessControl
|
|
1141
1182
|
forceNotifyDevice: $forceNotifyDevice
|
|
1142
1183
|
) {
|
|
1143
1184
|
...deviceArguments
|
|
1185
|
+
...deviceDetailArguments
|
|
1144
1186
|
}
|
|
1145
1187
|
}
|
|
1146
|
-
${
|
|
1147
|
-
|
|
1188
|
+
${el}
|
|
1189
|
+
${ep}
|
|
1190
|
+
`),e6=eJ((0,es.default)`
|
|
1148
1191
|
mutation ControllerClient_moveDevice(
|
|
1149
1192
|
$id: ID!
|
|
1150
1193
|
$workspaceId: ID!
|
|
@@ -1162,8 +1205,8 @@ ${((e,i)=>{switch(e){case"defined_properties":return Object.entries(i).map(([e,i
|
|
|
1162
1205
|
...deviceArguments
|
|
1163
1206
|
}
|
|
1164
1207
|
}
|
|
1165
|
-
${
|
|
1166
|
-
`),
|
|
1208
|
+
${el}
|
|
1209
|
+
`),e5=eJ((0,es.default)`
|
|
1167
1210
|
mutation ControllerClient_updateVirtualDevice(
|
|
1168
1211
|
$id: ID!
|
|
1169
1212
|
$tokens: [DeviceTokenInput]
|
|
@@ -1172,6 +1215,7 @@ ${((e,i)=>{switch(e){case"defined_properties":return Object.entries(i).map(([e,i
|
|
|
1172
1215
|
updateVirtualDevice(id: $id, tokens: $tokens, revokeTokens: $revokeTokens) {
|
|
1173
1216
|
device {
|
|
1174
1217
|
...deviceArguments
|
|
1218
|
+
...deviceDetailArguments
|
|
1175
1219
|
}
|
|
1176
1220
|
newTokens {
|
|
1177
1221
|
name
|
|
@@ -1179,19 +1223,20 @@ ${((e,i)=>{switch(e){case"defined_properties":return Object.entries(i).map(([e,i
|
|
|
1179
1223
|
}
|
|
1180
1224
|
}
|
|
1181
1225
|
}
|
|
1182
|
-
${
|
|
1183
|
-
|
|
1226
|
+
${el}
|
|
1227
|
+
${ep}
|
|
1228
|
+
`),e9=eJ((0,es.default)`
|
|
1184
1229
|
mutation ControllerClient_removeDevice($id: ID!) {
|
|
1185
1230
|
removeDevice(id: $id)
|
|
1186
1231
|
}
|
|
1187
|
-
`),
|
|
1232
|
+
`),e2=eJ((0,es.default)`
|
|
1188
1233
|
mutation ControllerClient_controlDevice($id: ID!, $type: String!, $eventPayload: JSON) {
|
|
1189
1234
|
controlDevice(id: $id, type: $type, eventPayload: $eventPayload) {
|
|
1190
1235
|
...deviceArguments
|
|
1191
1236
|
}
|
|
1192
1237
|
}
|
|
1193
|
-
${
|
|
1194
|
-
`),
|
|
1238
|
+
${el}
|
|
1239
|
+
`),e3=eJ((0,es.default)`
|
|
1195
1240
|
mutation ControllerClient_createDeviceGroup(
|
|
1196
1241
|
$workspaceId: ID!
|
|
1197
1242
|
$name: String!
|
|
@@ -1201,8 +1246,8 @@ ${((e,i)=>{switch(e){case"defined_properties":return Object.entries(i).map(([e,i
|
|
|
1201
1246
|
...deviceGroupArguments
|
|
1202
1247
|
}
|
|
1203
1248
|
}
|
|
1204
|
-
${
|
|
1205
|
-
`),
|
|
1249
|
+
${eu}
|
|
1250
|
+
`),e8=eJ((0,es.default)`
|
|
1206
1251
|
mutation ControllerClient_updateDeviceGroup(
|
|
1207
1252
|
$id: ID!
|
|
1208
1253
|
$name: String
|
|
@@ -1226,23 +1271,23 @@ ${((e,i)=>{switch(e){case"defined_properties":return Object.entries(i).map(([e,i
|
|
|
1226
1271
|
...deviceGroupArguments
|
|
1227
1272
|
}
|
|
1228
1273
|
}
|
|
1229
|
-
${
|
|
1230
|
-
`),
|
|
1274
|
+
${eu}
|
|
1275
|
+
`),e7=eJ((0,es.default)`
|
|
1231
1276
|
mutation ControllerClient_dispatchDeviceGroupAction($id: ID!, $action: String!) {
|
|
1232
1277
|
dispatchDeviceGroupAction(id: $id, action: $action) {
|
|
1233
1278
|
devices
|
|
1234
1279
|
dispatched
|
|
1235
1280
|
}
|
|
1236
1281
|
}
|
|
1237
|
-
`),
|
|
1282
|
+
`),ie=eJ((0,es.default)`
|
|
1238
1283
|
mutation ControllerClient_removeDeviceGroup($id: ID!) {
|
|
1239
1284
|
removeDeviceGroup(id: $id)
|
|
1240
1285
|
}
|
|
1241
|
-
`),
|
|
1286
|
+
`),ii=eJ((0,es.default)`
|
|
1242
1287
|
mutation ControllerClient_removeWorkspace($id: ID!) {
|
|
1243
1288
|
removeWorkspace(id: $id)
|
|
1244
1289
|
}
|
|
1245
|
-
`),
|
|
1290
|
+
`),it=eJ((0,es.default)`
|
|
1246
1291
|
mutation ControllerClient_createApplication(
|
|
1247
1292
|
$workspaceId: ID
|
|
1248
1293
|
$name: String
|
|
@@ -1262,8 +1307,8 @@ ${((e,i)=>{switch(e){case"defined_properties":return Object.entries(i).map(([e,i
|
|
|
1262
1307
|
...applicationArguments
|
|
1263
1308
|
}
|
|
1264
1309
|
}
|
|
1265
|
-
${
|
|
1266
|
-
`),
|
|
1310
|
+
${em}
|
|
1311
|
+
`),ia=eJ((0,es.default)`
|
|
1267
1312
|
mutation ControllerClient_createApplicationWithShareVersion(
|
|
1268
1313
|
$workspaceId: ID
|
|
1269
1314
|
$name: String
|
|
@@ -1279,14 +1324,15 @@ ${((e,i)=>{switch(e){case"defined_properties":return Object.entries(i).map(([e,i
|
|
|
1279
1324
|
...applicationArguments
|
|
1280
1325
|
}
|
|
1281
1326
|
}
|
|
1282
|
-
${
|
|
1283
|
-
`),
|
|
1327
|
+
${em}
|
|
1328
|
+
`),io=eJ((0,es.default)`
|
|
1284
1329
|
mutation ControllerClient_updateApplication(
|
|
1285
1330
|
$id: ID!
|
|
1286
1331
|
$name: String
|
|
1287
1332
|
$description: String
|
|
1288
1333
|
$tags: [String]
|
|
1289
1334
|
$config: String
|
|
1335
|
+
$validateConfig: Boolean
|
|
1290
1336
|
$runtimeEdit: RuntimeEditInput
|
|
1291
1337
|
$canvasControlEdit: CanvasControlEditInput
|
|
1292
1338
|
$deviceControlEdit: DeviceControlEditInput
|
|
@@ -1307,6 +1353,7 @@ ${((e,i)=>{switch(e){case"defined_properties":return Object.entries(i).map(([e,i
|
|
|
1307
1353
|
description: $description
|
|
1308
1354
|
tags: $tags
|
|
1309
1355
|
config: $config
|
|
1356
|
+
validateConfig: $validateConfig
|
|
1310
1357
|
runtimeEdit: $runtimeEdit
|
|
1311
1358
|
canvasControlEdit: $canvasControlEdit
|
|
1312
1359
|
deviceControlEdit: $deviceControlEdit
|
|
@@ -1324,8 +1371,8 @@ ${((e,i)=>{switch(e){case"defined_properties":return Object.entries(i).map(([e,i
|
|
|
1324
1371
|
...applicationArguments
|
|
1325
1372
|
}
|
|
1326
1373
|
}
|
|
1327
|
-
${
|
|
1328
|
-
`),
|
|
1374
|
+
${em}
|
|
1375
|
+
`),ir=eJ((0,es.default)`
|
|
1329
1376
|
mutation ControllerClient_bindApplication(
|
|
1330
1377
|
$id: ID!
|
|
1331
1378
|
$devices: [ID]
|
|
@@ -1347,12 +1394,12 @@ ${((e,i)=>{switch(e){case"defined_properties":return Object.entries(i).map(([e,i
|
|
|
1347
1394
|
...applicationArguments
|
|
1348
1395
|
}
|
|
1349
1396
|
}
|
|
1350
|
-
${
|
|
1351
|
-
`),
|
|
1397
|
+
${em}
|
|
1398
|
+
`),is=eJ((0,es.default)`
|
|
1352
1399
|
mutation ControllerClient_toggleShortEditApplication($id: ID!, $enabled: Boolean!) {
|
|
1353
1400
|
toggleShortEditApplication(id: $id, enabled: $enabled)
|
|
1354
1401
|
}
|
|
1355
|
-
`),
|
|
1402
|
+
`),id=eJ((0,es.default)`
|
|
1356
1403
|
mutation ControllerClient_updateApplicationViewportPreset(
|
|
1357
1404
|
$id: ID!
|
|
1358
1405
|
$newViewportPresets: [ApplicationViewportPresetInput]
|
|
@@ -1368,8 +1415,8 @@ ${((e,i)=>{switch(e){case"defined_properties":return Object.entries(i).map(([e,i
|
|
|
1368
1415
|
...applicationArguments
|
|
1369
1416
|
}
|
|
1370
1417
|
}
|
|
1371
|
-
${
|
|
1372
|
-
`),
|
|
1418
|
+
${em}
|
|
1419
|
+
`),ic=eJ((0,es.default)`
|
|
1373
1420
|
mutation ControllerClient_bindApplicationWithDeviceGroup(
|
|
1374
1421
|
$id: ID!
|
|
1375
1422
|
$bindDeviceGroup: ApplicationBindDeviceGroupInput
|
|
@@ -1385,8 +1432,8 @@ ${((e,i)=>{switch(e){case"defined_properties":return Object.entries(i).map(([e,i
|
|
|
1385
1432
|
...applicationArguments
|
|
1386
1433
|
}
|
|
1387
1434
|
}
|
|
1388
|
-
${
|
|
1389
|
-
`),
|
|
1435
|
+
${em}
|
|
1436
|
+
`),il=eJ((0,es.default)`
|
|
1390
1437
|
mutation ControllerClient_shareApplication(
|
|
1391
1438
|
$id: ID!
|
|
1392
1439
|
$shareSetting: ApplicationShareSettingInput
|
|
@@ -1406,15 +1453,15 @@ ${((e,i)=>{switch(e){case"defined_properties":return Object.entries(i).map(([e,i
|
|
|
1406
1453
|
...applicationArguments
|
|
1407
1454
|
}
|
|
1408
1455
|
}
|
|
1409
|
-
${
|
|
1410
|
-
`),
|
|
1456
|
+
${em}
|
|
1457
|
+
`),ip=eJ((0,es.default)`
|
|
1411
1458
|
mutation ControllerClient_moveApplication($id: ID!, $workspaceId: ID!) {
|
|
1412
1459
|
moveApplication(id: $id, workspaceId: $workspaceId) {
|
|
1413
1460
|
...applicationArguments
|
|
1414
1461
|
}
|
|
1415
1462
|
}
|
|
1416
|
-
${
|
|
1417
|
-
`),
|
|
1463
|
+
${em}
|
|
1464
|
+
`),iu=eJ((0,es.default)`
|
|
1418
1465
|
mutation ControllerClient_createDeviceGroupWithApp(
|
|
1419
1466
|
$applicationId: ID!
|
|
1420
1467
|
$name: String!
|
|
@@ -1439,15 +1486,15 @@ ${((e,i)=>{switch(e){case"defined_properties":return Object.entries(i).map(([e,i
|
|
|
1439
1486
|
}
|
|
1440
1487
|
}
|
|
1441
1488
|
}
|
|
1442
|
-
${
|
|
1443
|
-
`),
|
|
1489
|
+
${em}
|
|
1490
|
+
`),im=eJ((0,es.default)`
|
|
1444
1491
|
mutation ControllerClient_forkApplication($id: ID!) {
|
|
1445
1492
|
forkApplication(id: $id) {
|
|
1446
1493
|
...applicationArguments
|
|
1447
1494
|
}
|
|
1448
1495
|
}
|
|
1449
|
-
${
|
|
1450
|
-
`),
|
|
1496
|
+
${em}
|
|
1497
|
+
`),i_=eJ((0,es.default)`
|
|
1451
1498
|
mutation ControllerClient_duplicateApplication(
|
|
1452
1499
|
$id: ID!
|
|
1453
1500
|
$includeVersions: Boolean
|
|
@@ -1461,12 +1508,12 @@ ${((e,i)=>{switch(e){case"defined_properties":return Object.entries(i).map(([e,i
|
|
|
1461
1508
|
...applicationArguments
|
|
1462
1509
|
}
|
|
1463
1510
|
}
|
|
1464
|
-
${
|
|
1465
|
-
`),
|
|
1511
|
+
${em}
|
|
1512
|
+
`),ig=eJ((0,es.default)`
|
|
1466
1513
|
mutation ControllerClient_removeApplication($id: ID!) {
|
|
1467
1514
|
removeApplication(id: $id)
|
|
1468
1515
|
}
|
|
1469
|
-
`),
|
|
1516
|
+
`),iy=eJ((0,es.default)`
|
|
1470
1517
|
mutation ControllerClient_createModule(
|
|
1471
1518
|
$workspaceId: ID
|
|
1472
1519
|
$name: String
|
|
@@ -1492,8 +1539,8 @@ ${((e,i)=>{switch(e){case"defined_properties":return Object.entries(i).map(([e,i
|
|
|
1492
1539
|
...moduleArguments
|
|
1493
1540
|
}
|
|
1494
1541
|
}
|
|
1495
|
-
${
|
|
1496
|
-
`),
|
|
1542
|
+
${eg}
|
|
1543
|
+
`),i$=eJ((0,es.default)`
|
|
1497
1544
|
mutation ControllerClient_updateModule(
|
|
1498
1545
|
$id: ID!
|
|
1499
1546
|
$name: String
|
|
@@ -1503,6 +1550,7 @@ ${((e,i)=>{switch(e){case"defined_properties":return Object.entries(i).map(([e,i
|
|
|
1503
1550
|
$isAllowModify: Boolean
|
|
1504
1551
|
$isPublic: Boolean
|
|
1505
1552
|
$config: String
|
|
1553
|
+
$validateConfig: Boolean
|
|
1506
1554
|
$useReleaseVersion: ID
|
|
1507
1555
|
$releaseCurrentVersion: String
|
|
1508
1556
|
$releaseCurrentVersionNote: String
|
|
@@ -1516,6 +1564,7 @@ ${((e,i)=>{switch(e){case"defined_properties":return Object.entries(i).map(([e,i
|
|
|
1516
1564
|
isAllowModify: $isAllowModify
|
|
1517
1565
|
isPublic: $isPublic
|
|
1518
1566
|
config: $config
|
|
1567
|
+
validateConfig: $validateConfig
|
|
1519
1568
|
useReleaseVersion: $useReleaseVersion
|
|
1520
1569
|
releaseCurrentVersion: $releaseCurrentVersion
|
|
1521
1570
|
releaseCurrentVersionNote: $releaseCurrentVersionNote
|
|
@@ -1523,26 +1572,26 @@ ${((e,i)=>{switch(e){case"defined_properties":return Object.entries(i).map(([e,i
|
|
|
1523
1572
|
...moduleArguments
|
|
1524
1573
|
}
|
|
1525
1574
|
}
|
|
1526
|
-
${
|
|
1527
|
-
`),
|
|
1575
|
+
${eg}
|
|
1576
|
+
`),iv=eJ((0,es.default)`
|
|
1528
1577
|
mutation ControllerClient_moveModule($id: ID!, $workspaceId: ID!) {
|
|
1529
1578
|
moveModule(id: $id, workspaceId: $workspaceId) {
|
|
1530
1579
|
...moduleArguments
|
|
1531
1580
|
}
|
|
1532
1581
|
}
|
|
1533
|
-
${
|
|
1534
|
-
`),
|
|
1582
|
+
${eg}
|
|
1583
|
+
`),ih=eJ((0,es.default)`
|
|
1535
1584
|
mutation ControllerClient_duplicateModule($id: ID!) {
|
|
1536
1585
|
duplicateModule(id: $id) {
|
|
1537
1586
|
...moduleArguments
|
|
1538
1587
|
}
|
|
1539
1588
|
}
|
|
1540
|
-
${
|
|
1541
|
-
`),
|
|
1589
|
+
${eg}
|
|
1590
|
+
`),ib=eJ((0,es.default)`
|
|
1542
1591
|
mutation ControllerClient_removeModule($id: ID!) {
|
|
1543
1592
|
removeModule(id: $id)
|
|
1544
1593
|
}
|
|
1545
|
-
`),
|
|
1594
|
+
`),iI=eJ((0,es.default)`
|
|
1546
1595
|
mutation ControllerClient_createConfigChangeOperation(
|
|
1547
1596
|
$applicationId: ID!
|
|
1548
1597
|
$config: JSON!
|
|
@@ -1552,12 +1601,12 @@ ${((e,i)=>{switch(e){case"defined_properties":return Object.entries(i).map(([e,i
|
|
|
1552
1601
|
...operationArguments
|
|
1553
1602
|
}
|
|
1554
1603
|
}
|
|
1555
|
-
${
|
|
1556
|
-
`),
|
|
1604
|
+
${e$}
|
|
1605
|
+
`),ik=eJ((0,es.default)`
|
|
1557
1606
|
mutation ControllerClient_doOperation($id: ID!, $applicationId: ID!) {
|
|
1558
1607
|
doOperation(id: $id, applicationId: $applicationId)
|
|
1559
1608
|
}
|
|
1560
|
-
`),
|
|
1609
|
+
`),iD=eJ((0,es.default)`
|
|
1561
1610
|
mutation ControllerClient_updateOperation(
|
|
1562
1611
|
$id: ID!
|
|
1563
1612
|
$applicationId: ID!
|
|
@@ -1568,12 +1617,12 @@ ${((e,i)=>{switch(e){case"defined_properties":return Object.entries(i).map(([e,i
|
|
|
1568
1617
|
...operationArguments
|
|
1569
1618
|
}
|
|
1570
1619
|
}
|
|
1571
|
-
${
|
|
1572
|
-
`),
|
|
1620
|
+
${e$}
|
|
1621
|
+
`),iA=eJ((0,es.default)`
|
|
1573
1622
|
mutation ControllerClient_removeOperation($id: ID!, $applicationId: ID!) {
|
|
1574
1623
|
removeOperation(id: $id, applicationId: $applicationId)
|
|
1575
1624
|
}
|
|
1576
|
-
`),
|
|
1625
|
+
`),iS=eJ((0,es.default)`
|
|
1577
1626
|
mutation ControllerClient_assignGroupPermissions(
|
|
1578
1627
|
$roleId: String!
|
|
1579
1628
|
$instanceType: String!
|
|
@@ -1587,18 +1636,18 @@ ${((e,i)=>{switch(e){case"defined_properties":return Object.entries(i).map(([e,i
|
|
|
1587
1636
|
permissions: $permissions
|
|
1588
1637
|
)
|
|
1589
1638
|
}
|
|
1590
|
-
`),
|
|
1639
|
+
`),iw=(0,es.default)`
|
|
1591
1640
|
mutation ControllerClient_registerFCMNotification($workspaceId: ID!, $token: String!) {
|
|
1592
1641
|
registerFCMNotification(workspaceId: $workspaceId, token: $token)
|
|
1593
1642
|
}
|
|
1594
|
-
`,
|
|
1643
|
+
`,iC=(0,es.default)`
|
|
1595
1644
|
mutation ControllerClient_registerRemoteDebug($deviceId: ID!) {
|
|
1596
1645
|
registerRemoteDebug(deviceId: $deviceId) {
|
|
1597
1646
|
deviceId
|
|
1598
1647
|
token
|
|
1599
1648
|
}
|
|
1600
1649
|
}
|
|
1601
|
-
`,
|
|
1650
|
+
`,iT=(0,es.default)`
|
|
1602
1651
|
mutation ControllerClient_shareAccessToken(
|
|
1603
1652
|
$workspaceId: ID
|
|
1604
1653
|
$passcode: String!
|
|
@@ -1606,7 +1655,7 @@ ${((e,i)=>{switch(e){case"defined_properties":return Object.entries(i).map(([e,i
|
|
|
1606
1655
|
) {
|
|
1607
1656
|
shareAccessToken(workspaceId: $workspaceId, passcode: $passcode, refreshToken: $refreshToken)
|
|
1608
1657
|
}
|
|
1609
|
-
`,
|
|
1658
|
+
`,ix=eJ((0,es.default)`
|
|
1610
1659
|
mutation ControllerClient_addUserFavorite($instanceType: InstanceType!, $instanceId: ID!) {
|
|
1611
1660
|
addUserFavorite(instanceType: $instanceType, instanceId: $instanceId) {
|
|
1612
1661
|
_id
|
|
@@ -1619,11 +1668,11 @@ ${((e,i)=>{switch(e){case"defined_properties":return Object.entries(i).map(([e,i
|
|
|
1619
1668
|
last_modify_datetime
|
|
1620
1669
|
}
|
|
1621
1670
|
}
|
|
1622
|
-
`),
|
|
1671
|
+
`),iE=eJ((0,es.default)`
|
|
1623
1672
|
mutation ControllerClient_removeUserFavorite($instanceType: InstanceType!, $instanceId: ID!) {
|
|
1624
1673
|
removeUserFavorite(instanceType: $instanceType, instanceId: $instanceId)
|
|
1625
1674
|
}
|
|
1626
|
-
`),
|
|
1675
|
+
`),iB=eJ((0,es.default)`
|
|
1627
1676
|
mutation ControllerClient_changeWorkspaceSubscriptionPlan(
|
|
1628
1677
|
$workspaceId: ID!
|
|
1629
1678
|
$type: String!
|
|
@@ -1631,7 +1680,7 @@ ${((e,i)=>{switch(e){case"defined_properties":return Object.entries(i).map(([e,i
|
|
|
1631
1680
|
) {
|
|
1632
1681
|
changeWorkspaceSubscriptionPlan(workspaceId: $workspaceId, type: $type, period: $period)
|
|
1633
1682
|
}
|
|
1634
|
-
`),
|
|
1683
|
+
`),iU=eJ((0,es.default)`
|
|
1635
1684
|
mutation ControllerClient_changeWorkspaceAdditionalLimitSpending(
|
|
1636
1685
|
$workspaceId: ID!
|
|
1637
1686
|
$boundDevicesLimit: Float
|
|
@@ -1643,7 +1692,7 @@ ${((e,i)=>{switch(e){case"defined_properties":return Object.entries(i).map(([e,i
|
|
|
1643
1692
|
groupMembersLimit: $groupMembersLimit
|
|
1644
1693
|
)
|
|
1645
1694
|
}
|
|
1646
|
-
`),
|
|
1695
|
+
`),iR=(0,es.default)`
|
|
1647
1696
|
mutation ControllerClient_createWorkspaceOTP(
|
|
1648
1697
|
$workspaceId: ID!
|
|
1649
1698
|
$tokenTypes: [WorkspaceTokenType]!
|
|
@@ -1655,32 +1704,32 @@ ${((e,i)=>{switch(e){case"defined_properties":return Object.entries(i).map(([e,i
|
|
|
1655
1704
|
expired_datetime
|
|
1656
1705
|
}
|
|
1657
1706
|
}
|
|
1658
|
-
`,
|
|
1707
|
+
`,iM=(0,es.default)`
|
|
1659
1708
|
mutation ControllerClient_revokeWorkspaceOTP($id: ID!) {
|
|
1660
1709
|
revokeWorkspaceOTP(id: $id)
|
|
1661
1710
|
}
|
|
1662
|
-
`;function
|
|
1711
|
+
`;function iO(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(e){}return(iO=function(){return!!e})()}var iP=function(e){function i(e,t){var n,a,o;return Z(this,i),a=i,o=[e,t,"/api/graphql",u,m],a=ei(a),(n=ee(this,iO()?Reflect.construct(a,o||[],ei(this).constructor):a.apply(this,o))).tokenType="user",n}return et(i,e),Q(i)}(eC),iF=t(90424),iN=(0,es.default)`
|
|
1663
1712
|
query Workspace_workspace {
|
|
1664
1713
|
workspace {
|
|
1665
1714
|
...mcpWorkspaceArguments
|
|
1666
1715
|
}
|
|
1667
1716
|
}
|
|
1668
|
-
${
|
|
1669
|
-
`,
|
|
1717
|
+
${eh}
|
|
1718
|
+
`,iq=(0,es.default)`
|
|
1670
1719
|
query Workspace_applications($keyword: String, $paginate: Paginate) {
|
|
1671
1720
|
applications(keyword: $keyword, paginate: $paginate) {
|
|
1672
1721
|
...mcpApplicationShortArguments
|
|
1673
1722
|
}
|
|
1674
1723
|
}
|
|
1675
|
-
${
|
|
1676
|
-
`,
|
|
1724
|
+
${eI}
|
|
1725
|
+
`,ij=(0,es.default)`
|
|
1677
1726
|
query Workspace_application($id: ID!, $composed: Boolean, $debug: Boolean) {
|
|
1678
1727
|
application(id: $id, composed: $composed, debug: $debug) {
|
|
1679
1728
|
...applicationArguments
|
|
1680
1729
|
}
|
|
1681
1730
|
}
|
|
1682
|
-
${
|
|
1683
|
-
`,
|
|
1731
|
+
${em}
|
|
1732
|
+
`,iW=(0,es.default)`
|
|
1684
1733
|
query Workspace_applicationByDevice(
|
|
1685
1734
|
$deviceId: ID!
|
|
1686
1735
|
$composeModule: Boolean
|
|
@@ -1696,43 +1745,43 @@ ${((e,i)=>{switch(e){case"defined_properties":return Object.entries(i).map(([e,i
|
|
|
1696
1745
|
...applicationArguments
|
|
1697
1746
|
}
|
|
1698
1747
|
}
|
|
1699
|
-
${
|
|
1700
|
-
`,
|
|
1748
|
+
${em}
|
|
1749
|
+
`,iV=(0,es.default)`
|
|
1701
1750
|
query Workspace_modules($keyword: String, $paginate: Paginate) {
|
|
1702
1751
|
modules(keyword: $keyword, paginate: $paginate) {
|
|
1703
1752
|
...moduleShortArguments
|
|
1704
1753
|
}
|
|
1705
1754
|
}
|
|
1706
|
-
${
|
|
1707
|
-
`,
|
|
1755
|
+
${ef}
|
|
1756
|
+
`,iY=(0,es.default)`
|
|
1708
1757
|
query Workspace_module($id: ID!) {
|
|
1709
1758
|
module(id: $id) {
|
|
1710
1759
|
...moduleArguments
|
|
1711
1760
|
}
|
|
1712
1761
|
}
|
|
1713
|
-
${
|
|
1714
|
-
`,
|
|
1762
|
+
${eg}
|
|
1763
|
+
`,iK=(0,es.default)`
|
|
1715
1764
|
query Workspace_devices($keyword: String, $paginate: Paginate) {
|
|
1716
1765
|
devices(keyword: $keyword, paginate: $paginate) {
|
|
1717
1766
|
...deviceArguments
|
|
1718
1767
|
}
|
|
1719
1768
|
}
|
|
1720
|
-
${
|
|
1721
|
-
`,
|
|
1769
|
+
${el}
|
|
1770
|
+
`,iG=(0,es.default)`
|
|
1722
1771
|
query Workspace_device($id: ID) {
|
|
1723
1772
|
device(id: $id) {
|
|
1724
1773
|
...deviceArguments
|
|
1725
1774
|
}
|
|
1726
1775
|
}
|
|
1727
|
-
${
|
|
1728
|
-
`,
|
|
1776
|
+
${el}
|
|
1777
|
+
`,iL=(0,es.default)`
|
|
1729
1778
|
query Workspace_devicesByApplication($id: ID!) {
|
|
1730
1779
|
devicesByApplication(id: $id) {
|
|
1731
1780
|
...deviceArguments
|
|
1732
1781
|
}
|
|
1733
1782
|
}
|
|
1734
|
-
${
|
|
1735
|
-
`,
|
|
1783
|
+
${el}
|
|
1784
|
+
`,iz=(0,es.default)`
|
|
1736
1785
|
query Workspace_deviceUsage($deviceId: ID, $startDate: Date, $endDate: Date) {
|
|
1737
1786
|
deviceUsage(deviceId: $deviceId, startDate: $startDate, endDate: $endDate) {
|
|
1738
1787
|
_id
|
|
@@ -1751,28 +1800,28 @@ ${((e,i)=>{switch(e){case"defined_properties":return Object.entries(i).map(([e,i
|
|
|
1751
1800
|
}
|
|
1752
1801
|
}
|
|
1753
1802
|
}
|
|
1754
|
-
`,
|
|
1803
|
+
`,iH=(0,es.default)`
|
|
1755
1804
|
query Workspace_mediaWorkspace {
|
|
1756
1805
|
mediaWorkspace {
|
|
1757
1806
|
...workspaceMediaWorkspaceArguments
|
|
1758
1807
|
}
|
|
1759
1808
|
}
|
|
1760
|
-
${
|
|
1761
|
-
`,
|
|
1809
|
+
${eD}
|
|
1810
|
+
`,iJ=(0,es.default)`
|
|
1762
1811
|
query Workspace_mediaBoxes {
|
|
1763
1812
|
mediaBoxes {
|
|
1764
1813
|
...workspaceMediaBoxArguments
|
|
1765
1814
|
}
|
|
1766
1815
|
}
|
|
1767
|
-
${
|
|
1768
|
-
`,
|
|
1816
|
+
${eA}
|
|
1817
|
+
`,iX=(0,es.default)`
|
|
1769
1818
|
query Workspace_mediaBox($boxId: ID!) {
|
|
1770
1819
|
mediaBox(id: $boxId) {
|
|
1771
1820
|
...workspaceMediaBoxArguments
|
|
1772
1821
|
}
|
|
1773
1822
|
}
|
|
1774
|
-
${
|
|
1775
|
-
`,
|
|
1823
|
+
${eA}
|
|
1824
|
+
`,iQ=(0,es.default)`
|
|
1776
1825
|
query Workspace_mediaFiles(
|
|
1777
1826
|
$boxId: ID!
|
|
1778
1827
|
$includeTypes: [String]
|
|
@@ -1790,15 +1839,15 @@ ${((e,i)=>{switch(e){case"defined_properties":return Object.entries(i).map(([e,i
|
|
|
1790
1839
|
...workspaceMediaFileArguments
|
|
1791
1840
|
}
|
|
1792
1841
|
}
|
|
1793
|
-
${
|
|
1794
|
-
`,
|
|
1842
|
+
${eS}
|
|
1843
|
+
`,iZ=(0,es.default)`
|
|
1795
1844
|
query Workspace_mediaFile($id: ID!) {
|
|
1796
1845
|
mediaFile(id: $id) {
|
|
1797
1846
|
...workspaceMediaFileArguments
|
|
1798
1847
|
}
|
|
1799
1848
|
}
|
|
1800
|
-
${
|
|
1801
|
-
`,
|
|
1849
|
+
${eS}
|
|
1850
|
+
`,i0=(0,es.default)`
|
|
1802
1851
|
mutation Workspace_createApplication(
|
|
1803
1852
|
$name: String
|
|
1804
1853
|
$description: String
|
|
@@ -1815,8 +1864,8 @@ ${((e,i)=>{switch(e){case"defined_properties":return Object.entries(i).map(([e,i
|
|
|
1815
1864
|
config
|
|
1816
1865
|
}
|
|
1817
1866
|
}
|
|
1818
|
-
${
|
|
1819
|
-
`,
|
|
1867
|
+
${eI}
|
|
1868
|
+
`,i1=(0,es.default)`
|
|
1820
1869
|
mutation Workspace_updateApplication(
|
|
1821
1870
|
$id: ID!
|
|
1822
1871
|
$config: String
|
|
@@ -1836,10 +1885,20 @@ ${((e,i)=>{switch(e){case"defined_properties":return Object.entries(i).map(([e,i
|
|
|
1836
1885
|
has_unreleased_changes
|
|
1837
1886
|
}
|
|
1838
1887
|
}
|
|
1839
|
-
${
|
|
1840
|
-
`,
|
|
1841
|
-
mutation Workspace_bindApplication(
|
|
1842
|
-
|
|
1888
|
+
${eI}
|
|
1889
|
+
`,i4=(0,es.default)`
|
|
1890
|
+
mutation Workspace_bindApplication(
|
|
1891
|
+
$id: ID!
|
|
1892
|
+
$bindDevices: [ID]
|
|
1893
|
+
$unbindDevices: [ID]
|
|
1894
|
+
$deviceFrames: JSON
|
|
1895
|
+
) {
|
|
1896
|
+
bindApplication(
|
|
1897
|
+
id: $id
|
|
1898
|
+
bindDevices: $bindDevices
|
|
1899
|
+
unbindDevices: $unbindDevices
|
|
1900
|
+
deviceFrames: $deviceFrames
|
|
1901
|
+
) {
|
|
1843
1902
|
_id
|
|
1844
1903
|
devices {
|
|
1845
1904
|
device_id
|
|
@@ -1848,7 +1907,7 @@ ${((e,i)=>{switch(e){case"defined_properties":return Object.entries(i).map(([e,i
|
|
|
1848
1907
|
}
|
|
1849
1908
|
}
|
|
1850
1909
|
}
|
|
1851
|
-
`,
|
|
1910
|
+
`,i6=(0,es.default)`
|
|
1852
1911
|
mutation Workspace_unbindApplication($id: ID!, $unbindDevices: [ID]) {
|
|
1853
1912
|
bindApplication(id: $id, unbindDevices: $unbindDevices) {
|
|
1854
1913
|
_id
|
|
@@ -1859,7 +1918,7 @@ ${((e,i)=>{switch(e){case"defined_properties":return Object.entries(i).map(([e,i
|
|
|
1859
1918
|
}
|
|
1860
1919
|
}
|
|
1861
1920
|
}
|
|
1862
|
-
`,
|
|
1921
|
+
`,i5=(0,es.default)`
|
|
1863
1922
|
mutation Workspace_createModule(
|
|
1864
1923
|
$name: String
|
|
1865
1924
|
$description: String
|
|
@@ -1881,8 +1940,8 @@ ${((e,i)=>{switch(e){case"defined_properties":return Object.entries(i).map(([e,i
|
|
|
1881
1940
|
...moduleArguments
|
|
1882
1941
|
}
|
|
1883
1942
|
}
|
|
1884
|
-
${
|
|
1885
|
-
`,
|
|
1943
|
+
${eg}
|
|
1944
|
+
`,i9=(0,es.default)`
|
|
1886
1945
|
mutation Workspace_updateModule(
|
|
1887
1946
|
$id: ID!
|
|
1888
1947
|
$config: String
|
|
@@ -1900,8 +1959,8 @@ ${((e,i)=>{switch(e){case"defined_properties":return Object.entries(i).map(([e,i
|
|
|
1900
1959
|
...moduleArguments
|
|
1901
1960
|
}
|
|
1902
1961
|
}
|
|
1903
|
-
${
|
|
1904
|
-
`,
|
|
1962
|
+
${eg}
|
|
1963
|
+
`,i2=(0,es.default)`
|
|
1905
1964
|
mutation Workspace_createMediaFileUploadRequest(
|
|
1906
1965
|
$name: String!
|
|
1907
1966
|
$description: String!
|
|
@@ -1932,7 +1991,7 @@ ${((e,i)=>{switch(e){case"defined_properties":return Object.entries(i).map(([e,i
|
|
|
1932
1991
|
}
|
|
1933
1992
|
}
|
|
1934
1993
|
}
|
|
1935
|
-
`,
|
|
1994
|
+
`,i3=(0,es.default)`
|
|
1936
1995
|
mutation Workspace_updateMediaFile(
|
|
1937
1996
|
$id: ID!
|
|
1938
1997
|
$name: String
|
|
@@ -1954,7 +2013,7 @@ ${((e,i)=>{switch(e){case"defined_properties":return Object.entries(i).map(([e,i
|
|
|
1954
2013
|
updatedAt
|
|
1955
2014
|
}
|
|
1956
2015
|
}
|
|
1957
|
-
`,
|
|
2016
|
+
`,i8=(0,es.default)`
|
|
1958
2017
|
mutation Workspace_updateMediaFiles(
|
|
1959
2018
|
$fileIds: [ID!]!
|
|
1960
2019
|
$name: String
|
|
@@ -1963,23 +2022,23 @@ ${((e,i)=>{switch(e){case"defined_properties":return Object.entries(i).map(([e,i
|
|
|
1963
2022
|
) {
|
|
1964
2023
|
updateMediaFiles(fileIds: $fileIds, name: $name, description: $description, userTags: $userTags)
|
|
1965
2024
|
}
|
|
1966
|
-
`,
|
|
2025
|
+
`,i7=(0,es.default)`
|
|
1967
2026
|
mutation Workspace_setMediaFileAsBoxPreview($id: ID!) {
|
|
1968
2027
|
setMediaFileAsBoxPreview(id: $id)
|
|
1969
2028
|
}
|
|
1970
|
-
`,
|
|
2029
|
+
`,te=(0,es.default)`
|
|
1971
2030
|
mutation Workspace_copyMediaFiles($fromBoxId: ID!, $toBoxId: ID!, $fileIds: [ID!]!) {
|
|
1972
2031
|
copyMediaFiles(fromBoxId: $fromBoxId, toBoxId: $toBoxId, fileIds: $fileIds)
|
|
1973
2032
|
}
|
|
1974
|
-
`,
|
|
2033
|
+
`,ti=(0,es.default)`
|
|
1975
2034
|
mutation Workspace_deleteMediaFiles($boxId: ID!, $fileIds: [ID!]!) {
|
|
1976
2035
|
deleteMediaFiles(boxId: $boxId, fileIds: $fileIds)
|
|
1977
2036
|
}
|
|
1978
|
-
`,
|
|
2037
|
+
`,tt=(0,es.default)`
|
|
1979
2038
|
mutation Workspace_deleteMediaBoxFiles($boxId: ID!, $includeTypes: [String]) {
|
|
1980
2039
|
deleteMediaBoxFiles(boxId: $boxId, includeTypes: $includeTypes)
|
|
1981
2040
|
}
|
|
1982
|
-
`;function
|
|
2041
|
+
`;function tn(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(e){}return(tn=function(){return!!e})()}var ta=["_id","name"],to=e=>Object.fromEntries(Object.entries(e).map(([e,i])=>[e,(0,iF.YR)(i,{Field(e){if("used_workspace"===e.name.value)return{...e,selectionSet:{...e.selectionSet,selections:e.selectionSet.selections.filter(e=>ta.includes(e.name?.value))}}}})])),tr=to(_),ts=to(g),td=function(e){function i(e,t){var n,a,o;return Z(this,i),a=i,o=[e,t,"/api/graphql-workspace",tr,ts],a=ei(a),(n=ee(this,tn()?Reflect.construct(a,o||[],ei(this).constructor):a.apply(this,o))).tokenType="workspace",n}return et(i,e),Q(i)}(eC);let tc={query:"query",mutation:"mutate"},tl=(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[tc[i]](c);({data:s,errors:d}=t||{})}if(d)throw Error(d.map(e=>e.message).join("\n"));return s?s[n]:null}},tp=[429],tu=[403];var tm=t(19074),t_=t(36054),tg=t(78342),tf=t(74114),ty=t(42028),t$=t(99815),tv=t(79556),th=t(17681),tb=t.n(th),tI=t(10655);let tk=[403,429],tD=(0,es.default)`
|
|
1983
2042
|
fragment mediaWorkspaceArguments on MediaWorkspace {
|
|
1984
2043
|
__typename
|
|
1985
2044
|
id
|
|
@@ -1993,7 +2052,7 @@ ${((e,i)=>{switch(e){case"defined_properties":return Object.entries(i).map(([e,i
|
|
|
1993
2052
|
sizeLimit
|
|
1994
2053
|
aiFeaturesEnabled
|
|
1995
2054
|
}
|
|
1996
|
-
`,
|
|
2055
|
+
`,tA=(0,es.default)`
|
|
1997
2056
|
fragment boxArguments on MediaBox {
|
|
1998
2057
|
__typename
|
|
1999
2058
|
id
|
|
@@ -2018,7 +2077,7 @@ ${((e,i)=>{switch(e){case"defined_properties":return Object.entries(i).map(([e,i
|
|
|
2018
2077
|
previewUrl
|
|
2019
2078
|
size
|
|
2020
2079
|
}
|
|
2021
|
-
`,
|
|
2080
|
+
`,tS=(0,es.default)`
|
|
2022
2081
|
fragment fileArguments on MediaFile {
|
|
2023
2082
|
__typename
|
|
2024
2083
|
id
|
|
@@ -2075,7 +2134,7 @@ ${((e,i)=>{switch(e){case"defined_properties":return Object.entries(i).map(([e,i
|
|
|
2075
2134
|
createdAt
|
|
2076
2135
|
updatedAt
|
|
2077
2136
|
}
|
|
2078
|
-
`,
|
|
2137
|
+
`,tw=(0,es.default)`
|
|
2079
2138
|
fragment fileShortArguments on MediaFile {
|
|
2080
2139
|
__typename
|
|
2081
2140
|
id
|
|
@@ -2123,35 +2182,35 @@ ${((e,i)=>{switch(e){case"defined_properties":return Object.entries(i).map(([e,i
|
|
|
2123
2182
|
createdAt
|
|
2124
2183
|
updatedAt
|
|
2125
2184
|
}
|
|
2126
|
-
`,
|
|
2185
|
+
`,tC=(0,es.default)`
|
|
2127
2186
|
query MediaClient_workspaces {
|
|
2128
2187
|
mediaWorkspaces {
|
|
2129
2188
|
...mediaWorkspaceArguments
|
|
2130
2189
|
}
|
|
2131
2190
|
}
|
|
2132
|
-
${
|
|
2133
|
-
`,
|
|
2191
|
+
${tD}
|
|
2192
|
+
`,tT=(0,es.default)`
|
|
2134
2193
|
query MediaClient_boxes($workspaceId: UUID, $filter: String) {
|
|
2135
2194
|
mediaBoxes(workspaceId: $workspaceId, filter: $filter) {
|
|
2136
2195
|
...boxArguments
|
|
2137
2196
|
}
|
|
2138
2197
|
}
|
|
2139
|
-
${
|
|
2140
|
-
`,
|
|
2198
|
+
${tA}
|
|
2199
|
+
`,tx=(0,es.default)`
|
|
2141
2200
|
query MediaClient_workspace($workspaceId: UUID!) {
|
|
2142
2201
|
mediaWorkspace(id: $workspaceId) {
|
|
2143
2202
|
...mediaWorkspaceArguments
|
|
2144
2203
|
}
|
|
2145
2204
|
}
|
|
2146
|
-
${
|
|
2147
|
-
`,
|
|
2205
|
+
${tD}
|
|
2206
|
+
`,tE=(0,es.default)`
|
|
2148
2207
|
query MediaClient_box($boxId: UUID!) {
|
|
2149
2208
|
mediaBox(boxId: $boxId) {
|
|
2150
2209
|
...boxArguments
|
|
2151
2210
|
}
|
|
2152
2211
|
}
|
|
2153
|
-
${
|
|
2154
|
-
`,
|
|
2212
|
+
${tA}
|
|
2213
|
+
`,tB=(0,es.default)`
|
|
2155
2214
|
query MediaClient_files(
|
|
2156
2215
|
$boxId: UUID!
|
|
2157
2216
|
$includeTypes: [FileType!]
|
|
@@ -2169,29 +2228,29 @@ ${((e,i)=>{switch(e){case"defined_properties":return Object.entries(i).map(([e,i
|
|
|
2169
2228
|
...fileShortArguments
|
|
2170
2229
|
}
|
|
2171
2230
|
}
|
|
2172
|
-
${
|
|
2173
|
-
`,
|
|
2231
|
+
${tw}
|
|
2232
|
+
`,tU=(0,es.default)`
|
|
2174
2233
|
query MediaClient_file($fileId: UUID!) {
|
|
2175
2234
|
mediaFile(fileId: $fileId) {
|
|
2176
2235
|
...fileArguments
|
|
2177
2236
|
}
|
|
2178
2237
|
}
|
|
2179
|
-
${
|
|
2180
|
-
`,
|
|
2238
|
+
${tS}
|
|
2239
|
+
`,tR=(0,es.default)`
|
|
2181
2240
|
mutation MediaClient_createMediaWorkspace($name: String!, $description: String!) {
|
|
2182
2241
|
createMediaWorkspace(name: $name, description: $description) {
|
|
2183
2242
|
...mediaWorkspaceArguments
|
|
2184
2243
|
}
|
|
2185
2244
|
}
|
|
2186
|
-
${
|
|
2187
|
-
`,
|
|
2245
|
+
${tD}
|
|
2246
|
+
`,tM=(0,es.default)`
|
|
2188
2247
|
mutation MediaClient_updateMediaWorkspace($id: UUID!, $name: String, $description: String) {
|
|
2189
2248
|
updateMediaWorkspace(id: $id, name: $name, description: $description) {
|
|
2190
2249
|
...mediaWorkspaceArguments
|
|
2191
2250
|
}
|
|
2192
2251
|
}
|
|
2193
|
-
${
|
|
2194
|
-
`,
|
|
2252
|
+
${tD}
|
|
2253
|
+
`,tO=(0,es.default)`
|
|
2195
2254
|
mutation MediaClient_createMediaBox(
|
|
2196
2255
|
$name: String!
|
|
2197
2256
|
$description: String!
|
|
@@ -2209,15 +2268,15 @@ ${((e,i)=>{switch(e){case"defined_properties":return Object.entries(i).map(([e,i
|
|
|
2209
2268
|
...boxArguments
|
|
2210
2269
|
}
|
|
2211
2270
|
}
|
|
2212
|
-
${
|
|
2213
|
-
`,
|
|
2271
|
+
${tA}
|
|
2272
|
+
`,tP=(0,es.default)`
|
|
2214
2273
|
mutation MediaClient_moveMediaBox($id: UUID!, $workspaceId: UUID) {
|
|
2215
2274
|
moveMediaBox(id: $id, workspaceId: $workspaceId) {
|
|
2216
2275
|
...boxArguments
|
|
2217
2276
|
}
|
|
2218
2277
|
}
|
|
2219
|
-
${
|
|
2220
|
-
`,
|
|
2278
|
+
${tA}
|
|
2279
|
+
`,tF=(0,es.default)`
|
|
2221
2280
|
mutation MediaClient_updateMediaBox(
|
|
2222
2281
|
$id: UUID!
|
|
2223
2282
|
$name: String
|
|
@@ -2237,8 +2296,8 @@ ${((e,i)=>{switch(e){case"defined_properties":return Object.entries(i).map(([e,i
|
|
|
2237
2296
|
...boxArguments
|
|
2238
2297
|
}
|
|
2239
2298
|
}
|
|
2240
|
-
${
|
|
2241
|
-
`,
|
|
2299
|
+
${tA}
|
|
2300
|
+
`,tN=(0,es.default)`
|
|
2242
2301
|
mutation MediaClient_requestFileUpload(
|
|
2243
2302
|
$name: String!
|
|
2244
2303
|
$description: String!
|
|
@@ -2260,8 +2319,8 @@ ${((e,i)=>{switch(e){case"defined_properties":return Object.entries(i).map(([e,i
|
|
|
2260
2319
|
...fileArguments
|
|
2261
2320
|
}
|
|
2262
2321
|
}
|
|
2263
|
-
${
|
|
2264
|
-
`,
|
|
2322
|
+
${tS}
|
|
2323
|
+
`,tq=(0,es.default)`
|
|
2265
2324
|
mutation MediaClient_updateMediaFile(
|
|
2266
2325
|
$fileId: UUID!
|
|
2267
2326
|
$name: String!
|
|
@@ -2279,8 +2338,8 @@ ${((e,i)=>{switch(e){case"defined_properties":return Object.entries(i).map(([e,i
|
|
|
2279
2338
|
...fileArguments
|
|
2280
2339
|
}
|
|
2281
2340
|
}
|
|
2282
|
-
${
|
|
2283
|
-
`,
|
|
2341
|
+
${tS}
|
|
2342
|
+
`,tj=(0,es.default)`
|
|
2284
2343
|
mutation MediaClient_updateMediaFiles(
|
|
2285
2344
|
$fileIds: [UUID!]!
|
|
2286
2345
|
$name: String
|
|
@@ -2289,19 +2348,19 @@ ${((e,i)=>{switch(e){case"defined_properties":return Object.entries(i).map(([e,i
|
|
|
2289
2348
|
) {
|
|
2290
2349
|
updateMediaFiles(fileIds: $fileIds, name: $name, description: $description, userTags: $userTags)
|
|
2291
2350
|
}
|
|
2292
|
-
`,
|
|
2351
|
+
`,tW=(0,es.default)`
|
|
2293
2352
|
mutation MediaClient_deleteMediaFiles($boxId: UUID!, $list: [UUID!]!) {
|
|
2294
2353
|
deleteMediaFiles(boxId: $boxId, list: $list)
|
|
2295
2354
|
}
|
|
2296
|
-
`,
|
|
2355
|
+
`,tV=(0,es.default)`
|
|
2297
2356
|
mutation MediaClient_copyMediaFiles($fromBoxId: UUID!, $toBoxId: UUID!, $list: [UUID!]!) {
|
|
2298
2357
|
copyMediaFiles(fromBoxId: $fromBoxId, toBoxId: $toBoxId, list: $list)
|
|
2299
2358
|
}
|
|
2300
|
-
`,
|
|
2359
|
+
`,tY=(0,es.default)`
|
|
2301
2360
|
mutation MediaClient_setMediaFileAsBoxPreview($id: UUID!) {
|
|
2302
2361
|
setMediaFileAsBoxPreview(id: $id)
|
|
2303
2362
|
}
|
|
2304
|
-
`,
|
|
2363
|
+
`,tK=(0,es.default)`
|
|
2305
2364
|
mutation MediaClient_assignGroupPermissions(
|
|
2306
2365
|
$roleId: String!
|
|
2307
2366
|
$instanceType: InstanceType!
|
|
@@ -2315,7 +2374,7 @@ ${((e,i)=>{switch(e){case"defined_properties":return Object.entries(i).map(([e,i
|
|
|
2315
2374
|
permissions: $permissions
|
|
2316
2375
|
)
|
|
2317
2376
|
}
|
|
2318
|
-
`,
|
|
2377
|
+
`,tG=(0,es.default)`
|
|
2319
2378
|
subscription MediaClient_listenBoxChanged($boxId: UUID!, $types: [ChangeType!]) {
|
|
2320
2379
|
mediaBoxChanged(boxId: $boxId, types: $types) {
|
|
2321
2380
|
createType
|
|
@@ -2329,15 +2388,15 @@ ${((e,i)=>{switch(e){case"defined_properties":return Object.entries(i).map(([e,i
|
|
|
2329
2388
|
}
|
|
2330
2389
|
}
|
|
2331
2390
|
}
|
|
2332
|
-
${
|
|
2333
|
-
`,
|
|
2391
|
+
${tS}
|
|
2392
|
+
`,tL=(0,es.default)`
|
|
2334
2393
|
query MediaClient_box($boxId: UUID!, $passcode: String!) {
|
|
2335
2394
|
mediaBox(boxId: $boxId, passcode: $passcode) {
|
|
2336
2395
|
...boxArguments
|
|
2337
2396
|
}
|
|
2338
2397
|
}
|
|
2339
|
-
${
|
|
2340
|
-
`,
|
|
2398
|
+
${tA}
|
|
2399
|
+
`,tz=(0,es.default)`
|
|
2341
2400
|
query MediaClient_files(
|
|
2342
2401
|
$boxId: UUID!
|
|
2343
2402
|
$passcode: String!
|
|
@@ -2357,15 +2416,15 @@ ${((e,i)=>{switch(e){case"defined_properties":return Object.entries(i).map(([e,i
|
|
|
2357
2416
|
...fileShortArguments
|
|
2358
2417
|
}
|
|
2359
2418
|
}
|
|
2360
|
-
${
|
|
2361
|
-
`,
|
|
2419
|
+
${tw}
|
|
2420
|
+
`,tH=(0,es.default)`
|
|
2362
2421
|
query MediaClient_file($fileId: UUID!, $passcode: String!) {
|
|
2363
2422
|
mediaFile(fileId: $fileId, passcode: $passcode) {
|
|
2364
2423
|
...fileArguments
|
|
2365
2424
|
}
|
|
2366
2425
|
}
|
|
2367
|
-
${
|
|
2368
|
-
`,
|
|
2426
|
+
${tS}
|
|
2427
|
+
`,tJ=(0,es.default)`
|
|
2369
2428
|
mutation MediaClient_requestFileUpload(
|
|
2370
2429
|
$name: String!
|
|
2371
2430
|
$description: String!
|
|
@@ -2389,8 +2448,8 @@ ${((e,i)=>{switch(e){case"defined_properties":return Object.entries(i).map(([e,i
|
|
|
2389
2448
|
...fileArguments
|
|
2390
2449
|
}
|
|
2391
2450
|
}
|
|
2392
|
-
${
|
|
2393
|
-
`,
|
|
2451
|
+
${tS}
|
|
2452
|
+
`,tX=(0,es.default)`
|
|
2394
2453
|
mutation MediaClient_updateMediaFile(
|
|
2395
2454
|
$boxId: UUID!
|
|
2396
2455
|
$passcode: String!
|
|
@@ -2412,8 +2471,8 @@ ${((e,i)=>{switch(e){case"defined_properties":return Object.entries(i).map(([e,i
|
|
|
2412
2471
|
...fileArguments
|
|
2413
2472
|
}
|
|
2414
2473
|
}
|
|
2415
|
-
${
|
|
2416
|
-
`,
|
|
2474
|
+
${tS}
|
|
2475
|
+
`,tQ=(0,es.default)`
|
|
2417
2476
|
mutation MediaClient_updateMediaFiles(
|
|
2418
2477
|
$boxId: UUID!
|
|
2419
2478
|
$passcode: String!
|
|
@@ -2431,11 +2490,11 @@ ${((e,i)=>{switch(e){case"defined_properties":return Object.entries(i).map(([e,i
|
|
|
2431
2490
|
userTags: $userTags
|
|
2432
2491
|
)
|
|
2433
2492
|
}
|
|
2434
|
-
`,
|
|
2493
|
+
`,tZ=(0,es.default)`
|
|
2435
2494
|
mutation MediaClient_deleteMediaFiles($boxId: UUID!, $passcode: String!, $list: [UUID!]!) {
|
|
2436
2495
|
deleteMediaFiles(boxId: $boxId, passcode: $passcode, list: $list)
|
|
2437
2496
|
}
|
|
2438
|
-
`,
|
|
2497
|
+
`,t0=(0,es.default)`
|
|
2439
2498
|
subscription MediaClient_listenBoxChanged(
|
|
2440
2499
|
$boxId: UUID!
|
|
2441
2500
|
$passcode: String!
|
|
@@ -2453,8 +2512,8 @@ ${((e,i)=>{switch(e){case"defined_properties":return Object.entries(i).map(([e,i
|
|
|
2453
2512
|
}
|
|
2454
2513
|
}
|
|
2455
2514
|
}
|
|
2456
|
-
${
|
|
2457
|
-
`,
|
|
2515
|
+
${tS}
|
|
2516
|
+
`,t1=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 t4=t(67996),t6=["authorization"],t5=`
|
|
2458
2517
|
query AL_events($filter: EventsFilter!) {
|
|
2459
2518
|
events(filter: $filter) {
|
|
2460
2519
|
device_id
|
|
@@ -2466,13 +2525,13 @@ ${((e,i)=>{switch(e){case"defined_properties":return Object.entries(i).map(([e,i
|
|
|
2466
2525
|
timestamp
|
|
2467
2526
|
}
|
|
2468
2527
|
}
|
|
2469
|
-
`,
|
|
2528
|
+
`,t9=`
|
|
2470
2529
|
query AL_screenshots($filter: ScreenshotFilter!) {
|
|
2471
2530
|
screenshots(filter: $filter) {
|
|
2472
2531
|
timestamp
|
|
2473
2532
|
}
|
|
2474
2533
|
}
|
|
2475
|
-
`,tZ=Q(function e(i,t){var n;Z(this,e),this.baseUrl=i,this.auth="string"==typeof t?{token:t,getHeaders:(n=h(function*(){return{authorization:`Bearer ${t}`}}),function(){return n.apply(this,arguments)})}:t,this.token=this.auth?.token,this.graphqlUrl=`${i}/api/graphql`},[{key:"authHeaders",value:(o=h(function*(){var e=yield this.auth.getHeaders();return{Authorization:e.authorization,...tz(e,tJ)}}),function(){return o.apply(this,arguments)})},{key:"graphql",value:(r=h(function*(e,i){var t=yield(0,B.Ay)(this.graphqlUrl,{method:"POST",headers:{"Content-Type":"application/json",...yield this.authHeaders(),Accept:"application/json"},body:JSON.stringify({query:e,variables:i})});if(!t.ok){var n=yield t.text().catch(()=>"");throw Error(`Activity-log query failed (${t.status}): ${n}`)}var a=yield t.json();if(a.errors?.length)throw Error(a.errors.map(e=>e.message).join("\n"));return a.data}),function(e,i){return r.apply(this,arguments)})},{key:"events",value:(s=h(function*(e,{limit:i,offset:t}={}){var n={...e};return null!=i&&(n.limit=i),null!=t&&(n.offset=t),(yield this.graphql(tX,{filter:n})).events}),function(e){return s.apply(this,arguments)})},{key:"screenshots",value:(d=h(function*(e){return(yield this.graphql(tQ,{filter:e})).screenshots}),function(e){return d.apply(this,arguments)})},{key:"downloadScreenshot",value:(c=h(function*(e,i,t){var n=`${this.baseUrl}/api/v1/${encodeURIComponent(e)}/${encodeURIComponent(i)}/screenshot?ts=${encodeURIComponent(t)}`,a=yield(0,B.Ay)(n,{headers:yield this.authHeaders()});if(!a.ok){var o=yield a.text().catch(()=>"");throw Error(`Screenshot fetch failed (${a.status}): ${o}`)}return Buffer.from((yield a.arrayBuffer()))}),function(e,i,t){return c.apply(this,arguments)})}]);function t0(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}.`)}}process.env.STAGE,process.env.URL_BASE;var t1="bricks-mcp",t4={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 t6=t(17199);let t5=({type:e,title:i,template_key:t})=>{var n,a,o=(0,t6.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=G(K.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,t6.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=G(K.dK.Basic),d=G(K.eW[t]);if(!d)throw Error(`Brick ${t} not found`);var c={...d,propTypes:{...s.propTypes,...d.propTypes},brickPropDescriptions:{...s.brickPropDescriptions,...d.brickPropDescriptions},eventTypes:{...s.eventTypes,...d.eventTypes},brickEventDescriptions:{...s.brickEventDescriptions,...d.brickEventDescriptions}};n={title:i,template_key:t,property:{$definitions:Object.fromEntries(Object.entries(c.propTypes).map(([e,i])=>[e,{...i,description:c.brickPropDescriptions[e]}]))},event_map:{$definitions:Object.fromEntries(Object.entries(c.eventTypes).map(([e])=>[e,{description:c.brickEventDescriptions[e]}]))},outlet:{$definitions:Object.fromEntries(Object.entries(c.outletTypes??{}).map(([e])=>[e,{description:(c.brickOutletDescriptions??{})[e]}]))},state_group:{"BRICK_STATE_GROUP_<UUID>":{}}},a={canvas_map:{"CANVAS_<UUID WHICH NEED DISPLAY THIS BRICK>":{item_list:[{type:"brick",brick_id:o,frame:{x:"number",y:"number",width:"number",height:"number",standby_mode:"custom|top|left|right|bottom",standby_delay:"number",standby_easing:{default:{method:"ease",duration:"number"}}}}]}}};break;case"state_group":n={title:i,description:"State Group Description",conds:[{type:"property_bank|inner_state",key:"PROPERTY_BANK#<Data Node ID>|[current_canvas|BRICK_<OUTLET NAME>]|",method:"==|!=|>|>=|<|<=",value:"value_to_compare"}],override:{property:!1,event:!1,outlet:!1},commented:!1,break:!1,property:{},outlet:{},animation:{}};break;case"generator":var l=G(K.wj[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(K.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,t6.M4)("property_bank_command"),u=(0,t6.M4)("property_bank_command"),m=(0,t6.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 x({id:o,example:n,extraInfo:a})};var t9=(l=h(function*(e,i){var t=new AbortController,n=setTimeout(()=>t.abort(),15e3);try{var a=yield(0,B.Ay)(e,{agent:i,size:0x6400000,signal:t.signal});if(!a.ok)throw Error(`source_url responded with HTTP ${a.status}`);var o=Number(a.headers.get("content-length"));if(Number.isFinite(o)&&o>0x6400000)throw Error("source_url response exceeds the 100 MiB download limit");var r=a.headers.get("content-type")||"application/octet-stream";return{data:yield a.blob(),contentType:r}}catch(e){if(e?.name==="AbortError")throw Error("source_url download exceeded the 15s time limit");throw e}finally{clearTimeout(n)}}),function(e,i){return l.apply(this,arguments)}),t2="2.25.10";function t3(){return t8.apply(this,arguments)}function t8(){return(t8=h(function*(e={}){var i,t,n=e.baseUrl||t4.bricks,a=e.activityLogBaseUrl||t4.activityLog,o=!e.token&&!!e.getAuthHeaders,r=e.token||!e.getAuthHeaders&&process.env.BRICKS_API_TOKEN,s=null;if(!r&&e.getAuthHeaders){var d=yield e.getAuthHeaders();r=d.authorization?.replace(/^Bearer /,""),s=d["x-bricks-workspace-id"]||null}if(!r)throw console.error("Error: API token is required"),console.error(o?"OAuth sign-in did not produce credentials. Run `bricks auth login` again.":"Please provide a token via options or set BRICKS_API_TOKEN environment variable"),Error("API token is required");var c=function(e){try{var i=e.queryStringParameters?.token;if(!i){var t=new Headers(e.headers);i=t.get("authorization")?.replace("Bearer ","")}if(!i)return{success:!1,message:"Authentication failed: No token provided"};var n=function(e){try{var i=e.split(".");if(i.length<3)return null;var t=JSON.parse(Buffer.from(i[0],"base64url").toString());if(!A.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=w.includes(n.iss)?"user":"workspace";if("workspace"===a){var o=Array.isArray(n.t)?n.t:[];n.permissions=o.reduce((e,i)=>{var t=D[i];return t&&e.push(t),e},[])}else n.permissions=Object.keys(k);return{success:!0,token:i,tokenInfo:n,tokenType:a}}catch(e){return{success:!1,message:`Authentication failed: ${e.message}`}}}({queryStringParameters:{token:r}});if(!c.success){var l=o?"Invalid OAuth session credentials — run `bricks auth login` again":"Invalid BRICKS_API_TOKEN";throw console.error(`Error: ${l}`),console.error(c.message),Error(l)}var p=new b._({name:t1,version:t2});if(e.getAuthHeaders&&s){var u={token:r,getHeaders:e.getAuthHeaders};t={...c,tokenType:"workspace",tokenInfo:{...c.tokenInfo,w_id:s,permissions:Object.keys(k)},auth:u,client:t0(n,u,"workspace")}}else t={...c,client:t0(n,c.token,c.tokenType)};p.prompt("getting-started","Getting started with BRICKS",{},h(function*(){return{messages:[{role:"user",content:{type:"text",text:`Welcome to BRICKS — start here.
|
|
2534
|
+
`,t2=Q(function e(i,t){var n;Z(this,e),this.baseUrl=i,this.auth="string"==typeof t?{token:t,getHeaders:(n=h(function*(){return{authorization:`Bearer ${t}`}}),function(){return n.apply(this,arguments)})}:t,this.token=this.auth?.token,this.graphqlUrl=`${i}/api/graphql`},[{key:"authHeaders",value:(o=h(function*(){var e=yield this.auth.getHeaders();return{Authorization:e.authorization,...t4(e,t6)}}),function(){return o.apply(this,arguments)})},{key:"graphql",value:(r=h(function*(e,i){var t=yield(0,E.Ay)(this.graphqlUrl,{method:"POST",headers:{"Content-Type":"application/json",...yield this.authHeaders(),Accept:"application/json"},body:JSON.stringify({query:e,variables:i})});if(!t.ok){var n=yield t.text().catch(()=>"");throw Error(`Activity-log query failed (${t.status}): ${n}`)}var a=yield t.json();if(a.errors?.length)throw Error(a.errors.map(e=>e.message).join("\n"));return a.data}),function(e,i){return r.apply(this,arguments)})},{key:"events",value:(s=h(function*(e,{limit:i,offset:t}={}){var n={...e};return null!=i&&(n.limit=i),null!=t&&(n.offset=t),(yield this.graphql(t5,{filter:n})).events}),function(e){return s.apply(this,arguments)})},{key:"screenshots",value:(d=h(function*(e){return(yield this.graphql(t9,{filter:e})).screenshots}),function(e){return d.apply(this,arguments)})},{key:"downloadScreenshot",value:(c=h(function*(e,i,t){var n=`${this.baseUrl}/api/v1/${encodeURIComponent(e)}/${encodeURIComponent(i)}/screenshot?ts=${encodeURIComponent(t)}`,a=yield(0,E.Ay)(n,{headers:yield this.authHeaders()});if(!a.ok){var o=yield a.text().catch(()=>"");throw Error(`Screenshot fetch failed (${a.status}): ${o}`)}return Buffer.from((yield a.arrayBuffer()))}),function(e,i,t){return c.apply(this,arguments)})}]);function t3(e,i,t){switch(t){case"user":return new iP(e,i);case"workspace":return new td(e,i);default:throw Error(`Invalid token type: ${t}.`)}}process.env.STAGE,process.env.URL_BASE;var t8="bricks-mcp",t7={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 ne=t(17199);let ni=({type:e,title:i,template_key:t})=>{var n,a,o=(0,ne.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=K(Y.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,ne.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=K(Y.dK.Basic),d=K(Y.eW[t]);if(!d)throw Error(`Brick ${t} not found`);var c={...d,propTypes:{...s.propTypes,...d.propTypes},brickPropDescriptions:{...s.brickPropDescriptions,...d.brickPropDescriptions},eventTypes:{...s.eventTypes,...d.eventTypes},brickEventDescriptions:{...s.brickEventDescriptions,...d.brickEventDescriptions}};n={title:i,template_key:t,property:{$definitions:Object.fromEntries(Object.entries(c.propTypes).map(([e,i])=>[e,{...i,description:c.brickPropDescriptions[e]}]))},event_map:{$definitions:Object.fromEntries(Object.entries(c.eventTypes).map(([e])=>[e,{description:c.brickEventDescriptions[e]}]))},outlet:{$definitions:Object.fromEntries(Object.entries(c.outletTypes??{}).map(([e])=>[e,{description:(c.brickOutletDescriptions??{})[e]}]))},state_group:{"BRICK_STATE_GROUP_<UUID>":{}}},a={canvas_map:{"CANVAS_<UUID WHICH NEED DISPLAY THIS BRICK>":{item_list:[{type:"brick",brick_id:o,frame:{x:"number",y:"number",width:"number",height:"number",standby_mode:"custom|top|left|right|bottom",standby_delay:"number",standby_easing:{default:{method:"ease",duration:"number"}}}}]}}};break;case"state_group":n={title:i,description:"State Group Description",conds:[{type:"property_bank|inner_state",key:"PROPERTY_BANK#<Data Node ID>|[current_canvas|BRICK_<OUTLET NAME>]|",method:"==|!=|>|>=|<|<=",value:"value_to_compare"}],override:{property:!1,event:!1,outlet:!1},commented:!1,break:!1,property:{},outlet:{},animation:{}};break;case"generator":var l=K(Y.wj[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(Y.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,ne.M4)("property_bank_command"),u=(0,ne.M4)("property_bank_command"),m=(0,ne.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 X({id:o,example:n,extraInfo:a})};var nt=(l=h(function*(e,i){var t=new AbortController,n=setTimeout(()=>t.abort(),15e3);try{var a=yield(0,E.Ay)(e,{agent:i,size:0x6400000,signal:t.signal});if(!a.ok)throw Error(`source_url responded with HTTP ${a.status}`);var o=Number(a.headers.get("content-length"));if(Number.isFinite(o)&&o>0x6400000)throw Error("source_url response exceeds the 100 MiB download limit");var r=a.headers.get("content-type")||"application/octet-stream";return{data:yield a.blob(),contentType:r}}catch(e){if(e?.name==="AbortError")throw Error("source_url download exceeded the 15s time limit");throw e}finally{clearTimeout(n),t.abort()}}),function(e,i){return l.apply(this,arguments)}),nn="2.25.12";function na(){return no.apply(this,arguments)}function no(){return(no=h(function*(e={}){var i,t,n=e.baseUrl||t7.bricks,a=e.activityLogBaseUrl||t7.activityLog,o=!e.token&&!!e.getAuthHeaders,r=e.token||!e.getAuthHeaders&&process.env.BRICKS_API_TOKEN,s=null;if(!r&&e.getAuthHeaders){var d=yield e.getAuthHeaders();r=d.authorization?.replace(/^Bearer /,""),s=d["x-bricks-workspace-id"]||null}if(!r)throw console.error("Error: API token is required"),console.error(o?"OAuth sign-in did not produce credentials. Run `bricks auth login` again.":"Please provide a token via options or set BRICKS_API_TOKEN environment variable"),Error("API token is required");var c=function(e){try{var i=e.queryStringParameters?.token;if(!i){var t=new Headers(e.headers);i=t.get("authorization")?.replace("Bearer ","")}if(!i)return{success:!1,message:"Authentication failed: No token provided"};var n=function(e){try{var i=e.split(".");if(i.length<3)return null;var t=JSON.parse(Buffer.from(i[0],"base64url").toString());if(!A.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=S.includes(n.iss)?"user":"workspace";if("workspace"===a){var o=Array.isArray(n.t)?n.t:[];n.permissions=o.reduce((e,i)=>{var t=D[i];return t&&e.push(t),e},[])}else n.permissions=Object.keys(k);return{success:!0,token:i,tokenInfo:n,tokenType:a}}catch(e){return{success:!1,message:`Authentication failed: ${e.message}`}}}({queryStringParameters:{token:r}});if(!c.success){var l=o?"Invalid OAuth session credentials — run `bricks auth login` again":"Invalid BRICKS_API_TOKEN";throw console.error(`Error: ${l}`),console.error(c.message),Error(l)}var p=new b._({name:t8,version:nn});if(e.getAuthHeaders&&s){var u={token:r,getHeaders:e.getAuthHeaders};t={...c,tokenType:"workspace",tokenInfo:{...c.tokenInfo,w_id:s,permissions:Object.keys(k)},auth:u,client:t3(n,u,"workspace")}}else t={...c,client:t3(n,c.token,c.tokenType)};p.prompt("getting-started","Getting started with BRICKS",{},h(function*(){return{messages:[{role:"user",content:{type:"text",text:`Welcome to BRICKS — start here.
|
|
2476
2535
|
|
|
2477
2536
|
Before doing any complex work (application design, deployments, etc.),
|
|
2478
2537
|
always consult the official docs rather than guessing.
|
|
@@ -2510,7 +2569,7 @@ Quick actions:
|
|
|
2510
2569
|
- "Deploy an application to a device" → use the \`deploy-to-device\` prompt
|
|
2511
2570
|
|
|
2512
2571
|
Try asking:
|
|
2513
|
-
- "Draft a plan to create an app with a text display and deploy it; ask any missing questions first"`}}]}})),p.prompt("create-application","Create a new BRICKS application with guided setup",{app_name:
|
|
2572
|
+
- "Draft a plan to create an app with a text display and deploy it; ask any missing questions first"`}}]}})),p.prompt("create-application","Create a new BRICKS application with guided setup",{app_name:w.Yj().describe("Name for the new application"),description:w.Yj().describe("Short description for the new application").optional()},(i=h(function*(e){var i=e?.app_name||"New Application",t=e?.description||"";return{messages:[{role:"user",content:{type:"text",text:`Help me create a new BRICKS application called "${i}".
|
|
2514
2573
|
|
|
2515
2574
|
${t?`Goal: ${t}`:""}
|
|
2516
2575
|
|
|
@@ -2543,4 +2602,4 @@ What I'll produce first:
|
|
|
2543
2602
|
- Short recap of requirements
|
|
2544
2603
|
- Clarifying questions (only what's necessary)
|
|
2545
2604
|
- High-level architecture plan
|
|
2546
|
-
- Minimal config skeleton that validates against the schema`}}]}}),function(e){return i.apply(this,arguments)})),p.resource("getting-started-docs","file://docs/getting-started.md",{mimeType:"text/markdown",title:"Getting Started with BRICKS",description:"Comprehensive guide to BRICKS architecture, concepts, and development workflow"},h(function*(){return x(C,{uri:"file://docs/getting-started.md",mimeType:"text/markdown"})})),function(e,i,{activityLogBaseUrl:t=t4.activityLog}={}){var n,a="user"===i.tokenType,o=((e,i=null)=>({name:t,description:n,inputSchema:a,permission:o},r)=>{(!o||i.tokenInfo.permissions?.includes(o)||0)&&e.tool(t,n,a,r)})(e,i),r=e=>({...e,...a?{workspace_id:S.Yj().describe("Workspace ID")}:{}}),s=i.client,d=a?function(e){var i=e.endpoint,t=e.accessToken;if(!i)throw Error("Media API endpoint is required");if(!t)throw Error("Access token is required");return((e={})=>{let i=(({endpoint:e="http://localhost:3002",accessToken:i,boxId:t,passcode:n,enableSubscription:a=!0,enableRetry:o=!0,subscriptionOnConnectionOrError:r,onNetworkError:s}={})=>{let d,c,l,p=t&&n,u=`${e}/api/graphql`;return p&&(u=`${e}/api/graphql_with_passcode`),d=function({endpointURL:e,subscriptionEndpointURL:i,accessToken:t,boxId:n,passcode:a,origin:o,enableSubscription:r,enableRetry:s=!0,subscriptionOnConnectionOrError:d,onNetworkError:c=()=>{}}){let l,p,u,m,_={};o&&(_.origin=o),n&&a||(_.authorization=`Bearer ${t}`);let g=new tc.z({uri:e,headers:_}),f=()=>{m&&(clearTimeout(m),m=void 0)};r&&(l=(0,tp.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 tl.c(l));let y=tr.C.from([(0,tu.S)(({networkError:e,operation:i})=>{if(e){let t;c(e,i);let n=e?.message||"";if("Aborted"===(t=e?.message)||e?.name==="AbortError"||"Timeout exceeded"===t||e?.timeout||e?.statusCode===403||e?.status===403||n.includes("Too many requests")||e?.response?.status===429||e?.statusCode===429||e?.status===429)return new ts.c(e=>e.complete())}}),s&&new td.z({attempts:{max:3,retryIf:e=>(function(e,{nonRetryableResponseStatusCodes:i=ta,nonRetryableStatusCodes:t=to}={}){if(!e)return!1;let n="string"==typeof e?.message?e.message:"string"==typeof e?e:"";return!(n.includes("Too many requests")||i.includes(e?.response?.status)||t.includes(e?.statusCode)||t.includes(e?.status)||e?.timeout||"Timeout exceeded"===n)&&"Aborted"!==n&&e?.name!=="AbortError"})(e,{nonRetryableStatusCodes:tf})}}),new(t_())(3e4),r?tr.C.split(({query:e})=>{let{kind:i,operation:t}=(0,tg.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 eo.D,(l=new ea.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=$,i.mutations=v;let t={boxId:e.boxId,passcode:e.passcode};Object.entries($).forEach(tn(i,"query",t)),Object.entries(v).forEach(tn(i,"mutation",t)),i.listenBoxChanged=(e,n)=>i.subscribe({query:tL,variables:{...t,...e}}).subscribe({next:tH(n),error(e){n(e)}})}else i.accessToken=e.accessToken,i.type="token",i.queries=f,i.mutations=y,Object.entries(f).forEach(tn(i,"query")),Object.entries(y).forEach(tn(i,"mutation")),i.listenBoxChanged=(e,t)=>i.subscribe({query:tN,variables:e}).subscribe({next:tH(t),error(e){t(e)}});return i})({endpoint:i,accessToken:t,enableSubscription:!1,enableRetry:!0})}({endpoint:t4.media,accessToken:i.token}):s,c=e=>a?{fileId:e}:{id:e},l=e=>a?{list:e}:{fileIds:e};if(a&&e.tool("list_workspaces","List all workspaces",{},h(function*(){return x((yield s.workspaces()))})),o({name:"get_workspace_overview",description:"Get comprehensive overview of the BRICKS workspace including stats and summary",inputSchema:r({}),permission:"info"},(p=h(function*({workspace_id:e}){var i=E((yield Promise.all([s.workspace({id:e}),s.applications({workspaceId:e,paginate:{limit:50,offset:0}}),s.modules({workspaceId:e,paginate:{limit:50,offset:0}}),s.devices({workspaceId:e,paginate:{limit:50,offset:0}}),a?d.mediaWorkspace({workspaceId:e}).catch(()=>null):d.mediaWorkspace().catch(()=>null),a?d.mediaBoxes({workspaceId:e}).catch(()=>[]):d.mediaBoxes().catch(()=>[])])),6),t=i[0],n=i[1],o=i[2],r=i[3],c=i[4],l=i[5];if(!t)throw Error("Authentication failed, please check your token");return x({workspace:t,stats:{applications:n?.length??"No permission",modules:o?.length??"No permission",devices:r?.length??"No permission",running_apps:n?.filter(e=>e.status?.running).length??"No permission",media_boxes:l?.length??"No permission",media_enabled:!!c,notes:"Note: The stats are based on the first 50 applications, modules, and devices in the workspace."},recent_activity:{latest_apps:n?.slice(0,5).map(e=>({id:e._id,name:e.name,status:e.status?.running?"running":"stopped",last_update:e.last_modify_datetime}))||[]},media_info:c?{workspace_id:c.id,name:c.name,size_used:c.size,size_limit:c.sizeLimit,boxes:l?.slice(0,5).map(e=>({id:e.id,name:e.name,size:e.size,description:e.description}))||[]}:{enabled:!1,note:"Media workspace is not enabled for this workspace"}})}),function(e){return p.apply(this,arguments)})),o({name:"get_applications",description:"List all applications in the workspace",inputSchema:r({limit:S.ai().describe("Maximum number of applications to return").optional().default(50),offset:S.ai().describe("Number of applications to skip").optional().default(0)}),permission:"query_application"},(u=h(function*({workspace_id:e,limit:i=50,offset:t=0}){return x((yield s.applications({workspaceId:e,paginate:{limit:i,offset:t}})))}),function(e){return u.apply(this,arguments)})),o({name:"get_application",description:"Get detailed info and config of a specific application",inputSchema:r({id:S.Yj().describe("Application ID")}),permission:"query_application"},(m=h(function*({workspace_id:e,id:i}){return x((yield s.application({workspaceId:e,id:i})))}),function(e){return m.apply(this,arguments)})),o({name:"get_modules",description:"List all modules in the workspace",inputSchema:r({limit:S.ai().describe("Maximum number of modules to return").optional().default(50),offset:S.ai().describe("Number of modules to skip").optional().default(0)}),permission:"query_module"},(_=h(function*({workspace_id:e,limit:i=50,offset:t=0}){return x((yield s.modules({workspaceId:e,paginate:{limit:i,offset:t}})))}),function(e){return _.apply(this,arguments)})),o({name:"get_module",description:"Get detailed info and config of a specific module",inputSchema:r({id:S.Yj().describe("Module ID")}),permission:"query_module"},(g=h(function*({workspace_id:e,id:i}){return x((yield s.module({workspaceId:e,id:i})))}),function(e){return g.apply(this,arguments)})),o({name:"update_module_info",description:"Update a specific module info",inputSchema:r({id:S.Yj().describe("Module ID"),name:S.Yj().describe("Module name"),description:S.Yj().describe("Module description")}),permission:"update_module"},(b=h(function*({workspace_id:e,id:i,name:t,description:n}){return x((yield s.updateModule({workspaceId:e,id:i,name:t,description:n})))}),function(e){return b.apply(this,arguments)})),o({name:"update_module_config",description:"Update a specific module configuration",inputSchema:r({id:S.Yj().describe("Module ID"),config:S.Ik({}).passthrough().describe("New configuration object, see file://docs/config-schema.md for schema reference")}),permission:"update_module"},(I=h(function*({workspace_id:e,id:i,config:t}){var n=yield V(t);if(!n.valid)throw Error(`Config validation failed: ${n.errors.join(", ")}`);return x((yield s.updateModule({workspaceId:e,id:i,config:JSON.stringify(t),validateConfig:!0})))}),function(e){return I.apply(this,arguments)})),o({name:"get_devices",description:"List all devices in the workspace",inputSchema:r({limit:S.ai().describe("Maximum number of devices to return").optional().default(50),offset:S.ai().describe("Number of devices to skip").optional().default(0)}),permission:"query_device"},(k=h(function*({workspace_id:e,limit:i=50,offset:t=0}){return x((yield s.devices({workspaceId:e,paginate:{limit:i,offset:t}})))}),function(e){return k.apply(this,arguments)})),o({name:"create_application",description:"Create a new BRICKS application with default grid layout",inputSchema:r({name:S.Yj().describe("Application name"),description:S.Yj().describe("Application description").optional(),grid_width:S.ai().describe("Grid width in units").optional().default(96),grid_height:S.ai().describe("Grid height in units").optional().default(54)}),permission:"create_application"},(D=h(function*({workspace_id:e,name:i,description:t,grid_width:n,grid_height:a}){return x((yield s.createApplication({workspaceId:e,name:i,description:t,gridWidth:n,gridHeight:a})))}),function(e){return D.apply(this,arguments)})),o({name:"update_application_info",description:"Update application info",inputSchema:{id:S.Yj().describe("Application ID"),name:S.Yj().describe("Application name"),description:S.Yj().describe("Application description")},permission:"update_application"},(A=h(function*({id:e,name:i,description:t}){return x((yield s.updateApplication({id:e,name:i,description:t})))}),function(e){return A.apply(this,arguments)})),o({name:"update_application_config",description:"Update application configuration with validation",inputSchema:{id:S.Yj().describe("Application ID"),config:S.Ik({}).passthrough().describe("New application configuration. Please read `getting-started` for BRICKS concepts before changing")},permission:"update_application"},(w=h(function*({id:e,config:i}){var t=yield V(i);if(!t.valid)throw Error(`Config validation failed: ${t.errors.join(", ")}`);return x((yield s.updateApplication({id:e,config:JSON.stringify(i)})))}),function(e){return w.apply(this,arguments)})),o({name:"bind_application",description:"Bind application to device with viewport configuration",inputSchema:{app_id:S.Yj().describe("Application ID"),viewports:S.YO(S.Ik({device_id:S.Yj().describe("Device ID"),x:S.ai().describe("X coordinate"),y:S.ai().describe("Y coordinate"),width:S.ai().describe("Width"),height:S.ai().describe("Height"),rotate:S.ai().describe("Rotation"),rotateType:S.Yj().describe("Rotation type")})).describe("Viewport configuration")},permission:"bind_application"},(C=h(function*({app_id:e,viewports:i}){return x((yield s.bindApplication({id:e,bindDevices:i.map(e=>e.device_id),deviceFrames:i.reduce((e,i)=>({...e,[i.device_id]:{x:i.x,y:i.y,width:i.width,height:i.height,rotate:i.rotate,rotateType:i.rotateType}}),{})})))}),function(e){return C.apply(this,arguments)})),o({name:"unbind_application",description:"Unbind application from device",inputSchema:{app_id:S.Yj().describe("Application ID"),device_id:S.Yj().describe("Device ID")},permission:"bind_application"},(R=h(function*({app_id:e,device_id:i}){return x((yield s.bindApplication({id:e,unbindDevices:[i]})))}),function(e){return R.apply(this,arguments)})),a&&o({name:"list_media_workspaces",description:"List all media workspaces",inputSchema:{},permission:"query_media_flow"},h(function*(){return x((yield d.mediaWorkspaces()))})),o({name:"get_media_workspace",description:"Get media workspace information and status",inputSchema:r({}),permission:"query_media_flow"},(P=h(function*({workspace_id:e}){return x((yield d.mediaWorkspace({workspaceId:e})))}),function(e){return P.apply(this,arguments)})),o({name:"list_media_boxes",description:"List all media boxes in the workspace",inputSchema:r({}),permission:"query_media_flow"},(O=h(function*({workspace_id:e}){return x((yield d.mediaBoxes({workspaceId:e})))}),function(e){return O.apply(this,arguments)})),o({name:"get_media_box",description:"Get detailed information about a specific media box",inputSchema:{box_id:S.Yj().describe("Media box ID")},permission:"query_media_flow"},(F=h(function*({box_id:e}){return x((yield d.mediaBox({boxId:e})))}),function(e){return F.apply(this,arguments)})),o({name:"list_media_files",description:"List media files in a specific box with filtering options",inputSchema:{box_id:S.Yj().describe("Media box ID"),include_types:S.YO(S.Yj()).optional().describe('Filter by file types (e.g., ["image", "video", "audio"])'),user_tags:S.YO(S.Yj()).optional().describe("Filter by user tags"),limit:S.ai().optional().default(50).describe("Maximum number of files to return"),offset:S.ai().optional().default(0).describe("Number of files to skip")},permission:"query_media_flow"},(N=h(function*({box_id:e,include_types:i,user_tags:t,limit:n,offset:a}){return x((yield d.mediaFiles({boxId:e,includeTypes:i,userTags:t,limit:n,offset:a})))}),function(e){return N.apply(this,arguments)})),o({name:"get_media_file_meta",description:"Get detailed information about a specific media file",inputSchema:{file_id:S.Yj().describe("Media file ID")},permission:"query_media_flow"},(q=h(function*({file_id:e}){return x((yield d.mediaFile(c(e))))}),function(e){return q.apply(this,arguments)})),o({name:"media_box_upload",description:"Upload a file to a media box from URL or base64 data",inputSchema:{box_id:S.Yj().describe("Target media box ID"),name:S.Yj().describe("File name"),description:S.Yj().optional().default("").describe("File description"),file_type:S.k5(["image","video","audio","file"]).describe("File type"),source_url:S.Yj().optional().describe("URL to download the file from (maximum 100 MiB)"),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"},(j=h(function*({box_id:e,name:i,description:t,source_url:n,base64_data:o,file_type:r,user_tags:s}){if(!n&&!o)throw Error("Either source_url or base64_data must be provided");if(n&&o)throw Error("Provide either source_url OR base64_data, not both");var c,l="application/octet-stream";if(n){var p=yield t9(n,(0,U.fJ)(n));c=p.data,l=p.contentType}else c=new Blob([T.Buffer.from(o,"base64")],{type:l});var u=yield d.requestFileUpload({name:i,description:t,boxId:e,fileType:a?r.toUpperCase():r,contentType:l,userTags:s,meta:{}}),m=!1;try{var _=JSON.parse(u?.meta.uploadInfo),g=new FormData;g.append("file",c),g.append("Content-Type",l),g.append("AWSAccessKeyId",_.AWSAccessKeyId),g.append("Signature",_.Signature),g.append("Policy",_.Policy),g.append("acl",_.acl),g.append("key",_.key),m=yield(0,B.Ay)(_.url,{method:"POST",body:g}).then(e=>e.ok).catch(()=>!1)}catch{m=!1}return x({file_id:u.id,upload_success:m,upload_info:{content_type:l,file_type:r,source_type:n?"url":"base64",processing_note:"File will be processed automatically. Use get_media_file to check processing status."}})}),function(e){return j.apply(this,arguments)})),o({name:"update_media_file_meta",description:"Update media file information",inputSchema:{file_id:S.Yj().describe("Media file ID"),name:S.Yj().optional().describe("New file name"),description:S.Yj().optional().describe("New file description"),user_tags:S.YO(S.Yj()).optional().describe("New user tags")},permission:"write_media_flow"},(W=h(function*({file_id:e,name:i,description:t,user_tags:n}){return x((yield d.updateMediaFile({...c(e),name:i,description:t,userTags:n,requestUploadAgain:!1})))}),function(e){return W.apply(this,arguments)})),o({name:"copy_media_files",description:"Copy media files from one box to another",inputSchema:{from_box_id:S.Yj().describe("Source media box ID"),to_box_id:S.Yj().describe("Target media box ID"),file_ids:S.YO(S.Yj()).describe("Array of media file IDs to copy")},permission:"write_media_flow"},(Y=h(function*({from_box_id:e,to_box_id:i,file_ids:t}){return x((yield d.copyMediaFiles({fromBoxId:e,toBoxId:i,...l(t)})))}),function(e){return Y.apply(this,arguments)})),o({name:"delete_media_files",description:"Delete specific media files from a box",inputSchema:{box_id:S.Yj().describe("Media box ID"),file_ids:S.YO(S.Yj()).describe("Array of media file IDs to delete")},permission:"write_media_flow"},(K=h(function*({box_id:e,file_ids:i}){return x((yield d.deleteMediaFiles({boxId:e,...l(i)})))}),function(e){return K.apply(this,arguments)})),o({name:"cleanup_media_box",description:"Delete all files in a media box, optionally filtered by type",inputSchema:{box_id:S.Yj().describe("Media box ID"),include_types:S.YO(S.Yj()).optional().describe('Only delete files of these types (e.g., ["image", "video"])')},permission:"write_media_flow"},(G=h(function*({box_id:e,include_types:i}){if("deleteMediaBoxFiles"in d)return x((yield d.deleteMediaBoxFiles({boxId:e,includeTypes:i})));var t=yield d.mediaFiles({boxId:e,includeTypes:i});return x((yield d.deleteMediaFiles({boxId:e,list:t.map(e=>e.id)})))}),function(e){return G.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)},(L=h(function*({device_width:e,device_height:i,app_grid_width:t,app_grid_height:n}){var a=(0,M.k)(t,e,i),o=(0,M.Y)(e,i,t);return x({device_resolution:{width:e,height:i,aspect_ratio:(e/i).toFixed(2)},current_grid:{width:t,height:n,unit_size_px:a.deviceBrickUnit.toFixed(2),total_pixels:{width:a.deviceBrickWidth.toFixed(2),height:a.deviceBrickHeight.toFixed(2)}},recommended_grid:{width:o.deviceBrickWidth,height:o.deviceBrickHeight,unit_size_px:o.deviceBrickUnit.toFixed(2),note:"Optimized for device aspect ratio"}})}),function(e){return L.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")},t5),e.tool("getting_started","Get documentation content for getting started",{},h(function*(){return x(X)})),!a){var p,u,m,_,g,b,I,k,D,A,w,C,R,P,O,F,N,q,j,W,Y,K,G,L,H,z,J,Q=()=>new tZ(t,i.auth||i.token);o({name:"activity_log_events",description:"Query activity log events. Returns raw events (general, data, local_sync) with filtering. Max 30-day range.",inputSchema:r({start_time:S.Yj().describe("Start time (ISO 8601)"),end_time:S.Yj().describe("End time (ISO 8601)"),device_id:S.Yj().optional().describe("Filter by device ID"),event_type:S.k5(["general","data","local_sync"]).optional().describe("Filter by event type"),event_name:S.Yj().optional().describe("Filter by event name (e.g. BRICK_xxx_ON_PRESS)"),subspace_id:S.Yj().optional().describe("Filter by subspace ID"),sender:S.Yj().optional().describe("Filter by sender"),limit:S.ai().optional().default(50).describe("Max events to return per page"),offset:S.ai().optional().default(0).describe("Number of events to skip (for pagination)")}),permission:"query_activity_log"},(H=h(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=Q(),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),x((yield c.events(l,{limit:s,offset:d})))}),function(e){return H.apply(this,arguments)})),o({name:"activity_log_screenshots",description:"List available screenshot timestamps for a device in a time range.",inputSchema:r({device_id:S.Yj().describe("Device ID (required)"),start_time:S.Yj().describe("Start time (ISO 8601)"),end_time:S.Yj().describe("End time (ISO 8601)")}),permission:"query_activity_log"},(z=h(function*({device_id:e,start_time:i,end_time:t}){var n=Q();return x((yield n.screenshots({device_id:e,start_time:i,end_time:t})))}),function(e){return z.apply(this,arguments)})),o({name:"activity_log_screenshot",description:"Download a device screenshot at a specific timestamp. Returns JPEG image as blob.",inputSchema:r({device_id:S.Yj().describe("Device ID"),ts:S.Yj().describe("Screenshot timestamp (ISO 8601 or epoch ms)")}),permission:"query_activity_log"},(J=h(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=Q(),r=/^\d+$/.test(n)?n:new Date(n).getTime();return x((yield o.downloadScreenshot(a,t,r)),{mimeType:"image/jpeg"})}),function(e){return J.apply(this,arguments)}))}o({name:"get_device_usage",description:"Get device usage metrics (uptime, memory, disk) for a date range. Data from BRICKS main server.",inputSchema:r({device_id:S.Yj().describe("Device ID"),start_date:S.Yj().optional().describe("Start date/time in ISO 8601 format (default: start of today)"),end_date:S.Yj().optional().describe("End date/time in ISO 8601 format (default: now)")}),permission:"query_device"},(n=h(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 x((yield s.deviceUsage({deviceId:e,startDate:i?new Date(i).toISOString():a,endDate:t?new Date(t).toISOString():n.toISOString()})))}),function(e){return n.apply(this,arguments)}))}(p,t,{activityLogBaseUrl:a});var m=new I.S;try{yield p.connect(m),console.error("BRICKS MCP Server running on STDIO"),console.error(`Server: ${t1} v${t2}`),console.error(`Token Type: ${t.tokenType}${s?" (oauth)":""}`),console.error(`Permissions: ${t.tokenInfo.permissions.join(", ")}`),console.error("Ready to accept requests...")}catch(e){throw console.error("Failed to start MCP server:",e),e}})).apply(this,arguments)}}};
|
|
2605
|
+
- Minimal config skeleton that validates against the schema`}}]}}),function(e){return i.apply(this,arguments)})),p.resource("getting-started-docs","file://docs/getting-started.md",{mimeType:"text/markdown",title:"Getting Started with BRICKS",description:"Comprehensive guide to BRICKS architecture, concepts, and development workflow"},h(function*(){return{contents:[{uri:"file://docs/getting-started.md",mimeType:"text/markdown",text:C}]}})),function(e,i,{activityLogBaseUrl:t=t7.activityLog}={}){var n,a="user"===i.tokenType,o=((e,i=null)=>({name:t,description:n,inputSchema:a,permission:o},r)=>{(!o||i.tokenInfo.permissions?.includes(o)||0)&&e.tool(t,n,a,r)})(e,i),r=e=>({...e,...a?{workspace_id:w.Yj().describe("Workspace ID")}:{}}),s=i.client,d=a?function(e){var i=e.endpoint,t=e.accessToken;if(!i)throw Error("Media API endpoint is required");if(!t)throw Error("Access token is required");return((e={})=>{let i=(({endpoint:e="http://localhost:3002",accessToken:i,boxId:t,passcode:n,enableSubscription:a=!0,enableRetry:o=!0,subscriptionOnConnectionOrError:r,onNetworkError:s}={})=>{let d,c,l,p=t&&n,u=`${e}/api/graphql`;return p&&(u=`${e}/api/graphql_with_passcode`),d=function({endpointURL:e,subscriptionEndpointURL:i,accessToken:t,boxId:n,passcode:a,origin:o,enableSubscription:r,enableRetry:s=!0,subscriptionOnConnectionOrError:d,onNetworkError:c=()=>{}}){let l,p,u={};o&&(u.origin=o),n&&a||(u.authorization=`Bearer ${t}`);let m=new tf.z({uri:e,headers:u});if(r){let e,t,n;l=(0,t$.UU)({url:i,lazy:!0,connectionParams:u,retryAttempts:1/0,shouldRetry:()=>!0,keepAlive:1e4,on:{error:e=>{n(),d?.(e)},opened:i=>{d?.(),e=i,n()},ping:i=>{i||(n(),t=setTimeout(()=>{e&&e.readyState===WebSocket.OPEN&&e.close(4205,"Client Restart")},5e3))},pong:e=>{e&&n()},closed:n=()=>{t&&(clearTimeout(t),t=void 0)}}}),p=new ty.c(l)}let _=tm.C.from([(0,tv.S)(({networkError:e,operation:i})=>{if(e){let t;c(e,i);let n=e?.message||"";if("Aborted"===(t=e?.message)||e?.name==="AbortError"||"Timeout exceeded"===t||e?.timeout||e?.statusCode===403||e?.status===403||n.includes("Too many requests")||e?.response?.status===429||e?.statusCode===429||e?.status===429)return new t_.c(e=>e.complete())}}),s&&new tg.z({attempts:{max:3,retryIf:e=>(function(e,{nonRetryableResponseStatusCodes:i=tp,nonRetryableStatusCodes:t=tu}={}){if(!e)return!1;let n="string"==typeof e?.message?e.message:"string"==typeof e?e:"";return!(n.includes("Too many requests")||i.includes(e?.response?.status)||t.includes(e?.statusCode)||t.includes(e?.status)||e?.timeout||"Timeout exceeded"===n)&&"Aborted"!==n&&e?.name!=="AbortError"})(e,{nonRetryableStatusCodes:tk})}}),new(tb())(3e4),r?tm.C.split(({query:e})=>{let{kind:i,operation:t}=(0,tI.Vn)(e);return"OperationDefinition"===i&&"subscription"===t},p,m):m].filter(Boolean));return _.closeSubscriptionClient=()=>r&&l.dispose(),_}({endpointURL:u,subscriptionEndpointURL:u.replace(/^http/,"ws"),accessToken:i,enableSubscription:!p&&a,enableRetry:o,subscriptionOnConnectionOrError:r,onNetworkError:s}),c=new eo.D,(l=new ea.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=$,i.mutations=v;let t={boxId:e.boxId,passcode:e.passcode};Object.entries($).forEach(tl(i,"query",t)),Object.entries(v).forEach(tl(i,"mutation",t)),i.listenBoxChanged=(e,n)=>i.subscribe({query:t0,variables:{...t,...e}}).subscribe({next:t1(n),error(e){n(e)}})}else i.accessToken=e.accessToken,i.type="token",i.queries=f,i.mutations=y,Object.entries(f).forEach(tl(i,"query")),Object.entries(y).forEach(tl(i,"mutation")),i.listenBoxChanged=(e,t)=>i.subscribe({query:tG,variables:e}).subscribe({next:t1(t),error(e){t(e)}});return i})({endpoint:i,accessToken:t,enableSubscription:!1,enableRetry:!0})}({endpoint:t7.media,accessToken:i.token}):s,c=e=>a?{fileId:e}:{id:e},l=e=>a?{list:e}:{fileIds:e},p=e=>e.toUpperCase(),u=e=>e?.map(p);if(a&&e.tool("list_workspaces","List all workspaces",{},h(function*(){return X((yield s.workspaces()))})),o({name:"get_workspace_overview",description:"Get comprehensive overview of the BRICKS workspace including stats and summary",inputSchema:r({}),permission:"info"},(m=h(function*({workspace_id:e}){var i=T((yield Promise.all([s.workspace({id:e}),s.applications({workspaceId:e,paginate:{limit:50,offset:0}}),s.modules({workspaceId:e,paginate:{limit:50,offset:0}}),s.devices({workspaceId:e,paginate:{limit:50,offset:0}}),a?d.mediaWorkspace({workspaceId:e}).catch(()=>null):d.mediaWorkspace().catch(()=>null),a?d.mediaBoxes({workspaceId:e}).catch(()=>[]):d.mediaBoxes().catch(()=>[])])),6),t=i[0],n=i[1],o=i[2],r=i[3],c=i[4],l=i[5];if(!t)throw Error("Authentication failed, please check your token");return X({workspace:t,stats:{applications:n?.length??"No permission",modules:o?.length??"No permission",devices:r?.length??"No permission",running_apps:n?.filter(e=>e.status?.running).length??"No permission",media_boxes:l?.length??"No permission",media_enabled:!!c,notes:"Note: The stats are based on the first 50 applications, modules, and devices in the workspace."},recent_activity:{latest_apps:n?.slice(0,5).map(e=>({id:e._id,name:e.name,status:e.status?.running?"running":"stopped",last_update:e.last_modify_datetime}))||[]},media_info:c?{workspace_id:c.id,name:c.name,size_used:c.size,size_limit:c.sizeLimit,boxes:l?.slice(0,5).map(e=>({id:e.id,name:e.name,size:e.size,description:e.description}))||[]}:{enabled:!1,note:"Media workspace is not enabled for this workspace"}})}),function(e){return m.apply(this,arguments)})),o({name:"get_applications",description:"List all applications in the workspace",inputSchema:r({limit:w.ai().describe("Maximum number of applications to return").optional().default(50),offset:w.ai().describe("Number of applications to skip").optional().default(0)}),permission:"query_application"},(_=h(function*({workspace_id:e,limit:i=50,offset:t=0}){return X((yield s.applications({workspaceId:e,paginate:{limit:i,offset:t}})))}),function(e){return _.apply(this,arguments)})),o({name:"get_application",description:"Get detailed info and config of a specific application",inputSchema:r({id:w.Yj().describe("Application ID")}),permission:"query_application"},(g=h(function*({workspace_id:e,id:i}){return X((yield s.application({workspaceId:e,id:i})))}),function(e){return g.apply(this,arguments)})),o({name:"get_modules",description:"List all modules in the workspace",inputSchema:r({limit:w.ai().describe("Maximum number of modules to return").optional().default(50),offset:w.ai().describe("Number of modules to skip").optional().default(0)}),permission:"query_module"},(b=h(function*({workspace_id:e,limit:i=50,offset:t=0}){return X((yield s.modules({workspaceId:e,paginate:{limit:i,offset:t}})))}),function(e){return b.apply(this,arguments)})),o({name:"get_module",description:"Get detailed info and config of a specific module",inputSchema:r({id:w.Yj().describe("Module ID")}),permission:"query_module"},(I=h(function*({workspace_id:e,id:i}){return X((yield s.module({workspaceId:e,id:i})))}),function(e){return I.apply(this,arguments)})),o({name:"update_module_info",description:"Update a specific module info",inputSchema:r({id:w.Yj().describe("Module ID"),name:w.Yj().describe("Module name"),description:w.Yj().describe("Module description")}),permission:"update_module"},(k=h(function*({workspace_id:e,id:i,name:t,description:n}){return X((yield s.updateModule({workspaceId:e,id:i,name:t,description:n})))}),function(e){return k.apply(this,arguments)})),o({name:"update_module_config",description:"Update a specific module configuration",inputSchema:r({id:w.Yj().describe("Module ID"),config:w.Ik({}).passthrough().describe("New configuration object, see file://docs/config-schema.md for schema reference")}),permission:"update_module"},(D=h(function*({workspace_id:e,id:i,config:t}){var n=yield W(t);if(!n.valid)throw Error(`Config validation failed: ${n.errors.join(", ")}`);return X((yield s.updateModule({workspaceId:e,id:i,config:JSON.stringify(t),validateConfig:!0})))}),function(e){return D.apply(this,arguments)})),o({name:"get_devices",description:"List all devices in the workspace",inputSchema:r({limit:w.ai().describe("Maximum number of devices to return").optional().default(50),offset:w.ai().describe("Number of devices to skip").optional().default(0)}),permission:"query_device"},(A=h(function*({workspace_id:e,limit:i=50,offset:t=0}){return X((yield s.devices({workspaceId:e,paginate:{limit:i,offset:t}})))}),function(e){return A.apply(this,arguments)})),o({name:"create_application",description:"Create a new BRICKS application with default grid layout",inputSchema:r({name:w.Yj().describe("Application name"),description:w.Yj().describe("Application description").optional(),grid_width:w.ai().describe("Grid width in units").optional().default(96),grid_height:w.ai().describe("Grid height in units").optional().default(54)}),permission:"create_application"},(S=h(function*({workspace_id:e,name:i,description:t,grid_width:n,grid_height:a}){return X((yield s.createApplication({workspaceId:e,name:i,description:t,gridWidth:n,gridHeight:a})))}),function(e){return S.apply(this,arguments)})),o({name:"update_application_info",description:"Update application info",inputSchema:{id:w.Yj().describe("Application ID"),name:w.Yj().describe("Application name"),description:w.Yj().describe("Application description")},permission:"update_application"},(C=h(function*({id:e,name:i,description:t}){return X((yield s.updateApplication({id:e,name:i,description:t})))}),function(e){return C.apply(this,arguments)})),o({name:"update_application_config",description:"Update application configuration with validation",inputSchema:{id:w.Yj().describe("Application ID"),config:w.Ik({}).passthrough().describe("New application configuration. Please read `getting-started` for BRICKS concepts before changing")},permission:"update_application"},(R=h(function*({id:e,config:i}){var t=yield W(i);if(!t.valid)throw Error(`Config validation failed: ${t.errors.join(", ")}`);return X((yield s.updateApplication({id:e,config:JSON.stringify(i),validateConfig:!0})))}),function(e){return R.apply(this,arguments)})),o({name:"bind_application",description:"Bind application to device with viewport configuration",inputSchema:{app_id:w.Yj().describe("Application ID"),viewports:w.YO(w.Ik({device_id:w.Yj().describe("Device ID"),x:w.ai().describe("X coordinate"),y:w.ai().describe("Y coordinate"),width:w.ai().describe("Width"),height:w.ai().describe("Height"),rotate:w.ai().describe("Rotation"),rotateType:w.Yj().describe("Rotation type")})).describe("Viewport configuration")},permission:"bind_application"},(M=h(function*({app_id:e,viewports:i}){return X((yield s.bindApplication({id:e,bindDevices:i.map(e=>e.device_id),deviceFrames:i.reduce((e,i)=>({...e,[i.device_id]:{x:i.x,y:i.y,width:i.width,height:i.height,rotate:i.rotate,rotateType:i.rotateType}}),{})})))}),function(e){return M.apply(this,arguments)})),o({name:"unbind_application",description:"Unbind application from device",inputSchema:{app_id:w.Yj().describe("Application ID"),device_id:w.Yj().describe("Device ID")},permission:"bind_application"},(O=h(function*({app_id:e,device_id:i}){return X((yield s.bindApplication({id:e,unbindDevices:[i]})))}),function(e){return O.apply(this,arguments)})),a&&o({name:"list_media_workspaces",description:"List all media workspaces",inputSchema:{},permission:"query_media_flow"},h(function*(){return X((yield d.mediaWorkspaces()))})),o({name:"get_media_workspace",description:"Get media workspace information and status",inputSchema:r({}),permission:"query_media_flow"},(P=h(function*({workspace_id:e}){return X((yield d.mediaWorkspace({workspaceId:e})))}),function(e){return P.apply(this,arguments)})),o({name:"list_media_boxes",description:"List all media boxes in the workspace",inputSchema:r({}),permission:"query_media_flow"},(F=h(function*({workspace_id:e}){return X((yield d.mediaBoxes({workspaceId:e})))}),function(e){return F.apply(this,arguments)})),o({name:"get_media_box",description:"Get detailed information about a specific media box",inputSchema:{box_id:w.Yj().describe("Media box ID")},permission:"query_media_flow"},(N=h(function*({box_id:e}){return X((yield d.mediaBox({boxId:e})))}),function(e){return N.apply(this,arguments)})),o({name:"list_media_files",description:"List media files in a specific box with filtering options",inputSchema:{box_id:w.Yj().describe("Media box ID"),include_types:w.YO(w.Yj()).optional().describe('Filter by file types (e.g., ["image", "video", "audio"])'),user_tags:w.YO(w.Yj()).optional().describe("Filter by user tags"),limit:w.ai().optional().default(50).describe("Maximum number of files to return"),offset:w.ai().optional().default(0).describe("Number of files to skip")},permission:"query_media_flow"},(q=h(function*({box_id:e,include_types:i,user_tags:t,limit:n,offset:a}){return X((yield d.mediaFiles({boxId:e,includeTypes:u(i),userTags:t,limit:n,offset:a})))}),function(e){return q.apply(this,arguments)})),o({name:"get_media_file_meta",description:"Get detailed information about a specific media file",inputSchema:{file_id:w.Yj().describe("Media file ID")},permission:"query_media_flow"},(j=h(function*({file_id:e}){return X((yield d.mediaFile(c(e))))}),function(e){return j.apply(this,arguments)})),o({name:"media_box_upload",description:"Upload a file to a media box from URL or base64 data",inputSchema:{box_id:w.Yj().describe("Target media box ID"),name:w.Yj().describe("File name"),description:w.Yj().optional().default("").describe("File description"),file_type:w.k5(["image","video","audio","file"]).describe("File type"),source_url:w.Yj().optional().describe("URL to download the file from (maximum 100 MiB)"),base64_data:w.Yj().optional().describe("Base64 encoded file data"),user_tags:w.YO(w.Yj()).optional().default([]).describe("User-defined tags for the file")},permission:"write_media_flow"},(V=h(function*({box_id:e,name:i,description:t,source_url:n,base64_data:a,file_type:o,user_tags:r}){if(!n&&!a)throw Error("Either source_url or base64_data must be provided");if(n&&a)throw Error("Provide either source_url OR base64_data, not both");var s,c="application/octet-stream";if(n){var l=yield nt(n,(0,B.fJ)(n));s=l.data,c=l.contentType}else s=new Blob([x.Buffer.from(a,"base64")],{type:c});var u=yield d.requestFileUpload({name:i,description:t,boxId:e,fileType:p(o),contentType:c,userTags:r,meta:{}}),m=!1;try{var _=JSON.parse(u?.meta.uploadInfo),g=new FormData;g.append("file",s),g.append("Content-Type",c),g.append("AWSAccessKeyId",_.AWSAccessKeyId),g.append("Signature",_.Signature),g.append("Policy",_.Policy),g.append("acl",_.acl),g.append("key",_.key),m=yield(0,E.Ay)(_.url,{method:"POST",body:g}).then(e=>e.ok).catch(()=>!1)}catch{m=!1}return X({file_id:u.id,upload_success:m,upload_info:{content_type:c,file_type:o,source_type:n?"url":"base64",processing_note:"File will be processed automatically. Use get_media_file to check processing status."}})}),function(e){return V.apply(this,arguments)})),o({name:"update_media_file_meta",description:"Update media file information",inputSchema:{file_id:w.Yj().describe("Media file ID"),name:w.Yj().optional().describe("New file name"),description:w.Yj().optional().describe("New file description"),user_tags:w.YO(w.Yj()).optional().describe("New user tags")},permission:"write_media_flow"},(Y=h(function*({file_id:e,name:i,description:t,user_tags:n}){return X((yield d.updateMediaFile({...c(e),name:i,description:t,userTags:n,requestUploadAgain:!1})))}),function(e){return Y.apply(this,arguments)})),o({name:"copy_media_files",description:"Copy media files from one box to another",inputSchema:{from_box_id:w.Yj().describe("Source media box ID"),to_box_id:w.Yj().describe("Target media box ID"),file_ids:w.YO(w.Yj()).describe("Array of media file IDs to copy")},permission:"write_media_flow"},(K=h(function*({from_box_id:e,to_box_id:i,file_ids:t}){return X((yield d.copyMediaFiles({fromBoxId:e,toBoxId:i,...l(t)})))}),function(e){return K.apply(this,arguments)})),o({name:"delete_media_files",description:"Delete specific media files from a box",inputSchema:{box_id:w.Yj().describe("Media box ID"),file_ids:w.YO(w.Yj()).describe("Array of media file IDs to delete")},permission:"write_media_flow"},(G=h(function*({box_id:e,file_ids:i}){return X((yield d.deleteMediaFiles({boxId:e,...l(i)})))}),function(e){return G.apply(this,arguments)})),o({name:"cleanup_media_box",description:"Delete all files in a media box, optionally filtered by type",inputSchema:{box_id:w.Yj().describe("Media box ID"),include_types:w.YO(w.Yj()).optional().describe('Only delete files of these types (e.g., ["image", "video"])')},permission:"write_media_flow"},(L=h(function*({box_id:e,include_types:i}){var t=u(i);if("deleteMediaBoxFiles"in d)return X((yield d.deleteMediaBoxFiles({boxId:e,includeTypes:t})));var n=yield d.mediaFiles({boxId:e,includeTypes:t});return X((yield d.deleteMediaFiles({boxId:e,list:n.map(e=>e.id)})))}),function(e){return L.apply(this,arguments)})),e.tool("calculate_grid_layout","Calculate grid layout and pixel conversions for different device resolutions",{device_width:w.ai().describe("Device width in pixels"),device_height:w.ai().describe("Device height in pixels"),app_grid_width:w.ai().describe("Application grid width").optional().default(96),app_grid_height:w.ai().describe("Application grid height").optional().default(54)},(z=h(function*({device_width:e,device_height:i,app_grid_width:t,app_grid_height:n}){var a=(0,U.k)(t,e,i),o=(0,U.Y)(e,i,t);return X({device_resolution:{width:e,height:i,aspect_ratio:(e/i).toFixed(2)},current_grid:{width:t,height:n,unit_size_px:a.deviceBrickUnit.toFixed(2),total_pixels:{width:a.deviceBrickWidth.toFixed(2),height:a.deviceBrickHeight.toFixed(2)}},recommended_grid:{width:o.deviceBrickWidth,height:o.deviceBrickHeight,unit_size_px:o.deviceBrickUnit.toFixed(2),note:"Optimized for device aspect ratio"}})}),function(e){return z.apply(this,arguments)})),e.tool("create_item","Use this tool to create new item that you can put in application configuration",{type:w.k5(["subspace","canvas","brick","generator","property_bank","property_bank_calc","property_bank_command","animation","state_group","automation_map"]).describe("Item type"),title:w.Yj().describe("Item title"),template_key:w.Yj().optional().describe("Template key for brick or generator")},ni),e.tool("getting_started","Get documentation content for getting started",{},h(function*(){return X(J)})),!a){var m,_,g,b,I,k,D,A,S,C,R,M,O,P,F,N,q,j,V,Y,K,G,L,z,H,Q,Z,ee=()=>new t2(t,i.auth||i.token);o({name:"activity_log_events",description:"Query activity log events. Returns raw events (general, data, local_sync) with filtering. Max 30-day range.",inputSchema:r({start_time:w.Yj().describe("Start time (ISO 8601)"),end_time:w.Yj().describe("End time (ISO 8601)"),device_id:w.Yj().optional().describe("Filter by device ID"),event_type:w.k5(["general","data","local_sync"]).optional().describe("Filter by event type"),event_name:w.Yj().optional().describe("Filter by event name (e.g. BRICK_xxx_ON_PRESS)"),subspace_id:w.Yj().optional().describe("Filter by subspace ID"),sender:w.Yj().optional().describe("Filter by sender"),limit:w.ai().optional().default(50).describe("Max events to return per page"),offset:w.ai().optional().default(0).describe("Number of events to skip (for pagination)")}),permission:"query_activity_log"},(H=h(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=ee(),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),X((yield c.events(l,{limit:s,offset:d})))}),function(e){return H.apply(this,arguments)})),o({name:"activity_log_screenshots",description:"List available screenshot timestamps for a device in a time range.",inputSchema:r({device_id:w.Yj().describe("Device ID (required)"),start_time:w.Yj().describe("Start time (ISO 8601)"),end_time:w.Yj().describe("End time (ISO 8601)")}),permission:"query_activity_log"},(Q=h(function*({device_id:e,start_time:i,end_time:t}){var n=ee();return X((yield n.screenshots({device_id:e,start_time:i,end_time:t})))}),function(e){return Q.apply(this,arguments)})),o({name:"activity_log_screenshot",description:"Download a device screenshot at a specific timestamp. Returns a base64-encoded JPEG image.",inputSchema:r({device_id:w.Yj().describe("Device ID"),ts:w.Yj().describe("Screenshot timestamp (ISO 8601 or epoch ms)")}),permission:"query_activity_log"},(Z=h(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=ee(),r=/^\d+$/.test(n)?n:new Date(n).getTime();return X((yield o.downloadScreenshot(a,t,r)),{mimeType:"image/jpeg"})}),function(e){return Z.apply(this,arguments)}))}o({name:"get_device_usage",description:"Get device usage metrics (uptime, memory, disk) for a date range. Data from BRICKS main server.",inputSchema:r({device_id:w.Yj().describe("Device ID"),start_date:w.Yj().optional().describe("Start date/time in ISO 8601 format (default: start of today)"),end_date:w.Yj().optional().describe("End date/time in ISO 8601 format (default: now)")}),permission:"query_device"},(n=h(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 X((yield s.deviceUsage({deviceId:e,startDate:i?new Date(i).toISOString():a,endDate:t?new Date(t).toISOString():n.toISOString()})))}),function(e){return n.apply(this,arguments)}))}(p,t,{activityLogBaseUrl:a});var m=new I.S;try{yield p.connect(m),console.error("BRICKS MCP Server running on STDIO"),console.error(`Server: ${t8} v${nn}`),console.error(`Token Type: ${t.tokenType}${s?" (oauth)":""}`),console.error(`Permissions: ${t.tokenInfo.permissions.join(", ")}`),console.error("Ready to accept requests...")}catch(e){throw console.error("Failed to start MCP server:",e),e}})).apply(this,arguments)}}};
|