@mochabug/adaptkit 0.1.0-alpha.35 → 0.1.0-alpha.37

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/bin/index.js CHANGED
@@ -1,18 +1,18 @@
1
1
  #!/usr/bin/env node
2
2
  import { ChannelCredentials } from '@grpc/grpc-js';
3
+ import { ServiceType, stackIntercept } from '@protobuf-ts/runtime-rpc';
4
+ import { MessageType, reflectionMergePartial, UnknownFieldHandler, WireType, MESSAGE_TYPE } from '@protobuf-ts/runtime';
3
5
  import { GrpcTransport } from '@protobuf-ts/grpc-transport';
4
6
  import chalk from 'chalk';
5
7
  import { execSync } from 'child_process';
6
8
  import { program } from 'commander';
9
+ import fg from 'fast-glob';
7
10
  import figlet from 'figlet';
8
11
  import fs from 'fs';
9
- import fg from 'fast-glob';
10
12
  import inquirer from 'inquirer';
11
13
  import { mkdirp } from 'mkdirp';
12
14
  import path from 'path';
13
15
  import sharp from 'sharp';
14
- import { ServiceType, stackIntercept } from '@protobuf-ts/runtime-rpc';
15
- import { MessageType, reflectionMergePartial, UnknownFieldHandler, WireType, MESSAGE_TYPE } from '@protobuf-ts/runtime';
16
16
 
17
17
  /******************************************************************************
18
18
  Copyright (c) Microsoft Corporation.
@@ -41,32 +41,8 @@ function __awaiter(thisArg, _arguments, P, generator) {
41
41
  });
42
42
  }
43
43
 
44
- var externalConfigTemplate = "import { VertexConfig } from '@mochabug/adapt-plugin-toolkit/api';\nimport { ExternalConfiguratorRouter } from '@mochabug/adapt-plugin-toolkit/router';\n\n/**\n * Constructs an instance of ExternalConfiguratorRouter and sets up routes to handle GET requests for configuration and HTML page.\n *\n * @name router\n * @type {ExternalConfiguratorRouter}\n */\nexport const router = new ExternalConfiguratorRouter()\n\n /**\n * Sets up a GET route at the '/api/config' endpoint.\n * This route is called for authorization and to get the vertex configuration.\n *\n * @method add\n * @async\n * @returns {Response} Returns a response object. The content of the response is based on the authorization result and the configuration result.\n */\n .add('GET', '/api/config', async (req, api) => {\n const authHeader = req.headers.get('Authorization')!;\n const auth = await api.authorize(authHeader.substring('Bearer '.length));\n if (!auth.ok) {\n return new Response('Unauthorized', { status: 401 });\n }\n\n const res = await api.getVertexConfig<VertexConfig>();\n if (!res.ok) {\n console.error(res);\n return new Response(res.errorMessage, { status: res.errorStatus });\n }\n return new Response(JSON.stringify(res.data!.item), {\n headers: {\n 'Content-Type': 'application/json',\n },\n });\n })\n\n /**\n * Sets up a GET route at the '/?' endpoint.\n * This route is called to display a \"Hello World\" page.\n *\n * @method add\n * @async\n * @returns {Response} Returns a response object with \"Hello World\" page content.\n */\n .add('GET', '(/?)', async () => {\n return new Response(getHelloWorldPage(), {\n headers: {\n 'Content-Type': 'text/html',\n },\n });\n });\n\nfunction getHelloWorldPage(): string {\n return `\n <html>\n <head>\n <style>\n @import url('https://fonts.googleapis.com/css2?family=Orbitron&display=swap');\n @keyframes glow {\n 0% { text-shadow: 0 0 5px #0f0, 0 0 10px #0f0, 0 0 15px #0f0, 0 0 20px #0f0; }\n 100% { text-shadow: 0 0 10px #0f0, 0 0 20px #0f0, 0 0 30px #0f0, 0 0 40px #0f0; }\n }\n body {\n background-color: #000;\n color: #0f0;\n font-family: 'Orbitron', sans-serif;\n text-align: center;\n overflow: hidden;\n margin: 0;\n padding: 0;\n }\n h1 {\n position: absolute;\n top: 30%;\n left: 50%;\n transform: translate(-50%, -50%);\n font-size: 3em;\n text-transform: uppercase;\n letter-spacing: 4px;\n animation: glow 2s infinite alternate;\n }\n #jsonOutput {\n position: absolute;\n top: 70%;\n left: 50%;\n transform: translate(-50%, -50%);\n font-size: 1.5em;\n text-transform: uppercase;\n letter-spacing: 2px;\n animation: glow 2s infinite alternate;\n }\n button {\n position: absolute;\n top: 50%;\n left: 50%;\n transform: translate(-50%, -50%);\n background-color: #0f0;\n border: none;\n color: black;\n padding: 15px 32px;\n text-align: center;\n text-decoration: none;\n display: inline-block;\n font-size: 20px; /* Increase the font size */\n margin: 4px 2px;\n cursor: pointer;\n transition-duration: 0.4s;\n animation: glow 2s infinite alternate;\n font-family: 'Orbitron', sans-serif;\n border-radius: 15px;\n transform: rotate(-10deg) skew(10deg, 10deg);\n }\n </style>\n </head>\n <body>\n <h1>Hello, World!</h1>\n <button id=\"assimilateButton\">Assimilate</button>\n <pre id=\"jsonOutput\"></pre>\n <script>\n document.getElementById('assimilateButton').addEventListener('click', function() {\n const hash = window.location.hash.substr(1).trim();\n const token = decodeURIComponent(hash); \n fetch('/api/config', {\n method: 'GET',\n headers: {\n 'Authorization': 'Bearer ' + token\n }\n })\n .then(response => response.json())\n .then(data => {\n document.getElementById('jsonOutput').innerText = JSON.stringify(data, null, 2);\n this.style.display = 'none'; /* Hide button after being clicked */\n })\n .catch(error => {\n console.error('Error:', error);\n document.getElementById('jsonOutput').innerText = 'Error occurred while assimilating data';\n });\n });\n </script>\n </body>\n </html>\n `;\n}\n";
45
-
46
- var internalConfigTemplate = "import { InternalConfiguratorRouter } from '@mochabug/adapt-plugin-toolkit/router';\n/**\n * A `InternalConfiguratorRouter` instance configured to handle internal platform calls for the vertex during configuration.\n *\n * There are no events to handle at the moment\n *\n * @see InternalConfiguratorRouter\n */\nexport const router = new InternalConfiguratorRouter();\n";
47
-
48
- var browserExecTempalte = "import { ExternalExecutorRouter } from '@mochabug/adapt-plugin-toolkit/router';\n\n/**\n * Constructs an instance of ExternalExecutorRouter and sets up routes to handle POST and GET requests.\n *\n * @name router\n * @type {ExternalExecutorRouter}\n */\nexport const router = new ExternalExecutorRouter()\n\n /**\n * Sets up a POST route at the '/api/done' endpoint.\n * This route checks the authorization status before allowing the action to complete.\n *\n * @method add\n * @async\n * @param {Request} _req - The incoming request object. This parameter is ignored in this function.\n * @param {ExecutorApi} api - The api object to interact with the system.\n * @param {RouteInfo} route - The route information. This parameter is ignored in this function.\n * @param {ExecutionContext} ctx - The context of execution to handle lifecycle events.\n * @returns {Response} Returns a response object.\n */\n .add('POST', '/api/done', async (req, api, route, ctx) => {\n const authHeader = req.headers.get('Authorization')!;\n const auth = await api.authorize(authHeader.substring('Bearer '.length));\n if (!auth.ok) {\n return new Response('Unauthorized', { status: 401 });\n }\n // We need the privileged api to communicate with the session\n const sapi = api.getSessionApi(authHeader);\n ctx.waitUntil(sapi.complete('output', {}));\n return new Response();\n })\n\n /**\n * Sets up a GET route at the root endpoint.\n * This route responds with a sample HTML page.\n *\n * @method add\n * @async\n * @returns {Response} Returns a response object with the HTML content and the appropriate headers.\n */\n .add('GET', '(/?)', async () => {\n return new Response(getSamplePage(), {\n headers: {\n 'Content-Type': 'text/html',\n },\n });\n });\n\nfunction getSamplePage(): string {\n return `\n <html>\n <head>\n <style>\n @import url('https://fonts.googleapis.com/css2?family=Orbitron&display=swap');\n @keyframes glow {\n 0% { text-shadow: 0 0 5px #0f0, 0 0 10px #0f0, 0 0 15px #0f0, 0 0 20px #0f0; }\n 100% { text-shadow: 0 0 10px #0f0, 0 0 20px #0f0, 0 0 30px #0f0, 0 0 40px #0f0; }\n }\n body {\n background-color: #000;\n color: #0f0;\n font-family: 'Orbitron', sans-serif;\n text-align: center;\n overflow: hidden;\n margin: 0;\n padding: 0;\n }\n button {\n position: absolute;\n top: 50%;\n left: 50%;\n transform: translate(-50%, -50%);\n background-color: #0f0;\n border: none;\n color: black;\n padding: 15px 32px;\n text-align: center;\n text-decoration: none;\n display: inline-block;\n font-size: 20px;\n margin: 4px 2px;\n cursor: pointer;\n transition-duration: 0.4s;\n animation: glow 2s infinite alternate;\n font-family: 'Orbitron', sans-serif;\n border-radius: 15px;\n transform: rotate(-10deg) skew(10deg, 10deg);\n }\n </style>\n </head>\n <body>\n <button id=\"doneButton\">Done</button>\n <script>\n document.getElementById('doneButton').addEventListener('click', function() {\n const hash = window.location.hash.substr(1).trim();\n const token = decodeURIComponent(hash); \n fetch('/api/done', {\n method: 'POST',\n headers: {\n 'Authorization': 'Bearer ' + token\n }\n })\n .then(data => {\n this.innerText = 'Done';\n })\n .catch(error => {\n console.error('Error:', error);\n });\n });\n </script>\n </body>\n </html>\n `;\n}\n";
49
-
50
- var cronExecTemplate = "import { CronExecutorRouter } from '@mochabug/adapt-plugin-toolkit/router';\n\n/**\n * Constructs an instance of CronExecutorRouter and sets up event handlers for all internal execution events.\n *\n * @name router\n * @type {CronExecutorRouter}\n */\nexport const router = new CronExecutorRouter()\n /**\n * Sets up a handler for the start event.\n * The handler is called when the execution of a vertex starts.\n *\n * @method onStart\n * @async\n */\n .onStart(async (req, api) => {\n const start = await req.json<StartExecutionRequest>();\n console.log('Start has been called');\n console.log(start);\n })\n /**\n * Sets up a handler for the stop event.\n * This route is called when the vertex is forcibly stopped.\n * I.e. a trigger that is closed or a session that is forcibly closed.\n *\n * @method onStop\n * @async\n */\n .onStop(async (req, api) => {\n console.log('Stop has been called');\n })\n /**\n * Sets up a handler for the cron event.\n * This route is called when the cron trigger is fired.\n *\n * @method onCron\n * @async\n */\n .onCron(async (req, api) => {\n console.log('Received cron event');\n })\n /**\n * Sets up a handler for the stream event.\n * This route is called when stream content is available.\n *\n * @method onStream\n * @async\n */\n .onStream(async (req, api, name) => {\n console.log(`Stream ${name} has been called`);\n const res = await req.json<StreamResult>();\n console.log(res);\n })\n\n /**\n * Sets up a handler for the procedure event.\n * This route is called when procedure result is available.\n *\n * @method onProcedure\n * @async\n */\n .onProcedure(async (req, api, name) => {\n console.log(`Procedure ${name} has been called`);\n const res = await req.json<ProcedureResult>();\n console.log(res);\n });\n";
51
-
52
- var triggerExecTemplate = "import { ExternalExecutorRouter } from '@mochabug/adapt-plugin-toolkit/router';\n\n/**\n * Constructs an instance of ExternalExecutorRouter and sets up a wildcard route to handle all requests.\n * This wildcard route makes this router capable of receiving any type of HTTP request on any route.\n * It's important to note that this generic handling might not be suitable for all webhook scenarios.\n * For instance, some webhooks might require specific routes or specific types of requests.\n * In these cases, you should add specific routes to handle these scenarios.\n *\n * @name router\n */\nexport const router = new ExternalExecutorRouter()\n /**\n * Sets up a wildcard route that matches any HTTP method and any URL pattern.\n * This route is ideal for handling webhooks, which often send POST requests to a specific URL.\n * Here are a few examples of common webhook scenarios:\n * 1. GitHub sends a POST request to /github-webhook every time a new issue is created in your repository.\n * 2. Stripe sends a POST request to /stripe-webhook whenever a new payment is received.\n * 3. Twilio sends a POST request to /sms-webhook whenever an incoming SMS message is received.\n * For these scenarios, you should add specific routes that match these patterns (e.g., POST /github-webhook).\n *\n * Also, it's important to ensure that your webhooks are secure. One common way to do this is by validating the payload signature.\n * Most platforms sending webhooks provide a signature in the request headers that can be used to verify that the payload was not tampered with.\n *\n * @method add\n * @async\n * @returns {Response} Returns a response object with a sample HTML page.\n */\n .add('*', '(.*)', async () => {\n return new Response();\n });";
53
-
54
- var internalExecTemplate = "import { InternalExecutorRouter } from '@mochabug/adapt-plugin-toolkit/router';\n\n/**\n * Constructs an instance of InternalExecutorRouter and sets up event handlers for all internal execution events.\n *\n * @name router\n * @type {InternalExecutorRouter}\n */\nexport const router = new InternalExecutorRouter()\n /**\n * Sets up a handler for the start event.\n * The handler is called when the execution of a vertex starts.\n *\n * @method onStart\n * @async\n */\n .onStart(async (req, api) => {\n const start = await req.json<StartExecutionRequest>();\n console.log('Start has been called');\n console.log(start);\n })\n /**\n * Sets up a handler for the stop event.\n * This route is called when the vertex is forcibly stopped.\n * I.e. a trigger that is closed or a session that is forcibly closed.\n *\n * @method onStop\n * @async\n */\n .onStop(async (req, api) => {\n console.log('Stop has been called');\n })\n /**\n * Sets up a handler for the stream event.\n * This route is called when stream content is available.\n *\n * @method onStream\n * @async\n */\n .onStream(async (req, api, name) => {\n console.log(`Stream ${name} has been called`);\n const res = await req.json<StreamResult>();\n console.log(res);\n })\n\n /**\n * Sets up a handler for the procedure event.\n * This route is called when procedure result is available.\n *\n * @method onProcedure\n * @async\n */\n .onProcedure(async (req, api, name) => {\n console.log(`Procedure ${name} has been called`);\n const res = await req.json<ProcedureResult>();\n console.log(res);\n });\n";
55
-
56
- var gitignoreTemplate = "# Logs\nlogs\n*.log\nnpm-debug.log*\nyarn-debug.log*\nyarn-error.log*\nlerna-debug.log*\n.pnpm-debug.log*\n\n# Diagnostic reports (https://nodejs.org/api/report.html)\nreport.[0-9]*.[0-9]*.[0-9]*.[0-9]*.json\n\n# Runtime data\npids\n*.pid\n*.seed\n*.pid.lock\n\n# Directory for instrumented libs generated by jscoverage/JSCover\nlib-cov\n\n# Coverage directory used by tools like istanbul\ncoverage\n*.lcov\n\n# nyc test coverage\n.nyc_output\n\n# Grunt intermediate storage (https://gruntjs.com/creating-plugins#storing-task-files)\n.grunt\n\n# Bower dependency directory (https://bower.io/)\nbower_components\n\n# node-waf configuration\n.lock-wscript\n\n# Compiled binary addons (https://nodejs.org/api/addons.html)\nbuild/Release\n\n# Dependency directories\nnode_modules/\njspm_packages/\n\n# Snowpack dependency directory (https://snowpack.dev/)\nweb_modules/\n\n# TypeScript cache\n*.tsbuildinfo\n\n# Optional npm cache directory\n.npm\n\n# Optional eslint cache\n.eslintcache\n\n# Optional stylelint cache\n.stylelintcache\n\n# Microbundle cache\n.rpt2_cache/\n.rts2_cache_cjs/\n.rts2_cache_es/\n.rts2_cache_umd/\n\n# Optional REPL history\n.node_repl_history\n\n# Output of 'npm pack'\n*.tgz\n\n# Yarn Integrity file\n.yarn-integrity\n\n# dotenv environment variable files\n.env\n.env.development.local\n.env.test.local\n.env.production.local\n.env.local\n\n# parcel-bundler cache (https://parceljs.org/)\n.cache\n.parcel-cache\n\n# Next.js build output\n.next\nout\n\n# Nuxt.js build / generate output\n.nuxt\ndist\nbuild\n\n# Gatsby files\n.cache/\n# Comment in the public line in if your project uses Gatsby and not Next.js\n# https://nextjs.org/blog/next-9-1#public-directory-support\n# public\n\n# vuepress build output\n.vuepress/dist\n\n# vuepress v2.x temp and cache directory\n.temp\n.cache\n\n# Stores VSCode versions used for testing VSCode extensions\n.vscode-test\n\n# yarn v2\n.yarn/cache\n.yarn/unplugged\n.yarn/build-state.yml\n.yarn/install-state.gz\n.pnp.*";
57
-
58
- var jestTemplate = "import type { Config } from \"@jest/types\"\n\nconst config: Config.InitialOptions = {\n preset: \"ts-jest\",\n testEnvironment: \"node\",\n verbose: true,\n automock: true,\n}\nexport default config";
59
-
60
- var licenseTemplate = "## ISC License\n\nCopyright (c) [year] [fullname]\n\nPermission to use, copy, modify, and/or distribute this software for any\npurpose with or without fee is hereby granted, provided that the above\ncopyright notice and this permission notice appear in all copies.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH\nREGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY\nAND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,\nINDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM\nLOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR\nOTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR\nPERFORMANCE OF THIS SOFTWARE.";
61
-
62
- var readmeTemplate = "# 🐞 Mochabug Adapt's Magnificent Plugin 🐞\n\n[![Version](https://img.shields.io/badge/version-PLUGIN_VERSION-blue)](PLUGIN_REPOSITORY_URL)\n[![License: ISC](https://img.shields.io/badge/License-ISC-yellow.svg)](https://opensource.org/licenses/ISC)\n\n## 📝 Description\n\nWelcome to the Magnificent Plugin for Mochabug Adapt! Developed by a talented third-party developer, this plugin promises to bring extra flavor to your Mochabug Adapt cloud platform experience. PLUGIN_DESCRIPTION\n\nThis plugin consists of one or more vertices. Each vertex is made up of an Executor and may optionally include a Configurator to help you tailor its behavior.\n\n## 📚 Table of Contents\n\n- [🐞 Mochabug Adapt's Magnificent Plugin 🐞](#-mochabug-adapts-magnificent-plugin-)\n - [📝 Description](#-description)\n - [📚 Table of Contents](#-table-of-contents)\n - [🚀 Getting Started](#-getting-started)\n - [🎯 Usage](#-usage)\n - [⚙️ Configuration](#️-configuration)\n - [📖 Documentation](#-documentation)\n - [🤝 Contributing](#-contributing)\n - [📜 License](#-license)\n - [👤 Author](#-author)\n\n## 🚀 Getting Started\n\nTo begin using Mochabug Adapt's Magnificent Plugin, simply start incorporating its vertices into your workflows within the Mochabug Adapt platform. No installation is required.\n\n## 🎯 Usage\n\nYou can start using the vertices by incorporating them into your workflows on the Mochabug Adapt platform. Each vertex will delight you with a specific task, and the usage will vary depending on your requirements. Consult the plugin documentation for a comprehensive guide on each vertex's usage.\n\n## ⚙️ Configuration\n\nEach vertex in the plugin may have a Configurator, which allows you to tailor the vertex's behavior to your liking. Configuration options may include settings for the Executor, input/output data formats, and other essential options.\n\n## 📖 Documentation\n\nFor more insights into the plugin, its vertices, and their features, visit the [homepage](PLUGIN_HOMEPAGE) and the [repository](PLUGIN_REPOSITORY_URL).\n\n## 🤝 Contributing\n\nReady to make the Magnificent Plugin for Mochabug Adapt even more magical? Contributions are welcome! Check the [repository](PLUGIN_REPOSITORY_URL) for open issues and guidelines on how to contribute.\n\n## 📜 License\n\nThis plugin is licensed under the [ISC License](https://opensource.org/licenses/ISC).\n\n## 👤 Author\n\nPLUGIN_AUTHOR\n";
63
-
64
- var rollupTemplate = "import fs from 'fs';\nimport typescript from '@rollup/plugin-typescript';\nimport { nodeResolve } from '@rollup/plugin-node-resolve';\nimport terser from '@rollup/plugin-terser';\nimport commonjs from '@rollup/plugin-commonjs';\n\nconst config = [\n {\n input: 'src/executors.ts',\n output: {\n file: 'dist/executors.js',\n format: 'esm'\n },\n plugins: [typescript(), nodeResolve(), commonjs(), terser()]\n }\n];\n\n// Check if 'src/configurators.ts' exists\nif (fs.existsSync('src/configurators.ts')) {\n config.push({\n input: 'src/configurators.ts',\n output: {\n file: 'dist/configurators.js',\n format: 'esm'\n },\n plugins: [typescript(), nodeResolve(), commonjs(), terser()]\n });\n}\n\nexport default config;\n";
65
-
66
- var tsconfig = "{\n \"exclude\": [\n \"**/*.test.*\",\n \"**/__mocks__/*\",\n \"**/__tests__/*\"\n ],\n \"compilerOptions\": {\n \"rootDir\": \"src\",\n \"jsx\": \"react\",\n \"target\": \"esnext\",\n \"module\": \"esnext\",\n \"lib\": [\"esnext\"],\n \"moduleResolution\": \"node\",\n \"types\": [\n \"@mochabug/adapt-plugin-typings\",\n \"jest\"\n ],\n \"resolveJsonModule\": true,\n \"allowJs\": true,\n \"checkJs\": false,\n \"noEmit\": true,\n \"isolatedModules\": true,\n \"allowSyntheticDefaultImports\": true,\n \"forceConsistentCasingInFileNames\": true,\n \"strict\": true,\n \"skipLibCheck\": true\n }\n}";
67
-
68
44
  // @generated by protobuf-ts 2.9.1
69
- // @generated from protobuf file "mochabug/adapt/plugins/v1/plugins.proto" (package "mochabug.adapt.plugins.v1", syntax proto3)
45
+ // @generated from protobuf file "mochabugapis/adapt/plugins/v1/plugins.proto" (package "mochabugapis.adapt.plugins.v1", syntax proto3)
70
46
  // tslint:disable
71
47
  //
72
48
  // Copyright 2023, mochabug AB
@@ -86,7 +62,7 @@ var tsconfig = "{\n \"exclude\": [\n \"**/*.test.*\",\n \"**/__
86
62
  /**
87
63
  * GrantType represents the supported OAuth2 grant types.
88
64
  *
89
- * @generated from protobuf enum mochabug.adapt.plugins.v1.OAuth2Service.GrantType
65
+ * @generated from protobuf enum mochabugapis.adapt.plugins.v1.OAuth2Service.GrantType
90
66
  */
91
67
  var OAuth2Service_GrantType;
92
68
  (function (OAuth2Service_GrantType) {
@@ -114,7 +90,7 @@ var OAuth2Service_GrantType;
114
90
  /**
115
91
  * The type of variable
116
92
  *
117
- * @generated from protobuf enum mochabug.adapt.plugins.v1.EnvironmentalVariable.Type
93
+ * @generated from protobuf enum mochabugapis.adapt.plugins.v1.EnvironmentalVariable.Type
118
94
  */
119
95
  var EnvironmentalVariable_Type;
120
96
  (function (EnvironmentalVariable_Type) {
@@ -146,7 +122,7 @@ var EnvironmentalVariable_Type;
146
122
  /**
147
123
  * VertexType represents the type of a vertex.
148
124
  *
149
- * @generated from protobuf enum mochabug.adapt.plugins.v1.Vertex.VertexType
125
+ * @generated from protobuf enum mochabugapis.adapt.plugins.v1.Vertex.VertexType
150
126
  */
151
127
  var Vertex_VertexType;
152
128
  (function (Vertex_VertexType) {
@@ -192,7 +168,7 @@ var Vertex_VertexType;
192
168
  // @generated message type with reflection information, may provide speed optimized methods
193
169
  class UploadPluginRequest$Type extends MessageType {
194
170
  constructor() {
195
- super("mochabug.adapt.plugins.v1.UploadPluginRequest", [
171
+ super("mochabugapis.adapt.plugins.v1.UploadPluginRequest", [
196
172
  { no: 1, name: "manifest", kind: "message", oneof: "data", T: () => Manifest },
197
173
  { no: 2, name: "file", kind: "message", oneof: "data", T: () => File }
198
174
  ]);
@@ -205,17 +181,17 @@ class UploadPluginRequest$Type extends MessageType {
205
181
  return message;
206
182
  }
207
183
  internalBinaryRead(reader, length, options, target) {
208
- let message = target !== null && target !== void 0 ? target : this.create(), end = reader.pos + length;
184
+ let message = target ?? this.create(), end = reader.pos + length;
209
185
  while (reader.pos < end) {
210
186
  let [fieldNo, wireType] = reader.tag();
211
187
  switch (fieldNo) {
212
- case /* mochabug.adapt.plugins.v1.Manifest manifest */ 1:
188
+ case /* mochabugapis.adapt.plugins.v1.Manifest manifest */ 1:
213
189
  message.data = {
214
190
  oneofKind: "manifest",
215
191
  manifest: Manifest.internalBinaryRead(reader, reader.uint32(), options, message.data.manifest)
216
192
  };
217
193
  break;
218
- case /* mochabug.adapt.plugins.v1.File file */ 2:
194
+ case /* mochabugapis.adapt.plugins.v1.File file */ 2:
219
195
  message.data = {
220
196
  oneofKind: "file",
221
197
  file: File.internalBinaryRead(reader, reader.uint32(), options, message.data.file)
@@ -233,10 +209,10 @@ class UploadPluginRequest$Type extends MessageType {
233
209
  return message;
234
210
  }
235
211
  internalBinaryWrite(message, writer, options) {
236
- /* mochabug.adapt.plugins.v1.Manifest manifest = 1; */
212
+ /* mochabugapis.adapt.plugins.v1.Manifest manifest = 1; */
237
213
  if (message.data.oneofKind === "manifest")
238
214
  Manifest.internalBinaryWrite(message.data.manifest, writer.tag(1, WireType.LengthDelimited).fork(), options).join();
239
- /* mochabug.adapt.plugins.v1.File file = 2; */
215
+ /* mochabugapis.adapt.plugins.v1.File file = 2; */
240
216
  if (message.data.oneofKind === "file")
241
217
  File.internalBinaryWrite(message.data.file, writer.tag(2, WireType.LengthDelimited).fork(), options).join();
242
218
  let u = options.writeUnknownFields;
@@ -246,13 +222,13 @@ class UploadPluginRequest$Type extends MessageType {
246
222
  }
247
223
  }
248
224
  /**
249
- * @generated MessageType for protobuf message mochabug.adapt.plugins.v1.UploadPluginRequest
225
+ * @generated MessageType for protobuf message mochabugapis.adapt.plugins.v1.UploadPluginRequest
250
226
  */
251
227
  const UploadPluginRequest = new UploadPluginRequest$Type();
252
228
  // @generated message type with reflection information, may provide speed optimized methods
253
229
  class UploadPluginResponse$Type extends MessageType {
254
230
  constructor() {
255
- super("mochabug.adapt.plugins.v1.UploadPluginResponse", []);
231
+ super("mochabugapis.adapt.plugins.v1.UploadPluginResponse", []);
256
232
  }
257
233
  create(value) {
258
234
  const message = {};
@@ -262,7 +238,7 @@ class UploadPluginResponse$Type extends MessageType {
262
238
  return message;
263
239
  }
264
240
  internalBinaryRead(reader, length, options, target) {
265
- return target !== null && target !== void 0 ? target : this.create();
241
+ return target ?? this.create();
266
242
  }
267
243
  internalBinaryWrite(message, writer, options) {
268
244
  let u = options.writeUnknownFields;
@@ -272,13 +248,13 @@ class UploadPluginResponse$Type extends MessageType {
272
248
  }
273
249
  }
274
250
  /**
275
- * @generated MessageType for protobuf message mochabug.adapt.plugins.v1.UploadPluginResponse
251
+ * @generated MessageType for protobuf message mochabugapis.adapt.plugins.v1.UploadPluginResponse
276
252
  */
277
253
  const UploadPluginResponse = new UploadPluginResponse$Type();
278
254
  // @generated message type with reflection information, may provide speed optimized methods
279
255
  class File$Type extends MessageType {
280
256
  constructor() {
281
- super("mochabug.adapt.plugins.v1.File", [
257
+ super("mochabugapis.adapt.plugins.v1.File", [
282
258
  { no: 1, name: "path", kind: "scalar", T: 9 /*ScalarType.STRING*/ },
283
259
  { no: 2, name: "data", kind: "scalar", T: 12 /*ScalarType.BYTES*/ }
284
260
  ]);
@@ -291,7 +267,7 @@ class File$Type extends MessageType {
291
267
  return message;
292
268
  }
293
269
  internalBinaryRead(reader, length, options, target) {
294
- let message = target !== null && target !== void 0 ? target : this.create(), end = reader.pos + length;
270
+ let message = target ?? this.create(), end = reader.pos + length;
295
271
  while (reader.pos < end) {
296
272
  let [fieldNo, wireType] = reader.tag();
297
273
  switch (fieldNo) {
@@ -326,13 +302,13 @@ class File$Type extends MessageType {
326
302
  }
327
303
  }
328
304
  /**
329
- * @generated MessageType for protobuf message mochabug.adapt.plugins.v1.File
305
+ * @generated MessageType for protobuf message mochabugapis.adapt.plugins.v1.File
330
306
  */
331
307
  const File = new File$Type();
332
308
  // @generated message type with reflection information, may provide speed optimized methods
333
309
  class Manifest$Type extends MessageType {
334
310
  constructor() {
335
- super("mochabug.adapt.plugins.v1.Manifest", [
311
+ super("mochabugapis.adapt.plugins.v1.Manifest", [
336
312
  { no: 1, name: "name", kind: "scalar", T: 9 /*ScalarType.STRING*/ },
337
313
  { no: 2, name: "version", kind: "scalar", T: 9 /*ScalarType.STRING*/ },
338
314
  { no: 3, name: "label", kind: "scalar", T: 9 /*ScalarType.STRING*/ },
@@ -346,22 +322,20 @@ class Manifest$Type extends MessageType {
346
322
  { no: 11, name: "configurator_esm", kind: "scalar", opt: true, T: 9 /*ScalarType.STRING*/ },
347
323
  { no: 12, name: "assets_dir", kind: "scalar", opt: true, T: 9 /*ScalarType.STRING*/ },
348
324
  { no: 13, name: "vertices", kind: "message", repeat: 1 /*RepeatType.PACKED*/, T: () => Vertex },
349
- { no: 14, name: "vertex_variables", kind: "message", repeat: 1 /*RepeatType.PACKED*/, T: () => EnvironmentalVariable },
350
- { no: 15, name: "vertex_mtls", kind: "message", repeat: 1 /*RepeatType.PACKED*/, T: () => MTLSService },
351
- { no: 16, name: "vertex_oauth2", kind: "message", repeat: 1 /*RepeatType.PACKED*/, T: () => OAuth2Service },
352
- { no: 17, name: "variables", kind: "message", repeat: 1 /*RepeatType.PACKED*/, T: () => EnvironmentalVariable },
353
- { no: 18, name: "mtls", kind: "message", repeat: 1 /*RepeatType.PACKED*/, T: () => MTLSService }
325
+ { no: 14, name: "oauth2", kind: "message", repeat: 1 /*RepeatType.PACKED*/, T: () => OAuth2Service },
326
+ { no: 15, name: "variables", kind: "message", repeat: 1 /*RepeatType.PACKED*/, T: () => EnvironmentalVariable },
327
+ { no: 16, name: "mtls", kind: "message", repeat: 1 /*RepeatType.PACKED*/, T: () => MTLSService }
354
328
  ]);
355
329
  }
356
330
  create(value) {
357
- const message = { name: "", version: "", label: "", description: "", executorEsm: "", vertices: [], vertexVariables: [], vertexMtls: [], vertexOauth2: [], variables: [], mtls: [] };
331
+ const message = { name: "", version: "", label: "", description: "", executorEsm: "", vertices: [], oauth2: [], variables: [], mtls: [] };
358
332
  globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this });
359
333
  if (value !== undefined)
360
334
  reflectionMergePartial(this, message, value);
361
335
  return message;
362
336
  }
363
337
  internalBinaryRead(reader, length, options, target) {
364
- let message = target !== null && target !== void 0 ? target : this.create(), end = reader.pos + length;
338
+ let message = target ?? this.create(), end = reader.pos + length;
365
339
  while (reader.pos < end) {
366
340
  let [fieldNo, wireType] = reader.tag();
367
341
  switch (fieldNo) {
@@ -401,22 +375,16 @@ class Manifest$Type extends MessageType {
401
375
  case /* optional string assets_dir */ 12:
402
376
  message.assetsDir = reader.string();
403
377
  break;
404
- case /* repeated mochabug.adapt.plugins.v1.Vertex vertices */ 13:
378
+ case /* repeated mochabugapis.adapt.plugins.v1.Vertex vertices */ 13:
405
379
  message.vertices.push(Vertex.internalBinaryRead(reader, reader.uint32(), options));
406
380
  break;
407
- case /* repeated mochabug.adapt.plugins.v1.EnvironmentalVariable vertex_variables */ 14:
408
- message.vertexVariables.push(EnvironmentalVariable.internalBinaryRead(reader, reader.uint32(), options));
381
+ case /* repeated mochabugapis.adapt.plugins.v1.OAuth2Service oauth2 */ 14:
382
+ message.oauth2.push(OAuth2Service.internalBinaryRead(reader, reader.uint32(), options));
409
383
  break;
410
- case /* repeated mochabug.adapt.plugins.v1.MTLSService vertex_mtls */ 15:
411
- message.vertexMtls.push(MTLSService.internalBinaryRead(reader, reader.uint32(), options));
412
- break;
413
- case /* repeated mochabug.adapt.plugins.v1.OAuth2Service vertex_oauth2 */ 16:
414
- message.vertexOauth2.push(OAuth2Service.internalBinaryRead(reader, reader.uint32(), options));
415
- break;
416
- case /* repeated mochabug.adapt.plugins.v1.EnvironmentalVariable variables */ 17:
384
+ case /* repeated mochabugapis.adapt.plugins.v1.EnvironmentalVariable variables */ 15:
417
385
  message.variables.push(EnvironmentalVariable.internalBinaryRead(reader, reader.uint32(), options));
418
386
  break;
419
- case /* repeated mochabug.adapt.plugins.v1.MTLSService mtls */ 18:
387
+ case /* repeated mochabugapis.adapt.plugins.v1.MTLSService mtls */ 16:
420
388
  message.mtls.push(MTLSService.internalBinaryRead(reader, reader.uint32(), options));
421
389
  break;
422
390
  default:
@@ -467,24 +435,18 @@ class Manifest$Type extends MessageType {
467
435
  /* optional string assets_dir = 12; */
468
436
  if (message.assetsDir !== undefined)
469
437
  writer.tag(12, WireType.LengthDelimited).string(message.assetsDir);
470
- /* repeated mochabug.adapt.plugins.v1.Vertex vertices = 13; */
438
+ /* repeated mochabugapis.adapt.plugins.v1.Vertex vertices = 13; */
471
439
  for (let i = 0; i < message.vertices.length; i++)
472
440
  Vertex.internalBinaryWrite(message.vertices[i], writer.tag(13, WireType.LengthDelimited).fork(), options).join();
473
- /* repeated mochabug.adapt.plugins.v1.EnvironmentalVariable vertex_variables = 14; */
474
- for (let i = 0; i < message.vertexVariables.length; i++)
475
- EnvironmentalVariable.internalBinaryWrite(message.vertexVariables[i], writer.tag(14, WireType.LengthDelimited).fork(), options).join();
476
- /* repeated mochabug.adapt.plugins.v1.MTLSService vertex_mtls = 15; */
477
- for (let i = 0; i < message.vertexMtls.length; i++)
478
- MTLSService.internalBinaryWrite(message.vertexMtls[i], writer.tag(15, WireType.LengthDelimited).fork(), options).join();
479
- /* repeated mochabug.adapt.plugins.v1.OAuth2Service vertex_oauth2 = 16; */
480
- for (let i = 0; i < message.vertexOauth2.length; i++)
481
- OAuth2Service.internalBinaryWrite(message.vertexOauth2[i], writer.tag(16, WireType.LengthDelimited).fork(), options).join();
482
- /* repeated mochabug.adapt.plugins.v1.EnvironmentalVariable variables = 17; */
441
+ /* repeated mochabugapis.adapt.plugins.v1.OAuth2Service oauth2 = 14; */
442
+ for (let i = 0; i < message.oauth2.length; i++)
443
+ OAuth2Service.internalBinaryWrite(message.oauth2[i], writer.tag(14, WireType.LengthDelimited).fork(), options).join();
444
+ /* repeated mochabugapis.adapt.plugins.v1.EnvironmentalVariable variables = 15; */
483
445
  for (let i = 0; i < message.variables.length; i++)
484
- EnvironmentalVariable.internalBinaryWrite(message.variables[i], writer.tag(17, WireType.LengthDelimited).fork(), options).join();
485
- /* repeated mochabug.adapt.plugins.v1.MTLSService mtls = 18; */
446
+ EnvironmentalVariable.internalBinaryWrite(message.variables[i], writer.tag(15, WireType.LengthDelimited).fork(), options).join();
447
+ /* repeated mochabugapis.adapt.plugins.v1.MTLSService mtls = 16; */
486
448
  for (let i = 0; i < message.mtls.length; i++)
487
- MTLSService.internalBinaryWrite(message.mtls[i], writer.tag(18, WireType.LengthDelimited).fork(), options).join();
449
+ MTLSService.internalBinaryWrite(message.mtls[i], writer.tag(16, WireType.LengthDelimited).fork(), options).join();
488
450
  let u = options.writeUnknownFields;
489
451
  if (u !== false)
490
452
  (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer);
@@ -492,17 +454,18 @@ class Manifest$Type extends MessageType {
492
454
  }
493
455
  }
494
456
  /**
495
- * @generated MessageType for protobuf message mochabug.adapt.plugins.v1.Manifest
457
+ * @generated MessageType for protobuf message mochabugapis.adapt.plugins.v1.Manifest
496
458
  */
497
459
  const Manifest = new Manifest$Type();
498
460
  // @generated message type with reflection information, may provide speed optimized methods
499
461
  class MTLSService$Type extends MessageType {
500
462
  constructor() {
501
- super("mochabug.adapt.plugins.v1.MTLSService", [
463
+ super("mochabugapis.adapt.plugins.v1.MTLSService", [
502
464
  { no: 1, name: "name", kind: "scalar", T: 9 /*ScalarType.STRING*/ },
503
465
  { no: 2, name: "trusted_ca", kind: "scalar", T: 9 /*ScalarType.STRING*/ },
504
466
  { no: 3, name: "label", kind: "scalar", opt: true, T: 9 /*ScalarType.STRING*/ },
505
- { no: 4, name: "description", kind: "scalar", opt: true, T: 9 /*ScalarType.STRING*/ }
467
+ { no: 4, name: "description", kind: "scalar", opt: true, T: 9 /*ScalarType.STRING*/ },
468
+ { no: 5, name: "optional", kind: "scalar", opt: true, T: 8 /*ScalarType.BOOL*/ }
506
469
  ]);
507
470
  }
508
471
  create(value) {
@@ -513,7 +476,7 @@ class MTLSService$Type extends MessageType {
513
476
  return message;
514
477
  }
515
478
  internalBinaryRead(reader, length, options, target) {
516
- let message = target !== null && target !== void 0 ? target : this.create(), end = reader.pos + length;
479
+ let message = target ?? this.create(), end = reader.pos + length;
517
480
  while (reader.pos < end) {
518
481
  let [fieldNo, wireType] = reader.tag();
519
482
  switch (fieldNo) {
@@ -529,6 +492,9 @@ class MTLSService$Type extends MessageType {
529
492
  case /* optional string description */ 4:
530
493
  message.description = reader.string();
531
494
  break;
495
+ case /* optional bool optional */ 5:
496
+ message.optional = reader.bool();
497
+ break;
532
498
  default:
533
499
  let u = options.readUnknownField;
534
500
  if (u === "throw")
@@ -553,6 +519,9 @@ class MTLSService$Type extends MessageType {
553
519
  /* optional string description = 4; */
554
520
  if (message.description !== undefined)
555
521
  writer.tag(4, WireType.LengthDelimited).string(message.description);
522
+ /* optional bool optional = 5; */
523
+ if (message.optional !== undefined)
524
+ writer.tag(5, WireType.Varint).bool(message.optional);
556
525
  let u = options.writeUnknownFields;
557
526
  if (u !== false)
558
527
  (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer);
@@ -560,15 +529,15 @@ class MTLSService$Type extends MessageType {
560
529
  }
561
530
  }
562
531
  /**
563
- * @generated MessageType for protobuf message mochabug.adapt.plugins.v1.MTLSService
532
+ * @generated MessageType for protobuf message mochabugapis.adapt.plugins.v1.MTLSService
564
533
  */
565
534
  const MTLSService = new MTLSService$Type();
566
535
  // @generated message type with reflection information, may provide speed optimized methods
567
536
  class OAuth2Service$Type extends MessageType {
568
537
  constructor() {
569
- super("mochabug.adapt.plugins.v1.OAuth2Service", [
538
+ super("mochabugapis.adapt.plugins.v1.OAuth2Service", [
570
539
  { no: 1, name: "name", kind: "scalar", T: 9 /*ScalarType.STRING*/ },
571
- { no: 2, name: "grant_type", kind: "enum", T: () => ["mochabug.adapt.plugins.v1.OAuth2Service.GrantType", OAuth2Service_GrantType, "GRANT_TYPE_"] },
540
+ { no: 2, name: "grant_type", kind: "enum", T: () => ["mochabugapis.adapt.plugins.v1.OAuth2Service.GrantType", OAuth2Service_GrantType, "GRANT_TYPE_"] },
572
541
  { no: 3, name: "label", kind: "scalar", opt: true, T: 9 /*ScalarType.STRING*/ },
573
542
  { no: 4, name: "description", kind: "scalar", opt: true, T: 9 /*ScalarType.STRING*/ }
574
543
  ]);
@@ -581,14 +550,14 @@ class OAuth2Service$Type extends MessageType {
581
550
  return message;
582
551
  }
583
552
  internalBinaryRead(reader, length, options, target) {
584
- let message = target !== null && target !== void 0 ? target : this.create(), end = reader.pos + length;
553
+ let message = target ?? this.create(), end = reader.pos + length;
585
554
  while (reader.pos < end) {
586
555
  let [fieldNo, wireType] = reader.tag();
587
556
  switch (fieldNo) {
588
557
  case /* string name */ 1:
589
558
  message.name = reader.string();
590
559
  break;
591
- case /* mochabug.adapt.plugins.v1.OAuth2Service.GrantType grant_type */ 2:
560
+ case /* mochabugapis.adapt.plugins.v1.OAuth2Service.GrantType grant_type */ 2:
592
561
  message.grantType = reader.int32();
593
562
  break;
594
563
  case /* optional string label */ 3:
@@ -612,7 +581,7 @@ class OAuth2Service$Type extends MessageType {
612
581
  /* string name = 1; */
613
582
  if (message.name !== "")
614
583
  writer.tag(1, WireType.LengthDelimited).string(message.name);
615
- /* mochabug.adapt.plugins.v1.OAuth2Service.GrantType grant_type = 2; */
584
+ /* mochabugapis.adapt.plugins.v1.OAuth2Service.GrantType grant_type = 2; */
616
585
  if (message.grantType !== 0)
617
586
  writer.tag(2, WireType.Varint).int32(message.grantType);
618
587
  /* optional string label = 3; */
@@ -628,17 +597,18 @@ class OAuth2Service$Type extends MessageType {
628
597
  }
629
598
  }
630
599
  /**
631
- * @generated MessageType for protobuf message mochabug.adapt.plugins.v1.OAuth2Service
600
+ * @generated MessageType for protobuf message mochabugapis.adapt.plugins.v1.OAuth2Service
632
601
  */
633
602
  const OAuth2Service = new OAuth2Service$Type();
634
603
  // @generated message type with reflection information, may provide speed optimized methods
635
604
  class EnvironmentalVariable$Type extends MessageType {
636
605
  constructor() {
637
- super("mochabug.adapt.plugins.v1.EnvironmentalVariable", [
606
+ super("mochabugapis.adapt.plugins.v1.EnvironmentalVariable", [
638
607
  { no: 1, name: "name", kind: "scalar", T: 9 /*ScalarType.STRING*/ },
639
608
  { no: 2, name: "label", kind: "scalar", opt: true, T: 9 /*ScalarType.STRING*/ },
640
609
  { no: 3, name: "description", kind: "scalar", opt: true, T: 9 /*ScalarType.STRING*/ },
641
- { no: 4, name: "type", kind: "enum", T: () => ["mochabug.adapt.plugins.v1.EnvironmentalVariable.Type", EnvironmentalVariable_Type, "TYPE_"] }
610
+ { no: 4, name: "type", kind: "enum", T: () => ["mochabugapis.adapt.plugins.v1.EnvironmentalVariable.Type", EnvironmentalVariable_Type, "TYPE_"] },
611
+ { no: 5, name: "optional", kind: "scalar", opt: true, T: 8 /*ScalarType.BOOL*/ }
642
612
  ]);
643
613
  }
644
614
  create(value) {
@@ -649,7 +619,7 @@ class EnvironmentalVariable$Type extends MessageType {
649
619
  return message;
650
620
  }
651
621
  internalBinaryRead(reader, length, options, target) {
652
- let message = target !== null && target !== void 0 ? target : this.create(), end = reader.pos + length;
622
+ let message = target ?? this.create(), end = reader.pos + length;
653
623
  while (reader.pos < end) {
654
624
  let [fieldNo, wireType] = reader.tag();
655
625
  switch (fieldNo) {
@@ -662,9 +632,12 @@ class EnvironmentalVariable$Type extends MessageType {
662
632
  case /* optional string description */ 3:
663
633
  message.description = reader.string();
664
634
  break;
665
- case /* mochabug.adapt.plugins.v1.EnvironmentalVariable.Type type */ 4:
635
+ case /* mochabugapis.adapt.plugins.v1.EnvironmentalVariable.Type type */ 4:
666
636
  message.type = reader.int32();
667
637
  break;
638
+ case /* optional bool optional */ 5:
639
+ message.optional = reader.bool();
640
+ break;
668
641
  default:
669
642
  let u = options.readUnknownField;
670
643
  if (u === "throw")
@@ -686,9 +659,12 @@ class EnvironmentalVariable$Type extends MessageType {
686
659
  /* optional string description = 3; */
687
660
  if (message.description !== undefined)
688
661
  writer.tag(3, WireType.LengthDelimited).string(message.description);
689
- /* mochabug.adapt.plugins.v1.EnvironmentalVariable.Type type = 4; */
662
+ /* mochabugapis.adapt.plugins.v1.EnvironmentalVariable.Type type = 4; */
690
663
  if (message.type !== 0)
691
664
  writer.tag(4, WireType.Varint).int32(message.type);
665
+ /* optional bool optional = 5; */
666
+ if (message.optional !== undefined)
667
+ writer.tag(5, WireType.Varint).bool(message.optional);
692
668
  let u = options.writeUnknownFields;
693
669
  if (u !== false)
694
670
  (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer);
@@ -696,13 +672,13 @@ class EnvironmentalVariable$Type extends MessageType {
696
672
  }
697
673
  }
698
674
  /**
699
- * @generated MessageType for protobuf message mochabug.adapt.plugins.v1.EnvironmentalVariable
675
+ * @generated MessageType for protobuf message mochabugapis.adapt.plugins.v1.EnvironmentalVariable
700
676
  */
701
677
  const EnvironmentalVariable = new EnvironmentalVariable$Type();
702
678
  // @generated message type with reflection information, may provide speed optimized methods
703
679
  class ServiceBinding$Type extends MessageType {
704
680
  constructor() {
705
- super("mochabug.adapt.plugins.v1.ServiceBinding", [
681
+ super("mochabugapis.adapt.plugins.v1.ServiceBinding", [
706
682
  { no: 1, name: "name", kind: "scalar", T: 9 /*ScalarType.STRING*/ },
707
683
  { no: 2, name: "optional", kind: "scalar", T: 8 /*ScalarType.BOOL*/ }
708
684
  ]);
@@ -715,7 +691,7 @@ class ServiceBinding$Type extends MessageType {
715
691
  return message;
716
692
  }
717
693
  internalBinaryRead(reader, length, options, target) {
718
- let message = target !== null && target !== void 0 ? target : this.create(), end = reader.pos + length;
694
+ let message = target ?? this.create(), end = reader.pos + length;
719
695
  while (reader.pos < end) {
720
696
  let [fieldNo, wireType] = reader.tag();
721
697
  switch (fieldNo) {
@@ -750,22 +726,22 @@ class ServiceBinding$Type extends MessageType {
750
726
  }
751
727
  }
752
728
  /**
753
- * @generated MessageType for protobuf message mochabug.adapt.plugins.v1.ServiceBinding
729
+ * @generated MessageType for protobuf message mochabugapis.adapt.plugins.v1.ServiceBinding
754
730
  */
755
731
  const ServiceBinding = new ServiceBinding$Type();
756
732
  // @generated message type with reflection information, may provide speed optimized methods
757
733
  class Vertex$Type extends MessageType {
758
734
  constructor() {
759
- super("mochabug.adapt.plugins.v1.Vertex", [
735
+ super("mochabugapis.adapt.plugins.v1.Vertex", [
760
736
  { no: 1, name: "name", kind: "scalar", T: 9 /*ScalarType.STRING*/ },
761
737
  { no: 2, name: "label", kind: "scalar", T: 9 /*ScalarType.STRING*/ },
762
738
  { no: 3, name: "description", kind: "scalar", opt: true, T: 9 /*ScalarType.STRING*/ },
763
739
  { no: 4, name: "logo", kind: "scalar", opt: true, T: 9 /*ScalarType.STRING*/ },
764
- { no: 5, name: "type", kind: "enum", T: () => ["mochabug.adapt.plugins.v1.Vertex.VertexType", Vertex_VertexType, "VERTEX_TYPE_"] },
740
+ { no: 5, name: "type", kind: "enum", T: () => ["mochabugapis.adapt.plugins.v1.Vertex.VertexType", Vertex_VertexType, "VERTEX_TYPE_"] },
765
741
  { no: 6, name: "default_config", kind: "scalar", T: 9 /*ScalarType.STRING*/ },
766
742
  { no: 7, name: "has_configurator", kind: "scalar", T: 8 /*ScalarType.BOOL*/ },
767
- { no: 8, name: "variables", kind: "message", repeat: 1 /*RepeatType.PACKED*/, T: () => ServiceBinding },
768
- { no: 9, name: "mtls", kind: "message", repeat: 1 /*RepeatType.PACKED*/, T: () => ServiceBinding },
743
+ { no: 8, name: "variables", kind: "message", repeat: 1 /*RepeatType.PACKED*/, T: () => EnvironmentalVariable },
744
+ { no: 9, name: "mtls", kind: "message", repeat: 1 /*RepeatType.PACKED*/, T: () => MTLSService },
769
745
  { no: 10, name: "oauth2", kind: "message", repeat: 1 /*RepeatType.PACKED*/, T: () => ServiceBinding }
770
746
  ]);
771
747
  }
@@ -777,7 +753,7 @@ class Vertex$Type extends MessageType {
777
753
  return message;
778
754
  }
779
755
  internalBinaryRead(reader, length, options, target) {
780
- let message = target !== null && target !== void 0 ? target : this.create(), end = reader.pos + length;
756
+ let message = target ?? this.create(), end = reader.pos + length;
781
757
  while (reader.pos < end) {
782
758
  let [fieldNo, wireType] = reader.tag();
783
759
  switch (fieldNo) {
@@ -793,7 +769,7 @@ class Vertex$Type extends MessageType {
793
769
  case /* optional string logo */ 4:
794
770
  message.logo = reader.string();
795
771
  break;
796
- case /* mochabug.adapt.plugins.v1.Vertex.VertexType type */ 5:
772
+ case /* mochabugapis.adapt.plugins.v1.Vertex.VertexType type */ 5:
797
773
  message.type = reader.int32();
798
774
  break;
799
775
  case /* string default_config */ 6:
@@ -802,13 +778,13 @@ class Vertex$Type extends MessageType {
802
778
  case /* bool has_configurator */ 7:
803
779
  message.hasConfigurator = reader.bool();
804
780
  break;
805
- case /* repeated mochabug.adapt.plugins.v1.ServiceBinding variables */ 8:
806
- message.variables.push(ServiceBinding.internalBinaryRead(reader, reader.uint32(), options));
781
+ case /* repeated mochabugapis.adapt.plugins.v1.EnvironmentalVariable variables */ 8:
782
+ message.variables.push(EnvironmentalVariable.internalBinaryRead(reader, reader.uint32(), options));
807
783
  break;
808
- case /* repeated mochabug.adapt.plugins.v1.ServiceBinding mtls */ 9:
809
- message.mtls.push(ServiceBinding.internalBinaryRead(reader, reader.uint32(), options));
784
+ case /* repeated mochabugapis.adapt.plugins.v1.MTLSService mtls */ 9:
785
+ message.mtls.push(MTLSService.internalBinaryRead(reader, reader.uint32(), options));
810
786
  break;
811
- case /* repeated mochabug.adapt.plugins.v1.ServiceBinding oauth2 */ 10:
787
+ case /* repeated mochabugapis.adapt.plugins.v1.ServiceBinding oauth2 */ 10:
812
788
  message.oauth2.push(ServiceBinding.internalBinaryRead(reader, reader.uint32(), options));
813
789
  break;
814
790
  default:
@@ -835,7 +811,7 @@ class Vertex$Type extends MessageType {
835
811
  /* optional string logo = 4; */
836
812
  if (message.logo !== undefined)
837
813
  writer.tag(4, WireType.LengthDelimited).string(message.logo);
838
- /* mochabug.adapt.plugins.v1.Vertex.VertexType type = 5; */
814
+ /* mochabugapis.adapt.plugins.v1.Vertex.VertexType type = 5; */
839
815
  if (message.type !== 0)
840
816
  writer.tag(5, WireType.Varint).int32(message.type);
841
817
  /* string default_config = 6; */
@@ -844,13 +820,13 @@ class Vertex$Type extends MessageType {
844
820
  /* bool has_configurator = 7; */
845
821
  if (message.hasConfigurator !== false)
846
822
  writer.tag(7, WireType.Varint).bool(message.hasConfigurator);
847
- /* repeated mochabug.adapt.plugins.v1.ServiceBinding variables = 8; */
823
+ /* repeated mochabugapis.adapt.plugins.v1.EnvironmentalVariable variables = 8; */
848
824
  for (let i = 0; i < message.variables.length; i++)
849
- ServiceBinding.internalBinaryWrite(message.variables[i], writer.tag(8, WireType.LengthDelimited).fork(), options).join();
850
- /* repeated mochabug.adapt.plugins.v1.ServiceBinding mtls = 9; */
825
+ EnvironmentalVariable.internalBinaryWrite(message.variables[i], writer.tag(8, WireType.LengthDelimited).fork(), options).join();
826
+ /* repeated mochabugapis.adapt.plugins.v1.MTLSService mtls = 9; */
851
827
  for (let i = 0; i < message.mtls.length; i++)
852
- ServiceBinding.internalBinaryWrite(message.mtls[i], writer.tag(9, WireType.LengthDelimited).fork(), options).join();
853
- /* repeated mochabug.adapt.plugins.v1.ServiceBinding oauth2 = 10; */
828
+ MTLSService.internalBinaryWrite(message.mtls[i], writer.tag(9, WireType.LengthDelimited).fork(), options).join();
829
+ /* repeated mochabugapis.adapt.plugins.v1.ServiceBinding oauth2 = 10; */
854
830
  for (let i = 0; i < message.oauth2.length; i++)
855
831
  ServiceBinding.internalBinaryWrite(message.oauth2[i], writer.tag(10, WireType.LengthDelimited).fork(), options).join();
856
832
  let u = options.writeUnknownFields;
@@ -860,27 +836,28 @@ class Vertex$Type extends MessageType {
860
836
  }
861
837
  }
862
838
  /**
863
- * @generated MessageType for protobuf message mochabug.adapt.plugins.v1.Vertex
839
+ * @generated MessageType for protobuf message mochabugapis.adapt.plugins.v1.Vertex
864
840
  */
865
841
  const Vertex = new Vertex$Type();
866
842
  /**
867
- * @generated ServiceType for protobuf service mochabug.adapt.plugins.v1.PluginService
843
+ * @generated ServiceType for protobuf service mochabugapis.adapt.plugins.v1.PluginService
868
844
  */
869
- const PluginService = new ServiceType("mochabug.adapt.plugins.v1.PluginService", [
845
+ const PluginService = new ServiceType("mochabugapis.adapt.plugins.v1.PluginService", [
870
846
  { name: "UploadPlugin", clientStreaming: true, options: { "google.api.http": { post: "/v1/plugins/upload", body: "*" } }, I: UploadPluginRequest, O: UploadPluginResponse }
871
847
  ], { "google.api.default_host": "adapt.mochabugapis.com", "google.api.oauth_scopes": "https://www.mochabugapis.com/auth/adapt.plugins" });
872
848
 
873
849
  /**
874
850
  * PluginService provides a service for uploading a plugin.
875
851
  *
876
- * @generated from protobuf service mochabug.adapt.plugins.v1.PluginService
852
+ * @generated from protobuf service mochabugapis.adapt.plugins.v1.PluginService
877
853
  */
878
854
  class PluginServiceClient {
855
+ _transport;
856
+ typeName = PluginService.typeName;
857
+ methods = PluginService.methods;
858
+ options = PluginService.options;
879
859
  constructor(_transport) {
880
860
  this._transport = _transport;
881
- this.typeName = PluginService.typeName;
882
- this.methods = PluginService.methods;
883
- this.options = PluginService.options;
884
861
  }
885
862
  /**
886
863
  * UploadPlugin is a streaming RPC method that allows uploading a plugin in
@@ -888,7 +865,7 @@ class PluginServiceClient {
888
865
  * server will respond with a single UploadPluginResponse after processing all
889
866
  * requests.
890
867
  *
891
- * @generated from protobuf rpc: UploadPlugin(stream mochabug.adapt.plugins.v1.UploadPluginRequest) returns (mochabug.adapt.plugins.v1.UploadPluginResponse);
868
+ * @generated from protobuf rpc: UploadPlugin(stream mochabugapis.adapt.plugins.v1.UploadPluginRequest) returns (mochabugapis.adapt.plugins.v1.UploadPluginResponse);
892
869
  */
893
870
  uploadPlugin(options) {
894
871
  const method = this.methods[0], opt = this._transport.mergeOptions(options);
@@ -896,6 +873,30 @@ class PluginServiceClient {
896
873
  }
897
874
  }
898
875
 
876
+ var externalConfigTemplate = "import { VertexConfig } from '@mochabug/adapt-plugin-toolkit/api';\nimport { ExternalConfiguratorRouter } from '@mochabug/adapt-plugin-toolkit/router';\n\n/**\n * Constructs an instance of ExternalConfiguratorRouter and sets up routes to handle GET requests for configuration and HTML page.\n *\n * @name router\n * @type {ExternalConfiguratorRouter}\n */\nexport const router = new ExternalConfiguratorRouter()\n\n /**\n * Sets up a GET route at the '/api/config' endpoint.\n * This route is called for authorization and to get the vertex configuration.\n *\n * @method add\n * @async\n * @returns {Response} Returns a response object. The content of the response is based on the authorization result and the configuration result.\n */\n .add('GET', '/api/config', async (req, api) => {\n const authHeader = req.headers.get('Authorization')!;\n const auth = await api.authorize(authHeader.substring('Bearer '.length));\n if (!auth.ok) {\n return new Response('Unauthorized', { status: 401 });\n }\n\n const res = await api.getVertexConfig<VertexConfig>();\n if (!res.ok) {\n console.error(res);\n return new Response(res.errorMessage, { status: res.errorStatus });\n }\n return new Response(JSON.stringify(res.data!.item), {\n headers: {\n 'Content-Type': 'application/json',\n },\n });\n })\n\n /**\n * Sets up a GET route at the '/?' endpoint.\n * This route is called to display a \"Hello World\" page.\n *\n * @method add\n * @async\n * @returns {Response} Returns a response object with \"Hello World\" page content.\n */\n .add('GET', '(/?)', async () => {\n return new Response(getHelloWorldPage(), {\n headers: {\n 'Content-Type': 'text/html',\n },\n });\n });\n\nfunction getHelloWorldPage(): string {\n return `\n <html>\n <head>\n <style>\n @import url('https://fonts.googleapis.com/css2?family=Orbitron&display=swap');\n @keyframes glow {\n 0% { text-shadow: 0 0 5px #0f0, 0 0 10px #0f0, 0 0 15px #0f0, 0 0 20px #0f0; }\n 100% { text-shadow: 0 0 10px #0f0, 0 0 20px #0f0, 0 0 30px #0f0, 0 0 40px #0f0; }\n }\n body {\n background-color: #000;\n color: #0f0;\n font-family: 'Orbitron', sans-serif;\n text-align: center;\n overflow: hidden;\n margin: 0;\n padding: 0;\n }\n h1 {\n position: absolute;\n top: 30%;\n left: 50%;\n transform: translate(-50%, -50%);\n font-size: 3em;\n text-transform: uppercase;\n letter-spacing: 4px;\n animation: glow 2s infinite alternate;\n }\n #jsonOutput {\n position: absolute;\n top: 70%;\n left: 50%;\n transform: translate(-50%, -50%);\n font-size: 1.5em;\n text-transform: uppercase;\n letter-spacing: 2px;\n animation: glow 2s infinite alternate;\n }\n button {\n position: absolute;\n top: 50%;\n left: 50%;\n transform: translate(-50%, -50%);\n background-color: #0f0;\n border: none;\n color: black;\n padding: 15px 32px;\n text-align: center;\n text-decoration: none;\n display: inline-block;\n font-size: 20px; /* Increase the font size */\n margin: 4px 2px;\n cursor: pointer;\n transition-duration: 0.4s;\n animation: glow 2s infinite alternate;\n font-family: 'Orbitron', sans-serif;\n border-radius: 15px;\n transform: rotate(-10deg) skew(10deg, 10deg);\n }\n </style>\n </head>\n <body>\n <h1>Hello, World!</h1>\n <button id=\"assimilateButton\">Assimilate</button>\n <pre id=\"jsonOutput\"></pre>\n <script>\n document.getElementById('assimilateButton').addEventListener('click', function() {\n const hash = window.location.hash.substr(1).trim();\n const token = decodeURIComponent(hash); \n fetch('/api/config', {\n method: 'GET',\n headers: {\n 'Authorization': 'Bearer ' + token\n }\n })\n .then(response => response.json())\n .then(data => {\n document.getElementById('jsonOutput').innerText = JSON.stringify(data, null, 2);\n this.style.display = 'none'; /* Hide button after being clicked */\n })\n .catch(error => {\n console.error('Error:', error);\n document.getElementById('jsonOutput').innerText = 'Error occurred while assimilating data';\n });\n });\n </script>\n </body>\n </html>\n `;\n}\n";
877
+
878
+ var internalConfigTemplate = "import { InternalConfiguratorRouter } from '@mochabug/adapt-plugin-toolkit/router';\n/**\n * A `InternalConfiguratorRouter` instance configured to handle internal platform calls for the vertex during configuration.\n *\n * There are no events to handle at the moment\n *\n * @see InternalConfiguratorRouter\n */\nexport const router = new InternalConfiguratorRouter();\n";
879
+
880
+ var browserExecTempalte = "import { ExternalExecutorRouter } from '@mochabug/adapt-plugin-toolkit/router';\n\n/**\n * Constructs an instance of ExternalExecutorRouter and sets up routes to handle POST and GET requests.\n *\n * @name router\n * @type {ExternalExecutorRouter}\n */\nexport const router = new ExternalExecutorRouter()\n\n /**\n * Sets up a POST route at the '/api/done' endpoint.\n * This route checks the authorization status before allowing the action to complete.\n *\n * @method add\n * @async\n * @param {Request} _req - The incoming request object. This parameter is ignored in this function.\n * @param {ExecutorApi} api - The api object to interact with the system.\n * @param {RouteInfo} route - The route information. This parameter is ignored in this function.\n * @param {ExecutionContext} ctx - The context of execution to handle lifecycle events.\n * @returns {Response} Returns a response object.\n */\n .add('POST', '/api/done', async (req, api, route, ctx) => {\n const authHeader = req.headers.get('Authorization')!;\n const auth = await api.authorize(authHeader.substring('Bearer '.length));\n if (!auth.ok) {\n return new Response('Unauthorized', { status: 401 });\n }\n // We need the privileged api to communicate with the session\n const sapi = api.getSessionApi(authHeader);\n ctx.waitUntil(sapi.complete('output', {}));\n return new Response();\n })\n\n /**\n * Sets up a GET route at the root endpoint.\n * This route responds with a sample HTML page.\n *\n * @method add\n * @async\n * @returns {Response} Returns a response object with the HTML content and the appropriate headers.\n */\n .add('GET', '(/?)', async () => {\n return new Response(getSamplePage(), {\n headers: {\n 'Content-Type': 'text/html',\n },\n });\n });\n\nfunction getSamplePage(): string {\n return `\n <html>\n <head>\n <style>\n @import url('https://fonts.googleapis.com/css2?family=Orbitron&display=swap');\n @keyframes glow {\n 0% { text-shadow: 0 0 5px #0f0, 0 0 10px #0f0, 0 0 15px #0f0, 0 0 20px #0f0; }\n 100% { text-shadow: 0 0 10px #0f0, 0 0 20px #0f0, 0 0 30px #0f0, 0 0 40px #0f0; }\n }\n body {\n background-color: #000;\n color: #0f0;\n font-family: 'Orbitron', sans-serif;\n text-align: center;\n overflow: hidden;\n margin: 0;\n padding: 0;\n }\n button {\n position: absolute;\n top: 50%;\n left: 50%;\n transform: translate(-50%, -50%);\n background-color: #0f0;\n border: none;\n color: black;\n padding: 15px 32px;\n text-align: center;\n text-decoration: none;\n display: inline-block;\n font-size: 20px;\n margin: 4px 2px;\n cursor: pointer;\n transition-duration: 0.4s;\n animation: glow 2s infinite alternate;\n font-family: 'Orbitron', sans-serif;\n border-radius: 15px;\n transform: rotate(-10deg) skew(10deg, 10deg);\n }\n </style>\n </head>\n <body>\n <button id=\"doneButton\">Done</button>\n <script>\n document.getElementById('doneButton').addEventListener('click', function() {\n const hash = window.location.hash.substr(1).trim();\n const token = decodeURIComponent(hash); \n fetch('/api/done', {\n method: 'POST',\n headers: {\n 'Authorization': 'Bearer ' + token\n }\n })\n .then(data => {\n this.innerText = 'Done';\n })\n .catch(error => {\n console.error('Error:', error);\n });\n });\n </script>\n </body>\n </html>\n `;\n}\n";
881
+
882
+ var cronExecTemplate = "import { CronExecutorRouter } from '@mochabug/adapt-plugin-toolkit/router';\n\n/**\n * Constructs an instance of CronExecutorRouter and sets up event handlers for all internal execution events.\n *\n * @name router\n * @type {CronExecutorRouter}\n */\nexport const router = new CronExecutorRouter()\n /**\n * Sets up a handler for the start event.\n * The handler is called when the execution of a vertex starts.\n *\n * @method onStart\n * @async\n */\n .onStart(async (req, api) => {\n const start = await req.json<StartExecutionRequest>();\n console.log('Start has been called');\n console.log(start);\n })\n /**\n * Sets up a handler for the stop event.\n * This route is called when the vertex is forcibly stopped.\n * I.e. a trigger that is closed or a session that is forcibly closed.\n *\n * @method onStop\n * @async\n */\n .onStop(async (req, api) => {\n console.log('Stop has been called');\n })\n /**\n * Sets up a handler for the cron event.\n * This route is called when the cron trigger is fired.\n *\n * @method onCron\n * @async\n */\n .onCron(async (req, api) => {\n console.log('Received cron event');\n })\n /**\n * Sets up a handler for the stream event.\n * This route is called when stream content is available.\n *\n * @method onStream\n * @async\n */\n .onStream(async (req, api, name) => {\n console.log(`Stream ${name} has been called`);\n const res = await req.json<StreamResult>();\n console.log(res);\n })\n\n /**\n * Sets up a handler for the procedure event.\n * This route is called when procedure result is available.\n *\n * @method onProcedure\n * @async\n */\n .onProcedure(async (req, api, name) => {\n console.log(`Procedure ${name} has been called`);\n const res = await req.json<ProcedureResult>();\n console.log(res);\n });\n";
883
+
884
+ var triggerExecTemplate = "import { ExternalExecutorRouter } from '@mochabug/adapt-plugin-toolkit/router';\n\n/**\n * Constructs an instance of ExternalExecutorRouter and sets up a wildcard route to handle all requests.\n * This wildcard route makes this router capable of receiving any type of HTTP request on any route.\n * It's important to note that this generic handling might not be suitable for all webhook scenarios.\n * For instance, some webhooks might require specific routes or specific types of requests.\n * In these cases, you should add specific routes to handle these scenarios.\n *\n * @name router\n */\nexport const router = new ExternalExecutorRouter()\n /**\n * Sets up a wildcard route that matches any HTTP method and any URL pattern.\n * This route is ideal for handling webhooks, which often send POST requests to a specific URL.\n * Here are a few examples of common webhook scenarios:\n * 1. GitHub sends a POST request to /github-webhook every time a new issue is created in your repository.\n * 2. Stripe sends a POST request to /stripe-webhook whenever a new payment is received.\n * 3. Twilio sends a POST request to /sms-webhook whenever an incoming SMS message is received.\n * For these scenarios, you should add specific routes that match these patterns (e.g., POST /github-webhook).\n *\n * Also, it's important to ensure that your webhooks are secure. One common way to do this is by validating the payload signature.\n * Most platforms sending webhooks provide a signature in the request headers that can be used to verify that the payload was not tampered with.\n *\n * @method add\n * @async\n * @returns {Response} Returns a response object with a sample HTML page.\n */\n .add('*', '(.*)', async () => {\n return new Response();\n });";
885
+
886
+ var internalExecTemplate = "import { InternalExecutorRouter } from '@mochabug/adapt-plugin-toolkit/router';\n\n/**\n * Constructs an instance of InternalExecutorRouter and sets up event handlers for all internal execution events.\n *\n * @name router\n * @type {InternalExecutorRouter}\n */\nexport const router = new InternalExecutorRouter()\n /**\n * Sets up a handler for the start event.\n * The handler is called when the execution of a vertex starts.\n *\n * @method onStart\n * @async\n */\n .onStart(async (req, api) => {\n const start = await req.json<StartExecutionRequest>();\n console.log('Start has been called');\n console.log(start);\n })\n /**\n * Sets up a handler for the stop event.\n * This route is called when the vertex is forcibly stopped.\n * I.e. a trigger that is closed or a session that is forcibly closed.\n *\n * @method onStop\n * @async\n */\n .onStop(async (req, api) => {\n console.log('Stop has been called');\n })\n /**\n * Sets up a handler for the stream event.\n * This route is called when stream content is available.\n *\n * @method onStream\n * @async\n */\n .onStream(async (req, api, name) => {\n console.log(`Stream ${name} has been called`);\n const res = await req.json<StreamResult>();\n console.log(res);\n })\n\n /**\n * Sets up a handler for the procedure event.\n * This route is called when procedure result is available.\n *\n * @method onProcedure\n * @async\n */\n .onProcedure(async (req, api, name) => {\n console.log(`Procedure ${name} has been called`);\n const res = await req.json<ProcedureResult>();\n console.log(res);\n });\n";
887
+
888
+ var gitignoreTemplate = "# Logs\nlogs\n*.log\nnpm-debug.log*\nyarn-debug.log*\nyarn-error.log*\nlerna-debug.log*\n.pnpm-debug.log*\n\n# Diagnostic reports (https://nodejs.org/api/report.html)\nreport.[0-9]*.[0-9]*.[0-9]*.[0-9]*.json\n\n# Runtime data\npids\n*.pid\n*.seed\n*.pid.lock\n\n# Directory for instrumented libs generated by jscoverage/JSCover\nlib-cov\n\n# Coverage directory used by tools like istanbul\ncoverage\n*.lcov\n\n# nyc test coverage\n.nyc_output\n\n# Grunt intermediate storage (https://gruntjs.com/creating-plugins#storing-task-files)\n.grunt\n\n# Bower dependency directory (https://bower.io/)\nbower_components\n\n# node-waf configuration\n.lock-wscript\n\n# Compiled binary addons (https://nodejs.org/api/addons.html)\nbuild/Release\n\n# Dependency directories\nnode_modules/\njspm_packages/\n\n# Snowpack dependency directory (https://snowpack.dev/)\nweb_modules/\n\n# TypeScript cache\n*.tsbuildinfo\n\n# Optional npm cache directory\n.npm\n\n# Optional eslint cache\n.eslintcache\n\n# Optional stylelint cache\n.stylelintcache\n\n# Microbundle cache\n.rpt2_cache/\n.rts2_cache_cjs/\n.rts2_cache_es/\n.rts2_cache_umd/\n\n# Optional REPL history\n.node_repl_history\n\n# Output of 'npm pack'\n*.tgz\n\n# Yarn Integrity file\n.yarn-integrity\n\n# dotenv environment variable files\n.env\n.env.development.local\n.env.test.local\n.env.production.local\n.env.local\n\n# parcel-bundler cache (https://parceljs.org/)\n.cache\n.parcel-cache\n\n# Next.js build output\n.next\nout\n\n# Nuxt.js build / generate output\n.nuxt\ndist\nbuild\n\n# Gatsby files\n.cache/\n# Comment in the public line in if your project uses Gatsby and not Next.js\n# https://nextjs.org/blog/next-9-1#public-directory-support\n# public\n\n# vuepress build output\n.vuepress/dist\n\n# vuepress v2.x temp and cache directory\n.temp\n.cache\n\n# Stores VSCode versions used for testing VSCode extensions\n.vscode-test\n\n# yarn v2\n.yarn/cache\n.yarn/unplugged\n.yarn/build-state.yml\n.yarn/install-state.gz\n.pnp.*";
889
+
890
+ var jestTemplate = "import type { Config } from \"@jest/types\"\n\nconst config: Config.InitialOptions = {\n preset: \"ts-jest\",\n testEnvironment: \"node\",\n verbose: true,\n automock: true,\n}\nexport default config";
891
+
892
+ var licenseTemplate = "## ISC License\n\nCopyright (c) [year] [fullname]\n\nPermission to use, copy, modify, and/or distribute this software for any\npurpose with or without fee is hereby granted, provided that the above\ncopyright notice and this permission notice appear in all copies.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH\nREGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY\nAND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,\nINDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM\nLOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR\nOTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR\nPERFORMANCE OF THIS SOFTWARE.";
893
+
894
+ var readmeTemplate = "# 🐞 Mochabug Adapt's Magnificent Plugin 🐞\n\n[![Version](https://img.shields.io/badge/version-PLUGIN_VERSION-blue)](PLUGIN_REPOSITORY_URL)\n[![License: ISC](https://img.shields.io/badge/License-ISC-yellow.svg)](https://opensource.org/licenses/ISC)\n\n## 📝 Description\n\nWelcome to the Magnificent Plugin for Mochabug Adapt! Developed by a talented third-party developer, this plugin promises to bring extra flavor to your Mochabug Adapt cloud platform experience. PLUGIN_DESCRIPTION\n\nThis plugin consists of one or more vertices. Each vertex is made up of an Executor and may optionally include a Configurator to help you tailor its behavior.\n\n## 📚 Table of Contents\n\n- [🐞 Mochabug Adapt's Magnificent Plugin 🐞](#-mochabug-adapts-magnificent-plugin-)\n - [📝 Description](#-description)\n - [📚 Table of Contents](#-table-of-contents)\n - [🚀 Getting Started](#-getting-started)\n - [🎯 Usage](#-usage)\n - [⚙️ Configuration](#️-configuration)\n - [📖 Documentation](#-documentation)\n - [🤝 Contributing](#-contributing)\n - [📜 License](#-license)\n - [👤 Author](#-author)\n\n## 🚀 Getting Started\n\nTo begin using Mochabug Adapt's Magnificent Plugin, simply start incorporating its vertices into your workflows within the Mochabug Adapt platform. No installation is required.\n\n## 🎯 Usage\n\nYou can start using the vertices by incorporating them into your workflows on the Mochabug Adapt platform. Each vertex will delight you with a specific task, and the usage will vary depending on your requirements. Consult the plugin documentation for a comprehensive guide on each vertex's usage.\n\n## ⚙️ Configuration\n\nEach vertex in the plugin may have a Configurator, which allows you to tailor the vertex's behavior to your liking. Configuration options may include settings for the Executor, input/output data formats, and other essential options.\n\n## 📖 Documentation\n\nFor more insights into the plugin, its vertices, and their features, visit the [homepage](PLUGIN_HOMEPAGE) and the [repository](PLUGIN_REPOSITORY_URL).\n\n## 🤝 Contributing\n\nReady to make the Magnificent Plugin for Mochabug Adapt even more magical? Contributions are welcome! Check the [repository](PLUGIN_REPOSITORY_URL) for open issues and guidelines on how to contribute.\n\n## 📜 License\n\nThis plugin is licensed under the [ISC License](https://opensource.org/licenses/ISC).\n\n## 👤 Author\n\nPLUGIN_AUTHOR\n";
895
+
896
+ var rollupTemplate = "import fs from 'fs';\nimport typescript from '@rollup/plugin-typescript';\nimport { nodeResolve } from '@rollup/plugin-node-resolve';\nimport terser from '@rollup/plugin-terser';\nimport commonjs from '@rollup/plugin-commonjs';\n\nconst config = [\n {\n input: 'src/executors.ts',\n output: {\n file: 'dist/executors.js',\n format: 'esm'\n },\n plugins: [typescript(), nodeResolve(), commonjs(), terser()]\n }\n];\n\n// Check if 'src/configurators.ts' exists\nif (fs.existsSync('src/configurators.ts')) {\n config.push({\n input: 'src/configurators.ts',\n output: {\n file: 'dist/configurators.js',\n format: 'esm'\n },\n plugins: [typescript(), nodeResolve(), commonjs(), terser()]\n });\n}\n\nexport default config;\n";
897
+
898
+ var tsconfig = "{\n \"exclude\": [\n \"**/*.test.*\",\n \"**/__mocks__/*\",\n \"**/__tests__/*\"\n ],\n \"compilerOptions\": {\n \"rootDir\": \"src\",\n \"jsx\": \"react\",\n \"target\": \"esnext\",\n \"module\": \"esnext\",\n \"lib\": [\"esnext\"],\n \"moduleResolution\": \"node\",\n \"types\": [\n \"@mochabug/adapt-plugin-typings\",\n \"jest\"\n ],\n \"resolveJsonModule\": true,\n \"allowJs\": true,\n \"checkJs\": false,\n \"noEmit\": true,\n \"isolatedModules\": true,\n \"allowSyntheticDefaultImports\": true,\n \"forceConsistentCasingInFileNames\": true,\n \"strict\": true,\n \"skipLibCheck\": true\n }\n}";
899
+
899
900
  // Copyright 2023, mochabug AB
900
901
  //
901
902
  // Licensed under the Apache License, Version 2.0 (the "License");
@@ -1158,12 +1159,10 @@ function init(dir) {
1158
1159
  homepage: `https://www.foobar.com`,
1159
1160
  repository: `https://github.com`,
1160
1161
  vertices: [vertex],
1161
- vertexVariables: [],
1162
- vertexMtls: [],
1163
- vertexOauth2: [],
1164
1162
  assetsDir: 'assets',
1165
1163
  executorEsm: 'dist/executors.js',
1166
1164
  variables: [],
1165
+ oauth2: [],
1167
1166
  mtls: [],
1168
1167
  };
1169
1168
  if (!vertex.defaultConfig) {
@@ -1296,11 +1295,11 @@ function publish(manifest, address) {
1296
1295
  for (let vertex of manifest.vertices) {
1297
1296
  yield send(vertex.logo, [40, 40]);
1298
1297
  yield send(vertex.defaultConfig);
1298
+ for (let mtls of vertex.mtls) {
1299
+ yield send(mtls.trustedCa);
1300
+ }
1299
1301
  }
1300
1302
  // Send the ca bundles
1301
- for (let mtls of manifest.vertexMtls) {
1302
- yield send(mtls.trustedCa);
1303
- }
1304
1303
  for (let mtls of manifest.mtls) {
1305
1304
  yield send(mtls.trustedCa);
1306
1305
  }