@flatfile/blueprint
Advanced tools
Comparing version 0.0.9 to 0.0.10
@@ -1,3 +0,69 @@ | ||
declare type Action = { | ||
type BaseActionConstraint = { | ||
type: 'hasAllValid' | 'hasSelection'; | ||
}; | ||
type HasAllValidConstraint = (BaseActionConstraint & { | ||
type?: 'hasAllValid'; | ||
}); | ||
type HasSelectionConstraint = (BaseActionConstraint & { | ||
type?: 'hasSelection'; | ||
}); | ||
type ActionConstraint = (HasSelectionConstraint | HasAllValidConstraint); | ||
type EnumPropertyOption = { | ||
/** | ||
* The value or ID of this option. This value will be sent in egress | ||
*/ | ||
value: (string | number | boolean); | ||
/** | ||
* A visual label for this option, defaults to value if not provided | ||
*/ | ||
label?: string; | ||
/** | ||
* A short description for this option | ||
*/ | ||
description?: string; | ||
/** | ||
* An optional color to assign this option | ||
*/ | ||
color?: string; | ||
/** | ||
* A reference pointer to a previously registered icon | ||
*/ | ||
icon?: string; | ||
/** | ||
* An arbitrary JSON object to be associated with this option and made available to hooks | ||
*/ | ||
meta?: Record<string, any>; | ||
/** | ||
* Alternative names to match this enum option to | ||
*/ | ||
alternativeNames?: Array<string>; | ||
}; | ||
type BaseConstraint = { | ||
type: 'required' | 'unique' | 'computed'; | ||
}; | ||
type RequiredConstraint = (BaseConstraint & { | ||
type?: 'required'; | ||
}); | ||
type InputConstraint = RequiredConstraint; | ||
type InputField = { | ||
key: string; | ||
label: string; | ||
description?: string; | ||
type: 'string' | 'textarea' | 'number' | 'boolean' | 'enum'; | ||
config?: { | ||
options: Array<EnumPropertyOption>; | ||
}; | ||
constraints?: Array<InputConstraint>; | ||
}; | ||
type Action = { | ||
/** | ||
* @deprecated | ||
@@ -8,2 +74,3 @@ */ | ||
description?: string; | ||
tooltip?: string; | ||
schedule?: 'weekly' | 'daily' | 'hourly'; | ||
@@ -17,3 +84,3 @@ /** | ||
*/ | ||
mode?: 'foreground' | 'background'; | ||
mode?: 'foreground' | 'background' | 'toolbarBlocking'; | ||
primary?: boolean; | ||
@@ -24,25 +91,35 @@ /** | ||
confirm?: boolean; | ||
/** | ||
* Whether to disable the action when the selection contains invalid records | ||
* @deprecated | ||
*/ | ||
requireAllValid?: boolean; | ||
/** | ||
* Whether to disable the action when the selection is empty | ||
* @deprecated | ||
*/ | ||
requireSelection?: boolean; | ||
icon?: string; | ||
/** | ||
* The input for this action | ||
*/ | ||
inputForm?: { | ||
type: 'simple'; | ||
fields: Array<InputField>; | ||
}; | ||
constraints?: Array<ActionConstraint>; | ||
}; | ||
declare type ArrayableProperty = { | ||
type ArrayableProperty = { | ||
/** | ||
* Will allow multiple values and store as an array | ||
*/ | ||
is_array?: boolean; | ||
isArray?: boolean; | ||
}; | ||
declare type BaseConstraint = { | ||
type: 'required' | 'unique' | 'computed'; | ||
}; | ||
declare type ComputedConstraint = (BaseConstraint & { | ||
type ComputedConstraint = (BaseConstraint & { | ||
type?: 'computed'; | ||
}); | ||
declare type RequiredConstraint = (BaseConstraint & { | ||
type?: 'required'; | ||
}); | ||
declare type UniqueConstraint = (BaseConstraint & { | ||
type UniqueConstraint = (BaseConstraint & { | ||
type: 'unique'; | ||
@@ -53,13 +130,13 @@ config?: { | ||
*/ | ||
case_sensitive?: boolean; | ||
caseSensitive?: boolean; | ||
/** | ||
* Do not flag empty values as duplicate | ||
*/ | ||
ignore_empty?: boolean; | ||
ignoreEmpty?: boolean; | ||
}; | ||
}); | ||
declare type Constraint = (RequiredConstraint | UniqueConstraint | ComputedConstraint); | ||
type Constraint = (RequiredConstraint | UniqueConstraint | ComputedConstraint); | ||
declare type BaseProperty = { | ||
type BaseProperty = { | ||
key: string; | ||
@@ -81,5 +158,7 @@ type: 'string' | 'number' | 'boolean' | 'date' | 'enum' | 'reference'; | ||
metadata?: Record<string, any>; | ||
treatments?: Array<string>; | ||
alternativeNames?: Array<string>; | ||
}; | ||
declare type BooleanProperty = (BaseProperty & { | ||
type BooleanProperty = (BaseProperty & { | ||
type?: 'boolean'; | ||
@@ -90,34 +169,18 @@ config?: { | ||
*/ | ||
allow_indeterminate?: boolean; | ||
allowIndeterminate?: boolean; | ||
}; | ||
}); | ||
declare type DateProperty = (BaseProperty & { | ||
type CompositeUniqueConstraint = { | ||
type: 'unique'; | ||
name?: string; | ||
fields?: Array<string>; | ||
strategy?: 'hash' | 'concat'; | ||
}; | ||
type DateProperty = (BaseProperty & { | ||
type?: 'date'; | ||
}); | ||
declare type EnumPropertyOption = { | ||
/** | ||
* The value or ID of this option. This value will be sent in egress | ||
*/ | ||
value: (string | number | boolean); | ||
/** | ||
* A visual label for this option, defaults to value if not provided | ||
*/ | ||
label?: string; | ||
/** | ||
* An optional color to assign this option | ||
*/ | ||
color?: string; | ||
/** | ||
* A reference pointer to a previously registered icon | ||
*/ | ||
icon?: string; | ||
/** | ||
* An arbitrary JSON object to be associated with this option and made available to hooks | ||
*/ | ||
meta?: Record<string, any>; | ||
}; | ||
declare type EnumProperty = (BaseProperty & ArrayableProperty & { | ||
type EnumProperty = (BaseProperty & ArrayableProperty & { | ||
type?: 'enum'; | ||
@@ -128,3 +191,3 @@ config: { | ||
*/ | ||
allow_custom?: boolean; | ||
allowCustom?: boolean; | ||
options: Array<EnumPropertyOption>; | ||
@@ -134,3 +197,3 @@ }; | ||
declare type NumberProperty = (BaseProperty & ArrayableProperty & { | ||
type NumberProperty = (BaseProperty & ArrayableProperty & { | ||
type?: 'number'; | ||
@@ -144,7 +207,7 @@ /** | ||
*/ | ||
decimal_places?: number; | ||
decimalPlaces?: number; | ||
}; | ||
}); | ||
declare type ReferenceProperty = (BaseProperty & ArrayableProperty & { | ||
type ReferenceProperty = (BaseProperty & ArrayableProperty & { | ||
type?: 'reference'; | ||
@@ -159,3 +222,3 @@ config: { | ||
*/ | ||
key?: string; | ||
key: string; | ||
/** | ||
@@ -168,17 +231,16 @@ * The type of relationship this defines | ||
declare type StringProperty = (BaseProperty & { | ||
type StringProperty = (BaseProperty & { | ||
type?: 'string'; | ||
}); | ||
declare type Property = (StringProperty | NumberProperty | BooleanProperty | DateProperty | EnumProperty | ReferenceProperty); | ||
type Property = (StringProperty | NumberProperty | BooleanProperty | DateProperty | EnumProperty | ReferenceProperty); | ||
declare type PropertyList = Array<Property>; | ||
type PropertyList = Array<Property>; | ||
declare type SheetAccess = '*' | 'add' | 'edit' | 'delete' | 'import'; | ||
type SheetAccess = '*' | 'add' | 'edit' | 'delete' | 'import'; | ||
/** | ||
* Describes shape of data as well as behavior | ||
*/ | ||
declare type SheetConfig = { | ||
name: string; | ||
type SheetConstraint = CompositeUniqueConstraint; | ||
type SheetConfigOptions = { | ||
name?: string; | ||
description?: string; | ||
@@ -190,7 +252,20 @@ slug?: string; | ||
readonly?: boolean; | ||
/** | ||
* Allow users to add fields | ||
*/ | ||
allowAdditionalFields?: boolean; | ||
/** | ||
* The minimum confidence required to automatically map a field | ||
*/ | ||
mappingConfidenceThreshold?: number; | ||
access?: Array<SheetAccess>; | ||
fields: Array<Property>; | ||
fields?: Array<Property>; | ||
actions?: Array<Action>; | ||
/** | ||
* Useful for any contextual metadata regarding the schema. Store any valid json here. | ||
*/ | ||
metadata?: Record<string, any>; | ||
constraints?: Array<SheetConstraint>; | ||
}; | ||
export { Action, ArrayableProperty, BaseConstraint, BaseProperty, BooleanProperty, ComputedConstraint, Constraint, DateProperty, EnumProperty, EnumPropertyOption, NumberProperty, Property, PropertyList, ReferenceProperty, RequiredConstraint, SheetAccess, SheetConfig, StringProperty, UniqueConstraint }; | ||
export { Action, ActionConstraint, ArrayableProperty, BaseActionConstraint, BaseConstraint, BaseProperty, BooleanProperty, CompositeUniqueConstraint, ComputedConstraint, Constraint, DateProperty, EnumProperty, EnumPropertyOption, HasAllValidConstraint, HasSelectionConstraint, InputConstraint, InputField, NumberProperty, Property, PropertyList, ReferenceProperty, RequiredConstraint, SheetAccess, SheetConfigOptions, SheetConstraint, StringProperty, UniqueConstraint }; |
@@ -0,1 +1,2 @@ | ||
"use strict"; | ||
var __defProp = Object.defineProperty; | ||
@@ -2,0 +3,0 @@ var __getOwnPropDesc = Object.getOwnPropertyDescriptor; |
{ | ||
"name": "@flatfile/blueprint", | ||
"version": "0.0.9", | ||
"version": "0.0.10", | ||
"description": "The universal DDL for defining data structures across Flatfile.", | ||
@@ -8,2 +8,6 @@ "main": "./dist/index.js", | ||
"types": "./dist/index.d.ts", | ||
"files": [ | ||
"dist", | ||
"properties.yaml" | ||
], | ||
"private": false, | ||
@@ -28,2 +32,3 @@ "engines": { | ||
"dependencies": { | ||
"tsup": "^6.7.0", | ||
"openapi-typescript-codegen": "^0.23.0" | ||
@@ -30,0 +35,0 @@ }, |
@@ -33,3 +33,3 @@ # Blueprint | ||
"config": { | ||
"case_sensitive": false | ||
"caseSensitive": false | ||
} | ||
@@ -50,3 +50,3 @@ } | ||
"config": { | ||
"decimal_places": 2 | ||
"decimalPlaces": 2 | ||
} | ||
@@ -60,3 +60,3 @@ }, | ||
"config": { | ||
"allow_custom": false, | ||
"allowCustom": false, | ||
"options": [ | ||
@@ -120,5 +120,5 @@ { | ||
| Option | Description | Default | | ||
| ---------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------- | | ||
| `decimal_places` | The number of decimal places to preserve accuracy to. Overages should be automatically rounded with a warning. A hook can pre-format to accomplish floor or ceil. | `0` | | ||
| Option | Description | Default | | ||
| --------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------- | | ||
| `decimalPlaces` | The number of decimal places to preserve accuracy to. Overages should be automatically rounded with a warning. A hook can pre-format to accomplish floor or ceil. | `0` | | ||
@@ -146,11 +146,11 @@ ## `reference` ๐ | ||
| Option | | Description | Default | Required? | | ||
| -------------- | ------- | -------------------------------------------------------------------------------------- | ------- | --------- | | ||
| `allow_custom` | | Permit the user to create new options for this specific field. | `false` | | | ||
| `options[]` | | A list of valid options the user can select from | | โ | | ||
| | `value` | The value or ID of this option. This value will be sent in egress | | โ | | ||
| | `label` | A visual label for this option, defaults to value if not provided | | | | ||
| | `color` | An optional color to assign this option | | | | ||
| | `icon` | A reference pointer to a previously registered icon | | | | ||
| | `meta` | An arbitrary JSON object to be associated with this option and made available to hooks | | | | ||
| Option | | Description | Default | Required? | | ||
| ------------- | ------- | -------------------------------------------------------------------------------------- | ------- | --------- | | ||
| `allowCustom` | | Permit the user to create new options for this specific field. | `false` | | | ||
| `options[]` | | A list of valid options the user can select from | | โ | | ||
| | `value` | The value or ID of this option. This value will be sent in egress | | โ | | ||
| | `label` | A visual label for this option, defaults to value if not provided | | | | ||
| | `color` | An optional color to assign this option | | | | ||
| | `icon` | A reference pointer to a previously registered icon | | | | ||
| | `meta` | An arbitrary JSON object to be associated with this option and made available to hooks | | | | ||
@@ -161,5 +161,5 @@ ## `boolean` | ||
| Option | Description | Default | | ||
| --------------------- | ------------------------------------------------------------------------------ | ------- | | ||
| `allow_indeterminate` | Allow an indeterminate (`null`) option that is neither selected or unselected. | `true` | | ||
| Option | Description | Default | | ||
| -------------------- | ------------------------------------------------------------------------------ | ------- | | ||
| `allowIndeterminate` | Allow an indeterminate (`null`) option that is neither selected or unselected. | `true` | | ||
@@ -166,0 +166,0 @@ ## `date` |
Sorry, the diff of this file is not supported yet
New author
Supply chain riskA new npm collaborator published a version of the package for the first time. New collaborators are usually benign additions to a project, but do indicate a change to the security surface area of a package.
Found 1 instance in 1 package
New author
Supply chain riskA new npm collaborator published a version of the package for the first time. New collaborators are usually benign additions to a project, but do indicate a change to the security surface area of a package.
Found 1 instance in 1 package
33049
250
2
5
+ Addedtsup@^6.7.0
+ Added@esbuild/android-arm@0.17.19(transitive)
+ Added@esbuild/android-arm64@0.17.19(transitive)
+ Added@esbuild/android-x64@0.17.19(transitive)
+ Added@esbuild/darwin-arm64@0.17.19(transitive)
+ Added@esbuild/darwin-x64@0.17.19(transitive)
+ Added@esbuild/freebsd-arm64@0.17.19(transitive)
+ Added@esbuild/freebsd-x64@0.17.19(transitive)
+ Added@esbuild/linux-arm@0.17.19(transitive)
+ Added@esbuild/linux-arm64@0.17.19(transitive)
+ Added@esbuild/linux-ia32@0.17.19(transitive)
+ Added@esbuild/linux-loong64@0.17.19(transitive)
+ Added@esbuild/linux-mips64el@0.17.19(transitive)
+ Added@esbuild/linux-ppc64@0.17.19(transitive)
+ Added@esbuild/linux-riscv64@0.17.19(transitive)
+ Added@esbuild/linux-s390x@0.17.19(transitive)
+ Added@esbuild/linux-x64@0.17.19(transitive)
+ Added@esbuild/netbsd-x64@0.17.19(transitive)
+ Added@esbuild/openbsd-x64@0.17.19(transitive)
+ Added@esbuild/sunos-x64@0.17.19(transitive)
+ Added@esbuild/win32-arm64@0.17.19(transitive)
+ Added@esbuild/win32-ia32@0.17.19(transitive)
+ Added@esbuild/win32-x64@0.17.19(transitive)
+ Added@isaacs/cliui@8.0.2(transitive)
+ Added@jridgewell/gen-mapping@0.3.8(transitive)
+ Added@jridgewell/resolve-uri@3.1.2(transitive)
+ Added@jridgewell/set-array@1.2.1(transitive)
+ Added@jridgewell/sourcemap-codec@1.5.0(transitive)
+ Added@jridgewell/trace-mapping@0.3.25(transitive)
+ Added@nodelib/fs.scandir@2.1.5(transitive)
+ Added@nodelib/fs.stat@2.0.5(transitive)
+ Added@nodelib/fs.walk@1.2.8(transitive)
+ Added@pkgjs/parseargs@0.11.0(transitive)
+ Addedansi-regex@5.0.16.1.0(transitive)
+ Addedansi-styles@4.3.06.2.1(transitive)
+ Addedany-promise@1.3.0(transitive)
+ Addedanymatch@3.1.3(transitive)
+ Addedarray-union@2.1.0(transitive)
+ Addedbalanced-match@1.0.2(transitive)
+ Addedbinary-extensions@2.3.0(transitive)
+ Addedbrace-expansion@2.0.1(transitive)
+ Addedbraces@3.0.3(transitive)
+ Addedbundle-require@4.2.1(transitive)
+ Addedcac@6.7.14(transitive)
+ Addedchokidar@3.6.0(transitive)
+ Addedcolor-convert@2.0.1(transitive)
+ Addedcolor-name@1.1.4(transitive)
+ Addedcommander@4.1.1(transitive)
+ Addedcross-spawn@7.0.6(transitive)
+ Addeddebug@4.4.0(transitive)
+ Addeddir-glob@3.0.1(transitive)
+ Addedeastasianwidth@0.2.0(transitive)
+ Addedemoji-regex@8.0.09.2.2(transitive)
+ Addedesbuild@0.17.19(transitive)
+ Addedexeca@5.1.1(transitive)
+ Addedfast-glob@3.3.3(transitive)
+ Addedfastq@1.18.0(transitive)
+ Addedfill-range@7.1.1(transitive)
+ Addedforeground-child@3.3.0(transitive)
+ Addedfsevents@2.3.3(transitive)
+ Addedget-stream@6.0.1(transitive)
+ Addedglob@10.4.5(transitive)
+ Addedglob-parent@5.1.2(transitive)
+ Addedglobby@11.1.0(transitive)
+ Addedhuman-signals@2.1.0(transitive)
+ Addedignore@5.3.2(transitive)
+ Addedis-binary-path@2.1.0(transitive)
+ Addedis-extglob@2.1.1(transitive)
+ Addedis-fullwidth-code-point@3.0.0(transitive)
+ Addedis-glob@4.0.3(transitive)
+ Addedis-number@7.0.0(transitive)
+ Addedis-stream@2.0.1(transitive)
+ Addedisexe@2.0.0(transitive)
+ Addedjackspeak@3.4.3(transitive)
+ Addedjoycon@3.1.1(transitive)
+ Addedlilconfig@2.1.0(transitive)
+ Addedlines-and-columns@1.2.4(transitive)
+ Addedload-tsconfig@0.2.5(transitive)
+ Addedlodash.sortby@4.7.0(transitive)
+ Addedlru-cache@10.4.3(transitive)
+ Addedmerge-stream@2.0.0(transitive)
+ Addedmerge2@1.4.1(transitive)
+ Addedmicromatch@4.0.8(transitive)
+ Addedmimic-fn@2.1.0(transitive)
+ Addedminimatch@9.0.5(transitive)
+ Addedminipass@7.1.2(transitive)
+ Addedms@2.1.3(transitive)
+ Addedmz@2.7.0(transitive)
+ Addednormalize-path@3.0.0(transitive)
+ Addednpm-run-path@4.0.1(transitive)
+ Addedobject-assign@4.1.1(transitive)
+ Addedonetime@5.1.2(transitive)
+ Addedpackage-json-from-dist@1.0.1(transitive)
+ Addedpath-key@3.1.1(transitive)
+ Addedpath-scurry@1.11.1(transitive)
+ Addedpath-type@4.0.0(transitive)
+ Addedpicomatch@2.3.1(transitive)
+ Addedpirates@4.0.6(transitive)
+ Addedpostcss-load-config@3.1.4(transitive)
+ Addedpunycode@2.3.1(transitive)
+ Addedqueue-microtask@1.2.3(transitive)
+ Addedreaddirp@3.6.0(transitive)
+ Addedresolve-from@5.0.0(transitive)
+ Addedreusify@1.0.4(transitive)
+ Addedrollup@3.29.5(transitive)
+ Addedrun-parallel@1.2.0(transitive)
+ Addedshebang-command@2.0.0(transitive)
+ Addedshebang-regex@3.0.0(transitive)
+ Addedsignal-exit@3.0.74.1.0(transitive)
+ Addedslash@3.0.0(transitive)
+ Addedsource-map@0.8.0-beta.0(transitive)
+ Addedstring-width@4.2.35.1.2(transitive)
+ Addedstrip-ansi@6.0.17.1.0(transitive)
+ Addedstrip-final-newline@2.0.0(transitive)
+ Addedsucrase@3.35.0(transitive)
+ Addedthenify@3.3.1(transitive)
+ Addedthenify-all@1.6.0(transitive)
+ Addedto-regex-range@5.0.1(transitive)
+ Addedtr46@1.0.1(transitive)
+ Addedtree-kill@1.2.2(transitive)
+ Addedts-interface-checker@0.1.13(transitive)
+ Addedtsup@6.7.0(transitive)
+ Addedwebidl-conversions@4.0.2(transitive)
+ Addedwhatwg-url@7.1.0(transitive)
+ Addedwhich@2.0.2(transitive)
+ Addedwrap-ansi@7.0.08.1.0(transitive)
+ Addedyaml@1.10.2(transitive)