@jd-data-limited/easy-fm 0.0.3 → 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.
package/README.md CHANGED
@@ -1,7 +1,7 @@
1
1
  # easy-fm
2
2
 
3
3
  easy-fm is a Node.js module that allows you to interact with
4
- a [FileMaker database stored](https://www.claris.com/filemaker/) on
4
+ a [FileMaker database](https://www.claris.com/filemaker/) stored on
5
5
  a [FileMaker server](https://www.claris.com/filemaker/server/). This module interacts with your server using the
6
6
  [FileMaker Data API](https://help.claris.com/en/data-api-guide/content/index.html).
7
7
 
@@ -169,7 +169,7 @@ find.addRequests( // Specify the find criteria
169
169
  {"CreatedBy": "BBBB"}
170
170
  )
171
171
 
172
- find.addSort("CratedBy", "ascend") // Sort the results in ascending order
172
+ find.addSort("CreatedBy", "ascend") // Sort the results in ascending order
173
173
  let records = await find.find() // Perform the find
174
174
  console.log(records)
175
175
  ```
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.3",
3
+ "version": "0.0.5",
4
4
  "dependencies": {
5
5
  "@types/btoa": "^1.2.3",
6
6
  "@types/events": "^3.0.0",