@jd-data-limited/easy-fm 0.0.4 → 0.0.5

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 (3) hide show
  1. package/index.js +7 -2
  2. package/index.ts +2 -1
  3. package/package.json +1 -1
package/index.js CHANGED
@@ -1,3 +1,6 @@
1
+ /*
2
+ * Copyright (c) 2022. See LICENSE file for more information
3
+ */
1
4
  var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
2
5
  function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
3
6
  return new (P || (P = Promise))(function (resolve, reject) {
@@ -462,10 +465,12 @@ class find {
462
465
  port: 443,
463
466
  method: "POST",
464
467
  body: JSON.stringify(this.toObject())
465
- }).then(res => {
468
+ }).then((res) => __awaiter(this, void 0, void 0, function* () {
466
469
  // // console.log(res)
467
470
  if (res.messages[0].code === "0") {
468
471
  // console.log("RESOLVING")
472
+ if (!this.layout.metadata)
473
+ yield this.layout.getLayoutMeta();
469
474
  let data = res.response.data.map(item => {
470
475
  return new record(this.layout, item.recordId, item.modId, item.fieldData, item.portalData);
471
476
  });
@@ -474,7 +479,7 @@ class find {
474
479
  else {
475
480
  reject(new FMError(res.messages[0].code, res.status, res));
476
481
  }
477
- })
482
+ }))
478
483
  .catch(e => {
479
484
  reject(e);
480
485
  });
package/index.ts CHANGED
@@ -543,10 +543,11 @@ class find {
543
543
  port: 443,
544
544
  method: "POST",
545
545
  body: JSON.stringify(this.toObject())
546
- }).then(res => {
546
+ }).then(async res => {
547
547
  // // console.log(res)
548
548
  if (res.messages[0].code === "0") {
549
549
  // console.log("RESOLVING")
550
+ if (!this.layout.metadata) await this.layout.getLayoutMeta()
550
551
  let data = res.response.data.map(item => {
551
552
  return new record(this.layout, item.recordId, item.modId, item.fieldData, item.portalData)
552
553
  })
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@jd-data-limited/easy-fm",
3
- "version": "0.0.4",
3
+ "version": "0.0.5",
4
4
  "dependencies": {
5
5
  "@types/btoa": "^1.2.3",
6
6
  "@types/events": "^3.0.0",