@scalemule/nextjs 0.0.1 → 0.0.2
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/dist/client.d.mts +8 -8
- package/dist/client.d.ts +8 -8
- package/dist/client.js +65 -59
- package/dist/client.mjs +65 -59
- package/dist/{index-BkacIKdu.d.mts → index-9v0SaLgg.d.mts} +8 -1
- package/dist/{index-BkacIKdu.d.ts → index-9v0SaLgg.d.ts} +8 -1
- package/dist/index.d.mts +2 -2
- package/dist/index.d.ts +2 -2
- package/dist/index.js +455 -514
- package/dist/index.mjs +455 -515
- package/dist/server/auth.js +116 -78
- package/dist/server/auth.mjs +116 -78
- package/dist/server/index.d.mts +14 -11
- package/dist/server/index.d.ts +14 -11
- package/dist/server/index.js +209 -175
- package/dist/server/index.mjs +209 -175
- package/dist/server/webhook-handler.d.mts +2 -2
- package/dist/server/webhook-handler.d.ts +2 -2
- package/dist/testing.d.mts +10 -10
- package/dist/testing.d.ts +10 -10
- package/dist/testing.js +13 -7
- package/dist/testing.mjs +13 -7
- package/dist/{webhook-handler-BPNqhuwL.d.ts → webhook-handler-DCSwldKC.d.mts} +66 -66
- package/dist/{webhook-handler-C-5_Ey1T.d.mts → webhook-handler-Ymeice_x.d.ts} +66 -66
- package/package.json +1 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { R as RegisterRequest,
|
|
1
|
+
import { R as RegisterRequest, U as User, l as LoginRequest, L as LoginResponse, c as ListFilesParams, T as ListFilesResponse, N as StorageFile, $ as ClientContext, W as UploadResponse } from './index-9v0SaLgg.js';
|
|
2
2
|
|
|
3
3
|
/**
|
|
4
4
|
* Server-Side ScaleMule Client
|
|
@@ -39,53 +39,53 @@ declare class ScaleMuleServer {
|
|
|
39
39
|
/**
|
|
40
40
|
* Register a new user
|
|
41
41
|
*/
|
|
42
|
-
register: (data: RegisterRequest) => Promise<
|
|
42
|
+
register: (data: RegisterRequest) => Promise<User>;
|
|
43
43
|
/**
|
|
44
44
|
* Login user - returns session token (store in HTTP-only cookie)
|
|
45
45
|
*/
|
|
46
|
-
login: (data: LoginRequest) => Promise<
|
|
46
|
+
login: (data: LoginRequest) => Promise<LoginResponse>;
|
|
47
47
|
/**
|
|
48
48
|
* Logout user
|
|
49
49
|
*/
|
|
50
|
-
logout: (sessionToken: string) => Promise<
|
|
50
|
+
logout: (sessionToken: string) => Promise<void>;
|
|
51
51
|
/**
|
|
52
52
|
* Get current user from session token
|
|
53
53
|
*/
|
|
54
|
-
me: (sessionToken: string) => Promise<
|
|
54
|
+
me: (sessionToken: string) => Promise<User>;
|
|
55
55
|
/**
|
|
56
56
|
* Refresh session token
|
|
57
57
|
*/
|
|
58
|
-
refresh: (sessionToken: string) => Promise<
|
|
58
|
+
refresh: (sessionToken: string) => Promise<{
|
|
59
59
|
session_token: string;
|
|
60
60
|
expires_at: string;
|
|
61
|
-
}
|
|
61
|
+
}>;
|
|
62
62
|
/**
|
|
63
63
|
* Request password reset email
|
|
64
64
|
*/
|
|
65
|
-
forgotPassword: (email: string) => Promise<
|
|
65
|
+
forgotPassword: (email: string) => Promise<{
|
|
66
66
|
message: string;
|
|
67
|
-
}
|
|
67
|
+
}>;
|
|
68
68
|
/**
|
|
69
69
|
* Reset password with token
|
|
70
70
|
*/
|
|
71
|
-
resetPassword: (token: string, newPassword: string) => Promise<
|
|
71
|
+
resetPassword: (token: string, newPassword: string) => Promise<{
|
|
72
72
|
message: string;
|
|
73
|
-
}
|
|
73
|
+
}>;
|
|
74
74
|
/**
|
|
75
75
|
* Verify email with token
|
|
76
76
|
*/
|
|
77
|
-
verifyEmail: (token: string) => Promise<
|
|
77
|
+
verifyEmail: (token: string) => Promise<{
|
|
78
78
|
message: string;
|
|
79
|
-
}
|
|
79
|
+
}>;
|
|
80
80
|
/**
|
|
81
81
|
* Resend verification email.
|
|
82
82
|
* Can be called with a session token (authenticated) or email (unauthenticated).
|
|
83
83
|
*/
|
|
84
84
|
resendVerification: (sessionTokenOrEmail: string, options?: {
|
|
85
85
|
email?: string;
|
|
86
|
-
}) => Promise<
|
|
86
|
+
}) => Promise<{
|
|
87
87
|
message: string;
|
|
88
|
-
}
|
|
88
|
+
}>;
|
|
89
89
|
};
|
|
90
90
|
user: {
|
|
91
91
|
/**
|
|
@@ -94,25 +94,25 @@ declare class ScaleMuleServer {
|
|
|
94
94
|
update: (sessionToken: string, data: {
|
|
95
95
|
full_name?: string;
|
|
96
96
|
avatar_url?: string;
|
|
97
|
-
}) => Promise<
|
|
97
|
+
}) => Promise<User>;
|
|
98
98
|
/**
|
|
99
99
|
* Change password
|
|
100
100
|
*/
|
|
101
|
-
changePassword: (sessionToken: string, currentPassword: string, newPassword: string) => Promise<
|
|
101
|
+
changePassword: (sessionToken: string, currentPassword: string, newPassword: string) => Promise<{
|
|
102
102
|
message: string;
|
|
103
|
-
}
|
|
103
|
+
}>;
|
|
104
104
|
/**
|
|
105
105
|
* Change email
|
|
106
106
|
*/
|
|
107
|
-
changeEmail: (sessionToken: string, newEmail: string, password: string) => Promise<
|
|
107
|
+
changeEmail: (sessionToken: string, newEmail: string, password: string) => Promise<{
|
|
108
108
|
message: string;
|
|
109
|
-
}
|
|
109
|
+
}>;
|
|
110
110
|
/**
|
|
111
111
|
* Delete account
|
|
112
112
|
*/
|
|
113
|
-
deleteAccount: (sessionToken: string, password: string) => Promise<
|
|
113
|
+
deleteAccount: (sessionToken: string, password: string) => Promise<{
|
|
114
114
|
message: string;
|
|
115
|
-
}
|
|
115
|
+
}>;
|
|
116
116
|
};
|
|
117
117
|
secrets: {
|
|
118
118
|
/**
|
|
@@ -126,10 +126,10 @@ declare class ScaleMuleServer {
|
|
|
126
126
|
* }
|
|
127
127
|
* ```
|
|
128
128
|
*/
|
|
129
|
-
get: (key: string) => Promise<
|
|
129
|
+
get: (key: string) => Promise<{
|
|
130
130
|
value: string;
|
|
131
131
|
version: number;
|
|
132
|
-
}
|
|
132
|
+
}>;
|
|
133
133
|
/**
|
|
134
134
|
* Set a secret in the tenant vault
|
|
135
135
|
*
|
|
@@ -138,46 +138,46 @@ declare class ScaleMuleServer {
|
|
|
138
138
|
* await scalemule.secrets.set('ANONYMOUS_USER_SALT', 'my-secret-salt')
|
|
139
139
|
* ```
|
|
140
140
|
*/
|
|
141
|
-
set: (key: string, value: string) => Promise<
|
|
141
|
+
set: (key: string, value: string) => Promise<{
|
|
142
142
|
value: string;
|
|
143
143
|
version: number;
|
|
144
|
-
}
|
|
144
|
+
}>;
|
|
145
145
|
/**
|
|
146
146
|
* Delete a secret from the tenant vault
|
|
147
147
|
*/
|
|
148
|
-
delete: (key: string) => Promise<
|
|
148
|
+
delete: (key: string) => Promise<void>;
|
|
149
149
|
/**
|
|
150
150
|
* List all secrets in the tenant vault
|
|
151
151
|
*/
|
|
152
|
-
list: () => Promise<
|
|
152
|
+
list: () => Promise<{
|
|
153
153
|
secrets: Array<{
|
|
154
154
|
path: string;
|
|
155
155
|
version: number;
|
|
156
156
|
}>;
|
|
157
|
-
}
|
|
157
|
+
}>;
|
|
158
158
|
/**
|
|
159
159
|
* Get secret version history
|
|
160
160
|
*/
|
|
161
|
-
versions: (key: string) => Promise<
|
|
161
|
+
versions: (key: string) => Promise<{
|
|
162
162
|
versions: Array<{
|
|
163
163
|
version: number;
|
|
164
164
|
created_at: string;
|
|
165
165
|
}>;
|
|
166
|
-
}
|
|
166
|
+
}>;
|
|
167
167
|
/**
|
|
168
168
|
* Rollback to a specific version
|
|
169
169
|
*/
|
|
170
|
-
rollback: (key: string, version: number) => Promise<
|
|
170
|
+
rollback: (key: string, version: number) => Promise<{
|
|
171
171
|
value: string;
|
|
172
172
|
version: number;
|
|
173
|
-
}
|
|
173
|
+
}>;
|
|
174
174
|
/**
|
|
175
175
|
* Rotate a secret (copy current version as new version)
|
|
176
176
|
*/
|
|
177
|
-
rotate: (key: string, newValue: string) => Promise<
|
|
177
|
+
rotate: (key: string, newValue: string) => Promise<{
|
|
178
178
|
value: string;
|
|
179
179
|
version: number;
|
|
180
|
-
}
|
|
180
|
+
}>;
|
|
181
181
|
};
|
|
182
182
|
bundles: {
|
|
183
183
|
/**
|
|
@@ -194,12 +194,12 @@ declare class ScaleMuleServer {
|
|
|
194
194
|
* }
|
|
195
195
|
* ```
|
|
196
196
|
*/
|
|
197
|
-
get: <T = Record<string, unknown>>(key: string, resolve?: boolean) => Promise<
|
|
197
|
+
get: <T = Record<string, unknown>>(key: string, resolve?: boolean) => Promise<{
|
|
198
198
|
type: string;
|
|
199
199
|
data: T;
|
|
200
200
|
version: number;
|
|
201
201
|
inherits_from?: string;
|
|
202
|
-
}
|
|
202
|
+
}>;
|
|
203
203
|
/**
|
|
204
204
|
* Set a bundle (structured secret)
|
|
205
205
|
*
|
|
@@ -225,26 +225,26 @@ declare class ScaleMuleServer {
|
|
|
225
225
|
* }, 'database/prod')
|
|
226
226
|
* ```
|
|
227
227
|
*/
|
|
228
|
-
set: <T = Record<string, unknown>>(key: string, type: string, data: T, inheritsFrom?: string) => Promise<
|
|
228
|
+
set: <T = Record<string, unknown>>(key: string, type: string, data: T, inheritsFrom?: string) => Promise<{
|
|
229
229
|
type: string;
|
|
230
230
|
data: T;
|
|
231
231
|
version: number;
|
|
232
|
-
}
|
|
232
|
+
}>;
|
|
233
233
|
/**
|
|
234
234
|
* Delete a bundle
|
|
235
235
|
*/
|
|
236
|
-
delete: (key: string) => Promise<
|
|
236
|
+
delete: (key: string) => Promise<void>;
|
|
237
237
|
/**
|
|
238
238
|
* List all bundles
|
|
239
239
|
*/
|
|
240
|
-
list: () => Promise<
|
|
240
|
+
list: () => Promise<{
|
|
241
241
|
bundles: Array<{
|
|
242
242
|
path: string;
|
|
243
243
|
type: string;
|
|
244
244
|
version: number;
|
|
245
245
|
inherits_from?: string;
|
|
246
246
|
}>;
|
|
247
|
-
}
|
|
247
|
+
}>;
|
|
248
248
|
/**
|
|
249
249
|
* Get connection URL for a database bundle
|
|
250
250
|
*
|
|
@@ -256,9 +256,9 @@ declare class ScaleMuleServer {
|
|
|
256
256
|
* }
|
|
257
257
|
* ```
|
|
258
258
|
*/
|
|
259
|
-
connectionUrl: (key: string) => Promise<
|
|
259
|
+
connectionUrl: (key: string) => Promise<{
|
|
260
260
|
url: string;
|
|
261
|
-
}
|
|
261
|
+
}>;
|
|
262
262
|
};
|
|
263
263
|
vaultAudit: {
|
|
264
264
|
/**
|
|
@@ -279,7 +279,7 @@ declare class ScaleMuleServer {
|
|
|
279
279
|
since?: string;
|
|
280
280
|
until?: string;
|
|
281
281
|
limit?: number;
|
|
282
|
-
}) => Promise<
|
|
282
|
+
}) => Promise<{
|
|
283
283
|
logs: Array<{
|
|
284
284
|
timestamp: string;
|
|
285
285
|
action: string;
|
|
@@ -287,21 +287,21 @@ declare class ScaleMuleServer {
|
|
|
287
287
|
success: boolean;
|
|
288
288
|
error_message?: string;
|
|
289
289
|
}>;
|
|
290
|
-
}
|
|
290
|
+
}>;
|
|
291
291
|
};
|
|
292
292
|
storage: {
|
|
293
293
|
/**
|
|
294
294
|
* List user's files
|
|
295
295
|
*/
|
|
296
|
-
list: (userId: string, params?: ListFilesParams) => Promise<
|
|
296
|
+
list: (userId: string, params?: ListFilesParams) => Promise<ListFilesResponse>;
|
|
297
297
|
/**
|
|
298
298
|
* Get file info
|
|
299
299
|
*/
|
|
300
|
-
get: (fileId: string) => Promise<
|
|
300
|
+
get: (fileId: string) => Promise<StorageFile>;
|
|
301
301
|
/**
|
|
302
302
|
* Delete file
|
|
303
303
|
*/
|
|
304
|
-
delete: (userId: string, fileId: string) => Promise<
|
|
304
|
+
delete: (userId: string, fileId: string) => Promise<void>;
|
|
305
305
|
/**
|
|
306
306
|
* Upload file (from server - use FormData)
|
|
307
307
|
*
|
|
@@ -326,7 +326,7 @@ declare class ScaleMuleServer {
|
|
|
326
326
|
contentType: string;
|
|
327
327
|
}, options?: {
|
|
328
328
|
clientContext?: ClientContext;
|
|
329
|
-
}) => Promise<
|
|
329
|
+
}) => Promise<UploadResponse>;
|
|
330
330
|
};
|
|
331
331
|
webhooks: {
|
|
332
332
|
/**
|
|
@@ -341,23 +341,23 @@ declare class ScaleMuleServer {
|
|
|
341
341
|
* })
|
|
342
342
|
*
|
|
343
343
|
* // Store the secret for signature verification
|
|
344
|
-
* console.log('Webhook secret:', result.
|
|
344
|
+
* console.log('Webhook secret:', result.secret)
|
|
345
345
|
* ```
|
|
346
346
|
*/
|
|
347
347
|
create: (data: {
|
|
348
348
|
webhook_name: string;
|
|
349
349
|
url: string;
|
|
350
350
|
events: string[];
|
|
351
|
-
}) => Promise<
|
|
351
|
+
}) => Promise<{
|
|
352
352
|
id: string;
|
|
353
353
|
secret: string;
|
|
354
354
|
url: string;
|
|
355
355
|
events: string[];
|
|
356
|
-
}
|
|
356
|
+
}>;
|
|
357
357
|
/**
|
|
358
358
|
* List all webhook subscriptions
|
|
359
359
|
*/
|
|
360
|
-
list: () => Promise<
|
|
360
|
+
list: () => Promise<{
|
|
361
361
|
webhooks: Array<{
|
|
362
362
|
id: string;
|
|
363
363
|
webhook_name: string;
|
|
@@ -365,11 +365,11 @@ declare class ScaleMuleServer {
|
|
|
365
365
|
events: string[];
|
|
366
366
|
is_enabled: boolean;
|
|
367
367
|
}>;
|
|
368
|
-
}
|
|
368
|
+
}>;
|
|
369
369
|
/**
|
|
370
370
|
* Delete a webhook subscription
|
|
371
371
|
*/
|
|
372
|
-
delete: (id: string) => Promise<
|
|
372
|
+
delete: (id: string) => Promise<void>;
|
|
373
373
|
/**
|
|
374
374
|
* Update a webhook subscription
|
|
375
375
|
*/
|
|
@@ -377,21 +377,21 @@ declare class ScaleMuleServer {
|
|
|
377
377
|
url?: string;
|
|
378
378
|
events?: string[];
|
|
379
379
|
is_enabled?: boolean;
|
|
380
|
-
}) => Promise<
|
|
380
|
+
}) => Promise<{
|
|
381
381
|
id: string;
|
|
382
382
|
url: string;
|
|
383
383
|
events: string[];
|
|
384
|
-
}
|
|
384
|
+
}>;
|
|
385
385
|
/**
|
|
386
386
|
* Get available webhook event types
|
|
387
387
|
*/
|
|
388
|
-
eventTypes: () => Promise<
|
|
388
|
+
eventTypes: () => Promise<{
|
|
389
389
|
events: Array<{
|
|
390
390
|
event_name: string;
|
|
391
391
|
event_description: string;
|
|
392
392
|
payload_schema: Record<string, unknown>;
|
|
393
393
|
}>;
|
|
394
|
-
}
|
|
394
|
+
}>;
|
|
395
395
|
};
|
|
396
396
|
analytics: {
|
|
397
397
|
/**
|
|
@@ -446,10 +446,10 @@ declare class ScaleMuleServer {
|
|
|
446
446
|
timestamp?: string;
|
|
447
447
|
}, options?: {
|
|
448
448
|
clientContext?: ClientContext;
|
|
449
|
-
}) => Promise<
|
|
449
|
+
}) => Promise<{
|
|
450
450
|
tracked: number;
|
|
451
451
|
session_id?: string;
|
|
452
|
-
}
|
|
452
|
+
}>;
|
|
453
453
|
/**
|
|
454
454
|
* Track a page view
|
|
455
455
|
*
|
|
@@ -470,10 +470,10 @@ declare class ScaleMuleServer {
|
|
|
470
470
|
user_id?: string;
|
|
471
471
|
}, options?: {
|
|
472
472
|
clientContext?: ClientContext;
|
|
473
|
-
}) => Promise<
|
|
473
|
+
}) => Promise<{
|
|
474
474
|
tracked: number;
|
|
475
475
|
session_id?: string;
|
|
476
|
-
}
|
|
476
|
+
}>;
|
|
477
477
|
/**
|
|
478
478
|
* Track multiple events in a batch (max 100)
|
|
479
479
|
*
|
|
@@ -511,9 +511,9 @@ declare class ScaleMuleServer {
|
|
|
511
511
|
timestamp?: string;
|
|
512
512
|
}>, options?: {
|
|
513
513
|
clientContext?: ClientContext;
|
|
514
|
-
}) => Promise<
|
|
514
|
+
}) => Promise<{
|
|
515
515
|
tracked: number;
|
|
516
|
-
}
|
|
516
|
+
}>;
|
|
517
517
|
};
|
|
518
518
|
}
|
|
519
519
|
/**
|
package/package.json
CHANGED