@daml/hub-react
Version:
Daml React functions for Daml Hub
89 lines (88 loc) • 2.33 kB
TypeScript
import { Decoder } from '@mojotech/json-type-validation';
export declare enum EntityTag {
DamlTrigger = "DamlTrigger",
LedgerBot = "LedgerBot",
Integration = "Integration"
}
interface AutomationEntity<Tag extends EntityTag, Value> {
tag: Tag;
value: {
entityName: string;
} & Value;
}
type DamlTrigger = AutomationEntity<EntityTag.DamlTrigger, {
metadata: {};
packageIds: string[];
sdkVersion: string;
triggerNames: string[];
}>;
type LedgerBot = AutomationEntity<EntityTag.LedgerBot, {
metadata: {};
runtime: string;
}>;
interface IntegrationTypeFieldInfo {
id: string;
name: string;
description: string;
fieldType: string;
helpUrl?: string | null;
defaultValue?: string | null;
required?: boolean | null;
tags: string[];
fieldContext?: string | null;
}
type Integration = AutomationEntity<EntityTag.Integration, {
artifactHash?: string | null;
typeName: string;
description: string;
entrypoint: string;
runtime?: string | null;
envClass?: string | null;
fields: IntegrationTypeFieldInfo[];
helpUrl?: string | null;
instanceTemplate?: string | null;
tags: string[];
}>;
export type Automation = {
artifactHash: string;
ledgerId: string;
automationEntity: DamlTrigger | LedgerBot | Integration;
deployers: string[];
createdAt: string;
owner: string;
apiVersion: string;
};
export declare const publicAutomationListDecoder: Decoder<Automation[]>;
type AutomationConfig = {
tag: 'AutomationC';
value: {
name?: string;
runAs: string;
configMap: {};
};
};
export type Instance = {
ledgerId: string;
entityInfo: {
apiVersion: string;
artifactHash: string;
entity: {
tag: 'Automation';
value: DamlTrigger | LedgerBot | Integration;
};
};
enabled: boolean;
deployer: string;
config: AutomationConfig;
id: string;
instanceLabel: string | null;
createdAt: string;
owner: string;
};
export declare const instanceDecoder: Decoder<Instance>;
export declare const instanceListDecoder: Decoder<Instance[]>;
export interface SuccessResponse {
result: 'success';
}
export declare const successResponseDecoder: Decoder<SuccessResponse>;
export {};