@syncmatters/script-api 1.0.44 → 1.0.45

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.
@@ -413,8 +413,9 @@ export interface ObjectMeta {
413
413
  export type UpsertFieldOperation = "add" | "update";
414
414
  /**
415
415
  * UpsertFieldsMeta describes an object's create-field form. A form has at most one key input (flagged `isUserKey` or
416
- * `isKey`, never both), at most one name input (flagged `isName`), and at least one of the two; the platform drops
417
- * a form that breaks this rule.
416
+ * `isKey`, never both), at most one name input (flagged `isName`), and at least one of the two. An input's
417
+ * `generateFromSetting` and `generateFromMode` are set together, name another input of the form and a known mode. The
418
+ * platform drops a form that breaks these rules.
418
419
  */
419
420
  export interface UpsertFieldsMeta {
420
421
  /** the operations the connector accepts (default ["add"]); a row whose operation is not listed is refused */
@@ -536,6 +537,17 @@ export interface FormInput {
536
537
  displayIf?: "none" | "other_setting_has_value" | "other_setting_is_not_empty";
537
538
  displayIfSetting?: string;
538
539
  displayIfValues?: string[];
540
+ /**
541
+ * id of another input of the same form: the UI fills this input from that input's value while the
542
+ * user has not typed in this one. The input's own constraints still validate the result. Set
543
+ * together with generateFromMode.
544
+ */
545
+ generateFromSetting?: string;
546
+ /**
547
+ * how the value is derived from generateFromSetting's value: "snake_lower" lower-cases, strips
548
+ * accents and turns each run of other characters than letters and digits into one underscore
549
+ */
550
+ generateFromMode?: "snake_lower";
539
551
  type?: "string" | "boolean" | "number" | "string_array" | "connection_uid_template" | "google_picker" | "option_array";
540
552
  control?: "singlelinetext" | "textarea" | "checkbox" | "switch" | "integer" | "url" | "datepicker" | "datetimepicker" | "filepicker" | "drivefolder" | "drivefile" | "select" | "multiselect" | "button" | "timezone";
541
553
  options?: FormInputOption[];
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@syncmatters/script-api",
3
- "version": "1.0.44",
3
+ "version": "1.0.45",
4
4
  "description": "TypeScript type definitions for the SyncMatters script API (types only - scripts execute on the SyncMatters platform)",
5
5
  "types": "./index.d.ts",
6
6
  "exports": {
@@ -28,7 +28,7 @@
28
28
  "license": "MIT",
29
29
  "author": "SyncMatters",
30
30
  "homepage": "https://syncmatters.com",
31
- "typesContentHash": "04475e4db60ca81efd87b1fa09a55709be88d008d8b1c1a18687fdefd7b84ee7",
31
+ "typesContentHash": "8bbb69db31085ae7bac25e7721a69250ea183dbea087fc28624c1fadcfd4bca0",
32
32
  "dependencies": {
33
33
  "@types/node": "*"
34
34
  }