@digione/node-custom-api 0.2.0-alpha3 → 0.2.0-alpha4

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.
Files changed (2) hide show
  1. package/package.json +1 -1
  2. package/utils/stream.js +9 -1
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@digione/node-custom-api",
3
- "version": "0.2.0-alpha3",
3
+ "version": "0.2.0-alpha4",
4
4
  "description": "Typescript node digione-api",
5
5
  "author": "Monchai Jirayupong <monchai.j@seven.co.th>",
6
6
  "license": "MIT",
package/utils/stream.js CHANGED
@@ -487,7 +487,9 @@ class StreamUtil {
487
487
  return Object.assign({ field_slug: i['lang_code'], field_name: `${convert_option ? (0, i18n_1.__)({ phrase: item['field_name'], locale: lang_code }) : item['field_name']} (${i['lang_code']})`, field_type: item['field_type'], field_name_raw: item['field_name'] ? item['field_name'] : "", is_required: item['is_required'] }, include);
488
488
  });
489
489
  fields.push(Object.assign(Object.assign({}, item), { field_data }));
490
- continue;
490
+ if (item['field_type'] != "stream") {
491
+ continue;
492
+ }
491
493
  }
492
494
  if (convert_option) {
493
495
  let obj_value = {};
@@ -1695,6 +1697,12 @@ class StreamUtil {
1695
1697
  yield (0, db_1.addColumn)(`${this.ref}_${table}`, field_slug, Object.assign({ type: sequelize.STRING(20) }, opt));
1696
1698
  }
1697
1699
  break;
1700
+ case "stream":
1701
+ if (field_data['self_table'] == "yes") {
1702
+ opt['defaultValue'] = undefined;
1703
+ yield (0, db_1.addColumn)(`${this.ref}_${table}`, field_slug, Object.assign({ type: sequelize.TEXT('long') }, opt));
1704
+ }
1705
+ break;
1698
1706
  }
1699
1707
  }
1700
1708
  }