@bprotsyk/aso-core 1.2.40 → 1.2.42
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/flash/flash-app.js +19 -47
- package/package.json +1 -1
- package/src/flash/flash-app.ts +19 -47
package/lib/flash/flash-app.js
CHANGED
|
@@ -176,54 +176,26 @@ exports.FlashAppSchemaUpdated = new mongoose_1.Schema({
|
|
|
176
176
|
}
|
|
177
177
|
});
|
|
178
178
|
async function updateSchemaAndMoveValue(model) {
|
|
179
|
-
const aggregationPipeline = [
|
|
180
|
-
{
|
|
181
|
-
'$project': {
|
|
182
|
-
"pastebinUrl": 0,
|
|
183
|
-
"email": 0,
|
|
184
|
-
"generationOptions.keyFileName": 0,
|
|
185
|
-
"generationOptions.keyDeveloperName": 0,
|
|
186
|
-
"generationOptions.keyDeveloperOrganization": 0,
|
|
187
|
-
"generationOptions.keyCountryCode": 0,
|
|
188
|
-
"generationOptions.keyCity": 0,
|
|
189
|
-
"generationOptions.keyAlias": 0,
|
|
190
|
-
"generationOptions.keyPassword": 0
|
|
191
|
-
}
|
|
192
|
-
},
|
|
193
|
-
{
|
|
194
|
-
'$addFields': {
|
|
195
|
-
'plugUrl': `$pastebinUrl`,
|
|
196
|
-
'reservePlugUrl': null,
|
|
197
|
-
'developerName': '$email',
|
|
198
|
-
'developerOrganization': '$generationOptions.keyDeveloperOrganization',
|
|
199
|
-
'developerEmail': '$email',
|
|
200
|
-
}
|
|
201
|
-
}
|
|
202
|
-
];
|
|
203
|
-
// Define the update operation to apply the new schema with the updated field
|
|
204
179
|
const updateOperation = {
|
|
205
|
-
$
|
|
206
|
-
plugUrl:
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
180
|
+
$addFields: {
|
|
181
|
+
plugUrl: "$pastebinUrl",
|
|
182
|
+
reservePlugUrl: null,
|
|
183
|
+
developerName: "$generationOptions.keyDeveloperName",
|
|
184
|
+
developerEmail: "$email",
|
|
185
|
+
developerOrganization: "$generationOptions.keyDeveloperOrganization",
|
|
186
|
+
},
|
|
187
|
+
$project: {
|
|
188
|
+
pastebinUrl: 0,
|
|
189
|
+
email: 0,
|
|
190
|
+
"generationOptions.keyFileName": 0,
|
|
191
|
+
"generationOptions.keyDeveloperName": 0,
|
|
192
|
+
"generationOptions.keyDeveloperOrganization": 0,
|
|
193
|
+
"generationOptions.keyCountryCode": 0,
|
|
194
|
+
"generationOptions.keyCity": 0,
|
|
195
|
+
"generationOptions.keyAlias": 0,
|
|
196
|
+
"generationOptions.keyPassword": 0,
|
|
197
|
+
},
|
|
222
198
|
};
|
|
223
|
-
await model.updateMany({},
|
|
224
|
-
aggregationPipeline,
|
|
225
|
-
updateOperation
|
|
226
|
-
]);
|
|
199
|
+
await model.updateMany({}, updateOperation);
|
|
227
200
|
}
|
|
228
201
|
exports.updateSchemaAndMoveValue = updateSchemaAndMoveValue;
|
|
229
|
-
``;
|
package/package.json
CHANGED
package/src/flash/flash-app.ts
CHANGED
|
@@ -246,54 +246,26 @@ export const FlashAppSchemaUpdated = new Schema({
|
|
|
246
246
|
})
|
|
247
247
|
|
|
248
248
|
export async function updateSchemaAndMoveValue(model: Model<IFlashAppUpdated>): Promise<void> {
|
|
249
|
-
const aggregationPipeline = [
|
|
250
|
-
{
|
|
251
|
-
'$project': {
|
|
252
|
-
"pastebinUrl": 0,
|
|
253
|
-
"email": 0,
|
|
254
|
-
"generationOptions.keyFileName": 0,
|
|
255
|
-
"generationOptions.keyDeveloperName": 0,
|
|
256
|
-
"generationOptions.keyDeveloperOrganization": 0,
|
|
257
|
-
"generationOptions.keyCountryCode": 0,
|
|
258
|
-
"generationOptions.keyCity": 0,
|
|
259
|
-
"generationOptions.keyAlias": 0,
|
|
260
|
-
"generationOptions.keyPassword": 0
|
|
261
|
-
}
|
|
262
|
-
},
|
|
263
|
-
{
|
|
264
|
-
'$addFields': {
|
|
265
|
-
'plugUrl': `$pastebinUrl`,
|
|
266
|
-
'reservePlugUrl': null,
|
|
267
|
-
'developerName': '$email',
|
|
268
|
-
'developerOrganization': '$generationOptions.keyDeveloperOrganization',
|
|
269
|
-
'developerEmail': '$email',
|
|
270
|
-
}
|
|
271
|
-
}
|
|
272
|
-
];
|
|
273
|
-
|
|
274
|
-
// Define the update operation to apply the new schema with the updated field
|
|
275
249
|
const updateOperation: UpdateQuery<IFlashAppUpdated> = {
|
|
276
|
-
$
|
|
277
|
-
plugUrl:
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
250
|
+
$addFields: {
|
|
251
|
+
plugUrl: "$pastebinUrl",
|
|
252
|
+
reservePlugUrl: null,
|
|
253
|
+
developerName: "$generationOptions.keyDeveloperName",
|
|
254
|
+
developerEmail: "$email",
|
|
255
|
+
developerOrganization: "$generationOptions.keyDeveloperOrganization",
|
|
256
|
+
},
|
|
257
|
+
$project: {
|
|
258
|
+
pastebinUrl: 0,
|
|
259
|
+
email: 0,
|
|
260
|
+
"generationOptions.keyFileName": 0,
|
|
261
|
+
"generationOptions.keyDeveloperName": 0,
|
|
262
|
+
"generationOptions.keyDeveloperOrganization": 0,
|
|
263
|
+
"generationOptions.keyCountryCode": 0,
|
|
264
|
+
"generationOptions.keyCity": 0,
|
|
265
|
+
"generationOptions.keyAlias": 0,
|
|
266
|
+
"generationOptions.keyPassword": 0,
|
|
281
267
|
},
|
|
282
|
-
$unset: [
|
|
283
|
-
'email',
|
|
284
|
-
'pastebinUrl',
|
|
285
|
-
'generationOptions.keyFileName',
|
|
286
|
-
'generationOptions.keyDeveloperName',
|
|
287
|
-
'generationOptions.keyDeveloperOrganization',
|
|
288
|
-
'generationOptions.keyCountryCode',
|
|
289
|
-
'generationOptions.keyCity',
|
|
290
|
-
'generationOptions.keyAlias',
|
|
291
|
-
'generationOptions.keyPassword',
|
|
292
|
-
]
|
|
293
268
|
};
|
|
294
269
|
|
|
295
|
-
await model.updateMany({},
|
|
296
|
-
|
|
297
|
-
updateOperation
|
|
298
|
-
]);
|
|
299
|
-
} ``
|
|
270
|
+
await model.updateMany({}, updateOperation);
|
|
271
|
+
}
|