@proxima-nexus/sdk-typescript 1.0.0 → 2.0.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 +96 -0
- package/README.md +173 -159
- package/dist/api/event-api.d.ts +171 -65
- package/dist/api/event-api.js +273 -93
- package/dist/api/group-api.d.ts +147 -70
- package/dist/api/group-api.js +234 -101
- package/dist/api/user-api.d.ts +210 -125
- package/dist/api/user-api.js +297 -171
- package/dist/models/create-event-dto.d.ts +4 -4
- package/dist/models/create-group-dto.d.ts +6 -5
- package/dist/models/create-group-dto.js +7 -1
- package/dist/models/create-user-dto.d.ts +0 -4
- package/dist/models/entity-connection-dto.d.ts +17 -1
- package/dist/models/entity-connection-dto.js +14 -1
- package/dist/models/event-dto.d.ts +13 -4
- package/dist/models/event-entity-connection-dto.d.ts +17 -1
- package/dist/models/event-entity-connection-dto.js +14 -1
- package/dist/models/group-dto.d.ts +15 -5
- package/dist/models/group-dto.js +7 -1
- package/dist/models/group-entity-connection-dto.d.ts +17 -1
- package/dist/models/group-entity-connection-dto.js +14 -1
- package/dist/models/index.d.ts +3 -0
- package/dist/models/index.js +3 -0
- package/dist/models/mutate-event-entity-connection-dto.d.ts +22 -0
- package/dist/models/mutate-event-entity-connection-dto.js +22 -0
- package/dist/models/mutate-group-entity-connection-dto.d.ts +22 -0
- package/dist/models/mutate-group-entity-connection-dto.js +22 -0
- package/dist/models/mutate-user-connection-dto.d.ts +21 -0
- package/dist/models/mutate-user-connection-dto.js +21 -0
- package/dist/models/update-event-dto.d.ts +4 -4
- package/dist/models/update-group-dto.d.ts +6 -5
- package/dist/models/update-group-dto.js +7 -1
- package/dist/models/update-user-dto.d.ts +0 -4
- package/dist/models/user-dto.d.ts +5 -4
- package/dist/models/user-entity-connection-dto.d.ts +17 -1
- package/dist/models/user-entity-connection-dto.js +14 -1
- package/package.json +5 -4
package/CHANGELOG.md
ADDED
|
@@ -0,0 +1,96 @@
|
|
|
1
|
+
# Changelog
|
|
2
|
+
|
|
3
|
+
All notable changes to the Proxima Nexus TypeScript SDK are documented in this file.
|
|
4
|
+
|
|
5
|
+
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
|
|
6
|
+
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
|
7
|
+
|
|
8
|
+
## [2.0.1] - 2025-01-29
|
|
9
|
+
|
|
10
|
+
### Changed
|
|
11
|
+
|
|
12
|
+
- Updated README.md to reflect version 2.0.0 API changes, including method renames, updated method signatures, and connection operation examples
|
|
13
|
+
|
|
14
|
+
## [2.0.0] - 2025-01-29
|
|
15
|
+
|
|
16
|
+
### Breaking Changes
|
|
17
|
+
|
|
18
|
+
This release aligns with `@proxima-nexus/openapi` version 2.0.0, which includes significant breaking changes to the API specification. Please refer to the [OpenAPI changelog](https://github.com/proxima-nexus/openapi/blob/HEAD/CHANGELOG.md#200---2025-01-29) for complete details.
|
|
19
|
+
|
|
20
|
+
#### API Method Renames
|
|
21
|
+
|
|
22
|
+
The following methods have been renamed to align with the updated OpenAPI specification:
|
|
23
|
+
|
|
24
|
+
**User API:**
|
|
25
|
+
- `findOne` → `get`
|
|
26
|
+
- `addFriend` → `putConnection`
|
|
27
|
+
- `removeFriend` → `deleteConnection`
|
|
28
|
+
- `getFriends` → `getConnections`
|
|
29
|
+
|
|
30
|
+
**Event API:**
|
|
31
|
+
- `findOne` → `get`
|
|
32
|
+
- `addAttendee` → `addConnection`
|
|
33
|
+
- `getAttendees` → `getConnections`
|
|
34
|
+
- New: `removeConnection` (for removing attendees)
|
|
35
|
+
|
|
36
|
+
**Group API:**
|
|
37
|
+
- `findOne` → `get`
|
|
38
|
+
- `addMember` → `addConnection`
|
|
39
|
+
- `removeMember` → `removeConnection`
|
|
40
|
+
- `getMembers` → `getConnections`
|
|
41
|
+
|
|
42
|
+
#### Path and Parameter Changes
|
|
43
|
+
|
|
44
|
+
- User connections: `friends` → `connections`, `friendUserId` → `targetUserId`
|
|
45
|
+
- Event connections: `attendees` → `connections`
|
|
46
|
+
- Group connections: `members` → `connections`
|
|
47
|
+
|
|
48
|
+
#### Request Identity Header
|
|
49
|
+
|
|
50
|
+
**Requester identity** is now sent via the **`X-Proxima-Nexus-Requester-User-Id`** header instead of in request bodies. The `requesterUserId` field has been removed from:
|
|
51
|
+
- `CreateUserDto`
|
|
52
|
+
- `UpdateUserDto`
|
|
53
|
+
- `CreateEventDto`
|
|
54
|
+
- `UpdateEventDto`
|
|
55
|
+
- `CreateGroupDto`
|
|
56
|
+
- `UpdateGroupDto`
|
|
57
|
+
|
|
58
|
+
#### Schema Changes
|
|
59
|
+
|
|
60
|
+
- **Removed** `tenantId` from `UserDto`, `EventDto`, and `GroupDto`
|
|
61
|
+
- **Added** `requesterConnection` (`EntityConnectionDto`) to `UserDto`, `EventDto`, and `GroupDto`
|
|
62
|
+
- **EntityConnectionDto**: Now includes both `state` and `type`
|
|
63
|
+
- **New mutation DTOs**: `MutateUserConnectionDto`, `MutateEventEntityConnectionDto`, `MutateGroupEntityConnectionDto`
|
|
64
|
+
- **User connections**: PUT now requires `MutateUserConnectionDto` with `type` (`friend` | `blocked`); DELETE requires query param `type`
|
|
65
|
+
- **Event/Group connections**: PUT and DELETE now require request body with connection DTOs
|
|
66
|
+
- **Group type**: Now enum `open` | `request` | `invite` (replaces free-form string)
|
|
67
|
+
- **Events**: Added `maxNumAttendees` and `numAttendees` fields
|
|
68
|
+
- **Groups**: Added `numMembers` and `requesterConnection` fields
|
|
69
|
+
|
|
70
|
+
#### Security
|
|
71
|
+
|
|
72
|
+
- Security scheme changed from `bearer` to `api_key` for all operations
|
|
73
|
+
|
|
74
|
+
### Migration Guide
|
|
75
|
+
|
|
76
|
+
To migrate from version 1.x to 2.0.0:
|
|
77
|
+
|
|
78
|
+
1. **Update method names**: Replace all renamed methods (e.g., `findOne` → `get`, `addFriend` → `putConnection`)
|
|
79
|
+
2. **Update connection endpoints**: Replace `friends`/`attendees`/`members` references with `connections`
|
|
80
|
+
3. **Move requester identity to header**: Remove `requesterUserId` from request bodies and set the `X-Proxima-Nexus-Requester-User-Id` header instead
|
|
81
|
+
4. **Update connection DTOs**: Use the new mutation DTOs (`MutateUserConnectionDto`, etc.) with required `type` field
|
|
82
|
+
5. **Update connection operations**: Ensure PUT/DELETE operations for connections include the required request bodies
|
|
83
|
+
|
|
84
|
+
### Dependencies
|
|
85
|
+
|
|
86
|
+
- Updated `@proxima-nexus/openapi` to `^2.0.0`
|
|
87
|
+
|
|
88
|
+
## [1.0.0] - 2024-12-XX
|
|
89
|
+
|
|
90
|
+
### Added
|
|
91
|
+
|
|
92
|
+
- Initial release of the Proxima Nexus TypeScript SDK
|
|
93
|
+
- Support for User, Event, and Group operations
|
|
94
|
+
- Axios-based HTTP client
|
|
95
|
+
- Full TypeScript type definitions
|
|
96
|
+
- Simplified API method names (removed "Controller" prefixes)
|
package/README.md
CHANGED
|
@@ -2,6 +2,8 @@
|
|
|
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
|
+
|
|
5
7
|
## Installation
|
|
6
8
|
|
|
7
9
|
```bash
|
|
@@ -29,88 +31,88 @@ async function main() {
|
|
|
29
31
|
try {
|
|
30
32
|
// Create a user
|
|
31
33
|
const createResponse = await client.users.create({
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
name: 'New York, NY'
|
|
43
|
-
}
|
|
44
|
-
},
|
|
34
|
+
userId: 'user-123',
|
|
35
|
+
displayName: 'John Doe',
|
|
36
|
+
visibility: 'public',
|
|
37
|
+
gender: 'male',
|
|
38
|
+
birthDate: '1990-01-01',
|
|
39
|
+
location: {
|
|
40
|
+
latitude: 40.7128,
|
|
41
|
+
longitude: -74.006,
|
|
42
|
+
name: 'New York, NY'
|
|
43
|
+
}
|
|
45
44
|
});
|
|
46
45
|
console.log('Created user:', createResponse.data);
|
|
47
46
|
|
|
48
47
|
// Search users
|
|
49
|
-
const searchResponse = await client.users.search(
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
48
|
+
const searchResponse = await client.users.search(
|
|
49
|
+
'John', // displayName
|
|
50
|
+
40.7128, // latitude
|
|
51
|
+
-74.006, // longitude
|
|
52
|
+
5000, // radius
|
|
53
|
+
undefined, // minLatitude
|
|
54
|
+
undefined, // maxLatitude
|
|
55
|
+
undefined, // minLongitude
|
|
56
|
+
undefined, // maxLongitude
|
|
57
|
+
10, // limit
|
|
58
|
+
'requester-123' // xProximaNexusRequesterUserId (optional)
|
|
59
|
+
);
|
|
56
60
|
console.log('Found users:', searchResponse.data);
|
|
57
61
|
|
|
58
62
|
// Get user by ID
|
|
59
|
-
const user = await client.users.
|
|
60
|
-
userId: 'user-123',
|
|
61
|
-
});
|
|
63
|
+
const user = await client.users.get('user-123', 'requester-123');
|
|
62
64
|
console.log('User details:', user.data);
|
|
63
65
|
|
|
64
66
|
// Update a user
|
|
65
|
-
const updated = await client.users.update(
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
67
|
+
const updated = await client.users.update(
|
|
68
|
+
'user-123',
|
|
69
|
+
'requester-123',
|
|
70
|
+
{
|
|
69
71
|
displayName: 'John Smith',
|
|
70
72
|
gender: 'male',
|
|
71
73
|
birthDate: '1990-01-01',
|
|
72
|
-
}
|
|
73
|
-
|
|
74
|
+
}
|
|
75
|
+
);
|
|
74
76
|
console.log('Updated user:', updated.data);
|
|
75
77
|
|
|
76
78
|
// Delete a user
|
|
77
|
-
await client.users.remove(
|
|
78
|
-
userId: 'user-123',
|
|
79
|
-
});
|
|
79
|
+
await client.users.remove('user-123', 'requester-123');
|
|
80
80
|
|
|
81
81
|
// Get a batch of users
|
|
82
|
-
const batchUsers = await client.users.getBatch(
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
});
|
|
82
|
+
const batchUsers = await client.users.getBatch(
|
|
83
|
+
{ userIds: ['user-1', 'user-2', 'user-3'] },
|
|
84
|
+
'requester-123'
|
|
85
|
+
);
|
|
87
86
|
console.log('Batch users:', batchUsers.data);
|
|
88
87
|
|
|
89
|
-
//
|
|
90
|
-
const
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
88
|
+
// Connection operations
|
|
89
|
+
const connections = await client.users.getConnections(
|
|
90
|
+
'user-123',
|
|
91
|
+
undefined, // state filter (optional)
|
|
92
|
+
undefined, // type filter (optional)
|
|
93
|
+
'requester-123' // xProximaNexusRequesterUserId (optional)
|
|
94
|
+
);
|
|
95
|
+
console.log('Connections:', connections.data);
|
|
96
|
+
|
|
97
|
+
await client.users.putConnection(
|
|
98
|
+
'user-123',
|
|
99
|
+
'friend-456',
|
|
100
|
+
'requester-123',
|
|
101
|
+
{ type: 'friend' } // MutateUserConnectionDto
|
|
102
|
+
);
|
|
103
|
+
|
|
104
|
+
await client.users.deleteConnection(
|
|
105
|
+
'user-123',
|
|
106
|
+
'friend-456',
|
|
107
|
+
'friend', // type: 'friend' | 'blocked'
|
|
108
|
+
'requester-123'
|
|
109
|
+
);
|
|
104
110
|
|
|
105
111
|
// Get user's groups and events
|
|
106
|
-
const groups = await client.users.getGroups(
|
|
107
|
-
userId: 'user-123',
|
|
108
|
-
});
|
|
112
|
+
const groups = await client.users.getGroups('user-123', 'requester-123');
|
|
109
113
|
console.log('User groups:', groups.data);
|
|
110
114
|
|
|
111
|
-
const events = await client.users.getEvents(
|
|
112
|
-
userId: 'user-123',
|
|
113
|
-
});
|
|
115
|
+
const events = await client.users.getEvents('user-123', 'requester-123');
|
|
114
116
|
console.log('User events:', events.data);
|
|
115
117
|
} catch (error: any) {
|
|
116
118
|
console.error('API Error:', error.message);
|
|
@@ -129,77 +131,84 @@ async function main() {
|
|
|
129
131
|
try {
|
|
130
132
|
// Create an event
|
|
131
133
|
const event = await client.events.create({
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
longitude: -74.006,
|
|
143
|
-
name: 'New York, NY'
|
|
144
|
-
},
|
|
145
|
-
description: 'Monthly tech meetup',
|
|
134
|
+
eventId: 'event-123',
|
|
135
|
+
displayName: 'Tech Meetup',
|
|
136
|
+
visibility: 'public',
|
|
137
|
+
startTime: '2024-12-01T18:00:00Z',
|
|
138
|
+
endTime: '2024-12-01T22:00:00Z',
|
|
139
|
+
type: 'meetup',
|
|
140
|
+
location: {
|
|
141
|
+
latitude: 40.7128,
|
|
142
|
+
longitude: -74.006,
|
|
143
|
+
name: 'New York, NY'
|
|
146
144
|
},
|
|
145
|
+
description: 'Monthly tech meetup',
|
|
147
146
|
});
|
|
148
147
|
console.log('Created event:', event.data);
|
|
149
148
|
|
|
150
149
|
// Search events
|
|
151
|
-
const events = await client.events.search(
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
150
|
+
const events = await client.events.search(
|
|
151
|
+
'Tech', // displayName
|
|
152
|
+
40.7128, // latitude
|
|
153
|
+
-74.006, // longitude
|
|
154
|
+
10000, // radius
|
|
155
|
+
undefined, // minLatitude
|
|
156
|
+
undefined, // maxLatitude
|
|
157
|
+
undefined, // minLongitude
|
|
158
|
+
undefined, // maxLongitude
|
|
159
|
+
50, // limit
|
|
160
|
+
'user-123' // xProximaNexusRequesterUserId (optional)
|
|
161
|
+
);
|
|
158
162
|
console.log('Found events:', events.data);
|
|
159
163
|
|
|
160
164
|
// Get an event by ID
|
|
161
|
-
const eventDetails = await client.events.
|
|
162
|
-
eventId: 'event-123',
|
|
163
|
-
});
|
|
165
|
+
const eventDetails = await client.events.get('event-123', 'user-123');
|
|
164
166
|
console.log('Event details:', eventDetails.data);
|
|
165
167
|
|
|
166
168
|
// Update an event
|
|
167
|
-
const updatedEvent = await client.events.update(
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
169
|
+
const updatedEvent = await client.events.update(
|
|
170
|
+
'event-123',
|
|
171
|
+
'user-123',
|
|
172
|
+
{
|
|
171
173
|
displayName: 'Tech Meetup 2024',
|
|
172
174
|
startTime: '2024-12-01T18:00:00Z',
|
|
173
175
|
endTime: '2024-12-01T23:00:00Z',
|
|
174
176
|
type: 'meetup',
|
|
175
|
-
}
|
|
176
|
-
|
|
177
|
+
}
|
|
178
|
+
);
|
|
177
179
|
console.log('Updated event:', updatedEvent.data);
|
|
178
180
|
|
|
179
181
|
// Delete an event
|
|
180
|
-
await client.events.remove(
|
|
181
|
-
eventId: 'event-123',
|
|
182
|
-
requesterUserId: 'user-123',
|
|
183
|
-
});
|
|
182
|
+
await client.events.remove('event-123', 'user-123');
|
|
184
183
|
|
|
185
184
|
// Get a batch of events
|
|
186
|
-
const batchEvents = await client.events.getBatch(
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
});
|
|
185
|
+
const batchEvents = await client.events.getBatch(
|
|
186
|
+
{ eventIds: ['event-1', 'event-2', 'event-3'] },
|
|
187
|
+
'user-123'
|
|
188
|
+
);
|
|
191
189
|
console.log('Batch events:', batchEvents.data);
|
|
192
190
|
|
|
193
|
-
//
|
|
194
|
-
const
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
191
|
+
// Connection operations
|
|
192
|
+
const connections = await client.events.getConnections(
|
|
193
|
+
'event-123',
|
|
194
|
+
undefined, // type filter (optional)
|
|
195
|
+
'user-123' // xProximaNexusRequesterUserId (optional)
|
|
196
|
+
);
|
|
197
|
+
console.log('Connections:', connections.data);
|
|
198
|
+
|
|
199
|
+
await client.events.addConnection(
|
|
200
|
+
'event-123',
|
|
201
|
+
'user-456',
|
|
202
|
+
'user-123',
|
|
203
|
+
{ type: 'attendee' } // MutateEventEntityConnectionDto
|
|
204
|
+
);
|
|
205
|
+
|
|
206
|
+
await client.events.removeConnection(
|
|
207
|
+
'event-123',
|
|
208
|
+
'user-456',
|
|
209
|
+
'user-123',
|
|
210
|
+
{ type: 'attendee' } // MutateEventEntityConnectionDto
|
|
211
|
+
);
|
|
203
212
|
} catch (error: any) {
|
|
204
213
|
console.error('API Error:', error.message);
|
|
205
214
|
if (error.response) {
|
|
@@ -217,78 +226,79 @@ async function main() {
|
|
|
217
226
|
try {
|
|
218
227
|
// Create a group
|
|
219
228
|
const group = await client.groups.create({
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
type: 'club',
|
|
226
|
-
description: 'A group for music enthusiasts',
|
|
227
|
-
},
|
|
229
|
+
groupId: 'group-123',
|
|
230
|
+
displayName: 'Music Lovers',
|
|
231
|
+
visibility: 'public',
|
|
232
|
+
type: 'open', // enum: 'open' | 'request' | 'invite'
|
|
233
|
+
description: 'A group for music enthusiasts',
|
|
228
234
|
});
|
|
229
235
|
console.log('Created group:', group.data);
|
|
230
236
|
|
|
231
237
|
// Search groups
|
|
232
|
-
const groups = await client.groups.search(
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
238
|
+
const groups = await client.groups.search(
|
|
239
|
+
'Music', // displayName
|
|
240
|
+
40.7128, // latitude
|
|
241
|
+
-74.006, // longitude
|
|
242
|
+
5000, // radius
|
|
243
|
+
undefined, // minLatitude
|
|
244
|
+
undefined, // maxLatitude
|
|
245
|
+
undefined, // minLongitude
|
|
246
|
+
undefined, // maxLongitude
|
|
247
|
+
100, // limit
|
|
248
|
+
'user-123' // xProximaNexusRequesterUserId (optional)
|
|
249
|
+
);
|
|
239
250
|
console.log('Found groups:', groups.data);
|
|
240
251
|
|
|
241
252
|
// Get a group by ID
|
|
242
|
-
const groupDetails = await client.groups.
|
|
243
|
-
groupId: 'group-123',
|
|
244
|
-
});
|
|
253
|
+
const groupDetails = await client.groups.get('group-123', 'user-123');
|
|
245
254
|
console.log('Group details:', groupDetails.data);
|
|
246
255
|
|
|
247
256
|
// Update a group
|
|
248
|
-
const updatedGroup = await client.groups.update(
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
257
|
+
const updatedGroup = await client.groups.update(
|
|
258
|
+
'group-123',
|
|
259
|
+
'user-123',
|
|
260
|
+
{
|
|
252
261
|
displayName: 'Music Enthusiasts',
|
|
253
|
-
type: '
|
|
254
|
-
}
|
|
255
|
-
|
|
262
|
+
type: 'open',
|
|
263
|
+
}
|
|
264
|
+
);
|
|
256
265
|
console.log('Updated group:', updatedGroup.data);
|
|
257
266
|
|
|
258
267
|
// Delete a group
|
|
259
|
-
await client.groups.remove(
|
|
260
|
-
groupId: 'group-123',
|
|
261
|
-
requesterUserId: 'user-123',
|
|
262
|
-
});
|
|
268
|
+
await client.groups.remove('group-123', 'user-123');
|
|
263
269
|
|
|
264
270
|
// Get a batch of groups
|
|
265
|
-
const batchGroups = await client.groups.getBatch(
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
});
|
|
271
|
+
const batchGroups = await client.groups.getBatch(
|
|
272
|
+
{ groupIds: ['group-1', 'group-2', 'group-3'] },
|
|
273
|
+
'user-123'
|
|
274
|
+
);
|
|
270
275
|
console.log('Batch groups:', batchGroups.data);
|
|
271
276
|
|
|
272
|
-
//
|
|
273
|
-
const
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
277
|
+
// Connection operations
|
|
278
|
+
const connections = await client.groups.getConnections(
|
|
279
|
+
'group-123',
|
|
280
|
+
undefined, // state filter (optional)
|
|
281
|
+
undefined, // type filter (optional)
|
|
282
|
+
'user-123' // xProximaNexusRequesterUserId (optional)
|
|
283
|
+
);
|
|
284
|
+
console.log('Connections:', connections.data);
|
|
285
|
+
|
|
286
|
+
await client.groups.addConnection(
|
|
287
|
+
'group-123',
|
|
288
|
+
'user-456',
|
|
289
|
+
'user-123',
|
|
290
|
+
{ type: 'member' } // MutateGroupEntityConnectionDto
|
|
291
|
+
);
|
|
292
|
+
|
|
293
|
+
await client.groups.removeConnection(
|
|
294
|
+
'group-123',
|
|
295
|
+
'user-456',
|
|
296
|
+
'user-123',
|
|
297
|
+
{ type: 'member' } // MutateGroupEntityConnectionDto
|
|
298
|
+
);
|
|
287
299
|
|
|
288
300
|
// Get group's events
|
|
289
|
-
const groupEvents = await client.groups.getEvents(
|
|
290
|
-
groupId: 'group-123',
|
|
291
|
-
});
|
|
301
|
+
const groupEvents = await client.groups.getEvents('group-123', 'user-123');
|
|
292
302
|
console.log('Group events:', groupEvents.data);
|
|
293
303
|
} catch (error: any) {
|
|
294
304
|
console.error('API Error:', error.message);
|
|
@@ -300,6 +310,10 @@ async function main() {
|
|
|
300
310
|
}
|
|
301
311
|
```
|
|
302
312
|
|
|
313
|
+
## Requester User ID
|
|
314
|
+
|
|
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.
|
|
316
|
+
|
|
303
317
|
## Configuration
|
|
304
318
|
|
|
305
319
|
The `ProximaNexusClientConfig` interface supports the following options:
|