@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.
Files changed (217) hide show
  1. package/LICENSE.txt +107 -0
  2. package/README.md +14 -0
  3. package/client-v2.d.ts +2 -0
  4. package/client-v2.js +1 -0
  5. package/client.d.ts +2 -0
  6. package/client.js +1 -0
  7. package/dist/client/index.d.ts +9 -0
  8. package/dist/client/index.js +10 -0
  9. package/dist/client/locale.d.ts +10 -0
  10. package/dist/client/models/index.d.ts +11 -0
  11. package/dist/client/plugin.d.ts +13 -0
  12. package/dist/client-v2/354.ead3e96143164cd5.js +10 -0
  13. package/dist/client-v2/499.ef2ff0c022687485.js +10 -0
  14. package/dist/client-v2/778.23ba409a924ee34a.js +10 -0
  15. package/dist/client-v2/845.f2b0ce44ae4be707.js +10 -0
  16. package/dist/client-v2/entryActions/PortalEntryActionModel.d.ts +52 -0
  17. package/dist/client-v2/entryActions/portalEntryActionStore.d.ts +36 -0
  18. package/dist/client-v2/entryActions/registerPortalEntryActions.d.ts +10 -0
  19. package/dist/client-v2/entryActions/types.d.ts +41 -0
  20. package/dist/client-v2/entryActions/url.d.ts +10 -0
  21. package/dist/client-v2/index.d.ts +9 -0
  22. package/dist/client-v2/index.js +10 -0
  23. package/dist/client-v2/layoutRegistration.d.ts +38 -0
  24. package/dist/client-v2/locale.d.ts +13 -0
  25. package/dist/client-v2/models/MultiPortalBlockModel.d.ts +13 -0
  26. package/dist/client-v2/models/MultiPortalMobilePageModels.d.ts +34 -0
  27. package/dist/client-v2/pages/MultiPortalsPage.d.ts +80 -0
  28. package/dist/client-v2/permissions/MultiPortalPermissionsTab.d.ts +21 -0
  29. package/dist/client-v2/permissions/multiPortalPermissions.d.ts +12 -0
  30. package/dist/client-v2/plugin.d.ts +13 -0
  31. package/dist/client-v2/routeRepositoryScope.d.ts +11 -0
  32. package/dist/client-v2/routeUrl.d.ts +18 -0
  33. package/dist/externalVersion.js +25 -0
  34. package/dist/index.d.ts +10 -0
  35. package/dist/index.js +48 -0
  36. package/dist/locale/en-US.json +82 -0
  37. package/dist/locale/zh-CN.json +82 -0
  38. package/dist/node_modules/tar/dist/commonjs/create.d.ts +3 -0
  39. package/dist/node_modules/tar/dist/commonjs/create.js +82 -0
  40. package/dist/node_modules/tar/dist/commonjs/cwd-error.d.ts +8 -0
  41. package/dist/node_modules/tar/dist/commonjs/cwd-error.js +18 -0
  42. package/dist/node_modules/tar/dist/commonjs/extract.d.ts +3 -0
  43. package/dist/node_modules/tar/dist/commonjs/extract.js +88 -0
  44. package/dist/node_modules/tar/dist/commonjs/get-write-flag.d.ts +2 -0
  45. package/dist/node_modules/tar/dist/commonjs/get-write-flag.js +32 -0
  46. package/dist/node_modules/tar/dist/commonjs/header.d.ts +53 -0
  47. package/dist/node_modules/tar/dist/commonjs/header.js +312 -0
  48. package/dist/node_modules/tar/dist/commonjs/index.d.ts +20 -0
  49. package/dist/node_modules/tar/dist/commonjs/index.js +64 -0
  50. package/dist/node_modules/tar/dist/commonjs/index.min.js +1 -0
  51. package/dist/node_modules/tar/dist/commonjs/large-numbers.d.ts +3 -0
  52. package/dist/node_modules/tar/dist/commonjs/large-numbers.js +99 -0
  53. package/dist/node_modules/tar/dist/commonjs/list.d.ts +7 -0
  54. package/dist/node_modules/tar/dist/commonjs/list.js +145 -0
  55. package/dist/node_modules/tar/dist/commonjs/make-command.d.ts +49 -0
  56. package/dist/node_modules/tar/dist/commonjs/make-command.js +52 -0
  57. package/dist/node_modules/tar/dist/commonjs/mkdir.d.ts +25 -0
  58. package/dist/node_modules/tar/dist/commonjs/mkdir.js +187 -0
  59. package/dist/node_modules/tar/dist/commonjs/mode-fix.d.ts +2 -0
  60. package/dist/node_modules/tar/dist/commonjs/mode-fix.js +29 -0
  61. package/dist/node_modules/tar/dist/commonjs/normalize-unicode.d.ts +2 -0
  62. package/dist/node_modules/tar/dist/commonjs/normalize-unicode.js +38 -0
  63. package/dist/node_modules/tar/dist/commonjs/normalize-windows-path.d.ts +2 -0
  64. package/dist/node_modules/tar/dist/commonjs/normalize-windows-path.js +12 -0
  65. package/dist/node_modules/tar/dist/commonjs/options.d.ts +596 -0
  66. package/dist/node_modules/tar/dist/commonjs/options.js +66 -0
  67. package/dist/node_modules/tar/dist/commonjs/pack.d.ts +105 -0
  68. package/dist/node_modules/tar/dist/commonjs/pack.js +545 -0
  69. package/dist/node_modules/tar/dist/commonjs/package.json +3 -0
  70. package/dist/node_modules/tar/dist/commonjs/parse.d.ts +85 -0
  71. package/dist/node_modules/tar/dist/commonjs/parse.js +610 -0
  72. package/dist/node_modules/tar/dist/commonjs/path-reservations.d.ts +11 -0
  73. package/dist/node_modules/tar/dist/commonjs/path-reservations.js +170 -0
  74. package/dist/node_modules/tar/dist/commonjs/pax.d.ts +26 -0
  75. package/dist/node_modules/tar/dist/commonjs/pax.js +158 -0
  76. package/dist/node_modules/tar/dist/commonjs/process-umask.d.ts +2 -0
  77. package/dist/node_modules/tar/dist/commonjs/process-umask.js +7 -0
  78. package/dist/node_modules/tar/dist/commonjs/read-entry.d.ts +36 -0
  79. package/dist/node_modules/tar/dist/commonjs/read-entry.js +136 -0
  80. package/dist/node_modules/tar/dist/commonjs/replace.d.ts +2 -0
  81. package/dist/node_modules/tar/dist/commonjs/replace.js +227 -0
  82. package/dist/node_modules/tar/dist/commonjs/strip-absolute-path.d.ts +2 -0
  83. package/dist/node_modules/tar/dist/commonjs/strip-absolute-path.js +29 -0
  84. package/dist/node_modules/tar/dist/commonjs/strip-trailing-slashes.d.ts +2 -0
  85. package/dist/node_modules/tar/dist/commonjs/strip-trailing-slashes.js +18 -0
  86. package/dist/node_modules/tar/dist/commonjs/symlink-error.d.ts +9 -0
  87. package/dist/node_modules/tar/dist/commonjs/symlink-error.js +19 -0
  88. package/dist/node_modules/tar/dist/commonjs/types.d.ts +7 -0
  89. package/dist/node_modules/tar/dist/commonjs/types.js +50 -0
  90. package/dist/node_modules/tar/dist/commonjs/unpack.d.ts +101 -0
  91. package/dist/node_modules/tar/dist/commonjs/unpack.js +932 -0
  92. package/dist/node_modules/tar/dist/commonjs/update.d.ts +2 -0
  93. package/dist/node_modules/tar/dist/commonjs/update.js +33 -0
  94. package/dist/node_modules/tar/dist/commonjs/warn-method.d.ts +24 -0
  95. package/dist/node_modules/tar/dist/commonjs/warn-method.js +31 -0
  96. package/dist/node_modules/tar/dist/commonjs/winchars.d.ts +3 -0
  97. package/dist/node_modules/tar/dist/commonjs/winchars.js +14 -0
  98. package/dist/node_modules/tar/dist/commonjs/write-entry.d.ts +129 -0
  99. package/dist/node_modules/tar/dist/commonjs/write-entry.js +698 -0
  100. package/dist/node_modules/tar/dist/esm/create.d.ts +3 -0
  101. package/dist/node_modules/tar/dist/esm/create.js +76 -0
  102. package/dist/node_modules/tar/dist/esm/cwd-error.d.ts +8 -0
  103. package/dist/node_modules/tar/dist/esm/cwd-error.js +14 -0
  104. package/dist/node_modules/tar/dist/esm/extract.d.ts +3 -0
  105. package/dist/node_modules/tar/dist/esm/extract.js +49 -0
  106. package/dist/node_modules/tar/dist/esm/get-write-flag.d.ts +2 -0
  107. package/dist/node_modules/tar/dist/esm/get-write-flag.js +26 -0
  108. package/dist/node_modules/tar/dist/esm/header.d.ts +53 -0
  109. package/dist/node_modules/tar/dist/esm/header.js +275 -0
  110. package/dist/node_modules/tar/dist/esm/index.d.ts +20 -0
  111. package/dist/node_modules/tar/dist/esm/index.js +20 -0
  112. package/dist/node_modules/tar/dist/esm/index.min.js +4 -0
  113. package/dist/node_modules/tar/dist/esm/large-numbers.d.ts +3 -0
  114. package/dist/node_modules/tar/dist/esm/large-numbers.js +94 -0
  115. package/dist/node_modules/tar/dist/esm/list.d.ts +7 -0
  116. package/dist/node_modules/tar/dist/esm/list.js +105 -0
  117. package/dist/node_modules/tar/dist/esm/make-command.d.ts +49 -0
  118. package/dist/node_modules/tar/dist/esm/make-command.js +48 -0
  119. package/dist/node_modules/tar/dist/esm/mkdir.d.ts +25 -0
  120. package/dist/node_modules/tar/dist/esm/mkdir.js +179 -0
  121. package/dist/node_modules/tar/dist/esm/mode-fix.d.ts +2 -0
  122. package/dist/node_modules/tar/dist/esm/mode-fix.js +25 -0
  123. package/dist/node_modules/tar/dist/esm/normalize-unicode.d.ts +2 -0
  124. package/dist/node_modules/tar/dist/esm/normalize-unicode.js +34 -0
  125. package/dist/node_modules/tar/dist/esm/normalize-windows-path.d.ts +2 -0
  126. package/dist/node_modules/tar/dist/esm/normalize-windows-path.js +9 -0
  127. package/dist/node_modules/tar/dist/esm/options.d.ts +596 -0
  128. package/dist/node_modules/tar/dist/esm/options.js +54 -0
  129. package/dist/node_modules/tar/dist/esm/pack.d.ts +105 -0
  130. package/dist/node_modules/tar/dist/esm/pack.js +503 -0
  131. package/dist/node_modules/tar/dist/esm/package.json +3 -0
  132. package/dist/node_modules/tar/dist/esm/parse.d.ts +85 -0
  133. package/dist/node_modules/tar/dist/esm/parse.js +606 -0
  134. package/dist/node_modules/tar/dist/esm/path-reservations.d.ts +11 -0
  135. package/dist/node_modules/tar/dist/esm/path-reservations.js +166 -0
  136. package/dist/node_modules/tar/dist/esm/pax.d.ts +26 -0
  137. package/dist/node_modules/tar/dist/esm/pax.js +154 -0
  138. package/dist/node_modules/tar/dist/esm/process-umask.d.ts +2 -0
  139. package/dist/node_modules/tar/dist/esm/process-umask.js +3 -0
  140. package/dist/node_modules/tar/dist/esm/read-entry.d.ts +36 -0
  141. package/dist/node_modules/tar/dist/esm/read-entry.js +132 -0
  142. package/dist/node_modules/tar/dist/esm/replace.d.ts +2 -0
  143. package/dist/node_modules/tar/dist/esm/replace.js +221 -0
  144. package/dist/node_modules/tar/dist/esm/strip-absolute-path.d.ts +2 -0
  145. package/dist/node_modules/tar/dist/esm/strip-absolute-path.js +25 -0
  146. package/dist/node_modules/tar/dist/esm/strip-trailing-slashes.d.ts +2 -0
  147. package/dist/node_modules/tar/dist/esm/strip-trailing-slashes.js +14 -0
  148. package/dist/node_modules/tar/dist/esm/symlink-error.d.ts +9 -0
  149. package/dist/node_modules/tar/dist/esm/symlink-error.js +15 -0
  150. package/dist/node_modules/tar/dist/esm/types.d.ts +7 -0
  151. package/dist/node_modules/tar/dist/esm/types.js +45 -0
  152. package/dist/node_modules/tar/dist/esm/unpack.d.ts +101 -0
  153. package/dist/node_modules/tar/dist/esm/unpack.js +891 -0
  154. package/dist/node_modules/tar/dist/esm/update.d.ts +2 -0
  155. package/dist/node_modules/tar/dist/esm/update.js +30 -0
  156. package/dist/node_modules/tar/dist/esm/warn-method.d.ts +24 -0
  157. package/dist/node_modules/tar/dist/esm/warn-method.js +27 -0
  158. package/dist/node_modules/tar/dist/esm/winchars.d.ts +3 -0
  159. package/dist/node_modules/tar/dist/esm/winchars.js +9 -0
  160. package/dist/node_modules/tar/dist/esm/write-entry.d.ts +129 -0
  161. package/dist/node_modules/tar/dist/esm/write-entry.js +656 -0
  162. package/dist/node_modules/tar/node_modules/chownr/dist/commonjs/index.d.ts +3 -0
  163. package/dist/node_modules/tar/node_modules/chownr/dist/commonjs/index.js +93 -0
  164. package/dist/node_modules/tar/node_modules/chownr/dist/commonjs/package.json +3 -0
  165. package/dist/node_modules/tar/node_modules/chownr/dist/esm/index.d.ts +3 -0
  166. package/dist/node_modules/tar/node_modules/chownr/dist/esm/index.js +85 -0
  167. package/dist/node_modules/tar/node_modules/chownr/dist/esm/package.json +3 -0
  168. package/dist/node_modules/tar/node_modules/chownr/package.json +69 -0
  169. package/dist/node_modules/tar/node_modules/minipass/dist/commonjs/index.d.ts +549 -0
  170. package/dist/node_modules/tar/node_modules/minipass/dist/commonjs/index.js +1028 -0
  171. package/dist/node_modules/tar/node_modules/minipass/dist/commonjs/package.json +3 -0
  172. package/dist/node_modules/tar/node_modules/minipass/dist/esm/index.d.ts +549 -0
  173. package/dist/node_modules/tar/node_modules/minipass/dist/esm/index.js +1018 -0
  174. package/dist/node_modules/tar/node_modules/minipass/dist/esm/package.json +3 -0
  175. package/dist/node_modules/tar/node_modules/minipass/package.json +82 -0
  176. package/dist/node_modules/tar/node_modules/minizlib/dist/commonjs/constants.d.ts +2 -0
  177. package/dist/node_modules/tar/node_modules/minizlib/dist/commonjs/constants.js +123 -0
  178. package/dist/node_modules/tar/node_modules/minizlib/dist/commonjs/index.d.ts +99 -0
  179. package/dist/node_modules/tar/node_modules/minizlib/dist/commonjs/index.js +416 -0
  180. package/dist/node_modules/tar/node_modules/minizlib/dist/commonjs/package.json +3 -0
  181. package/dist/node_modules/tar/node_modules/minizlib/dist/esm/constants.d.ts +2 -0
  182. package/dist/node_modules/tar/node_modules/minizlib/dist/esm/constants.js +117 -0
  183. package/dist/node_modules/tar/node_modules/minizlib/dist/esm/index.d.ts +99 -0
  184. package/dist/node_modules/tar/node_modules/minizlib/dist/esm/index.js +363 -0
  185. package/dist/node_modules/tar/node_modules/minizlib/dist/esm/package.json +3 -0
  186. package/dist/node_modules/tar/node_modules/minizlib/package.json +80 -0
  187. package/dist/node_modules/tar/node_modules/yallist/dist/commonjs/index.d.ts +39 -0
  188. package/dist/node_modules/tar/node_modules/yallist/dist/commonjs/index.js +384 -0
  189. package/dist/node_modules/tar/node_modules/yallist/dist/commonjs/package.json +3 -0
  190. package/dist/node_modules/tar/node_modules/yallist/dist/esm/index.d.ts +39 -0
  191. package/dist/node_modules/tar/node_modules/yallist/dist/esm/index.js +379 -0
  192. package/dist/node_modules/tar/node_modules/yallist/dist/esm/package.json +3 -0
  193. package/dist/node_modules/tar/node_modules/yallist/package.json +68 -0
  194. package/dist/node_modules/tar/package.json +1 -0
  195. package/dist/server/collections/desktopRoutes.d.ts +14 -0
  196. package/dist/server/collections/desktopRoutes.js +48 -0
  197. package/dist/server/collections/extendRoleField.d.ts +14 -0
  198. package/dist/server/collections/extendRoleField.js +51 -0
  199. package/dist/server/collections/multiPortals.d.ts +10 -0
  200. package/dist/server/collections/multiPortals.js +128 -0
  201. package/dist/server/collections/rolesMultiPortalDesktopRoutes.d.ts +10 -0
  202. package/dist/server/collections/rolesMultiPortalDesktopRoutes.js +76 -0
  203. package/dist/server/collections/rolesMultiPortalRoutePolicies.d.ts +10 -0
  204. package/dist/server/collections/rolesMultiPortalRoutePolicies.js +73 -0
  205. package/dist/server/collections/rolesMultiPortals.d.ts +10 -0
  206. package/dist/server/collections/rolesMultiPortals.js +68 -0
  207. package/dist/server/ensureDefaultRoleMultiPortalAccess.d.ts +11 -0
  208. package/dist/server/ensureDefaultRoleMultiPortalAccess.js +70 -0
  209. package/dist/server/index.d.ts +9 -0
  210. package/dist/server/index.js +42 -0
  211. package/dist/server/migrations/20260723105200-drop-ui-layout-foreign-key-constraint.d.ts +13 -0
  212. package/dist/server/migrations/20260723105200-drop-ui-layout-foreign-key-constraint.js +104 -0
  213. package/dist/server/plugin.d.ts +63 -0
  214. package/dist/server/plugin.js +2130 -0
  215. package/package.json +34 -0
  216. package/server.d.ts +2 -0
  217. package/server.js +1 -0
@@ -0,0 +1,49 @@
1
+ import type { TarOptions, TarOptionsAsyncFile, TarOptionsAsyncNoFile, TarOptionsSyncFile, TarOptionsSyncNoFile, TarOptionsWithAliases, TarOptionsWithAliasesAsync, TarOptionsWithAliasesAsyncFile, TarOptionsWithAliasesAsyncNoFile, TarOptionsWithAliasesFile, TarOptionsWithAliasesNoFile, TarOptionsWithAliasesSync, TarOptionsWithAliasesSyncFile, TarOptionsWithAliasesSyncNoFile } from './options.js';
2
+ export type CB = (er?: Error) => unknown;
3
+ export type TarCommand<AsyncClass, SyncClass extends {
4
+ sync: true;
5
+ }> = {
6
+ (): AsyncClass;
7
+ (opt: TarOptionsWithAliasesAsyncNoFile): AsyncClass;
8
+ (entries: string[]): AsyncClass;
9
+ (opt: TarOptionsWithAliasesAsyncNoFile, entries: string[]): AsyncClass;
10
+ } & {
11
+ (opt: TarOptionsWithAliasesSyncNoFile): SyncClass;
12
+ (opt: TarOptionsWithAliasesSyncNoFile, entries: string[]): SyncClass;
13
+ } & {
14
+ (opt: TarOptionsWithAliasesAsyncFile): Promise<void>;
15
+ (opt: TarOptionsWithAliasesAsyncFile, entries: string[]): Promise<void>;
16
+ (opt: TarOptionsWithAliasesAsyncFile, cb: CB): Promise<void>;
17
+ (opt: TarOptionsWithAliasesAsyncFile, entries: string[], cb: CB): Promise<void>;
18
+ } & {
19
+ (opt: TarOptionsWithAliasesSyncFile): void;
20
+ (opt: TarOptionsWithAliasesSyncFile, entries: string[]): void;
21
+ } & {
22
+ (opt: TarOptionsWithAliasesSync): typeof opt extends (TarOptionsWithAliasesFile) ? void : typeof opt extends TarOptionsWithAliasesNoFile ? SyncClass : void | SyncClass;
23
+ (opt: TarOptionsWithAliasesSync, entries: string[]): typeof opt extends TarOptionsWithAliasesFile ? void : typeof opt extends TarOptionsWithAliasesNoFile ? SyncClass : void | SyncClass;
24
+ } & {
25
+ (opt: TarOptionsWithAliasesAsync): typeof opt extends (TarOptionsWithAliasesFile) ? Promise<void> : typeof opt extends TarOptionsWithAliasesNoFile ? AsyncClass : Promise<void> | AsyncClass;
26
+ (opt: TarOptionsWithAliasesAsync, entries: string[]): typeof opt extends TarOptionsWithAliasesFile ? Promise<void> : typeof opt extends TarOptionsWithAliasesNoFile ? AsyncClass : Promise<void> | AsyncClass;
27
+ (opt: TarOptionsWithAliasesAsync, cb: CB): Promise<void>;
28
+ (opt: TarOptionsWithAliasesAsync, entries: string[], cb: CB): typeof opt extends TarOptionsWithAliasesFile ? Promise<void> : typeof opt extends TarOptionsWithAliasesNoFile ? never : Promise<void>;
29
+ } & {
30
+ (opt: TarOptionsWithAliasesFile): Promise<void> | void;
31
+ (opt: TarOptionsWithAliasesFile, entries: string[]): typeof opt extends TarOptionsWithAliasesSync ? void : typeof opt extends TarOptionsWithAliasesAsync ? Promise<void> : Promise<void> | void;
32
+ (opt: TarOptionsWithAliasesFile, cb: CB): Promise<void>;
33
+ (opt: TarOptionsWithAliasesFile, entries: string[], cb: CB): typeof opt extends TarOptionsWithAliasesSync ? never : typeof opt extends TarOptionsWithAliasesAsync ? Promise<void> : Promise<void>;
34
+ } & {
35
+ (opt: TarOptionsWithAliasesNoFile): typeof opt extends (TarOptionsWithAliasesSync) ? SyncClass : typeof opt extends TarOptionsWithAliasesAsync ? AsyncClass : SyncClass | AsyncClass;
36
+ (opt: TarOptionsWithAliasesNoFile, entries: string[]): typeof opt extends TarOptionsWithAliasesSync ? SyncClass : typeof opt extends TarOptionsWithAliasesAsync ? AsyncClass : SyncClass | AsyncClass;
37
+ } & {
38
+ (opt: TarOptionsWithAliases): typeof opt extends (TarOptionsWithAliasesFile) ? typeof opt extends TarOptionsWithAliasesSync ? void : typeof opt extends TarOptionsWithAliasesAsync ? Promise<void> : void | Promise<void> : typeof opt extends TarOptionsWithAliasesNoFile ? typeof opt extends TarOptionsWithAliasesSync ? SyncClass : typeof opt extends TarOptionsWithAliasesAsync ? AsyncClass : SyncClass | AsyncClass : typeof opt extends TarOptionsWithAliasesSync ? SyncClass | void : typeof opt extends TarOptionsWithAliasesAsync ? AsyncClass | Promise<void> : SyncClass | void | AsyncClass | Promise<void>;
39
+ } & {
40
+ syncFile: (opt: TarOptionsSyncFile, entries: string[]) => void;
41
+ asyncFile: (opt: TarOptionsAsyncFile, entries: string[], cb?: CB) => Promise<void>;
42
+ syncNoFile: (opt: TarOptionsSyncNoFile, entries: string[]) => SyncClass;
43
+ asyncNoFile: (opt: TarOptionsAsyncNoFile, entries: string[]) => AsyncClass;
44
+ validate?: (opt: TarOptions, entries?: string[]) => void;
45
+ };
46
+ export declare const makeCommand: <AsyncClass, SyncClass extends {
47
+ sync: true;
48
+ }>(syncFile: (opt: TarOptionsSyncFile, entries: string[]) => void, asyncFile: (opt: TarOptionsAsyncFile, entries: string[], cb?: CB) => Promise<void>, syncNoFile: (opt: TarOptionsSyncNoFile, entries: string[]) => SyncClass, asyncNoFile: (opt: TarOptionsAsyncNoFile, entries: string[]) => AsyncClass, validate?: (opt: TarOptions, entries?: string[]) => void) => TarCommand<AsyncClass, SyncClass>;
49
+ //# sourceMappingURL=make-command.d.ts.map
@@ -0,0 +1,52 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.makeCommand = void 0;
4
+ const options_js_1 = require("./options.js");
5
+ const makeCommand = (syncFile, asyncFile, syncNoFile, asyncNoFile, validate) => {
6
+ return Object.assign((opt_ = [], entries, cb) => {
7
+ if (Array.isArray(opt_)) {
8
+ entries = opt_;
9
+ opt_ = {};
10
+ }
11
+ if (typeof entries === 'function') {
12
+ cb = entries;
13
+ entries = undefined;
14
+ }
15
+ entries = !entries ? [] : Array.from(entries);
16
+ const opt = (0, options_js_1.dealias)(opt_);
17
+ validate?.(opt, entries);
18
+ if ((0, options_js_1.isSyncFile)(opt)) {
19
+ if (typeof cb === 'function') {
20
+ throw new TypeError('callback not supported for sync tar functions');
21
+ }
22
+ return syncFile(opt, entries);
23
+ }
24
+ else if ((0, options_js_1.isAsyncFile)(opt)) {
25
+ const p = asyncFile(opt, entries);
26
+ return cb ? p.then(() => cb(), cb) : p;
27
+ }
28
+ else if ((0, options_js_1.isSyncNoFile)(opt)) {
29
+ if (typeof cb === 'function') {
30
+ throw new TypeError('callback not supported for sync tar functions');
31
+ }
32
+ return syncNoFile(opt, entries);
33
+ }
34
+ else if ((0, options_js_1.isAsyncNoFile)(opt)) {
35
+ if (typeof cb === 'function') {
36
+ throw new TypeError('callback only supported with file option');
37
+ }
38
+ return asyncNoFile(opt, entries);
39
+ /* c8 ignore start */
40
+ }
41
+ throw new Error('impossible options??');
42
+ /* c8 ignore stop */
43
+ }, {
44
+ syncFile,
45
+ asyncFile,
46
+ syncNoFile,
47
+ asyncNoFile,
48
+ validate,
49
+ });
50
+ };
51
+ exports.makeCommand = makeCommand;
52
+ //# sourceMappingURL=make-command.js.map
@@ -0,0 +1,25 @@
1
+ import { CwdError } from './cwd-error.js';
2
+ import { SymlinkError } from './symlink-error.js';
3
+ export type MkdirOptions = {
4
+ uid?: number;
5
+ gid?: number;
6
+ processUid?: number;
7
+ processGid?: number;
8
+ umask?: number;
9
+ preserve: boolean;
10
+ unlink: boolean;
11
+ cwd: string;
12
+ mode: number;
13
+ };
14
+ export type MkdirError = NodeJS.ErrnoException | CwdError | SymlinkError;
15
+ /**
16
+ * Wrapper around fs/promises.mkdir for tar's needs.
17
+ *
18
+ * The main purpose is to avoid creating directories if we know that
19
+ * they already exist (and track which ones exist for this purpose),
20
+ * and prevent entries from being extracted into symlinked folders,
21
+ * if `preservePaths` is not set.
22
+ */
23
+ export declare const mkdir: (dir: string, opt: MkdirOptions, cb: (er?: null | MkdirError, made?: string) => void) => void | Promise<void>;
24
+ export declare const mkdirSync: (dir: string, opt: MkdirOptions) => void | SymlinkError;
25
+ //# sourceMappingURL=mkdir.d.ts.map
@@ -0,0 +1,187 @@
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.mkdirSync = exports.mkdir = void 0;
7
+ const chownr_1 = require("chownr");
8
+ const node_fs_1 = __importDefault(require("node:fs"));
9
+ const promises_1 = __importDefault(require("node:fs/promises"));
10
+ const node_path_1 = __importDefault(require("node:path"));
11
+ const cwd_error_js_1 = require("./cwd-error.js");
12
+ const normalize_windows_path_js_1 = require("./normalize-windows-path.js");
13
+ const symlink_error_js_1 = require("./symlink-error.js");
14
+ const checkCwd = (dir, cb) => {
15
+ node_fs_1.default.stat(dir, (er, st) => {
16
+ if (er || !st.isDirectory()) {
17
+ er = new cwd_error_js_1.CwdError(dir, er?.code || 'ENOTDIR');
18
+ }
19
+ cb(er);
20
+ });
21
+ };
22
+ /**
23
+ * Wrapper around fs/promises.mkdir for tar's needs.
24
+ *
25
+ * The main purpose is to avoid creating directories if we know that
26
+ * they already exist (and track which ones exist for this purpose),
27
+ * and prevent entries from being extracted into symlinked folders,
28
+ * if `preservePaths` is not set.
29
+ */
30
+ const mkdir = (dir, opt, cb) => {
31
+ dir = (0, normalize_windows_path_js_1.normalizeWindowsPath)(dir);
32
+ // if there's any overlap between mask and mode,
33
+ // then we'll need an explicit chmod
34
+ /* c8 ignore next */
35
+ const umask = opt.umask ?? 0o22;
36
+ const mode = opt.mode | 0o0700;
37
+ const needChmod = (mode & umask) !== 0;
38
+ const uid = opt.uid;
39
+ const gid = opt.gid;
40
+ const doChown = typeof uid === 'number' &&
41
+ typeof gid === 'number' &&
42
+ (uid !== opt.processUid || gid !== opt.processGid);
43
+ const preserve = opt.preserve;
44
+ const unlink = opt.unlink;
45
+ const cwd = (0, normalize_windows_path_js_1.normalizeWindowsPath)(opt.cwd);
46
+ const done = (er, created) => {
47
+ if (er) {
48
+ cb(er);
49
+ }
50
+ else {
51
+ if (created && doChown) {
52
+ (0, chownr_1.chownr)(created, uid, gid, er => done(er));
53
+ }
54
+ else if (needChmod) {
55
+ node_fs_1.default.chmod(dir, mode, cb);
56
+ }
57
+ else {
58
+ cb();
59
+ }
60
+ }
61
+ };
62
+ if (dir === cwd) {
63
+ return checkCwd(dir, done);
64
+ }
65
+ if (preserve) {
66
+ return promises_1.default.mkdir(dir, { mode, recursive: true }).then(made => done(null, made ?? undefined), // oh, ts
67
+ done);
68
+ }
69
+ const sub = (0, normalize_windows_path_js_1.normalizeWindowsPath)(node_path_1.default.relative(cwd, dir));
70
+ const parts = sub.split('/');
71
+ mkdir_(cwd, parts, mode, unlink, cwd, undefined, done);
72
+ };
73
+ exports.mkdir = mkdir;
74
+ const mkdir_ = (base, parts, mode, unlink, cwd, created, cb) => {
75
+ if (parts.length === 0) {
76
+ return cb(null, created);
77
+ }
78
+ const p = parts.shift();
79
+ const part = (0, normalize_windows_path_js_1.normalizeWindowsPath)(node_path_1.default.resolve(base + '/' + p));
80
+ node_fs_1.default.mkdir(part, mode, onmkdir(part, parts, mode, unlink, cwd, created, cb));
81
+ };
82
+ const onmkdir = (part, parts, mode, unlink, cwd, created, cb) => (er) => {
83
+ if (er) {
84
+ node_fs_1.default.lstat(part, (statEr, st) => {
85
+ if (statEr) {
86
+ statEr.path = statEr.path && (0, normalize_windows_path_js_1.normalizeWindowsPath)(statEr.path);
87
+ cb(statEr);
88
+ }
89
+ else if (st.isDirectory()) {
90
+ mkdir_(part, parts, mode, unlink, cwd, created, cb);
91
+ }
92
+ else if (unlink) {
93
+ node_fs_1.default.unlink(part, er => {
94
+ if (er) {
95
+ return cb(er);
96
+ }
97
+ node_fs_1.default.mkdir(part, mode, onmkdir(part, parts, mode, unlink, cwd, created, cb));
98
+ });
99
+ }
100
+ else if (st.isSymbolicLink()) {
101
+ return cb(new symlink_error_js_1.SymlinkError(part, part + '/' + parts.join('/')));
102
+ }
103
+ else {
104
+ cb(er);
105
+ }
106
+ });
107
+ }
108
+ else {
109
+ created = created || part;
110
+ mkdir_(part, parts, mode, unlink, cwd, created, cb);
111
+ }
112
+ };
113
+ const checkCwdSync = (dir) => {
114
+ let ok = false;
115
+ let code;
116
+ try {
117
+ ok = node_fs_1.default.statSync(dir).isDirectory();
118
+ }
119
+ catch (er) {
120
+ code = er?.code;
121
+ }
122
+ finally {
123
+ if (!ok) {
124
+ throw new cwd_error_js_1.CwdError(dir, code ?? 'ENOTDIR');
125
+ }
126
+ }
127
+ };
128
+ const mkdirSync = (dir, opt) => {
129
+ dir = (0, normalize_windows_path_js_1.normalizeWindowsPath)(dir);
130
+ // if there's any overlap between mask and mode,
131
+ // then we'll need an explicit chmod
132
+ /* c8 ignore next */
133
+ const umask = opt.umask ?? 0o22;
134
+ const mode = opt.mode | 0o700;
135
+ const needChmod = (mode & umask) !== 0;
136
+ const uid = opt.uid;
137
+ const gid = opt.gid;
138
+ const doChown = typeof uid === 'number' &&
139
+ typeof gid === 'number' &&
140
+ (uid !== opt.processUid || gid !== opt.processGid);
141
+ const preserve = opt.preserve;
142
+ const unlink = opt.unlink;
143
+ const cwd = (0, normalize_windows_path_js_1.normalizeWindowsPath)(opt.cwd);
144
+ const done = (created) => {
145
+ if (created && doChown) {
146
+ (0, chownr_1.chownrSync)(created, uid, gid);
147
+ }
148
+ if (needChmod) {
149
+ node_fs_1.default.chmodSync(dir, mode);
150
+ }
151
+ };
152
+ if (dir === cwd) {
153
+ checkCwdSync(cwd);
154
+ return done();
155
+ }
156
+ if (preserve) {
157
+ return done(node_fs_1.default.mkdirSync(dir, { mode, recursive: true }) ?? undefined);
158
+ }
159
+ const sub = (0, normalize_windows_path_js_1.normalizeWindowsPath)(node_path_1.default.relative(cwd, dir));
160
+ const parts = sub.split('/');
161
+ let created;
162
+ for (let p = parts.shift(), part = cwd; p && (part += '/' + p); p = parts.shift()) {
163
+ part = (0, normalize_windows_path_js_1.normalizeWindowsPath)(node_path_1.default.resolve(part));
164
+ try {
165
+ node_fs_1.default.mkdirSync(part, mode);
166
+ created = created || part;
167
+ }
168
+ catch {
169
+ const st = node_fs_1.default.lstatSync(part);
170
+ if (st.isDirectory()) {
171
+ continue;
172
+ }
173
+ else if (unlink) {
174
+ node_fs_1.default.unlinkSync(part);
175
+ node_fs_1.default.mkdirSync(part, mode);
176
+ created = created || part;
177
+ continue;
178
+ }
179
+ else if (st.isSymbolicLink()) {
180
+ return new symlink_error_js_1.SymlinkError(part, part + '/' + parts.join('/'));
181
+ }
182
+ }
183
+ }
184
+ return done(created);
185
+ };
186
+ exports.mkdirSync = mkdirSync;
187
+ //# sourceMappingURL=mkdir.js.map
@@ -0,0 +1,2 @@
1
+ export declare const modeFix: (mode: number, isDir: boolean, portable: boolean) => number;
2
+ //# sourceMappingURL=mode-fix.d.ts.map
@@ -0,0 +1,29 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.modeFix = void 0;
4
+ const modeFix = (mode, isDir, portable) => {
5
+ mode &= 0o7777;
6
+ // in portable mode, use the minimum reasonable umask
7
+ // if this system creates files with 0o664 by default
8
+ // (as some linux distros do), then we'll write the
9
+ // archive with 0o644 instead. Also, don't ever create
10
+ // a file that is not readable/writable by the owner.
11
+ if (portable) {
12
+ mode = (mode | 0o600) & ~0o22;
13
+ }
14
+ // if dirs are readable, then they should be listable
15
+ if (isDir) {
16
+ if (mode & 0o400) {
17
+ mode |= 0o100;
18
+ }
19
+ if (mode & 0o40) {
20
+ mode |= 0o10;
21
+ }
22
+ if (mode & 0o4) {
23
+ mode |= 0o1;
24
+ }
25
+ }
26
+ return mode;
27
+ };
28
+ exports.modeFix = modeFix;
29
+ //# sourceMappingURL=mode-fix.js.map
@@ -0,0 +1,2 @@
1
+ export declare const normalizeUnicode: (s: string) => string;
2
+ //# sourceMappingURL=normalize-unicode.d.ts.map
@@ -0,0 +1,38 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.normalizeUnicode = void 0;
4
+ // warning: extremely hot code path.
5
+ // This has been meticulously optimized for use
6
+ // within npm install on large package trees.
7
+ // Do not edit without careful benchmarking.
8
+ const normalizeCache = Object.create(null);
9
+ // Limit the size of this. Very low-sophistication LRU cache
10
+ const MAX = 10000;
11
+ const cache = new Set();
12
+ const normalizeUnicode = (s) => {
13
+ if (!cache.has(s)) {
14
+ // shake out identical accents and ligatures
15
+ normalizeCache[s] = s
16
+ .normalize('NFD')
17
+ .toLocaleLowerCase('en')
18
+ .toLocaleUpperCase('en');
19
+ }
20
+ else {
21
+ cache.delete(s);
22
+ }
23
+ cache.add(s);
24
+ const ret = normalizeCache[s];
25
+ let i = cache.size - MAX;
26
+ // only prune when we're 10% over the max
27
+ if (i > MAX / 10) {
28
+ for (const s of cache) {
29
+ cache.delete(s);
30
+ delete normalizeCache[s];
31
+ if (--i <= 0)
32
+ break;
33
+ }
34
+ }
35
+ return ret;
36
+ };
37
+ exports.normalizeUnicode = normalizeUnicode;
38
+ //# sourceMappingURL=normalize-unicode.js.map
@@ -0,0 +1,2 @@
1
+ export declare const normalizeWindowsPath: (p: string) => string;
2
+ //# sourceMappingURL=normalize-windows-path.d.ts.map
@@ -0,0 +1,12 @@
1
+ "use strict";
2
+ // on windows, either \ or / are valid directory separators.
3
+ // on unix, \ is a valid character in filenames.
4
+ // so, on windows, and only on windows, we replace all \ chars with /,
5
+ // so that we can use / as our one and only directory separator char.
6
+ Object.defineProperty(exports, "__esModule", { value: true });
7
+ exports.normalizeWindowsPath = void 0;
8
+ const platform = process.env.TESTING_TAR_FAKE_PLATFORM || process.platform;
9
+ exports.normalizeWindowsPath = platform !== 'win32' ?
10
+ (p) => p
11
+ : (p) => p && p.replaceAll(/\\/g, '/');
12
+ //# sourceMappingURL=normalize-windows-path.js.map