@flatfile/blueprint
Advanced tools
Comparing version
@@ -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
18.26%250
37.36%2
100%5
-28.57%+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added