@teamkeel/functions-runtime 0.423.1 → 0.423.3
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/dist/index.cjs +23 -0
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +41 -16
- package/dist/index.d.ts +41 -16
- package/dist/index.js +23 -0
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.d.cts
CHANGED
|
@@ -279,54 +279,77 @@ declare class Duration {
|
|
|
279
279
|
toPostgres(): string;
|
|
280
280
|
}
|
|
281
281
|
|
|
282
|
-
type ElementDataType$
|
|
283
|
-
type UiElementSelectOne = <const TValue extends ElementDataType$
|
|
282
|
+
type ElementDataType$4 = string | number | boolean | Date;
|
|
283
|
+
type UiElementSelectOne = <const TValue extends ElementDataType$4, N extends string, O extends boolean = false>(name: N, options?: BaseInputConfig<TValue, O> & {
|
|
284
284
|
options: ({
|
|
285
285
|
label: string;
|
|
286
286
|
value: TValue;
|
|
287
287
|
} | TValue)[];
|
|
288
288
|
}) => InputElementResponse<N, O extends true ? TValue | undefined : TValue>;
|
|
289
|
-
interface UiElementSelectOneApiResponse extends BaseUiInputResponse<"ui.select.one", ElementDataType$
|
|
289
|
+
interface UiElementSelectOneApiResponse extends BaseUiInputResponse<"ui.select.one", ElementDataType$4> {
|
|
290
290
|
options: ({
|
|
291
291
|
label: string;
|
|
292
|
-
value: ElementDataType$
|
|
293
|
-
} | ElementDataType$
|
|
292
|
+
value: ElementDataType$4;
|
|
293
|
+
} | ElementDataType$4)[];
|
|
294
294
|
}
|
|
295
295
|
|
|
296
|
-
type ElementDataType$
|
|
297
|
-
type UiElementInputText = InputElement<ElementDataType$
|
|
296
|
+
type ElementDataType$3 = string;
|
|
297
|
+
type UiElementInputText = InputElement<ElementDataType$3, {
|
|
298
298
|
placeholder?: string;
|
|
299
299
|
multiline?: boolean;
|
|
300
300
|
maxLength?: number;
|
|
301
301
|
minLength?: number;
|
|
302
302
|
}>;
|
|
303
|
-
interface UiElementInputTextApiResponse extends BaseUiInputResponse<"ui.input.text", ElementDataType$
|
|
303
|
+
interface UiElementInputTextApiResponse extends BaseUiInputResponse<"ui.input.text", ElementDataType$3> {
|
|
304
304
|
placeholder?: string;
|
|
305
305
|
multiline?: boolean;
|
|
306
306
|
maxLength?: number;
|
|
307
307
|
minLength?: number;
|
|
308
308
|
}
|
|
309
309
|
|
|
310
|
-
type ElementDataType$
|
|
311
|
-
type UiElementInputNumber = InputElement<ElementDataType$
|
|
310
|
+
type ElementDataType$2 = number;
|
|
311
|
+
type UiElementInputNumber = InputElement<ElementDataType$2, {
|
|
312
312
|
placeholder?: string;
|
|
313
313
|
min?: number;
|
|
314
314
|
max?: number;
|
|
315
315
|
}>;
|
|
316
|
-
interface UiElementInputNumberApiResponse extends BaseUiInputResponse<"ui.input.number", ElementDataType$
|
|
316
|
+
interface UiElementInputNumberApiResponse extends BaseUiInputResponse<"ui.input.number", ElementDataType$2> {
|
|
317
317
|
placeholder?: string;
|
|
318
318
|
min?: number;
|
|
319
319
|
max?: number;
|
|
320
320
|
}
|
|
321
321
|
|
|
322
|
-
type ElementDataType = boolean;
|
|
323
|
-
type UiElementInputBoolean = InputElement<ElementDataType, {
|
|
322
|
+
type ElementDataType$1 = boolean;
|
|
323
|
+
type UiElementInputBoolean = InputElement<ElementDataType$1, {
|
|
324
324
|
mode?: "checkbox" | "switch";
|
|
325
325
|
}>;
|
|
326
|
-
interface UiElementInputBooleanApiResponse extends BaseUiInputResponse<"ui.input.boolean", ElementDataType> {
|
|
326
|
+
interface UiElementInputBooleanApiResponse extends BaseUiInputResponse<"ui.input.boolean", ElementDataType$1> {
|
|
327
327
|
mode: "checkbox" | "switch";
|
|
328
328
|
}
|
|
329
329
|
|
|
330
|
+
type ElementDataType = string;
|
|
331
|
+
/**
|
|
332
|
+
* Defines what type of datepicker should we use.
|
|
333
|
+
* @default "dateTime"
|
|
334
|
+
*/
|
|
335
|
+
type DatePickerMode =
|
|
336
|
+
/** Pick both a date and a time */
|
|
337
|
+
"dateTime"
|
|
338
|
+
/** Pick only a date */
|
|
339
|
+
| "date";
|
|
340
|
+
type UiElementInputDatePicker = InputElement<ElementDataType, {
|
|
341
|
+
mode?: DatePickerMode;
|
|
342
|
+
/** Allows selecting only dates/datetimes past this given date. */
|
|
343
|
+
min?: string;
|
|
344
|
+
/** Allows selecting only dates/datetimes before this given date. */
|
|
345
|
+
max?: string;
|
|
346
|
+
}>;
|
|
347
|
+
interface UiElementInputDatePickerApiResponse extends BaseUiInputResponse<"ui.input.datePicker", ElementDataType> {
|
|
348
|
+
mode?: DatePickerMode;
|
|
349
|
+
min?: string;
|
|
350
|
+
max?: string;
|
|
351
|
+
}
|
|
352
|
+
|
|
330
353
|
type UiElementMarkdown = DisplayElement<{
|
|
331
354
|
content: string;
|
|
332
355
|
}>;
|
|
@@ -557,7 +580,7 @@ type ColumnConfig<Cols extends string[]> = {
|
|
|
557
580
|
type?: DataGridDataTypes;
|
|
558
581
|
editable?: boolean;
|
|
559
582
|
};
|
|
560
|
-
type DataGridOptions<T extends Record<string, any>, C> = Omit<BaseInputConfig<T>, "defaultValue" | "label" | "optional" | "disabled"> & {
|
|
583
|
+
type DataGridOptions<T extends Record<string, any>, C> = Omit<BaseInputConfig<T[]>, "defaultValue" | "label" | "optional" | "disabled"> & {
|
|
561
584
|
data: T[];
|
|
562
585
|
columns?: C;
|
|
563
586
|
allowAddRows?: boolean;
|
|
@@ -758,6 +781,7 @@ type UiInputsElements = {
|
|
|
758
781
|
number: UiElementInputNumber;
|
|
759
782
|
boolean: UiElementInputBoolean;
|
|
760
783
|
dataGrid: UiElementInputDataGrid;
|
|
784
|
+
datePicker: UiElementInputDatePicker;
|
|
761
785
|
scan: UiElementScan;
|
|
762
786
|
};
|
|
763
787
|
type UiSelectElements = {
|
|
@@ -850,6 +874,7 @@ type UIApiResponses = {
|
|
|
850
874
|
number: UiElementInputNumberApiResponse;
|
|
851
875
|
boolean: UiElementInputBooleanApiResponse;
|
|
852
876
|
dataGrid: UiElementInputDataGridApiResponse;
|
|
877
|
+
datePicker: UiElementInputDatePickerApiResponse;
|
|
853
878
|
scan: UiElementInputScanApiResponse;
|
|
854
879
|
};
|
|
855
880
|
select: {
|
|
@@ -862,7 +887,7 @@ type UIApiResponses = {
|
|
|
862
887
|
pickList: UiElementPickListApiResponse;
|
|
863
888
|
};
|
|
864
889
|
};
|
|
865
|
-
type UiElementApiResponse = UiElementDividerApiResponse | UiElementMarkdownApiResponse | UiElementHeaderApiResponse | UiElementBannerApiResponse | UiElementImageApiResponse | UiElementCodeApiResponse | UiElementGridApiResponse | UiElementListApiResponse | UiElementTableApiResponse | UiElementKeyValueApiResponse | UiElementFileApiResponse | UiElementInputTextApiResponse | UiElementInputNumberApiResponse | UiElementInputBooleanApiResponse | UiElementInputDataGridApiResponse | UiElementInputScanApiResponse | UiElementSelectOneApiResponse | UiElementSelectTableApiResponse | UiElementIteratorApiResponse | UiElementPrintApiResponse | UiElementPickListApiResponse;
|
|
890
|
+
type UiElementApiResponse = UiElementDividerApiResponse | UiElementMarkdownApiResponse | UiElementHeaderApiResponse | UiElementBannerApiResponse | UiElementImageApiResponse | UiElementCodeApiResponse | UiElementGridApiResponse | UiElementListApiResponse | UiElementTableApiResponse | UiElementKeyValueApiResponse | UiElementFileApiResponse | UiElementInputTextApiResponse | UiElementInputNumberApiResponse | UiElementInputBooleanApiResponse | UiElementInputDataGridApiResponse | UiElementInputScanApiResponse | UiElementInputDatePickerApiResponse | UiElementSelectOneApiResponse | UiElementSelectTableApiResponse | UiElementIteratorApiResponse | UiElementPrintApiResponse | UiElementPickListApiResponse;
|
|
866
891
|
type UiElementApiResponses = UiElementApiResponse[];
|
|
867
892
|
|
|
868
893
|
declare class NonRetriableError extends Error {
|
package/dist/index.d.ts
CHANGED
|
@@ -279,54 +279,77 @@ declare class Duration {
|
|
|
279
279
|
toPostgres(): string;
|
|
280
280
|
}
|
|
281
281
|
|
|
282
|
-
type ElementDataType$
|
|
283
|
-
type UiElementSelectOne = <const TValue extends ElementDataType$
|
|
282
|
+
type ElementDataType$4 = string | number | boolean | Date;
|
|
283
|
+
type UiElementSelectOne = <const TValue extends ElementDataType$4, N extends string, O extends boolean = false>(name: N, options?: BaseInputConfig<TValue, O> & {
|
|
284
284
|
options: ({
|
|
285
285
|
label: string;
|
|
286
286
|
value: TValue;
|
|
287
287
|
} | TValue)[];
|
|
288
288
|
}) => InputElementResponse<N, O extends true ? TValue | undefined : TValue>;
|
|
289
|
-
interface UiElementSelectOneApiResponse extends BaseUiInputResponse<"ui.select.one", ElementDataType$
|
|
289
|
+
interface UiElementSelectOneApiResponse extends BaseUiInputResponse<"ui.select.one", ElementDataType$4> {
|
|
290
290
|
options: ({
|
|
291
291
|
label: string;
|
|
292
|
-
value: ElementDataType$
|
|
293
|
-
} | ElementDataType$
|
|
292
|
+
value: ElementDataType$4;
|
|
293
|
+
} | ElementDataType$4)[];
|
|
294
294
|
}
|
|
295
295
|
|
|
296
|
-
type ElementDataType$
|
|
297
|
-
type UiElementInputText = InputElement<ElementDataType$
|
|
296
|
+
type ElementDataType$3 = string;
|
|
297
|
+
type UiElementInputText = InputElement<ElementDataType$3, {
|
|
298
298
|
placeholder?: string;
|
|
299
299
|
multiline?: boolean;
|
|
300
300
|
maxLength?: number;
|
|
301
301
|
minLength?: number;
|
|
302
302
|
}>;
|
|
303
|
-
interface UiElementInputTextApiResponse extends BaseUiInputResponse<"ui.input.text", ElementDataType$
|
|
303
|
+
interface UiElementInputTextApiResponse extends BaseUiInputResponse<"ui.input.text", ElementDataType$3> {
|
|
304
304
|
placeholder?: string;
|
|
305
305
|
multiline?: boolean;
|
|
306
306
|
maxLength?: number;
|
|
307
307
|
minLength?: number;
|
|
308
308
|
}
|
|
309
309
|
|
|
310
|
-
type ElementDataType$
|
|
311
|
-
type UiElementInputNumber = InputElement<ElementDataType$
|
|
310
|
+
type ElementDataType$2 = number;
|
|
311
|
+
type UiElementInputNumber = InputElement<ElementDataType$2, {
|
|
312
312
|
placeholder?: string;
|
|
313
313
|
min?: number;
|
|
314
314
|
max?: number;
|
|
315
315
|
}>;
|
|
316
|
-
interface UiElementInputNumberApiResponse extends BaseUiInputResponse<"ui.input.number", ElementDataType$
|
|
316
|
+
interface UiElementInputNumberApiResponse extends BaseUiInputResponse<"ui.input.number", ElementDataType$2> {
|
|
317
317
|
placeholder?: string;
|
|
318
318
|
min?: number;
|
|
319
319
|
max?: number;
|
|
320
320
|
}
|
|
321
321
|
|
|
322
|
-
type ElementDataType = boolean;
|
|
323
|
-
type UiElementInputBoolean = InputElement<ElementDataType, {
|
|
322
|
+
type ElementDataType$1 = boolean;
|
|
323
|
+
type UiElementInputBoolean = InputElement<ElementDataType$1, {
|
|
324
324
|
mode?: "checkbox" | "switch";
|
|
325
325
|
}>;
|
|
326
|
-
interface UiElementInputBooleanApiResponse extends BaseUiInputResponse<"ui.input.boolean", ElementDataType> {
|
|
326
|
+
interface UiElementInputBooleanApiResponse extends BaseUiInputResponse<"ui.input.boolean", ElementDataType$1> {
|
|
327
327
|
mode: "checkbox" | "switch";
|
|
328
328
|
}
|
|
329
329
|
|
|
330
|
+
type ElementDataType = string;
|
|
331
|
+
/**
|
|
332
|
+
* Defines what type of datepicker should we use.
|
|
333
|
+
* @default "dateTime"
|
|
334
|
+
*/
|
|
335
|
+
type DatePickerMode =
|
|
336
|
+
/** Pick both a date and a time */
|
|
337
|
+
"dateTime"
|
|
338
|
+
/** Pick only a date */
|
|
339
|
+
| "date";
|
|
340
|
+
type UiElementInputDatePicker = InputElement<ElementDataType, {
|
|
341
|
+
mode?: DatePickerMode;
|
|
342
|
+
/** Allows selecting only dates/datetimes past this given date. */
|
|
343
|
+
min?: string;
|
|
344
|
+
/** Allows selecting only dates/datetimes before this given date. */
|
|
345
|
+
max?: string;
|
|
346
|
+
}>;
|
|
347
|
+
interface UiElementInputDatePickerApiResponse extends BaseUiInputResponse<"ui.input.datePicker", ElementDataType> {
|
|
348
|
+
mode?: DatePickerMode;
|
|
349
|
+
min?: string;
|
|
350
|
+
max?: string;
|
|
351
|
+
}
|
|
352
|
+
|
|
330
353
|
type UiElementMarkdown = DisplayElement<{
|
|
331
354
|
content: string;
|
|
332
355
|
}>;
|
|
@@ -557,7 +580,7 @@ type ColumnConfig<Cols extends string[]> = {
|
|
|
557
580
|
type?: DataGridDataTypes;
|
|
558
581
|
editable?: boolean;
|
|
559
582
|
};
|
|
560
|
-
type DataGridOptions<T extends Record<string, any>, C> = Omit<BaseInputConfig<T>, "defaultValue" | "label" | "optional" | "disabled"> & {
|
|
583
|
+
type DataGridOptions<T extends Record<string, any>, C> = Omit<BaseInputConfig<T[]>, "defaultValue" | "label" | "optional" | "disabled"> & {
|
|
561
584
|
data: T[];
|
|
562
585
|
columns?: C;
|
|
563
586
|
allowAddRows?: boolean;
|
|
@@ -758,6 +781,7 @@ type UiInputsElements = {
|
|
|
758
781
|
number: UiElementInputNumber;
|
|
759
782
|
boolean: UiElementInputBoolean;
|
|
760
783
|
dataGrid: UiElementInputDataGrid;
|
|
784
|
+
datePicker: UiElementInputDatePicker;
|
|
761
785
|
scan: UiElementScan;
|
|
762
786
|
};
|
|
763
787
|
type UiSelectElements = {
|
|
@@ -850,6 +874,7 @@ type UIApiResponses = {
|
|
|
850
874
|
number: UiElementInputNumberApiResponse;
|
|
851
875
|
boolean: UiElementInputBooleanApiResponse;
|
|
852
876
|
dataGrid: UiElementInputDataGridApiResponse;
|
|
877
|
+
datePicker: UiElementInputDatePickerApiResponse;
|
|
853
878
|
scan: UiElementInputScanApiResponse;
|
|
854
879
|
};
|
|
855
880
|
select: {
|
|
@@ -862,7 +887,7 @@ type UIApiResponses = {
|
|
|
862
887
|
pickList: UiElementPickListApiResponse;
|
|
863
888
|
};
|
|
864
889
|
};
|
|
865
|
-
type UiElementApiResponse = UiElementDividerApiResponse | UiElementMarkdownApiResponse | UiElementHeaderApiResponse | UiElementBannerApiResponse | UiElementImageApiResponse | UiElementCodeApiResponse | UiElementGridApiResponse | UiElementListApiResponse | UiElementTableApiResponse | UiElementKeyValueApiResponse | UiElementFileApiResponse | UiElementInputTextApiResponse | UiElementInputNumberApiResponse | UiElementInputBooleanApiResponse | UiElementInputDataGridApiResponse | UiElementInputScanApiResponse | UiElementSelectOneApiResponse | UiElementSelectTableApiResponse | UiElementIteratorApiResponse | UiElementPrintApiResponse | UiElementPickListApiResponse;
|
|
890
|
+
type UiElementApiResponse = UiElementDividerApiResponse | UiElementMarkdownApiResponse | UiElementHeaderApiResponse | UiElementBannerApiResponse | UiElementImageApiResponse | UiElementCodeApiResponse | UiElementGridApiResponse | UiElementListApiResponse | UiElementTableApiResponse | UiElementKeyValueApiResponse | UiElementFileApiResponse | UiElementInputTextApiResponse | UiElementInputNumberApiResponse | UiElementInputBooleanApiResponse | UiElementInputDataGridApiResponse | UiElementInputScanApiResponse | UiElementInputDatePickerApiResponse | UiElementSelectOneApiResponse | UiElementSelectTableApiResponse | UiElementIteratorApiResponse | UiElementPrintApiResponse | UiElementPickListApiResponse;
|
|
866
891
|
type UiElementApiResponses = UiElementApiResponse[];
|
|
867
892
|
|
|
868
893
|
declare class NonRetriableError extends Error {
|
package/dist/index.js
CHANGED
|
@@ -2834,6 +2834,28 @@ var dataGridInput = /* @__PURE__ */ __name((name, options) => {
|
|
|
2834
2834
|
};
|
|
2835
2835
|
}, "dataGridInput");
|
|
2836
2836
|
|
|
2837
|
+
// src/flows/ui/elements/input/datePicker.ts
|
|
2838
|
+
var datePickerInput = /* @__PURE__ */ __name((name, options) => {
|
|
2839
|
+
return {
|
|
2840
|
+
__type: "input",
|
|
2841
|
+
uiConfig: {
|
|
2842
|
+
__type: "ui.input.datePicker",
|
|
2843
|
+
name,
|
|
2844
|
+
label: options?.label || name,
|
|
2845
|
+
optional: options?.optional || false,
|
|
2846
|
+
disabled: options?.disabled || false,
|
|
2847
|
+
helpText: options?.helpText,
|
|
2848
|
+
defaultValue: options?.defaultValue,
|
|
2849
|
+
mode: options?.mode,
|
|
2850
|
+
min: options?.min,
|
|
2851
|
+
max: options?.max
|
|
2852
|
+
},
|
|
2853
|
+
validate: options?.validate,
|
|
2854
|
+
onLeave: options?.onLeave,
|
|
2855
|
+
getData: /* @__PURE__ */ __name((x) => x, "getData")
|
|
2856
|
+
};
|
|
2857
|
+
}, "datePickerInput");
|
|
2858
|
+
|
|
2837
2859
|
// src/flows/ui/elements/iterator.ts
|
|
2838
2860
|
var iterator = /* @__PURE__ */ __name((name, options) => {
|
|
2839
2861
|
return {
|
|
@@ -3228,6 +3250,7 @@ function createFlowContext(runId, data, action, callback, element, spanId, ctx)
|
|
|
3228
3250
|
number: numberInput,
|
|
3229
3251
|
boolean: booleanInput,
|
|
3230
3252
|
dataGrid: dataGridInput,
|
|
3253
|
+
datePicker: datePickerInput,
|
|
3231
3254
|
scan
|
|
3232
3255
|
},
|
|
3233
3256
|
display: {
|