@teamvortexsoftware/vortex-nextjs-15-sdk 0.0.1 → 0.0.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +143 -373
- package/bin/vortex-setup.js +181 -0
- package/dist/config.d.ts +56 -11
- package/dist/config.d.ts.map +1 -1
- package/dist/config.js +81 -20
- package/dist/handlers/invitations.js +98 -84
- package/dist/handlers/jwt.d.ts.map +1 -1
- package/dist/handlers/jwt.js +58 -10
- package/dist/index.d.ts +3 -3
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +8 -1
- package/dist/routes.d.ts +100 -10
- package/dist/routes.d.ts.map +1 -1
- package/dist/routes.js +100 -7
- package/dist/utils.d.ts +5 -5
- package/dist/utils.d.ts.map +1 -1
- package/dist/utils.js +37 -3
- package/package.json +14 -12
package/dist/routes.d.ts
CHANGED
|
@@ -1,18 +1,34 @@
|
|
|
1
1
|
import { NextRequest } from 'next/server';
|
|
2
|
+
/**
|
|
3
|
+
* Expected route paths that match the React provider's API calls
|
|
4
|
+
* This ensures the Next.js routes and React provider stay in sync
|
|
5
|
+
*/
|
|
6
|
+
export declare const VORTEX_ROUTES: {
|
|
7
|
+
readonly JWT: "/jwt";
|
|
8
|
+
readonly INVITATIONS: "/invitations";
|
|
9
|
+
readonly INVITATION: "/invitations/[invitationId]";
|
|
10
|
+
readonly INVITATIONS_ACCEPT: "/invitations/accept";
|
|
11
|
+
readonly INVITATIONS_BY_GROUP: "/invitations/by-group/[groupType]/[groupId]";
|
|
12
|
+
readonly INVITATION_REINVITE: "/invitations/[invitationId]/reinvite";
|
|
13
|
+
};
|
|
14
|
+
/**
|
|
15
|
+
* Utility to create the full API path based on base URL
|
|
16
|
+
*/
|
|
17
|
+
export declare function createVortexApiPath(baseUrl: string, route: keyof typeof VORTEX_ROUTES): string;
|
|
2
18
|
export declare function createVortexJwtRoute(): (request: NextRequest) => Promise<import("next/server").NextResponse<unknown>>;
|
|
3
19
|
export declare function createVortexInvitationsRoute(): {
|
|
4
20
|
GET(request: NextRequest): Promise<import("next/server").NextResponse<unknown>>;
|
|
5
21
|
};
|
|
6
22
|
export declare function createVortexInvitationRoute(): {
|
|
7
23
|
GET(request: NextRequest, { params }: {
|
|
8
|
-
params: {
|
|
24
|
+
params: Promise<{
|
|
9
25
|
invitationId: string;
|
|
10
|
-
}
|
|
26
|
+
}>;
|
|
11
27
|
}): Promise<import("next/server").NextResponse<unknown>>;
|
|
12
28
|
DELETE(request: NextRequest, { params }: {
|
|
13
|
-
params: {
|
|
29
|
+
params: Promise<{
|
|
14
30
|
invitationId: string;
|
|
15
|
-
}
|
|
31
|
+
}>;
|
|
16
32
|
}): Promise<import("next/server").NextResponse<unknown>>;
|
|
17
33
|
};
|
|
18
34
|
export declare function createVortexInvitationsAcceptRoute(): {
|
|
@@ -20,23 +36,97 @@ export declare function createVortexInvitationsAcceptRoute(): {
|
|
|
20
36
|
};
|
|
21
37
|
export declare function createVortexInvitationsByGroupRoute(): {
|
|
22
38
|
GET(request: NextRequest, { params }: {
|
|
23
|
-
params: {
|
|
39
|
+
params: Promise<{
|
|
24
40
|
groupType: string;
|
|
25
41
|
groupId: string;
|
|
26
|
-
}
|
|
42
|
+
}>;
|
|
27
43
|
}): Promise<import("next/server").NextResponse<unknown>>;
|
|
28
44
|
DELETE(request: NextRequest, { params }: {
|
|
29
|
-
params: {
|
|
45
|
+
params: Promise<{
|
|
30
46
|
groupType: string;
|
|
31
47
|
groupId: string;
|
|
32
|
-
}
|
|
48
|
+
}>;
|
|
33
49
|
}): Promise<import("next/server").NextResponse<unknown>>;
|
|
34
50
|
};
|
|
35
51
|
export declare function createVortexReinviteRoute(): {
|
|
36
52
|
POST(request: NextRequest, { params }: {
|
|
37
|
-
params: {
|
|
53
|
+
params: Promise<{
|
|
38
54
|
invitationId: string;
|
|
39
|
-
}
|
|
55
|
+
}>;
|
|
40
56
|
}): Promise<import("next/server").NextResponse<unknown>>;
|
|
41
57
|
};
|
|
58
|
+
/**
|
|
59
|
+
* Creates all Vortex routes with enforced path structure
|
|
60
|
+
* This ensures perfect compatibility with the React provider
|
|
61
|
+
*
|
|
62
|
+
* Usage:
|
|
63
|
+
* ```typescript
|
|
64
|
+
* // In your Next.js app, create these files with the exact structure:
|
|
65
|
+
*
|
|
66
|
+
* // app/api/vortex/jwt/route.ts
|
|
67
|
+
* export const { POST } = createVortexRoutes().jwt;
|
|
68
|
+
*
|
|
69
|
+
* // app/api/vortex/invitations/route.ts
|
|
70
|
+
* export const { GET } = createVortexRoutes().invitations;
|
|
71
|
+
*
|
|
72
|
+
* // app/api/vortex/invitations/[invitationId]/route.ts
|
|
73
|
+
* export const { GET, DELETE } = createVortexRoutes().invitation;
|
|
74
|
+
*
|
|
75
|
+
* // etc...
|
|
76
|
+
* ```
|
|
77
|
+
*/
|
|
78
|
+
export declare function createVortexRoutes(): {
|
|
79
|
+
jwt: (request: NextRequest) => Promise<import("next/server").NextResponse<unknown>>;
|
|
80
|
+
invitations: {
|
|
81
|
+
GET(request: NextRequest): Promise<import("next/server").NextResponse<unknown>>;
|
|
82
|
+
};
|
|
83
|
+
invitation: {
|
|
84
|
+
GET(request: NextRequest, { params }: {
|
|
85
|
+
params: Promise<{
|
|
86
|
+
invitationId: string;
|
|
87
|
+
}>;
|
|
88
|
+
}): Promise<import("next/server").NextResponse<unknown>>;
|
|
89
|
+
DELETE(request: NextRequest, { params }: {
|
|
90
|
+
params: Promise<{
|
|
91
|
+
invitationId: string;
|
|
92
|
+
}>;
|
|
93
|
+
}): Promise<import("next/server").NextResponse<unknown>>;
|
|
94
|
+
};
|
|
95
|
+
invitationsAccept: {
|
|
96
|
+
POST(request: NextRequest): Promise<import("next/server").NextResponse<unknown>>;
|
|
97
|
+
};
|
|
98
|
+
invitationsByGroup: {
|
|
99
|
+
GET(request: NextRequest, { params }: {
|
|
100
|
+
params: Promise<{
|
|
101
|
+
groupType: string;
|
|
102
|
+
groupId: string;
|
|
103
|
+
}>;
|
|
104
|
+
}): Promise<import("next/server").NextResponse<unknown>>;
|
|
105
|
+
DELETE(request: NextRequest, { params }: {
|
|
106
|
+
params: Promise<{
|
|
107
|
+
groupType: string;
|
|
108
|
+
groupId: string;
|
|
109
|
+
}>;
|
|
110
|
+
}): Promise<import("next/server").NextResponse<unknown>>;
|
|
111
|
+
};
|
|
112
|
+
invitationReinvite: {
|
|
113
|
+
POST(request: NextRequest, { params }: {
|
|
114
|
+
params: Promise<{
|
|
115
|
+
invitationId: string;
|
|
116
|
+
}>;
|
|
117
|
+
}): Promise<import("next/server").NextResponse<unknown>>;
|
|
118
|
+
};
|
|
119
|
+
};
|
|
120
|
+
/**
|
|
121
|
+
* File structure guide for Next.js App Router
|
|
122
|
+
* Create these files in your app/api/vortex/ directory:
|
|
123
|
+
*/
|
|
124
|
+
export declare const NEXTJS_FILE_STRUCTURE: {
|
|
125
|
+
readonly 'jwt/route.ts': "/jwt";
|
|
126
|
+
readonly 'invitations/route.ts': "/invitations";
|
|
127
|
+
readonly 'invitations/[invitationId]/route.ts': "/invitations/[invitationId]";
|
|
128
|
+
readonly 'invitations/accept/route.ts': "/invitations/accept";
|
|
129
|
+
readonly 'invitations/by-group/[groupType]/[groupId]/route.ts': "/invitations/by-group/[groupType]/[groupId]";
|
|
130
|
+
readonly 'invitations/[invitationId]/reinvite/route.ts': "/invitations/[invitationId]/reinvite";
|
|
131
|
+
};
|
|
42
132
|
//# sourceMappingURL=routes.d.ts.map
|
package/dist/routes.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"routes.d.ts","sourceRoot":"","sources":["../src/routes.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AAY1C,wBAAgB,oBAAoB,KACP,SAAS,WAAW,0DAGhD;AAED,wBAAgB,4BAA4B;iBAErB,WAAW;EAIjC;AAED,wBAAgB,2BAA2B;iBAEpB,WAAW,cAAc;QAAE,MAAM,EAAE;YAAE,YAAY,EAAE,MAAM,CAAA;SAAE,CAAA;KAAE;
|
|
1
|
+
{"version":3,"file":"routes.d.ts","sourceRoot":"","sources":["../src/routes.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AAY1C;;;GAGG;AACH,eAAO,MAAM,aAAa;;;;;;;CAOhB,CAAC;AAEX;;GAEG;AACH,wBAAgB,mBAAmB,CAAC,OAAO,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,OAAO,aAAa,GAAG,MAAM,CAE9F;AAED,wBAAgB,oBAAoB,KACP,SAAS,WAAW,0DAGhD;AAED,wBAAgB,4BAA4B;iBAErB,WAAW;EAIjC;AAED,wBAAgB,2BAA2B;iBAEpB,WAAW,cAAc;QAAE,MAAM,EAAE,OAAO,CAAC;YAAE,YAAY,EAAE,MAAM,CAAA;SAAE,CAAC,CAAA;KAAE;oBAInE,WAAW,cAAc;QAAE,MAAM,EAAE,OAAO,CAAC;YAAE,YAAY,EAAE,MAAM,CAAA;SAAE,CAAC,CAAA;KAAE;EAK/F;AAED,wBAAgB,kCAAkC;kBAE1B,WAAW;EAIlC;AAED,wBAAgB,mCAAmC;iBAE5B,WAAW,cAAc;QAAE,MAAM,EAAE,OAAO,CAAC;YAAE,SAAS,EAAE,MAAM,CAAC;YAAC,OAAO,EAAE,MAAM,CAAA;SAAE,CAAC,CAAA;KAAE;oBAIjF,WAAW,cAAc;QAAE,MAAM,EAAE,OAAO,CAAC;YAAE,SAAS,EAAE,MAAM,CAAC;YAAC,OAAO,EAAE,MAAM,CAAA;SAAE,CAAC,CAAA;KAAE;EAK7G;AAED,wBAAgB,yBAAyB;kBAEjB,WAAW,cAAc;QAAE,MAAM,EAAE,OAAO,CAAC;YAAE,YAAY,EAAE,MAAM,CAAA;SAAE,CAAC,CAAA;KAAE;EAK7F;AAED;;;;;;;;;;;;;;;;;;;GAmBG;AACH,wBAAgB,kBAAkB;mBA5EI,WAAW;;qBAO1B,WAAW;;;qBAQX,WAAW,cAAc;YAAE,MAAM,EAAE,OAAO,CAAC;gBAAE,YAAY,EAAE,MAAM,CAAA;aAAE,CAAC,CAAA;SAAE;wBAInE,WAAW,cAAc;YAAE,MAAM,EAAE,OAAO,CAAC;gBAAE,YAAY,EAAE,MAAM,CAAA;aAAE,CAAC,CAAA;SAAE;;;sBASxE,WAAW;;;qBAQZ,WAAW,cAAc;YAAE,MAAM,EAAE,OAAO,CAAC;gBAAE,SAAS,EAAE,MAAM,CAAC;gBAAC,OAAO,EAAE,MAAM,CAAA;aAAE,CAAC,CAAA;SAAE;wBAIjF,WAAW,cAAc;YAAE,MAAM,EAAE,OAAO,CAAC;gBAAE,SAAS,EAAE,MAAM,CAAC;gBAAC,OAAO,EAAE,MAAM,CAAA;aAAE,CAAC,CAAA;SAAE;;;sBAStF,WAAW,cAAc;YAAE,MAAM,EAAE,OAAO,CAAC;gBAAE,YAAY,EAAE,MAAM,CAAA;aAAE,CAAC,CAAA;SAAE;;EAoC7F;AAED;;;GAGG;AACH,eAAO,MAAM,qBAAqB;;;;;;;CAOxB,CAAC"}
|
package/dist/routes.js
CHANGED
|
@@ -36,14 +36,35 @@ var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
|
36
36
|
}
|
|
37
37
|
};
|
|
38
38
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
39
|
+
exports.NEXTJS_FILE_STRUCTURE = exports.VORTEX_ROUTES = void 0;
|
|
40
|
+
exports.createVortexApiPath = createVortexApiPath;
|
|
39
41
|
exports.createVortexJwtRoute = createVortexJwtRoute;
|
|
40
42
|
exports.createVortexInvitationsRoute = createVortexInvitationsRoute;
|
|
41
43
|
exports.createVortexInvitationRoute = createVortexInvitationRoute;
|
|
42
44
|
exports.createVortexInvitationsAcceptRoute = createVortexInvitationsAcceptRoute;
|
|
43
45
|
exports.createVortexInvitationsByGroupRoute = createVortexInvitationsByGroupRoute;
|
|
44
46
|
exports.createVortexReinviteRoute = createVortexReinviteRoute;
|
|
47
|
+
exports.createVortexRoutes = createVortexRoutes;
|
|
45
48
|
var jwt_1 = require("./handlers/jwt");
|
|
46
49
|
var invitations_1 = require("./handlers/invitations");
|
|
50
|
+
/**
|
|
51
|
+
* Expected route paths that match the React provider's API calls
|
|
52
|
+
* This ensures the Next.js routes and React provider stay in sync
|
|
53
|
+
*/
|
|
54
|
+
exports.VORTEX_ROUTES = {
|
|
55
|
+
JWT: '/jwt',
|
|
56
|
+
INVITATIONS: '/invitations',
|
|
57
|
+
INVITATION: '/invitations/[invitationId]',
|
|
58
|
+
INVITATIONS_ACCEPT: '/invitations/accept',
|
|
59
|
+
INVITATIONS_BY_GROUP: '/invitations/by-group/[groupType]/[groupId]',
|
|
60
|
+
INVITATION_REINVITE: '/invitations/[invitationId]/reinvite',
|
|
61
|
+
};
|
|
62
|
+
/**
|
|
63
|
+
* Utility to create the full API path based on base URL
|
|
64
|
+
*/
|
|
65
|
+
function createVortexApiPath(baseUrl, route) {
|
|
66
|
+
return "".concat(baseUrl.replace(/\/$/, '')).concat(exports.VORTEX_ROUTES[route]);
|
|
67
|
+
}
|
|
47
68
|
function createVortexJwtRoute() {
|
|
48
69
|
return function POST(request) {
|
|
49
70
|
return __awaiter(this, void 0, void 0, function () {
|
|
@@ -68,17 +89,29 @@ function createVortexInvitationRoute() {
|
|
|
68
89
|
return {
|
|
69
90
|
GET: function (request_1, _a) {
|
|
70
91
|
return __awaiter(this, arguments, void 0, function (request, _b) {
|
|
92
|
+
var invitationId;
|
|
71
93
|
var params = _b.params;
|
|
72
94
|
return __generator(this, function (_c) {
|
|
73
|
-
|
|
95
|
+
switch (_c.label) {
|
|
96
|
+
case 0: return [4 /*yield*/, params];
|
|
97
|
+
case 1:
|
|
98
|
+
invitationId = (_c.sent()).invitationId;
|
|
99
|
+
return [2 /*return*/, (0, invitations_1.handleGetInvitation)(request, invitationId)];
|
|
100
|
+
}
|
|
74
101
|
});
|
|
75
102
|
});
|
|
76
103
|
},
|
|
77
104
|
DELETE: function (request_1, _a) {
|
|
78
105
|
return __awaiter(this, arguments, void 0, function (request, _b) {
|
|
106
|
+
var invitationId;
|
|
79
107
|
var params = _b.params;
|
|
80
108
|
return __generator(this, function (_c) {
|
|
81
|
-
|
|
109
|
+
switch (_c.label) {
|
|
110
|
+
case 0: return [4 /*yield*/, params];
|
|
111
|
+
case 1:
|
|
112
|
+
invitationId = (_c.sent()).invitationId;
|
|
113
|
+
return [2 /*return*/, (0, invitations_1.handleRevokeInvitation)(request, invitationId)];
|
|
114
|
+
}
|
|
82
115
|
});
|
|
83
116
|
});
|
|
84
117
|
},
|
|
@@ -99,17 +132,29 @@ function createVortexInvitationsByGroupRoute() {
|
|
|
99
132
|
return {
|
|
100
133
|
GET: function (request_1, _a) {
|
|
101
134
|
return __awaiter(this, arguments, void 0, function (request, _b) {
|
|
135
|
+
var _c, groupType, groupId;
|
|
102
136
|
var params = _b.params;
|
|
103
|
-
return __generator(this, function (
|
|
104
|
-
|
|
137
|
+
return __generator(this, function (_d) {
|
|
138
|
+
switch (_d.label) {
|
|
139
|
+
case 0: return [4 /*yield*/, params];
|
|
140
|
+
case 1:
|
|
141
|
+
_c = _d.sent(), groupType = _c.groupType, groupId = _c.groupId;
|
|
142
|
+
return [2 /*return*/, (0, invitations_1.handleGetInvitationsByGroup)(request, groupType, groupId)];
|
|
143
|
+
}
|
|
105
144
|
});
|
|
106
145
|
});
|
|
107
146
|
},
|
|
108
147
|
DELETE: function (request_1, _a) {
|
|
109
148
|
return __awaiter(this, arguments, void 0, function (request, _b) {
|
|
149
|
+
var _c, groupType, groupId;
|
|
110
150
|
var params = _b.params;
|
|
111
|
-
return __generator(this, function (
|
|
112
|
-
|
|
151
|
+
return __generator(this, function (_d) {
|
|
152
|
+
switch (_d.label) {
|
|
153
|
+
case 0: return [4 /*yield*/, params];
|
|
154
|
+
case 1:
|
|
155
|
+
_c = _d.sent(), groupType = _c.groupType, groupId = _c.groupId;
|
|
156
|
+
return [2 /*return*/, (0, invitations_1.handleDeleteInvitationsByGroup)(request, groupType, groupId)];
|
|
157
|
+
}
|
|
113
158
|
});
|
|
114
159
|
});
|
|
115
160
|
},
|
|
@@ -119,11 +164,59 @@ function createVortexReinviteRoute() {
|
|
|
119
164
|
return {
|
|
120
165
|
POST: function (request_1, _a) {
|
|
121
166
|
return __awaiter(this, arguments, void 0, function (request, _b) {
|
|
167
|
+
var invitationId;
|
|
122
168
|
var params = _b.params;
|
|
123
169
|
return __generator(this, function (_c) {
|
|
124
|
-
|
|
170
|
+
switch (_c.label) {
|
|
171
|
+
case 0: return [4 /*yield*/, params];
|
|
172
|
+
case 1:
|
|
173
|
+
invitationId = (_c.sent()).invitationId;
|
|
174
|
+
return [2 /*return*/, (0, invitations_1.handleReinvite)(request, invitationId)];
|
|
175
|
+
}
|
|
125
176
|
});
|
|
126
177
|
});
|
|
127
178
|
},
|
|
128
179
|
};
|
|
129
180
|
}
|
|
181
|
+
/**
|
|
182
|
+
* Creates all Vortex routes with enforced path structure
|
|
183
|
+
* This ensures perfect compatibility with the React provider
|
|
184
|
+
*
|
|
185
|
+
* Usage:
|
|
186
|
+
* ```typescript
|
|
187
|
+
* // In your Next.js app, create these files with the exact structure:
|
|
188
|
+
*
|
|
189
|
+
* // app/api/vortex/jwt/route.ts
|
|
190
|
+
* export const { POST } = createVortexRoutes().jwt;
|
|
191
|
+
*
|
|
192
|
+
* // app/api/vortex/invitations/route.ts
|
|
193
|
+
* export const { GET } = createVortexRoutes().invitations;
|
|
194
|
+
*
|
|
195
|
+
* // app/api/vortex/invitations/[invitationId]/route.ts
|
|
196
|
+
* export const { GET, DELETE } = createVortexRoutes().invitation;
|
|
197
|
+
*
|
|
198
|
+
* // etc...
|
|
199
|
+
* ```
|
|
200
|
+
*/
|
|
201
|
+
function createVortexRoutes() {
|
|
202
|
+
return {
|
|
203
|
+
jwt: createVortexJwtRoute(),
|
|
204
|
+
invitations: createVortexInvitationsRoute(),
|
|
205
|
+
invitation: createVortexInvitationRoute(),
|
|
206
|
+
invitationsAccept: createVortexInvitationsAcceptRoute(),
|
|
207
|
+
invitationsByGroup: createVortexInvitationsByGroupRoute(),
|
|
208
|
+
invitationReinvite: createVortexReinviteRoute(),
|
|
209
|
+
};
|
|
210
|
+
}
|
|
211
|
+
/**
|
|
212
|
+
* File structure guide for Next.js App Router
|
|
213
|
+
* Create these files in your app/api/vortex/ directory:
|
|
214
|
+
*/
|
|
215
|
+
exports.NEXTJS_FILE_STRUCTURE = {
|
|
216
|
+
'jwt/route.ts': exports.VORTEX_ROUTES.JWT,
|
|
217
|
+
'invitations/route.ts': exports.VORTEX_ROUTES.INVITATIONS,
|
|
218
|
+
'invitations/[invitationId]/route.ts': exports.VORTEX_ROUTES.INVITATION,
|
|
219
|
+
'invitations/accept/route.ts': exports.VORTEX_ROUTES.INVITATIONS_ACCEPT,
|
|
220
|
+
'invitations/by-group/[groupType]/[groupId]/route.ts': exports.VORTEX_ROUTES.INVITATIONS_BY_GROUP,
|
|
221
|
+
'invitations/[invitationId]/reinvite/route.ts': exports.VORTEX_ROUTES.INVITATION_REINVITE,
|
|
222
|
+
};
|
package/dist/utils.d.ts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import
|
|
2
|
-
export declare function createApiResponse(data: any, status?: number): NextResponse;
|
|
3
|
-
export declare function createErrorResponse(message: string, status?: number): NextResponse;
|
|
4
|
-
export declare function parseRequestBody(request: NextRequest): Promise<any>;
|
|
5
|
-
export declare function getQueryParam(request: NextRequest, param: string): string | null;
|
|
1
|
+
import * as NextServer from 'next/server';
|
|
2
|
+
export declare function createApiResponse(data: any, status?: number): NextServer.NextResponse;
|
|
3
|
+
export declare function createErrorResponse(message: string, status?: number): NextServer.NextResponse;
|
|
4
|
+
export declare function parseRequestBody(request: NextServer.NextRequest): Promise<any>;
|
|
5
|
+
export declare function getQueryParam(request: NextServer.NextRequest, param: string): string | null;
|
|
6
6
|
export declare function validateRequiredFields(data: any, fields: string[]): void;
|
|
7
7
|
export declare function sanitizeInput(input: string | null): string | null;
|
|
8
8
|
//# sourceMappingURL=utils.d.ts.map
|
package/dist/utils.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../src/utils.ts"],"names":[],"mappings":"AAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../src/utils.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,UAAU,MAAM,aAAa,CAAC;AAI1C,wBAAgB,iBAAiB,CAAC,IAAI,EAAE,GAAG,EAAE,MAAM,GAAE,MAAY,GAAG,UAAU,CAAC,YAAY,CAE1F;AAED,wBAAgB,mBAAmB,CAAC,OAAO,EAAE,MAAM,EAAE,MAAM,GAAE,MAAY,GAAG,UAAU,CAAC,YAAY,CAElG;AAED,wBAAsB,gBAAgB,CAAC,OAAO,EAAE,UAAU,CAAC,WAAW,GAAG,OAAO,CAAC,GAAG,CAAC,CAMpF;AAED,wBAAgB,aAAa,CAAC,OAAO,EAAE,UAAU,CAAC,WAAW,EAAE,KAAK,EAAE,MAAM,GAAG,MAAM,GAAG,IAAI,CAE3F;AAED,wBAAgB,sBAAsB,CAAC,IAAI,EAAE,GAAG,EAAE,MAAM,EAAE,MAAM,EAAE,GAAG,IAAI,CAKxE;AAED,wBAAgB,aAAa,CAAC,KAAK,EAAE,MAAM,GAAG,IAAI,GAAG,MAAM,GAAG,IAAI,CAQjE"}
|
package/dist/utils.js
CHANGED
|
@@ -1,4 +1,37 @@
|
|
|
1
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 __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
+
}) : function(o, v) {
|
|
16
|
+
o["default"] = v;
|
|
17
|
+
});
|
|
18
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
19
|
+
var ownKeys = function(o) {
|
|
20
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
21
|
+
var ar = [];
|
|
22
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
23
|
+
return ar;
|
|
24
|
+
};
|
|
25
|
+
return ownKeys(o);
|
|
26
|
+
};
|
|
27
|
+
return function (mod) {
|
|
28
|
+
if (mod && mod.__esModule) return mod;
|
|
29
|
+
var result = {};
|
|
30
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
31
|
+
__setModuleDefault(result, mod);
|
|
32
|
+
return result;
|
|
33
|
+
};
|
|
34
|
+
})();
|
|
2
35
|
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
3
36
|
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
4
37
|
return new (P || (P = Promise))(function (resolve, reject) {
|
|
@@ -42,14 +75,15 @@ exports.parseRequestBody = parseRequestBody;
|
|
|
42
75
|
exports.getQueryParam = getQueryParam;
|
|
43
76
|
exports.validateRequiredFields = validateRequiredFields;
|
|
44
77
|
exports.sanitizeInput = sanitizeInput;
|
|
45
|
-
var
|
|
78
|
+
var NextServer = __importStar(require("next/server"));
|
|
79
|
+
var NextResponse = NextServer.NextResponse;
|
|
46
80
|
function createApiResponse(data, status) {
|
|
47
81
|
if (status === void 0) { status = 200; }
|
|
48
|
-
return
|
|
82
|
+
return NextResponse.json(data, { status: status });
|
|
49
83
|
}
|
|
50
84
|
function createErrorResponse(message, status) {
|
|
51
85
|
if (status === void 0) { status = 400; }
|
|
52
|
-
return
|
|
86
|
+
return NextResponse.json({ error: message }, { status: status });
|
|
53
87
|
}
|
|
54
88
|
function parseRequestBody(request) {
|
|
55
89
|
return __awaiter(this, void 0, void 0, function () {
|
package/package.json
CHANGED
|
@@ -2,25 +2,29 @@
|
|
|
2
2
|
"name": "@teamvortexsoftware/vortex-nextjs-15-sdk",
|
|
3
3
|
"description": "Drop-in Next.js module for Vortex API integration",
|
|
4
4
|
"author": "@teamvortexsoftware",
|
|
5
|
-
"version": "0.0.
|
|
6
|
-
"main": "./dist/
|
|
7
|
-
"
|
|
8
|
-
"
|
|
5
|
+
"version": "0.0.3",
|
|
6
|
+
"main": "./dist/index.js",
|
|
7
|
+
"types": "./dist/index.d.ts",
|
|
8
|
+
"bin": {
|
|
9
|
+
"vortex-setup": "./bin/vortex-setup.js"
|
|
10
|
+
},
|
|
9
11
|
"exports": {
|
|
10
12
|
".": {
|
|
11
|
-
"
|
|
12
|
-
"
|
|
13
|
+
"types": "./dist/index.d.ts",
|
|
14
|
+
"import": "./dist/index.js",
|
|
15
|
+
"require": "./dist/index.js"
|
|
13
16
|
}
|
|
14
17
|
},
|
|
15
18
|
"files": [
|
|
16
|
-
"dist/"
|
|
19
|
+
"dist/",
|
|
20
|
+
"bin/"
|
|
17
21
|
],
|
|
18
22
|
"scripts": {
|
|
19
23
|
"build:stg": "pnpm run distclean && pnpm run build && mkdir -p dist.d/stg && mv dist dist.d/stg && echo && echo 'Build in ./dist.d/stg'",
|
|
20
|
-
"prepublish:stg": "cp ./LICENSE ./README.md ./dist.d/stg/ && jq '.name = \"@teamvortexsoftware/vortex-nextjs-15-sdk-stg\" | .description = \"Vortex NextJS 15 SDK (STG)\" | del(.scripts.prepack)' ./package.json > ./dist.d/stg/package.json",
|
|
24
|
+
"prepublish:stg": "cp ./LICENSE ./README.md ./dist.d/stg/ && cp -r ./bin ./dist.d/stg/ && jq '.name = \"@teamvortexsoftware/vortex-nextjs-15-sdk-stg\" | .description = \"Vortex NextJS 15 SDK (STG)\" | del(.devDependencies.\"@teamvortexsoftware/eslint-config\") | del(.devDependencies.\"@teamvortexsoftware/typescript-config\") | .dependencies.\"@teamvortexsoftware/vortex-node-22-sdk\" = \"^0.0.3\" | del(.scripts.prepack)' ./package.json > ./dist.d/stg/package.json",
|
|
21
25
|
"publish:stg": "pnpm run prepublish:stg && npm publish --userconfig ../../.npmrc --access restricted ./dist.d/stg",
|
|
22
26
|
"build:prod": "pnpm run distclean && pnpm run build && mkdir -p dist.d/prod && mv dist dist.d/prod && echo && echo 'Build in ./dist.d/prod'",
|
|
23
|
-
"prepublish:prod": "cp ./LICENSE ./README.md ./dist.d/prod/ && jq 'del(.scripts.prepack)' ./package.json > ./dist.d/prod/package.json",
|
|
27
|
+
"prepublish:prod": "cp ./LICENSE ./README.md ./dist.d/prod/ && cp -r ./bin ./dist.d/prod/ && jq 'del(.devDependencies.\"@teamvortexsoftware/eslint-config\") | del(.devDependencies.\"@teamvortexsoftware/typescript-config\") | .dependencies.\"@teamvortexsoftware/vortex-node-22-sdk\" = \"^0.0.3\" | del(.scripts.prepack)' ./package.json > ./dist.d/prod/package.json",
|
|
24
28
|
"publish:prod": "pnpm run prepublish:prod && npm publish --userconfig ../../.npmrc --access public ./dist.d/prod",
|
|
25
29
|
"check-types": "tsc --noEmit",
|
|
26
30
|
"distclean": "rm -rf ./dist ./dist.d",
|
|
@@ -45,8 +49,6 @@
|
|
|
45
49
|
"devDependencies": {
|
|
46
50
|
"@eslint/js": "^9.24.0",
|
|
47
51
|
"@jest/globals": "29.7.0",
|
|
48
|
-
"@teamvortexsoftware/eslint-config": "workspace:*",
|
|
49
|
-
"@teamvortexsoftware/typescript-config": "workspace:*",
|
|
50
52
|
"eslint": "^9.24.0",
|
|
51
53
|
"jest": "29.7.0",
|
|
52
54
|
"typescript-eslint": "^8.30.1",
|
|
@@ -55,7 +57,7 @@
|
|
|
55
57
|
"typescript": "^5.0.0"
|
|
56
58
|
},
|
|
57
59
|
"dependencies": {
|
|
58
|
-
"@teamvortexsoftware/vortex-node-22-sdk": "
|
|
60
|
+
"@teamvortexsoftware/vortex-node-22-sdk": "^0.0.3"
|
|
59
61
|
},
|
|
60
62
|
"peerDependencies": {
|
|
61
63
|
"next": ">=13.0.0"
|