@cyberskill/shared 1.100.0 → 1.102.0

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 (77) hide show
  1. package/dist/_tsup-dts-rollup.d.cts +110 -47
  2. package/dist/_tsup-dts-rollup.d.ts +110 -47
  3. package/dist/configs/config.util.cjs +1 -1
  4. package/dist/configs/config.util.js +1 -1
  5. package/dist/configs/index.cjs +1 -1
  6. package/dist/configs/index.js +1 -1
  7. package/dist/index.cjs +1 -1
  8. package/dist/index.d.cts +16 -7
  9. package/dist/index.d.ts +16 -7
  10. package/dist/index.js +1 -1
  11. package/dist/nodejs/cli/cli.util.cjs +1 -1
  12. package/dist/nodejs/cli/cli.util.js +1 -1
  13. package/dist/nodejs/cli/index.cjs +1 -1
  14. package/dist/nodejs/cli/index.js +1 -1
  15. package/dist/nodejs/command/command.type.cjs +1 -1
  16. package/dist/nodejs/command/command.type.js +1 -1
  17. package/dist/nodejs/command/command.util.cjs +1 -1
  18. package/dist/nodejs/command/command.util.js +1 -1
  19. package/dist/nodejs/command/index.cjs +1 -1
  20. package/dist/nodejs/command/index.js +1 -1
  21. package/dist/nodejs/express/express.type.cjs +1 -1
  22. package/dist/nodejs/express/express.type.js +1 -1
  23. package/dist/nodejs/express/index.cjs +1 -1
  24. package/dist/nodejs/express/index.js +1 -1
  25. package/dist/nodejs/fs/fs.type.cjs +1 -0
  26. package/dist/nodejs/fs/fs.type.d.cts +1 -0
  27. package/dist/nodejs/fs/fs.type.d.ts +1 -0
  28. package/dist/nodejs/fs/fs.type.js +0 -0
  29. package/dist/nodejs/fs/fs.util.cjs +1 -1
  30. package/dist/nodejs/fs/fs.util.d.cts +8 -1
  31. package/dist/nodejs/fs/fs.util.d.ts +8 -1
  32. package/dist/nodejs/fs/fs.util.js +1 -1
  33. package/dist/nodejs/fs/index.cjs +1 -1
  34. package/dist/nodejs/fs/index.d.cts +9 -1
  35. package/dist/nodejs/fs/index.d.ts +9 -1
  36. package/dist/nodejs/fs/index.js +1 -1
  37. package/dist/nodejs/index.cjs +1 -1
  38. package/dist/nodejs/index.d.cts +16 -7
  39. package/dist/nodejs/index.d.ts +16 -7
  40. package/dist/nodejs/index.js +1 -1
  41. package/dist/nodejs/mongo/index.cjs +1 -1
  42. package/dist/nodejs/mongo/index.d.cts +7 -6
  43. package/dist/nodejs/mongo/index.d.ts +7 -6
  44. package/dist/nodejs/mongo/index.js +1 -1
  45. package/dist/nodejs/mongo/mongo.constant.cjs +1 -0
  46. package/dist/nodejs/mongo/mongo.constant.d.cts +1 -0
  47. package/dist/nodejs/mongo/mongo.constant.d.ts +1 -0
  48. package/dist/nodejs/mongo/mongo.constant.js +1 -0
  49. package/dist/nodejs/mongo/mongo.type.d.cts +1 -0
  50. package/dist/nodejs/mongo/mongo.type.d.ts +1 -0
  51. package/dist/nodejs/mongo/mongo.util.cjs +1 -0
  52. package/dist/nodejs/mongo/mongo.util.js +1 -0
  53. package/dist/nodejs/package/index.cjs +1 -1
  54. package/dist/nodejs/package/index.js +1 -1
  55. package/dist/nodejs/package/package.util.cjs +1 -1
  56. package/dist/nodejs/package/package.util.js +1 -1
  57. package/dist/nodejs/path/index.cjs +1 -1
  58. package/dist/nodejs/path/index.js +1 -1
  59. package/dist/nodejs/path/path.constant.cjs +1 -1
  60. package/dist/nodejs/path/path.constant.js +1 -1
  61. package/dist/nodejs/path/path.util.cjs +1 -1
  62. package/dist/nodejs/path/path.util.js +1 -1
  63. package/dist/react/index.cjs +1 -1
  64. package/dist/react/index.js +1 -1
  65. package/dist/react/vitest/index.cjs +1 -1
  66. package/dist/react/vitest/index.js +1 -1
  67. package/dist/react/vitest/vitest.unit.cjs +1 -1
  68. package/dist/react/vitest/vitest.unit.js +1 -1
  69. package/package.json +7 -4
  70. package/dist/nodejs/mongo/migrate.util.cjs +0 -1
  71. package/dist/nodejs/mongo/migrate.util.d.cts +0 -1
  72. package/dist/nodejs/mongo/migrate.util.d.ts +0 -1
  73. package/dist/nodejs/mongo/migrate.util.js +0 -1
  74. package/dist/nodejs/mongo/mongo.cjs +0 -1
  75. package/dist/nodejs/mongo/mongo.js +0 -1
  76. /package/dist/nodejs/mongo/{mongo.d.cts → mongo.util.d.cts} +0 -0
  77. /package/dist/nodejs/mongo/{mongo.d.ts → mongo.util.d.ts} +0 -0
@@ -13,9 +13,9 @@ import type { ClientSession } from 'mongoose';
13
13
  import type { CodegenConfig } from '@graphql-codegen/cli';
14
14
  import { Collection } from 'mongodb';
15
15
  import type { ComponentType } from 'react';
16
- import { config } from 'migrate-mongo';
17
16
  import type consola from 'consola';
18
17
  import { Context } from 'react';
18
+ import type { CopySyncOptions } from 'node:fs';
19
19
  import cors from 'cors';
20
20
  import { Db } from 'mongodb';
21
21
  import type { DeleteResult } from 'mongodb';
@@ -27,6 +27,7 @@ import express from 'express';
27
27
  import { expressMiddleware } from '@apollo/server/express4';
28
28
  import type { Filter } from 'mongodb';
29
29
  import type { FilterQuery } from 'mongoose';
30
+ import fsExtra from 'fs-extra';
30
31
  import type { GraphQLSchema } from 'graphql';
31
32
  import { I_ApolloErrorContext as I_ApolloErrorContext_2 } from './apollo-error.type.js';
32
33
  import { I_Command as I_Command_2 } from './command.type.js';
@@ -38,6 +39,7 @@ import type { InsertOneResult } from 'mongodb';
38
39
  import type { JSX } from 'react';
39
40
  import { Locale } from 'date-fns/locale';
40
41
  import type { Locale as Locale_2 } from 'date-fns';
42
+ import migrate from 'migrate-mongo';
41
43
  import { Model } from 'mongoose';
42
44
  import type mongoose from 'mongoose';
43
45
  import mongoosePaginate from 'mongoose-paginate-v2';
@@ -127,9 +129,7 @@ export { ApolloProvider as ApolloProvider_alias_1 }
127
129
  export { ApolloProvider as ApolloProvider_alias_2 }
128
130
  export { ApolloProvider as ApolloProvider_alias_3 }
129
131
 
130
- declare function appendFileSync(filePath: string, data: string | T_Object_2, options?: {
131
- isJson?: boolean;
132
- }): void;
132
+ declare const appendFileSync: typeof fsExtra.appendFileSync;
133
133
  export { appendFileSync }
134
134
  export { appendFileSync as appendFileSync_alias_1 }
135
135
  export { appendFileSync as appendFileSync_alias_2 }
@@ -190,25 +190,25 @@ export { clearAllErrorLists as clearAllErrorLists_alias_2 }
190
190
  export { clearAllErrorLists as clearAllErrorLists_alias_3 }
191
191
 
192
192
  declare const command: {
193
- simpleGitHooks: () => Promise<string>;
194
- eslintInspect: () => Promise<string>;
195
- nodeModulesInspect: () => Promise<string>;
196
- eslintCheck: () => Promise<string>;
197
- eslintFix: () => Promise<string>;
198
- typescriptCheck: () => Promise<string>;
199
- configureGitHook: () => Promise<string>;
200
- testUnit: () => Promise<string>;
201
- testE2e: () => Promise<string>;
202
- mongoMigrateCreate: (migrateName: string) => Promise<string>;
203
- mongoMigrateUp: () => Promise<string>;
204
- mongoMigrateDown: () => Promise<string>;
205
- commitLint: () => Promise<string>;
206
- lintStaged: () => Promise<string>;
207
- stageBuildDirectory: () => Promise<string>;
208
- build: () => Promise<string>;
209
- pnpmInstallStandard: () => Promise<string>;
210
- pnpmInstallLegacy: () => Promise<string>;
211
- pnpmInstallForce: () => Promise<string>;
193
+ simpleGitHooks: () => Promise<string | void>;
194
+ eslintInspect: () => Promise<string | void>;
195
+ nodeModulesInspect: () => Promise<string | void>;
196
+ eslintCheck: () => Promise<string | void>;
197
+ eslintFix: () => Promise<string | void>;
198
+ typescriptCheck: () => Promise<string | void>;
199
+ configureGitHook: () => Promise<string | void>;
200
+ testUnit: () => Promise<string | void>;
201
+ testE2e: () => Promise<string | void>;
202
+ mongoMigrateCreate: (migrateName: string) => Promise<string | void>;
203
+ mongoMigrateUp: () => Promise<string | void>;
204
+ mongoMigrateDown: () => Promise<string | void>;
205
+ commitLint: () => Promise<string | void>;
206
+ lintStaged: () => Promise<string | void>;
207
+ stageBuildDirectory: () => Promise<string | void>;
208
+ build: () => Promise<string | void>;
209
+ pnpmInstallStandard: () => Promise<string | void>;
210
+ pnpmInstallLegacy: () => Promise<string | void>;
211
+ pnpmInstallForce: () => Promise<string | void>;
212
212
  };
213
213
  export { command }
214
214
  export { command as command_alias_1 }
@@ -227,6 +227,18 @@ export { COMMIT_LINT_PACKAGE_NAME as COMMIT_LINT_PACKAGE_NAME_alias_1 }
227
227
  export { COMMIT_LINT_PACKAGE_NAME as COMMIT_LINT_PACKAGE_NAME_alias_2 }
228
228
  export { COMMIT_LINT_PACKAGE_NAME as COMMIT_LINT_PACKAGE_NAME_alias_3 }
229
229
 
230
+ declare function copySync(src: string, dest: string, options?: I_CopySyncOptions): void;
231
+ export { copySync }
232
+ export { copySync as copySync_alias_1 }
233
+ export { copySync as copySync_alias_2 }
234
+ export { copySync as copySync_alias_3 }
235
+
236
+ declare const copySyncE: typeof fsExtra.copySync;
237
+ export { copySyncE }
238
+ export { copySyncE as copySyncE_alias_1 }
239
+ export { copySyncE as copySyncE_alias_2 }
240
+ export { copySyncE as copySyncE_alias_3 }
241
+
230
242
  declare function createApolloServer(options: I_ApolloServerOptions): ApolloServer;
231
243
  export { createApolloServer }
232
244
  export { createApolloServer as createApolloServer_alias_1 }
@@ -1467,7 +1479,8 @@ export { _default_3 as lintStagedConfig_alias_1 }
1467
1479
 
1468
1480
  declare enum E_CommandType {
1469
1481
  CLI = "CLI",
1470
- RAW = "RAW"
1482
+ STRING = "STRING",
1483
+ FUNCTION = "FUNCTION"
1471
1484
  }
1472
1485
  export { E_CommandType }
1473
1486
  export { E_CommandType as E_CommandType_alias_1 }
@@ -1705,6 +1718,14 @@ export { I_CommandContext as I_CommandContext_alias_1 }
1705
1718
  export { I_CommandContext as I_CommandContext_alias_2 }
1706
1719
  export { I_CommandContext as I_CommandContext_alias_3 }
1707
1720
 
1721
+ declare interface I_CopySyncOptions extends CopySyncOptions {
1722
+ extensions?: string[];
1723
+ }
1724
+ export { I_CopySyncOptions }
1725
+ export { I_CopySyncOptions as I_CopySyncOptions_alias_1 }
1726
+ export { I_CopySyncOptions as I_CopySyncOptions_alias_2 }
1727
+ export { I_CopySyncOptions as I_CopySyncOptions_alias_3 }
1728
+
1708
1729
  declare interface I_CorsOptions {
1709
1730
  isDev?: boolean;
1710
1731
  whiteList?: string[];
@@ -1999,6 +2020,11 @@ export { I_Log_NodeJS as I_Log_NodeJS_alias_1 }
1999
2020
  export { I_Log_NodeJS as I_Log_NodeJS_alias_2 }
2000
2021
  export { I_Log_NodeJS as I_Log_NodeJS_alias_3 }
2001
2022
 
2023
+ declare interface I_MongoMigrateRawContext {
2024
+ db: mongoose.mongo.Db;
2025
+ client: mongoose.mongo.MongoClient;
2026
+ }
2027
+
2002
2028
  declare interface I_MongooseModelMiddleware<T extends Partial<C_Document>> {
2003
2029
  method: T_MongooseMiddlewareMethod;
2004
2030
  pre?: T_MongooseMiddlewarePreFunction<T & T_QueryWithHelpers<T>>;
@@ -2270,12 +2296,27 @@ declare const mongo: {
2270
2296
  }>(fields: string[]): (this: T, value: unknown) => Promise<boolean>;
2271
2297
  matchesRegex(regexArray: RegExp[]): (value: string) => Promise<boolean>;
2272
2298
  };
2299
+ migrate: {
2300
+ withConfig: <T, NeedDb extends boolean = false>(callback: (ctx: T_MongoMigrateContext<NeedDb>) => Promise<T>, needDb?: NeedDb) => Promise<T>;
2301
+ init: () => Promise<void>;
2302
+ create: (name: string) => Promise<void>;
2303
+ up: () => Promise<void>;
2304
+ down: () => Promise<void>;
2305
+ status: () => Promise<void>;
2306
+ config: (options: Partial<migrate.config.Config>) => void;
2307
+ };
2273
2308
  };
2274
2309
  export { mongo }
2275
2310
  export { mongo as mongo_alias_1 }
2276
2311
  export { mongo as mongo_alias_2 }
2277
2312
  export { mongo as mongo_alias_3 }
2278
2313
 
2314
+ declare const MONGO_MIGRATE_OPTIONS = "MONGO_MIGRATE_OPTIONS";
2315
+ export { MONGO_MIGRATE_OPTIONS }
2316
+ export { MONGO_MIGRATE_OPTIONS as MONGO_MIGRATE_OPTIONS_alias_1 }
2317
+ export { MONGO_MIGRATE_OPTIONS as MONGO_MIGRATE_OPTIONS_alias_2 }
2318
+ export { MONGO_MIGRATE_OPTIONS as MONGO_MIGRATE_OPTIONS_alias_3 }
2319
+
2279
2320
  declare class MongoController<D extends Partial<C_Document>> {
2280
2321
  private collection;
2281
2322
  constructor(db: C_Db, collectionName: string);
@@ -2448,6 +2489,12 @@ export { PATH as PATH_alias_1 }
2448
2489
  export { PATH as PATH_alias_2 }
2449
2490
  export { PATH as PATH_alias_3 }
2450
2491
 
2492
+ declare const pathExistsSync: typeof fsExtra.pathExistsSync;
2493
+ export { pathExistsSync }
2494
+ export { pathExistsSync as pathExistsSync_alias_1 }
2495
+ export { pathExistsSync as pathExistsSync_alias_2 }
2496
+ export { pathExistsSync as pathExistsSync_alias_3 }
2497
+
2451
2498
  declare const PLAYWRIGHT_PACKAGE_NAME = "playwright";
2452
2499
  export { PLAYWRIGHT_PACKAGE_NAME }
2453
2500
  export { PLAYWRIGHT_PACKAGE_NAME as PLAYWRIGHT_PACKAGE_NAME_alias_1 }
@@ -2481,18 +2528,18 @@ export { rawCommand as rawCommand_alias_1 }
2481
2528
  export { rawCommand as rawCommand_alias_2 }
2482
2529
  export { rawCommand as rawCommand_alias_3 }
2483
2530
 
2484
- declare function readFileSync(filePath: string, options: {
2485
- asJson: true;
2486
- }): T_Object_2;
2487
-
2488
- declare function readFileSync(filePath: string, options?: {
2489
- asJson?: false;
2490
- }): string;
2531
+ declare const readFileSync: typeof fsExtra.readFileSync;
2491
2532
  export { readFileSync }
2492
2533
  export { readFileSync as readFileSync_alias_1 }
2493
2534
  export { readFileSync as readFileSync_alias_2 }
2494
2535
  export { readFileSync as readFileSync_alias_3 }
2495
2536
 
2537
+ declare const readJsonSync: <T = unknown>(file: string, options?: fsExtra.JsonReadOptions) => T;
2538
+ export { readJsonSync }
2539
+ export { readJsonSync as readJsonSync_alias_1 }
2540
+ export { readJsonSync as readJsonSync_alias_2 }
2541
+ export { readJsonSync as readJsonSync_alias_3 }
2542
+
2496
2543
  declare function regexSearchMapper(str: string): string;
2497
2544
  export { regexSearchMapper }
2498
2545
  export { regexSearchMapper as regexSearchMapper_alias_1 }
@@ -2505,6 +2552,18 @@ export { removeAccent as removeAccent_alias_1 }
2505
2552
  export { removeAccent as removeAccent_alias_2 }
2506
2553
  export { removeAccent as removeAccent_alias_3 }
2507
2554
 
2555
+ declare function removeSync(...paths: string[]): void;
2556
+ export { removeSync }
2557
+ export { removeSync as removeSync_alias_1 }
2558
+ export { removeSync as removeSync_alias_2 }
2559
+ export { removeSync as removeSync_alias_3 }
2560
+
2561
+ declare const removeSyncE: typeof fsExtra.removeSync;
2562
+ export { removeSyncE }
2563
+ export { removeSyncE as removeSyncE_alias_1 }
2564
+ export { removeSyncE as removeSyncE_alias_2 }
2565
+ export { removeSyncE as removeSyncE_alias_3 }
2566
+
2508
2567
  export { Request_2 as Request }
2509
2568
  export { Request_2 as Request_alias_1 }
2510
2569
  export { Request_2 as Request_alias_2 }
@@ -2789,18 +2848,12 @@ export { RESPONSE_STATUS }
2789
2848
  export { RESPONSE_STATUS as RESPONSE_STATUS_alias_1 }
2790
2849
  export { RESPONSE_STATUS as RESPONSE_STATUS_alias_2 }
2791
2850
 
2792
- declare function rmSync(...paths: string[]): void;
2793
- export { rmSync }
2794
- export { rmSync as rmSync_alias_1 }
2795
- export { rmSync as rmSync_alias_2 }
2796
- export { rmSync as rmSync_alias_3 }
2797
-
2798
2851
  export { Router }
2799
2852
  export { Router as Router_alias_1 }
2800
2853
  export { Router as Router_alias_2 }
2801
2854
  export { Router as Router_alias_3 }
2802
2855
 
2803
- declare function runCommand(label: string, command: string): Promise<void>;
2856
+ declare function runCommand(label: string, command: string | void): Promise<void>;
2804
2857
  export { runCommand }
2805
2858
  export { runCommand as runCommand_alias_1 }
2806
2859
  export { runCommand as runCommand_alias_2 }
@@ -2823,12 +2876,6 @@ export { setGlobalApolloErrorCallback as setGlobalApolloErrorCallback_alias_1 }
2823
2876
  export { setGlobalApolloErrorCallback as setGlobalApolloErrorCallback_alias_2 }
2824
2877
  export { setGlobalApolloErrorCallback as setGlobalApolloErrorCallback_alias_3 }
2825
2878
 
2826
- declare function setMongoMigrateConfig(options: config.Config): void;
2827
- export { setMongoMigrateConfig }
2828
- export { setMongoMigrateConfig as setMongoMigrateConfig_alias_1 }
2829
- export { setMongoMigrateConfig as setMongoMigrateConfig_alias_2 }
2830
- export { setMongoMigrateConfig as setMongoMigrateConfig_alias_3 }
2831
-
2832
2879
  declare function setupPackages(packages: string[], options?: {
2833
2880
  update?: boolean;
2834
2881
  postInstallActions?: (() => Promise<void>)[];
@@ -2862,6 +2909,12 @@ export { SIMPLE_GIT_HOOKS_PACKAGE_NAME as SIMPLE_GIT_HOOKS_PACKAGE_NAME_alias_1
2862
2909
  export { SIMPLE_GIT_HOOKS_PACKAGE_NAME as SIMPLE_GIT_HOOKS_PACKAGE_NAME_alias_2 }
2863
2910
  export { SIMPLE_GIT_HOOKS_PACKAGE_NAME as SIMPLE_GIT_HOOKS_PACKAGE_NAME_alias_3 }
2864
2911
 
2912
+ declare const statSync: fsExtra.StatSyncFn;
2913
+ export { statSync }
2914
+ export { statSync as statSync_alias_1 }
2915
+ export { statSync as statSync_alias_2 }
2916
+ export { statSync as statSync_alias_3 }
2917
+
2865
2918
  declare const storage: {
2866
2919
  get<T = unknown>(key: string): Promise<T | null>;
2867
2920
  set<T = unknown>(key: string, value: T): Promise<void>;
@@ -3008,6 +3061,12 @@ export { T_InsertOneResult as T_InsertOneResult_alias_1 }
3008
3061
  export { T_InsertOneResult as T_InsertOneResult_alias_2 }
3009
3062
  export { T_InsertOneResult as T_InsertOneResult_alias_3 }
3010
3063
 
3064
+ declare type T_MongoMigrateContext<NeedDb extends boolean> = NeedDb extends true ? I_MongoMigrateRawContext : undefined;
3065
+ export { T_MongoMigrateContext }
3066
+ export { T_MongoMigrateContext as T_MongoMigrateContext_alias_1 }
3067
+ export { T_MongoMigrateContext as T_MongoMigrateContext_alias_2 }
3068
+ export { T_MongoMigrateContext as T_MongoMigrateContext_alias_3 }
3069
+
3011
3070
  declare type T_MongooseHookNextFunction = (error?: Error) => void;
3012
3071
  export { T_MongooseHookNextFunction }
3013
3072
  export { T_MongooseHookNextFunction as T_MongooseHookNextFunction_alias_1 }
@@ -3308,12 +3367,16 @@ export { WORKING_DIRECTORY as WORKING_DIRECTORY_alias_1 }
3308
3367
  export { WORKING_DIRECTORY as WORKING_DIRECTORY_alias_2 }
3309
3368
  export { WORKING_DIRECTORY as WORKING_DIRECTORY_alias_3 }
3310
3369
 
3311
- declare function writeFileSync(filePath: string, data: string | T_Object_2, options?: {
3312
- isJson?: boolean;
3313
- }): void;
3370
+ declare const writeFileSync: typeof fsExtra.writeFileSync;
3314
3371
  export { writeFileSync }
3315
3372
  export { writeFileSync as writeFileSync_alias_1 }
3316
3373
  export { writeFileSync as writeFileSync_alias_2 }
3317
3374
  export { writeFileSync as writeFileSync_alias_3 }
3318
3375
 
3376
+ declare const writeJsonSync: <T = unknown>(file: string, obj: T, options?: fsExtra.JsonWriteOptions | null) => void;
3377
+ export { writeJsonSync }
3378
+ export { writeJsonSync as writeJsonSync_alias_1 }
3379
+ export { writeJsonSync as writeJsonSync_alias_2 }
3380
+ export { writeJsonSync as writeJsonSync_alias_3 }
3381
+
3319
3382
  export { }
@@ -13,9 +13,9 @@ import type { ClientSession } from 'mongoose';
13
13
  import type { CodegenConfig } from '@graphql-codegen/cli';
14
14
  import { Collection } from 'mongodb';
15
15
  import type { ComponentType } from 'react';
16
- import { config } from 'migrate-mongo';
17
16
  import type consola from 'consola';
18
17
  import { Context } from 'react';
18
+ import type { CopySyncOptions } from 'node:fs';
19
19
  import cors from 'cors';
20
20
  import { Db } from 'mongodb';
21
21
  import type { DeleteResult } from 'mongodb';
@@ -27,6 +27,7 @@ import express from 'express';
27
27
  import { expressMiddleware } from '@apollo/server/express4';
28
28
  import type { Filter } from 'mongodb';
29
29
  import type { FilterQuery } from 'mongoose';
30
+ import fsExtra from 'fs-extra';
30
31
  import type { GraphQLSchema } from 'graphql';
31
32
  import { I_ApolloErrorContext as I_ApolloErrorContext_2 } from './apollo-error.type.js';
32
33
  import { I_Command as I_Command_2 } from './command.type.js';
@@ -38,6 +39,7 @@ import type { InsertOneResult } from 'mongodb';
38
39
  import type { JSX } from 'react';
39
40
  import { Locale } from 'date-fns/locale';
40
41
  import type { Locale as Locale_2 } from 'date-fns';
42
+ import migrate from 'migrate-mongo';
41
43
  import { Model } from 'mongoose';
42
44
  import type mongoose from 'mongoose';
43
45
  import mongoosePaginate from 'mongoose-paginate-v2';
@@ -127,9 +129,7 @@ export { ApolloProvider as ApolloProvider_alias_1 }
127
129
  export { ApolloProvider as ApolloProvider_alias_2 }
128
130
  export { ApolloProvider as ApolloProvider_alias_3 }
129
131
 
130
- declare function appendFileSync(filePath: string, data: string | T_Object_2, options?: {
131
- isJson?: boolean;
132
- }): void;
132
+ declare const appendFileSync: typeof fsExtra.appendFileSync;
133
133
  export { appendFileSync }
134
134
  export { appendFileSync as appendFileSync_alias_1 }
135
135
  export { appendFileSync as appendFileSync_alias_2 }
@@ -190,25 +190,25 @@ export { clearAllErrorLists as clearAllErrorLists_alias_2 }
190
190
  export { clearAllErrorLists as clearAllErrorLists_alias_3 }
191
191
 
192
192
  declare const command: {
193
- simpleGitHooks: () => Promise<string>;
194
- eslintInspect: () => Promise<string>;
195
- nodeModulesInspect: () => Promise<string>;
196
- eslintCheck: () => Promise<string>;
197
- eslintFix: () => Promise<string>;
198
- typescriptCheck: () => Promise<string>;
199
- configureGitHook: () => Promise<string>;
200
- testUnit: () => Promise<string>;
201
- testE2e: () => Promise<string>;
202
- mongoMigrateCreate: (migrateName: string) => Promise<string>;
203
- mongoMigrateUp: () => Promise<string>;
204
- mongoMigrateDown: () => Promise<string>;
205
- commitLint: () => Promise<string>;
206
- lintStaged: () => Promise<string>;
207
- stageBuildDirectory: () => Promise<string>;
208
- build: () => Promise<string>;
209
- pnpmInstallStandard: () => Promise<string>;
210
- pnpmInstallLegacy: () => Promise<string>;
211
- pnpmInstallForce: () => Promise<string>;
193
+ simpleGitHooks: () => Promise<string | void>;
194
+ eslintInspect: () => Promise<string | void>;
195
+ nodeModulesInspect: () => Promise<string | void>;
196
+ eslintCheck: () => Promise<string | void>;
197
+ eslintFix: () => Promise<string | void>;
198
+ typescriptCheck: () => Promise<string | void>;
199
+ configureGitHook: () => Promise<string | void>;
200
+ testUnit: () => Promise<string | void>;
201
+ testE2e: () => Promise<string | void>;
202
+ mongoMigrateCreate: (migrateName: string) => Promise<string | void>;
203
+ mongoMigrateUp: () => Promise<string | void>;
204
+ mongoMigrateDown: () => Promise<string | void>;
205
+ commitLint: () => Promise<string | void>;
206
+ lintStaged: () => Promise<string | void>;
207
+ stageBuildDirectory: () => Promise<string | void>;
208
+ build: () => Promise<string | void>;
209
+ pnpmInstallStandard: () => Promise<string | void>;
210
+ pnpmInstallLegacy: () => Promise<string | void>;
211
+ pnpmInstallForce: () => Promise<string | void>;
212
212
  };
213
213
  export { command }
214
214
  export { command as command_alias_1 }
@@ -227,6 +227,18 @@ export { COMMIT_LINT_PACKAGE_NAME as COMMIT_LINT_PACKAGE_NAME_alias_1 }
227
227
  export { COMMIT_LINT_PACKAGE_NAME as COMMIT_LINT_PACKAGE_NAME_alias_2 }
228
228
  export { COMMIT_LINT_PACKAGE_NAME as COMMIT_LINT_PACKAGE_NAME_alias_3 }
229
229
 
230
+ declare function copySync(src: string, dest: string, options?: I_CopySyncOptions): void;
231
+ export { copySync }
232
+ export { copySync as copySync_alias_1 }
233
+ export { copySync as copySync_alias_2 }
234
+ export { copySync as copySync_alias_3 }
235
+
236
+ declare const copySyncE: typeof fsExtra.copySync;
237
+ export { copySyncE }
238
+ export { copySyncE as copySyncE_alias_1 }
239
+ export { copySyncE as copySyncE_alias_2 }
240
+ export { copySyncE as copySyncE_alias_3 }
241
+
230
242
  declare function createApolloServer(options: I_ApolloServerOptions): ApolloServer;
231
243
  export { createApolloServer }
232
244
  export { createApolloServer as createApolloServer_alias_1 }
@@ -1467,7 +1479,8 @@ export { _default_3 as lintStagedConfig_alias_1 }
1467
1479
 
1468
1480
  declare enum E_CommandType {
1469
1481
  CLI = "CLI",
1470
- RAW = "RAW"
1482
+ STRING = "STRING",
1483
+ FUNCTION = "FUNCTION"
1471
1484
  }
1472
1485
  export { E_CommandType }
1473
1486
  export { E_CommandType as E_CommandType_alias_1 }
@@ -1705,6 +1718,14 @@ export { I_CommandContext as I_CommandContext_alias_1 }
1705
1718
  export { I_CommandContext as I_CommandContext_alias_2 }
1706
1719
  export { I_CommandContext as I_CommandContext_alias_3 }
1707
1720
 
1721
+ declare interface I_CopySyncOptions extends CopySyncOptions {
1722
+ extensions?: string[];
1723
+ }
1724
+ export { I_CopySyncOptions }
1725
+ export { I_CopySyncOptions as I_CopySyncOptions_alias_1 }
1726
+ export { I_CopySyncOptions as I_CopySyncOptions_alias_2 }
1727
+ export { I_CopySyncOptions as I_CopySyncOptions_alias_3 }
1728
+
1708
1729
  declare interface I_CorsOptions {
1709
1730
  isDev?: boolean;
1710
1731
  whiteList?: string[];
@@ -1999,6 +2020,11 @@ export { I_Log_NodeJS as I_Log_NodeJS_alias_1 }
1999
2020
  export { I_Log_NodeJS as I_Log_NodeJS_alias_2 }
2000
2021
  export { I_Log_NodeJS as I_Log_NodeJS_alias_3 }
2001
2022
 
2023
+ declare interface I_MongoMigrateRawContext {
2024
+ db: mongoose.mongo.Db;
2025
+ client: mongoose.mongo.MongoClient;
2026
+ }
2027
+
2002
2028
  declare interface I_MongooseModelMiddleware<T extends Partial<C_Document>> {
2003
2029
  method: T_MongooseMiddlewareMethod;
2004
2030
  pre?: T_MongooseMiddlewarePreFunction<T & T_QueryWithHelpers<T>>;
@@ -2270,12 +2296,27 @@ declare const mongo: {
2270
2296
  }>(fields: string[]): (this: T, value: unknown) => Promise<boolean>;
2271
2297
  matchesRegex(regexArray: RegExp[]): (value: string) => Promise<boolean>;
2272
2298
  };
2299
+ migrate: {
2300
+ withConfig: <T, NeedDb extends boolean = false>(callback: (ctx: T_MongoMigrateContext<NeedDb>) => Promise<T>, needDb?: NeedDb) => Promise<T>;
2301
+ init: () => Promise<void>;
2302
+ create: (name: string) => Promise<void>;
2303
+ up: () => Promise<void>;
2304
+ down: () => Promise<void>;
2305
+ status: () => Promise<void>;
2306
+ config: (options: Partial<migrate.config.Config>) => void;
2307
+ };
2273
2308
  };
2274
2309
  export { mongo }
2275
2310
  export { mongo as mongo_alias_1 }
2276
2311
  export { mongo as mongo_alias_2 }
2277
2312
  export { mongo as mongo_alias_3 }
2278
2313
 
2314
+ declare const MONGO_MIGRATE_OPTIONS = "MONGO_MIGRATE_OPTIONS";
2315
+ export { MONGO_MIGRATE_OPTIONS }
2316
+ export { MONGO_MIGRATE_OPTIONS as MONGO_MIGRATE_OPTIONS_alias_1 }
2317
+ export { MONGO_MIGRATE_OPTIONS as MONGO_MIGRATE_OPTIONS_alias_2 }
2318
+ export { MONGO_MIGRATE_OPTIONS as MONGO_MIGRATE_OPTIONS_alias_3 }
2319
+
2279
2320
  declare class MongoController<D extends Partial<C_Document>> {
2280
2321
  private collection;
2281
2322
  constructor(db: C_Db, collectionName: string);
@@ -2448,6 +2489,12 @@ export { PATH as PATH_alias_1 }
2448
2489
  export { PATH as PATH_alias_2 }
2449
2490
  export { PATH as PATH_alias_3 }
2450
2491
 
2492
+ declare const pathExistsSync: typeof fsExtra.pathExistsSync;
2493
+ export { pathExistsSync }
2494
+ export { pathExistsSync as pathExistsSync_alias_1 }
2495
+ export { pathExistsSync as pathExistsSync_alias_2 }
2496
+ export { pathExistsSync as pathExistsSync_alias_3 }
2497
+
2451
2498
  declare const PLAYWRIGHT_PACKAGE_NAME = "playwright";
2452
2499
  export { PLAYWRIGHT_PACKAGE_NAME }
2453
2500
  export { PLAYWRIGHT_PACKAGE_NAME as PLAYWRIGHT_PACKAGE_NAME_alias_1 }
@@ -2481,18 +2528,18 @@ export { rawCommand as rawCommand_alias_1 }
2481
2528
  export { rawCommand as rawCommand_alias_2 }
2482
2529
  export { rawCommand as rawCommand_alias_3 }
2483
2530
 
2484
- declare function readFileSync(filePath: string, options: {
2485
- asJson: true;
2486
- }): T_Object_2;
2487
-
2488
- declare function readFileSync(filePath: string, options?: {
2489
- asJson?: false;
2490
- }): string;
2531
+ declare const readFileSync: typeof fsExtra.readFileSync;
2491
2532
  export { readFileSync }
2492
2533
  export { readFileSync as readFileSync_alias_1 }
2493
2534
  export { readFileSync as readFileSync_alias_2 }
2494
2535
  export { readFileSync as readFileSync_alias_3 }
2495
2536
 
2537
+ declare const readJsonSync: <T = unknown>(file: string, options?: fsExtra.JsonReadOptions) => T;
2538
+ export { readJsonSync }
2539
+ export { readJsonSync as readJsonSync_alias_1 }
2540
+ export { readJsonSync as readJsonSync_alias_2 }
2541
+ export { readJsonSync as readJsonSync_alias_3 }
2542
+
2496
2543
  declare function regexSearchMapper(str: string): string;
2497
2544
  export { regexSearchMapper }
2498
2545
  export { regexSearchMapper as regexSearchMapper_alias_1 }
@@ -2505,6 +2552,18 @@ export { removeAccent as removeAccent_alias_1 }
2505
2552
  export { removeAccent as removeAccent_alias_2 }
2506
2553
  export { removeAccent as removeAccent_alias_3 }
2507
2554
 
2555
+ declare function removeSync(...paths: string[]): void;
2556
+ export { removeSync }
2557
+ export { removeSync as removeSync_alias_1 }
2558
+ export { removeSync as removeSync_alias_2 }
2559
+ export { removeSync as removeSync_alias_3 }
2560
+
2561
+ declare const removeSyncE: typeof fsExtra.removeSync;
2562
+ export { removeSyncE }
2563
+ export { removeSyncE as removeSyncE_alias_1 }
2564
+ export { removeSyncE as removeSyncE_alias_2 }
2565
+ export { removeSyncE as removeSyncE_alias_3 }
2566
+
2508
2567
  export { Request_2 as Request }
2509
2568
  export { Request_2 as Request_alias_1 }
2510
2569
  export { Request_2 as Request_alias_2 }
@@ -2789,18 +2848,12 @@ export { RESPONSE_STATUS }
2789
2848
  export { RESPONSE_STATUS as RESPONSE_STATUS_alias_1 }
2790
2849
  export { RESPONSE_STATUS as RESPONSE_STATUS_alias_2 }
2791
2850
 
2792
- declare function rmSync(...paths: string[]): void;
2793
- export { rmSync }
2794
- export { rmSync as rmSync_alias_1 }
2795
- export { rmSync as rmSync_alias_2 }
2796
- export { rmSync as rmSync_alias_3 }
2797
-
2798
2851
  export { Router }
2799
2852
  export { Router as Router_alias_1 }
2800
2853
  export { Router as Router_alias_2 }
2801
2854
  export { Router as Router_alias_3 }
2802
2855
 
2803
- declare function runCommand(label: string, command: string): Promise<void>;
2856
+ declare function runCommand(label: string, command: string | void): Promise<void>;
2804
2857
  export { runCommand }
2805
2858
  export { runCommand as runCommand_alias_1 }
2806
2859
  export { runCommand as runCommand_alias_2 }
@@ -2823,12 +2876,6 @@ export { setGlobalApolloErrorCallback as setGlobalApolloErrorCallback_alias_1 }
2823
2876
  export { setGlobalApolloErrorCallback as setGlobalApolloErrorCallback_alias_2 }
2824
2877
  export { setGlobalApolloErrorCallback as setGlobalApolloErrorCallback_alias_3 }
2825
2878
 
2826
- declare function setMongoMigrateConfig(options: config.Config): void;
2827
- export { setMongoMigrateConfig }
2828
- export { setMongoMigrateConfig as setMongoMigrateConfig_alias_1 }
2829
- export { setMongoMigrateConfig as setMongoMigrateConfig_alias_2 }
2830
- export { setMongoMigrateConfig as setMongoMigrateConfig_alias_3 }
2831
-
2832
2879
  declare function setupPackages(packages: string[], options?: {
2833
2880
  update?: boolean;
2834
2881
  postInstallActions?: (() => Promise<void>)[];
@@ -2862,6 +2909,12 @@ export { SIMPLE_GIT_HOOKS_PACKAGE_NAME as SIMPLE_GIT_HOOKS_PACKAGE_NAME_alias_1
2862
2909
  export { SIMPLE_GIT_HOOKS_PACKAGE_NAME as SIMPLE_GIT_HOOKS_PACKAGE_NAME_alias_2 }
2863
2910
  export { SIMPLE_GIT_HOOKS_PACKAGE_NAME as SIMPLE_GIT_HOOKS_PACKAGE_NAME_alias_3 }
2864
2911
 
2912
+ declare const statSync: fsExtra.StatSyncFn;
2913
+ export { statSync }
2914
+ export { statSync as statSync_alias_1 }
2915
+ export { statSync as statSync_alias_2 }
2916
+ export { statSync as statSync_alias_3 }
2917
+
2865
2918
  declare const storage: {
2866
2919
  get<T = unknown>(key: string): Promise<T | null>;
2867
2920
  set<T = unknown>(key: string, value: T): Promise<void>;
@@ -3008,6 +3061,12 @@ export { T_InsertOneResult as T_InsertOneResult_alias_1 }
3008
3061
  export { T_InsertOneResult as T_InsertOneResult_alias_2 }
3009
3062
  export { T_InsertOneResult as T_InsertOneResult_alias_3 }
3010
3063
 
3064
+ declare type T_MongoMigrateContext<NeedDb extends boolean> = NeedDb extends true ? I_MongoMigrateRawContext : undefined;
3065
+ export { T_MongoMigrateContext }
3066
+ export { T_MongoMigrateContext as T_MongoMigrateContext_alias_1 }
3067
+ export { T_MongoMigrateContext as T_MongoMigrateContext_alias_2 }
3068
+ export { T_MongoMigrateContext as T_MongoMigrateContext_alias_3 }
3069
+
3011
3070
  declare type T_MongooseHookNextFunction = (error?: Error) => void;
3012
3071
  export { T_MongooseHookNextFunction }
3013
3072
  export { T_MongooseHookNextFunction as T_MongooseHookNextFunction_alias_1 }
@@ -3308,12 +3367,16 @@ export { WORKING_DIRECTORY as WORKING_DIRECTORY_alias_1 }
3308
3367
  export { WORKING_DIRECTORY as WORKING_DIRECTORY_alias_2 }
3309
3368
  export { WORKING_DIRECTORY as WORKING_DIRECTORY_alias_3 }
3310
3369
 
3311
- declare function writeFileSync(filePath: string, data: string | T_Object_2, options?: {
3312
- isJson?: boolean;
3313
- }): void;
3370
+ declare const writeFileSync: typeof fsExtra.writeFileSync;
3314
3371
  export { writeFileSync }
3315
3372
  export { writeFileSync as writeFileSync_alias_1 }
3316
3373
  export { writeFileSync as writeFileSync_alias_2 }
3317
3374
  export { writeFileSync as writeFileSync_alias_3 }
3318
3375
 
3376
+ declare const writeJsonSync: <T = unknown>(file: string, obj: T, options?: fsExtra.JsonWriteOptions | null) => void;
3377
+ export { writeJsonSync }
3378
+ export { writeJsonSync as writeJsonSync_alias_1 }
3379
+ export { writeJsonSync as writeJsonSync_alias_2 }
3380
+ export { writeJsonSync as writeJsonSync_alias_3 }
3381
+
3319
3382
  export { }