cogfy-data-exchange 1.0.17 → 1.0.18

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.
@@ -35,6 +35,19 @@ type ExtractScreenData<T> = T extends {
35
35
  type ExtractDataSourceIds<DS> = DS extends readonly {
36
36
  id: infer Id;
37
37
  }[] ? Id : string;
38
+ type DocumentPickerFile = {
39
+ file_name: string;
40
+ media_id: string;
41
+ cdn_url: string;
42
+ encryption_metadata: {
43
+ encryption_key: string;
44
+ hmac_key: string;
45
+ hmac: string;
46
+ iv: string;
47
+ plaintext_hash: string;
48
+ encrypted_hash: string;
49
+ };
50
+ };
38
51
  type ComponentFormValue<C> = C extends {
39
52
  type: 'RadioButtonsGroup' | 'Dropdown';
40
53
  'data-source': infer DS;
@@ -45,7 +58,9 @@ type ComponentFormValue<C> = C extends {
45
58
  type: 'TextInput' | 'TextArea' | 'DatePicker';
46
59
  } ? string : C extends {
47
60
  type: 'OptIn';
48
- } ? boolean : string;
61
+ } ? boolean : C extends {
62
+ type: 'DocumentPicker';
63
+ } ? DocumentPickerFile[] : string;
49
64
  type ResolvePayloadValue<V, Children, ScreenData> = V extends `$${'{'}form.${infer FieldName}}` ? [Extract<Children, {
50
65
  name: FieldName;
51
66
  }>] extends [never] ? string : ComponentFormValue<Extract<Children, {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "cogfy-data-exchange",
3
- "version": "1.0.17",
3
+ "version": "1.0.18",
4
4
  "description": "",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
@@ -34,6 +34,20 @@ type ExtractScreenData<T> = T extends { data: infer D } ? D : never
34
34
 
35
35
  type ExtractDataSourceIds<DS> = DS extends readonly { id: infer Id }[] ? Id : string
36
36
 
37
+ type DocumentPickerFile = {
38
+ file_name: string
39
+ media_id: string
40
+ cdn_url: string
41
+ encryption_metadata: {
42
+ encryption_key: string
43
+ hmac_key: string
44
+ hmac: string
45
+ iv: string
46
+ plaintext_hash: string
47
+ encrypted_hash: string
48
+ }
49
+ }
50
+
37
51
  type ComponentFormValue<C> = C extends {
38
52
  type: 'RadioButtonsGroup' | 'Dropdown'
39
53
  'data-source': infer DS
@@ -48,7 +62,9 @@ type ComponentFormValue<C> = C extends {
48
62
  ? string
49
63
  : C extends { type: 'OptIn' }
50
64
  ? boolean
51
- : string
65
+ : C extends { type: 'DocumentPicker' }
66
+ ? DocumentPickerFile[]
67
+ : string
52
68
 
53
69
  type ResolvePayloadValue<V, Children, ScreenData> = V extends `$${'{'}form.${infer FieldName}}`
54
70
  ? [Extract<Children, { name: FieldName }>] extends [never]