@amp-labs/react 1.4.4 → 1.5.0
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/generated-sources/api/src/apis/index.d.ts +0 -2
- package/build/generated-sources/api/src/apis/index.js +0 -2
- package/build/generated-sources/api/src/models/BaseReadConfig.d.ts +4 -4
- package/build/generated-sources/api/src/models/BaseReadConfig.js +3 -3
- package/build/generated-sources/api/src/models/{BaseReadConfigStandardObject.d.ts → BaseReadConfigObject.d.ts} +12 -12
- package/build/generated-sources/api/src/models/{BaseReadConfigStandardObject.js → BaseReadConfigObject.js} +11 -11
- package/build/generated-sources/api/src/models/HydratedIntegrationRead.d.ts +1 -1
- package/build/generated-sources/api/src/models/HydratedIntegrationRead.js +2 -2
- package/build/generated-sources/api/src/models/IntegrationRead.d.ts +1 -1
- package/build/generated-sources/api/src/models/IntegrationRead.js +2 -2
- package/build/generated-sources/api/src/models/ProviderInfo.d.ts +12 -0
- package/build/generated-sources/api/src/models/ProviderInfo.js +5 -0
- package/build/generated-sources/api/src/models/index.d.ts +1 -2
- package/build/generated-sources/api/src/models/index.js +1 -2
- package/build/src/components/Configure/actions/mutateAndSetState/updateInstallationAndSetState.js +1 -1
- package/build/src/components/Configure/actions/read/onSaveReadCreateInstallation.js +3 -3
- package/build/src/components/Configure/actions/read/onSaveReadUpdateInstallation.js +1 -1
- package/build/src/components/Configure/actions/write/onSaveWriteCreateInstallation.js +2 -2
- package/build/src/components/Configure/content/UpdateInstallation.js +1 -1
- package/build/src/components/Configure/state/utils.js +3 -3
- package/build/src/components/Configure/utils.d.ts +1 -1
- package/build/src/components/Configure/utils.js +7 -7
- package/build/src/services/ApiService.d.ts +1 -3
- package/build/src/services/ApiService.js +0 -2
- package/build/src/services/version.d.ts +1 -1
- package/build/src/services/version.js +1 -1
- package/package.json +1 -1
- package/build/generated-sources/api/src/apis/AllowedDomainApi.d.ts +0 -79
- package/build/generated-sources/api/src/apis/AllowedDomainApi.js +0 -101
- package/build/generated-sources/api/src/apis/ProjectMembershipApi.d.ts +0 -126
- package/build/generated-sources/api/src/apis/ProjectMembershipApi.js +0 -154
- package/build/generated-sources/api/src/models/UpsertProjectMembershipRequest.d.ts +0 -37
- package/build/generated-sources/api/src/models/UpsertProjectMembershipRequest.js +0 -53
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
export * from './APIKeyApi';
|
|
2
|
-
export * from './AllowedDomainApi';
|
|
3
2
|
export * from './ConnectionApi';
|
|
4
3
|
export * from './ConsumerApi';
|
|
5
4
|
export * from './DestinationApi';
|
|
@@ -11,7 +10,6 @@ export * from './OperationApi';
|
|
|
11
10
|
export * from './OperationEventApi';
|
|
12
11
|
export * from './OrgApi';
|
|
13
12
|
export * from './ProjectApi';
|
|
14
|
-
export * from './ProjectMembershipApi';
|
|
15
13
|
export * from './ProviderApi';
|
|
16
14
|
export * from './ProviderAppApi';
|
|
17
15
|
export * from './RevisionApi';
|
|
@@ -17,7 +17,6 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
17
17
|
/* tslint:disable */
|
|
18
18
|
/* eslint-disable */
|
|
19
19
|
__exportStar(require("./APIKeyApi"), exports);
|
|
20
|
-
__exportStar(require("./AllowedDomainApi"), exports);
|
|
21
20
|
__exportStar(require("./ConnectionApi"), exports);
|
|
22
21
|
__exportStar(require("./ConsumerApi"), exports);
|
|
23
22
|
__exportStar(require("./DestinationApi"), exports);
|
|
@@ -29,7 +28,6 @@ __exportStar(require("./OperationApi"), exports);
|
|
|
29
28
|
__exportStar(require("./OperationEventApi"), exports);
|
|
30
29
|
__exportStar(require("./OrgApi"), exports);
|
|
31
30
|
__exportStar(require("./ProjectApi"), exports);
|
|
32
|
-
__exportStar(require("./ProjectMembershipApi"), exports);
|
|
33
31
|
__exportStar(require("./ProviderApi"), exports);
|
|
34
32
|
__exportStar(require("./ProviderAppApi"), exports);
|
|
35
33
|
__exportStar(require("./RevisionApi"), exports);
|
|
@@ -9,7 +9,7 @@
|
|
|
9
9
|
* https://openapi-generator.tech
|
|
10
10
|
* Do not edit the class manually.
|
|
11
11
|
*/
|
|
12
|
-
import type {
|
|
12
|
+
import type { BaseReadConfigObject } from './BaseReadConfigObject';
|
|
13
13
|
/**
|
|
14
14
|
*
|
|
15
15
|
* @export
|
|
@@ -18,11 +18,11 @@ import type { BaseReadConfigStandardObject } from './BaseReadConfigStandardObjec
|
|
|
18
18
|
export interface BaseReadConfig {
|
|
19
19
|
/**
|
|
20
20
|
* This is a map of object names to their configuration.
|
|
21
|
-
* @type {{ [key: string]:
|
|
21
|
+
* @type {{ [key: string]: BaseReadConfigObject; }}
|
|
22
22
|
* @memberof BaseReadConfig
|
|
23
23
|
*/
|
|
24
|
-
|
|
25
|
-
[key: string]:
|
|
24
|
+
objects?: {
|
|
25
|
+
[key: string]: BaseReadConfigObject;
|
|
26
26
|
};
|
|
27
27
|
}
|
|
28
28
|
/**
|
|
@@ -15,7 +15,7 @@
|
|
|
15
15
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
16
16
|
exports.BaseReadConfigToJSON = exports.BaseReadConfigFromJSONTyped = exports.BaseReadConfigFromJSON = exports.instanceOfBaseReadConfig = void 0;
|
|
17
17
|
const runtime_1 = require("../runtime");
|
|
18
|
-
const
|
|
18
|
+
const BaseReadConfigObject_1 = require("./BaseReadConfigObject");
|
|
19
19
|
/**
|
|
20
20
|
* Check if a given object implements the BaseReadConfig interface.
|
|
21
21
|
*/
|
|
@@ -33,7 +33,7 @@ function BaseReadConfigFromJSONTyped(json, ignoreDiscriminator) {
|
|
|
33
33
|
return json;
|
|
34
34
|
}
|
|
35
35
|
return {
|
|
36
|
-
'
|
|
36
|
+
'objects': !(0, runtime_1.exists)(json, 'objects') ? undefined : ((0, runtime_1.mapValues)(json['objects'], BaseReadConfigObject_1.BaseReadConfigObjectFromJSON)),
|
|
37
37
|
};
|
|
38
38
|
}
|
|
39
39
|
exports.BaseReadConfigFromJSONTyped = BaseReadConfigFromJSONTyped;
|
|
@@ -45,7 +45,7 @@ function BaseReadConfigToJSON(value) {
|
|
|
45
45
|
return null;
|
|
46
46
|
}
|
|
47
47
|
return {
|
|
48
|
-
'
|
|
48
|
+
'objects': value.objects === undefined ? undefined : ((0, runtime_1.mapValues)(value.objects, BaseReadConfigObject_1.BaseReadConfigObjectToJSON)),
|
|
49
49
|
};
|
|
50
50
|
}
|
|
51
51
|
exports.BaseReadConfigToJSON = BaseReadConfigToJSON;
|
|
@@ -12,31 +12,31 @@
|
|
|
12
12
|
/**
|
|
13
13
|
*
|
|
14
14
|
* @export
|
|
15
|
-
* @interface
|
|
15
|
+
* @interface BaseReadConfigObject
|
|
16
16
|
*/
|
|
17
|
-
export interface
|
|
17
|
+
export interface BaseReadConfigObject {
|
|
18
18
|
/**
|
|
19
19
|
* The name of the object to read from.
|
|
20
20
|
* @type {string}
|
|
21
|
-
* @memberof
|
|
21
|
+
* @memberof BaseReadConfigObject
|
|
22
22
|
*/
|
|
23
23
|
objectName?: string;
|
|
24
24
|
/**
|
|
25
25
|
* The schedule for reading the object, in cron syntax.
|
|
26
26
|
* @type {string}
|
|
27
|
-
* @memberof
|
|
27
|
+
* @memberof BaseReadConfigObject
|
|
28
28
|
*/
|
|
29
29
|
schedule?: string;
|
|
30
30
|
/**
|
|
31
31
|
* The name of the destination that the result should be sent to.
|
|
32
32
|
* @type {string}
|
|
33
|
-
* @memberof
|
|
33
|
+
* @memberof BaseReadConfigObject
|
|
34
34
|
*/
|
|
35
35
|
destination?: string;
|
|
36
36
|
/**
|
|
37
37
|
* This is a map of field names to booleans indicating whether they should be read.
|
|
38
38
|
* @type {{ [key: string]: boolean; }}
|
|
39
|
-
* @memberof
|
|
39
|
+
* @memberof BaseReadConfigObject
|
|
40
40
|
*/
|
|
41
41
|
selectedFields?: {
|
|
42
42
|
[key: string]: boolean;
|
|
@@ -44,16 +44,16 @@ export interface BaseReadConfigStandardObject {
|
|
|
44
44
|
/**
|
|
45
45
|
* This is a map of mapToNames to field names. (A mapTo name is the name the builder wants to map a field to when it lands in their destination.)
|
|
46
46
|
* @type {{ [key: string]: string; }}
|
|
47
|
-
* @memberof
|
|
47
|
+
* @memberof BaseReadConfigObject
|
|
48
48
|
*/
|
|
49
49
|
selectedFieldMappings?: {
|
|
50
50
|
[key: string]: string;
|
|
51
51
|
};
|
|
52
52
|
}
|
|
53
53
|
/**
|
|
54
|
-
* Check if a given object implements the
|
|
54
|
+
* Check if a given object implements the BaseReadConfigObject interface.
|
|
55
55
|
*/
|
|
56
|
-
export declare function
|
|
57
|
-
export declare function
|
|
58
|
-
export declare function
|
|
59
|
-
export declare function
|
|
56
|
+
export declare function instanceOfBaseReadConfigObject(value: object): boolean;
|
|
57
|
+
export declare function BaseReadConfigObjectFromJSON(json: any): BaseReadConfigObject;
|
|
58
|
+
export declare function BaseReadConfigObjectFromJSONTyped(json: any, ignoreDiscriminator: boolean): BaseReadConfigObject;
|
|
59
|
+
export declare function BaseReadConfigObjectToJSON(value?: BaseReadConfigObject | null): any;
|
|
@@ -13,21 +13,21 @@
|
|
|
13
13
|
* Do not edit the class manually.
|
|
14
14
|
*/
|
|
15
15
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
16
|
-
exports.
|
|
16
|
+
exports.BaseReadConfigObjectToJSON = exports.BaseReadConfigObjectFromJSONTyped = exports.BaseReadConfigObjectFromJSON = exports.instanceOfBaseReadConfigObject = void 0;
|
|
17
17
|
const runtime_1 = require("../runtime");
|
|
18
18
|
/**
|
|
19
|
-
* Check if a given object implements the
|
|
19
|
+
* Check if a given object implements the BaseReadConfigObject interface.
|
|
20
20
|
*/
|
|
21
|
-
function
|
|
21
|
+
function instanceOfBaseReadConfigObject(value) {
|
|
22
22
|
let isInstance = true;
|
|
23
23
|
return isInstance;
|
|
24
24
|
}
|
|
25
|
-
exports.
|
|
26
|
-
function
|
|
27
|
-
return
|
|
25
|
+
exports.instanceOfBaseReadConfigObject = instanceOfBaseReadConfigObject;
|
|
26
|
+
function BaseReadConfigObjectFromJSON(json) {
|
|
27
|
+
return BaseReadConfigObjectFromJSONTyped(json, false);
|
|
28
28
|
}
|
|
29
|
-
exports.
|
|
30
|
-
function
|
|
29
|
+
exports.BaseReadConfigObjectFromJSON = BaseReadConfigObjectFromJSON;
|
|
30
|
+
function BaseReadConfigObjectFromJSONTyped(json, ignoreDiscriminator) {
|
|
31
31
|
if ((json === undefined) || (json === null)) {
|
|
32
32
|
return json;
|
|
33
33
|
}
|
|
@@ -39,8 +39,8 @@ function BaseReadConfigStandardObjectFromJSONTyped(json, ignoreDiscriminator) {
|
|
|
39
39
|
'selectedFieldMappings': !(0, runtime_1.exists)(json, 'selectedFieldMappings') ? undefined : json['selectedFieldMappings'],
|
|
40
40
|
};
|
|
41
41
|
}
|
|
42
|
-
exports.
|
|
43
|
-
function
|
|
42
|
+
exports.BaseReadConfigObjectFromJSONTyped = BaseReadConfigObjectFromJSONTyped;
|
|
43
|
+
function BaseReadConfigObjectToJSON(value) {
|
|
44
44
|
if (value === undefined) {
|
|
45
45
|
return undefined;
|
|
46
46
|
}
|
|
@@ -55,4 +55,4 @@ function BaseReadConfigStandardObjectToJSON(value) {
|
|
|
55
55
|
'selectedFieldMappings': value.selectedFieldMappings,
|
|
56
56
|
};
|
|
57
57
|
}
|
|
58
|
-
exports.
|
|
58
|
+
exports.BaseReadConfigObjectToJSON = BaseReadConfigObjectToJSON;
|
|
@@ -21,7 +21,7 @@ export interface HydratedIntegrationRead {
|
|
|
21
21
|
* @type {Array<HydratedIntegrationObject>}
|
|
22
22
|
* @memberof HydratedIntegrationRead
|
|
23
23
|
*/
|
|
24
|
-
|
|
24
|
+
objects?: Array<HydratedIntegrationObject>;
|
|
25
25
|
}
|
|
26
26
|
/**
|
|
27
27
|
* Check if a given object implements the HydratedIntegrationRead interface.
|
|
@@ -33,7 +33,7 @@ function HydratedIntegrationReadFromJSONTyped(json, ignoreDiscriminator) {
|
|
|
33
33
|
return json;
|
|
34
34
|
}
|
|
35
35
|
return {
|
|
36
|
-
'
|
|
36
|
+
'objects': !(0, runtime_1.exists)(json, 'objects') ? undefined : (json['objects'].map(HydratedIntegrationObject_1.HydratedIntegrationObjectFromJSON)),
|
|
37
37
|
};
|
|
38
38
|
}
|
|
39
39
|
exports.HydratedIntegrationReadFromJSONTyped = HydratedIntegrationReadFromJSONTyped;
|
|
@@ -45,7 +45,7 @@ function HydratedIntegrationReadToJSON(value) {
|
|
|
45
45
|
return null;
|
|
46
46
|
}
|
|
47
47
|
return {
|
|
48
|
-
'
|
|
48
|
+
'objects': value.objects === undefined ? undefined : (value.objects.map(HydratedIntegrationObject_1.HydratedIntegrationObjectToJSON)),
|
|
49
49
|
};
|
|
50
50
|
}
|
|
51
51
|
exports.HydratedIntegrationReadToJSON = HydratedIntegrationReadToJSON;
|
|
@@ -21,7 +21,7 @@ export interface IntegrationRead {
|
|
|
21
21
|
* @type {Array<IntegrationObject>}
|
|
22
22
|
* @memberof IntegrationRead
|
|
23
23
|
*/
|
|
24
|
-
|
|
24
|
+
objects?: Array<IntegrationObject>;
|
|
25
25
|
}
|
|
26
26
|
/**
|
|
27
27
|
* Check if a given object implements the IntegrationRead interface.
|
|
@@ -33,7 +33,7 @@ function IntegrationReadFromJSONTyped(json, ignoreDiscriminator) {
|
|
|
33
33
|
return json;
|
|
34
34
|
}
|
|
35
35
|
return {
|
|
36
|
-
'
|
|
36
|
+
'objects': !(0, runtime_1.exists)(json, 'objects') ? undefined : (json['objects'].map(IntegrationObject_1.IntegrationObjectFromJSON)),
|
|
37
37
|
};
|
|
38
38
|
}
|
|
39
39
|
exports.IntegrationReadFromJSONTyped = IntegrationReadFromJSONTyped;
|
|
@@ -45,7 +45,7 @@ function IntegrationReadToJSON(value) {
|
|
|
45
45
|
return null;
|
|
46
46
|
}
|
|
47
47
|
return {
|
|
48
|
-
'
|
|
48
|
+
'objects': value.objects === undefined ? undefined : (value.objects.map(IntegrationObject_1.IntegrationObjectToJSON)),
|
|
49
49
|
};
|
|
50
50
|
}
|
|
51
51
|
exports.IntegrationReadToJSON = IntegrationReadToJSON;
|
|
@@ -50,6 +50,18 @@ export interface ProviderInfo {
|
|
|
50
50
|
providerOpts: {
|
|
51
51
|
[key: string]: string;
|
|
52
52
|
};
|
|
53
|
+
/**
|
|
54
|
+
* The display name of the provider, if omitted, defaults to provider name.
|
|
55
|
+
* @type {string}
|
|
56
|
+
* @memberof ProviderInfo
|
|
57
|
+
*/
|
|
58
|
+
displayName?: string;
|
|
59
|
+
/**
|
|
60
|
+
* If true, we require additional information after auth to start making requests.
|
|
61
|
+
* @type {boolean}
|
|
62
|
+
* @memberof ProviderInfo
|
|
63
|
+
*/
|
|
64
|
+
postAuthInfoNeeded?: boolean;
|
|
53
65
|
}
|
|
54
66
|
/**
|
|
55
67
|
* Check if a given object implements the ProviderInfo interface.
|
|
@@ -14,6 +14,7 @@
|
|
|
14
14
|
*/
|
|
15
15
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
16
16
|
exports.ProviderInfoToJSON = exports.ProviderInfoFromJSONTyped = exports.ProviderInfoFromJSON = exports.instanceOfProviderInfo = void 0;
|
|
17
|
+
const runtime_1 = require("../runtime");
|
|
17
18
|
const AuthType_1 = require("./AuthType");
|
|
18
19
|
const OauthOpts_1 = require("./OauthOpts");
|
|
19
20
|
const Support_1 = require("./Support");
|
|
@@ -44,6 +45,8 @@ function ProviderInfoFromJSONTyped(json, ignoreDiscriminator) {
|
|
|
44
45
|
'oauthOpts': (0, OauthOpts_1.OauthOptsFromJSON)(json['oauthOpts']),
|
|
45
46
|
'support': (0, Support_1.SupportFromJSON)(json['support']),
|
|
46
47
|
'providerOpts': json['providerOpts'],
|
|
48
|
+
'displayName': !(0, runtime_1.exists)(json, 'displayName') ? undefined : json['displayName'],
|
|
49
|
+
'postAuthInfoNeeded': !(0, runtime_1.exists)(json, 'postAuthInfoNeeded') ? undefined : json['postAuthInfoNeeded'],
|
|
47
50
|
};
|
|
48
51
|
}
|
|
49
52
|
exports.ProviderInfoFromJSONTyped = ProviderInfoFromJSONTyped;
|
|
@@ -60,6 +63,8 @@ function ProviderInfoToJSON(value) {
|
|
|
60
63
|
'oauthOpts': (0, OauthOpts_1.OauthOptsToJSON)(value.oauthOpts),
|
|
61
64
|
'support': (0, Support_1.SupportToJSON)(value.support),
|
|
62
65
|
'providerOpts': value.providerOpts,
|
|
66
|
+
'displayName': value.displayName,
|
|
67
|
+
'postAuthInfoNeeded': value.postAuthInfoNeeded,
|
|
63
68
|
};
|
|
64
69
|
}
|
|
65
70
|
exports.ProviderInfoToJSON = ProviderInfoToJSON;
|
|
@@ -6,7 +6,7 @@ export * from './AuthType';
|
|
|
6
6
|
export * from './BaseConfigContent';
|
|
7
7
|
export * from './BaseProxyConfig';
|
|
8
8
|
export * from './BaseReadConfig';
|
|
9
|
-
export * from './
|
|
9
|
+
export * from './BaseReadConfigObject';
|
|
10
10
|
export * from './BaseWriteConfig';
|
|
11
11
|
export * from './BaseWriteConfigObject';
|
|
12
12
|
export * from './BatchUpsertIntegrationsRequest';
|
|
@@ -92,4 +92,3 @@ export * from './UpdateProjectRequest';
|
|
|
92
92
|
export * from './UpdateProjectRequestProject';
|
|
93
93
|
export * from './UpdateProviderAppRequest';
|
|
94
94
|
export * from './UpdateProviderAppRequestProviderApp';
|
|
95
|
-
export * from './UpsertProjectMembershipRequest';
|
|
@@ -24,7 +24,7 @@ __exportStar(require("./AuthType"), exports);
|
|
|
24
24
|
__exportStar(require("./BaseConfigContent"), exports);
|
|
25
25
|
__exportStar(require("./BaseProxyConfig"), exports);
|
|
26
26
|
__exportStar(require("./BaseReadConfig"), exports);
|
|
27
|
-
__exportStar(require("./
|
|
27
|
+
__exportStar(require("./BaseReadConfigObject"), exports);
|
|
28
28
|
__exportStar(require("./BaseWriteConfig"), exports);
|
|
29
29
|
__exportStar(require("./BaseWriteConfigObject"), exports);
|
|
30
30
|
__exportStar(require("./BatchUpsertIntegrationsRequest"), exports);
|
|
@@ -110,4 +110,3 @@ __exportStar(require("./UpdateProjectRequest"), exports);
|
|
|
110
110
|
__exportStar(require("./UpdateProjectRequestProject"), exports);
|
|
111
111
|
__exportStar(require("./UpdateProviderAppRequest"), exports);
|
|
112
112
|
__exportStar(require("./UpdateProviderAppRequestProviderApp"), exports);
|
|
113
|
-
__exportStar(require("./UpsertProjectMembershipRequest"), exports);
|
package/build/src/components/Configure/actions/mutateAndSetState/updateInstallationAndSetState.js
CHANGED
|
@@ -10,7 +10,7 @@ function updateInstallationAndSetState({ updateConfig, projectId, integrationId,
|
|
|
10
10
|
installationUpdate: {
|
|
11
11
|
// update mask will recurse to the object path and replace the object at the object path
|
|
12
12
|
// this example will replace the object at the object (i.e. accounts)
|
|
13
|
-
updateMask: [`config.content.read.
|
|
13
|
+
updateMask: [`config.content.read.objects.${selectedObjectName}`],
|
|
14
14
|
installation: {
|
|
15
15
|
config: updateConfig,
|
|
16
16
|
},
|
|
@@ -12,8 +12,8 @@ const isProxyEnabled_1 = require("../proxy/isProxyEnabled");
|
|
|
12
12
|
*/
|
|
13
13
|
const getObjectFromHydratedRevision = (hydratedRevision, objectName) => {
|
|
14
14
|
const readAction = hydratedRevision.content.read;
|
|
15
|
-
const
|
|
16
|
-
return
|
|
15
|
+
const objects = readAction === null || readAction === void 0 ? void 0 : readAction.objects;
|
|
16
|
+
return objects === null || objects === void 0 ? void 0 : objects.find((obj) => obj.objectName === objectName);
|
|
17
17
|
};
|
|
18
18
|
/**
|
|
19
19
|
* given a configureState, objectName, hyrdatedRevision, and consumerRef
|
|
@@ -45,7 +45,7 @@ const generateCreateReadConfigFromConfigureState = (configureState, objectName,
|
|
|
45
45
|
content: {
|
|
46
46
|
provider: hydratedRevision.content.provider,
|
|
47
47
|
read: {
|
|
48
|
-
|
|
48
|
+
objects: {
|
|
49
49
|
[objectName]: {
|
|
50
50
|
objectName,
|
|
51
51
|
schedule: obj.schedule,
|
|
@@ -27,7 +27,7 @@ const generateUpdateReadConfigFromConfigureState = (configureState, objectName,
|
|
|
27
27
|
const updateConfigObject = {
|
|
28
28
|
content: {
|
|
29
29
|
read: {
|
|
30
|
-
|
|
30
|
+
objects: {
|
|
31
31
|
[objectName]: {
|
|
32
32
|
objectName,
|
|
33
33
|
// these two fields are copied from previous config, otherwise they will override null
|
|
@@ -42,10 +42,10 @@ const generateCreateWriteConfigFromConfigureState = (configureState, hydratedRev
|
|
|
42
42
|
createdBy: `consumer:${consumerRef}`,
|
|
43
43
|
content: {
|
|
44
44
|
provider: hydratedRevision.content.provider,
|
|
45
|
-
// hack: need empty read.
|
|
45
|
+
// hack: need empty read.objects to be initialized for update read
|
|
46
46
|
// https://linear.app/ampersand/issue/ENG-780/bug-write-createupdate-installation-without-read
|
|
47
47
|
read: {
|
|
48
|
-
|
|
48
|
+
objects: {},
|
|
49
49
|
},
|
|
50
50
|
write: {
|
|
51
51
|
objects: configWriteObjects,
|
|
@@ -41,7 +41,7 @@ function UpdateInstallation({ installation, integrationObj }) {
|
|
|
41
41
|
}, [installation, resetState]);
|
|
42
42
|
const hydratedObject = (0, react_1.useMemo)(() => {
|
|
43
43
|
var _a, _b, _c;
|
|
44
|
-
const hydrated = (_c = (_b = (_a = hydratedRevision === null || hydratedRevision === void 0 ? void 0 : hydratedRevision.content) === null || _a === void 0 ? void 0 : _a.read) === null || _b === void 0 ? void 0 : _b.
|
|
44
|
+
const hydrated = (_c = (_b = (_a = hydratedRevision === null || hydratedRevision === void 0 ? void 0 : hydratedRevision.content) === null || _a === void 0 ? void 0 : _a.read) === null || _b === void 0 ? void 0 : _b.objects) === null || _c === void 0 ? void 0 : _c.find((obj) => (obj === null || obj === void 0 ? void 0 : obj.objectName) === selectedObjectName);
|
|
45
45
|
return hydrated;
|
|
46
46
|
}, [hydratedRevision, selectedObjectName]);
|
|
47
47
|
const onSaveRead = () => {
|
|
@@ -17,15 +17,15 @@ const generateConfigurationStateRead = (readAction, objectName, config) => {
|
|
|
17
17
|
return null;
|
|
18
18
|
}
|
|
19
19
|
// refactor this section to be immutable at hydrated revision level
|
|
20
|
-
const object = (0, utils_1.
|
|
20
|
+
const object = (0, utils_1.getObjectFromAction)(readAction, objectName);
|
|
21
21
|
const requiredFields = object && (0, utils_1.getRequiredFieldsFromObject)(object);
|
|
22
22
|
const optionalFields = object && (0, utils_1.getOptionalFieldsFromObject)(object);
|
|
23
23
|
const requiredMapFields = object && (0, utils_1.getRequiredMapFieldsFromObject)(object);
|
|
24
24
|
/// //////////////////////////////////////////////////////////////////////
|
|
25
25
|
const allFields = (object === null || object === void 0 ? void 0 : object.allFields) || [];
|
|
26
26
|
const content = config === null || config === void 0 ? void 0 : config.content;
|
|
27
|
-
const readSelectedFields = ((_c = (_b = (_a = content === null || content === void 0 ? void 0 : content.read) === null || _a === void 0 ? void 0 : _a.
|
|
28
|
-
const selectedFieldMappings = ((_f = (_e = (_d = content === null || content === void 0 ? void 0 : content.read) === null || _d === void 0 ? void 0 : _d.
|
|
27
|
+
const readSelectedFields = ((_c = (_b = (_a = content === null || content === void 0 ? void 0 : content.read) === null || _a === void 0 ? void 0 : _a.objects) === null || _b === void 0 ? void 0 : _b[objectName]) === null || _c === void 0 ? void 0 : _c.selectedFields) || {};
|
|
28
|
+
const selectedFieldMappings = ((_f = (_e = (_d = content === null || content === void 0 ? void 0 : content.read) === null || _d === void 0 ? void 0 : _d.objects) === null || _e === void 0 ? void 0 : _e[objectName]) === null || _f === void 0 ? void 0 : _f.selectedFieldMappings) || {};
|
|
29
29
|
const optionalFieldsSaved = Object.assign({}, readSelectedFields);
|
|
30
30
|
const requiredMapFieldsSaved = Object.assign({}, selectedFieldMappings);
|
|
31
31
|
return {
|
|
@@ -14,7 +14,7 @@ export declare function isIntegrationFieldMapping(field: HydratedIntegrationFiel
|
|
|
14
14
|
* @param objectName string (account, contact, etc...)
|
|
15
15
|
* @returns HydratedIntegrationObject | null
|
|
16
16
|
*/
|
|
17
|
-
export declare function
|
|
17
|
+
export declare function getObjectFromAction(action: HydratedIntegrationRead, objectName: string): HydratedIntegrationObject | null;
|
|
18
18
|
export declare function getRequiredFieldsFromObject(object: HydratedIntegrationObject): HydratedIntegrationField[] | null;
|
|
19
19
|
export declare function getRequiredMapFieldsFromObject(object: HydratedIntegrationObject): IntegrationFieldMapping[] | null;
|
|
20
20
|
export declare function getOptionalFieldsFromObject(object: HydratedIntegrationObject): HydratedIntegrationField[] | null;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.validateFieldMappings = exports.generateAllNavObjects = exports.generateOtherNavObject = exports.generateReadNavObjects = exports.getFieldKeyValue = exports.getReadObject = exports.getOptionalFieldsFromObject = exports.getRequiredMapFieldsFromObject = exports.getRequiredFieldsFromObject = exports.
|
|
3
|
+
exports.validateFieldMappings = exports.generateAllNavObjects = exports.generateOtherNavObject = exports.generateReadNavObjects = exports.getFieldKeyValue = exports.getReadObject = exports.getOptionalFieldsFromObject = exports.getRequiredMapFieldsFromObject = exports.getRequiredFieldsFromObject = exports.getObjectFromAction = exports.isIntegrationFieldMapping = void 0;
|
|
4
4
|
const ErrorContextProvider_1 = require("../../context/ErrorContextProvider");
|
|
5
5
|
const constant_1 = require("./nav/ObjectManagementNav/constant");
|
|
6
6
|
/**
|
|
@@ -13,18 +13,18 @@ function isIntegrationFieldMapping(field) {
|
|
|
13
13
|
return field.mapToName !== undefined;
|
|
14
14
|
}
|
|
15
15
|
exports.isIntegrationFieldMapping = isIntegrationFieldMapping;
|
|
16
|
-
// 1. get
|
|
16
|
+
// 1. get object
|
|
17
17
|
/**
|
|
18
18
|
*
|
|
19
19
|
* @param action HydratedIntegrationAction
|
|
20
20
|
* @param objectName string (account, contact, etc...)
|
|
21
21
|
* @returns HydratedIntegrationObject | null
|
|
22
22
|
*/
|
|
23
|
-
function
|
|
23
|
+
function getObjectFromAction(action, objectName) {
|
|
24
24
|
var _a;
|
|
25
|
-
return ((_a = action === null || action === void 0 ? void 0 : action.
|
|
25
|
+
return ((_a = action === null || action === void 0 ? void 0 : action.objects) === null || _a === void 0 ? void 0 : _a.find((object) => object.objectName === objectName)) || null;
|
|
26
26
|
}
|
|
27
|
-
exports.
|
|
27
|
+
exports.getObjectFromAction = getObjectFromAction;
|
|
28
28
|
// 2a. get required fields
|
|
29
29
|
function getRequiredFieldsFromObject(object) {
|
|
30
30
|
var _a;
|
|
@@ -44,7 +44,7 @@ function getOptionalFieldsFromObject(object) {
|
|
|
44
44
|
return ((_a = object === null || object === void 0 ? void 0 : object.optionalFields) === null || _a === void 0 ? void 0 : _a.filter((rf) => !isIntegrationFieldMapping(rf) && !!rf.fieldName)) || null;
|
|
45
45
|
}
|
|
46
46
|
exports.getOptionalFieldsFromObject = getOptionalFieldsFromObject;
|
|
47
|
-
const getReadObject = (config, objectName) => { var _a, _b, _c; return (_c = (_b = (_a = config === null || config === void 0 ? void 0 : config.content) === null || _a === void 0 ? void 0 : _a.read) === null || _b === void 0 ? void 0 : _b.
|
|
47
|
+
const getReadObject = (config, objectName) => { var _a, _b, _c; return (_c = (_b = (_a = config === null || config === void 0 ? void 0 : config.content) === null || _a === void 0 ? void 0 : _a.read) === null || _b === void 0 ? void 0 : _b.objects) === null || _c === void 0 ? void 0 : _c[objectName]; };
|
|
48
48
|
exports.getReadObject = getReadObject;
|
|
49
49
|
// aux. get field value based on type guard
|
|
50
50
|
function getFieldKeyValue(field) {
|
|
@@ -63,7 +63,7 @@ exports.getFieldKeyValue = getFieldKeyValue;
|
|
|
63
63
|
const generateReadNavObjects = (config, hydratedRevision) => {
|
|
64
64
|
var _a, _b, _c;
|
|
65
65
|
const navObjects = [];
|
|
66
|
-
(_c = (_b = (_a = hydratedRevision.content) === null || _a === void 0 ? void 0 : _a.read) === null || _b === void 0 ? void 0 : _b.
|
|
66
|
+
(_c = (_b = (_a = hydratedRevision.content) === null || _a === void 0 ? void 0 : _a.read) === null || _b === void 0 ? void 0 : _b.objects) === null || _c === void 0 ? void 0 : _c.forEach((object) => {
|
|
67
67
|
navObjects.push({
|
|
68
68
|
name: object === null || object === void 0 ? void 0 : object.objectName,
|
|
69
69
|
// if no config, object is not completed
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { Configuration, ConnectionApi, ConsumerApi, DestinationApi, GroupApi, InstallationApi, IntegrationApi, OAuthApi, OperationApi, ProjectApi, ProviderApi, ProviderAppApi, RevisionApi, UploadURLApi } from '../../generated-sources/api/src';
|
|
2
2
|
/**
|
|
3
3
|
* ApiService is a wrapper around the generated API client, which exposes
|
|
4
4
|
* all generated api services as properties.
|
|
@@ -8,7 +8,6 @@ import { AllowedDomainApi, Configuration, ConnectionApi, ConsumerApi, Destinatio
|
|
|
8
8
|
* Note: some services are not used in this repo.
|
|
9
9
|
*/
|
|
10
10
|
export declare class ApiService {
|
|
11
|
-
allowedDomainApi: AllowedDomainApi;
|
|
12
11
|
connectionApi: ConnectionApi;
|
|
13
12
|
consumerApi: ConsumerApi;
|
|
14
13
|
destinationApi: DestinationApi;
|
|
@@ -18,7 +17,6 @@ export declare class ApiService {
|
|
|
18
17
|
oAuthApi: OAuthApi;
|
|
19
18
|
operationApi: OperationApi;
|
|
20
19
|
projectApi: ProjectApi;
|
|
21
|
-
projectMembershipApi: ProjectMembershipApi;
|
|
22
20
|
providerApi: ProviderApi;
|
|
23
21
|
providerAppApi: ProviderAppApi;
|
|
24
22
|
revisionApi: RevisionApi;
|
|
@@ -14,7 +14,6 @@ const src_1 = require("../../generated-sources/api/src");
|
|
|
14
14
|
*/
|
|
15
15
|
class ApiService {
|
|
16
16
|
constructor(config) {
|
|
17
|
-
this.allowedDomainApi = new src_1.AllowedDomainApi(config);
|
|
18
17
|
this.connectionApi = new src_1.ConnectionApi(config);
|
|
19
18
|
this.consumerApi = new src_1.ConsumerApi(config);
|
|
20
19
|
this.destinationApi = new src_1.DestinationApi(config);
|
|
@@ -24,7 +23,6 @@ class ApiService {
|
|
|
24
23
|
this.oAuthApi = new src_1.OAuthApi(config);
|
|
25
24
|
this.operationApi = new src_1.OperationApi(config);
|
|
26
25
|
this.projectApi = new src_1.ProjectApi(config);
|
|
27
|
-
this.projectMembershipApi = new src_1.ProjectMembershipApi(config);
|
|
28
26
|
this.providerApi = new src_1.ProviderApi(config);
|
|
29
27
|
this.providerAppApi = new src_1.ProviderAppApi(config);
|
|
30
28
|
this.revisionApi = new src_1.RevisionApi(config);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const LIB_VERSION = "1.
|
|
1
|
+
export declare const LIB_VERSION = "1.5.0";
|
package/package.json
CHANGED
|
@@ -1,79 +0,0 @@
|
|
|
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
|
-
import * as runtime from '../runtime';
|
|
13
|
-
export interface ListAllowedDomainsForProjectRequest {
|
|
14
|
-
projectId: string;
|
|
15
|
-
}
|
|
16
|
-
export interface ListAllowedProjectsForDomainRequest {
|
|
17
|
-
domain: string;
|
|
18
|
-
}
|
|
19
|
-
/**
|
|
20
|
-
* AllowedDomainApi - interface
|
|
21
|
-
*
|
|
22
|
-
* @export
|
|
23
|
-
* @interface AllowedDomainApiInterface
|
|
24
|
-
*/
|
|
25
|
-
export interface AllowedDomainApiInterface {
|
|
26
|
-
/**
|
|
27
|
-
* List the email domain that are allow to join a project.
|
|
28
|
-
* @summary List allowed domains for project
|
|
29
|
-
* @param {string} projectId The project ID to search for.
|
|
30
|
-
* @param {*} [options] Override http request option.
|
|
31
|
-
* @throws {RequiredError}
|
|
32
|
-
* @memberof AllowedDomainApiInterface
|
|
33
|
-
*/
|
|
34
|
-
listAllowedDomainsForProjectRaw(requestParameters: ListAllowedDomainsForProjectRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<Array<string>>>;
|
|
35
|
-
/**
|
|
36
|
-
* List the email domain that are allow to join a project.
|
|
37
|
-
* List allowed domains for project
|
|
38
|
-
*/
|
|
39
|
-
listAllowedDomainsForProject(requestParameters: ListAllowedDomainsForProjectRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<Array<string>>;
|
|
40
|
-
/**
|
|
41
|
-
* List the projects that a user with an email address ending in the given domain would be able to join.
|
|
42
|
-
* @summary List projects allowed for domain
|
|
43
|
-
* @param {string} domain The domain to search for (e.g. \"company.com\")
|
|
44
|
-
* @param {*} [options] Override http request option.
|
|
45
|
-
* @throws {RequiredError}
|
|
46
|
-
* @memberof AllowedDomainApiInterface
|
|
47
|
-
*/
|
|
48
|
-
listAllowedProjectsForDomainRaw(requestParameters: ListAllowedProjectsForDomainRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<Array<string>>>;
|
|
49
|
-
/**
|
|
50
|
-
* List the projects that a user with an email address ending in the given domain would be able to join.
|
|
51
|
-
* List projects allowed for domain
|
|
52
|
-
*/
|
|
53
|
-
listAllowedProjectsForDomain(requestParameters: ListAllowedProjectsForDomainRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<Array<string>>;
|
|
54
|
-
}
|
|
55
|
-
/**
|
|
56
|
-
*
|
|
57
|
-
*/
|
|
58
|
-
export declare class AllowedDomainApi extends runtime.BaseAPI implements AllowedDomainApiInterface {
|
|
59
|
-
/**
|
|
60
|
-
* List the email domain that are allow to join a project.
|
|
61
|
-
* List allowed domains for project
|
|
62
|
-
*/
|
|
63
|
-
listAllowedDomainsForProjectRaw(requestParameters: ListAllowedDomainsForProjectRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<Array<string>>>;
|
|
64
|
-
/**
|
|
65
|
-
* List the email domain that are allow to join a project.
|
|
66
|
-
* List allowed domains for project
|
|
67
|
-
*/
|
|
68
|
-
listAllowedDomainsForProject(requestParameters: ListAllowedDomainsForProjectRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<Array<string>>;
|
|
69
|
-
/**
|
|
70
|
-
* List the projects that a user with an email address ending in the given domain would be able to join.
|
|
71
|
-
* List projects allowed for domain
|
|
72
|
-
*/
|
|
73
|
-
listAllowedProjectsForDomainRaw(requestParameters: ListAllowedProjectsForDomainRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<Array<string>>>;
|
|
74
|
-
/**
|
|
75
|
-
* List the projects that a user with an email address ending in the given domain would be able to join.
|
|
76
|
-
* List projects allowed for domain
|
|
77
|
-
*/
|
|
78
|
-
listAllowedProjectsForDomain(requestParameters: ListAllowedProjectsForDomainRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<Array<string>>;
|
|
79
|
-
}
|
|
@@ -1,101 +0,0 @@
|
|
|
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
|
-
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
16
|
-
if (k2 === undefined) k2 = k;
|
|
17
|
-
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
18
|
-
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
19
|
-
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
20
|
-
}
|
|
21
|
-
Object.defineProperty(o, k2, desc);
|
|
22
|
-
}) : (function(o, m, k, k2) {
|
|
23
|
-
if (k2 === undefined) k2 = k;
|
|
24
|
-
o[k2] = m[k];
|
|
25
|
-
}));
|
|
26
|
-
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
27
|
-
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
28
|
-
}) : function(o, v) {
|
|
29
|
-
o["default"] = v;
|
|
30
|
-
});
|
|
31
|
-
var __importStar = (this && this.__importStar) || function (mod) {
|
|
32
|
-
if (mod && mod.__esModule) return mod;
|
|
33
|
-
var result = {};
|
|
34
|
-
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
35
|
-
__setModuleDefault(result, mod);
|
|
36
|
-
return result;
|
|
37
|
-
};
|
|
38
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
39
|
-
exports.AllowedDomainApi = void 0;
|
|
40
|
-
const runtime = __importStar(require("../runtime"));
|
|
41
|
-
/**
|
|
42
|
-
*
|
|
43
|
-
*/
|
|
44
|
-
class AllowedDomainApi extends runtime.BaseAPI {
|
|
45
|
-
/**
|
|
46
|
-
* List the email domain that are allow to join a project.
|
|
47
|
-
* List allowed domains for project
|
|
48
|
-
*/
|
|
49
|
-
async listAllowedDomainsForProjectRaw(requestParameters, initOverrides) {
|
|
50
|
-
if (requestParameters.projectId === null || requestParameters.projectId === undefined) {
|
|
51
|
-
throw new runtime.RequiredError('projectId', 'Required parameter requestParameters.projectId was null or undefined when calling listAllowedDomainsForProject.');
|
|
52
|
-
}
|
|
53
|
-
const queryParameters = {};
|
|
54
|
-
const headerParameters = {};
|
|
55
|
-
const response = await this.request({
|
|
56
|
-
path: `/projects/{projectId}/allowed-domains`.replace(`{${"projectId"}}`, encodeURIComponent(String(requestParameters.projectId))),
|
|
57
|
-
method: 'GET',
|
|
58
|
-
headers: headerParameters,
|
|
59
|
-
query: queryParameters,
|
|
60
|
-
}, initOverrides);
|
|
61
|
-
return new runtime.JSONApiResponse(response);
|
|
62
|
-
}
|
|
63
|
-
/**
|
|
64
|
-
* List the email domain that are allow to join a project.
|
|
65
|
-
* List allowed domains for project
|
|
66
|
-
*/
|
|
67
|
-
async listAllowedDomainsForProject(requestParameters, initOverrides) {
|
|
68
|
-
const response = await this.listAllowedDomainsForProjectRaw(requestParameters, initOverrides);
|
|
69
|
-
return await response.value();
|
|
70
|
-
}
|
|
71
|
-
/**
|
|
72
|
-
* List the projects that a user with an email address ending in the given domain would be able to join.
|
|
73
|
-
* List projects allowed for domain
|
|
74
|
-
*/
|
|
75
|
-
async listAllowedProjectsForDomainRaw(requestParameters, initOverrides) {
|
|
76
|
-
if (requestParameters.domain === null || requestParameters.domain === undefined) {
|
|
77
|
-
throw new runtime.RequiredError('domain', 'Required parameter requestParameters.domain was null or undefined when calling listAllowedProjectsForDomain.');
|
|
78
|
-
}
|
|
79
|
-
const queryParameters = {};
|
|
80
|
-
if (requestParameters.domain !== undefined) {
|
|
81
|
-
queryParameters['domain'] = requestParameters.domain;
|
|
82
|
-
}
|
|
83
|
-
const headerParameters = {};
|
|
84
|
-
const response = await this.request({
|
|
85
|
-
path: `/projects:list-allowed-for-domain`,
|
|
86
|
-
method: 'GET',
|
|
87
|
-
headers: headerParameters,
|
|
88
|
-
query: queryParameters,
|
|
89
|
-
}, initOverrides);
|
|
90
|
-
return new runtime.JSONApiResponse(response);
|
|
91
|
-
}
|
|
92
|
-
/**
|
|
93
|
-
* List the projects that a user with an email address ending in the given domain would be able to join.
|
|
94
|
-
* List projects allowed for domain
|
|
95
|
-
*/
|
|
96
|
-
async listAllowedProjectsForDomain(requestParameters, initOverrides) {
|
|
97
|
-
const response = await this.listAllowedProjectsForDomainRaw(requestParameters, initOverrides);
|
|
98
|
-
return await response.value();
|
|
99
|
-
}
|
|
100
|
-
}
|
|
101
|
-
exports.AllowedDomainApi = AllowedDomainApi;
|
|
@@ -1,126 +0,0 @@
|
|
|
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
|
-
import * as runtime from '../runtime';
|
|
13
|
-
import type { ProjectMembership, UpsertProjectMembershipRequest } from '../models';
|
|
14
|
-
export interface GetProjectMembershipForBuilderRequest {
|
|
15
|
-
projectId: string;
|
|
16
|
-
builderId: string;
|
|
17
|
-
}
|
|
18
|
-
export interface ListBuilderProjectMembershipsRequest {
|
|
19
|
-
builderId: string;
|
|
20
|
-
}
|
|
21
|
-
export interface ListProjectMembershipsRequest {
|
|
22
|
-
projectId: string;
|
|
23
|
-
}
|
|
24
|
-
export interface UpsertProjectMembershipOperationRequest {
|
|
25
|
-
projectId: string;
|
|
26
|
-
membership: UpsertProjectMembershipRequest;
|
|
27
|
-
}
|
|
28
|
-
/**
|
|
29
|
-
* ProjectMembershipApi - interface
|
|
30
|
-
*
|
|
31
|
-
* @export
|
|
32
|
-
* @interface ProjectMembershipApiInterface
|
|
33
|
-
*/
|
|
34
|
-
export interface ProjectMembershipApiInterface {
|
|
35
|
-
/**
|
|
36
|
-
*
|
|
37
|
-
* @summary Get a project membership for a builder
|
|
38
|
-
* @param {string} projectId
|
|
39
|
-
* @param {string} builderId The builder\'s ID.
|
|
40
|
-
* @param {*} [options] Override http request option.
|
|
41
|
-
* @throws {RequiredError}
|
|
42
|
-
* @memberof ProjectMembershipApiInterface
|
|
43
|
-
*/
|
|
44
|
-
getProjectMembershipForBuilderRaw(requestParameters: GetProjectMembershipForBuilderRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<ProjectMembership>>;
|
|
45
|
-
/**
|
|
46
|
-
* Get a project membership for a builder
|
|
47
|
-
*/
|
|
48
|
-
getProjectMembershipForBuilder(requestParameters: GetProjectMembershipForBuilderRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<ProjectMembership>;
|
|
49
|
-
/**
|
|
50
|
-
*
|
|
51
|
-
* @summary List project memberships for a builder
|
|
52
|
-
* @param {string} builderId The builder\'s ID.
|
|
53
|
-
* @param {*} [options] Override http request option.
|
|
54
|
-
* @throws {RequiredError}
|
|
55
|
-
* @memberof ProjectMembershipApiInterface
|
|
56
|
-
*/
|
|
57
|
-
listBuilderProjectMembershipsRaw(requestParameters: ListBuilderProjectMembershipsRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<Array<ProjectMembership>>>;
|
|
58
|
-
/**
|
|
59
|
-
* List project memberships for a builder
|
|
60
|
-
*/
|
|
61
|
-
listBuilderProjectMemberships(requestParameters: ListBuilderProjectMembershipsRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<Array<ProjectMembership>>;
|
|
62
|
-
/**
|
|
63
|
-
*
|
|
64
|
-
* @summary List a project\'s memberships
|
|
65
|
-
* @param {string} projectId
|
|
66
|
-
* @param {*} [options] Override http request option.
|
|
67
|
-
* @throws {RequiredError}
|
|
68
|
-
* @memberof ProjectMembershipApiInterface
|
|
69
|
-
*/
|
|
70
|
-
listProjectMembershipsRaw(requestParameters: ListProjectMembershipsRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<Array<ProjectMembership>>>;
|
|
71
|
-
/**
|
|
72
|
-
* List a project\'s memberships
|
|
73
|
-
*/
|
|
74
|
-
listProjectMemberships(requestParameters: ListProjectMembershipsRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<Array<ProjectMembership>>;
|
|
75
|
-
/**
|
|
76
|
-
*
|
|
77
|
-
* @summary Create or update a project membership
|
|
78
|
-
* @param {string} projectId
|
|
79
|
-
* @param {UpsertProjectMembershipRequest} membership
|
|
80
|
-
* @param {*} [options] Override http request option.
|
|
81
|
-
* @throws {RequiredError}
|
|
82
|
-
* @memberof ProjectMembershipApiInterface
|
|
83
|
-
*/
|
|
84
|
-
upsertProjectMembershipRaw(requestParameters: UpsertProjectMembershipOperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<ProjectMembership>>;
|
|
85
|
-
/**
|
|
86
|
-
* Create or update a project membership
|
|
87
|
-
*/
|
|
88
|
-
upsertProjectMembership(requestParameters: UpsertProjectMembershipOperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<ProjectMembership>;
|
|
89
|
-
}
|
|
90
|
-
/**
|
|
91
|
-
*
|
|
92
|
-
*/
|
|
93
|
-
export declare class ProjectMembershipApi extends runtime.BaseAPI implements ProjectMembershipApiInterface {
|
|
94
|
-
/**
|
|
95
|
-
* Get a project membership for a builder
|
|
96
|
-
*/
|
|
97
|
-
getProjectMembershipForBuilderRaw(requestParameters: GetProjectMembershipForBuilderRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<ProjectMembership>>;
|
|
98
|
-
/**
|
|
99
|
-
* Get a project membership for a builder
|
|
100
|
-
*/
|
|
101
|
-
getProjectMembershipForBuilder(requestParameters: GetProjectMembershipForBuilderRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<ProjectMembership>;
|
|
102
|
-
/**
|
|
103
|
-
* List project memberships for a builder
|
|
104
|
-
*/
|
|
105
|
-
listBuilderProjectMembershipsRaw(requestParameters: ListBuilderProjectMembershipsRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<Array<ProjectMembership>>>;
|
|
106
|
-
/**
|
|
107
|
-
* List project memberships for a builder
|
|
108
|
-
*/
|
|
109
|
-
listBuilderProjectMemberships(requestParameters: ListBuilderProjectMembershipsRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<Array<ProjectMembership>>;
|
|
110
|
-
/**
|
|
111
|
-
* List a project\'s memberships
|
|
112
|
-
*/
|
|
113
|
-
listProjectMembershipsRaw(requestParameters: ListProjectMembershipsRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<Array<ProjectMembership>>>;
|
|
114
|
-
/**
|
|
115
|
-
* List a project\'s memberships
|
|
116
|
-
*/
|
|
117
|
-
listProjectMemberships(requestParameters: ListProjectMembershipsRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<Array<ProjectMembership>>;
|
|
118
|
-
/**
|
|
119
|
-
* Create or update a project membership
|
|
120
|
-
*/
|
|
121
|
-
upsertProjectMembershipRaw(requestParameters: UpsertProjectMembershipOperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<ProjectMembership>>;
|
|
122
|
-
/**
|
|
123
|
-
* Create or update a project membership
|
|
124
|
-
*/
|
|
125
|
-
upsertProjectMembership(requestParameters: UpsertProjectMembershipOperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<ProjectMembership>;
|
|
126
|
-
}
|
|
@@ -1,154 +0,0 @@
|
|
|
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
|
-
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
16
|
-
if (k2 === undefined) k2 = k;
|
|
17
|
-
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
18
|
-
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
19
|
-
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
20
|
-
}
|
|
21
|
-
Object.defineProperty(o, k2, desc);
|
|
22
|
-
}) : (function(o, m, k, k2) {
|
|
23
|
-
if (k2 === undefined) k2 = k;
|
|
24
|
-
o[k2] = m[k];
|
|
25
|
-
}));
|
|
26
|
-
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
27
|
-
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
28
|
-
}) : function(o, v) {
|
|
29
|
-
o["default"] = v;
|
|
30
|
-
});
|
|
31
|
-
var __importStar = (this && this.__importStar) || function (mod) {
|
|
32
|
-
if (mod && mod.__esModule) return mod;
|
|
33
|
-
var result = {};
|
|
34
|
-
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
35
|
-
__setModuleDefault(result, mod);
|
|
36
|
-
return result;
|
|
37
|
-
};
|
|
38
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
39
|
-
exports.ProjectMembershipApi = void 0;
|
|
40
|
-
const runtime = __importStar(require("../runtime"));
|
|
41
|
-
const models_1 = require("../models");
|
|
42
|
-
/**
|
|
43
|
-
*
|
|
44
|
-
*/
|
|
45
|
-
class ProjectMembershipApi extends runtime.BaseAPI {
|
|
46
|
-
/**
|
|
47
|
-
* Get a project membership for a builder
|
|
48
|
-
*/
|
|
49
|
-
async getProjectMembershipForBuilderRaw(requestParameters, initOverrides) {
|
|
50
|
-
if (requestParameters.projectId === null || requestParameters.projectId === undefined) {
|
|
51
|
-
throw new runtime.RequiredError('projectId', 'Required parameter requestParameters.projectId was null or undefined when calling getProjectMembershipForBuilder.');
|
|
52
|
-
}
|
|
53
|
-
if (requestParameters.builderId === null || requestParameters.builderId === undefined) {
|
|
54
|
-
throw new runtime.RequiredError('builderId', 'Required parameter requestParameters.builderId was null or undefined when calling getProjectMembershipForBuilder.');
|
|
55
|
-
}
|
|
56
|
-
const queryParameters = {};
|
|
57
|
-
if (requestParameters.builderId !== undefined) {
|
|
58
|
-
queryParameters['builderId'] = requestParameters.builderId;
|
|
59
|
-
}
|
|
60
|
-
const headerParameters = {};
|
|
61
|
-
const response = await this.request({
|
|
62
|
-
path: `/projects/{projectId}/memberships:get-for-builder`.replace(`{${"projectId"}}`, encodeURIComponent(String(requestParameters.projectId))),
|
|
63
|
-
method: 'GET',
|
|
64
|
-
headers: headerParameters,
|
|
65
|
-
query: queryParameters,
|
|
66
|
-
}, initOverrides);
|
|
67
|
-
return new runtime.JSONApiResponse(response, (jsonValue) => (0, models_1.ProjectMembershipFromJSON)(jsonValue));
|
|
68
|
-
}
|
|
69
|
-
/**
|
|
70
|
-
* Get a project membership for a builder
|
|
71
|
-
*/
|
|
72
|
-
async getProjectMembershipForBuilder(requestParameters, initOverrides) {
|
|
73
|
-
const response = await this.getProjectMembershipForBuilderRaw(requestParameters, initOverrides);
|
|
74
|
-
return await response.value();
|
|
75
|
-
}
|
|
76
|
-
/**
|
|
77
|
-
* List project memberships for a builder
|
|
78
|
-
*/
|
|
79
|
-
async listBuilderProjectMembershipsRaw(requestParameters, initOverrides) {
|
|
80
|
-
if (requestParameters.builderId === null || requestParameters.builderId === undefined) {
|
|
81
|
-
throw new runtime.RequiredError('builderId', 'Required parameter requestParameters.builderId was null or undefined when calling listBuilderProjectMemberships.');
|
|
82
|
-
}
|
|
83
|
-
const queryParameters = {};
|
|
84
|
-
const headerParameters = {};
|
|
85
|
-
const response = await this.request({
|
|
86
|
-
path: `/builders/{builderId}/project-memberships`.replace(`{${"builderId"}}`, encodeURIComponent(String(requestParameters.builderId))),
|
|
87
|
-
method: 'GET',
|
|
88
|
-
headers: headerParameters,
|
|
89
|
-
query: queryParameters,
|
|
90
|
-
}, initOverrides);
|
|
91
|
-
return new runtime.JSONApiResponse(response, (jsonValue) => jsonValue.map(models_1.ProjectMembershipFromJSON));
|
|
92
|
-
}
|
|
93
|
-
/**
|
|
94
|
-
* List project memberships for a builder
|
|
95
|
-
*/
|
|
96
|
-
async listBuilderProjectMemberships(requestParameters, initOverrides) {
|
|
97
|
-
const response = await this.listBuilderProjectMembershipsRaw(requestParameters, initOverrides);
|
|
98
|
-
return await response.value();
|
|
99
|
-
}
|
|
100
|
-
/**
|
|
101
|
-
* List a project\'s memberships
|
|
102
|
-
*/
|
|
103
|
-
async listProjectMembershipsRaw(requestParameters, initOverrides) {
|
|
104
|
-
if (requestParameters.projectId === null || requestParameters.projectId === undefined) {
|
|
105
|
-
throw new runtime.RequiredError('projectId', 'Required parameter requestParameters.projectId was null or undefined when calling listProjectMemberships.');
|
|
106
|
-
}
|
|
107
|
-
const queryParameters = {};
|
|
108
|
-
const headerParameters = {};
|
|
109
|
-
const response = await this.request({
|
|
110
|
-
path: `/projects/{projectId}/memberships`.replace(`{${"projectId"}}`, encodeURIComponent(String(requestParameters.projectId))),
|
|
111
|
-
method: 'GET',
|
|
112
|
-
headers: headerParameters,
|
|
113
|
-
query: queryParameters,
|
|
114
|
-
}, initOverrides);
|
|
115
|
-
return new runtime.JSONApiResponse(response, (jsonValue) => jsonValue.map(models_1.ProjectMembershipFromJSON));
|
|
116
|
-
}
|
|
117
|
-
/**
|
|
118
|
-
* List a project\'s memberships
|
|
119
|
-
*/
|
|
120
|
-
async listProjectMemberships(requestParameters, initOverrides) {
|
|
121
|
-
const response = await this.listProjectMembershipsRaw(requestParameters, initOverrides);
|
|
122
|
-
return await response.value();
|
|
123
|
-
}
|
|
124
|
-
/**
|
|
125
|
-
* Create or update a project membership
|
|
126
|
-
*/
|
|
127
|
-
async upsertProjectMembershipRaw(requestParameters, initOverrides) {
|
|
128
|
-
if (requestParameters.projectId === null || requestParameters.projectId === undefined) {
|
|
129
|
-
throw new runtime.RequiredError('projectId', 'Required parameter requestParameters.projectId was null or undefined when calling upsertProjectMembership.');
|
|
130
|
-
}
|
|
131
|
-
if (requestParameters.membership === null || requestParameters.membership === undefined) {
|
|
132
|
-
throw new runtime.RequiredError('membership', 'Required parameter requestParameters.membership was null or undefined when calling upsertProjectMembership.');
|
|
133
|
-
}
|
|
134
|
-
const queryParameters = {};
|
|
135
|
-
const headerParameters = {};
|
|
136
|
-
headerParameters['Content-Type'] = 'application/json';
|
|
137
|
-
const response = await this.request({
|
|
138
|
-
path: `/projects/{projectId}/memberships:upsert`.replace(`{${"projectId"}}`, encodeURIComponent(String(requestParameters.projectId))),
|
|
139
|
-
method: 'POST',
|
|
140
|
-
headers: headerParameters,
|
|
141
|
-
query: queryParameters,
|
|
142
|
-
body: (0, models_1.UpsertProjectMembershipRequestToJSON)(requestParameters.membership),
|
|
143
|
-
}, initOverrides);
|
|
144
|
-
return new runtime.JSONApiResponse(response, (jsonValue) => (0, models_1.ProjectMembershipFromJSON)(jsonValue));
|
|
145
|
-
}
|
|
146
|
-
/**
|
|
147
|
-
* Create or update a project membership
|
|
148
|
-
*/
|
|
149
|
-
async upsertProjectMembership(requestParameters, initOverrides) {
|
|
150
|
-
const response = await this.upsertProjectMembershipRaw(requestParameters, initOverrides);
|
|
151
|
-
return await response.value();
|
|
152
|
-
}
|
|
153
|
-
}
|
|
154
|
-
exports.ProjectMembershipApi = ProjectMembershipApi;
|
|
@@ -1,37 +0,0 @@
|
|
|
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 UpsertProjectMembershipRequest
|
|
16
|
-
*/
|
|
17
|
-
export interface UpsertProjectMembershipRequest {
|
|
18
|
-
/**
|
|
19
|
-
* The builder's ID.
|
|
20
|
-
* @type {string}
|
|
21
|
-
* @memberof UpsertProjectMembershipRequest
|
|
22
|
-
*/
|
|
23
|
-
builderId: string;
|
|
24
|
-
/**
|
|
25
|
-
* The builder's role.
|
|
26
|
-
* @type {string}
|
|
27
|
-
* @memberof UpsertProjectMembershipRequest
|
|
28
|
-
*/
|
|
29
|
-
role: string;
|
|
30
|
-
}
|
|
31
|
-
/**
|
|
32
|
-
* Check if a given object implements the UpsertProjectMembershipRequest interface.
|
|
33
|
-
*/
|
|
34
|
-
export declare function instanceOfUpsertProjectMembershipRequest(value: object): boolean;
|
|
35
|
-
export declare function UpsertProjectMembershipRequestFromJSON(json: any): UpsertProjectMembershipRequest;
|
|
36
|
-
export declare function UpsertProjectMembershipRequestFromJSONTyped(json: any, ignoreDiscriminator: boolean): UpsertProjectMembershipRequest;
|
|
37
|
-
export declare function UpsertProjectMembershipRequestToJSON(value?: UpsertProjectMembershipRequest | null): any;
|
|
@@ -1,53 +0,0 @@
|
|
|
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.UpsertProjectMembershipRequestToJSON = exports.UpsertProjectMembershipRequestFromJSONTyped = exports.UpsertProjectMembershipRequestFromJSON = exports.instanceOfUpsertProjectMembershipRequest = void 0;
|
|
17
|
-
/**
|
|
18
|
-
* Check if a given object implements the UpsertProjectMembershipRequest interface.
|
|
19
|
-
*/
|
|
20
|
-
function instanceOfUpsertProjectMembershipRequest(value) {
|
|
21
|
-
let isInstance = true;
|
|
22
|
-
isInstance = isInstance && "builderId" in value;
|
|
23
|
-
isInstance = isInstance && "role" in value;
|
|
24
|
-
return isInstance;
|
|
25
|
-
}
|
|
26
|
-
exports.instanceOfUpsertProjectMembershipRequest = instanceOfUpsertProjectMembershipRequest;
|
|
27
|
-
function UpsertProjectMembershipRequestFromJSON(json) {
|
|
28
|
-
return UpsertProjectMembershipRequestFromJSONTyped(json, false);
|
|
29
|
-
}
|
|
30
|
-
exports.UpsertProjectMembershipRequestFromJSON = UpsertProjectMembershipRequestFromJSON;
|
|
31
|
-
function UpsertProjectMembershipRequestFromJSONTyped(json, ignoreDiscriminator) {
|
|
32
|
-
if ((json === undefined) || (json === null)) {
|
|
33
|
-
return json;
|
|
34
|
-
}
|
|
35
|
-
return {
|
|
36
|
-
'builderId': json['builderId'],
|
|
37
|
-
'role': json['role'],
|
|
38
|
-
};
|
|
39
|
-
}
|
|
40
|
-
exports.UpsertProjectMembershipRequestFromJSONTyped = UpsertProjectMembershipRequestFromJSONTyped;
|
|
41
|
-
function UpsertProjectMembershipRequestToJSON(value) {
|
|
42
|
-
if (value === undefined) {
|
|
43
|
-
return undefined;
|
|
44
|
-
}
|
|
45
|
-
if (value === null) {
|
|
46
|
-
return null;
|
|
47
|
-
}
|
|
48
|
-
return {
|
|
49
|
-
'builderId': value.builderId,
|
|
50
|
-
'role': value.role,
|
|
51
|
-
};
|
|
52
|
-
}
|
|
53
|
-
exports.UpsertProjectMembershipRequestToJSON = UpsertProjectMembershipRequestToJSON;
|