@jd-data-limited/easy-fm 3.0.8 → 3.0.10

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@jd-data-limited/easy-fm",
3
- "version": "3.0.8",
3
+ "version": "3.0.10",
4
4
  "dependencies": {
5
5
  "@types/btoa": "^1.2.3",
6
6
  "@types/events": "^3.0.0",
package/src/index.js CHANGED
@@ -1488,17 +1488,17 @@ export class LayoutRecord extends RecordBase {
1488
1488
  if ((_a = extraBody.scripts) === null || _a === void 0 ? void 0 : _a.after) {
1489
1489
  data["script"] = extraBody.scripts.after.name;
1490
1490
  if (extraBody.scripts.after.parameter)
1491
- data["param"] = extraBody.scripts.after.parameter;
1491
+ data["script.param"] = extraBody.scripts.after.parameter;
1492
1492
  }
1493
1493
  if ((_b = extraBody.scripts) === null || _b === void 0 ? void 0 : _b.prerequest) {
1494
- data["script"] = extraBody.scripts.after.name;
1494
+ data["script.prerequest"] = extraBody.scripts.after.name;
1495
1495
  if (extraBody.scripts.prerequest.parameter)
1496
- data["param"] = extraBody.scripts.prerequest.parameter;
1496
+ data["script.prerequest.param"] = extraBody.scripts.prerequest.parameter;
1497
1497
  }
1498
1498
  if ((_c = extraBody.scripts) === null || _c === void 0 ? void 0 : _c.presort) {
1499
- data["script"] = extraBody.scripts.presort.name;
1499
+ data["script.presort"] = extraBody.scripts.presort.name;
1500
1500
  if (extraBody.scripts.presort.parameter)
1501
- data["param"] = extraBody.scripts.presort.parameter;
1501
+ data["script.presort.param"] = extraBody.scripts.presort.parameter;
1502
1502
  }
1503
1503
  if (this.recordId === -1) {
1504
1504
  // This is a new LayoutRecord
@@ -1663,7 +1663,10 @@ export class Field {
1663
1663
  && !(content instanceof Date) && !!content) {
1664
1664
  throw "Value was not an instance of Date: " + content;
1665
1665
  }
1666
- this._value = content;
1666
+ if (!content)
1667
+ this._value = "";
1668
+ else
1669
+ this._value = content;
1667
1670
  this.edited = true;
1668
1671
  }
1669
1672
  get metadata() {
package/src/index.ts CHANGED
@@ -1676,15 +1676,15 @@ export class LayoutRecord extends RecordBase {
1676
1676
 
1677
1677
  if (extraBody.scripts?.after) {
1678
1678
  data["script"] = extraBody.scripts.after.name
1679
- if (extraBody.scripts.after.parameter) data["param"] = extraBody.scripts.after.parameter
1679
+ if (extraBody.scripts.after.parameter) data["script.param"] = extraBody.scripts.after.parameter
1680
1680
  }
1681
1681
  if (extraBody.scripts?.prerequest) {
1682
- data["script"] = extraBody.scripts.after.name
1683
- if (extraBody.scripts.prerequest.parameter) data["param"] = extraBody.scripts.prerequest.parameter
1682
+ data["script.prerequest"] = extraBody.scripts.after.name
1683
+ if (extraBody.scripts.prerequest.parameter) data["script.prerequest.param"] = extraBody.scripts.prerequest.parameter
1684
1684
  }
1685
1685
  if (extraBody.scripts?.presort) {
1686
- data["script"] = extraBody.scripts.presort.name
1687
- if (extraBody.scripts.presort.parameter) data["param"] = extraBody.scripts.presort.parameter
1686
+ data["script.presort"] = extraBody.scripts.presort.name
1687
+ if (extraBody.scripts.presort.parameter) data["script.presort.param"] = extraBody.scripts.presort.parameter
1688
1688
  }
1689
1689
 
1690
1690
  if (this.recordId === -1) {
@@ -1856,7 +1856,7 @@ export class Field {
1856
1856
  this.edited = false
1857
1857
  }
1858
1858
 
1859
- set(content: string | number | Date) {
1859
+ set(content: string | number | Date | undefined | null) {
1860
1860
  if (this.metadata.result === "container") throw "Cannot set container value using set(). Use upload() instead."
1861
1861
  if (
1862
1862
  (this.metadata.result === "timeStamp" ||
@@ -1866,7 +1866,8 @@ export class Field {
1866
1866
  ) {
1867
1867
  throw "Value was not an instance of Date: " + content
1868
1868
  }
1869
- this._value = content
1869
+ if (!content) this._value = ""
1870
+ else this._value = content
1870
1871
  this.edited = true
1871
1872
  }
1872
1873
 
package/img.png DELETED
Binary file
package/prop1.toml DELETED
@@ -1,58 +0,0 @@
1
- #Minecraft server properties
2
- #Wed May 03 20:32:16 AEST 2023
3
- allow-flight=false
4
- allow-nether=true
5
- broadcast-console-to-ops=true
6
- broadcast-rcon-to-ops=true
7
- difficulty=easy
8
- enable-command-block=false
9
- enable-jmx-monitoring=false
10
- enable-query=false
11
- enable-rcon=false
12
- enable-status=true
13
- enforce-secure-profile=true
14
- enforce-whitelist=false
15
- entity-broadcast-range-percentage=100
16
- force-gamemode=false
17
- function-permission-level=2
18
- gamemode=survival
19
- generate-structures=true
20
- generator-settings={}
21
- hardcore=false
22
- hide-online-players=false
23
- level-name=world
24
- level-seed=
25
- level-type=minecraft\:normal
26
- max-chained-neighbor-updates=1000000
27
- max-players=20
28
- max-threads=6
29
- max-tick-time=-1
30
- max-world-size=29999984
31
- motd=A Minecraft Server
32
- network-compression-threshold=256
33
- online-mode=false
34
- op-permission-level=4
35
- player-idle-timeout=0
36
- prevent-proxy-connections=false
37
- previews-chat=false
38
- pvp=true
39
- query.port=25565
40
- rate-limit=0
41
- rcon.password=
42
- rcon.port=25575
43
- require-resource-pack=false
44
- resource-pack=
45
- resource-pack-prompt=
46
- resource-pack-sha1=
47
- server-ip=119.252.189.11
48
- server-port=27002
49
- simulation-distance=10
50
- spawn-animals=true
51
- spawn-monsters=true
52
- spawn-npcs=true
53
- spawn-protection=16
54
- sync-chunk-writes=false
55
- text-filtering-config=
56
- use-native-transport=true
57
- view-distance=10
58
- white-list=false
package/prop2.toml DELETED
@@ -1,58 +0,0 @@
1
- #Minecraft server properties
2
- #Wed May 03 12:46:20 CEST 2023
3
- allow-flight=false
4
- allow-nether=true
5
- broadcast-console-to-ops=true
6
- broadcast-rcon-to-ops=true
7
- difficulty=easy
8
- enable-command-block=true
9
- enable-jmx-monitoring=false
10
- enable-query=true
11
- enable-rcon=false
12
- enable-status=true
13
- enforce-secure-profile=true
14
- enforce-whitelist=false
15
- entity-broadcast-range-percentage=100
16
- force-gamemode=false
17
- function-permission-level=2
18
- gamemode=survival
19
- generate-structures=true
20
- generator-settings={}
21
- hardcore=false
22
- hide-online-players=false
23
- level-name=world
24
- level-seed=
25
- level-type=minecraft\:normal
26
- max-chained-neighbor-updates=1000000
27
- max-players=100
28
- max-tick-time=60000
29
- max-world-size=29999984
30
- motd=4vNBdJ
31
- network-compression-threshold=256
32
- online-mode=true
33
- op-permission-level=4
34
- player-idle-timeout=0
35
- prevent-proxy-connections=false
36
- previews-chat=false
37
- pvp=true
38
- query.port=41305
39
- rate-limit=0
40
- rcon.password=
41
- rcon.port=25575
42
- require-resource-pack=false
43
- resource-pack=
44
- resource-pack-prompt=
45
- resource-pack-sha1=
46
- server-ip=
47
- server-port=41305
48
- simulation-distance=10
49
- snooper-enabled=false
50
- spawn-animals=true
51
- spawn-monsters=true
52
- spawn-npcs=true
53
- spawn-protection=16
54
- sync-chunk-writes=true
55
- text-filtering-config=
56
- use-native-transport=true
57
- view-distance=10
58
- white-list=false
package/test.js DELETED
@@ -1,35 +0,0 @@
1
- import FMHost from "./src/index.js";
2
- import * as fs from "fs";
3
- import {DOWNLOAD_MODES} from "./src/index.js";
4
-
5
- process.env.NODE_TLS_REJECT_UNAUTHORIZED = '0';
6
-
7
- const host = new FMHost("https://192.168.2.128", 0, false)
8
- const database = host.database({
9
- database: "Snapshot_2",
10
- credentials: {
11
- method: "filemaker",
12
- username: "jhawinkels",
13
- password: "ZTw8&8E7"
14
- },
15
- externalSources: []
16
- })
17
- database.login()
18
- .then(async () => {
19
- let layout = database.getLayout("ReportsJSON")
20
- await layout.getLayoutMeta()
21
- console.log(layout.metadata)
22
-
23
- let record = (await layout.records.range(4, 9).fetch())[0]
24
-
25
- record.getField("In|PartnerID").set("42565F30-5F5D-44A4-83A0-E52128974581")
26
-
27
-
28
- let portal = record.getPortal("Reports|Archive")
29
- let portal_record = portal.create()
30
- portal_record.getField("SampleClass").set("Hello!")
31
-
32
- await record.commit()
33
- await record.get()
34
- console.log(record.getField("__PrimaryKey").value)
35
- })
package/test2.cjs DELETED
@@ -1,62 +0,0 @@
1
- const ytdl = require('ytdl-core');
2
- const path = require('path');
3
- const fs = require('fs');
4
-
5
-
6
- // To get your YouTube cookie
7
- // - navigate to YouTube in a web browser
8
- // - open up dev tools (opt+cmd+j on mac)
9
- // - go to the network tab
10
- // - click on a request on the left
11
- // - scroll down to "Request Headers"
12
- // - find the "cookie" header and copy its entire contents
13
- const videoID = 'WAw1g2tHN3s';
14
-
15
- const outputName = 'video.mp4';
16
- const outputPath = path.resolve(__dirname, outputName);
17
- let last_pecent
18
- async function run() {
19
- await downloadVideo(videoID, "highestaudio", outputPath + ".audio.mp4")
20
- }
21
-
22
- function downloadVideo(id, format, file) {
23
- return new Promise(async (resolve, reject) => {
24
- const video = await ytdl(videoID, {filter: "audioandvideo"});
25
- const save_stream = fs.createWriteStream(file)
26
-
27
- video.on('info', info => {
28
- console.log('title:', info.videoDetails.title);
29
- console.log('rating:', info.player_response.videoDetails.averageRating);
30
- console.log('uploaded by:', info.videoDetails.author.name);
31
- });
32
-
33
- video.on('progress', (chunkLength, downloaded, total) => {
34
- const percent = Math.round((downloaded / total) * 100) / 100;
35
- if (percent !== last_pecent) {
36
- console.log(format + ' - downloading', `${(percent * 100)}%`);
37
- last_pecent = percent
38
- }
39
- });
40
-
41
- video.on('end', () => {
42
- console.log('saved to', outputName);
43
- });
44
-
45
- video.on("error", (e) => {
46
- console.log("ERROR:", e)
47
- })
48
-
49
- save_stream.on("close", (e) => {
50
- console.log("Stream closed")
51
- resolve()
52
- })
53
-
54
- video.pipe(save_stream);
55
-
56
- setTimeout(() => {
57
- console.log("HI!")
58
- }, 600000000)
59
- })
60
- }
61
-
62
- run()