@nocobase/plugin-notification-in-app-message 2.1.0-beta.2 → 2.1.0-beta.21
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/LICENSE +201 -0
- package/README.md +99 -1
- package/dist/client/index.js +1 -1
- package/dist/externalVersion.js +9 -11
- package/dist/node_modules/uuid/dist/bin/uuid +2 -0
- package/dist/node_modules/uuid/dist/commonjs-browser/index.js +104 -0
- package/dist/node_modules/uuid/dist/commonjs-browser/max.js +7 -0
- package/dist/node_modules/uuid/dist/commonjs-browser/md5.js +200 -0
- package/dist/node_modules/uuid/dist/commonjs-browser/native.js +10 -0
- package/dist/node_modules/uuid/dist/commonjs-browser/nil.js +7 -0
- package/dist/node_modules/uuid/dist/commonjs-browser/parse.js +44 -0
- package/dist/node_modules/uuid/dist/commonjs-browser/regex.js +7 -0
- package/dist/node_modules/uuid/dist/commonjs-browser/rng.js +23 -0
- package/dist/node_modules/uuid/dist/commonjs-browser/sha1.js +82 -0
- package/dist/node_modules/uuid/dist/commonjs-browser/stringify.js +38 -0
- package/dist/node_modules/uuid/dist/commonjs-browser/v1.js +131 -0
- package/dist/node_modules/uuid/dist/commonjs-browser/v1ToV6.js +26 -0
- package/dist/node_modules/uuid/dist/commonjs-browser/v3.js +11 -0
- package/dist/node_modules/uuid/dist/commonjs-browser/v35.js +63 -0
- package/dist/node_modules/uuid/dist/commonjs-browser/v4.js +32 -0
- package/dist/node_modules/uuid/dist/commonjs-browser/v5.js +11 -0
- package/dist/node_modules/uuid/dist/commonjs-browser/v6.js +42 -0
- package/dist/node_modules/uuid/dist/commonjs-browser/v6ToV1.js +26 -0
- package/dist/node_modules/uuid/dist/commonjs-browser/v7.js +152 -0
- package/dist/node_modules/uuid/dist/commonjs-browser/validate.js +12 -0
- package/dist/node_modules/uuid/dist/commonjs-browser/version.js +15 -0
- package/dist/node_modules/uuid/dist/esm-browser/index.js +14 -0
- package/dist/node_modules/uuid/dist/esm-browser/max.js +1 -0
- package/dist/node_modules/uuid/dist/esm-browser/md5.js +194 -0
- package/dist/node_modules/uuid/dist/esm-browser/native.js +4 -0
- package/dist/node_modules/uuid/dist/esm-browser/nil.js +1 -0
- package/dist/node_modules/uuid/dist/esm-browser/parse.js +37 -0
- package/dist/node_modules/uuid/dist/esm-browser/regex.js +1 -0
- package/dist/node_modules/uuid/dist/esm-browser/rng.js +17 -0
- package/dist/node_modules/uuid/dist/esm-browser/sha1.js +76 -0
- package/dist/node_modules/uuid/dist/esm-browser/stringify.js +31 -0
- package/dist/node_modules/uuid/dist/esm-browser/v1.js +125 -0
- package/dist/node_modules/uuid/dist/esm-browser/v1ToV6.js +20 -0
- package/dist/node_modules/uuid/dist/esm-browser/v3.js +4 -0
- package/dist/node_modules/uuid/dist/esm-browser/v35.js +55 -0
- package/dist/node_modules/uuid/dist/esm-browser/v4.js +25 -0
- package/dist/node_modules/uuid/dist/esm-browser/v5.js +4 -0
- package/dist/node_modules/uuid/dist/esm-browser/v6.js +36 -0
- package/dist/node_modules/uuid/dist/esm-browser/v6ToV1.js +20 -0
- package/dist/node_modules/uuid/dist/esm-browser/v7.js +146 -0
- package/dist/node_modules/uuid/dist/esm-browser/validate.js +5 -0
- package/dist/node_modules/uuid/dist/esm-browser/version.js +8 -0
- package/dist/node_modules/uuid/dist/esm-node/index.js +14 -0
- package/dist/node_modules/uuid/dist/esm-node/max.js +1 -0
- package/dist/node_modules/uuid/dist/esm-node/md5.js +10 -0
- package/dist/node_modules/uuid/dist/esm-node/native.js +4 -0
- package/dist/node_modules/uuid/dist/esm-node/nil.js +1 -0
- package/dist/node_modules/uuid/dist/esm-node/parse.js +37 -0
- package/dist/node_modules/uuid/dist/esm-node/regex.js +1 -0
- package/dist/node_modules/uuid/dist/esm-node/rng.js +10 -0
- package/dist/node_modules/uuid/dist/esm-node/sha1.js +10 -0
- package/dist/node_modules/uuid/dist/esm-node/stringify.js +31 -0
- package/dist/node_modules/uuid/dist/esm-node/v1.js +125 -0
- package/dist/node_modules/uuid/dist/esm-node/v1ToV6.js +20 -0
- package/dist/node_modules/uuid/dist/esm-node/v3.js +4 -0
- package/dist/node_modules/uuid/dist/esm-node/v35.js +55 -0
- package/dist/node_modules/uuid/dist/esm-node/v4.js +25 -0
- package/dist/node_modules/uuid/dist/esm-node/v5.js +4 -0
- package/dist/node_modules/uuid/dist/esm-node/v6.js +32 -0
- package/dist/node_modules/uuid/dist/esm-node/v6ToV1.js +20 -0
- package/dist/node_modules/uuid/dist/esm-node/v7.js +146 -0
- package/dist/node_modules/uuid/dist/esm-node/validate.js +5 -0
- package/dist/node_modules/uuid/dist/esm-node/version.js +8 -0
- package/dist/node_modules/uuid/dist/index.js +1 -0
- package/dist/node_modules/uuid/dist/max.js +7 -0
- package/dist/node_modules/uuid/dist/md5-browser.js +200 -0
- package/dist/node_modules/uuid/dist/md5.js +17 -0
- package/dist/node_modules/uuid/dist/native-browser.js +10 -0
- package/dist/node_modules/uuid/dist/native.js +11 -0
- package/dist/node_modules/uuid/dist/nil.js +7 -0
- package/dist/node_modules/uuid/dist/parse.js +44 -0
- package/dist/node_modules/uuid/dist/regex.js +7 -0
- package/dist/node_modules/uuid/dist/rng-browser.js +23 -0
- package/dist/node_modules/uuid/dist/rng.js +17 -0
- package/dist/node_modules/uuid/dist/sha1-browser.js +82 -0
- package/dist/node_modules/uuid/dist/sha1.js +17 -0
- package/dist/node_modules/uuid/dist/stringify.js +38 -0
- package/dist/node_modules/uuid/dist/uuid-bin.js +75 -0
- package/dist/node_modules/uuid/dist/v1.js +131 -0
- package/dist/node_modules/uuid/dist/v1ToV6.js +26 -0
- package/dist/node_modules/uuid/dist/v3.js +11 -0
- package/dist/node_modules/uuid/dist/v35.js +63 -0
- package/dist/node_modules/uuid/dist/v4.js +32 -0
- package/dist/node_modules/uuid/dist/v5.js +11 -0
- package/dist/node_modules/uuid/dist/v6.js +38 -0
- package/dist/node_modules/uuid/dist/v6ToV1.js +26 -0
- package/dist/node_modules/uuid/dist/v7.js +152 -0
- package/dist/node_modules/uuid/dist/validate.js +12 -0
- package/dist/node_modules/uuid/dist/version.js +15 -0
- package/dist/node_modules/uuid/package.json +1 -0
- package/dist/server/InAppNotificationChannel.d.ts +5 -0
- package/dist/server/InAppNotificationChannel.js +93 -35
- package/dist/server/defineMyInAppMessages.js +2 -1
- package/dist/server/parseUserSelectionConf.d.ts +2 -1
- package/dist/server/parseUserSelectionConf.js +3 -2
- package/package.json +5 -2
- package/LICENSE.txt +0 -172
- package/dist/client/components/UsersAddition.d.ts +0 -10
- package/dist/client/components/UsersSelect.d.ts +0 -18
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.default = void 0;
|
|
7
|
+
exports.unsafeStringify = unsafeStringify;
|
|
8
|
+
var _validate = _interopRequireDefault(require("./validate.js"));
|
|
9
|
+
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
10
|
+
/**
|
|
11
|
+
* Convert array of 16 byte values to UUID string format of the form:
|
|
12
|
+
* XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX
|
|
13
|
+
*/
|
|
14
|
+
const byteToHex = [];
|
|
15
|
+
for (let i = 0; i < 256; ++i) {
|
|
16
|
+
byteToHex.push((i + 0x100).toString(16).slice(1));
|
|
17
|
+
}
|
|
18
|
+
function unsafeStringify(arr, offset = 0) {
|
|
19
|
+
// Note: Be careful editing this code! It's been tuned for performance
|
|
20
|
+
// and works in ways you may not expect. See https://github.com/uuidjs/uuid/pull/434
|
|
21
|
+
//
|
|
22
|
+
// Note to future-self: No, you can't remove the `toLowerCase()` call.
|
|
23
|
+
// REF: https://github.com/uuidjs/uuid/pull/677#issuecomment-1757351351
|
|
24
|
+
return (byteToHex[arr[offset + 0]] + byteToHex[arr[offset + 1]] + byteToHex[arr[offset + 2]] + byteToHex[arr[offset + 3]] + '-' + byteToHex[arr[offset + 4]] + byteToHex[arr[offset + 5]] + '-' + byteToHex[arr[offset + 6]] + byteToHex[arr[offset + 7]] + '-' + byteToHex[arr[offset + 8]] + byteToHex[arr[offset + 9]] + '-' + byteToHex[arr[offset + 10]] + byteToHex[arr[offset + 11]] + byteToHex[arr[offset + 12]] + byteToHex[arr[offset + 13]] + byteToHex[arr[offset + 14]] + byteToHex[arr[offset + 15]]).toLowerCase();
|
|
25
|
+
}
|
|
26
|
+
function stringify(arr, offset = 0) {
|
|
27
|
+
const uuid = unsafeStringify(arr, offset);
|
|
28
|
+
// Consistency check for valid UUID. If this throws, it's likely due to one
|
|
29
|
+
// of the following:
|
|
30
|
+
// - One or more input array values don't map to a hex octet (leading to
|
|
31
|
+
// "undefined" in the uuid)
|
|
32
|
+
// - Invalid input values for the RFC `version` or `variant` fields
|
|
33
|
+
if (!(0, _validate.default)(uuid)) {
|
|
34
|
+
throw TypeError('Stringified UUID is invalid');
|
|
35
|
+
}
|
|
36
|
+
return uuid;
|
|
37
|
+
}
|
|
38
|
+
var _default = exports.default = stringify;
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _assert = _interopRequireDefault(require("assert"));
|
|
4
|
+
var _v = _interopRequireDefault(require("./v1.js"));
|
|
5
|
+
var _v2 = _interopRequireDefault(require("./v3.js"));
|
|
6
|
+
var _v3 = _interopRequireDefault(require("./v4.js"));
|
|
7
|
+
var _v4 = _interopRequireDefault(require("./v5.js"));
|
|
8
|
+
var _v5 = _interopRequireDefault(require("./v6.js"));
|
|
9
|
+
var _v6 = _interopRequireDefault(require("./v7.js"));
|
|
10
|
+
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
11
|
+
function usage() {
|
|
12
|
+
console.log('Usage:');
|
|
13
|
+
console.log(' uuid');
|
|
14
|
+
console.log(' uuid v1');
|
|
15
|
+
console.log(' uuid v3 <name> <namespace uuid>');
|
|
16
|
+
console.log(' uuid v4');
|
|
17
|
+
console.log(' uuid v5 <name> <namespace uuid>');
|
|
18
|
+
console.log(' uuid v6');
|
|
19
|
+
console.log(' uuid v7');
|
|
20
|
+
console.log(' uuid --help');
|
|
21
|
+
console.log('\nNote: <namespace uuid> may be "URL" or "DNS" to use the corresponding UUIDs defined by RFC9562');
|
|
22
|
+
}
|
|
23
|
+
const args = process.argv.slice(2);
|
|
24
|
+
if (args.indexOf('--help') >= 0) {
|
|
25
|
+
usage();
|
|
26
|
+
process.exit(0);
|
|
27
|
+
}
|
|
28
|
+
const version = args.shift() || 'v4';
|
|
29
|
+
switch (version) {
|
|
30
|
+
case 'v1':
|
|
31
|
+
console.log((0, _v.default)());
|
|
32
|
+
break;
|
|
33
|
+
case 'v3':
|
|
34
|
+
{
|
|
35
|
+
const name = args.shift();
|
|
36
|
+
let namespace = args.shift();
|
|
37
|
+
(0, _assert.default)(name != null, 'v3 name not specified');
|
|
38
|
+
(0, _assert.default)(namespace != null, 'v3 namespace not specified');
|
|
39
|
+
if (namespace === 'URL') {
|
|
40
|
+
namespace = _v2.default.URL;
|
|
41
|
+
}
|
|
42
|
+
if (namespace === 'DNS') {
|
|
43
|
+
namespace = _v2.default.DNS;
|
|
44
|
+
}
|
|
45
|
+
console.log((0, _v2.default)(name, namespace));
|
|
46
|
+
break;
|
|
47
|
+
}
|
|
48
|
+
case 'v4':
|
|
49
|
+
console.log((0, _v3.default)());
|
|
50
|
+
break;
|
|
51
|
+
case 'v5':
|
|
52
|
+
{
|
|
53
|
+
const name = args.shift();
|
|
54
|
+
let namespace = args.shift();
|
|
55
|
+
(0, _assert.default)(name != null, 'v5 name not specified');
|
|
56
|
+
(0, _assert.default)(namespace != null, 'v5 namespace not specified');
|
|
57
|
+
if (namespace === 'URL') {
|
|
58
|
+
namespace = _v4.default.URL;
|
|
59
|
+
}
|
|
60
|
+
if (namespace === 'DNS') {
|
|
61
|
+
namespace = _v4.default.DNS;
|
|
62
|
+
}
|
|
63
|
+
console.log((0, _v4.default)(name, namespace));
|
|
64
|
+
break;
|
|
65
|
+
}
|
|
66
|
+
case 'v6':
|
|
67
|
+
console.log((0, _v5.default)());
|
|
68
|
+
break;
|
|
69
|
+
case 'v7':
|
|
70
|
+
console.log((0, _v6.default)());
|
|
71
|
+
break;
|
|
72
|
+
default:
|
|
73
|
+
usage();
|
|
74
|
+
process.exit(1);
|
|
75
|
+
}
|
|
@@ -0,0 +1,131 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.default = void 0;
|
|
7
|
+
var _rng = _interopRequireDefault(require("./rng.js"));
|
|
8
|
+
var _stringify = require("./stringify.js");
|
|
9
|
+
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
10
|
+
// **`v1()` - Generate time-based UUID**
|
|
11
|
+
//
|
|
12
|
+
// Inspired by https://github.com/LiosK/UUID.js
|
|
13
|
+
// and http://docs.python.org/library/uuid.html
|
|
14
|
+
|
|
15
|
+
let _nodeId;
|
|
16
|
+
let _clockseq;
|
|
17
|
+
|
|
18
|
+
// Previous uuid creation time
|
|
19
|
+
let _lastMSecs = 0;
|
|
20
|
+
let _lastNSecs = 0;
|
|
21
|
+
|
|
22
|
+
// See https://github.com/uuidjs/uuid for API details
|
|
23
|
+
function v1(options, buf, offset) {
|
|
24
|
+
let i = buf && offset || 0;
|
|
25
|
+
const b = buf || new Array(16);
|
|
26
|
+
options = options || {};
|
|
27
|
+
let node = options.node;
|
|
28
|
+
let clockseq = options.clockseq;
|
|
29
|
+
|
|
30
|
+
// v1 only: Use cached `node` and `clockseq` values
|
|
31
|
+
if (!options._v6) {
|
|
32
|
+
if (!node) {
|
|
33
|
+
node = _nodeId;
|
|
34
|
+
}
|
|
35
|
+
if (clockseq == null) {
|
|
36
|
+
clockseq = _clockseq;
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
// Handle cases where we need entropy. We do this lazily to minimize issues
|
|
41
|
+
// related to insufficient system entropy. See #189
|
|
42
|
+
if (node == null || clockseq == null) {
|
|
43
|
+
const seedBytes = options.random || (options.rng || _rng.default)();
|
|
44
|
+
|
|
45
|
+
// Randomize node
|
|
46
|
+
if (node == null) {
|
|
47
|
+
node = [seedBytes[0], seedBytes[1], seedBytes[2], seedBytes[3], seedBytes[4], seedBytes[5]];
|
|
48
|
+
|
|
49
|
+
// v1 only: cache node value for reuse
|
|
50
|
+
if (!_nodeId && !options._v6) {
|
|
51
|
+
// per RFC4122 4.5: Set MAC multicast bit (v1 only)
|
|
52
|
+
node[0] |= 0x01; // Set multicast bit
|
|
53
|
+
|
|
54
|
+
_nodeId = node;
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
// Randomize clockseq
|
|
59
|
+
if (clockseq == null) {
|
|
60
|
+
// Per 4.2.2, randomize (14 bit) clockseq
|
|
61
|
+
clockseq = (seedBytes[6] << 8 | seedBytes[7]) & 0x3fff;
|
|
62
|
+
if (_clockseq === undefined && !options._v6) {
|
|
63
|
+
_clockseq = clockseq;
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
// v1 & v6 timestamps are 100 nano-second units since the Gregorian epoch,
|
|
69
|
+
// (1582-10-15 00:00). JSNumbers aren't precise enough for this, so time is
|
|
70
|
+
// handled internally as 'msecs' (integer milliseconds) and 'nsecs'
|
|
71
|
+
// (100-nanoseconds offset from msecs) since unix epoch, 1970-01-01 00:00.
|
|
72
|
+
let msecs = options.msecs !== undefined ? options.msecs : Date.now();
|
|
73
|
+
|
|
74
|
+
// Per 4.2.1.2, use count of uuid's generated during the current clock
|
|
75
|
+
// cycle to simulate higher resolution clock
|
|
76
|
+
let nsecs = options.nsecs !== undefined ? options.nsecs : _lastNSecs + 1;
|
|
77
|
+
|
|
78
|
+
// Time since last uuid creation (in msecs)
|
|
79
|
+
const dt = msecs - _lastMSecs + (nsecs - _lastNSecs) / 10000;
|
|
80
|
+
|
|
81
|
+
// Per 4.2.1.2, Bump clockseq on clock regression
|
|
82
|
+
if (dt < 0 && options.clockseq === undefined) {
|
|
83
|
+
clockseq = clockseq + 1 & 0x3fff;
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
// Reset nsecs if clock regresses (new clockseq) or we've moved onto a new
|
|
87
|
+
// time interval
|
|
88
|
+
if ((dt < 0 || msecs > _lastMSecs) && options.nsecs === undefined) {
|
|
89
|
+
nsecs = 0;
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
// Per 4.2.1.2 Throw error if too many uuids are requested
|
|
93
|
+
if (nsecs >= 10000) {
|
|
94
|
+
throw new Error("uuid.v1(): Can't create more than 10M uuids/sec");
|
|
95
|
+
}
|
|
96
|
+
_lastMSecs = msecs;
|
|
97
|
+
_lastNSecs = nsecs;
|
|
98
|
+
_clockseq = clockseq;
|
|
99
|
+
|
|
100
|
+
// Per 4.1.4 - Convert from unix epoch to Gregorian epoch
|
|
101
|
+
msecs += 12219292800000;
|
|
102
|
+
|
|
103
|
+
// `time_low`
|
|
104
|
+
const tl = ((msecs & 0xfffffff) * 10000 + nsecs) % 0x100000000;
|
|
105
|
+
b[i++] = tl >>> 24 & 0xff;
|
|
106
|
+
b[i++] = tl >>> 16 & 0xff;
|
|
107
|
+
b[i++] = tl >>> 8 & 0xff;
|
|
108
|
+
b[i++] = tl & 0xff;
|
|
109
|
+
|
|
110
|
+
// `time_mid`
|
|
111
|
+
const tmh = msecs / 0x100000000 * 10000 & 0xfffffff;
|
|
112
|
+
b[i++] = tmh >>> 8 & 0xff;
|
|
113
|
+
b[i++] = tmh & 0xff;
|
|
114
|
+
|
|
115
|
+
// `time_high_and_version`
|
|
116
|
+
b[i++] = tmh >>> 24 & 0xf | 0x10; // include version
|
|
117
|
+
b[i++] = tmh >>> 16 & 0xff;
|
|
118
|
+
|
|
119
|
+
// `clock_seq_hi_and_reserved` (Per 4.2.2 - include variant)
|
|
120
|
+
b[i++] = clockseq >>> 8 | 0x80;
|
|
121
|
+
|
|
122
|
+
// `clock_seq_low`
|
|
123
|
+
b[i++] = clockseq & 0xff;
|
|
124
|
+
|
|
125
|
+
// `node`
|
|
126
|
+
for (let n = 0; n < 6; ++n) {
|
|
127
|
+
b[i + n] = node[n];
|
|
128
|
+
}
|
|
129
|
+
return buf || (0, _stringify.unsafeStringify)(b);
|
|
130
|
+
}
|
|
131
|
+
var _default = exports.default = v1;
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.default = v1ToV6;
|
|
7
|
+
var _parse = _interopRequireDefault(require("./parse.js"));
|
|
8
|
+
var _stringify = require("./stringify.js");
|
|
9
|
+
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
10
|
+
/**
|
|
11
|
+
* Convert a v1 UUID to a v6 UUID
|
|
12
|
+
*
|
|
13
|
+
* @param {string|Uint8Array} uuid - The v1 UUID to convert to v6
|
|
14
|
+
* @returns {string|Uint8Array} The v6 UUID as the same type as the `uuid` arg
|
|
15
|
+
* (string or Uint8Array)
|
|
16
|
+
*/
|
|
17
|
+
function v1ToV6(uuid) {
|
|
18
|
+
const v1Bytes = typeof uuid === 'string' ? (0, _parse.default)(uuid) : uuid;
|
|
19
|
+
const v6Bytes = _v1ToV6(v1Bytes);
|
|
20
|
+
return typeof uuid === 'string' ? (0, _stringify.unsafeStringify)(v6Bytes) : v6Bytes;
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
// Do the field transformation needed for v1 -> v6
|
|
24
|
+
function _v1ToV6(v1Bytes, randomize = false) {
|
|
25
|
+
return Uint8Array.of((v1Bytes[6] & 0x0f) << 4 | v1Bytes[7] >> 4 & 0x0f, (v1Bytes[7] & 0x0f) << 4 | (v1Bytes[4] & 0xf0) >> 4, (v1Bytes[4] & 0x0f) << 4 | (v1Bytes[5] & 0xf0) >> 4, (v1Bytes[5] & 0x0f) << 4 | (v1Bytes[0] & 0xf0) >> 4, (v1Bytes[0] & 0x0f) << 4 | (v1Bytes[1] & 0xf0) >> 4, (v1Bytes[1] & 0x0f) << 4 | (v1Bytes[2] & 0xf0) >> 4, 0x60 | v1Bytes[2] & 0x0f, v1Bytes[3], v1Bytes[8], v1Bytes[9], v1Bytes[10], v1Bytes[11], v1Bytes[12], v1Bytes[13], v1Bytes[14], v1Bytes[15]);
|
|
26
|
+
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.default = void 0;
|
|
7
|
+
var _v = _interopRequireDefault(require("./v35.js"));
|
|
8
|
+
var _md = _interopRequireDefault(require("./md5.js"));
|
|
9
|
+
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
10
|
+
const v3 = (0, _v.default)('v3', 0x30, _md.default);
|
|
11
|
+
var _default = exports.default = v3;
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.URL = exports.DNS = void 0;
|
|
7
|
+
exports.default = v35;
|
|
8
|
+
var _stringify = require("./stringify.js");
|
|
9
|
+
var _parse = _interopRequireDefault(require("./parse.js"));
|
|
10
|
+
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
11
|
+
function stringToBytes(str) {
|
|
12
|
+
str = unescape(encodeURIComponent(str)); // UTF8 escape
|
|
13
|
+
|
|
14
|
+
const bytes = [];
|
|
15
|
+
for (let i = 0; i < str.length; ++i) {
|
|
16
|
+
bytes.push(str.charCodeAt(i));
|
|
17
|
+
}
|
|
18
|
+
return bytes;
|
|
19
|
+
}
|
|
20
|
+
const DNS = exports.DNS = '6ba7b810-9dad-11d1-80b4-00c04fd430c8';
|
|
21
|
+
const URL = exports.URL = '6ba7b811-9dad-11d1-80b4-00c04fd430c8';
|
|
22
|
+
function v35(name, version, hashfunc) {
|
|
23
|
+
function generateUUID(value, namespace, buf, offset) {
|
|
24
|
+
var _namespace;
|
|
25
|
+
if (typeof value === 'string') {
|
|
26
|
+
value = stringToBytes(value);
|
|
27
|
+
}
|
|
28
|
+
if (typeof namespace === 'string') {
|
|
29
|
+
namespace = (0, _parse.default)(namespace);
|
|
30
|
+
}
|
|
31
|
+
if (((_namespace = namespace) === null || _namespace === void 0 ? void 0 : _namespace.length) !== 16) {
|
|
32
|
+
throw TypeError('Namespace must be array-like (16 iterable integer values, 0-255)');
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
// Compute hash of namespace and value, Per 4.3
|
|
36
|
+
// Future: Use spread syntax when supported on all platforms, e.g. `bytes =
|
|
37
|
+
// hashfunc([...namespace, ... value])`
|
|
38
|
+
let bytes = new Uint8Array(16 + value.length);
|
|
39
|
+
bytes.set(namespace);
|
|
40
|
+
bytes.set(value, namespace.length);
|
|
41
|
+
bytes = hashfunc(bytes);
|
|
42
|
+
bytes[6] = bytes[6] & 0x0f | version;
|
|
43
|
+
bytes[8] = bytes[8] & 0x3f | 0x80;
|
|
44
|
+
if (buf) {
|
|
45
|
+
offset = offset || 0;
|
|
46
|
+
for (let i = 0; i < 16; ++i) {
|
|
47
|
+
buf[offset + i] = bytes[i];
|
|
48
|
+
}
|
|
49
|
+
return buf;
|
|
50
|
+
}
|
|
51
|
+
return (0, _stringify.unsafeStringify)(bytes);
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
// Function#name is not settable on some platforms (#270)
|
|
55
|
+
try {
|
|
56
|
+
generateUUID.name = name;
|
|
57
|
+
} catch (err) {}
|
|
58
|
+
|
|
59
|
+
// For CommonJS default export support
|
|
60
|
+
generateUUID.DNS = DNS;
|
|
61
|
+
generateUUID.URL = URL;
|
|
62
|
+
return generateUUID;
|
|
63
|
+
}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.default = void 0;
|
|
7
|
+
var _native = _interopRequireDefault(require("./native.js"));
|
|
8
|
+
var _rng = _interopRequireDefault(require("./rng.js"));
|
|
9
|
+
var _stringify = require("./stringify.js");
|
|
10
|
+
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
11
|
+
function v4(options, buf, offset) {
|
|
12
|
+
if (_native.default.randomUUID && !buf && !options) {
|
|
13
|
+
return _native.default.randomUUID();
|
|
14
|
+
}
|
|
15
|
+
options = options || {};
|
|
16
|
+
const rnds = options.random || (options.rng || _rng.default)();
|
|
17
|
+
|
|
18
|
+
// Per 4.4, set bits for version and `clock_seq_hi_and_reserved`
|
|
19
|
+
rnds[6] = rnds[6] & 0x0f | 0x40;
|
|
20
|
+
rnds[8] = rnds[8] & 0x3f | 0x80;
|
|
21
|
+
|
|
22
|
+
// Copy bytes to buffer, if provided
|
|
23
|
+
if (buf) {
|
|
24
|
+
offset = offset || 0;
|
|
25
|
+
for (let i = 0; i < 16; ++i) {
|
|
26
|
+
buf[offset + i] = rnds[i];
|
|
27
|
+
}
|
|
28
|
+
return buf;
|
|
29
|
+
}
|
|
30
|
+
return (0, _stringify.unsafeStringify)(rnds);
|
|
31
|
+
}
|
|
32
|
+
var _default = exports.default = v4;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.default = void 0;
|
|
7
|
+
var _v = _interopRequireDefault(require("./v35.js"));
|
|
8
|
+
var _sha = _interopRequireDefault(require("./sha1.js"));
|
|
9
|
+
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
10
|
+
const v5 = (0, _v.default)('v5', 0x50, _sha.default);
|
|
11
|
+
var _default = exports.default = v5;
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.default = v6;
|
|
7
|
+
var _stringify = require("./stringify.js");
|
|
8
|
+
var _v = _interopRequireDefault(require("./v1.js"));
|
|
9
|
+
var _v1ToV = _interopRequireDefault(require("./v1ToV6.js"));
|
|
10
|
+
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
11
|
+
/**
|
|
12
|
+
*
|
|
13
|
+
* @param {object} options
|
|
14
|
+
* @param {Uint8Array=} buf
|
|
15
|
+
* @param {number=} offset
|
|
16
|
+
* @returns
|
|
17
|
+
*/
|
|
18
|
+
function v6(options = {}, buf, offset = 0) {
|
|
19
|
+
// v6 is v1 with different field layout, so we start with a v1 UUID, albeit
|
|
20
|
+
// with slightly different behavior around how the clock_seq and node fields
|
|
21
|
+
// are randomized, which is why we call v1 with _v6: true.
|
|
22
|
+
let bytes = (0, _v.default)({
|
|
23
|
+
...options,
|
|
24
|
+
_v6: true
|
|
25
|
+
}, new Uint8Array(16));
|
|
26
|
+
|
|
27
|
+
// Reorder the fields to v6 layout.
|
|
28
|
+
bytes = (0, _v1ToV.default)(bytes);
|
|
29
|
+
|
|
30
|
+
// Return as a byte array if requested
|
|
31
|
+
if (buf) {
|
|
32
|
+
for (let i = 0; i < 16; i++) {
|
|
33
|
+
buf[offset + i] = bytes[i];
|
|
34
|
+
}
|
|
35
|
+
return buf;
|
|
36
|
+
}
|
|
37
|
+
return (0, _stringify.unsafeStringify)(bytes);
|
|
38
|
+
}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.default = v6ToV1;
|
|
7
|
+
var _parse = _interopRequireDefault(require("./parse.js"));
|
|
8
|
+
var _stringify = require("./stringify.js");
|
|
9
|
+
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
10
|
+
/**
|
|
11
|
+
* Convert a v6 UUID to a v1 UUID
|
|
12
|
+
*
|
|
13
|
+
* @param {string|Uint8Array} uuid - The v6 UUID to convert to v6
|
|
14
|
+
* @returns {string|Uint8Array} The v1 UUID as the same type as the `uuid` arg
|
|
15
|
+
* (string or Uint8Array)
|
|
16
|
+
*/
|
|
17
|
+
function v6ToV1(uuid) {
|
|
18
|
+
const v6Bytes = typeof uuid === 'string' ? (0, _parse.default)(uuid) : uuid;
|
|
19
|
+
const v1Bytes = _v6ToV1(v6Bytes);
|
|
20
|
+
return typeof uuid === 'string' ? (0, _stringify.unsafeStringify)(v1Bytes) : v1Bytes;
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
// Do the field transformation needed for v6 -> v1
|
|
24
|
+
function _v6ToV1(v6Bytes) {
|
|
25
|
+
return Uint8Array.of((v6Bytes[3] & 0x0f) << 4 | v6Bytes[4] >> 4 & 0x0f, (v6Bytes[4] & 0x0f) << 4 | (v6Bytes[5] & 0xf0) >> 4, (v6Bytes[5] & 0x0f) << 4 | v6Bytes[6] & 0x0f, v6Bytes[7], (v6Bytes[1] & 0x0f) << 4 | (v6Bytes[2] & 0xf0) >> 4, (v6Bytes[2] & 0x0f) << 4 | (v6Bytes[3] & 0xf0) >> 4, 0x10 | (v6Bytes[0] & 0xf0) >> 4, (v6Bytes[0] & 0x0f) << 4 | (v6Bytes[1] & 0xf0) >> 4, v6Bytes[8], v6Bytes[9], v6Bytes[10], v6Bytes[11], v6Bytes[12], v6Bytes[13], v6Bytes[14], v6Bytes[15]);
|
|
26
|
+
}
|
|
@@ -0,0 +1,152 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.default = void 0;
|
|
7
|
+
var _rng = _interopRequireDefault(require("./rng.js"));
|
|
8
|
+
var _stringify = require("./stringify.js");
|
|
9
|
+
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
10
|
+
/**
|
|
11
|
+
* UUID V7 - Unix Epoch time-based UUID
|
|
12
|
+
*
|
|
13
|
+
* The IETF has published RFC9562, introducing 3 new UUID versions (6,7,8). This
|
|
14
|
+
* implementation of V7 is based on the accepted, though not yet approved,
|
|
15
|
+
* revisions.
|
|
16
|
+
*
|
|
17
|
+
* RFC 9562:https://www.rfc-editor.org/rfc/rfc9562.html Universally Unique
|
|
18
|
+
* IDentifiers (UUIDs)
|
|
19
|
+
|
|
20
|
+
*
|
|
21
|
+
* Sample V7 value:
|
|
22
|
+
* https://www.rfc-editor.org/rfc/rfc9562.html#name-example-of-a-uuidv7-value
|
|
23
|
+
*
|
|
24
|
+
* Monotonic Bit Layout: RFC rfc9562.6.2 Method 1, Dedicated Counter Bits ref:
|
|
25
|
+
* https://www.rfc-editor.org/rfc/rfc9562.html#section-6.2-5.1
|
|
26
|
+
*
|
|
27
|
+
* 0 1 2 3 0 1 2 3 4 5 6
|
|
28
|
+
* 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
|
|
29
|
+
* +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|
|
30
|
+
* | unix_ts_ms |
|
|
31
|
+
* +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|
|
32
|
+
* | unix_ts_ms | ver | seq_hi |
|
|
33
|
+
* +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|
|
34
|
+
* |var| seq_low | rand |
|
|
35
|
+
* +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|
|
36
|
+
* | rand |
|
|
37
|
+
* +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|
|
38
|
+
*
|
|
39
|
+
* seq is a 31 bit serialized counter; comprised of 12 bit seq_hi and 19 bit
|
|
40
|
+
* seq_low, and randomly initialized upon timestamp change. 31 bit counter size
|
|
41
|
+
* was selected as any bitwise operations in node are done as _signed_ 32 bit
|
|
42
|
+
* ints. we exclude the sign bit.
|
|
43
|
+
*/
|
|
44
|
+
|
|
45
|
+
let _seqLow = null;
|
|
46
|
+
let _seqHigh = null;
|
|
47
|
+
let _msecs = 0;
|
|
48
|
+
function v7(options, buf, offset) {
|
|
49
|
+
options = options || {};
|
|
50
|
+
|
|
51
|
+
// initialize buffer and pointer
|
|
52
|
+
let i = buf && offset || 0;
|
|
53
|
+
const b = buf || new Uint8Array(16);
|
|
54
|
+
|
|
55
|
+
// rnds is Uint8Array(16) filled with random bytes
|
|
56
|
+
const rnds = options.random || (options.rng || _rng.default)();
|
|
57
|
+
|
|
58
|
+
// milliseconds since unix epoch, 1970-01-01 00:00
|
|
59
|
+
const msecs = options.msecs !== undefined ? options.msecs : Date.now();
|
|
60
|
+
|
|
61
|
+
// seq is user provided 31 bit counter
|
|
62
|
+
let seq = options.seq !== undefined ? options.seq : null;
|
|
63
|
+
|
|
64
|
+
// initialize local seq high/low parts
|
|
65
|
+
let seqHigh = _seqHigh;
|
|
66
|
+
let seqLow = _seqLow;
|
|
67
|
+
|
|
68
|
+
// check if clock has advanced and user has not provided msecs
|
|
69
|
+
if (msecs > _msecs && options.msecs === undefined) {
|
|
70
|
+
_msecs = msecs;
|
|
71
|
+
|
|
72
|
+
// unless user provided seq, reset seq parts
|
|
73
|
+
if (seq !== null) {
|
|
74
|
+
seqHigh = null;
|
|
75
|
+
seqLow = null;
|
|
76
|
+
}
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
// if we have a user provided seq
|
|
80
|
+
if (seq !== null) {
|
|
81
|
+
// trim provided seq to 31 bits of value, avoiding overflow
|
|
82
|
+
if (seq > 0x7fffffff) {
|
|
83
|
+
seq = 0x7fffffff;
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
// split provided seq into high/low parts
|
|
87
|
+
seqHigh = seq >>> 19 & 0xfff;
|
|
88
|
+
seqLow = seq & 0x7ffff;
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
// randomly initialize seq
|
|
92
|
+
if (seqHigh === null || seqLow === null) {
|
|
93
|
+
seqHigh = rnds[6] & 0x7f;
|
|
94
|
+
seqHigh = seqHigh << 8 | rnds[7];
|
|
95
|
+
seqLow = rnds[8] & 0x3f; // pad for var
|
|
96
|
+
seqLow = seqLow << 8 | rnds[9];
|
|
97
|
+
seqLow = seqLow << 5 | rnds[10] >>> 3;
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
// increment seq if within msecs window
|
|
101
|
+
if (msecs + 10000 > _msecs && seq === null) {
|
|
102
|
+
if (++seqLow > 0x7ffff) {
|
|
103
|
+
seqLow = 0;
|
|
104
|
+
if (++seqHigh > 0xfff) {
|
|
105
|
+
seqHigh = 0;
|
|
106
|
+
|
|
107
|
+
// increment internal _msecs. this allows us to continue incrementing
|
|
108
|
+
// while staying monotonic. Note, once we hit 10k milliseconds beyond system
|
|
109
|
+
// clock, we will reset breaking monotonicity (after (2^31)*10000 generations)
|
|
110
|
+
_msecs++;
|
|
111
|
+
}
|
|
112
|
+
}
|
|
113
|
+
} else {
|
|
114
|
+
// resetting; we have advanced more than
|
|
115
|
+
// 10k milliseconds beyond system clock
|
|
116
|
+
_msecs = msecs;
|
|
117
|
+
}
|
|
118
|
+
_seqHigh = seqHigh;
|
|
119
|
+
_seqLow = seqLow;
|
|
120
|
+
|
|
121
|
+
// [bytes 0-5] 48 bits of local timestamp
|
|
122
|
+
b[i++] = _msecs / 0x10000000000 & 0xff;
|
|
123
|
+
b[i++] = _msecs / 0x100000000 & 0xff;
|
|
124
|
+
b[i++] = _msecs / 0x1000000 & 0xff;
|
|
125
|
+
b[i++] = _msecs / 0x10000 & 0xff;
|
|
126
|
+
b[i++] = _msecs / 0x100 & 0xff;
|
|
127
|
+
b[i++] = _msecs & 0xff;
|
|
128
|
+
|
|
129
|
+
// [byte 6] - set 4 bits of version (7) with first 4 bits seq_hi
|
|
130
|
+
b[i++] = seqHigh >>> 4 & 0x0f | 0x70;
|
|
131
|
+
|
|
132
|
+
// [byte 7] remaining 8 bits of seq_hi
|
|
133
|
+
b[i++] = seqHigh & 0xff;
|
|
134
|
+
|
|
135
|
+
// [byte 8] - variant (2 bits), first 6 bits seq_low
|
|
136
|
+
b[i++] = seqLow >>> 13 & 0x3f | 0x80;
|
|
137
|
+
|
|
138
|
+
// [byte 9] 8 bits seq_low
|
|
139
|
+
b[i++] = seqLow >>> 5 & 0xff;
|
|
140
|
+
|
|
141
|
+
// [byte 10] remaining 5 bits seq_low, 3 bits random
|
|
142
|
+
b[i++] = seqLow << 3 & 0xff | rnds[10] & 0x07;
|
|
143
|
+
|
|
144
|
+
// [bytes 11-15] always random
|
|
145
|
+
b[i++] = rnds[11];
|
|
146
|
+
b[i++] = rnds[12];
|
|
147
|
+
b[i++] = rnds[13];
|
|
148
|
+
b[i++] = rnds[14];
|
|
149
|
+
b[i++] = rnds[15];
|
|
150
|
+
return buf || (0, _stringify.unsafeStringify)(b);
|
|
151
|
+
}
|
|
152
|
+
var _default = exports.default = v7;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.default = void 0;
|
|
7
|
+
var _regex = _interopRequireDefault(require("./regex.js"));
|
|
8
|
+
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
9
|
+
function validate(uuid) {
|
|
10
|
+
return typeof uuid === 'string' && _regex.default.test(uuid);
|
|
11
|
+
}
|
|
12
|
+
var _default = exports.default = validate;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.default = void 0;
|
|
7
|
+
var _validate = _interopRequireDefault(require("./validate.js"));
|
|
8
|
+
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
9
|
+
function version(uuid) {
|
|
10
|
+
if (!(0, _validate.default)(uuid)) {
|
|
11
|
+
throw TypeError('Invalid UUID');
|
|
12
|
+
}
|
|
13
|
+
return parseInt(uuid.slice(14, 15), 16);
|
|
14
|
+
}
|
|
15
|
+
var _default = exports.default = version;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"name":"uuid","version":"10.0.0","description":"RFC9562 UUIDs","funding":["https://github.com/sponsors/broofa","https://github.com/sponsors/ctavan"],"commitlint":{"extends":["@commitlint/config-conventional"]},"keywords":["uuid","guid","rfc4122","rfc9562"],"license":"MIT","bin":{"uuid":"dist/bin/uuid"},"sideEffects":false,"main":"./dist/index.js","exports":{".":{"node":{"module":"./dist/esm-node/index.js","require":"./dist/index.js","import":"./wrapper.mjs"},"browser":{"import":"./dist/esm-browser/index.js","require":"./dist/commonjs-browser/index.js"},"default":"./dist/esm-browser/index.js"},"./package.json":"./package.json"},"module":"./dist/esm-node/index.js","browser":{"./dist/esm-node/index.js":"./dist/esm-browser/index.js","./dist/md5.js":"./dist/md5-browser.js","./dist/native.js":"./dist/native-browser.js","./dist/rng.js":"./dist/rng-browser.js","./dist/sha1.js":"./dist/sha1-browser.js"},"files":["CHANGELOG.md","CONTRIBUTING.md","LICENSE.md","README.md","dist","wrapper.mjs"],"devDependencies":{"@babel/cli":"7.24.6","@babel/core":"7.24.6","@babel/eslint-parser":"7.24.6","@babel/plugin-syntax-import-attributes":"7.24.6","@babel/preset-env":"7.24.6","@commitlint/cli":"19.3.0","@commitlint/config-conventional":"19.2.2","@wdio/browserstack-service":"7.16.10","@wdio/cli":"7.16.10","@wdio/jasmine-framework":"7.16.6","@wdio/local-runner":"7.16.10","@wdio/spec-reporter":"7.16.9","@wdio/static-server-service":"7.16.6","bundlewatch":"0.3.3","eslint":"9.4.0","eslint-plugin-prettier":"5.1.3","globals":"15.3.0","husky":"9.0.11","jest":"29.7.0","lint-staged":"15.2.5","neostandard":"0.5.1","npm-run-all":"4.1.5","optional-dev-dependency":"2.0.1","prettier":"3.3.0","random-seed":"0.3.0","runmd":"1.3.9","standard-version":"9.5.0"},"optionalDevDependencies":{"@wdio/browserstack-service":"7.16.10","@wdio/cli":"7.16.10","@wdio/jasmine-framework":"7.16.6","@wdio/local-runner":"7.16.10","@wdio/spec-reporter":"7.16.9","@wdio/static-server-service":"7.16.6"},"scripts":{"examples:browser:webpack:build":"cd examples/browser-webpack && npm install && npm run build","examples:browser:rollup:build":"cd examples/browser-rollup && npm install && npm run build","examples:node:commonjs:test":"cd examples/node-commonjs && npm install && npm test","examples:node:esmodules:test":"cd examples/node-esmodules && npm install && npm test","examples:node:jest:test":"cd examples/node-jest && npm install && npm test","prepare":"husky install","lint":"npm run eslint:check && npm run prettier:check","eslint:check":"eslint src/ test/ examples/ *.js","eslint:fix":"eslint --fix src/ test/ examples/ *.js","pretest":"npm run build","test":"BABEL_ENV=commonjsNode node --throw-deprecation node_modules/.bin/jest test/unit/","test:matching":"BABEL_ENV=commonjsNode node --throw-deprecation node_modules/.bin/jest test/unit/ -t","pretest:browser":"optional-dev-dependency && npm run build && npm-run-all --parallel examples:browser:**","test:browser":"wdio run ./wdio.conf.js","pretest:node":"npm run build","test:node":"npm-run-all --parallel examples:node:**","test:pack":"./scripts/testpack.sh","pretest:benchmark":"npm run build","test:benchmark":"cd examples/benchmark && HUSKY=0 npm install && npm test","prettier:check":"prettier --check .","prettier:fix":"prettier --write .","bundlewatch":"npm run pretest:browser && bundlewatch --config bundlewatch.config.json","md":"runmd --watch --output=README.md README_js.md","docs":"npm run build && npx runmd --output=README.md README_js.md","docs:diff":"npm run docs && git diff --quiet README.md","build":"./scripts/build.sh","prepack":"npm run build","release":"standard-version --no-verify"},"repository":{"type":"git","url":"git+https://github.com/uuidjs/uuid.git"},"lint-staged":{"*":["prettier --no-error-on-unmatched-pattern --write"],"*.{js,jsx}":["eslint --no-error-on-unmatched-pattern --fix"]},"standard-version":{"scripts":{"postchangelog":"prettier --write CHANGELOG.md"}},"packageManager":"npm@10.8.1+sha256.b8807aebb9656758e2872fa6e7c564b506aa2faa9297439a478d471d2fe32483","_lastModified":"2026-04-27T17:02:59.836Z"}
|
|
@@ -9,6 +9,11 @@
|
|
|
9
9
|
import { SendFnType, BaseNotificationChannel } from '@nocobase/plugin-notification-manager';
|
|
10
10
|
import { InAppMessageFormValues } from '../types';
|
|
11
11
|
export default class InAppNotificationChannel extends BaseNotificationChannel {
|
|
12
|
+
private static readonly SLOW_SEND_THRESHOLD_MS;
|
|
13
|
+
private getMessagePayload;
|
|
14
|
+
private emitMessageEventsAsync;
|
|
15
|
+
private scheduleMessageEvents;
|
|
16
|
+
private emitMessageEvents;
|
|
12
17
|
load(): Promise<void>;
|
|
13
18
|
onMessageCreated: (model: any, options: any) => Promise<void>;
|
|
14
19
|
onMessageUpdated: (model: any, options: any) => Promise<void>;
|