firebase-tools 12.5.0 → 12.5.1
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.
|
@@ -95,17 +95,18 @@ class Fabricator {
|
|
|
95
95
|
deployResults.push(result);
|
|
96
96
|
};
|
|
97
97
|
const upserts = [];
|
|
98
|
-
const
|
|
98
|
+
const scraperV1 = new sourceTokenScraper_1.SourceTokenScraper();
|
|
99
|
+
const scraperV2 = new sourceTokenScraper_1.SourceTokenScraper();
|
|
99
100
|
for (const endpoint of changes.endpointsToCreate) {
|
|
100
101
|
this.logOpStart("creating", endpoint);
|
|
101
|
-
upserts.push(handle("create", endpoint, () => this.createEndpoint(endpoint,
|
|
102
|
+
upserts.push(handle("create", endpoint, () => this.createEndpoint(endpoint, scraperV1, scraperV2)));
|
|
102
103
|
}
|
|
103
104
|
for (const endpoint of changes.endpointsToSkip) {
|
|
104
105
|
utils.logSuccess(this.getLogSuccessMessage("skip", endpoint));
|
|
105
106
|
}
|
|
106
107
|
for (const update of changes.endpointsToUpdate) {
|
|
107
108
|
this.logOpStart("updating", update.endpoint);
|
|
108
|
-
upserts.push(handle("update", update.endpoint, () => this.updateEndpoint(update,
|
|
109
|
+
upserts.push(handle("update", update.endpoint, () => this.updateEndpoint(update, scraperV1, scraperV2)));
|
|
109
110
|
}
|
|
110
111
|
await utils.allSettled(upserts);
|
|
111
112
|
if (deployResults.find((r) => r.error)) {
|
|
@@ -126,31 +127,31 @@ class Fabricator {
|
|
|
126
127
|
await utils.allSettled(deletes);
|
|
127
128
|
return deployResults;
|
|
128
129
|
}
|
|
129
|
-
async createEndpoint(endpoint,
|
|
130
|
+
async createEndpoint(endpoint, scraperV1, scraperV2) {
|
|
130
131
|
endpoint.labels = Object.assign(Object.assign({}, endpoint.labels), deploymentTool.labels());
|
|
131
132
|
if (endpoint.platform === "gcfv1") {
|
|
132
|
-
await this.createV1Function(endpoint,
|
|
133
|
+
await this.createV1Function(endpoint, scraperV1);
|
|
133
134
|
}
|
|
134
135
|
else if (endpoint.platform === "gcfv2") {
|
|
135
|
-
await this.createV2Function(endpoint,
|
|
136
|
+
await this.createV2Function(endpoint, scraperV2);
|
|
136
137
|
}
|
|
137
138
|
else {
|
|
138
139
|
(0, functional_1.assertExhaustive)(endpoint.platform);
|
|
139
140
|
}
|
|
140
141
|
await this.setTrigger(endpoint);
|
|
141
142
|
}
|
|
142
|
-
async updateEndpoint(update,
|
|
143
|
+
async updateEndpoint(update, scraperV1, scraperV2) {
|
|
143
144
|
update.endpoint.labels = Object.assign(Object.assign({}, update.endpoint.labels), deploymentTool.labels());
|
|
144
145
|
if (update.deleteAndRecreate) {
|
|
145
146
|
await this.deleteEndpoint(update.deleteAndRecreate);
|
|
146
|
-
await this.createEndpoint(update.endpoint,
|
|
147
|
+
await this.createEndpoint(update.endpoint, scraperV1, scraperV2);
|
|
147
148
|
return;
|
|
148
149
|
}
|
|
149
150
|
if (update.endpoint.platform === "gcfv1") {
|
|
150
|
-
await this.updateV1Function(update.endpoint,
|
|
151
|
+
await this.updateV1Function(update.endpoint, scraperV1);
|
|
151
152
|
}
|
|
152
153
|
else if (update.endpoint.platform === "gcfv2") {
|
|
153
|
-
await this.updateV2Function(update.endpoint,
|
|
154
|
+
await this.updateV2Function(update.endpoint, scraperV2);
|
|
154
155
|
}
|
|
155
156
|
else {
|
|
156
157
|
(0, functional_1.assertExhaustive)(update.endpoint.platform);
|