@remnawave/backend-contract 2.0.0-alpha.11 → 2.0.0-alpha.14

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 (53) hide show
  1. package/build/backend/commands/infra-billing/create-bill-record.command.d.ts +125 -0
  2. package/build/backend/commands/infra-billing/create-bill-record.command.d.ts.map +1 -0
  3. package/build/backend/commands/infra-billing/create-bill-record.command.js +30 -0
  4. package/build/backend/commands/infra-billing/create-billing-node.command.d.ts +364 -0
  5. package/build/backend/commands/infra-billing/create-billing-node.command.d.ts.map +1 -0
  6. package/build/backend/commands/infra-billing/create-billing-node.command.js +33 -0
  7. package/build/backend/commands/infra-billing/delete-bill-record-by-uuid.command.d.ts +119 -0
  8. package/build/backend/commands/infra-billing/delete-bill-record-by-uuid.command.d.ts.map +1 -0
  9. package/build/backend/commands/infra-billing/delete-bill-record-by-uuid.command.js +22 -0
  10. package/build/backend/commands/infra-billing/delete-billing-node-by-uuid.command.d.ts +353 -0
  11. package/build/backend/commands/infra-billing/delete-billing-node-by-uuid.command.d.ts.map +1 -0
  12. package/build/backend/commands/infra-billing/delete-billing-node-by-uuid.command.js +23 -0
  13. package/build/backend/commands/infra-billing/get-bill-records.command.d.ts +122 -0
  14. package/build/backend/commands/infra-billing/get-bill-records.command.d.ts.map +1 -0
  15. package/build/backend/commands/infra-billing/get-bill-records.command.js +31 -0
  16. package/build/backend/commands/infra-billing/get-blling-nodes.command.d.ts +350 -0
  17. package/build/backend/commands/infra-billing/get-blling-nodes.command.d.ts.map +1 -0
  18. package/build/backend/commands/infra-billing/get-blling-nodes.command.js +21 -0
  19. package/build/backend/commands/infra-billing/index.d.ts +7 -0
  20. package/build/backend/commands/infra-billing/index.d.ts.map +1 -1
  21. package/build/backend/commands/infra-billing/index.js +7 -0
  22. package/build/backend/commands/infra-billing/update-billing-node.command.d.ts +361 -0
  23. package/build/backend/commands/infra-billing/update-billing-node.command.d.ts.map +1 -0
  24. package/build/backend/commands/infra-billing/update-billing-node.command.js +31 -0
  25. package/build/backend/constants/errors/errors.d.ts +30 -0
  26. package/build/backend/constants/errors/errors.d.ts.map +1 -1
  27. package/build/backend/constants/errors/errors.js +30 -0
  28. package/build/backend/models/index.d.ts +3 -0
  29. package/build/backend/models/index.d.ts.map +1 -1
  30. package/build/backend/models/index.js +3 -0
  31. package/build/backend/models/infra-billing-available-node.schema.d.ts +90 -0
  32. package/build/backend/models/infra-billing-available-node.schema.d.ts.map +1 -0
  33. package/build/backend/models/infra-billing-available-node.schema.js +9 -0
  34. package/build/backend/models/infra-billing-history-record.schema.d.ts +44 -0
  35. package/build/backend/models/infra-billing-history-record.schema.d.ts.map +1 -0
  36. package/build/backend/models/infra-billing-history-record.schema.js +19 -0
  37. package/build/backend/models/infra-billing-node.schema.d.ts +145 -0
  38. package/build/backend/models/infra-billing-node.schema.d.ts.map +1 -0
  39. package/build/backend/models/infra-billing-node.schema.js +34 -0
  40. package/build/frontend/commands/infra-billing/create-bill-record.command.js +30 -0
  41. package/build/frontend/commands/infra-billing/create-billing-node.command.js +33 -0
  42. package/build/frontend/commands/infra-billing/delete-bill-record-by-uuid.command.js +22 -0
  43. package/build/frontend/commands/infra-billing/delete-billing-node-by-uuid.command.js +23 -0
  44. package/build/frontend/commands/infra-billing/get-bill-records.command.js +31 -0
  45. package/build/frontend/commands/infra-billing/get-blling-nodes.command.js +21 -0
  46. package/build/frontend/commands/infra-billing/index.js +7 -0
  47. package/build/frontend/commands/infra-billing/update-billing-node.command.js +31 -0
  48. package/build/frontend/constants/errors/errors.js +30 -0
  49. package/build/frontend/models/index.js +3 -0
  50. package/build/frontend/models/infra-billing-available-node.schema.js +9 -0
  51. package/build/frontend/models/infra-billing-history-record.schema.js +19 -0
  52. package/build/frontend/models/infra-billing-node.schema.js +34 -0
  53. package/package.json +1 -1
@@ -0,0 +1,19 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.InfraBillingHistoryRecordSchema = void 0;
4
+ const zod_1 = require("zod");
5
+ const infra_provider_schema_1 = require("./infra-provider.schema");
6
+ exports.InfraBillingHistoryRecordSchema = zod_1.z.object({
7
+ uuid: zod_1.z.string().uuid(),
8
+ providerUuid: zod_1.z.string().uuid(),
9
+ amount: zod_1.z.number(),
10
+ billedAt: zod_1.z
11
+ .string()
12
+ .datetime()
13
+ .transform((str) => new Date(str)),
14
+ provider: infra_provider_schema_1.PartialInfraProviderSchema.omit({
15
+ createdAt: true,
16
+ updatedAt: true,
17
+ loginUrl: true,
18
+ }),
19
+ });
@@ -0,0 +1,145 @@
1
+ import { z } from 'zod';
2
+ export declare const InfraBillingNodeSchema: z.ZodObject<{
3
+ uuid: z.ZodString;
4
+ nodeUuid: z.ZodString;
5
+ providerUuid: z.ZodString;
6
+ provider: z.ZodObject<Omit<{
7
+ uuid: z.ZodString;
8
+ name: z.ZodString;
9
+ faviconLink: z.ZodNullable<z.ZodString>;
10
+ loginUrl: z.ZodNullable<z.ZodString>;
11
+ createdAt: z.ZodEffects<z.ZodString, Date, string>;
12
+ updatedAt: z.ZodEffects<z.ZodString, Date, string>;
13
+ }, "createdAt" | "updatedAt" | "faviconLink" | "loginUrl">, "strip", z.ZodTypeAny, {
14
+ uuid: string;
15
+ name: string;
16
+ }, {
17
+ uuid: string;
18
+ name: string;
19
+ }>;
20
+ node: z.ZodObject<Pick<{
21
+ uuid: z.ZodString;
22
+ name: z.ZodString;
23
+ address: z.ZodString;
24
+ port: z.ZodNullable<z.ZodNumber>;
25
+ isConnected: z.ZodBoolean;
26
+ isDisabled: z.ZodBoolean;
27
+ isConnecting: z.ZodBoolean;
28
+ isNodeOnline: z.ZodBoolean;
29
+ isXrayRunning: z.ZodBoolean;
30
+ lastStatusChange: z.ZodNullable<z.ZodEffects<z.ZodString, Date, string>>;
31
+ lastStatusMessage: z.ZodNullable<z.ZodString>;
32
+ xrayVersion: z.ZodNullable<z.ZodString>;
33
+ xrayUptime: z.ZodString;
34
+ isTrafficTrackingActive: z.ZodBoolean;
35
+ trafficResetDay: z.ZodNullable<z.ZodNumber>;
36
+ trafficLimitBytes: z.ZodNullable<z.ZodNumber>;
37
+ trafficUsedBytes: z.ZodNullable<z.ZodNumber>;
38
+ notifyPercent: z.ZodNullable<z.ZodNumber>;
39
+ usersOnline: z.ZodNullable<z.ZodNumber>;
40
+ viewPosition: z.ZodNumber;
41
+ countryCode: z.ZodString;
42
+ consumptionMultiplier: z.ZodNumber;
43
+ cpuCount: z.ZodNullable<z.ZodNumber>;
44
+ cpuModel: z.ZodNullable<z.ZodString>;
45
+ totalRam: z.ZodNullable<z.ZodString>;
46
+ createdAt: z.ZodEffects<z.ZodString, Date, string>;
47
+ updatedAt: z.ZodEffects<z.ZodString, Date, string>;
48
+ activeConfigProfileUuid: z.ZodNullable<z.ZodString>;
49
+ activeInbounds: z.ZodNullable<z.ZodArray<z.ZodObject<{
50
+ uuid: z.ZodString;
51
+ profileUuid: z.ZodString;
52
+ tag: z.ZodString;
53
+ type: z.ZodString;
54
+ network: z.ZodNullable<z.ZodString>;
55
+ security: z.ZodNullable<z.ZodString>;
56
+ port: z.ZodNullable<z.ZodNumber>;
57
+ rawInbound: z.ZodNullable<z.ZodUnknown>;
58
+ }, "strip", z.ZodTypeAny, {
59
+ type: string;
60
+ uuid: string;
61
+ profileUuid: string;
62
+ tag: string;
63
+ network: string | null;
64
+ security: string | null;
65
+ port: number | null;
66
+ rawInbound?: unknown;
67
+ }, {
68
+ type: string;
69
+ uuid: string;
70
+ profileUuid: string;
71
+ tag: string;
72
+ network: string | null;
73
+ security: string | null;
74
+ port: number | null;
75
+ rawInbound?: unknown;
76
+ }>, "many">>;
77
+ providerUuid: z.ZodNullable<z.ZodString>;
78
+ provider: z.ZodNullable<z.ZodObject<{
79
+ uuid: z.ZodString;
80
+ name: z.ZodString;
81
+ faviconLink: z.ZodNullable<z.ZodString>;
82
+ loginUrl: z.ZodNullable<z.ZodString>;
83
+ createdAt: z.ZodEffects<z.ZodString, Date, string>;
84
+ updatedAt: z.ZodEffects<z.ZodString, Date, string>;
85
+ }, "strip", z.ZodTypeAny, {
86
+ uuid: string;
87
+ createdAt: Date;
88
+ updatedAt: Date;
89
+ name: string;
90
+ faviconLink: string | null;
91
+ loginUrl: string | null;
92
+ }, {
93
+ uuid: string;
94
+ createdAt: string;
95
+ updatedAt: string;
96
+ name: string;
97
+ faviconLink: string | null;
98
+ loginUrl: string | null;
99
+ }>>;
100
+ }, "uuid" | "name" | "countryCode">, "strip", z.ZodTypeAny, {
101
+ uuid: string;
102
+ name: string;
103
+ countryCode: string;
104
+ }, {
105
+ uuid: string;
106
+ name: string;
107
+ countryCode: string;
108
+ }>;
109
+ nextBillingAt: z.ZodEffects<z.ZodString, Date, string>;
110
+ createdAt: z.ZodEffects<z.ZodString, Date, string>;
111
+ updatedAt: z.ZodEffects<z.ZodString, Date, string>;
112
+ }, "strip", z.ZodTypeAny, {
113
+ uuid: string;
114
+ createdAt: Date;
115
+ updatedAt: Date;
116
+ nodeUuid: string;
117
+ providerUuid: string;
118
+ provider: {
119
+ uuid: string;
120
+ name: string;
121
+ };
122
+ node: {
123
+ uuid: string;
124
+ name: string;
125
+ countryCode: string;
126
+ };
127
+ nextBillingAt: Date;
128
+ }, {
129
+ uuid: string;
130
+ createdAt: string;
131
+ updatedAt: string;
132
+ nodeUuid: string;
133
+ providerUuid: string;
134
+ provider: {
135
+ uuid: string;
136
+ name: string;
137
+ };
138
+ node: {
139
+ uuid: string;
140
+ name: string;
141
+ countryCode: string;
142
+ };
143
+ nextBillingAt: string;
144
+ }>;
145
+ //# sourceMappingURL=infra-billing-node.schema.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"infra-billing-node.schema.d.ts","sourceRoot":"","sources":["../../../models/infra-billing-node.schema.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAKxB,eAAO,MAAM,sBAAsB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EA4BjC,CAAC"}
@@ -0,0 +1,34 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.InfraBillingNodeSchema = void 0;
4
+ const zod_1 = require("zod");
5
+ const infra_provider_schema_1 = require("./infra-provider.schema");
6
+ const nodes_schema_1 = require("./nodes.schema");
7
+ exports.InfraBillingNodeSchema = zod_1.z.object({
8
+ uuid: zod_1.z.string().uuid(),
9
+ nodeUuid: zod_1.z.string().uuid(),
10
+ providerUuid: zod_1.z.string().uuid(),
11
+ provider: infra_provider_schema_1.PartialInfraProviderSchema.omit({
12
+ createdAt: true,
13
+ updatedAt: true,
14
+ loginUrl: true,
15
+ faviconLink: true,
16
+ }),
17
+ node: nodes_schema_1.NodesSchema.pick({
18
+ uuid: true,
19
+ name: true,
20
+ countryCode: true,
21
+ }),
22
+ nextBillingAt: zod_1.z
23
+ .string()
24
+ .datetime()
25
+ .transform((str) => new Date(str)),
26
+ createdAt: zod_1.z
27
+ .string()
28
+ .datetime()
29
+ .transform((str) => new Date(str)),
30
+ updatedAt: zod_1.z
31
+ .string()
32
+ .datetime()
33
+ .transform((str) => new Date(str)),
34
+ });
@@ -0,0 +1,30 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.CreateInfraBillingHistoryRecordCommand = void 0;
4
+ const zod_1 = require("zod");
5
+ const models_1 = require("../../models");
6
+ const api_1 = require("../../api");
7
+ const constants_1 = require("../../constants");
8
+ var CreateInfraBillingHistoryRecordCommand;
9
+ (function (CreateInfraBillingHistoryRecordCommand) {
10
+ CreateInfraBillingHistoryRecordCommand.url = api_1.REST_API.INFRA_BILLING.CREATE_BILLING_HISTORY;
11
+ CreateInfraBillingHistoryRecordCommand.TSQ_url = CreateInfraBillingHistoryRecordCommand.url;
12
+ CreateInfraBillingHistoryRecordCommand.endpointDetails = (0, constants_1.getEndpointDetails)(api_1.INFRA_BILLING_ROUTES.CREATE_BILLING_HISTORY, 'post', 'Create infra billing history');
13
+ CreateInfraBillingHistoryRecordCommand.RequestSchema = zod_1.z.object({
14
+ providerUuid: zod_1.z.string().uuid(),
15
+ amount: zod_1.z.number().min(0, 'Amount must be greater than 0'),
16
+ billedAt: zod_1.z
17
+ .string({
18
+ invalid_type_error: 'Invalid date format',
19
+ })
20
+ .datetime({ message: 'Invalid date format', offset: true, local: true })
21
+ .transform((str) => new Date(str))
22
+ .describe('Billing date. Format: 2025-01-17T15:38:45.065Z'),
23
+ });
24
+ CreateInfraBillingHistoryRecordCommand.ResponseSchema = zod_1.z.object({
25
+ response: zod_1.z.object({
26
+ records: zod_1.z.array(models_1.InfraBillingHistoryRecordSchema),
27
+ total: zod_1.z.number(),
28
+ }),
29
+ });
30
+ })(CreateInfraBillingHistoryRecordCommand || (exports.CreateInfraBillingHistoryRecordCommand = CreateInfraBillingHistoryRecordCommand = {}));
@@ -0,0 +1,33 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.CreateInfraBillingNodeCommand = void 0;
4
+ const zod_1 = require("zod");
5
+ const models_1 = require("../../models");
6
+ const api_1 = require("../../api");
7
+ const constants_1 = require("../../constants");
8
+ var CreateInfraBillingNodeCommand;
9
+ (function (CreateInfraBillingNodeCommand) {
10
+ CreateInfraBillingNodeCommand.url = api_1.REST_API.INFRA_BILLING.CREATE_BILLING_NODE;
11
+ CreateInfraBillingNodeCommand.TSQ_url = CreateInfraBillingNodeCommand.url;
12
+ CreateInfraBillingNodeCommand.endpointDetails = (0, constants_1.getEndpointDetails)(api_1.INFRA_BILLING_ROUTES.CREATE_BILLING_NODE, 'post', 'Create infra billing node');
13
+ CreateInfraBillingNodeCommand.RequestSchema = zod_1.z.object({
14
+ providerUuid: zod_1.z.string().uuid(),
15
+ nodeUuid: zod_1.z.string().uuid(),
16
+ nextBillingAt: zod_1.z
17
+ .string({
18
+ invalid_type_error: 'Invalid date format',
19
+ })
20
+ .datetime({ message: 'Invalid date format', offset: true, local: true })
21
+ .transform((str) => new Date(str))
22
+ .optional()
23
+ .describe('Next billing date. Format: 2025-01-17T15:38:45.065Z'),
24
+ });
25
+ CreateInfraBillingNodeCommand.ResponseSchema = zod_1.z.object({
26
+ response: zod_1.z.object({
27
+ totalBillingNodes: zod_1.z.number(),
28
+ billingNodes: zod_1.z.array(models_1.InfraBillingNodeSchema),
29
+ availableBillingNodes: zod_1.z.array(models_1.InfraBillingAvailableNodeSchema),
30
+ totalAvailableBillingNodes: zod_1.z.number(),
31
+ }),
32
+ });
33
+ })(CreateInfraBillingNodeCommand || (exports.CreateInfraBillingNodeCommand = CreateInfraBillingNodeCommand = {}));
@@ -0,0 +1,22 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.DeleteInfraBillingHistoryRecordCommand = void 0;
4
+ const zod_1 = require("zod");
5
+ const models_1 = require("../../models");
6
+ const api_1 = require("../../api");
7
+ const constants_1 = require("../../constants");
8
+ var DeleteInfraBillingHistoryRecordCommand;
9
+ (function (DeleteInfraBillingHistoryRecordCommand) {
10
+ DeleteInfraBillingHistoryRecordCommand.url = api_1.REST_API.INFRA_BILLING.DELETE_BILLING_HISTORY(':uuid');
11
+ DeleteInfraBillingHistoryRecordCommand.TSQ_url = DeleteInfraBillingHistoryRecordCommand.url;
12
+ DeleteInfraBillingHistoryRecordCommand.endpointDetails = (0, constants_1.getEndpointDetails)(api_1.INFRA_BILLING_ROUTES.DELETE_BILLING_HISTORY(':uuid'), 'delete', 'Delete infra billing history');
13
+ DeleteInfraBillingHistoryRecordCommand.RequestSchema = zod_1.z.object({
14
+ uuid: zod_1.z.string().uuid(),
15
+ });
16
+ DeleteInfraBillingHistoryRecordCommand.ResponseSchema = zod_1.z.object({
17
+ response: zod_1.z.object({
18
+ records: zod_1.z.array(models_1.InfraBillingHistoryRecordSchema),
19
+ total: zod_1.z.number(),
20
+ }),
21
+ });
22
+ })(DeleteInfraBillingHistoryRecordCommand || (exports.DeleteInfraBillingHistoryRecordCommand = DeleteInfraBillingHistoryRecordCommand = {}));
@@ -0,0 +1,23 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.DeleteInfraBillingNodeByUuidCommand = void 0;
4
+ const zod_1 = require("zod");
5
+ const models_1 = require("../../models");
6
+ const api_1 = require("../../api");
7
+ const constants_1 = require("../../constants");
8
+ var DeleteInfraBillingNodeByUuidCommand;
9
+ (function (DeleteInfraBillingNodeByUuidCommand) {
10
+ DeleteInfraBillingNodeByUuidCommand.url = api_1.REST_API.INFRA_BILLING.DELETE_BILLING_NODE(':uuid');
11
+ DeleteInfraBillingNodeByUuidCommand.TSQ_url = DeleteInfraBillingNodeByUuidCommand.url;
12
+ DeleteInfraBillingNodeByUuidCommand.endpointDetails = (0, constants_1.getEndpointDetails)(api_1.INFRA_BILLING_ROUTES.DELETE_BILLING_NODE(':uuid'), 'delete', 'Delete infra billing node');
13
+ DeleteInfraBillingNodeByUuidCommand.RequestSchema = zod_1.z.object({
14
+ uuid: zod_1.z.string().uuid(),
15
+ });
16
+ DeleteInfraBillingNodeByUuidCommand.ResponseSchema = zod_1.z.object({
17
+ response: zod_1.z.object({
18
+ nodes: zod_1.z.array(models_1.InfraBillingNodeSchema),
19
+ availableNodes: zod_1.z.array(models_1.InfraBillingAvailableNodeSchema),
20
+ total: zod_1.z.number(),
21
+ }),
22
+ });
23
+ })(DeleteInfraBillingNodeByUuidCommand || (exports.DeleteInfraBillingNodeByUuidCommand = DeleteInfraBillingNodeByUuidCommand = {}));
@@ -0,0 +1,31 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.GetInfraBillingHistoryRecordsCommand = void 0;
4
+ const zod_1 = require("zod");
5
+ const models_1 = require("../../models");
6
+ const api_1 = require("../../api");
7
+ const constants_1 = require("../../constants");
8
+ var GetInfraBillingHistoryRecordsCommand;
9
+ (function (GetInfraBillingHistoryRecordsCommand) {
10
+ GetInfraBillingHistoryRecordsCommand.url = api_1.REST_API.INFRA_BILLING.GET_BILLING_HISTORY;
11
+ GetInfraBillingHistoryRecordsCommand.TSQ_url = GetInfraBillingHistoryRecordsCommand.url;
12
+ GetInfraBillingHistoryRecordsCommand.endpointDetails = (0, constants_1.getEndpointDetails)(api_1.INFRA_BILLING_ROUTES.GET_BILLING_HISTORY, 'get', 'Get infra billing history');
13
+ GetInfraBillingHistoryRecordsCommand.RequestQuerySchema = zod_1.z.object({
14
+ start: zod_1.z.coerce
15
+ .number()
16
+ .default(0)
17
+ .describe('Start index (offset) of the billing history records to return, default is 0'),
18
+ size: zod_1.z.coerce
19
+ .number()
20
+ .min(1, 'Size (limit) must be greater than 0')
21
+ .max(500, 'Size (limit) must be less than 500')
22
+ .describe('Number of users to return, no more than 500')
23
+ .default(50),
24
+ });
25
+ GetInfraBillingHistoryRecordsCommand.ResponseSchema = zod_1.z.object({
26
+ response: zod_1.z.object({
27
+ records: zod_1.z.array(models_1.InfraBillingHistoryRecordSchema),
28
+ total: zod_1.z.number(),
29
+ }),
30
+ });
31
+ })(GetInfraBillingHistoryRecordsCommand || (exports.GetInfraBillingHistoryRecordsCommand = GetInfraBillingHistoryRecordsCommand = {}));
@@ -0,0 +1,21 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.GetInfraBillingNodesCommand = void 0;
4
+ const zod_1 = require("zod");
5
+ const models_1 = require("../../models");
6
+ const api_1 = require("../../api");
7
+ const constants_1 = require("../../constants");
8
+ var GetInfraBillingNodesCommand;
9
+ (function (GetInfraBillingNodesCommand) {
10
+ GetInfraBillingNodesCommand.url = api_1.REST_API.INFRA_BILLING.GET_BILLING_NODES;
11
+ GetInfraBillingNodesCommand.TSQ_url = GetInfraBillingNodesCommand.url;
12
+ GetInfraBillingNodesCommand.endpointDetails = (0, constants_1.getEndpointDetails)(api_1.INFRA_BILLING_ROUTES.GET_BILLING_NODES, 'get', 'Get infra billing nodes');
13
+ GetInfraBillingNodesCommand.ResponseSchema = zod_1.z.object({
14
+ response: zod_1.z.object({
15
+ totalBillingNodes: zod_1.z.number(),
16
+ billingNodes: zod_1.z.array(models_1.InfraBillingNodeSchema),
17
+ availableBillingNodes: zod_1.z.array(models_1.InfraBillingAvailableNodeSchema),
18
+ totalAvailableBillingNodes: zod_1.z.number(),
19
+ }),
20
+ });
21
+ })(GetInfraBillingNodesCommand || (exports.GetInfraBillingNodesCommand = GetInfraBillingNodesCommand = {}));
@@ -14,8 +14,15 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
14
  for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
15
  };
16
16
  Object.defineProperty(exports, "__esModule", { value: true });
17
+ __exportStar(require("./create-bill-record.command"), exports);
18
+ __exportStar(require("./create-billing-node.command"), exports);
17
19
  __exportStar(require("./create-infra-provider.command"), exports);
20
+ __exportStar(require("./delete-bill-record-by-uuid.command"), exports);
21
+ __exportStar(require("./delete-billing-node-by-uuid.command"), exports);
18
22
  __exportStar(require("./delete-infra-provider-by-uuid.command"), exports);
23
+ __exportStar(require("./get-bill-records.command"), exports);
24
+ __exportStar(require("./get-blling-nodes.command"), exports);
19
25
  __exportStar(require("./get-infra-provider-by-uuid.command"), exports);
20
26
  __exportStar(require("./get-infra-providers.command"), exports);
27
+ __exportStar(require("./update-billing-node.command"), exports);
21
28
  __exportStar(require("./update-infra-provider.command"), exports);
@@ -0,0 +1,31 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.UpdateInfraBillingNodeCommand = void 0;
4
+ const zod_1 = require("zod");
5
+ const models_1 = require("../../models");
6
+ const api_1 = require("../../api");
7
+ const constants_1 = require("../../constants");
8
+ var UpdateInfraBillingNodeCommand;
9
+ (function (UpdateInfraBillingNodeCommand) {
10
+ UpdateInfraBillingNodeCommand.url = api_1.REST_API.INFRA_BILLING.UPDATE_BILLING_NODE(':uuid');
11
+ UpdateInfraBillingNodeCommand.TSQ_url = UpdateInfraBillingNodeCommand.url;
12
+ UpdateInfraBillingNodeCommand.endpointDetails = (0, constants_1.getEndpointDetails)(api_1.INFRA_BILLING_ROUTES.UPDATE_BILLING_NODE(':uuid'), 'patch', 'Update infra billing node');
13
+ UpdateInfraBillingNodeCommand.RequestSchema = zod_1.z.object({
14
+ uuid: zod_1.z.string().uuid(),
15
+ nextBillingAt: zod_1.z
16
+ .string({
17
+ invalid_type_error: 'Invalid date format',
18
+ })
19
+ .datetime({ message: 'Invalid date format', offset: true, local: true })
20
+ .transform((str) => new Date(str))
21
+ .optional(),
22
+ });
23
+ UpdateInfraBillingNodeCommand.ResponseSchema = zod_1.z.object({
24
+ response: zod_1.z.object({
25
+ totalBillingNodes: zod_1.z.number(),
26
+ billingNodes: zod_1.z.array(models_1.InfraBillingNodeSchema),
27
+ availableBillingNodes: zod_1.z.array(models_1.InfraBillingAvailableNodeSchema),
28
+ totalAvailableBillingNodes: zod_1.z.number(),
29
+ }),
30
+ });
31
+ })(UpdateInfraBillingNodeCommand || (exports.UpdateInfraBillingNodeCommand = UpdateInfraBillingNodeCommand = {}));
@@ -655,4 +655,34 @@ exports.ERRORS = {
655
655
  message: 'Update infra provider error',
656
656
  httpCode: 500,
657
657
  },
658
+ CREATE_INFRA_BILLING_HISTORY_RECORD_ERROR: {
659
+ code: 'A132',
660
+ message: 'Create infra billing history record error',
661
+ httpCode: 500,
662
+ },
663
+ GET_INFRA_BILLING_HISTORY_RECORDS_ERROR: {
664
+ code: 'A133',
665
+ message: 'Get infra billing history records error',
666
+ httpCode: 500,
667
+ },
668
+ DELETE_INFRA_BILLING_HISTORY_RECORD_BY_UUID_ERROR: {
669
+ code: 'A134',
670
+ message: 'Delete infra billing history record by UUID error',
671
+ httpCode: 500,
672
+ },
673
+ GET_BILLING_NODES_ERROR: {
674
+ code: 'A135',
675
+ message: 'Get billing nodes error',
676
+ httpCode: 500,
677
+ },
678
+ UPDATE_INFRA_BILLING_NODE_ERROR: {
679
+ code: 'A136',
680
+ message: 'Update infra billing node error',
681
+ httpCode: 500,
682
+ },
683
+ CREATE_INFRA_BILLING_NODE_ERROR: {
684
+ code: 'A137',
685
+ message: 'Create infra billing node error',
686
+ httpCode: 500,
687
+ },
658
688
  };
@@ -24,6 +24,9 @@ __exportStar(require("./extented-users.schema"), exports);
24
24
  __exportStar(require("./happ.schema"), exports);
25
25
  __exportStar(require("./hosts.schema"), exports);
26
26
  __exportStar(require("./hwid-user-device.schema"), exports);
27
+ __exportStar(require("./infra-billing-available-node.schema"), exports);
28
+ __exportStar(require("./infra-billing-history-record.schema"), exports);
29
+ __exportStar(require("./infra-billing-node.schema"), exports);
27
30
  __exportStar(require("./infra-provider.schema"), exports);
28
31
  __exportStar(require("./internal-squad.schema"), exports);
29
32
  __exportStar(require("./last-connected-node.schema"), exports);
@@ -0,0 +1,9 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.InfraBillingAvailableNodeSchema = void 0;
4
+ const nodes_schema_1 = require("./nodes.schema");
5
+ exports.InfraBillingAvailableNodeSchema = nodes_schema_1.NodesSchema.pick({
6
+ uuid: true,
7
+ name: true,
8
+ countryCode: true,
9
+ });
@@ -0,0 +1,19 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.InfraBillingHistoryRecordSchema = void 0;
4
+ const zod_1 = require("zod");
5
+ const infra_provider_schema_1 = require("./infra-provider.schema");
6
+ exports.InfraBillingHistoryRecordSchema = zod_1.z.object({
7
+ uuid: zod_1.z.string().uuid(),
8
+ providerUuid: zod_1.z.string().uuid(),
9
+ amount: zod_1.z.number(),
10
+ billedAt: zod_1.z
11
+ .string()
12
+ .datetime()
13
+ .transform((str) => new Date(str)),
14
+ provider: infra_provider_schema_1.PartialInfraProviderSchema.omit({
15
+ createdAt: true,
16
+ updatedAt: true,
17
+ loginUrl: true,
18
+ }),
19
+ });
@@ -0,0 +1,34 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.InfraBillingNodeSchema = void 0;
4
+ const zod_1 = require("zod");
5
+ const infra_provider_schema_1 = require("./infra-provider.schema");
6
+ const nodes_schema_1 = require("./nodes.schema");
7
+ exports.InfraBillingNodeSchema = zod_1.z.object({
8
+ uuid: zod_1.z.string().uuid(),
9
+ nodeUuid: zod_1.z.string().uuid(),
10
+ providerUuid: zod_1.z.string().uuid(),
11
+ provider: infra_provider_schema_1.PartialInfraProviderSchema.omit({
12
+ createdAt: true,
13
+ updatedAt: true,
14
+ loginUrl: true,
15
+ faviconLink: true,
16
+ }),
17
+ node: nodes_schema_1.NodesSchema.pick({
18
+ uuid: true,
19
+ name: true,
20
+ countryCode: true,
21
+ }),
22
+ nextBillingAt: zod_1.z
23
+ .string()
24
+ .datetime()
25
+ .transform((str) => new Date(str)),
26
+ createdAt: zod_1.z
27
+ .string()
28
+ .datetime()
29
+ .transform((str) => new Date(str)),
30
+ updatedAt: zod_1.z
31
+ .string()
32
+ .datetime()
33
+ .transform((str) => new Date(str)),
34
+ });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@remnawave/backend-contract",
3
- "version": "2.0.0-alpha.11",
3
+ "version": "2.0.0-alpha.14",
4
4
  "public": true,
5
5
  "license": "AGPL-3.0-only",
6
6
  "description": "A contract library for Remnawave Backend. It can be used in backend and frontend.",