@hiver/connector-admin 4.25.0 → 4.26.0-prefillAuto-beta.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.
- package/features/connector-library/api/fetchDefaults.d.ts +23 -16
- package/features/connector-library/api/fetchDefaults.d.ts.map +1 -1
- package/features/connector-library/components/connector-info-card/index.d.ts.map +1 -1
- package/features/connector-library/components/map-form-defaults/index.d.ts +5 -1
- package/features/connector-library/components/map-form-defaults/index.d.ts.map +1 -1
- package/features/connector-library/utils/prefillDefaultSaved.d.ts +38 -0
- package/features/connector-library/utils/prefillDefaultSaved.d.ts.map +1 -0
- package/index.es.js +7761 -7706
- package/index.umd.js +335 -335
- package/package.json +1 -1
- package/types/form.d.ts +2 -0
- package/types/form.d.ts.map +1 -1
|
@@ -1,13 +1,20 @@
|
|
|
1
|
+
import { ApiData } from '@connector/utils';
|
|
1
2
|
export interface GetFormDefaultProps {
|
|
2
3
|
formId: string | number;
|
|
3
4
|
}
|
|
4
5
|
export interface GetFormDefaultQueryProps extends GetFormDefaultProps {
|
|
5
6
|
enabled: boolean;
|
|
6
7
|
}
|
|
7
|
-
export
|
|
8
|
+
export interface IFormDefaultsWithMeta {
|
|
9
|
+
values: Record<string, unknown>;
|
|
10
|
+
/** Raw defaults (template string in `label`), kept to diff system defaults on save. */
|
|
11
|
+
rawDefaults: ApiData;
|
|
12
|
+
systemDefaultFields: string[];
|
|
13
|
+
}
|
|
14
|
+
export declare const fetchFormDefaultsWithMeta: ({ formId }: GetFormDefaultProps) => Promise<IFormDefaultsWithMeta>;
|
|
8
15
|
export declare const getFormDefaultsQuery: ({ formId }: GetFormDefaultProps) => (string | number)[];
|
|
9
16
|
export declare const useGetFormDefaultsQuery: ({ formId, enabled }: GetFormDefaultQueryProps) => {
|
|
10
|
-
data:
|
|
17
|
+
data: IFormDefaultsWithMeta;
|
|
11
18
|
error: Error;
|
|
12
19
|
isError: true;
|
|
13
20
|
isPending: false;
|
|
@@ -29,12 +36,12 @@ export declare const useGetFormDefaultsQuery: ({ formId, enabled }: GetFormDefau
|
|
|
29
36
|
isPaused: boolean;
|
|
30
37
|
isRefetching: boolean;
|
|
31
38
|
isStale: boolean;
|
|
32
|
-
refetch: (options?: import('@tanstack/query-core').RefetchOptions) => Promise<import('@tanstack/query-core').QueryObserverResult<
|
|
39
|
+
refetch: (options?: import('@tanstack/query-core').RefetchOptions) => Promise<import('@tanstack/query-core').QueryObserverResult<IFormDefaultsWithMeta, Error>>;
|
|
33
40
|
fetchStatus: import('@tanstack/query-core').FetchStatus;
|
|
34
|
-
promise: Promise<
|
|
41
|
+
promise: Promise<IFormDefaultsWithMeta>;
|
|
35
42
|
enabledRef: import('react').MutableRefObject<boolean>;
|
|
36
43
|
} | {
|
|
37
|
-
data:
|
|
44
|
+
data: IFormDefaultsWithMeta;
|
|
38
45
|
error: null;
|
|
39
46
|
isError: false;
|
|
40
47
|
isPending: false;
|
|
@@ -56,9 +63,9 @@ export declare const useGetFormDefaultsQuery: ({ formId, enabled }: GetFormDefau
|
|
|
56
63
|
isPaused: boolean;
|
|
57
64
|
isRefetching: boolean;
|
|
58
65
|
isStale: boolean;
|
|
59
|
-
refetch: (options?: import('@tanstack/query-core').RefetchOptions) => Promise<import('@tanstack/query-core').QueryObserverResult<
|
|
66
|
+
refetch: (options?: import('@tanstack/query-core').RefetchOptions) => Promise<import('@tanstack/query-core').QueryObserverResult<IFormDefaultsWithMeta, Error>>;
|
|
60
67
|
fetchStatus: import('@tanstack/query-core').FetchStatus;
|
|
61
|
-
promise: Promise<
|
|
68
|
+
promise: Promise<IFormDefaultsWithMeta>;
|
|
62
69
|
enabledRef: import('react').MutableRefObject<boolean>;
|
|
63
70
|
} | {
|
|
64
71
|
data: undefined;
|
|
@@ -83,9 +90,9 @@ export declare const useGetFormDefaultsQuery: ({ formId, enabled }: GetFormDefau
|
|
|
83
90
|
isPaused: boolean;
|
|
84
91
|
isRefetching: boolean;
|
|
85
92
|
isStale: boolean;
|
|
86
|
-
refetch: (options?: import('@tanstack/query-core').RefetchOptions) => Promise<import('@tanstack/query-core').QueryObserverResult<
|
|
93
|
+
refetch: (options?: import('@tanstack/query-core').RefetchOptions) => Promise<import('@tanstack/query-core').QueryObserverResult<IFormDefaultsWithMeta, Error>>;
|
|
87
94
|
fetchStatus: import('@tanstack/query-core').FetchStatus;
|
|
88
|
-
promise: Promise<
|
|
95
|
+
promise: Promise<IFormDefaultsWithMeta>;
|
|
89
96
|
enabledRef: import('react').MutableRefObject<boolean>;
|
|
90
97
|
} | {
|
|
91
98
|
data: undefined;
|
|
@@ -110,9 +117,9 @@ export declare const useGetFormDefaultsQuery: ({ formId, enabled }: GetFormDefau
|
|
|
110
117
|
isPaused: boolean;
|
|
111
118
|
isRefetching: boolean;
|
|
112
119
|
isStale: boolean;
|
|
113
|
-
refetch: (options?: import('@tanstack/query-core').RefetchOptions) => Promise<import('@tanstack/query-core').QueryObserverResult<
|
|
120
|
+
refetch: (options?: import('@tanstack/query-core').RefetchOptions) => Promise<import('@tanstack/query-core').QueryObserverResult<IFormDefaultsWithMeta, Error>>;
|
|
114
121
|
fetchStatus: import('@tanstack/query-core').FetchStatus;
|
|
115
|
-
promise: Promise<
|
|
122
|
+
promise: Promise<IFormDefaultsWithMeta>;
|
|
116
123
|
enabledRef: import('react').MutableRefObject<boolean>;
|
|
117
124
|
} | {
|
|
118
125
|
data: undefined;
|
|
@@ -137,12 +144,12 @@ export declare const useGetFormDefaultsQuery: ({ formId, enabled }: GetFormDefau
|
|
|
137
144
|
isPaused: boolean;
|
|
138
145
|
isRefetching: boolean;
|
|
139
146
|
isStale: boolean;
|
|
140
|
-
refetch: (options?: import('@tanstack/query-core').RefetchOptions) => Promise<import('@tanstack/query-core').QueryObserverResult<
|
|
147
|
+
refetch: (options?: import('@tanstack/query-core').RefetchOptions) => Promise<import('@tanstack/query-core').QueryObserverResult<IFormDefaultsWithMeta, Error>>;
|
|
141
148
|
fetchStatus: import('@tanstack/query-core').FetchStatus;
|
|
142
|
-
promise: Promise<
|
|
149
|
+
promise: Promise<IFormDefaultsWithMeta>;
|
|
143
150
|
enabledRef: import('react').MutableRefObject<boolean>;
|
|
144
151
|
} | {
|
|
145
|
-
data:
|
|
152
|
+
data: IFormDefaultsWithMeta;
|
|
146
153
|
isError: false;
|
|
147
154
|
error: null;
|
|
148
155
|
isPending: false;
|
|
@@ -164,9 +171,9 @@ export declare const useGetFormDefaultsQuery: ({ formId, enabled }: GetFormDefau
|
|
|
164
171
|
isPaused: boolean;
|
|
165
172
|
isRefetching: boolean;
|
|
166
173
|
isStale: boolean;
|
|
167
|
-
refetch: (options?: import('@tanstack/query-core').RefetchOptions) => Promise<import('@tanstack/query-core').QueryObserverResult<
|
|
174
|
+
refetch: (options?: import('@tanstack/query-core').RefetchOptions) => Promise<import('@tanstack/query-core').QueryObserverResult<IFormDefaultsWithMeta, Error>>;
|
|
168
175
|
fetchStatus: import('@tanstack/query-core').FetchStatus;
|
|
169
|
-
promise: Promise<
|
|
176
|
+
promise: Promise<IFormDefaultsWithMeta>;
|
|
170
177
|
enabledRef: import('react').MutableRefObject<boolean>;
|
|
171
178
|
};
|
|
172
179
|
//# sourceMappingURL=fetchDefaults.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"fetchDefaults.d.ts","sourceRoot":"","sources":["../../../../src/features/connector-library/api/fetchDefaults.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"fetchDefaults.d.ts","sourceRoot":"","sources":["../../../../src/features/connector-library/api/fetchDefaults.ts"],"names":[],"mappings":"AAQA,OAAO,EAAqB,OAAO,EAAE,MAAM,kBAAkB,CAAC;AAG9D,MAAM,WAAW,mBAAmB;IAClC,MAAM,EAAE,MAAM,GAAG,MAAM,CAAC;CACzB;AAED,MAAM,WAAW,wBAAyB,SAAQ,mBAAmB;IACnE,OAAO,EAAE,OAAO,CAAC;CAClB;AAUD,MAAM,WAAW,qBAAqB;IACpC,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IAChC,uFAAuF;IACvF,WAAW,EAAE,OAAO,CAAC;IACrB,mBAAmB,EAAE,MAAM,EAAE,CAAC;CAC/B;AAED,eAAO,MAAM,yBAAyB,eAAsB,mBAAmB,KAAG,OAAO,CAAC,qBAAqB,CAoB9G,CAAC;AAEF,eAAO,MAAM,oBAAoB,eAAgB,mBAAmB,wBAKnE,CAAC;AAEF,eAAO,MAAM,uBAAuB,wBAAyB,wBAAwB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAmBpF,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/features/connector-library/components/connector-info-card/index.tsx"],"names":[],"mappings":"AA6BA,OAAO,EAAE,cAAc,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAC;AAkB7D,UAAU,iBAAiB;IACzB,QAAQ,EAAE,cAAc,GAAG,QAAQ,CAAC;IACpC,kBAAkB,EAAE,MAAM,CAAC;IAC3B,mBAAmB,CAAC,EAAE,OAAO,CAAC;IAC9B,mBAAmB,EAAE,CAAC,CAAC,EAAE,OAAO,KAAK,IAAI,CAAC;CAC3C;AAED,eAAO,MAAM,iBAAiB,6GAK3B,iBAAiB,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/features/connector-library/components/connector-info-card/index.tsx"],"names":[],"mappings":"AA6BA,OAAO,EAAE,cAAc,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAC;AAkB7D,UAAU,iBAAiB;IACzB,QAAQ,EAAE,cAAc,GAAG,QAAQ,CAAC;IACpC,kBAAkB,EAAE,MAAM,CAAC;IAC3B,mBAAmB,CAAC,EAAE,OAAO,CAAC;IAC9B,mBAAmB,EAAE,CAAC,CAAC,EAAE,OAAO,KAAK,IAAI,CAAC;CAC3C;AAED,eAAO,MAAM,iBAAiB,6GAK3B,iBAAiB,4CAoRnB,CAAC"}
|
|
@@ -10,8 +10,12 @@ export type MapFormDefaultsProps = {
|
|
|
10
10
|
customFormArgsMap?: Record<string, unknown>;
|
|
11
11
|
title?: string;
|
|
12
12
|
isLoading?: boolean;
|
|
13
|
+
/** App name for the "Prefill Default Saved" event (e.g. "Linear"). */
|
|
14
|
+
appName?: string;
|
|
15
|
+
/** Connector form creation time (ISO string), for `days_since_form_created`. */
|
|
16
|
+
formCreatedAt?: string | null;
|
|
13
17
|
onSuccess?: (data: PutFormDefaultProps) => void;
|
|
14
18
|
onClose?: () => void;
|
|
15
19
|
};
|
|
16
|
-
export declare const MapFormDefaults: ({ open, formId, fields, connectorLogo, variables, customFormArgsEnabled, customFormArgsMap, title, isLoading, onSuccess, onClose }: MapFormDefaultsProps) => import("react/jsx-runtime").JSX.Element;
|
|
20
|
+
export declare const MapFormDefaults: ({ open, formId, fields, connectorLogo, variables, customFormArgsEnabled, customFormArgsMap, title, isLoading, appName, formCreatedAt, onSuccess, onClose }: MapFormDefaultsProps) => import("react/jsx-runtime").JSX.Element;
|
|
17
21
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/features/connector-library/components/map-form-defaults/index.tsx"],"names":[],"mappings":"AAOA,OAAO,EAA8B,mBAAmB,EAAE,MAAM,uBAAuB,CAAC;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/features/connector-library/components/map-form-defaults/index.tsx"],"names":[],"mappings":"AAOA,OAAO,EAA8B,mBAAmB,EAAE,MAAM,uBAAuB,CAAC;AAKxF,OAAO,KAAK,EAAE,SAAS,EAAE,QAAQ,EAA0C,MAAM,eAAe,CAAC;AAEjG,MAAM,MAAM,oBAAoB,GAAG;IACjC,IAAI,EAAE,OAAO,CAAC;IACd,MAAM,EAAE,MAAM,CAAC;IACf,MAAM,EAAE,SAAS,EAAE,CAAC;IACpB,aAAa,EAAE,MAAM,CAAC;IACtB,SAAS,EAAE,QAAQ,EAAE,CAAC;IACtB,qBAAqB,EAAE,OAAO,CAAC;IAC/B,iBAAiB,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IAC5C,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,sEAAsE;IACtE,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,gFAAgF;IAChF,aAAa,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAC9B,SAAS,CAAC,EAAE,CAAC,IAAI,EAAE,mBAAmB,KAAK,IAAI,CAAC;IAChD,OAAO,CAAC,EAAE,MAAM,IAAI,CAAC;CACtB,CAAC;AAEF,eAAO,MAAM,eAAe,+JAczB,oBAAoB,4CAiHtB,CAAC"}
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import { ApiData } from '@connector/utils';
|
|
2
|
+
/**
|
|
3
|
+
* "Prefill Default Saved" (PRD: Analytics). Fires once per system-default field
|
|
4
|
+
* that the admin removed or replaced when saving the "Pre-fill fields" drawer.
|
|
5
|
+
* System defaults are the title/description templates the backend injects on the
|
|
6
|
+
* defaults read (`system_default_fields`, ticket 02) until an admin first saves.
|
|
7
|
+
*/
|
|
8
|
+
export declare const PREFILL_DEFAULT_SAVED_EVENT = "Prefill Default Saved";
|
|
9
|
+
export type PrefillDefaultChangeType = 'removed' | 'replaced';
|
|
10
|
+
export interface IPrefillDefaultSavedEventData {
|
|
11
|
+
app: string;
|
|
12
|
+
field: string;
|
|
13
|
+
change_type: PrefillDefaultChangeType;
|
|
14
|
+
new_value_added: 'Yes' | 'No';
|
|
15
|
+
/** Whole days since the connector form was created; null when the backend did not send a creation time. */
|
|
16
|
+
days_since_form_created: number | null;
|
|
17
|
+
}
|
|
18
|
+
export interface IGetPrefillDefaultSavedEventsArgs {
|
|
19
|
+
app: string;
|
|
20
|
+
/** Keys the defaults read injected (`system_default_fields`). */
|
|
21
|
+
systemDefaultFields: string[];
|
|
22
|
+
/** Raw defaults from the same read: `label` carries the injected template. */
|
|
23
|
+
injectedDefaults: ApiData;
|
|
24
|
+
/** The `defaults` payload sent on PUT. */
|
|
25
|
+
savedDefaults: Record<string, unknown>;
|
|
26
|
+
formCreatedAt?: string | number | null;
|
|
27
|
+
now?: Date;
|
|
28
|
+
}
|
|
29
|
+
/** Whole days (floored, never negative) between the form's creation time and `now`. */
|
|
30
|
+
export declare const daysSinceFormCreated: (createdAt: string | number | null | undefined, now?: Date) => number | null;
|
|
31
|
+
/**
|
|
32
|
+
* Builds one event per system-default field the admin removed (key absent from
|
|
33
|
+
* the saved payload, or saved empty) or replaced (label differs from the
|
|
34
|
+
* injected template). Unchanged fields, and reads without system defaults,
|
|
35
|
+
* produce nothing.
|
|
36
|
+
*/
|
|
37
|
+
export declare const getPrefillDefaultSavedEvents: ({ app, systemDefaultFields, injectedDefaults, savedDefaults, formCreatedAt, now }: IGetPrefillDefaultSavedEventsArgs) => IPrefillDefaultSavedEventData[];
|
|
38
|
+
//# sourceMappingURL=prefillDefaultSaved.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"prefillDefaultSaved.d.ts","sourceRoot":"","sources":["../../../../src/features/connector-library/utils/prefillDefaultSaved.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,kBAAkB,CAAC;AAEhD;;;;;GAKG;AACH,eAAO,MAAM,2BAA2B,0BAA0B,CAAC;AAInE,MAAM,MAAM,wBAAwB,GAAG,SAAS,GAAG,UAAU,CAAC;AAE9D,MAAM,WAAW,6BAA6B;IAC5C,GAAG,EAAE,MAAM,CAAC;IACZ,KAAK,EAAE,MAAM,CAAC;IACd,WAAW,EAAE,wBAAwB,CAAC;IACtC,eAAe,EAAE,KAAK,GAAG,IAAI,CAAC;IAC9B,2GAA2G;IAC3G,uBAAuB,EAAE,MAAM,GAAG,IAAI,CAAC;CACxC;AAED,MAAM,WAAW,iCAAiC;IAChD,GAAG,EAAE,MAAM,CAAC;IACZ,iEAAiE;IACjE,mBAAmB,EAAE,MAAM,EAAE,CAAC;IAC9B,8EAA8E;IAC9E,gBAAgB,EAAE,OAAO,CAAC;IAC1B,0CAA0C;IAC1C,aAAa,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IACvC,aAAa,CAAC,EAAE,MAAM,GAAG,MAAM,GAAG,IAAI,CAAC;IACvC,GAAG,CAAC,EAAE,IAAI,CAAC;CACZ;AAED,uFAAuF;AACvF,eAAO,MAAM,oBAAoB,cACpB,MAAM,GAAG,MAAM,GAAG,IAAI,GAAG,SAAS,QACxC,IAAI,KACR,MAAM,GAAG,IAKX,CAAC;AAiBF;;;;;GAKG;AACH,eAAO,MAAM,4BAA4B,sFAOtC,iCAAiC,KAAG,6BAA6B,EA2BnE,CAAC"}
|