@nocobase/plugin-multi-portal 2.2.0-alpha.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/LICENSE.txt +107 -0
- package/README.md +14 -0
- package/client-v2.d.ts +2 -0
- package/client-v2.js +1 -0
- package/client.d.ts +2 -0
- package/client.js +1 -0
- package/dist/client/index.d.ts +9 -0
- package/dist/client/index.js +10 -0
- package/dist/client/locale.d.ts +10 -0
- package/dist/client/models/index.d.ts +11 -0
- package/dist/client/plugin.d.ts +13 -0
- package/dist/client-v2/354.ead3e96143164cd5.js +10 -0
- package/dist/client-v2/499.ef2ff0c022687485.js +10 -0
- package/dist/client-v2/778.23ba409a924ee34a.js +10 -0
- package/dist/client-v2/845.f2b0ce44ae4be707.js +10 -0
- package/dist/client-v2/entryActions/PortalEntryActionModel.d.ts +52 -0
- package/dist/client-v2/entryActions/portalEntryActionStore.d.ts +36 -0
- package/dist/client-v2/entryActions/registerPortalEntryActions.d.ts +10 -0
- package/dist/client-v2/entryActions/types.d.ts +41 -0
- package/dist/client-v2/entryActions/url.d.ts +10 -0
- package/dist/client-v2/index.d.ts +9 -0
- package/dist/client-v2/index.js +10 -0
- package/dist/client-v2/layoutRegistration.d.ts +38 -0
- package/dist/client-v2/locale.d.ts +13 -0
- package/dist/client-v2/models/MultiPortalBlockModel.d.ts +13 -0
- package/dist/client-v2/models/MultiPortalMobilePageModels.d.ts +34 -0
- package/dist/client-v2/pages/MultiPortalsPage.d.ts +80 -0
- package/dist/client-v2/permissions/MultiPortalPermissionsTab.d.ts +21 -0
- package/dist/client-v2/permissions/multiPortalPermissions.d.ts +12 -0
- package/dist/client-v2/plugin.d.ts +13 -0
- package/dist/client-v2/routeRepositoryScope.d.ts +11 -0
- package/dist/client-v2/routeUrl.d.ts +18 -0
- package/dist/externalVersion.js +25 -0
- package/dist/index.d.ts +10 -0
- package/dist/index.js +48 -0
- package/dist/locale/en-US.json +82 -0
- package/dist/locale/zh-CN.json +82 -0
- package/dist/node_modules/tar/dist/commonjs/create.d.ts +3 -0
- package/dist/node_modules/tar/dist/commonjs/create.js +82 -0
- package/dist/node_modules/tar/dist/commonjs/cwd-error.d.ts +8 -0
- package/dist/node_modules/tar/dist/commonjs/cwd-error.js +18 -0
- package/dist/node_modules/tar/dist/commonjs/extract.d.ts +3 -0
- package/dist/node_modules/tar/dist/commonjs/extract.js +88 -0
- package/dist/node_modules/tar/dist/commonjs/get-write-flag.d.ts +2 -0
- package/dist/node_modules/tar/dist/commonjs/get-write-flag.js +32 -0
- package/dist/node_modules/tar/dist/commonjs/header.d.ts +53 -0
- package/dist/node_modules/tar/dist/commonjs/header.js +312 -0
- package/dist/node_modules/tar/dist/commonjs/index.d.ts +20 -0
- package/dist/node_modules/tar/dist/commonjs/index.js +64 -0
- package/dist/node_modules/tar/dist/commonjs/index.min.js +1 -0
- package/dist/node_modules/tar/dist/commonjs/large-numbers.d.ts +3 -0
- package/dist/node_modules/tar/dist/commonjs/large-numbers.js +99 -0
- package/dist/node_modules/tar/dist/commonjs/list.d.ts +7 -0
- package/dist/node_modules/tar/dist/commonjs/list.js +145 -0
- package/dist/node_modules/tar/dist/commonjs/make-command.d.ts +49 -0
- package/dist/node_modules/tar/dist/commonjs/make-command.js +52 -0
- package/dist/node_modules/tar/dist/commonjs/mkdir.d.ts +25 -0
- package/dist/node_modules/tar/dist/commonjs/mkdir.js +187 -0
- package/dist/node_modules/tar/dist/commonjs/mode-fix.d.ts +2 -0
- package/dist/node_modules/tar/dist/commonjs/mode-fix.js +29 -0
- package/dist/node_modules/tar/dist/commonjs/normalize-unicode.d.ts +2 -0
- package/dist/node_modules/tar/dist/commonjs/normalize-unicode.js +38 -0
- package/dist/node_modules/tar/dist/commonjs/normalize-windows-path.d.ts +2 -0
- package/dist/node_modules/tar/dist/commonjs/normalize-windows-path.js +12 -0
- package/dist/node_modules/tar/dist/commonjs/options.d.ts +596 -0
- package/dist/node_modules/tar/dist/commonjs/options.js +66 -0
- package/dist/node_modules/tar/dist/commonjs/pack.d.ts +105 -0
- package/dist/node_modules/tar/dist/commonjs/pack.js +545 -0
- package/dist/node_modules/tar/dist/commonjs/package.json +3 -0
- package/dist/node_modules/tar/dist/commonjs/parse.d.ts +85 -0
- package/dist/node_modules/tar/dist/commonjs/parse.js +610 -0
- package/dist/node_modules/tar/dist/commonjs/path-reservations.d.ts +11 -0
- package/dist/node_modules/tar/dist/commonjs/path-reservations.js +170 -0
- package/dist/node_modules/tar/dist/commonjs/pax.d.ts +26 -0
- package/dist/node_modules/tar/dist/commonjs/pax.js +158 -0
- package/dist/node_modules/tar/dist/commonjs/process-umask.d.ts +2 -0
- package/dist/node_modules/tar/dist/commonjs/process-umask.js +7 -0
- package/dist/node_modules/tar/dist/commonjs/read-entry.d.ts +36 -0
- package/dist/node_modules/tar/dist/commonjs/read-entry.js +136 -0
- package/dist/node_modules/tar/dist/commonjs/replace.d.ts +2 -0
- package/dist/node_modules/tar/dist/commonjs/replace.js +227 -0
- package/dist/node_modules/tar/dist/commonjs/strip-absolute-path.d.ts +2 -0
- package/dist/node_modules/tar/dist/commonjs/strip-absolute-path.js +29 -0
- package/dist/node_modules/tar/dist/commonjs/strip-trailing-slashes.d.ts +2 -0
- package/dist/node_modules/tar/dist/commonjs/strip-trailing-slashes.js +18 -0
- package/dist/node_modules/tar/dist/commonjs/symlink-error.d.ts +9 -0
- package/dist/node_modules/tar/dist/commonjs/symlink-error.js +19 -0
- package/dist/node_modules/tar/dist/commonjs/types.d.ts +7 -0
- package/dist/node_modules/tar/dist/commonjs/types.js +50 -0
- package/dist/node_modules/tar/dist/commonjs/unpack.d.ts +101 -0
- package/dist/node_modules/tar/dist/commonjs/unpack.js +932 -0
- package/dist/node_modules/tar/dist/commonjs/update.d.ts +2 -0
- package/dist/node_modules/tar/dist/commonjs/update.js +33 -0
- package/dist/node_modules/tar/dist/commonjs/warn-method.d.ts +24 -0
- package/dist/node_modules/tar/dist/commonjs/warn-method.js +31 -0
- package/dist/node_modules/tar/dist/commonjs/winchars.d.ts +3 -0
- package/dist/node_modules/tar/dist/commonjs/winchars.js +14 -0
- package/dist/node_modules/tar/dist/commonjs/write-entry.d.ts +129 -0
- package/dist/node_modules/tar/dist/commonjs/write-entry.js +698 -0
- package/dist/node_modules/tar/dist/esm/create.d.ts +3 -0
- package/dist/node_modules/tar/dist/esm/create.js +76 -0
- package/dist/node_modules/tar/dist/esm/cwd-error.d.ts +8 -0
- package/dist/node_modules/tar/dist/esm/cwd-error.js +14 -0
- package/dist/node_modules/tar/dist/esm/extract.d.ts +3 -0
- package/dist/node_modules/tar/dist/esm/extract.js +49 -0
- package/dist/node_modules/tar/dist/esm/get-write-flag.d.ts +2 -0
- package/dist/node_modules/tar/dist/esm/get-write-flag.js +26 -0
- package/dist/node_modules/tar/dist/esm/header.d.ts +53 -0
- package/dist/node_modules/tar/dist/esm/header.js +275 -0
- package/dist/node_modules/tar/dist/esm/index.d.ts +20 -0
- package/dist/node_modules/tar/dist/esm/index.js +20 -0
- package/dist/node_modules/tar/dist/esm/index.min.js +4 -0
- package/dist/node_modules/tar/dist/esm/large-numbers.d.ts +3 -0
- package/dist/node_modules/tar/dist/esm/large-numbers.js +94 -0
- package/dist/node_modules/tar/dist/esm/list.d.ts +7 -0
- package/dist/node_modules/tar/dist/esm/list.js +105 -0
- package/dist/node_modules/tar/dist/esm/make-command.d.ts +49 -0
- package/dist/node_modules/tar/dist/esm/make-command.js +48 -0
- package/dist/node_modules/tar/dist/esm/mkdir.d.ts +25 -0
- package/dist/node_modules/tar/dist/esm/mkdir.js +179 -0
- package/dist/node_modules/tar/dist/esm/mode-fix.d.ts +2 -0
- package/dist/node_modules/tar/dist/esm/mode-fix.js +25 -0
- package/dist/node_modules/tar/dist/esm/normalize-unicode.d.ts +2 -0
- package/dist/node_modules/tar/dist/esm/normalize-unicode.js +34 -0
- package/dist/node_modules/tar/dist/esm/normalize-windows-path.d.ts +2 -0
- package/dist/node_modules/tar/dist/esm/normalize-windows-path.js +9 -0
- package/dist/node_modules/tar/dist/esm/options.d.ts +596 -0
- package/dist/node_modules/tar/dist/esm/options.js +54 -0
- package/dist/node_modules/tar/dist/esm/pack.d.ts +105 -0
- package/dist/node_modules/tar/dist/esm/pack.js +503 -0
- package/dist/node_modules/tar/dist/esm/package.json +3 -0
- package/dist/node_modules/tar/dist/esm/parse.d.ts +85 -0
- package/dist/node_modules/tar/dist/esm/parse.js +606 -0
- package/dist/node_modules/tar/dist/esm/path-reservations.d.ts +11 -0
- package/dist/node_modules/tar/dist/esm/path-reservations.js +166 -0
- package/dist/node_modules/tar/dist/esm/pax.d.ts +26 -0
- package/dist/node_modules/tar/dist/esm/pax.js +154 -0
- package/dist/node_modules/tar/dist/esm/process-umask.d.ts +2 -0
- package/dist/node_modules/tar/dist/esm/process-umask.js +3 -0
- package/dist/node_modules/tar/dist/esm/read-entry.d.ts +36 -0
- package/dist/node_modules/tar/dist/esm/read-entry.js +132 -0
- package/dist/node_modules/tar/dist/esm/replace.d.ts +2 -0
- package/dist/node_modules/tar/dist/esm/replace.js +221 -0
- package/dist/node_modules/tar/dist/esm/strip-absolute-path.d.ts +2 -0
- package/dist/node_modules/tar/dist/esm/strip-absolute-path.js +25 -0
- package/dist/node_modules/tar/dist/esm/strip-trailing-slashes.d.ts +2 -0
- package/dist/node_modules/tar/dist/esm/strip-trailing-slashes.js +14 -0
- package/dist/node_modules/tar/dist/esm/symlink-error.d.ts +9 -0
- package/dist/node_modules/tar/dist/esm/symlink-error.js +15 -0
- package/dist/node_modules/tar/dist/esm/types.d.ts +7 -0
- package/dist/node_modules/tar/dist/esm/types.js +45 -0
- package/dist/node_modules/tar/dist/esm/unpack.d.ts +101 -0
- package/dist/node_modules/tar/dist/esm/unpack.js +891 -0
- package/dist/node_modules/tar/dist/esm/update.d.ts +2 -0
- package/dist/node_modules/tar/dist/esm/update.js +30 -0
- package/dist/node_modules/tar/dist/esm/warn-method.d.ts +24 -0
- package/dist/node_modules/tar/dist/esm/warn-method.js +27 -0
- package/dist/node_modules/tar/dist/esm/winchars.d.ts +3 -0
- package/dist/node_modules/tar/dist/esm/winchars.js +9 -0
- package/dist/node_modules/tar/dist/esm/write-entry.d.ts +129 -0
- package/dist/node_modules/tar/dist/esm/write-entry.js +656 -0
- package/dist/node_modules/tar/node_modules/chownr/dist/commonjs/index.d.ts +3 -0
- package/dist/node_modules/tar/node_modules/chownr/dist/commonjs/index.js +93 -0
- package/dist/node_modules/tar/node_modules/chownr/dist/commonjs/package.json +3 -0
- package/dist/node_modules/tar/node_modules/chownr/dist/esm/index.d.ts +3 -0
- package/dist/node_modules/tar/node_modules/chownr/dist/esm/index.js +85 -0
- package/dist/node_modules/tar/node_modules/chownr/dist/esm/package.json +3 -0
- package/dist/node_modules/tar/node_modules/chownr/package.json +69 -0
- package/dist/node_modules/tar/node_modules/minipass/dist/commonjs/index.d.ts +549 -0
- package/dist/node_modules/tar/node_modules/minipass/dist/commonjs/index.js +1028 -0
- package/dist/node_modules/tar/node_modules/minipass/dist/commonjs/package.json +3 -0
- package/dist/node_modules/tar/node_modules/minipass/dist/esm/index.d.ts +549 -0
- package/dist/node_modules/tar/node_modules/minipass/dist/esm/index.js +1018 -0
- package/dist/node_modules/tar/node_modules/minipass/dist/esm/package.json +3 -0
- package/dist/node_modules/tar/node_modules/minipass/package.json +82 -0
- package/dist/node_modules/tar/node_modules/minizlib/dist/commonjs/constants.d.ts +2 -0
- package/dist/node_modules/tar/node_modules/minizlib/dist/commonjs/constants.js +123 -0
- package/dist/node_modules/tar/node_modules/minizlib/dist/commonjs/index.d.ts +99 -0
- package/dist/node_modules/tar/node_modules/minizlib/dist/commonjs/index.js +416 -0
- package/dist/node_modules/tar/node_modules/minizlib/dist/commonjs/package.json +3 -0
- package/dist/node_modules/tar/node_modules/minizlib/dist/esm/constants.d.ts +2 -0
- package/dist/node_modules/tar/node_modules/minizlib/dist/esm/constants.js +117 -0
- package/dist/node_modules/tar/node_modules/minizlib/dist/esm/index.d.ts +99 -0
- package/dist/node_modules/tar/node_modules/minizlib/dist/esm/index.js +363 -0
- package/dist/node_modules/tar/node_modules/minizlib/dist/esm/package.json +3 -0
- package/dist/node_modules/tar/node_modules/minizlib/package.json +80 -0
- package/dist/node_modules/tar/node_modules/yallist/dist/commonjs/index.d.ts +39 -0
- package/dist/node_modules/tar/node_modules/yallist/dist/commonjs/index.js +384 -0
- package/dist/node_modules/tar/node_modules/yallist/dist/commonjs/package.json +3 -0
- package/dist/node_modules/tar/node_modules/yallist/dist/esm/index.d.ts +39 -0
- package/dist/node_modules/tar/node_modules/yallist/dist/esm/index.js +379 -0
- package/dist/node_modules/tar/node_modules/yallist/dist/esm/package.json +3 -0
- package/dist/node_modules/tar/node_modules/yallist/package.json +68 -0
- package/dist/node_modules/tar/package.json +1 -0
- package/dist/server/collections/desktopRoutes.d.ts +14 -0
- package/dist/server/collections/desktopRoutes.js +48 -0
- package/dist/server/collections/extendRoleField.d.ts +14 -0
- package/dist/server/collections/extendRoleField.js +51 -0
- package/dist/server/collections/multiPortals.d.ts +10 -0
- package/dist/server/collections/multiPortals.js +128 -0
- package/dist/server/collections/rolesMultiPortalDesktopRoutes.d.ts +10 -0
- package/dist/server/collections/rolesMultiPortalDesktopRoutes.js +76 -0
- package/dist/server/collections/rolesMultiPortalRoutePolicies.d.ts +10 -0
- package/dist/server/collections/rolesMultiPortalRoutePolicies.js +73 -0
- package/dist/server/collections/rolesMultiPortals.d.ts +10 -0
- package/dist/server/collections/rolesMultiPortals.js +68 -0
- package/dist/server/ensureDefaultRoleMultiPortalAccess.d.ts +11 -0
- package/dist/server/ensureDefaultRoleMultiPortalAccess.js +70 -0
- package/dist/server/index.d.ts +9 -0
- package/dist/server/index.js +42 -0
- package/dist/server/migrations/20260723105200-drop-ui-layout-foreign-key-constraint.d.ts +13 -0
- package/dist/server/migrations/20260723105200-drop-ui-layout-foreign-key-constraint.js +104 -0
- package/dist/server/plugin.d.ts +63 -0
- package/dist/server/plugin.js +2130 -0
- package/package.json +34 -0
- package/server.d.ts +2 -0
- package/server.js +1 -0
|
@@ -0,0 +1,93 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.chownrSync = exports.chownr = void 0;
|
|
7
|
+
const node_fs_1 = __importDefault(require("node:fs"));
|
|
8
|
+
const node_path_1 = __importDefault(require("node:path"));
|
|
9
|
+
const lchownSync = (path, uid, gid) => {
|
|
10
|
+
try {
|
|
11
|
+
return node_fs_1.default.lchownSync(path, uid, gid);
|
|
12
|
+
}
|
|
13
|
+
catch (er) {
|
|
14
|
+
if (er?.code !== 'ENOENT')
|
|
15
|
+
throw er;
|
|
16
|
+
}
|
|
17
|
+
};
|
|
18
|
+
const chown = (cpath, uid, gid, cb) => {
|
|
19
|
+
node_fs_1.default.lchown(cpath, uid, gid, er => {
|
|
20
|
+
// Skip ENOENT error
|
|
21
|
+
cb(er && er?.code !== 'ENOENT' ? er : null);
|
|
22
|
+
});
|
|
23
|
+
};
|
|
24
|
+
const chownrKid = (p, child, uid, gid, cb) => {
|
|
25
|
+
if (child.isDirectory()) {
|
|
26
|
+
(0, exports.chownr)(node_path_1.default.resolve(p, child.name), uid, gid, (er) => {
|
|
27
|
+
if (er)
|
|
28
|
+
return cb(er);
|
|
29
|
+
const cpath = node_path_1.default.resolve(p, child.name);
|
|
30
|
+
chown(cpath, uid, gid, cb);
|
|
31
|
+
});
|
|
32
|
+
}
|
|
33
|
+
else {
|
|
34
|
+
const cpath = node_path_1.default.resolve(p, child.name);
|
|
35
|
+
chown(cpath, uid, gid, cb);
|
|
36
|
+
}
|
|
37
|
+
};
|
|
38
|
+
const chownr = (p, uid, gid, cb) => {
|
|
39
|
+
node_fs_1.default.readdir(p, { withFileTypes: true }, (er, children) => {
|
|
40
|
+
// any error other than ENOTDIR or ENOTSUP means it's not readable,
|
|
41
|
+
// or doesn't exist. give up.
|
|
42
|
+
if (er) {
|
|
43
|
+
if (er.code === 'ENOENT')
|
|
44
|
+
return cb();
|
|
45
|
+
else if (er.code !== 'ENOTDIR' && er.code !== 'ENOTSUP')
|
|
46
|
+
return cb(er);
|
|
47
|
+
}
|
|
48
|
+
if (er || !children.length)
|
|
49
|
+
return chown(p, uid, gid, cb);
|
|
50
|
+
let len = children.length;
|
|
51
|
+
let errState = null;
|
|
52
|
+
const then = (er) => {
|
|
53
|
+
/* c8 ignore start */
|
|
54
|
+
if (errState)
|
|
55
|
+
return;
|
|
56
|
+
/* c8 ignore stop */
|
|
57
|
+
if (er)
|
|
58
|
+
return cb((errState = er));
|
|
59
|
+
if (--len === 0)
|
|
60
|
+
return chown(p, uid, gid, cb);
|
|
61
|
+
};
|
|
62
|
+
for (const child of children) {
|
|
63
|
+
chownrKid(p, child, uid, gid, then);
|
|
64
|
+
}
|
|
65
|
+
});
|
|
66
|
+
};
|
|
67
|
+
exports.chownr = chownr;
|
|
68
|
+
const chownrKidSync = (p, child, uid, gid) => {
|
|
69
|
+
if (child.isDirectory())
|
|
70
|
+
(0, exports.chownrSync)(node_path_1.default.resolve(p, child.name), uid, gid);
|
|
71
|
+
lchownSync(node_path_1.default.resolve(p, child.name), uid, gid);
|
|
72
|
+
};
|
|
73
|
+
const chownrSync = (p, uid, gid) => {
|
|
74
|
+
let children;
|
|
75
|
+
try {
|
|
76
|
+
children = node_fs_1.default.readdirSync(p, { withFileTypes: true });
|
|
77
|
+
}
|
|
78
|
+
catch (er) {
|
|
79
|
+
const e = er;
|
|
80
|
+
if (e?.code === 'ENOENT')
|
|
81
|
+
return;
|
|
82
|
+
else if (e?.code === 'ENOTDIR' || e?.code === 'ENOTSUP')
|
|
83
|
+
return lchownSync(p, uid, gid);
|
|
84
|
+
else
|
|
85
|
+
throw e;
|
|
86
|
+
}
|
|
87
|
+
for (const child of children) {
|
|
88
|
+
chownrKidSync(p, child, uid, gid);
|
|
89
|
+
}
|
|
90
|
+
return lchownSync(p, uid, gid);
|
|
91
|
+
};
|
|
92
|
+
exports.chownrSync = chownrSync;
|
|
93
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
import fs from 'node:fs';
|
|
2
|
+
import path from 'node:path';
|
|
3
|
+
const lchownSync = (path, uid, gid) => {
|
|
4
|
+
try {
|
|
5
|
+
return fs.lchownSync(path, uid, gid);
|
|
6
|
+
}
|
|
7
|
+
catch (er) {
|
|
8
|
+
if (er?.code !== 'ENOENT')
|
|
9
|
+
throw er;
|
|
10
|
+
}
|
|
11
|
+
};
|
|
12
|
+
const chown = (cpath, uid, gid, cb) => {
|
|
13
|
+
fs.lchown(cpath, uid, gid, er => {
|
|
14
|
+
// Skip ENOENT error
|
|
15
|
+
cb(er && er?.code !== 'ENOENT' ? er : null);
|
|
16
|
+
});
|
|
17
|
+
};
|
|
18
|
+
const chownrKid = (p, child, uid, gid, cb) => {
|
|
19
|
+
if (child.isDirectory()) {
|
|
20
|
+
chownr(path.resolve(p, child.name), uid, gid, (er) => {
|
|
21
|
+
if (er)
|
|
22
|
+
return cb(er);
|
|
23
|
+
const cpath = path.resolve(p, child.name);
|
|
24
|
+
chown(cpath, uid, gid, cb);
|
|
25
|
+
});
|
|
26
|
+
}
|
|
27
|
+
else {
|
|
28
|
+
const cpath = path.resolve(p, child.name);
|
|
29
|
+
chown(cpath, uid, gid, cb);
|
|
30
|
+
}
|
|
31
|
+
};
|
|
32
|
+
export const chownr = (p, uid, gid, cb) => {
|
|
33
|
+
fs.readdir(p, { withFileTypes: true }, (er, children) => {
|
|
34
|
+
// any error other than ENOTDIR or ENOTSUP means it's not readable,
|
|
35
|
+
// or doesn't exist. give up.
|
|
36
|
+
if (er) {
|
|
37
|
+
if (er.code === 'ENOENT')
|
|
38
|
+
return cb();
|
|
39
|
+
else if (er.code !== 'ENOTDIR' && er.code !== 'ENOTSUP')
|
|
40
|
+
return cb(er);
|
|
41
|
+
}
|
|
42
|
+
if (er || !children.length)
|
|
43
|
+
return chown(p, uid, gid, cb);
|
|
44
|
+
let len = children.length;
|
|
45
|
+
let errState = null;
|
|
46
|
+
const then = (er) => {
|
|
47
|
+
/* c8 ignore start */
|
|
48
|
+
if (errState)
|
|
49
|
+
return;
|
|
50
|
+
/* c8 ignore stop */
|
|
51
|
+
if (er)
|
|
52
|
+
return cb((errState = er));
|
|
53
|
+
if (--len === 0)
|
|
54
|
+
return chown(p, uid, gid, cb);
|
|
55
|
+
};
|
|
56
|
+
for (const child of children) {
|
|
57
|
+
chownrKid(p, child, uid, gid, then);
|
|
58
|
+
}
|
|
59
|
+
});
|
|
60
|
+
};
|
|
61
|
+
const chownrKidSync = (p, child, uid, gid) => {
|
|
62
|
+
if (child.isDirectory())
|
|
63
|
+
chownrSync(path.resolve(p, child.name), uid, gid);
|
|
64
|
+
lchownSync(path.resolve(p, child.name), uid, gid);
|
|
65
|
+
};
|
|
66
|
+
export const chownrSync = (p, uid, gid) => {
|
|
67
|
+
let children;
|
|
68
|
+
try {
|
|
69
|
+
children = fs.readdirSync(p, { withFileTypes: true });
|
|
70
|
+
}
|
|
71
|
+
catch (er) {
|
|
72
|
+
const e = er;
|
|
73
|
+
if (e?.code === 'ENOENT')
|
|
74
|
+
return;
|
|
75
|
+
else if (e?.code === 'ENOTDIR' || e?.code === 'ENOTSUP')
|
|
76
|
+
return lchownSync(p, uid, gid);
|
|
77
|
+
else
|
|
78
|
+
throw e;
|
|
79
|
+
}
|
|
80
|
+
for (const child of children) {
|
|
81
|
+
chownrKidSync(p, child, uid, gid);
|
|
82
|
+
}
|
|
83
|
+
return lchownSync(p, uid, gid);
|
|
84
|
+
};
|
|
85
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
{
|
|
2
|
+
"author": "Isaac Z. Schlueter <i@izs.me> (http://blog.izs.me/)",
|
|
3
|
+
"name": "chownr",
|
|
4
|
+
"description": "like `chown -R`",
|
|
5
|
+
"version": "3.0.0",
|
|
6
|
+
"repository": {
|
|
7
|
+
"type": "git",
|
|
8
|
+
"url": "git://github.com/isaacs/chownr.git"
|
|
9
|
+
},
|
|
10
|
+
"files": [
|
|
11
|
+
"dist"
|
|
12
|
+
],
|
|
13
|
+
"devDependencies": {
|
|
14
|
+
"@types/node": "^20.12.5",
|
|
15
|
+
"mkdirp": "^3.0.1",
|
|
16
|
+
"prettier": "^3.2.5",
|
|
17
|
+
"rimraf": "^5.0.5",
|
|
18
|
+
"tap": "^18.7.2",
|
|
19
|
+
"tshy": "^1.13.1",
|
|
20
|
+
"typedoc": "^0.25.12"
|
|
21
|
+
},
|
|
22
|
+
"scripts": {
|
|
23
|
+
"prepare": "tshy",
|
|
24
|
+
"pretest": "npm run prepare",
|
|
25
|
+
"test": "tap",
|
|
26
|
+
"preversion": "npm test",
|
|
27
|
+
"postversion": "npm publish",
|
|
28
|
+
"prepublishOnly": "git push origin --follow-tags",
|
|
29
|
+
"format": "prettier --write . --loglevel warn",
|
|
30
|
+
"typedoc": "typedoc --tsconfig .tshy/esm.json ./src/*.ts"
|
|
31
|
+
},
|
|
32
|
+
"license": "BlueOak-1.0.0",
|
|
33
|
+
"engines": {
|
|
34
|
+
"node": ">=18"
|
|
35
|
+
},
|
|
36
|
+
"tshy": {
|
|
37
|
+
"exports": {
|
|
38
|
+
"./package.json": "./package.json",
|
|
39
|
+
".": "./src/index.ts"
|
|
40
|
+
}
|
|
41
|
+
},
|
|
42
|
+
"exports": {
|
|
43
|
+
"./package.json": "./package.json",
|
|
44
|
+
".": {
|
|
45
|
+
"import": {
|
|
46
|
+
"types": "./dist/esm/index.d.ts",
|
|
47
|
+
"default": "./dist/esm/index.js"
|
|
48
|
+
},
|
|
49
|
+
"require": {
|
|
50
|
+
"types": "./dist/commonjs/index.d.ts",
|
|
51
|
+
"default": "./dist/commonjs/index.js"
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
},
|
|
55
|
+
"main": "./dist/commonjs/index.js",
|
|
56
|
+
"types": "./dist/commonjs/index.d.ts",
|
|
57
|
+
"type": "module",
|
|
58
|
+
"prettier": {
|
|
59
|
+
"semi": false,
|
|
60
|
+
"printWidth": 75,
|
|
61
|
+
"tabWidth": 2,
|
|
62
|
+
"useTabs": false,
|
|
63
|
+
"singleQuote": true,
|
|
64
|
+
"jsxSingleQuote": false,
|
|
65
|
+
"bracketSameLine": true,
|
|
66
|
+
"arrowParens": "avoid",
|
|
67
|
+
"endOfLine": "lf"
|
|
68
|
+
}
|
|
69
|
+
}
|