@proxima-nexus/sdk-typescript 2.0.1 → 2.1.1
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/CHANGELOG.md +31 -0
- package/README.md +48 -8
- package/dist/api/group-api.d.ts +1 -2
- package/dist/api/group-api.js +1 -2
- package/dist/api/user-api.d.ts +3 -4
- package/dist/api/user-api.js +2 -3
- package/dist/enhanced/enhanced-event-api.d.ts +21 -0
- package/dist/enhanced/enhanced-event-api.js +58 -0
- package/dist/enhanced/enhanced-group-api.d.ts +26 -0
- package/dist/enhanced/enhanced-group-api.js +77 -0
- package/dist/enhanced/enhanced-user-api.d.ts +25 -0
- package/dist/enhanced/enhanced-user-api.js +74 -0
- package/dist/enhanced/errors.d.ts +40 -0
- package/dist/enhanced/errors.js +87 -0
- package/dist/enhanced/index.d.ts +34 -0
- package/dist/enhanced/index.js +64 -0
- package/dist/enhanced/types.d.ts +6 -0
- package/dist/enhanced/types.js +7 -0
- package/dist/index.d.ts +2 -0
- package/dist/index.js +13 -1
- package/dist/models/entity-connection-dto.d.ts +11 -12
- package/dist/models/entity-connection-dto.js +9 -10
- package/dist/models/event-entity-connection-dto.d.ts +11 -12
- package/dist/models/event-entity-connection-dto.js +9 -10
- package/dist/models/group-entity-connection-dto.d.ts +11 -12
- package/dist/models/group-entity-connection-dto.js +9 -10
- package/dist/models/user-entity-connection-dto.d.ts +11 -12
- package/dist/models/user-entity-connection-dto.js +9 -10
- package/package.json +2 -2
package/CHANGELOG.md
CHANGED
|
@@ -5,6 +5,37 @@ All notable changes to the Proxima Nexus TypeScript SDK are documented in this f
|
|
|
5
5
|
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
|
|
6
6
|
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
|
7
7
|
|
|
8
|
+
## [2.1.1] - 2026-02-04
|
|
9
|
+
|
|
10
|
+
### Changed
|
|
11
|
+
|
|
12
|
+
- Updated `@proxima-nexus/openapi` to `^2.0.1` and regenerated connection DTOs to match the latest API schema for connection states (including `incoming_request`, `outgoing_request`, and `invited`).
|
|
13
|
+
- Made `state` optional on connection DTOs and cleaned up enum values to better reflect the underlying API.
|
|
14
|
+
- Updated `UserApi` and `GroupApi` connection state enums to use the new state names.
|
|
15
|
+
- Adjusted enhanced client helpers so that:
|
|
16
|
+
- `getPendingFriendRequests` returns both incoming and outgoing friend requests using the new state values.
|
|
17
|
+
- `getBlockedUsers` filters on connection type `blocked` while keeping state `active`.
|
|
18
|
+
- `getMembers` for groups returns active members, admins, and the owner.
|
|
19
|
+
|
|
20
|
+
## [2.1.0] - 2025-01-30
|
|
21
|
+
|
|
22
|
+
### Added
|
|
23
|
+
|
|
24
|
+
- **Enhanced Client** (`EnhancedProximaNexusClient`) – Higher-level API that wraps the base client with:
|
|
25
|
+
- **Simplified method signatures** – No `RawAxiosRequestConfig`; `requesterUserId` instead of `xProximaNexusRequesterUserId`
|
|
26
|
+
- **Unwrapped return values** – Methods return `Promise<T>` (e.g. `UserDto`) instead of Axios response; no `.data` needed
|
|
27
|
+
- **Domain-focused methods** – e.g. `getUser`, `getFriends`, `sendFriendRequest`, `acceptFriendRequest`, `searchByDisplayName`, `searchByRadius`, `searchByBoundingBox`
|
|
28
|
+
- **Friend workflow** – `sendFriendRequest`, `acceptFriendRequest`, `declineFriendRequest`, `removeFriend`, `getFriends`, `getPendingFriendRequests`
|
|
29
|
+
- **Blocking** – `blockUser`, `unblockUser`, `getBlockedUsers`
|
|
30
|
+
- **Event attendee/role** – `addAttendee`, `removeAttendee`, `getAttendees`, `promoteToAdmin`, `demoteToAttendee`, `getAdmins`, `getOwner`
|
|
31
|
+
- **Group membership** – `joinGroup`, `leaveGroup`, `approveMember`, `rejectMember`, `removeMember`, `getMembers`, `getPendingMembers`, `promoteToAdmin`, `demoteToMember`, `getAdmins`, `getOwner`
|
|
32
|
+
- **Custom errors** – `NotFoundError`, `UnauthorizedError`, `ValidationError` (thrown instead of raw Axios errors when using the enhanced client)
|
|
33
|
+
- **Base client access** – `client.base` on `EnhancedProximaNexusClient` for direct access to `UserApi`, `EventApi`, `GroupApi` when needed
|
|
34
|
+
|
|
35
|
+
### Changed
|
|
36
|
+
|
|
37
|
+
- None; base client API is unchanged. Enhanced client is additive.
|
|
38
|
+
|
|
8
39
|
## [2.0.1] - 2025-01-29
|
|
9
40
|
|
|
10
41
|
### Changed
|
package/README.md
CHANGED
|
@@ -2,29 +2,57 @@
|
|
|
2
2
|
|
|
3
3
|
TypeScript SDK for the Proxima Nexus Data Plane API.
|
|
4
4
|
|
|
5
|
-
> **Note:** This SDK version 2.0.0 includes breaking changes. See the [CHANGELOG.md](./CHANGELOG.md) for migration details.
|
|
6
|
-
|
|
7
5
|
## Installation
|
|
8
6
|
|
|
9
7
|
```bash
|
|
10
8
|
npm install @proxima-nexus/sdk-typescript
|
|
11
9
|
```
|
|
12
10
|
|
|
11
|
+
## Client Options
|
|
12
|
+
|
|
13
|
+
The SDK provides two client options:
|
|
14
|
+
|
|
15
|
+
- **ProximaNexusClient** (base) – Direct mapping to the Data Plane API. Returns Axios promises; you use `.data` on responses.
|
|
16
|
+
- **EnhancedProximaNexusClient** – Higher-level API with simpler method names, unwrapped return values (no `.data`), and domain helpers (e.g. `getFriends`, `searchByDisplayName`). Use `client.base` when you need the raw APIs.
|
|
17
|
+
|
|
13
18
|
## Usage
|
|
14
19
|
|
|
15
|
-
### Basic Setup
|
|
20
|
+
### Basic Setup (Base Client)
|
|
16
21
|
|
|
17
22
|
```typescript
|
|
18
23
|
import { ProximaNexusClient } from '@proxima-nexus/sdk-typescript';
|
|
19
24
|
|
|
20
|
-
// Initialize client
|
|
21
25
|
const client = new ProximaNexusClient({
|
|
22
26
|
apiKey: process.env.PROXIMA_NEXUS_API_KEY!,
|
|
23
27
|
baseURL: 'https://api.proxima-nexus.com',
|
|
24
28
|
});
|
|
25
29
|
```
|
|
26
30
|
|
|
27
|
-
###
|
|
31
|
+
### Enhanced Client (Recommended for New Code)
|
|
32
|
+
|
|
33
|
+
```typescript
|
|
34
|
+
import { EnhancedProximaNexusClient } from '@proxima-nexus/sdk-typescript';
|
|
35
|
+
|
|
36
|
+
const client = new EnhancedProximaNexusClient({
|
|
37
|
+
apiKey: process.env.PROXIMA_NEXUS_API_KEY!,
|
|
38
|
+
baseURL: 'https://api.proxima-nexus.com',
|
|
39
|
+
});
|
|
40
|
+
|
|
41
|
+
// Methods return unwrapped data (no .data)
|
|
42
|
+
const user = await client.users.getUser('user-123', 'requester-123'); // UserDto
|
|
43
|
+
const friends = await client.users.getFriends('user-123'); // UserEntityConnectionDto[]
|
|
44
|
+
const users = await client.users.searchByDisplayName('John', undefined, 10);
|
|
45
|
+
|
|
46
|
+
// Friend workflow
|
|
47
|
+
await client.users.sendFriendRequest('alice-id', 'bob-id');
|
|
48
|
+
await client.users.acceptFriendRequest('bob-id', 'alice-id');
|
|
49
|
+
await client.users.removeFriend('alice-id', 'bob-id');
|
|
50
|
+
|
|
51
|
+
// Access raw APIs when needed
|
|
52
|
+
const rawResponse = await client.base.users.get('user-123');
|
|
53
|
+
```
|
|
54
|
+
|
|
55
|
+
### User Operations (Base Client)
|
|
28
56
|
|
|
29
57
|
```typescript
|
|
30
58
|
async function main() {
|
|
@@ -124,7 +152,7 @@ async function main() {
|
|
|
124
152
|
}
|
|
125
153
|
```
|
|
126
154
|
|
|
127
|
-
### Event Operations
|
|
155
|
+
### Event Operations (Base Client)
|
|
128
156
|
|
|
129
157
|
```typescript
|
|
130
158
|
async function main() {
|
|
@@ -219,7 +247,7 @@ async function main() {
|
|
|
219
247
|
}
|
|
220
248
|
```
|
|
221
249
|
|
|
222
|
-
### Group Operations
|
|
250
|
+
### Group Operations (Base Client)
|
|
223
251
|
|
|
224
252
|
```typescript
|
|
225
253
|
async function main() {
|
|
@@ -310,9 +338,21 @@ async function main() {
|
|
|
310
338
|
}
|
|
311
339
|
```
|
|
312
340
|
|
|
341
|
+
## Enhanced Client API Overview
|
|
342
|
+
|
|
343
|
+
The enhanced client exposes domain-focused methods:
|
|
344
|
+
|
|
345
|
+
**Users:** `getUser`, `getUsers`, `createUser`, `updateUser`, `deleteUser`, `searchByDisplayName`, `searchByRadius`, `searchByBoundingBox`, `sendFriendRequest`, `acceptFriendRequest`, `declineFriendRequest`, `removeFriend`, `getFriends`, `getPendingFriendRequests`, `blockUser`, `unblockUser`, `getBlockedUsers`, `getEvents`, `getGroups`
|
|
346
|
+
|
|
347
|
+
**Events:** `getEvent`, `getEvents`, `createEvent`, `updateEvent`, `deleteEvent`, `searchByDisplayName`, `searchByRadius`, `searchByBoundingBox`, `addAttendee`, `removeAttendee`, `getAttendees`, `promoteToAdmin`, `demoteToAttendee`, `getAdmins`, `getOwner`
|
|
348
|
+
|
|
349
|
+
**Groups:** `getGroup`, `getGroups`, `createGroup`, `updateGroup`, `deleteGroup`, `searchByDisplayName`, `searchByRadius`, `searchByBoundingBox`, `joinGroup`, `leaveGroup`, `approveMember`, `rejectMember`, `removeMember`, `getMembers`, `getPendingMembers`, `promoteToAdmin`, `demoteToMember`, `getAdmins`, `getOwner`, `getEvents`
|
|
350
|
+
|
|
351
|
+
Errors from the enhanced client are thrown as `NotFoundError`, `UnauthorizedError`, or `ValidationError` (see `src/enhanced/errors.ts`).
|
|
352
|
+
|
|
313
353
|
## Requester User ID
|
|
314
354
|
|
|
315
|
-
In version 2.0.0, the requester user ID is passed as a method parameter (`xProximaNexusRequesterUserId`) rather than in request bodies. This parameter is optional for most operations but required for operations that modify entities (create, update, delete) or when accessing non-public entities.
|
|
355
|
+
In version 2.0.0, the requester user ID is passed as a method parameter (`xProximaNexusRequesterUserId` / `requesterUserId`) rather than in request bodies. This parameter is optional for most operations but required for operations that modify entities (create, update, delete) or when accessing non-public entities.
|
|
316
356
|
|
|
317
357
|
## Configuration
|
|
318
358
|
|
package/dist/api/group-api.d.ts
CHANGED
|
@@ -573,8 +573,7 @@ export declare class GroupApi extends BaseAPI implements GroupApiInterface {
|
|
|
573
573
|
export declare enum GroupControllerGetConnectionsStateEnum {
|
|
574
574
|
requested = "requested",
|
|
575
575
|
active = "active",
|
|
576
|
-
|
|
577
|
-
blocked = "blocked"
|
|
576
|
+
invited = "invited"
|
|
578
577
|
}
|
|
579
578
|
export declare enum GroupControllerGetConnectionsTypeEnum {
|
|
580
579
|
member = "member",
|
package/dist/api/group-api.js
CHANGED
|
@@ -897,8 +897,7 @@ var GroupControllerGetConnectionsStateEnum;
|
|
|
897
897
|
(function (GroupControllerGetConnectionsStateEnum) {
|
|
898
898
|
GroupControllerGetConnectionsStateEnum["requested"] = "requested";
|
|
899
899
|
GroupControllerGetConnectionsStateEnum["active"] = "active";
|
|
900
|
-
GroupControllerGetConnectionsStateEnum["
|
|
901
|
-
GroupControllerGetConnectionsStateEnum["blocked"] = "blocked";
|
|
900
|
+
GroupControllerGetConnectionsStateEnum["invited"] = "invited";
|
|
902
901
|
})(GroupControllerGetConnectionsStateEnum || (exports.GroupControllerGetConnectionsStateEnum = GroupControllerGetConnectionsStateEnum = {}));
|
|
903
902
|
var GroupControllerGetConnectionsTypeEnum;
|
|
904
903
|
(function (GroupControllerGetConnectionsTypeEnum) {
|
package/dist/api/user-api.d.ts
CHANGED
|
@@ -617,10 +617,9 @@ export declare enum UserControllerDeleteConnectionTypeEnum {
|
|
|
617
617
|
blocked = "blocked"
|
|
618
618
|
}
|
|
619
619
|
export declare enum UserControllerGetConnectionsStateEnum {
|
|
620
|
-
|
|
621
|
-
|
|
622
|
-
|
|
623
|
-
blocked = "blocked"
|
|
620
|
+
incoming_request = "incoming_request",
|
|
621
|
+
outgoing_request = "outgoing_request",
|
|
622
|
+
active = "active"
|
|
624
623
|
}
|
|
625
624
|
export declare enum UserControllerGetConnectionsTypeEnum {
|
|
626
625
|
friend = "friend",
|
package/dist/api/user-api.js
CHANGED
|
@@ -964,10 +964,9 @@ var UserControllerDeleteConnectionTypeEnum;
|
|
|
964
964
|
})(UserControllerDeleteConnectionTypeEnum || (exports.UserControllerDeleteConnectionTypeEnum = UserControllerDeleteConnectionTypeEnum = {}));
|
|
965
965
|
var UserControllerGetConnectionsStateEnum;
|
|
966
966
|
(function (UserControllerGetConnectionsStateEnum) {
|
|
967
|
-
UserControllerGetConnectionsStateEnum["
|
|
967
|
+
UserControllerGetConnectionsStateEnum["incoming_request"] = "incoming_request";
|
|
968
|
+
UserControllerGetConnectionsStateEnum["outgoing_request"] = "outgoing_request";
|
|
968
969
|
UserControllerGetConnectionsStateEnum["active"] = "active";
|
|
969
|
-
UserControllerGetConnectionsStateEnum["rejected"] = "rejected";
|
|
970
|
-
UserControllerGetConnectionsStateEnum["blocked"] = "blocked";
|
|
971
970
|
})(UserControllerGetConnectionsStateEnum || (exports.UserControllerGetConnectionsStateEnum = UserControllerGetConnectionsStateEnum = {}));
|
|
972
971
|
var UserControllerGetConnectionsTypeEnum;
|
|
973
972
|
(function (UserControllerGetConnectionsTypeEnum) {
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import type { EventApi } from '../api/event-api';
|
|
2
|
+
import type { CreateEventDto, EntityConnectionDto, EventDto, UpdateEventDto, UserEntityConnectionDto } from '../models';
|
|
3
|
+
export declare class EnhancedEventApi {
|
|
4
|
+
private readonly api;
|
|
5
|
+
constructor(api: EventApi);
|
|
6
|
+
getEvent(eventId: string, requesterUserId?: string): Promise<EventDto>;
|
|
7
|
+
getEvents(eventIds: string[], requesterUserId?: string): Promise<EventDto[]>;
|
|
8
|
+
createEvent(creatorUserId: string, data: CreateEventDto): Promise<string>;
|
|
9
|
+
updateEvent(eventId: string, requesterUserId: string, data: UpdateEventDto): Promise<string>;
|
|
10
|
+
deleteEvent(eventId: string, requesterUserId: string): Promise<void>;
|
|
11
|
+
searchByDisplayName(displayName: string, requesterUserId?: string, limit?: number): Promise<EventDto[]>;
|
|
12
|
+
searchByRadius(latitude: number, longitude: number, radiusMeters: number, requesterUserId?: string, limit?: number): Promise<EventDto[]>;
|
|
13
|
+
searchByBoundingBox(minLat: number, maxLat: number, minLng: number, maxLng: number, requesterUserId?: string, limit?: number): Promise<EventDto[]>;
|
|
14
|
+
addAttendee(eventId: string, userId: string, requesterUserId: string): Promise<EntityConnectionDto>;
|
|
15
|
+
removeAttendee(eventId: string, userId: string, requesterUserId: string): Promise<void>;
|
|
16
|
+
getAttendees(eventId: string, requesterUserId?: string): Promise<UserEntityConnectionDto[]>;
|
|
17
|
+
promoteToAdmin(eventId: string, userId: string, requesterUserId: string): Promise<EntityConnectionDto>;
|
|
18
|
+
demoteToAttendee(eventId: string, userId: string, requesterUserId: string): Promise<EntityConnectionDto>;
|
|
19
|
+
getAdmins(eventId: string, requesterUserId?: string): Promise<UserEntityConnectionDto[]>;
|
|
20
|
+
getOwner(eventId: string, requesterUserId?: string): Promise<UserEntityConnectionDto | undefined>;
|
|
21
|
+
}
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.EnhancedEventApi = void 0;
|
|
4
|
+
const event_api_1 = require("../api/event-api");
|
|
5
|
+
const mutate_event_entity_connection_dto_1 = require("../models/mutate-event-entity-connection-dto");
|
|
6
|
+
const errors_1 = require("./errors");
|
|
7
|
+
class EnhancedEventApi {
|
|
8
|
+
constructor(api) {
|
|
9
|
+
this.api = api;
|
|
10
|
+
}
|
|
11
|
+
async getEvent(eventId, requesterUserId) {
|
|
12
|
+
return (0, errors_1.unwrap)(this.api.get(eventId, requesterUserId));
|
|
13
|
+
}
|
|
14
|
+
async getEvents(eventIds, requesterUserId) {
|
|
15
|
+
return (0, errors_1.unwrap)(this.api.getBatch({ eventIds }, requesterUserId));
|
|
16
|
+
}
|
|
17
|
+
async createEvent(creatorUserId, data) {
|
|
18
|
+
return (0, errors_1.unwrap)(this.api.create(creatorUserId, data));
|
|
19
|
+
}
|
|
20
|
+
async updateEvent(eventId, requesterUserId, data) {
|
|
21
|
+
return (0, errors_1.unwrap)(this.api.update(eventId, requesterUserId, data));
|
|
22
|
+
}
|
|
23
|
+
async deleteEvent(eventId, requesterUserId) {
|
|
24
|
+
return (0, errors_1.unwrap)(this.api.remove(eventId, requesterUserId));
|
|
25
|
+
}
|
|
26
|
+
async searchByDisplayName(displayName, requesterUserId, limit) {
|
|
27
|
+
return (0, errors_1.unwrap)(this.api.search(displayName, undefined, undefined, undefined, undefined, undefined, undefined, undefined, limit, requesterUserId));
|
|
28
|
+
}
|
|
29
|
+
async searchByRadius(latitude, longitude, radiusMeters, requesterUserId, limit) {
|
|
30
|
+
return (0, errors_1.unwrap)(this.api.search(undefined, latitude, longitude, radiusMeters, undefined, undefined, undefined, undefined, limit, requesterUserId));
|
|
31
|
+
}
|
|
32
|
+
async searchByBoundingBox(minLat, maxLat, minLng, maxLng, requesterUserId, limit) {
|
|
33
|
+
return (0, errors_1.unwrap)(this.api.search(undefined, undefined, undefined, undefined, minLat, maxLat, minLng, maxLng, limit, requesterUserId));
|
|
34
|
+
}
|
|
35
|
+
async addAttendee(eventId, userId, requesterUserId) {
|
|
36
|
+
return (0, errors_1.unwrap)(this.api.addConnection(eventId, userId, requesterUserId, { type: mutate_event_entity_connection_dto_1.MutateEventEntityConnectionDtoTypeEnum.attendee }));
|
|
37
|
+
}
|
|
38
|
+
async removeAttendee(eventId, userId, requesterUserId) {
|
|
39
|
+
return (0, errors_1.unwrap)(this.api.removeConnection(eventId, userId, requesterUserId, { type: mutate_event_entity_connection_dto_1.MutateEventEntityConnectionDtoTypeEnum.attendee }));
|
|
40
|
+
}
|
|
41
|
+
async getAttendees(eventId, requesterUserId) {
|
|
42
|
+
return (0, errors_1.unwrap)(this.api.getConnections(eventId, [event_api_1.EventControllerGetConnectionsTypeEnum.attendee], requesterUserId));
|
|
43
|
+
}
|
|
44
|
+
async promoteToAdmin(eventId, userId, requesterUserId) {
|
|
45
|
+
return (0, errors_1.unwrap)(this.api.addConnection(eventId, userId, requesterUserId, { type: mutate_event_entity_connection_dto_1.MutateEventEntityConnectionDtoTypeEnum.admin }));
|
|
46
|
+
}
|
|
47
|
+
async demoteToAttendee(eventId, userId, requesterUserId) {
|
|
48
|
+
return (0, errors_1.unwrap)(this.api.addConnection(eventId, userId, requesterUserId, { type: mutate_event_entity_connection_dto_1.MutateEventEntityConnectionDtoTypeEnum.attendee }));
|
|
49
|
+
}
|
|
50
|
+
async getAdmins(eventId, requesterUserId) {
|
|
51
|
+
return (0, errors_1.unwrap)(this.api.getConnections(eventId, [event_api_1.EventControllerGetConnectionsTypeEnum.admin], requesterUserId));
|
|
52
|
+
}
|
|
53
|
+
async getOwner(eventId, requesterUserId) {
|
|
54
|
+
const connections = await (0, errors_1.unwrap)(this.api.getConnections(eventId, [event_api_1.EventControllerGetConnectionsTypeEnum.owner], requesterUserId));
|
|
55
|
+
return connections[0];
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
exports.EnhancedEventApi = EnhancedEventApi;
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import type { GroupApi } from '../api/group-api';
|
|
2
|
+
import type { CreateGroupDto, EntityConnectionDto, EventEntityConnectionDto, GroupDto, UpdateGroupDto, UserEntityConnectionDto } from '../models';
|
|
3
|
+
export declare class EnhancedGroupApi {
|
|
4
|
+
private readonly api;
|
|
5
|
+
constructor(api: GroupApi);
|
|
6
|
+
getGroup(groupId: string, requesterUserId?: string): Promise<GroupDto>;
|
|
7
|
+
getGroups(groupIds: string[], requesterUserId?: string): Promise<GroupDto[]>;
|
|
8
|
+
createGroup(creatorUserId: string, data: CreateGroupDto): Promise<string>;
|
|
9
|
+
updateGroup(groupId: string, requesterUserId: string, data: UpdateGroupDto): Promise<string>;
|
|
10
|
+
deleteGroup(groupId: string, requesterUserId: string): Promise<void>;
|
|
11
|
+
searchByDisplayName(displayName: string, requesterUserId?: string, limit?: number): Promise<GroupDto[]>;
|
|
12
|
+
searchByRadius(latitude: number, longitude: number, radiusMeters: number, requesterUserId?: string, limit?: number): Promise<GroupDto[]>;
|
|
13
|
+
searchByBoundingBox(minLat: number, maxLat: number, minLng: number, maxLng: number, requesterUserId?: string, limit?: number): Promise<GroupDto[]>;
|
|
14
|
+
joinGroup(groupId: string, userId: string): Promise<EntityConnectionDto>;
|
|
15
|
+
leaveGroup(groupId: string, userId: string): Promise<void>;
|
|
16
|
+
approveMember(groupId: string, userId: string, requesterUserId: string): Promise<EntityConnectionDto>;
|
|
17
|
+
rejectMember(groupId: string, userId: string, requesterUserId: string): Promise<void>;
|
|
18
|
+
removeMember(groupId: string, userId: string, requesterUserId: string): Promise<void>;
|
|
19
|
+
getMembers(groupId: string, requesterUserId?: string): Promise<UserEntityConnectionDto[]>;
|
|
20
|
+
getPendingMembers(groupId: string, requesterUserId?: string): Promise<UserEntityConnectionDto[]>;
|
|
21
|
+
promoteToAdmin(groupId: string, userId: string, requesterUserId: string): Promise<EntityConnectionDto>;
|
|
22
|
+
demoteToMember(groupId: string, userId: string, requesterUserId: string): Promise<EntityConnectionDto>;
|
|
23
|
+
getAdmins(groupId: string, requesterUserId?: string): Promise<UserEntityConnectionDto[]>;
|
|
24
|
+
getOwner(groupId: string, requesterUserId?: string): Promise<UserEntityConnectionDto | undefined>;
|
|
25
|
+
getEvents(groupId: string, requesterUserId?: string): Promise<EventEntityConnectionDto[]>;
|
|
26
|
+
}
|
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.EnhancedGroupApi = void 0;
|
|
4
|
+
const group_api_1 = require("../api/group-api");
|
|
5
|
+
const mutate_group_entity_connection_dto_1 = require("../models/mutate-group-entity-connection-dto");
|
|
6
|
+
const errors_1 = require("./errors");
|
|
7
|
+
class EnhancedGroupApi {
|
|
8
|
+
constructor(api) {
|
|
9
|
+
this.api = api;
|
|
10
|
+
}
|
|
11
|
+
async getGroup(groupId, requesterUserId) {
|
|
12
|
+
return (0, errors_1.unwrap)(this.api.get(groupId, requesterUserId));
|
|
13
|
+
}
|
|
14
|
+
async getGroups(groupIds, requesterUserId) {
|
|
15
|
+
return (0, errors_1.unwrap)(this.api.getBatch({ groupIds }, requesterUserId));
|
|
16
|
+
}
|
|
17
|
+
async createGroup(creatorUserId, data) {
|
|
18
|
+
return (0, errors_1.unwrap)(this.api.create(creatorUserId, data));
|
|
19
|
+
}
|
|
20
|
+
async updateGroup(groupId, requesterUserId, data) {
|
|
21
|
+
return (0, errors_1.unwrap)(this.api.update(groupId, requesterUserId, data));
|
|
22
|
+
}
|
|
23
|
+
async deleteGroup(groupId, requesterUserId) {
|
|
24
|
+
return (0, errors_1.unwrap)(this.api.remove(groupId, requesterUserId));
|
|
25
|
+
}
|
|
26
|
+
async searchByDisplayName(displayName, requesterUserId, limit) {
|
|
27
|
+
return (0, errors_1.unwrap)(this.api.search(displayName, undefined, undefined, undefined, undefined, undefined, undefined, undefined, limit, requesterUserId));
|
|
28
|
+
}
|
|
29
|
+
async searchByRadius(latitude, longitude, radiusMeters, requesterUserId, limit) {
|
|
30
|
+
return (0, errors_1.unwrap)(this.api.search(undefined, latitude, longitude, radiusMeters, undefined, undefined, undefined, undefined, limit, requesterUserId));
|
|
31
|
+
}
|
|
32
|
+
async searchByBoundingBox(minLat, maxLat, minLng, maxLng, requesterUserId, limit) {
|
|
33
|
+
return (0, errors_1.unwrap)(this.api.search(undefined, undefined, undefined, undefined, minLat, maxLat, minLng, maxLng, limit, requesterUserId));
|
|
34
|
+
}
|
|
35
|
+
async joinGroup(groupId, userId) {
|
|
36
|
+
return (0, errors_1.unwrap)(this.api.addConnection(groupId, userId, userId, { type: mutate_group_entity_connection_dto_1.MutateGroupEntityConnectionDtoTypeEnum.member }));
|
|
37
|
+
}
|
|
38
|
+
async leaveGroup(groupId, userId) {
|
|
39
|
+
return (0, errors_1.unwrap)(this.api.removeConnection(groupId, userId, userId, { type: mutate_group_entity_connection_dto_1.MutateGroupEntityConnectionDtoTypeEnum.member }));
|
|
40
|
+
}
|
|
41
|
+
async approveMember(groupId, userId, requesterUserId) {
|
|
42
|
+
return (0, errors_1.unwrap)(this.api.addConnection(groupId, userId, requesterUserId, { type: mutate_group_entity_connection_dto_1.MutateGroupEntityConnectionDtoTypeEnum.member }));
|
|
43
|
+
}
|
|
44
|
+
async rejectMember(groupId, userId, requesterUserId) {
|
|
45
|
+
return (0, errors_1.unwrap)(this.api.removeConnection(groupId, userId, requesterUserId, { type: mutate_group_entity_connection_dto_1.MutateGroupEntityConnectionDtoTypeEnum.member }));
|
|
46
|
+
}
|
|
47
|
+
async removeMember(groupId, userId, requesterUserId) {
|
|
48
|
+
return (0, errors_1.unwrap)(this.api.removeConnection(groupId, userId, requesterUserId, { type: mutate_group_entity_connection_dto_1.MutateGroupEntityConnectionDtoTypeEnum.member }));
|
|
49
|
+
}
|
|
50
|
+
async getMembers(groupId, requesterUserId) {
|
|
51
|
+
return (0, errors_1.unwrap)(this.api.getConnections(groupId, [group_api_1.GroupControllerGetConnectionsStateEnum.active], [
|
|
52
|
+
group_api_1.GroupControllerGetConnectionsTypeEnum.member,
|
|
53
|
+
group_api_1.GroupControllerGetConnectionsTypeEnum.admin,
|
|
54
|
+
group_api_1.GroupControllerGetConnectionsTypeEnum.owner,
|
|
55
|
+
], requesterUserId));
|
|
56
|
+
}
|
|
57
|
+
async getPendingMembers(groupId, requesterUserId) {
|
|
58
|
+
return (0, errors_1.unwrap)(this.api.getConnections(groupId, [group_api_1.GroupControllerGetConnectionsStateEnum.requested], [group_api_1.GroupControllerGetConnectionsTypeEnum.member], requesterUserId));
|
|
59
|
+
}
|
|
60
|
+
async promoteToAdmin(groupId, userId, requesterUserId) {
|
|
61
|
+
return (0, errors_1.unwrap)(this.api.addConnection(groupId, userId, requesterUserId, { type: mutate_group_entity_connection_dto_1.MutateGroupEntityConnectionDtoTypeEnum.admin }));
|
|
62
|
+
}
|
|
63
|
+
async demoteToMember(groupId, userId, requesterUserId) {
|
|
64
|
+
return (0, errors_1.unwrap)(this.api.addConnection(groupId, userId, requesterUserId, { type: mutate_group_entity_connection_dto_1.MutateGroupEntityConnectionDtoTypeEnum.member }));
|
|
65
|
+
}
|
|
66
|
+
async getAdmins(groupId, requesterUserId) {
|
|
67
|
+
return (0, errors_1.unwrap)(this.api.getConnections(groupId, [group_api_1.GroupControllerGetConnectionsStateEnum.active], [group_api_1.GroupControllerGetConnectionsTypeEnum.admin], requesterUserId));
|
|
68
|
+
}
|
|
69
|
+
async getOwner(groupId, requesterUserId) {
|
|
70
|
+
const connections = await (0, errors_1.unwrap)(this.api.getConnections(groupId, [group_api_1.GroupControllerGetConnectionsStateEnum.active], [group_api_1.GroupControllerGetConnectionsTypeEnum.owner], requesterUserId));
|
|
71
|
+
return connections[0];
|
|
72
|
+
}
|
|
73
|
+
async getEvents(groupId, requesterUserId) {
|
|
74
|
+
return (0, errors_1.unwrap)(this.api.getEvents(groupId, requesterUserId));
|
|
75
|
+
}
|
|
76
|
+
}
|
|
77
|
+
exports.EnhancedGroupApi = EnhancedGroupApi;
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import type { UserApi } from '../api/user-api';
|
|
2
|
+
import type { CreateUserDto, EntityConnectionDto, EventEntityConnectionDto, GroupEntityConnectionDto, MutateUserResponseDto, UpdateUserDto, UserDto, UserEntityConnectionDto } from '../models';
|
|
3
|
+
export declare class EnhancedUserApi {
|
|
4
|
+
private readonly api;
|
|
5
|
+
constructor(api: UserApi);
|
|
6
|
+
getUser(userId: string, requesterUserId?: string): Promise<UserDto>;
|
|
7
|
+
getUsers(userIds: string[], requesterUserId?: string): Promise<UserDto[]>;
|
|
8
|
+
createUser(data: CreateUserDto): Promise<MutateUserResponseDto>;
|
|
9
|
+
updateUser(userId: string, data: UpdateUserDto, requesterUserId?: string): Promise<MutateUserResponseDto>;
|
|
10
|
+
deleteUser(userId: string, requesterUserId?: string): Promise<void>;
|
|
11
|
+
searchByDisplayName(displayName: string, requesterUserId?: string, limit?: number): Promise<UserDto[]>;
|
|
12
|
+
searchByRadius(latitude: number, longitude: number, radiusMeters: number, requesterUserId?: string, limit?: number): Promise<UserDto[]>;
|
|
13
|
+
searchByBoundingBox(minLat: number, maxLat: number, minLng: number, maxLng: number, requesterUserId?: string, limit?: number): Promise<UserDto[]>;
|
|
14
|
+
sendFriendRequest(fromUserId: string, toUserId: string): Promise<EntityConnectionDto>;
|
|
15
|
+
acceptFriendRequest(userId: string, fromUserId: string): Promise<EntityConnectionDto>;
|
|
16
|
+
declineFriendRequest(userId: string, fromUserId: string): Promise<void>;
|
|
17
|
+
removeFriend(userId: string, friendUserId: string): Promise<void>;
|
|
18
|
+
getFriends(userId: string, requesterUserId?: string): Promise<UserEntityConnectionDto[]>;
|
|
19
|
+
getPendingFriendRequests(userId: string): Promise<UserEntityConnectionDto[]>;
|
|
20
|
+
blockUser(blockingUserId: string, blockedUserId: string): Promise<EntityConnectionDto>;
|
|
21
|
+
unblockUser(blockingUserId: string, blockedUserId: string): Promise<void>;
|
|
22
|
+
getBlockedUsers(userId: string): Promise<UserEntityConnectionDto[]>;
|
|
23
|
+
getEvents(userId: string, requesterUserId?: string): Promise<EventEntityConnectionDto[]>;
|
|
24
|
+
getGroups(userId: string, requesterUserId?: string): Promise<GroupEntityConnectionDto[]>;
|
|
25
|
+
}
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.EnhancedUserApi = void 0;
|
|
4
|
+
const user_api_1 = require("../api/user-api");
|
|
5
|
+
const mutate_user_connection_dto_1 = require("../models/mutate-user-connection-dto");
|
|
6
|
+
const errors_1 = require("./errors");
|
|
7
|
+
class EnhancedUserApi {
|
|
8
|
+
constructor(api) {
|
|
9
|
+
this.api = api;
|
|
10
|
+
}
|
|
11
|
+
async getUser(userId, requesterUserId) {
|
|
12
|
+
return (0, errors_1.unwrap)(this.api.get(userId, requesterUserId));
|
|
13
|
+
}
|
|
14
|
+
async getUsers(userIds, requesterUserId) {
|
|
15
|
+
return (0, errors_1.unwrap)(this.api.getBatch({ userIds }, requesterUserId));
|
|
16
|
+
}
|
|
17
|
+
async createUser(data) {
|
|
18
|
+
return (0, errors_1.unwrap)(this.api.create(data));
|
|
19
|
+
}
|
|
20
|
+
async updateUser(userId, data, requesterUserId) {
|
|
21
|
+
const requester = requesterUserId ?? userId;
|
|
22
|
+
return (0, errors_1.unwrap)(this.api.update(userId, requester, data));
|
|
23
|
+
}
|
|
24
|
+
async deleteUser(userId, requesterUserId) {
|
|
25
|
+
const requester = requesterUserId ?? userId;
|
|
26
|
+
return (0, errors_1.unwrap)(this.api.remove(userId, requester));
|
|
27
|
+
}
|
|
28
|
+
async searchByDisplayName(displayName, requesterUserId, limit) {
|
|
29
|
+
return (0, errors_1.unwrap)(this.api.search(displayName, undefined, undefined, undefined, undefined, undefined, undefined, undefined, limit, requesterUserId));
|
|
30
|
+
}
|
|
31
|
+
async searchByRadius(latitude, longitude, radiusMeters, requesterUserId, limit) {
|
|
32
|
+
return (0, errors_1.unwrap)(this.api.search(undefined, latitude, longitude, radiusMeters, undefined, undefined, undefined, undefined, limit, requesterUserId));
|
|
33
|
+
}
|
|
34
|
+
async searchByBoundingBox(minLat, maxLat, minLng, maxLng, requesterUserId, limit) {
|
|
35
|
+
return (0, errors_1.unwrap)(this.api.search(undefined, undefined, undefined, undefined, minLat, maxLat, minLng, maxLng, limit, requesterUserId));
|
|
36
|
+
}
|
|
37
|
+
async sendFriendRequest(fromUserId, toUserId) {
|
|
38
|
+
return (0, errors_1.unwrap)(this.api.putConnection(fromUserId, toUserId, fromUserId, { type: mutate_user_connection_dto_1.MutateUserConnectionDtoTypeEnum.friend }));
|
|
39
|
+
}
|
|
40
|
+
async acceptFriendRequest(userId, fromUserId) {
|
|
41
|
+
return (0, errors_1.unwrap)(this.api.putConnection(userId, fromUserId, userId, { type: mutate_user_connection_dto_1.MutateUserConnectionDtoTypeEnum.friend }));
|
|
42
|
+
}
|
|
43
|
+
async declineFriendRequest(userId, fromUserId) {
|
|
44
|
+
return (0, errors_1.unwrap)(this.api.deleteConnection(userId, fromUserId, user_api_1.UserControllerDeleteConnectionTypeEnum.friend, userId));
|
|
45
|
+
}
|
|
46
|
+
async removeFriend(userId, friendUserId) {
|
|
47
|
+
return (0, errors_1.unwrap)(this.api.deleteConnection(userId, friendUserId, user_api_1.UserControllerDeleteConnectionTypeEnum.friend, userId));
|
|
48
|
+
}
|
|
49
|
+
async getFriends(userId, requesterUserId) {
|
|
50
|
+
return (0, errors_1.unwrap)(this.api.getConnections(userId, [user_api_1.UserControllerGetConnectionsStateEnum.active], [user_api_1.UserControllerGetConnectionsTypeEnum.friend], requesterUserId ?? userId));
|
|
51
|
+
}
|
|
52
|
+
async getPendingFriendRequests(userId) {
|
|
53
|
+
return (0, errors_1.unwrap)(this.api.getConnections(userId, [
|
|
54
|
+
user_api_1.UserControllerGetConnectionsStateEnum.outgoing_request,
|
|
55
|
+
user_api_1.UserControllerGetConnectionsStateEnum.incoming_request,
|
|
56
|
+
], [user_api_1.UserControllerGetConnectionsTypeEnum.friend], userId));
|
|
57
|
+
}
|
|
58
|
+
async blockUser(blockingUserId, blockedUserId) {
|
|
59
|
+
return (0, errors_1.unwrap)(this.api.putConnection(blockingUserId, blockedUserId, blockingUserId, { type: mutate_user_connection_dto_1.MutateUserConnectionDtoTypeEnum.blocked }));
|
|
60
|
+
}
|
|
61
|
+
async unblockUser(blockingUserId, blockedUserId) {
|
|
62
|
+
return (0, errors_1.unwrap)(this.api.deleteConnection(blockingUserId, blockedUserId, user_api_1.UserControllerDeleteConnectionTypeEnum.blocked, blockingUserId));
|
|
63
|
+
}
|
|
64
|
+
async getBlockedUsers(userId) {
|
|
65
|
+
return (0, errors_1.unwrap)(this.api.getConnections(userId, [user_api_1.UserControllerGetConnectionsStateEnum.active], [user_api_1.UserControllerGetConnectionsTypeEnum.blocked], userId));
|
|
66
|
+
}
|
|
67
|
+
async getEvents(userId, requesterUserId) {
|
|
68
|
+
return (0, errors_1.unwrap)(this.api.getEvents(userId, requesterUserId));
|
|
69
|
+
}
|
|
70
|
+
async getGroups(userId, requesterUserId) {
|
|
71
|
+
return (0, errors_1.unwrap)(this.api.getGroups(userId, requesterUserId));
|
|
72
|
+
}
|
|
73
|
+
}
|
|
74
|
+
exports.EnhancedUserApi = EnhancedUserApi;
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Custom error classes for the enhanced SDK client.
|
|
3
|
+
* Axios errors are transformed into these domain-specific errors.
|
|
4
|
+
*/
|
|
5
|
+
/**
|
|
6
|
+
* Base class for enhanced client errors.
|
|
7
|
+
*/
|
|
8
|
+
export declare class EnhancedClientError extends Error {
|
|
9
|
+
readonly statusCode?: number | undefined;
|
|
10
|
+
readonly cause?: unknown | undefined;
|
|
11
|
+
constructor(message: string, statusCode?: number | undefined, cause?: unknown | undefined);
|
|
12
|
+
}
|
|
13
|
+
/**
|
|
14
|
+
* Thrown when an entity is not found (HTTP 404).
|
|
15
|
+
*/
|
|
16
|
+
export declare class NotFoundError extends EnhancedClientError {
|
|
17
|
+
constructor(message?: string, statusCode?: number, cause?: unknown);
|
|
18
|
+
}
|
|
19
|
+
/**
|
|
20
|
+
* Thrown when the user lacks permission (HTTP 401 or 403).
|
|
21
|
+
*/
|
|
22
|
+
export declare class UnauthorizedError extends EnhancedClientError {
|
|
23
|
+
constructor(message?: string, statusCode?: number, cause?: unknown);
|
|
24
|
+
}
|
|
25
|
+
/**
|
|
26
|
+
* Thrown for invalid parameters or validation failures (HTTP 400 or 422).
|
|
27
|
+
*/
|
|
28
|
+
export declare class ValidationError extends EnhancedClientError {
|
|
29
|
+
constructor(message?: string, statusCode?: number, cause?: unknown);
|
|
30
|
+
}
|
|
31
|
+
/**
|
|
32
|
+
* Transforms an axios error into an enhanced client error.
|
|
33
|
+
*/
|
|
34
|
+
export declare function transformAxiosError(error: unknown): never;
|
|
35
|
+
/**
|
|
36
|
+
* Unwraps an axios response and transforms errors.
|
|
37
|
+
*/
|
|
38
|
+
export declare function unwrap<T>(promise: Promise<{
|
|
39
|
+
data: T;
|
|
40
|
+
}>): Promise<T>;
|
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* Custom error classes for the enhanced SDK client.
|
|
4
|
+
* Axios errors are transformed into these domain-specific errors.
|
|
5
|
+
*/
|
|
6
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
7
|
+
exports.ValidationError = exports.UnauthorizedError = exports.NotFoundError = exports.EnhancedClientError = void 0;
|
|
8
|
+
exports.transformAxiosError = transformAxiosError;
|
|
9
|
+
exports.unwrap = unwrap;
|
|
10
|
+
/**
|
|
11
|
+
* Base class for enhanced client errors.
|
|
12
|
+
*/
|
|
13
|
+
class EnhancedClientError extends Error {
|
|
14
|
+
constructor(message, statusCode, cause) {
|
|
15
|
+
super(message);
|
|
16
|
+
this.statusCode = statusCode;
|
|
17
|
+
this.cause = cause;
|
|
18
|
+
this.name = this.constructor.name;
|
|
19
|
+
Object.setPrototypeOf(this, new.target.prototype);
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
exports.EnhancedClientError = EnhancedClientError;
|
|
23
|
+
/**
|
|
24
|
+
* Thrown when an entity is not found (HTTP 404).
|
|
25
|
+
*/
|
|
26
|
+
class NotFoundError extends EnhancedClientError {
|
|
27
|
+
constructor(message = 'Resource not found', statusCode = 404, cause) {
|
|
28
|
+
super(message, statusCode, cause);
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
exports.NotFoundError = NotFoundError;
|
|
32
|
+
/**
|
|
33
|
+
* Thrown when the user lacks permission (HTTP 401 or 403).
|
|
34
|
+
*/
|
|
35
|
+
class UnauthorizedError extends EnhancedClientError {
|
|
36
|
+
constructor(message = 'Unauthorized', statusCode = 401, cause) {
|
|
37
|
+
super(message, statusCode, cause);
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
exports.UnauthorizedError = UnauthorizedError;
|
|
41
|
+
/**
|
|
42
|
+
* Thrown for invalid parameters or validation failures (HTTP 400 or 422).
|
|
43
|
+
*/
|
|
44
|
+
class ValidationError extends EnhancedClientError {
|
|
45
|
+
constructor(message = 'Validation failed', statusCode, cause) {
|
|
46
|
+
super(message, statusCode, cause);
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
exports.ValidationError = ValidationError;
|
|
50
|
+
/**
|
|
51
|
+
* Transforms an axios error into an enhanced client error.
|
|
52
|
+
*/
|
|
53
|
+
function transformAxiosError(error) {
|
|
54
|
+
if (error && typeof error === 'object' && 'isAxiosError' in error) {
|
|
55
|
+
const axiosError = error;
|
|
56
|
+
const status = axiosError.response?.status;
|
|
57
|
+
const message = typeof axiosError.response?.data === 'object' &&
|
|
58
|
+
axiosError.response?.data !== null &&
|
|
59
|
+
'message' in axiosError.response.data
|
|
60
|
+
? String(axiosError.response.data.message)
|
|
61
|
+
: axiosError.message ?? 'Request failed';
|
|
62
|
+
if (status === 404) {
|
|
63
|
+
throw new NotFoundError(message, status, error);
|
|
64
|
+
}
|
|
65
|
+
if (status === 401 || status === 403) {
|
|
66
|
+
throw new UnauthorizedError(message, status ?? 401, error);
|
|
67
|
+
}
|
|
68
|
+
if (status === 400 || status === 422) {
|
|
69
|
+
throw new ValidationError(message, status, error);
|
|
70
|
+
}
|
|
71
|
+
throw new EnhancedClientError(message, status, error);
|
|
72
|
+
}
|
|
73
|
+
throw error;
|
|
74
|
+
}
|
|
75
|
+
/**
|
|
76
|
+
* Unwraps an axios response and transforms errors.
|
|
77
|
+
*/
|
|
78
|
+
async function unwrap(promise) {
|
|
79
|
+
try {
|
|
80
|
+
const response = await promise;
|
|
81
|
+
return response.data;
|
|
82
|
+
}
|
|
83
|
+
catch (error) {
|
|
84
|
+
transformAxiosError(error);
|
|
85
|
+
return undefined;
|
|
86
|
+
}
|
|
87
|
+
}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import { EnhancedUserApi } from './enhanced-user-api';
|
|
2
|
+
import { EnhancedEventApi } from './enhanced-event-api';
|
|
3
|
+
import { EnhancedGroupApi } from './enhanced-group-api';
|
|
4
|
+
/**
|
|
5
|
+
* Configuration for the enhanced client (same shape as ProximaNexusClientConfig).
|
|
6
|
+
* Defined here to avoid circular dependency with main index.
|
|
7
|
+
*/
|
|
8
|
+
export interface EnhancedClientConfig {
|
|
9
|
+
baseURL?: string;
|
|
10
|
+
apiKey: string;
|
|
11
|
+
timeout?: number;
|
|
12
|
+
axiosConfig?: any;
|
|
13
|
+
}
|
|
14
|
+
export { EnhancedUserApi } from './enhanced-user-api';
|
|
15
|
+
export { EnhancedEventApi } from './enhanced-event-api';
|
|
16
|
+
export { EnhancedGroupApi } from './enhanced-group-api';
|
|
17
|
+
export { NotFoundError, UnauthorizedError, ValidationError, EnhancedClientError, transformAxiosError, unwrap, } from './errors';
|
|
18
|
+
export type { EnhancedClientError as EnhancedClientErrorType } from './errors';
|
|
19
|
+
export * from './types';
|
|
20
|
+
/**
|
|
21
|
+
* Enhanced Proxima Nexus client with a simplified, domain-driven API.
|
|
22
|
+
* Wraps the base APIs and provides cleaner method signatures and convenience methods.
|
|
23
|
+
* Use `client.base` to access the raw APIs when needed.
|
|
24
|
+
*
|
|
25
|
+
* Accepts either EnhancedClientConfig or a ProximaNexusClient instance for base.
|
|
26
|
+
*/
|
|
27
|
+
export declare class EnhancedProximaNexusClient {
|
|
28
|
+
readonly users: EnhancedUserApi;
|
|
29
|
+
readonly events: EnhancedEventApi;
|
|
30
|
+
readonly groups: EnhancedGroupApi;
|
|
31
|
+
readonly base: InstanceType<typeof import('../index').ProximaNexusClient>;
|
|
32
|
+
constructor(configOrBase: EnhancedClientConfig | InstanceType<typeof import('../index').ProximaNexusClient>);
|
|
33
|
+
}
|
|
34
|
+
export default EnhancedProximaNexusClient;
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
+
};
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
exports.EnhancedProximaNexusClient = exports.unwrap = exports.transformAxiosError = exports.EnhancedClientError = exports.ValidationError = exports.UnauthorizedError = exports.NotFoundError = exports.EnhancedGroupApi = exports.EnhancedEventApi = exports.EnhancedUserApi = void 0;
|
|
18
|
+
const enhanced_user_api_1 = require("./enhanced-user-api");
|
|
19
|
+
const enhanced_event_api_1 = require("./enhanced-event-api");
|
|
20
|
+
const enhanced_group_api_1 = require("./enhanced-group-api");
|
|
21
|
+
var enhanced_user_api_2 = require("./enhanced-user-api");
|
|
22
|
+
Object.defineProperty(exports, "EnhancedUserApi", { enumerable: true, get: function () { return enhanced_user_api_2.EnhancedUserApi; } });
|
|
23
|
+
var enhanced_event_api_2 = require("./enhanced-event-api");
|
|
24
|
+
Object.defineProperty(exports, "EnhancedEventApi", { enumerable: true, get: function () { return enhanced_event_api_2.EnhancedEventApi; } });
|
|
25
|
+
var enhanced_group_api_2 = require("./enhanced-group-api");
|
|
26
|
+
Object.defineProperty(exports, "EnhancedGroupApi", { enumerable: true, get: function () { return enhanced_group_api_2.EnhancedGroupApi; } });
|
|
27
|
+
var errors_1 = require("./errors");
|
|
28
|
+
Object.defineProperty(exports, "NotFoundError", { enumerable: true, get: function () { return errors_1.NotFoundError; } });
|
|
29
|
+
Object.defineProperty(exports, "UnauthorizedError", { enumerable: true, get: function () { return errors_1.UnauthorizedError; } });
|
|
30
|
+
Object.defineProperty(exports, "ValidationError", { enumerable: true, get: function () { return errors_1.ValidationError; } });
|
|
31
|
+
Object.defineProperty(exports, "EnhancedClientError", { enumerable: true, get: function () { return errors_1.EnhancedClientError; } });
|
|
32
|
+
Object.defineProperty(exports, "transformAxiosError", { enumerable: true, get: function () { return errors_1.transformAxiosError; } });
|
|
33
|
+
Object.defineProperty(exports, "unwrap", { enumerable: true, get: function () { return errors_1.unwrap; } });
|
|
34
|
+
__exportStar(require("./types"), exports);
|
|
35
|
+
/**
|
|
36
|
+
* Enhanced Proxima Nexus client with a simplified, domain-driven API.
|
|
37
|
+
* Wraps the base APIs and provides cleaner method signatures and convenience methods.
|
|
38
|
+
* Use `client.base` to access the raw APIs when needed.
|
|
39
|
+
*
|
|
40
|
+
* Accepts either EnhancedClientConfig or a ProximaNexusClient instance for base.
|
|
41
|
+
*/
|
|
42
|
+
class EnhancedProximaNexusClient {
|
|
43
|
+
constructor(configOrBase) {
|
|
44
|
+
const isConfig = typeof configOrBase.apiKey === 'string';
|
|
45
|
+
if (isConfig) {
|
|
46
|
+
const config = configOrBase;
|
|
47
|
+
// Dynamic import to break cycle: main index will export EnhancedProximaNexusClient
|
|
48
|
+
// and we need ProximaNexusClient here. We construct base client from same config.
|
|
49
|
+
const { ProximaNexusClient } = require('../index');
|
|
50
|
+
this.base = new ProximaNexusClient(config);
|
|
51
|
+
}
|
|
52
|
+
else {
|
|
53
|
+
this.base = configOrBase;
|
|
54
|
+
}
|
|
55
|
+
const userApi = this.base.users;
|
|
56
|
+
const eventApi = this.base.events;
|
|
57
|
+
const groupApi = this.base.groups;
|
|
58
|
+
this.users = new enhanced_user_api_1.EnhancedUserApi(userApi);
|
|
59
|
+
this.events = new enhanced_event_api_1.EnhancedEventApi(eventApi);
|
|
60
|
+
this.groups = new enhanced_group_api_1.EnhancedGroupApi(groupApi);
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
exports.EnhancedProximaNexusClient = EnhancedProximaNexusClient;
|
|
64
|
+
exports.default = EnhancedProximaNexusClient;
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Shared types and interfaces for the enhanced SDK client.
|
|
3
|
+
* Re-exports model types for convenience; no additional interfaces needed
|
|
4
|
+
* as we use the existing DTOs from the base API.
|
|
5
|
+
*/
|
|
6
|
+
export type { CreateUserDto, UpdateUserDto, MutateUserResponseDto, CreateEventDto, UpdateEventDto, CreateGroupDto, UpdateGroupDto, UserDto, EventDto, GroupDto, EntityConnectionDto, UserEntityConnectionDto, EventEntityConnectionDto, GroupEntityConnectionDto, GetUsersDto, GetEventsDto, GetGroupsDto, } from '../models';
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* Shared types and interfaces for the enhanced SDK client.
|
|
4
|
+
* Re-exports model types for convenience; no additional interfaces needed
|
|
5
|
+
* as we use the existing DTOs from the base API.
|
|
6
|
+
*/
|
|
7
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
package/dist/index.d.ts
CHANGED
|
@@ -36,3 +36,5 @@ export declare class ProximaNexusClient {
|
|
|
36
36
|
constructor(config: ProximaNexusClientConfig);
|
|
37
37
|
}
|
|
38
38
|
export default ProximaNexusClient;
|
|
39
|
+
export { EnhancedProximaNexusClient, EnhancedUserApi, EnhancedEventApi, EnhancedGroupApi, NotFoundError, UnauthorizedError, ValidationError, EnhancedClientError, transformAxiosError, unwrap, type EnhancedClientConfig, } from './enhanced';
|
|
40
|
+
export type { EnhancedClientError as EnhancedClientErrorType } from './enhanced';
|
package/dist/index.js
CHANGED
|
@@ -14,7 +14,7 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
|
14
14
|
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
15
|
};
|
|
16
16
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
-
exports.ProximaNexusClient = exports.Configuration = exports.GroupApi = exports.EventApi = exports.UserApi = void 0;
|
|
17
|
+
exports.unwrap = exports.transformAxiosError = exports.EnhancedClientError = exports.ValidationError = exports.UnauthorizedError = exports.NotFoundError = exports.EnhancedGroupApi = exports.EnhancedEventApi = exports.EnhancedUserApi = exports.EnhancedProximaNexusClient = exports.ProximaNexusClient = exports.Configuration = exports.GroupApi = exports.EventApi = exports.UserApi = void 0;
|
|
18
18
|
const configuration_1 = require("./configuration");
|
|
19
19
|
Object.defineProperty(exports, "Configuration", { enumerable: true, get: function () { return configuration_1.Configuration; } });
|
|
20
20
|
const user_api_1 = require("./api/user-api");
|
|
@@ -42,3 +42,15 @@ class ProximaNexusClient {
|
|
|
42
42
|
}
|
|
43
43
|
exports.ProximaNexusClient = ProximaNexusClient;
|
|
44
44
|
exports.default = ProximaNexusClient;
|
|
45
|
+
// Enhanced client (separate export path to avoid circular dependency in enhanced module)
|
|
46
|
+
var enhanced_1 = require("./enhanced");
|
|
47
|
+
Object.defineProperty(exports, "EnhancedProximaNexusClient", { enumerable: true, get: function () { return enhanced_1.EnhancedProximaNexusClient; } });
|
|
48
|
+
Object.defineProperty(exports, "EnhancedUserApi", { enumerable: true, get: function () { return enhanced_1.EnhancedUserApi; } });
|
|
49
|
+
Object.defineProperty(exports, "EnhancedEventApi", { enumerable: true, get: function () { return enhanced_1.EnhancedEventApi; } });
|
|
50
|
+
Object.defineProperty(exports, "EnhancedGroupApi", { enumerable: true, get: function () { return enhanced_1.EnhancedGroupApi; } });
|
|
51
|
+
Object.defineProperty(exports, "NotFoundError", { enumerable: true, get: function () { return enhanced_1.NotFoundError; } });
|
|
52
|
+
Object.defineProperty(exports, "UnauthorizedError", { enumerable: true, get: function () { return enhanced_1.UnauthorizedError; } });
|
|
53
|
+
Object.defineProperty(exports, "ValidationError", { enumerable: true, get: function () { return enhanced_1.ValidationError; } });
|
|
54
|
+
Object.defineProperty(exports, "EnhancedClientError", { enumerable: true, get: function () { return enhanced_1.EnhancedClientError; } });
|
|
55
|
+
Object.defineProperty(exports, "transformAxiosError", { enumerable: true, get: function () { return enhanced_1.transformAxiosError; } });
|
|
56
|
+
Object.defineProperty(exports, "unwrap", { enumerable: true, get: function () { return enhanced_1.unwrap; } });
|
|
@@ -18,29 +18,28 @@ export interface EntityConnectionDto {
|
|
|
18
18
|
* Date/time the connection was last updated (ISO string)
|
|
19
19
|
*/
|
|
20
20
|
'updatedAt'?: string;
|
|
21
|
-
/**
|
|
22
|
-
* Connection state
|
|
23
|
-
*/
|
|
24
|
-
'state': EntityConnectionDtoStateEnum;
|
|
25
21
|
/**
|
|
26
22
|
* Connection type
|
|
27
23
|
*/
|
|
28
24
|
'type': EntityConnectionDtoTypeEnum;
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
rejected = "rejected",
|
|
34
|
-
blocked = "blocked"
|
|
25
|
+
/**
|
|
26
|
+
* Connection state
|
|
27
|
+
*/
|
|
28
|
+
'state'?: EntityConnectionDtoStateEnum;
|
|
35
29
|
}
|
|
36
30
|
export declare enum EntityConnectionDtoTypeEnum {
|
|
37
31
|
attendee = "attendee",
|
|
38
32
|
admin = "admin",
|
|
39
33
|
owner = "owner",
|
|
40
34
|
member = "member",
|
|
41
|
-
admin2 = "admin",
|
|
42
|
-
owner2 = "owner",
|
|
43
35
|
friend = "friend",
|
|
44
36
|
blocked = "blocked",
|
|
45
37
|
none = "none"
|
|
46
38
|
}
|
|
39
|
+
export declare enum EntityConnectionDtoStateEnum {
|
|
40
|
+
incoming_request = "incoming_request",
|
|
41
|
+
outgoing_request = "outgoing_request",
|
|
42
|
+
active = "active",
|
|
43
|
+
requested = "requested",
|
|
44
|
+
invited = "invited"
|
|
45
|
+
}
|
|
@@ -13,23 +13,22 @@
|
|
|
13
13
|
* Do not edit the class manually.
|
|
14
14
|
*/
|
|
15
15
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
16
|
-
exports.
|
|
17
|
-
var EntityConnectionDtoStateEnum;
|
|
18
|
-
(function (EntityConnectionDtoStateEnum) {
|
|
19
|
-
EntityConnectionDtoStateEnum["requested"] = "requested";
|
|
20
|
-
EntityConnectionDtoStateEnum["active"] = "active";
|
|
21
|
-
EntityConnectionDtoStateEnum["rejected"] = "rejected";
|
|
22
|
-
EntityConnectionDtoStateEnum["blocked"] = "blocked";
|
|
23
|
-
})(EntityConnectionDtoStateEnum || (exports.EntityConnectionDtoStateEnum = EntityConnectionDtoStateEnum = {}));
|
|
16
|
+
exports.EntityConnectionDtoStateEnum = exports.EntityConnectionDtoTypeEnum = void 0;
|
|
24
17
|
var EntityConnectionDtoTypeEnum;
|
|
25
18
|
(function (EntityConnectionDtoTypeEnum) {
|
|
26
19
|
EntityConnectionDtoTypeEnum["attendee"] = "attendee";
|
|
27
20
|
EntityConnectionDtoTypeEnum["admin"] = "admin";
|
|
28
21
|
EntityConnectionDtoTypeEnum["owner"] = "owner";
|
|
29
22
|
EntityConnectionDtoTypeEnum["member"] = "member";
|
|
30
|
-
EntityConnectionDtoTypeEnum["admin2"] = "admin";
|
|
31
|
-
EntityConnectionDtoTypeEnum["owner2"] = "owner";
|
|
32
23
|
EntityConnectionDtoTypeEnum["friend"] = "friend";
|
|
33
24
|
EntityConnectionDtoTypeEnum["blocked"] = "blocked";
|
|
34
25
|
EntityConnectionDtoTypeEnum["none"] = "none";
|
|
35
26
|
})(EntityConnectionDtoTypeEnum || (exports.EntityConnectionDtoTypeEnum = EntityConnectionDtoTypeEnum = {}));
|
|
27
|
+
var EntityConnectionDtoStateEnum;
|
|
28
|
+
(function (EntityConnectionDtoStateEnum) {
|
|
29
|
+
EntityConnectionDtoStateEnum["incoming_request"] = "incoming_request";
|
|
30
|
+
EntityConnectionDtoStateEnum["outgoing_request"] = "outgoing_request";
|
|
31
|
+
EntityConnectionDtoStateEnum["active"] = "active";
|
|
32
|
+
EntityConnectionDtoStateEnum["requested"] = "requested";
|
|
33
|
+
EntityConnectionDtoStateEnum["invited"] = "invited";
|
|
34
|
+
})(EntityConnectionDtoStateEnum || (exports.EntityConnectionDtoStateEnum = EntityConnectionDtoStateEnum = {}));
|
|
@@ -18,33 +18,32 @@ export interface EventEntityConnectionDto {
|
|
|
18
18
|
* Date/time the connection was last updated (ISO string)
|
|
19
19
|
*/
|
|
20
20
|
'updatedAt'?: string;
|
|
21
|
-
/**
|
|
22
|
-
* Connection state
|
|
23
|
-
*/
|
|
24
|
-
'state': EventEntityConnectionDtoStateEnum;
|
|
25
21
|
/**
|
|
26
22
|
* Connection type
|
|
27
23
|
*/
|
|
28
24
|
'type': EventEntityConnectionDtoTypeEnum;
|
|
25
|
+
/**
|
|
26
|
+
* Connection state
|
|
27
|
+
*/
|
|
28
|
+
'state'?: EventEntityConnectionDtoStateEnum;
|
|
29
29
|
/**
|
|
30
30
|
* Event ID
|
|
31
31
|
*/
|
|
32
32
|
'eventId': string;
|
|
33
33
|
}
|
|
34
|
-
export declare enum EventEntityConnectionDtoStateEnum {
|
|
35
|
-
requested = "requested",
|
|
36
|
-
active = "active",
|
|
37
|
-
rejected = "rejected",
|
|
38
|
-
blocked = "blocked"
|
|
39
|
-
}
|
|
40
34
|
export declare enum EventEntityConnectionDtoTypeEnum {
|
|
41
35
|
attendee = "attendee",
|
|
42
36
|
admin = "admin",
|
|
43
37
|
owner = "owner",
|
|
44
38
|
member = "member",
|
|
45
|
-
admin2 = "admin",
|
|
46
|
-
owner2 = "owner",
|
|
47
39
|
friend = "friend",
|
|
48
40
|
blocked = "blocked",
|
|
49
41
|
none = "none"
|
|
50
42
|
}
|
|
43
|
+
export declare enum EventEntityConnectionDtoStateEnum {
|
|
44
|
+
incoming_request = "incoming_request",
|
|
45
|
+
outgoing_request = "outgoing_request",
|
|
46
|
+
active = "active",
|
|
47
|
+
requested = "requested",
|
|
48
|
+
invited = "invited"
|
|
49
|
+
}
|
|
@@ -13,23 +13,22 @@
|
|
|
13
13
|
* Do not edit the class manually.
|
|
14
14
|
*/
|
|
15
15
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
16
|
-
exports.
|
|
17
|
-
var EventEntityConnectionDtoStateEnum;
|
|
18
|
-
(function (EventEntityConnectionDtoStateEnum) {
|
|
19
|
-
EventEntityConnectionDtoStateEnum["requested"] = "requested";
|
|
20
|
-
EventEntityConnectionDtoStateEnum["active"] = "active";
|
|
21
|
-
EventEntityConnectionDtoStateEnum["rejected"] = "rejected";
|
|
22
|
-
EventEntityConnectionDtoStateEnum["blocked"] = "blocked";
|
|
23
|
-
})(EventEntityConnectionDtoStateEnum || (exports.EventEntityConnectionDtoStateEnum = EventEntityConnectionDtoStateEnum = {}));
|
|
16
|
+
exports.EventEntityConnectionDtoStateEnum = exports.EventEntityConnectionDtoTypeEnum = void 0;
|
|
24
17
|
var EventEntityConnectionDtoTypeEnum;
|
|
25
18
|
(function (EventEntityConnectionDtoTypeEnum) {
|
|
26
19
|
EventEntityConnectionDtoTypeEnum["attendee"] = "attendee";
|
|
27
20
|
EventEntityConnectionDtoTypeEnum["admin"] = "admin";
|
|
28
21
|
EventEntityConnectionDtoTypeEnum["owner"] = "owner";
|
|
29
22
|
EventEntityConnectionDtoTypeEnum["member"] = "member";
|
|
30
|
-
EventEntityConnectionDtoTypeEnum["admin2"] = "admin";
|
|
31
|
-
EventEntityConnectionDtoTypeEnum["owner2"] = "owner";
|
|
32
23
|
EventEntityConnectionDtoTypeEnum["friend"] = "friend";
|
|
33
24
|
EventEntityConnectionDtoTypeEnum["blocked"] = "blocked";
|
|
34
25
|
EventEntityConnectionDtoTypeEnum["none"] = "none";
|
|
35
26
|
})(EventEntityConnectionDtoTypeEnum || (exports.EventEntityConnectionDtoTypeEnum = EventEntityConnectionDtoTypeEnum = {}));
|
|
27
|
+
var EventEntityConnectionDtoStateEnum;
|
|
28
|
+
(function (EventEntityConnectionDtoStateEnum) {
|
|
29
|
+
EventEntityConnectionDtoStateEnum["incoming_request"] = "incoming_request";
|
|
30
|
+
EventEntityConnectionDtoStateEnum["outgoing_request"] = "outgoing_request";
|
|
31
|
+
EventEntityConnectionDtoStateEnum["active"] = "active";
|
|
32
|
+
EventEntityConnectionDtoStateEnum["requested"] = "requested";
|
|
33
|
+
EventEntityConnectionDtoStateEnum["invited"] = "invited";
|
|
34
|
+
})(EventEntityConnectionDtoStateEnum || (exports.EventEntityConnectionDtoStateEnum = EventEntityConnectionDtoStateEnum = {}));
|
|
@@ -18,33 +18,32 @@ export interface GroupEntityConnectionDto {
|
|
|
18
18
|
* Date/time the connection was last updated (ISO string)
|
|
19
19
|
*/
|
|
20
20
|
'updatedAt'?: string;
|
|
21
|
-
/**
|
|
22
|
-
* Connection state
|
|
23
|
-
*/
|
|
24
|
-
'state': GroupEntityConnectionDtoStateEnum;
|
|
25
21
|
/**
|
|
26
22
|
* Connection type
|
|
27
23
|
*/
|
|
28
24
|
'type': GroupEntityConnectionDtoTypeEnum;
|
|
25
|
+
/**
|
|
26
|
+
* Connection state
|
|
27
|
+
*/
|
|
28
|
+
'state'?: GroupEntityConnectionDtoStateEnum;
|
|
29
29
|
/**
|
|
30
30
|
* Group ID
|
|
31
31
|
*/
|
|
32
32
|
'groupId': string;
|
|
33
33
|
}
|
|
34
|
-
export declare enum GroupEntityConnectionDtoStateEnum {
|
|
35
|
-
requested = "requested",
|
|
36
|
-
active = "active",
|
|
37
|
-
rejected = "rejected",
|
|
38
|
-
blocked = "blocked"
|
|
39
|
-
}
|
|
40
34
|
export declare enum GroupEntityConnectionDtoTypeEnum {
|
|
41
35
|
attendee = "attendee",
|
|
42
36
|
admin = "admin",
|
|
43
37
|
owner = "owner",
|
|
44
38
|
member = "member",
|
|
45
|
-
admin2 = "admin",
|
|
46
|
-
owner2 = "owner",
|
|
47
39
|
friend = "friend",
|
|
48
40
|
blocked = "blocked",
|
|
49
41
|
none = "none"
|
|
50
42
|
}
|
|
43
|
+
export declare enum GroupEntityConnectionDtoStateEnum {
|
|
44
|
+
incoming_request = "incoming_request",
|
|
45
|
+
outgoing_request = "outgoing_request",
|
|
46
|
+
active = "active",
|
|
47
|
+
requested = "requested",
|
|
48
|
+
invited = "invited"
|
|
49
|
+
}
|
|
@@ -13,23 +13,22 @@
|
|
|
13
13
|
* Do not edit the class manually.
|
|
14
14
|
*/
|
|
15
15
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
16
|
-
exports.
|
|
17
|
-
var GroupEntityConnectionDtoStateEnum;
|
|
18
|
-
(function (GroupEntityConnectionDtoStateEnum) {
|
|
19
|
-
GroupEntityConnectionDtoStateEnum["requested"] = "requested";
|
|
20
|
-
GroupEntityConnectionDtoStateEnum["active"] = "active";
|
|
21
|
-
GroupEntityConnectionDtoStateEnum["rejected"] = "rejected";
|
|
22
|
-
GroupEntityConnectionDtoStateEnum["blocked"] = "blocked";
|
|
23
|
-
})(GroupEntityConnectionDtoStateEnum || (exports.GroupEntityConnectionDtoStateEnum = GroupEntityConnectionDtoStateEnum = {}));
|
|
16
|
+
exports.GroupEntityConnectionDtoStateEnum = exports.GroupEntityConnectionDtoTypeEnum = void 0;
|
|
24
17
|
var GroupEntityConnectionDtoTypeEnum;
|
|
25
18
|
(function (GroupEntityConnectionDtoTypeEnum) {
|
|
26
19
|
GroupEntityConnectionDtoTypeEnum["attendee"] = "attendee";
|
|
27
20
|
GroupEntityConnectionDtoTypeEnum["admin"] = "admin";
|
|
28
21
|
GroupEntityConnectionDtoTypeEnum["owner"] = "owner";
|
|
29
22
|
GroupEntityConnectionDtoTypeEnum["member"] = "member";
|
|
30
|
-
GroupEntityConnectionDtoTypeEnum["admin2"] = "admin";
|
|
31
|
-
GroupEntityConnectionDtoTypeEnum["owner2"] = "owner";
|
|
32
23
|
GroupEntityConnectionDtoTypeEnum["friend"] = "friend";
|
|
33
24
|
GroupEntityConnectionDtoTypeEnum["blocked"] = "blocked";
|
|
34
25
|
GroupEntityConnectionDtoTypeEnum["none"] = "none";
|
|
35
26
|
})(GroupEntityConnectionDtoTypeEnum || (exports.GroupEntityConnectionDtoTypeEnum = GroupEntityConnectionDtoTypeEnum = {}));
|
|
27
|
+
var GroupEntityConnectionDtoStateEnum;
|
|
28
|
+
(function (GroupEntityConnectionDtoStateEnum) {
|
|
29
|
+
GroupEntityConnectionDtoStateEnum["incoming_request"] = "incoming_request";
|
|
30
|
+
GroupEntityConnectionDtoStateEnum["outgoing_request"] = "outgoing_request";
|
|
31
|
+
GroupEntityConnectionDtoStateEnum["active"] = "active";
|
|
32
|
+
GroupEntityConnectionDtoStateEnum["requested"] = "requested";
|
|
33
|
+
GroupEntityConnectionDtoStateEnum["invited"] = "invited";
|
|
34
|
+
})(GroupEntityConnectionDtoStateEnum || (exports.GroupEntityConnectionDtoStateEnum = GroupEntityConnectionDtoStateEnum = {}));
|
|
@@ -18,33 +18,32 @@ export interface UserEntityConnectionDto {
|
|
|
18
18
|
* Date/time the connection was last updated (ISO string)
|
|
19
19
|
*/
|
|
20
20
|
'updatedAt'?: string;
|
|
21
|
-
/**
|
|
22
|
-
* Connection state
|
|
23
|
-
*/
|
|
24
|
-
'state': UserEntityConnectionDtoStateEnum;
|
|
25
21
|
/**
|
|
26
22
|
* Connection type
|
|
27
23
|
*/
|
|
28
24
|
'type': UserEntityConnectionDtoTypeEnum;
|
|
25
|
+
/**
|
|
26
|
+
* Connection state
|
|
27
|
+
*/
|
|
28
|
+
'state'?: UserEntityConnectionDtoStateEnum;
|
|
29
29
|
/**
|
|
30
30
|
* User ID
|
|
31
31
|
*/
|
|
32
32
|
'userId': string;
|
|
33
33
|
}
|
|
34
|
-
export declare enum UserEntityConnectionDtoStateEnum {
|
|
35
|
-
requested = "requested",
|
|
36
|
-
active = "active",
|
|
37
|
-
rejected = "rejected",
|
|
38
|
-
blocked = "blocked"
|
|
39
|
-
}
|
|
40
34
|
export declare enum UserEntityConnectionDtoTypeEnum {
|
|
41
35
|
attendee = "attendee",
|
|
42
36
|
admin = "admin",
|
|
43
37
|
owner = "owner",
|
|
44
38
|
member = "member",
|
|
45
|
-
admin2 = "admin",
|
|
46
|
-
owner2 = "owner",
|
|
47
39
|
friend = "friend",
|
|
48
40
|
blocked = "blocked",
|
|
49
41
|
none = "none"
|
|
50
42
|
}
|
|
43
|
+
export declare enum UserEntityConnectionDtoStateEnum {
|
|
44
|
+
incoming_request = "incoming_request",
|
|
45
|
+
outgoing_request = "outgoing_request",
|
|
46
|
+
active = "active",
|
|
47
|
+
requested = "requested",
|
|
48
|
+
invited = "invited"
|
|
49
|
+
}
|
|
@@ -13,23 +13,22 @@
|
|
|
13
13
|
* Do not edit the class manually.
|
|
14
14
|
*/
|
|
15
15
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
16
|
-
exports.
|
|
17
|
-
var UserEntityConnectionDtoStateEnum;
|
|
18
|
-
(function (UserEntityConnectionDtoStateEnum) {
|
|
19
|
-
UserEntityConnectionDtoStateEnum["requested"] = "requested";
|
|
20
|
-
UserEntityConnectionDtoStateEnum["active"] = "active";
|
|
21
|
-
UserEntityConnectionDtoStateEnum["rejected"] = "rejected";
|
|
22
|
-
UserEntityConnectionDtoStateEnum["blocked"] = "blocked";
|
|
23
|
-
})(UserEntityConnectionDtoStateEnum || (exports.UserEntityConnectionDtoStateEnum = UserEntityConnectionDtoStateEnum = {}));
|
|
16
|
+
exports.UserEntityConnectionDtoStateEnum = exports.UserEntityConnectionDtoTypeEnum = void 0;
|
|
24
17
|
var UserEntityConnectionDtoTypeEnum;
|
|
25
18
|
(function (UserEntityConnectionDtoTypeEnum) {
|
|
26
19
|
UserEntityConnectionDtoTypeEnum["attendee"] = "attendee";
|
|
27
20
|
UserEntityConnectionDtoTypeEnum["admin"] = "admin";
|
|
28
21
|
UserEntityConnectionDtoTypeEnum["owner"] = "owner";
|
|
29
22
|
UserEntityConnectionDtoTypeEnum["member"] = "member";
|
|
30
|
-
UserEntityConnectionDtoTypeEnum["admin2"] = "admin";
|
|
31
|
-
UserEntityConnectionDtoTypeEnum["owner2"] = "owner";
|
|
32
23
|
UserEntityConnectionDtoTypeEnum["friend"] = "friend";
|
|
33
24
|
UserEntityConnectionDtoTypeEnum["blocked"] = "blocked";
|
|
34
25
|
UserEntityConnectionDtoTypeEnum["none"] = "none";
|
|
35
26
|
})(UserEntityConnectionDtoTypeEnum || (exports.UserEntityConnectionDtoTypeEnum = UserEntityConnectionDtoTypeEnum = {}));
|
|
27
|
+
var UserEntityConnectionDtoStateEnum;
|
|
28
|
+
(function (UserEntityConnectionDtoStateEnum) {
|
|
29
|
+
UserEntityConnectionDtoStateEnum["incoming_request"] = "incoming_request";
|
|
30
|
+
UserEntityConnectionDtoStateEnum["outgoing_request"] = "outgoing_request";
|
|
31
|
+
UserEntityConnectionDtoStateEnum["active"] = "active";
|
|
32
|
+
UserEntityConnectionDtoStateEnum["requested"] = "requested";
|
|
33
|
+
UserEntityConnectionDtoStateEnum["invited"] = "invited";
|
|
34
|
+
})(UserEntityConnectionDtoStateEnum || (exports.UserEntityConnectionDtoStateEnum = UserEntityConnectionDtoStateEnum = {}));
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@proxima-nexus/sdk-typescript",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.1.1",
|
|
4
4
|
"description": "TypeScript SDK for Proxima Nexus Data Plane API",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"types": "dist/index.d.ts",
|
|
@@ -43,7 +43,7 @@
|
|
|
43
43
|
},
|
|
44
44
|
"devDependencies": {
|
|
45
45
|
"@openapitools/openapi-generator-cli": "^2.7.0",
|
|
46
|
-
"@proxima-nexus/openapi": "^2.0.
|
|
46
|
+
"@proxima-nexus/openapi": "^2.0.1",
|
|
47
47
|
"@types/node": "^20.10.0",
|
|
48
48
|
"typescript": "^5.3.3",
|
|
49
49
|
"ts-node": "^10.9.2"
|