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

@ez4/stateful

Package Overview
Dependencies
Maintainers
1
Versions
10
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@ez4/stateful - npm Package Compare versions

Comparing version 0.6.0 to 0.7.0

4

dist/state/apply.d.ts
import type { EntryState, EntryStates } from '../types/entry.js';
import type { StepHandlers, StepState } from '../types/step.js';
export type ApplyState<E extends EntryState = EntryState> = {
export type ApplyResult<E extends EntryState = EntryState> = {
result: EntryStates<E>;
errors: Error[];
};
export declare const applySteps: <E extends EntryState>(stepList: StepState[], newEntries: EntryStates<E> | undefined, oldEntries: EntryStates<E> | undefined, handlers: StepHandlers<E>) => Promise<ApplyState<E>>;
export declare const applySteps: <E extends EntryState>(stepList: StepState[], newEntries: EntryStates<E> | undefined, oldEntries: EntryStates<E> | undefined, handlers: StepHandlers<E>) => Promise<ApplyResult<E>>;

@@ -1,6 +0,6 @@

import type { EntryState, EntryStates, TypedEntryState } from '../types/entry.js';
import type { EntryState, EntryStates } from '../types/entry.js';
export declare const getEntry: <E extends EntryState>(entryMap: EntryStates<E>, entryId: string) => E;
export declare const attachEntry: <E1 extends EntryState, E2 extends E1>(entryMap: EntryStates<E1>, entry: E2) => E2;
export declare const attachEntry: <E extends EntryState, T extends E>(entryMap: EntryStates<E>, entry: T) => T;
export declare const validateEntries: <E extends EntryState>(entryMap: EntryStates<E>) => void;
export declare const linkDependency: <E extends EntryState>(entryMap: EntryStates<E>, entryId: string, dependencyId: string) => void;
export declare const getDependencies: <E extends EntryState, T extends string>(entryMap: EntryStates<E>, entry: E, type?: T) => TypedEntryState<E, T>[];
export declare const getDependencies: <E extends EntryState>(entryMap: EntryStates, entry: EntryState, type?: E["type"]) => E[];

@@ -8,12 +8,6 @@ /**

dependencies: string[];
parameters: Record<string, any>;
result?: Record<string, any>;
parameters: unknown;
result?: unknown;
};
/**
* Regular entry state with type overwritten.
*/
export type TypedEntryState<E extends EntryState, T extends string> = E & {
type: T;
};
/**
* Map of regular entry states.

@@ -20,0 +14,0 @@ */

import type { ObjectComparison } from '@ez4/utils';
import type { StepAction } from '../state/step.js';
import type { EntryState, TypedEntryState } from './entry.js';
import type { EntryState } from './entry.js';
/**

@@ -16,3 +16,3 @@ * A step state that contains an action to perform.

*/
export type StepContext<E extends EntryState = EntryState> = {
export type StepContext = {
/**

@@ -25,3 +25,3 @@ * Get all dependencies from the current step entry, if a `type` is given

*/
getDependencies: <T extends string>(type?: T) => TypedEntryState<E, T>[];
getDependencies: <E extends EntryState>(type?: E['type']) => E[];
};

@@ -45,3 +45,3 @@ /**

*/
create: (candidate: Readonly<E>, context: StepContext<E>) => Record<string, any> | undefined | Promise<Record<string, any> | unknown>;
create: (candidate: Readonly<E>, context: StepContext) => Record<string, any> | undefined | Promise<Record<string, any> | undefined>;
/**

@@ -54,3 +54,3 @@ * Handle entry replacement.

*/
replace: (candidate: Readonly<E>, current: Readonly<E>, context: StepContext<E>) => Record<string, any> | undefined | Promise<Record<string, any> | undefined>;
replace: (candidate: Readonly<E>, current: Readonly<E>, context: StepContext) => Record<string, any> | undefined | Promise<Record<string, any> | undefined>;
/**

@@ -70,3 +70,3 @@ * Handle entry preview.

*/
update: (candidate: Readonly<E>, current: Readonly<E>, context: StepContext<E>) => Record<string, any> | undefined | Promise<Record<string, any> | undefined>;
update: (candidate: Readonly<E>, current: Readonly<E>, context: StepContext) => Record<string, any> | undefined | Promise<Record<string, any> | undefined>;
/**

@@ -78,3 +78,3 @@ * Handle entry deletion.

*/
delete: (candidate: Readonly<E>, context: StepContext<E>) => void | Promise<void>;
delete: (candidate: Readonly<E>, context: StepContext) => void | Promise<void>;
};

@@ -81,0 +81,0 @@ /**

{
"name": "@ez4/stateful",
"description": "EZ4: State management with dependencies for providers",
"version": "0.6.0",
"version": "0.7.0",
"author": "Silas B.",

@@ -38,4 +38,4 @@ "license": "MIT",

"dependencies": {
"@ez4/utils": "^0.6.0"
"@ez4/utils": "^0.7.0"
}
}

Sorry, the diff of this file is not supported yet

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