@amp-labs/react 1.0.1 → 1.0.2

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.
Files changed (190) hide show
  1. package/README.md +1 -1
  2. package/build/generated-sources/api/src/apis/DefaultApi.d.ts +48 -2
  3. package/build/generated-sources/api/src/apis/DefaultApi.js +51 -1
  4. package/build/generated-sources/api/src/models/BaseConfigContent.d.ts +8 -1
  5. package/build/generated-sources/api/src/models/BaseConfigContent.js +4 -1
  6. package/build/generated-sources/api/src/models/BaseReadConfig.d.ts +1 -1
  7. package/build/generated-sources/api/src/models/BaseReadConfig.js +1 -1
  8. package/build/generated-sources/api/src/models/BaseReadConfigStandardObject.d.ts +2 -2
  9. package/build/generated-sources/api/src/models/BaseReadConfigStandardObject.js +1 -1
  10. package/build/generated-sources/api/src/models/BaseWriteConfig.d.ts +34 -0
  11. package/build/generated-sources/api/src/models/BaseWriteConfig.js +51 -0
  12. package/build/generated-sources/api/src/models/BaseWriteConfigObject.d.ts +31 -0
  13. package/build/generated-sources/api/src/models/BaseWriteConfigObject.js +50 -0
  14. package/build/generated-sources/api/src/models/BatchUpsertIntegrationsRequest.d.ts +1 -1
  15. package/build/generated-sources/api/src/models/BatchUpsertIntegrationsRequest.js +1 -1
  16. package/build/generated-sources/api/src/models/Config.d.ts +1 -1
  17. package/build/generated-sources/api/src/models/Config.js +1 -1
  18. package/build/generated-sources/api/src/models/ConfigContent.d.ts +7 -1
  19. package/build/generated-sources/api/src/models/ConfigContent.js +3 -1
  20. package/build/generated-sources/api/src/models/ConfigContentAllOf.d.ts +7 -1
  21. package/build/generated-sources/api/src/models/ConfigContentAllOf.js +3 -1
  22. package/build/generated-sources/api/src/models/Connection.d.ts +1 -1
  23. package/build/generated-sources/api/src/models/Connection.js +1 -1
  24. package/build/generated-sources/api/src/models/Consumer.d.ts +1 -1
  25. package/build/generated-sources/api/src/models/Consumer.js +1 -1
  26. package/build/generated-sources/api/src/models/CreateConsumerRequest.d.ts +1 -1
  27. package/build/generated-sources/api/src/models/CreateConsumerRequest.js +1 -1
  28. package/build/generated-sources/api/src/models/CreateDestinationRequest.d.ts +1 -1
  29. package/build/generated-sources/api/src/models/CreateDestinationRequest.js +1 -1
  30. package/build/generated-sources/api/src/models/CreateDestinationRequestMetadata.d.ts +1 -1
  31. package/build/generated-sources/api/src/models/CreateDestinationRequestMetadata.js +1 -1
  32. package/build/generated-sources/api/src/models/CreateGroupRequest.d.ts +1 -1
  33. package/build/generated-sources/api/src/models/CreateGroupRequest.js +1 -1
  34. package/build/generated-sources/api/src/models/CreateInstallationRequest.d.ts +1 -1
  35. package/build/generated-sources/api/src/models/CreateInstallationRequest.js +1 -1
  36. package/build/generated-sources/api/src/models/CreateInstallationRequestConfig.d.ts +1 -1
  37. package/build/generated-sources/api/src/models/CreateInstallationRequestConfig.js +1 -1
  38. package/build/generated-sources/api/src/models/CreateIntegrationRequest.d.ts +1 -1
  39. package/build/generated-sources/api/src/models/CreateIntegrationRequest.js +1 -1
  40. package/build/generated-sources/api/src/models/CreateIntegrationRequestLatestRevision.d.ts +1 -1
  41. package/build/generated-sources/api/src/models/CreateIntegrationRequestLatestRevision.js +1 -1
  42. package/build/generated-sources/api/src/models/CreateProjectRequest.d.ts +1 -1
  43. package/build/generated-sources/api/src/models/CreateProjectRequest.js +1 -1
  44. package/build/generated-sources/api/src/models/CreateProviderAppRequest.d.ts +7 -1
  45. package/build/generated-sources/api/src/models/CreateProviderAppRequest.js +3 -1
  46. package/build/generated-sources/api/src/models/Group.d.ts +1 -1
  47. package/build/generated-sources/api/src/models/Group.js +1 -1
  48. package/build/generated-sources/api/src/models/HydratedIntegration.d.ts +8 -1
  49. package/build/generated-sources/api/src/models/HydratedIntegration.js +4 -1
  50. package/build/generated-sources/api/src/models/HydratedIntegrationField.d.ts +1 -1
  51. package/build/generated-sources/api/src/models/HydratedIntegrationField.js +1 -1
  52. package/build/generated-sources/api/src/models/HydratedIntegrationFieldExistent.d.ts +1 -1
  53. package/build/generated-sources/api/src/models/HydratedIntegrationFieldExistent.js +1 -1
  54. package/build/generated-sources/api/src/models/HydratedIntegrationObject.d.ts +1 -1
  55. package/build/generated-sources/api/src/models/HydratedIntegrationObject.js +1 -1
  56. package/build/generated-sources/api/src/models/HydratedIntegrationRead.d.ts +1 -1
  57. package/build/generated-sources/api/src/models/HydratedIntegrationRead.js +1 -1
  58. package/build/generated-sources/api/src/models/HydratedIntegrationWrite.d.ts +32 -0
  59. package/build/generated-sources/api/src/models/HydratedIntegrationWrite.js +51 -0
  60. package/build/generated-sources/api/src/models/HydratedIntegrationWriteObject.d.ts +37 -0
  61. package/build/generated-sources/api/src/models/HydratedIntegrationWriteObject.js +53 -0
  62. package/build/generated-sources/api/src/models/HydratedRevision.d.ts +1 -1
  63. package/build/generated-sources/api/src/models/HydratedRevision.js +1 -1
  64. package/build/generated-sources/api/src/models/ImportConnectionRequest.d.ts +1 -7
  65. package/build/generated-sources/api/src/models/ImportConnectionRequest.js +1 -4
  66. package/build/generated-sources/api/src/models/ImportInstallationRequest.d.ts +7 -1
  67. package/build/generated-sources/api/src/models/ImportInstallationRequest.js +4 -1
  68. package/build/generated-sources/api/src/models/ImportInstallationRequestConfig.d.ts +1 -1
  69. package/build/generated-sources/api/src/models/ImportInstallationRequestConfig.js +1 -1
  70. package/build/generated-sources/api/src/models/Installation.d.ts +1 -1
  71. package/build/generated-sources/api/src/models/Installation.js +1 -1
  72. package/build/generated-sources/api/src/models/Integration.d.ts +1 -1
  73. package/build/generated-sources/api/src/models/Integration.js +1 -1
  74. package/build/generated-sources/api/src/models/Integration1.d.ts +8 -1
  75. package/build/generated-sources/api/src/models/Integration1.js +4 -1
  76. package/build/generated-sources/api/src/models/IntegrationField.d.ts +1 -1
  77. package/build/generated-sources/api/src/models/IntegrationField.js +1 -1
  78. package/build/generated-sources/api/src/models/IntegrationFieldExistent.d.ts +1 -1
  79. package/build/generated-sources/api/src/models/IntegrationFieldExistent.js +1 -1
  80. package/build/generated-sources/api/src/models/IntegrationFieldMapping.d.ts +1 -1
  81. package/build/generated-sources/api/src/models/IntegrationFieldMapping.js +1 -1
  82. package/build/generated-sources/api/src/models/IntegrationObject.d.ts +1 -1
  83. package/build/generated-sources/api/src/models/IntegrationObject.js +1 -1
  84. package/build/generated-sources/api/src/models/IntegrationRead.d.ts +1 -1
  85. package/build/generated-sources/api/src/models/IntegrationRead.js +1 -1
  86. package/build/generated-sources/api/src/models/IntegrationWrite.d.ts +32 -0
  87. package/build/generated-sources/api/src/models/IntegrationWrite.js +51 -0
  88. package/build/generated-sources/api/src/models/IntegrationWriteObject.d.ts +31 -0
  89. package/build/generated-sources/api/src/models/IntegrationWriteObject.js +50 -0
  90. package/build/generated-sources/api/src/models/OauthConnectRequest.d.ts +1 -1
  91. package/build/generated-sources/api/src/models/OauthConnectRequest.js +1 -1
  92. package/build/generated-sources/api/src/models/Operation.d.ts +1 -1
  93. package/build/generated-sources/api/src/models/Operation.js +1 -1
  94. package/build/generated-sources/api/src/models/OperationError.d.ts +1 -1
  95. package/build/generated-sources/api/src/models/OperationError.js +1 -1
  96. package/build/generated-sources/api/src/models/OptionalFieldsAutoOption.d.ts +1 -1
  97. package/build/generated-sources/api/src/models/OptionalFieldsAutoOption.js +1 -1
  98. package/build/generated-sources/api/src/models/Project.d.ts +1 -1
  99. package/build/generated-sources/api/src/models/Project.js +1 -1
  100. package/build/generated-sources/api/src/models/ProjectMembership.d.ts +1 -1
  101. package/build/generated-sources/api/src/models/ProjectMembership.js +1 -1
  102. package/build/generated-sources/api/src/models/ProviderApp.d.ts +1 -1
  103. package/build/generated-sources/api/src/models/ProviderApp.js +1 -1
  104. package/build/generated-sources/api/src/models/Revision.d.ts +1 -1
  105. package/build/generated-sources/api/src/models/Revision.js +1 -1
  106. package/build/generated-sources/api/src/models/SignedUrl.d.ts +43 -0
  107. package/build/generated-sources/api/src/models/SignedUrl.js +56 -0
  108. package/build/generated-sources/api/src/models/UpdateInstallationConfigContent.d.ts +8 -1
  109. package/build/generated-sources/api/src/models/UpdateInstallationConfigContent.js +4 -1
  110. package/build/generated-sources/api/src/models/UpdateInstallationRequest.d.ts +1 -1
  111. package/build/generated-sources/api/src/models/UpdateInstallationRequest.js +1 -1
  112. package/build/generated-sources/api/src/models/UpdateInstallationRequestInstallation.d.ts +1 -1
  113. package/build/generated-sources/api/src/models/UpdateInstallationRequestInstallation.js +1 -1
  114. package/build/generated-sources/api/src/models/UpdateInstallationRequestInstallationConfig.d.ts +1 -1
  115. package/build/generated-sources/api/src/models/UpdateInstallationRequestInstallationConfig.js +1 -1
  116. package/build/generated-sources/api/src/models/UpdateProjectRequest.d.ts +1 -1
  117. package/build/generated-sources/api/src/models/UpdateProjectRequest.js +1 -1
  118. package/build/generated-sources/api/src/models/UpdateProjectRequestProject.d.ts +1 -1
  119. package/build/generated-sources/api/src/models/UpdateProjectRequestProject.js +1 -1
  120. package/build/generated-sources/api/src/models/UpdateProviderAppRequest.d.ts +1 -1
  121. package/build/generated-sources/api/src/models/UpdateProviderAppRequest.js +1 -1
  122. package/build/generated-sources/api/src/models/UpdateProviderAppRequestProviderApp.d.ts +7 -1
  123. package/build/generated-sources/api/src/models/UpdateProviderAppRequestProviderApp.js +3 -1
  124. package/build/generated-sources/api/src/models/UpsertProjectMembershipRequest.d.ts +1 -1
  125. package/build/generated-sources/api/src/models/UpsertProjectMembershipRequest.js +1 -1
  126. package/build/generated-sources/api/src/models/index.d.ts +7 -0
  127. package/build/generated-sources/api/src/models/index.js +7 -0
  128. package/build/generated-sources/api/src/runtime.d.ts +1 -1
  129. package/build/generated-sources/api/src/runtime.js +1 -1
  130. package/build/src/assets/NavIcon.d.ts +1 -0
  131. package/build/src/assets/NavIcon.js +3 -2
  132. package/build/src/assets/TrashIcon.d.ts +1 -0
  133. package/build/src/assets/TrashIcon.js +9 -0
  134. package/build/src/components/AmpersandProvider/AmpersandProvider.js +2 -2
  135. package/build/src/components/Configure/ConfigureInstallationBase.js +14 -2
  136. package/build/src/components/Configure/CreateInstallation.js +11 -14
  137. package/build/src/components/Configure/InstallIntegration.js +1 -2
  138. package/build/src/components/Configure/ObjectManagementNav/UninstallInstallation.d.ts +7 -0
  139. package/build/src/components/Configure/ObjectManagementNav/UninstallInstallation.js +15 -0
  140. package/build/src/components/Configure/ObjectManagementNav/index.js +13 -6
  141. package/build/src/components/Configure/ProtectedConnectionLayout.d.ts +7 -2
  142. package/build/src/components/Configure/ProtectedConnectionLayout.js +10 -5
  143. package/build/src/components/Configure/UninstallContent.d.ts +1 -0
  144. package/build/src/components/Configure/UninstallContent.js +37 -0
  145. package/build/src/components/Configure/UpdateInstallation.js +10 -21
  146. package/build/src/components/Configure/fields/{FieldMapping.d.ts → FieldMappings/FieldMapping.d.ts} +2 -3
  147. package/build/src/components/Configure/fields/{FieldMapping.js → FieldMappings/FieldMapping.js} +12 -11
  148. package/build/src/components/Configure/fields/{RequiredFieldMappings.js → FieldMappings/RequiredFieldMappings.js} +9 -9
  149. package/build/src/components/Configure/fields/FieldMappings/index.d.ts +3 -0
  150. package/build/src/components/Configure/fields/FieldMappings/index.js +7 -0
  151. package/build/src/components/Configure/fields/FieldMappings/setFieldMapping.d.ts +3 -0
  152. package/build/src/components/Configure/fields/FieldMappings/setFieldMapping.js +18 -0
  153. package/build/src/components/Configure/fields/{OptionalFields.js → OptionalFields/OptionalFields.js} +8 -19
  154. package/build/src/components/Configure/fields/OptionalFields/index.d.ts +2 -0
  155. package/build/src/components/Configure/fields/OptionalFields/index.js +5 -0
  156. package/build/src/components/Configure/fields/OptionalFields/setOptionalField.d.ts +3 -0
  157. package/build/src/components/Configure/fields/OptionalFields/setOptionalField.js +21 -0
  158. package/build/src/components/Configure/state/ConfigurationStateProvider.d.ts +47 -1
  159. package/build/src/components/Configure/state/ConfigurationStateProvider.js +28 -6
  160. package/build/src/components/Configure/state/HydratedRevisionContext.js +3 -6
  161. package/build/src/components/Configure/state/utils.d.ts +4 -16
  162. package/build/src/components/Configure/state/utils.js +28 -63
  163. package/build/src/components/Configure/types.d.ts +6 -9
  164. package/build/src/components/Configure/utils.d.ts +6 -4
  165. package/build/src/components/Configure/utils.js +17 -16
  166. package/build/src/components/Connect/ConnectProvider.d.ts +9 -0
  167. package/build/src/components/Connect/ConnectProvider.js +18 -0
  168. package/build/src/components/{OAuthPopup → Connect}/OAuthPopup.js +3 -3
  169. package/build/src/components/Salesforce/SalesforceOauthFlow.js +41 -30
  170. package/build/src/components/ThemeProvider/Button/buttonTheme.d.ts +13 -0
  171. package/build/src/components/ThemeProvider/Button/buttonTheme.js +17 -0
  172. package/build/src/components/ThemeProvider/Button/index.d.ts +2 -0
  173. package/build/src/components/ThemeProvider/Button/index.js +5 -0
  174. package/build/src/components/ThemeProvider/index.js +21 -0
  175. package/build/src/components/index.d.ts +1 -0
  176. package/build/src/components/index.js +1 -0
  177. package/build/src/context/{ApiKeyContext.d.ts → ApiKeyProvider.d.ts} +1 -0
  178. package/build/src/context/ApiKeyProvider.js +14 -0
  179. package/build/src/context/ConnectionsContext.d.ts +5 -4
  180. package/build/src/context/ConnectionsContext.js +13 -5
  181. package/build/src/context/InstallIntegrationContext.d.ts +1 -0
  182. package/build/src/context/InstallIntegrationContext.js +15 -10
  183. package/build/src/context/IntegrationListContext.js +3 -3
  184. package/build/src/context/ProjectContext.js +3 -3
  185. package/build/src/hooks/useIsIntegrationInstalled.js +2 -2
  186. package/package.json +4 -3
  187. package/build/src/context/ApiKeyContext.js +0 -6
  188. /package/build/src/components/Configure/fields/{RequiredFieldMappings.d.ts → FieldMappings/RequiredFieldMappings.d.ts} +0 -0
  189. /package/build/src/components/Configure/fields/{OptionalFields.d.ts → OptionalFields/OptionalFields.d.ts} +0 -0
  190. /package/build/src/components/{OAuthPopup → Connect}/OAuthPopup.d.ts +0 -0
@@ -0,0 +1,43 @@
1
+ /**
2
+ * Ampersand public API
3
+ * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
4
+ *
5
+ * The version of the OpenAPI document: 1.0.0
6
+ *
7
+ *
8
+ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
9
+ * https://openapi-generator.tech
10
+ * Do not edit the class manually.
11
+ */
12
+ /**
13
+ *
14
+ * @export
15
+ * @interface SignedUrl
16
+ */
17
+ export interface SignedUrl {
18
+ /**
19
+ * The signed URL to upload the zip file to.
20
+ * @type {string}
21
+ * @memberof SignedUrl
22
+ */
23
+ url: string;
24
+ /**
25
+ * The bucket (will match the bucket part of the url).
26
+ * @type {string}
27
+ * @memberof SignedUrl
28
+ */
29
+ bucket: string;
30
+ /**
31
+ * The path (will match the path part of the url).
32
+ * @type {string}
33
+ * @memberof SignedUrl
34
+ */
35
+ path: string;
36
+ }
37
+ /**
38
+ * Check if a given object implements the SignedUrl interface.
39
+ */
40
+ export declare function instanceOfSignedUrl(value: object): boolean;
41
+ export declare function SignedUrlFromJSON(json: any): SignedUrl;
42
+ export declare function SignedUrlFromJSONTyped(json: any, ignoreDiscriminator: boolean): SignedUrl;
43
+ export declare function SignedUrlToJSON(value?: SignedUrl | null): any;
@@ -0,0 +1,56 @@
1
+ "use strict";
2
+ /* tslint:disable */
3
+ /* eslint-disable */
4
+ /**
5
+ * Ampersand public API
6
+ * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
7
+ *
8
+ * The version of the OpenAPI document: 1.0.0
9
+ *
10
+ *
11
+ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
12
+ * https://openapi-generator.tech
13
+ * Do not edit the class manually.
14
+ */
15
+ Object.defineProperty(exports, "__esModule", { value: true });
16
+ exports.SignedUrlToJSON = exports.SignedUrlFromJSONTyped = exports.SignedUrlFromJSON = exports.instanceOfSignedUrl = void 0;
17
+ /**
18
+ * Check if a given object implements the SignedUrl interface.
19
+ */
20
+ function instanceOfSignedUrl(value) {
21
+ let isInstance = true;
22
+ isInstance = isInstance && "url" in value;
23
+ isInstance = isInstance && "bucket" in value;
24
+ isInstance = isInstance && "path" in value;
25
+ return isInstance;
26
+ }
27
+ exports.instanceOfSignedUrl = instanceOfSignedUrl;
28
+ function SignedUrlFromJSON(json) {
29
+ return SignedUrlFromJSONTyped(json, false);
30
+ }
31
+ exports.SignedUrlFromJSON = SignedUrlFromJSON;
32
+ function SignedUrlFromJSONTyped(json, ignoreDiscriminator) {
33
+ if ((json === undefined) || (json === null)) {
34
+ return json;
35
+ }
36
+ return {
37
+ 'url': json['url'],
38
+ 'bucket': json['bucket'],
39
+ 'path': json['path'],
40
+ };
41
+ }
42
+ exports.SignedUrlFromJSONTyped = SignedUrlFromJSONTyped;
43
+ function SignedUrlToJSON(value) {
44
+ if (value === undefined) {
45
+ return undefined;
46
+ }
47
+ if (value === null) {
48
+ return null;
49
+ }
50
+ return {
51
+ 'url': value.url,
52
+ 'bucket': value.bucket,
53
+ 'path': value.path,
54
+ };
55
+ }
56
+ exports.SignedUrlToJSON = SignedUrlToJSON;
@@ -2,7 +2,7 @@
2
2
  * Ampersand public API
3
3
  * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
4
4
  *
5
- * The version of the OpenAPI document: 0.1.0
5
+ * The version of the OpenAPI document: 1.0.0
6
6
  *
7
7
  *
8
8
  * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
@@ -10,6 +10,7 @@
10
10
  * Do not edit the class manually.
11
11
  */
12
12
  import type { BaseReadConfig } from './BaseReadConfig';
13
+ import type { BaseWriteConfig } from './BaseWriteConfig';
13
14
  /**
14
15
  *
15
16
  * @export
@@ -28,6 +29,12 @@ export interface UpdateInstallationConfigContent {
28
29
  * @memberof UpdateInstallationConfigContent
29
30
  */
30
31
  read?: BaseReadConfig;
32
+ /**
33
+ *
34
+ * @type {BaseWriteConfig}
35
+ * @memberof UpdateInstallationConfigContent
36
+ */
37
+ write?: BaseWriteConfig;
31
38
  }
32
39
  /**
33
40
  * Check if a given object implements the UpdateInstallationConfigContent interface.
@@ -5,7 +5,7 @@
5
5
  * Ampersand public API
6
6
  * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
7
7
  *
8
- * The version of the OpenAPI document: 0.1.0
8
+ * The version of the OpenAPI document: 1.0.0
9
9
  *
10
10
  *
11
11
  * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
@@ -16,6 +16,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
16
16
  exports.UpdateInstallationConfigContentToJSON = exports.UpdateInstallationConfigContentFromJSONTyped = exports.UpdateInstallationConfigContentFromJSON = exports.instanceOfUpdateInstallationConfigContent = void 0;
17
17
  const runtime_1 = require("../runtime");
18
18
  const BaseReadConfig_1 = require("./BaseReadConfig");
19
+ const BaseWriteConfig_1 = require("./BaseWriteConfig");
19
20
  /**
20
21
  * Check if a given object implements the UpdateInstallationConfigContent interface.
21
22
  */
@@ -35,6 +36,7 @@ function UpdateInstallationConfigContentFromJSONTyped(json, ignoreDiscriminator)
35
36
  return {
36
37
  'provider': !(0, runtime_1.exists)(json, 'provider') ? undefined : json['provider'],
37
38
  'read': !(0, runtime_1.exists)(json, 'read') ? undefined : (0, BaseReadConfig_1.BaseReadConfigFromJSON)(json['read']),
39
+ 'write': !(0, runtime_1.exists)(json, 'write') ? undefined : (0, BaseWriteConfig_1.BaseWriteConfigFromJSON)(json['write']),
38
40
  };
39
41
  }
40
42
  exports.UpdateInstallationConfigContentFromJSONTyped = UpdateInstallationConfigContentFromJSONTyped;
@@ -48,6 +50,7 @@ function UpdateInstallationConfigContentToJSON(value) {
48
50
  return {
49
51
  'provider': value.provider,
50
52
  'read': (0, BaseReadConfig_1.BaseReadConfigToJSON)(value.read),
53
+ 'write': (0, BaseWriteConfig_1.BaseWriteConfigToJSON)(value.write),
51
54
  };
52
55
  }
53
56
  exports.UpdateInstallationConfigContentToJSON = UpdateInstallationConfigContentToJSON;
@@ -2,7 +2,7 @@
2
2
  * Ampersand public API
3
3
  * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
4
4
  *
5
- * The version of the OpenAPI document: 0.1.0
5
+ * The version of the OpenAPI document: 1.0.0
6
6
  *
7
7
  *
8
8
  * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
@@ -5,7 +5,7 @@
5
5
  * Ampersand public API
6
6
  * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
7
7
  *
8
- * The version of the OpenAPI document: 0.1.0
8
+ * The version of the OpenAPI document: 1.0.0
9
9
  *
10
10
  *
11
11
  * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
@@ -2,7 +2,7 @@
2
2
  * Ampersand public API
3
3
  * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
4
4
  *
5
- * The version of the OpenAPI document: 0.1.0
5
+ * The version of the OpenAPI document: 1.0.0
6
6
  *
7
7
  *
8
8
  * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
@@ -5,7 +5,7 @@
5
5
  * Ampersand public API
6
6
  * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
7
7
  *
8
- * The version of the OpenAPI document: 0.1.0
8
+ * The version of the OpenAPI document: 1.0.0
9
9
  *
10
10
  *
11
11
  * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
@@ -2,7 +2,7 @@
2
2
  * Ampersand public API
3
3
  * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
4
4
  *
5
- * The version of the OpenAPI document: 0.1.0
5
+ * The version of the OpenAPI document: 1.0.0
6
6
  *
7
7
  *
8
8
  * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
@@ -5,7 +5,7 @@
5
5
  * Ampersand public API
6
6
  * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
7
7
  *
8
- * The version of the OpenAPI document: 0.1.0
8
+ * The version of the OpenAPI document: 1.0.0
9
9
  *
10
10
  *
11
11
  * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
@@ -2,7 +2,7 @@
2
2
  * Ampersand public API
3
3
  * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
4
4
  *
5
- * The version of the OpenAPI document: 0.1.0
5
+ * The version of the OpenAPI document: 1.0.0
6
6
  *
7
7
  *
8
8
  * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
@@ -5,7 +5,7 @@
5
5
  * Ampersand public API
6
6
  * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
7
7
  *
8
- * The version of the OpenAPI document: 0.1.0
8
+ * The version of the OpenAPI document: 1.0.0
9
9
  *
10
10
  *
11
11
  * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
@@ -2,7 +2,7 @@
2
2
  * Ampersand public API
3
3
  * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
4
4
  *
5
- * The version of the OpenAPI document: 0.1.0
5
+ * The version of the OpenAPI document: 1.0.0
6
6
  *
7
7
  *
8
8
  * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
@@ -5,7 +5,7 @@
5
5
  * Ampersand public API
6
6
  * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
7
7
  *
8
- * The version of the OpenAPI document: 0.1.0
8
+ * The version of the OpenAPI document: 1.0.0
9
9
  *
10
10
  *
11
11
  * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
@@ -2,7 +2,7 @@
2
2
  * Ampersand public API
3
3
  * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
4
4
  *
5
- * The version of the OpenAPI document: 0.1.0
5
+ * The version of the OpenAPI document: 1.0.0
6
6
  *
7
7
  *
8
8
  * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
@@ -5,7 +5,7 @@
5
5
  * Ampersand public API
6
6
  * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
7
7
  *
8
- * The version of the OpenAPI document: 0.1.0
8
+ * The version of the OpenAPI document: 1.0.0
9
9
  *
10
10
  *
11
11
  * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
@@ -2,7 +2,7 @@
2
2
  * Ampersand public API
3
3
  * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
4
4
  *
5
- * The version of the OpenAPI document: 0.1.0
5
+ * The version of the OpenAPI document: 1.0.0
6
6
  *
7
7
  *
8
8
  * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
@@ -39,6 +39,12 @@ export interface UpdateProviderAppRequestProviderApp {
39
39
  * @memberof UpdateProviderAppRequestProviderApp
40
40
  */
41
41
  clientSecret?: string;
42
+ /**
43
+ * The OAuth scopes for this app.
44
+ * @type {Array<string>}
45
+ * @memberof UpdateProviderAppRequestProviderApp
46
+ */
47
+ scopes?: Array<string>;
42
48
  }
43
49
  /**
44
50
  * Check if a given object implements the UpdateProviderAppRequestProviderApp interface.
@@ -5,7 +5,7 @@
5
5
  * Ampersand public API
6
6
  * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
7
7
  *
8
- * The version of the OpenAPI document: 0.1.0
8
+ * The version of the OpenAPI document: 1.0.0
9
9
  *
10
10
  *
11
11
  * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
@@ -36,6 +36,7 @@ function UpdateProviderAppRequestProviderAppFromJSONTyped(json, ignoreDiscrimina
36
36
  'provider': !(0, runtime_1.exists)(json, 'provider') ? undefined : json['provider'],
37
37
  'clientId': !(0, runtime_1.exists)(json, 'clientId') ? undefined : json['clientId'],
38
38
  'clientSecret': !(0, runtime_1.exists)(json, 'clientSecret') ? undefined : json['clientSecret'],
39
+ 'scopes': !(0, runtime_1.exists)(json, 'scopes') ? undefined : json['scopes'],
39
40
  };
40
41
  }
41
42
  exports.UpdateProviderAppRequestProviderAppFromJSONTyped = UpdateProviderAppRequestProviderAppFromJSONTyped;
@@ -51,6 +52,7 @@ function UpdateProviderAppRequestProviderAppToJSON(value) {
51
52
  'provider': value.provider,
52
53
  'clientId': value.clientId,
53
54
  'clientSecret': value.clientSecret,
55
+ 'scopes': value.scopes,
54
56
  };
55
57
  }
56
58
  exports.UpdateProviderAppRequestProviderAppToJSON = UpdateProviderAppRequestProviderAppToJSON;
@@ -2,7 +2,7 @@
2
2
  * Ampersand public API
3
3
  * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
4
4
  *
5
- * The version of the OpenAPI document: 0.1.0
5
+ * The version of the OpenAPI document: 1.0.0
6
6
  *
7
7
  *
8
8
  * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
@@ -5,7 +5,7 @@
5
5
  * Ampersand public API
6
6
  * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
7
7
  *
8
- * The version of the OpenAPI document: 0.1.0
8
+ * The version of the OpenAPI document: 1.0.0
9
9
  *
10
10
  *
11
11
  * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
@@ -1,6 +1,8 @@
1
1
  export * from './BaseConfigContent';
2
2
  export * from './BaseReadConfig';
3
3
  export * from './BaseReadConfigStandardObject';
4
+ export * from './BaseWriteConfig';
5
+ export * from './BaseWriteConfigObject';
4
6
  export * from './BatchUpsertIntegrationsRequest';
5
7
  export * from './Config';
6
8
  export * from './ConfigContent';
@@ -23,6 +25,8 @@ export * from './HydratedIntegrationField';
23
25
  export * from './HydratedIntegrationFieldExistent';
24
26
  export * from './HydratedIntegrationObject';
25
27
  export * from './HydratedIntegrationRead';
28
+ export * from './HydratedIntegrationWrite';
29
+ export * from './HydratedIntegrationWriteObject';
26
30
  export * from './HydratedRevision';
27
31
  export * from './ImportConnectionRequest';
28
32
  export * from './ImportInstallationRequest';
@@ -35,6 +39,8 @@ export * from './IntegrationFieldExistent';
35
39
  export * from './IntegrationFieldMapping';
36
40
  export * from './IntegrationObject';
37
41
  export * from './IntegrationRead';
42
+ export * from './IntegrationWrite';
43
+ export * from './IntegrationWriteObject';
38
44
  export * from './OauthConnectRequest';
39
45
  export * from './Operation';
40
46
  export * from './OperationError';
@@ -43,6 +49,7 @@ export * from './Project';
43
49
  export * from './ProjectMembership';
44
50
  export * from './ProviderApp';
45
51
  export * from './Revision';
52
+ export * from './SignedUrl';
46
53
  export * from './UpdateInstallationConfigContent';
47
54
  export * from './UpdateInstallationRequest';
48
55
  export * from './UpdateInstallationRequestInstallation';
@@ -19,6 +19,8 @@ Object.defineProperty(exports, "__esModule", { value: true });
19
19
  __exportStar(require("./BaseConfigContent"), exports);
20
20
  __exportStar(require("./BaseReadConfig"), exports);
21
21
  __exportStar(require("./BaseReadConfigStandardObject"), exports);
22
+ __exportStar(require("./BaseWriteConfig"), exports);
23
+ __exportStar(require("./BaseWriteConfigObject"), exports);
22
24
  __exportStar(require("./BatchUpsertIntegrationsRequest"), exports);
23
25
  __exportStar(require("./Config"), exports);
24
26
  __exportStar(require("./ConfigContent"), exports);
@@ -41,6 +43,8 @@ __exportStar(require("./HydratedIntegrationField"), exports);
41
43
  __exportStar(require("./HydratedIntegrationFieldExistent"), exports);
42
44
  __exportStar(require("./HydratedIntegrationObject"), exports);
43
45
  __exportStar(require("./HydratedIntegrationRead"), exports);
46
+ __exportStar(require("./HydratedIntegrationWrite"), exports);
47
+ __exportStar(require("./HydratedIntegrationWriteObject"), exports);
44
48
  __exportStar(require("./HydratedRevision"), exports);
45
49
  __exportStar(require("./ImportConnectionRequest"), exports);
46
50
  __exportStar(require("./ImportInstallationRequest"), exports);
@@ -53,6 +57,8 @@ __exportStar(require("./IntegrationFieldExistent"), exports);
53
57
  __exportStar(require("./IntegrationFieldMapping"), exports);
54
58
  __exportStar(require("./IntegrationObject"), exports);
55
59
  __exportStar(require("./IntegrationRead"), exports);
60
+ __exportStar(require("./IntegrationWrite"), exports);
61
+ __exportStar(require("./IntegrationWriteObject"), exports);
56
62
  __exportStar(require("./OauthConnectRequest"), exports);
57
63
  __exportStar(require("./Operation"), exports);
58
64
  __exportStar(require("./OperationError"), exports);
@@ -61,6 +67,7 @@ __exportStar(require("./Project"), exports);
61
67
  __exportStar(require("./ProjectMembership"), exports);
62
68
  __exportStar(require("./ProviderApp"), exports);
63
69
  __exportStar(require("./Revision"), exports);
70
+ __exportStar(require("./SignedUrl"), exports);
64
71
  __exportStar(require("./UpdateInstallationConfigContent"), exports);
65
72
  __exportStar(require("./UpdateInstallationRequest"), exports);
66
73
  __exportStar(require("./UpdateInstallationRequestInstallation"), exports);
@@ -2,7 +2,7 @@
2
2
  * Ampersand public API
3
3
  * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
4
4
  *
5
- * The version of the OpenAPI document: 0.1.0
5
+ * The version of the OpenAPI document: 1.0.0
6
6
  *
7
7
  *
8
8
  * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
@@ -5,7 +5,7 @@
5
5
  * Ampersand public API
6
6
  * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
7
7
  *
8
- * The version of the OpenAPI document: 0.1.0
8
+ * The version of the OpenAPI document: 1.0.0
9
9
  *
10
10
  *
11
11
  * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
@@ -1 +1,2 @@
1
+ export declare const CheckMarkIcon: import("react/jsx-runtime").JSX.Element;
1
2
  export declare function NavIcon(completed: boolean, pending?: boolean): import("react/jsx-runtime").JSX.Element;
@@ -3,9 +3,10 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
3
3
  return (mod && mod.__esModule) ? mod : { "default": mod };
4
4
  };
5
5
  Object.defineProperty(exports, "__esModule", { value: true });
6
- exports.NavIcon = void 0;
6
+ exports.NavIcon = exports.CheckMarkIcon = void 0;
7
7
  const jsx_runtime_1 = require("react/jsx-runtime");
8
8
  const react_1 = __importDefault(require("react"));
9
+ exports.CheckMarkIcon = ((0, jsx_runtime_1.jsxs)("svg", { xmlns: "http://www.w3.org/2000/svg", width: "18", height: "18", viewBox: "0 0 18 18", fill: "none", children: [(0, jsx_runtime_1.jsx)("circle", { cx: "9", cy: "9", r: "9", fill: "#BBF7D0" }), (0, jsx_runtime_1.jsx)("path", { d: "M13 7L7.5 12L5 9.72727", stroke: "#16A34A", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round" })] }));
9
10
  function NavIcon(completed, pending) {
10
11
  if (pending) {
11
12
  return (react_1.default.createElement('svg', {
@@ -15,7 +16,7 @@ function NavIcon(completed, pending) {
15
16
  })));
16
17
  }
17
18
  if (completed) {
18
- return ((0, jsx_runtime_1.jsxs)("svg", { xmlns: "http://www.w3.org/2000/svg", width: "18", height: "18", viewBox: "0 0 18 18", fill: "none", children: [(0, jsx_runtime_1.jsx)("circle", { cx: "9", cy: "9", r: "9", fill: "#BBF7D0" }), (0, jsx_runtime_1.jsx)("path", { d: "M13 7L7.5 12L5 9.72727", stroke: "#16A34A", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round" })] }));
19
+ return exports.CheckMarkIcon;
19
20
  }
20
21
  // default to empty icon
21
22
  return ((0, jsx_runtime_1.jsx)("svg", { xmlns: "http://www.w3.org/2000/svg", width: "18", height: "18", viewBox: "0 0 18 18", fill: "none", children: (0, jsx_runtime_1.jsx)("circle", { cx: "9", cy: "9", r: "5", fill: "#BFDBFE" }) }));
@@ -0,0 +1 @@
1
+ export declare function TrashIcon(): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,9 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.TrashIcon = void 0;
4
+ const jsx_runtime_1 = require("react/jsx-runtime");
5
+ // red.800 trash icon
6
+ function TrashIcon() {
7
+ return ((0, jsx_runtime_1.jsxs)("svg", { width: "18", height: "18", viewBox: "0 0 18 18", fill: "none", xmlns: "http://www.w3.org/2000/svg", children: [(0, jsx_runtime_1.jsx)("path", { d: "M2.25 4.5H3.75H15.75", stroke: "#991B1B", strokeWidth: "1.5", strokeLinecap: "round", strokeLinejoin: "round" }), (0, jsx_runtime_1.jsx)("path", { d: "M14.25 4.5V15C14.25 15.3978 14.092 15.7794 13.8107 16.0607C13.5294 16.342 13.1478 16.5 12.75 16.5H5.25C4.85218 16.5 4.47064 16.342 4.18934 16.0607C3.90804 15.7794 3.75 15.3978 3.75 15V4.5M6 4.5V3C6 2.60218 6.15804 2.22064 6.43934 1.93934C6.72064 1.65804 7.10218 1.5 7.5 1.5H10.5C10.8978 1.5 11.2794 1.65804 11.5607 1.93934C11.842 2.22064 12 2.60218 12 3V4.5", stroke: "#991B1B", strokeWidth: "1.5", strokeLinecap: "round", strokeLinejoin: "round" }), (0, jsx_runtime_1.jsx)("path", { d: "M7.5 8.25V12.75", stroke: "#991B1B", strokeWidth: "1.5", strokeLinecap: "round", strokeLinejoin: "round" }), (0, jsx_runtime_1.jsx)("path", { d: "M10.5 8.25V12.75", stroke: "#991B1B", strokeWidth: "1.5", strokeLinecap: "round", strokeLinejoin: "round" })] }));
8
+ }
9
+ exports.TrashIcon = TrashIcon;
@@ -9,14 +9,14 @@ const jsx_runtime_1 = require("react/jsx-runtime");
9
9
  * Also optionally accepts theme styles object with CSS values.
10
10
  */
11
11
  const react_1 = require("react");
12
- const ApiKeyContext_1 = require("../../context/ApiKeyContext");
12
+ const ApiKeyProvider_1 = require("../../context/ApiKeyProvider");
13
13
  const ErrorContextProvider_1 = require("../../context/ErrorContextProvider");
14
14
  const IntegrationListContext_1 = require("../../context/IntegrationListContext");
15
15
  const ProjectContext_1 = require("../../context/ProjectContext");
16
16
  const ThemeProvider_1 = require("../ThemeProvider");
17
17
  function AmpersandProvider(props) {
18
18
  const { options: { apiKey, projectId }, children } = props;
19
- return ((0, jsx_runtime_1.jsx)(ThemeProvider_1.ThemeProvider, { children: (0, jsx_runtime_1.jsx)(ErrorContextProvider_1.ErrorStateProvider, { children: (0, jsx_runtime_1.jsx)(ApiKeyContext_1.ApiKeyProvider, { value: apiKey, children: (0, jsx_runtime_1.jsx)(ProjectContext_1.ProjectProvider, { projectId: projectId, children: (0, jsx_runtime_1.jsx)(IntegrationListContext_1.IntegrationListProvider, { projectId: projectId, children: children }) }) }) }) }));
19
+ return ((0, jsx_runtime_1.jsx)(ThemeProvider_1.ThemeProvider, { children: (0, jsx_runtime_1.jsx)(ErrorContextProvider_1.ErrorStateProvider, { children: (0, jsx_runtime_1.jsx)(ApiKeyProvider_1.ApiKeyProvider, { value: apiKey, children: (0, jsx_runtime_1.jsx)(ProjectContext_1.ProjectProvider, { projectId: projectId, children: (0, jsx_runtime_1.jsx)(IntegrationListContext_1.IntegrationListProvider, { projectId: projectId, children: children }) }) }) }) }));
20
20
  }
21
21
  exports.AmpersandProvider = AmpersandProvider;
22
22
  exports.AmpersandContext = (0, react_1.createContext)(null);
@@ -4,14 +4,26 @@ exports.ConfigureInstallationBase = void 0;
4
4
  const jsx_runtime_1 = require("react/jsx-runtime");
5
5
  const react_1 = require("@chakra-ui/react");
6
6
  const LoadingIcon_1 = require("../../assets/LoadingIcon");
7
+ const FieldMappings_1 = require("./fields/FieldMappings");
7
8
  const OptionalFields_1 = require("./fields/OptionalFields");
8
- const RequiredFieldMappings_1 = require("./fields/RequiredFieldMappings");
9
9
  const RequiredFields_1 = require("./fields/RequiredFields");
10
+ const UninstallInstallation_1 = require("./ObjectManagementNav/UninstallInstallation");
11
+ const ConfigurationStateProvider_1 = require("./state/ConfigurationStateProvider");
10
12
  const HydratedRevisionContext_1 = require("./state/HydratedRevisionContext");
13
+ const utils_1 = require("./state/utils");
14
+ const ObjectManagementNav_1 = require("./ObjectManagementNav");
15
+ const UninstallContent_1 = require("./UninstallContent");
11
16
  // Installation UI Base
12
17
  function ConfigureInstallationBase({ onSave, onReset, isLoading }) {
13
18
  const { hydratedRevision, loading } = (0, HydratedRevisionContext_1.useHydratedRevision)();
19
+ const { selectedObjectName } = (0, ObjectManagementNav_1.useSelectedObjectName)();
20
+ const { objectConfigurationsState } = (0, ConfigurationStateProvider_1.useConfigureState)();
21
+ const configureState = (0, utils_1.getConfigureState)(selectedObjectName || '', objectConfigurationsState);
22
+ const isPending = (configureState === null || configureState === void 0 ? void 0 : configureState.isOptionalFieldsModified)
23
+ || (configureState === null || configureState === void 0 ? void 0 : configureState.isRequiredMapFieldsModified);
24
+ const isDisabled = loading || isLoading || !configureState || !selectedObjectName || !isPending;
25
+ const isUninstall = selectedObjectName === UninstallInstallation_1.UNINSTALL_INSTALLATION_CONST;
14
26
  return (isLoading ? (0, jsx_runtime_1.jsx)(LoadingIcon_1.LoadingIcon, {})
15
- : ((0, jsx_runtime_1.jsxs)("form", { style: { width: '100%', maxWidth: '50rem' }, onSubmit: onSave, children: [(0, jsx_runtime_1.jsxs)(react_1.Stack, { direction: "row", spacing: 4, marginBottom: "20px", flexDir: "row-reverse", children: [(0, jsx_runtime_1.jsx)(react_1.Button, { backgroundColor: "gray.800", _hover: { backgroundColor: 'gray.600' }, type: "submit", isDisabled: loading || isLoading, children: "Save" }), (0, jsx_runtime_1.jsx)(react_1.Button, { backgroundColor: "gray.200", color: "blackAlpha.700", _hover: { backgroundColor: 'gray.300' }, isDisabled: loading || isLoading, onClick: onReset, children: "Reset" })] }), (0, jsx_runtime_1.jsxs)(react_1.Box, { p: 8, width: "100%", border: "1px solid #EFEFEF", borderRadius: 8, boxShadow: "md", textAlign: ['left'], margin: "auto", bgColor: "white", maxHeight: "100%", overflowY: "scroll", children: [loading && (0, jsx_runtime_1.jsx)(LoadingIcon_1.LoadingIcon, {}), hydratedRevision && ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)(RequiredFields_1.RequiredFields, {}), (0, jsx_runtime_1.jsx)(RequiredFieldMappings_1.RequiredFieldMappings, {}), (0, jsx_runtime_1.jsx)(OptionalFields_1.OptionalFields, {})] }))] })] })));
27
+ : ((0, jsx_runtime_1.jsxs)("form", { style: { width: '100%', maxWidth: '50rem' }, onSubmit: onSave, children: [(0, jsx_runtime_1.jsxs)(react_1.Stack, { direction: "row", spacing: 4, marginBottom: "20px", flexDir: "row-reverse", children: [(0, jsx_runtime_1.jsx)(react_1.Button, { backgroundColor: "gray.800", _hover: { backgroundColor: 'gray.600' }, type: "submit", isDisabled: isDisabled, children: "Save" }), (0, jsx_runtime_1.jsx)(react_1.Button, { backgroundColor: "gray.200", color: "blackAlpha.700", _hover: { backgroundColor: 'gray.300' }, isDisabled: isDisabled, onClick: onReset, children: "Reset" })] }), (0, jsx_runtime_1.jsxs)(react_1.Box, { p: 8, width: "100%", border: "1px solid #EFEFEF", borderRadius: 8, boxShadow: "md", textAlign: ['left'], margin: "auto", bgColor: "white", maxHeight: "100%", overflowY: "scroll", children: [loading && (0, jsx_runtime_1.jsx)(LoadingIcon_1.LoadingIcon, {}), hydratedRevision && !isUninstall && ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)(RequiredFields_1.RequiredFields, {}), (0, jsx_runtime_1.jsx)(FieldMappings_1.RequiredFieldMappings, {}), (0, jsx_runtime_1.jsx)(OptionalFields_1.OptionalFields, {})] })), !loading && isUninstall && (0, jsx_runtime_1.jsx)(UninstallContent_1.UninstallContent, {})] })] })));
16
28
  }
17
29
  exports.ConfigureInstallationBase = ConfigureInstallationBase;
@@ -6,7 +6,7 @@ const jsx_runtime_1 = require("react/jsx-runtime");
6
6
  * this page is wip: untested
7
7
  */
8
8
  const react_1 = require("react");
9
- const ApiKeyContext_1 = require("../../context/ApiKeyContext");
9
+ const ApiKeyProvider_1 = require("../../context/ApiKeyProvider");
10
10
  const ConnectionsContext_1 = require("../../context/ConnectionsContext");
11
11
  const ErrorContextProvider_1 = require("../../context/ErrorContextProvider");
12
12
  const InstallIntegrationContext_1 = require("../../context/InstallIntegrationContext");
@@ -17,6 +17,7 @@ const HydratedRevisionContext_1 = require("./state/HydratedRevisionContext");
17
17
  const utils_1 = require("./state/utils");
18
18
  const ConfigureInstallationBase_1 = require("./ConfigureInstallationBase");
19
19
  const ObjectManagementNav_1 = require("./ObjectManagementNav");
20
+ const utils_2 = require("./utils");
20
21
  // the config should be undefined for create flow
21
22
  const UNDEFINED_CONFIG = undefined;
22
23
  // Create Installation Flow
@@ -25,18 +26,18 @@ function CreateInstallation() {
25
26
  const { hydratedRevision, loading } = (0, HydratedRevisionContext_1.useHydratedRevision)();
26
27
  const { selectedObjectName } = (0, ObjectManagementNav_1.useSelectedObjectName)();
27
28
  const { selectedConnection } = (0, ConnectionsContext_1.useConnections)();
28
- const apiKey = (0, react_1.useContext)(ApiKeyContext_1.ApiKeyContext);
29
+ const apiKey = (0, ApiKeyProvider_1.useApiKey)();
29
30
  const { projectId } = (0, ProjectContext_1.useProject)();
30
31
  const { resetBoundary, setErrors } = (0, ErrorContextProvider_1.useErrorState)();
31
- const { setConfigureState, objectConfigurationsState, resetPendingConfigurationState, } = (0, ConfigurationStateProvider_1.useConfigureState)();
32
+ const { resetConfigureState, objectConfigurationsState, resetPendingConfigurationState, } = (0, ConfigurationStateProvider_1.useConfigureState)();
32
33
  const configureState = (0, utils_1.getConfigureState)(selectedObjectName || '', objectConfigurationsState);
33
34
  const [isLoading, setLoadingState] = (0, react_1.useState)(false);
34
35
  const resetState = (0, react_1.useCallback)(() => {
35
36
  resetBoundary(ErrorContextProvider_1.ErrorBoundary.MAPPING);
36
37
  if ((hydratedRevision === null || hydratedRevision === void 0 ? void 0 : hydratedRevision.content) && !loading && selectedObjectName) {
37
- (0, utils_1.resetConfigurationState)(hydratedRevision, UNDEFINED_CONFIG, selectedObjectName, setConfigureState);
38
+ (0, utils_1.setHydrateConfigState)(hydratedRevision, UNDEFINED_CONFIG, selectedObjectName, resetConfigureState);
38
39
  }
39
- }, [hydratedRevision, loading, selectedObjectName, setConfigureState, resetBoundary]);
40
+ }, [resetBoundary, hydratedRevision, loading, selectedObjectName, resetConfigureState]);
40
41
  (0, react_1.useEffect)(() => {
41
42
  // set configurationState when hydratedRevision is loaded
42
43
  if (!configureState && (hydratedRevision === null || hydratedRevision === void 0 ? void 0 : hydratedRevision.content) && !loading) {
@@ -45,16 +46,12 @@ function CreateInstallation() {
45
46
  }, [configureState, objectConfigurationsState, hydratedRevision, loading, resetState]);
46
47
  const onSave = (e) => {
47
48
  e.preventDefault();
48
- const { requiredMapFields } = configureState;
49
- const fieldsWithRequirementsNotMet = (requiredMapFields === null || requiredMapFields === void 0 ? void 0 : requiredMapFields.filter((field) => !field.value))
50
- || [];
51
- const errList = fieldsWithRequirementsNotMet.map((field) => field.mapToName);
52
- setErrors(ErrorContextProvider_1.ErrorBoundary.MAPPING, errList);
53
- // if requires fields are not met, set error fields and return
54
- if (fieldsWithRequirementsNotMet === null || fieldsWithRequirementsNotMet === void 0 ? void 0 : fieldsWithRequirementsNotMet.length) {
55
- console.error('required fields not met', fieldsWithRequirementsNotMet.map((field) => field.mapToDisplayName));
49
+ // check if fields with requirements are met
50
+ const { requiredMapFields, selectedFieldMappings } = configureState || {};
51
+ const { errorList } = (0, utils_2.validateFieldMappings)(requiredMapFields, selectedFieldMappings, setErrors);
52
+ if (errorList.length > 0) {
56
53
  return;
57
- }
54
+ } // skip if there are errors
58
55
  if (selectedObjectName && (selectedConnection === null || selectedConnection === void 0 ? void 0 : selectedConnection.id) && apiKey && projectId
59
56
  && integrationId && groupRef && consumerRef && hydratedRevision) {
60
57
  setLoadingState(true);
@@ -25,7 +25,6 @@ function InstallationContent() {
25
25
  // No installation, render create installation flow
26
26
  (0, jsx_runtime_1.jsx)(CreateInstallation_1.CreateInstallation, {}));
27
27
  }
28
- // TODO consider creating an integration obj context
29
28
  function InstallIntegration({ integration, consumerRef, consumerName, groupRef, groupName, }) {
30
29
  var _a;
31
30
  const { projectId } = (0, ProjectContext_1.useProject)();
@@ -35,6 +34,6 @@ function InstallIntegration({ integration, consumerRef, consumerName, groupRef,
35
34
  }
36
35
  return (
37
36
  // install integration provider provides all props, integrationObj and installation
38
- (0, jsx_runtime_1.jsx)(InstallIntegrationContext_1.InstallIntegrationProvider, { integration: integration, consumerRef: consumerRef, consumerName: consumerName, groupRef: groupRef, groupName: groupName, children: (0, jsx_runtime_1.jsx)(ConnectionsContext_1.ConnectionsProvider, { projectId: projectId, children: (0, jsx_runtime_1.jsx)(ProtectedConnectionLayout_1.ProtectedConnectionLayout, { children: (0, jsx_runtime_1.jsx)(HydratedRevisionContext_1.HydratedRevisionProvider, { projectId: projectId, children: (0, jsx_runtime_1.jsx)(ConfigurationStateProvider_1.ConfigurationProvider, { children: (0, jsx_runtime_1.jsx)(ObjectManagementNav_1.ObjectManagementNav, { children: (0, jsx_runtime_1.jsx)(InstallationContent, {}) }) }) }) }) }) }));
37
+ (0, jsx_runtime_1.jsx)(InstallIntegrationContext_1.InstallIntegrationProvider, { integration: integration, consumerRef: consumerRef, consumerName: consumerName, groupRef: groupRef, groupName: groupName, children: (0, jsx_runtime_1.jsx)(ConnectionsContext_1.ConnectionsProvider, { groupRef: groupRef, children: (0, jsx_runtime_1.jsx)(ProtectedConnectionLayout_1.ProtectedConnectionLayout, { consumerRef: consumerRef, consumerName: consumerName, groupRef: groupRef, groupName: groupName, children: (0, jsx_runtime_1.jsx)(HydratedRevisionContext_1.HydratedRevisionProvider, { projectId: projectId, children: (0, jsx_runtime_1.jsx)(ConfigurationStateProvider_1.ConfigurationProvider, { children: (0, jsx_runtime_1.jsx)(ObjectManagementNav_1.ObjectManagementNav, { children: (0, jsx_runtime_1.jsx)(InstallationContent, {}) }) }) }) }) }) }));
39
38
  }
40
39
  exports.InstallIntegration = InstallIntegration;
@@ -0,0 +1,7 @@
1
+ /// <reference types="react" />
2
+ interface NavObjectItemProps {
3
+ text?: string;
4
+ }
5
+ export declare const UNINSTALL_INSTALLATION_CONST = "uninstall-intallation";
6
+ export declare const UninstallInstallation: import("react").ForwardRefExoticComponent<NavObjectItemProps & import("react").RefAttributes<HTMLButtonElement>>;
7
+ export {};