@hiver/connector-agent 4.19.0-attachment-beta.5 → 4.19.0-attachment-beta.7
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-cards/api/attachment-data.d.ts +27 -0
- package/features/connector-cards/api/attachment-data.d.ts.map +1 -0
- package/features/connector-cards/components/card-list/CardContent.d.ts.map +1 -1
- package/features/connector-cards/components/card-list/attachment/attachment-field.d.ts +13 -0
- package/features/connector-cards/components/card-list/attachment/attachment-field.d.ts.map +1 -0
- package/features/connector-cards/components/card-list/attachment/card-attachment-list.d.ts +2 -1
- package/features/connector-cards/components/card-list/attachment/card-attachment-list.d.ts.map +1 -1
- package/features/connector-cards/components/card-list/attachment/styles.d.ts.map +1 -1
- package/features/connector-cards/components/card-list/card-content-value.d.ts +2 -0
- package/features/connector-cards/components/card-list/card-content-value.d.ts.map +1 -1
- package/features/connector-cards/constants/api.d.ts +3 -0
- package/features/connector-cards/constants/api.d.ts.map +1 -1
- package/index.es.js +7498 -7394
- package/index.umd.js +458 -437
- package/package.json +1 -1
- package/testing/mocks/handlers/attachments.d.ts.map +1 -1
- package/testing/mocks/handlers/fetch-cards.d.ts +30 -2
- package/testing/mocks/handlers/fetch-cards.d.ts.map +1 -1
- package/types/cards.d.ts +5 -0
- package/types/cards.d.ts.map +1 -1
- package/utils/__tests__/poll.test.d.ts +2 -0
- package/utils/__tests__/poll.test.d.ts.map +1 -0
- package/utils/poll.d.ts +8 -1
- package/utils/poll.d.ts.map +1 -1
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { IAttachmentDataResponse } from '../../../types/cards';
|
|
2
|
+
export type IAttachmentDataParams = {
|
|
3
|
+
cardId: string;
|
|
4
|
+
/** the attachment field's `key` (e.g. "attachments") */
|
|
5
|
+
key: string;
|
|
6
|
+
conversationId?: number;
|
|
7
|
+
externalResourceId?: string;
|
|
8
|
+
};
|
|
9
|
+
export declare const getAttachmentData: ({ cardId, key, conversationId, externalResourceId }: IAttachmentDataParams) => Promise<IAttachmentDataResponse>;
|
|
10
|
+
export type IUseAttachmentDataProps = IAttachmentDataParams & {
|
|
11
|
+
enabled?: boolean;
|
|
12
|
+
/** backoff schedule (ms) between polls; the last entry is reused if exceeded */
|
|
13
|
+
pollIntervals?: number[];
|
|
14
|
+
/** max total API calls before polling gives up */
|
|
15
|
+
maxCalls?: number;
|
|
16
|
+
};
|
|
17
|
+
/**
|
|
18
|
+
* Fetches fresh attachment data for one card field and polls until the backend
|
|
19
|
+
* reports `completed: true` (or the call cap is reached). Intermediate (in-flight)
|
|
20
|
+
* responses are pushed into the query cache so the rendered file list updates as
|
|
21
|
+
* files finish uploading. Polling stops early the moment `completed` is true.
|
|
22
|
+
*
|
|
23
|
+
* `data.value` always holds the latest attachment list seen — including after a
|
|
24
|
+
* poll times out, since the last intermediate result stays in the cache.
|
|
25
|
+
*/
|
|
26
|
+
export declare const useAttachmentData: ({ cardId, key, conversationId, externalResourceId, enabled, pollIntervals, maxCalls }: IUseAttachmentDataProps) => import('@tanstack/react-query').UseQueryResult<IAttachmentDataResponse, Error>;
|
|
27
|
+
//# sourceMappingURL=attachment-data.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"attachment-data.d.ts","sourceRoot":"","sources":["../../../../src/features/connector-cards/api/attachment-data.ts"],"names":[],"mappings":"AAOA,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,eAAe,CAAC;AAO7D,MAAM,MAAM,qBAAqB,GAAG;IAClC,MAAM,EAAE,MAAM,CAAC;IACf,wDAAwD;IACxD,GAAG,EAAE,MAAM,CAAC;IACZ,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,kBAAkB,CAAC,EAAE,MAAM,CAAC;CAC7B,CAAC;AAIF,eAAO,MAAM,iBAAiB,wDAK3B,qBAAqB,KAAG,OAAO,CAAC,uBAAuB,CAazD,CAAC;AAEF,MAAM,MAAM,uBAAuB,GAAG,qBAAqB,GAAG;IAC5D,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,gFAAgF;IAChF,aAAa,CAAC,EAAE,MAAM,EAAE,CAAC;IACzB,kDAAkD;IAClD,QAAQ,CAAC,EAAE,MAAM,CAAC;CACnB,CAAC;AAIF;;;;;;;;GAQG;AACH,eAAO,MAAM,iBAAiB,0FAQ3B,uBAAuB,mFAiCzB,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CardContent.d.ts","sourceRoot":"","sources":["../../../../../src/features/connector-cards/components/card-list/CardContent.tsx"],"names":[],"mappings":"AAUA,OAAO,EAAY,KAAK,EAAE,aAAa,EAAE,MAAM,eAAe,CAAC;AAC/D,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AASxC,UAAU,MAAM;IACd,EAAE,EAAE,MAAM,CAAC;IACX,SAAS,EAAE,MAAM,CAAC;IAClB,WAAW,CAAC,EAAE,KAAK,CAAC;IACpB,gBAAgB,EAAE;QAChB,CAAC,GAAG,EAAE,MAAM,GAAG,aAAa,GAAG,IAAI,CAAC;KACrC,GAAG,IAAI,CAAC;IACT,0BAA0B,EAAE;QAC1B,CAAC,GAAG,EAAE,MAAM,GAAG,SAAS,CAAC;KAC1B,GAAG,IAAI,CAAC;IACT,MAAM,EAAE,OAAO,CAAC;CACjB;AAED,eAAO,MAAM,WAAW,UAAW,MAAM,
|
|
1
|
+
{"version":3,"file":"CardContent.d.ts","sourceRoot":"","sources":["../../../../../src/features/connector-cards/components/card-list/CardContent.tsx"],"names":[],"mappings":"AAUA,OAAO,EAAY,KAAK,EAAE,aAAa,EAAE,MAAM,eAAe,CAAC;AAC/D,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AASxC,UAAU,MAAM;IACd,EAAE,EAAE,MAAM,CAAC;IACX,SAAS,EAAE,MAAM,CAAC;IAClB,WAAW,CAAC,EAAE,KAAK,CAAC;IACpB,gBAAgB,EAAE;QAChB,CAAC,GAAG,EAAE,MAAM,GAAG,aAAa,GAAG,IAAI,CAAC;KACrC,GAAG,IAAI,CAAC;IACT,0BAA0B,EAAE;QAC1B,CAAC,GAAG,EAAE,MAAM,GAAG,SAAS,CAAC;KAC1B,GAAG,IAAI,CAAC;IACT,MAAM,EAAE,OAAO,CAAC;CACjB;AAED,eAAO,MAAM,WAAW,UAAW,MAAM,4CAoKxC,CAAC"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { ICardAttachment } from '../../../../../types/cards';
|
|
2
|
+
interface IAttachmentFieldProps {
|
|
3
|
+
/** possibly-stale list from the card read payload; shown until fresh data arrives */
|
|
4
|
+
initialAttachments: ICardAttachment[];
|
|
5
|
+
/** raw card id (ICard.id) — the `:cardId` path param, not the composite item id */
|
|
6
|
+
cardId?: string;
|
|
7
|
+
externalResourceId?: string;
|
|
8
|
+
/** the attachment field's `key` (query param) */
|
|
9
|
+
fieldKey?: string;
|
|
10
|
+
}
|
|
11
|
+
export declare const AttachmentField: ({ initialAttachments, cardId, externalResourceId, fieldKey }: IAttachmentFieldProps) => import("react/jsx-runtime").JSX.Element;
|
|
12
|
+
export {};
|
|
13
|
+
//# sourceMappingURL=attachment-field.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"attachment-field.d.ts","sourceRoot":"","sources":["../../../../../../src/features/connector-cards/components/card-list/attachment/attachment-field.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,eAAe,CAAC;AAIrD,UAAU,qBAAqB;IAC7B,qFAAqF;IACrF,kBAAkB,EAAE,eAAe,EAAE,CAAC;IACtC,mFAAmF;IACnF,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,kBAAkB,CAAC,EAAE,MAAM,CAAC;IAC5B,iDAAiD;IACjD,QAAQ,CAAC,EAAE,MAAM,CAAC;CACnB;AAMD,eAAO,MAAM,eAAe,iEAKzB,qBAAqB,4CAkBvB,CAAC"}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { ICardAttachment } from '../../../../../types/cards';
|
|
2
2
|
export interface ICardAttachmentListProps {
|
|
3
3
|
attachments: ICardAttachment[];
|
|
4
|
+
isLoading?: boolean;
|
|
4
5
|
}
|
|
5
|
-
export declare const CardAttachmentList: ({ attachments }: ICardAttachmentListProps) => import("react/jsx-runtime").JSX.Element;
|
|
6
|
+
export declare const CardAttachmentList: ({ attachments, isLoading }: ICardAttachmentListProps) => import("react/jsx-runtime").JSX.Element;
|
|
6
7
|
//# sourceMappingURL=card-attachment-list.d.ts.map
|
package/features/connector-cards/components/card-list/attachment/card-attachment-list.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"card-attachment-list.d.ts","sourceRoot":"","sources":["../../../../../../src/features/connector-cards/components/card-list/attachment/card-attachment-list.tsx"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,eAAe,CAAC;AAWrD,MAAM,WAAW,wBAAwB;IACvC,WAAW,EAAE,eAAe,EAAE,CAAC;
|
|
1
|
+
{"version":3,"file":"card-attachment-list.d.ts","sourceRoot":"","sources":["../../../../../../src/features/connector-cards/components/card-list/attachment/card-attachment-list.tsx"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,eAAe,CAAC;AAWrD,MAAM,WAAW,wBAAwB;IACvC,WAAW,EAAE,eAAe,EAAE,CAAC;IAG/B,SAAS,CAAC,EAAE,OAAO,CAAC;CACrB;AAsED,eAAO,MAAM,kBAAkB,+BAAwC,wBAAwB,4CAyB9F,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"styles.d.ts","sourceRoot":"","sources":["../../../../../../src/features/connector-cards/components/card-list/attachment/styles.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,QAAQ,EAAE,UAAU,EAAE,MAAM,qBAAqB,CAAC;AAChE,OAAO,EAAE,eAAe,EAAE,MAAM,iBAAiB,CAAC;AAsClD,eAAO,MAAM,cAAc,EAAE,eAAe,CAAC,UAAU,CAItD,CAAC;AAEF,eAAO,MAAM,oBAAoB,EAAE,eAAe,CAAC,GAAG,CAAC,iBAAiB,CAAC,QAAQ,CAAC,CAGjF,CAAC;AAEF,eAAO,MAAM,oBAAoB,EAAE,eAAe,CAAC,GAAG,CAAC,iBAAiB,CAAC,GAAG,CAAC,CAE5E,CAAC;AAGF,eAAO,MAAM,eAAe,EAAE,eAAe,CAAC,QAAQ,CASrD,CAAC;AAEF,eAAO,MAAM,QAAQ,EAAE,eAAe,CAAC,QAAQ,CAO9C,CAAC;AAGF,eAAO,MAAM,UAAU,EAAE,eAAe,CAAC,QAAQ,
|
|
1
|
+
{"version":3,"file":"styles.d.ts","sourceRoot":"","sources":["../../../../../../src/features/connector-cards/components/card-list/attachment/styles.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,QAAQ,EAAE,UAAU,EAAE,MAAM,qBAAqB,CAAC;AAChE,OAAO,EAAE,eAAe,EAAE,MAAM,iBAAiB,CAAC;AAsClD,eAAO,MAAM,cAAc,EAAE,eAAe,CAAC,UAAU,CAItD,CAAC;AAEF,eAAO,MAAM,oBAAoB,EAAE,eAAe,CAAC,GAAG,CAAC,iBAAiB,CAAC,QAAQ,CAAC,CAGjF,CAAC;AAEF,eAAO,MAAM,oBAAoB,EAAE,eAAe,CAAC,GAAG,CAAC,iBAAiB,CAAC,GAAG,CAAC,CAE5E,CAAC;AAGF,eAAO,MAAM,eAAe,EAAE,eAAe,CAAC,QAAQ,CASrD,CAAC;AAEF,eAAO,MAAM,QAAQ,EAAE,eAAe,CAAC,QAAQ,CAO9C,CAAC;AAGF,eAAO,MAAM,UAAU,EAAE,eAAe,CAAC,QAAQ,CAahD,CAAC"}
|
|
@@ -15,6 +15,8 @@ interface IProps {
|
|
|
15
15
|
isCardLevelError?: boolean;
|
|
16
16
|
fieldName?: string;
|
|
17
17
|
showErrorIcon?: boolean;
|
|
18
|
+
/** the field's `key`, used to fetch fresh attachment data for `type: 'attachment'` */
|
|
19
|
+
attachmentKey?: string;
|
|
18
20
|
}
|
|
19
21
|
export declare const CardContentValue: (props: IProps) => import("react/jsx-runtime").JSX.Element;
|
|
20
22
|
export {};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"card-content-value.d.ts","sourceRoot":"","sources":["../../../../../src/features/connector-cards/components/card-list/card-content-value.tsx"],"names":[],"mappings":"AAyBA,OAAO,EAAE,KAAK,EAAE,cAAc,EAAmB,MAAM,eAAe,CAAC;AAGvE,UAAU,MAAM;IACd,KAAK,CAAC,EAAE,cAAc,CAAC;IACvB,KAAK,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IACtB,QAAQ,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IACzB,UAAU,CAAC,EAAE,MAAM,GAAG,MAAM,GAAG,IAAI,CAAC;IACpC,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,IAAI,CAAC,EAAE,MAAM,GAAG,YAAY,CAAC;IAC7B,kBAAkB,CAAC,EAAE,OAAO,CAAC;IAC7B,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,cAAc,CAAC,EAAE,MAAM,EAAE,CAAC;IAC1B,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,WAAW,CAAC,EAAE,KAAK,CAAC;IACpB,MAAM,EAAE,MAAM,CAAC;IACf,gBAAgB,CAAC,EAAE,OAAO,CAAC;IAC3B,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,aAAa,CAAC,EAAE,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"card-content-value.d.ts","sourceRoot":"","sources":["../../../../../src/features/connector-cards/components/card-list/card-content-value.tsx"],"names":[],"mappings":"AAyBA,OAAO,EAAE,KAAK,EAAE,cAAc,EAAmB,MAAM,eAAe,CAAC;AAGvE,UAAU,MAAM;IACd,KAAK,CAAC,EAAE,cAAc,CAAC;IACvB,KAAK,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IACtB,QAAQ,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IACzB,UAAU,CAAC,EAAE,MAAM,GAAG,MAAM,GAAG,IAAI,CAAC;IACpC,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,IAAI,CAAC,EAAE,MAAM,GAAG,YAAY,CAAC;IAC7B,kBAAkB,CAAC,EAAE,OAAO,CAAC;IAC7B,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,cAAc,CAAC,EAAE,MAAM,EAAE,CAAC;IAC1B,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,WAAW,CAAC,EAAE,KAAK,CAAC;IACpB,MAAM,EAAE,MAAM,CAAC;IACf,gBAAgB,CAAC,EAAE,OAAO,CAAC;IAC3B,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,aAAa,CAAC,EAAE,OAAO,CAAC;IACxB,sFAAsF;IACtF,aAAa,CAAC,EAAE,MAAM,CAAC;CACxB;AAED,eAAO,MAAM,gBAAgB,UAAW,MAAM,4CAmM7C,CAAC"}
|
|
@@ -1,6 +1,9 @@
|
|
|
1
1
|
export declare const BASE_URL = "/v1/api";
|
|
2
2
|
export declare const FETCH_ALL_CARDS_API: string;
|
|
3
3
|
export declare const FETCH_SPECIFIC_CARD_API: string;
|
|
4
|
+
export declare const FETCH_ATTACHMENT_DATA_API: string;
|
|
5
|
+
export declare const ATTACHMENT_DATA_POLL_INTERVALS_MS: number[];
|
|
6
|
+
export declare const ATTACHMENT_DATA_MAX_CALLS = 5;
|
|
4
7
|
export declare const USER_AUTH_STATUS_API: string;
|
|
5
8
|
export declare const USER_AUTH_START_API: string;
|
|
6
9
|
//# sourceMappingURL=api.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"api.d.ts","sourceRoot":"","sources":["../../../../src/features/connector-cards/constants/api.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,QAAQ,YAAY,CAAC;AAClC,eAAO,MAAM,mBAAmB,EAAE,MAAuC,CAAC;AAC1E,eAAO,MAAM,uBAAuB,EAAE,MAAgD,CAAC;
|
|
1
|
+
{"version":3,"file":"api.d.ts","sourceRoot":"","sources":["../../../../src/features/connector-cards/constants/api.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,QAAQ,YAAY,CAAC;AAClC,eAAO,MAAM,mBAAmB,EAAE,MAAuC,CAAC;AAC1E,eAAO,MAAM,uBAAuB,EAAE,MAAgD,CAAC;AAGvF,eAAO,MAAM,yBAAyB,EAAE,MAA+D,CAAC;AAKxG,eAAO,MAAM,iCAAiC,EAAE,MAAM,EAAsC,CAAC;AAC7F,eAAO,MAAM,yBAAyB,IAAI,CAAC;AAI3C,eAAO,MAAM,oBAAoB,EAAE,MAA+D,CAAC;AACnG,eAAO,MAAM,mBAAmB,EAAE,MAA8D,CAAC"}
|