@grouparoo/core
Version:
The Grouparoo Core
754 lines (753 loc) • 25.4 kB
TypeScript
import { AuthenticatedAction } from "../classes/actions/authenticatedAction";
import { Property } from "../models/Property";
import { FilterHelper } from "../modules/filterHelper";
import { APIData } from "../modules/apiData";
import { ActionPermission } from "../models/Permission";
import { ParamsFrom } from "actionhero";
export declare class PropertiesList extends AuthenticatedAction {
name: string;
description: string;
outputExample: {};
permission: ActionPermission;
inputs: {
readonly limit: {
readonly required: true;
readonly default: 100;
readonly formatter: typeof APIData.ensureNumber;
};
readonly offset: {
readonly required: true;
readonly default: 0;
readonly formatter: typeof APIData.ensureNumber;
};
readonly unique: {
readonly required: false;
readonly formatter: typeof APIData.ensureBoolean;
};
readonly state: {
readonly required: false;
};
readonly modelId: {
readonly required: false;
};
readonly sourceId: {
readonly required: false;
};
readonly includeExamples: {
readonly required: true;
readonly default: "false";
readonly formatter: typeof APIData.ensureBoolean;
};
readonly order: {
readonly required: false;
readonly formatter: typeof APIData.ensureArray;
readonly default: readonly [readonly ["key", "asc"], readonly ["createdAt", "desc"]];
};
};
runWithinTransaction({ params, }: {
params: ParamsFrom<PropertiesList>;
}): Promise<{
total: number;
properties: {
id: string;
sourceId: string;
key: string;
type: "string" | "boolean" | "url" | "float" | "integer" | "date" | "email" | "phoneNumber";
state: "ready" | "draft" | "deleted";
unique: boolean;
isPrimaryKey: boolean;
locked: string;
options: import("../modules/optionHelper").OptionHelper.SimpleOptions;
filters: FilterHelper.FiltersWithKey[];
isArray: boolean;
createdAt: number;
updatedAt: number;
recordProperties: {
recordId: string;
property: Property;
state: "pending" | "ready" | "draft";
valueChangedAt: number;
stateChangedAt: number;
confirmedAt: number;
startedAt: number;
position: number;
unique: boolean;
key: string;
value: string | number | boolean | Date;
invalidValue: string;
invalidReason: string;
}[];
}[];
examples: {
[id: string]: string[];
};
}>;
}
export declare class PropertiesOptions extends AuthenticatedAction {
name: string;
description: string;
outputExample: {};
permission: ActionPermission;
runWithinTransaction(): Promise<{
types: readonly string[];
}>;
}
export declare class PropertyGroups extends AuthenticatedAction {
name: string;
description: string;
outputExample: {};
permission: ActionPermission;
inputs: {
readonly id: {
readonly required: true;
};
};
runWithinTransaction({ params, }: {
params: ParamsFrom<PropertyGroups>;
}): Promise<{
groups: {
id: string;
name: string;
modelId: string;
modelName: string;
rules: import("../models/Group").GroupRuleWithKey[];
matchType: "all" | "any";
state: "ready" | "draft" | "deleted" | "initializing" | "updating";
locked: string;
recordsCount: number;
createdAt: number;
updatedAt: number;
nextCalculatedAt: number;
calculatedAt: number;
}[];
}>;
}
export declare class PropertyCreate extends AuthenticatedAction {
name: string;
description: string;
outputExample: {};
permission: ActionPermission;
inputs: {
readonly id: {
readonly required: false;
};
readonly key: {
readonly required: false;
};
readonly type: {
readonly required: true;
};
readonly unique: {
readonly required: false;
readonly formatter: typeof APIData.ensureBoolean;
};
readonly isArray: {
readonly required: false;
readonly formatter: typeof APIData.ensureBoolean;
};
readonly state: {
readonly required: false;
};
readonly sourceId: {
readonly required: false;
};
readonly options: {
readonly required: false;
readonly formatter: typeof APIData.ensureObject;
};
readonly filters: {
readonly required: false;
readonly formatter: typeof APIData.ensureArray;
};
};
runWithinTransaction({ params, }: {
params: ParamsFrom<PropertyCreate>;
}): Promise<{
property: {
id: string;
sourceId: string;
key: string;
type: "string" | "boolean" | "url" | "float" | "integer" | "date" | "email" | "phoneNumber";
state: "ready" | "draft" | "deleted";
unique: boolean;
isPrimaryKey: boolean;
locked: string;
options: import("../modules/optionHelper").OptionHelper.SimpleOptions;
filters: FilterHelper.FiltersWithKey[];
isArray: boolean;
createdAt: number;
updatedAt: number;
recordProperties: {
recordId: string;
property: Property;
state: "pending" | "ready" | "draft";
valueChangedAt: number;
stateChangedAt: number;
confirmedAt: number;
startedAt: number;
position: number;
unique: boolean;
key: string;
value: string | number | boolean | Date;
invalidValue: string;
invalidReason: string;
}[];
};
pluginOptions: {
key: string;
displayName?: string;
description: string;
required: boolean;
type: import("..").PluginOptionType;
options: {
key: string;
description?: string;
default?: boolean;
examples?: any[];
}[];
}[];
source: {
id: string;
name: string;
type: string;
state: "ready" | "draft" | "deleted";
mapping: import("../modules/mappingHelper").MappingHelper.Mappings;
app: {
id: string;
name: string;
icon: string;
type: string;
state: "ready" | "draft" | "deleted";
locked: string;
options: import("../modules/optionHelper").OptionHelper.SimpleOptions;
provides: {
source: boolean;
destination: boolean;
};
pluginName: string;
pluginApp: import("..").PluginApp;
refreshQueryAvailable: boolean;
createdAt: number;
updatedAt: number;
appRefreshQuery: {
id: string;
appId: string;
refreshQuery: string;
value: string;
locked: string;
state: "ready" | "draft";
lastChangedAt: number;
lastConfirmedAt: number;
recurringFrequency: number;
createdAt: number;
updatedAt: number;
};
};
appId: string;
modelName: string;
modelId: string;
scheduleAvailable: boolean;
schedule: {
id: string;
name: string;
state: "ready" | "draft";
sourceId: string;
incremental: boolean;
recurring: boolean;
refreshEnabled: boolean;
locked: string;
confirmRecords: boolean;
supportIncrementalSchedule: boolean;
options: import("../modules/optionHelper").OptionHelper.SimpleOptions;
filters: FilterHelper.FiltersWithKey[];
recurringFrequency: number;
createdAt: number;
updatedAt: number;
};
previewAvailable: boolean;
locked: string;
options: import("../modules/optionHelper").OptionHelper.SimpleOptions;
connection: import("..").PluginConnection;
createdAt: number;
updatedAt: number;
};
}>;
}
export declare class PropertyEdit extends AuthenticatedAction {
name: string;
description: string;
outputExample: {};
permission: ActionPermission;
inputs: {
readonly id: {
readonly required: true;
};
readonly key: {
readonly required: false;
};
readonly type: {
readonly required: false;
};
readonly unique: {
readonly required: false;
readonly formatter: typeof APIData.ensureBoolean;
};
readonly isArray: {
readonly required: false;
};
readonly state: {
readonly required: false;
};
readonly sourceId: {
readonly required: false;
};
readonly options: {
readonly required: false;
readonly formatter: typeof APIData.ensureObject;
};
readonly filters: {
readonly required: false;
readonly formatter: typeof APIData.ensureArray;
};
};
runWithinTransaction({ params }: {
params: ParamsFrom<PropertyEdit>;
}): Promise<{
property: {
id: string;
sourceId: string;
key: string;
type: "string" | "boolean" | "url" | "float" | "integer" | "date" | "email" | "phoneNumber";
state: "ready" | "draft" | "deleted";
unique: boolean;
isPrimaryKey: boolean;
locked: string;
options: import("../modules/optionHelper").OptionHelper.SimpleOptions;
filters: FilterHelper.FiltersWithKey[];
isArray: boolean;
createdAt: number;
updatedAt: number;
recordProperties: {
recordId: string;
property: Property;
state: "pending" | "ready" | "draft";
valueChangedAt: number;
stateChangedAt: number;
confirmedAt: number;
startedAt: number;
position: number;
unique: boolean;
key: string;
value: string | number | boolean | Date;
invalidValue: string;
invalidReason: string;
}[];
};
pluginOptions: {
key: string;
displayName?: string;
description: string;
required: boolean;
type: import("..").PluginOptionType;
options: {
key: string;
description?: string;
default?: boolean;
examples?: any[];
}[];
}[];
source: {
id: string;
name: string;
type: string;
state: "ready" | "draft" | "deleted";
mapping: import("../modules/mappingHelper").MappingHelper.Mappings;
app: {
id: string;
name: string;
icon: string;
type: string;
state: "ready" | "draft" | "deleted";
locked: string;
options: import("../modules/optionHelper").OptionHelper.SimpleOptions;
provides: {
source: boolean;
destination: boolean;
};
pluginName: string;
pluginApp: import("..").PluginApp;
refreshQueryAvailable: boolean;
createdAt: number;
updatedAt: number;
appRefreshQuery: {
id: string;
appId: string;
refreshQuery: string;
value: string;
locked: string;
state: "ready" | "draft";
lastChangedAt: number;
lastConfirmedAt: number;
recurringFrequency: number;
createdAt: number;
updatedAt: number;
};
};
appId: string;
modelName: string;
modelId: string;
scheduleAvailable: boolean;
schedule: {
id: string;
name: string;
state: "ready" | "draft";
sourceId: string;
incremental: boolean;
recurring: boolean;
refreshEnabled: boolean;
locked: string;
confirmRecords: boolean;
supportIncrementalSchedule: boolean;
options: import("../modules/optionHelper").OptionHelper.SimpleOptions;
filters: FilterHelper.FiltersWithKey[];
recurringFrequency: number;
createdAt: number;
updatedAt: number;
};
previewAvailable: boolean;
locked: string;
options: import("../modules/optionHelper").OptionHelper.SimpleOptions;
connection: import("..").PluginConnection;
createdAt: number;
updatedAt: number;
};
}>;
}
export declare class PropertyFilterOptions extends AuthenticatedAction {
name: string;
description: string;
outputExample: {};
permission: ActionPermission;
inputs: {
readonly id: {
readonly required: true;
};
};
runWithinTransaction({ params, }: {
params: ParamsFrom<PropertyFilterOptions>;
}): Promise<{
options: import("..").SourceFilterMethodResponseRow[];
optionDescriptions: {
[key: string]: string;
};
}>;
}
export declare class PropertyView extends AuthenticatedAction {
name: string;
description: string;
outputExample: {};
permission: ActionPermission;
inputs: {
readonly id: {
readonly required: true;
};
};
runWithinTransaction({ params }: {
params: ParamsFrom<PropertyView>;
}): Promise<{
property: {
id: string;
sourceId: string;
key: string;
type: "string" | "boolean" | "url" | "float" | "integer" | "date" | "email" | "phoneNumber";
state: "ready" | "draft" | "deleted";
unique: boolean;
isPrimaryKey: boolean;
locked: string;
options: import("../modules/optionHelper").OptionHelper.SimpleOptions;
filters: FilterHelper.FiltersWithKey[];
isArray: boolean;
createdAt: number;
updatedAt: number;
recordProperties: {
recordId: string;
property: Property;
state: "pending" | "ready" | "draft";
valueChangedAt: number;
stateChangedAt: number;
confirmedAt: number;
startedAt: number;
position: number;
unique: boolean;
key: string;
value: string | number | boolean | Date;
invalidValue: string;
invalidReason: string;
}[];
};
source: {
id: string;
name: string;
type: string;
state: "ready" | "draft" | "deleted";
mapping: import("../modules/mappingHelper").MappingHelper.Mappings;
app: {
id: string;
name: string;
icon: string;
type: string;
state: "ready" | "draft" | "deleted";
locked: string;
options: import("../modules/optionHelper").OptionHelper.SimpleOptions;
provides: {
source: boolean;
destination: boolean;
};
pluginName: string;
pluginApp: import("..").PluginApp;
refreshQueryAvailable: boolean;
createdAt: number;
updatedAt: number;
appRefreshQuery: {
id: string;
appId: string;
refreshQuery: string;
value: string;
locked: string;
state: "ready" | "draft";
lastChangedAt: number;
lastConfirmedAt: number;
recurringFrequency: number;
createdAt: number;
updatedAt: number;
};
};
appId: string;
modelName: string;
modelId: string;
scheduleAvailable: boolean;
schedule: {
id: string;
name: string;
state: "ready" | "draft";
sourceId: string;
incremental: boolean;
recurring: boolean;
refreshEnabled: boolean;
locked: string;
confirmRecords: boolean;
supportIncrementalSchedule: boolean;
options: import("../modules/optionHelper").OptionHelper.SimpleOptions;
filters: FilterHelper.FiltersWithKey[];
recurringFrequency: number;
createdAt: number;
updatedAt: number;
};
previewAvailable: boolean;
locked: string;
options: import("../modules/optionHelper").OptionHelper.SimpleOptions;
connection: import("..").PluginConnection;
createdAt: number;
updatedAt: number;
};
}>;
}
export declare class PropertyPluginOptions extends AuthenticatedAction {
name: string;
description: string;
outputExample: {};
permission: ActionPermission;
inputs: {
readonly id: {
readonly required: true;
};
readonly options: {
readonly required: false;
readonly formatter: typeof APIData.ensureObject;
};
};
runWithinTransaction({ params, }: {
params: ParamsFrom<PropertyPluginOptions>;
}): Promise<{
pluginOptions: {
key: string;
displayName?: string;
description: string;
required: boolean;
type: import("..").PluginOptionType;
options: {
key: string;
description?: string;
default?: boolean;
examples?: any[];
}[];
}[];
}>;
}
export declare class PropertyRecordPreview extends AuthenticatedAction {
name: string;
description: string;
outputExample: {};
permission: ActionPermission;
inputs: {
readonly id: {
readonly required: true;
};
readonly recordId: {
readonly required: false;
};
readonly options: {
readonly required: false;
readonly formatter: typeof APIData.ensureObject;
};
readonly filters: {
readonly required: false;
readonly formatter: typeof APIData.ensureArray;
};
};
runWithinTransaction({ params, }: {
params: ParamsFrom<PropertyRecordPreview>;
}): Promise<{
errorMessage: string;
record?: undefined;
groups?: undefined;
destinations?: undefined;
} | {
errorMessage: string;
record: {
id: string;
state: "pending" | "ready" | "draft" | "deleted";
modelId: string;
modelName: string;
groupIds: string[];
invalid: boolean;
properties: import("../modules/ops/record").RecordPropertyType;
createdAt: number;
updatedAt: number;
};
groups: {
id: string;
name: string;
modelId: string;
modelName: string;
rules: import("../models/Group").GroupRuleWithKey[];
matchType: "all" | "any";
state: "ready" | "draft" | "deleted" | "initializing" | "updating";
locked: string;
recordsCount: number;
createdAt: number;
updatedAt: number;
nextCalculatedAt: number;
calculatedAt: number;
}[];
destinations: {
id: string;
name: string;
type: string;
state: "ready" | "draft" | "deleted";
locked: string;
syncMode: "sync" | "additive" | "enrich";
syncModes: {
key: "sync" | "additive" | "enrich";
displayName: string;
description: string;
operations: import("..").DestinationSyncOperations;
}[];
collection: "none" | "group" | "model";
app: {
id: string;
name: string;
icon: string;
type: string;
state: "ready" | "draft" | "deleted";
locked: string;
options: import("../modules/optionHelper").OptionHelper.SimpleOptions;
provides: {
source: boolean;
destination: boolean;
};
pluginName: string;
pluginApp: import("..").PluginApp;
refreshQueryAvailable: boolean;
createdAt: number;
updatedAt: number;
appRefreshQuery: {
id: string;
appId: string;
refreshQuery: string;
value: string;
locked: string;
state: "ready" | "draft";
lastChangedAt: number;
lastConfirmedAt: number;
recurringFrequency: number;
createdAt: number;
updatedAt: number;
};
};
modelId: string;
modelName: string;
mapping: import("../modules/mappingHelper").MappingHelper.Mappings;
options: import("../modules/optionHelper").OptionHelper.SimpleOptions;
connection: import("..").PluginConnection;
group: {
id: string;
name: string;
modelId: string;
modelName: string;
rules: import("../models/Group").GroupRuleWithKey[];
matchType: "all" | "any";
state: "ready" | "draft" | "deleted" | "initializing" | "updating";
locked: string;
recordsCount: number;
createdAt: number;
updatedAt: number;
nextCalculatedAt: number;
calculatedAt: number;
};
destinationGroupMemberships: import("../models/Destination").SimpleDestinationGroupMembership[];
createdAt: number;
updatedAt: number;
exportTotals: {
failed: number;
canceled: number;
complete: number;
pending: number;
draft: number;
processing: number;
};
}[];
}>;
}
export declare class PropertyTest extends AuthenticatedAction {
name: string;
description: string;
outputExample: {};
permission: ActionPermission;
inputs: {
readonly id: {
readonly required: true;
};
};
runWithinTransaction({ params }: {
params: ParamsFrom<PropertyTest>;
}): Promise<{
test: boolean | import("..").RecordPropertyPluginMethodResponse;
}>;
}
export declare class PropertyDestroy extends AuthenticatedAction {
name: string;
description: string;
outputExample: {};
permission: ActionPermission;
inputs: {
readonly id: {
readonly required: true;
};
};
runWithinTransaction({ params, }: {
params: ParamsFrom<PropertyDestroy>;
}): Promise<{
success: boolean;
}>;
}