@cyberskill/shared 1.194.0 → 1.197.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.
- package/README.md +323 -61
- package/dist/_tsup-dts-rollup.d.cts +3 -22
- package/dist/_tsup-dts-rollup.d.ts +3 -22
- package/dist/node/cli/cli.util.cjs +1 -1
- package/dist/node/cli/cli.util.js +1 -1
- package/dist/node/cli/index.cjs +1 -1
- package/dist/node/cli/index.js +1 -1
- package/dist/node/express/express.util.cjs +1 -1
- package/dist/node/express/express.util.js +1 -1
- package/dist/node/express/index.cjs +1 -1
- package/dist/node/express/index.js +1 -1
- package/dist/node/index.cjs +1 -1
- package/dist/node/index.js +1 -1
- package/dist/react/apollo-client/apollo-client.component.cjs +1 -1
- package/dist/react/apollo-client/apollo-client.component.js +1 -1
- package/dist/react/apollo-client/apollo-client.type.d.cts +0 -1
- package/dist/react/apollo-client/apollo-client.type.d.ts +0 -1
- package/dist/react/apollo-client/apollo-client.util.cjs +1 -1
- package/dist/react/apollo-client/apollo-client.util.js +1 -1
- package/dist/react/apollo-client/index.cjs +1 -1
- package/dist/react/apollo-client/index.d.cts +0 -1
- package/dist/react/apollo-client/index.d.ts +0 -1
- package/dist/react/apollo-client/index.js +1 -1
- package/dist/react/index.cjs +1 -1
- package/dist/react/index.d.cts +0 -1
- package/dist/react/index.d.ts +0 -1
- package/dist/react/index.js +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -1,98 +1,360 @@
|
|
|
1
|
-
<
|
|
1
|
+
<div align="center">
|
|
2
2
|
<img src="https://res.cloudinary.com/cyberskill/image/upload/v1742786793/cyberskill/favicon/favicon-96x96.png" width="96" height="96" alt="CyberSkill Logo">
|
|
3
|
-
</p>
|
|
4
3
|
|
|
5
|
-
|
|
4
|
+
# CyberSkill Shared
|
|
6
5
|
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
6
|
+
**A comprehensive utility library for consistent development across CyberSkill projects**
|
|
7
|
+
|
|
8
|
+
[](https://npmjs.com/package/@cyberskill/shared)
|
|
9
|
+
[](https://npmjs.com/package/@cyberskill/shared)
|
|
10
|
+
[](https://opensource.org/licenses/MIT)
|
|
11
|
+
[](https://www.typescriptlang.org/)
|
|
12
|
+
[](https://nodejs.org/)
|
|
13
|
+
|
|
14
|
+
</div>
|
|
15
|
+
|
|
16
|
+
---
|
|
17
|
+
|
|
18
|
+
## 📋 Table of Contents
|
|
19
|
+
|
|
20
|
+
- [Overview](#overview)
|
|
21
|
+
- [Features](#features)
|
|
22
|
+
- [Installation](#installation)
|
|
23
|
+
- [Quick Start](#quick-start)
|
|
24
|
+
- [Documentation](#documentation)
|
|
25
|
+
- [API Reference](#api-reference)
|
|
26
|
+
- [Development](#development)
|
|
27
|
+
- [Contributing](#contributing)
|
|
28
|
+
- [License](#license)
|
|
10
29
|
|
|
11
30
|
---
|
|
12
31
|
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
<img src="https://img.shields.io/badge/license-MIT-blue" alt="License">
|
|
25
|
-
</a>
|
|
26
|
-
</p>
|
|
32
|
+
## 📖 Overview
|
|
33
|
+
|
|
34
|
+
CyberSkill Shared is a modular, TypeScript-first utility library designed to standardize development practices across CyberSkill projects. Built with enterprise-grade architecture, it provides a comprehensive suite of utilities, configurations, and components that ensure consistency, maintainability, and developer productivity.
|
|
35
|
+
|
|
36
|
+
### 🎯 Key Benefits
|
|
37
|
+
|
|
38
|
+
- **🔄 Consistency**: Standardized patterns and utilities across all projects
|
|
39
|
+
- **⚡ Productivity**: Pre-built solutions for common development tasks
|
|
40
|
+
- **🛡️ Reliability**: Type-safe implementations with comprehensive testing
|
|
41
|
+
- **📈 Scalability**: Modular architecture that grows with your needs
|
|
42
|
+
- **🔧 Maintainability**: Well-documented, clean, and extensible codebase
|
|
27
43
|
|
|
28
44
|
---
|
|
29
45
|
|
|
30
|
-
##
|
|
46
|
+
## ✨ Features
|
|
47
|
+
|
|
48
|
+
### 🛠️ Core Utilities
|
|
31
49
|
|
|
32
|
-
|
|
50
|
+
- **Type-safe utilities** for common operations
|
|
51
|
+
- **Object manipulation** and validation helpers
|
|
52
|
+
- **String processing** and formatting functions
|
|
53
|
+
- **Serialization** and data transformation tools
|
|
33
54
|
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
-
|
|
55
|
+
### ⚙️ Configuration Management
|
|
56
|
+
|
|
57
|
+
- **Environment configuration** with type safety
|
|
58
|
+
- **ESLint configurations** for consistent code quality
|
|
59
|
+
- **Testing setups** for unit and integration tests
|
|
60
|
+
- **Build tool configurations** optimized for performance
|
|
61
|
+
|
|
62
|
+
### 🌐 Node.js Modules
|
|
63
|
+
|
|
64
|
+
- **Express.js utilities** for API development
|
|
65
|
+
- **MongoDB integration** helpers
|
|
66
|
+
- **WebSocket management** tools
|
|
67
|
+
- **File system operations** with enhanced error handling
|
|
68
|
+
- **CLI development** utilities
|
|
69
|
+
|
|
70
|
+
### ⚛️ React Components
|
|
71
|
+
|
|
72
|
+
- **Apollo Client** integration and error handling
|
|
73
|
+
- **Internationalization** (i18n) support
|
|
74
|
+
- **Loading states** and user feedback components
|
|
75
|
+
- **Storage management** hooks and utilities
|
|
76
|
+
- **Toast notifications** system
|
|
77
|
+
|
|
78
|
+
### 📝 TypeScript Support
|
|
79
|
+
|
|
80
|
+
- **Comprehensive type definitions**
|
|
81
|
+
- **React component types**
|
|
82
|
+
- **Utility type helpers**
|
|
83
|
+
- **Style declaration files**
|
|
37
84
|
|
|
38
85
|
---
|
|
39
86
|
|
|
40
|
-
## 🚀
|
|
87
|
+
## 🚀 Installation
|
|
88
|
+
|
|
89
|
+
### Prerequisites
|
|
41
90
|
|
|
42
|
-
|
|
91
|
+
- Node.js 18+
|
|
92
|
+
- pnpm 8+
|
|
93
|
+
|
|
94
|
+
### Install Package
|
|
43
95
|
|
|
44
96
|
```bash
|
|
45
|
-
pnpm
|
|
97
|
+
# Using pnpm (recommended)
|
|
98
|
+
pnpm add @cyberskill/shared
|
|
99
|
+
|
|
100
|
+
# Using npm
|
|
101
|
+
npm install @cyberskill/shared
|
|
102
|
+
|
|
103
|
+
# Using yarn
|
|
104
|
+
yarn add @cyberskill/shared
|
|
105
|
+
```
|
|
106
|
+
|
|
107
|
+
---
|
|
108
|
+
|
|
109
|
+
## 🏃 Quick Start
|
|
110
|
+
|
|
111
|
+
### Basic Usage
|
|
112
|
+
|
|
113
|
+
```typescript
|
|
114
|
+
import { formatCurrency, validateEmail } from '@cyberskill/shared';
|
|
115
|
+
|
|
116
|
+
// Validate email
|
|
117
|
+
const isValid = validateEmail('user@example.com');
|
|
118
|
+
|
|
119
|
+
// Format currency
|
|
120
|
+
const formatted = formatCurrency(1234.56, 'USD');
|
|
46
121
|
```
|
|
47
122
|
|
|
123
|
+
### React Components
|
|
124
|
+
|
|
125
|
+
```tsx
|
|
126
|
+
import { LoadingProvider, useLoading } from '@cyberskill/shared';
|
|
127
|
+
|
|
128
|
+
function App() {
|
|
129
|
+
return (
|
|
130
|
+
<LoadingProvider>
|
|
131
|
+
<MyComponent />
|
|
132
|
+
</LoadingProvider>
|
|
133
|
+
);
|
|
134
|
+
}
|
|
135
|
+
|
|
136
|
+
function MyComponent() {
|
|
137
|
+
const { showLoading, hideLoading } = useLoading();
|
|
138
|
+
|
|
139
|
+
// Use loading states
|
|
140
|
+
return <div>Your component</div>;
|
|
141
|
+
}
|
|
142
|
+
```
|
|
143
|
+
|
|
144
|
+
---
|
|
145
|
+
|
|
146
|
+
## 📚 Documentation
|
|
147
|
+
|
|
148
|
+
For detailed documentation, visit our [documentation site](https://docs.cyberskill.com/shared) or check the [JSDocs reference](https://www.jsdocs.io/package/@cyberskill/shared).
|
|
149
|
+
|
|
150
|
+
### Key Documentation Sections
|
|
151
|
+
|
|
152
|
+
- [Getting Started Guide](https://docs.cyberskill.com/shared/getting-started)
|
|
153
|
+
- [API Reference](https://docs.cyberskill.com/shared/api)
|
|
154
|
+
- [Migration Guide](https://docs.cyberskill.com/shared/migration)
|
|
155
|
+
- [Best Practices](https://docs.cyberskill.com/shared/best-practices)
|
|
156
|
+
|
|
48
157
|
---
|
|
49
158
|
|
|
50
|
-
##
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
|
55
|
-
|
|
|
56
|
-
|
|
|
57
|
-
|
|
|
58
|
-
|
|
|
59
|
-
|
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
|
64
|
-
|
|
|
159
|
+
## 🔧 API Reference
|
|
160
|
+
|
|
161
|
+
### Core Modules
|
|
162
|
+
|
|
163
|
+
| Module | Description | Import Path |
|
|
164
|
+
| ------------- | --------------------------- | ------------------------------- |
|
|
165
|
+
| **Utils** | Common utility functions | `@cyberskill/shared/util` |
|
|
166
|
+
| **Constants** | Shared constants and enums | `@cyberskill/shared/constant` |
|
|
167
|
+
| **Types** | TypeScript type definitions | `@cyberskill/shared/typescript` |
|
|
168
|
+
| **Config** | Configuration utilities | `@cyberskill/shared/config` |
|
|
169
|
+
|
|
170
|
+
### Node.js Modules
|
|
171
|
+
|
|
172
|
+
| Module | Description | Import Path |
|
|
173
|
+
| ----------------- | ------------------------------ | --------------------------------------- |
|
|
174
|
+
| **apollo-server** | Apollo Server utilities | `@cyberskill/shared/node/apollo-server` |
|
|
175
|
+
| **cli** | Command-line interface helpers | `@cyberskill/shared/node/cli` |
|
|
176
|
+
| **command** | Command execution utilities | `@cyberskill/shared/node/command` |
|
|
177
|
+
| **express** | Express.js utilities | `@cyberskill/shared/node/express` |
|
|
178
|
+
| **fs** | File system helpers | `@cyberskill/shared/node/fs` |
|
|
179
|
+
| **log** | Logging utilities | `@cyberskill/shared/node/log` |
|
|
180
|
+
| **mongo** | MongoDB helpers | `@cyberskill/shared/node/mongo` |
|
|
181
|
+
| **package** | Package management utilities | `@cyberskill/shared/node/package` |
|
|
182
|
+
| **path** | Path utilities | `@cyberskill/shared/node/path` |
|
|
183
|
+
| **storage** | Storage helpers | `@cyberskill/shared/node/storage` |
|
|
184
|
+
| **upload** | File upload utilities | `@cyberskill/shared/node/upload` |
|
|
185
|
+
| **ws** | WebSocket utilities | `@cyberskill/shared/node/ws` |
|
|
186
|
+
|
|
187
|
+
### React Modules
|
|
188
|
+
|
|
189
|
+
| Module | Description | Import Path |
|
|
190
|
+
| ----------------- | ---------------------------- | ---------------------------------------- |
|
|
191
|
+
| **apollo-client** | Apollo Client integration | `@cyberskill/shared/react/apollo-client` |
|
|
192
|
+
| **apollo-error** | Apollo error handling | `@cyberskill/shared/react/apollo-error` |
|
|
193
|
+
| **i18next** | Internationalization (i18n) | `@cyberskill/shared/react/i18next` |
|
|
194
|
+
| **loading** | Loading state management | `@cyberskill/shared/react/loading` |
|
|
195
|
+
| **log** | Logging utilities | `@cyberskill/shared/react/log` |
|
|
196
|
+
| **next-intl** | Next.js internationalization | `@cyberskill/shared/react/next-intl` |
|
|
197
|
+
| **storage** | Client-side storage | `@cyberskill/shared/react/storage` |
|
|
198
|
+
| **toast** | Toast notification system | `@cyberskill/shared/react/toast` |
|
|
199
|
+
| **userback** | User feedback integration | `@cyberskill/shared/react/userback` |
|
|
200
|
+
|
|
201
|
+
### Util Modules
|
|
202
|
+
|
|
203
|
+
| Module | Description | Import Path |
|
|
204
|
+
| -------------- | -------------------------------- | ------------------------------------ |
|
|
205
|
+
| **common** | Common utility types and helpers | `@cyberskill/shared/util/common` |
|
|
206
|
+
| **object** | Object manipulation utilities | `@cyberskill/shared/util/object` |
|
|
207
|
+
| **serializer** | Serialization and transformation | `@cyberskill/shared/util/serializer` |
|
|
208
|
+
| **string** | String processing utilities | `@cyberskill/shared/util/string` |
|
|
209
|
+
| **validate** | Validation helpers | `@cyberskill/shared/util/validate` |
|
|
65
210
|
|
|
66
211
|
---
|
|
67
212
|
|
|
68
|
-
##
|
|
213
|
+
## 🛠️ Development
|
|
214
|
+
|
|
215
|
+
### Prerequisites
|
|
216
|
+
|
|
217
|
+
- Node.js 22+
|
|
218
|
+
- pnpm 10+
|
|
219
|
+
- Git
|
|
220
|
+
|
|
221
|
+
### Setup
|
|
222
|
+
|
|
223
|
+
```bash
|
|
224
|
+
# Clone the repository
|
|
225
|
+
git clone https://github.com/cyberskill-world/shared.git
|
|
226
|
+
cd shared
|
|
227
|
+
|
|
228
|
+
# Install dependencies
|
|
229
|
+
pnpm install
|
|
230
|
+
|
|
231
|
+
# Build the project
|
|
232
|
+
pnpm run build
|
|
233
|
+
```
|
|
234
|
+
|
|
235
|
+
### Available Scripts
|
|
236
|
+
|
|
237
|
+
| Command | Description |
|
|
238
|
+
| -------------------- | -------------------------------------- |
|
|
239
|
+
| `pnpm run dev` | Start development mode with hot reload |
|
|
240
|
+
| `pnpm run build` | Build for production |
|
|
241
|
+
| `pnpm run lint` | Check for linting issues |
|
|
242
|
+
| `pnpm run lint:fix` | Fix linting issues automatically |
|
|
243
|
+
| `pnpm run test:unit` | Run unit tests |
|
|
244
|
+
| `pnpm run test:e2e` | Run end-to-end tests |
|
|
245
|
+
| `pnpm run inspect` | Inspect project dependencies |
|
|
246
|
+
| `pnpm run reset` | Reset project state |
|
|
247
|
+
| `pnpm run ready` | Prepare project for development |
|
|
248
|
+
|
|
249
|
+
### Project Structure
|
|
69
250
|
|
|
70
251
|
```text
|
|
71
|
-
|
|
72
|
-
├──
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
252
|
+
shared/
|
|
253
|
+
├── public/ # Static assets (favicons, manifest, etc.)
|
|
254
|
+
├── src/
|
|
255
|
+
│ ├── config/ # App configuration (commitlint, eslint, env, graphql-codegen, lint-staged, vitest)
|
|
256
|
+
│ ├── constant/ # Static values and constants
|
|
257
|
+
│ ├── node/ # Node.js utilities and modules
|
|
258
|
+
│ │ ├── apollo-server/ # Apollo Server helpers
|
|
259
|
+
│ │ ├── cli/ # CLI utilities
|
|
260
|
+
│ │ ├── command/ # Command execution helpers
|
|
261
|
+
│ │ ├── express/ # Express.js utilities
|
|
262
|
+
│ │ ├── fs/ # File system helpers
|
|
263
|
+
│ │ ├── log/ # Logging utilities
|
|
264
|
+
│ │ ├── mongo/ # MongoDB helpers
|
|
265
|
+
│ │ ├── package/ # Package management
|
|
266
|
+
│ │ ├── path/ # Path utilities
|
|
267
|
+
│ │ ├── storage/ # Storage helpers
|
|
268
|
+
│ │ ├── upload/ # File upload utilities
|
|
269
|
+
│ │ └── ws/ # WebSocket utilities
|
|
270
|
+
│ ├── react/ # React utilities and modules
|
|
271
|
+
│ │ ├── apollo-client/ # Apollo Client integration
|
|
272
|
+
│ │ ├── apollo-error/ # Apollo error handling
|
|
273
|
+
│ │ ├── i18next/ # Internationalization (i18n)
|
|
274
|
+
│ │ ├── loading/ # Loading state management
|
|
275
|
+
│ │ ├── log/ # Logging utilities
|
|
276
|
+
│ │ ├── next-intl/ # Next.js internationalization
|
|
277
|
+
│ │ ├── storage/ # Client-side storage
|
|
278
|
+
│ │ ├── toast/ # Toast notifications
|
|
279
|
+
│ │ └── userback/ # User feedback integration
|
|
280
|
+
│ ├── typescript/ # TypeScript types and interfaces
|
|
281
|
+
│ └── util/ # Utility functions and helpers
|
|
282
|
+
│ ├── common/ # Common utilities
|
|
283
|
+
│ ├── object/ # Object manipulation
|
|
284
|
+
│ ├── serializer/ # Serialization helpers
|
|
285
|
+
│ ├── string/ # String utilities
|
|
286
|
+
│ └── validate/ # Validation helpers
|
|
287
|
+
├── package.json # Project manifest
|
|
288
|
+
├── tsconfig.json # TypeScript configuration
|
|
289
|
+
└── ... # Other configuration and metadata files
|
|
290
|
+
```
|
|
291
|
+
|
|
292
|
+
### Testing
|
|
293
|
+
|
|
294
|
+
```bash
|
|
295
|
+
# Run all tests
|
|
296
|
+
pnpm run test
|
|
297
|
+
|
|
298
|
+
# Run unit tests only
|
|
299
|
+
pnpm run test:unit
|
|
300
|
+
|
|
301
|
+
# Run e2e tests only
|
|
302
|
+
pnpm run test:e2e
|
|
303
|
+
|
|
304
|
+
# Run tests with coverage
|
|
305
|
+
pnpm run test:coverage
|
|
80
306
|
```
|
|
81
307
|
|
|
82
308
|
---
|
|
83
309
|
|
|
84
|
-
##
|
|
310
|
+
## 🤝 Contributing
|
|
311
|
+
|
|
312
|
+
We welcome contributions from the community! Please read our [Contributing Guide](CONTRIBUTING.md) for details on our code of conduct and the process for submitting pull requests.
|
|
313
|
+
|
|
314
|
+
### Development Workflow
|
|
85
315
|
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
316
|
+
1. Fork the repository
|
|
317
|
+
2. Create a feature branch (`git checkout -b feature/amazing-feature`)
|
|
318
|
+
3. Make your changes
|
|
319
|
+
4. Add tests for new functionality
|
|
320
|
+
5. Ensure all tests pass (`pnpm run test`)
|
|
321
|
+
6. Commit your changes (`git commit -m 'Add amazing feature'`)
|
|
322
|
+
7. Push to the branch (`git push origin feature/amazing-feature`)
|
|
323
|
+
8. Open a Pull Request
|
|
324
|
+
|
|
325
|
+
### Code Standards
|
|
326
|
+
|
|
327
|
+
- Follow TypeScript best practices
|
|
328
|
+
- Write comprehensive tests
|
|
329
|
+
- Update documentation for new features
|
|
330
|
+
- Follow our ESLint configuration
|
|
331
|
+
- Use conventional commit messages
|
|
89
332
|
|
|
90
333
|
---
|
|
91
334
|
|
|
92
|
-
📄
|
|
335
|
+
## 📄 License
|
|
336
|
+
|
|
337
|
+
This project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details.
|
|
93
338
|
|
|
94
339
|
---
|
|
95
340
|
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
341
|
+
## 🏢 About CyberSkill
|
|
342
|
+
|
|
343
|
+
CyberSkill JSC is a technology company focused on building innovative solutions for the cybersecurity industry. Our shared libraries and tools help developers create secure, scalable, and maintainable applications.
|
|
344
|
+
|
|
345
|
+
- **Website**: [https://cyberskill.com](https://cyberskill.com)
|
|
346
|
+
- **GitHub**: [https://github.com/cyberskill-world](https://github.com/cyberskill-world)
|
|
347
|
+
- **Documentation**: [https://docs.cyberskill.com](https://docs.cyberskill.com)
|
|
348
|
+
|
|
349
|
+
---
|
|
350
|
+
|
|
351
|
+
<div align="center">
|
|
352
|
+
<p>Made with ❤️ by the <a href="https://github.com/cyberskill-world">CyberSkill Team</a></p>
|
|
353
|
+
|
|
354
|
+
<p>
|
|
355
|
+
<a href="https://cyberskill.com">Website</a> •
|
|
356
|
+
<a href="https://docs.cyberskill.com">Documentation</a> •
|
|
357
|
+
<a href="https://github.com/cyberskill-world/shared/issues">Issues</a> •
|
|
358
|
+
<a href="https://github.com/cyberskill-world/shared/discussions">Discussions</a>
|
|
359
|
+
</p>
|
|
360
|
+
</div>
|
|
@@ -5,11 +5,9 @@ import type { AggregatePaginateResult } from 'mongoose';
|
|
|
5
5
|
import { ApolloCache } from '@apollo/client';
|
|
6
6
|
import { ApolloClient } from '@apollo/client';
|
|
7
7
|
import { ApolloClient as ApolloClient_2 } from '@apollo/client/core/core.cjs';
|
|
8
|
-
import { ApolloClient as ApolloClient_3 } from '@apollo/client-integration-nextjs';
|
|
9
8
|
import { ApolloClientOptions } from '@apollo/client';
|
|
10
9
|
import { ApolloError } from '@apollo/client';
|
|
11
10
|
import type { ApolloLink } from '@apollo/client';
|
|
12
|
-
import { ApolloQueryResult } from '@apollo/client';
|
|
13
11
|
import { ApolloServer } from '@apollo/server';
|
|
14
12
|
import type { Application } from 'express';
|
|
15
13
|
import bodyParser from 'body-parser';
|
|
@@ -49,7 +47,6 @@ import type { InsertOneResult } from 'mongodb';
|
|
|
49
47
|
import type { JSX } from 'react';
|
|
50
48
|
import { Locale } from 'date-fns/locale';
|
|
51
49
|
import type { Locale as Locale_2 } from 'date-fns';
|
|
52
|
-
import { MaybeMasked } from '@apollo/client';
|
|
53
50
|
import migrate from 'migrate-mongo';
|
|
54
51
|
import { Model } from 'mongoose';
|
|
55
52
|
import type mongoose from 'mongoose';
|
|
@@ -57,7 +54,6 @@ import mongoosePaginate from 'mongoose-paginate-v2';
|
|
|
57
54
|
import type mongooseRaw from 'mongoose';
|
|
58
55
|
import { NextFunction } from 'express';
|
|
59
56
|
import { NormalizedCacheObject } from '@apollo/client';
|
|
60
|
-
import { OperationVariables } from '@apollo/client';
|
|
61
57
|
import type { OptionalUnlessRequiredId } from 'mongodb';
|
|
62
58
|
import type { PaginateModel } from 'mongoose';
|
|
63
59
|
import type { PaginateOptions } from 'mongoose';
|
|
@@ -67,12 +63,10 @@ import type { PipelineStage } from 'mongoose';
|
|
|
67
63
|
import type { PopulateOption } from 'mongoose';
|
|
68
64
|
import type { PopulateOptions } from 'mongoose';
|
|
69
65
|
import type { PostMiddlewareFunction } from 'mongoose';
|
|
70
|
-
import { PreloadQueryComponent } from '@apollo/client-integration-nextjs';
|
|
71
66
|
import type { PreMiddlewareFunction } from 'mongoose';
|
|
72
67
|
import type { PreSaveMiddlewareFunction } from 'mongoose';
|
|
73
68
|
import type { ProjectionType } from 'mongoose';
|
|
74
69
|
import type { QueryOptions } from 'mongoose';
|
|
75
|
-
import { QueryOptions as QueryOptions_2 } from '@apollo/client';
|
|
76
70
|
import type { QueryWithHelpers } from 'mongoose';
|
|
77
71
|
import { default as React_2 } from 'react';
|
|
78
72
|
import type { ReactElement } from 'react';
|
|
@@ -1716,11 +1710,7 @@ export { generateSlug }
|
|
|
1716
1710
|
export { generateSlug as generateSlug_alias_1 }
|
|
1717
1711
|
export { generateSlug as generateSlug_alias_2 }
|
|
1718
1712
|
|
|
1719
|
-
declare function getClient(options?: I_ApolloOptions, isNextJS?: boolean): ApolloClient_2<NormalizedCacheObject
|
|
1720
|
-
getClient: () => ApolloClient_3<unknown>;
|
|
1721
|
-
query: <T = any, TVariables extends OperationVariables = OperationVariables>(options: QueryOptions_2<TVariables, T>) => Promise<ApolloQueryResult<MaybeMasked<T>>>;
|
|
1722
|
-
PreloadQuery: PreloadQueryComponent;
|
|
1723
|
-
};
|
|
1713
|
+
declare function getClient(options?: I_ApolloOptions, isNextJS?: boolean): ApolloClient_2<NormalizedCacheObject>;
|
|
1724
1714
|
export { getClient }
|
|
1725
1715
|
export { getClient as getClient_alias_1 }
|
|
1726
1716
|
export { getClient as getClient_alias_2 }
|
|
@@ -1804,9 +1794,7 @@ export { I_ApolloErrorContext as I_ApolloErrorContext_alias_2 }
|
|
|
1804
1794
|
declare interface I_ApolloOptions extends Omit<ApolloClientOptions<NormalizedCacheObject>, 'cache'> {
|
|
1805
1795
|
uri?: string | UriFunction;
|
|
1806
1796
|
wsUrl?: string;
|
|
1807
|
-
cache?: ApolloCache<NormalizedCacheObject>;
|
|
1808
1797
|
customLinks?: ApolloLink[];
|
|
1809
|
-
ssrMode?: boolean;
|
|
1810
1798
|
}
|
|
1811
1799
|
export { I_ApolloOptions }
|
|
1812
1800
|
export { I_ApolloOptions as I_ApolloOptions_alias_1 }
|
|
@@ -1950,7 +1938,7 @@ export { I_EslintError as I_EslintError_alias_1 }
|
|
|
1950
1938
|
export { I_EslintError as I_EslintError_alias_2 }
|
|
1951
1939
|
|
|
1952
1940
|
declare interface I_ExpressOptions {
|
|
1953
|
-
|
|
1941
|
+
static?: string | string[];
|
|
1954
1942
|
}
|
|
1955
1943
|
export { I_ExpressOptions }
|
|
1956
1944
|
export { I_ExpressOptions as I_ExpressOptions_alias_1 }
|
|
@@ -2199,7 +2187,7 @@ declare interface I_MongooseOptions<T> {
|
|
|
2199
2187
|
|
|
2200
2188
|
declare interface I_NestOptions {
|
|
2201
2189
|
module: Type<object>;
|
|
2202
|
-
|
|
2190
|
+
static?: string | string[];
|
|
2203
2191
|
filters?: ExceptionFilter[];
|
|
2204
2192
|
pipes?: ValidationPipe[];
|
|
2205
2193
|
}
|
|
@@ -2272,13 +2260,6 @@ export { I_PackageInput }
|
|
|
2272
2260
|
export { I_PackageInput as I_PackageInput_alias_1 }
|
|
2273
2261
|
export { I_PackageInput as I_PackageInput_alias_2 }
|
|
2274
2262
|
|
|
2275
|
-
declare interface I_RegisteredApolloClient {
|
|
2276
|
-
getClient: () => ApolloClient<NormalizedCacheObject>;
|
|
2277
|
-
}
|
|
2278
|
-
export { I_RegisteredApolloClient }
|
|
2279
|
-
export { I_RegisteredApolloClient as I_RegisteredApolloClient_alias_1 }
|
|
2280
|
-
export { I_RegisteredApolloClient as I_RegisteredApolloClient_alias_2 }
|
|
2281
|
-
|
|
2282
2263
|
declare type I_Return<T = void, E = unknown> = I_ReturnSuccess<T, E> | I_ReturnFailure;
|
|
2283
2264
|
export { I_Return }
|
|
2284
2265
|
export { I_Return as I_Return_alias_1 }
|
|
@@ -5,11 +5,9 @@ import type { AggregatePaginateResult } from 'mongoose';
|
|
|
5
5
|
import { ApolloCache } from '@apollo/client';
|
|
6
6
|
import { ApolloClient } from '@apollo/client';
|
|
7
7
|
import { ApolloClient as ApolloClient_2 } from '@apollo/client/core/core.cjs';
|
|
8
|
-
import { ApolloClient as ApolloClient_3 } from '@apollo/client-integration-nextjs';
|
|
9
8
|
import { ApolloClientOptions } from '@apollo/client';
|
|
10
9
|
import { ApolloError } from '@apollo/client';
|
|
11
10
|
import type { ApolloLink } from '@apollo/client';
|
|
12
|
-
import { ApolloQueryResult } from '@apollo/client';
|
|
13
11
|
import { ApolloServer } from '@apollo/server';
|
|
14
12
|
import type { Application } from 'express';
|
|
15
13
|
import bodyParser from 'body-parser';
|
|
@@ -49,7 +47,6 @@ import type { InsertOneResult } from 'mongodb';
|
|
|
49
47
|
import type { JSX } from 'react';
|
|
50
48
|
import { Locale } from 'date-fns/locale';
|
|
51
49
|
import type { Locale as Locale_2 } from 'date-fns';
|
|
52
|
-
import { MaybeMasked } from '@apollo/client';
|
|
53
50
|
import migrate from 'migrate-mongo';
|
|
54
51
|
import { Model } from 'mongoose';
|
|
55
52
|
import type mongoose from 'mongoose';
|
|
@@ -57,7 +54,6 @@ import mongoosePaginate from 'mongoose-paginate-v2';
|
|
|
57
54
|
import type mongooseRaw from 'mongoose';
|
|
58
55
|
import { NextFunction } from 'express';
|
|
59
56
|
import { NormalizedCacheObject } from '@apollo/client';
|
|
60
|
-
import { OperationVariables } from '@apollo/client';
|
|
61
57
|
import type { OptionalUnlessRequiredId } from 'mongodb';
|
|
62
58
|
import type { PaginateModel } from 'mongoose';
|
|
63
59
|
import type { PaginateOptions } from 'mongoose';
|
|
@@ -67,12 +63,10 @@ import type { PipelineStage } from 'mongoose';
|
|
|
67
63
|
import type { PopulateOption } from 'mongoose';
|
|
68
64
|
import type { PopulateOptions } from 'mongoose';
|
|
69
65
|
import type { PostMiddlewareFunction } from 'mongoose';
|
|
70
|
-
import { PreloadQueryComponent } from '@apollo/client-integration-nextjs';
|
|
71
66
|
import type { PreMiddlewareFunction } from 'mongoose';
|
|
72
67
|
import type { PreSaveMiddlewareFunction } from 'mongoose';
|
|
73
68
|
import type { ProjectionType } from 'mongoose';
|
|
74
69
|
import type { QueryOptions } from 'mongoose';
|
|
75
|
-
import { QueryOptions as QueryOptions_2 } from '@apollo/client';
|
|
76
70
|
import type { QueryWithHelpers } from 'mongoose';
|
|
77
71
|
import { default as React_2 } from 'react';
|
|
78
72
|
import type { ReactElement } from 'react';
|
|
@@ -1716,11 +1710,7 @@ export { generateSlug }
|
|
|
1716
1710
|
export { generateSlug as generateSlug_alias_1 }
|
|
1717
1711
|
export { generateSlug as generateSlug_alias_2 }
|
|
1718
1712
|
|
|
1719
|
-
declare function getClient(options?: I_ApolloOptions, isNextJS?: boolean): ApolloClient_2<NormalizedCacheObject
|
|
1720
|
-
getClient: () => ApolloClient_3<unknown>;
|
|
1721
|
-
query: <T = any, TVariables extends OperationVariables = OperationVariables>(options: QueryOptions_2<TVariables, T>) => Promise<ApolloQueryResult<MaybeMasked<T>>>;
|
|
1722
|
-
PreloadQuery: PreloadQueryComponent;
|
|
1723
|
-
};
|
|
1713
|
+
declare function getClient(options?: I_ApolloOptions, isNextJS?: boolean): ApolloClient_2<NormalizedCacheObject>;
|
|
1724
1714
|
export { getClient }
|
|
1725
1715
|
export { getClient as getClient_alias_1 }
|
|
1726
1716
|
export { getClient as getClient_alias_2 }
|
|
@@ -1804,9 +1794,7 @@ export { I_ApolloErrorContext as I_ApolloErrorContext_alias_2 }
|
|
|
1804
1794
|
declare interface I_ApolloOptions extends Omit<ApolloClientOptions<NormalizedCacheObject>, 'cache'> {
|
|
1805
1795
|
uri?: string | UriFunction;
|
|
1806
1796
|
wsUrl?: string;
|
|
1807
|
-
cache?: ApolloCache<NormalizedCacheObject>;
|
|
1808
1797
|
customLinks?: ApolloLink[];
|
|
1809
|
-
ssrMode?: boolean;
|
|
1810
1798
|
}
|
|
1811
1799
|
export { I_ApolloOptions }
|
|
1812
1800
|
export { I_ApolloOptions as I_ApolloOptions_alias_1 }
|
|
@@ -1950,7 +1938,7 @@ export { I_EslintError as I_EslintError_alias_1 }
|
|
|
1950
1938
|
export { I_EslintError as I_EslintError_alias_2 }
|
|
1951
1939
|
|
|
1952
1940
|
declare interface I_ExpressOptions {
|
|
1953
|
-
|
|
1941
|
+
static?: string | string[];
|
|
1954
1942
|
}
|
|
1955
1943
|
export { I_ExpressOptions }
|
|
1956
1944
|
export { I_ExpressOptions as I_ExpressOptions_alias_1 }
|
|
@@ -2199,7 +2187,7 @@ declare interface I_MongooseOptions<T> {
|
|
|
2199
2187
|
|
|
2200
2188
|
declare interface I_NestOptions {
|
|
2201
2189
|
module: Type<object>;
|
|
2202
|
-
|
|
2190
|
+
static?: string | string[];
|
|
2203
2191
|
filters?: ExceptionFilter[];
|
|
2204
2192
|
pipes?: ValidationPipe[];
|
|
2205
2193
|
}
|
|
@@ -2272,13 +2260,6 @@ export { I_PackageInput }
|
|
|
2272
2260
|
export { I_PackageInput as I_PackageInput_alias_1 }
|
|
2273
2261
|
export { I_PackageInput as I_PackageInput_alias_2 }
|
|
2274
2262
|
|
|
2275
|
-
declare interface I_RegisteredApolloClient {
|
|
2276
|
-
getClient: () => ApolloClient<NormalizedCacheObject>;
|
|
2277
|
-
}
|
|
2278
|
-
export { I_RegisteredApolloClient }
|
|
2279
|
-
export { I_RegisteredApolloClient as I_RegisteredApolloClient_alias_1 }
|
|
2280
|
-
export { I_RegisteredApolloClient as I_RegisteredApolloClient_alias_2 }
|
|
2281
|
-
|
|
2282
2263
|
declare type I_Return<T = void, E = unknown> = I_ReturnSuccess<T, E> | I_ReturnFailure;
|
|
2283
2264
|
export { I_Return }
|
|
2284
2265
|
export { I_Return as I_Return_alias_1 }
|