@monkeyplus/payscope 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.
Files changed (82) hide show
  1. package/dist/THIRD-PARTY-LICENSES.md +41 -0
  2. package/dist/_chunks/auth.d.mts +707 -0
  3. package/dist/_chunks/database.mjs +831 -0
  4. package/dist/_chunks/db.d.mts +7100 -0
  5. package/dist/_chunks/index.d.mts +178 -0
  6. package/dist/_chunks/lib.mjs +3073 -0
  7. package/dist/_chunks/libs/better-call.d.mts +478 -0
  8. package/dist/_chunks/libs/postgres.d.mts +1 -0
  9. package/dist/_chunks/rolldown-runtime.mjs +11 -0
  10. package/dist/server/db.d.mts +2 -0
  11. package/dist/server/db.mjs +108 -0
  12. package/dist/server/env.d.mts +21 -0
  13. package/dist/server/env.mjs +22 -0
  14. package/dist/server/lib.d.mts +362 -0
  15. package/dist/server/lib.mjs +2 -0
  16. package/dist/server/router.d.mts +1218 -0
  17. package/dist/server/router.mjs +1157 -0
  18. package/dist/server/schemas/auth.d.mts +2 -0
  19. package/dist/server/schemas/auth.mjs +62 -0
  20. package/package.json +58 -0
  21. package/storefront/Readme.md +0 -0
  22. package/storefront/auth.ts +29 -0
  23. package/storefront/cart/ResumeCart.vue +217 -0
  24. package/storefront/cart/ResumeCartSelect.vue +32 -0
  25. package/storefront/cart/ShoppinCart.vue +100 -0
  26. package/storefront/cart/ShoppinCartItem.vue +99 -0
  27. package/storefront/checkout/App.vue +36 -0
  28. package/storefront/checkout/AppCart.vue +72 -0
  29. package/storefront/checkout/AppCartDiscount.vue +74 -0
  30. package/storefront/checkout/AppCartTotals.vue +72 -0
  31. package/storefront/checkout/AppLoading.vue +55 -0
  32. package/storefront/checkout/composables.ts +28 -0
  33. package/storefront/checkout/constants.ts +0 -0
  34. package/storefront/checkout/main.ts +11 -0
  35. package/storefront/checkout/pages/Address/Address.vue +95 -0
  36. package/storefront/checkout/pages/Info/Info.vue +94 -0
  37. package/storefront/checkout/pages/Info/InfoUser.vue +38 -0
  38. package/storefront/checkout/pages/Pay/Pay.vue +115 -0
  39. package/storefront/checkout/pages/Pay/Providers/BancoEconomico/BancoEconomico.vue +9 -0
  40. package/storefront/checkout/pages/Pay/Providers/Cybersource/Cybersource.vue +9 -0
  41. package/storefront/checkout/pages/Pay/Providers/Datafast/Datafast.vue +9 -0
  42. package/storefront/checkout/pages/Pay/Providers/Multipago/Multipago.vue +9 -0
  43. package/storefront/checkout/pages/Pay/Providers/Pagomedios/Pagomedios.vue +93 -0
  44. package/storefront/checkout/pages/Pay/Providers/Pagomedios/composable.ts +23 -0
  45. package/storefront/checkout/pages/Pay/Providers/Paypal/Paypal.vue +168 -0
  46. package/storefront/checkout/pages/Pay/Providers/Paypal/composable.ts +33 -0
  47. package/storefront/checkout/pages/Pay/Providers/Placetopay/Placetopay.vue +9 -0
  48. package/storefront/checkout/pages/Pay/Providers/Wabi/Wabi.vue +9 -0
  49. package/storefront/checkout/pages/Pay/Providers/composable.ts +30 -0
  50. package/storefront/checkout/pages/Payment/Payment.vue +19 -0
  51. package/storefront/checkout/pages/Payment/PaymentStatus.vue +187 -0
  52. package/storefront/checkout/pages/Payment/PaymentStatusDetail.vue +77 -0
  53. package/storefront/checkout/pages/Payment/composable.ts +81 -0
  54. package/storefront/checkout/pages/Shipping/Shipping.vue +67 -0
  55. package/storefront/checkout/pages/StepInfo.vue +37 -0
  56. package/storefront/checkout/router.ts +59 -0
  57. package/storefront/index.ts +3 -0
  58. package/storefront/login/App.vue +9 -0
  59. package/storefront/login/main.ts +10 -0
  60. package/storefront/login/pages/SignIn/Login.vue +82 -0
  61. package/storefront/login/pages/SignUp/SignUp.vue +99 -0
  62. package/storefront/login/router.ts +15 -0
  63. package/storefront/product/AddProduct.vue +303 -0
  64. package/storefront/product/AddProductNumber.vue +62 -0
  65. package/storefront/product/AddProductVariant.vue +66 -0
  66. package/storefront/profile/App.vue +88 -0
  67. package/storefront/profile/main.ts +10 -0
  68. package/storefront/profile/pages/Addresses/Addresses.vue +79 -0
  69. package/storefront/profile/pages/Addresses/AddressesForm.vue +95 -0
  70. package/storefront/profile/pages/Addresses/AddressesModal.vue +24 -0
  71. package/storefront/profile/pages/Buys/Buys.vue +8 -0
  72. package/storefront/profile/pages/Me/Me.vue +15 -0
  73. package/storefront/profile/pages/Me/MeBilling.vue +79 -0
  74. package/storefront/profile/pages/Me/MeBillingForm.vue +66 -0
  75. package/storefront/profile/pages/Me/MeBillingModal.vue +24 -0
  76. package/storefront/profile/pages/Me/MeInfo.vue +75 -0
  77. package/storefront/profile/pages/Me/MePassword.vue +53 -0
  78. package/storefront/profile/pages/Me/MeSubscriptions.vue +15 -0
  79. package/storefront/profile/pages/Returns/Returns.vue +8 -0
  80. package/storefront/profile/pages/Whislist/Whislist.vue +8 -0
  81. package/storefront/profile/router.ts +32 -0
  82. package/storefront/stores.ts +320 -0
@@ -0,0 +1,1218 @@
1
+ import { Database, Store } from "../_chunks/db.mjs";
2
+ import { Payment } from "../_chunks/index.mjs";
3
+ import { MiddlewareInputContext, MiddlewareOptions, StrictEndpoint } from "../_chunks/libs/better-call.mjs";
4
+ import { H3, H3Event } from "h3";
5
+ interface OptionsAccount$2 {
6
+ path: (...params: string[]) => string;
7
+ storeId: number;
8
+ }
9
+ declare function useUser(event: H3Event): {
10
+ id: string;
11
+ email: string;
12
+ };
13
+ declare function registerAccount(app: H3, db: Database, {
14
+ path,
15
+ storeId
16
+ }: OptionsAccount$2): void;
17
+ declare const _auth: import("better-auth").Auth<{
18
+ plugins: [{
19
+ id: "admin";
20
+ version: string;
21
+ init(): {
22
+ options: {
23
+ databaseHooks: {
24
+ user: {
25
+ create: {
26
+ before(user: {
27
+ id: string;
28
+ createdAt: Date;
29
+ updatedAt: Date;
30
+ email: string;
31
+ emailVerified: boolean;
32
+ name: string;
33
+ image?: string | null | undefined;
34
+ } & Record<string, unknown>): Promise<{
35
+ data: {
36
+ id: string;
37
+ createdAt: Date;
38
+ updatedAt: Date;
39
+ email: string;
40
+ emailVerified: boolean;
41
+ name: string;
42
+ image?: string | null | undefined;
43
+ role: string;
44
+ };
45
+ }>;
46
+ };
47
+ };
48
+ session: {
49
+ create: {
50
+ before(session: {
51
+ id: string;
52
+ createdAt: Date;
53
+ updatedAt: Date;
54
+ userId: string;
55
+ expiresAt: Date;
56
+ token: string;
57
+ ipAddress?: string | null | undefined;
58
+ userAgent?: string | null | undefined;
59
+ } & Record<string, unknown>, ctx: import("better-auth").GenericEndpointContext | null): Promise<void>;
60
+ };
61
+ };
62
+ };
63
+ };
64
+ };
65
+ hooks: {
66
+ after: {
67
+ matcher(context: import("better-auth").HookEndpointContext): boolean;
68
+ handler: (inputContext: MiddlewareInputContext<MiddlewareOptions>) => Promise<import("better-auth/plugins").SessionWithImpersonatedBy[] | undefined>;
69
+ }[];
70
+ };
71
+ endpoints: {
72
+ setRole: StrictEndpoint<"/admin/set-role", {
73
+ method: "POST";
74
+ body: import("zod").ZodObject<{
75
+ userId: import("zod").ZodCoercedString<unknown>;
76
+ role: import("zod").ZodUnion<readonly [import("zod").ZodString, import("zod").ZodArray<import("zod").ZodString>]>;
77
+ }, import("zod/v4/core").$strip>;
78
+ requireHeaders: true;
79
+ use: ((inputContext: MiddlewareInputContext<MiddlewareOptions>) => Promise<{
80
+ session: {
81
+ user: import("better-auth/plugins").UserWithRole;
82
+ session: {
83
+ id: string;
84
+ createdAt: Date;
85
+ updatedAt: Date;
86
+ userId: string;
87
+ expiresAt: Date;
88
+ token: string;
89
+ ipAddress?: string | null | undefined;
90
+ userAgent?: string | null | undefined;
91
+ };
92
+ };
93
+ }>)[];
94
+ metadata: {
95
+ openapi: {
96
+ operationId: string;
97
+ summary: string;
98
+ description: string;
99
+ responses: {
100
+ 200: {
101
+ description: string;
102
+ content: {
103
+ "application/json": {
104
+ schema: {
105
+ type: "object";
106
+ properties: {
107
+ user: {
108
+ $ref: string;
109
+ };
110
+ };
111
+ };
112
+ };
113
+ };
114
+ };
115
+ };
116
+ };
117
+ $Infer: {
118
+ body: {
119
+ userId: string;
120
+ role: "admin" | "user" | ("admin" | "user")[];
121
+ };
122
+ };
123
+ };
124
+ }, {
125
+ user: import("better-auth/plugins").UserWithRole;
126
+ }>;
127
+ getUser: StrictEndpoint<"/admin/get-user", {
128
+ method: "GET";
129
+ query: import("zod").ZodObject<{
130
+ id: import("zod").ZodString;
131
+ }, import("zod/v4/core").$strip>;
132
+ use: ((inputContext: MiddlewareInputContext<MiddlewareOptions>) => Promise<{
133
+ session: {
134
+ user: import("better-auth/plugins").UserWithRole;
135
+ session: {
136
+ id: string;
137
+ createdAt: Date;
138
+ updatedAt: Date;
139
+ userId: string;
140
+ expiresAt: Date;
141
+ token: string;
142
+ ipAddress?: string | null | undefined;
143
+ userAgent?: string | null | undefined;
144
+ };
145
+ };
146
+ }>)[];
147
+ metadata: {
148
+ openapi: {
149
+ operationId: string;
150
+ summary: string;
151
+ description: string;
152
+ responses: {
153
+ 200: {
154
+ description: string;
155
+ content: {
156
+ "application/json": {
157
+ schema: {
158
+ type: "object";
159
+ properties: {
160
+ user: {
161
+ $ref: string;
162
+ };
163
+ };
164
+ };
165
+ };
166
+ };
167
+ };
168
+ };
169
+ };
170
+ };
171
+ }, import("better-auth/plugins").UserWithRole>;
172
+ createUser: StrictEndpoint<"/admin/create-user", {
173
+ method: "POST";
174
+ body: import("zod").ZodObject<{
175
+ email: import("zod").ZodString;
176
+ password: import("zod").ZodOptional<import("zod").ZodString>;
177
+ name: import("zod").ZodString;
178
+ role: import("zod").ZodOptional<import("zod").ZodUnion<readonly [import("zod").ZodString, import("zod").ZodArray<import("zod").ZodString>]>>;
179
+ data: import("zod").ZodOptional<import("zod").ZodRecord<import("zod").ZodString, import("zod").ZodAny>>;
180
+ }, import("zod/v4/core").$strip>;
181
+ metadata: {
182
+ openapi: {
183
+ operationId: string;
184
+ summary: string;
185
+ description: string;
186
+ responses: {
187
+ 200: {
188
+ description: string;
189
+ content: {
190
+ "application/json": {
191
+ schema: {
192
+ type: "object";
193
+ properties: {
194
+ user: {
195
+ $ref: string;
196
+ };
197
+ };
198
+ };
199
+ };
200
+ };
201
+ };
202
+ };
203
+ };
204
+ $Infer: {
205
+ body: {
206
+ email: string;
207
+ password?: string | undefined;
208
+ name: string;
209
+ role?: "admin" | "user" | ("admin" | "user")[];
210
+ data?: Record<string, any> | undefined;
211
+ };
212
+ };
213
+ };
214
+ }, {
215
+ user: import("better-auth/plugins").UserWithRole;
216
+ }>;
217
+ adminUpdateUser: StrictEndpoint<"/admin/update-user", {
218
+ method: "POST";
219
+ body: import("zod").ZodObject<{
220
+ userId: import("zod").ZodCoercedString<unknown>;
221
+ data: import("zod").ZodRecord<import("zod").ZodAny, import("zod").ZodAny>;
222
+ }, import("zod/v4/core").$strip>;
223
+ use: ((inputContext: MiddlewareInputContext<MiddlewareOptions>) => Promise<{
224
+ session: {
225
+ user: import("better-auth/plugins").UserWithRole;
226
+ session: {
227
+ id: string;
228
+ createdAt: Date;
229
+ updatedAt: Date;
230
+ userId: string;
231
+ expiresAt: Date;
232
+ token: string;
233
+ ipAddress?: string | null | undefined;
234
+ userAgent?: string | null | undefined;
235
+ };
236
+ };
237
+ }>)[];
238
+ metadata: {
239
+ openapi: {
240
+ operationId: string;
241
+ summary: string;
242
+ description: string;
243
+ responses: {
244
+ 200: {
245
+ description: string;
246
+ content: {
247
+ "application/json": {
248
+ schema: {
249
+ type: "object";
250
+ properties: {
251
+ user: {
252
+ $ref: string;
253
+ };
254
+ };
255
+ };
256
+ };
257
+ };
258
+ };
259
+ };
260
+ };
261
+ };
262
+ }, import("better-auth/plugins").UserWithRole>;
263
+ listUsers: StrictEndpoint<"/admin/list-users", {
264
+ method: "GET";
265
+ use: ((inputContext: MiddlewareInputContext<MiddlewareOptions>) => Promise<{
266
+ session: {
267
+ user: import("better-auth/plugins").UserWithRole;
268
+ session: {
269
+ id: string;
270
+ createdAt: Date;
271
+ updatedAt: Date;
272
+ userId: string;
273
+ expiresAt: Date;
274
+ token: string;
275
+ ipAddress?: string | null | undefined;
276
+ userAgent?: string | null | undefined;
277
+ };
278
+ };
279
+ }>)[];
280
+ query: import("zod").ZodObject<{
281
+ searchValue: import("zod").ZodOptional<import("zod").ZodString>;
282
+ searchField: import("zod").ZodOptional<import("zod").ZodEnum<{
283
+ email: "email";
284
+ name: "name";
285
+ }>>;
286
+ searchOperator: import("zod").ZodOptional<import("zod").ZodEnum<{
287
+ contains: "contains";
288
+ starts_with: "starts_with";
289
+ ends_with: "ends_with";
290
+ }>>;
291
+ limit: import("zod").ZodOptional<import("zod").ZodUnion<[import("zod").ZodString, import("zod").ZodNumber]>>;
292
+ offset: import("zod").ZodOptional<import("zod").ZodUnion<[import("zod").ZodString, import("zod").ZodNumber]>>;
293
+ sortBy: import("zod").ZodOptional<import("zod").ZodString>;
294
+ sortDirection: import("zod").ZodOptional<import("zod").ZodEnum<{
295
+ asc: "asc";
296
+ desc: "desc";
297
+ }>>;
298
+ filterField: import("zod").ZodOptional<import("zod").ZodString>;
299
+ filterValue: import("zod").ZodOptional<import("zod").ZodUnion<[import("zod").ZodUnion<[import("zod").ZodUnion<[import("zod").ZodUnion<[import("zod").ZodString, import("zod").ZodNumber]>, import("zod").ZodBoolean]>, import("zod").ZodArray<import("zod").ZodString>]>, import("zod").ZodArray<import("zod").ZodNumber>]>>;
300
+ filterOperator: import("zod").ZodOptional<import("zod").ZodEnum<{
301
+ eq: "eq";
302
+ ne: "ne";
303
+ gt: "gt";
304
+ gte: "gte";
305
+ lt: "lt";
306
+ lte: "lte";
307
+ in: "in";
308
+ not_in: "not_in";
309
+ contains: "contains";
310
+ starts_with: "starts_with";
311
+ ends_with: "ends_with";
312
+ }>>;
313
+ }, import("zod/v4/core").$strip>;
314
+ metadata: {
315
+ openapi: {
316
+ operationId: string;
317
+ summary: string;
318
+ description: string;
319
+ responses: {
320
+ 200: {
321
+ description: string;
322
+ content: {
323
+ "application/json": {
324
+ schema: {
325
+ type: "object";
326
+ properties: {
327
+ users: {
328
+ type: string;
329
+ items: {
330
+ $ref: string;
331
+ };
332
+ };
333
+ total: {
334
+ type: string;
335
+ };
336
+ limit: {
337
+ type: string;
338
+ };
339
+ offset: {
340
+ type: string;
341
+ };
342
+ };
343
+ required: string[];
344
+ };
345
+ };
346
+ };
347
+ };
348
+ };
349
+ };
350
+ };
351
+ }, {
352
+ users: import("better-auth/plugins").UserWithRole[];
353
+ total: number;
354
+ }>;
355
+ listUserSessions: StrictEndpoint<"/admin/list-user-sessions", {
356
+ method: "POST";
357
+ use: ((inputContext: MiddlewareInputContext<MiddlewareOptions>) => Promise<{
358
+ session: {
359
+ user: import("better-auth/plugins").UserWithRole;
360
+ session: {
361
+ id: string;
362
+ createdAt: Date;
363
+ updatedAt: Date;
364
+ userId: string;
365
+ expiresAt: Date;
366
+ token: string;
367
+ ipAddress?: string | null | undefined;
368
+ userAgent?: string | null | undefined;
369
+ };
370
+ };
371
+ }>)[];
372
+ body: import("zod").ZodObject<{
373
+ userId: import("zod").ZodCoercedString<unknown>;
374
+ }, import("zod/v4/core").$strip>;
375
+ metadata: {
376
+ openapi: {
377
+ operationId: string;
378
+ summary: string;
379
+ description: string;
380
+ responses: {
381
+ 200: {
382
+ description: string;
383
+ content: {
384
+ "application/json": {
385
+ schema: {
386
+ type: "object";
387
+ properties: {
388
+ sessions: {
389
+ type: string;
390
+ items: {
391
+ $ref: string;
392
+ };
393
+ };
394
+ };
395
+ };
396
+ };
397
+ };
398
+ };
399
+ };
400
+ };
401
+ };
402
+ }, {
403
+ sessions: import("better-auth/plugins").SessionWithImpersonatedBy[];
404
+ }>;
405
+ unbanUser: StrictEndpoint<"/admin/unban-user", {
406
+ method: "POST";
407
+ body: import("zod").ZodObject<{
408
+ userId: import("zod").ZodCoercedString<unknown>;
409
+ }, import("zod/v4/core").$strip>;
410
+ use: ((inputContext: MiddlewareInputContext<MiddlewareOptions>) => Promise<{
411
+ session: {
412
+ user: import("better-auth/plugins").UserWithRole;
413
+ session: {
414
+ id: string;
415
+ createdAt: Date;
416
+ updatedAt: Date;
417
+ userId: string;
418
+ expiresAt: Date;
419
+ token: string;
420
+ ipAddress?: string | null | undefined;
421
+ userAgent?: string | null | undefined;
422
+ };
423
+ };
424
+ }>)[];
425
+ metadata: {
426
+ openapi: {
427
+ operationId: string;
428
+ summary: string;
429
+ description: string;
430
+ responses: {
431
+ 200: {
432
+ description: string;
433
+ content: {
434
+ "application/json": {
435
+ schema: {
436
+ type: "object";
437
+ properties: {
438
+ user: {
439
+ $ref: string;
440
+ };
441
+ };
442
+ };
443
+ };
444
+ };
445
+ };
446
+ };
447
+ };
448
+ };
449
+ }, {
450
+ user: import("better-auth/plugins").UserWithRole;
451
+ }>;
452
+ banUser: StrictEndpoint<"/admin/ban-user", {
453
+ method: "POST";
454
+ body: import("zod").ZodObject<{
455
+ userId: import("zod").ZodCoercedString<unknown>;
456
+ banReason: import("zod").ZodOptional<import("zod").ZodString>;
457
+ banExpiresIn: import("zod").ZodOptional<import("zod").ZodNumber>;
458
+ }, import("zod/v4/core").$strip>;
459
+ use: ((inputContext: MiddlewareInputContext<MiddlewareOptions>) => Promise<{
460
+ session: {
461
+ user: import("better-auth/plugins").UserWithRole;
462
+ session: {
463
+ id: string;
464
+ createdAt: Date;
465
+ updatedAt: Date;
466
+ userId: string;
467
+ expiresAt: Date;
468
+ token: string;
469
+ ipAddress?: string | null | undefined;
470
+ userAgent?: string | null | undefined;
471
+ };
472
+ };
473
+ }>)[];
474
+ metadata: {
475
+ openapi: {
476
+ operationId: string;
477
+ summary: string;
478
+ description: string;
479
+ responses: {
480
+ 200: {
481
+ description: string;
482
+ content: {
483
+ "application/json": {
484
+ schema: {
485
+ type: "object";
486
+ properties: {
487
+ user: {
488
+ $ref: string;
489
+ };
490
+ };
491
+ };
492
+ };
493
+ };
494
+ };
495
+ };
496
+ };
497
+ };
498
+ }, {
499
+ user: import("better-auth/plugins").UserWithRole;
500
+ }>;
501
+ impersonateUser: StrictEndpoint<"/admin/impersonate-user", {
502
+ method: "POST";
503
+ body: import("zod").ZodObject<{
504
+ userId: import("zod").ZodCoercedString<unknown>;
505
+ }, import("zod/v4/core").$strip>;
506
+ use: ((inputContext: MiddlewareInputContext<MiddlewareOptions>) => Promise<{
507
+ session: {
508
+ user: import("better-auth/plugins").UserWithRole;
509
+ session: {
510
+ id: string;
511
+ createdAt: Date;
512
+ updatedAt: Date;
513
+ userId: string;
514
+ expiresAt: Date;
515
+ token: string;
516
+ ipAddress?: string | null | undefined;
517
+ userAgent?: string | null | undefined;
518
+ };
519
+ };
520
+ }>)[];
521
+ metadata: {
522
+ openapi: {
523
+ operationId: string;
524
+ summary: string;
525
+ description: string;
526
+ responses: {
527
+ 200: {
528
+ description: string;
529
+ content: {
530
+ "application/json": {
531
+ schema: {
532
+ type: "object";
533
+ properties: {
534
+ session: {
535
+ $ref: string;
536
+ };
537
+ user: {
538
+ $ref: string;
539
+ };
540
+ };
541
+ };
542
+ };
543
+ };
544
+ };
545
+ };
546
+ };
547
+ };
548
+ }, {
549
+ session: {
550
+ id: string;
551
+ createdAt: Date;
552
+ updatedAt: Date;
553
+ userId: string;
554
+ expiresAt: Date;
555
+ token: string;
556
+ ipAddress?: string | null | undefined;
557
+ userAgent?: string | null | undefined;
558
+ };
559
+ user: import("better-auth/plugins").UserWithRole;
560
+ }>;
561
+ stopImpersonating: StrictEndpoint<"/admin/stop-impersonating", {
562
+ method: "POST";
563
+ requireHeaders: true;
564
+ }, {
565
+ session: {
566
+ id: string;
567
+ createdAt: Date;
568
+ updatedAt: Date;
569
+ userId: string;
570
+ expiresAt: Date;
571
+ token: string;
572
+ ipAddress?: string | null | undefined;
573
+ userAgent?: string | null | undefined;
574
+ } & Record<string, any>;
575
+ user: {
576
+ id: string;
577
+ createdAt: Date;
578
+ updatedAt: Date;
579
+ email: string;
580
+ emailVerified: boolean;
581
+ name: string;
582
+ image?: string | null | undefined;
583
+ } & Record<string, any>;
584
+ }>;
585
+ revokeUserSession: StrictEndpoint<"/admin/revoke-user-session", {
586
+ method: "POST";
587
+ body: import("zod").ZodObject<{
588
+ sessionToken: import("zod").ZodString;
589
+ }, import("zod/v4/core").$strip>;
590
+ use: ((inputContext: MiddlewareInputContext<MiddlewareOptions>) => Promise<{
591
+ session: {
592
+ user: import("better-auth/plugins").UserWithRole;
593
+ session: {
594
+ id: string;
595
+ createdAt: Date;
596
+ updatedAt: Date;
597
+ userId: string;
598
+ expiresAt: Date;
599
+ token: string;
600
+ ipAddress?: string | null | undefined;
601
+ userAgent?: string | null | undefined;
602
+ };
603
+ };
604
+ }>)[];
605
+ metadata: {
606
+ openapi: {
607
+ operationId: string;
608
+ summary: string;
609
+ description: string;
610
+ responses: {
611
+ 200: {
612
+ description: string;
613
+ content: {
614
+ "application/json": {
615
+ schema: {
616
+ type: "object";
617
+ properties: {
618
+ success: {
619
+ type: string;
620
+ };
621
+ };
622
+ };
623
+ };
624
+ };
625
+ };
626
+ };
627
+ };
628
+ };
629
+ }, {
630
+ success: boolean;
631
+ }>;
632
+ revokeUserSessions: StrictEndpoint<"/admin/revoke-user-sessions", {
633
+ method: "POST";
634
+ body: import("zod").ZodObject<{
635
+ userId: import("zod").ZodCoercedString<unknown>;
636
+ }, import("zod/v4/core").$strip>;
637
+ use: ((inputContext: MiddlewareInputContext<MiddlewareOptions>) => Promise<{
638
+ session: {
639
+ user: import("better-auth/plugins").UserWithRole;
640
+ session: {
641
+ id: string;
642
+ createdAt: Date;
643
+ updatedAt: Date;
644
+ userId: string;
645
+ expiresAt: Date;
646
+ token: string;
647
+ ipAddress?: string | null | undefined;
648
+ userAgent?: string | null | undefined;
649
+ };
650
+ };
651
+ }>)[];
652
+ metadata: {
653
+ openapi: {
654
+ operationId: string;
655
+ summary: string;
656
+ description: string;
657
+ responses: {
658
+ 200: {
659
+ description: string;
660
+ content: {
661
+ "application/json": {
662
+ schema: {
663
+ type: "object";
664
+ properties: {
665
+ success: {
666
+ type: string;
667
+ };
668
+ };
669
+ };
670
+ };
671
+ };
672
+ };
673
+ };
674
+ };
675
+ };
676
+ }, {
677
+ success: boolean;
678
+ }>;
679
+ removeUser: StrictEndpoint<"/admin/remove-user", {
680
+ method: "POST";
681
+ body: import("zod").ZodObject<{
682
+ userId: import("zod").ZodCoercedString<unknown>;
683
+ }, import("zod/v4/core").$strip>;
684
+ use: ((inputContext: MiddlewareInputContext<MiddlewareOptions>) => Promise<{
685
+ session: {
686
+ user: import("better-auth/plugins").UserWithRole;
687
+ session: {
688
+ id: string;
689
+ createdAt: Date;
690
+ updatedAt: Date;
691
+ userId: string;
692
+ expiresAt: Date;
693
+ token: string;
694
+ ipAddress?: string | null | undefined;
695
+ userAgent?: string | null | undefined;
696
+ };
697
+ };
698
+ }>)[];
699
+ metadata: {
700
+ openapi: {
701
+ operationId: string;
702
+ summary: string;
703
+ description: string;
704
+ responses: {
705
+ 200: {
706
+ description: string;
707
+ content: {
708
+ "application/json": {
709
+ schema: {
710
+ type: "object";
711
+ properties: {
712
+ success: {
713
+ type: string;
714
+ };
715
+ };
716
+ };
717
+ };
718
+ };
719
+ };
720
+ };
721
+ };
722
+ };
723
+ }, {
724
+ success: boolean;
725
+ }>;
726
+ setUserPassword: StrictEndpoint<"/admin/set-user-password", {
727
+ method: "POST";
728
+ body: import("zod").ZodObject<{
729
+ newPassword: import("zod").ZodString;
730
+ userId: import("zod").ZodCoercedString<unknown>;
731
+ }, import("zod/v4/core").$strip>;
732
+ use: ((inputContext: MiddlewareInputContext<MiddlewareOptions>) => Promise<{
733
+ session: {
734
+ user: import("better-auth/plugins").UserWithRole;
735
+ session: {
736
+ id: string;
737
+ createdAt: Date;
738
+ updatedAt: Date;
739
+ userId: string;
740
+ expiresAt: Date;
741
+ token: string;
742
+ ipAddress?: string | null | undefined;
743
+ userAgent?: string | null | undefined;
744
+ };
745
+ };
746
+ }>)[];
747
+ metadata: {
748
+ openapi: {
749
+ operationId: string;
750
+ summary: string;
751
+ description: string;
752
+ responses: {
753
+ 200: {
754
+ description: string;
755
+ content: {
756
+ "application/json": {
757
+ schema: {
758
+ type: "object";
759
+ properties: {
760
+ status: {
761
+ type: string;
762
+ };
763
+ };
764
+ };
765
+ };
766
+ };
767
+ };
768
+ };
769
+ };
770
+ };
771
+ }, {
772
+ status: boolean;
773
+ }>;
774
+ userHasPermission: StrictEndpoint<"/admin/has-permission", {
775
+ method: "POST";
776
+ body: import("zod").ZodIntersection<import("zod").ZodObject<{
777
+ userId: import("zod").ZodOptional<import("zod").ZodCoercedString<unknown>>;
778
+ role: import("zod").ZodOptional<import("zod").ZodString>;
779
+ }, import("zod/v4/core").$strip>, import("zod").ZodXor<readonly [import("zod").ZodObject<{
780
+ permission: import("zod").ZodRecord<import("zod").ZodString, import("zod").ZodArray<import("zod").ZodString>>;
781
+ }, import("zod/v4/core").$strip>, import("zod").ZodObject<{
782
+ permissions: import("zod").ZodRecord<import("zod").ZodString, import("zod").ZodArray<import("zod").ZodString>>;
783
+ }, import("zod/v4/core").$strip>]>>;
784
+ metadata: {
785
+ openapi: {
786
+ description: string;
787
+ requestBody: {
788
+ content: {
789
+ "application/json": {
790
+ schema: {
791
+ type: "object";
792
+ properties: {
793
+ permissions: {
794
+ type: string;
795
+ description: string;
796
+ };
797
+ };
798
+ required: string[];
799
+ };
800
+ };
801
+ };
802
+ };
803
+ responses: {
804
+ "200": {
805
+ description: string;
806
+ content: {
807
+ "application/json": {
808
+ schema: {
809
+ type: "object";
810
+ properties: {
811
+ error: {
812
+ type: string;
813
+ };
814
+ success: {
815
+ type: string;
816
+ };
817
+ };
818
+ required: string[];
819
+ };
820
+ };
821
+ };
822
+ };
823
+ };
824
+ };
825
+ $Infer: {
826
+ body: {
827
+ permissions: {
828
+ readonly [x: string]: import("better-auth").LiteralString[];
829
+ };
830
+ } & {
831
+ userId?: string | undefined;
832
+ role?: "admin" | "user";
833
+ };
834
+ };
835
+ };
836
+ }, {
837
+ error: null;
838
+ success: boolean;
839
+ }>;
840
+ };
841
+ $ERROR_CODES: {
842
+ USER_ALREADY_EXISTS_USE_ANOTHER_EMAIL: import("better-auth").RawError<"USER_ALREADY_EXISTS_USE_ANOTHER_EMAIL">;
843
+ FAILED_TO_CREATE_USER: import("better-auth").RawError<"FAILED_TO_CREATE_USER">;
844
+ USER_ALREADY_EXISTS: import("better-auth").RawError<"USER_ALREADY_EXISTS">;
845
+ YOU_CANNOT_BAN_YOURSELF: import("better-auth").RawError<"YOU_CANNOT_BAN_YOURSELF">;
846
+ YOU_ARE_NOT_ALLOWED_TO_CHANGE_USERS_ROLE: import("better-auth").RawError<"YOU_ARE_NOT_ALLOWED_TO_CHANGE_USERS_ROLE">;
847
+ YOU_ARE_NOT_ALLOWED_TO_CREATE_USERS: import("better-auth").RawError<"YOU_ARE_NOT_ALLOWED_TO_CREATE_USERS">;
848
+ YOU_ARE_NOT_ALLOWED_TO_LIST_USERS: import("better-auth").RawError<"YOU_ARE_NOT_ALLOWED_TO_LIST_USERS">;
849
+ YOU_ARE_NOT_ALLOWED_TO_LIST_USERS_SESSIONS: import("better-auth").RawError<"YOU_ARE_NOT_ALLOWED_TO_LIST_USERS_SESSIONS">;
850
+ YOU_ARE_NOT_ALLOWED_TO_BAN_USERS: import("better-auth").RawError<"YOU_ARE_NOT_ALLOWED_TO_BAN_USERS">;
851
+ YOU_ARE_NOT_ALLOWED_TO_IMPERSONATE_USERS: import("better-auth").RawError<"YOU_ARE_NOT_ALLOWED_TO_IMPERSONATE_USERS">;
852
+ YOU_ARE_NOT_ALLOWED_TO_REVOKE_USERS_SESSIONS: import("better-auth").RawError<"YOU_ARE_NOT_ALLOWED_TO_REVOKE_USERS_SESSIONS">;
853
+ YOU_ARE_NOT_ALLOWED_TO_DELETE_USERS: import("better-auth").RawError<"YOU_ARE_NOT_ALLOWED_TO_DELETE_USERS">;
854
+ YOU_ARE_NOT_ALLOWED_TO_SET_USERS_PASSWORD: import("better-auth").RawError<"YOU_ARE_NOT_ALLOWED_TO_SET_USERS_PASSWORD">;
855
+ BANNED_USER: import("better-auth").RawError<"BANNED_USER">;
856
+ YOU_ARE_NOT_ALLOWED_TO_GET_USER: import("better-auth").RawError<"YOU_ARE_NOT_ALLOWED_TO_GET_USER">;
857
+ NO_DATA_TO_UPDATE: import("better-auth").RawError<"NO_DATA_TO_UPDATE">;
858
+ YOU_ARE_NOT_ALLOWED_TO_UPDATE_USERS: import("better-auth").RawError<"YOU_ARE_NOT_ALLOWED_TO_UPDATE_USERS">;
859
+ YOU_CANNOT_REMOVE_YOURSELF: import("better-auth").RawError<"YOU_CANNOT_REMOVE_YOURSELF">;
860
+ YOU_ARE_NOT_ALLOWED_TO_SET_NON_EXISTENT_VALUE: import("better-auth").RawError<"YOU_ARE_NOT_ALLOWED_TO_SET_NON_EXISTENT_VALUE">;
861
+ YOU_CANNOT_IMPERSONATE_ADMINS: import("better-auth").RawError<"YOU_CANNOT_IMPERSONATE_ADMINS">;
862
+ INVALID_ROLE_TYPE: import("better-auth").RawError<"INVALID_ROLE_TYPE">;
863
+ YOU_ARE_NOT_ALLOWED_TO_SET_USERS_EMAIL: import("better-auth").RawError<"YOU_ARE_NOT_ALLOWED_TO_SET_USERS_EMAIL">;
864
+ PASSWORD_CANNOT_BE_UPDATED_VIA_UPDATE_USER: import("better-auth").RawError<"PASSWORD_CANNOT_BE_UPDATED_VIA_UPDATE_USER">;
865
+ };
866
+ schema: {
867
+ user: {
868
+ fields: {
869
+ role: {
870
+ type: "string";
871
+ required: false;
872
+ input: false;
873
+ };
874
+ banned: {
875
+ type: "boolean";
876
+ defaultValue: false;
877
+ required: false;
878
+ input: false;
879
+ };
880
+ banReason: {
881
+ type: "string";
882
+ required: false;
883
+ input: false;
884
+ };
885
+ banExpires: {
886
+ type: "date";
887
+ required: false;
888
+ input: false;
889
+ };
890
+ };
891
+ };
892
+ session: {
893
+ fields: {
894
+ impersonatedBy: {
895
+ type: "string";
896
+ required: false;
897
+ input: false;
898
+ };
899
+ };
900
+ };
901
+ };
902
+ options: NoInfer<import("better-auth/plugins").AdminOptions>;
903
+ }, {
904
+ id: "username";
905
+ version: string;
906
+ init(ctx: import("better-auth").AuthContext): {
907
+ options: {
908
+ databaseHooks: {
909
+ user: {
910
+ create: {
911
+ before(user: {
912
+ id: string;
913
+ createdAt: Date;
914
+ updatedAt: Date;
915
+ email: string;
916
+ emailVerified: boolean;
917
+ name: string;
918
+ image?: string | null | undefined;
919
+ } & Record<string, unknown>, context: import("better-auth").GenericEndpointContext | null): Promise<{
920
+ data: {
921
+ username: string;
922
+ displayUsername: string;
923
+ id: string;
924
+ createdAt: Date;
925
+ updatedAt: Date;
926
+ email: string;
927
+ emailVerified: boolean;
928
+ name: string;
929
+ image?: string | null | undefined;
930
+ };
931
+ } | {
932
+ data: {
933
+ displayUsername?: string | undefined;
934
+ id: string;
935
+ createdAt: Date;
936
+ updatedAt: Date;
937
+ email: string;
938
+ emailVerified: boolean;
939
+ name: string;
940
+ image?: string | null | undefined;
941
+ };
942
+ }>;
943
+ };
944
+ update: {
945
+ before(user: Partial<{
946
+ id: string;
947
+ createdAt: Date;
948
+ updatedAt: Date;
949
+ email: string;
950
+ emailVerified: boolean;
951
+ name: string;
952
+ image?: string | null | undefined;
953
+ }> & Record<string, unknown>, context: import("better-auth").GenericEndpointContext | null): Promise<{
954
+ data: {
955
+ displayUsername?: string | undefined;
956
+ username: string;
957
+ id?: string | undefined;
958
+ createdAt?: Date | undefined;
959
+ updatedAt?: Date | undefined;
960
+ email?: string | undefined;
961
+ emailVerified?: boolean | undefined;
962
+ name?: string | undefined;
963
+ image?: string | null | undefined;
964
+ };
965
+ } | {
966
+ data: {
967
+ displayUsername?: string | undefined;
968
+ id?: string | undefined;
969
+ createdAt?: Date | undefined;
970
+ updatedAt?: Date | undefined;
971
+ email?: string | undefined;
972
+ emailVerified?: boolean | undefined;
973
+ name?: string | undefined;
974
+ image?: string | null | undefined;
975
+ };
976
+ }>;
977
+ };
978
+ };
979
+ };
980
+ };
981
+ };
982
+ endpoints: {
983
+ signInUsername: StrictEndpoint<"/sign-in/username", {
984
+ method: "POST";
985
+ body: import("zod").ZodObject<{
986
+ username: import("zod").ZodString;
987
+ password: import("zod").ZodString;
988
+ rememberMe: import("zod").ZodOptional<import("zod").ZodBoolean>;
989
+ callbackURL: import("zod").ZodOptional<import("zod").ZodString>;
990
+ }, import("zod/v4/core").$strip>;
991
+ metadata: {
992
+ openapi: {
993
+ summary: string;
994
+ description: string;
995
+ responses: {
996
+ 200: {
997
+ description: string;
998
+ content: {
999
+ "application/json": {
1000
+ schema: {
1001
+ type: "object";
1002
+ properties: {
1003
+ redirect: {
1004
+ type: string;
1005
+ description: string;
1006
+ };
1007
+ token: {
1008
+ type: string;
1009
+ description: string;
1010
+ };
1011
+ url: {
1012
+ type: string;
1013
+ nullable: boolean;
1014
+ description: string;
1015
+ };
1016
+ user: {
1017
+ $ref: string;
1018
+ };
1019
+ };
1020
+ required: string[];
1021
+ };
1022
+ };
1023
+ };
1024
+ };
1025
+ 422: {
1026
+ description: string;
1027
+ content: {
1028
+ "application/json": {
1029
+ schema: {
1030
+ type: "object";
1031
+ properties: {
1032
+ message: {
1033
+ type: string;
1034
+ };
1035
+ };
1036
+ };
1037
+ };
1038
+ };
1039
+ };
1040
+ };
1041
+ };
1042
+ };
1043
+ }, {
1044
+ redirect: boolean;
1045
+ token: string;
1046
+ url: string | undefined;
1047
+ user: {
1048
+ id: string;
1049
+ createdAt: Date;
1050
+ updatedAt: Date;
1051
+ email: string;
1052
+ emailVerified: boolean;
1053
+ name: string;
1054
+ image?: string | null | undefined;
1055
+ } & {
1056
+ username: string;
1057
+ displayUsername: string;
1058
+ };
1059
+ }>;
1060
+ isUsernameAvailable: StrictEndpoint<"/is-username-available", {
1061
+ method: "POST";
1062
+ body: import("zod").ZodObject<{
1063
+ username: import("zod").ZodString;
1064
+ }, import("zod/v4/core").$strip>;
1065
+ }, {
1066
+ available: boolean;
1067
+ }>;
1068
+ };
1069
+ schema: {
1070
+ user: {
1071
+ fields: {
1072
+ username: {
1073
+ type: "string";
1074
+ required: false;
1075
+ sortable: true;
1076
+ unique: true;
1077
+ returned: true;
1078
+ transform: {
1079
+ input(value: import("better-auth").DBPrimitive): string | number | boolean | Date | Record<string, unknown> | unknown[] | null | undefined;
1080
+ };
1081
+ };
1082
+ displayUsername: {
1083
+ type: "string";
1084
+ required: false;
1085
+ transform: {
1086
+ input(value: import("better-auth").DBPrimitive): string | number | boolean | Date | Record<string, unknown> | unknown[] | null | undefined;
1087
+ };
1088
+ };
1089
+ };
1090
+ };
1091
+ };
1092
+ hooks: {
1093
+ before: {
1094
+ matcher(context: import("better-auth").HookEndpointContext): boolean;
1095
+ handler: (inputContext: MiddlewareInputContext<MiddlewareOptions>) => Promise<void>;
1096
+ }[];
1097
+ };
1098
+ options: import("better-auth/plugins").UsernameOptions | undefined;
1099
+ $ERROR_CODES: {
1100
+ EMAIL_NOT_VERIFIED: import("better-auth").RawError<"EMAIL_NOT_VERIFIED">;
1101
+ UNEXPECTED_ERROR: import("better-auth").RawError<"UNEXPECTED_ERROR">;
1102
+ INVALID_USERNAME_OR_PASSWORD: import("better-auth").RawError<"INVALID_USERNAME_OR_PASSWORD">;
1103
+ USERNAME_IS_ALREADY_TAKEN: import("better-auth").RawError<"USERNAME_IS_ALREADY_TAKEN">;
1104
+ USERNAME_TOO_SHORT: import("better-auth").RawError<"USERNAME_TOO_SHORT">;
1105
+ USERNAME_TOO_LONG: import("better-auth").RawError<"USERNAME_TOO_LONG">;
1106
+ INVALID_USERNAME: import("better-auth").RawError<"INVALID_USERNAME">;
1107
+ INVALID_DISPLAY_USERNAME: import("better-auth").RawError<"INVALID_DISPLAY_USERNAME">;
1108
+ };
1109
+ }];
1110
+ user: {
1111
+ additionalFields: {
1112
+ surname: {
1113
+ type: "string";
1114
+ required: false;
1115
+ };
1116
+ identification: {
1117
+ type: "string";
1118
+ required: false;
1119
+ };
1120
+ phone: {
1121
+ type: "string";
1122
+ required: false;
1123
+ };
1124
+ birthday: {
1125
+ type: "date";
1126
+ required: false;
1127
+ };
1128
+ };
1129
+ };
1130
+ }>;
1131
+ type Auth = typeof _auth;
1132
+ declare function registerAuthMiddleware(app: H3, options: {
1133
+ auth: any;
1134
+ guard?: {
1135
+ path?: string;
1136
+ excludePaths?: string[];
1137
+ };
1138
+ }): void;
1139
+ declare function registerAuth(app: H3, auth: Auth): void;
1140
+ interface OptionsCache {
1141
+ path: (...params: string[]) => string;
1142
+ storeId: number;
1143
+ }
1144
+ declare function getTax(store: Store): any;
1145
+ declare function useProducts(db: Database): {
1146
+ getProducts: (storeId: any) => Promise<any[]>;
1147
+ getStore: (storeId: any) => Promise<any>;
1148
+ };
1149
+ declare function registerCache(app: H3, db: Database, {
1150
+ path,
1151
+ storeId
1152
+ }: OptionsCache): void;
1153
+ interface PVariant {}
1154
+ interface Product {
1155
+ id: any;
1156
+ title: any;
1157
+ taxes: any[];
1158
+ extras: any;
1159
+ discount: number;
1160
+ originalPrice: number;
1161
+ variants: {
1162
+ id: any;
1163
+ originalPrice: number;
1164
+ }[];
1165
+ }
1166
+ interface LineItemsCart {
1167
+ id: string;
1168
+ quantity: number;
1169
+ title: string;
1170
+ variant: PVariant;
1171
+ taxes?: any[];
1172
+ }
1173
+ type GetProducts = () => Promise<Product[]>;
1174
+ interface OptionsCart {
1175
+ getProducts: GetProducts;
1176
+ path: (...params: string[]) => string;
1177
+ }
1178
+ declare function registerCart(app: H3, {
1179
+ getProducts,
1180
+ path
1181
+ }: OptionsCart): void;
1182
+ interface OptionsAccount$1 {
1183
+ path: (...params: string[]) => string;
1184
+ storeId: number;
1185
+ }
1186
+ declare function getCheckoutId(event: H3Event): any;
1187
+ declare function registerCheckout(app: H3, db: Database, {
1188
+ path,
1189
+ storeId
1190
+ }: OptionsAccount$1): void;
1191
+ interface PayPresset {
1192
+ prepare?: {
1193
+ preHandle?: (event: H3Event, payment: Payment) => Promise<void>;
1194
+ postHandle?: (event: H3Event, result: any) => Promise<void>;
1195
+ };
1196
+ postPrepare?: {
1197
+ preHandle?: (event: H3Event, payment: Payment) => Promise<void>;
1198
+ postHandle?: (event: H3Event, result: any) => Promise<void>;
1199
+ };
1200
+ }
1201
+ interface OptionsAccount {
1202
+ path: (...params: string[]) => string;
1203
+ storeId: number;
1204
+ providers: any;
1205
+ preset: 'ecommerce' | PayPresset;
1206
+ providerOptions: Record<string, any>;
1207
+ redirect: string;
1208
+ }
1209
+ declare const safeParams: (v: string) => string;
1210
+ declare function registerPayment(app: H3, db: Database, {
1211
+ path,
1212
+ storeId,
1213
+ providers,
1214
+ preset,
1215
+ providerOptions,
1216
+ redirect: globalRedirect
1217
+ }: OptionsAccount): void;
1218
+ export { LineItemsCart, getCheckoutId, getTax, registerAccount, registerAuth, registerAuthMiddleware, registerCache, registerCart, registerCheckout, registerPayment, safeParams, useProducts, useUser };