cloudflare-ddns-sync 2.0.5 → 2.0.6

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/CHANGELOG.md CHANGED
@@ -2,6 +2,10 @@
2
2
 
3
3
  ## v2
4
4
 
5
+ ### v2.0.6
6
+
7
+ - ⬆️ Update dependencies
8
+
5
9
  ### v2.0.5
6
10
 
7
11
  - 🚨 Replace tslint with eslint
package/README.md CHANGED
@@ -5,12 +5,11 @@
5
5
  [![NPM](https://nodei.co/npm/cloudflare-ddns-sync.png)](https://www.npmjs.com/package/cloudflare-ddns-sync)
6
6
  [![NPM](https://nodei.co/npm/cloudflare-ddns-sync-cli.png)](https://www.npmjs.com/package/cloudflare-ddns-sync-cli)
7
7
 
8
-
9
8
  ## Overview
10
9
 
11
10
  Cloudflare-DDNS-Sync is a simple module that updates Cloudflare DNS records.
12
11
 
13
- For a more detailed overview, have a look at the [Documentation](https://cddnss.knaup.dev/)
12
+ For a more detailed overview, have a look at the [Documentation](https://cddnss.knaup.pw/)
14
13
 
15
14
  You may also have a look at the **official** [CLI version](https://www.npmjs.com/package/cloudflare-ddns-sync-cli) of Cloudflare-DDNS-Sync.
16
15
 
@@ -18,7 +17,7 @@ You may also have a look at the **official** [CLI version](https://www.npmjs.com
18
17
 
19
18
  ### Prerequisites
20
19
 
21
- - Node
20
+ - Node (14, 16, 18)
22
21
  - Cloudflare Account
23
22
 
24
23
  ### Installation
@@ -34,27 +33,27 @@ in your project folder.
34
33
  ## Usage
35
34
 
36
35
  > Hint: If a record is not existing, CDS will automatically create it when
37
- syncing.
36
+ > syncing.
38
37
 
39
38
  ### Javascript Example
40
39
 
41
40
  ```javascript
42
- const Cddnss = require('cloudflare-ddns-sync').default;
41
+ const Cddnss = require("cloudflare-ddns-sync").default;
43
42
 
44
- const cddnss = new Cddnss('your@email.com', '<your-cloudflare-api-key>');
43
+ const cddnss = new Cddnss("your@email.com", "<your-cloudflare-api-key>");
45
44
 
46
45
  const records = [
47
46
  {
48
- name: 'test-1.domain.com',
49
- type: 'A', // optional
50
- proxied: true, // optional
51
- ttl: 1, // optional
52
- priority: 0, // optional
53
- content: '1.2.3.4', // optional
47
+ name: "test-1.domain.com",
48
+ type: "A", // optional
49
+ proxied: true, // optional
50
+ ttl: 1, // optional
51
+ priority: 0, // optional
52
+ content: "1.2.3.4", // optional
54
53
  },
55
54
  {
56
- name: "test-2.domain.com"
57
- }
55
+ name: "test-2.domain.com",
56
+ },
58
57
  ];
59
58
 
60
59
  cddnss.syncRecords(records).then((result) => {
@@ -65,21 +64,24 @@ cddnss.syncRecords(records).then((result) => {
65
64
  ### Typescript Example
66
65
 
67
66
  ```typescript
68
- import Cddnss, {Record, RecordData} from 'cloudflare-ddns-sync';
67
+ import Cddnss, { Record, RecordData } from "cloudflare-ddns-sync";
69
68
 
70
- const cddnss: Cddnss = new Cddnss('your@email.com', '<your-cloudflare-api-key>');
69
+ const cddnss: Cddnss = new Cddnss(
70
+ "your@email.com",
71
+ "<your-cloudflare-api-key>"
72
+ );
71
73
 
72
74
  const records: Array<Record> = [
73
75
  {
74
- name: 'test-1.yourdomain.com',
75
- type: 'A', // optional
76
- proxied: true, // optional
77
- ttl: 1, // optional
78
- priority: 0, // optional
79
- content: '1.2.3.4', // optional
76
+ name: "test-1.yourdomain.com",
77
+ type: "A", // optional
78
+ proxied: true, // optional
79
+ ttl: 1, // optional
80
+ priority: 0, // optional
81
+ content: "1.2.3.4", // optional
80
82
  },
81
83
  {
82
- name: "test-2.yourdomain.com"
84
+ name: "test-2.yourdomain.com",
83
85
  },
84
86
  ];
85
87
 
@@ -108,18 +110,18 @@ Cron expressions have the following syntax:
108
110
 
109
111
  - getIp(): Promise\<string\>
110
112
  - getIpv6(): Promise\<string\>
111
- - getRecordDataForDomain(domain: string): Promise\<Array\<[RecordData](https://cddnss.knaup.dev/types/recorddata)\>\>
112
- - getRecordDataForDomains(domains: Array\<string\>): Promise\<[DomainRecordList](https://cddnss.knaup.dev/types/domainrecordlist)\>
113
- - getRecordDataForRecord(record: [Record](https://cddnss.knaup.dev/types/record)): Promise\<[RecordData](https://cddnss.knaup.dev/types/recorddata)\>
114
- - getRecordDataForRecords(records: Array\<[Record](https://cddnss.knaup.dev/types/record)\>): Promise\<Array\<[RecordData](https://cddnss.knaup.dev/types/recorddata)\>\>
113
+ - getRecordDataForDomain(domain: string): Promise\<Array\<[RecordData](https://cddnss.knaup.pw/types/recorddata)\>\>
114
+ - getRecordDataForDomains(domains: Array\<string\>): Promise\<[DomainRecordList](https://cddnss.knaup.pw/types/domainrecordlist)\>
115
+ - getRecordDataForRecord(record: [Record](https://cddnss.knaup.pw/types/record)): Promise\<[RecordData](https://cddnss.knaup.pw/types/recorddata)\>
116
+ - getRecordDataForRecords(records: Array\<[Record](https://cddnss.knaup.pw/types/record)\>): Promise\<Array\<[RecordData](https://cddnss.knaup.pw/types/recorddata)\>\>
115
117
  - removeRecord(recordName: string, recordType?: string): Promise\<void\>
116
118
  - stopSyncOnIpChange(changeListenerId: string): void
117
- - syncByCronTime(cronExpression: string, records: Array\<[Record](https://cddnss.knaup.dev/types/recorddata)\>, callback: [MultiSyncCallback](https://cddnss.knaup.dev/types/multisynccallback), ip?: string): [ScheduledTask](https://www.npmjs.com/package/node-cron#scheduledtask-methods)
118
- - syncOnIpChange(records: Array\<[Record](https://cddnss.knaup.dev/types/record)\>, callback: multisynccallback): Promise\<string\>
119
- - syncRecord(record: [Record](https://cddnss.knaup.dev/types/record), ip?: string): Promise\<[RecordData](https://cddnss.knaup.dev/types/recorddata)\>
120
- - syncRecords(records: Array\<[Record](https://cddnss.knaup.dev/types/record)\>, ip?: string): Promise\<Array\<[RecordData](https://cddnss.knaup.dev/types/recorddata)\>\>
119
+ - syncByCronTime(cronExpression: string, records: Array\<[Record](https://cddnss.knaup.pw/types/recorddata)\>, callback: [MultiSyncCallback](https://cddnss.knaup.pw/types/multisynccallback), ip?: string): [ScheduledTask](https://www.npmjs.com/package/node-cron#scheduledtask-methods)
120
+ - syncOnIpChange(records: Array\<[Record](https://cddnss.knaup.pw/types/record)\>, callback: multisynccallback): Promise\<string\>
121
+ - syncRecord(record: [Record](https://cddnss.knaup.pw/types/record), ip?: string): Promise\<[RecordData](https://cddnss.knaup.pw/types/recorddata)\>
122
+ - syncRecords(records: Array\<[Record](https://cddnss.knaup.pw/types/record)\>, ip?: string): Promise\<Array\<[RecordData](https://cddnss.knaup.pw/types/recorddata)\>\>
121
123
 
122
- For a more detailed view, have a look at the [Documentation](https://cddnss.knaup.dev/)
124
+ For a more detailed view, have a look at the [Documentation](https://cddnss.knaup.pw/)
123
125
 
124
126
  ## Get Your Cloudflare API Key
125
127
 
@@ -1,3 +1,3 @@
1
1
  import { RecordData } from './index';
2
- export declare type SingleSyncCallback = (syncResult: RecordData) => void;
3
- export declare type MultiSyncCallback = (syncResult: Array<RecordData>) => void;
2
+ export type SingleSyncCallback = (syncResult: RecordData) => void;
3
+ export type MultiSyncCallback = (syncResult: Array<RecordData>) => void;
@@ -1,4 +1,4 @@
1
1
  import { RecordData } from './index';
2
- export declare type DomainRecordList = {
2
+ export type DomainRecordList = {
3
3
  [domain: string]: Array<RecordData>;
4
4
  };
@@ -1,4 +1,4 @@
1
- export declare type Record = {
1
+ export type Record = {
2
2
  name: string;
3
3
  type?: string;
4
4
  proxied?: boolean;
@@ -1 +1 @@
1
- export declare type ZoneMap = Map<string, string>;
1
+ export type ZoneMap = Map<string, string>;
@@ -1,4 +1,4 @@
1
- export declare type RecordData = {
1
+ export type RecordData = {
2
2
  id: string;
3
3
  type: string;
4
4
  name: string;
@@ -13,7 +13,7 @@ export declare type RecordData = {
13
13
  created_on: string;
14
14
  meta: RecordMetaData;
15
15
  };
16
- export declare type RecordMetaData = {
16
+ export type RecordMetaData = {
17
17
  auto_added: boolean;
18
18
  managed_by_apps: boolean;
19
19
  managed_by_argo_tunnel: boolean;
@@ -1,4 +1,4 @@
1
- export declare type ZoneData = {
1
+ export type ZoneData = {
2
2
  id: string;
3
3
  name: string;
4
4
  status: string;
@@ -1,7 +1,11 @@
1
1
  "use strict";
2
2
  var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
3
  if (k2 === undefined) k2 = k;
4
- Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
5
9
  }) : (function(o, m, k, k2) {
6
10
  if (k2 === undefined) k2 = k;
7
11
  o[k2] = m[k];
@@ -1,7 +1,11 @@
1
1
  "use strict";
2
2
  var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
3
  if (k2 === undefined) k2 = k;
4
- Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
5
9
  }) : (function(o, m, k, k2) {
6
10
  if (k2 === undefined) k2 = k;
7
11
  o[k2] = m[k];
package/dist/index.js CHANGED
@@ -1,7 +1,11 @@
1
1
  "use strict";
2
2
  var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
3
  if (k2 === undefined) k2 = k;
4
- Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
5
9
  }) : (function(o, m, k, k2) {
6
10
  if (k2 === undefined) k2 = k;
7
11
  o[k2] = m[k];
package/dist/lib/cron.js CHANGED
@@ -9,7 +9,7 @@ class Cron {
9
9
  const cronExpressionIsInvalid = !this.isValid(cronExpression);
10
10
  if (cronExpressionIsInvalid) {
11
11
  // eslint-disable-next-line max-len
12
- throw new Error(`'${cronExpression}' is not a valid cron expression.\nHere you can see how cron expressions work: https://cddnss.knaup.dev/cron-expression-syntax`);
12
+ throw new Error(`'${cronExpression}' is not a valid cron expression.\nHere you can see how cron expressions work: https://cddnss.knaup.pw/cron-expression-syntax`);
13
13
  }
14
14
  return node_cron_1.default.schedule(cronExpression, () => {
15
15
  callback();
@@ -1,7 +1,11 @@
1
1
  "use strict";
2
2
  var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
3
  if (k2 === undefined) k2 = k;
4
- Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
5
9
  }) : (function(o, m, k, k2) {
6
10
  if (k2 === undefined) k2 = k;
7
11
  o[k2] = m[k];
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "cloudflare-ddns-sync",
3
- "version": "2.0.5",
3
+ "version": "2.0.6",
4
4
  "description": "A simple module to update DNS records on Cloudflare whenever you want",
5
5
  "main": "dist/index.js",
6
6
  "author": "Steffen Knaup <SteffenKnaup@hotmail.de>",
@@ -13,7 +13,7 @@
13
13
  "dyndns",
14
14
  "sync"
15
15
  ],
16
- "homepage": "https://cddnss.knaup.dev/",
16
+ "homepage": "https://cddnss.knaup.pw/",
17
17
  "repository": {
18
18
  "type": "git",
19
19
  "url": "git://github.com:Steffen982/cloudflare-ddns-sync.git"
@@ -29,25 +29,24 @@
29
29
  },
30
30
  "dependencies": {
31
31
  "cloudflare": "2.9.1",
32
- "node-cron": "3.0.0",
32
+ "node-cron": "3.0.2",
33
33
  "parse-domain": "4.1.0",
34
34
  "public-ip": "4.0.4",
35
35
  "what-is-my-ip-address": "1.0.3"
36
36
  },
37
37
  "devDependencies": {
38
- "@types/chai": "4.3.0",
38
+ "@types/chai": "4.3.4",
39
39
  "@types/minimist": "1.2.2",
40
- "@types/mocha": "9.0.0",
41
- "@types/node": "16.11.20",
42
- "@types/node-cron": "3.0.1",
43
- "@typescript-eslint/eslint-plugin": "5.10.0",
44
- "@typescript-eslint/parser": "5.10.0",
45
- "c8": "7.11.0",
46
- "chai": "4.3.4",
47
- "eslint": "8.7.0",
48
- "minimist": "1.2.5",
49
- "mocha": "9.1.4",
50
- "tslint": "6.1.3",
51
- "typescript": "4.5.4"
40
+ "@types/mocha": "9.1.1",
41
+ "@types/node": "18.11.17",
42
+ "@types/node-cron": "3.0.6",
43
+ "@typescript-eslint/eslint-plugin": "5.46.1",
44
+ "@typescript-eslint/parser": "5.46.1",
45
+ "c8": "7.12.0",
46
+ "chai": "4.3.7",
47
+ "eslint": "8.30.0",
48
+ "minimist": "1.2.7",
49
+ "mocha": "9.2.2",
50
+ "typescript": "4.9.4"
52
51
  }
53
52
  }