@cyberskill/shared 1.113.0 → 1.114.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.
@@ -9,6 +9,7 @@ import type { ApolloError as ApolloError_2 } from '@apollo/client';
9
9
  import type { ApolloLink } from '@apollo/client';
10
10
  import { ApolloServer } from '@apollo/server';
11
11
  import type { Application } from 'express';
12
+ import bodyParser from 'body-parser';
12
13
  import type { Buffer as Buffer_2 } from 'node:buffer';
13
14
  import type { ClientSession } from 'mongoose';
14
15
  import type { CodegenConfig } from '@graphql-codegen/cli';
@@ -28,6 +29,7 @@ import { Disposable as Disposable_2 } from 'graphql-ws';
28
29
  import { Document as Document_2 } from 'mongoose';
29
30
  import type { ErrorHandlingMiddlewareFunction } from 'mongoose';
30
31
  import type { ErrorHandlingMiddlewareWithOption } from 'mongoose';
32
+ import type { ExceptionFilter } from '@nestjs/common';
31
33
  import express from 'express';
32
34
  import { expressMiddleware } from '@apollo/server/express4';
33
35
  import type { Filter } from 'mongodb';
@@ -37,6 +39,7 @@ import type { GraphQLSchema } from 'graphql';
37
39
  import { I_ApolloErrorContext as I_ApolloErrorContext_2 } from './apollo-error.type.js';
38
40
  import { I_Command as I_Command_2 } from './command.type.js';
39
41
  import { I_LoadingContext as I_LoadingContext_2 } from './loading.type.js';
42
+ import type { INestApplication } from '@nestjs/common';
40
43
  import type { InitOptions } from 'i18next';
41
44
  import type { InsertManyOptions } from 'mongoose';
42
45
  import type { InsertManyResult } from 'mongodb';
@@ -81,12 +84,14 @@ import { TFunction } from 'i18next';
81
84
  import type { Timezone } from 'next-intl';
82
85
  import { toast } from 'react-hot-toast';
83
86
  import { Toaster } from 'react-hot-toast';
87
+ import type { Type } from '@nestjs/common';
84
88
  import type { UpdateQuery } from 'mongoose';
85
89
  import type { UpdateResult } from 'mongodb';
86
90
  import type { UriFunction } from '@apollo/client';
87
91
  import type { UserConfig } from 'vite';
88
92
  import { useTranslation } from 'react-i18next';
89
93
  import { useTranslations } from 'next-intl';
94
+ import type { ValidationPipe } from '@nestjs/common';
90
95
  import { WebSocketServer } from 'ws';
91
96
  import type { WithId } from 'mongodb';
92
97
 
@@ -142,6 +147,11 @@ export { appendFileSync as appendFileSync_alias_1 }
142
147
  export { appendFileSync as appendFileSync_alias_2 }
143
148
  export { appendFileSync as appendFileSync_alias_3 }
144
149
 
150
+ export { bodyParser }
151
+ export { bodyParser as bodyParser_alias_1 }
152
+ export { bodyParser as bodyParser_alias_2 }
153
+ export { bodyParser as bodyParser_alias_3 }
154
+
145
155
  declare const BUILD_DIRECTORY = "dist";
146
156
  export { BUILD_DIRECTORY }
147
157
  export { BUILD_DIRECTORY as BUILD_DIRECTORY_alias_1 }
@@ -246,7 +256,7 @@ export { createApolloServer as createApolloServer_alias_1 }
246
256
  export { createApolloServer as createApolloServer_alias_2 }
247
257
  export { createApolloServer as createApolloServer_alias_3 }
248
258
 
249
- declare function createCors({ isDev, whiteList, ...rest }: I_CorsOptions): (req: cors.CorsRequest, res: {
259
+ declare function createCors<T extends T_CorsType>({ isDev, whiteList, ...rest }: T_CorsOptions<T>): (req: cors.CorsRequest, res: {
250
260
  statusCode?: number | undefined;
251
261
  setHeader(key: string, value: string): any;
252
262
  end(): any;
@@ -256,7 +266,7 @@ export { createCors as createCors_alias_1 }
256
266
  export { createCors as createCors_alias_2 }
257
267
  export { createCors as createCors_alias_3 }
258
268
 
259
- declare function createExpress(options: I_ExpressOptions): Application;
269
+ declare function createExpress(options?: I_ExpressOptions): Application;
260
270
  export { createExpress }
261
271
  export { createExpress as createExpress_alias_1 }
262
272
  export { createExpress as createExpress_alias_2 }
@@ -281,6 +291,12 @@ export { createGraphqlCodegenConfig as createGraphqlCodegenConfig_alias_1 }
281
291
  export { createGraphqlCodegenConfig as createGraphqlCodegenConfig_alias_2 }
282
292
  export { createGraphqlCodegenConfig as createGraphqlCodegenConfig_alias_3 }
283
293
 
294
+ declare function createNest(options: I_NestOptions): Promise<INestApplication>;
295
+ export { createNest }
296
+ export { createNest as createNest_alias_1 }
297
+ export { createNest as createNest_alias_2 }
298
+ export { createNest as createNest_alias_3 }
299
+
284
300
  declare function createSession(options: SessionOptions): RequestHandler;
285
301
  export { createSession }
286
302
  export { createSession as createSession_alias_1 }
@@ -1731,6 +1747,11 @@ export { I_ApolloServerOptions as I_ApolloServerOptions_alias_1 }
1731
1747
  export { I_ApolloServerOptions as I_ApolloServerOptions_alias_2 }
1732
1748
  export { I_ApolloServerOptions as I_ApolloServerOptions_alias_3 }
1733
1749
 
1750
+ declare interface I_BaseCorsOptions {
1751
+ isDev?: boolean;
1752
+ whiteList?: string[];
1753
+ }
1754
+
1734
1755
  declare interface I_CheckPackage {
1735
1756
  isCurrentProject: boolean;
1736
1757
  installedPath: string;
@@ -1779,14 +1800,11 @@ export { I_CopySyncOptions as I_CopySyncOptions_alias_1 }
1779
1800
  export { I_CopySyncOptions as I_CopySyncOptions_alias_2 }
1780
1801
  export { I_CopySyncOptions as I_CopySyncOptions_alias_3 }
1781
1802
 
1782
- declare interface I_CorsOptions extends ResolvedCorsOptions, CorsOptionsDelegate<CorsRequest> {
1783
- isDev?: boolean;
1784
- whiteList?: string[];
1803
+ declare interface I_CorsOptionsNestJS extends I_BaseCorsOptions, CorsOptions_2 {
1804
+ }
1805
+
1806
+ declare interface I_CorsOptionsNodeJS extends I_BaseCorsOptions, CorsOptions, CorsOptionsDelegate<CorsRequest> {
1785
1807
  }
1786
- export { I_CorsOptions }
1787
- export { I_CorsOptions as I_CorsOptions_alias_1 }
1788
- export { I_CorsOptions as I_CorsOptions_alias_2 }
1789
- export { I_CorsOptions as I_CorsOptions_alias_3 }
1790
1808
 
1791
1809
  declare interface I_CreateModelOptions<T extends Partial<C_Document>> extends I_MongooseOptions<T> {
1792
1810
  schema: T_Input_MongooseSchema<T>;
@@ -1843,8 +1861,7 @@ export { I_EslintError as I_EslintError_alias_2 }
1843
1861
  export { I_EslintError as I_EslintError_alias_3 }
1844
1862
 
1845
1863
  declare interface I_ExpressOptions {
1846
- staticFolder: string;
1847
- sessionOptions?: SessionOptions;
1864
+ staticFolder?: string;
1848
1865
  }
1849
1866
  export { I_ExpressOptions }
1850
1867
  export { I_ExpressOptions as I_ExpressOptions_alias_1 }
@@ -2096,6 +2113,17 @@ export { I_MongooseOptions as I_MongooseOptions_alias_1 }
2096
2113
  export { I_MongooseOptions as I_MongooseOptions_alias_2 }
2097
2114
  export { I_MongooseOptions as I_MongooseOptions_alias_3 }
2098
2115
 
2116
+ declare interface I_NestOptions {
2117
+ module: Type<object>;
2118
+ staticFolder?: string;
2119
+ filters?: ExceptionFilter[];
2120
+ pipes?: ValidationPipe[];
2121
+ }
2122
+ export { I_NestOptions }
2123
+ export { I_NestOptions as I_NestOptions_alias_1 }
2124
+ export { I_NestOptions as I_NestOptions_alias_2 }
2125
+ export { I_NestOptions as I_NestOptions_alias_3 }
2126
+
2099
2127
  declare interface I_NextIntlContext {
2100
2128
  languages: I_NextIntlLanguage[];
2101
2129
  currentLanguage: I_NextIntlLanguage;
@@ -2684,10 +2712,6 @@ export { resolveCommands as resolveCommands_alias_1 }
2684
2712
  export { resolveCommands as resolveCommands_alias_2 }
2685
2713
  export { resolveCommands as resolveCommands_alias_3 }
2686
2714
 
2687
- declare type ResolvedCorsOptions = Partial<CorsOptions> & Partial<CorsOptions_2> & {
2688
- origin?: CorsOptions['origin'] | CorsOptions_2['origin'];
2689
- };
2690
-
2691
2715
  declare function resolveWorkingPath(...urls: string[]): string;
2692
2716
  export { resolveWorkingPath }
2693
2717
  export { resolveWorkingPath as resolveWorkingPath_alias_1 }
@@ -3103,6 +3127,18 @@ export { T_ConfigType }
3103
3127
  export { T_ConfigType as T_ConfigType_alias_1 }
3104
3128
  export { T_ConfigType as T_ConfigType_alias_2 }
3105
3129
 
3130
+ declare type T_CorsOptions<T extends T_CorsType> = T extends 'node' ? I_CorsOptionsNodeJS : I_CorsOptionsNestJS;
3131
+ export { T_CorsOptions }
3132
+ export { T_CorsOptions as T_CorsOptions_alias_1 }
3133
+ export { T_CorsOptions as T_CorsOptions_alias_2 }
3134
+ export { T_CorsOptions as T_CorsOptions_alias_3 }
3135
+
3136
+ declare type T_CorsType = 'node' | 'nest';
3137
+ export { T_CorsType }
3138
+ export { T_CorsType as T_CorsType_alias_1 }
3139
+ export { T_CorsType as T_CorsType_alias_2 }
3140
+ export { T_CorsType as T_CorsType_alias_3 }
3141
+
3106
3142
  declare type T_DeleteResult = DeleteResult;
3107
3143
  export { T_DeleteResult }
3108
3144
  export { T_DeleteResult as T_DeleteResult_alias_1 }
@@ -9,6 +9,7 @@ import type { ApolloError as ApolloError_2 } from '@apollo/client';
9
9
  import type { ApolloLink } from '@apollo/client';
10
10
  import { ApolloServer } from '@apollo/server';
11
11
  import type { Application } from 'express';
12
+ import bodyParser from 'body-parser';
12
13
  import type { Buffer as Buffer_2 } from 'node:buffer';
13
14
  import type { ClientSession } from 'mongoose';
14
15
  import type { CodegenConfig } from '@graphql-codegen/cli';
@@ -28,6 +29,7 @@ import { Disposable as Disposable_2 } from 'graphql-ws';
28
29
  import { Document as Document_2 } from 'mongoose';
29
30
  import type { ErrorHandlingMiddlewareFunction } from 'mongoose';
30
31
  import type { ErrorHandlingMiddlewareWithOption } from 'mongoose';
32
+ import type { ExceptionFilter } from '@nestjs/common';
31
33
  import express from 'express';
32
34
  import { expressMiddleware } from '@apollo/server/express4';
33
35
  import type { Filter } from 'mongodb';
@@ -37,6 +39,7 @@ import type { GraphQLSchema } from 'graphql';
37
39
  import { I_ApolloErrorContext as I_ApolloErrorContext_2 } from './apollo-error.type.js';
38
40
  import { I_Command as I_Command_2 } from './command.type.js';
39
41
  import { I_LoadingContext as I_LoadingContext_2 } from './loading.type.js';
42
+ import type { INestApplication } from '@nestjs/common';
40
43
  import type { InitOptions } from 'i18next';
41
44
  import type { InsertManyOptions } from 'mongoose';
42
45
  import type { InsertManyResult } from 'mongodb';
@@ -81,12 +84,14 @@ import { TFunction } from 'i18next';
81
84
  import type { Timezone } from 'next-intl';
82
85
  import { toast } from 'react-hot-toast';
83
86
  import { Toaster } from 'react-hot-toast';
87
+ import type { Type } from '@nestjs/common';
84
88
  import type { UpdateQuery } from 'mongoose';
85
89
  import type { UpdateResult } from 'mongodb';
86
90
  import type { UriFunction } from '@apollo/client';
87
91
  import type { UserConfig } from 'vite';
88
92
  import { useTranslation } from 'react-i18next';
89
93
  import { useTranslations } from 'next-intl';
94
+ import type { ValidationPipe } from '@nestjs/common';
90
95
  import { WebSocketServer } from 'ws';
91
96
  import type { WithId } from 'mongodb';
92
97
 
@@ -142,6 +147,11 @@ export { appendFileSync as appendFileSync_alias_1 }
142
147
  export { appendFileSync as appendFileSync_alias_2 }
143
148
  export { appendFileSync as appendFileSync_alias_3 }
144
149
 
150
+ export { bodyParser }
151
+ export { bodyParser as bodyParser_alias_1 }
152
+ export { bodyParser as bodyParser_alias_2 }
153
+ export { bodyParser as bodyParser_alias_3 }
154
+
145
155
  declare const BUILD_DIRECTORY = "dist";
146
156
  export { BUILD_DIRECTORY }
147
157
  export { BUILD_DIRECTORY as BUILD_DIRECTORY_alias_1 }
@@ -246,7 +256,7 @@ export { createApolloServer as createApolloServer_alias_1 }
246
256
  export { createApolloServer as createApolloServer_alias_2 }
247
257
  export { createApolloServer as createApolloServer_alias_3 }
248
258
 
249
- declare function createCors({ isDev, whiteList, ...rest }: I_CorsOptions): (req: cors.CorsRequest, res: {
259
+ declare function createCors<T extends T_CorsType>({ isDev, whiteList, ...rest }: T_CorsOptions<T>): (req: cors.CorsRequest, res: {
250
260
  statusCode?: number | undefined;
251
261
  setHeader(key: string, value: string): any;
252
262
  end(): any;
@@ -256,7 +266,7 @@ export { createCors as createCors_alias_1 }
256
266
  export { createCors as createCors_alias_2 }
257
267
  export { createCors as createCors_alias_3 }
258
268
 
259
- declare function createExpress(options: I_ExpressOptions): Application;
269
+ declare function createExpress(options?: I_ExpressOptions): Application;
260
270
  export { createExpress }
261
271
  export { createExpress as createExpress_alias_1 }
262
272
  export { createExpress as createExpress_alias_2 }
@@ -281,6 +291,12 @@ export { createGraphqlCodegenConfig as createGraphqlCodegenConfig_alias_1 }
281
291
  export { createGraphqlCodegenConfig as createGraphqlCodegenConfig_alias_2 }
282
292
  export { createGraphqlCodegenConfig as createGraphqlCodegenConfig_alias_3 }
283
293
 
294
+ declare function createNest(options: I_NestOptions): Promise<INestApplication>;
295
+ export { createNest }
296
+ export { createNest as createNest_alias_1 }
297
+ export { createNest as createNest_alias_2 }
298
+ export { createNest as createNest_alias_3 }
299
+
284
300
  declare function createSession(options: SessionOptions): RequestHandler;
285
301
  export { createSession }
286
302
  export { createSession as createSession_alias_1 }
@@ -1731,6 +1747,11 @@ export { I_ApolloServerOptions as I_ApolloServerOptions_alias_1 }
1731
1747
  export { I_ApolloServerOptions as I_ApolloServerOptions_alias_2 }
1732
1748
  export { I_ApolloServerOptions as I_ApolloServerOptions_alias_3 }
1733
1749
 
1750
+ declare interface I_BaseCorsOptions {
1751
+ isDev?: boolean;
1752
+ whiteList?: string[];
1753
+ }
1754
+
1734
1755
  declare interface I_CheckPackage {
1735
1756
  isCurrentProject: boolean;
1736
1757
  installedPath: string;
@@ -1779,14 +1800,11 @@ export { I_CopySyncOptions as I_CopySyncOptions_alias_1 }
1779
1800
  export { I_CopySyncOptions as I_CopySyncOptions_alias_2 }
1780
1801
  export { I_CopySyncOptions as I_CopySyncOptions_alias_3 }
1781
1802
 
1782
- declare interface I_CorsOptions extends ResolvedCorsOptions, CorsOptionsDelegate<CorsRequest> {
1783
- isDev?: boolean;
1784
- whiteList?: string[];
1803
+ declare interface I_CorsOptionsNestJS extends I_BaseCorsOptions, CorsOptions_2 {
1804
+ }
1805
+
1806
+ declare interface I_CorsOptionsNodeJS extends I_BaseCorsOptions, CorsOptions, CorsOptionsDelegate<CorsRequest> {
1785
1807
  }
1786
- export { I_CorsOptions }
1787
- export { I_CorsOptions as I_CorsOptions_alias_1 }
1788
- export { I_CorsOptions as I_CorsOptions_alias_2 }
1789
- export { I_CorsOptions as I_CorsOptions_alias_3 }
1790
1808
 
1791
1809
  declare interface I_CreateModelOptions<T extends Partial<C_Document>> extends I_MongooseOptions<T> {
1792
1810
  schema: T_Input_MongooseSchema<T>;
@@ -1843,8 +1861,7 @@ export { I_EslintError as I_EslintError_alias_2 }
1843
1861
  export { I_EslintError as I_EslintError_alias_3 }
1844
1862
 
1845
1863
  declare interface I_ExpressOptions {
1846
- staticFolder: string;
1847
- sessionOptions?: SessionOptions;
1864
+ staticFolder?: string;
1848
1865
  }
1849
1866
  export { I_ExpressOptions }
1850
1867
  export { I_ExpressOptions as I_ExpressOptions_alias_1 }
@@ -2096,6 +2113,17 @@ export { I_MongooseOptions as I_MongooseOptions_alias_1 }
2096
2113
  export { I_MongooseOptions as I_MongooseOptions_alias_2 }
2097
2114
  export { I_MongooseOptions as I_MongooseOptions_alias_3 }
2098
2115
 
2116
+ declare interface I_NestOptions {
2117
+ module: Type<object>;
2118
+ staticFolder?: string;
2119
+ filters?: ExceptionFilter[];
2120
+ pipes?: ValidationPipe[];
2121
+ }
2122
+ export { I_NestOptions }
2123
+ export { I_NestOptions as I_NestOptions_alias_1 }
2124
+ export { I_NestOptions as I_NestOptions_alias_2 }
2125
+ export { I_NestOptions as I_NestOptions_alias_3 }
2126
+
2099
2127
  declare interface I_NextIntlContext {
2100
2128
  languages: I_NextIntlLanguage[];
2101
2129
  currentLanguage: I_NextIntlLanguage;
@@ -2684,10 +2712,6 @@ export { resolveCommands as resolveCommands_alias_1 }
2684
2712
  export { resolveCommands as resolveCommands_alias_2 }
2685
2713
  export { resolveCommands as resolveCommands_alias_3 }
2686
2714
 
2687
- declare type ResolvedCorsOptions = Partial<CorsOptions> & Partial<CorsOptions_2> & {
2688
- origin?: CorsOptions['origin'] | CorsOptions_2['origin'];
2689
- };
2690
-
2691
2715
  declare function resolveWorkingPath(...urls: string[]): string;
2692
2716
  export { resolveWorkingPath }
2693
2717
  export { resolveWorkingPath as resolveWorkingPath_alias_1 }
@@ -3103,6 +3127,18 @@ export { T_ConfigType }
3103
3127
  export { T_ConfigType as T_ConfigType_alias_1 }
3104
3128
  export { T_ConfigType as T_ConfigType_alias_2 }
3105
3129
 
3130
+ declare type T_CorsOptions<T extends T_CorsType> = T extends 'node' ? I_CorsOptionsNodeJS : I_CorsOptionsNestJS;
3131
+ export { T_CorsOptions }
3132
+ export { T_CorsOptions as T_CorsOptions_alias_1 }
3133
+ export { T_CorsOptions as T_CorsOptions_alias_2 }
3134
+ export { T_CorsOptions as T_CorsOptions_alias_3 }
3135
+
3136
+ declare type T_CorsType = 'node' | 'nest';
3137
+ export { T_CorsType }
3138
+ export { T_CorsType as T_CorsType_alias_1 }
3139
+ export { T_CorsType as T_CorsType_alias_2 }
3140
+ export { T_CorsType as T_CorsType_alias_3 }
3141
+
3106
3142
  declare type T_DeleteResult = DeleteResult;
3107
3143
  export { T_DeleteResult }
3108
3144
  export { T_DeleteResult as T_DeleteResult_alias_1 }