mirror of
https://github.com/Start9Labs/start-sdk.git
synced 2026-03-30 20:24:47 +00:00
chore: charlie 20
This commit is contained in:
@@ -103,7 +103,7 @@ export class List<A extends ValueSpecList> extends IBuilder<A> {
|
|||||||
description?: string | null;
|
description?: string | null;
|
||||||
warning?: string | null;
|
warning?: string | null;
|
||||||
/** Default [] */
|
/** Default [] */
|
||||||
default?: Record<string, unknown>[];
|
default?: [];
|
||||||
/** Default = "(\*,\*)" */
|
/** Default = "(\*,\*)" */
|
||||||
range?: string;
|
range?: string;
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -2,34 +2,38 @@ import * as C from "./configTypesRaw";
|
|||||||
|
|
||||||
export type ValueType = C.ValueType;
|
export type ValueType = C.ValueType;
|
||||||
|
|
||||||
export type InputSpec = Record<string, Required<C.ValueSpec>>;
|
export type RequiredDeep<A> = A extends {}
|
||||||
|
? { [K in keyof A]-?: RequiredDeep<A[K]> }
|
||||||
|
: Required<A>;
|
||||||
|
|
||||||
export type ValueSpec = Required<C.ValueSpec>;
|
export type InputSpec = Record<string, RequiredDeep<C.ValueSpec>>;
|
||||||
|
|
||||||
|
export type ValueSpec = RequiredDeep<C.ValueSpec>;
|
||||||
|
|
||||||
/** core spec types. These types provide the metadata for performing validations */
|
/** core spec types. These types provide the metadata for performing validations */
|
||||||
export type ValueSpecOf<T extends ValueType> = Required<C.ValueSpecOf<T>>;
|
export type ValueSpecOf<T extends ValueType> = RequiredDeep<C.ValueSpecOf<T>>;
|
||||||
|
|
||||||
export type ValueSpecString = Required<C.ValueSpecString>;
|
export type ValueSpecString = RequiredDeep<C.ValueSpecString>;
|
||||||
export type ValueSpecTextarea = Required<C.ValueSpecTextarea>;
|
export type ValueSpecTextarea = RequiredDeep<C.ValueSpecTextarea>;
|
||||||
export type ValueSpecNumber = Required<C.ValueSpecNumber>;
|
export type ValueSpecNumber = RequiredDeep<C.ValueSpecNumber>;
|
||||||
export type ValueSpecSelect = Required<C.ValueSpecSelect>;
|
export type ValueSpecSelect = RequiredDeep<C.ValueSpecSelect>;
|
||||||
export type ValueSpecMultiselect = Required<C.ValueSpecMultiselect>;
|
export type ValueSpecMultiselect = RequiredDeep<C.ValueSpecMultiselect>;
|
||||||
export type ValueSpecBoolean = Required<C.ValueSpecBoolean>;
|
export type ValueSpecBoolean = RequiredDeep<C.ValueSpecBoolean>;
|
||||||
export type ValueSpecUnion = Required<C.ValueSpecUnion>;
|
export type ValueSpecUnion = RequiredDeep<C.ValueSpecUnion>;
|
||||||
export type ValueSpecFile = Required<C.ValueSpecFile>;
|
export type ValueSpecFile = RequiredDeep<C.ValueSpecFile>;
|
||||||
export type ValueSpecObject = Required<C.ValueSpecObject>;
|
export type ValueSpecObject = RequiredDeep<C.ValueSpecObject>;
|
||||||
export type WithStandalone = Required<C.WithStandalone>;
|
export type WithStandalone = RequiredDeep<C.WithStandalone>;
|
||||||
export type SelectBase = Required<C.SelectBase>;
|
export type SelectBase = RequiredDeep<C.SelectBase>;
|
||||||
export type ListValueSpecType = Required<C.ListValueSpecType>;
|
export type ListValueSpecType = RequiredDeep<C.ListValueSpecType>;
|
||||||
|
|
||||||
/** represents a spec for the values of a list */
|
/** represents a spec for the values of a list */
|
||||||
export type ListValueSpecOf<T extends ListValueSpecType> = Required<
|
export type ListValueSpecOf<T extends ListValueSpecType> = RequiredDeep<
|
||||||
C.ListValueSpecOf<T>
|
C.ListValueSpecOf<T>
|
||||||
>;
|
>;
|
||||||
|
|
||||||
/** represents a spec for a list */
|
/** represents a spec for a list */
|
||||||
export type ValueSpecList = Required<C.ValueSpecList>;
|
export type ValueSpecList = RequiredDeep<C.ValueSpecList>;
|
||||||
export type ValueSpecListOf<T extends ListValueSpecType> = Required<
|
export type ValueSpecListOf<T extends ListValueSpecType> = RequiredDeep<
|
||||||
C.ValueSpecListOf<T>
|
C.ValueSpecListOf<T>
|
||||||
>;
|
>;
|
||||||
|
|
||||||
@@ -40,11 +44,11 @@ export function isValueSpecListOf<S extends ListValueSpecType>(
|
|||||||
): t is ValueSpecListOf<S> & { spec: ListValueSpecOf<S> } {
|
): t is ValueSpecListOf<S> & { spec: ListValueSpecOf<S> } {
|
||||||
return t.spec.type === s;
|
return t.spec.type === s;
|
||||||
}
|
}
|
||||||
export type ListValueSpecString = Required<C.ListValueSpecString>;
|
export type ListValueSpecString = RequiredDeep<C.ListValueSpecString>;
|
||||||
export type ListValueSpecNumber = Required<C.ListValueSpecNumber>;
|
export type ListValueSpecNumber = RequiredDeep<C.ListValueSpecNumber>;
|
||||||
export type ListValueSpecObject = Required<C.ListValueSpecObject>;
|
export type ListValueSpecObject = RequiredDeep<C.ListValueSpecObject>;
|
||||||
export type UniqueBy = Required<C.UniqueBy>;
|
export type UniqueBy = RequiredDeep<C.UniqueBy>;
|
||||||
export type DefaultString = Required<C.DefaultString>;
|
export type DefaultString = RequiredDeep<C.DefaultString>;
|
||||||
|
|
||||||
export const unionSelectKey = "unionSelectKey" as const;
|
export const unionSelectKey = "unionSelectKey" as const;
|
||||||
export type UnionSelectKey = typeof unionSelectKey;
|
export type UnionSelectKey = typeof unionSelectKey;
|
||||||
|
|||||||
@@ -6,7 +6,9 @@ export { PropertyObject } from "./PropertyObject";
|
|||||||
export { PropertyString } from "./PropertyString";
|
export { PropertyString } from "./PropertyString";
|
||||||
|
|
||||||
export const test = "";
|
export const test = "";
|
||||||
export type UnionToIntersection<T> = ((x: T) => any) extends (x: infer R) => any ? R : never;
|
export type UnionToIntersection<T> = ((x: T) => any) extends (x: infer R) => any
|
||||||
|
? R
|
||||||
|
: never;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* This is used during creating the type of properties fn in the service package.
|
* This is used during creating the type of properties fn in the service package.
|
||||||
|
|||||||
4
package-lock.json
generated
4
package-lock.json
generated
@@ -1,12 +1,12 @@
|
|||||||
{
|
{
|
||||||
"name": "start-sdk",
|
"name": "start-sdk",
|
||||||
"version": "0.4.0-lib0.charlie19",
|
"version": "0.4.0-lib0.charlie20",
|
||||||
"lockfileVersion": 3,
|
"lockfileVersion": 3,
|
||||||
"requires": true,
|
"requires": true,
|
||||||
"packages": {
|
"packages": {
|
||||||
"": {
|
"": {
|
||||||
"name": "start-sdk",
|
"name": "start-sdk",
|
||||||
"version": "0.4.0-lib0.charlie19",
|
"version": "0.4.0-lib0.charlie20",
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@iarna/toml": "^2.2.5",
|
"@iarna/toml": "^2.2.5",
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "start-sdk",
|
"name": "start-sdk",
|
||||||
"version": "0.4.0-lib0.charlie19",
|
"version": "0.4.0-lib0.charlie20",
|
||||||
"description": "For making the patterns that are wanted in making services for the startOS.",
|
"description": "For making the patterns that are wanted in making services for the startOS.",
|
||||||
"main": "./lib/index.js",
|
"main": "./lib/index.js",
|
||||||
"types": "./lib/index.d.ts",
|
"types": "./lib/index.d.ts",
|
||||||
|
|||||||
@@ -217,7 +217,10 @@ export default async function makeFileContent(
|
|||||||
const values = Object.fromEntries(
|
const values = Object.fromEntries(
|
||||||
Array.from(allValueNames)
|
Array.from(allValueNames)
|
||||||
.filter(string.test)
|
.filter(string.test)
|
||||||
.map((key) => [key, value?.spec?.["value-names"]?.[key] || key])
|
.map((key: string) => [
|
||||||
|
key,
|
||||||
|
value?.spec?.["value-names"]?.[key] || key,
|
||||||
|
])
|
||||||
);
|
);
|
||||||
return `Value.multiselect(${JSON.stringify(
|
return `Value.multiselect(${JSON.stringify(
|
||||||
{
|
{
|
||||||
|
|||||||
Reference in New Issue
Block a user