import { AxiosResponse } from 'axios'; import { CreateSpecification } from './digitaltwin'; import Archivable, { ArchivedUpdatedEvent } from './shared/archivable'; import Draftable from './shared/draftable'; import Entity from './shared/entity'; import { Event } from './shared/eventstore-client/EventstoreClient'; import { ServiceClientWithEventstore } from './shared/service-client/ServiceClientWithEventstore'; export interface MessageResponse { message: string; } export interface Template extends TemplateProperties, Entity, Archivable, Draftable { } export interface TemplateBatch extends TemplateBatchProperties, Entity { } export interface TemplateProperties { tags?: string[]; specification: CreateSpecification; } export declare type TemplateBatchSpecification = Omit & { imageUrl?: string; presentationId?: string; }; export interface TemplateBatchProperties { entries: TemplateBatchEntry[]; status: BatchStatus; statusMessage?: string; } export declare type CreateTemplateInput = TemplateProperties & Draftable; export declare type UpdateTemplateInput = Pick & { specification?: Partial; } & Draftable; export declare type TemplateBatchEntry = Omit & { specification: TemplateBatchSpecification; entryId: string; status: EntryStatus; statusMessage?: string; }; export declare type CreateTemplateBatchEntryInput = Omit & { specification: TemplateBatchSpecification; }; export declare enum EntryStatus { SUCCESS = "SUCCESS", PENDING = "PENDING", FAILED = "FAILED" } export declare enum BatchStatus { RUNNING = "RUNNING", COMPLETED = "COMPLETED", FAILED = "FAILED" } export interface CreateTemplateBatchInput { entries: CreateTemplateBatchEntryInput[]; } export declare type PERMISSIONS = typeof DELETE | typeof GET_ALL | typeof GET | typeof GET_BATCH | typeof GET_ALL_BATCHES | typeof CREATE | typeof CREATE_BATCH | typeof UPDATE | typeof SET_ARCHIVED | typeof GET_EVENTS_ANY | typeof GET_EVENTS_CREATED | typeof GET_EVENTS_UPDATED | typeof GET_EVENTS_DELETED | typeof GET_EVENTS_ARCHIVED_UPDATED; export declare const CREATE = "TEMPLATE:CREATE"; export declare const CREATE_BATCH = "TEMPLATE:CREATE_BATCH"; export declare const UPDATE = "TEMPLATE:UPDATE"; export declare const DELETE = "TEMPLATE:DELETE"; export declare const GET = "TEMPLATE:GET"; export declare const GET_BATCH = "TEMPLATE:GET_BATCH"; export declare const GET_ALL = "TEMPLATE:GET_ALL"; export declare const GET_ALL_BATCHES = "TEMPLATE:GET_ALL_BATCHES"; export declare const SET_ARCHIVED = "TEMPLATE:SET_ARCHIVED"; export declare const GET_EVENTS_ANY = "TEMPLATE:GET_EVENTS:ANY"; export declare const GET_EVENTS_CREATED = "TEMPLATE:GET_EVENTS:CREATED"; export declare const GET_EVENTS_DELETED = "TEMPLATE:GET_EVENTS:DELETED"; export declare const GET_EVENTS_UPDATED = "TEMPLATE:GET_EVENTS:UPDATED"; export declare const GET_EVENTS_ARCHIVED_UPDATED = "TEMPLATE:GET_EVENTS:ARCHIVED_UPDATED"; export declare const PERMISSION_NAMES: { CREATE: string; CREATE_BATCH: string; UPDATE: string; DELETE: string; GET: string; GET_ALL: string; GET_BATCH: string; GET_ALL_BATCHES: string; SET_ARCHIVED: string; GET_EVENTS_ANY: string; GET_EVENTS_CREATED: string; GET_EVENTS_DELETED: string; GET_EVENTS_UPDATED: string; GET_EVENTS_ARCHIVED_UPDATED: string; }; export interface CreatedEvent extends Event { type: 'CREATED'; data: Template; } export interface UpdatedEvent extends Event { type: 'UPDATED'; data: UpdateTemplateInput; } export interface DeletedEvent extends Event { type: 'DELETED'; } export declare type TemplateEvents = CreatedEvent | DeletedEvent | UpdatedEvent | ArchivedUpdatedEvent; export interface GetTemplatesResponse { templates: Template[]; continuationToken?: string; } export interface GetTemplatesRequest { limit?: number; continuationToken?: string; allowArchived?: boolean; allowDraft?: boolean; } export declare class TemplateClient extends ServiceClientWithEventstore { get(id: string): Promise>; getAll(input?: GetTemplatesRequest): Promise>; create(t: CreateTemplateInput): Promise>; update(id: string, t: UpdateTemplateInput): Promise>; delete(id: string): Promise>; setArchived(id: string, archived: boolean): Promise>; createBatch(t: CreateTemplateBatchInput): Promise>; validateCreateBatch(t: CreateTemplateBatchInput): Promise>; getBatch(id: string): Promise>; }