@cyberskill/shared 1.140.0 → 1.141.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.
@@ -1861,6 +1861,14 @@ export { I_GraphqlWSOptions }
1861
1861
  export { I_GraphqlWSOptions as I_GraphqlWSOptions_alias_1 }
1862
1862
  export { I_GraphqlWSOptions as I_GraphqlWSOptions_alias_2 }
1863
1863
 
1864
+ declare interface I_Input_CheckSlug<T> extends I_InputSlug<T> {
1865
+ slug: string;
1866
+ from: T;
1867
+ }
1868
+ export { I_Input_CheckSlug }
1869
+ export { I_Input_CheckSlug as I_Input_CheckSlug_alias_1 }
1870
+ export { I_Input_CheckSlug as I_Input_CheckSlug_alias_2 }
1871
+
1864
1872
  declare interface I_Input_CreateMany<T> {
1865
1873
  docs: T[];
1866
1874
  }
@@ -1875,6 +1883,13 @@ export { I_Input_CreateOne }
1875
1883
  export { I_Input_CreateOne as I_Input_CreateOne_alias_1 }
1876
1884
  export { I_Input_CreateOne as I_Input_CreateOne_alias_2 }
1877
1885
 
1886
+ declare interface I_Input_CreateSlug<T> extends I_InputSlug<T> {
1887
+ from: T;
1888
+ }
1889
+ export { I_Input_CreateSlug }
1890
+ export { I_Input_CreateSlug as I_Input_CreateSlug_alias_1 }
1891
+ export { I_Input_CreateSlug as I_Input_CreateSlug_alias_2 }
1892
+
1878
1893
  declare interface I_Input_DeleteMany<T> {
1879
1894
  filter: T_FilterQuery<T>;
1880
1895
  options?: I_DeleteOptionsExtended;
@@ -1925,6 +1940,14 @@ export { I_Input_FindPagingAggregate }
1925
1940
  export { I_Input_FindPagingAggregate as I_Input_FindPagingAggregate_alias_1 }
1926
1941
  export { I_Input_FindPagingAggregate as I_Input_FindPagingAggregate_alias_2 }
1927
1942
 
1943
+ declare interface I_Input_GenerateSlug<T> extends I_InputSlug<T> {
1944
+ slug: string;
1945
+ isObject: boolean;
1946
+ }
1947
+ export { I_Input_GenerateSlug }
1948
+ export { I_Input_GenerateSlug as I_Input_GenerateSlug_alias_1 }
1949
+ export { I_Input_GenerateSlug as I_Input_GenerateSlug_alias_2 }
1950
+
1928
1951
  declare interface I_Input_UpdateMany<T> extends T_PopulateOption {
1929
1952
  filter: T_FilterQuery<T>;
1930
1953
  update: T_UpdateQuery<T>;
@@ -1943,6 +1966,14 @@ export { I_Input_UpdateOne }
1943
1966
  export { I_Input_UpdateOne as I_Input_UpdateOne_alias_1 }
1944
1967
  export { I_Input_UpdateOne as I_Input_UpdateOne_alias_2 }
1945
1968
 
1969
+ declare interface I_InputSlug<T> {
1970
+ field: string;
1971
+ filter?: T_FilterQuery<T>;
1972
+ }
1973
+ export { I_InputSlug }
1974
+ export { I_InputSlug as I_InputSlug_alias_1 }
1975
+ export { I_InputSlug as I_InputSlug_alias_2 }
1976
+
1946
1977
  declare interface I_IssueEntry {
1947
1978
  type: E_IssueType;
1948
1979
  file: string;
@@ -2396,10 +2427,165 @@ declare class MongooseController<T extends Partial<C_Document>> {
2396
2427
  deleteOne(filter?: T_FilterQuery<T>, options?: I_DeleteOptionsExtended): Promise<I_Return_2<T>>;
2397
2428
  deleteMany(filter?: T_FilterQuery<T>, options?: I_DeleteOptionsExtended): Promise<I_Return_2<T_DeleteResult>>;
2398
2429
  createShortId(id: string, length?: number): Promise<I_Return_2<string>>;
2399
- private generateSlugQuery;
2400
- private generateUniqueSlug;
2401
- createSlug<R = string>(fieldName: string, fields: T, filters?: T_FilterQuery<T>): Promise<I_Return_2<R>>;
2402
- checkSlug(slug: string, fieldName: string, fields: T, filters?: T_FilterQuery<T>): Promise<I_Return_2<boolean>>;
2430
+ generateSlugQuery({ slug, field, isObject, filter }: I_Input_GenerateSlug<T>): {
2431
+ $or: ({
2432
+ [x: string]: string;
2433
+ slugHistory?: undefined;
2434
+ } | {
2435
+ slugHistory: {
2436
+ $elemMatch: {
2437
+ [x: string]: string;
2438
+ };
2439
+ };
2440
+ })[];
2441
+ _id?: any;
2442
+ $assertPopulated?: any;
2443
+ $clearModifiedPaths?: any;
2444
+ $clone?: any;
2445
+ $createModifiedPathsSnapshot?: any;
2446
+ $getAllSubdocs?: any;
2447
+ $ignore?: any;
2448
+ $isDefault?: any;
2449
+ $isDeleted?: any;
2450
+ $getPopulatedDocs?: any;
2451
+ $inc?: any;
2452
+ $isEmpty?: any;
2453
+ $isValid?: any;
2454
+ $locals?: any;
2455
+ $markValid?: any;
2456
+ $model?: any;
2457
+ $op?: any;
2458
+ $restoreModifiedPathsSnapshot?: any;
2459
+ $session?: any;
2460
+ $set?: any;
2461
+ $where?: any;
2462
+ baseModelName?: any;
2463
+ collection?: any;
2464
+ db?: any;
2465
+ deleteOne?: any;
2466
+ depopulate?: any;
2467
+ directModifiedPaths?: any;
2468
+ equals?: any;
2469
+ errors?: any;
2470
+ get?: any;
2471
+ getChanges?: any;
2472
+ id?: any;
2473
+ increment?: any;
2474
+ init?: any;
2475
+ invalidate?: any;
2476
+ isDirectModified?: any;
2477
+ isDirectSelected?: any;
2478
+ isInit?: any;
2479
+ isModified?: any;
2480
+ isNew?: any;
2481
+ isSelected?: any;
2482
+ markModified?: any;
2483
+ model?: any;
2484
+ modifiedPaths?: any;
2485
+ overwrite?: any;
2486
+ $parent?: any;
2487
+ populate?: any;
2488
+ populated?: any;
2489
+ replaceOne?: any;
2490
+ save?: any;
2491
+ schema?: any;
2492
+ set?: any;
2493
+ toJSON?: any;
2494
+ toObject?: any;
2495
+ unmarkModified?: any;
2496
+ updateOne?: any;
2497
+ validate?: any;
2498
+ validateSync?: any;
2499
+ $and?: mongooseRaw.FilterQuery<T>[] | undefined;
2500
+ $nor?: mongooseRaw.FilterQuery<T>[] | undefined;
2501
+ $text?: {
2502
+ $search: string;
2503
+ $language?: string;
2504
+ $caseSensitive?: boolean;
2505
+ $diacriticSensitive?: boolean;
2506
+ };
2507
+ $comment?: string;
2508
+ $expr?: Record<string, any>;
2509
+ } | {
2510
+ $or: ({
2511
+ slug: string;
2512
+ slugHistory?: undefined;
2513
+ } | {
2514
+ slugHistory: string;
2515
+ slug?: undefined;
2516
+ })[];
2517
+ _id?: any;
2518
+ $assertPopulated?: any;
2519
+ $clearModifiedPaths?: any;
2520
+ $clone?: any;
2521
+ $createModifiedPathsSnapshot?: any;
2522
+ $getAllSubdocs?: any;
2523
+ $ignore?: any;
2524
+ $isDefault?: any;
2525
+ $isDeleted?: any;
2526
+ $getPopulatedDocs?: any;
2527
+ $inc?: any;
2528
+ $isEmpty?: any;
2529
+ $isValid?: any;
2530
+ $locals?: any;
2531
+ $markValid?: any;
2532
+ $model?: any;
2533
+ $op?: any;
2534
+ $restoreModifiedPathsSnapshot?: any;
2535
+ $session?: any;
2536
+ $set?: any;
2537
+ $where?: any;
2538
+ baseModelName?: any;
2539
+ collection?: any;
2540
+ db?: any;
2541
+ deleteOne?: any;
2542
+ depopulate?: any;
2543
+ directModifiedPaths?: any;
2544
+ equals?: any;
2545
+ errors?: any;
2546
+ get?: any;
2547
+ getChanges?: any;
2548
+ id?: any;
2549
+ increment?: any;
2550
+ init?: any;
2551
+ invalidate?: any;
2552
+ isDirectModified?: any;
2553
+ isDirectSelected?: any;
2554
+ isInit?: any;
2555
+ isModified?: any;
2556
+ isNew?: any;
2557
+ isSelected?: any;
2558
+ markModified?: any;
2559
+ model?: any;
2560
+ modifiedPaths?: any;
2561
+ overwrite?: any;
2562
+ $parent?: any;
2563
+ populate?: any;
2564
+ populated?: any;
2565
+ replaceOne?: any;
2566
+ save?: any;
2567
+ schema?: any;
2568
+ set?: any;
2569
+ toJSON?: any;
2570
+ toObject?: any;
2571
+ unmarkModified?: any;
2572
+ updateOne?: any;
2573
+ validate?: any;
2574
+ validateSync?: any;
2575
+ $and?: mongooseRaw.FilterQuery<T>[] | undefined;
2576
+ $nor?: mongooseRaw.FilterQuery<T>[] | undefined;
2577
+ $text?: {
2578
+ $search: string;
2579
+ $language?: string;
2580
+ $caseSensitive?: boolean;
2581
+ $diacriticSensitive?: boolean;
2582
+ };
2583
+ $comment?: string;
2584
+ $expr?: Record<string, any>;
2585
+ };
2586
+ generateUniqueSlug({ slug, field, isObject, filter }: I_Input_GenerateSlug<T>): Promise<string>;
2587
+ createSlug<R = string>({ field, from, filter }: I_Input_CreateSlug<T>): Promise<I_Return_2<R>>;
2588
+ checkSlug({ slug, field, from, filter }: I_Input_CheckSlug<T>): Promise<I_Return_2<boolean>>;
2403
2589
  aggregate(pipeline: T_PipelineStage[]): Promise<I_Return_2<T[]>>;
2404
2590
  }
2405
2591
  export { MongooseController }
@@ -1861,6 +1861,14 @@ export { I_GraphqlWSOptions }
1861
1861
  export { I_GraphqlWSOptions as I_GraphqlWSOptions_alias_1 }
1862
1862
  export { I_GraphqlWSOptions as I_GraphqlWSOptions_alias_2 }
1863
1863
 
1864
+ declare interface I_Input_CheckSlug<T> extends I_InputSlug<T> {
1865
+ slug: string;
1866
+ from: T;
1867
+ }
1868
+ export { I_Input_CheckSlug }
1869
+ export { I_Input_CheckSlug as I_Input_CheckSlug_alias_1 }
1870
+ export { I_Input_CheckSlug as I_Input_CheckSlug_alias_2 }
1871
+
1864
1872
  declare interface I_Input_CreateMany<T> {
1865
1873
  docs: T[];
1866
1874
  }
@@ -1875,6 +1883,13 @@ export { I_Input_CreateOne }
1875
1883
  export { I_Input_CreateOne as I_Input_CreateOne_alias_1 }
1876
1884
  export { I_Input_CreateOne as I_Input_CreateOne_alias_2 }
1877
1885
 
1886
+ declare interface I_Input_CreateSlug<T> extends I_InputSlug<T> {
1887
+ from: T;
1888
+ }
1889
+ export { I_Input_CreateSlug }
1890
+ export { I_Input_CreateSlug as I_Input_CreateSlug_alias_1 }
1891
+ export { I_Input_CreateSlug as I_Input_CreateSlug_alias_2 }
1892
+
1878
1893
  declare interface I_Input_DeleteMany<T> {
1879
1894
  filter: T_FilterQuery<T>;
1880
1895
  options?: I_DeleteOptionsExtended;
@@ -1925,6 +1940,14 @@ export { I_Input_FindPagingAggregate }
1925
1940
  export { I_Input_FindPagingAggregate as I_Input_FindPagingAggregate_alias_1 }
1926
1941
  export { I_Input_FindPagingAggregate as I_Input_FindPagingAggregate_alias_2 }
1927
1942
 
1943
+ declare interface I_Input_GenerateSlug<T> extends I_InputSlug<T> {
1944
+ slug: string;
1945
+ isObject: boolean;
1946
+ }
1947
+ export { I_Input_GenerateSlug }
1948
+ export { I_Input_GenerateSlug as I_Input_GenerateSlug_alias_1 }
1949
+ export { I_Input_GenerateSlug as I_Input_GenerateSlug_alias_2 }
1950
+
1928
1951
  declare interface I_Input_UpdateMany<T> extends T_PopulateOption {
1929
1952
  filter: T_FilterQuery<T>;
1930
1953
  update: T_UpdateQuery<T>;
@@ -1943,6 +1966,14 @@ export { I_Input_UpdateOne }
1943
1966
  export { I_Input_UpdateOne as I_Input_UpdateOne_alias_1 }
1944
1967
  export { I_Input_UpdateOne as I_Input_UpdateOne_alias_2 }
1945
1968
 
1969
+ declare interface I_InputSlug<T> {
1970
+ field: string;
1971
+ filter?: T_FilterQuery<T>;
1972
+ }
1973
+ export { I_InputSlug }
1974
+ export { I_InputSlug as I_InputSlug_alias_1 }
1975
+ export { I_InputSlug as I_InputSlug_alias_2 }
1976
+
1946
1977
  declare interface I_IssueEntry {
1947
1978
  type: E_IssueType;
1948
1979
  file: string;
@@ -2396,10 +2427,165 @@ declare class MongooseController<T extends Partial<C_Document>> {
2396
2427
  deleteOne(filter?: T_FilterQuery<T>, options?: I_DeleteOptionsExtended): Promise<I_Return_2<T>>;
2397
2428
  deleteMany(filter?: T_FilterQuery<T>, options?: I_DeleteOptionsExtended): Promise<I_Return_2<T_DeleteResult>>;
2398
2429
  createShortId(id: string, length?: number): Promise<I_Return_2<string>>;
2399
- private generateSlugQuery;
2400
- private generateUniqueSlug;
2401
- createSlug<R = string>(fieldName: string, fields: T, filters?: T_FilterQuery<T>): Promise<I_Return_2<R>>;
2402
- checkSlug(slug: string, fieldName: string, fields: T, filters?: T_FilterQuery<T>): Promise<I_Return_2<boolean>>;
2430
+ generateSlugQuery({ slug, field, isObject, filter }: I_Input_GenerateSlug<T>): {
2431
+ $or: ({
2432
+ [x: string]: string;
2433
+ slugHistory?: undefined;
2434
+ } | {
2435
+ slugHistory: {
2436
+ $elemMatch: {
2437
+ [x: string]: string;
2438
+ };
2439
+ };
2440
+ })[];
2441
+ _id?: any;
2442
+ $assertPopulated?: any;
2443
+ $clearModifiedPaths?: any;
2444
+ $clone?: any;
2445
+ $createModifiedPathsSnapshot?: any;
2446
+ $getAllSubdocs?: any;
2447
+ $ignore?: any;
2448
+ $isDefault?: any;
2449
+ $isDeleted?: any;
2450
+ $getPopulatedDocs?: any;
2451
+ $inc?: any;
2452
+ $isEmpty?: any;
2453
+ $isValid?: any;
2454
+ $locals?: any;
2455
+ $markValid?: any;
2456
+ $model?: any;
2457
+ $op?: any;
2458
+ $restoreModifiedPathsSnapshot?: any;
2459
+ $session?: any;
2460
+ $set?: any;
2461
+ $where?: any;
2462
+ baseModelName?: any;
2463
+ collection?: any;
2464
+ db?: any;
2465
+ deleteOne?: any;
2466
+ depopulate?: any;
2467
+ directModifiedPaths?: any;
2468
+ equals?: any;
2469
+ errors?: any;
2470
+ get?: any;
2471
+ getChanges?: any;
2472
+ id?: any;
2473
+ increment?: any;
2474
+ init?: any;
2475
+ invalidate?: any;
2476
+ isDirectModified?: any;
2477
+ isDirectSelected?: any;
2478
+ isInit?: any;
2479
+ isModified?: any;
2480
+ isNew?: any;
2481
+ isSelected?: any;
2482
+ markModified?: any;
2483
+ model?: any;
2484
+ modifiedPaths?: any;
2485
+ overwrite?: any;
2486
+ $parent?: any;
2487
+ populate?: any;
2488
+ populated?: any;
2489
+ replaceOne?: any;
2490
+ save?: any;
2491
+ schema?: any;
2492
+ set?: any;
2493
+ toJSON?: any;
2494
+ toObject?: any;
2495
+ unmarkModified?: any;
2496
+ updateOne?: any;
2497
+ validate?: any;
2498
+ validateSync?: any;
2499
+ $and?: mongooseRaw.FilterQuery<T>[] | undefined;
2500
+ $nor?: mongooseRaw.FilterQuery<T>[] | undefined;
2501
+ $text?: {
2502
+ $search: string;
2503
+ $language?: string;
2504
+ $caseSensitive?: boolean;
2505
+ $diacriticSensitive?: boolean;
2506
+ };
2507
+ $comment?: string;
2508
+ $expr?: Record<string, any>;
2509
+ } | {
2510
+ $or: ({
2511
+ slug: string;
2512
+ slugHistory?: undefined;
2513
+ } | {
2514
+ slugHistory: string;
2515
+ slug?: undefined;
2516
+ })[];
2517
+ _id?: any;
2518
+ $assertPopulated?: any;
2519
+ $clearModifiedPaths?: any;
2520
+ $clone?: any;
2521
+ $createModifiedPathsSnapshot?: any;
2522
+ $getAllSubdocs?: any;
2523
+ $ignore?: any;
2524
+ $isDefault?: any;
2525
+ $isDeleted?: any;
2526
+ $getPopulatedDocs?: any;
2527
+ $inc?: any;
2528
+ $isEmpty?: any;
2529
+ $isValid?: any;
2530
+ $locals?: any;
2531
+ $markValid?: any;
2532
+ $model?: any;
2533
+ $op?: any;
2534
+ $restoreModifiedPathsSnapshot?: any;
2535
+ $session?: any;
2536
+ $set?: any;
2537
+ $where?: any;
2538
+ baseModelName?: any;
2539
+ collection?: any;
2540
+ db?: any;
2541
+ deleteOne?: any;
2542
+ depopulate?: any;
2543
+ directModifiedPaths?: any;
2544
+ equals?: any;
2545
+ errors?: any;
2546
+ get?: any;
2547
+ getChanges?: any;
2548
+ id?: any;
2549
+ increment?: any;
2550
+ init?: any;
2551
+ invalidate?: any;
2552
+ isDirectModified?: any;
2553
+ isDirectSelected?: any;
2554
+ isInit?: any;
2555
+ isModified?: any;
2556
+ isNew?: any;
2557
+ isSelected?: any;
2558
+ markModified?: any;
2559
+ model?: any;
2560
+ modifiedPaths?: any;
2561
+ overwrite?: any;
2562
+ $parent?: any;
2563
+ populate?: any;
2564
+ populated?: any;
2565
+ replaceOne?: any;
2566
+ save?: any;
2567
+ schema?: any;
2568
+ set?: any;
2569
+ toJSON?: any;
2570
+ toObject?: any;
2571
+ unmarkModified?: any;
2572
+ updateOne?: any;
2573
+ validate?: any;
2574
+ validateSync?: any;
2575
+ $and?: mongooseRaw.FilterQuery<T>[] | undefined;
2576
+ $nor?: mongooseRaw.FilterQuery<T>[] | undefined;
2577
+ $text?: {
2578
+ $search: string;
2579
+ $language?: string;
2580
+ $caseSensitive?: boolean;
2581
+ $diacriticSensitive?: boolean;
2582
+ };
2583
+ $comment?: string;
2584
+ $expr?: Record<string, any>;
2585
+ };
2586
+ generateUniqueSlug({ slug, field, isObject, filter }: I_Input_GenerateSlug<T>): Promise<string>;
2587
+ createSlug<R = string>({ field, from, filter }: I_Input_CreateSlug<T>): Promise<I_Return_2<R>>;
2588
+ checkSlug({ slug, field, from, filter }: I_Input_CheckSlug<T>): Promise<I_Return_2<boolean>>;
2403
2589
  aggregate(pipeline: T_PipelineStage[]): Promise<I_Return_2<T[]>>;
2404
2590
  }
2405
2591
  export { MongooseController }