@gigapay-dev/contracts 1.8.4 → 1.8.5

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 (67) hide show
  1. package/build/commands/api-response.d.ts +18 -0
  2. package/build/commands/auth/confirm.d.ts +11 -0
  3. package/build/commands/auth/endpoints.d.ts +114 -0
  4. package/build/commands/auth/index.d.ts +5 -0
  5. package/build/commands/auth/login.d.ts +20 -0
  6. package/build/commands/auth/profile.d.ts +18 -0
  7. package/build/commands/auth/register.d.ts +12 -0
  8. package/build/commands/auth/reset.d.ts +12 -0
  9. package/build/commands/consts.d.ts +1 -0
  10. package/build/commands/index.d.ts +13 -0
  11. package/build/commands/orders/create.d.ts +95 -0
  12. package/build/commands/orders/endpoints.d.ts +726 -0
  13. package/build/commands/orders/enums.d.ts +7 -0
  14. package/build/commands/orders/index.d.ts +6 -0
  15. package/build/commands/orders/query.d.ts +103 -0
  16. package/build/commands/orders/read.d.ts +230 -0
  17. package/build/commands/orders/update.d.ts +23 -0
  18. package/build/commands/pagination.d.ts +12 -0
  19. package/build/commands/payment-methods/create.d.ts +45 -0
  20. package/build/commands/payment-methods/endpoints.d.ts +536 -0
  21. package/build/commands/payment-methods/index.d.ts +4 -0
  22. package/build/commands/payment-methods/read.d.ts +71 -0
  23. package/build/commands/payment-methods/update.d.ts +45 -0
  24. package/build/commands/products/create.d.ts +229 -0
  25. package/build/commands/products/endpoints.d.ts +1881 -0
  26. package/build/commands/products/enums.d.ts +19 -0
  27. package/build/commands/products/index.d.ts +6 -0
  28. package/build/commands/products/query.d.ts +79 -0
  29. package/build/commands/products/read.d.ts +833 -0
  30. package/build/commands/products/update.d.ts +78 -0
  31. package/build/commands/promocode-activations/create.d.ts +18 -0
  32. package/build/commands/promocode-activations/index.d.ts +3 -0
  33. package/build/commands/promocode-activations/read.d.ts +21 -0
  34. package/build/commands/promocode-activations/update.d.ts +18 -0
  35. package/build/commands/promocodes/create.d.ts +39 -0
  36. package/build/commands/promocodes/endpoints.d.ts +353 -0
  37. package/build/commands/promocodes/enums.d.ts +5 -0
  38. package/build/commands/promocodes/index.d.ts +5 -0
  39. package/build/commands/promocodes/read.d.ts +45 -0
  40. package/build/commands/promocodes/update.d.ts +33 -0
  41. package/build/commands/refresh-sessions/create.d.ts +24 -0
  42. package/build/commands/refresh-sessions/enums.d.ts +3 -0
  43. package/build/commands/refresh-sessions/index.d.ts +4 -0
  44. package/build/commands/refresh-sessions/read.d.ts +27 -0
  45. package/build/commands/refresh-sessions/update.d.ts +24 -0
  46. package/build/commands/settings/endpoints.d.ts +108 -0
  47. package/build/commands/settings/index.d.ts +3 -0
  48. package/build/commands/settings/read.d.ts +18 -0
  49. package/build/commands/settings/update.d.ts +18 -0
  50. package/build/commands/stats/endpoints.d.ts +67 -0
  51. package/build/commands/stats/index.d.ts +3 -0
  52. package/build/commands/stats/query.d.ts +31 -0
  53. package/build/commands/stats/read.d.ts +30 -0
  54. package/build/commands/users/create.d.ts +42 -0
  55. package/build/commands/users/endpoints.d.ts +403 -0
  56. package/build/commands/users/enums.d.ts +6 -0
  57. package/build/commands/users/index.d.ts +6 -0
  58. package/build/commands/users/query.d.ts +52 -0
  59. package/build/commands/users/read.d.ts +60 -0
  60. package/build/commands/users/update.d.ts +42 -0
  61. package/build/index.d.ts +1 -0
  62. package/build/types.d.ts +8 -0
  63. package/package.json +3 -2
  64. package/tsconfig.json +1 -1
  65. package/build/commands/status/endpoints.js +0 -33
  66. package/build/commands/status/index.js +0 -18
  67. package/build/commands/status/read.js +0 -12
@@ -0,0 +1,18 @@
1
+ import z from "zod";
2
+ export declare const ApiResponseSchema: z.ZodObject<{
3
+ status: z.ZodNumber;
4
+ error: z.ZodUnion<[z.ZodString, z.ZodLiteral<false>]>;
5
+ error_code: z.ZodUnion<[z.ZodString, z.ZodLiteral<false>]>;
6
+ data: z.ZodOptional<z.ZodAny>;
7
+ }, "strip", z.ZodTypeAny, {
8
+ status: number;
9
+ error: string | false;
10
+ error_code: string | false;
11
+ data?: any;
12
+ }, {
13
+ status: number;
14
+ error: string | false;
15
+ error_code: string | false;
16
+ data?: any;
17
+ }>;
18
+ export type ApiResponse = z.infer<typeof ApiResponseSchema>;
@@ -0,0 +1,11 @@
1
+ import z from "zod";
2
+ import { UserLoginResponseSchema } from "./login";
3
+ export declare const ConfirmCodeRequestSchema: z.ZodObject<{
4
+ code: z.ZodString;
5
+ }, "strip", z.ZodTypeAny, {
6
+ code: string;
7
+ }, {
8
+ code: string;
9
+ }>;
10
+ export type ConfirmCodeRequest = z.infer<typeof ConfirmCodeRequestSchema>;
11
+ export type ConfirmCodeResponse = z.infer<typeof UserLoginResponseSchema>;
@@ -0,0 +1,114 @@
1
+ import z from "zod";
2
+ export declare const AuthEndpoints: {
3
+ login: {
4
+ method: "POST";
5
+ path: string;
6
+ request: z.ZodObject<{
7
+ email: z.ZodString;
8
+ password: z.ZodString;
9
+ }, "strip", z.ZodTypeAny, {
10
+ email: string;
11
+ password: string;
12
+ }, {
13
+ email: string;
14
+ password: string;
15
+ }>;
16
+ response: z.ZodObject<{
17
+ accessToken: z.ZodString;
18
+ }, "strip", z.ZodTypeAny, {
19
+ accessToken: string;
20
+ }, {
21
+ accessToken: string;
22
+ }>;
23
+ };
24
+ register: {
25
+ method: "POST";
26
+ path: string;
27
+ request: z.ZodObject<{
28
+ email: z.ZodString;
29
+ password: z.ZodString;
30
+ }, "strip", z.ZodTypeAny, {
31
+ email: string;
32
+ password: string;
33
+ }, {
34
+ email: string;
35
+ password: string;
36
+ }>;
37
+ response: z.ZodObject<{
38
+ accessToken: z.ZodString;
39
+ }, "strip", z.ZodTypeAny, {
40
+ accessToken: string;
41
+ }, {
42
+ accessToken: string;
43
+ }>;
44
+ };
45
+ refresh: {
46
+ method: "GET";
47
+ path: string;
48
+ request: z.ZodVoid;
49
+ response: z.ZodObject<{
50
+ accessToken: z.ZodString;
51
+ }, "strip", z.ZodTypeAny, {
52
+ accessToken: string;
53
+ }, {
54
+ accessToken: string;
55
+ }>;
56
+ };
57
+ reset: {
58
+ method: "POST";
59
+ path: string;
60
+ request: z.ZodObject<{
61
+ code: z.ZodString;
62
+ password: z.ZodString;
63
+ }, "strip", z.ZodTypeAny, {
64
+ password: string;
65
+ code: string;
66
+ }, {
67
+ password: string;
68
+ code: string;
69
+ }>;
70
+ response: z.ZodVoid;
71
+ };
72
+ confirm: {
73
+ method: "GET";
74
+ path: string;
75
+ request: z.ZodObject<{
76
+ code: z.ZodString;
77
+ }, "strip", z.ZodTypeAny, {
78
+ code: string;
79
+ }, {
80
+ code: string;
81
+ }>;
82
+ response: z.ZodObject<{
83
+ accessToken: z.ZodString;
84
+ }, "strip", z.ZodTypeAny, {
85
+ accessToken: string;
86
+ }, {
87
+ accessToken: string;
88
+ }>;
89
+ };
90
+ profile: {
91
+ method: "GET";
92
+ path: string;
93
+ request: z.ZodVoid;
94
+ response: z.ZodObject<{
95
+ id: z.ZodNumber;
96
+ username: z.ZodString;
97
+ email: z.ZodString;
98
+ avatar: z.ZodNullable<z.ZodString>;
99
+ }, "strip", z.ZodTypeAny, {
100
+ email: string;
101
+ id: number;
102
+ username: string;
103
+ avatar: string | null;
104
+ }, {
105
+ email: string;
106
+ id: number;
107
+ username: string;
108
+ avatar: string | null;
109
+ }>;
110
+ };
111
+ };
112
+ export type AuthEndpointKey = keyof typeof AuthEndpoints;
113
+ export type GetAuthRequest<K extends AuthEndpointKey> = z.infer<typeof AuthEndpoints[K]["request"]>;
114
+ export type GetAuthResponse<K extends AuthEndpointKey> = z.infer<typeof AuthEndpoints[K]["response"]>;
@@ -0,0 +1,5 @@
1
+ export * from './login';
2
+ export * from './register';
3
+ export * from './confirm';
4
+ export * from './reset';
5
+ export * from './endpoints';
@@ -0,0 +1,20 @@
1
+ import { z } from "zod";
2
+ export declare const UserLoginRequestSchema: z.ZodObject<{
3
+ email: z.ZodString;
4
+ password: z.ZodString;
5
+ }, "strip", z.ZodTypeAny, {
6
+ email: string;
7
+ password: string;
8
+ }, {
9
+ email: string;
10
+ password: string;
11
+ }>;
12
+ export declare const UserLoginResponseSchema: z.ZodObject<{
13
+ accessToken: z.ZodString;
14
+ }, "strip", z.ZodTypeAny, {
15
+ accessToken: string;
16
+ }, {
17
+ accessToken: string;
18
+ }>;
19
+ export type UserLoginRequest = z.infer<typeof UserLoginRequestSchema>;
20
+ export type UserLoginResponse = z.infer<typeof UserLoginResponseSchema>;
@@ -0,0 +1,18 @@
1
+ import { z } from "zod";
2
+ export declare const UserProfileResponseSchema: z.ZodObject<{
3
+ id: z.ZodNumber;
4
+ username: z.ZodString;
5
+ email: z.ZodString;
6
+ avatar: z.ZodNullable<z.ZodString>;
7
+ }, "strip", z.ZodTypeAny, {
8
+ email: string;
9
+ id: number;
10
+ username: string;
11
+ avatar: string | null;
12
+ }, {
13
+ email: string;
14
+ id: number;
15
+ username: string;
16
+ avatar: string | null;
17
+ }>;
18
+ export type UserProfileResponse = z.infer<typeof UserProfileResponseSchema>;
@@ -0,0 +1,12 @@
1
+ import z from "zod";
2
+ export declare const UserRegisterRequestSchema: z.ZodObject<{
3
+ email: z.ZodString;
4
+ password: z.ZodString;
5
+ }, "strip", z.ZodTypeAny, {
6
+ email: string;
7
+ password: string;
8
+ }, {
9
+ email: string;
10
+ password: string;
11
+ }>;
12
+ export type UserRegisterRequest = z.infer<typeof UserRegisterRequestSchema>;
@@ -0,0 +1,12 @@
1
+ import { z } from "zod";
2
+ export declare const UserResetRequestSchema: z.ZodObject<{
3
+ code: z.ZodString;
4
+ password: z.ZodString;
5
+ }, "strip", z.ZodTypeAny, {
6
+ password: string;
7
+ code: string;
8
+ }, {
9
+ password: string;
10
+ code: string;
11
+ }>;
12
+ export type UserResetRequest = z.infer<typeof UserResetRequestSchema>;
@@ -0,0 +1 @@
1
+ export declare const CONFIRMATION_CODE_LENGTH = 4;
@@ -0,0 +1,13 @@
1
+ export * from './auth';
2
+ export * from './orders';
3
+ export * from './promocodes';
4
+ export * from './promocode-activations';
5
+ export * from './refresh-sessions';
6
+ export * from './consts';
7
+ export * from './pagination';
8
+ export * from './payment-methods';
9
+ export * from './api-response';
10
+ export * from './users';
11
+ export * from './stats';
12
+ export * from './settings';
13
+ export * from './products';
@@ -0,0 +1,95 @@
1
+ import z from "zod";
2
+ export declare const OrderItemInputSchema: z.ZodObject<{
3
+ variantId: z.ZodNumber;
4
+ quantity: z.ZodDefault<z.ZodNumber>;
5
+ gameUsername: z.ZodOptional<z.ZodString>;
6
+ gameUsernameType: z.ZodOptional<z.ZodString>;
7
+ }, "strip", z.ZodTypeAny, {
8
+ variantId: number;
9
+ quantity: number;
10
+ gameUsername?: string | undefined;
11
+ gameUsernameType?: string | undefined;
12
+ }, {
13
+ variantId: number;
14
+ quantity?: number | undefined;
15
+ gameUsername?: string | undefined;
16
+ gameUsernameType?: string | undefined;
17
+ }>;
18
+ /** Запрос на создание заказа */
19
+ export declare const OrderCreateRequestSchema: z.ZodObject<{
20
+ /** Email покупателя */
21
+ email: z.ZodString;
22
+ /** ID способа оплаты */
23
+ paymentMethodId: z.ZodNumber;
24
+ /** Список товаров в заказе (минимум 1) */
25
+ items: z.ZodArray<z.ZodObject<{
26
+ variantId: z.ZodNumber;
27
+ quantity: z.ZodDefault<z.ZodNumber>;
28
+ gameUsername: z.ZodOptional<z.ZodString>;
29
+ gameUsernameType: z.ZodOptional<z.ZodString>;
30
+ }, "strip", z.ZodTypeAny, {
31
+ variantId: number;
32
+ quantity: number;
33
+ gameUsername?: string | undefined;
34
+ gameUsernameType?: string | undefined;
35
+ }, {
36
+ variantId: number;
37
+ quantity?: number | undefined;
38
+ gameUsername?: string | undefined;
39
+ gameUsernameType?: string | undefined;
40
+ }>, "many">;
41
+ /** ID промокода (опционально) */
42
+ promocodeId: z.ZodOptional<z.ZodNumber>;
43
+ /** ID существующего пользователя (опционально) */
44
+ userId: z.ZodOptional<z.ZodNumber>;
45
+ /** Telegram ID покупателя (опционально) */
46
+ telegramId: z.ZodOptional<z.ZodString>;
47
+ /** UTM-метка источника трафика */
48
+ utmSource: z.ZodOptional<z.ZodString>;
49
+ /** Тип дизайна формы оплаты */
50
+ designType: z.ZodOptional<z.ZodString>;
51
+ /** Тип заказа: MAIN (сайт) или WEBAPP (Telegram Mini App) */
52
+ type: z.ZodDefault<z.ZodOptional<z.ZodEnum<["MAIN", "WEBAPP"]>>>;
53
+ }, "strip", z.ZodTypeAny, {
54
+ email: string;
55
+ type: "MAIN" | "WEBAPP";
56
+ paymentMethodId: number;
57
+ items: {
58
+ variantId: number;
59
+ quantity: number;
60
+ gameUsername?: string | undefined;
61
+ gameUsernameType?: string | undefined;
62
+ }[];
63
+ promocodeId?: number | undefined;
64
+ userId?: number | undefined;
65
+ telegramId?: string | undefined;
66
+ utmSource?: string | undefined;
67
+ designType?: string | undefined;
68
+ }, {
69
+ email: string;
70
+ paymentMethodId: number;
71
+ items: {
72
+ variantId: number;
73
+ quantity?: number | undefined;
74
+ gameUsername?: string | undefined;
75
+ gameUsernameType?: string | undefined;
76
+ }[];
77
+ type?: "MAIN" | "WEBAPP" | undefined;
78
+ promocodeId?: number | undefined;
79
+ userId?: number | undefined;
80
+ telegramId?: string | undefined;
81
+ utmSource?: string | undefined;
82
+ designType?: string | undefined;
83
+ }>;
84
+ /** Ответ на создание заказа — ссылка для оплаты */
85
+ export declare const OrderCreateResponseSchema: z.ZodObject<{
86
+ /** URL для редиректа на платёжную страницу */
87
+ redirectUrl: z.ZodString;
88
+ }, "strip", z.ZodTypeAny, {
89
+ redirectUrl: string;
90
+ }, {
91
+ redirectUrl: string;
92
+ }>;
93
+ export type OrderItemInput = z.infer<typeof OrderItemInputSchema>;
94
+ export type OrderCreateRequest = z.infer<typeof OrderCreateRequestSchema>;
95
+ export type OrderCreateResponse = z.infer<typeof OrderCreateResponseSchema>;