@proxima-nexus/openapi 1.0.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/LICENSE +15 -0
- package/README.md +284 -0
- package/openapi.json +2262 -0
- package/openapi.yaml +1500 -0
- package/package.json +45 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
ISC License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026, Proxima Nexus
|
|
4
|
+
|
|
5
|
+
Permission to use, copy, modify, and/or distribute this software for any
|
|
6
|
+
purpose with or without fee is hereby granted, provided that the above
|
|
7
|
+
copyright notice and this permission notice appear in all copies.
|
|
8
|
+
|
|
9
|
+
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
|
|
10
|
+
WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
|
|
11
|
+
MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
|
|
12
|
+
ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
|
|
13
|
+
WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
|
|
14
|
+
ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
|
|
15
|
+
OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
package/README.md
ADDED
|
@@ -0,0 +1,284 @@
|
|
|
1
|
+
# @proxima-nexus/openapi
|
|
2
|
+
|
|
3
|
+
[](https://www.npmjs.com/package/@proxima-nexus/openapi)
|
|
4
|
+
[](https://opensource.org/licenses/ISC)
|
|
5
|
+
|
|
6
|
+
Official OpenAPI 3.0 specification for the **Proxima Nexus Data Plane API**. This package provides machine-readable API documentation in both JSON and YAML formats, enabling automatic SDK generation, API testing, and client integration.
|
|
7
|
+
|
|
8
|
+
## 📦 Installation
|
|
9
|
+
|
|
10
|
+
```bash
|
|
11
|
+
npm install @proxima-nexus/openapi
|
|
12
|
+
```
|
|
13
|
+
|
|
14
|
+
or with yarn:
|
|
15
|
+
|
|
16
|
+
```bash
|
|
17
|
+
yarn add @proxima-nexus/openapi
|
|
18
|
+
```
|
|
19
|
+
|
|
20
|
+
or with pnpm:
|
|
21
|
+
|
|
22
|
+
```bash
|
|
23
|
+
pnpm add @proxima-nexus/openapi
|
|
24
|
+
```
|
|
25
|
+
|
|
26
|
+
## 📋 Contents
|
|
27
|
+
|
|
28
|
+
This package includes:
|
|
29
|
+
|
|
30
|
+
- **`openapi.json`** - OpenAPI 3.0 specification in JSON format
|
|
31
|
+
- **`openapi.yaml`** - OpenAPI 3.0 specification in YAML format
|
|
32
|
+
|
|
33
|
+
Both files are identical in content and are provided for convenience depending on your tooling preferences.
|
|
34
|
+
|
|
35
|
+
## 🚀 Usage
|
|
36
|
+
|
|
37
|
+
### Accessing the Specification Files
|
|
38
|
+
|
|
39
|
+
```typescript
|
|
40
|
+
import openapiJson from '@proxima-nexus/openapi/openapi.json';
|
|
41
|
+
import * as fs from 'fs';
|
|
42
|
+
import * as path from 'path';
|
|
43
|
+
|
|
44
|
+
// In Node.js
|
|
45
|
+
const openapiPath = path.join(
|
|
46
|
+
require.resolve('@proxima-nexus/openapi'),
|
|
47
|
+
'../openapi.yaml'
|
|
48
|
+
);
|
|
49
|
+
const spec = fs.readFileSync(openapiPath, 'utf-8');
|
|
50
|
+
```
|
|
51
|
+
|
|
52
|
+
```javascript
|
|
53
|
+
// In Node.js (CommonJS)
|
|
54
|
+
const openapiJson = require('@proxima-nexus/openapi/openapi.json');
|
|
55
|
+
const openapiYaml = require('@proxima-nexus/openapi/openapi.yaml');
|
|
56
|
+
```
|
|
57
|
+
|
|
58
|
+
```python
|
|
59
|
+
# In Python
|
|
60
|
+
import json
|
|
61
|
+
import pkg_resources
|
|
62
|
+
|
|
63
|
+
openapi_json_path = pkg_resources.resource_filename(
|
|
64
|
+
'proxima_nexus_openapi', 'openapi.json'
|
|
65
|
+
)
|
|
66
|
+
with open(openapi_json_path, 'r') as f:
|
|
67
|
+
spec = json.load(f)
|
|
68
|
+
```
|
|
69
|
+
|
|
70
|
+
### Generating SDKs
|
|
71
|
+
|
|
72
|
+
#### TypeScript/JavaScript
|
|
73
|
+
|
|
74
|
+
Using [openapi-generator](https://openapi-generator.tech/):
|
|
75
|
+
|
|
76
|
+
```bash
|
|
77
|
+
npx @openapitools/openapi-generator-cli generate \
|
|
78
|
+
-i node_modules/@proxima-nexus/openapi/openapi.yaml \
|
|
79
|
+
-g typescript-axios \
|
|
80
|
+
-o ./generated-sdk
|
|
81
|
+
```
|
|
82
|
+
|
|
83
|
+
#### Python
|
|
84
|
+
|
|
85
|
+
```bash
|
|
86
|
+
npx @openapitools/openapi-generator-cli generate \
|
|
87
|
+
-i node_modules/@proxima-nexus/openapi/openapi.yaml \
|
|
88
|
+
-g python \
|
|
89
|
+
-o ./generated-sdk
|
|
90
|
+
```
|
|
91
|
+
|
|
92
|
+
#### Java
|
|
93
|
+
|
|
94
|
+
```bash
|
|
95
|
+
npx @openapitools/openapi-generator-cli generate \
|
|
96
|
+
-i node_modules/@proxima-nexus/openapi/openapi.yaml \
|
|
97
|
+
-g java \
|
|
98
|
+
-o ./generated-sdk
|
|
99
|
+
```
|
|
100
|
+
|
|
101
|
+
#### Go
|
|
102
|
+
|
|
103
|
+
```bash
|
|
104
|
+
npx @openapitools/openapi-generator-cli generate \
|
|
105
|
+
-i node_modules/@proxima-nexus/openapi/openapi.yaml \
|
|
106
|
+
-g go \
|
|
107
|
+
-o ./generated-sdk
|
|
108
|
+
```
|
|
109
|
+
|
|
110
|
+
### Using with Swagger UI
|
|
111
|
+
|
|
112
|
+
```typescript
|
|
113
|
+
import SwaggerUI from 'swagger-ui-react';
|
|
114
|
+
import openapiJson from '@proxima-nexus/openapi/openapi.json';
|
|
115
|
+
|
|
116
|
+
function ApiDocs() {
|
|
117
|
+
return <SwaggerUI spec={openapiJson} />;
|
|
118
|
+
}
|
|
119
|
+
```
|
|
120
|
+
|
|
121
|
+
### Using with Postman
|
|
122
|
+
|
|
123
|
+
1. Import `openapi.json` or `openapi.yaml` into Postman
|
|
124
|
+
2. Postman will automatically generate a collection with all API endpoints
|
|
125
|
+
|
|
126
|
+
### Validating API Requests
|
|
127
|
+
|
|
128
|
+
```typescript
|
|
129
|
+
import Ajv from 'ajv';
|
|
130
|
+
import addFormats from 'ajv-formats';
|
|
131
|
+
import openapiJson from '@proxima-nexus/openapi/openapi.json';
|
|
132
|
+
|
|
133
|
+
const ajv = new Ajv();
|
|
134
|
+
addFormats(ajv);
|
|
135
|
+
|
|
136
|
+
// Validate request body against schema
|
|
137
|
+
const validate = ajv.compile(
|
|
138
|
+
openapiJson.components.schemas.CreateUserDto
|
|
139
|
+
);
|
|
140
|
+
|
|
141
|
+
const isValid = validate(requestBody);
|
|
142
|
+
if (!isValid) {
|
|
143
|
+
console.error(validate.errors);
|
|
144
|
+
}
|
|
145
|
+
```
|
|
146
|
+
|
|
147
|
+
## 📚 API Overview
|
|
148
|
+
|
|
149
|
+
The Proxima Nexus Data Plane API provides RESTful endpoints for managing:
|
|
150
|
+
|
|
151
|
+
### Resources
|
|
152
|
+
|
|
153
|
+
- **Users** (`/user`) - User profile management, search, and connections
|
|
154
|
+
- **Events** (`/event`) - Event creation, updates, and discovery
|
|
155
|
+
- **Groups** (`/group`) - Group management and membership
|
|
156
|
+
|
|
157
|
+
### Key Features
|
|
158
|
+
|
|
159
|
+
- **Geospatial Search** - Location-based queries with radius and bounding box support
|
|
160
|
+
- **Text Search** - Display name search with relevance ranking
|
|
161
|
+
- **Connections** - Relationship management between entities
|
|
162
|
+
- **Multi-tenancy** - Tenant isolation for all operations
|
|
163
|
+
|
|
164
|
+
### Authentication
|
|
165
|
+
|
|
166
|
+
All endpoints require API key authentication via the `X-Proxima-Nexus-Api-Key` header:
|
|
167
|
+
|
|
168
|
+
```http
|
|
169
|
+
GET /user/123 HTTP/1.1
|
|
170
|
+
Host: api.proxima-nexus.com
|
|
171
|
+
X-Proxima-Nexus-Api-Key: your-api-key-here
|
|
172
|
+
```
|
|
173
|
+
|
|
174
|
+
## 🔄 Versioning
|
|
175
|
+
|
|
176
|
+
This package follows [Semantic Versioning](https://semver.org/):
|
|
177
|
+
|
|
178
|
+
- **MAJOR** version increments when breaking changes are introduced to the API
|
|
179
|
+
- **MINOR** version increments when new endpoints or features are added (backward compatible)
|
|
180
|
+
- **PATCH** version increments for bug fixes and non-breaking changes
|
|
181
|
+
|
|
182
|
+
The package version matches the API version. Check the [CHANGELOG](./CHANGELOG.md) for detailed version history.
|
|
183
|
+
|
|
184
|
+
## 🔗 Related Packages
|
|
185
|
+
|
|
186
|
+
- **TypeScript SDK** - Coming soon
|
|
187
|
+
- **Python SDK** - Coming soon
|
|
188
|
+
|
|
189
|
+
## 🤝 Contributing
|
|
190
|
+
|
|
191
|
+
This package is automatically generated from the API implementation. To update the specification:
|
|
192
|
+
|
|
193
|
+
1. Make changes to the API implementation
|
|
194
|
+
2. The OpenAPI specification is automatically regenerated via CI/CD
|
|
195
|
+
3. A new version of this package is published
|
|
196
|
+
|
|
197
|
+
## 🔍 Examples
|
|
198
|
+
|
|
199
|
+
### Example: Generate TypeScript SDK
|
|
200
|
+
|
|
201
|
+
```bash
|
|
202
|
+
# Install the package
|
|
203
|
+
npm install @proxima-nexus/openapi
|
|
204
|
+
|
|
205
|
+
# Generate TypeScript SDK
|
|
206
|
+
npx @openapitools/openapi-generator-cli generate \
|
|
207
|
+
-i node_modules/@proxima-nexus/openapi/openapi.yaml \
|
|
208
|
+
-g typescript-axios \
|
|
209
|
+
-o ./src/generated/api-client \
|
|
210
|
+
--additional-properties=npmName=@my-org/proxima-nexus-client,npmVersion=1.0.0
|
|
211
|
+
|
|
212
|
+
# Use the generated client
|
|
213
|
+
import { Configuration, UsersApi } from './src/generated/api-client';
|
|
214
|
+
|
|
215
|
+
const config = new Configuration({
|
|
216
|
+
apiKey: process.env.PROXIMA_NEXUS_API_KEY,
|
|
217
|
+
basePath: 'https://api.proxima-nexus.com',
|
|
218
|
+
});
|
|
219
|
+
|
|
220
|
+
const usersApi = new UsersApi(config);
|
|
221
|
+
const users = await usersApi.userControllerSearch({
|
|
222
|
+
displayName: 'John',
|
|
223
|
+
limit: 10,
|
|
224
|
+
});
|
|
225
|
+
```
|
|
226
|
+
|
|
227
|
+
### Example: Validate Request Schema
|
|
228
|
+
|
|
229
|
+
```typescript
|
|
230
|
+
import Ajv from 'ajv';
|
|
231
|
+
import addFormats from 'ajv-formats';
|
|
232
|
+
import openapiJson from '@proxima-nexus/openapi/openapi.json';
|
|
233
|
+
|
|
234
|
+
const ajv = new Ajv({ allErrors: true });
|
|
235
|
+
addFormats(ajv);
|
|
236
|
+
|
|
237
|
+
// Get schema for CreateUserDto
|
|
238
|
+
const createUserSchema = openapiJson.components.schemas.CreateUserDto;
|
|
239
|
+
const validate = ajv.compile(createUserSchema);
|
|
240
|
+
|
|
241
|
+
// Validate user input
|
|
242
|
+
const userInput = {
|
|
243
|
+
displayName: 'John Doe',
|
|
244
|
+
email: 'john@example.com',
|
|
245
|
+
location: {
|
|
246
|
+
latitude: 40.7128,
|
|
247
|
+
longitude: -74.0060,
|
|
248
|
+
},
|
|
249
|
+
};
|
|
250
|
+
|
|
251
|
+
if (validate(userInput)) {
|
|
252
|
+
console.log('Valid input');
|
|
253
|
+
} else {
|
|
254
|
+
console.error('Validation errors:', validate.errors);
|
|
255
|
+
}
|
|
256
|
+
```
|
|
257
|
+
|
|
258
|
+
### Example: Use with Redoc
|
|
259
|
+
|
|
260
|
+
```html
|
|
261
|
+
<!DOCTYPE html>
|
|
262
|
+
<html>
|
|
263
|
+
<head>
|
|
264
|
+
<title>Proxima Nexus API Documentation</title>
|
|
265
|
+
<meta charset="utf-8"/>
|
|
266
|
+
<meta name="viewport" content="width=device-width, initial-scale=1">
|
|
267
|
+
<link href="https://fonts.googleapis.com/css?family=Montserrat:300,400,700|Roboto:300,400,700" rel="stylesheet">
|
|
268
|
+
<style>
|
|
269
|
+
body {
|
|
270
|
+
margin: 0;
|
|
271
|
+
padding: 0;
|
|
272
|
+
}
|
|
273
|
+
</style>
|
|
274
|
+
</head>
|
|
275
|
+
<body>
|
|
276
|
+
<redoc spec-url='./node_modules/@proxima-nexus/openapi/openapi.json'></redoc>
|
|
277
|
+
<script src="https://cdn.redoc.ly/redoc/latest/bundles/redoc.standalone.js"></script>
|
|
278
|
+
</body>
|
|
279
|
+
</html>
|
|
280
|
+
```
|
|
281
|
+
|
|
282
|
+
---
|
|
283
|
+
|
|
284
|
+
**Note**: This package contains only the OpenAPI specification. It does not include the API implementation, which remains proprietary.
|