@meistrari/tela-sdk-js 2.0.0 → 2.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +771 -1
- package/dist/index.cjs +314 -32
- package/dist/index.d.cts +641 -29
- package/dist/index.d.mts +641 -29
- package/dist/index.d.ts +641 -29
- package/dist/index.mjs +318 -37
- package/package.json +36 -35
package/dist/index.d.ts
CHANGED
|
@@ -1,4 +1,6 @@
|
|
|
1
|
-
import
|
|
1
|
+
import * as _zod from 'zod';
|
|
2
|
+
import _zod__default, { ZodError, z } from 'zod';
|
|
3
|
+
import Emittery from 'emittery';
|
|
2
4
|
|
|
3
5
|
/**
|
|
4
6
|
* Base HTTP client with retry logic, request/response transformation, and streaming support.
|
|
@@ -245,7 +247,7 @@ type TelaFileOptions = BaseTelaFileOptions | TelaFileOptionsWithMimeType;
|
|
|
245
247
|
* which can be a URL string, Uint8Array, ReadableStream, ReadStream, Blob, or File.
|
|
246
248
|
*/
|
|
247
249
|
type TelaFileInput = string | Uint8Array | ReadableStream | Blob | File;
|
|
248
|
-
declare function TelaFileSchema():
|
|
250
|
+
declare function TelaFileSchema(): _zod__default.ZodCustom<TelaFile, TelaFile>;
|
|
249
251
|
/**
|
|
250
252
|
* Represents a file with support for various types including URLs, binary data, streams, and Blobs.
|
|
251
253
|
*
|
|
@@ -310,7 +312,8 @@ declare class TelaFile {
|
|
|
310
312
|
* @throws {InvalidFileURL} If the provided URL is not valid.
|
|
311
313
|
* @throws {EmptyFileError} If the provided file is empty.
|
|
312
314
|
*/
|
|
313
|
-
|
|
315
|
+
constructor(file: Blob | File | string, options?: BaseTelaFileOptions);
|
|
316
|
+
constructor(file: Uint8Array | ReadableStream, options: TelaFileOptionsWithMimeType);
|
|
314
317
|
static create(file: Blob | File | string, options?: BaseTelaFileOptions): TelaFile;
|
|
315
318
|
static create(file: Uint8Array | ReadableStream, options: TelaFileOptionsWithMimeType): TelaFile;
|
|
316
319
|
/**
|
|
@@ -408,6 +411,12 @@ interface BaseExecutionParams {
|
|
|
408
411
|
* This is required if a canvasId is not provided.
|
|
409
412
|
*/
|
|
410
413
|
applicationId?: string;
|
|
414
|
+
/**
|
|
415
|
+
* Optional label for this execution when using applicationId.
|
|
416
|
+
* This label can be used to identify or categorize the execution.
|
|
417
|
+
* Note: This field is only applicable when applicationId is provided.
|
|
418
|
+
*/
|
|
419
|
+
label?: string;
|
|
411
420
|
/**
|
|
412
421
|
* An array of previous messages in the conversation.
|
|
413
422
|
* Each message should have a 'role' (e.g., 'user', 'assistant') and 'content'.
|
|
@@ -456,6 +465,11 @@ interface BaseExecutionParams {
|
|
|
456
465
|
* @default false
|
|
457
466
|
*/
|
|
458
467
|
skipResultValidation?: boolean;
|
|
468
|
+
/**
|
|
469
|
+
* Optional array of tags to associate with this execution.
|
|
470
|
+
* Tags can be used for filtering, categorization, and analytics.
|
|
471
|
+
*/
|
|
472
|
+
tags?: string[];
|
|
459
473
|
}
|
|
460
474
|
/**
|
|
461
475
|
* Configuration for asynchronous canvas execution with polling.
|
|
@@ -523,6 +537,117 @@ interface SyncExecutionParams extends BaseExecutionParams {
|
|
|
523
537
|
*/
|
|
524
538
|
stream?: never;
|
|
525
539
|
}
|
|
540
|
+
/**
|
|
541
|
+
* Status of a canvas execution.
|
|
542
|
+
*
|
|
543
|
+
* Possible values:
|
|
544
|
+
* - `created` - Async execution queued on server (initial state)
|
|
545
|
+
* - `running` - Async execution actively processing
|
|
546
|
+
* - `succeeded` - Execution completed successfully (after validation)
|
|
547
|
+
* - `failed` - Execution failed (API error, validation error, or server failure)
|
|
548
|
+
* - `streaming` - Stream execution in progress
|
|
549
|
+
*
|
|
550
|
+
* @see {@link CanvasExecution.status} for status transitions and timing
|
|
551
|
+
*/
|
|
552
|
+
type ExecutionStatus = 'succeeded' | 'failed' | 'running' | 'created' | 'streaming';
|
|
553
|
+
type AsyncCompletionCreateResult = {
|
|
554
|
+
id: string;
|
|
555
|
+
status: ExecutionStatus;
|
|
556
|
+
input_content: {
|
|
557
|
+
files: Array<any>;
|
|
558
|
+
messages: Array<any>;
|
|
559
|
+
variables: {
|
|
560
|
+
body: string;
|
|
561
|
+
title: string;
|
|
562
|
+
};
|
|
563
|
+
};
|
|
564
|
+
output_content: null;
|
|
565
|
+
raw_input: {
|
|
566
|
+
async: boolean;
|
|
567
|
+
canvas_id: string;
|
|
568
|
+
variables: {
|
|
569
|
+
body: string;
|
|
570
|
+
title: string;
|
|
571
|
+
};
|
|
572
|
+
};
|
|
573
|
+
raw_output: any;
|
|
574
|
+
compatibility_date: string;
|
|
575
|
+
metadata: Array<{
|
|
576
|
+
promptVersion: {
|
|
577
|
+
modelConfigurations: {
|
|
578
|
+
type: string;
|
|
579
|
+
model: string;
|
|
580
|
+
temperature: number;
|
|
581
|
+
structuredOutput: {
|
|
582
|
+
schema: {
|
|
583
|
+
type: string;
|
|
584
|
+
title: string;
|
|
585
|
+
required: Array<string>;
|
|
586
|
+
properties: {
|
|
587
|
+
clickbaitMessages: {
|
|
588
|
+
id: string;
|
|
589
|
+
type: string;
|
|
590
|
+
items: {
|
|
591
|
+
id: string;
|
|
592
|
+
type: string;
|
|
593
|
+
};
|
|
594
|
+
description: string;
|
|
595
|
+
};
|
|
596
|
+
};
|
|
597
|
+
description: string;
|
|
598
|
+
};
|
|
599
|
+
enabled: boolean;
|
|
600
|
+
};
|
|
601
|
+
};
|
|
602
|
+
variablesDefinitions: Array<{
|
|
603
|
+
name: string;
|
|
604
|
+
type: string;
|
|
605
|
+
required: boolean;
|
|
606
|
+
}>;
|
|
607
|
+
};
|
|
608
|
+
}>;
|
|
609
|
+
credits_used: number;
|
|
610
|
+
prompt_id: string;
|
|
611
|
+
prompt_version_id: string;
|
|
612
|
+
prompt_application_id: any;
|
|
613
|
+
workspace_id: string;
|
|
614
|
+
created_at: string;
|
|
615
|
+
updated_at: string;
|
|
616
|
+
deleted_at: any;
|
|
617
|
+
};
|
|
618
|
+
/**
|
|
619
|
+
* Raw API response type. Represents the unprocessed response from the Tela API.
|
|
620
|
+
* This type will be refined in future versions with proper typing.
|
|
621
|
+
*/
|
|
622
|
+
type RawAPIResult = any;
|
|
623
|
+
/**
|
|
624
|
+
* Result returned when polling for asynchronous execution status.
|
|
625
|
+
*
|
|
626
|
+
* @template T - The type of the output content.
|
|
627
|
+
*/
|
|
628
|
+
type AsyncCompletionPollingResult<T> = {
|
|
629
|
+
/**
|
|
630
|
+
* Unique identifier for the execution.
|
|
631
|
+
*/
|
|
632
|
+
id: string;
|
|
633
|
+
/**
|
|
634
|
+
* Current status of the execution.
|
|
635
|
+
*/
|
|
636
|
+
status: ExecutionStatus;
|
|
637
|
+
/**
|
|
638
|
+
* The output content when execution succeeds.
|
|
639
|
+
*/
|
|
640
|
+
outputContent: {
|
|
641
|
+
/**
|
|
642
|
+
* The actual content result.
|
|
643
|
+
*/
|
|
644
|
+
content: T;
|
|
645
|
+
};
|
|
646
|
+
/**
|
|
647
|
+
* Raw output data from the execution.
|
|
648
|
+
*/
|
|
649
|
+
rawOutput: Record<string, any>;
|
|
650
|
+
};
|
|
526
651
|
/**
|
|
527
652
|
* Union type of all possible execution parameter configurations.
|
|
528
653
|
*/
|
|
@@ -537,29 +662,74 @@ type ExecutionParams = AsyncExecutionParams | StreamExecutionParams | SyncExecut
|
|
|
537
662
|
* @returns AsyncGenerator for streaming executions, Promise otherwise.
|
|
538
663
|
*/
|
|
539
664
|
type CanvasExecutionResult<TParams, TOutput = unknown> = TParams extends StreamExecutionParams ? AsyncGenerator<Partial<TOutput>> : Promise<TOutput>;
|
|
665
|
+
type CanvasExecutionEvents<TOutput> = {
|
|
666
|
+
poll: AsyncCompletionPollingResult<TOutput>;
|
|
667
|
+
success: TOutput;
|
|
668
|
+
error: ExecutionFailedError;
|
|
669
|
+
statusChange: ExecutionStatus;
|
|
670
|
+
};
|
|
540
671
|
/**
|
|
541
672
|
* Manages the execution lifecycle of a canvas.
|
|
542
673
|
*
|
|
543
674
|
* Handles synchronous, asynchronous (with polling), and streaming execution modes.
|
|
544
675
|
* Automatically uploads TelaFile instances and validates results based on output schema.
|
|
545
676
|
*
|
|
677
|
+
* ## Status Tracking
|
|
678
|
+
*
|
|
679
|
+
* The execution status can be accessed via the `status` property and tracks the lifecycle:
|
|
680
|
+
*
|
|
681
|
+
* - **Sync executions**: `succeeded` or `failed` (set after validation completes)
|
|
682
|
+
* - **Async executions**: `created` → `running` → `succeeded` or `failed` (updated during polling)
|
|
683
|
+
* - **Stream executions**: `streaming` (set when stream starts)
|
|
684
|
+
*
|
|
685
|
+
* Status is set to `failed` when:
|
|
686
|
+
* - API request fails
|
|
687
|
+
* - Validation fails (for both sync and async)
|
|
688
|
+
* - Polling reports failure status
|
|
689
|
+
*
|
|
690
|
+
* Status is set to `succeeded` only after:
|
|
691
|
+
* - API request succeeds AND
|
|
692
|
+
* - Output validation passes (if schema provided)
|
|
693
|
+
*
|
|
546
694
|
* @category Canvas
|
|
547
695
|
*
|
|
548
696
|
* @typeParam TParams - The execution parameters type
|
|
549
697
|
* @typeParam TInput - The input variables type
|
|
550
698
|
* @typeParam TOutput - The output result type
|
|
699
|
+
*
|
|
700
|
+
* @fires poll - Emitted during async polling with current status and output (async executions only)
|
|
701
|
+
* @fires success - Emitted when execution completes successfully with the final result
|
|
702
|
+
* @fires error - Emitted when execution fails (only if error listeners are registered, otherwise throws)
|
|
703
|
+
* @fires statusChange - Emitted when execution status transitions to a new state
|
|
704
|
+
*
|
|
705
|
+
* @example
|
|
706
|
+
* ```typescript
|
|
707
|
+
* const execution = await canvas.execute({ query: 'test' }, { async: true })
|
|
708
|
+
*
|
|
709
|
+
* // Track status changes
|
|
710
|
+
* execution.on('statusChange', (status) => {
|
|
711
|
+
* console.log(`Status: ${status}`) // created → running → succeeded
|
|
712
|
+
* })
|
|
713
|
+
*
|
|
714
|
+
* // Access current status at any time
|
|
715
|
+
* console.log(execution.status) // 'running'
|
|
716
|
+
*
|
|
717
|
+
* const result = await execution.result
|
|
718
|
+
* console.log(execution.status) // 'succeeded'
|
|
719
|
+
* ```
|
|
551
720
|
*/
|
|
552
|
-
declare class CanvasExecution<TParams extends ExecutionParams = SyncExecutionParams, TInput = unknown, TOutput = unknown> {
|
|
721
|
+
declare class CanvasExecution<TParams extends ExecutionParams = SyncExecutionParams, TInput = unknown, TOutput = unknown> extends Emittery<CanvasExecutionEvents<TOutput>> {
|
|
553
722
|
private _id;
|
|
723
|
+
private _status;
|
|
554
724
|
private readonly _variables;
|
|
555
725
|
private readonly _params;
|
|
556
726
|
private readonly _client;
|
|
557
727
|
private readonly _outputSchema;
|
|
558
728
|
private readonly _skipResultValidation;
|
|
559
729
|
private readonly _abortController;
|
|
560
|
-
private _startPropmise;
|
|
561
730
|
private _resultPromise;
|
|
562
731
|
private _stream;
|
|
732
|
+
private _rawResultValue;
|
|
563
733
|
/**
|
|
564
734
|
* Creates a new canvas execution instance.
|
|
565
735
|
*
|
|
@@ -568,14 +738,81 @@ declare class CanvasExecution<TParams extends ExecutionParams = SyncExecutionPar
|
|
|
568
738
|
* @param outputSchema - Zod schema or object schema for validating/parsing output.
|
|
569
739
|
* @param client - HTTP client instance for making API requests.
|
|
570
740
|
*/
|
|
571
|
-
constructor(variables: TInput, params: TParams | undefined, outputSchema:
|
|
741
|
+
constructor(variables: TInput, params: TParams | undefined, outputSchema: _zod__default.ZodType | Record<string, unknown>, client: BaseClient);
|
|
742
|
+
/**
|
|
743
|
+
* Fetches an existing asynchronous execution by its ID.
|
|
744
|
+
*
|
|
745
|
+
* This method retrieves the current state of an async execution and creates a new
|
|
746
|
+
* CanvasExecution instance with the fetched data. Only async executions can be
|
|
747
|
+
* fetched, as they are the only ones with persistent UUIDs on the server.
|
|
748
|
+
*
|
|
749
|
+
* @param id - The UUID of the async execution to fetch.
|
|
750
|
+
* @param outputSchema - Zod schema or object schema for validating/parsing output.
|
|
751
|
+
* @param client - HTTP client instance for making API requests.
|
|
752
|
+
* @param options - Optional configuration for polling behavior.
|
|
753
|
+
* @param options.pollingInterval - Time in milliseconds between polling attempts (default: 1000).
|
|
754
|
+
* @param options.pollingTimeout - Maximum time in milliseconds to wait for completion (default: 60000).
|
|
755
|
+
* @throws {InvalidExecutionModeError} If the provided ID is not a valid UUID.
|
|
756
|
+
* @returns A promise resolving to a CanvasExecution instance with the fetched state.
|
|
757
|
+
*
|
|
758
|
+
* @example
|
|
759
|
+
* ```typescript
|
|
760
|
+
* const execution = await CanvasExecution.fetch(
|
|
761
|
+
* 'execution-uuid',
|
|
762
|
+
* z.object({ result: z.string() }),
|
|
763
|
+
* client,
|
|
764
|
+
* { pollingInterval: 2000, pollingTimeout: 120000 }
|
|
765
|
+
* )
|
|
766
|
+
* console.log(execution.status) // 'running' or 'succeeded' or 'failed'
|
|
767
|
+
* ```
|
|
768
|
+
*/
|
|
769
|
+
static fetch<TOutput = unknown>(id: string, outputSchema: _zod__default.ZodType | Record<string, unknown>, client: BaseClient, options?: {
|
|
770
|
+
pollingInterval?: number;
|
|
771
|
+
pollingTimeout?: number;
|
|
772
|
+
}): Promise<CanvasExecution<AsyncExecutionParams, unknown, TOutput>>;
|
|
572
773
|
/**
|
|
573
774
|
* Gets the unique execution ID assigned by the server.
|
|
574
775
|
*
|
|
575
|
-
*
|
|
776
|
+
* Note: Streaming executions do not have an ID as they don't create a tracked execution on the server.
|
|
777
|
+
*
|
|
778
|
+
* @throws {ExecutionNotStartedError} If the execution has not been started yet.
|
|
779
|
+
* @throws {InvalidExecutionModeError} If called on a streaming execution (streams don't have IDs).
|
|
576
780
|
* @returns The execution ID.
|
|
577
781
|
*/
|
|
578
782
|
get id(): string;
|
|
783
|
+
/**
|
|
784
|
+
* Gets the latest known status of the execution.
|
|
785
|
+
*
|
|
786
|
+
* Status values and transitions:
|
|
787
|
+
* - **Sync**: `succeeded` (after validation) or `failed` (on any error)
|
|
788
|
+
* - **Async**: `created` → `running` → `succeeded` or `failed`
|
|
789
|
+
* - **Stream**: `streaming` (once started)
|
|
790
|
+
*
|
|
791
|
+
* **Important:** Status is set to `succeeded` only after successful validation.
|
|
792
|
+
* If validation fails, status will be `failed` even if the API request succeeded.
|
|
793
|
+
*
|
|
794
|
+
* Use the `statusChange` event to track status transitions in real-time.
|
|
795
|
+
*
|
|
796
|
+
* @throws {ExecutionNotStartedError} If the execution has not been started yet.
|
|
797
|
+
* @returns The current status of the execution.
|
|
798
|
+
*
|
|
799
|
+
* @example
|
|
800
|
+
* ```typescript
|
|
801
|
+
* const execution = await canvas.execute({ query: 'test' }, { async: true })
|
|
802
|
+
* console.log(execution.status) // 'created'
|
|
803
|
+
*
|
|
804
|
+
* await execution.result
|
|
805
|
+
* console.log(execution.status) // 'succeeded' or 'failed'
|
|
806
|
+
* ```
|
|
807
|
+
*/
|
|
808
|
+
get status(): ExecutionStatus;
|
|
809
|
+
/**
|
|
810
|
+
* Sets the status of the execution.
|
|
811
|
+
*
|
|
812
|
+
* @param status - The new status of the execution.
|
|
813
|
+
* @private
|
|
814
|
+
*/
|
|
815
|
+
private set status(value);
|
|
579
816
|
/**
|
|
580
817
|
* Gets the input variables provided to this execution.
|
|
581
818
|
*
|
|
@@ -606,6 +843,17 @@ declare class CanvasExecution<TParams extends ExecutionParams = SyncExecutionPar
|
|
|
606
843
|
* @returns True if stream mode is enabled.
|
|
607
844
|
*/
|
|
608
845
|
get isStream(): boolean;
|
|
846
|
+
/**
|
|
847
|
+
* Gets the raw API response without any processing or validation.
|
|
848
|
+
* Automatically starts execution and waits for completion (including polling for async executions).
|
|
849
|
+
*
|
|
850
|
+
* For sync executions, returns the complete API response.
|
|
851
|
+
* For async executions, returns the polling response with status and output.
|
|
852
|
+
*
|
|
853
|
+
* @throws {InvalidExecutionModeError} If called on a streaming execution.
|
|
854
|
+
* @returns A promise resolving to the raw API result.
|
|
855
|
+
*/
|
|
856
|
+
get rawResult(): Promise<RawAPIResult>;
|
|
609
857
|
/**
|
|
610
858
|
* Type guard to check if params indicate async execution.
|
|
611
859
|
*
|
|
@@ -619,9 +867,7 @@ declare class CanvasExecution<TParams extends ExecutionParams = SyncExecutionPar
|
|
|
619
867
|
*
|
|
620
868
|
* @returns A promise or async generator depending on execution mode.
|
|
621
869
|
*/
|
|
622
|
-
start(): Promise<CanvasExecutionResult<TParams, TOutput>> | AsyncGenerator<Partial<TOutput>, any, any> | Promise<AsyncGenerator<Partial<TOutput>, any, any>> | Promise<
|
|
623
|
-
id: string;
|
|
624
|
-
}>;
|
|
870
|
+
start(): Promise<CanvasExecutionResult<TParams, TOutput>> | AsyncGenerator<Partial<TOutput>, any, any> | Promise<AsyncGenerator<Partial<TOutput>, any, any>> | Promise<AsyncCompletionCreateResult>;
|
|
625
871
|
/**
|
|
626
872
|
* Gets the execution result. For async executions, automatically starts polling.
|
|
627
873
|
* For sync executions, returns the result promise. For streams, returns the generator.
|
|
@@ -633,9 +879,59 @@ declare class CanvasExecution<TParams extends ExecutionParams = SyncExecutionPar
|
|
|
633
879
|
* Cancels the ongoing execution by aborting all active requests and polling operations.
|
|
634
880
|
*/
|
|
635
881
|
cancel(): void;
|
|
882
|
+
/**
|
|
883
|
+
* Starts polling for the execution result without waiting for the promise to resolve.
|
|
884
|
+
* This allows users to track execution progress via events rather than awaiting a promise.
|
|
885
|
+
*
|
|
886
|
+
* The following events will be emitted during polling:
|
|
887
|
+
* - `statusChange`: Emitted when the execution status changes (e.g., 'created' → 'running' → 'succeeded')
|
|
888
|
+
* - `poll`: Emitted on each polling attempt with the server response
|
|
889
|
+
* - `success`: Emitted when the execution completes successfully with the final result
|
|
890
|
+
* - `error`: Emitted if the execution fails
|
|
891
|
+
*
|
|
892
|
+
* **Important:** Events are only emitted while polling is active. You must either call `poll()` or
|
|
893
|
+
* await `execution.result` to start polling. Simply setting up event listeners without starting
|
|
894
|
+
* polling will not trigger any events.
|
|
895
|
+
*
|
|
896
|
+
* **Note:** If the execution has already completed (succeeded or failed) when fetched, the `success`
|
|
897
|
+
* and `error` events will not fire since no polling is needed. Check the `status` property and
|
|
898
|
+
* access the `result` directly for already-completed executions.
|
|
899
|
+
*
|
|
900
|
+
* @throws {InvalidExecutionModeError} If called on a non-async execution (sync or stream).
|
|
901
|
+
* @throws {ExecutionNotStartedError} If the execution has not been started yet (no ID assigned).
|
|
902
|
+
*
|
|
903
|
+
* @example
|
|
904
|
+
* ```typescript
|
|
905
|
+
* const execution = await canvas.getExecution('execution-id')
|
|
906
|
+
*
|
|
907
|
+
* // Check if already completed
|
|
908
|
+
* if (execution.status === 'succeeded' || execution.status === 'failed') {
|
|
909
|
+
* // Access result directly - events won't fire
|
|
910
|
+
* const result = await execution.result
|
|
911
|
+
* console.log('Already completed:', result)
|
|
912
|
+
* } else {
|
|
913
|
+
* // Still running - set up events and start polling
|
|
914
|
+
* execution.on('statusChange', (status) => {
|
|
915
|
+
* console.log('Status:', status)
|
|
916
|
+
* })
|
|
917
|
+
*
|
|
918
|
+
* execution.on('success', (result) => {
|
|
919
|
+
* console.log('Completed:', result)
|
|
920
|
+
* })
|
|
921
|
+
*
|
|
922
|
+
* execution.on('error', (error) => {
|
|
923
|
+
* console.error('Failed:', error)
|
|
924
|
+
* })
|
|
925
|
+
*
|
|
926
|
+
* // Start polling without waiting
|
|
927
|
+
* execution.poll()
|
|
928
|
+
* }
|
|
929
|
+
* ```
|
|
930
|
+
*/
|
|
931
|
+
poll(): void;
|
|
636
932
|
/**
|
|
637
933
|
* Builds the base request body shared across all execution types.
|
|
638
|
-
* Includes messages, overrides, and structured output configuration.
|
|
934
|
+
* Includes messages, overrides, tags, label, and structured output configuration.
|
|
639
935
|
*
|
|
640
936
|
* @returns The base request body object.
|
|
641
937
|
*/
|
|
@@ -789,19 +1085,294 @@ type CanvasGetOptions<TInput extends ZodTypeOrRecord, TOutput extends ZodTypeOrR
|
|
|
789
1085
|
skipSchemaValidation?: boolean;
|
|
790
1086
|
};
|
|
791
1087
|
declare const zod: {
|
|
792
|
-
string: typeof string;
|
|
793
|
-
number: typeof number;
|
|
794
|
-
boolean: typeof boolean;
|
|
795
|
-
object: typeof object;
|
|
796
|
-
array: typeof array;
|
|
797
1088
|
file: typeof TelaFileSchema;
|
|
798
|
-
|
|
799
|
-
|
|
1089
|
+
z: typeof _zod.z;
|
|
1090
|
+
default: typeof _zod.z;
|
|
1091
|
+
core: typeof _zod.core;
|
|
1092
|
+
globalRegistry: _zod.core.$ZodRegistry<_zod.core.GlobalMeta, _zod.core.$ZodType<unknown, unknown, _zod.core.$ZodTypeInternals<unknown, unknown>>>;
|
|
1093
|
+
registry: typeof _zod.core.registry;
|
|
1094
|
+
config: typeof _zod.core.config;
|
|
1095
|
+
$output: typeof _zod.core.$output;
|
|
1096
|
+
$input: typeof _zod.core.$input;
|
|
1097
|
+
$brand: typeof _zod.core.$brand;
|
|
1098
|
+
clone: typeof _zod.core.util.clone;
|
|
1099
|
+
regexes: typeof _zod.core.regexes;
|
|
1100
|
+
treeifyError: typeof _zod.core.treeifyError;
|
|
1101
|
+
prettifyError: typeof _zod.core.prettifyError;
|
|
1102
|
+
formatError: typeof _zod.core.formatError;
|
|
1103
|
+
flattenError: typeof _zod.core.flattenError;
|
|
1104
|
+
toJSONSchema: typeof _zod.core.toJSONSchema;
|
|
1105
|
+
TimePrecision: {
|
|
1106
|
+
readonly Any: null;
|
|
1107
|
+
readonly Minute: -1;
|
|
1108
|
+
readonly Second: 0;
|
|
1109
|
+
readonly Millisecond: 3;
|
|
1110
|
+
readonly Microsecond: 6;
|
|
1111
|
+
};
|
|
1112
|
+
util: typeof _zod.core.util;
|
|
1113
|
+
NEVER: never;
|
|
1114
|
+
locales: typeof _zod.core.locales;
|
|
1115
|
+
ZodISODateTime: _zod.core.$constructor<_zod.ZodISODateTime, _zod.core.$ZodISODateTimeDef>;
|
|
1116
|
+
ZodISODate: _zod.core.$constructor<_zod.ZodISODate, _zod.core.$ZodStringFormatDef<"date">>;
|
|
1117
|
+
ZodISOTime: _zod.core.$constructor<_zod.ZodISOTime, _zod.core.$ZodISOTimeDef>;
|
|
1118
|
+
ZodISODuration: _zod.core.$constructor<_zod.ZodISODuration, _zod.core.$ZodStringFormatDef<"duration">>;
|
|
1119
|
+
iso: typeof _zod.iso;
|
|
1120
|
+
coerce: typeof _zod.coerce;
|
|
1121
|
+
string(params?: string | _zod.core.$ZodStringParams): _zod.ZodString;
|
|
1122
|
+
string<T extends string>(params?: string | _zod.core.$ZodStringParams): _zod.core.$ZodType<T, T>;
|
|
1123
|
+
email(params?: string | _zod.core.$ZodEmailParams): _zod.ZodEmail;
|
|
1124
|
+
guid(params?: string | _zod.core.$ZodGUIDParams): _zod.ZodGUID;
|
|
1125
|
+
uuid(params?: string | _zod.core.$ZodUUIDParams): _zod.ZodUUID;
|
|
1126
|
+
uuidv4(params?: string | _zod.core.$ZodUUIDv4Params): _zod.ZodUUID;
|
|
1127
|
+
uuidv6(params?: string | _zod.core.$ZodUUIDv6Params): _zod.ZodUUID;
|
|
1128
|
+
uuidv7(params?: string | _zod.core.$ZodUUIDv7Params): _zod.ZodUUID;
|
|
1129
|
+
url(params?: string | _zod.core.$ZodURLParams): _zod.ZodURL;
|
|
1130
|
+
httpUrl(params?: string | Omit<_zod.core.$ZodURLParams, "protocol" | "hostname">): _zod.ZodURL;
|
|
1131
|
+
emoji(params?: string | _zod.core.$ZodEmojiParams): _zod.ZodEmoji;
|
|
1132
|
+
nanoid(params?: string | _zod.core.$ZodNanoIDParams): _zod.ZodNanoID;
|
|
1133
|
+
cuid(params?: string | _zod.core.$ZodCUIDParams): _zod.ZodCUID;
|
|
1134
|
+
cuid2(params?: string | _zod.core.$ZodCUID2Params): _zod.ZodCUID2;
|
|
1135
|
+
ulid(params?: string | _zod.core.$ZodULIDParams): _zod.ZodULID;
|
|
1136
|
+
xid(params?: string | _zod.core.$ZodXIDParams): _zod.ZodXID;
|
|
1137
|
+
ksuid(params?: string | _zod.core.$ZodKSUIDParams): _zod.ZodKSUID;
|
|
1138
|
+
ipv4(params?: string | _zod.core.$ZodIPv4Params): _zod.ZodIPv4;
|
|
1139
|
+
ipv6(params?: string | _zod.core.$ZodIPv6Params): _zod.ZodIPv6;
|
|
1140
|
+
cidrv4(params?: string | _zod.core.$ZodCIDRv4Params): _zod.ZodCIDRv4;
|
|
1141
|
+
cidrv6(params?: string | _zod.core.$ZodCIDRv6Params): _zod.ZodCIDRv6;
|
|
1142
|
+
base64(params?: string | _zod.core.$ZodBase64Params): _zod.ZodBase64;
|
|
1143
|
+
base64url(params?: string | _zod.core.$ZodBase64URLParams): _zod.ZodBase64URL;
|
|
1144
|
+
e164(params?: string | _zod.core.$ZodE164Params): _zod.ZodE164;
|
|
1145
|
+
jwt(params?: string | _zod.core.$ZodJWTParams): _zod.ZodJWT;
|
|
1146
|
+
stringFormat<Format extends string>(format: Format, fnOrRegex: ((arg: string) => _zod.core.util.MaybeAsync<unknown>) | RegExp, _params?: string | _zod.core.$ZodStringFormatParams): _zod.ZodCustomStringFormat<Format>;
|
|
1147
|
+
hostname(_params?: string | _zod.core.$ZodStringFormatParams): _zod.ZodCustomStringFormat<"hostname">;
|
|
1148
|
+
hex(_params?: string | _zod.core.$ZodStringFormatParams): _zod.ZodCustomStringFormat<"hex">;
|
|
1149
|
+
hash<Alg extends _zod.core.util.HashAlgorithm, Enc extends _zod.core.util.HashEncoding = "hex">(alg: Alg, params?: {
|
|
1150
|
+
enc?: Enc;
|
|
1151
|
+
} & _zod.core.$ZodStringFormatParams): _zod.ZodCustomStringFormat<`${Alg}_${Enc}`>;
|
|
1152
|
+
number(params?: string | _zod.core.$ZodNumberParams): _zod.ZodNumber;
|
|
1153
|
+
int(params?: string | _zod.core.$ZodCheckNumberFormatParams): _zod.ZodInt;
|
|
1154
|
+
float32(params?: string | _zod.core.$ZodCheckNumberFormatParams): _zod.ZodFloat32;
|
|
1155
|
+
float64(params?: string | _zod.core.$ZodCheckNumberFormatParams): _zod.ZodFloat64;
|
|
1156
|
+
int32(params?: string | _zod.core.$ZodCheckNumberFormatParams): _zod.ZodInt32;
|
|
1157
|
+
uint32(params?: string | _zod.core.$ZodCheckNumberFormatParams): _zod.ZodUInt32;
|
|
1158
|
+
boolean(params?: string | _zod.core.$ZodBooleanParams): _zod.ZodBoolean;
|
|
1159
|
+
bigint(params?: string | _zod.core.$ZodBigIntParams): _zod.ZodBigInt;
|
|
1160
|
+
int64(params?: string | _zod.core.$ZodBigIntFormatParams): _zod.ZodBigIntFormat;
|
|
1161
|
+
uint64(params?: string | _zod.core.$ZodBigIntFormatParams): _zod.ZodBigIntFormat;
|
|
1162
|
+
symbol(params?: string | _zod.core.$ZodSymbolParams): _zod.ZodSymbol;
|
|
1163
|
+
any(): _zod.ZodAny;
|
|
1164
|
+
unknown(): _zod.ZodUnknown;
|
|
1165
|
+
never(params?: string | _zod.core.$ZodNeverParams): _zod.ZodNever;
|
|
1166
|
+
date(params?: string | _zod.core.$ZodDateParams): _zod.ZodDate;
|
|
1167
|
+
array<T extends _zod.core.SomeType>(element: T, params?: string | _zod.core.$ZodArrayParams): _zod.ZodArray<T>;
|
|
1168
|
+
keyof<T extends _zod.ZodObject>(schema: T): _zod.ZodEnum<_zod.core.util.KeysEnum<T["_zod"]["output"]>>;
|
|
1169
|
+
object<T extends _zod.core.$ZodLooseShape = Partial<Record<never, _zod.core.SomeType>>>(shape?: T, params?: string | _zod.core.$ZodObjectParams): _zod.ZodObject<_zod.core.util.Writeable<T>, _zod.core.$strip>;
|
|
1170
|
+
strictObject<T extends _zod.core.$ZodLooseShape>(shape: T, params?: string | _zod.core.$ZodObjectParams): _zod.ZodObject<T, _zod.core.$strict>;
|
|
1171
|
+
looseObject<T extends _zod.core.$ZodLooseShape>(shape: T, params?: string | _zod.core.$ZodObjectParams): _zod.ZodObject<T, _zod.core.$loose>;
|
|
1172
|
+
union<const T extends readonly _zod.core.SomeType[]>(options: T, params?: string | _zod.core.$ZodUnionParams): _zod.ZodUnion<T>;
|
|
1173
|
+
discriminatedUnion<Types extends readonly [_zod.core.$ZodTypeDiscriminable, ..._zod.core.$ZodTypeDiscriminable[]], Disc extends string>(discriminator: Disc, options: Types, params?: string | _zod.core.$ZodDiscriminatedUnionParams): _zod.ZodDiscriminatedUnion<Types, Disc>;
|
|
1174
|
+
intersection<T extends _zod.core.SomeType, U extends _zod.core.SomeType>(left: T, right: U): _zod.ZodIntersection<T, U>;
|
|
1175
|
+
tuple<T extends readonly [_zod.core.SomeType, ..._zod.core.SomeType[]]>(items: T, params?: string | _zod.core.$ZodTupleParams): _zod.ZodTuple<T, null>;
|
|
1176
|
+
tuple<T extends readonly [_zod.core.SomeType, ..._zod.core.SomeType[]], Rest extends _zod.core.SomeType>(items: T, rest: Rest, params?: string | _zod.core.$ZodTupleParams): _zod.ZodTuple<T, Rest>;
|
|
1177
|
+
tuple(items: [], params?: string | _zod.core.$ZodTupleParams): _zod.ZodTuple<[], null>;
|
|
1178
|
+
record<Key extends _zod.core.$ZodRecordKey, Value extends _zod.core.SomeType>(keyType: Key, valueType: Value, params?: string | _zod.core.$ZodRecordParams): _zod.ZodRecord<Key, Value>;
|
|
1179
|
+
partialRecord<Key extends _zod.core.$ZodRecordKey, Value extends _zod.core.SomeType>(keyType: Key, valueType: Value, params?: string | _zod.core.$ZodRecordParams): _zod.ZodRecord<Key & _zod.core.$partial, Value>;
|
|
1180
|
+
map<Key extends _zod.core.SomeType, Value extends _zod.core.SomeType>(keyType: Key, valueType: Value, params?: string | _zod.core.$ZodMapParams): _zod.ZodMap<Key, Value>;
|
|
1181
|
+
set<Value extends _zod.core.SomeType>(valueType: Value, params?: string | _zod.core.$ZodSetParams): _zod.ZodSet<Value>;
|
|
1182
|
+
nativeEnum<T extends _zod.core.util.EnumLike>(entries: T, params?: string | _zod.core.$ZodEnumParams): _zod.ZodEnum<T>;
|
|
1183
|
+
literal<const T extends ReadonlyArray<_zod.core.util.Literal>>(value: T, params?: string | _zod.core.$ZodLiteralParams): _zod.ZodLiteral<T[number]>;
|
|
1184
|
+
literal<const T extends _zod.core.util.Literal>(value: T, params?: string | _zod.core.$ZodLiteralParams): _zod.ZodLiteral<T>;
|
|
1185
|
+
transform<I = unknown, O = I>(fn: (input: I, ctx: _zod.core.ParsePayload) => O): _zod.ZodTransform<Awaited<O>, I>;
|
|
1186
|
+
optional<T extends _zod.core.SomeType>(innerType: T): _zod.ZodOptional<T>;
|
|
1187
|
+
nullable<T extends _zod.core.SomeType>(innerType: T): _zod.ZodNullable<T>;
|
|
1188
|
+
nullish<T extends _zod.core.SomeType>(innerType: T): _zod.ZodOptional<_zod.ZodNullable<T>>;
|
|
1189
|
+
_default<T extends _zod.core.SomeType>(innerType: T, defaultValue: _zod.core.util.NoUndefined<_zod.core.output<T>> | (() => _zod.core.util.NoUndefined<_zod.core.output<T>>)): _zod.ZodDefault<T>;
|
|
1190
|
+
prefault<T extends _zod.core.SomeType>(innerType: T, defaultValue: _zod.core.input<T> | (() => _zod.core.input<T>)): _zod.ZodPrefault<T>;
|
|
1191
|
+
nonoptional<T extends _zod.core.SomeType>(innerType: T, params?: string | _zod.core.$ZodNonOptionalParams): _zod.ZodNonOptional<T>;
|
|
1192
|
+
success<T extends _zod.core.SomeType>(innerType: T): _zod.ZodSuccess<T>;
|
|
1193
|
+
nan(params?: string | _zod.core.$ZodNaNParams): _zod.ZodNaN;
|
|
1194
|
+
pipe<const A extends _zod.core.SomeType, B extends _zod.core.$ZodType<unknown, _zod.core.output<A>> = _zod.core.$ZodType<unknown, _zod.core.output<A>, _zod.core.$ZodTypeInternals<unknown, _zod.core.output<A>>>>(in_: A, out: B | _zod.core.$ZodType<unknown, _zod.core.output<A>>): _zod.ZodPipe<A, B>;
|
|
1195
|
+
codec<const A extends _zod.core.SomeType, B extends _zod.core.SomeType = _zod.core.$ZodType<unknown, unknown, _zod.core.$ZodTypeInternals<unknown, unknown>>>(in_: A, out: B, params: {
|
|
1196
|
+
decode: (value: _zod.core.output<A>, payload: _zod.core.ParsePayload<_zod.core.output<A>>) => _zod.core.util.MaybeAsync<_zod.core.input<B>>;
|
|
1197
|
+
encode: (value: _zod.core.input<B>, payload: _zod.core.ParsePayload<_zod.core.input<B>>) => _zod.core.util.MaybeAsync<_zod.core.output<A>>;
|
|
1198
|
+
}): _zod.ZodCodec<A, B>;
|
|
1199
|
+
readonly<T extends _zod.core.SomeType>(innerType: T): _zod.ZodReadonly<T>;
|
|
1200
|
+
templateLiteral<const Parts extends _zod.core.$ZodTemplateLiteralPart[]>(parts: Parts, params?: string | _zod.core.$ZodTemplateLiteralParams): _zod.ZodTemplateLiteral<_zod.core.$PartsToTemplateLiteral<Parts>>;
|
|
1201
|
+
lazy<T extends _zod.core.SomeType>(getter: () => T): _zod.ZodLazy<T>;
|
|
1202
|
+
promise<T extends _zod.core.SomeType>(innerType: T): _zod.ZodPromise<T>;
|
|
1203
|
+
_function(): _zod.ZodFunction;
|
|
1204
|
+
_function<const In extends ReadonlyArray<_zod.core.$ZodType>>(params: {
|
|
1205
|
+
input: In;
|
|
1206
|
+
}): _zod.ZodFunction<_zod.ZodTuple<In, null>, _zod.core.$ZodFunctionOut>;
|
|
1207
|
+
_function<const In extends ReadonlyArray<_zod.core.$ZodType>, const Out extends _zod.core.$ZodFunctionOut = _zod.core.$ZodFunctionOut>(params: {
|
|
1208
|
+
input: In;
|
|
1209
|
+
output: Out;
|
|
1210
|
+
}): _zod.ZodFunction<_zod.ZodTuple<In, null>, Out>;
|
|
1211
|
+
_function<const In extends _zod.core.$ZodFunctionIn = _zod.core.$ZodFunctionArgs>(params: {
|
|
1212
|
+
input: In;
|
|
1213
|
+
}): _zod.ZodFunction<In, _zod.core.$ZodFunctionOut>;
|
|
1214
|
+
_function<const Out extends _zod.core.$ZodFunctionOut = _zod.core.$ZodFunctionOut>(params: {
|
|
1215
|
+
output: Out;
|
|
1216
|
+
}): _zod.ZodFunction<_zod.core.$ZodFunctionIn, Out>;
|
|
1217
|
+
_function<In extends _zod.core.$ZodFunctionIn = _zod.core.$ZodFunctionArgs, Out extends _zod.core.$ZodType = _zod.core.$ZodType<unknown, unknown, _zod.core.$ZodTypeInternals<unknown, unknown>>>(params?: {
|
|
1218
|
+
input: In;
|
|
1219
|
+
output: Out;
|
|
1220
|
+
}): _zod.ZodFunction<In, Out>;
|
|
1221
|
+
check<O = unknown>(fn: _zod.core.CheckFn<O>): _zod.core.$ZodCheck<O>;
|
|
1222
|
+
custom<O>(fn?: (data: unknown) => unknown, _params?: string | _zod.core.$ZodCustomParams | undefined): _zod.ZodCustom<O, O>;
|
|
1223
|
+
refine<T>(fn: (arg: NoInfer<T>) => _zod.core.util.MaybeAsync<unknown>, _params?: string | _zod.core.$ZodCustomParams): _zod.core.$ZodCheck<T>;
|
|
1224
|
+
superRefine<T>(fn: (arg: T, payload: _zod.core.$RefinementCtx<T>) => void | Promise<void>): _zod.core.$ZodCheck<T>;
|
|
1225
|
+
json(params?: string | _zod.core.$ZodCustomParams): _zod.ZodJSONSchema;
|
|
1226
|
+
preprocess<A, U extends _zod.core.SomeType, B = unknown>(fn: (arg: B, ctx: _zod.core.$RefinementCtx) => A, schema: U): _zod.ZodPipe<_zod.ZodTransform<A, B>, U>;
|
|
1227
|
+
ZodType: _zod.core.$constructor<_zod.ZodType>;
|
|
1228
|
+
_ZodString: _zod.core.$constructor<_zod._ZodString>;
|
|
1229
|
+
ZodString: _zod.core.$constructor<_zod.ZodString>;
|
|
1230
|
+
ZodStringFormat: _zod.core.$constructor<_zod.ZodStringFormat>;
|
|
1231
|
+
ZodEmail: _zod.core.$constructor<_zod.ZodEmail>;
|
|
1232
|
+
ZodGUID: _zod.core.$constructor<_zod.ZodGUID>;
|
|
1233
|
+
ZodUUID: _zod.core.$constructor<_zod.ZodUUID>;
|
|
1234
|
+
ZodURL: _zod.core.$constructor<_zod.ZodURL>;
|
|
1235
|
+
ZodEmoji: _zod.core.$constructor<_zod.ZodEmoji>;
|
|
1236
|
+
ZodNanoID: _zod.core.$constructor<_zod.ZodNanoID>;
|
|
1237
|
+
ZodCUID: _zod.core.$constructor<_zod.ZodCUID>;
|
|
1238
|
+
ZodCUID2: _zod.core.$constructor<_zod.ZodCUID2>;
|
|
1239
|
+
ZodULID: _zod.core.$constructor<_zod.ZodULID>;
|
|
1240
|
+
ZodXID: _zod.core.$constructor<_zod.ZodXID>;
|
|
1241
|
+
ZodKSUID: _zod.core.$constructor<_zod.ZodKSUID>;
|
|
1242
|
+
ZodIPv4: _zod.core.$constructor<_zod.ZodIPv4>;
|
|
1243
|
+
ZodIPv6: _zod.core.$constructor<_zod.ZodIPv6>;
|
|
1244
|
+
ZodCIDRv4: _zod.core.$constructor<_zod.ZodCIDRv4>;
|
|
1245
|
+
ZodCIDRv6: _zod.core.$constructor<_zod.ZodCIDRv6>;
|
|
1246
|
+
ZodBase64: _zod.core.$constructor<_zod.ZodBase64>;
|
|
1247
|
+
ZodBase64URL: _zod.core.$constructor<_zod.ZodBase64URL>;
|
|
1248
|
+
ZodE164: _zod.core.$constructor<_zod.ZodE164>;
|
|
1249
|
+
ZodJWT: _zod.core.$constructor<_zod.ZodJWT>;
|
|
1250
|
+
ZodCustomStringFormat: _zod.core.$constructor<_zod.ZodCustomStringFormat>;
|
|
1251
|
+
ZodNumber: _zod.core.$constructor<_zod.ZodNumber>;
|
|
1252
|
+
ZodNumberFormat: _zod.core.$constructor<_zod.ZodNumberFormat>;
|
|
1253
|
+
ZodBoolean: _zod.core.$constructor<_zod.ZodBoolean>;
|
|
1254
|
+
ZodBigInt: _zod.core.$constructor<_zod.ZodBigInt>;
|
|
1255
|
+
ZodBigIntFormat: _zod.core.$constructor<_zod.ZodBigIntFormat>;
|
|
1256
|
+
ZodSymbol: _zod.core.$constructor<_zod.ZodSymbol>;
|
|
1257
|
+
ZodUndefined: _zod.core.$constructor<_zod.ZodUndefined>;
|
|
1258
|
+
undefined: typeof _zod.undefined;
|
|
1259
|
+
ZodNull: _zod.core.$constructor<_zod.ZodNull>;
|
|
1260
|
+
null: typeof _zod.null;
|
|
1261
|
+
ZodAny: _zod.core.$constructor<_zod.ZodAny>;
|
|
1262
|
+
ZodUnknown: _zod.core.$constructor<_zod.ZodUnknown>;
|
|
1263
|
+
ZodNever: _zod.core.$constructor<_zod.ZodNever>;
|
|
1264
|
+
ZodVoid: _zod.core.$constructor<_zod.ZodVoid>;
|
|
1265
|
+
void: typeof _zod.void;
|
|
1266
|
+
ZodDate: _zod.core.$constructor<_zod.ZodDate>;
|
|
1267
|
+
ZodArray: _zod.core.$constructor<_zod.ZodArray>;
|
|
1268
|
+
ZodObject: _zod.core.$constructor<_zod.ZodObject>;
|
|
1269
|
+
ZodUnion: _zod.core.$constructor<_zod.ZodUnion>;
|
|
1270
|
+
ZodDiscriminatedUnion: _zod.core.$constructor<_zod.ZodDiscriminatedUnion>;
|
|
1271
|
+
ZodIntersection: _zod.core.$constructor<_zod.ZodIntersection>;
|
|
1272
|
+
ZodTuple: _zod.core.$constructor<_zod.ZodTuple>;
|
|
1273
|
+
ZodRecord: _zod.core.$constructor<_zod.ZodRecord>;
|
|
1274
|
+
ZodMap: _zod.core.$constructor<_zod.ZodMap>;
|
|
1275
|
+
ZodSet: _zod.core.$constructor<_zod.ZodSet>;
|
|
1276
|
+
ZodEnum: _zod.core.$constructor<_zod.ZodEnum>;
|
|
1277
|
+
enum: typeof _zod.enum;
|
|
1278
|
+
ZodLiteral: _zod.core.$constructor<_zod.ZodLiteral>;
|
|
1279
|
+
ZodFile: _zod.core.$constructor<_zod.ZodFile>;
|
|
1280
|
+
ZodTransform: _zod.core.$constructor<_zod.ZodTransform>;
|
|
1281
|
+
ZodOptional: _zod.core.$constructor<_zod.ZodOptional>;
|
|
1282
|
+
ZodNullable: _zod.core.$constructor<_zod.ZodNullable>;
|
|
1283
|
+
ZodDefault: _zod.core.$constructor<_zod.ZodDefault>;
|
|
1284
|
+
ZodPrefault: _zod.core.$constructor<_zod.ZodPrefault>;
|
|
1285
|
+
ZodNonOptional: _zod.core.$constructor<_zod.ZodNonOptional>;
|
|
1286
|
+
ZodSuccess: _zod.core.$constructor<_zod.ZodSuccess>;
|
|
1287
|
+
ZodCatch: _zod.core.$constructor<_zod.ZodCatch>;
|
|
1288
|
+
catch: typeof _zod.catch;
|
|
1289
|
+
ZodNaN: _zod.core.$constructor<_zod.ZodNaN>;
|
|
1290
|
+
ZodPipe: _zod.core.$constructor<_zod.ZodPipe>;
|
|
1291
|
+
ZodCodec: _zod.core.$constructor<_zod.ZodCodec>;
|
|
1292
|
+
ZodReadonly: _zod.core.$constructor<_zod.ZodReadonly>;
|
|
1293
|
+
ZodTemplateLiteral: _zod.core.$constructor<_zod.ZodTemplateLiteral>;
|
|
1294
|
+
ZodLazy: _zod.core.$constructor<_zod.ZodLazy>;
|
|
1295
|
+
ZodPromise: _zod.core.$constructor<_zod.ZodPromise>;
|
|
1296
|
+
ZodFunction: _zod.core.$constructor<_zod.ZodFunction>;
|
|
1297
|
+
function: typeof _zod._function;
|
|
1298
|
+
ZodCustom: _zod.core.$constructor<_zod.ZodCustom>;
|
|
1299
|
+
instanceof: typeof _zod.instanceof;
|
|
1300
|
+
stringbool: (_params?: string | _zod.core.$ZodStringBoolParams) => _zod.ZodCodec<_zod.ZodString, _zod.ZodBoolean>;
|
|
1301
|
+
lt: typeof _zod.core._lt;
|
|
1302
|
+
lte: typeof _zod.core._lte;
|
|
1303
|
+
gt: typeof _zod.core._gt;
|
|
1304
|
+
gte: typeof _zod.core._gte;
|
|
1305
|
+
positive: typeof _zod.core._positive;
|
|
1306
|
+
negative: typeof _zod.core._negative;
|
|
1307
|
+
nonpositive: typeof _zod.core._nonpositive;
|
|
1308
|
+
nonnegative: typeof _zod.core._nonnegative;
|
|
1309
|
+
multipleOf: typeof _zod.core._multipleOf;
|
|
1310
|
+
maxSize: typeof _zod.core._maxSize;
|
|
1311
|
+
minSize: typeof _zod.core._minSize;
|
|
1312
|
+
size: typeof _zod.core._size;
|
|
1313
|
+
maxLength: typeof _zod.core._maxLength;
|
|
1314
|
+
minLength: typeof _zod.core._minLength;
|
|
1315
|
+
length: typeof _zod.core._length;
|
|
1316
|
+
regex: typeof _zod.core._regex;
|
|
1317
|
+
lowercase: typeof _zod.core._lowercase;
|
|
1318
|
+
uppercase: typeof _zod.core._uppercase;
|
|
1319
|
+
includes: typeof _zod.core._includes;
|
|
1320
|
+
startsWith: typeof _zod.core._startsWith;
|
|
1321
|
+
endsWith: typeof _zod.core._endsWith;
|
|
1322
|
+
property: typeof _zod.core._property;
|
|
1323
|
+
mime: typeof _zod.core._mime;
|
|
1324
|
+
overwrite: typeof _zod.core._overwrite;
|
|
1325
|
+
normalize: typeof _zod.core._normalize;
|
|
1326
|
+
trim: typeof _zod.core._trim;
|
|
1327
|
+
toLowerCase: typeof _zod.core._toLowerCase;
|
|
1328
|
+
toUpperCase: typeof _zod.core._toUpperCase;
|
|
1329
|
+
ZodError: _zod.core.$constructor<ZodError>;
|
|
1330
|
+
ZodRealError: _zod.core.$constructor<ZodError>;
|
|
1331
|
+
parse: <T extends _zod.core.$ZodType>(schema: T, value: unknown, _ctx?: _zod.core.ParseContext<_zod.core.$ZodIssue>, _params?: {
|
|
1332
|
+
callee?: _zod.core.util.AnyFunc;
|
|
1333
|
+
Err?: _zod.core.$ZodErrorClass;
|
|
1334
|
+
}) => _zod.core.output<T>;
|
|
1335
|
+
parseAsync: <T extends _zod.core.$ZodType>(schema: T, value: unknown, _ctx?: _zod.core.ParseContext<_zod.core.$ZodIssue>, _params?: {
|
|
1336
|
+
callee?: _zod.core.util.AnyFunc;
|
|
1337
|
+
Err?: _zod.core.$ZodErrorClass;
|
|
1338
|
+
}) => Promise<_zod.core.output<T>>;
|
|
1339
|
+
safeParse: <T extends _zod.core.$ZodType>(schema: T, value: unknown, _ctx?: _zod.core.ParseContext<_zod.core.$ZodIssue>) => _zod.ZodSafeParseResult<_zod.core.output<T>>;
|
|
1340
|
+
safeParseAsync: <T extends _zod.core.$ZodType>(schema: T, value: unknown, _ctx?: _zod.core.ParseContext<_zod.core.$ZodIssue>) => Promise<_zod.ZodSafeParseResult<_zod.core.output<T>>>;
|
|
1341
|
+
encode: <T extends _zod.core.$ZodType>(schema: T, value: _zod.core.output<T>, _ctx?: _zod.core.ParseContext<_zod.core.$ZodIssue>) => _zod.core.input<T>;
|
|
1342
|
+
decode: <T extends _zod.core.$ZodType>(schema: T, value: _zod.core.input<T>, _ctx?: _zod.core.ParseContext<_zod.core.$ZodIssue>) => _zod.core.output<T>;
|
|
1343
|
+
encodeAsync: <T extends _zod.core.$ZodType>(schema: T, value: _zod.core.output<T>, _ctx? /**
|
|
1344
|
+
* Unique identifier for this prompt version.
|
|
1345
|
+
*/: _zod.core.ParseContext<_zod.core.$ZodIssue>) => Promise<_zod.core.input<T>>;
|
|
1346
|
+
decodeAsync: <T extends _zod.core.$ZodType>(schema: T, value: _zod.core.input<T>, _ctx?: _zod.core.ParseContext<_zod.core.$ZodIssue>) => Promise<_zod.core.output<T>>;
|
|
1347
|
+
safeEncode: <T extends _zod.core.$ZodType>(schema: T, value: _zod.core.output<T>, _ctx? /**
|
|
1348
|
+
* Variables available in this prompt version.
|
|
1349
|
+
*/: _zod.core.ParseContext<_zod.core.$ZodIssue>) => _zod.ZodSafeParseResult<_zod.core.input<T>>;
|
|
1350
|
+
safeDecode: <T extends _zod.core.$ZodType>(schema: T, value: _zod.core.input<T>, _ctx? /**
|
|
1351
|
+
* Configuration settings for this prompt version.
|
|
1352
|
+
*/: _zod.core.ParseContext<_zod.core.$ZodIssue>) => _zod.ZodSafeParseResult<_zod.core.output<T>>;
|
|
1353
|
+
safeEncodeAsync: <T extends _zod.core.$ZodType>(schema: T, value: _zod.core.output<T>, _ctx?: _zod.core.ParseContext<_zod.core.$ZodIssue>) => Promise<_zod.ZodSafeParseResult<_zod.core.input<T>>>;
|
|
1354
|
+
safeDecodeAsync: <T extends _zod.core.$ZodType>(schema: T, value: _zod.core.input<T>, _ctx?: _zod.core.ParseContext<_zod.core.$ZodIssue>) => Promise<_zod.ZodSafeParseResult<_zod.core.output<T>>>;
|
|
1355
|
+
setErrorMap(map: _zod.core.$ZodErrorMap): void;
|
|
1356
|
+
getErrorMap(): _zod.core.$ZodErrorMap<_zod.core.$ZodIssue> | undefined;
|
|
1357
|
+
ZodIssueCode: {
|
|
1358
|
+
readonly invalid_type: "invalid_type";
|
|
1359
|
+
readonly too_big: "too_big";
|
|
1360
|
+
readonly too_small: "too_small";
|
|
1361
|
+
readonly invalid_format: "invalid_format";
|
|
1362
|
+
readonly not_multiple_of: "not_multiple_of";
|
|
1363
|
+
readonly unrecognized_keys: "unrecognized_keys";
|
|
1364
|
+
readonly invalid_union: "invalid_union";
|
|
1365
|
+
readonly invalid_key: "invalid_key";
|
|
1366
|
+
readonly invalid_element: "invalid_element";
|
|
1367
|
+
readonly invalid_value: "invalid_value";
|
|
1368
|
+
readonly custom: "custom";
|
|
1369
|
+
};
|
|
1370
|
+
ZodFirstPartyTypeKind: typeof _zod.ZodFirstPartyTypeKind;
|
|
800
1371
|
};
|
|
801
1372
|
type SchemaBuilder = typeof zod;
|
|
802
1373
|
type SchemaFunction<T> = (schema: SchemaBuilder) => T;
|
|
803
|
-
type Output<T> = T extends z
|
|
804
|
-
type ZodTypeOrRecord = z
|
|
1374
|
+
type Output<T> = T extends z.ZodType ? z.infer<T> : T;
|
|
1375
|
+
type ZodTypeOrRecord = z.ZodType | Record<string, unknown>;
|
|
805
1376
|
type CanvasExecutionPromiseLike<TParams extends ExecutionParams = SyncExecutionParams, TInput = unknown, TOutput = unknown> = PromiseLike<CanvasExecution<TParams, TInput, TOutput>> & {
|
|
806
1377
|
result: Promise<CanvasExecutionResult<TParams, TOutput>>;
|
|
807
1378
|
};
|
|
@@ -916,11 +1487,50 @@ declare class Canvas<TInput extends ZodTypeOrRecord, TOutput extends ZodTypeOrRe
|
|
|
916
1487
|
* ).result) {
|
|
917
1488
|
* console.log(chunk);
|
|
918
1489
|
* }
|
|
1490
|
+
*
|
|
1491
|
+
* // Execution with tags
|
|
1492
|
+
* const result = await canvas.execute(
|
|
1493
|
+
* { query: "Hello" },
|
|
1494
|
+
* { tags: ["production", "analytics"] }
|
|
1495
|
+
* ).result;
|
|
919
1496
|
* ```
|
|
920
1497
|
*/
|
|
921
|
-
execute(variables: z
|
|
922
|
-
execute(variables: z
|
|
923
|
-
execute(variables: z
|
|
1498
|
+
execute(variables: z.input<TInput>, params?: SyncExecutionParams): CanvasExecutionPromiseLike<SyncExecutionParams, Output<TInput>, Output<TOutput>>;
|
|
1499
|
+
execute(variables: z.input<TInput>, params?: AsyncExecutionParams): CanvasExecutionPromiseLike<AsyncExecutionParams, Output<TInput>, Output<TOutput>>;
|
|
1500
|
+
execute(variables: z.input<TInput>, params?: StreamExecutionParams): CanvasExecutionPromiseLike<StreamExecutionParams, Output<TInput>, Output<TOutput>>;
|
|
1501
|
+
/**
|
|
1502
|
+
* Fetches an existing async execution by its ID.
|
|
1503
|
+
*
|
|
1504
|
+
* This method retrieves the current state of an async execution that was previously
|
|
1505
|
+
* started on this canvas. Only async executions can be fetched, as they are the only
|
|
1506
|
+
* ones with persistent UUIDs on the server.
|
|
1507
|
+
*
|
|
1508
|
+
* @param id - The UUID of the async execution to fetch.
|
|
1509
|
+
* @param options - Optional configuration for polling behavior.
|
|
1510
|
+
* @param options.pollingInterval - Time in milliseconds between polling attempts (default: 1000).
|
|
1511
|
+
* @param options.pollingTimeout - Maximum time in milliseconds to wait for completion (default: 60000).
|
|
1512
|
+
* @throws {InvalidExecutionModeError} If the provided ID is not a valid UUID.
|
|
1513
|
+
* @returns A promise resolving to a CanvasExecution instance with the fetched state.
|
|
1514
|
+
*
|
|
1515
|
+
* @example
|
|
1516
|
+
* ```typescript
|
|
1517
|
+
* // Start an async execution
|
|
1518
|
+
* const execution = await canvas.execute({ query: 'test' }, { async: true })
|
|
1519
|
+
* const executionId = execution.id
|
|
1520
|
+
*
|
|
1521
|
+
* // Later, fetch the execution by ID
|
|
1522
|
+
* const fetched = await canvas.getExecution(executionId)
|
|
1523
|
+
* console.log(fetched.status) // 'running', 'succeeded', or 'failed'
|
|
1524
|
+
*
|
|
1525
|
+
* // Use poll() for event-driven progress tracking
|
|
1526
|
+
* fetched.on('statusChange', (status) => console.log('Status:', status))
|
|
1527
|
+
* fetched.poll()
|
|
1528
|
+
* ```
|
|
1529
|
+
*/
|
|
1530
|
+
getExecution(id: string, options?: {
|
|
1531
|
+
pollingInterval?: number;
|
|
1532
|
+
pollingTimeout?: number;
|
|
1533
|
+
}): Promise<CanvasExecution<AsyncExecutionParams, unknown, Output<TOutput>>>;
|
|
924
1534
|
}
|
|
925
1535
|
|
|
926
1536
|
/**
|
|
@@ -990,20 +1600,22 @@ declare class TelaSDK extends BaseClient {
|
|
|
990
1600
|
createFile: typeof TelaFile.create;
|
|
991
1601
|
/**
|
|
992
1602
|
* Retrieves a canvas by its ID, version ID, or application ID.
|
|
993
|
-
* Validates input and output schemas if
|
|
1603
|
+
* Validates input and output schemas if provided via schema builder functions.
|
|
994
1604
|
*
|
|
995
1605
|
* @param options - Options for retrieving the canvas.
|
|
996
1606
|
* @returns A promise resolving to a Canvas instance.
|
|
997
1607
|
*
|
|
998
1608
|
* @example
|
|
999
1609
|
* ```typescript
|
|
1000
|
-
* import { z } from 'zod';
|
|
1001
|
-
*
|
|
1002
1610
|
* // Get canvas by ID with schemas
|
|
1003
1611
|
* const canvas = await tela.canvas.get({
|
|
1004
1612
|
* id: 'canvas-id',
|
|
1005
|
-
* input:
|
|
1006
|
-
*
|
|
1613
|
+
* input: schema => schema.object({
|
|
1614
|
+
* query: schema.string()
|
|
1615
|
+
* }),
|
|
1616
|
+
* output: schema => schema.object({
|
|
1617
|
+
* response: schema.string()
|
|
1618
|
+
* })
|
|
1007
1619
|
* });
|
|
1008
1620
|
*
|
|
1009
1621
|
* // Get canvas by application ID
|
|
@@ -1017,7 +1629,7 @@ declare class TelaSDK extends BaseClient {
|
|
|
1017
1629
|
* ```
|
|
1018
1630
|
*/
|
|
1019
1631
|
canvas: {
|
|
1020
|
-
get: <TInput extends z
|
|
1632
|
+
get: <TInput extends z.ZodType | Record<string, unknown> = Record<string, unknown>, TOutput extends z.ZodType | Record<string, unknown> = Record<string, unknown>>(options: CanvasGetOptions<TInput, TOutput>) => Promise<Canvas<TInput, TOutput>>;
|
|
1021
1633
|
};
|
|
1022
1634
|
static TelaSDK: typeof TelaSDK;
|
|
1023
1635
|
static DEFAULT_TIMEOUT: number;
|