@nocobase/plugin-field-sequence 1.2.13-alpha → 1.3.0-alpha.20240710084543

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 (91) hide show
  1. package/package.json +2 -2
  2. package/dist/client/SequenceFieldProvider.d.ts +0 -10
  3. package/dist/client/index.d.ts +0 -13
  4. package/dist/client/index.js +0 -28
  5. package/dist/client/locale/index.d.ts +0 -11
  6. package/dist/client/sequence.d.ts +0 -267
  7. package/dist/externalVersion.js +0 -23
  8. package/dist/index.d.ts +0 -10
  9. package/dist/index.js +0 -48
  10. package/dist/locale/en-US.json +0 -24
  11. package/dist/locale/es-ES.json +0 -24
  12. package/dist/locale/fr-FR.json +0 -24
  13. package/dist/locale/ko_KR.json +0 -24
  14. package/dist/locale/pt-BR.json +0 -24
  15. package/dist/locale/zh-CN.json +0 -28
  16. package/dist/node_modules/cron-parser/.eslintrc.json +0 -15
  17. package/dist/node_modules/cron-parser/.travis.yml +0 -7
  18. package/dist/node_modules/cron-parser/LICENSE +0 -21
  19. package/dist/node_modules/cron-parser/component.json +0 -11
  20. package/dist/node_modules/cron-parser/index.d.ts +0 -1
  21. package/dist/node_modules/cron-parser/lib/date.js +0 -252
  22. package/dist/node_modules/cron-parser/lib/expression.js +0 -983
  23. package/dist/node_modules/cron-parser/lib/field_compactor.js +0 -70
  24. package/dist/node_modules/cron-parser/lib/field_stringify.js +0 -38
  25. package/dist/node_modules/cron-parser/lib/parser.js +0 -1
  26. package/dist/node_modules/cron-parser/node_modules/luxon/build/amd/luxon.js +0 -8489
  27. package/dist/node_modules/cron-parser/node_modules/luxon/build/cjs-browser/luxon.js +0 -8487
  28. package/dist/node_modules/cron-parser/node_modules/luxon/build/global/luxon.js +0 -8490
  29. package/dist/node_modules/cron-parser/node_modules/luxon/build/global/luxon.min.js +0 -1
  30. package/dist/node_modules/cron-parser/node_modules/luxon/build/node/luxon.js +0 -7522
  31. package/dist/node_modules/cron-parser/node_modules/luxon/package.json +0 -96
  32. package/dist/node_modules/cron-parser/node_modules/luxon/src/datetime.js +0 -2169
  33. package/dist/node_modules/cron-parser/node_modules/luxon/src/duration.js +0 -880
  34. package/dist/node_modules/cron-parser/node_modules/luxon/src/errors.js +0 -61
  35. package/dist/node_modules/cron-parser/node_modules/luxon/src/impl/conversions.js +0 -157
  36. package/dist/node_modules/cron-parser/node_modules/luxon/src/impl/diff.js +0 -80
  37. package/dist/node_modules/cron-parser/node_modules/luxon/src/impl/digits.js +0 -76
  38. package/dist/node_modules/cron-parser/node_modules/luxon/src/impl/english.js +0 -233
  39. package/dist/node_modules/cron-parser/node_modules/luxon/src/impl/formats.js +0 -191
  40. package/dist/node_modules/cron-parser/node_modules/luxon/src/impl/formatter.js +0 -386
  41. package/dist/node_modules/cron-parser/node_modules/luxon/src/impl/invalid.js +0 -14
  42. package/dist/node_modules/cron-parser/node_modules/luxon/src/impl/locale.js +0 -482
  43. package/dist/node_modules/cron-parser/node_modules/luxon/src/impl/regexParser.js +0 -335
  44. package/dist/node_modules/cron-parser/node_modules/luxon/src/impl/tokenParser.js +0 -424
  45. package/dist/node_modules/cron-parser/node_modules/luxon/src/impl/util.js +0 -292
  46. package/dist/node_modules/cron-parser/node_modules/luxon/src/impl/zoneUtil.js +0 -36
  47. package/dist/node_modules/cron-parser/node_modules/luxon/src/info.js +0 -193
  48. package/dist/node_modules/cron-parser/node_modules/luxon/src/interval.js +0 -602
  49. package/dist/node_modules/cron-parser/node_modules/luxon/src/luxon.js +0 -26
  50. package/dist/node_modules/cron-parser/node_modules/luxon/src/luxonFilled.js +0 -13
  51. package/dist/node_modules/cron-parser/node_modules/luxon/src/settings.js +0 -137
  52. package/dist/node_modules/cron-parser/node_modules/luxon/src/zone.js +0 -88
  53. package/dist/node_modules/cron-parser/node_modules/luxon/src/zones/IANAZone.js +0 -191
  54. package/dist/node_modules/cron-parser/node_modules/luxon/src/zones/fixedOffsetZone.js +0 -94
  55. package/dist/node_modules/cron-parser/node_modules/luxon/src/zones/invalidZone.js +0 -53
  56. package/dist/node_modules/cron-parser/node_modules/luxon/src/zones/localZone.js +0 -63
  57. package/dist/node_modules/cron-parser/package.json +0 -1
  58. package/dist/node_modules/cron-parser/test/31_of_month.js +0 -17
  59. package/dist/node_modules/cron-parser/test/bug.js +0 -29
  60. package/dist/node_modules/cron-parser/test/crondate.js +0 -16
  61. package/dist/node_modules/cron-parser/test/crontab.example +0 -7
  62. package/dist/node_modules/cron-parser/test/empty_around_comma.js +0 -22
  63. package/dist/node_modules/cron-parser/test/expression.js +0 -1489
  64. package/dist/node_modules/cron-parser/test/field_compactor.js +0 -250
  65. package/dist/node_modules/cron-parser/test/field_stringify.js +0 -84
  66. package/dist/node_modules/cron-parser/test/fields.js +0 -32
  67. package/dist/node_modules/cron-parser/test/increment_on_first_iteration.js +0 -22
  68. package/dist/node_modules/cron-parser/test/index-ts3.test-d.ts +0 -133
  69. package/dist/node_modules/cron-parser/test/index.test-d.ts +0 -138
  70. package/dist/node_modules/cron-parser/test/leap_year.js +0 -17
  71. package/dist/node_modules/cron-parser/test/parser.js +0 -46
  72. package/dist/node_modules/cron-parser/test/parser_crondate_formats.js +0 -145
  73. package/dist/node_modules/cron-parser/test/parser_day_of_month.js +0 -169
  74. package/dist/node_modules/cron-parser/test/prev_date.js +0 -32
  75. package/dist/node_modules/cron-parser/test/stringify.js +0 -402
  76. package/dist/node_modules/cron-parser/test/timezone.js +0 -422
  77. package/dist/node_modules/cron-parser/types/common.d.ts +0 -131
  78. package/dist/node_modules/cron-parser/types/index.d.ts +0 -45
  79. package/dist/node_modules/cron-parser/types/ts3/index.d.ts +0 -28
  80. package/dist/server/Plugin.d.ts +0 -16
  81. package/dist/server/Plugin.js +0 -133
  82. package/dist/server/collections/sequences.d.ts +0 -10
  83. package/dist/server/collections/sequences.js +0 -99
  84. package/dist/server/fields/sequence-field.d.ts +0 -46
  85. package/dist/server/fields/sequence-field.js +0 -395
  86. package/dist/server/index.d.ts +0 -10
  87. package/dist/server/index.js +0 -48
  88. package/dist/server/migrations/20221207022250-sequence-field-key.d.ts +0 -14
  89. package/dist/server/migrations/20221207022250-sequence-field-key.js +0 -94
  90. package/dist/server/migrations/20240425225438-change-locale-module.d.ts +0 -14
  91. package/dist/server/migrations/20240425225438-change-locale-module.js +0 -51
@@ -1,46 +0,0 @@
1
- var test = require('tap').test;
2
- var CronParser = require('../lib/parser');
3
-
4
- // Globals
5
-
6
- test('load crontab file', function(t) {
7
- CronParser.parseFile(__dirname + '/crontab.example', function(err, result) {
8
- t.error(err, 'File read error');
9
- t.ok(result, 'Crontab parsed parsed');
10
-
11
- t.equal(Object.keys(result.variables).length, 2, 'variables length matches');
12
- t.equal(Object.keys(result.errors).length, 0, 'errors length matches');
13
- t.equal(result.expressions.length, 3, 'expressions length matches');
14
-
15
- // Parse expressions
16
- var next = null;
17
-
18
- t.equal(result.expressions[0].hasNext(), true);
19
- next = result.expressions[0].next();
20
- t.ok(next, 'first date');
21
-
22
- next = result.expressions[1].next();
23
- t.ok(next, 'second date');
24
-
25
- next = result.expressions[2].next();
26
- t.ok(next, 'third date');
27
-
28
- t.end();
29
- });
30
- });
31
-
32
- test('no next date', function(t) {
33
- var options = {
34
- currentDate: new Date(2014, 0, 1),
35
- endDate: new Date(2014, 0, 1)
36
- };
37
-
38
- try {
39
- var interval = CronParser.parseExpression('* * 2 * *', options);
40
- t.equal(interval.hasNext(), false);
41
- } catch (err) {
42
- t.error(err, 'Parse read error');
43
- }
44
-
45
- t.end();
46
- });
@@ -1,145 +0,0 @@
1
- var luxon = require('luxon');
2
- var test = require('tap').test;
3
- var CronDate = require('../lib/date');
4
-
5
- test('parse cron date formats with local timezone', (t) => {
6
- // Some tests need the local offset to be compatible without invoking timezone management.
7
- // Local offset is dependent on what the system being tested on is
8
- var offset = new Date().getTimezoneOffset();
9
- var offsetHours = Math.abs(Math.floor(offset/60));
10
- var offsetMinutes = offset % 60;
11
- var offsetSign = offset < 0 ? '-' : '+';
12
-
13
- var expectedTime = new Date(2021, 0, 4, 10, 0, 0).toString();
14
-
15
- test('undefined date', (t) => {
16
- const realDate = new Date();
17
- var d = new CronDate();
18
-
19
- t.equal(d.toDate().toString(), realDate.toString());
20
-
21
- t.end();
22
- });
23
-
24
- test('JS Date', (t) => {
25
- var d = new CronDate(new Date(2021, 0, 4, 10, 0, 0));
26
- t.equal(d.toDate().toString(), expectedTime);
27
-
28
- t.end();
29
- });
30
-
31
- test('ISO 8601', (t) => {
32
- var d = new CronDate('2021-01-04T10:00:00');
33
- t.equal(d.toDate().toString(), expectedTime);
34
-
35
- t.end();
36
- });
37
-
38
- test('ISO 8601 date', (t) => {
39
-
40
- var d = new CronDate('2021-01-04');
41
- var expectedTime = new Date(2021, 0, 4, 0, 0, 0).toString();
42
-
43
- t.equal(d.toDate().toString(), expectedTime);
44
-
45
- t.end();
46
- });
47
-
48
- test('RFC2822', (t) => {
49
- var offsetString = offsetSign + String(offsetHours).padStart(2, 0) + String(offsetMinutes).padStart(2, 0);
50
-
51
- var d = new CronDate('Mon, 4 Jan 2021 10:00:00 ' + offsetString);
52
- t.equal(d.toDate().toString(), expectedTime);
53
-
54
- t.end();
55
- });
56
-
57
- test('RFC2822-like without timezone offset', (t) => {
58
- var d = new CronDate('Mon, 4 Jan 2021 10:00:00');
59
- t.equal(d.toDate().toString(), expectedTime);
60
-
61
- t.end();
62
- });
63
-
64
- test('SQL', (t) => {
65
- var d = new CronDate('2021-01-04 10:00:00');
66
- t.equal(d.toDate().toString(), expectedTime);
67
-
68
- t.end();
69
- });
70
-
71
- test('milliseconds', (t) => {
72
- var d = new CronDate(new Date('2021-01-04 10:00:00').valueOf());
73
- t.equal(d.toDate().toString(), expectedTime);
74
-
75
- t.end();
76
- });
77
-
78
- test('CronDate', (t) => {
79
- var date = new CronDate('Mon, 4 Jan 2021 10:00:00');
80
- var d = new CronDate(date);
81
- t.equal(d.toDate().toString(), expectedTime);
82
-
83
- t.end();
84
- });
85
-
86
- test('invalid', (t) => {
87
- t.throws(() => {
88
- var d = new CronDate('2021-01-4 10:00:00');
89
- });
90
-
91
- t.end();
92
- });
93
-
94
- t.end();
95
- });
96
-
97
- test('parse cron date formats with another timezone', (t) => {
98
- test('ISO 8601 without offset', (t) => {
99
- // implies format already in timezone
100
- var d = new CronDate('2021-01-04T10:00:00', 'Europe/Athens');
101
- t.equal(d.toISOString(), '2021-01-04T08:00:00.000Z');
102
-
103
- t.end();
104
- });
105
-
106
- test('ISO 8601 with non-local offset', (t) => {
107
- var d = new CronDate('2021-01-04T10:00:00+01:00', 'Europe/Athens');
108
- t.equal(d.toISOString(), '2021-01-04T09:00:00.000Z');
109
-
110
- t.end();
111
- });
112
-
113
- test('RFC2822 with non-local offset', (t) => {
114
- var d = new CronDate('Mon, 4 Jan 2021 10:00:00 +0100', 'Europe/Athens');
115
- t.equal(d.toISOString(), '2021-01-04T09:00:00.000Z');
116
-
117
- t.end();
118
- });
119
-
120
- test('milliseconds', (t) => {
121
- var date = luxon.DateTime.fromISO('2021-01-04T11:00:00.000+02:00').valueOf();
122
- var d = new CronDate(date, 'Europe/Athens');
123
- t.equal(d.toISOString(), '2021-01-04T09:00:00.000Z');
124
-
125
- t.end();
126
- });
127
-
128
- test('CronDate with same timezone', (t) => {
129
- var date = new CronDate('Mon, 4 Jan 2021 10:00:00', 'Europe/Athens');
130
- var d = new CronDate(date);
131
- t.equal(d.toISOString(), '2021-01-04T08:00:00.000Z');
132
-
133
- t.end();
134
- });
135
-
136
- test('CronDate with different timezone', (t) => {
137
- var date = new CronDate('Mon, 4 Jan 2021 10:00:00', 'America/New_York');
138
- var d = new CronDate(date, 'Europe/Athens');
139
- t.equal(d.toISOString(), '2021-01-04T15:00:00.000Z');
140
-
141
- t.end();
142
- });
143
-
144
- t.end('crondate input should');
145
- });
@@ -1,169 +0,0 @@
1
- var test = require('tap').test;
2
- var CronParser = require('../lib/parser');
3
-
4
- test('parse cron with last day in a month', function(t) {
5
- var options = {
6
- currentDate: new Date(2014, 0, 1),
7
- endDate: new Date(2014, 10, 1)
8
- };
9
-
10
- try {
11
- var interval = CronParser.parseExpression('0 0 L * *', options);
12
- t.equal(interval.hasNext(), true);
13
-
14
- for (i = 0; i < 10; ++i) {
15
- var next = interval.next();
16
- t.ok(next, 'has a date');
17
- }
18
- } catch (err) {
19
- t.error(err, 'Parse read error');
20
- }
21
-
22
- t.end();
23
- });
24
-
25
- test('parse cron with last day in feb', function(t) {
26
- var options = {
27
- currentDate: new Date(2016, 0, 1),
28
- endDate: new Date(2016, 10, 1)
29
- };
30
-
31
- try {
32
- var interval = CronParser.parseExpression('0 0 6-20/2,L 2 *', options);
33
- t.equal(interval.hasNext(), true);
34
- var next = null;
35
- var items = 9;
36
- var i = 0;
37
- while(interval.hasNext()) {
38
- next = interval.next();
39
- i += 1;
40
- t.ok(next, 'has a date');
41
- }
42
- //leap year
43
- t.equal(next.getDate(), 29);
44
- t.equal(i, items);
45
- } catch (err) {
46
- t.error(err, 'Parse read error');
47
- }
48
-
49
- t.end();
50
- });
51
-
52
- test('parse cron with last day in feb', function(t) {
53
- var options = {
54
- currentDate: new Date(2014, 0, 1),
55
- endDate: new Date(2014, 10, 1)
56
- };
57
-
58
- try {
59
- var interval = CronParser.parseExpression('0 0 1,3,6-10,L 2 *', options);
60
- t.equal(interval.hasNext(), true);
61
- var next = null;
62
- while(interval.hasNext()) {
63
- next = interval.next();
64
- t.ok(next, 'has a date');
65
- }
66
- //common year
67
- t.equal(next.getDate(), 28);
68
- } catch (err) {
69
- t.error(err, 'Parse read error');
70
- }
71
-
72
- t.end();
73
- });
74
-
75
- test('parse cron with last weekday of the month', function(t) {
76
- var options = {
77
- currentDate: new Date(2021, 8, 1),
78
- endDate: new Date(2021, 11, 1)
79
- };
80
-
81
- var testCases = [
82
- { expression: '0 0 0 * * 1L', expectedDate: 27 },
83
- { expression: '0 0 0 * * 2L', expectedDate: 28 },
84
- { expression: '0 0 0 * * 3L', expectedDate: 29 },
85
- { expression: '0 0 0 * * 4L', expectedDate: 30 },
86
- { expression: '0 0 0 * * 5L', expectedDate: 24 },
87
- { expression: '0 0 0 * * 6L', expectedDate: 25 },
88
- { expression: '0 0 0 * * 0L', expectedDate: 26 },
89
- { expression: '0 0 0 * * 7L', expectedDate: 26 }
90
- ];
91
-
92
- testCases.forEach(function({ expression, expectedDate }) {
93
- t.test(expression, function(t) {
94
- try {
95
- var interval = CronParser.parseExpression(expression, options);
96
-
97
- t.equal(interval.hasNext(), true);
98
-
99
- var next = interval.next();
100
-
101
- t.equal(next.getDate(), expectedDate);
102
- } catch (err) {
103
- t.error(err, 'Parse read error');
104
- }
105
-
106
- t.end();
107
- });
108
- });
109
-
110
- t.end();
111
- });
112
-
113
- test('parses expression that runs on both last monday and friday of the month', function(t) {
114
- var options = {
115
- currentDate: new Date(2021, 8, 1),
116
- endDate: new Date(2021, 11, 1)
117
- };
118
-
119
- try {
120
- var interval = CronParser.parseExpression('0 0 0 * * 1L,5L', options);
121
-
122
- t.equal(interval.next().getDate(), 24);
123
- t.equal(interval.next().getDate(), 27);
124
- } catch (err) {
125
- t.error(err, 'Parse read error');
126
- }
127
-
128
- t.end();
129
- });
130
-
131
- test('parses expression that runs on both every monday and last friday of mont', function(t) {
132
- var options = {
133
- currentDate: new Date(2021, 8, 1),
134
- endDate: new Date(2021, 8, 30)
135
- };
136
-
137
- try {
138
- var interval = CronParser.parseExpression('0 0 0 * * 1,5L', options);
139
-
140
- var dates = [];
141
-
142
- while(true) {
143
- try {
144
- dates.push(interval.next().getDate());
145
- } catch (e) {
146
- if (e.message !== 'Out of the timespan range') {
147
- throw e;
148
- }
149
-
150
- break;
151
- }
152
- }
153
-
154
- t.same(dates, [6, 13, 20, 24, 27]);
155
- } catch (err) {
156
- t.error(err, 'Parse read error');
157
- }
158
-
159
- t.end();
160
- });
161
-
162
- test('fails to parse for invalid last weekday of month expression', function(t) {
163
- t.throws(function() {
164
- var interval = CronParser.parseExpression('0 0 0 * * L');
165
- interval.next();
166
- });
167
-
168
- t.end();
169
- });
@@ -1,32 +0,0 @@
1
- var test = require('tap').test;
2
- var CronExpression = require('../lib/expression');
3
-
4
- test('prev should match correctly (issue #98) when milliseconds are greater than 0', function(t) {
5
- var options = {
6
- currentDate: new Date('2017-06-13T18:21:25.002Z')
7
- };
8
-
9
- var interval = CronExpression.parse('*/5 * * * * *', options);
10
- var prev = interval.prev();
11
- t.equal(prev.getSeconds(), 25);
12
-
13
- t.end();
14
- });
15
-
16
- test('prev should match correctly (issue #98) when milliseconds are equal to 0', function(t) {
17
- var interval = CronExpression.parse('59 59 23 * * *',{
18
- currentDate : new Date('2012-12-26 14:38:53')
19
- });
20
-
21
- [25, 24, 23, 22].forEach(function(date) {
22
- var prev = interval.prev();
23
- t.equal(prev.getFullYear(), 2012);
24
- t.equal(prev.getMonth(), 11);
25
- t.equal(prev.getDate(), date);
26
- t.equal(prev.getHours(), 23);
27
- t.equal(prev.getMinutes(), 59);
28
- t.equal(prev.getSeconds(), 59);
29
- });
30
-
31
- t.end();
32
- });