@useparagon/connect 2.3.1-experimental.20102.1 → 2.3.2-experimental.1
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/dist/src/ConnectSDK.d.ts +1 -1
- package/dist/src/ConnectSDK.js +1 -1
- package/dist/src/file-picker/integrations/box.d.ts +0 -1
- package/dist/src/index.js +1 -1
- package/dist/src/types/action.d.ts +1 -1
- package/dist/src/types/sdk.d.ts +4 -29
- package/dist/src/utils/connect.d.ts +11 -0
- package/dist/src/utils/generic.d.ts +0 -6
- package/package.json +7 -2
- package/dist/src/file-picker/helpers/normalizeFiles.d.ts +0 -42
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { ReactNode } from 'react';
|
|
1
|
+
import type { ReactNode } from 'react';
|
|
2
2
|
import { AuthenticationScheme } from '../entities/credential.interface';
|
|
3
3
|
import { CustomDropdownField, DynamicMappingField, DynamicMappingOptions, InstructionStage, SidebarInput } from './connect';
|
|
4
4
|
import { DataType, KeyedSource, Source } from './resolvers';
|
package/dist/src/types/sdk.d.ts
CHANGED
|
@@ -187,7 +187,7 @@ export interface IConnectSDK {
|
|
|
187
187
|
* @param path request path
|
|
188
188
|
* @param init request initialization options {method: httpMethod, body:RequestBody, header}
|
|
189
189
|
*/
|
|
190
|
-
request<TResponse>(action: string, path: string, init
|
|
190
|
+
request<TResponse>(action: string, path: string, init?: ProxyRequestOptions): Promise<TResponse | undefined>;
|
|
191
191
|
/**
|
|
192
192
|
* listen on connect sdk events
|
|
193
193
|
* @param eventName SDKEVENTS
|
|
@@ -471,30 +471,6 @@ export interface IFilePicker {
|
|
|
471
471
|
*/
|
|
472
472
|
getInstance(): unknown;
|
|
473
473
|
}
|
|
474
|
-
export type HashType = string;
|
|
475
|
-
export type UnifiedBase = {
|
|
476
|
-
/** Unique identifier for the record */
|
|
477
|
-
id: string;
|
|
478
|
-
/** External system's unique identifier for the record */
|
|
479
|
-
externalId: string;
|
|
480
|
-
/** ISO timestamp of when the record was created */
|
|
481
|
-
createdAt: string;
|
|
482
|
-
/** ISO timestamp of when the record was last updated */
|
|
483
|
-
updatedAt: string;
|
|
484
|
-
};
|
|
485
|
-
export type UnifiedFile = UnifiedBase & {
|
|
486
|
-
name: string;
|
|
487
|
-
mimeType: string;
|
|
488
|
-
size: number;
|
|
489
|
-
url: string;
|
|
490
|
-
thumbnailUrl?: string;
|
|
491
|
-
hash?: {
|
|
492
|
-
type: HashType;
|
|
493
|
-
value: string;
|
|
494
|
-
};
|
|
495
|
-
parentFolderId?: string;
|
|
496
|
-
customFields?: Record<string, unknown>;
|
|
497
|
-
};
|
|
498
474
|
export type FilePickerOptions = {
|
|
499
475
|
allowedTypes?: string[];
|
|
500
476
|
allowMultiSelect?: boolean;
|
|
@@ -502,7 +478,6 @@ export type FilePickerOptions = {
|
|
|
502
478
|
onOpen?: () => void;
|
|
503
479
|
onClose?: () => void;
|
|
504
480
|
onFileSelect?: (files: unknown) => void;
|
|
505
|
-
onFileSelectNormalized?: (files: UnifiedFile[]) => void;
|
|
506
481
|
onCancel?: () => void;
|
|
507
482
|
integrationOptions?: {
|
|
508
483
|
googledrive?: {
|
|
@@ -567,8 +542,8 @@ export type UpdateWorkflowStateResponse = {
|
|
|
567
542
|
};
|
|
568
543
|
export type ProxyRequestOptions = {
|
|
569
544
|
selectedCredentialId?: string;
|
|
570
|
-
method
|
|
571
|
-
body
|
|
572
|
-
headers
|
|
545
|
+
method?: RequestInit['method'];
|
|
546
|
+
body?: RequestInit['body'] | object;
|
|
547
|
+
headers?: RequestInit['headers'];
|
|
573
548
|
};
|
|
574
549
|
export {};
|
|
@@ -21,3 +21,14 @@ export declare function sanitizeExternalConfigId(externalId: string): string;
|
|
|
21
21
|
export declare const getHeadersForUserMeta: (userMeta?: PersonaMeta) => {
|
|
22
22
|
[x: string]: string;
|
|
23
23
|
};
|
|
24
|
+
/**
|
|
25
|
+
* Normalizes persona metadata keys to match DB conventions.
|
|
26
|
+
* `name` (any casing) -> `Name`, `email` (any casing) -> `Email`,
|
|
27
|
+
* all other keys are trimmed.
|
|
28
|
+
*/
|
|
29
|
+
export declare function normalizePersonaMeta(meta: PersonaMeta): PersonaMeta;
|
|
30
|
+
/**
|
|
31
|
+
* Checks whether incoming metadata (from request header) would produce
|
|
32
|
+
* a meaningful change when merged into the existing stored metadata.
|
|
33
|
+
*/
|
|
34
|
+
export declare function hasPersonaMetaChanged(incomingMeta: PersonaMeta, storedMeta: PersonaMeta | undefined | null): boolean;
|
|
@@ -28,12 +28,6 @@ export declare function generateMatrix<T extends Record<string, any>>(input: {
|
|
|
28
28
|
[k in keyof T]: T[k][];
|
|
29
29
|
}, limit?: number): T[];
|
|
30
30
|
export declare function sleep(milliseconds: number): Promise<void>;
|
|
31
|
-
/**
|
|
32
|
-
* Normalizes a plain object for comparison by sorting keys (key-order independent).
|
|
33
|
-
* Only handles objects; does not accept or recurse into arrays.
|
|
34
|
-
*/
|
|
35
|
-
export declare function normalizeForMetaCompare(value: Record<string, unknown>): Record<string, unknown>;
|
|
36
|
-
export declare function areObjectsEqual(a: Record<string, unknown>, b: Record<string, unknown>): boolean;
|
|
37
31
|
export declare const uuidPattern: RegExp;
|
|
38
32
|
export declare function isUUID(value: string | unknown): boolean;
|
|
39
33
|
/**
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@useparagon/connect",
|
|
3
|
-
"version": "2.3.
|
|
3
|
+
"version": "2.3.2-experimental.1",
|
|
4
4
|
"description": "Embed integrations into your app with the Paragon SDK",
|
|
5
5
|
"main": "dist/src/index.js",
|
|
6
6
|
"types": "dist/src/index.d.ts",
|
|
@@ -33,9 +33,12 @@
|
|
|
33
33
|
"clone-deep": "^4.0.1",
|
|
34
34
|
"hash.js": "^1.1.7",
|
|
35
35
|
"jwt-decode": "^3.1.2",
|
|
36
|
-
"
|
|
36
|
+
"lodash": "^4.17.23",
|
|
37
37
|
"tslib": "2.3.1"
|
|
38
38
|
},
|
|
39
|
+
"peerDependencies": {
|
|
40
|
+
"react": "^17 || ^18 || ^19"
|
|
41
|
+
},
|
|
39
42
|
"devDependencies": {
|
|
40
43
|
"@babel/core": "^7.12.3",
|
|
41
44
|
"@babel/preset-env": "^7.12.1",
|
|
@@ -46,6 +49,7 @@
|
|
|
46
49
|
"@types/gapi": "^0.0.47",
|
|
47
50
|
"@types/google.picker": "^0.0.42",
|
|
48
51
|
"@types/jest": "^29.5.1",
|
|
52
|
+
"@types/lodash": "^4.17.24",
|
|
49
53
|
"@types/node": "^18.13.0",
|
|
50
54
|
"@types/react": "^17.0.11",
|
|
51
55
|
"@types/react-dom": "^17.0.8",
|
|
@@ -77,6 +81,7 @@
|
|
|
77
81
|
"pkg": "^5.8.1",
|
|
78
82
|
"prettier": "^2.2.1",
|
|
79
83
|
"process": "^0.11.10",
|
|
84
|
+
"react": "^17.0.2",
|
|
80
85
|
"react-dom": "^17.0.2",
|
|
81
86
|
"rimraf": "^3.0.2",
|
|
82
87
|
"stream-browserify": "^3.0.0",
|
|
@@ -1,42 +0,0 @@
|
|
|
1
|
-
import { UnifiedFile } from '../../types';
|
|
2
|
-
type GooglePickerThumbnail = {
|
|
3
|
-
url?: string;
|
|
4
|
-
};
|
|
5
|
-
type GooglePickerDocument = {
|
|
6
|
-
id?: string;
|
|
7
|
-
name?: string;
|
|
8
|
-
mimeType?: string;
|
|
9
|
-
sizeBytes?: number;
|
|
10
|
-
url?: string;
|
|
11
|
-
thumbnails?: GooglePickerThumbnail[];
|
|
12
|
-
lastEditedUtc?: number | string;
|
|
13
|
-
parentId?: string;
|
|
14
|
-
};
|
|
15
|
-
type BoxPickerItemLike = {
|
|
16
|
-
id?: string;
|
|
17
|
-
name?: string;
|
|
18
|
-
size?: number;
|
|
19
|
-
created_at?: string;
|
|
20
|
-
modified_at?: string;
|
|
21
|
-
path_collection?: {
|
|
22
|
-
entries?: Array<{
|
|
23
|
-
id?: string;
|
|
24
|
-
name?: string;
|
|
25
|
-
type?: string;
|
|
26
|
-
}>;
|
|
27
|
-
};
|
|
28
|
-
shared_link?: {
|
|
29
|
-
url?: string;
|
|
30
|
-
download_url?: string;
|
|
31
|
-
permissions?: {
|
|
32
|
-
can_download?: boolean;
|
|
33
|
-
can_preview?: boolean;
|
|
34
|
-
};
|
|
35
|
-
};
|
|
36
|
-
};
|
|
37
|
-
export declare const normalizeGoogleDriveFiles: <T extends GooglePickerDocument>(data: {
|
|
38
|
-
docs?: T[] | undefined;
|
|
39
|
-
}) => UnifiedFile[];
|
|
40
|
-
export declare const normalizeBoxFiles: <T extends BoxPickerItemLike>(items: T[]) => UnifiedFile[];
|
|
41
|
-
export declare const normalizeMicrosoftFiles: (items: Record<string, unknown>[]) => UnifiedFile[];
|
|
42
|
-
export {};
|