@fugood/bricks-cli 2.25.5-beta.2 → 2.26.0-beta.0
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 +5 -0
- package/lib/1708.js +1 -1
- package/lib/2486.js +1 -1
- package/lib/6818.js +1 -1
- package/lib/7233.js +7 -7
- package/lib/907.js +51 -31
- package/lib/index.js +35 -35
- package/lib/lib.js +55 -35
- package/package.json +6 -6
package/lib/907.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export const __rspack_esm_id=907;export const __rspack_esm_ids=[907];export const __webpack_modules__={85382(e,i,t){t.r(i),t.d(i,{BricksClient:()=>b,BricksPublicClient:()=>I,createClient:()=>S,createFetchForUrl:()=>g.P,createPublicClient:()=>k});var a,n,o,
|
|
1
|
+
export const __rspack_esm_id=907;export const __rspack_esm_ids=[907];export const __webpack_modules__={85382(e,i,t){t.r(i),t.d(i,{BricksClient:()=>b,BricksPublicClient:()=>I,createClient:()=>S,createFetchForUrl:()=>g.P,createPublicClient:()=>k});var a,n,r,o,s=t(99436),d=t(5018),l=t(44668),c=t(54506),u=t(78549),p=t(94370),m=t(43741),$=t(89293),g=t(75149),_=c.ApolloClient,v=c.InMemoryCache,h=c.HttpLink,y=u.o,f={query:"query",mutation:"mutate"},I=l(function e(i){d(this,e),this.baseUrl=i,this.endpoint="/api/graphql-nonauth";var t=new h({uri:`${i}${this.endpoint}`,fetch:(0,g.P)(i)});this.apolloClient=new _({link:t,cache:new v,defaultOptions:{query:{errorPolicy:"all",fetchPolicy:"no-cache"}}})},[{key:"checkWorkspaceOTP",value:(a=s(function*(e){var i=(0,p.default)`
|
|
2
2
|
query checkWorkspaceOTP($passcode: String!) {
|
|
3
3
|
checkWorkspaceOTP(passcode: $passcode)
|
|
4
4
|
}
|
|
@@ -12,7 +12,7 @@ export const __rspack_esm_id=907;export const __rspack_esm_ids=[907];export cons
|
|
|
12
12
|
}
|
|
13
13
|
`,t=yield this.apolloClient.mutate({mutation:i,variables:{passcode:e}}),a=t.data,n=t.errors;if(n?.length>0)throw Error(n.map(({message:e})=>e).join("\n"));return a.exchangeWorkspaceOTP}),function(e){return n.apply(this,arguments)})}]),k=e=>new I(e),A="Note: OAuth workspace access is awaiting the next production server release. Until then, use workspace auth (passcode or token; CLI: `bricks auth login-workspace`).",C=(e,i)=>{if(i?.kind!=="oauth")return e;var t=e?.message||String(e);if(!(403===(e?.statusCode||e?.networkError?.statusCode||e?.cause?.statusCode)||/\b403\b|invalid algorithm/i.test(t))||t.includes(A))return e;var a=Error(`${t}
|
|
14
14
|
|
|
15
|
-
${A}`);return a.cause=e,a},b=l(function e(i,t){var a,n=this;d(this,e),this.baseUrl=i,this.auth=(e=>{if(!e)return null;if("string"==typeof e){var i;return{kind:"token",token:e,getHeaders:(i=s(function*(){return{authorization:`Bearer ${e}`}}),function(){return i.apply(this,arguments)})}}return e})(t),this.token=this.auth?.token,this.endpoint="/api/graphql-workspace";var
|
|
15
|
+
${A}`);return a.cause=e,a},b=l(function e(i,t){var a,n=this;d(this,e),this.baseUrl=i,this.auth=(e=>{if(!e)return null;if("string"==typeof e){var i;return{kind:"token",token:e,getHeaders:(i=s(function*(){return{authorization:`Bearer ${e}`}}),function(){return i.apply(this,arguments)})}}return e})(t),this.token=this.auth?.token,this.endpoint="/api/graphql-workspace";var r=new h({uri:`${i}${this.endpoint}`,fetch:(0,g.P)(i)}),o=y((a=s(function*(e,{headers:i}){return{headers:{...i,...n.auth?yield n.auth.getHeaders():{}}}}),function(e,i){return a.apply(this,arguments)}));this.apolloClient=new _({link:o.concat(r),cache:new v,defaultOptions:{watchQuery:{errorPolicy:"all",fetchPolicy:"no-cache"},query:{errorPolicy:"all",fetchPolicy:"no-cache"}}}),this.queries=m,this.mutations=$,this.generateMethods()},[{key:"generateMethods",value:function(){var e=this,i=i=>([t,a])=>{if(!this[t]){var n,r=(n=s(function*(n,r){try{var o=e.apolloClient[f[i]].bind(e.apolloClient),s=yield o({[i]:a,variables:n,...r}),d=s.data,l=s.errors;if(l)throw Error(l.map(({message:e})=>e).join("\n"));return d[t]}catch(e){if(e.cause?.result?.errors)throw Error(e.cause.result.errors.map(({message:e})=>e).join("\n"));throw e}}),function(e,i){return n.apply(this,arguments)});this[t]=s(function*(i={},t={}){try{return yield r(i,t)}catch(a){if(e.auth?.kind==="oauth"&&e.auth.refresh&&/401|unauthoriz|jwt expired|token.*expired|invalid.*token/i.test(a?.message||"")){yield e.auth.refresh();try{return yield r(i,t)}catch(i){throw C(i,e.auth)}}throw C(a,e.auth)}})}};Object.entries(this.queries).forEach(i("query")),Object.entries(this.mutations).forEach(i("mutation"))}},{key:"query",value:(r=s(function*(e,i={}){var t=yield this.apolloClient.query({query:e,variables:i,fetchPolicy:"no-cache"}),a=t.data,n=t.errors;if(n?.length>0)throw Error(n.map(({message:e})=>e).join("\n"));return a}),function(e){return r.apply(this,arguments)})},{key:"mutate",value:(o=s(function*(e,i={}){var t=yield this.apolloClient.mutate({mutation:e,variables:i}),a=t.data,n=t.errors;if(n?.length>0)throw Error(n.map(({message:e})=>e).join("\n"));return a}),function(e){return o.apply(this,arguments)})}]),S=(e,i)=>new b(e,i)},75149(e,i,t){t.d(i,{P:()=>r});var a=t(79657),n=t(64007);function r(e){var i=process.env.HTTPS_PROXY||process.env.https_proxy;if(!i||!e.startsWith("https://"))return a.Ay;var t=new n(i);return(e,i={})=>(0,a.Ay)(e,{...i,agent:t})}},48596(e,i,t){t.d(i,{$7:()=>c,$V:()=>u,F3:()=>r,J6:()=>p,NJ:()=>s,VZ:()=>o,Yi:()=>n,lI:()=>l,mJ:()=>d});var a=t(94370),n=(0,a.default)`
|
|
16
16
|
fragment cliWorkspaceArguments on Workspace {
|
|
17
17
|
_id
|
|
18
18
|
name
|
|
@@ -38,7 +38,7 @@ ${A}`);return a.cause=e,a},b=l(function e(i,t){var a,n=this;d(this,e),this.baseU
|
|
|
38
38
|
}
|
|
39
39
|
}
|
|
40
40
|
}
|
|
41
|
-
`,
|
|
41
|
+
`,r=(0,a.default)`
|
|
42
42
|
fragment cliDeviceArguments on Device {
|
|
43
43
|
_id
|
|
44
44
|
name
|
|
@@ -124,7 +124,7 @@ ${A}`);return a.cause=e,a},b=l(function e(i,t){var a,n=this;d(this,e),this.baseU
|
|
|
124
124
|
create_datetime
|
|
125
125
|
last_modify_datetime
|
|
126
126
|
}
|
|
127
|
-
`,
|
|
127
|
+
`,o=(0,a.default)`
|
|
128
128
|
fragment cliDevicePanelArguments on Device {
|
|
129
129
|
_id
|
|
130
130
|
name
|
|
@@ -268,14 +268,14 @@ ${A}`);return a.cause=e,a},b=l(function e(i,t){var a,n=this;d(this,e),this.baseU
|
|
|
268
268
|
description
|
|
269
269
|
current_version
|
|
270
270
|
}
|
|
271
|
-
`},89293(e,i,t){t.r(i),t.d(i,{bindApplication:()
|
|
271
|
+
`},89293(e,i,t){t.r(i),t.d(i,{bindApplication:()=>_,bindButtressServer:()=>S,controlDevice:()=>o,createApplication:()=>u,createApplicationWithShareVersion:()=>p,createDevice:()=>r,createMediaFileUploadRequest:()=>C,createModule:()=>h,createVirtualDevice:()=>s,dispatchDeviceGroupAction:()=>c,issueButtressAccessToken:()=>w,issueDevtoolsAccessToken:()=>L,releaseApplication:()=>A,releaseModule:()=>b,removeApplication:()=>$,removeDevice:()=>l,removeModule:()=>f,shortEditApplication:()=>g,shortEditModule:()=>I,triggerApplicationCanvasControl:()=>v,unbindButtressServer:()=>D,updateApplication:()=>m,updateModule:()=>y,updateVirtualDevice:()=>d,updateWorkspace:()=>k});var a=t(94370),n=t(48596),r=(0,a.default)`
|
|
272
272
|
mutation CLI_createDevice($bindPasscode: String, $name: String, $deviceName: String) {
|
|
273
273
|
createDevice(bindPasscode: $bindPasscode, name: $name, deviceName: $deviceName) {
|
|
274
274
|
...cliDeviceArguments
|
|
275
275
|
}
|
|
276
276
|
}
|
|
277
277
|
${n.F3}
|
|
278
|
-
`,
|
|
278
|
+
`,o=(0,a.default)`
|
|
279
279
|
mutation CLI_controlDevice($id: ID!, $type: String!, $eventPayload: JSON) {
|
|
280
280
|
controlDevice(id: $id, type: $type, eventPayload: $eventPayload) {
|
|
281
281
|
_id
|
|
@@ -283,17 +283,37 @@ ${A}`);return a.cause=e,a},b=l(function e(i,t){var a,n=this;d(this,e),this.baseU
|
|
|
283
283
|
}
|
|
284
284
|
}
|
|
285
285
|
`,s=(0,a.default)`
|
|
286
|
+
mutation CLI_createVirtualDevice($name: String, $deviceName: String) {
|
|
287
|
+
createVirtualDevice(name: $name, deviceName: $deviceName) {
|
|
288
|
+
...cliDeviceArguments
|
|
289
|
+
}
|
|
290
|
+
}
|
|
291
|
+
${n.F3}
|
|
292
|
+
`,d=(0,a.default)`
|
|
293
|
+
mutation CLI_updateVirtualDevice($id: ID!, $tokens: [DeviceTokenInput], $revokeTokens: [ID!]) {
|
|
294
|
+
updateVirtualDevice(id: $id, tokens: $tokens, revokeTokens: $revokeTokens) {
|
|
295
|
+
device {
|
|
296
|
+
...cliDeviceArguments
|
|
297
|
+
}
|
|
298
|
+
newTokens {
|
|
299
|
+
name
|
|
300
|
+
token
|
|
301
|
+
}
|
|
302
|
+
}
|
|
303
|
+
}
|
|
304
|
+
${n.F3}
|
|
305
|
+
`,l=(0,a.default)`
|
|
286
306
|
mutation CLI_removeDevice($id: ID!) {
|
|
287
307
|
removeDevice(id: $id)
|
|
288
308
|
}
|
|
289
|
-
`,
|
|
309
|
+
`,c=(0,a.default)`
|
|
290
310
|
mutation CLI_dispatchDeviceGroupAction($id: ID!, $action: String!) {
|
|
291
311
|
dispatchDeviceGroupAction(id: $id, action: $action) {
|
|
292
312
|
dispatched
|
|
293
313
|
devices
|
|
294
314
|
}
|
|
295
315
|
}
|
|
296
|
-
`,
|
|
316
|
+
`,u=(0,a.default)`
|
|
297
317
|
mutation CLI_createApplication(
|
|
298
318
|
$name: String
|
|
299
319
|
$description: String
|
|
@@ -310,7 +330,7 @@ ${A}`);return a.cause=e,a},b=l(function e(i,t){var a,n=this;d(this,e),this.baseU
|
|
|
310
330
|
}
|
|
311
331
|
}
|
|
312
332
|
${n.$7}
|
|
313
|
-
`,
|
|
333
|
+
`,p=(0,a.default)`
|
|
314
334
|
mutation CLI_createApplicationWithShareVersion(
|
|
315
335
|
$name: String
|
|
316
336
|
$description: String
|
|
@@ -327,7 +347,7 @@ ${A}`);return a.cause=e,a},b=l(function e(i,t){var a,n=this;d(this,e),this.baseU
|
|
|
327
347
|
}
|
|
328
348
|
}
|
|
329
349
|
${n.$7}
|
|
330
|
-
`,
|
|
350
|
+
`,m=(0,a.default)`
|
|
331
351
|
mutation CLI_updateApplication(
|
|
332
352
|
$id: ID!
|
|
333
353
|
$config: String
|
|
@@ -350,11 +370,11 @@ ${A}`);return a.cause=e,a},b=l(function e(i,t){var a,n=this;d(this,e),this.baseU
|
|
|
350
370
|
}
|
|
351
371
|
}
|
|
352
372
|
${n.$7}
|
|
353
|
-
|
|
373
|
+
`,$=(0,a.default)`
|
|
354
374
|
mutation CLI_removeApplication($id: ID!) {
|
|
355
375
|
removeApplication(id: $id)
|
|
356
376
|
}
|
|
357
|
-
`,
|
|
377
|
+
`,g=(0,a.default)`
|
|
358
378
|
mutation CLI_shortEditApplication(
|
|
359
379
|
$id: ID!
|
|
360
380
|
$list: [ShortEditInput]!
|
|
@@ -366,7 +386,7 @@ ${A}`);return a.cause=e,a},b=l(function e(i,t){var a,n=this;d(this,e),this.baseU
|
|
|
366
386
|
}
|
|
367
387
|
}
|
|
368
388
|
${n.$7}
|
|
369
|
-
|
|
389
|
+
`,_=(0,a.default)`
|
|
370
390
|
mutation CLI_bindApplication(
|
|
371
391
|
$id: ID!
|
|
372
392
|
$bindDevices: [ID]
|
|
@@ -387,7 +407,7 @@ ${A}`);return a.cause=e,a},b=l(function e(i,t){var a,n=this;d(this,e),this.baseU
|
|
|
387
407
|
}
|
|
388
408
|
}
|
|
389
409
|
}
|
|
390
|
-
`,
|
|
410
|
+
`,v=(0,a.default)`
|
|
391
411
|
mutation CLI_triggerApplicationCanvasControl(
|
|
392
412
|
$id: ID!
|
|
393
413
|
$testId: String!
|
|
@@ -405,7 +425,7 @@ ${A}`);return a.cause=e,a},b=l(function e(i,t){var a,n=this;d(this,e),this.baseU
|
|
|
405
425
|
_id
|
|
406
426
|
}
|
|
407
427
|
}
|
|
408
|
-
`,
|
|
428
|
+
`,h=(0,a.default)`
|
|
409
429
|
mutation CLI_createModule(
|
|
410
430
|
$name: String
|
|
411
431
|
$description: String
|
|
@@ -430,7 +450,7 @@ ${A}`);return a.cause=e,a},b=l(function e(i,t){var a,n=this;d(this,e),this.baseU
|
|
|
430
450
|
}
|
|
431
451
|
}
|
|
432
452
|
${n.$V}
|
|
433
|
-
`,
|
|
453
|
+
`,y=(0,a.default)`
|
|
434
454
|
mutation CLI_updateModule(
|
|
435
455
|
$id: ID!
|
|
436
456
|
$config: String
|
|
@@ -451,11 +471,11 @@ ${A}`);return a.cause=e,a},b=l(function e(i,t){var a,n=this;d(this,e),this.baseU
|
|
|
451
471
|
}
|
|
452
472
|
}
|
|
453
473
|
${n.$V}
|
|
454
|
-
`,
|
|
474
|
+
`,f=(0,a.default)`
|
|
455
475
|
mutation CLI_removeModule($id: ID!) {
|
|
456
476
|
removeModule(id: $id)
|
|
457
477
|
}
|
|
458
|
-
`,
|
|
478
|
+
`,I=(0,a.default)`
|
|
459
479
|
mutation CLI_shortEditModule(
|
|
460
480
|
$id: ID!
|
|
461
481
|
$list: [ShortEditInput]!
|
|
@@ -467,7 +487,7 @@ ${A}`);return a.cause=e,a},b=l(function e(i,t){var a,n=this;d(this,e),this.baseU
|
|
|
467
487
|
name
|
|
468
488
|
}
|
|
469
489
|
}
|
|
470
|
-
`,
|
|
490
|
+
`,k=(0,a.default)`
|
|
471
491
|
mutation CLI_updateWorkspace(
|
|
472
492
|
$name: String
|
|
473
493
|
$description: String
|
|
@@ -491,7 +511,7 @@ ${A}`);return a.cause=e,a},b=l(function e(i,t){var a,n=this;d(this,e),this.baseU
|
|
|
491
511
|
}
|
|
492
512
|
}
|
|
493
513
|
}
|
|
494
|
-
`,
|
|
514
|
+
`,A=(0,a.default)`
|
|
495
515
|
mutation CLI_releaseApplication(
|
|
496
516
|
$id: ID!
|
|
497
517
|
$config: String
|
|
@@ -510,7 +530,7 @@ ${A}`);return a.cause=e,a},b=l(function e(i,t){var a,n=this;d(this,e),this.baseU
|
|
|
510
530
|
name
|
|
511
531
|
}
|
|
512
532
|
}
|
|
513
|
-
`,
|
|
533
|
+
`,C=(0,a.default)`
|
|
514
534
|
mutation CLI_createMediaFileUploadRequest(
|
|
515
535
|
$name: String!
|
|
516
536
|
$description: String!
|
|
@@ -537,7 +557,7 @@ ${A}`);return a.cause=e,a},b=l(function e(i,t){var a,n=this;d(this,e),this.baseU
|
|
|
537
557
|
}
|
|
538
558
|
}
|
|
539
559
|
}
|
|
540
|
-
`,
|
|
560
|
+
`,b=(0,a.default)`
|
|
541
561
|
mutation CLI_releaseModule(
|
|
542
562
|
$id: ID!
|
|
543
563
|
$config: String
|
|
@@ -557,7 +577,7 @@ ${A}`);return a.cause=e,a},b=l(function e(i,t){var a,n=this;d(this,e),this.baseU
|
|
|
557
577
|
name
|
|
558
578
|
}
|
|
559
579
|
}
|
|
560
|
-
`,
|
|
580
|
+
`,S=(0,a.default)`
|
|
561
581
|
mutation CLI_bindButtressServer(
|
|
562
582
|
$serverId: String!
|
|
563
583
|
$name: String
|
|
@@ -573,11 +593,11 @@ ${A}`);return a.cause=e,a},b=l(function e(i,t){var a,n=this;d(this,e),this.baseU
|
|
|
573
593
|
}
|
|
574
594
|
}
|
|
575
595
|
}
|
|
576
|
-
`,
|
|
596
|
+
`,D=(0,a.default)`
|
|
577
597
|
mutation CLI_unbindButtressServer($serverId: String!) {
|
|
578
598
|
unbindButtressServer(serverId: $serverId)
|
|
579
599
|
}
|
|
580
|
-
`,
|
|
600
|
+
`,w=(0,a.default)`
|
|
581
601
|
mutation CLI_issueButtressAccessToken($ttlSeconds: Int) {
|
|
582
602
|
issueButtressAccessToken(ttlSeconds: $ttlSeconds) {
|
|
583
603
|
token
|
|
@@ -586,7 +606,7 @@ ${A}`);return a.cause=e,a},b=l(function e(i,t){var a,n=this;d(this,e),this.baseU
|
|
|
586
606
|
jti
|
|
587
607
|
}
|
|
588
608
|
}
|
|
589
|
-
`,
|
|
609
|
+
`,L=(0,a.default)`
|
|
590
610
|
mutation CLI_issueDevtoolsAccessToken($ttlSeconds: Int) {
|
|
591
611
|
issueDevtoolsAccessToken(ttlSeconds: $ttlSeconds) {
|
|
592
612
|
token
|
|
@@ -595,14 +615,14 @@ ${A}`);return a.cause=e,a},b=l(function e(i,t){var a,n=this;d(this,e),this.baseU
|
|
|
595
615
|
jti
|
|
596
616
|
}
|
|
597
617
|
}
|
|
598
|
-
`},43741(e,i,t){t.r(i),t.d(i,{application:()=>p,applicationProject:()=>b,applications:()=>m,buttressServers:()=>
|
|
618
|
+
`},43741(e,i,t){t.r(i),t.d(i,{application:()=>p,applicationProject:()=>b,applications:()=>m,buttressServers:()=>D,checkBindDevicePasscode:()=>h,device:()=>o,deviceGroup:()=>l,deviceGroups:()=>c,deviceUsage:()=>C,devices:()=>s,devicesByGroup:()=>u,devicesPanel:()=>d,mediaBox:()=>k,mediaBoxes:()=>I,mediaFile:()=>A,mediaFiles:()=>y,mediaWorkspace:()=>f,module:()=>g,moduleProject:()=>S,modules:()=>_,publicApplicationShareInfo:()=>$,publicModules:()=>v,workspace:()=>r});var a=t(94370),n=t(48596),r=(0,a.default)`
|
|
599
619
|
query CLI_workspace {
|
|
600
620
|
workspace {
|
|
601
621
|
...cliWorkspaceArguments
|
|
602
622
|
}
|
|
603
623
|
}
|
|
604
624
|
${n.Yi}
|
|
605
|
-
`,
|
|
625
|
+
`,o=(0,a.default)`
|
|
606
626
|
query CLI_device($id: ID) {
|
|
607
627
|
device(id: $id) {
|
|
608
628
|
...cliDeviceArguments
|
|
@@ -711,14 +731,14 @@ ${A}`);return a.cause=e,a},b=l(function e(i,t){var a,n=this;d(this,e),this.baseU
|
|
|
711
731
|
}
|
|
712
732
|
}
|
|
713
733
|
${n.J6}
|
|
714
|
-
`,
|
|
734
|
+
`,v=(0,a.default)`
|
|
715
735
|
query CLI_publicModules($keyword: String!, $limit: Int) {
|
|
716
736
|
publicModules(keyword: $keyword, paginate: { limit: $limit }) {
|
|
717
737
|
...cliModuleShortArguments
|
|
718
738
|
}
|
|
719
739
|
}
|
|
720
740
|
${n.J6}
|
|
721
|
-
`,
|
|
741
|
+
`,h=(0,a.default)`
|
|
722
742
|
query CLI_checkBindDevicePasscode($passcode: String!) {
|
|
723
743
|
checkBindDevicePasscode(passcode: $passcode)
|
|
724
744
|
}
|
|
@@ -906,7 +926,7 @@ ${A}`);return a.cause=e,a},b=l(function e(i,t){var a,n=this;d(this,e),this.baseU
|
|
|
906
926
|
setupGeminiCLI: $setupGeminiCLI
|
|
907
927
|
)
|
|
908
928
|
}
|
|
909
|
-
`,
|
|
929
|
+
`,D=(0,a.default)`
|
|
910
930
|
query CLI_buttressServers {
|
|
911
931
|
buttressServers {
|
|
912
932
|
serverId
|