@forge/cli-shared 2.1.5 → 2.1.6-next.3
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/CHANGELOG.md +27 -0
- package/out/config/config-file.d.ts +3 -1
- package/out/config/config-file.d.ts.map +1 -1
- package/out/config/config-file.js +20 -6
- package/out/graphql/graphql-types.d.ts +117 -86
- package/out/graphql/graphql-types.d.ts.map +1 -1
- package/out/graphql/graphql-types.js +1 -0
- package/package.json +2 -2
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,32 @@
|
|
|
1
1
|
# @forge/cli-shared
|
|
2
2
|
|
|
3
|
+
## 2.1.6-next.3
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- Updated dependencies [a017696]
|
|
8
|
+
- @forge/manifest@2.5.1-next.2
|
|
9
|
+
|
|
10
|
+
## 2.1.6-next.2
|
|
11
|
+
|
|
12
|
+
### Patch Changes
|
|
13
|
+
|
|
14
|
+
- Updated dependencies [af1473c]
|
|
15
|
+
- @forge/manifest@2.5.1-next.1
|
|
16
|
+
|
|
17
|
+
## 2.1.6-next.1
|
|
18
|
+
|
|
19
|
+
### Patch Changes
|
|
20
|
+
|
|
21
|
+
- Updated dependencies [06209fc]
|
|
22
|
+
- @forge/manifest@2.5.1-next.0
|
|
23
|
+
|
|
24
|
+
## 2.1.6-next.0
|
|
25
|
+
|
|
26
|
+
### Patch Changes
|
|
27
|
+
|
|
28
|
+
- 2338be5: Handle the manifest case of remotes found in the egress permissions section when installing an app
|
|
29
|
+
|
|
3
30
|
## 2.1.5
|
|
4
31
|
|
|
5
32
|
### Patch Changes
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { Document } from 'yaml';
|
|
2
2
|
import { FileSystemReader, FileSystemWriter } from '../file-system';
|
|
3
3
|
import { ConfigReader, ConfigWriter } from './';
|
|
4
|
-
import { ManifestSchema, Resources } from '@forge/manifest';
|
|
4
|
+
import { ManifestSchema, Resources } from '@forge/manifest/out/schema/manifest';
|
|
5
5
|
export declare class ResourceDefinitionMissingError extends Error {
|
|
6
6
|
constructor(resources: string[]);
|
|
7
7
|
}
|
|
@@ -27,6 +27,8 @@ export declare class ConfigFile implements ConfigReader, ConfigWriter, ConfigInt
|
|
|
27
27
|
writeToConfigFile<K extends string, V>(configKey: K, config: V): Promise<void>;
|
|
28
28
|
private getHostedResourceKeys;
|
|
29
29
|
private findMissingResources;
|
|
30
|
+
private getRemoteFromEgressPermission;
|
|
31
|
+
private instanceOfRemote;
|
|
30
32
|
getEgressPermissions(): Promise<{
|
|
31
33
|
type: string;
|
|
32
34
|
domains: string[] | undefined;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"config-file.d.ts","sourceRoot":"","sources":["../../src/config/config-file.ts"],"names":[],"mappings":"AAAA,OAAa,EAAwB,QAAQ,EAAE,MAAM,MAAM,CAAC;AAI5D,OAAO,EAAE,gBAAgB,EAAE,gBAAgB,EAAE,MAAM,gBAAgB,CAAC;AAGpE,OAAO,EAAE,YAAY,EAAE,YAAY,EAAoB,MAAM,IAAI,CAAC;AAGlE,OAAO,
|
|
1
|
+
{"version":3,"file":"config-file.d.ts","sourceRoot":"","sources":["../../src/config/config-file.ts"],"names":[],"mappings":"AAAA,OAAa,EAAwB,QAAQ,EAAE,MAAM,MAAM,CAAC;AAI5D,OAAO,EAAE,gBAAgB,EAAE,gBAAgB,EAAE,MAAM,gBAAgB,CAAC;AAGpE,OAAO,EAAE,YAAY,EAAE,YAAY,EAAoB,MAAM,IAAI,CAAC;AAGlE,OAAO,EAEL,cAAc,EACd,SAAS,EAMV,MAAM,qCAAqC,CAAC;AAE7C,qBAAa,8BAA+B,SAAQ,KAAK;gBAC3C,SAAS,EAAE,MAAM,EAAE;CAGhC;AAED,MAAM,WAAW,gBAAgB;IAC/B,cAAc,IAAI,OAAO,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC,CAAC;IACzC,gBAAgB,IAA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IAe1E,YAAY,IAAI,OAAO,CAAC,eAAe,EAAE,CAAC;IA0B1C,aAAa,IAAI,OAAO,CAAC,MAAM,GAAG,SAAS,CAAC;CAI1D"}
|
|
@@ -112,8 +112,22 @@ class ConfigFile {
|
|
|
112
112
|
const missing = resourceKeys.filter((resourceKey) => !resources.some(({ key }) => resourceKey === key));
|
|
113
113
|
return missing;
|
|
114
114
|
}
|
|
115
|
+
getRemoteFromEgressPermission(remoteEgressPermission, remotes) {
|
|
116
|
+
if (!remotes) {
|
|
117
|
+
return remoteEgressPermission;
|
|
118
|
+
}
|
|
119
|
+
for (const remote of remotes) {
|
|
120
|
+
if (remote.key === remoteEgressPermission) {
|
|
121
|
+
return new url_1.URL(remote.baseUrl).hostname;
|
|
122
|
+
}
|
|
123
|
+
}
|
|
124
|
+
return remoteEgressPermission;
|
|
125
|
+
}
|
|
126
|
+
instanceOfRemote(remote) {
|
|
127
|
+
return typeof remote !== 'string' && 'remote' in remote;
|
|
128
|
+
}
|
|
115
129
|
async getEgressPermissions() {
|
|
116
|
-
const { permissions } = await this.readConfig();
|
|
130
|
+
const { permissions, remotes } = await this.readConfig();
|
|
117
131
|
const egressPermissions = permissions === null || permissions === void 0 ? void 0 : permissions.external;
|
|
118
132
|
if (!egressPermissions) {
|
|
119
133
|
return [];
|
|
@@ -126,9 +140,11 @@ class ConfigFile {
|
|
|
126
140
|
return ({
|
|
127
141
|
type: typePrefix ? `${typePrefix}_${entry[0]}` : entry[0],
|
|
128
142
|
domains: (_a = entry[1]) === null || _a === void 0 ? void 0 : _a.map((url) => {
|
|
129
|
-
let domain = url;
|
|
143
|
+
let domain = this.instanceOfRemote(url) ? url.remote : url;
|
|
130
144
|
try {
|
|
131
|
-
domain =
|
|
145
|
+
domain = this.instanceOfRemote(url)
|
|
146
|
+
? this.getRemoteFromEgressPermission(url.remote, remotes)
|
|
147
|
+
: new url_1.URL(url).hostname;
|
|
132
148
|
}
|
|
133
149
|
catch (e) {
|
|
134
150
|
}
|
|
@@ -137,9 +153,7 @@ class ConfigFile {
|
|
|
137
153
|
});
|
|
138
154
|
});
|
|
139
155
|
const egressUrls = getDomainsFromPermissions(otherEgress);
|
|
140
|
-
const fetchUrls = fetchEgress
|
|
141
|
-
? getDomainsFromPermissions(fetchEgress, 'fetch')
|
|
142
|
-
: [];
|
|
156
|
+
const fetchUrls = fetchEgress ? getDomainsFromPermissions(fetchEgress, 'fetch') : [];
|
|
143
157
|
return [...egressUrls, ...fetchUrls];
|
|
144
158
|
}
|
|
145
159
|
async getAuthProviders() {
|