@kajidog/connpass-api-client 0.3.0 → 0.4.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 +24 -27
- package/dist/application/ConnpassClient.d.ts +4 -4
- package/dist/application/ConnpassClient.d.ts.map +1 -1
- package/dist/application/ConnpassClient.js +7 -7
- package/dist/application/ConnpassClient.js.map +1 -1
- package/dist/application/services/EventService.d.ts +3 -3
- package/dist/application/services/EventService.d.ts.map +1 -1
- package/dist/application/services/EventService.js +3 -2
- package/dist/application/services/EventService.js.map +1 -1
- package/dist/application/services/GroupService.d.ts +3 -3
- package/dist/application/services/GroupService.d.ts.map +1 -1
- package/dist/application/services/GroupService.js +2 -1
- package/dist/application/services/GroupService.js.map +1 -1
- package/dist/application/services/UserService.d.ts +3 -3
- package/dist/application/services/UserService.d.ts.map +1 -1
- package/dist/application/services/UserService.js +9 -5
- package/dist/application/services/UserService.js.map +1 -1
- package/dist/application/services/index.d.ts +3 -3
- package/dist/domain/entities/index.d.ts +4 -4
- package/dist/domain/errors/ConnpassError.d.ts +3 -3
- package/dist/domain/errors/ConnpassError.d.ts.map +1 -1
- package/dist/domain/errors/ConnpassError.js +7 -7
- package/dist/domain/errors/ConnpassError.js.map +1 -1
- package/dist/domain/errors/index.d.ts +1 -1
- package/dist/domain/repositories/IEventRepository.d.ts +1 -1
- package/dist/domain/repositories/IEventRepository.d.ts.map +1 -1
- package/dist/domain/repositories/IGroupRepository.d.ts +1 -1
- package/dist/domain/repositories/IUserRepository.d.ts +1 -1
- package/dist/domain/repositories/IUserRepository.d.ts.map +1 -1
- package/dist/domain/repositories/index.d.ts +3 -3
- package/dist/domain/utils/validators.d.ts +8 -8
- package/dist/domain/utils/validators.d.ts.map +1 -1
- package/dist/domain/utils/validators.js +39 -37
- package/dist/domain/utils/validators.js.map +1 -1
- package/dist/index.d.ts +5 -4
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1 -0
- package/dist/index.js.map +1 -1
- package/dist/infrastructure/cache/PresentationCache.d.ts +1 -1
- package/dist/infrastructure/cache/PresentationCache.d.ts.map +1 -1
- package/dist/infrastructure/cache/PresentationCache.js +6 -4
- package/dist/infrastructure/cache/PresentationCache.js.map +1 -1
- package/dist/infrastructure/http/HttpClient.d.ts +3 -2
- package/dist/infrastructure/http/HttpClient.d.ts.map +1 -1
- package/dist/infrastructure/http/HttpClient.js +16 -17
- package/dist/infrastructure/http/HttpClient.js.map +1 -1
- package/dist/infrastructure/repositories/EventRepository.d.ts +5 -4
- package/dist/infrastructure/repositories/EventRepository.d.ts.map +1 -1
- package/dist/infrastructure/repositories/EventRepository.js +25 -36
- package/dist/infrastructure/repositories/EventRepository.js.map +1 -1
- package/dist/infrastructure/repositories/GroupRepository.d.ts +4 -3
- package/dist/infrastructure/repositories/GroupRepository.d.ts.map +1 -1
- package/dist/infrastructure/repositories/GroupRepository.js +15 -3
- package/dist/infrastructure/repositories/GroupRepository.js.map +1 -1
- package/dist/infrastructure/repositories/UserRepository.d.ts +6 -3
- package/dist/infrastructure/repositories/UserRepository.d.ts.map +1 -1
- package/dist/infrastructure/repositories/UserRepository.js +43 -9
- package/dist/infrastructure/repositories/UserRepository.js.map +1 -1
- package/dist/infrastructure/repositories/apiTypes.d.ts +140 -0
- package/dist/infrastructure/repositories/apiTypes.d.ts.map +1 -0
- package/dist/infrastructure/repositories/apiTypes.js +119 -0
- package/dist/infrastructure/repositories/apiTypes.js.map +1 -0
- package/dist/infrastructure/repositories/index.d.ts +3 -3
- package/dist/prefectures.d.ts +14 -0
- package/dist/prefectures.d.ts.map +1 -0
- package/dist/prefectures.js +102 -0
- package/dist/prefectures.js.map +1 -0
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -45,12 +45,6 @@ const client = new ConnpassClient({
|
|
|
45
45
|
});
|
|
46
46
|
```
|
|
47
47
|
|
|
48
|
-
If these options are omitted, the client falls back to environment variables:
|
|
49
|
-
|
|
50
|
-
- `CONNPASS_PRESENTATION_CACHE_ENABLED` (`true`/`false`, defaults to `true`)
|
|
51
|
-
- `CONNPASS_PRESENTATION_CACHE_TTL_MS` (millisecond TTL, defaults to `3600000`)
|
|
52
|
-
- `CONNPASS_PRESENTATION_CACHE_PATH` (path to persistent cache file, defaults to `./data/presentation-cache.json`)
|
|
53
|
-
|
|
54
48
|
### Available Methods
|
|
55
49
|
|
|
56
50
|
#### Events
|
|
@@ -61,6 +55,7 @@ const events = await client.searchEvents({
|
|
|
61
55
|
keyword: 'JavaScript',
|
|
62
56
|
ymdFrom: '2024-01-01',
|
|
63
57
|
ymdTo: '2024-12-31',
|
|
58
|
+
prefecture: ['tokyo', 'osaka'],
|
|
64
59
|
count: 20,
|
|
65
60
|
start: 1
|
|
66
61
|
});
|
|
@@ -80,7 +75,7 @@ const presentations = await client.getEventPresentations(12345);
|
|
|
80
75
|
// Search groups
|
|
81
76
|
const groups = await client.searchGroups({
|
|
82
77
|
keyword: 'JavaScript',
|
|
83
|
-
prefecture: '
|
|
78
|
+
prefecture: 'tokyo'
|
|
84
79
|
});
|
|
85
80
|
|
|
86
81
|
// Get all groups
|
|
@@ -108,17 +103,30 @@ const sameResult = await client.getUserAttendedEvents('kajidog');
|
|
|
108
103
|
const presenterEvents = await client.getUserPresenterEvents(12345);
|
|
109
104
|
```
|
|
110
105
|
|
|
111
|
-
|
|
106
|
+
#### Prefectures
|
|
112
107
|
|
|
113
|
-
|
|
108
|
+
```typescript
|
|
109
|
+
import { getAllPrefectures, normalizePrefecture } from '@kajidog/connpass-api-client';
|
|
110
|
+
|
|
111
|
+
// Get all prefecture options
|
|
112
|
+
const prefectures = getAllPrefectures();
|
|
113
|
+
// [{ code: 'hokkaido', name: '北海道' }, { code: 'aomori', name: '青森県' }, ...]
|
|
114
|
+
|
|
115
|
+
// Normalize prefecture input (name or code → code)
|
|
116
|
+
normalizePrefecture('東京都'); // 'tokyo'
|
|
117
|
+
normalizePrefecture('tokyo'); // 'tokyo'
|
|
118
|
+
normalizePrefecture('invalid'); // undefined
|
|
119
|
+
```
|
|
120
|
+
|
|
121
|
+
### Error Handling
|
|
114
122
|
|
|
115
123
|
```typescript
|
|
116
|
-
import {
|
|
117
|
-
ConnpassError,
|
|
118
|
-
ConnpassApiError,
|
|
119
|
-
ConnpassRateLimitError,
|
|
124
|
+
import {
|
|
125
|
+
ConnpassError,
|
|
126
|
+
ConnpassApiError,
|
|
127
|
+
ConnpassRateLimitError,
|
|
120
128
|
ConnpassValidationError,
|
|
121
|
-
ConnpassTimeoutError
|
|
129
|
+
ConnpassTimeoutError
|
|
122
130
|
} from '@kajidog/connpass-api-client';
|
|
123
131
|
|
|
124
132
|
try {
|
|
@@ -132,8 +140,6 @@ try {
|
|
|
132
140
|
console.log('API error:', error.statusCode, error.message);
|
|
133
141
|
} else if (error instanceof ConnpassTimeoutError) {
|
|
134
142
|
console.log('Request timeout');
|
|
135
|
-
} else {
|
|
136
|
-
console.log('Unknown error:', error.message);
|
|
137
143
|
}
|
|
138
144
|
}
|
|
139
145
|
```
|
|
@@ -150,6 +156,7 @@ try {
|
|
|
150
156
|
- `nickname`: Participant nickname
|
|
151
157
|
- `ownerNickname`: Event owner nickname
|
|
152
158
|
- `groupId`: Array of group IDs
|
|
159
|
+
- `prefecture`: Array of prefecture codes (e.g. `['tokyo', 'osaka']`)
|
|
153
160
|
- `count`: Number of results (1-100, default 10)
|
|
154
161
|
- `order`: Sort order (1: updated_at desc, 2: started_at asc, 3: started_at desc)
|
|
155
162
|
- `start`: Start position for pagination
|
|
@@ -159,7 +166,7 @@ try {
|
|
|
159
166
|
- `groupId`: Array of group IDs
|
|
160
167
|
- `keyword`: Search keyword
|
|
161
168
|
- `countryCode`: Country code
|
|
162
|
-
- `prefecture`: Prefecture
|
|
169
|
+
- `prefecture`: Prefecture code
|
|
163
170
|
- `count`: Number of results (1-100, default 10)
|
|
164
171
|
- `order`: Sort order
|
|
165
172
|
- `start`: Start position for pagination
|
|
@@ -172,16 +179,6 @@ try {
|
|
|
172
179
|
- `order`: Sort order
|
|
173
180
|
- `start`: Start position for pagination
|
|
174
181
|
|
|
175
|
-
## Features
|
|
176
|
-
|
|
177
|
-
- ✅ Full TypeScript support with comprehensive type definitions
|
|
178
|
-
- ✅ Rate limiting built-in (1 request per second) with optional queuing
|
|
179
|
-
- ✅ Automatic pagination support with `getAll*` methods
|
|
180
|
-
- ✅ Comprehensive error handling with specific error types
|
|
181
|
-
- ✅ Input validation
|
|
182
|
-
- ✅ Clean architecture design
|
|
183
|
-
- ✅ Easy to test and extend
|
|
184
|
-
|
|
185
182
|
## License
|
|
186
183
|
|
|
187
184
|
MIT
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { EventSearchParams, EventsResponse,
|
|
1
|
+
import { EventSearchParams, EventsResponse, GroupSearchParams, GroupsResponse, PresentationsResponse, UserSearchParams, UsersResponse } from "../domain/entities";
|
|
2
2
|
export interface ConnpassClientConfig {
|
|
3
3
|
apiKey: string;
|
|
4
4
|
baseURL?: string;
|
|
@@ -16,12 +16,12 @@ export declare class ConnpassClient {
|
|
|
16
16
|
private readonly userService;
|
|
17
17
|
constructor(config: ConnpassClientConfig);
|
|
18
18
|
searchEvents(params?: EventSearchParams): Promise<EventsResponse>;
|
|
19
|
-
getAllEvents(params?: Omit<EventSearchParams,
|
|
19
|
+
getAllEvents(params?: Omit<EventSearchParams, "start" | "count">): Promise<EventsResponse>;
|
|
20
20
|
getEventPresentations(eventId: number): Promise<PresentationsResponse>;
|
|
21
21
|
searchGroups(params?: GroupSearchParams): Promise<GroupsResponse>;
|
|
22
|
-
getAllGroups(params?: Omit<GroupSearchParams,
|
|
22
|
+
getAllGroups(params?: Omit<GroupSearchParams, "start" | "count">): Promise<GroupsResponse>;
|
|
23
23
|
searchUsers(params?: UserSearchParams): Promise<UsersResponse>;
|
|
24
|
-
getAllUsers(params?: Omit<UserSearchParams,
|
|
24
|
+
getAllUsers(params?: Omit<UserSearchParams, "start" | "count">): Promise<UsersResponse>;
|
|
25
25
|
getUserGroups(userIdOrNickname: number | string, params?: {
|
|
26
26
|
count?: number;
|
|
27
27
|
start?: number;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ConnpassClient.d.ts","sourceRoot":"","sources":["../../src/application/ConnpassClient.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"ConnpassClient.d.ts","sourceRoot":"","sources":["../../src/application/ConnpassClient.ts"],"names":[],"mappings":"AAEA,OAAO,EACL,iBAAiB,EACjB,cAAc,EACd,iBAAiB,EACjB,cAAc,EACd,qBAAqB,EACrB,gBAAgB,EAChB,aAAa,EACd,MAAM,oBAAoB,CAAC;AAU5B,MAAM,WAAW,oBAAoB;IACnC,MAAM,EAAE,MAAM,CAAC;IACf,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,gBAAgB,CAAC,EAAE,OAAO,CAAC;IAC3B,uBAAuB,CAAC,EAAE,OAAO,CAAC;IAClC,sBAAsB,CAAC,EAAE,MAAM,CAAC;IAChC,qBAAqB,CAAC,EAAE,MAAM,CAAC;IAC/B,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAED,qBAAa,cAAc;IACzB,OAAO,CAAC,QAAQ,CAAC,YAAY,CAAe;IAC5C,OAAO,CAAC,QAAQ,CAAC,YAAY,CAAe;IAC5C,OAAO,CAAC,QAAQ,CAAC,WAAW,CAAc;gBAE9B,MAAM,EAAE,oBAAoB;IA6BlC,YAAY,CAAC,MAAM,GAAE,iBAAsB,GAAG,OAAO,CAAC,cAAc,CAAC;IAIrE,YAAY,CAChB,MAAM,GAAE,IAAI,CAAC,iBAAiB,EAAE,OAAO,GAAG,OAAO,CAAM,GACtD,OAAO,CAAC,cAAc,CAAC;IAIpB,qBAAqB,CAAC,OAAO,EAAE,MAAM,GAAG,OAAO,CAAC,qBAAqB,CAAC;IAItE,YAAY,CAAC,MAAM,GAAE,iBAAsB,GAA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require("path"));
|
|
8
8
|
const package_json_1 = __importDefault(require("../../package.json"));
|
|
9
|
+
const PresentationCache_1 = require("../infrastructure/cache/PresentationCache");
|
|
9
10
|
const HttpClient_1 = require("../infrastructure/http/HttpClient");
|
|
10
11
|
const repositories_1 = require("../infrastructure/repositories");
|
|
11
12
|
const services_1 = require("./services");
|
|
12
|
-
const PresentationCache_1 = require("../infrastructure/cache/PresentationCache");
|
|
13
13
|
class ConnpassClient {
|
|
14
14
|
constructor(config) {
|
|
15
15
|
if (!config.apiKey) {
|
|
16
|
-
throw new Error(
|
|
16
|
+
throw new Error("API key is required");
|
|
17
17
|
}
|
|
18
18
|
const httpClient = new HttpClient_1.HttpClient({
|
|
19
|
-
baseURL: config.baseURL ??
|
|
19
|
+
baseURL: config.baseURL ?? "https://connpass.com/api/v2",
|
|
20
20
|
apiKey: config.apiKey,
|
|
21
21
|
timeout: config.timeout,
|
|
22
22
|
rateLimitDelay: config.rateLimitDelay,
|
|
@@ -66,7 +66,7 @@ class ConnpassClient {
|
|
|
66
66
|
return this.userService.getUserPresenterEvents(userIdOrNickname, params);
|
|
67
67
|
}
|
|
68
68
|
resolveCacheEnabled(explicit) {
|
|
69
|
-
if (typeof explicit ===
|
|
69
|
+
if (typeof explicit === "boolean") {
|
|
70
70
|
return explicit;
|
|
71
71
|
}
|
|
72
72
|
const raw = process.env.CONNPASS_PRESENTATION_CACHE_ENABLED;
|
|
@@ -83,7 +83,7 @@ class ConnpassClient {
|
|
|
83
83
|
return true;
|
|
84
84
|
}
|
|
85
85
|
resolveCacheTtl(explicit) {
|
|
86
|
-
if (typeof explicit ===
|
|
86
|
+
if (typeof explicit === "number" && explicit >= 0) {
|
|
87
87
|
return explicit;
|
|
88
88
|
}
|
|
89
89
|
const fromEnv = process.env.CONNPASS_PRESENTATION_CACHE_TTL_MS;
|
|
@@ -104,7 +104,7 @@ class ConnpassClient {
|
|
|
104
104
|
if (fromEnv?.trim()) {
|
|
105
105
|
return fromEnv;
|
|
106
106
|
}
|
|
107
|
-
return path_1.default.join(process.cwd(),
|
|
107
|
+
return path_1.default.join(process.cwd(), "data", "presentation-cache.json");
|
|
108
108
|
}
|
|
109
109
|
resolveUserAgent(explicit) {
|
|
110
110
|
if (explicit?.trim()) {
|
|
@@ -114,7 +114,7 @@ class ConnpassClient {
|
|
|
114
114
|
if (fromEnv?.trim()) {
|
|
115
115
|
return fromEnv;
|
|
116
116
|
}
|
|
117
|
-
const version = package_json_1.default.version ??
|
|
117
|
+
const version = package_json_1.default.version ?? "0.0.0";
|
|
118
118
|
return `@kajidog/connpass-api-client/${version}`;
|
|
119
119
|
}
|
|
120
120
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ConnpassClient.js","sourceRoot":"","sources":["../../src/application/ConnpassClient.ts"],"names":[],"mappings":";;;;;;AAAA,gDAAwB;AACxB,sEAAqC;
|
|
1
|
+
{"version":3,"file":"ConnpassClient.js","sourceRoot":"","sources":["../../src/application/ConnpassClient.ts"],"names":[],"mappings":";;;;;;AAAA,gDAAwB;AACxB,sEAAqC;AAUrC,iFAA8E;AAC9E,kEAA+D;AAC/D,iEAIwC;AACxC,yCAAqE;AAcrE,MAAa,cAAc;IAKzB,YAAY,MAA4B;QACtC,IAAI,CAAC,MAAM,CAAC,MAAM,EAAE,CAAC;YACnB,MAAM,IAAI,KAAK,CAAC,qBAAqB,CAAC,CAAC;QACzC,CAAC;QAED,MAAM,UAAU,GAAG,IAAI,uBAAU,CAAC;YAChC,OAAO,EAAE,MAAM,CAAC,OAAO,IAAI,6BAA6B;YACxD,MAAM,EAAE,MAAM,CAAC,MAAM;YACrB,OAAO,EAAE,MAAM,CAAC,OAAO;YACvB,cAAc,EAAE,MAAM,CAAC,cAAc;YACrC,gBAAgB,EAAE,MAAM,CAAC,gBAAgB;YACzC,SAAS,EAAE,IAAI,CAAC,gBAAgB,CAAC,MAAM,CAAC,SAAS,CAAC;SACnD,CAAC,CAAC;QAEH,MAAM,iBAAiB,GAAG,I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EAAE,IAAI,EAAE,EAAE,CAAC;YACpB,OAAO,OAAO,CAAC;QACjB,CAAC;QAED,MAAM,OAAO,GAAG,sBAAG,CAAC,OAAO,IAAI,OAAO,CAAC;QACvC,OAAO,gCAAgC,OAAO,EAAE,CAAC;IACnD,CAAC;CACF;AAzJD,wCAyJC"}
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
1
|
+
import { EventSearchParams, EventsResponse, PresentationsResponse } from "../../domain/entities";
|
|
2
|
+
import { IEventRepository } from "../../domain/repositories";
|
|
3
3
|
export declare class EventService {
|
|
4
4
|
private eventRepository;
|
|
5
5
|
constructor(eventRepository: IEventRepository);
|
|
6
6
|
searchEvents(params?: EventSearchParams): Promise<EventsResponse>;
|
|
7
7
|
getEventPresentations(eventId: number): Promise<PresentationsResponse>;
|
|
8
|
-
getAllEvents(params?: Omit<EventSearchParams,
|
|
8
|
+
getAllEvents(params?: Omit<EventSearchParams, "start" | "count">): Promise<EventsResponse>;
|
|
9
9
|
}
|
|
10
10
|
//# sourceMappingURL=EventService.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"EventService.d.ts","sourceRoot":"","sources":["../../../src/application/services/EventService.ts"],"names":[],"mappings":"AAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"EventService.d.ts","sourceRoot":"","sources":["../../../src/application/services/EventService.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,iBAAiB,EACjB,cAAc,EACd,qBAAqB,EACtB,MAAM,uBAAuB,CAAC;AAC/B,OAAO,EAAE,gBAAgB,EAAE,MAAM,2BAA2B,CAAC;AAE7D,qBAAa,YAAY;IACX,OAAO,CAAC,eAAe;gBAAf,eAAe,EAAE,gBAAgB;IAE/C,YAAY,CAAC,MAAM,GAAE,iBAAsB,GAAG,OAAO,CAAC,cAAc,CAAC;IAIrE,qBAAqB,CAAC,OAAO,EAAE,MAAM,GAAG,OAAO,CAAC,qBAAqB,CAAC;IAOtE,YAAY,CAChB,MAAM,GAAE,IAAI,CAAC,iBAAiB,EAAE,OAAO,GAAG,OAAO,CAAM,GACtD,OAAO,CAAC,cAAc,CAAC;CAkC3B"}
|
|
@@ -10,7 +10,7 @@ class EventService {
|
|
|
10
10
|
}
|
|
11
11
|
async getEventPresentations(eventId) {
|
|
12
12
|
if (eventId <= 0) {
|
|
13
|
-
throw new Error(
|
|
13
|
+
throw new Error("Event ID must be a positive number");
|
|
14
14
|
}
|
|
15
15
|
return this.eventRepository.getEventPresentations(eventId);
|
|
16
16
|
}
|
|
@@ -31,7 +31,8 @@ class EventService {
|
|
|
31
31
|
}
|
|
32
32
|
allEvents.events.push(...response.events);
|
|
33
33
|
allEvents.eventsReturned += response.eventsReturned;
|
|
34
|
-
if (response.eventsReturned < count ||
|
|
34
|
+
if (response.eventsReturned < count ||
|
|
35
|
+
allEvents.events.length >= response.eventsAvailable) {
|
|
35
36
|
break;
|
|
36
37
|
}
|
|
37
38
|
start += count;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"EventService.js","sourceRoot":"","sources":["../../../src/application/services/EventService.ts"],"names":[],"mappings":";;;
|
|
1
|
+
{"version":3,"file":"EventService.js","sourceRoot":"","sources":["../../../src/application/services/EventService.ts"],"names":[],"mappings":";;;AAOA,MAAa,YAAY;IACvB,YAAoB,eAAiC;QAAjC,oBAAe,GAAf,eAAe,CAAkB;IAAG,CAAC;IAEzD,KAAK,CAAC,YAAY,CAAC,SAA4B,EAAE;QAC/C,OAAO,IAAI,CAAC,eAAe,CAAC,YAAY,CAAC,MAAM,CAAC,CAAC;IACnD,CAAC;IAED,KAAK,CAAC,qBAAqB,CAAC,OAAe;QACzC,IAAI,OAAO,IAAI,CAAC,EAAE,CAAC;YACjB,MAAM,IAAI,KAAK,CAAC,oCAAoC,CAAC,CAAC;QACxD,CAAC;QACD,OAAO,IAAI,CAAC,eAAe,CAAC,qBAAqB,CAAC,OAAO,CAAC,CAAC;IAC7D,CAAC;IAED,KAAK,CAAC,YAAY,CAChB,SAAqD,EAAE;QAEvD,MAAM,SAAS,GAAmB;YAChC,cAAc,EAAE,CAAC;YACjB,eAAe,EAAE,CAAC;YAClB,WAAW,EAAE,CAAC;YACd,MAAM,EAAE,EAAE;SACX,CAAC;QAEF,IAAI,KAAK,GAAG,CAAC,CAAC;QACd,MAAM,KAAK,GAAG,GAAG,CAAC;QAElB,OAAO,IAAI,EAAE,CAAC;YACZ,MAAM,QAAQ,GAAG,MAAM,IAAI,CAAC,YAAY,CAAC,EAAE,GAAG,MAAM,EAAE,KAAK,EAAE,KAAK,EAAE,CAAC,CAAC;YAEtE,IAAI,SAAS,CAAC,eAAe,KAAK,CAAC,EAAE,CAAC;gBACpC,SAAS,CAAC,eAAe,GAAG,QAAQ,CAAC,eAAe,CAAC;gBACrD,SAAS,CAAC,WAAW,GAAG,QAAQ,CAAC,WAAW,CAAC;YAC/C,CAAC;YAED,SAAS,CAAC,MAAM,CAAC,IAAI,CAAC,GAAG,QAAQ,CAAC,MAAM,CAAC,CAAC;YAC1C,SAAS,CAAC,cAAc,IAAI,QAAQ,CAAC,cAAc,CAAC;YAEpD,IACE,QAAQ,CAAC,cAAc,GAAG,KAAK;gBAC/B,SAAS,CAAC,MAAM,CAAC,MAAM,IAAI,QAAQ,CAAC,eAAe,EACnD,CAAC;gBACD,MAAM;YACR,CAAC;YAED,KAAK,IAAI,KAAK,CAAC;QACjB,CAAC;QAED,OAAO,SAAS,CAAC;IACnB,CAAC;CACF;AAlDD,oCAkDC"}
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
1
|
+
import { GroupSearchParams, GroupsResponse } from "../../domain/entities";
|
|
2
|
+
import { IGroupRepository } from "../../domain/repositories";
|
|
3
3
|
export declare class GroupService {
|
|
4
4
|
private groupRepository;
|
|
5
5
|
constructor(groupRepository: IGroupRepository);
|
|
6
6
|
searchGroups(params?: GroupSearchParams): Promise<GroupsResponse>;
|
|
7
|
-
getAllGroups(params?: Omit<GroupSearchParams,
|
|
7
|
+
getAllGroups(params?: Omit<GroupSearchParams, "start" | "count">): Promise<GroupsResponse>;
|
|
8
8
|
}
|
|
9
9
|
//# sourceMappingURL=GroupService.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"GroupService.d.ts","sourceRoot":"","sources":["../../../src/application/services/GroupService.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"GroupService.d.ts","sourceRoot":"","sources":["../../../src/application/services/GroupService.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAC;AAC1E,OAAO,EAAE,gBAAgB,EAAE,MAAM,2BAA2B,CAAC;AAE7D,qBAAa,YAAY;IACX,OAAO,CAAC,eAAe;gBAAf,eAAe,EAAE,gBAAgB;IAE/C,YAAY,CAAC,MAAM,GAAE,iBAAsB,GAAG,OAAO,CAAC,cAAc,CAAC;IAIrE,YAAY,CAChB,MAAM,GAAE,IAAI,CAAC,iBAAiB,EAAE,OAAO,GAAG,OAAO,CAAM,GACtD,OAAO,CAAC,cAAc,CAAC;CAkC3B"}
|
|
@@ -25,7 +25,8 @@ class GroupService {
|
|
|
25
25
|
}
|
|
26
26
|
allGroups.groups.push(...response.groups);
|
|
27
27
|
allGroups.groupsReturned += response.groupsReturned;
|
|
28
|
-
if (response.groupsReturned < count ||
|
|
28
|
+
if (response.groupsReturned < count ||
|
|
29
|
+
allGroups.groups.length >= response.groupsAvailable) {
|
|
29
30
|
break;
|
|
30
31
|
}
|
|
31
32
|
start += count;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"GroupService.js","sourceRoot":"","sources":["../../../src/application/services/GroupService.ts"],"names":[],"mappings":";;;AAGA,MAAa,YAAY;IACvB,YAAoB,eAAiC;QAAjC,oBAAe,GAAf,eAAe,CAAkB;IAAG,CAAC;IAEzD,KAAK,CAAC,YAAY,C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nD,CAAC;gBACD,MAAM;YACR,CAAC;YAED,KAAK,IAAI,KAAK,CAAC;QACjB,CAAC;QAED,OAAO,SAAS,CAAC;IACnB,CAAC;CACF;AA3CD,oCA2CC"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
1
|
+
import { EventsResponse, GroupsResponse, UserSearchParams, UsersResponse } from "../../domain/entities";
|
|
2
|
+
import { IUserRepository } from "../../domain/repositories";
|
|
3
3
|
export declare class UserService {
|
|
4
4
|
private userRepository;
|
|
5
5
|
private readonly nicknameCache;
|
|
@@ -19,7 +19,7 @@ export declare class UserService {
|
|
|
19
19
|
order?: 1 | 2 | 3;
|
|
20
20
|
start?: number;
|
|
21
21
|
}): Promise<EventsResponse>;
|
|
22
|
-
getAllUsers(params?: Omit<UserSearchParams,
|
|
22
|
+
getAllUsers(params?: Omit<UserSearchParams, "start" | "count">): Promise<UsersResponse>;
|
|
23
23
|
private resolveUserNickname;
|
|
24
24
|
}
|
|
25
25
|
//# sourceMappingURL=UserService.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"UserService.d.ts","sourceRoot":"","sources":["../../../src/application/services/UserService.ts"],"names":[],"mappings":"AAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"UserService.d.ts","sourceRoot":"","sources":["../../../src/application/services/UserService.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,cAAc,EACd,cAAc,EACd,gBAAgB,EAChB,aAAa,EACd,MAAM,uBAAuB,CAAC;AAC/B,OAAO,EAAE,eAAe,EAAE,MAAM,2BAA2B,CAAC;AAE5D,qBAAa,WAAW;IAGV,OAAO,CAAC,cAAc;IAFlC,OAAO,CAAC,QAAQ,CAAC,aAAa,CAA6B;gBAEvC,cAAc,EAAE,eAAe;IAE7C,WAAW,CAAC,MAAM,GAAE,gBAAqB,GAAG,OAAO,CAAC,aAAa,CAAC;IAIlE,aAAa,CACjB,gBAAgB,EAAE,MAAM,GAAG,MAAM,EACjC,MAAM,CAAC,EAAE;QAAE,KAAK,CAAC,EAAE,MAAM,CAAC;QAAC,KAAK,CAAC,EAAE,MAAM,CAAA;KAAE,GAC1C,OAAO,CAAC,cAAc,CAAC;IAKpB,qBAAqB,CACzB,gBAAgB,EAAE,MAAM,GAAG,MAAM,EACjC,MAAM,CAAC,EAAE;QAAE,KAAK,CAAC,EAAE,MAAM,CAAC;QAAC,KAAK,CAAC,EAAE,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC;QAAC,KAAK,CAAC,EAAE,MAAM,CAAA;KAAE,GAC7D,OAAO,CAAC,cAAc,CAAC;IAKpB,sBAAsB,CAC1B,gBAAgB,EAAE,MAAM,GAAG,MAAM,EACjC,MAAM,CAAC,EAAE;QAAE,KAAK,CAAC,EAAE,MAAM,CAAC;QAAC,KAAK,CAAC,EAAE,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC;QAAC,KAAK,CAAC,EAAE,MAAM,CAAA;KAAE,GAC7D,OAAO,CAAC,cAAc,CAAC;IAKpB,WAAW,CACf,MAAM,GAAE,IAAI,CAAC,gBAAgB,EAAE,OAAO,GAAG,OAAO,CAAM,GACrD,OAAO,CAAC,aAAa,CAAC;YAmCX,mBAAmB;CAkClC"}
|
|
@@ -38,7 +38,8 @@ class UserService {
|
|
|
38
38
|
}
|
|
39
39
|
allUsers.users.push(...response.users);
|
|
40
40
|
allUsers.usersReturned += response.usersReturned;
|
|
41
|
-
if (response.usersReturned < count ||
|
|
41
|
+
if (response.usersReturned < count ||
|
|
42
|
+
allUsers.users.length >= response.usersAvailable) {
|
|
42
43
|
break;
|
|
43
44
|
}
|
|
44
45
|
start += count;
|
|
@@ -46,22 +47,25 @@ class UserService {
|
|
|
46
47
|
return allUsers;
|
|
47
48
|
}
|
|
48
49
|
async resolveUserNickname(userIdOrNickname) {
|
|
49
|
-
if (typeof userIdOrNickname ===
|
|
50
|
+
if (typeof userIdOrNickname === "string") {
|
|
50
51
|
const nickname = userIdOrNickname.trim();
|
|
51
52
|
if (!nickname) {
|
|
52
|
-
throw new Error(
|
|
53
|
+
throw new Error("Nickname must be a non-empty string");
|
|
53
54
|
}
|
|
54
55
|
return nickname;
|
|
55
56
|
}
|
|
56
57
|
if (!Number.isFinite(userIdOrNickname) || userIdOrNickname <= 0) {
|
|
57
|
-
throw new Error(
|
|
58
|
+
throw new Error("User ID must be a positive number");
|
|
58
59
|
}
|
|
59
60
|
const userId = Math.trunc(userIdOrNickname);
|
|
60
61
|
const cachedNickname = this.nicknameCache.get(userId);
|
|
61
62
|
if (cachedNickname) {
|
|
62
63
|
return cachedNickname;
|
|
63
64
|
}
|
|
64
|
-
const response = await this.userRepository.searchUsers({
|
|
65
|
+
const response = await this.userRepository.searchUsers({
|
|
66
|
+
userId: [userId],
|
|
67
|
+
count: 1,
|
|
68
|
+
});
|
|
65
69
|
const user = response.users.find((candidate) => candidate.id === userId);
|
|
66
70
|
if (!user) {
|
|
67
71
|
throw new Error(`User with ID ${userId} was not found`);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"UserService.js","sourceRoot":"","sources":["../../../src/application/services/UserService.ts"],"names":[],"mappings":";;;
|
|
1
|
+
{"version":3,"file":"UserService.js","sourceRoot":"","sources":["../../../src/application/services/UserService.ts"],"names":[],"mappings":";;;AAQA,MAAa,WAAW;IAGtB,YAAoB,cAA+B;QAA/B,mBAAc,GAAd,cAAc,CAAiB;QAFlC,kBAAa,GAAG,IAAI,GAAG,EAAkB,CAAC;IAEL,CAAC;IAEvD,KAAK,CAAC,WAAW,CAAC,SAA2B,EAAE;QAC7C,OAAO,IAAI,CAAC,cAAc,CAAC,WAAW,CAAC,MAAM,CAAC,CAAC;IACjD,CAAC;IAED,KAAK,CAAC,aAAa,CACjB,gBAAiC,EACjC,MAA2C;QAE3C,MAAM,QAAQ,GAAG,MAAM,IAAI,CAAC,mBAAmB,CAAC,gBAAgB,CAAC,CAAC;QAClE,OAAO,IAAI,CAAC,cAAc,CAAC,aAAa,CA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CAAC;QAC1D,CAAC;QAED,IAAI,CAAC,aAAa,CAAC,GAAG,CAAC,MAAM,EAAE,IAAI,CAAC,QAAQ,CAAC,CAAC;QAC9C,OAAO,IAAI,CAAC,QAAQ,CAAC;IACvB,CAAC;CACF;AAxGD,kCAwGC"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export * from
|
|
2
|
-
export * from
|
|
3
|
-
export * from
|
|
1
|
+
export * from "./EventService";
|
|
2
|
+
export * from "./GroupService";
|
|
3
|
+
export * from "./UserService";
|
|
4
4
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
export * from
|
|
2
|
-
export * from
|
|
3
|
-
export * from
|
|
4
|
-
export * from
|
|
1
|
+
export * from "./Event";
|
|
2
|
+
export * from "./Group";
|
|
3
|
+
export * from "./User";
|
|
4
|
+
export * from "./Presentation";
|
|
5
5
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
export declare class ConnpassError extends Error {
|
|
2
2
|
readonly statusCode?: number | undefined;
|
|
3
|
-
readonly response?:
|
|
4
|
-
constructor(message: string, statusCode?: number | undefined, response?:
|
|
3
|
+
readonly response?: unknown | undefined;
|
|
4
|
+
constructor(message: string, statusCode?: number | undefined, response?: unknown | undefined);
|
|
5
5
|
}
|
|
6
6
|
export declare class ConnpassApiError extends ConnpassError {
|
|
7
|
-
constructor(message: string, statusCode: number, response:
|
|
7
|
+
constructor(message: string, statusCode: number, response: unknown);
|
|
8
8
|
}
|
|
9
9
|
export declare class ConnpassRateLimitError extends ConnpassError {
|
|
10
10
|
constructor(message?: string);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ConnpassError.d.ts","sourceRoot":"","sources":["../../../src/domain/errors/ConnpassError.ts"],"names":[],"mappings":"AAAA,qBAAa,aAAc,SAAQ,KAAK;aAGpB,UAAU,CAAC,EAAE,MAAM;aACnB,QAAQ,CAAC,EAAE,
|
|
1
|
+
{"version":3,"file":"ConnpassError.d.ts","sourceRoot":"","sources":["../../../src/domain/errors/ConnpassError.ts"],"names":[],"mappings":"AAAA,qBAAa,aAAc,SAAQ,KAAK;aAGpB,UAAU,CAAC,EAAE,MAAM;aACnB,QAAQ,CAAC,EAAE,OAAO;gBAFlC,OAAO,EAAE,MAAM,EACC,UAAU,CAAC,EAAE,MAAM,YAAA,EACnB,QAAQ,CAAC,EAAE,OAAO,YAAA;CAMrC;AAED,qBAAa,gBAAiB,SAAQ,aAAa;gBACrC,OAAO,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,EAAE,QAAQ,EAAE,OAAO;CAKnE;AAED,qBAAa,sBAAuB,SAAQ,aAAa;gBAC3C,OAAO,SAAwB;CAK5C;AAED,qBAAa,uBAAwB,SAAQ,aAAa;gBAC5C,OAAO,EAAE,MAAM;CAK5B;AAED,qBAAa,oBAAqB,SAAQ,aAAa;gBACzC,OAAO,SAAoB;CAKxC"}
|
|
@@ -6,7 +6,7 @@ class ConnpassError extends Error {
|
|
|
6
6
|
super(message);
|
|
7
7
|
this.statusCode = statusCode;
|
|
8
8
|
this.response = response;
|
|
9
|
-
this.name =
|
|
9
|
+
this.name = "ConnpassError";
|
|
10
10
|
Object.setPrototypeOf(this, ConnpassError.prototype);
|
|
11
11
|
}
|
|
12
12
|
}
|
|
@@ -14,15 +14,15 @@ exports.ConnpassError = ConnpassError;
|
|
|
14
14
|
class ConnpassApiError extends ConnpassError {
|
|
15
15
|
constructor(message, statusCode, response) {
|
|
16
16
|
super(`API Error: ${message}`, statusCode, response);
|
|
17
|
-
this.name =
|
|
17
|
+
this.name = "ConnpassApiError";
|
|
18
18
|
Object.setPrototypeOf(this, ConnpassApiError.prototype);
|
|
19
19
|
}
|
|
20
20
|
}
|
|
21
21
|
exports.ConnpassApiError = ConnpassApiError;
|
|
22
22
|
class ConnpassRateLimitError extends ConnpassError {
|
|
23
|
-
constructor(message =
|
|
23
|
+
constructor(message = "Rate limit exceeded") {
|
|
24
24
|
super(message, 429);
|
|
25
|
-
this.name =
|
|
25
|
+
this.name = "ConnpassRateLimitError";
|
|
26
26
|
Object.setPrototypeOf(this, ConnpassRateLimitError.prototype);
|
|
27
27
|
}
|
|
28
28
|
}
|
|
@@ -30,15 +30,15 @@ exports.ConnpassRateLimitError = ConnpassRateLimitError;
|
|
|
30
30
|
class ConnpassValidationError extends ConnpassError {
|
|
31
31
|
constructor(message) {
|
|
32
32
|
super(`Validation Error: ${message}`);
|
|
33
|
-
this.name =
|
|
33
|
+
this.name = "ConnpassValidationError";
|
|
34
34
|
Object.setPrototypeOf(this, ConnpassValidationError.prototype);
|
|
35
35
|
}
|
|
36
36
|
}
|
|
37
37
|
exports.ConnpassValidationError = ConnpassValidationError;
|
|
38
38
|
class ConnpassTimeoutError extends ConnpassError {
|
|
39
|
-
constructor(message =
|
|
39
|
+
constructor(message = "Request timeout") {
|
|
40
40
|
super(message);
|
|
41
|
-
this.name =
|
|
41
|
+
this.name = "ConnpassTimeoutError";
|
|
42
42
|
Object.setPrototypeOf(this, ConnpassTimeoutError.prototype);
|
|
43
43
|
}
|
|
44
44
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ConnpassError.js","sourceRoot":"","sources":["../../../src/domain/errors/ConnpassError.ts"],"names":[],"mappings":";;;AAAA,MAAa,aAAc,SAAQ,KAAK;IACtC,YACE,OAAe,EACC,UAAmB,EACnB,
|
|
1
|
+
{"version":3,"file":"ConnpassError.js","sourceRoot":"","sources":["../../../src/domain/errors/ConnpassError.ts"],"names":[],"mappings":";;;AAAA,MAAa,aAAc,SAAQ,KAAK;IACtC,YACE,OAAe,EACC,UAAmB,EACnB,QAAkB;QAElC,KAAK,CAAC,OAAO,CAAC,CAAC;QAHC,eAAU,GAAV,UAAU,CAAS;QACnB,aAAQ,GAAR,QAAQ,CAAU;QAGlC,IAAI,CAAC,IAAI,GAAG,eAAe,CAAC;QAC5B,MAAM,CAAC,cAAc,CAAC,IAAI,E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map
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { EventSearchParams, EventsResponse, PresentationsResponse } from
|
|
1
|
+
import { EventSearchParams, EventsResponse, PresentationsResponse } from "../entities";
|
|
2
2
|
export interface IEventRepository {
|
|
3
3
|
searchEvents(params: EventSearchParams): Promise<EventsResponse>;
|
|
4
4
|
getEventPresentations(eventId: number): Promise<PresentationsResponse>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"IEventRepository.d.ts","sourceRoot":"","sources":["../../../src/domain/repositories/IEventRepository.ts"],"names":[],"mappings":"AAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"IEventRepository.d.ts","sourceRoot":"","sources":["../../../src/domain/repositories/IEventRepository.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,iBAAiB,EACjB,cAAc,EACd,qBAAqB,EACtB,MAAM,aAAa,CAAC;AAErB,MAAM,WAAW,gBAAgB;IAC/B,YAAY,CAAC,MAAM,EAAE,iBAAiB,GAAG,OAAO,CAAC,cAAc,CAAC,CAAC;IACjE,qBAAqB,CAAC,OAAO,EAAE,MAAM,GAAG,OAAO,CAAC,qBAAqB,CAAC,CAAC;CACxE"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { EventsResponse, GroupsResponse, UserSearchParams, UsersResponse } from "../entities";
|
|
2
2
|
export interface IUserRepository {
|
|
3
3
|
searchUsers(params: UserSearchParams): Promise<UsersResponse>;
|
|
4
4
|
getUserGroups(nickname: string, params?: {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"IUserRepository.d.ts","sourceRoot":"","sources":["../../../src/domain/repositories/IUserRepository.ts"],"names":[],"mappings":"AAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"IUserRepository.d.ts","sourceRoot":"","sources":["../../../src/domain/repositories/IUserRepository.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,cAAc,EACd,cAAc,EACd,gBAAgB,EAChB,aAAa,EACd,MAAM,aAAa,CAAC;AAErB,MAAM,WAAW,eAAe;IAC9B,WAAW,CAAC,MAAM,EAAE,gBAAgB,GAAG,OAAO,CAAC,aAAa,CAAC,CAAC;IAC9D,aAAa,CACX,QAAQ,EAAE,MAAM,EAChB,MAAM,CAAC,EAAE;QAAE,KAAK,CAAC,EAAE,MAAM,CAAC;QAAC,KAAK,CAAC,EAAE,MAAM,CAAA;KAAE,GAC1C,OAAO,CAAC,cAAc,CAAC,CAAC;IAC3B,qBAAqB,CACnB,QAAQ,EAAE,MAAM,EAChB,MAAM,CAAC,EAAE;QAAE,KAAK,CAAC,EAAE,MAAM,CAAC;QAAC,KAAK,CAAC,EAAE,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC;QAAC,KAAK,CAAC,EAAE,MAAM,CAAA;KAAE,GAC7D,OAAO,CAAC,cAAc,CAAC,CAAC;IAC3B,sBAAsB,CACpB,QAAQ,EAAE,MAAM,EAChB,MAAM,CAAC,EAAE;QAAE,KAAK,CAAC,EAAE,MAAM,CAAC;QAAC,KAAK,CAAC,EAAE,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC;QAAC,KAAK,CAAC,EAAE,MAAM,CAAA;KAAE,GAC7D,OAAO,CAAC,cAAc,CAAC,CAAC;CAC5B"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export * from
|
|
2
|
-
export * from
|
|
3
|
-
export * from
|
|
1
|
+
export * from "./IEventRepository";
|
|
2
|
+
export * from "./IGroupRepository";
|
|
3
|
+
export * from "./IUserRepository";
|
|
4
4
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { EventSearchParams, GroupSearchParams, UserSearchParams } from
|
|
2
|
-
export declare
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
}
|
|
1
|
+
import { EventSearchParams, GroupSearchParams, UserSearchParams } from "../../domain/entities";
|
|
2
|
+
export declare const Validators: {
|
|
3
|
+
validateEventSearchParams(params: EventSearchParams): void;
|
|
4
|
+
validateGroupSearchParams(params: GroupSearchParams): void;
|
|
5
|
+
validateUserSearchParams(params: UserSearchParams): void;
|
|
6
|
+
validatePositiveInteger(value: number, fieldName: string): void;
|
|
7
|
+
validateNickname(value: string, fieldName?: string): void;
|
|
8
|
+
};
|
|
9
9
|
//# sourceMappingURL=validators.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"validators.d.ts","sourceRoot":"","sources":["../../../src/domain/utils/validators.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"validators.d.ts","sourceRoot":"","sources":["../../../src/domain/utils/validators.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,iBAAiB,EACjB,iBAAiB,EACjB,gBAAgB,EACjB,MAAM,uBAAuB,CAAC;AAG/B,eAAO,MAAM,UAAU;sCACa,iBAAiB,GAAG,IAAI;sCAiDxB,iBAAiB,GAAG,IAAI;qCAyBzB,gBAAgB,GAAG,IAAI;mCAyBzB,MAAM,aAAa,MAAM,GAAG,IAAI;4BAQvC,MAAM,cAAa,MAAM,GAAgB,IAAI;CAOtE,CAAC"}
|