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.1.4 to 1.1.5

1

dist/cjs/playground.d.ts

@@ -38,4 +38,5 @@ import { JsonSchemaObject } from '@workflowai/schema';

streamRunTask: GeneratedCode;
importTaskRun: GeneratedCode;
};
export declare const getPlaygroundSnippets: (config: GetPlaygroundSnippetsConfig) => Promise<GetPlaygroundSnippetsResult>;
export {};

@@ -55,5 +55,9 @@ "use strict";

const taskFunctionName = validVarName(taskName || taskId);
const importRunFunctionName = validVarName(`import ${taskFunctionName} run`);
const _stringifiedInput = JSON.stringify(example.input, null, 2);
const _stringifiedOutput = JSON.stringify(example.output, null, 2);
const beautifiedInput = base64DataToFileDataProvider(_stringifiedInput, fileDataProvider);
const isUsingFileDataProvider = beautifiedInput !== _stringifiedInput;
const beautifiedOutput = base64DataToFileDataProvider(_stringifiedOutput, fileDataProvider);
const isUsingFileDataProvider = beautifiedInput !== _stringifiedInput ||
beautifiedOutput !== _stringifiedOutput;
const fileProviderImport = {

@@ -94,3 +98,3 @@ 'fs-promise': 'import { readFile } from "fs/promises"',

${cleanZodDescribe((0, beautify_1.beautifyTypescript)(`const { run: ${taskFunctionName} } = await workflowAI.useTask({
${cleanZodDescribe((0, beautify_1.beautifyTypescript)(`const { run: ${taskFunctionName}, importRun: ${importRunFunctionName} } = await workflowAI.useTask({
taskId: "${taskId}",

@@ -146,4 +150,28 @@ schema: {

},
importTaskRun: {
language: 'typescript',
code: `
${[
'import { TaskInput, TaskOutput } from "@workflowai/workflowai"',
isUsingFileDataProvider && fileProviderImport,
]
.filter(Boolean)
.join('\n')}
const input: TaskInput<typeof ${importRunFunctionName}> = ${beautifiedInput}
const output: TaskOutput<typeof ${importRunFunctionName}> = ${beautifiedOutput}
await ${importRunFunctionName}(input, output, {
group: {
properties: {
provider: "openai",
model: "gpt-4o-2024-05-13",
temperature: 0,
}
}
})
`.trim(),
},
};
};
exports.getPlaygroundSnippets = getPlaygroundSnippets;

@@ -52,5 +52,9 @@ import { inputSchemaToZod, outputSchemaToZod, } from '@workflowai/schema';

const taskFunctionName = validVarName(taskName || taskId);
const importRunFunctionName = validVarName(`import ${taskFunctionName} run`);
const _stringifiedInput = JSON.stringify(example.input, null, 2);
const _stringifiedOutput = JSON.stringify(example.output, null, 2);
const beautifiedInput = base64DataToFileDataProvider(_stringifiedInput, fileDataProvider);
const isUsingFileDataProvider = beautifiedInput !== _stringifiedInput;
const beautifiedOutput = base64DataToFileDataProvider(_stringifiedOutput, fileDataProvider);
const isUsingFileDataProvider = beautifiedInput !== _stringifiedInput ||
beautifiedOutput !== _stringifiedOutput;
const fileProviderImport = {

@@ -91,3 +95,3 @@ 'fs-promise': 'import { readFile } from "fs/promises"',

${cleanZodDescribe(beautifyTypescript(`const { run: ${taskFunctionName} } = await workflowAI.useTask({
${cleanZodDescribe(beautifyTypescript(`const { run: ${taskFunctionName}, importRun: ${importRunFunctionName} } = await workflowAI.useTask({
taskId: "${taskId}",

@@ -143,3 +147,27 @@ schema: {

},
importTaskRun: {
language: 'typescript',
code: `
${[
'import { TaskInput, TaskOutput } from "@workflowai/workflowai"',
isUsingFileDataProvider && fileProviderImport,
]
.filter(Boolean)
.join('\n')}
const input: TaskInput<typeof ${importRunFunctionName}> = ${beautifiedInput}
const output: TaskOutput<typeof ${importRunFunctionName}> = ${beautifiedOutput}
await ${importRunFunctionName}(input, output, {
group: {
properties: {
provider: "openai",
model: "gpt-4o-2024-05-13",
temperature: 0,
}
}
})
`.trim(),
},
};
};

@@ -38,2 +38,3 @@ import { JsonSchemaObject } from '@workflowai/schema';

streamRunTask: GeneratedCode;
importTaskRun: GeneratedCode;
};

@@ -40,0 +41,0 @@ export declare const getPlaygroundSnippets: (config: GetPlaygroundSnippetsConfig) => Promise<GetPlaygroundSnippetsResult>;

2

package.json
{
"name": "@workflowai/code-generator",
"version": "1.1.4",
"version": "1.1.5",
"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