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

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 (37) 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 +31 -0
  4. package/build/backend/commands/infra-billing/delete-bill-record-by-uuid.command.d.ts +119 -0
  5. package/build/backend/commands/infra-billing/delete-bill-record-by-uuid.command.d.ts.map +1 -0
  6. package/build/backend/commands/infra-billing/delete-bill-record-by-uuid.command.js +22 -0
  7. package/build/backend/commands/infra-billing/get-bill-records.command.d.ts +122 -0
  8. package/build/backend/commands/infra-billing/get-bill-records.command.d.ts.map +1 -0
  9. package/build/backend/commands/infra-billing/get-bill-records.command.js +31 -0
  10. package/build/backend/commands/infra-billing/index.d.ts +3 -0
  11. package/build/backend/commands/infra-billing/index.d.ts.map +1 -1
  12. package/build/backend/commands/infra-billing/index.js +3 -0
  13. package/build/backend/commands/nodes/actions/disable.command.d.ts +36 -36
  14. package/build/backend/commands/nodes/actions/enable.command.d.ts +36 -36
  15. package/build/backend/commands/nodes/actions/reorder.command.d.ts +36 -36
  16. package/build/backend/commands/nodes/create.command.d.ts +38 -38
  17. package/build/backend/commands/nodes/get-all.command.d.ts +36 -36
  18. package/build/backend/commands/nodes/get-one.command.d.ts +36 -36
  19. package/build/backend/commands/nodes/update.command.d.ts +38 -38
  20. package/build/backend/constants/errors/errors.d.ts +15 -0
  21. package/build/backend/constants/errors/errors.d.ts.map +1 -1
  22. package/build/backend/constants/errors/errors.js +15 -0
  23. package/build/backend/models/index.d.ts +1 -0
  24. package/build/backend/models/index.d.ts.map +1 -1
  25. package/build/backend/models/index.js +1 -0
  26. package/build/backend/models/infra-billing-history-record.schema.d.ts +44 -0
  27. package/build/backend/models/infra-billing-history-record.schema.d.ts.map +1 -0
  28. package/build/backend/models/infra-billing-history-record.schema.js +19 -0
  29. package/build/backend/models/nodes.schema.d.ts +18 -18
  30. package/build/frontend/commands/infra-billing/create-bill-record.command.js +31 -0
  31. package/build/frontend/commands/infra-billing/delete-bill-record-by-uuid.command.js +22 -0
  32. package/build/frontend/commands/infra-billing/get-bill-records.command.js +31 -0
  33. package/build/frontend/commands/infra-billing/index.js +3 -0
  34. package/build/frontend/constants/errors/errors.js +15 -0
  35. package/build/frontend/models/index.js +1 -0
  36. package/build/frontend/models/infra-billing-history-record.schema.js +19 -0
  37. package/package.json +1 -1
@@ -103,13 +103,13 @@ export declare namespace UpdateNodeCommand {
103
103
  countryCode?: string | undefined;
104
104
  trafficLimitBytes?: number | undefined;
105
105
  address?: string | undefined;
106
+ providerUuid?: string | null | undefined;
106
107
  isTrafficTrackingActive?: boolean | undefined;
107
108
  trafficResetDay?: number | undefined;
108
109
  notifyPercent?: number | undefined;
109
110
  consumptionMultiplier?: number | undefined;
110
111
  activeConfigProfileUuid?: string | undefined;
111
112
  activeInbounds?: string[] | undefined;
112
- providerUuid?: string | null | undefined;
113
113
  }, {
114
114
  uuid: string;
115
115
  name?: string | undefined;
@@ -117,13 +117,13 @@ export declare namespace UpdateNodeCommand {
117
117
  countryCode?: string | undefined;
118
118
  trafficLimitBytes?: number | undefined;
119
119
  address?: string | undefined;
120
+ providerUuid?: string | null | undefined;
120
121
  isTrafficTrackingActive?: boolean | undefined;
121
122
  trafficResetDay?: number | undefined;
122
123
  notifyPercent?: number | undefined;
123
124
  consumptionMultiplier?: number | undefined;
124
125
  activeConfigProfileUuid?: string | undefined;
125
126
  activeInbounds?: string[] | undefined;
126
- providerUuid?: string | null | undefined;
127
127
  }>;
128
128
  type Request = z.infer<typeof RequestSchema>;
129
129
  const ResponseSchema: z.ZodObject<{
@@ -218,6 +218,15 @@ export declare namespace UpdateNodeCommand {
218
218
  viewPosition: number;
219
219
  address: string;
220
220
  isDisabled: boolean;
221
+ providerUuid: string | null;
222
+ provider: {
223
+ uuid: string;
224
+ createdAt: Date;
225
+ updatedAt: Date;
226
+ name: string;
227
+ faviconLink: string | null;
228
+ loginUrl: string | null;
229
+ } | null;
221
230
  isConnected: boolean;
222
231
  isConnecting: boolean;
223
232
  isNodeOnline: boolean;
@@ -246,15 +255,6 @@ export declare namespace UpdateNodeCommand {
246
255
  port: number | null;
247
256
  rawInbound?: unknown;
248
257
  }[] | null;
249
- providerUuid: string | null;
250
- provider: {
251
- uuid: string;
252
- createdAt: Date;
253
- updatedAt: Date;
254
- name: string;
255
- faviconLink: string | null;
256
- loginUrl: string | null;
257
- } | null;
258
258
  }, {
259
259
  uuid: string;
260
260
  createdAt: string;
@@ -266,6 +266,15 @@ export declare namespace UpdateNodeCommand {
266
266
  viewPosition: number;
267
267
  address: string;
268
268
  isDisabled: boolean;
269
+ providerUuid: string | null;
270
+ provider: {
271
+ uuid: string;
272
+ createdAt: string;
273
+ updatedAt: string;
274
+ name: string;
275
+ faviconLink: string | null;
276
+ loginUrl: string | null;
277
+ } | null;
269
278
  isConnected: boolean;
270
279
  isConnecting: boolean;
271
280
  isNodeOnline: boolean;
@@ -294,15 +303,6 @@ export declare namespace UpdateNodeCommand {
294
303
  port: number | null;
295
304
  rawInbound?: unknown;
296
305
  }[] | null;
297
- providerUuid: string | null;
298
- provider: {
299
- uuid: string;
300
- createdAt: string;
301
- updatedAt: string;
302
- name: string;
303
- faviconLink: string | null;
304
- loginUrl: string | null;
305
- } | null;
306
306
  }>;
307
307
  }, "strip", z.ZodTypeAny, {
308
308
  response: {
@@ -316,6 +316,15 @@ export declare namespace UpdateNodeCommand {
316
316
  viewPosition: number;
317
317
  address: string;
318
318
  isDisabled: boolean;
319
+ providerUuid: string | null;
320
+ provider: {
321
+ uuid: string;
322
+ createdAt: Date;
323
+ updatedAt: Date;
324
+ name: string;
325
+ faviconLink: string | null;
326
+ loginUrl: string | null;
327
+ } | null;
319
328
  isConnected: boolean;
320
329
  isConnecting: boolean;
321
330
  isNodeOnline: boolean;
@@ -344,15 +353,6 @@ export declare namespace UpdateNodeCommand {
344
353
  port: number | null;
345
354
  rawInbound?: unknown;
346
355
  }[] | null;
347
- providerUuid: string | null;
348
- provider: {
349
- uuid: string;
350
- createdAt: Date;
351
- updatedAt: Date;
352
- name: string;
353
- faviconLink: string | null;
354
- loginUrl: string | null;
355
- } | null;
356
356
  };
357
357
  }, {
358
358
  response: {
@@ -366,6 +366,15 @@ export declare namespace UpdateNodeCommand {
366
366
  viewPosition: number;
367
367
  address: string;
368
368
  isDisabled: boolean;
369
+ providerUuid: string | null;
370
+ provider: {
371
+ uuid: string;
372
+ createdAt: string;
373
+ updatedAt: string;
374
+ name: string;
375
+ faviconLink: string | null;
376
+ loginUrl: string | null;
377
+ } | null;
369
378
  isConnected: boolean;
370
379
  isConnecting: boolean;
371
380
  isNodeOnline: boolean;
@@ -394,15 +403,6 @@ export declare namespace UpdateNodeCommand {
394
403
  port: number | null;
395
404
  rawInbound?: unknown;
396
405
  }[] | null;
397
- providerUuid: string | null;
398
- provider: {
399
- uuid: string;
400
- createdAt: string;
401
- updatedAt: string;
402
- name: string;
403
- faviconLink: string | null;
404
- loginUrl: string | null;
405
- } | null;
406
406
  };
407
407
  }>;
408
408
  type Response = z.infer<typeof ResponseSchema>;
@@ -684,5 +684,20 @@ export declare const ERRORS: {
684
684
  readonly message: "Update infra provider error";
685
685
  readonly httpCode: 500;
686
686
  };
687
+ readonly CREATE_INFRA_BILLING_HISTORY_RECORD_ERROR: {
688
+ readonly code: "A132";
689
+ readonly message: "Create infra billing history record error";
690
+ readonly httpCode: 500;
691
+ };
692
+ readonly GET_INFRA_BILLING_HISTORY_RECORDS_ERROR: {
693
+ readonly code: "A133";
694
+ readonly message: "Get infra billing history records error";
695
+ readonly httpCode: 500;
696
+ };
697
+ readonly DELETE_INFRA_BILLING_HISTORY_RECORD_BY_UUID_ERROR: {
698
+ readonly code: "A134";
699
+ readonly message: "Delete infra billing history record by UUID error";
700
+ readonly httpCode: 500;
701
+ };
687
702
  };
688
703
  //# sourceMappingURL=errors.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"errors.d.ts","sourceRoot":"","sources":["../../../../constants/errors/errors.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,MAAM;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;wCAwJY,MAAM;;;;;;;;;;wCAUN,MAAM;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;wCA4IN,MAAM;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAkW3B,CAAC"}
1
+ {"version":3,"file":"errors.d.ts","sourceRoot":"","sources":["../../../../constants/errors/errors.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,MAAM;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;wCAwJY,MAAM;;;;;;;;;;wCAUN,MAAM;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;wCA4IN,MAAM;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAiX3B,CAAC"}
@@ -655,4 +655,19 @@ 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
+ },
658
673
  };
@@ -8,6 +8,7 @@ export * from './extented-users.schema';
8
8
  export * from './happ.schema';
9
9
  export * from './hosts.schema';
10
10
  export * from './hwid-user-device.schema';
11
+ export * from './infra-billing-history-record.schema';
11
12
  export * from './infra-provider.schema';
12
13
  export * from './internal-squad.schema';
13
14
  export * from './last-connected-node.schema';
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../models/index.ts"],"names":[],"mappings":"AAAA,cAAc,qBAAqB,CAAC;AACpC,cAAc,eAAe,CAAC;AAC9B,cAAc,8BAA8B,CAAC;AAC7C,cAAc,oBAAoB,CAAC;AACnC,cAAc,kCAAkC,CAAC;AACjD,cAAc,yBAAyB,CAAC;AACxC,cAAc,yBAAyB,CAAC;AACxC,cAAc,eAAe,CAAC;AAC9B,cAAc,gBAAgB,CAAC;AAC/B,cAAc,2BAA2B,CAAC;AAC1C,cAAc,yBAAyB,CAAC;AACxC,cAAc,yBAAyB,CAAC;AACxC,cAAc,8BAA8B,CAAC;AAC7C,cAAc,gBAAgB,CAAC;AAC/B,cAAc,gCAAgC,CAAC;AAC/C,cAAc,gBAAgB,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../models/index.ts"],"names":[],"mappings":"AAAA,cAAc,qBAAqB,CAAC;AACpC,cAAc,eAAe,CAAC;AAC9B,cAAc,8BAA8B,CAAC;AAC7C,cAAc,oBAAoB,CAAC;AACnC,cAAc,kCAAkC,CAAC;AACjD,cAAc,yBAAyB,CAAC;AACxC,cAAc,yBAAyB,CAAC;AACxC,cAAc,eAAe,CAAC;AAC9B,cAAc,gBAAgB,CAAC;AAC/B,cAAc,2BAA2B,CAAC;AAC1C,cAAc,uCAAuC,CAAC;AACtD,cAAc,yBAAyB,CAAC;AACxC,cAAc,yBAAyB,CAAC;AACxC,cAAc,8BAA8B,CAAC;AAC7C,cAAc,gBAAgB,CAAC;AAC/B,cAAc,gCAAgC,CAAC;AAC/C,cAAc,gBAAgB,CAAC"}
@@ -24,6 +24,7 @@ __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-history-record.schema"), exports);
27
28
  __exportStar(require("./infra-provider.schema"), exports);
28
29
  __exportStar(require("./internal-squad.schema"), exports);
29
30
  __exportStar(require("./last-connected-node.schema"), exports);
@@ -0,0 +1,44 @@
1
+ import { z } from 'zod';
2
+ export declare const InfraBillingHistoryRecordSchema: z.ZodObject<{
3
+ uuid: z.ZodString;
4
+ providerUuid: z.ZodString;
5
+ amount: z.ZodNumber;
6
+ billedAt: z.ZodEffects<z.ZodString, Date, string>;
7
+ provider: z.ZodObject<Omit<{
8
+ uuid: z.ZodString;
9
+ name: z.ZodString;
10
+ faviconLink: z.ZodNullable<z.ZodString>;
11
+ loginUrl: z.ZodNullable<z.ZodString>;
12
+ createdAt: z.ZodEffects<z.ZodString, Date, string>;
13
+ updatedAt: z.ZodEffects<z.ZodString, Date, string>;
14
+ }, "createdAt" | "updatedAt" | "loginUrl">, "strip", z.ZodTypeAny, {
15
+ uuid: string;
16
+ name: string;
17
+ faviconLink: string | null;
18
+ }, {
19
+ uuid: string;
20
+ name: string;
21
+ faviconLink: string | null;
22
+ }>;
23
+ }, "strip", z.ZodTypeAny, {
24
+ uuid: string;
25
+ providerUuid: string;
26
+ amount: number;
27
+ billedAt: Date;
28
+ provider: {
29
+ uuid: string;
30
+ name: string;
31
+ faviconLink: string | null;
32
+ };
33
+ }, {
34
+ uuid: string;
35
+ providerUuid: string;
36
+ amount: number;
37
+ billedAt: string;
38
+ provider: {
39
+ uuid: string;
40
+ name: string;
41
+ faviconLink: string | null;
42
+ };
43
+ }>;
44
+ //# sourceMappingURL=infra-billing-history-record.schema.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"infra-billing-history-record.schema.d.ts","sourceRoot":"","sources":["../../../models/infra-billing-history-record.schema.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAIxB,eAAO,MAAM,+BAA+B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAa1C,CAAC"}
@@ -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
+ });
@@ -90,6 +90,15 @@ export declare const NodesSchema: z.ZodObject<{
90
90
  viewPosition: number;
91
91
  address: string;
92
92
  isDisabled: boolean;
93
+ providerUuid: string | null;
94
+ provider: {
95
+ uuid: string;
96
+ createdAt: Date;
97
+ updatedAt: Date;
98
+ name: string;
99
+ faviconLink: string | null;
100
+ loginUrl: string | null;
101
+ } | null;
93
102
  isConnected: boolean;
94
103
  isConnecting: boolean;
95
104
  isNodeOnline: boolean;
@@ -118,15 +127,6 @@ export declare const NodesSchema: z.ZodObject<{
118
127
  port: number | null;
119
128
  rawInbound?: unknown;
120
129
  }[] | null;
121
- providerUuid: string | null;
122
- provider: {
123
- uuid: string;
124
- createdAt: Date;
125
- updatedAt: Date;
126
- name: string;
127
- faviconLink: string | null;
128
- loginUrl: string | null;
129
- } | null;
130
130
  }, {
131
131
  uuid: string;
132
132
  createdAt: string;
@@ -138,6 +138,15 @@ export declare const NodesSchema: z.ZodObject<{
138
138
  viewPosition: number;
139
139
  address: string;
140
140
  isDisabled: boolean;
141
+ providerUuid: string | null;
142
+ provider: {
143
+ uuid: string;
144
+ createdAt: string;
145
+ updatedAt: string;
146
+ name: string;
147
+ faviconLink: string | null;
148
+ loginUrl: string | null;
149
+ } | null;
141
150
  isConnected: boolean;
142
151
  isConnecting: boolean;
143
152
  isNodeOnline: boolean;
@@ -166,14 +175,5 @@ export declare const NodesSchema: z.ZodObject<{
166
175
  port: number | null;
167
176
  rawInbound?: unknown;
168
177
  }[] | null;
169
- providerUuid: string | null;
170
- provider: {
171
- uuid: string;
172
- createdAt: string;
173
- updatedAt: string;
174
- name: string;
175
- faviconLink: string | null;
176
- loginUrl: string | null;
177
- } | null;
178
178
  }>;
179
179
  //# sourceMappingURL=nodes.schema.d.ts.map
@@ -0,0 +1,31 @@
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
+ .optional()
23
+ .describe('Billing date. Format: 2025-01-17T15:38:45.065Z'),
24
+ });
25
+ CreateInfraBillingHistoryRecordCommand.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
+ })(CreateInfraBillingHistoryRecordCommand || (exports.CreateInfraBillingHistoryRecordCommand = CreateInfraBillingHistoryRecordCommand = {}));
@@ -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,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 = {}));
@@ -14,8 +14,11 @@ 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);
17
18
  __exportStar(require("./create-infra-provider.command"), exports);
19
+ __exportStar(require("./delete-bill-record-by-uuid.command"), exports);
18
20
  __exportStar(require("./delete-infra-provider-by-uuid.command"), exports);
21
+ __exportStar(require("./get-bill-records.command"), exports);
19
22
  __exportStar(require("./get-infra-provider-by-uuid.command"), exports);
20
23
  __exportStar(require("./get-infra-providers.command"), exports);
21
24
  __exportStar(require("./update-infra-provider.command"), exports);
@@ -655,4 +655,19 @@ 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
+ },
658
673
  };
@@ -24,6 +24,7 @@ __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-history-record.schema"), exports);
27
28
  __exportStar(require("./infra-provider.schema"), exports);
28
29
  __exportStar(require("./internal-squad.schema"), exports);
29
30
  __exportStar(require("./last-connected-node.schema"), exports);
@@ -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
+ });
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.12",
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.",