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

@workflowai/code-generator

Package Overview
Dependencies
Maintainers
2
Versions
21
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@workflowai/code-generator - npm Package Compare versions

Comparing version 1.0.7 to 1.0.8

6

dist/cjs/playground.d.ts
import { JsonSchemaObject } from '@workflowai/schema';
export type FileDataProvider = 'fs-promise' | 'fetch' | 'axios';
export declare enum FileDataProvider {
FILE_SYSTEM = "fs-promise",
FETCH = "fetch",
AXIOS = "axios"
}
type GeneratedCode = {

@@ -4,0 +8,0 @@ language: 'bash' | 'typescript';

16

dist/cjs/playground.js
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.getPlaygroundSnippets = void 0;
exports.getPlaygroundSnippets = exports.FileDataProvider = void 0;
const schema_1 = require("@workflowai/schema");

@@ -23,11 +23,17 @@ const beautify_1 = require("./beautify");

};
var FileDataProvider;
(function (FileDataProvider) {
FileDataProvider["FILE_SYSTEM"] = "fs-promise";
FileDataProvider["FETCH"] = "fetch";
FileDataProvider["AXIOS"] = "axios";
})(FileDataProvider || (exports.FileDataProvider = FileDataProvider = {}));
const base64DataToFileDataProvider = (str, fileDataProvider) => {
return str.replace(/"[-A-Za-z0-9+/]{50,}={0,3}"/g, {
'fs-promise': 'readFile("/path/to/file")',
fetch: '(await fetch("http://url.to/file")).arrayBuffer()',
axios: '(await axios.get("http://url.to/file", { responseType: "arraybuffer" })).data',
[FileDataProvider.FILE_SYSTEM]: 'readFile("/path/to/file")',
[FileDataProvider.FETCH]: '(await fetch("http://url.to/file")).arrayBuffer()',
[FileDataProvider.AXIOS]: '(await axios.get("http://url.to/file", { responseType: "arraybuffer" })).data',
}[fileDataProvider]);
};
const getPlaygroundSnippets = async (config) => {
const { taskId, taskName, schema, groupId, example, api, fileDataProvider = 'fs-promise', } = {
const { taskId, taskName, schema, groupId, example, api, fileDataProvider = FileDataProvider.FILE_SYSTEM, } = {
...config,

@@ -34,0 +40,0 @@ };

@@ -20,11 +20,17 @@ import { inputSchemaToZod, outputSchemaToZod, } from '@workflowai/schema';

};
export var FileDataProvider;
(function (FileDataProvider) {
FileDataProvider["FILE_SYSTEM"] = "fs-promise";
FileDataProvider["FETCH"] = "fetch";
FileDataProvider["AXIOS"] = "axios";
})(FileDataProvider || (FileDataProvider = {}));
const base64DataToFileDataProvider = (str, fileDataProvider) => {
return str.replace(/"[-A-Za-z0-9+/]{50,}={0,3}"/g, {
'fs-promise': 'readFile("/path/to/file")',
fetch: '(await fetch("http://url.to/file")).arrayBuffer()',
axios: '(await axios.get("http://url.to/file", { responseType: "arraybuffer" })).data',
[FileDataProvider.FILE_SYSTEM]: 'readFile("/path/to/file")',
[FileDataProvider.FETCH]: '(await fetch("http://url.to/file")).arrayBuffer()',
[FileDataProvider.AXIOS]: '(await axios.get("http://url.to/file", { responseType: "arraybuffer" })).data',
}[fileDataProvider]);
};
export const getPlaygroundSnippets = async (config) => {
const { taskId, taskName, schema, groupId, example, api, fileDataProvider = 'fs-promise', } = {
const { taskId, taskName, schema, groupId, example, api, fileDataProvider = FileDataProvider.FILE_SYSTEM, } = {
...config,

@@ -31,0 +37,0 @@ };

import { JsonSchemaObject } from '@workflowai/schema';
export type FileDataProvider = 'fs-promise' | 'fetch' | 'axios';
export declare enum FileDataProvider {
FILE_SYSTEM = "fs-promise",
FETCH = "fetch",
AXIOS = "axios"
}
type GeneratedCode = {

@@ -4,0 +8,0 @@ language: 'bash' | 'typescript';

{
"name": "@workflowai/code-generator",
"version": "1.0.7",
"version": "1.0.8",
"description": "workflowAI code-generator",

@@ -5,0 +5,0 @@ "author": "workflowAI",

Sorry, the diff of this file is not supported yet

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