Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions integration-tests/cli/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,12 @@
# @openfn/integration-tests-cli

## 1.0.21

### Patch Changes

- @openfn/lightning-mock@2.4.16
- @openfn/project@0.15.1

## 1.0.20

### Patch Changes
Expand Down
2 changes: 1 addition & 1 deletion integration-tests/cli/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "@openfn/integration-tests-cli",
"private": true,
"version": "1.0.20",
"version": "1.0.21",
"description": "CLI integration tests",
"author": "Open Function Group <admin@openfn.org>",
"license": "ISC",
Expand Down
13 changes: 13 additions & 0 deletions packages/cli/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,18 @@
# @openfn/cli

## 1.35.2

### Patch Changes

Update type interfaces to match new portability spec.

- Updated dependencies [728e6cb]
- Updated dependencies [380bccd]
- @openfn/lexicon@2.0.0
- @openfn/runtime@1.9.3
- @openfn/compiler@1.2.5
- @openfn/project@0.15.1

## 1.35.1

### Patch Changes
Expand Down
2 changes: 1 addition & 1 deletion packages/cli/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@openfn/cli",
"version": "1.35.1",
"version": "1.35.2",
"description": "CLI devtools for the OpenFn toolchain",
"engines": {
"node": ">=18",
Expand Down
8 changes: 2 additions & 6 deletions packages/cli/src/compile/compile.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,8 @@ import compile, {
Options,
getExports,
} from '@openfn/compiler';
import { getModulePath } from '@openfn/runtime';
import type {
ExecutionPlan,
Job,
SourceMapWithOperations,
} from '@openfn/lexicon';
import { getModulePath, type ExecutionPlan, type Job } from '@openfn/runtime';
import type { SourceMapWithOperations } from '@openfn/lexicon';

import createLogger, { COMPILER, Logger } from '../util/logger';
import abort from '../util/abort';
Expand Down
2 changes: 1 addition & 1 deletion packages/cli/src/execute/apply-credential-map.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
* and apply credentials to each step
*/

import { ExecutionPlan } from '@openfn/lexicon';
import { ExecutionPlan } from '@openfn/runtime';
import { Logger } from '../util';

type JobId = string;
Expand Down
3 changes: 2 additions & 1 deletion packages/cli/src/execute/execute.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import run, { NOTIFY_JOB_COMPLETE, getNameAndVersion } from '@openfn/runtime';
import type { ExecutionPlan, Job } from '@openfn/lexicon';
import type {
ExecutionPlan,
Job,
ModuleInfo,
ModuleInfoMap,
NotifyJobCompletePayload,
Expand Down
2 changes: 1 addition & 1 deletion packages/cli/src/execute/get-autoinstall-targets.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { ExecutionPlan, Job } from '@openfn/lexicon';
import { ExecutionPlan, Job } from '@openfn/runtime';

const getAutoinstallTargets = (plan: ExecutionPlan) => {
const adaptors = {} as Record<string, true>;
Expand Down
2 changes: 1 addition & 1 deletion packages/cli/src/execute/handler.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import type { ExecutionPlan } from '@openfn/lexicon';
import type { ExecutionPlan } from '@openfn/runtime';
import path from 'node:path';

import type { ExecuteOptions } from './command';
Expand Down
7 changes: 5 additions & 2 deletions packages/cli/src/metadata/handler.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,11 @@ import { Logger } from '../util/logger';
import { MetadataOpts } from './command';
import loadState from '../util/load-state';
import * as cache from './cache';
import { getModuleEntryPoint, registerEsmHook } from '@openfn/runtime';
import { ExecutionPlan } from '@openfn/lexicon';
import {
getModuleEntryPoint,
registerEsmHook,
type ExecutionPlan,
} from '@openfn/runtime';
import { install, removePackage } from '../repo/handler';

// Add created date stamp to the metadata object
Expand Down
2 changes: 1 addition & 1 deletion packages/cli/src/test/handler.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import type { ExecutionPlan } from '@openfn/lexicon';
import type { ExecutionPlan } from '@openfn/runtime';

import { TestOptions } from './command';
import { createNullLogger, Logger } from '../util/logger';
Expand Down
33 changes: 12 additions & 21 deletions packages/cli/src/types.ts
Original file line number Diff line number Diff line change
@@ -1,43 +1,34 @@
// the executionPLan for the CLI is a bit differnt to the runtime's perspective
import { WorkflowOptions } from '@openfn/lexicon';
import type { ExecutionPlan, Job, Trigger } from '@openfn/runtime';

import { Trigger, UUID, WorkflowOptions } from '@openfn/lexicon';

// Ie config can be a string
export type JobNodeID = string;

export type OldCLIWorkflow = {
id?: string; // UUID for this plan
id?: string;
start?: JobNodeID;
jobs: CLIJobNode[];
};

export type CLIExecutionPlan = {
id?: UUID;
// Input-format wrapper around the runtime ExecutionPlan.
// Accepts singular `adaptor` on jobs (normalized to `adaptors[]` by ensureAdaptors
// before handing to the runtime) and adds the CLI-only collectionsEndpoint option.
export type CLIExecutionPlan = Omit<ExecutionPlan, 'workflow' | 'options'> & {
options?: WorkflowOptions & {
collectionsEndpoint?: string;
};
workflow: {
id?: string;
name?: string;
workflow: Omit<ExecutionPlan['workflow'], 'steps'> & {
steps: Array<CLIJobNode | Trigger>;
globals?: string;
};
};

export type CLIJobNode = {
id?: string;
expression?: string; // path or expression
configuration?: string | object; // path or credential object
// Loose input variant of Job: `adaptor` (singular) is normalized to `adaptors[]`
// by the CLI before the plan reaches the runtime.
export type CLIJobNode = Job & {
data?: any;
next?: string | Record<JobNodeID, true | CLIJobEdge>;

// We can accept a single adaptor or multiple
// The CLI will convert it to adaptors as an array
adaptor?: string;
adaptors?: string[];
};

export type CLIJobEdge = {
condition?: string; // Javascript expression (function body, not function)
condition?: string;
label?: string;
};
2 changes: 1 addition & 1 deletion packages/cli/src/util/cache.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import fs from 'node:fs';
import path from 'node:path';
import { rmdir } from 'node:fs/promises';

import type { ExecutionPlan } from '@openfn/lexicon';
import type { ExecutionPlan } from '@openfn/runtime';
import type { Opts } from '../options';
import type { Logger } from './logger';

Expand Down
2 changes: 1 addition & 1 deletion packages/cli/src/util/expand-adaptors.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { ExecutionPlan, Job } from '@openfn/lexicon';
import { ExecutionPlan, Job } from '@openfn/runtime';

const expand = (name: string) => {
if (typeof name === 'string') {
Expand Down
2 changes: 1 addition & 1 deletion packages/cli/src/util/fuzzy-match-step.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { ExecutionPlan } from '@openfn/lexicon';
import { ExecutionPlan } from '@openfn/runtime';

export default (plan: ExecutionPlan, stepPattern?: string) => {
if (stepPattern) {
Expand Down
3 changes: 2 additions & 1 deletion packages/cli/src/util/load-plan.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,8 @@ import { Workspace, yamlToJson } from '@openfn/project';
import abort from './abort';
import expandAdaptors from './expand-adaptors';
import mapAdaptorsToMonorepo from './map-adaptors-to-monorepo';
import type { ExecutionPlan, Job, WorkflowOptions } from '@openfn/lexicon';
import type { WorkflowOptions } from '@openfn/lexicon';
import type { ExecutionPlan, Job } from '@openfn/runtime';
import type { Opts } from '../options';
import type { Logger } from './logger';
import type { CLIExecutionPlan, CLIJobNode, OldCLIWorkflow } from '../types';
Expand Down
2 changes: 1 addition & 1 deletion packages/cli/src/util/load-state.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import fs from 'node:fs/promises';

import { getCachePath } from './cache';

import type { ExecutionPlan } from '@openfn/lexicon';
import type { ExecutionPlan } from '@openfn/runtime';
import type { Logger } from '@openfn/logger';
import type { Opts } from '../options';

Expand Down
7 changes: 5 additions & 2 deletions packages/cli/src/util/map-adaptors-to-monorepo.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,11 @@ import { readFile } from 'node:fs/promises';
import path from 'node:path';
import assert from 'node:assert';
import { Logger } from '@openfn/logger';
import { getNameAndVersion } from '@openfn/runtime';
import type { ExecutionPlan, Job } from '@openfn/lexicon';
import {
getNameAndVersion,
type ExecutionPlan,
type Job,
} from '@openfn/runtime';

import type { Opts } from '../options';

Expand Down
2 changes: 1 addition & 1 deletion packages/cli/src/util/override-plan-adaptors.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { ExecutionPlan, Job, Step } from '@openfn/lexicon';
import { ExecutionPlan, Job, Step } from '@openfn/runtime';

function overridePlanAdaptors(
plan: ExecutionPlan,
Expand Down
3 changes: 2 additions & 1 deletion packages/cli/src/util/validate-plan.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import { ExecutionPlan, Job, Trigger, WorkflowOptions } from '@openfn/lexicon';
import { WorkflowOptions } from '@openfn/lexicon';
import { ExecutionPlan, Job, Trigger } from '@openfn/runtime';
import { Logger } from '@openfn/logger';

const assertWorkflowStructure = (plan: ExecutionPlan, logger: Logger) => {
Expand Down
2 changes: 1 addition & 1 deletion packages/cli/test/compile/compile.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import compile, {
import { CompileOptions } from '../../src/compile/command';
import { mockFs, resetMockFs } from '../util';

import type { ExecutionPlan, Job } from '@openfn/lexicon';
import type { ExecutionPlan, Job } from '@openfn/runtime';

const mockLog = createMockLogger();

Expand Down
2 changes: 1 addition & 1 deletion packages/cli/test/execute/get-autoinstall-targets.test.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import test from 'ava';

import getAutoinstallTargets from '../../src/execute/get-autoinstall-targets';
import { ExecutionPlan, Job } from '@openfn/lexicon';
import { ExecutionPlan, Job } from '@openfn/runtime';

const getPlan = (steps: Job[]) =>
({
Expand Down
2 changes: 1 addition & 1 deletion packages/cli/test/execute/parse-adaptors.test.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import test from 'ava';
import { ExecutionPlan, Job } from '@openfn/lexicon';
import { ExecutionPlan, Job } from '@openfn/runtime';

import { parseAdaptors } from '../../src/execute/execute';

Expand Down
2 changes: 1 addition & 1 deletion packages/cli/test/util.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
import mock from 'mock-fs';
import path from 'node:path';

import type { ExecutionPlan, Job, StepEdge } from '@openfn/lexicon';
import type { ExecutionPlan, Job, StepEdge } from '@openfn/runtime';

export const mockFs = (files: Record<string, string>) => {
// We have to explicitly expose some modules paths so that dependencies can run in the tests
Expand Down
2 changes: 1 addition & 1 deletion packages/cli/test/util/load-plan.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import test from 'ava';
import mock from 'mock-fs';
import { createMockLogger } from '@openfn/logger';
import { omit } from 'lodash-es';
import type { Job } from '@openfn/lexicon';
import type { Job } from '@openfn/runtime';

import loadPlan from '../../src/util/load-plan';
import { Opts } from '../../src/options';
Expand Down
2 changes: 1 addition & 1 deletion packages/cli/test/util/map-adaptors-to-monorepo.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import mapAdaptorsToMonorepo, {
validateMonoRepo,
updatePath,
} from '../../src/util/map-adaptors-to-monorepo';
import { ExecutionPlan } from '@openfn/lexicon';
import { ExecutionPlan } from '@openfn/runtime';

const REPO_PATH = 'a/b/c';
const ABS_REPO_PATH = path.resolve(REPO_PATH);
Expand Down
2 changes: 1 addition & 1 deletion packages/cli/test/util/override-plan-adaptor.test.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { ExecutionPlan } from '@openfn/lexicon';
import { ExecutionPlan } from '@openfn/runtime';
import test from 'ava';
import overridePlanAdaptors, {
isJob,
Expand Down
2 changes: 1 addition & 1 deletion packages/cli/test/util/validate-plan.test.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import test from 'ava';
import { createMockLogger } from '@openfn/logger';
import type { ExecutionPlan } from '@openfn/lexicon';
import type { ExecutionPlan } from '@openfn/runtime';
import validate from '../../src/util/validate-plan';

const logger = createMockLogger('', { level: 'debug' });
Expand Down
9 changes: 9 additions & 0 deletions packages/compiler/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,14 @@
# @openfn/compiler

## 1.2.5

### Patch Changes

Update type interfaces to match new portability spec.

- Updated dependencies [728e6cb]
- @openfn/lexicon@2.0.0

## 1.2.4

### Patch Changes
Expand Down
2 changes: 1 addition & 1 deletion packages/compiler/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@openfn/compiler",
"version": "1.2.4",
"version": "1.2.5",
"description": "Compiler and language tooling for openfn jobs.",
"author": "Open Function Group <admin@openfn.org>",
"license": "ISC",
Expand Down
12 changes: 12 additions & 0 deletions packages/engine-multi/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,17 @@
# engine-multi

## 1.11.4

### Patch Changes

Update type interfaces to match new portability spec.

- Updated dependencies [728e6cb]
- Updated dependencies [380bccd]
- @openfn/lexicon@2.0.0
- @openfn/runtime@1.9.3
- @openfn/compiler@1.2.5

## 1.11.3

### Patch Changes
Expand Down
2 changes: 1 addition & 1 deletion packages/engine-multi/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@openfn/engine-multi",
"version": "1.11.3",
"version": "1.11.4",
"description": "Multi-process runtime engine",
"main": "dist/index.js",
"type": "module",
Expand Down
5 changes: 3 additions & 2 deletions packages/engine-multi/src/api/autoinstall.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,10 @@ import {
getNameAndVersion,
getLatestVersion,
loadRepoPkg,
install as runtimeInstall,
type ExecutionPlan,
type Job,
} from '@openfn/runtime';
import { install as runtimeInstall } from '@openfn/runtime';
import type { ExecutionPlan, Job } from '@openfn/lexicon';
import type { Logger } from '@openfn/logger';

import { AUTOINSTALL_COMPLETE, AUTOINSTALL_ERROR } from '../events';
Expand Down
2 changes: 1 addition & 1 deletion packages/engine-multi/src/api/preload-credentials.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { ExecutionPlan, Job } from '@openfn/lexicon';
import { ExecutionPlan, Job } from '@openfn/runtime';
import type { Logger } from '@openfn/logger';
import { CredentialErrorObj, CredentialLoadError } from '../errors';

Expand Down
3 changes: 2 additions & 1 deletion packages/engine-multi/src/engine.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
import { EventEmitter } from 'node:events';
import path from 'node:path';
import { fileURLToPath } from 'node:url';
import type { ExecutionPlan, State, UUID } from '@openfn/lexicon';
import type { State, UUID } from '@openfn/lexicon';
import type { ExecutionPlan } from '@openfn/runtime';
import type { Logger } from '@openfn/logger';

import {
Expand Down
2 changes: 1 addition & 1 deletion packages/engine-multi/src/test/util.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { ExecutionPlan } from '@openfn/lexicon';
import { ExecutionPlan } from '@openfn/runtime';

export const createPlan = (job = {}) =>
({
Expand Down
2 changes: 1 addition & 1 deletion packages/engine-multi/src/test/worker-functions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import path from 'node:path';

import { register, publish, threadId } from '../worker/thread/runtime';
import { increment } from './counter.js';
import { ExecutionPlan, Job } from '@openfn/lexicon';
import { ExecutionPlan, Job } from '@openfn/runtime';

const tasks = {
test: async (result = 42) => {
Expand Down
Loading