@forestadmin/forestadmin-client 1.11.0 → 1.13.0

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.
@@ -68,19 +68,23 @@ export type ForestServerActionFieldCommon<TType extends ForestServerColumnType =
68
68
  export type ForestServerActionFieldBase = ForestServerActionFieldCommon & {
69
69
  reference: string | null;
70
70
  };
71
- export type ForestServerActionFieldDropdownOptions<TValue = string> = {
72
- name: 'dropdown';
71
+ type ForestServerActionFieldLimitedValueOptions<TName extends string, TValue = string, TParameters = Record<string, never>> = {
72
+ name: TName;
73
73
  parameters: {
74
- placeholder?: string | null;
75
- isSearchable?: boolean;
76
74
  static: {
77
75
  options: Array<{
78
76
  label: string;
79
77
  value: TValue;
80
78
  } | TValue>;
81
79
  };
82
- };
80
+ } & TParameters;
83
81
  };
82
+ export type ForestServerActionFieldDropdownOptions<TValue = string> = ForestServerActionFieldLimitedValueOptions<'dropdown', TValue, {
83
+ placeholder?: string | null;
84
+ isSearchable?: boolean;
85
+ }>;
86
+ export type ForestServerActionFieldRadioButtonOptions<TValue = string> = ForestServerActionFieldLimitedValueOptions<'radio button', TValue>;
87
+ export type ForestServerActionFieldCheckboxGroupOptions<TValue = string> = ForestServerActionFieldLimitedValueOptions<'checkboxes', TValue>;
84
88
  export type ForestServerActionFieldCheckboxOptions = {
85
89
  name: 'boolean editor';
86
90
  parameters: Record<string, never>;
@@ -114,7 +118,9 @@ export type ForestServerActionFieldRichTextOptions = {
114
118
  };
115
119
  };
116
120
  export type ForestServerActionFieldDropdown = ForestServerActionFieldCommon<'String' | 'Dateonly' | 'Date' | 'Timeonly', ForestServerActionFieldDropdownOptions<string>> | ForestServerActionFieldCommon<['String'], ForestServerActionFieldDropdownOptions<string[]>> | ForestServerActionFieldCommon<'Number', ForestServerActionFieldDropdownOptions<number>>;
117
- export type ForestServerActionField = ForestServerActionFieldDropdown | ForestServerActionFieldBase | ForestServerActionFieldCommon<'Boolean', ForestServerActionFieldCheckboxOptions> | ForestServerActionFieldCommon<'String', ForestServerActionFieldTextInputOptions> | ForestServerActionFieldCommon<['String'], ForestServerActionFieldTextInputListOptions> | ForestServerActionFieldCommon<'String', ForestServerActionFieldTextAreaOptions> | ForestServerActionFieldCommon<'String', ForestServerActionFieldRichTextOptions>;
121
+ export type ForestServerActionFieldRadioGroup = ForestServerActionFieldCommon<'String' | 'Dateonly' | 'Date' | 'Timeonly', ForestServerActionFieldRadioButtonOptions<string>> | ForestServerActionFieldCommon<'Number', ForestServerActionFieldRadioButtonOptions<number>>;
122
+ export type ForestServerActionFieldCheckboxGroup = ForestServerActionFieldCommon<['String'], ForestServerActionFieldCheckboxGroupOptions<string>> | ForestServerActionFieldCommon<['Number'], ForestServerActionFieldCheckboxGroupOptions<number>>;
123
+ export type ForestServerActionField = ForestServerActionFieldDropdown | ForestServerActionFieldRadioGroup | ForestServerActionFieldCheckboxGroup | ForestServerActionFieldBase | ForestServerActionFieldCommon<'Boolean', ForestServerActionFieldCheckboxOptions> | ForestServerActionFieldCommon<'String', ForestServerActionFieldTextInputOptions> | ForestServerActionFieldCommon<['String'], ForestServerActionFieldTextInputListOptions> | ForestServerActionFieldCommon<'String', ForestServerActionFieldTextAreaOptions> | ForestServerActionFieldCommon<'String', ForestServerActionFieldRichTextOptions>;
118
124
  export type ForestServerField = Partial<{
119
125
  field: string;
120
126
  type: ForestServerColumnType;
@@ -141,4 +147,5 @@ export type ForestServerSegment = {
141
147
  name: string;
142
148
  };
143
149
  export type ValidationType = 'contains' | 'is after' | 'is before' | 'is greater than' | 'is less than' | 'is like' | 'is longer than' | 'is present' | 'is shorter than';
150
+ export {};
144
151
  //# sourceMappingURL=types.d.ts.map
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@forestadmin/forestadmin-client",
3
- "version": "1.11.0",
3
+ "version": "1.13.0",
4
4
  "main": "dist/index.js",
5
5
  "license": "GPL-3.0",
6
6
  "publishConfig": {
@@ -31,7 +31,7 @@
31
31
  "test": "jest"
32
32
  },
33
33
  "devDependencies": {
34
- "@forestadmin/datasource-toolkit": "1.15.0",
34
+ "@forestadmin/datasource-toolkit": "1.17.0",
35
35
  "@types/json-api-serializer": "^2.6.3",
36
36
  "@types/jsonwebtoken": "^9.0.1",
37
37
  "@types/superagent": "^4.1.16"