@amp-labs/react 2.4.3 → 2.4.5

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/build/index.d.ts CHANGED
@@ -1,8 +1,6 @@
1
1
  import { Config } from '../../generated-sources/api/src';
2
2
  import { Connection } from '../../generated-sources/api/src';
3
3
  import { default as default_2 } from 'react';
4
- import { HydratedIntegrationFieldExistent } from '../../generated-sources/api/src';
5
- import { IntegrationFieldMapping } from '../../generated-sources/api/src';
6
4
  import { JSX as JSX_2 } from 'react/jsx-runtime';
7
5
 
8
6
  export declare const AmpersandContext: default_2.Context<null>;
@@ -56,27 +54,35 @@ declare interface ConnectProviderProps {
56
54
  onDisconnectSuccess?: (connection: Connection) => void;
57
55
  }
58
56
 
59
- export declare function FieldMapping({ field, onSelectChange, allFields }: FieldMappingProps): JSX_2.Element;
60
-
61
- declare type FieldMapping_2 = {
62
- [key: string]: Array<FieldMappingWithMappedValues>;
57
+ /**
58
+ * A map of object names to FieldMappingEntry arrays, with each FieldMappingEntry representing a field.
59
+ */
60
+ export declare type FieldMapping = {
61
+ [key: string]: Array<FieldMappingEntry>;
63
62
  };
64
63
 
65
- declare interface FieldMappingProps {
66
- field: IntegrationFieldMapping;
67
- onSelectChange: (e: React.ChangeEvent<HTMLSelectElement>) => void;
68
- allFields: HydratedIntegrationFieldExistent[];
69
- }
70
-
71
- declare type FieldMappingWithMappedValues = IntegrationFieldMapping & {
64
+ export declare type FieldMappingEntry = {
72
65
  /**
73
- * The name of the field to map from the source
66
+ * The name of the field in your application.
74
67
  */
75
- fieldName?: string;
68
+ mapToName: string;
69
+ /**
70
+ * Optional display name of the field to show the user in the mapping UI.
71
+ */
72
+ mapToDisplayName?: string;
76
73
  /**
77
- * The app-specific values to map provider API values to
74
+ * Optional prompt to show the user in the mapping UI.
75
+ */
76
+ prompt?: string;
77
+ /**
78
+ * If you would like the user to map a set of possible values,
79
+ * this is the list of possible values of the field in your application.
78
80
  */
79
81
  mappedValues?: MappedValue[];
82
+ /**
83
+ * The name of the field in SaaS provider, if present, then we will not prompt the user to map the field.
84
+ */
85
+ fieldName?: string;
80
86
  };
81
87
 
82
88
  export declare function InstallIntegration({ integration, consumerRef, consumerName, groupRef, groupName, onInstallSuccess, onUpdateSuccess, onUninstallSuccess, fieldMapping, }: InstallIntegrationProps): JSX_2.Element;
@@ -106,7 +112,7 @@ declare interface InstallIntegrationProps {
106
112
  * Dynamic field mappings that need to be filled out by a consumer.
107
113
  * @experimental
108
114
  */
109
- fieldMapping?: FieldMapping_2;
115
+ fieldMapping?: FieldMapping;
110
116
  onInstallSuccess?: (installationId: string, config: Config) => void;
111
117
  onUpdateSuccess?: (installationId: string, config: Config) => void;
112
118
  onUninstallSuccess?: (installationId: string) => void;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@amp-labs/react",
3
- "version": "2.4.3",
3
+ "version": "2.4.5",
4
4
  "description": "Ampersand React library.",
5
5
  "author": {
6
6
  "name": "Ampersand Labs",