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

@interval/sdk

Package Overview
Dependencies
Maintainers
3
Versions
54
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@interval/sdk - npm Package Compare versions

Comparing version 1.1.1 to 1.2.0

dist/components/displayMetadata.d.ts

7

dist/classes/IOClient.d.ts
/// <reference types="node" />
import { z } from 'zod';
import { Evt } from 'evt';
import { T_IO_RESPONSE, T_IO_PROPS, T_IO_RETURNS, T_IO_METHOD_NAMES, T_IO_DISPLAY_METHOD_NAMES, T_IO_INPUT_METHOD_NAMES, T_IO_MULTIPLEABLE_METHOD_NAMES } from '../ioSchema';

@@ -80,3 +81,3 @@ import Logger from './Logger';

group<IOPromises extends [MaybeOptionalGroupIOPromise, ...MaybeOptionalGroupIOPromise[]] | Record<string, MaybeOptionalGroupIOPromise> | MaybeOptionalGroupIOPromise[]>(promises: IOPromises, props?: GroupConfig): IOGroupPromise<IOPromises, IOPromises extends Record<string, MaybeOptionalGroupIOPromise> ? IOPromises extends infer T ? { [K in keyof T]: ReturnType<IOPromises[K]["getValue"]>; } : never : IOPromises extends [MaybeOptionalGroupIOPromise, ...MaybeOptionalGroupIOPromise[]] ? import("./IOPromise").IOGroupReturnValues<IOPromises> : unknown[]>;
getPromiseProps<MethodName extends T_IO_METHOD_NAMES, Props extends object = T_IO_PROPS<MethodName>, Output = T_IO_RETURNS<MethodName>, DefaultValue = Output>(methodName: MethodName, inputProps?: Props, componentDef?: IOComponentDefinition<MethodName, Props, Output, DefaultValue>): {
getPromiseProps<MethodName extends T_IO_METHOD_NAMES, Props extends object = T_IO_PROPS<MethodName>, Output = T_IO_RETURNS<MethodName>, DefaultValue = Output>(methodName: MethodName, inputProps?: Props, componentDef?: IOComponentDefinition<MethodName, Props, Output, DefaultValue>, onPropsUpdate?: Evt<T_IO_PROPS<MethodName>>): {
methodName: MethodName;

@@ -861,3 +862,3 @@ props: T_IO_PROPS<MethodName>;

*/
metadata: RequiredPropsDisplayIOComponentFunction<"DISPLAY_METADATA", {
metadata: RequiredPropsDisplayIOComponentFunction<"DISPLAY_METADATA", Pick<{
layout?: "grid" | "list" | "card" | undefined;

@@ -880,2 +881,4 @@ data: {

}[];
}, "layout"> & {
data: import("../components/displayMetadata").EventualMetaItem[];
}, null>;

@@ -882,0 +885,0 @@ /**

@@ -8,2 +8,3 @@ "use strict";

const uuid_1 = require("uuid");
const evt_1 = require("evt");
const superjson_1 = __importDefault(require("../utils/superjson"));

@@ -23,2 +24,3 @@ const ioSchema_1 = require("../ioSchema");

const displayVideo_1 = __importDefault(require("../components/displayVideo"));
const displayMetadata_1 = __importDefault(require("../components/displayMetadata"));
const url_1 = __importDefault(require("../components/url"));

@@ -269,3 +271,3 @@ const inputDate_1 = require("../components/inputDate");

}
getPromiseProps(methodName, inputProps, componentDef) {
getPromiseProps(methodName, inputProps, componentDef, onPropsUpdate) {
let props = inputProps

@@ -278,3 +280,3 @@ ? inputProps

if (componentDef) {
const componentGetters = componentDef.bind(this)(inputProps !== null && inputProps !== void 0 ? inputProps : {});
const componentGetters = componentDef.bind(this)(inputProps !== null && inputProps !== void 0 ? inputProps : {}, onPropsUpdate);
if (componentGetters.props) {

@@ -303,5 +305,6 @@ props = componentGetters.props;

return (label, props) => {
const onPropsUpdate = new evt_1.Evt();
if ((0, ioSchema_1.supportsMultiple)(methodName)) {
return new IOPromise_1.MultipleableIOPromise({
...this.getPromiseProps(methodName, props, componentDef),
...this.getPromiseProps(methodName, props, componentDef, onPropsUpdate),
methodName: methodName,

@@ -311,2 +314,3 @@ renderer: this.renderComponents.bind(this),

displayResolvesImmediately: this.displayResolvesImmediately,
onPropsUpdate: onPropsUpdate,
});

@@ -316,3 +320,3 @@ }

? new IOPromise_1.DisplayIOPromise({
...this.getPromiseProps(methodName, props, componentDef),
...this.getPromiseProps(methodName, props, componentDef, onPropsUpdate),
methodName: methodName,

@@ -322,5 +326,6 @@ renderer: this.renderComponents.bind(this),

displayResolvesImmediately: this.displayResolvesImmediately,
onPropsUpdate: onPropsUpdate,
})
: new IOPromise_1.InputIOPromise({
...this.getPromiseProps(methodName, props, componentDef),
...this.getPromiseProps(methodName, props, componentDef, onPropsUpdate),
methodName: methodName,

@@ -330,2 +335,3 @@ renderer: this.renderComponents.bind(this),

displayResolvesImmediately: this.displayResolvesImmediately,
onPropsUpdate: onPropsUpdate,
});

@@ -722,2 +728,3 @@ };

metadata: this.createIOMethod('DISPLAY_METADATA', {
componentDef: (0, displayMetadata_1.default)(this.logger),
propsRequired: true,

@@ -724,0 +731,0 @@ }),

import { z } from 'zod';
import { Evt } from 'evt';
import { ioSchema, T_IO_DISPLAY_METHOD_NAMES, T_IO_METHOD_NAMES, T_IO_PROPS, T_IO_RETURNS, T_IO_STATE } from '../ioSchema';

@@ -41,2 +42,3 @@ import { IOPromiseValidator } from './IOPromise';

handleStateChange: ((incomingState: z.infer<IoSchema[MethodName]['state']>) => Promise<Partial<z.input<IoSchema[MethodName]['props']>>>) | undefined;
onPropsUpdate: (() => T_IO_PROPS<MethodName>) | undefined;
validator: IOPromiseValidator<MaybeMultipleComponentReturnValue<MethodName> | undefined> | undefined;

@@ -55,3 +57,3 @@ resolvesImmediately: boolean;

*/
constructor({ methodName, label, initialProps, onStateChange, isOptional, isMultiple, validator, multipleProps, displayResolvesImmediately, }: {
constructor({ methodName, label, initialProps, onStateChange, isOptional, isMultiple, validator, multipleProps, displayResolvesImmediately, onPropsUpdate, }: {
methodName: MethodName;

@@ -68,2 +70,3 @@ label: string;

displayResolvesImmediately?: boolean;
onPropsUpdate?: Evt<T_IO_PROPS<MethodName>>;
});

@@ -70,0 +73,0 @@ handleValidation(returnValue: MaybeMultipleComponentReturnValue<MethodName> | undefined): Promise<string | undefined>;

@@ -27,3 +27,3 @@ "use strict";

*/
constructor({ methodName, label, initialProps, onStateChange, isOptional = false, isMultiple = false, validator, multipleProps, displayResolvesImmediately, }) {
constructor({ methodName, label, initialProps, onStateChange, isOptional = false, isMultiple = false, validator, multipleProps, displayResolvesImmediately, onPropsUpdate, }) {
this.resolvesImmediately = false;

@@ -33,2 +33,5 @@ this.handleStateChange = onStateChange;

this.validator = validator;
if (onPropsUpdate) {
onPropsUpdate.attach(this.setProps.bind(this));
}
try {

@@ -35,0 +38,0 @@ initialProps = this.schema.props.parse(initialProps !== null && initialProps !== void 0 ? initialProps : {});

@@ -0,1 +1,2 @@

import type { Evt } from 'evt';
import { T_IO_DISPLAY_METHOD_NAMES, T_IO_INPUT_METHOD_NAMES, T_IO_METHOD_NAMES, T_IO_MULTIPLEABLE_METHOD_NAMES, T_IO_PROPS, T_IO_RETURNS, T_IO_STATE } from '../ioSchema';

@@ -11,2 +12,3 @@ import IOComponent, { AnyIOComponent, ComponentReturnValue, MaybeMultipleComponentReturnValue } from './IOComponent';

props: Props;
onPropsUpdate?: Evt<T_IO_PROPS<MethodName>>;
valueGetter?: (response: ComponentReturnValue<MethodName>) => ComponentOutput;

@@ -34,3 +36,4 @@ onStateChange?: (incomingState: T_IO_STATE<MethodName>) => Promise<Partial<Props>>;

protected displayResolvesImmediately: boolean | undefined;
constructor({ renderer, methodName, label, props, valueGetter, onStateChange, validator, displayResolvesImmediately, }: IOPromiseProps<MethodName, Props, ComponentOutput>);
protected onPropsUpdate: Evt<T_IO_PROPS<MethodName>> | undefined;
constructor({ renderer, methodName, label, props, valueGetter, onStateChange, validator, displayResolvesImmediately, onPropsUpdate, }: IOPromiseProps<MethodName, Props, ComponentOutput>);
then(resolve: (output: ComponentOutput) => void, reject?: (err: IOError) => void): void;

@@ -80,2 +83,3 @@ getValue(result: ComponentReturnValue<MethodName>): ComponentOutput;

displayResolvesImmediately?: boolean;
onPropsUpdate?: Evt<T_IO_PROPS<MethodName>>;
});

@@ -99,2 +103,3 @@ multiple({ defaultValue, }?: {

validator?: IOPromiseValidator<ComponentOutput[]> | undefined;
onPropsUpdate?: Evt<T_IO_PROPS<MethodName>>;
});

@@ -122,2 +127,3 @@ then(resolve: (output: ComponentOutput[]) => void, reject?: (err: IOError) => void): void;

validator?: IOPromiseValidator<ComponentOutput[] | undefined> | undefined;
onPropsUpdate?: Evt<T_IO_PROPS<MethodName>>;
});

@@ -124,0 +130,0 @@ then(resolve: (output: ComponentOutput[] | undefined) => void, reject?: (err: IOError) => void): void;

@@ -33,3 +33,3 @@ "use strict";

class IOPromise {
constructor({ renderer, methodName, label, props, valueGetter, onStateChange, validator, displayResolvesImmediately, }) {
constructor({ renderer, methodName, label, props, valueGetter, onStateChange, validator, displayResolvesImmediately, onPropsUpdate, }) {
this.renderer = renderer;

@@ -43,2 +43,3 @@ this.methodName = methodName;

this.displayResolvesImmediately = displayResolvesImmediately;
this.onPropsUpdate = onPropsUpdate;
}

@@ -77,2 +78,3 @@ then(resolve, reject) {

displayResolvesImmediately: this.displayResolvesImmediately,
onPropsUpdate: this.onPropsUpdate,
});

@@ -104,2 +106,3 @@ }

displayResolvesImmediately: this.displayResolvesImmediately,
onPropsUpdate: this.onPropsUpdate,
});

@@ -183,2 +186,3 @@ }

displayResolvesImmediately: this.displayResolvesImmediately,
onPropsUpdate: this.onPropsUpdate,
});

@@ -314,2 +318,3 @@ }

displayResolvesImmediately: this.displayResolvesImmediately,
onPropsUpdate: this.onPropsUpdate,
});

@@ -393,2 +398,3 @@ }

displayResolvesImmediately: this.displayResolvesImmediately,
onPropsUpdate: this.onPropsUpdate,
});

@@ -517,2 +523,3 @@ }

displayResolvesImmediately: this.displayResolvesImmediately,
onPropsUpdate: this.onPropsUpdate,
});

@@ -519,0 +526,0 @@ }

import { z } from 'zod';
import { Literal, metaItemSchema } from '../ioSchema';
import { AnyDisplayIOPromise, ButtonItem, PageError } from '../types';
declare type EventualString = string | Promise<string> | (() => string) | (() => Promise<string>);
import { AnyDisplayIOPromise, ButtonItem, PageError, EventualValue } from '../types';
declare type EventualString = EventualValue<string>;
export interface BasicLayoutConfig {

@@ -6,0 +6,0 @@ title?: EventualString;

@@ -59,3 +59,3 @@ "use strict";

builtColumns = initialColumns;
totalRecords = initialData.length;
totalRecords = sorted.length;
}

@@ -62,0 +62,0 @@ return {

@@ -113,3 +113,3 @@ "use strict";

get environment() { return getSomeStore().ctx.environment; },
get loading() { return getActionStore().ctx.loading; },
get loading() { return getSomeStore().ctx.loading; },
get log() { return getActionStore().ctx.log; },

@@ -116,0 +116,0 @@ get organization() { return getSomeStore().ctx.organization; },

/// <reference types="node" />
import type { z } from 'zod';
import type { Evt } from 'evt';
import type { T_IO_RENDER_INPUT, T_IO_RESPONSE, T_IO_PROPS, T_IO_RETURNS, T_IO_STATE, T_IO_Schema, T_IO_METHOD_NAMES, IOFunctionReturnType, T_IO_DISPLAY_METHOD_NAMES, T_IO_INPUT_METHOD_NAMES, menuItem, buttonItem, ButtonTheme, serializableRecord, ImageSize, SerializableRecord, LegacyLinkProps, T_IO_MULTIPLEABLE_METHOD_NAMES, HighlightColor } from './ioSchema';

@@ -123,3 +124,3 @@ import type { AccessControlDefinition, ActionEnvironment } from './internalRpcSchema';

};
export declare type PageCtx = Pick<ActionCtx, 'user' | 'params' | 'environment' | 'organization' | 'redirect'> & {
export declare type PageCtx = Pick<ActionCtx, 'user' | 'params' | 'environment' | 'organization' | 'redirect' | 'loading'> & {
/**

@@ -237,3 +238,3 @@ * Information about the currently open page.

export declare type MaybeOptionalGroupIOPromise = GroupIOPromise | OptionalGroupIOPromise;
export declare type IOComponentDefinition<MethodName extends T_IO_METHOD_NAMES, Props, Output, DefaultValue = Output> = (this: IOClient, props: Props) => {
export declare type IOComponentDefinition<MethodName extends T_IO_METHOD_NAMES, Props, Output, DefaultValue = Output> = (this: IOClient, props: Props, onPropsUpdate?: Evt<T_IO_PROPS<MethodName>>) => {
props?: T_IO_PROPS<MethodName>;

@@ -343,1 +344,2 @@ getValue?: (response: T_IO_RETURNS<MethodName>) => Output;

export declare type IntervalErrorHandler = (props: IntervalErrorProps) => void;
export declare type EventualValue<T> = T | Promise<T> | (() => T) | (() => Promise<T>);
{
"name": "@interval/sdk",
"version": "1.1.1",
"version": "1.2.0",
"description": "The frontendless framework for high growth companies. Interval automatically generates apps by inlining the UI in your backend code. It's a faster and more maintainable way to build internal tools, rapid prototypes, and more.",

@@ -5,0 +5,0 @@ "homepage": "https://interval.com",

Sorry, the diff of this file is too big to display

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