@mochabug/adaptkit 1.0.0-beta.5 → 1.0.0-beta.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/assets/inject.js +0 -7
- package/bin/index.js +1 -1
- package/package.json +2 -2
package/assets/inject.js
CHANGED
|
@@ -9,13 +9,6 @@ import consoleModule from '@cloudflare/unenv-preset/runtime/node/console/index'
|
|
|
9
9
|
if (typeof globalThis.console === 'undefined') {
|
|
10
10
|
globalThis.console = consoleModule
|
|
11
11
|
}
|
|
12
|
-
import * as timers from '@cloudflare/unenv-preset/runtime/node/timers/index'
|
|
13
|
-
if (typeof globalThis.setImmediate === 'undefined') {
|
|
14
|
-
globalThis.setImmediate = timers.setImmediate
|
|
15
|
-
}
|
|
16
|
-
if (typeof globalThis.clearImmediate === 'undefined') {
|
|
17
|
-
globalThis.clearImmediate = timers.clearImmediate
|
|
18
|
-
}
|
|
19
12
|
import perfModule from 'unenv/runtime/polyfill/performance'
|
|
20
13
|
if (typeof globalThis.performance === 'undefined') {
|
|
21
14
|
globalThis.performance = perfModule
|
package/bin/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
var k={name:"@mochabug/adaptkit",version:"1.0.0-beta.5"};import m from"chalk";import{program as P}from"commander";import Bn from"figlet";import _n from"fs";import Ln from"is-valid-hostname";import En from"path";import Sn from"semver";import In from"update-notifier";import{confirm as en,input as tn,select as st}from"@inquirer/prompts";import Ce from"chalk";import nn from"fs";import{ServiceType as St}from"@protobuf-ts/runtime-rpc";import{WireType as u}from"@protobuf-ts/runtime";import{UnknownFieldHandler as v}from"@protobuf-ts/runtime";import{reflectionMergePartial as E}from"@protobuf-ts/runtime";import{MessageType as S}from"@protobuf-ts/runtime";var Be=(n=>(n[n.UNSPECIFIED=0]="UNSPECIFIED",n[n.ACTION=1]="ACTION",n[n.BROWSER=2]="BROWSER",n[n.CRON_TRIGGER=3]="CRON_TRIGGER",n[n.EXTERNAL_TRIGGER=4]="EXTERNAL_TRIGGER",n))(Be||{}),Je=(a=>(a[a.UNSPECIFIED=0]="UNSPECIFIED",a[a.SECRET=1]="SECRET",a[a.STRING=2]="STRING",a[a.SWITCH=3]="SWITCH",a))(Je||{}),qe=(t=>(t[t.UNSPECIFIED=0]="UNSPECIFIED",t[t.RS256=1]="RS256",t))(qe||{}),ze=(n=>(n[n.UNSPECIFIED=0]="UNSPECIFIED",n[n.AUTHORIZATION_CODE=1]="AUTHORIZATION_CODE",n[n.CLIENT_CREDENTIALS=2]="CLIENT_CREDENTIALS",n[n.JWT_BEARER=3]="JWT_BEARER",n[n.SAML2_BEARER=4]="SAML2_BEARER",n))(ze||{}),Ke=(s=>(s[s.UNSPECIFIED=0]="UNSPECIFIED",s[s.BASIC=1]="BASIC",s[s.FORM=2]="FORM",s[s.PRIVATE_KEY_JWT=3]="PRIVATE_KEY_JWT",s[s.MTLS=4]="MTLS",s[s.SAML2_BEARER=5]="SAML2_BEARER",s))(Ke||{}),ge=class extends S{constructor(){super("mochabugapis.adapt.plugins.v1.UploadPluginRequest",[{no:1,name:"manifest",kind:"message",oneof:"data",T:()=>L},{no:2,name:"file",kind:"message",oneof:"data",T:()=>ue}])}create(e){let t=globalThis.Object.create(this.messagePrototype);return t.data={oneofKind:void 0},e!==void 0&&E(this,t,e),t}internalBinaryRead(e,t,i,a){let n=a??this.create(),s=e.pos+t;for(;e.pos<s;){let[r,p]=e.tag();switch(r){case 1:n.data={oneofKind:"manifest",manifest:L.internalBinaryRead(e,e.uint32(),i,n.data.manifest)};break;case 2:n.data={oneofKind:"file",file:ue.internalBinaryRead(e,e.uint32(),i,n.data.file)};break;default:let l=i.readUnknownField;if(l==="throw")throw new globalThis.Error(`Unknown field ${r} (wire type ${p}) for ${this.typeName}`);let c=e.skip(p);l!==!1&&(l===!0?v.onRead:l)(this.typeName,n,r,p,c)}}return n}internalBinaryWrite(e,t,i){e.data.oneofKind==="manifest"&&L.internalBinaryWrite(e.data.manifest,t.tag(1,u.LengthDelimited).fork(),i).join(),e.data.oneofKind==="file"&&ue.internalBinaryWrite(e.data.file,t.tag(2,u.LengthDelimited).fork(),i).join();let a=i.writeUnknownFields;return a!==!1&&(a==!0?v.onWrite:a)(this.typeName,e,t),t}},It=new ge,he=class extends S{constructor(){super("mochabugapis.adapt.plugins.v1.UploadPluginResponse",[])}create(e){let t=globalThis.Object.create(this.messagePrototype);return e!==void 0&&E(this,t,e),t}internalBinaryRead(e,t,i,a){return a??this.create()}internalBinaryWrite(e,t,i){let a=i.writeUnknownFields;return a!==!1&&(a==!0?v.onWrite:a)(this.typeName,e,t),t}},Ot=new he,be=class extends S{constructor(){super("mochabugapis.adapt.plugins.v1.File",[{no:1,name:"path",kind:"scalar",T:9,options:{"buf.validate.field":{string:{minLen:"2",maxLen:"4096",pattern:"^[^/]+(\\/[^/]+)*$"}}}},{no:2,name:"data",kind:"scalar",T:12,options:{"buf.validate.field":{bytes:{minLen:"1",maxLen:"40000000"}}}}])}create(e){let t=globalThis.Object.create(this.messagePrototype);return t.path="",t.data=new Uint8Array(0),e!==void 0&&E(this,t,e),t}internalBinaryRead(e,t,i,a){let n=a??this.create(),s=e.pos+t;for(;e.pos<s;){let[r,p]=e.tag();switch(r){case 1:n.path=e.string();break;case 2:n.data=e.bytes();break;default:let l=i.readUnknownField;if(l==="throw")throw new globalThis.Error(`Unknown field ${r} (wire type ${p}) for ${this.typeName}`);let c=e.skip(p);l!==!1&&(l===!0?v.onRead:l)(this.typeName,n,r,p,c)}}return n}internalBinaryWrite(e,t,i){e.path!==""&&t.tag(1,u.LengthDelimited).string(e.path),e.data.length&&t.tag(2,u.LengthDelimited).bytes(e.data);let a=i.writeUnknownFields;return a!==!1&&(a==!0?v.onWrite:a)(this.typeName,e,t),t}},ue=new be,ye=class extends S{constructor(){super("mochabugapis.adapt.plugins.v1.Manifest",[{no:1,name:"name",kind:"scalar",T:9,options:{"buf.validate.field":{string:{minLen:"1",maxLen:"100",pattern:"^[_$a-z][_$a-z0-9]*$"}}}},{no:2,name:"version",kind:"scalar",T:9,options:{"buf.validate.field":{string:{minLen:"5",maxLen:"150",pattern:"^(0|[1-9]\\d*)\\.(0|[1-9]\\d*)\\.(0|[1-9]\\d*)(?:-((?:0|[1-9]\\d*|\\d*[a-zA-Z-][0-9a-zA-Z-]*)(?:\\.(?:0|[1-9]\\d*|\\d*[a-zA-Z-][0-9a-zA-Z-]*))*))?(?:\\+([0-9a-zA-Z-]+(?:\\.[0-9a-zA-Z-]+)*))?$"}}}},{no:3,name:"label",kind:"scalar",T:9,options:{"buf.validate.field":{string:{minLen:"1",maxLen:"100"}}}},{no:4,name:"description",kind:"scalar",T:9,options:{"buf.validate.field":{string:{minLen:"1",maxLen:"250"}}}},{no:5,name:"organization",kind:"scalar",T:9,options:{"buf.validate.field":{string:{uuid:!0}}}},{no:6,name:"homepage",kind:"scalar",opt:!0,T:9,options:{"buf.validate.field":{ignore:"IGNORE_EMPTY",string:{minLen:"11",maxLen:"4096",pattern:"^https://[a-zA-Z0-9.-]+(?:\\.[a-zA-Z]{2,})(?:/.*)?$"}}}},{no:7,name:"repository",kind:"scalar",opt:!0,T:9,options:{"buf.validate.field":{ignore:"IGNORE_EMPTY",string:{minLen:"11",maxLen:"4096",pattern:"^https://[a-zA-Z0-9.-]+(?:\\.[a-zA-Z]{2,})(?:/.*)?$"}}}},{no:8,name:"bugs",kind:"scalar",opt:!0,T:9,options:{"buf.validate.field":{cel:[{id:"valid_email_or_url",message:"bugs must be a valid email or URL",expression:"size(this) >= 2 && size(this) <= 4096 && (this.isEmail() || this.matches('^https://[a-zA-Z0-9.-]+(?:\\\\.[a-zA-Z]{2,})(?:/.*)?$'))"}],ignore:"IGNORE_EMPTY"}}},{no:9,name:"author",kind:"scalar",opt:!0,T:9,options:{"buf.validate.field":{ignore:"IGNORE_EMPTY",string:{minLen:"1",maxLen:"100"}}}},{no:10,name:"logo",kind:"scalar",opt:!0,T:9,options:{"buf.validate.field":{ignore:"IGNORE_EMPTY",string:{minLen:"2",maxLen:"4096",pattern:"^([^/]+(/[^/]+)*)\\.(gif|jpg|jpeg|jfif|pjpeg|pjp|png|svg|webp|avif)$"}}}},{no:11,name:"executors",kind:"scalar",T:9,options:{"buf.validate.field":{string:{minLen:"2",maxLen:"4096",pattern:"^([^/]+(/[^/]+)*)\\.(mjs|js)$"}}}},{no:12,name:"configurators",kind:"scalar",opt:!0,T:9,options:{"buf.validate.field":{ignore:"IGNORE_EMPTY",string:{minLen:"2",maxLen:"4096",pattern:"^([^/]+(/[^/]+)*)\\.(mjs|js)$"}}}},{no:13,name:"assets",kind:"scalar",opt:!0,T:9,options:{"buf.validate.field":{string:{minLen:"2",maxLen:"4096",pattern:"^[^/]+(\\/[^/]+)*$"}}}},{no:14,name:"cdn",kind:"scalar",opt:!0,T:9,options:{"buf.validate.field":{string:{minLen:"2",maxLen:"4096",pattern:"^[^/]+(\\/[^/]+)*$"}}}},{no:15,name:"vertices",kind:"message",repeat:1,T:()=>de,options:{"buf.validate.field":{cel:[{id:"vertex_unique_names",message:"a name cannot appear more than once",expression:"this.map(vertex, vertex.name).unique()"}],repeated:{minItems:"1",maxItems:"100"}}}},{no:16,name:"plugin_oauth2",kind:"message",repeat:1,T:()=>j,options:{"buf.validate.field":{cel:[{id:"plugin_oauth2.oauth_unique_names",message:"a name cannot appear more than once",expression:"this.map(oauth, oauth.name).unique()"}],repeated:{minItems:"0",maxItems:"20",items:{cel:[{id:"plugin_oauth2.oauth2.client_id",message:"The client_id property must be set",expression:"has(this.client_id)"}]}}}}},{no:17,name:"plugin_variables",kind:"message",repeat:1,T:()=>M,options:{"buf.validate.field":{cel:[{id:"vars_unique_names",message:"a name cannot appear more than once",expression:"this.map(variable, variable.name).unique()"}],repeated:{minItems:"0",maxItems:"100"}}}},{no:18,name:"plugin_mtls",kind:"message",repeat:1,T:()=>U,options:{"buf.validate.field":{cel:[{id:"mtls_unique_names",message:"a name cannot appear more than once",expression:"this.map(mtls, mtls.name).unique()"}],repeated:{minItems:"0",maxItems:"20"}}}}])}create(e){let t=globalThis.Object.create(this.messagePrototype);return t.name="",t.version="",t.label="",t.description="",t.organization="",t.executors="",t.vertices=[],t.pluginOauth2=[],t.pluginVariables=[],t.pluginMtls=[],e!==void 0&&E(this,t,e),t}internalBinaryRead(e,t,i,a){let n=a??this.create(),s=e.pos+t;for(;e.pos<s;){let[r,p]=e.tag();switch(r){case 1:n.name=e.string();break;case 2:n.version=e.string();break;case 3:n.label=e.string();break;case 4:n.description=e.string();break;case 5:n.organization=e.string();break;case 6:n.homepage=e.string();break;case 7:n.repository=e.string();break;case 8:n.bugs=e.string();break;case 9:n.author=e.string();break;case 10:n.logo=e.string();break;case 11:n.executors=e.string();break;case 12:n.configurators=e.string();break;case 13:n.assets=e.string();break;case 14:n.cdn=e.string();break;case 15:n.vertices.push(de.internalBinaryRead(e,e.uint32(),i));break;case 16:n.pluginOauth2.push(j.internalBinaryRead(e,e.uint32(),i));break;case 17:n.pluginVariables.push(M.internalBinaryRead(e,e.uint32(),i));break;case 18:n.pluginMtls.push(U.internalBinaryRead(e,e.uint32(),i));break;default:let l=i.readUnknownField;if(l==="throw")throw new globalThis.Error(`Unknown field ${r} (wire type ${p}) for ${this.typeName}`);let c=e.skip(p);l!==!1&&(l===!0?v.onRead:l)(this.typeName,n,r,p,c)}}return n}internalBinaryWrite(e,t,i){e.name!==""&&t.tag(1,u.LengthDelimited).string(e.name),e.version!==""&&t.tag(2,u.LengthDelimited).string(e.version),e.label!==""&&t.tag(3,u.LengthDelimited).string(e.label),e.description!==""&&t.tag(4,u.LengthDelimited).string(e.description),e.organization!==""&&t.tag(5,u.LengthDelimited).string(e.organization),e.homepage!==void 0&&t.tag(6,u.LengthDelimited).string(e.homepage),e.repository!==void 0&&t.tag(7,u.LengthDelimited).string(e.repository),e.bugs!==void 0&&t.tag(8,u.LengthDelimited).string(e.bugs),e.author!==void 0&&t.tag(9,u.LengthDelimited).string(e.author),e.logo!==void 0&&t.tag(10,u.LengthDelimited).string(e.logo),e.executors!==""&&t.tag(11,u.LengthDelimited).string(e.executors),e.configurators!==void 0&&t.tag(12,u.LengthDelimited).string(e.configurators),e.assets!==void 0&&t.tag(13,u.LengthDelimited).string(e.assets),e.cdn!==void 0&&t.tag(14,u.LengthDelimited).string(e.cdn);for(let n=0;n<e.vertices.length;n++)de.internalBinaryWrite(e.vertices[n],t.tag(15,u.LengthDelimited).fork(),i).join();for(let n=0;n<e.pluginOauth2.length;n++)j.internalBinaryWrite(e.pluginOauth2[n],t.tag(16,u.LengthDelimited).fork(),i).join();for(let n=0;n<e.pluginVariables.length;n++)M.internalBinaryWrite(e.pluginVariables[n],t.tag(17,u.LengthDelimited).fork(),i).join();for(let n=0;n<e.pluginMtls.length;n++)U.internalBinaryWrite(e.pluginMtls[n],t.tag(18,u.LengthDelimited).fork(),i).join();let a=i.writeUnknownFields;return a!==!1&&(a==!0?v.onWrite:a)(this.typeName,e,t),t}},L=new ye,ke=class extends S{constructor(){super("mochabugapis.adapt.plugins.v1.Vertex",[{no:1,name:"name",kind:"scalar",T:9,options:{"buf.validate.field":{string:{minLen:"1",maxLen:"100",pattern:"^[_$a-z][_$a-z0-9]*$"}}}},{no:2,name:"label",kind:"scalar",T:9,options:{"buf.validate.field":{string:{minLen:"1",maxLen:"100"}}}},{no:3,name:"description",kind:"scalar",opt:!0,T:9,options:{"buf.validate.field":{ignore:"IGNORE_EMPTY",string:{minLen:"1",maxLen:"250"}}}},{no:4,name:"logo",kind:"scalar",opt:!0,T:9,options:{"buf.validate.field":{ignore:"IGNORE_EMPTY",string:{minLen:"2",maxLen:"4096",pattern:"^([^/]+(/[^/]+)*)\\.(gif|jpg|jpeg|jfif|pjpeg|pjp|png|svg|webp|avif)$"}}}},{no:5,name:"type",kind:"enum",T:()=>["mochabugapis.adapt.plugins.v1.Vertex.VertexType",Be,"VERTEX_TYPE_"],options:{"buf.validate.field":{enum:{notIn:[0]}}}},{no:6,name:"config",kind:"scalar",opt:!0,T:9,options:{"buf.validate.field":{string:{minLen:"5",maxLen:"4096",pattern:"^([^/]+(/[^/]+)*)"}}}},{no:7,name:"metadata",kind:"scalar",T:9,options:{"buf.validate.field":{string:{minLen:"5",maxLen:"4096",pattern:"^([^/]+(/[^/]+)*)\\.json$"}}}},{no:8,name:"configurator",kind:"scalar",T:8},{no:9,name:"variables",kind:"message",repeat:1,T:()=>M,options:{"buf.validate.field":{cel:[{id:"vars_unique_names",message:"a name cannot appear more than once",expression:"this.map(variable, variable.name).unique()"}],repeated:{minItems:"0",maxItems:"100"}}}},{no:10,name:"mtls",kind:"message",repeat:1,T:()=>U,options:{"buf.validate.field":{cel:[{id:"mtls_unique_names",message:"a name cannot appear more than once",expression:"this.map(mtls, mtls.name).unique()"}],repeated:{minItems:"0",maxItems:"100"}}}},{no:11,name:"code_oauth2",kind:"message",repeat:1,T:()=>me,options:{"buf.validate.field":{cel:[{id:"vertex.code_oauth2.unique_names",message:"a name cannot appear more than once",expression:"this.map(oauth, oauth.name).unique()"}],repeated:{minItems:"0",maxItems:"20"}}}},{no:12,name:"oauth2",kind:"message",repeat:1,T:()=>j,options:{"buf.validate.field":{cel:[{id:"vertex.oauth2.unique_names",message:"a name cannot appear more than once",expression:"this.map(oauth, oauth.name).unique()"}],repeated:{minItems:"0",maxItems:"20",items:{cel:[{id:"vertex.oauth2.client_id_and_code",message:"The client_id and the code property may not be set as well as the code grant type",expression:"!has(this.client_id) && !has(this.code) && this.grant_type != 1"}]}}}}}],{"buf.validate.message":{cel:[{id:"vertex.oauth2_and_code_bindings",message:"The names of the oauth2 services and the code bindings must be unique",expression:"(this.oauth2.map(val, val.name) + this.code_oauth2.map(val, val.name)).unique()"}]}})}create(e){let t=globalThis.Object.create(this.messagePrototype);return t.name="",t.label="",t.type=0,t.metadata="",t.configurator=!1,t.variables=[],t.mtls=[],t.codeOauth2=[],t.oauth2=[],e!==void 0&&E(this,t,e),t}internalBinaryRead(e,t,i,a){let n=a??this.create(),s=e.pos+t;for(;e.pos<s;){let[r,p]=e.tag();switch(r){case 1:n.name=e.string();break;case 2:n.label=e.string();break;case 3:n.description=e.string();break;case 4:n.logo=e.string();break;case 5:n.type=e.int32();break;case 6:n.config=e.string();break;case 7:n.metadata=e.string();break;case 8:n.configurator=e.bool();break;case 9:n.variables.push(M.internalBinaryRead(e,e.uint32(),i));break;case 10:n.mtls.push(U.internalBinaryRead(e,e.uint32(),i));break;case 11:n.codeOauth2.push(me.internalBinaryRead(e,e.uint32(),i));break;case 12:n.oauth2.push(j.internalBinaryRead(e,e.uint32(),i));break;default:let l=i.readUnknownField;if(l==="throw")throw new globalThis.Error(`Unknown field ${r} (wire type ${p}) for ${this.typeName}`);let c=e.skip(p);l!==!1&&(l===!0?v.onRead:l)(this.typeName,n,r,p,c)}}return n}internalBinaryWrite(e,t,i){e.name!==""&&t.tag(1,u.LengthDelimited).string(e.name),e.label!==""&&t.tag(2,u.LengthDelimited).string(e.label),e.description!==void 0&&t.tag(3,u.LengthDelimited).string(e.description),e.logo!==void 0&&t.tag(4,u.LengthDelimited).string(e.logo),e.type!==0&&t.tag(5,u.Varint).int32(e.type),e.config!==void 0&&t.tag(6,u.LengthDelimited).string(e.config),e.metadata!==""&&t.tag(7,u.LengthDelimited).string(e.metadata),e.configurator!==!1&&t.tag(8,u.Varint).bool(e.configurator);for(let n=0;n<e.variables.length;n++)M.internalBinaryWrite(e.variables[n],t.tag(9,u.LengthDelimited).fork(),i).join();for(let n=0;n<e.mtls.length;n++)U.internalBinaryWrite(e.mtls[n],t.tag(10,u.LengthDelimited).fork(),i).join();for(let n=0;n<e.codeOauth2.length;n++)me.internalBinaryWrite(e.codeOauth2[n],t.tag(11,u.LengthDelimited).fork(),i).join();for(let n=0;n<e.oauth2.length;n++)j.internalBinaryWrite(e.oauth2[n],t.tag(12,u.LengthDelimited).fork(),i).join();let a=i.writeUnknownFields;return a!==!1&&(a==!0?v.onWrite:a)(this.typeName,e,t),t}},de=new ke,ve=class extends S{constructor(){super("mochabugapis.adapt.plugins.v1.MTLSService",[{no:1,name:"name",kind:"scalar",T:9,options:{"buf.validate.field":{string:{minLen:"1",maxLen:"100",pattern:"^[_$a-z][_$a-z0-9]*$"}}}},{no:2,name:"label",kind:"scalar",opt:!0,T:9,options:{"buf.validate.field":{ignore:"IGNORE_EMPTY",string:{minLen:"1",maxLen:"100"}}}},{no:3,name:"description",kind:"scalar",opt:!0,T:9,options:{"buf.validate.field":{ignore:"IGNORE_EMPTY",string:{minLen:"1",maxLen:"250"}}}},{no:4,name:"optional",kind:"scalar",opt:!0,T:8}])}create(e){let t=globalThis.Object.create(this.messagePrototype);return t.name="",e!==void 0&&E(this,t,e),t}internalBinaryRead(e,t,i,a){let n=a??this.create(),s=e.pos+t;for(;e.pos<s;){let[r,p]=e.tag();switch(r){case 1:n.name=e.string();break;case 2:n.label=e.string();break;case 3:n.description=e.string();break;case 4:n.optional=e.bool();break;default:let l=i.readUnknownField;if(l==="throw")throw new globalThis.Error(`Unknown field ${r} (wire type ${p}) for ${this.typeName}`);let c=e.skip(p);l!==!1&&(l===!0?v.onRead:l)(this.typeName,n,r,p,c)}}return n}internalBinaryWrite(e,t,i){e.name!==""&&t.tag(1,u.LengthDelimited).string(e.name),e.label!==void 0&&t.tag(2,u.LengthDelimited).string(e.label),e.description!==void 0&&t.tag(3,u.LengthDelimited).string(e.description),e.optional!==void 0&&t.tag(4,u.Varint).bool(e.optional);let a=i.writeUnknownFields;return a!==!1&&(a==!0?v.onWrite:a)(this.typeName,e,t),t}},U=new ve,Te=class extends S{constructor(){super("mochabugapis.adapt.plugins.v1.VariableService",[{no:1,name:"name",kind:"scalar",T:9,options:{"buf.validate.field":{string:{minLen:"1",maxLen:"100",pattern:"^[_$a-z][_$a-z0-9]*$"}}}},{no:2,name:"label",kind:"scalar",opt:!0,T:9,options:{"buf.validate.field":{string:{minLen:"1",maxLen:"100"}}}},{no:3,name:"description",kind:"scalar",opt:!0,T:9,options:{"buf.validate.field":{ignore:"IGNORE_EMPTY",string:{minLen:"1",maxLen:"250"}}}},{no:4,name:"type",kind:"enum",T:()=>["mochabugapis.adapt.plugins.v1.VariableService.Type",Je,"TYPE_"],options:{"buf.validate.field":{enum:{notIn:[0]}}}},{no:5,name:"optional",kind:"scalar",opt:!0,T:8}])}create(e){let t=globalThis.Object.create(this.messagePrototype);return t.name="",t.type=0,e!==void 0&&E(this,t,e),t}internalBinaryRead(e,t,i,a){let n=a??this.create(),s=e.pos+t;for(;e.pos<s;){let[r,p]=e.tag();switch(r){case 1:n.name=e.string();break;case 2:n.label=e.string();break;case 3:n.description=e.string();break;case 4:n.type=e.int32();break;case 5:n.optional=e.bool();break;default:let l=i.readUnknownField;if(l==="throw")throw new globalThis.Error(`Unknown field ${r} (wire type ${p}) for ${this.typeName}`);let c=e.skip(p);l!==!1&&(l===!0?v.onRead:l)(this.typeName,n,r,p,c)}}return n}internalBinaryWrite(e,t,i){e.name!==""&&t.tag(1,u.LengthDelimited).string(e.name),e.label!==void 0&&t.tag(2,u.LengthDelimited).string(e.label),e.description!==void 0&&t.tag(3,u.LengthDelimited).string(e.description),e.type!==0&&t.tag(4,u.Varint).int32(e.type),e.optional!==void 0&&t.tag(5,u.Varint).bool(e.optional);let a=i.writeUnknownFields;return a!==!1&&(a==!0?v.onWrite:a)(this.typeName,e,t),t}},M=new Te,xe=class extends S{constructor(){super("mochabugapis.adapt.plugins.v1.Oauth2Service",[{no:1,name:"name",kind:"scalar",T:9,options:{"buf.validate.field":{string:{minLen:"1",maxLen:"100",pattern:"^[_$a-z][_$a-z0-9]*$"}}}},{no:2,name:"label",kind:"scalar",opt:!0,T:9,options:{"buf.validate.field":{ignore:"IGNORE_EMPTY",string:{minLen:"1",maxLen:"100"}}}},{no:3,name:"description",kind:"scalar",opt:!0,T:9,options:{"buf.validate.field":{ignore:"IGNORE_EMPTY",string:{minLen:"1",maxLen:"250"}}}},{no:4,name:"grant_type",kind:"enum",T:()=>["mochabugapis.adapt.plugins.v1.Oauth2GrantType",ze,"OAUTH2_GRANT_TYPE_"],options:{"buf.validate.field":{enum:{notIn:[0]}}}},{no:5,name:"scopes",kind:"scalar",repeat:2,T:9,options:{"buf.validate.field":{repeated:{minItems:"1",maxItems:"500",unique:!0,items:{string:{minLen:"1",maxLen:"100"}}}}}},{no:6,name:"auth_method",kind:"enum",opt:!0,T:()=>["mochabugapis.adapt.plugins.v1.Oauth2AuthType",Ke,"OAUTH2_AUTH_TYPE_"],options:{"buf.validate.field":{ignore:"IGNORE_EMPTY",enum:{notIn:[0]}}}},{no:7,name:"alg",kind:"enum",opt:!0,T:()=>["mochabugapis.adapt.plugins.v1.PrivateKeyAlg",qe,"PRIVATE_KEY_ALG_"],options:{"buf.validate.field":{ignore:"IGNORE_EMPTY",enum:{notIn:[0]}}}},{no:8,name:"client_id",kind:"scalar",opt:!0,T:9,options:{"buf.validate.field":{ignore:"IGNORE_EMPTY",string:{minLen:"1",maxLen:"250"}}}},{no:9,name:"token_endpoint",kind:"scalar",T:9,options:{"buf.validate.field":{string:{minLen:"11",maxLen:"4096",pattern:"^https://[a-zA-Z0-9.-]+(?:\\.[a-zA-Z]{2,})(?:/.*)?$"}}}},{no:10,name:"code",kind:"message",T:()=>fe},{no:11,name:"optional",kind:"scalar",opt:!0,T:8}],{"buf.validate.message":{cel:[{id:"oauth2.auth_method",message:"The auth_method property must be set in case of grant_type OAUTH2_GRANT_TYPE_AUTHORIZATION_CODE or OAUTH2_GRANT_TYPE_CLIENT_CREDENTIALS",expression:"has(this.auth_method) == (this.grant_type == 1 || this.grant_type == 2)"},{id:"oauth2.alg",message:"The alg property must be set in case of grant_type OAUTH2_GRANT_TYPE_JWT_BEARER, OAUTH2_GRANT_TYPE_SAML2_BEARER or auth_method OAUTH2_AUTH_TYPE_PRIVATE_KEY_JWT, OAUTH2_AUTH_TYPE_SAML2_BEARER",expression:"has(this.alg) == (this.grant_type == 3 || this.grant_type == 4 || this.auth_method == 3 || this.auth_method == 5)"},{id:"oauth2.code",message:"The code property must be set in case of grant_type OAUTH2_GRANT_TYPE_AUTHORIZATION_CODE",expression:"has(this.code) == (this.grant_type == 1)"},{id:"oauth2.optional",message:"The optional property cannot be set to true in case of grant_type OAUTH2_GRANT_TYPE_AUTHORIZATION_CODE",expression:"!has(this.optional) || this.grant_type != 1 || (!this.optional && this.grant_type == 1)"}]}})}create(e){let t=globalThis.Object.create(this.messagePrototype);return t.name="",t.grantType=0,t.scopes=[],t.tokenEndpoint="",e!==void 0&&E(this,t,e),t}internalBinaryRead(e,t,i,a){let n=a??this.create(),s=e.pos+t;for(;e.pos<s;){let[r,p]=e.tag();switch(r){case 1:n.name=e.string();break;case 2:n.label=e.string();break;case 3:n.description=e.string();break;case 4:n.grantType=e.int32();break;case 5:n.scopes.push(e.string());break;case 6:n.authMethod=e.int32();break;case 7:n.alg=e.int32();break;case 8:n.clientId=e.string();break;case 9:n.tokenEndpoint=e.string();break;case 10:n.code=fe.internalBinaryRead(e,e.uint32(),i,n.code);break;case 11:n.optional=e.bool();break;default:let l=i.readUnknownField;if(l==="throw")throw new globalThis.Error(`Unknown field ${r} (wire type ${p}) for ${this.typeName}`);let c=e.skip(p);l!==!1&&(l===!0?v.onRead:l)(this.typeName,n,r,p,c)}}return n}internalBinaryWrite(e,t,i){e.name!==""&&t.tag(1,u.LengthDelimited).string(e.name),e.label!==void 0&&t.tag(2,u.LengthDelimited).string(e.label),e.description!==void 0&&t.tag(3,u.LengthDelimited).string(e.description),e.grantType!==0&&t.tag(4,u.Varint).int32(e.grantType);for(let n=0;n<e.scopes.length;n++)t.tag(5,u.LengthDelimited).string(e.scopes[n]);e.authMethod!==void 0&&t.tag(6,u.Varint).int32(e.authMethod),e.alg!==void 0&&t.tag(7,u.Varint).int32(e.alg),e.clientId!==void 0&&t.tag(8,u.LengthDelimited).string(e.clientId),e.tokenEndpoint!==""&&t.tag(9,u.LengthDelimited).string(e.tokenEndpoint),e.code&&fe.internalBinaryWrite(e.code,t.tag(10,u.LengthDelimited).fork(),i).join(),e.optional!==void 0&&t.tag(11,u.Varint).bool(e.optional);let a=i.writeUnknownFields;return a!==!1&&(a==!0?v.onWrite:a)(this.typeName,e,t),t}},j=new xe,Re=class extends S{constructor(){super("mochabugapis.adapt.plugins.v1.Oauth2CodeBinding",[{no:1,name:"name",kind:"scalar",T:9,options:{"buf.validate.field":{string:{minLen:"1",maxLen:"100",pattern:"^[_$a-z][_$a-z0-9]*$"}}}},{no:2,name:"optional",kind:"scalar",opt:!0,T:8}])}create(e){let t=globalThis.Object.create(this.messagePrototype);return t.name="",e!==void 0&&E(this,t,e),t}internalBinaryRead(e,t,i,a){let n=a??this.create(),s=e.pos+t;for(;e.pos<s;){let[r,p]=e.tag();switch(r){case 1:n.name=e.string();break;case 2:n.optional=e.bool();break;default:let l=i.readUnknownField;if(l==="throw")throw new globalThis.Error(`Unknown field ${r} (wire type ${p}) for ${this.typeName}`);let c=e.skip(p);l!==!1&&(l===!0?v.onRead:l)(this.typeName,n,r,p,c)}}return n}internalBinaryWrite(e,t,i){e.name!==""&&t.tag(1,u.LengthDelimited).string(e.name),e.optional!==void 0&&t.tag(2,u.Varint).bool(e.optional);let a=i.writeUnknownFields;return a!==!1&&(a==!0?v.onWrite:a)(this.typeName,e,t),t}},me=new Re,we=class extends S{constructor(){super("mochabugapis.adapt.plugins.v1.Oauth2Code",[{no:1,name:"auth_endpoint",kind:"scalar",T:9,options:{"buf.validate.field":{string:{minLen:"11",maxLen:"4096",pattern:"^https://[a-zA-Z0-9.-]+(?:\\.[a-zA-Z]{2,})(?:/.*)?$"}}}},{no:2,name:"issuer",kind:"scalar",T:9,options:{"buf.validate.field":{string:{minLen:"1",maxLen:"4096"}}}},{no:3,name:"jwks_uri",kind:"scalar",T:9,options:{"buf.validate.field":{string:{minLen:"11",maxLen:"4096",pattern:"^https://[a-zA-Z0-9.-]+(?:\\.[a-zA-Z]{2,})(?:/.*)?$"}}}},{no:4,name:"additional_params",kind:"map",K:9,V:{kind:"scalar",T:9},options:{"buf.validate.field":{map:{minPairs:"0",maxPairs:"50",keys:{string:{minLen:"1",maxLen:"250"}},values:{string:{minLen:"1",maxLen:"250"}}}}}},{no:5,name:"use_pkce",kind:"scalar",T:8}])}create(e){let t=globalThis.Object.create(this.messagePrototype);return t.authEndpoint="",t.issuer="",t.jwksUri="",t.additionalParams={},t.usePkce=!1,e!==void 0&&E(this,t,e),t}internalBinaryRead(e,t,i,a){let n=a??this.create(),s=e.pos+t;for(;e.pos<s;){let[r,p]=e.tag();switch(r){case 1:n.authEndpoint=e.string();break;case 2:n.issuer=e.string();break;case 3:n.jwksUri=e.string();break;case 4:this.binaryReadMap4(n.additionalParams,e,i);break;case 5:n.usePkce=e.bool();break;default:let l=i.readUnknownField;if(l==="throw")throw new globalThis.Error(`Unknown field ${r} (wire type ${p}) for ${this.typeName}`);let c=e.skip(p);l!==!1&&(l===!0?v.onRead:l)(this.typeName,n,r,p,c)}}return n}binaryReadMap4(e,t,i){let a=t.uint32(),n=t.pos+a,s,r;for(;t.pos<n;){let[p,l]=t.tag();switch(p){case 1:s=t.string();break;case 2:r=t.string();break;default:throw new globalThis.Error("unknown map entry field for field mochabugapis.adapt.plugins.v1.Oauth2Code.additional_params")}}e[s??""]=r??""}internalBinaryWrite(e,t,i){e.authEndpoint!==""&&t.tag(1,u.LengthDelimited).string(e.authEndpoint),e.issuer!==""&&t.tag(2,u.LengthDelimited).string(e.issuer),e.jwksUri!==""&&t.tag(3,u.LengthDelimited).string(e.jwksUri);for(let n of globalThis.Object.keys(e.additionalParams))t.tag(4,u.LengthDelimited).fork().tag(1,u.LengthDelimited).string(n).tag(2,u.LengthDelimited).string(e.additionalParams[n]).join();e.usePkce!==!1&&t.tag(5,u.Varint).bool(e.usePkce);let a=i.writeUnknownFields;return a!==!1&&(a==!0?v.onWrite:a)(this.typeName,e,t),t}},fe=new we,Z=new St("mochabugapis.adapt.plugins.v1.PluginService",[{name:"UploadPlugin",clientStreaming:!0,options:{"google.api.http":{post:"/v1/plugins/upload",body:"*"}},I:It,O:Ot}],{"google.api.default_host":"adapt.mochabugapis.com","google.api.oauth_scopes":"https://www.mochabugapis.com/auth/adapt/plugins,https://www.mochabugapis.com/auth/adapt/plugins.upload"});import z from"fs";import{mkdirp as Zt}from"mkdirp";import T from"path";import{WireType as C}from"@protobuf-ts/runtime";import{UnknownFieldHandler as it}from"@protobuf-ts/runtime";import{reflectionMergePartial as Kt}from"@protobuf-ts/runtime";import{MessageType as Gt}from"@protobuf-ts/runtime";import{WireType as Q}from"@protobuf-ts/runtime";import{UnknownFieldHandler as Xe}from"@protobuf-ts/runtime";import{reflectionMergePartial as Mt}from"@protobuf-ts/runtime";import{MessageType as jt}from"@protobuf-ts/runtime";import{WireType as De}from"@protobuf-ts/runtime";import{UnknownFieldHandler as Ze}from"@protobuf-ts/runtime";import{reflectionMergePartial as $t}from"@protobuf-ts/runtime";import{MessageType as Ut}from"@protobuf-ts/runtime";import{WireType as J}from"@protobuf-ts/runtime";import{UnknownFieldHandler as Ye}from"@protobuf-ts/runtime";import{reflectionMergePartial as Wt}from"@protobuf-ts/runtime";import{MessageType as Vt}from"@protobuf-ts/runtime";import{WireType as y}from"@protobuf-ts/runtime";import{UnknownFieldHandler as He}from"@protobuf-ts/runtime";import{reflectionMergePartial as Nt}from"@protobuf-ts/runtime";import{MessageType as Dt}from"@protobuf-ts/runtime";import{WireType as I}from"@protobuf-ts/runtime";import{UnknownFieldHandler as A}from"@protobuf-ts/runtime";import{reflectionMergePartial as Se}from"@protobuf-ts/runtime";import{isJsonObject as Pt}from"@protobuf-ts/runtime";import{typeofJsonValue as Ie}from"@protobuf-ts/runtime";import{MessageType as Oe}from"@protobuf-ts/runtime";var Ge=(e=>(e[e.NULL_VALUE=0]="NULL_VALUE",e))(Ge||{}),_e=class extends Oe{constructor(){super("google.protobuf.Struct",[{no:1,name:"fields",kind:"map",K:9,V:{kind:"message",T:()=>R}}])}internalJsonWrite(e,t){let i={};for(let[a,n]of Object.entries(e.fields))i[a]=R.toJson(n);return i}internalJsonRead(e,t,i){if(!Pt(e))throw new globalThis.Error("Unable to parse message "+this.typeName+" from JSON "+Ie(e)+".");i||(i=this.create());for(let[a,n]of globalThis.Object.entries(e))i.fields[a]=R.fromJson(n);return i}create(e){let t=globalThis.Object.create(this.messagePrototype);return t.fields={},e!==void 0&&Se(this,t,e),t}internalBinaryRead(e,t,i,a){let n=a??this.create(),s=e.pos+t;for(;e.pos<s;){let[r,p]=e.tag();switch(r){case 1:this.binaryReadMap1(n.fields,e,i);break;default:let l=i.readUnknownField;if(l==="throw")throw new globalThis.Error(`Unknown field ${r} (wire type ${p}) for ${this.typeName}`);let c=e.skip(p);l!==!1&&(l===!0?A.onRead:l)(this.typeName,n,r,p,c)}}return n}binaryReadMap1(e,t,i){let a=t.uint32(),n=t.pos+a,s,r;for(;t.pos<n;){let[p,l]=t.tag();switch(p){case 1:s=t.string();break;case 2:r=R.internalBinaryRead(t,t.uint32(),i);break;default:throw new globalThis.Error("unknown map entry field for field google.protobuf.Struct.fields")}}e[s??""]=r??R.create()}internalBinaryWrite(e,t,i){for(let n of globalThis.Object.keys(e.fields))t.tag(1,I.LengthDelimited).fork().tag(1,I.LengthDelimited).string(n),t.tag(2,I.LengthDelimited).fork(),R.internalBinaryWrite(e.fields[n],t,i),t.join().join();let a=i.writeUnknownFields;return a!==!1&&(a==!0?A.onWrite:a)(this.typeName,e,t),t}},D=new _e,Le=class extends Oe{constructor(){super("google.protobuf.Value",[{no:1,name:"null_value",kind:"enum",oneof:"kind",T:()=>["google.protobuf.NullValue",Ge]},{no:2,name:"number_value",kind:"scalar",oneof:"kind",T:1},{no:3,name:"string_value",kind:"scalar",oneof:"kind",T:9},{no:4,name:"bool_value",kind:"scalar",oneof:"kind",T:8},{no:5,name:"struct_value",kind:"message",oneof:"kind",T:()=>D},{no:6,name:"list_value",kind:"message",oneof:"kind",T:()=>X}])}internalJsonWrite(e,t){if(e.kind.oneofKind===void 0)throw new globalThis.Error;switch(e.kind.oneofKind){case void 0:throw new globalThis.Error;case"boolValue":return e.kind.boolValue;case"nullValue":return null;case"numberValue":let i=e.kind.numberValue;if(typeof i=="number"&&!Number.isFinite(i))throw new globalThis.Error;return i;case"stringValue":return e.kind.stringValue;case"listValue":let a=this.fields.find(s=>s.no===6);if(a?.kind!=="message")throw new globalThis.Error;return a.T().toJson(e.kind.listValue);case"structValue":let n=this.fields.find(s=>s.no===5);if(n?.kind!=="message")throw new globalThis.Error;return n.T().toJson(e.kind.structValue)}}internalJsonRead(e,t,i){switch(i||(i=this.create()),typeof e){case"number":i.kind={oneofKind:"numberValue",numberValue:e};break;case"string":i.kind={oneofKind:"stringValue",stringValue:e};break;case"boolean":i.kind={oneofKind:"boolValue",boolValue:e};break;case"object":e===null?i.kind={oneofKind:"nullValue",nullValue:0}:globalThis.Array.isArray(e)?i.kind={oneofKind:"listValue",listValue:X.fromJson(e)}:i.kind={oneofKind:"structValue",structValue:D.fromJson(e)};break;default:throw new globalThis.Error("Unable to parse "+this.typeName+" from JSON "+Ie(e))}return i}create(e){let t=globalThis.Object.create(this.messagePrototype);return t.kind={oneofKind:void 0},e!==void 0&&Se(this,t,e),t}internalBinaryRead(e,t,i,a){let n=a??this.create(),s=e.pos+t;for(;e.pos<s;){let[r,p]=e.tag();switch(r){case 1:n.kind={oneofKind:"nullValue",nullValue:e.int32()};break;case 2:n.kind={oneofKind:"numberValue",numberValue:e.double()};break;case 3:n.kind={oneofKind:"stringValue",stringValue:e.string()};break;case 4:n.kind={oneofKind:"boolValue",boolValue:e.bool()};break;case 5:n.kind={oneofKind:"structValue",structValue:D.internalBinaryRead(e,e.uint32(),i,n.kind.structValue)};break;case 6:n.kind={oneofKind:"listValue",listValue:X.internalBinaryRead(e,e.uint32(),i,n.kind.listValue)};break;default:let l=i.readUnknownField;if(l==="throw")throw new globalThis.Error(`Unknown field ${r} (wire type ${p}) for ${this.typeName}`);let c=e.skip(p);l!==!1&&(l===!0?A.onRead:l)(this.typeName,n,r,p,c)}}return n}internalBinaryWrite(e,t,i){e.kind.oneofKind==="nullValue"&&t.tag(1,I.Varint).int32(e.kind.nullValue),e.kind.oneofKind==="numberValue"&&t.tag(2,I.Bit64).double(e.kind.numberValue),e.kind.oneofKind==="stringValue"&&t.tag(3,I.LengthDelimited).string(e.kind.stringValue),e.kind.oneofKind==="boolValue"&&t.tag(4,I.Varint).bool(e.kind.boolValue),e.kind.oneofKind==="structValue"&&D.internalBinaryWrite(e.kind.structValue,t.tag(5,I.LengthDelimited).fork(),i).join(),e.kind.oneofKind==="listValue"&&X.internalBinaryWrite(e.kind.listValue,t.tag(6,I.LengthDelimited).fork(),i).join();let a=i.writeUnknownFields;return a!==!1&&(a==!0?A.onWrite:a)(this.typeName,e,t),t}},R=new Le,Ee=class extends Oe{constructor(){super("google.protobuf.ListValue",[{no:1,name:"values",kind:"message",repeat:1,T:()=>R}])}internalJsonWrite(e,t){return e.values.map(i=>R.toJson(i))}internalJsonRead(e,t,i){if(!globalThis.Array.isArray(e))throw new globalThis.Error("Unable to parse "+this.typeName+" from JSON "+Ie(e));i||(i=this.create());let a=e.map(n=>R.fromJson(n));return i.values.push(...a),i}create(e){let t=globalThis.Object.create(this.messagePrototype);return t.values=[],e!==void 0&&Se(this,t,e),t}internalBinaryRead(e,t,i,a){let n=a??this.create(),s=e.pos+t;for(;e.pos<s;){let[r,p]=e.tag();switch(r){case 1:n.values.push(R.internalBinaryRead(e,e.uint32(),i));break;default:let l=i.readUnknownField;if(l==="throw")throw new globalThis.Error(`Unknown field ${r} (wire type ${p}) for ${this.typeName}`);let c=e.skip(p);l!==!1&&(l===!0?A.onRead:l)(this.typeName,n,r,p,c)}}return n}internalBinaryWrite(e,t,i){for(let n=0;n<e.values.length;n++)R.internalBinaryWrite(e.values[n],t.tag(1,I.LengthDelimited).fork(),i).join();let a=i.writeUnknownFields;return a!==!1&&(a==!0?A.onWrite:a)(this.typeName,e,t),t}},X=new Ee;var Pe=class extends Dt{constructor(){super("mochabugapis.adapt.graph.JTDSchema",[{no:1,name:"definitions",kind:"map",K:9,V:{kind:"message",T:()=>f}},{no:2,name:"metadata",kind:"message",T:()=>D},{no:3,name:"nullable",kind:"scalar",opt:!0,T:8},{no:4,name:"ref",kind:"scalar",opt:!0,T:9},{no:5,name:"type",kind:"scalar",opt:!0,T:9},{no:6,name:"enum",kind:"scalar",repeat:2,T:9},{no:7,name:"elements",kind:"message",T:()=>f},{no:8,name:"properties",kind:"map",K:9,V:{kind:"message",T:()=>f}},{no:9,name:"optional_properties",kind:"map",K:9,V:{kind:"message",T:()=>f}},{no:10,name:"additional_properties",kind:"scalar",opt:!0,T:8},{no:11,name:"values",kind:"message",T:()=>f},{no:12,name:"discriminator",kind:"scalar",opt:!0,T:9},{no:13,name:"mapping",kind:"map",K:9,V:{kind:"message",T:()=>f}}])}create(e){let t=globalThis.Object.create(this.messagePrototype);return t.definitions={},t.enum=[],t.properties={},t.optionalProperties={},t.mapping={},e!==void 0&&Nt(this,t,e),t}internalBinaryRead(e,t,i,a){let n=a??this.create(),s=e.pos+t;for(;e.pos<s;){let[r,p]=e.tag();switch(r){case 1:this.binaryReadMap1(n.definitions,e,i);break;case 2:n.metadata=D.internalBinaryRead(e,e.uint32(),i,n.metadata);break;case 3:n.nullable=e.bool();break;case 4:n.ref=e.string();break;case 5:n.type=e.string();break;case 6:n.enum.push(e.string());break;case 7:n.elements=f.internalBinaryRead(e,e.uint32(),i,n.elements);break;case 8:this.binaryReadMap8(n.properties,e,i);break;case 9:this.binaryReadMap9(n.optionalProperties,e,i);break;case 10:n.additionalProperties=e.bool();break;case 11:n.values=f.internalBinaryRead(e,e.uint32(),i,n.values);break;case 12:n.discriminator=e.string();break;case 13:this.binaryReadMap13(n.mapping,e,i);break;default:let l=i.readUnknownField;if(l==="throw")throw new globalThis.Error(`Unknown field ${r} (wire type ${p}) for ${this.typeName}`);let c=e.skip(p);l!==!1&&(l===!0?He.onRead:l)(this.typeName,n,r,p,c)}}return n}binaryReadMap1(e,t,i){let a=t.uint32(),n=t.pos+a,s,r;for(;t.pos<n;){let[p,l]=t.tag();switch(p){case 1:s=t.string();break;case 2:r=f.internalBinaryRead(t,t.uint32(),i);break;default:throw new globalThis.Error("unknown map entry field for field mochabugapis.adapt.graph.JTDSchema.definitions")}}e[s??""]=r??f.create()}binaryReadMap8(e,t,i){let a=t.uint32(),n=t.pos+a,s,r;for(;t.pos<n;){let[p,l]=t.tag();switch(p){case 1:s=t.string();break;case 2:r=f.internalBinaryRead(t,t.uint32(),i);break;default:throw new globalThis.Error("unknown map entry field for field mochabugapis.adapt.graph.JTDSchema.properties")}}e[s??""]=r??f.create()}binaryReadMap9(e,t,i){let a=t.uint32(),n=t.pos+a,s,r;for(;t.pos<n;){let[p,l]=t.tag();switch(p){case 1:s=t.string();break;case 2:r=f.internalBinaryRead(t,t.uint32(),i);break;default:throw new globalThis.Error("unknown map entry field for field mochabugapis.adapt.graph.JTDSchema.optional_properties")}}e[s??""]=r??f.create()}binaryReadMap13(e,t,i){let a=t.uint32(),n=t.pos+a,s,r;for(;t.pos<n;){let[p,l]=t.tag();switch(p){case 1:s=t.string();break;case 2:r=f.internalBinaryRead(t,t.uint32(),i);break;default:throw new globalThis.Error("unknown map entry field for field mochabugapis.adapt.graph.JTDSchema.mapping")}}e[s??""]=r??f.create()}internalBinaryWrite(e,t,i){for(let n of globalThis.Object.keys(e.definitions))t.tag(1,y.LengthDelimited).fork().tag(1,y.LengthDelimited).string(n),t.tag(2,y.LengthDelimited).fork(),f.internalBinaryWrite(e.definitions[n],t,i),t.join().join();e.metadata&&D.internalBinaryWrite(e.metadata,t.tag(2,y.LengthDelimited).fork(),i).join(),e.nullable!==void 0&&t.tag(3,y.Varint).bool(e.nullable),e.ref!==void 0&&t.tag(4,y.LengthDelimited).string(e.ref),e.type!==void 0&&t.tag(5,y.LengthDelimited).string(e.type);for(let n=0;n<e.enum.length;n++)t.tag(6,y.LengthDelimited).string(e.enum[n]);e.elements&&f.internalBinaryWrite(e.elements,t.tag(7,y.LengthDelimited).fork(),i).join();for(let n of globalThis.Object.keys(e.properties))t.tag(8,y.LengthDelimited).fork().tag(1,y.LengthDelimited).string(n),t.tag(2,y.LengthDelimited).fork(),f.internalBinaryWrite(e.properties[n],t,i),t.join().join();for(let n of globalThis.Object.keys(e.optionalProperties))t.tag(9,y.LengthDelimited).fork().tag(1,y.LengthDelimited).string(n),t.tag(2,y.LengthDelimited).fork(),f.internalBinaryWrite(e.optionalProperties[n],t,i),t.join().join();e.additionalProperties!==void 0&&t.tag(10,y.Varint).bool(e.additionalProperties),e.values&&f.internalBinaryWrite(e.values,t.tag(11,y.LengthDelimited).fork(),i).join(),e.discriminator!==void 0&&t.tag(12,y.LengthDelimited).string(e.discriminator);for(let n of globalThis.Object.keys(e.mapping))t.tag(13,y.LengthDelimited).fork().tag(1,y.LengthDelimited).string(n),t.tag(2,y.LengthDelimited).fork(),f.internalBinaryWrite(e.mapping[n],t,i),t.join().join();let a=i.writeUnknownFields;return a!==!1&&(a==!0?He.onWrite:a)(this.typeName,e,t),t}},f=new Pe;var Ne=class extends Vt{constructor(){super("mochabugapis.adapt.graph.SignalDescriptor",[{no:1,name:"name",kind:"scalar",T:9,options:{"buf.validate.field":{string:{minLen:"1",maxLen:"50",pattern:"^[_$a-z][_$a-z0-9]*$"}}}},{no:5,name:"label",kind:"scalar",opt:!0,T:9,options:{"buf.validate.field":{string:{maxLen:"50"}}}},{no:2,name:"description",kind:"scalar",opt:!0,T:9,options:{"buf.validate.field":{string:{maxLen:"250"}}}},{no:3,name:"schema",kind:"message",T:()=>f,options:{"buf.validate.field":{required:!0}}},{no:4,name:"optional",kind:"scalar",opt:!0,T:8}])}create(e){let t=globalThis.Object.create(this.messagePrototype);return t.name="",e!==void 0&&Wt(this,t,e),t}internalBinaryRead(e,t,i,a){let n=a??this.create(),s=e.pos+t;for(;e.pos<s;){let[r,p]=e.tag();switch(r){case 1:n.name=e.string();break;case 5:n.label=e.string();break;case 2:n.description=e.string();break;case 3:n.schema=f.internalBinaryRead(e,e.uint32(),i,n.schema);break;case 4:n.optional=e.bool();break;default:let l=i.readUnknownField;if(l==="throw")throw new globalThis.Error(`Unknown field ${r} (wire type ${p}) for ${this.typeName}`);let c=e.skip(p);l!==!1&&(l===!0?Ye.onRead:l)(this.typeName,n,r,p,c)}}return n}internalBinaryWrite(e,t,i){e.name!==""&&t.tag(1,J.LengthDelimited).string(e.name),e.label!==void 0&&t.tag(5,J.LengthDelimited).string(e.label),e.description!==void 0&&t.tag(2,J.LengthDelimited).string(e.description),e.schema&&f.internalBinaryWrite(e.schema,t.tag(3,J.LengthDelimited).fork(),i).join(),e.optional!==void 0&&t.tag(4,J.Varint).bool(e.optional);let a=i.writeUnknownFields;return a!==!1&&(a==!0?Ye.onWrite:a)(this.typeName,e,t),t}},w=new Ne;var We=class extends Ut{constructor(){super("mochabugapis.adapt.graph.Transceiver",[{no:1,name:"name",kind:"scalar",T:9,options:{"buf.validate.field":{string:{minLen:"1",maxLen:"50",pattern:"^[_$a-z][_$a-z0-9]*$"}}}},{no:2,name:"description",kind:"scalar",opt:!0,T:9,options:{"buf.validate.field":{string:{maxLen:"250"}}}},{no:3,name:"signals",kind:"message",repeat:1,T:()=>w,options:{"buf.validate.field":{cel:[{id:"signals_unique_names",message:"Each signal must have a unique name.",expression:"this.map(signal, signal.name).unique()"}],repeated:{maxItems:"512"}}}}])}create(e){let t=globalThis.Object.create(this.messagePrototype);return t.name="",t.signals=[],e!==void 0&&$t(this,t,e),t}internalBinaryRead(e,t,i,a){let n=a??this.create(),s=e.pos+t;for(;e.pos<s;){let[r,p]=e.tag();switch(r){case 1:n.name=e.string();break;case 2:n.description=e.string();break;case 3:n.signals.push(w.internalBinaryRead(e,e.uint32(),i));break;default:let l=i.readUnknownField;if(l==="throw")throw new globalThis.Error(`Unknown field ${r} (wire type ${p}) for ${this.typeName}`);let c=e.skip(p);l!==!1&&(l===!0?Ze.onRead:l)(this.typeName,n,r,p,c)}}return n}internalBinaryWrite(e,t,i){e.name!==""&&t.tag(1,De.LengthDelimited).string(e.name),e.description!==void 0&&t.tag(2,De.LengthDelimited).string(e.description);for(let n=0;n<e.signals.length;n++)w.internalBinaryWrite(e.signals[n],t.tag(3,De.LengthDelimited).fork(),i).join();let a=i.writeUnknownFields;return a!==!1&&(a==!0?Ze.onWrite:a)(this.typeName,e,t),t}},V=new We;var Ve=class extends jt{constructor(){super("mochabugapis.adapt.graph.Exchange",[{no:1,name:"name",kind:"scalar",T:9,options:{"buf.validate.field":{string:{minLen:"1",maxLen:"50",pattern:"^[_$a-z][_$a-z0-9]*$"}}}},{no:2,name:"description",kind:"scalar",opt:!0,T:9,options:{"buf.validate.field":{string:{maxLen:"250"}}}},{no:3,name:"transmitters",kind:"message",repeat:1,T:()=>V,options:{"buf.validate.field":{cel:[{id:"transmitters_unique_names",message:"Each transmitter must have a unique name.",expression:"this.map(transmitter, transmitter.name).unique()"}],repeated:{maxItems:"10"}}}},{no:4,name:"receivers",kind:"message",repeat:1,T:()=>V,options:{"buf.validate.field":{cel:[{id:"receivers_unique_names",message:"Each receiver must have a unique name.",expression:"this.map(receiver, receiver.name).unique()"}],repeated:{minItems:"1",maxItems:"10"}}}}])}create(e){let t=globalThis.Object.create(this.messagePrototype);return t.name="",t.transmitters=[],t.receivers=[],e!==void 0&&Mt(this,t,e),t}internalBinaryRead(e,t,i,a){let n=a??this.create(),s=e.pos+t;for(;e.pos<s;){let[r,p]=e.tag();switch(r){case 1:n.name=e.string();break;case 2:n.description=e.string();break;case 3:n.transmitters.push(V.internalBinaryRead(e,e.uint32(),i));break;case 4:n.receivers.push(V.internalBinaryRead(e,e.uint32(),i));break;default:let l=i.readUnknownField;if(l==="throw")throw new globalThis.Error(`Unknown field ${r} (wire type ${p}) for ${this.typeName}`);let c=e.skip(p);l!==!1&&(l===!0?Xe.onRead:l)(this.typeName,n,r,p,c)}}return n}internalBinaryWrite(e,t,i){e.name!==""&&t.tag(1,Q.LengthDelimited).string(e.name),e.description!==void 0&&t.tag(2,Q.LengthDelimited).string(e.description);for(let n=0;n<e.transmitters.length;n++)V.internalBinaryWrite(e.transmitters[n],t.tag(3,Q.LengthDelimited).fork(),i).join();for(let n=0;n<e.receivers.length;n++)V.internalBinaryWrite(e.receivers[n],t.tag(4,Q.LengthDelimited).fork(),i).join();let a=i.writeUnknownFields;return a!==!1&&(a==!0?Xe.onWrite:a)(this.typeName,e,t),t}},$=new Ve;import{WireType as ee}from"@protobuf-ts/runtime";import{UnknownFieldHandler as Qe}from"@protobuf-ts/runtime";import{reflectionMergePartial as At}from"@protobuf-ts/runtime";import{MessageType as Ct}from"@protobuf-ts/runtime";var $e=class extends Ct{constructor(){super("mochabugapis.adapt.graph.Transmitter",[{no:1,name:"name",kind:"scalar",T:9,options:{"buf.validate.field":{string:{minLen:"1",maxLen:"50",pattern:"^[_$a-z][_$a-z0-9]*$"}}}},{no:2,name:"description",kind:"scalar",opt:!0,T:9,options:{"buf.validate.field":{string:{maxLen:"250"}}}},{no:3,name:"signals",kind:"message",repeat:1,T:()=>w,options:{"buf.validate.field":{cel:[{id:"signals_unique_names",message:"Each signal must have a unique name.",expression:"this.map(signal, signal.name).unique()"}],repeated:{maxItems:"512"}}}},{no:4,name:"failure",kind:"scalar",T:8}])}create(e){let t=globalThis.Object.create(this.messagePrototype);return t.name="",t.signals=[],t.failure=!1,e!==void 0&&At(this,t,e),t}internalBinaryRead(e,t,i,a){let n=a??this.create(),s=e.pos+t;for(;e.pos<s;){let[r,p]=e.tag();switch(r){case 1:n.name=e.string();break;case 2:n.description=e.string();break;case 3:n.signals.push(w.internalBinaryRead(e,e.uint32(),i));break;case 4:n.failure=e.bool();break;default:let l=i.readUnknownField;if(l==="throw")throw new globalThis.Error(`Unknown field ${r} (wire type ${p}) for ${this.typeName}`);let c=e.skip(p);l!==!1&&(l===!0?Qe.onRead:l)(this.typeName,n,r,p,c)}}return n}internalBinaryWrite(e,t,i){e.name!==""&&t.tag(1,ee.LengthDelimited).string(e.name),e.description!==void 0&&t.tag(2,ee.LengthDelimited).string(e.description);for(let n=0;n<e.signals.length;n++)w.internalBinaryWrite(e.signals[n],t.tag(3,ee.LengthDelimited).fork(),i).join();e.failure!==!1&&t.tag(4,ee.Varint).bool(e.failure);let a=i.writeUnknownFields;return a!==!1&&(a==!0?Qe.onWrite:a)(this.typeName,e,t),t}},te=new $e;import{WireType as Me}from"@protobuf-ts/runtime";import{UnknownFieldHandler as nt}from"@protobuf-ts/runtime";import{reflectionMergePartial as qt}from"@protobuf-ts/runtime";import{MessageType as zt}from"@protobuf-ts/runtime";import{WireType as ne}from"@protobuf-ts/runtime";import{UnknownFieldHandler as et}from"@protobuf-ts/runtime";import{reflectionMergePartial as Ft}from"@protobuf-ts/runtime";import{MessageType as Jt}from"@protobuf-ts/runtime";var tt=(a=>(a[a.UNSPECIFIED=0]="UNSPECIFIED",a[a.UNBOUND=1]="UNBOUND",a[a.INVALID_SOURCE=2]="INVALID_SOURCE",a[a.SCHEMA_MISMATCH=3]="SCHEMA_MISMATCH",a))(tt||{}),Ue=class extends Jt{constructor(){super("mochabugapis.adapt.graph.SignalBinding",[{no:1,name:"descriptor",kind:"message",T:()=>w,options:{"buf.validate.field":{required:!0}}},{no:2,name:"reference",kind:"scalar",oneof:"binding",T:9,options:{"buf.validate.field":{string:{maxLen:"250"}}}},{no:3,name:"constant",kind:"message",oneof:"binding",T:()=>R},{no:4,name:"error",kind:"enum",opt:!0,T:()=>["mochabugapis.adapt.graph.SignalBinding.Error",tt,"ERROR_"],options:{"buf.validate.field":{ignore:"IGNORE_EMPTY",enum:{notIn:[0]}}}}])}create(e){let t=globalThis.Object.create(this.messagePrototype);return t.binding={oneofKind:void 0},e!==void 0&&Ft(this,t,e),t}internalBinaryRead(e,t,i,a){let n=a??this.create(),s=e.pos+t;for(;e.pos<s;){let[r,p]=e.tag();switch(r){case 1:n.descriptor=w.internalBinaryRead(e,e.uint32(),i,n.descriptor);break;case 2:n.binding={oneofKind:"reference",reference:e.string()};break;case 3:n.binding={oneofKind:"constant",constant:R.internalBinaryRead(e,e.uint32(),i,n.binding.constant)};break;case 4:n.error=e.int32();break;default:let l=i.readUnknownField;if(l==="throw")throw new globalThis.Error(`Unknown field ${r} (wire type ${p}) for ${this.typeName}`);let c=e.skip(p);l!==!1&&(l===!0?et.onRead:l)(this.typeName,n,r,p,c)}}return n}internalBinaryWrite(e,t,i){e.descriptor&&w.internalBinaryWrite(e.descriptor,t.tag(1,ne.LengthDelimited).fork(),i).join(),e.binding.oneofKind==="reference"&&t.tag(2,ne.LengthDelimited).string(e.binding.reference),e.binding.oneofKind==="constant"&&R.internalBinaryWrite(e.binding.constant,t.tag(3,ne.LengthDelimited).fork(),i).join(),e.error!==void 0&&t.tag(4,ne.Varint).int32(e.error);let a=i.writeUnknownFields;return a!==!1&&(a==!0?et.onWrite:a)(this.typeName,e,t),t}},ie=new Ue;var je=class extends zt{constructor(){super("mochabugapis.adapt.graph.Receiver",[{no:1,name:"name",kind:"scalar",T:9,options:{"buf.validate.field":{string:{minLen:"1",maxLen:"50",pattern:"^[_$a-z][_$a-z0-9]*$"}}}},{no:2,name:"description",kind:"scalar",opt:!0,T:9,options:{"buf.validate.field":{string:{maxLen:"250"}}}},{no:3,name:"bindings",kind:"message",repeat:1,T:()=>ie,options:{"buf.validate.field":{cel:[{id:"bindings_unique_names",message:"Each binding must have a unique name.",expression:"this.map(binding, binding.descriptor.name).unique()"}],repeated:{maxItems:"512"}}}}])}create(e){let t=globalThis.Object.create(this.messagePrototype);return t.name="",t.bindings=[],e!==void 0&&qt(this,t,e),t}internalBinaryRead(e,t,i,a){let n=a??this.create(),s=e.pos+t;for(;e.pos<s;){let[r,p]=e.tag();switch(r){case 1:n.name=e.string();break;case 2:n.description=e.string();break;case 3:n.bindings.push(ie.internalBinaryRead(e,e.uint32(),i));break;default:let l=i.readUnknownField;if(l==="throw")throw new globalThis.Error(`Unknown field ${r} (wire type ${p}) for ${this.typeName}`);let c=e.skip(p);l!==!1&&(l===!0?nt.onRead:l)(this.typeName,n,r,p,c)}}return n}internalBinaryWrite(e,t,i){e.name!==""&&t.tag(1,Me.LengthDelimited).string(e.name),e.description!==void 0&&t.tag(2,Me.LengthDelimited).string(e.description);for(let n=0;n<e.bindings.length;n++)ie.internalBinaryWrite(e.bindings[n],t.tag(3,Me.LengthDelimited).fork(),i).join();let a=i.writeUnknownFields;return a!==!1&&(a==!0?nt.onWrite:a)(this.typeName,e,t),t}},ae=new je;var Ae=class extends Gt{constructor(){super("mochabugapis.adapt.graph.VertexConfigMetadata",[{no:1,name:"complete",kind:"scalar",T:8},{no:2,name:"receivers",kind:"message",repeat:1,T:()=>ae,options:{"buf.validate.field":{cel:[{id:"receivers_unique_names",message:"Each receiver must have a unique name.",expression:"this.map(receiver, receiver.name).unique()"}],repeated:{minItems:"1",maxItems:"50"}}}},{no:3,name:"transmitters",kind:"message",repeat:1,T:()=>te,options:{"buf.validate.field":{cel:[{id:"transmitters_unique_names",message:"Each transmitter must have a unique name.",expression:"this.map(transmitter, transmitter.name).unique()"}],repeated:{maxItems:"50"}}}},{no:4,name:"procedures",kind:"message",repeat:1,T:()=>$,options:{"buf.validate.field":{cel:[{id:"procedures_unique_names",message:"Each procedure must have a unique name.",expression:"this.map(procedure, procedure.name).unique()"}],repeated:{maxItems:"10"}}}},{no:5,name:"streams",kind:"message",repeat:1,T:()=>$,options:{"buf.validate.field":{cel:[{id:"streams_unique_names",message:"Each stream must have a unique name.",expression:"this.map(stream, stream.name).unique()"}],repeated:{maxItems:"10"}}}},{no:6,name:"cron_schedule",kind:"scalar",opt:!0,T:9,options:{"buf.validate.field":{ignore:"IGNORE_DEFAULT",string:{minLen:"1",maxLen:"100"}}}}])}create(e){let t=globalThis.Object.create(this.messagePrototype);return t.complete=!1,t.receivers=[],t.transmitters=[],t.procedures=[],t.streams=[],e!==void 0&&Kt(this,t,e),t}internalBinaryRead(e,t,i,a){let n=a??this.create(),s=e.pos+t;for(;e.pos<s;){let[r,p]=e.tag();switch(r){case 1:n.complete=e.bool();break;case 2:n.receivers.push(ae.internalBinaryRead(e,e.uint32(),i));break;case 3:n.transmitters.push(te.internalBinaryRead(e,e.uint32(),i));break;case 4:n.procedures.push($.internalBinaryRead(e,e.uint32(),i));break;case 5:n.streams.push($.internalBinaryRead(e,e.uint32(),i));break;case 6:n.cronSchedule=e.string();break;default:let l=i.readUnknownField;if(l==="throw")throw new globalThis.Error(`Unknown field ${r} (wire type ${p}) for ${this.typeName}`);let c=e.skip(p);l!==!1&&(l===!0?it.onRead:l)(this.typeName,n,r,p,c)}}return n}internalBinaryWrite(e,t,i){e.complete!==!1&&t.tag(1,C.Varint).bool(e.complete);for(let n=0;n<e.receivers.length;n++)ae.internalBinaryWrite(e.receivers[n],t.tag(2,C.LengthDelimited).fork(),i).join();for(let n=0;n<e.transmitters.length;n++)te.internalBinaryWrite(e.transmitters[n],t.tag(3,C.LengthDelimited).fork(),i).join();for(let n=0;n<e.procedures.length;n++)$.internalBinaryWrite(e.procedures[n],t.tag(4,C.LengthDelimited).fork(),i).join();for(let n=0;n<e.streams.length;n++)$.internalBinaryWrite(e.streams[n],t.tag(5,C.LengthDelimited).fork(),i).join();e.cronSchedule!==void 0&&t.tag(6,C.LengthDelimited).string(e.cronSchedule);let a=i.writeUnknownFields;return a!==!1&&(a==!0?it.onWrite:a)(this.typeName,e,t),t}},at=new Ae;import{execSync as Xt}from"child_process";import re from"fs";import{mkdirp as Ht}from"mkdirp";import oe from"path";import rt from"chalk";import{fileURLToPath as Yt}from"url";function g(o){return re.readFileSync(oe.join(oe.dirname(Yt(import.meta.url)),"..","assets",o)).toString()}function h(o,e){let t=oe.dirname(o);Ht.sync(t),re.writeFileSync(o,e)}function q(o){let e=oe.resolve(o);if(!re.existsSync(e))return console.error(rt.red(`Invalid command: Manifest file not found at ${e}.`)),null;try{let t=re.readFileSync(e).toString();return L.fromJsonString(t)}catch(t){return console.error(rt.red("An error occurred while reading the manifest")),console.error(t.message),null}}function se(o){return(o.charAt(0).toUpperCase()+o.substring(1)).replace("_"," ")}function Qt(o){switch(o){case"action":return 1;case"cron-trigger":return 3;case"external-trigger":return 4;case"browser":return 2;default:throw new Error("The node type is invalid")}}function le(o,e,t,i,a,n){let s=T.join(o,"src","vertices",e);if(z.existsSync(s))throw new Error(`The folder for the new vertex: ${s} already exists`);Zt.sync(s);let r=T.join(s,"executor.ts"),p={name:e,label:se(e),description:`The better description of what ${e} is doing, the better it is for both AI and humans`,type:Qt(t),metadata:T.join("src","vertices",e,"metadata.json"),configurator:i,mtls:[],codeOauth2:[],oauth2:[],variables:[]};if(n==="react"){Xt("npm install react react-dom @types/react @types/react-dom",{cwd:o,stdio:"inherit"});let c=T.join(o,"src/vertices",e,"ui");i&&(h(T.join(c,"configurator.App.tsx"),g("configurator.App.tsx")),h(T.join(c,"configurator.main.tsx"),g("configurator.main.tsx")),h(T.join(c,"configurator.ssg.tsx"),g("configurator.ssg.tsx"))),t==="browser"&&(h(T.join(c,"executor.App.tsx"),g("executor.App.tsx")),h(T.join(c,"executor.main.tsx"),g("executor.main.tsx")),h(T.join(c,"executor.ssg.tsx"),g("executor.ssg.tsx"))),z.existsSync(T.join(o,"build-client.js"))||h(T.join(o,"build-client.js"),g("build-client.js"))}switch(p.type){case 1:h(r,g("executor_action.ts"));break;case 2:n==="react"?h(r,g("executor_browser_react.tsx").replaceAll("___VERTEX_NAME___",e)):h(r,g("executor_browser_none.ts"));break;case 4:h(r,g("executor_external_trigger.ts"));break;case 3:h(r,g("executor_cron_trigger.ts"));break;default:throw new Error("The vertex type is invalid")}z.writeFileSync(T.join(o,"src","executors.ts"),ot([e,...a.map(c=>c.name)],"ExecutorEnvironment"));let l={complete:!0,receivers:[{name:"input",description:"Default input receiver",bindings:[]}],transmitters:[{name:"output",description:"Default output transmitter",signals:[],failure:!1}],procedures:[],streams:[]};return p.type===3&&(l.cronSchedule="/5 * * * * *"),i&&(n==="react"?h(T.join(s,"configurator.ts"),g("configurator_react.tsx").replaceAll("___VERTEX_NAME___",e)):h(T.join(s,"configurator.ts"),g("configurator_none.ts")),l.complete=!1,z.writeFileSync(T.join(o,"src","configurators.ts"),ot([e,...a.filter(c=>c.configurator).map(c=>c.name)],"ConfiguratorEnvironment"))),z.writeFileSync(T.join(s,"metadata.json"),at.toJsonString(l,{prettySpaces:2})),p}function ot(o,e){let t=o.map(i=>`import ${i} from './vertices/${i}/${e==="ExecutorEnvironment"?"executor":"configurator"}';`).join(`
|
|
2
|
+
var k={name:"@mochabug/adaptkit",version:"1.0.0-beta.6"};import m from"chalk";import{program as P}from"commander";import Bn from"figlet";import _n from"fs";import Ln from"is-valid-hostname";import En from"path";import Sn from"semver";import In from"update-notifier";import{confirm as en,input as tn,select as st}from"@inquirer/prompts";import Ce from"chalk";import nn from"fs";import{ServiceType as St}from"@protobuf-ts/runtime-rpc";import{WireType as u}from"@protobuf-ts/runtime";import{UnknownFieldHandler as v}from"@protobuf-ts/runtime";import{reflectionMergePartial as E}from"@protobuf-ts/runtime";import{MessageType as S}from"@protobuf-ts/runtime";var Be=(n=>(n[n.UNSPECIFIED=0]="UNSPECIFIED",n[n.ACTION=1]="ACTION",n[n.BROWSER=2]="BROWSER",n[n.CRON_TRIGGER=3]="CRON_TRIGGER",n[n.EXTERNAL_TRIGGER=4]="EXTERNAL_TRIGGER",n))(Be||{}),Je=(a=>(a[a.UNSPECIFIED=0]="UNSPECIFIED",a[a.SECRET=1]="SECRET",a[a.STRING=2]="STRING",a[a.SWITCH=3]="SWITCH",a))(Je||{}),qe=(t=>(t[t.UNSPECIFIED=0]="UNSPECIFIED",t[t.RS256=1]="RS256",t))(qe||{}),ze=(n=>(n[n.UNSPECIFIED=0]="UNSPECIFIED",n[n.AUTHORIZATION_CODE=1]="AUTHORIZATION_CODE",n[n.CLIENT_CREDENTIALS=2]="CLIENT_CREDENTIALS",n[n.JWT_BEARER=3]="JWT_BEARER",n[n.SAML2_BEARER=4]="SAML2_BEARER",n))(ze||{}),Ke=(s=>(s[s.UNSPECIFIED=0]="UNSPECIFIED",s[s.BASIC=1]="BASIC",s[s.FORM=2]="FORM",s[s.PRIVATE_KEY_JWT=3]="PRIVATE_KEY_JWT",s[s.MTLS=4]="MTLS",s[s.SAML2_BEARER=5]="SAML2_BEARER",s))(Ke||{}),ge=class extends S{constructor(){super("mochabugapis.adapt.plugins.v1.UploadPluginRequest",[{no:1,name:"manifest",kind:"message",oneof:"data",T:()=>L},{no:2,name:"file",kind:"message",oneof:"data",T:()=>ue}])}create(e){let t=globalThis.Object.create(this.messagePrototype);return t.data={oneofKind:void 0},e!==void 0&&E(this,t,e),t}internalBinaryRead(e,t,i,a){let n=a??this.create(),s=e.pos+t;for(;e.pos<s;){let[r,p]=e.tag();switch(r){case 1:n.data={oneofKind:"manifest",manifest:L.internalBinaryRead(e,e.uint32(),i,n.data.manifest)};break;case 2:n.data={oneofKind:"file",file:ue.internalBinaryRead(e,e.uint32(),i,n.data.file)};break;default:let l=i.readUnknownField;if(l==="throw")throw new globalThis.Error(`Unknown field ${r} (wire type ${p}) for ${this.typeName}`);let c=e.skip(p);l!==!1&&(l===!0?v.onRead:l)(this.typeName,n,r,p,c)}}return n}internalBinaryWrite(e,t,i){e.data.oneofKind==="manifest"&&L.internalBinaryWrite(e.data.manifest,t.tag(1,u.LengthDelimited).fork(),i).join(),e.data.oneofKind==="file"&&ue.internalBinaryWrite(e.data.file,t.tag(2,u.LengthDelimited).fork(),i).join();let a=i.writeUnknownFields;return a!==!1&&(a==!0?v.onWrite:a)(this.typeName,e,t),t}},It=new ge,he=class extends S{constructor(){super("mochabugapis.adapt.plugins.v1.UploadPluginResponse",[])}create(e){let t=globalThis.Object.create(this.messagePrototype);return e!==void 0&&E(this,t,e),t}internalBinaryRead(e,t,i,a){return a??this.create()}internalBinaryWrite(e,t,i){let a=i.writeUnknownFields;return a!==!1&&(a==!0?v.onWrite:a)(this.typeName,e,t),t}},Ot=new he,be=class extends S{constructor(){super("mochabugapis.adapt.plugins.v1.File",[{no:1,name:"path",kind:"scalar",T:9,options:{"buf.validate.field":{string:{minLen:"2",maxLen:"4096",pattern:"^[^/]+(\\/[^/]+)*$"}}}},{no:2,name:"data",kind:"scalar",T:12,options:{"buf.validate.field":{bytes:{minLen:"1",maxLen:"40000000"}}}}])}create(e){let t=globalThis.Object.create(this.messagePrototype);return t.path="",t.data=new Uint8Array(0),e!==void 0&&E(this,t,e),t}internalBinaryRead(e,t,i,a){let n=a??this.create(),s=e.pos+t;for(;e.pos<s;){let[r,p]=e.tag();switch(r){case 1:n.path=e.string();break;case 2:n.data=e.bytes();break;default:let l=i.readUnknownField;if(l==="throw")throw new globalThis.Error(`Unknown field ${r} (wire type ${p}) for ${this.typeName}`);let c=e.skip(p);l!==!1&&(l===!0?v.onRead:l)(this.typeName,n,r,p,c)}}return n}internalBinaryWrite(e,t,i){e.path!==""&&t.tag(1,u.LengthDelimited).string(e.path),e.data.length&&t.tag(2,u.LengthDelimited).bytes(e.data);let a=i.writeUnknownFields;return a!==!1&&(a==!0?v.onWrite:a)(this.typeName,e,t),t}},ue=new be,ye=class extends S{constructor(){super("mochabugapis.adapt.plugins.v1.Manifest",[{no:1,name:"name",kind:"scalar",T:9,options:{"buf.validate.field":{string:{minLen:"1",maxLen:"100",pattern:"^[_$a-z][_$a-z0-9]*$"}}}},{no:2,name:"version",kind:"scalar",T:9,options:{"buf.validate.field":{string:{minLen:"5",maxLen:"150",pattern:"^(0|[1-9]\\d*)\\.(0|[1-9]\\d*)\\.(0|[1-9]\\d*)(?:-((?:0|[1-9]\\d*|\\d*[a-zA-Z-][0-9a-zA-Z-]*)(?:\\.(?:0|[1-9]\\d*|\\d*[a-zA-Z-][0-9a-zA-Z-]*))*))?(?:\\+([0-9a-zA-Z-]+(?:\\.[0-9a-zA-Z-]+)*))?$"}}}},{no:3,name:"label",kind:"scalar",T:9,options:{"buf.validate.field":{string:{minLen:"1",maxLen:"100"}}}},{no:4,name:"description",kind:"scalar",T:9,options:{"buf.validate.field":{string:{minLen:"1",maxLen:"250"}}}},{no:5,name:"organization",kind:"scalar",T:9,options:{"buf.validate.field":{string:{uuid:!0}}}},{no:6,name:"homepage",kind:"scalar",opt:!0,T:9,options:{"buf.validate.field":{ignore:"IGNORE_EMPTY",string:{minLen:"11",maxLen:"4096",pattern:"^https://[a-zA-Z0-9.-]+(?:\\.[a-zA-Z]{2,})(?:/.*)?$"}}}},{no:7,name:"repository",kind:"scalar",opt:!0,T:9,options:{"buf.validate.field":{ignore:"IGNORE_EMPTY",string:{minLen:"11",maxLen:"4096",pattern:"^https://[a-zA-Z0-9.-]+(?:\\.[a-zA-Z]{2,})(?:/.*)?$"}}}},{no:8,name:"bugs",kind:"scalar",opt:!0,T:9,options:{"buf.validate.field":{cel:[{id:"valid_email_or_url",message:"bugs must be a valid email or URL",expression:"size(this) >= 2 && size(this) <= 4096 && (this.isEmail() || this.matches('^https://[a-zA-Z0-9.-]+(?:\\\\.[a-zA-Z]{2,})(?:/.*)?$'))"}],ignore:"IGNORE_EMPTY"}}},{no:9,name:"author",kind:"scalar",opt:!0,T:9,options:{"buf.validate.field":{ignore:"IGNORE_EMPTY",string:{minLen:"1",maxLen:"100"}}}},{no:10,name:"logo",kind:"scalar",opt:!0,T:9,options:{"buf.validate.field":{ignore:"IGNORE_EMPTY",string:{minLen:"2",maxLen:"4096",pattern:"^([^/]+(/[^/]+)*)\\.(gif|jpg|jpeg|jfif|pjpeg|pjp|png|svg|webp|avif)$"}}}},{no:11,name:"executors",kind:"scalar",T:9,options:{"buf.validate.field":{string:{minLen:"2",maxLen:"4096",pattern:"^([^/]+(/[^/]+)*)\\.(mjs|js)$"}}}},{no:12,name:"configurators",kind:"scalar",opt:!0,T:9,options:{"buf.validate.field":{ignore:"IGNORE_EMPTY",string:{minLen:"2",maxLen:"4096",pattern:"^([^/]+(/[^/]+)*)\\.(mjs|js)$"}}}},{no:13,name:"assets",kind:"scalar",opt:!0,T:9,options:{"buf.validate.field":{string:{minLen:"2",maxLen:"4096",pattern:"^[^/]+(\\/[^/]+)*$"}}}},{no:14,name:"cdn",kind:"scalar",opt:!0,T:9,options:{"buf.validate.field":{string:{minLen:"2",maxLen:"4096",pattern:"^[^/]+(\\/[^/]+)*$"}}}},{no:15,name:"vertices",kind:"message",repeat:1,T:()=>de,options:{"buf.validate.field":{cel:[{id:"vertex_unique_names",message:"a name cannot appear more than once",expression:"this.map(vertex, vertex.name).unique()"}],repeated:{minItems:"1",maxItems:"100"}}}},{no:16,name:"plugin_oauth2",kind:"message",repeat:1,T:()=>j,options:{"buf.validate.field":{cel:[{id:"plugin_oauth2.oauth_unique_names",message:"a name cannot appear more than once",expression:"this.map(oauth, oauth.name).unique()"}],repeated:{minItems:"0",maxItems:"20",items:{cel:[{id:"plugin_oauth2.oauth2.client_id",message:"The client_id property must be set",expression:"has(this.client_id)"}]}}}}},{no:17,name:"plugin_variables",kind:"message",repeat:1,T:()=>M,options:{"buf.validate.field":{cel:[{id:"vars_unique_names",message:"a name cannot appear more than once",expression:"this.map(variable, variable.name).unique()"}],repeated:{minItems:"0",maxItems:"100"}}}},{no:18,name:"plugin_mtls",kind:"message",repeat:1,T:()=>U,options:{"buf.validate.field":{cel:[{id:"mtls_unique_names",message:"a name cannot appear more than once",expression:"this.map(mtls, mtls.name).unique()"}],repeated:{minItems:"0",maxItems:"20"}}}}])}create(e){let t=globalThis.Object.create(this.messagePrototype);return t.name="",t.version="",t.label="",t.description="",t.organization="",t.executors="",t.vertices=[],t.pluginOauth2=[],t.pluginVariables=[],t.pluginMtls=[],e!==void 0&&E(this,t,e),t}internalBinaryRead(e,t,i,a){let n=a??this.create(),s=e.pos+t;for(;e.pos<s;){let[r,p]=e.tag();switch(r){case 1:n.name=e.string();break;case 2:n.version=e.string();break;case 3:n.label=e.string();break;case 4:n.description=e.string();break;case 5:n.organization=e.string();break;case 6:n.homepage=e.string();break;case 7:n.repository=e.string();break;case 8:n.bugs=e.string();break;case 9:n.author=e.string();break;case 10:n.logo=e.string();break;case 11:n.executors=e.string();break;case 12:n.configurators=e.string();break;case 13:n.assets=e.string();break;case 14:n.cdn=e.string();break;case 15:n.vertices.push(de.internalBinaryRead(e,e.uint32(),i));break;case 16:n.pluginOauth2.push(j.internalBinaryRead(e,e.uint32(),i));break;case 17:n.pluginVariables.push(M.internalBinaryRead(e,e.uint32(),i));break;case 18:n.pluginMtls.push(U.internalBinaryRead(e,e.uint32(),i));break;default:let l=i.readUnknownField;if(l==="throw")throw new globalThis.Error(`Unknown field ${r} (wire type ${p}) for ${this.typeName}`);let c=e.skip(p);l!==!1&&(l===!0?v.onRead:l)(this.typeName,n,r,p,c)}}return n}internalBinaryWrite(e,t,i){e.name!==""&&t.tag(1,u.LengthDelimited).string(e.name),e.version!==""&&t.tag(2,u.LengthDelimited).string(e.version),e.label!==""&&t.tag(3,u.LengthDelimited).string(e.label),e.description!==""&&t.tag(4,u.LengthDelimited).string(e.description),e.organization!==""&&t.tag(5,u.LengthDelimited).string(e.organization),e.homepage!==void 0&&t.tag(6,u.LengthDelimited).string(e.homepage),e.repository!==void 0&&t.tag(7,u.LengthDelimited).string(e.repository),e.bugs!==void 0&&t.tag(8,u.LengthDelimited).string(e.bugs),e.author!==void 0&&t.tag(9,u.LengthDelimited).string(e.author),e.logo!==void 0&&t.tag(10,u.LengthDelimited).string(e.logo),e.executors!==""&&t.tag(11,u.LengthDelimited).string(e.executors),e.configurators!==void 0&&t.tag(12,u.LengthDelimited).string(e.configurators),e.assets!==void 0&&t.tag(13,u.LengthDelimited).string(e.assets),e.cdn!==void 0&&t.tag(14,u.LengthDelimited).string(e.cdn);for(let n=0;n<e.vertices.length;n++)de.internalBinaryWrite(e.vertices[n],t.tag(15,u.LengthDelimited).fork(),i).join();for(let n=0;n<e.pluginOauth2.length;n++)j.internalBinaryWrite(e.pluginOauth2[n],t.tag(16,u.LengthDelimited).fork(),i).join();for(let n=0;n<e.pluginVariables.length;n++)M.internalBinaryWrite(e.pluginVariables[n],t.tag(17,u.LengthDelimited).fork(),i).join();for(let n=0;n<e.pluginMtls.length;n++)U.internalBinaryWrite(e.pluginMtls[n],t.tag(18,u.LengthDelimited).fork(),i).join();let a=i.writeUnknownFields;return a!==!1&&(a==!0?v.onWrite:a)(this.typeName,e,t),t}},L=new ye,ke=class extends S{constructor(){super("mochabugapis.adapt.plugins.v1.Vertex",[{no:1,name:"name",kind:"scalar",T:9,options:{"buf.validate.field":{string:{minLen:"1",maxLen:"100",pattern:"^[_$a-z][_$a-z0-9]*$"}}}},{no:2,name:"label",kind:"scalar",T:9,options:{"buf.validate.field":{string:{minLen:"1",maxLen:"100"}}}},{no:3,name:"description",kind:"scalar",opt:!0,T:9,options:{"buf.validate.field":{ignore:"IGNORE_EMPTY",string:{minLen:"1",maxLen:"250"}}}},{no:4,name:"logo",kind:"scalar",opt:!0,T:9,options:{"buf.validate.field":{ignore:"IGNORE_EMPTY",string:{minLen:"2",maxLen:"4096",pattern:"^([^/]+(/[^/]+)*)\\.(gif|jpg|jpeg|jfif|pjpeg|pjp|png|svg|webp|avif)$"}}}},{no:5,name:"type",kind:"enum",T:()=>["mochabugapis.adapt.plugins.v1.Vertex.VertexType",Be,"VERTEX_TYPE_"],options:{"buf.validate.field":{enum:{notIn:[0]}}}},{no:6,name:"config",kind:"scalar",opt:!0,T:9,options:{"buf.validate.field":{string:{minLen:"5",maxLen:"4096",pattern:"^([^/]+(/[^/]+)*)"}}}},{no:7,name:"metadata",kind:"scalar",T:9,options:{"buf.validate.field":{string:{minLen:"5",maxLen:"4096",pattern:"^([^/]+(/[^/]+)*)\\.json$"}}}},{no:8,name:"configurator",kind:"scalar",T:8},{no:9,name:"variables",kind:"message",repeat:1,T:()=>M,options:{"buf.validate.field":{cel:[{id:"vars_unique_names",message:"a name cannot appear more than once",expression:"this.map(variable, variable.name).unique()"}],repeated:{minItems:"0",maxItems:"100"}}}},{no:10,name:"mtls",kind:"message",repeat:1,T:()=>U,options:{"buf.validate.field":{cel:[{id:"mtls_unique_names",message:"a name cannot appear more than once",expression:"this.map(mtls, mtls.name).unique()"}],repeated:{minItems:"0",maxItems:"100"}}}},{no:11,name:"code_oauth2",kind:"message",repeat:1,T:()=>me,options:{"buf.validate.field":{cel:[{id:"vertex.code_oauth2.unique_names",message:"a name cannot appear more than once",expression:"this.map(oauth, oauth.name).unique()"}],repeated:{minItems:"0",maxItems:"20"}}}},{no:12,name:"oauth2",kind:"message",repeat:1,T:()=>j,options:{"buf.validate.field":{cel:[{id:"vertex.oauth2.unique_names",message:"a name cannot appear more than once",expression:"this.map(oauth, oauth.name).unique()"}],repeated:{minItems:"0",maxItems:"20",items:{cel:[{id:"vertex.oauth2.client_id_and_code",message:"The client_id and the code property may not be set as well as the code grant type",expression:"!has(this.client_id) && !has(this.code) && this.grant_type != 1"}]}}}}}],{"buf.validate.message":{cel:[{id:"vertex.oauth2_and_code_bindings",message:"The names of the oauth2 services and the code bindings must be unique",expression:"(this.oauth2.map(val, val.name) + this.code_oauth2.map(val, val.name)).unique()"}]}})}create(e){let t=globalThis.Object.create(this.messagePrototype);return t.name="",t.label="",t.type=0,t.metadata="",t.configurator=!1,t.variables=[],t.mtls=[],t.codeOauth2=[],t.oauth2=[],e!==void 0&&E(this,t,e),t}internalBinaryRead(e,t,i,a){let n=a??this.create(),s=e.pos+t;for(;e.pos<s;){let[r,p]=e.tag();switch(r){case 1:n.name=e.string();break;case 2:n.label=e.string();break;case 3:n.description=e.string();break;case 4:n.logo=e.string();break;case 5:n.type=e.int32();break;case 6:n.config=e.string();break;case 7:n.metadata=e.string();break;case 8:n.configurator=e.bool();break;case 9:n.variables.push(M.internalBinaryRead(e,e.uint32(),i));break;case 10:n.mtls.push(U.internalBinaryRead(e,e.uint32(),i));break;case 11:n.codeOauth2.push(me.internalBinaryRead(e,e.uint32(),i));break;case 12:n.oauth2.push(j.internalBinaryRead(e,e.uint32(),i));break;default:let l=i.readUnknownField;if(l==="throw")throw new globalThis.Error(`Unknown field ${r} (wire type ${p}) for ${this.typeName}`);let c=e.skip(p);l!==!1&&(l===!0?v.onRead:l)(this.typeName,n,r,p,c)}}return n}internalBinaryWrite(e,t,i){e.name!==""&&t.tag(1,u.LengthDelimited).string(e.name),e.label!==""&&t.tag(2,u.LengthDelimited).string(e.label),e.description!==void 0&&t.tag(3,u.LengthDelimited).string(e.description),e.logo!==void 0&&t.tag(4,u.LengthDelimited).string(e.logo),e.type!==0&&t.tag(5,u.Varint).int32(e.type),e.config!==void 0&&t.tag(6,u.LengthDelimited).string(e.config),e.metadata!==""&&t.tag(7,u.LengthDelimited).string(e.metadata),e.configurator!==!1&&t.tag(8,u.Varint).bool(e.configurator);for(let n=0;n<e.variables.length;n++)M.internalBinaryWrite(e.variables[n],t.tag(9,u.LengthDelimited).fork(),i).join();for(let n=0;n<e.mtls.length;n++)U.internalBinaryWrite(e.mtls[n],t.tag(10,u.LengthDelimited).fork(),i).join();for(let n=0;n<e.codeOauth2.length;n++)me.internalBinaryWrite(e.codeOauth2[n],t.tag(11,u.LengthDelimited).fork(),i).join();for(let n=0;n<e.oauth2.length;n++)j.internalBinaryWrite(e.oauth2[n],t.tag(12,u.LengthDelimited).fork(),i).join();let a=i.writeUnknownFields;return a!==!1&&(a==!0?v.onWrite:a)(this.typeName,e,t),t}},de=new ke,ve=class extends S{constructor(){super("mochabugapis.adapt.plugins.v1.MTLSService",[{no:1,name:"name",kind:"scalar",T:9,options:{"buf.validate.field":{string:{minLen:"1",maxLen:"100",pattern:"^[_$a-z][_$a-z0-9]*$"}}}},{no:2,name:"label",kind:"scalar",opt:!0,T:9,options:{"buf.validate.field":{ignore:"IGNORE_EMPTY",string:{minLen:"1",maxLen:"100"}}}},{no:3,name:"description",kind:"scalar",opt:!0,T:9,options:{"buf.validate.field":{ignore:"IGNORE_EMPTY",string:{minLen:"1",maxLen:"250"}}}},{no:4,name:"optional",kind:"scalar",opt:!0,T:8}])}create(e){let t=globalThis.Object.create(this.messagePrototype);return t.name="",e!==void 0&&E(this,t,e),t}internalBinaryRead(e,t,i,a){let n=a??this.create(),s=e.pos+t;for(;e.pos<s;){let[r,p]=e.tag();switch(r){case 1:n.name=e.string();break;case 2:n.label=e.string();break;case 3:n.description=e.string();break;case 4:n.optional=e.bool();break;default:let l=i.readUnknownField;if(l==="throw")throw new globalThis.Error(`Unknown field ${r} (wire type ${p}) for ${this.typeName}`);let c=e.skip(p);l!==!1&&(l===!0?v.onRead:l)(this.typeName,n,r,p,c)}}return n}internalBinaryWrite(e,t,i){e.name!==""&&t.tag(1,u.LengthDelimited).string(e.name),e.label!==void 0&&t.tag(2,u.LengthDelimited).string(e.label),e.description!==void 0&&t.tag(3,u.LengthDelimited).string(e.description),e.optional!==void 0&&t.tag(4,u.Varint).bool(e.optional);let a=i.writeUnknownFields;return a!==!1&&(a==!0?v.onWrite:a)(this.typeName,e,t),t}},U=new ve,Te=class extends S{constructor(){super("mochabugapis.adapt.plugins.v1.VariableService",[{no:1,name:"name",kind:"scalar",T:9,options:{"buf.validate.field":{string:{minLen:"1",maxLen:"100",pattern:"^[_$a-z][_$a-z0-9]*$"}}}},{no:2,name:"label",kind:"scalar",opt:!0,T:9,options:{"buf.validate.field":{string:{minLen:"1",maxLen:"100"}}}},{no:3,name:"description",kind:"scalar",opt:!0,T:9,options:{"buf.validate.field":{ignore:"IGNORE_EMPTY",string:{minLen:"1",maxLen:"250"}}}},{no:4,name:"type",kind:"enum",T:()=>["mochabugapis.adapt.plugins.v1.VariableService.Type",Je,"TYPE_"],options:{"buf.validate.field":{enum:{notIn:[0]}}}},{no:5,name:"optional",kind:"scalar",opt:!0,T:8}])}create(e){let t=globalThis.Object.create(this.messagePrototype);return t.name="",t.type=0,e!==void 0&&E(this,t,e),t}internalBinaryRead(e,t,i,a){let n=a??this.create(),s=e.pos+t;for(;e.pos<s;){let[r,p]=e.tag();switch(r){case 1:n.name=e.string();break;case 2:n.label=e.string();break;case 3:n.description=e.string();break;case 4:n.type=e.int32();break;case 5:n.optional=e.bool();break;default:let l=i.readUnknownField;if(l==="throw")throw new globalThis.Error(`Unknown field ${r} (wire type ${p}) for ${this.typeName}`);let c=e.skip(p);l!==!1&&(l===!0?v.onRead:l)(this.typeName,n,r,p,c)}}return n}internalBinaryWrite(e,t,i){e.name!==""&&t.tag(1,u.LengthDelimited).string(e.name),e.label!==void 0&&t.tag(2,u.LengthDelimited).string(e.label),e.description!==void 0&&t.tag(3,u.LengthDelimited).string(e.description),e.type!==0&&t.tag(4,u.Varint).int32(e.type),e.optional!==void 0&&t.tag(5,u.Varint).bool(e.optional);let a=i.writeUnknownFields;return a!==!1&&(a==!0?v.onWrite:a)(this.typeName,e,t),t}},M=new Te,xe=class extends S{constructor(){super("mochabugapis.adapt.plugins.v1.Oauth2Service",[{no:1,name:"name",kind:"scalar",T:9,options:{"buf.validate.field":{string:{minLen:"1",maxLen:"100",pattern:"^[_$a-z][_$a-z0-9]*$"}}}},{no:2,name:"label",kind:"scalar",opt:!0,T:9,options:{"buf.validate.field":{ignore:"IGNORE_EMPTY",string:{minLen:"1",maxLen:"100"}}}},{no:3,name:"description",kind:"scalar",opt:!0,T:9,options:{"buf.validate.field":{ignore:"IGNORE_EMPTY",string:{minLen:"1",maxLen:"250"}}}},{no:4,name:"grant_type",kind:"enum",T:()=>["mochabugapis.adapt.plugins.v1.Oauth2GrantType",ze,"OAUTH2_GRANT_TYPE_"],options:{"buf.validate.field":{enum:{notIn:[0]}}}},{no:5,name:"scopes",kind:"scalar",repeat:2,T:9,options:{"buf.validate.field":{repeated:{minItems:"1",maxItems:"500",unique:!0,items:{string:{minLen:"1",maxLen:"100"}}}}}},{no:6,name:"auth_method",kind:"enum",opt:!0,T:()=>["mochabugapis.adapt.plugins.v1.Oauth2AuthType",Ke,"OAUTH2_AUTH_TYPE_"],options:{"buf.validate.field":{ignore:"IGNORE_EMPTY",enum:{notIn:[0]}}}},{no:7,name:"alg",kind:"enum",opt:!0,T:()=>["mochabugapis.adapt.plugins.v1.PrivateKeyAlg",qe,"PRIVATE_KEY_ALG_"],options:{"buf.validate.field":{ignore:"IGNORE_EMPTY",enum:{notIn:[0]}}}},{no:8,name:"client_id",kind:"scalar",opt:!0,T:9,options:{"buf.validate.field":{ignore:"IGNORE_EMPTY",string:{minLen:"1",maxLen:"250"}}}},{no:9,name:"token_endpoint",kind:"scalar",T:9,options:{"buf.validate.field":{string:{minLen:"11",maxLen:"4096",pattern:"^https://[a-zA-Z0-9.-]+(?:\\.[a-zA-Z]{2,})(?:/.*)?$"}}}},{no:10,name:"code",kind:"message",T:()=>fe},{no:11,name:"optional",kind:"scalar",opt:!0,T:8}],{"buf.validate.message":{cel:[{id:"oauth2.auth_method",message:"The auth_method property must be set in case of grant_type OAUTH2_GRANT_TYPE_AUTHORIZATION_CODE or OAUTH2_GRANT_TYPE_CLIENT_CREDENTIALS",expression:"has(this.auth_method) == (this.grant_type == 1 || this.grant_type == 2)"},{id:"oauth2.alg",message:"The alg property must be set in case of grant_type OAUTH2_GRANT_TYPE_JWT_BEARER, OAUTH2_GRANT_TYPE_SAML2_BEARER or auth_method OAUTH2_AUTH_TYPE_PRIVATE_KEY_JWT, OAUTH2_AUTH_TYPE_SAML2_BEARER",expression:"has(this.alg) == (this.grant_type == 3 || this.grant_type == 4 || this.auth_method == 3 || this.auth_method == 5)"},{id:"oauth2.code",message:"The code property must be set in case of grant_type OAUTH2_GRANT_TYPE_AUTHORIZATION_CODE",expression:"has(this.code) == (this.grant_type == 1)"},{id:"oauth2.optional",message:"The optional property cannot be set to true in case of grant_type OAUTH2_GRANT_TYPE_AUTHORIZATION_CODE",expression:"!has(this.optional) || this.grant_type != 1 || (!this.optional && this.grant_type == 1)"}]}})}create(e){let t=globalThis.Object.create(this.messagePrototype);return t.name="",t.grantType=0,t.scopes=[],t.tokenEndpoint="",e!==void 0&&E(this,t,e),t}internalBinaryRead(e,t,i,a){let n=a??this.create(),s=e.pos+t;for(;e.pos<s;){let[r,p]=e.tag();switch(r){case 1:n.name=e.string();break;case 2:n.label=e.string();break;case 3:n.description=e.string();break;case 4:n.grantType=e.int32();break;case 5:n.scopes.push(e.string());break;case 6:n.authMethod=e.int32();break;case 7:n.alg=e.int32();break;case 8:n.clientId=e.string();break;case 9:n.tokenEndpoint=e.string();break;case 10:n.code=fe.internalBinaryRead(e,e.uint32(),i,n.code);break;case 11:n.optional=e.bool();break;default:let l=i.readUnknownField;if(l==="throw")throw new globalThis.Error(`Unknown field ${r} (wire type ${p}) for ${this.typeName}`);let c=e.skip(p);l!==!1&&(l===!0?v.onRead:l)(this.typeName,n,r,p,c)}}return n}internalBinaryWrite(e,t,i){e.name!==""&&t.tag(1,u.LengthDelimited).string(e.name),e.label!==void 0&&t.tag(2,u.LengthDelimited).string(e.label),e.description!==void 0&&t.tag(3,u.LengthDelimited).string(e.description),e.grantType!==0&&t.tag(4,u.Varint).int32(e.grantType);for(let n=0;n<e.scopes.length;n++)t.tag(5,u.LengthDelimited).string(e.scopes[n]);e.authMethod!==void 0&&t.tag(6,u.Varint).int32(e.authMethod),e.alg!==void 0&&t.tag(7,u.Varint).int32(e.alg),e.clientId!==void 0&&t.tag(8,u.LengthDelimited).string(e.clientId),e.tokenEndpoint!==""&&t.tag(9,u.LengthDelimited).string(e.tokenEndpoint),e.code&&fe.internalBinaryWrite(e.code,t.tag(10,u.LengthDelimited).fork(),i).join(),e.optional!==void 0&&t.tag(11,u.Varint).bool(e.optional);let a=i.writeUnknownFields;return a!==!1&&(a==!0?v.onWrite:a)(this.typeName,e,t),t}},j=new xe,Re=class extends S{constructor(){super("mochabugapis.adapt.plugins.v1.Oauth2CodeBinding",[{no:1,name:"name",kind:"scalar",T:9,options:{"buf.validate.field":{string:{minLen:"1",maxLen:"100",pattern:"^[_$a-z][_$a-z0-9]*$"}}}},{no:2,name:"optional",kind:"scalar",opt:!0,T:8}])}create(e){let t=globalThis.Object.create(this.messagePrototype);return t.name="",e!==void 0&&E(this,t,e),t}internalBinaryRead(e,t,i,a){let n=a??this.create(),s=e.pos+t;for(;e.pos<s;){let[r,p]=e.tag();switch(r){case 1:n.name=e.string();break;case 2:n.optional=e.bool();break;default:let l=i.readUnknownField;if(l==="throw")throw new globalThis.Error(`Unknown field ${r} (wire type ${p}) for ${this.typeName}`);let c=e.skip(p);l!==!1&&(l===!0?v.onRead:l)(this.typeName,n,r,p,c)}}return n}internalBinaryWrite(e,t,i){e.name!==""&&t.tag(1,u.LengthDelimited).string(e.name),e.optional!==void 0&&t.tag(2,u.Varint).bool(e.optional);let a=i.writeUnknownFields;return a!==!1&&(a==!0?v.onWrite:a)(this.typeName,e,t),t}},me=new Re,we=class extends S{constructor(){super("mochabugapis.adapt.plugins.v1.Oauth2Code",[{no:1,name:"auth_endpoint",kind:"scalar",T:9,options:{"buf.validate.field":{string:{minLen:"11",maxLen:"4096",pattern:"^https://[a-zA-Z0-9.-]+(?:\\.[a-zA-Z]{2,})(?:/.*)?$"}}}},{no:2,name:"issuer",kind:"scalar",T:9,options:{"buf.validate.field":{string:{minLen:"1",maxLen:"4096"}}}},{no:3,name:"jwks_uri",kind:"scalar",T:9,options:{"buf.validate.field":{string:{minLen:"11",maxLen:"4096",pattern:"^https://[a-zA-Z0-9.-]+(?:\\.[a-zA-Z]{2,})(?:/.*)?$"}}}},{no:4,name:"additional_params",kind:"map",K:9,V:{kind:"scalar",T:9},options:{"buf.validate.field":{map:{minPairs:"0",maxPairs:"50",keys:{string:{minLen:"1",maxLen:"250"}},values:{string:{minLen:"1",maxLen:"250"}}}}}},{no:5,name:"use_pkce",kind:"scalar",T:8}])}create(e){let t=globalThis.Object.create(this.messagePrototype);return t.authEndpoint="",t.issuer="",t.jwksUri="",t.additionalParams={},t.usePkce=!1,e!==void 0&&E(this,t,e),t}internalBinaryRead(e,t,i,a){let n=a??this.create(),s=e.pos+t;for(;e.pos<s;){let[r,p]=e.tag();switch(r){case 1:n.authEndpoint=e.string();break;case 2:n.issuer=e.string();break;case 3:n.jwksUri=e.string();break;case 4:this.binaryReadMap4(n.additionalParams,e,i);break;case 5:n.usePkce=e.bool();break;default:let l=i.readUnknownField;if(l==="throw")throw new globalThis.Error(`Unknown field ${r} (wire type ${p}) for ${this.typeName}`);let c=e.skip(p);l!==!1&&(l===!0?v.onRead:l)(this.typeName,n,r,p,c)}}return n}binaryReadMap4(e,t,i){let a=t.uint32(),n=t.pos+a,s,r;for(;t.pos<n;){let[p,l]=t.tag();switch(p){case 1:s=t.string();break;case 2:r=t.string();break;default:throw new globalThis.Error("unknown map entry field for field mochabugapis.adapt.plugins.v1.Oauth2Code.additional_params")}}e[s??""]=r??""}internalBinaryWrite(e,t,i){e.authEndpoint!==""&&t.tag(1,u.LengthDelimited).string(e.authEndpoint),e.issuer!==""&&t.tag(2,u.LengthDelimited).string(e.issuer),e.jwksUri!==""&&t.tag(3,u.LengthDelimited).string(e.jwksUri);for(let n of globalThis.Object.keys(e.additionalParams))t.tag(4,u.LengthDelimited).fork().tag(1,u.LengthDelimited).string(n).tag(2,u.LengthDelimited).string(e.additionalParams[n]).join();e.usePkce!==!1&&t.tag(5,u.Varint).bool(e.usePkce);let a=i.writeUnknownFields;return a!==!1&&(a==!0?v.onWrite:a)(this.typeName,e,t),t}},fe=new we,Z=new St("mochabugapis.adapt.plugins.v1.PluginService",[{name:"UploadPlugin",clientStreaming:!0,options:{"google.api.http":{post:"/v1/plugins/upload",body:"*"}},I:It,O:Ot}],{"google.api.default_host":"adapt.mochabugapis.com","google.api.oauth_scopes":"https://www.mochabugapis.com/auth/adapt/plugins,https://www.mochabugapis.com/auth/adapt/plugins.upload"});import z from"fs";import{mkdirp as Zt}from"mkdirp";import T from"path";import{WireType as C}from"@protobuf-ts/runtime";import{UnknownFieldHandler as it}from"@protobuf-ts/runtime";import{reflectionMergePartial as Kt}from"@protobuf-ts/runtime";import{MessageType as Gt}from"@protobuf-ts/runtime";import{WireType as Q}from"@protobuf-ts/runtime";import{UnknownFieldHandler as Xe}from"@protobuf-ts/runtime";import{reflectionMergePartial as Mt}from"@protobuf-ts/runtime";import{MessageType as jt}from"@protobuf-ts/runtime";import{WireType as De}from"@protobuf-ts/runtime";import{UnknownFieldHandler as Ze}from"@protobuf-ts/runtime";import{reflectionMergePartial as $t}from"@protobuf-ts/runtime";import{MessageType as Ut}from"@protobuf-ts/runtime";import{WireType as J}from"@protobuf-ts/runtime";import{UnknownFieldHandler as Ye}from"@protobuf-ts/runtime";import{reflectionMergePartial as Wt}from"@protobuf-ts/runtime";import{MessageType as Vt}from"@protobuf-ts/runtime";import{WireType as y}from"@protobuf-ts/runtime";import{UnknownFieldHandler as He}from"@protobuf-ts/runtime";import{reflectionMergePartial as Nt}from"@protobuf-ts/runtime";import{MessageType as Dt}from"@protobuf-ts/runtime";import{WireType as I}from"@protobuf-ts/runtime";import{UnknownFieldHandler as A}from"@protobuf-ts/runtime";import{reflectionMergePartial as Se}from"@protobuf-ts/runtime";import{isJsonObject as Pt}from"@protobuf-ts/runtime";import{typeofJsonValue as Ie}from"@protobuf-ts/runtime";import{MessageType as Oe}from"@protobuf-ts/runtime";var Ge=(e=>(e[e.NULL_VALUE=0]="NULL_VALUE",e))(Ge||{}),_e=class extends Oe{constructor(){super("google.protobuf.Struct",[{no:1,name:"fields",kind:"map",K:9,V:{kind:"message",T:()=>R}}])}internalJsonWrite(e,t){let i={};for(let[a,n]of Object.entries(e.fields))i[a]=R.toJson(n);return i}internalJsonRead(e,t,i){if(!Pt(e))throw new globalThis.Error("Unable to parse message "+this.typeName+" from JSON "+Ie(e)+".");i||(i=this.create());for(let[a,n]of globalThis.Object.entries(e))i.fields[a]=R.fromJson(n);return i}create(e){let t=globalThis.Object.create(this.messagePrototype);return t.fields={},e!==void 0&&Se(this,t,e),t}internalBinaryRead(e,t,i,a){let n=a??this.create(),s=e.pos+t;for(;e.pos<s;){let[r,p]=e.tag();switch(r){case 1:this.binaryReadMap1(n.fields,e,i);break;default:let l=i.readUnknownField;if(l==="throw")throw new globalThis.Error(`Unknown field ${r} (wire type ${p}) for ${this.typeName}`);let c=e.skip(p);l!==!1&&(l===!0?A.onRead:l)(this.typeName,n,r,p,c)}}return n}binaryReadMap1(e,t,i){let a=t.uint32(),n=t.pos+a,s,r;for(;t.pos<n;){let[p,l]=t.tag();switch(p){case 1:s=t.string();break;case 2:r=R.internalBinaryRead(t,t.uint32(),i);break;default:throw new globalThis.Error("unknown map entry field for field google.protobuf.Struct.fields")}}e[s??""]=r??R.create()}internalBinaryWrite(e,t,i){for(let n of globalThis.Object.keys(e.fields))t.tag(1,I.LengthDelimited).fork().tag(1,I.LengthDelimited).string(n),t.tag(2,I.LengthDelimited).fork(),R.internalBinaryWrite(e.fields[n],t,i),t.join().join();let a=i.writeUnknownFields;return a!==!1&&(a==!0?A.onWrite:a)(this.typeName,e,t),t}},D=new _e,Le=class extends Oe{constructor(){super("google.protobuf.Value",[{no:1,name:"null_value",kind:"enum",oneof:"kind",T:()=>["google.protobuf.NullValue",Ge]},{no:2,name:"number_value",kind:"scalar",oneof:"kind",T:1},{no:3,name:"string_value",kind:"scalar",oneof:"kind",T:9},{no:4,name:"bool_value",kind:"scalar",oneof:"kind",T:8},{no:5,name:"struct_value",kind:"message",oneof:"kind",T:()=>D},{no:6,name:"list_value",kind:"message",oneof:"kind",T:()=>X}])}internalJsonWrite(e,t){if(e.kind.oneofKind===void 0)throw new globalThis.Error;switch(e.kind.oneofKind){case void 0:throw new globalThis.Error;case"boolValue":return e.kind.boolValue;case"nullValue":return null;case"numberValue":let i=e.kind.numberValue;if(typeof i=="number"&&!Number.isFinite(i))throw new globalThis.Error;return i;case"stringValue":return e.kind.stringValue;case"listValue":let a=this.fields.find(s=>s.no===6);if(a?.kind!=="message")throw new globalThis.Error;return a.T().toJson(e.kind.listValue);case"structValue":let n=this.fields.find(s=>s.no===5);if(n?.kind!=="message")throw new globalThis.Error;return n.T().toJson(e.kind.structValue)}}internalJsonRead(e,t,i){switch(i||(i=this.create()),typeof e){case"number":i.kind={oneofKind:"numberValue",numberValue:e};break;case"string":i.kind={oneofKind:"stringValue",stringValue:e};break;case"boolean":i.kind={oneofKind:"boolValue",boolValue:e};break;case"object":e===null?i.kind={oneofKind:"nullValue",nullValue:0}:globalThis.Array.isArray(e)?i.kind={oneofKind:"listValue",listValue:X.fromJson(e)}:i.kind={oneofKind:"structValue",structValue:D.fromJson(e)};break;default:throw new globalThis.Error("Unable to parse "+this.typeName+" from JSON "+Ie(e))}return i}create(e){let t=globalThis.Object.create(this.messagePrototype);return t.kind={oneofKind:void 0},e!==void 0&&Se(this,t,e),t}internalBinaryRead(e,t,i,a){let n=a??this.create(),s=e.pos+t;for(;e.pos<s;){let[r,p]=e.tag();switch(r){case 1:n.kind={oneofKind:"nullValue",nullValue:e.int32()};break;case 2:n.kind={oneofKind:"numberValue",numberValue:e.double()};break;case 3:n.kind={oneofKind:"stringValue",stringValue:e.string()};break;case 4:n.kind={oneofKind:"boolValue",boolValue:e.bool()};break;case 5:n.kind={oneofKind:"structValue",structValue:D.internalBinaryRead(e,e.uint32(),i,n.kind.structValue)};break;case 6:n.kind={oneofKind:"listValue",listValue:X.internalBinaryRead(e,e.uint32(),i,n.kind.listValue)};break;default:let l=i.readUnknownField;if(l==="throw")throw new globalThis.Error(`Unknown field ${r} (wire type ${p}) for ${this.typeName}`);let c=e.skip(p);l!==!1&&(l===!0?A.onRead:l)(this.typeName,n,r,p,c)}}return n}internalBinaryWrite(e,t,i){e.kind.oneofKind==="nullValue"&&t.tag(1,I.Varint).int32(e.kind.nullValue),e.kind.oneofKind==="numberValue"&&t.tag(2,I.Bit64).double(e.kind.numberValue),e.kind.oneofKind==="stringValue"&&t.tag(3,I.LengthDelimited).string(e.kind.stringValue),e.kind.oneofKind==="boolValue"&&t.tag(4,I.Varint).bool(e.kind.boolValue),e.kind.oneofKind==="structValue"&&D.internalBinaryWrite(e.kind.structValue,t.tag(5,I.LengthDelimited).fork(),i).join(),e.kind.oneofKind==="listValue"&&X.internalBinaryWrite(e.kind.listValue,t.tag(6,I.LengthDelimited).fork(),i).join();let a=i.writeUnknownFields;return a!==!1&&(a==!0?A.onWrite:a)(this.typeName,e,t),t}},R=new Le,Ee=class extends Oe{constructor(){super("google.protobuf.ListValue",[{no:1,name:"values",kind:"message",repeat:1,T:()=>R}])}internalJsonWrite(e,t){return e.values.map(i=>R.toJson(i))}internalJsonRead(e,t,i){if(!globalThis.Array.isArray(e))throw new globalThis.Error("Unable to parse "+this.typeName+" from JSON "+Ie(e));i||(i=this.create());let a=e.map(n=>R.fromJson(n));return i.values.push(...a),i}create(e){let t=globalThis.Object.create(this.messagePrototype);return t.values=[],e!==void 0&&Se(this,t,e),t}internalBinaryRead(e,t,i,a){let n=a??this.create(),s=e.pos+t;for(;e.pos<s;){let[r,p]=e.tag();switch(r){case 1:n.values.push(R.internalBinaryRead(e,e.uint32(),i));break;default:let l=i.readUnknownField;if(l==="throw")throw new globalThis.Error(`Unknown field ${r} (wire type ${p}) for ${this.typeName}`);let c=e.skip(p);l!==!1&&(l===!0?A.onRead:l)(this.typeName,n,r,p,c)}}return n}internalBinaryWrite(e,t,i){for(let n=0;n<e.values.length;n++)R.internalBinaryWrite(e.values[n],t.tag(1,I.LengthDelimited).fork(),i).join();let a=i.writeUnknownFields;return a!==!1&&(a==!0?A.onWrite:a)(this.typeName,e,t),t}},X=new Ee;var Pe=class extends Dt{constructor(){super("mochabugapis.adapt.graph.JTDSchema",[{no:1,name:"definitions",kind:"map",K:9,V:{kind:"message",T:()=>f}},{no:2,name:"metadata",kind:"message",T:()=>D},{no:3,name:"nullable",kind:"scalar",opt:!0,T:8},{no:4,name:"ref",kind:"scalar",opt:!0,T:9},{no:5,name:"type",kind:"scalar",opt:!0,T:9},{no:6,name:"enum",kind:"scalar",repeat:2,T:9},{no:7,name:"elements",kind:"message",T:()=>f},{no:8,name:"properties",kind:"map",K:9,V:{kind:"message",T:()=>f}},{no:9,name:"optional_properties",kind:"map",K:9,V:{kind:"message",T:()=>f}},{no:10,name:"additional_properties",kind:"scalar",opt:!0,T:8},{no:11,name:"values",kind:"message",T:()=>f},{no:12,name:"discriminator",kind:"scalar",opt:!0,T:9},{no:13,name:"mapping",kind:"map",K:9,V:{kind:"message",T:()=>f}}])}create(e){let t=globalThis.Object.create(this.messagePrototype);return t.definitions={},t.enum=[],t.properties={},t.optionalProperties={},t.mapping={},e!==void 0&&Nt(this,t,e),t}internalBinaryRead(e,t,i,a){let n=a??this.create(),s=e.pos+t;for(;e.pos<s;){let[r,p]=e.tag();switch(r){case 1:this.binaryReadMap1(n.definitions,e,i);break;case 2:n.metadata=D.internalBinaryRead(e,e.uint32(),i,n.metadata);break;case 3:n.nullable=e.bool();break;case 4:n.ref=e.string();break;case 5:n.type=e.string();break;case 6:n.enum.push(e.string());break;case 7:n.elements=f.internalBinaryRead(e,e.uint32(),i,n.elements);break;case 8:this.binaryReadMap8(n.properties,e,i);break;case 9:this.binaryReadMap9(n.optionalProperties,e,i);break;case 10:n.additionalProperties=e.bool();break;case 11:n.values=f.internalBinaryRead(e,e.uint32(),i,n.values);break;case 12:n.discriminator=e.string();break;case 13:this.binaryReadMap13(n.mapping,e,i);break;default:let l=i.readUnknownField;if(l==="throw")throw new globalThis.Error(`Unknown field ${r} (wire type ${p}) for ${this.typeName}`);let c=e.skip(p);l!==!1&&(l===!0?He.onRead:l)(this.typeName,n,r,p,c)}}return n}binaryReadMap1(e,t,i){let a=t.uint32(),n=t.pos+a,s,r;for(;t.pos<n;){let[p,l]=t.tag();switch(p){case 1:s=t.string();break;case 2:r=f.internalBinaryRead(t,t.uint32(),i);break;default:throw new globalThis.Error("unknown map entry field for field mochabugapis.adapt.graph.JTDSchema.definitions")}}e[s??""]=r??f.create()}binaryReadMap8(e,t,i){let a=t.uint32(),n=t.pos+a,s,r;for(;t.pos<n;){let[p,l]=t.tag();switch(p){case 1:s=t.string();break;case 2:r=f.internalBinaryRead(t,t.uint32(),i);break;default:throw new globalThis.Error("unknown map entry field for field mochabugapis.adapt.graph.JTDSchema.properties")}}e[s??""]=r??f.create()}binaryReadMap9(e,t,i){let a=t.uint32(),n=t.pos+a,s,r;for(;t.pos<n;){let[p,l]=t.tag();switch(p){case 1:s=t.string();break;case 2:r=f.internalBinaryRead(t,t.uint32(),i);break;default:throw new globalThis.Error("unknown map entry field for field mochabugapis.adapt.graph.JTDSchema.optional_properties")}}e[s??""]=r??f.create()}binaryReadMap13(e,t,i){let a=t.uint32(),n=t.pos+a,s,r;for(;t.pos<n;){let[p,l]=t.tag();switch(p){case 1:s=t.string();break;case 2:r=f.internalBinaryRead(t,t.uint32(),i);break;default:throw new globalThis.Error("unknown map entry field for field mochabugapis.adapt.graph.JTDSchema.mapping")}}e[s??""]=r??f.create()}internalBinaryWrite(e,t,i){for(let n of globalThis.Object.keys(e.definitions))t.tag(1,y.LengthDelimited).fork().tag(1,y.LengthDelimited).string(n),t.tag(2,y.LengthDelimited).fork(),f.internalBinaryWrite(e.definitions[n],t,i),t.join().join();e.metadata&&D.internalBinaryWrite(e.metadata,t.tag(2,y.LengthDelimited).fork(),i).join(),e.nullable!==void 0&&t.tag(3,y.Varint).bool(e.nullable),e.ref!==void 0&&t.tag(4,y.LengthDelimited).string(e.ref),e.type!==void 0&&t.tag(5,y.LengthDelimited).string(e.type);for(let n=0;n<e.enum.length;n++)t.tag(6,y.LengthDelimited).string(e.enum[n]);e.elements&&f.internalBinaryWrite(e.elements,t.tag(7,y.LengthDelimited).fork(),i).join();for(let n of globalThis.Object.keys(e.properties))t.tag(8,y.LengthDelimited).fork().tag(1,y.LengthDelimited).string(n),t.tag(2,y.LengthDelimited).fork(),f.internalBinaryWrite(e.properties[n],t,i),t.join().join();for(let n of globalThis.Object.keys(e.optionalProperties))t.tag(9,y.LengthDelimited).fork().tag(1,y.LengthDelimited).string(n),t.tag(2,y.LengthDelimited).fork(),f.internalBinaryWrite(e.optionalProperties[n],t,i),t.join().join();e.additionalProperties!==void 0&&t.tag(10,y.Varint).bool(e.additionalProperties),e.values&&f.internalBinaryWrite(e.values,t.tag(11,y.LengthDelimited).fork(),i).join(),e.discriminator!==void 0&&t.tag(12,y.LengthDelimited).string(e.discriminator);for(let n of globalThis.Object.keys(e.mapping))t.tag(13,y.LengthDelimited).fork().tag(1,y.LengthDelimited).string(n),t.tag(2,y.LengthDelimited).fork(),f.internalBinaryWrite(e.mapping[n],t,i),t.join().join();let a=i.writeUnknownFields;return a!==!1&&(a==!0?He.onWrite:a)(this.typeName,e,t),t}},f=new Pe;var Ne=class extends Vt{constructor(){super("mochabugapis.adapt.graph.SignalDescriptor",[{no:1,name:"name",kind:"scalar",T:9,options:{"buf.validate.field":{string:{minLen:"1",maxLen:"50",pattern:"^[_$a-z][_$a-z0-9]*$"}}}},{no:5,name:"label",kind:"scalar",opt:!0,T:9,options:{"buf.validate.field":{string:{maxLen:"50"}}}},{no:2,name:"description",kind:"scalar",opt:!0,T:9,options:{"buf.validate.field":{string:{maxLen:"250"}}}},{no:3,name:"schema",kind:"message",T:()=>f,options:{"buf.validate.field":{required:!0}}},{no:4,name:"optional",kind:"scalar",opt:!0,T:8}])}create(e){let t=globalThis.Object.create(this.messagePrototype);return t.name="",e!==void 0&&Wt(this,t,e),t}internalBinaryRead(e,t,i,a){let n=a??this.create(),s=e.pos+t;for(;e.pos<s;){let[r,p]=e.tag();switch(r){case 1:n.name=e.string();break;case 5:n.label=e.string();break;case 2:n.description=e.string();break;case 3:n.schema=f.internalBinaryRead(e,e.uint32(),i,n.schema);break;case 4:n.optional=e.bool();break;default:let l=i.readUnknownField;if(l==="throw")throw new globalThis.Error(`Unknown field ${r} (wire type ${p}) for ${this.typeName}`);let c=e.skip(p);l!==!1&&(l===!0?Ye.onRead:l)(this.typeName,n,r,p,c)}}return n}internalBinaryWrite(e,t,i){e.name!==""&&t.tag(1,J.LengthDelimited).string(e.name),e.label!==void 0&&t.tag(5,J.LengthDelimited).string(e.label),e.description!==void 0&&t.tag(2,J.LengthDelimited).string(e.description),e.schema&&f.internalBinaryWrite(e.schema,t.tag(3,J.LengthDelimited).fork(),i).join(),e.optional!==void 0&&t.tag(4,J.Varint).bool(e.optional);let a=i.writeUnknownFields;return a!==!1&&(a==!0?Ye.onWrite:a)(this.typeName,e,t),t}},w=new Ne;var We=class extends Ut{constructor(){super("mochabugapis.adapt.graph.Transceiver",[{no:1,name:"name",kind:"scalar",T:9,options:{"buf.validate.field":{string:{minLen:"1",maxLen:"50",pattern:"^[_$a-z][_$a-z0-9]*$"}}}},{no:2,name:"description",kind:"scalar",opt:!0,T:9,options:{"buf.validate.field":{string:{maxLen:"250"}}}},{no:3,name:"signals",kind:"message",repeat:1,T:()=>w,options:{"buf.validate.field":{cel:[{id:"signals_unique_names",message:"Each signal must have a unique name.",expression:"this.map(signal, signal.name).unique()"}],repeated:{maxItems:"512"}}}}])}create(e){let t=globalThis.Object.create(this.messagePrototype);return t.name="",t.signals=[],e!==void 0&&$t(this,t,e),t}internalBinaryRead(e,t,i,a){let n=a??this.create(),s=e.pos+t;for(;e.pos<s;){let[r,p]=e.tag();switch(r){case 1:n.name=e.string();break;case 2:n.description=e.string();break;case 3:n.signals.push(w.internalBinaryRead(e,e.uint32(),i));break;default:let l=i.readUnknownField;if(l==="throw")throw new globalThis.Error(`Unknown field ${r} (wire type ${p}) for ${this.typeName}`);let c=e.skip(p);l!==!1&&(l===!0?Ze.onRead:l)(this.typeName,n,r,p,c)}}return n}internalBinaryWrite(e,t,i){e.name!==""&&t.tag(1,De.LengthDelimited).string(e.name),e.description!==void 0&&t.tag(2,De.LengthDelimited).string(e.description);for(let n=0;n<e.signals.length;n++)w.internalBinaryWrite(e.signals[n],t.tag(3,De.LengthDelimited).fork(),i).join();let a=i.writeUnknownFields;return a!==!1&&(a==!0?Ze.onWrite:a)(this.typeName,e,t),t}},V=new We;var Ve=class extends jt{constructor(){super("mochabugapis.adapt.graph.Exchange",[{no:1,name:"name",kind:"scalar",T:9,options:{"buf.validate.field":{string:{minLen:"1",maxLen:"50",pattern:"^[_$a-z][_$a-z0-9]*$"}}}},{no:2,name:"description",kind:"scalar",opt:!0,T:9,options:{"buf.validate.field":{string:{maxLen:"250"}}}},{no:3,name:"transmitters",kind:"message",repeat:1,T:()=>V,options:{"buf.validate.field":{cel:[{id:"transmitters_unique_names",message:"Each transmitter must have a unique name.",expression:"this.map(transmitter, transmitter.name).unique()"}],repeated:{maxItems:"10"}}}},{no:4,name:"receivers",kind:"message",repeat:1,T:()=>V,options:{"buf.validate.field":{cel:[{id:"receivers_unique_names",message:"Each receiver must have a unique name.",expression:"this.map(receiver, receiver.name).unique()"}],repeated:{minItems:"1",maxItems:"10"}}}}])}create(e){let t=globalThis.Object.create(this.messagePrototype);return t.name="",t.transmitters=[],t.receivers=[],e!==void 0&&Mt(this,t,e),t}internalBinaryRead(e,t,i,a){let n=a??this.create(),s=e.pos+t;for(;e.pos<s;){let[r,p]=e.tag();switch(r){case 1:n.name=e.string();break;case 2:n.description=e.string();break;case 3:n.transmitters.push(V.internalBinaryRead(e,e.uint32(),i));break;case 4:n.receivers.push(V.internalBinaryRead(e,e.uint32(),i));break;default:let l=i.readUnknownField;if(l==="throw")throw new globalThis.Error(`Unknown field ${r} (wire type ${p}) for ${this.typeName}`);let c=e.skip(p);l!==!1&&(l===!0?Xe.onRead:l)(this.typeName,n,r,p,c)}}return n}internalBinaryWrite(e,t,i){e.name!==""&&t.tag(1,Q.LengthDelimited).string(e.name),e.description!==void 0&&t.tag(2,Q.LengthDelimited).string(e.description);for(let n=0;n<e.transmitters.length;n++)V.internalBinaryWrite(e.transmitters[n],t.tag(3,Q.LengthDelimited).fork(),i).join();for(let n=0;n<e.receivers.length;n++)V.internalBinaryWrite(e.receivers[n],t.tag(4,Q.LengthDelimited).fork(),i).join();let a=i.writeUnknownFields;return a!==!1&&(a==!0?Xe.onWrite:a)(this.typeName,e,t),t}},$=new Ve;import{WireType as ee}from"@protobuf-ts/runtime";import{UnknownFieldHandler as Qe}from"@protobuf-ts/runtime";import{reflectionMergePartial as At}from"@protobuf-ts/runtime";import{MessageType as Ct}from"@protobuf-ts/runtime";var $e=class extends Ct{constructor(){super("mochabugapis.adapt.graph.Transmitter",[{no:1,name:"name",kind:"scalar",T:9,options:{"buf.validate.field":{string:{minLen:"1",maxLen:"50",pattern:"^[_$a-z][_$a-z0-9]*$"}}}},{no:2,name:"description",kind:"scalar",opt:!0,T:9,options:{"buf.validate.field":{string:{maxLen:"250"}}}},{no:3,name:"signals",kind:"message",repeat:1,T:()=>w,options:{"buf.validate.field":{cel:[{id:"signals_unique_names",message:"Each signal must have a unique name.",expression:"this.map(signal, signal.name).unique()"}],repeated:{maxItems:"512"}}}},{no:4,name:"failure",kind:"scalar",T:8}])}create(e){let t=globalThis.Object.create(this.messagePrototype);return t.name="",t.signals=[],t.failure=!1,e!==void 0&&At(this,t,e),t}internalBinaryRead(e,t,i,a){let n=a??this.create(),s=e.pos+t;for(;e.pos<s;){let[r,p]=e.tag();switch(r){case 1:n.name=e.string();break;case 2:n.description=e.string();break;case 3:n.signals.push(w.internalBinaryRead(e,e.uint32(),i));break;case 4:n.failure=e.bool();break;default:let l=i.readUnknownField;if(l==="throw")throw new globalThis.Error(`Unknown field ${r} (wire type ${p}) for ${this.typeName}`);let c=e.skip(p);l!==!1&&(l===!0?Qe.onRead:l)(this.typeName,n,r,p,c)}}return n}internalBinaryWrite(e,t,i){e.name!==""&&t.tag(1,ee.LengthDelimited).string(e.name),e.description!==void 0&&t.tag(2,ee.LengthDelimited).string(e.description);for(let n=0;n<e.signals.length;n++)w.internalBinaryWrite(e.signals[n],t.tag(3,ee.LengthDelimited).fork(),i).join();e.failure!==!1&&t.tag(4,ee.Varint).bool(e.failure);let a=i.writeUnknownFields;return a!==!1&&(a==!0?Qe.onWrite:a)(this.typeName,e,t),t}},te=new $e;import{WireType as Me}from"@protobuf-ts/runtime";import{UnknownFieldHandler as nt}from"@protobuf-ts/runtime";import{reflectionMergePartial as qt}from"@protobuf-ts/runtime";import{MessageType as zt}from"@protobuf-ts/runtime";import{WireType as ne}from"@protobuf-ts/runtime";import{UnknownFieldHandler as et}from"@protobuf-ts/runtime";import{reflectionMergePartial as Ft}from"@protobuf-ts/runtime";import{MessageType as Jt}from"@protobuf-ts/runtime";var tt=(a=>(a[a.UNSPECIFIED=0]="UNSPECIFIED",a[a.UNBOUND=1]="UNBOUND",a[a.INVALID_SOURCE=2]="INVALID_SOURCE",a[a.SCHEMA_MISMATCH=3]="SCHEMA_MISMATCH",a))(tt||{}),Ue=class extends Jt{constructor(){super("mochabugapis.adapt.graph.SignalBinding",[{no:1,name:"descriptor",kind:"message",T:()=>w,options:{"buf.validate.field":{required:!0}}},{no:2,name:"reference",kind:"scalar",oneof:"binding",T:9,options:{"buf.validate.field":{string:{maxLen:"250"}}}},{no:3,name:"constant",kind:"message",oneof:"binding",T:()=>R},{no:4,name:"error",kind:"enum",opt:!0,T:()=>["mochabugapis.adapt.graph.SignalBinding.Error",tt,"ERROR_"],options:{"buf.validate.field":{ignore:"IGNORE_EMPTY",enum:{notIn:[0]}}}}])}create(e){let t=globalThis.Object.create(this.messagePrototype);return t.binding={oneofKind:void 0},e!==void 0&&Ft(this,t,e),t}internalBinaryRead(e,t,i,a){let n=a??this.create(),s=e.pos+t;for(;e.pos<s;){let[r,p]=e.tag();switch(r){case 1:n.descriptor=w.internalBinaryRead(e,e.uint32(),i,n.descriptor);break;case 2:n.binding={oneofKind:"reference",reference:e.string()};break;case 3:n.binding={oneofKind:"constant",constant:R.internalBinaryRead(e,e.uint32(),i,n.binding.constant)};break;case 4:n.error=e.int32();break;default:let l=i.readUnknownField;if(l==="throw")throw new globalThis.Error(`Unknown field ${r} (wire type ${p}) for ${this.typeName}`);let c=e.skip(p);l!==!1&&(l===!0?et.onRead:l)(this.typeName,n,r,p,c)}}return n}internalBinaryWrite(e,t,i){e.descriptor&&w.internalBinaryWrite(e.descriptor,t.tag(1,ne.LengthDelimited).fork(),i).join(),e.binding.oneofKind==="reference"&&t.tag(2,ne.LengthDelimited).string(e.binding.reference),e.binding.oneofKind==="constant"&&R.internalBinaryWrite(e.binding.constant,t.tag(3,ne.LengthDelimited).fork(),i).join(),e.error!==void 0&&t.tag(4,ne.Varint).int32(e.error);let a=i.writeUnknownFields;return a!==!1&&(a==!0?et.onWrite:a)(this.typeName,e,t),t}},ie=new Ue;var je=class extends zt{constructor(){super("mochabugapis.adapt.graph.Receiver",[{no:1,name:"name",kind:"scalar",T:9,options:{"buf.validate.field":{string:{minLen:"1",maxLen:"50",pattern:"^[_$a-z][_$a-z0-9]*$"}}}},{no:2,name:"description",kind:"scalar",opt:!0,T:9,options:{"buf.validate.field":{string:{maxLen:"250"}}}},{no:3,name:"bindings",kind:"message",repeat:1,T:()=>ie,options:{"buf.validate.field":{cel:[{id:"bindings_unique_names",message:"Each binding must have a unique name.",expression:"this.map(binding, binding.descriptor.name).unique()"}],repeated:{maxItems:"512"}}}}])}create(e){let t=globalThis.Object.create(this.messagePrototype);return t.name="",t.bindings=[],e!==void 0&&qt(this,t,e),t}internalBinaryRead(e,t,i,a){let n=a??this.create(),s=e.pos+t;for(;e.pos<s;){let[r,p]=e.tag();switch(r){case 1:n.name=e.string();break;case 2:n.description=e.string();break;case 3:n.bindings.push(ie.internalBinaryRead(e,e.uint32(),i));break;default:let l=i.readUnknownField;if(l==="throw")throw new globalThis.Error(`Unknown field ${r} (wire type ${p}) for ${this.typeName}`);let c=e.skip(p);l!==!1&&(l===!0?nt.onRead:l)(this.typeName,n,r,p,c)}}return n}internalBinaryWrite(e,t,i){e.name!==""&&t.tag(1,Me.LengthDelimited).string(e.name),e.description!==void 0&&t.tag(2,Me.LengthDelimited).string(e.description);for(let n=0;n<e.bindings.length;n++)ie.internalBinaryWrite(e.bindings[n],t.tag(3,Me.LengthDelimited).fork(),i).join();let a=i.writeUnknownFields;return a!==!1&&(a==!0?nt.onWrite:a)(this.typeName,e,t),t}},ae=new je;var Ae=class extends Gt{constructor(){super("mochabugapis.adapt.graph.VertexConfigMetadata",[{no:1,name:"complete",kind:"scalar",T:8},{no:2,name:"receivers",kind:"message",repeat:1,T:()=>ae,options:{"buf.validate.field":{cel:[{id:"receivers_unique_names",message:"Each receiver must have a unique name.",expression:"this.map(receiver, receiver.name).unique()"}],repeated:{minItems:"1",maxItems:"50"}}}},{no:3,name:"transmitters",kind:"message",repeat:1,T:()=>te,options:{"buf.validate.field":{cel:[{id:"transmitters_unique_names",message:"Each transmitter must have a unique name.",expression:"this.map(transmitter, transmitter.name).unique()"}],repeated:{maxItems:"50"}}}},{no:4,name:"procedures",kind:"message",repeat:1,T:()=>$,options:{"buf.validate.field":{cel:[{id:"procedures_unique_names",message:"Each procedure must have a unique name.",expression:"this.map(procedure, procedure.name).unique()"}],repeated:{maxItems:"10"}}}},{no:5,name:"streams",kind:"message",repeat:1,T:()=>$,options:{"buf.validate.field":{cel:[{id:"streams_unique_names",message:"Each stream must have a unique name.",expression:"this.map(stream, stream.name).unique()"}],repeated:{maxItems:"10"}}}},{no:6,name:"cron_schedule",kind:"scalar",opt:!0,T:9,options:{"buf.validate.field":{ignore:"IGNORE_DEFAULT",string:{minLen:"1",maxLen:"100"}}}}])}create(e){let t=globalThis.Object.create(this.messagePrototype);return t.complete=!1,t.receivers=[],t.transmitters=[],t.procedures=[],t.streams=[],e!==void 0&&Kt(this,t,e),t}internalBinaryRead(e,t,i,a){let n=a??this.create(),s=e.pos+t;for(;e.pos<s;){let[r,p]=e.tag();switch(r){case 1:n.complete=e.bool();break;case 2:n.receivers.push(ae.internalBinaryRead(e,e.uint32(),i));break;case 3:n.transmitters.push(te.internalBinaryRead(e,e.uint32(),i));break;case 4:n.procedures.push($.internalBinaryRead(e,e.uint32(),i));break;case 5:n.streams.push($.internalBinaryRead(e,e.uint32(),i));break;case 6:n.cronSchedule=e.string();break;default:let l=i.readUnknownField;if(l==="throw")throw new globalThis.Error(`Unknown field ${r} (wire type ${p}) for ${this.typeName}`);let c=e.skip(p);l!==!1&&(l===!0?it.onRead:l)(this.typeName,n,r,p,c)}}return n}internalBinaryWrite(e,t,i){e.complete!==!1&&t.tag(1,C.Varint).bool(e.complete);for(let n=0;n<e.receivers.length;n++)ae.internalBinaryWrite(e.receivers[n],t.tag(2,C.LengthDelimited).fork(),i).join();for(let n=0;n<e.transmitters.length;n++)te.internalBinaryWrite(e.transmitters[n],t.tag(3,C.LengthDelimited).fork(),i).join();for(let n=0;n<e.procedures.length;n++)$.internalBinaryWrite(e.procedures[n],t.tag(4,C.LengthDelimited).fork(),i).join();for(let n=0;n<e.streams.length;n++)$.internalBinaryWrite(e.streams[n],t.tag(5,C.LengthDelimited).fork(),i).join();e.cronSchedule!==void 0&&t.tag(6,C.LengthDelimited).string(e.cronSchedule);let a=i.writeUnknownFields;return a!==!1&&(a==!0?it.onWrite:a)(this.typeName,e,t),t}},at=new Ae;import{execSync as Xt}from"child_process";import re from"fs";import{mkdirp as Ht}from"mkdirp";import oe from"path";import rt from"chalk";import{fileURLToPath as Yt}from"url";function g(o){return re.readFileSync(oe.join(oe.dirname(Yt(import.meta.url)),"..","assets",o)).toString()}function h(o,e){let t=oe.dirname(o);Ht.sync(t),re.writeFileSync(o,e)}function q(o){let e=oe.resolve(o);if(!re.existsSync(e))return console.error(rt.red(`Invalid command: Manifest file not found at ${e}.`)),null;try{let t=re.readFileSync(e).toString();return L.fromJsonString(t)}catch(t){return console.error(rt.red("An error occurred while reading the manifest")),console.error(t.message),null}}function se(o){return(o.charAt(0).toUpperCase()+o.substring(1)).replace("_"," ")}function Qt(o){switch(o){case"action":return 1;case"cron-trigger":return 3;case"external-trigger":return 4;case"browser":return 2;default:throw new Error("The node type is invalid")}}function le(o,e,t,i,a,n){let s=T.join(o,"src","vertices",e);if(z.existsSync(s))throw new Error(`The folder for the new vertex: ${s} already exists`);Zt.sync(s);let r=T.join(s,"executor.ts"),p={name:e,label:se(e),description:`The better description of what ${e} is doing, the better it is for both AI and humans`,type:Qt(t),metadata:T.join("src","vertices",e,"metadata.json"),configurator:i,mtls:[],codeOauth2:[],oauth2:[],variables:[]};if(n==="react"){Xt("npm install react react-dom @types/react @types/react-dom",{cwd:o,stdio:"inherit"});let c=T.join(o,"src/vertices",e,"ui");i&&(h(T.join(c,"configurator.App.tsx"),g("configurator.App.tsx")),h(T.join(c,"configurator.main.tsx"),g("configurator.main.tsx")),h(T.join(c,"configurator.ssg.tsx"),g("configurator.ssg.tsx"))),t==="browser"&&(h(T.join(c,"executor.App.tsx"),g("executor.App.tsx")),h(T.join(c,"executor.main.tsx"),g("executor.main.tsx")),h(T.join(c,"executor.ssg.tsx"),g("executor.ssg.tsx"))),z.existsSync(T.join(o,"build-client.js"))||h(T.join(o,"build-client.js"),g("build-client.js"))}switch(p.type){case 1:h(r,g("executor_action.ts"));break;case 2:n==="react"?h(r,g("executor_browser_react.tsx").replaceAll("___VERTEX_NAME___",e)):h(r,g("executor_browser_none.ts"));break;case 4:h(r,g("executor_external_trigger.ts"));break;case 3:h(r,g("executor_cron_trigger.ts"));break;default:throw new Error("The vertex type is invalid")}z.writeFileSync(T.join(o,"src","executors.ts"),ot([e,...a.map(c=>c.name)],"ExecutorEnvironment"));let l={complete:!0,receivers:[{name:"input",description:"Default input receiver",bindings:[]}],transmitters:[{name:"output",description:"Default output transmitter",signals:[],failure:!1}],procedures:[],streams:[]};return p.type===3&&(l.cronSchedule="/5 * * * * *"),i&&(n==="react"?h(T.join(s,"configurator.ts"),g("configurator_react.tsx").replaceAll("___VERTEX_NAME___",e)):h(T.join(s,"configurator.ts"),g("configurator_none.ts")),l.complete=!1,z.writeFileSync(T.join(o,"src","configurators.ts"),ot([e,...a.filter(c=>c.configurator).map(c=>c.name)],"ConfiguratorEnvironment"))),z.writeFileSync(T.join(s,"metadata.json"),at.toJsonString(l,{prettySpaces:2})),p}function ot(o,e){let t=o.map(i=>`import ${i} from './vertices/${i}/${e==="ExecutorEnvironment"?"executor":"configurator"}';`).join(`
|
|
3
3
|
`);return`/**
|
|
4
4
|
* ---------------------------------------------------------------------------
|
|
5
5
|
* THIS FILE IS AUTOGENERATED - DO NOT EDIT MANUALLY
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@mochabug/adaptkit",
|
|
3
|
-
"version": "1.0.0-beta.
|
|
3
|
+
"version": "1.0.0-beta.6",
|
|
4
4
|
"description": "A cmd to create, emulate and publish Mochabug Adapt plugins",
|
|
5
5
|
"main": "bin/index.js",
|
|
6
6
|
"type": "module",
|
|
@@ -69,7 +69,7 @@
|
|
|
69
69
|
"node-fetch": "^3.3.2",
|
|
70
70
|
"open": "^10.1.0",
|
|
71
71
|
"pkce-challenge": "^4.1.0",
|
|
72
|
-
"semver": "^7.
|
|
72
|
+
"semver": "^7.7.0",
|
|
73
73
|
"sharp": "^0.33.5",
|
|
74
74
|
"update-notifier": "^7.3.1"
|
|
75
75
|
}
|