@stoker-platform/cli 0.5.134 → 0.5.135

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/lib/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@stoker-platform/cli",
3
- "version": "0.5.133",
3
+ "version": "0.5.134",
4
4
  "type": "module",
5
5
  "license": "SEE LICENSE IN LICENSE.md",
6
6
  "main": "./lib/src/main.js",
@@ -119,26 +119,24 @@ export const customDomain = async (options) => {
119
119
  "describe",
120
120
  `gs://${projectId}`,
121
121
  `--project=${projectId}`,
122
+ "--raw",
122
123
  "--format=json",
123
124
  ]);
124
125
  const corsConfigJson = JSON.parse(corsConfigString);
125
126
  const existingCors = corsConfigJson.cors || [];
126
- const allOrigins = new Set();
127
- for (const corsEntry of existingCors) {
128
- if (corsEntry.origin) {
129
- for (const origin of corsEntry.origin) {
130
- allOrigins.add(origin);
131
- }
132
- }
133
- }
134
- allOrigins.add(`https://${options.domain}`);
135
- const corsToWrite = [
136
- {
137
- origin: Array.from(allOrigins),
138
- method: ["GET"],
139
- maxAgeSeconds: 3600,
140
- },
141
- ];
127
+ const customDomainOrigin = `https://${options.domain}`;
128
+ const corsToWrite = existingCors.length > 0
129
+ ? existingCors.map((corsEntry) => ({
130
+ ...corsEntry,
131
+ origin: Array.from(new Set([...(corsEntry.origin || []), customDomainOrigin])),
132
+ }))
133
+ : [
134
+ {
135
+ origin: [customDomainOrigin],
136
+ method: ["GET"],
137
+ maxAgeSeconds: 3600,
138
+ },
139
+ ];
142
140
  await writeFile("cors.json", JSON.stringify(corsToWrite));
143
141
  await runChildProcess("gcloud", [
144
142
  "storage",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@stoker-platform/cli",
3
- "version": "0.5.134",
3
+ "version": "0.5.135",
4
4
  "type": "module",
5
5
  "license": "SEE LICENSE IN LICENSE.md",
6
6
  "main": "./lib/src/main.js",