@bprotsyk/aso-core 1.2.81 → 1.2.83

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.
@@ -50,7 +50,7 @@ exports.FlashAppSchema = new mongoose_1.Schema({
50
50
  },
51
51
  plugStatus: {
52
52
  type: String,
53
- enum: PlugType,
53
+ enum: FlashAppPlugStatus,
54
54
  default: FlashAppPlugStatus.DISABLED,
55
55
  required: false
56
56
  },
@@ -62,7 +62,7 @@ exports.FlashAppSchema = new mongoose_1.Schema({
62
62
  },
63
63
  reservePlugType: {
64
64
  type: String,
65
- enum: PlugType,
65
+ enum: FlashAppPlugStatus,
66
66
  default: PlugType.GIST,
67
67
  required: false
68
68
  },
@@ -210,32 +210,18 @@ async function updateSchemaAndMoveValue(model) {
210
210
  // employee_addr: "$$REMOVE"
211
211
  // },
212
212
  $set: {
213
- "plugAccountId": 1,
214
- "reservePlugAccountId": 1,
215
- "plugId": "none",
216
- "plugContent": "none",
217
- "keitaroData.domainId": "$$REMOVE",
218
- "keitaroData.domainName": "$$REMOVE",
219
- "plugUrl": "$$REMOVE",
220
- "reservePlugUrl": "$$REMOVE",
213
+ "plugStatus": "$$REMOVE",
214
+ "reservePlugStatus": "$$REMOVE",
221
215
  }
222
216
  }
223
217
  ];
224
218
  let aggregation = model.aggregate(pipelineStage);
225
219
  try {
226
- await model.collection.dropIndex("keitaroData.domainId");
227
- }
228
- catch (e) { }
229
- try {
230
- await model.collection.dropIndex("keitaroData.domainName");
231
- }
232
- catch (e) { }
233
- try {
234
- await model.collection.dropIndex("plugUrl");
220
+ await model.collection.dropIndex("plugStatus");
235
221
  }
236
222
  catch (e) { }
237
223
  try {
238
- await model.collection.dropIndex("reservePlugUrl");
224
+ await model.collection.dropIndex("reservePlugStatus");
239
225
  }
240
226
  catch (e) { }
241
227
  // await model.schema.dropIndex("generationOptions.keyPassword_1")
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@bprotsyk/aso-core",
3
- "version": "1.2.81",
3
+ "version": "1.2.83",
4
4
  "main": "lib/index.js",
5
5
  "types": "lib/index.d.ts",
6
6
  "scripts": {
@@ -104,7 +104,7 @@ export const FlashAppSchema = new Schema({
104
104
  },
105
105
  plugStatus: {
106
106
  type: String,
107
- enum: PlugType,
107
+ enum: FlashAppPlugStatus,
108
108
  default: FlashAppPlugStatus.DISABLED,
109
109
  required: false
110
110
  },
@@ -116,7 +116,7 @@ export const FlashAppSchema = new Schema({
116
116
  },
117
117
  reservePlugType: {
118
118
  type: String,
119
- enum: PlugType,
119
+ enum: FlashAppPlugStatus,
120
120
  default: PlugType.GIST,
121
121
  required: false
122
122
  },
@@ -269,24 +269,15 @@ export async function updateSchemaAndMoveValue(model: Model<IFlashApp>): Promise
269
269
  // employee_addr: "$$REMOVE"
270
270
  // },
271
271
  $set: {
272
- "plugAccountId": 1,
273
- "reservePlugAccountId": 1,
274
- "plugId": "none",
275
- "plugContent": "none",
276
- "keitaroData.domainId": "$$REMOVE",
277
- "keitaroData.domainName": "$$REMOVE",
278
- "plugUrl": "$$REMOVE",
279
- "reservePlugUrl": "$$REMOVE",
272
+ "plugStatus": "$$REMOVE",
273
+ "reservePlugStatus": "$$REMOVE",
280
274
  }
281
275
  }
282
276
  ]
283
277
 
284
278
  let aggregation = model.aggregate(pipelineStage)
285
- try { await model.collection.dropIndex("keitaroData.domainId") } catch(e) {}
286
- try { await model.collection.dropIndex("keitaroData.domainName") } catch(e) {}
287
-
288
- try { await model.collection.dropIndex("plugUrl") } catch(e) {}
289
- try { await model.collection.dropIndex("reservePlugUrl") } catch(e) {}
279
+ try { await model.collection.dropIndex("plugStatus") } catch(e) {}
280
+ try { await model.collection.dropIndex("reservePlugStatus") } catch(e) {}
290
281
 
291
282
  // await model.schema.dropIndex("generationOptions.keyPassword_1")
292
283
  await aggregation.exec()