Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@contrail/cli

Package Overview
Dependencies
Maintainers
9
Versions
134
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@contrail/cli - npm Package Compare versions

Comparing version 1.0.42 to 1.0.43

lib/apps/app-api.d.ts

1

lib/api/event-workflow-template-definition.d.ts

@@ -6,1 +6,2 @@ export declare function createWorkflowTemplateDefinition(object: any): Promise<any>;

}): Promise<any>;
export declare function deleteWorkflowTemplateDefinition(templateId: string): Promise<any>;

@@ -15,1 +15,7 @@ import { Entities } from '@contrail/sdk';

}
export async function deleteWorkflowTemplateDefinition(templateId) {
return await new Entities().delete({
entityName: 'event-workflow-template-definition',
id: templateId,
});
}

31

lib/workflow-template-definitions/workflow-template-definition-deployer.js

@@ -5,3 +5,3 @@ import inquirer from 'inquirer';

import { createWorkflowTemplate } from '../api/event-workflow-templates';
import { createWorkflowTemplateDefinition, updateWorkflowTemplateDefinition as apiUpdateWorkflowTemplateDefinition } from '../api/event-workflow-template-definition';
import { createWorkflowTemplateDefinition, deleteWorkflowTemplateDefinition, updateWorkflowTemplateDefinition as apiUpdateWorkflowTemplateDefinition } from '../api/event-workflow-template-definition';
import { getActionDeclarationIdentifier, getActionsForApp } from '../apps/deploy-app/actions-deployer';

@@ -15,3 +15,3 @@ export class WorkflowTemplateDefinitionDeployer {

}
let answers = await inquirer.prompt([{
const answers = await inquirer.prompt([{
type: 'list',

@@ -27,16 +27,13 @@ name: 'appIdentifier',

}
answers = await inquirer.prompt([{
type: 'confirm',
name: 'shouldInstall',
message: 'Confirmation: would you like to install these workflows? (yes)',
default: true,
}]);
if (!answers.shouldInstall) {
console.log('%s Canceling installing workflows template definitions.', chalk.yellow.bold('WORKFLOW DEFINITION TEMPLATE'));
return;
}
await this.installWorkflowTemplateDefinitions(workflowTemplateDefinitions);
}
async installWorkflowTemplateDefinitions(workflowTemplateDefinitions) {
const answers = await inquirer.prompt([{
let answers = await inquirer.prompt([{
type: 'checkbox',
name: 'workflowTemplateDefinitionsToInstall',
message: 'Which workflow templates would you like to install?',
choices: workflowTemplateDefinitions.map(x => { return { value: x.identifier, name: x.name }; }),
}]);
const workflowTemplateDefinitionsToInstall = workflowTemplateDefinitions.filter(x => answers.workflowTemplateDefinitionsToInstall.includes(x.identifier));
answers = await inquirer.prompt([{
type: 'confirm',

@@ -48,3 +45,3 @@ name: 'makeActive',

const makeActive = answers.makeActive;
for (const definition of workflowTemplateDefinitions) {
for (const definition of workflowTemplateDefinitionsToInstall) {
const newObject = {

@@ -88,2 +85,8 @@ name: definition.name,

}
// remove old templates that were removed by the app publisher
const localIdentifiers = localWorkflows.map(x => this.getWorkflowDeclarationIdentifier(x, app));
const workflowTemplateDefinitionsToDelete = existingWorkflows.filter(x => !localIdentifiers.includes(x.identifier));
for (const templateToDelete of workflowTemplateDefinitionsToDelete) {
await deleteWorkflowTemplateDefinition(templateToDelete.id);
}
}

@@ -90,0 +93,0 @@ }

export declare function deleteWorkflowTemplates(): Promise<void>;
export declare function localDeleteWorkflowTemplate(): Promise<void>;
export declare function localDeployWorkflowTemplate(): Promise<void>;
export declare function listWorkflowTemplate(): Promise<any>;
export declare function listWorkflowTemplate(): Promise<void>;
export declare class WorkflowTemplateDeployer {
deleteWorkflowTemplates(): Promise<void>;
listExistingWorkflowTemplates(): Promise<any>;
listExistingWorkflowTemplates(): Promise<void>;
}

@@ -22,5 +22,6 @@ import chalk from 'chalk';

const templates = await getExistingWorkflowTemplates();
console.log(templates);
return templates;
console.log('(Date Created) (active) workflow name');
console.log('------------------------');
console.log(chalk.green.bold(templates.map(x => `(${x.createdOn}) (${x.isActive ? 'active' : 'inactive'}) ${x.name} `).join('\n')));
}
}
{
"name": "@contrail/cli",
"version": "1.0.42",
"version": "1.0.43",
"description": "VibeIQ's Contrail Platform CLI.",

@@ -5,0 +5,0 @@ "main": "lib/index.js",

@@ -16,2 +16,9 @@ import { Entities } from '@contrail/sdk';

});
}
export async function deleteWorkflowTemplateDefinition(templateId: string) {
return await new Entities().delete({
entityName: 'event-workflow-template-definition',
id: templateId,
});
}

@@ -6,3 +6,3 @@ import inquirer from 'inquirer';

import { createWorkflowTemplate } from '../api/event-workflow-templates';
import { createWorkflowTemplateDefinition, updateWorkflowTemplateDefinition as apiUpdateWorkflowTemplateDefinition } from '../api/event-workflow-template-definition';
import { createWorkflowTemplateDefinition, deleteWorkflowTemplateDefinition, updateWorkflowTemplateDefinition as apiUpdateWorkflowTemplateDefinition } from '../api/event-workflow-template-definition';
import { getActionDeclarationIdentifier, getActionsForApp } from '../apps/deploy-app/actions-deployer';

@@ -19,3 +19,3 @@

let answers = await inquirer.prompt([{
const answers = await inquirer.prompt([{
type: 'list',

@@ -31,14 +31,2 @@ name: 'appIdentifier',

}
answers = await inquirer.prompt([{
type: 'confirm',
name: 'shouldInstall',
message: 'Confirmation: would you like to install these workflows? (yes)',
default: true,
}]);
if (!answers.shouldInstall) {
console.log('%s Canceling installing workflows template definitions.', chalk.yellow.bold('WORKFLOW DEFINITION TEMPLATE'));
return;
}
await this.installWorkflowTemplateDefinitions(workflowTemplateDefinitions);

@@ -48,4 +36,11 @@ }

async installWorkflowTemplateDefinitions(workflowTemplateDefinitions: WorkflowTemplate[]) {
let answers = await inquirer.prompt([{
type: 'checkbox',
name: 'workflowTemplateDefinitionsToInstall',
message: 'Which workflow templates would you like to install?',
choices: workflowTemplateDefinitions.map(x => {return {value: x.identifier, name: x.name};}),
}]);
const answers = await inquirer.prompt([{
const workflowTemplateDefinitionsToInstall = workflowTemplateDefinitions.filter(x => answers.workflowTemplateDefinitionsToInstall.includes(x.identifier));
answers = await inquirer.prompt([{
type: 'confirm',

@@ -57,3 +52,3 @@ name: 'makeActive',

const makeActive = answers.makeActive;
for (const definition of workflowTemplateDefinitions) {
for (const definition of workflowTemplateDefinitionsToInstall) {
const newObject: WorkflowTemplate = {

@@ -108,2 +103,9 @@ name: definition.name,

}
// remove old templates that were removed by the app publisher
const localIdentifiers = localWorkflows.map(x=> this.getWorkflowDeclarationIdentifier(x, app));
const workflowTemplateDefinitionsToDelete = existingWorkflows.filter(x=> !localIdentifiers.includes(x.identifier));
for(const templateToDelete of workflowTemplateDefinitionsToDelete) {
await deleteWorkflowTemplateDefinition(templateToDelete.id);
}
}

@@ -110,0 +112,0 @@ }

@@ -26,5 +26,6 @@ import chalk from 'chalk';

const templates = await getExistingWorkflowTemplates();
console.log(templates);
return templates;
console.log('(Date Created) (active) workflow name');
console.log('------------------------');
console.log(chalk.green.bold(templates.map(x => `(${x.createdOn}) (${x.isActive? 'active': 'inactive'}) ${x.name} `).join('\n')));
}
}
SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc