@useparagon/connect 2.3.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.
@@ -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';
@@ -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: ProxyRequestOptions): Promise<TResponse | undefined>;
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
@@ -542,8 +542,8 @@ export type UpdateWorkflowStateResponse = {
542
542
  };
543
543
  export type ProxyRequestOptions = {
544
544
  selectedCredentialId?: string;
545
- method: RequestInit['method'];
546
- body: RequestInit['body'] | object;
547
- headers: RequestInit['headers'];
545
+ method?: RequestInit['method'];
546
+ body?: RequestInit['body'] | object;
547
+ headers?: RequestInit['headers'];
548
548
  };
549
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.1",
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
- "react": "^17.0.2",
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",