@cyberskill/shared 1.112.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';
@@ -19,6 +20,7 @@ import { Context } from 'react';
19
20
  import type { CopySyncOptions } from 'node:fs';
20
21
  import cors from 'cors';
21
22
  import type { CorsOptions } from 'cors';
23
+ import type { CorsOptions as CorsOptions_2 } from '@nestjs/common/interfaces/external/cors-options.interface.js';
22
24
  import type { CorsOptionsDelegate } from 'cors';
23
25
  import type { CorsRequest } from 'cors';
24
26
  import { Db } from 'mongodb';
@@ -27,6 +29,7 @@ import { Disposable as Disposable_2 } from 'graphql-ws';
27
29
  import { Document as Document_2 } from 'mongoose';
28
30
  import type { ErrorHandlingMiddlewareFunction } from 'mongoose';
29
31
  import type { ErrorHandlingMiddlewareWithOption } from 'mongoose';
32
+ import type { ExceptionFilter } from '@nestjs/common';
30
33
  import express from 'express';
31
34
  import { expressMiddleware } from '@apollo/server/express4';
32
35
  import type { Filter } from 'mongodb';
@@ -36,6 +39,7 @@ import type { GraphQLSchema } from 'graphql';
36
39
  import { I_ApolloErrorContext as I_ApolloErrorContext_2 } from './apollo-error.type.js';
37
40
  import { I_Command as I_Command_2 } from './command.type.js';
38
41
  import { I_LoadingContext as I_LoadingContext_2 } from './loading.type.js';
42
+ import type { INestApplication } from '@nestjs/common';
39
43
  import type { InitOptions } from 'i18next';
40
44
  import type { InsertManyOptions } from 'mongoose';
41
45
  import type { InsertManyResult } from 'mongodb';
@@ -68,6 +72,7 @@ import { default as React_2 } from 'react';
68
72
  import type { ReactElement } from 'react';
69
73
  import type { ReactNode } from 'react';
70
74
  import { Request as Request_2 } from 'express';
75
+ import type { RequestHandler } from 'express';
71
76
  import { Response as Response_2 } from 'express';
72
77
  import { Router } from 'express';
73
78
  import type { Schema } from 'mongoose';
@@ -79,12 +84,14 @@ import { TFunction } from 'i18next';
79
84
  import type { Timezone } from 'next-intl';
80
85
  import { toast } from 'react-hot-toast';
81
86
  import { Toaster } from 'react-hot-toast';
87
+ import type { Type } from '@nestjs/common';
82
88
  import type { UpdateQuery } from 'mongoose';
83
89
  import type { UpdateResult } from 'mongodb';
84
90
  import type { UriFunction } from '@apollo/client';
85
91
  import type { UserConfig } from 'vite';
86
92
  import { useTranslation } from 'react-i18next';
87
93
  import { useTranslations } from 'next-intl';
94
+ import type { ValidationPipe } from '@nestjs/common';
88
95
  import { WebSocketServer } from 'ws';
89
96
  import type { WithId } from 'mongodb';
90
97
 
@@ -140,6 +147,11 @@ export { appendFileSync as appendFileSync_alias_1 }
140
147
  export { appendFileSync as appendFileSync_alias_2 }
141
148
  export { appendFileSync as appendFileSync_alias_3 }
142
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
+
143
155
  declare const BUILD_DIRECTORY = "dist";
144
156
  export { BUILD_DIRECTORY }
145
157
  export { BUILD_DIRECTORY as BUILD_DIRECTORY_alias_1 }
@@ -244,7 +256,7 @@ export { createApolloServer as createApolloServer_alias_1 }
244
256
  export { createApolloServer as createApolloServer_alias_2 }
245
257
  export { createApolloServer as createApolloServer_alias_3 }
246
258
 
247
- 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: {
248
260
  statusCode?: number | undefined;
249
261
  setHeader(key: string, value: string): any;
250
262
  end(): any;
@@ -254,7 +266,7 @@ export { createCors as createCors_alias_1 }
254
266
  export { createCors as createCors_alias_2 }
255
267
  export { createCors as createCors_alias_3 }
256
268
 
257
- declare function createExpress(options: I_ExpressOptions): Application;
269
+ declare function createExpress(options?: I_ExpressOptions): Application;
258
270
  export { createExpress }
259
271
  export { createExpress as createExpress_alias_1 }
260
272
  export { createExpress as createExpress_alias_2 }
@@ -279,6 +291,18 @@ export { createGraphqlCodegenConfig as createGraphqlCodegenConfig_alias_1 }
279
291
  export { createGraphqlCodegenConfig as createGraphqlCodegenConfig_alias_2 }
280
292
  export { createGraphqlCodegenConfig as createGraphqlCodegenConfig_alias_3 }
281
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
+
300
+ declare function createSession(options: SessionOptions): RequestHandler;
301
+ export { createSession }
302
+ export { createSession as createSession_alias_1 }
303
+ export { createSession as createSession_alias_2 }
304
+ export { createSession as createSession_alias_3 }
305
+
282
306
  declare function createWSServer(options: I_WSOptions): WebSocketServer;
283
307
  export { createWSServer }
284
308
  export { createWSServer as createWSServer_alias_1 }
@@ -1723,6 +1747,11 @@ export { I_ApolloServerOptions as I_ApolloServerOptions_alias_1 }
1723
1747
  export { I_ApolloServerOptions as I_ApolloServerOptions_alias_2 }
1724
1748
  export { I_ApolloServerOptions as I_ApolloServerOptions_alias_3 }
1725
1749
 
1750
+ declare interface I_BaseCorsOptions {
1751
+ isDev?: boolean;
1752
+ whiteList?: string[];
1753
+ }
1754
+
1726
1755
  declare interface I_CheckPackage {
1727
1756
  isCurrentProject: boolean;
1728
1757
  installedPath: string;
@@ -1771,14 +1800,11 @@ export { I_CopySyncOptions as I_CopySyncOptions_alias_1 }
1771
1800
  export { I_CopySyncOptions as I_CopySyncOptions_alias_2 }
1772
1801
  export { I_CopySyncOptions as I_CopySyncOptions_alias_3 }
1773
1802
 
1774
- declare interface I_CorsOptions extends CorsOptions, CorsOptionsDelegate<CorsRequest> {
1775
- isDev?: boolean;
1776
- 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> {
1777
1807
  }
1778
- export { I_CorsOptions }
1779
- export { I_CorsOptions as I_CorsOptions_alias_1 }
1780
- export { I_CorsOptions as I_CorsOptions_alias_2 }
1781
- export { I_CorsOptions as I_CorsOptions_alias_3 }
1782
1808
 
1783
1809
  declare interface I_CreateModelOptions<T extends Partial<C_Document>> extends I_MongooseOptions<T> {
1784
1810
  schema: T_Input_MongooseSchema<T>;
@@ -1835,8 +1861,7 @@ export { I_EslintError as I_EslintError_alias_2 }
1835
1861
  export { I_EslintError as I_EslintError_alias_3 }
1836
1862
 
1837
1863
  declare interface I_ExpressOptions {
1838
- staticFolder: string;
1839
- sessionOptions?: SessionOptions;
1864
+ staticFolder?: string;
1840
1865
  }
1841
1866
  export { I_ExpressOptions }
1842
1867
  export { I_ExpressOptions as I_ExpressOptions_alias_1 }
@@ -2088,6 +2113,17 @@ export { I_MongooseOptions as I_MongooseOptions_alias_1 }
2088
2113
  export { I_MongooseOptions as I_MongooseOptions_alias_2 }
2089
2114
  export { I_MongooseOptions as I_MongooseOptions_alias_3 }
2090
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
+
2091
2127
  declare interface I_NextIntlContext {
2092
2128
  languages: I_NextIntlLanguage[];
2093
2129
  currentLanguage: I_NextIntlLanguage;
@@ -3091,6 +3127,18 @@ export { T_ConfigType }
3091
3127
  export { T_ConfigType as T_ConfigType_alias_1 }
3092
3128
  export { T_ConfigType as T_ConfigType_alias_2 }
3093
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
+
3094
3142
  declare type T_DeleteResult = DeleteResult;
3095
3143
  export { T_DeleteResult }
3096
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';
@@ -19,6 +20,7 @@ import { Context } from 'react';
19
20
  import type { CopySyncOptions } from 'node:fs';
20
21
  import cors from 'cors';
21
22
  import type { CorsOptions } from 'cors';
23
+ import type { CorsOptions as CorsOptions_2 } from '@nestjs/common/interfaces/external/cors-options.interface.js';
22
24
  import type { CorsOptionsDelegate } from 'cors';
23
25
  import type { CorsRequest } from 'cors';
24
26
  import { Db } from 'mongodb';
@@ -27,6 +29,7 @@ import { Disposable as Disposable_2 } from 'graphql-ws';
27
29
  import { Document as Document_2 } from 'mongoose';
28
30
  import type { ErrorHandlingMiddlewareFunction } from 'mongoose';
29
31
  import type { ErrorHandlingMiddlewareWithOption } from 'mongoose';
32
+ import type { ExceptionFilter } from '@nestjs/common';
30
33
  import express from 'express';
31
34
  import { expressMiddleware } from '@apollo/server/express4';
32
35
  import type { Filter } from 'mongodb';
@@ -36,6 +39,7 @@ import type { GraphQLSchema } from 'graphql';
36
39
  import { I_ApolloErrorContext as I_ApolloErrorContext_2 } from './apollo-error.type.js';
37
40
  import { I_Command as I_Command_2 } from './command.type.js';
38
41
  import { I_LoadingContext as I_LoadingContext_2 } from './loading.type.js';
42
+ import type { INestApplication } from '@nestjs/common';
39
43
  import type { InitOptions } from 'i18next';
40
44
  import type { InsertManyOptions } from 'mongoose';
41
45
  import type { InsertManyResult } from 'mongodb';
@@ -68,6 +72,7 @@ import { default as React_2 } from 'react';
68
72
  import type { ReactElement } from 'react';
69
73
  import type { ReactNode } from 'react';
70
74
  import { Request as Request_2 } from 'express';
75
+ import type { RequestHandler } from 'express';
71
76
  import { Response as Response_2 } from 'express';
72
77
  import { Router } from 'express';
73
78
  import type { Schema } from 'mongoose';
@@ -79,12 +84,14 @@ import { TFunction } from 'i18next';
79
84
  import type { Timezone } from 'next-intl';
80
85
  import { toast } from 'react-hot-toast';
81
86
  import { Toaster } from 'react-hot-toast';
87
+ import type { Type } from '@nestjs/common';
82
88
  import type { UpdateQuery } from 'mongoose';
83
89
  import type { UpdateResult } from 'mongodb';
84
90
  import type { UriFunction } from '@apollo/client';
85
91
  import type { UserConfig } from 'vite';
86
92
  import { useTranslation } from 'react-i18next';
87
93
  import { useTranslations } from 'next-intl';
94
+ import type { ValidationPipe } from '@nestjs/common';
88
95
  import { WebSocketServer } from 'ws';
89
96
  import type { WithId } from 'mongodb';
90
97
 
@@ -140,6 +147,11 @@ export { appendFileSync as appendFileSync_alias_1 }
140
147
  export { appendFileSync as appendFileSync_alias_2 }
141
148
  export { appendFileSync as appendFileSync_alias_3 }
142
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
+
143
155
  declare const BUILD_DIRECTORY = "dist";
144
156
  export { BUILD_DIRECTORY }
145
157
  export { BUILD_DIRECTORY as BUILD_DIRECTORY_alias_1 }
@@ -244,7 +256,7 @@ export { createApolloServer as createApolloServer_alias_1 }
244
256
  export { createApolloServer as createApolloServer_alias_2 }
245
257
  export { createApolloServer as createApolloServer_alias_3 }
246
258
 
247
- 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: {
248
260
  statusCode?: number | undefined;
249
261
  setHeader(key: string, value: string): any;
250
262
  end(): any;
@@ -254,7 +266,7 @@ export { createCors as createCors_alias_1 }
254
266
  export { createCors as createCors_alias_2 }
255
267
  export { createCors as createCors_alias_3 }
256
268
 
257
- declare function createExpress(options: I_ExpressOptions): Application;
269
+ declare function createExpress(options?: I_ExpressOptions): Application;
258
270
  export { createExpress }
259
271
  export { createExpress as createExpress_alias_1 }
260
272
  export { createExpress as createExpress_alias_2 }
@@ -279,6 +291,18 @@ export { createGraphqlCodegenConfig as createGraphqlCodegenConfig_alias_1 }
279
291
  export { createGraphqlCodegenConfig as createGraphqlCodegenConfig_alias_2 }
280
292
  export { createGraphqlCodegenConfig as createGraphqlCodegenConfig_alias_3 }
281
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
+
300
+ declare function createSession(options: SessionOptions): RequestHandler;
301
+ export { createSession }
302
+ export { createSession as createSession_alias_1 }
303
+ export { createSession as createSession_alias_2 }
304
+ export { createSession as createSession_alias_3 }
305
+
282
306
  declare function createWSServer(options: I_WSOptions): WebSocketServer;
283
307
  export { createWSServer }
284
308
  export { createWSServer as createWSServer_alias_1 }
@@ -1723,6 +1747,11 @@ export { I_ApolloServerOptions as I_ApolloServerOptions_alias_1 }
1723
1747
  export { I_ApolloServerOptions as I_ApolloServerOptions_alias_2 }
1724
1748
  export { I_ApolloServerOptions as I_ApolloServerOptions_alias_3 }
1725
1749
 
1750
+ declare interface I_BaseCorsOptions {
1751
+ isDev?: boolean;
1752
+ whiteList?: string[];
1753
+ }
1754
+
1726
1755
  declare interface I_CheckPackage {
1727
1756
  isCurrentProject: boolean;
1728
1757
  installedPath: string;
@@ -1771,14 +1800,11 @@ export { I_CopySyncOptions as I_CopySyncOptions_alias_1 }
1771
1800
  export { I_CopySyncOptions as I_CopySyncOptions_alias_2 }
1772
1801
  export { I_CopySyncOptions as I_CopySyncOptions_alias_3 }
1773
1802
 
1774
- declare interface I_CorsOptions extends CorsOptions, CorsOptionsDelegate<CorsRequest> {
1775
- isDev?: boolean;
1776
- 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> {
1777
1807
  }
1778
- export { I_CorsOptions }
1779
- export { I_CorsOptions as I_CorsOptions_alias_1 }
1780
- export { I_CorsOptions as I_CorsOptions_alias_2 }
1781
- export { I_CorsOptions as I_CorsOptions_alias_3 }
1782
1808
 
1783
1809
  declare interface I_CreateModelOptions<T extends Partial<C_Document>> extends I_MongooseOptions<T> {
1784
1810
  schema: T_Input_MongooseSchema<T>;
@@ -1835,8 +1861,7 @@ export { I_EslintError as I_EslintError_alias_2 }
1835
1861
  export { I_EslintError as I_EslintError_alias_3 }
1836
1862
 
1837
1863
  declare interface I_ExpressOptions {
1838
- staticFolder: string;
1839
- sessionOptions?: SessionOptions;
1864
+ staticFolder?: string;
1840
1865
  }
1841
1866
  export { I_ExpressOptions }
1842
1867
  export { I_ExpressOptions as I_ExpressOptions_alias_1 }
@@ -2088,6 +2113,17 @@ export { I_MongooseOptions as I_MongooseOptions_alias_1 }
2088
2113
  export { I_MongooseOptions as I_MongooseOptions_alias_2 }
2089
2114
  export { I_MongooseOptions as I_MongooseOptions_alias_3 }
2090
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
+
2091
2127
  declare interface I_NextIntlContext {
2092
2128
  languages: I_NextIntlLanguage[];
2093
2129
  currentLanguage: I_NextIntlLanguage;
@@ -3091,6 +3127,18 @@ export { T_ConfigType }
3091
3127
  export { T_ConfigType as T_ConfigType_alias_1 }
3092
3128
  export { T_ConfigType as T_ConfigType_alias_2 }
3093
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
+
3094
3142
  declare type T_DeleteResult = DeleteResult;
3095
3143
  export { T_DeleteResult }
3096
3144
  export { T_DeleteResult as T_DeleteResult_alias_1 }