@veruna/api-contracts 2.0.1 → 3.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 (107) hide show
  1. package/build/controllers/analytics.controllers.d.ts +1 -0
  2. package/build/controllers/analytics.controllers.js +5 -0
  3. package/build/controllers/analytics.controllers.js.map +1 -0
  4. package/build/controllers/billing.controllers.d.ts +0 -2
  5. package/build/controllers/billing.controllers.js +1 -3
  6. package/build/controllers/billing.controllers.js.map +1 -1
  7. package/build/controllers/index.d.ts +3 -2
  8. package/build/controllers/index.js +4 -3
  9. package/build/controllers/index.js.map +1 -1
  10. package/build/controllers/wallet.controllers.d.ts +1 -0
  11. package/build/controllers/wallet.controllers.js +2 -1
  12. package/build/controllers/wallet.controllers.js.map +1 -1
  13. package/build/locales/validation.d.ts +7 -7
  14. package/build/locales/validation.js +7 -7
  15. package/build/rest-api.d.ts +7 -6
  16. package/build/rest-api.js +8 -7
  17. package/build/rest-api.js.map +1 -1
  18. package/build/routes/analytics.routes.d.ts +6 -0
  19. package/build/routes/analytics.routes.js +10 -0
  20. package/build/routes/analytics.routes.js.map +1 -0
  21. package/build/routes/billing.routes.d.ts +0 -8
  22. package/build/routes/billing.routes.js +1 -9
  23. package/build/routes/billing.routes.js.map +1 -1
  24. package/build/routes/index.d.ts +3 -2
  25. package/build/routes/index.js +4 -3
  26. package/build/routes/index.js.map +1 -1
  27. package/build/routes/wallet.routes.d.ts +3 -0
  28. package/build/routes/wallet.routes.js +4 -1
  29. package/build/routes/wallet.routes.js.map +1 -1
  30. package/build/tsconfig.tsbuildinfo +1 -1
  31. package/build/v1/analytics/analytics.errors.d.ts +5 -0
  32. package/build/v1/analytics/analytics.errors.js +14 -0
  33. package/build/v1/analytics/analytics.errors.js.map +1 -0
  34. package/build/v1/analytics/index.d.ts +5 -0
  35. package/build/v1/analytics/index.js +25 -0
  36. package/build/v1/analytics/index.js.map +1 -0
  37. package/build/v1/analytics/queries/index.d.ts +4 -0
  38. package/build/v1/analytics/queries/index.js +21 -0
  39. package/build/v1/analytics/queries/index.js.map +1 -0
  40. package/build/v1/analytics/queries/list-messages.query.d.ts +38 -0
  41. package/build/v1/analytics/queries/list-messages.query.js +14 -0
  42. package/build/v1/analytics/queries/list-messages.query.js.map +1 -0
  43. package/build/v1/analytics/queries/message-details.query.d.ts +40 -0
  44. package/build/v1/analytics/queries/message-details.query.js +17 -0
  45. package/build/v1/analytics/queries/message-details.query.js.map +1 -0
  46. package/build/v1/analytics/queries/requests-chart.query.d.ts +32 -0
  47. package/build/v1/analytics/queries/requests-chart.query.js +14 -0
  48. package/build/v1/analytics/queries/requests-chart.query.js.map +1 -0
  49. package/build/v1/analytics/queries/spend-chart.query.d.ts +32 -0
  50. package/build/v1/analytics/queries/spend-chart.query.js +14 -0
  51. package/build/v1/analytics/queries/spend-chart.query.js.map +1 -0
  52. package/build/v1/analytics/schemas/chart.schema.d.ts +57 -0
  53. package/build/v1/analytics/schemas/chart.schema.js +57 -0
  54. package/build/v1/analytics/schemas/chart.schema.js.map +1 -0
  55. package/build/v1/analytics/schemas/index.d.ts +2 -0
  56. package/build/v1/analytics/schemas/index.js +19 -0
  57. package/build/v1/analytics/schemas/index.js.map +1 -0
  58. package/build/v1/analytics/schemas/message.schema.d.ts +111 -0
  59. package/build/v1/analytics/schemas/message.schema.js +72 -0
  60. package/build/v1/analytics/schemas/message.schema.js.map +1 -0
  61. package/build/v1/billing/billing.errors.d.ts +1 -2
  62. package/build/v1/billing/billing.errors.js +0 -5
  63. package/build/v1/billing/billing.errors.js.map +1 -1
  64. package/build/v1/billing/index.d.ts +2 -2
  65. package/build/v1/billing/index.js +1 -3
  66. package/build/v1/billing/index.js.map +1 -1
  67. package/build/v1/billing/queries/index.d.ts +0 -3
  68. package/build/v1/billing/queries/index.js +0 -3
  69. package/build/v1/billing/queries/index.js.map +1 -1
  70. package/build/v1/billing/schemas/index.d.ts +0 -3
  71. package/build/v1/billing/schemas/index.js +0 -3
  72. package/build/v1/billing/schemas/index.js.map +1 -1
  73. package/build/v1/index.d.ts +1 -0
  74. package/build/v1/index.js +1 -0
  75. package/build/v1/index.js.map +1 -1
  76. package/build/v1/message/commands/create-message.command.d.ts +21 -0
  77. package/build/v1/message/queries/get-message-stream-reg.query.d.ts +19 -0
  78. package/build/v1/message/queries/get-message-stream-unreg.query.d.ts +19 -0
  79. package/build/v1/message/schemas/stream-events.schema.d.ts +42 -0
  80. package/build/v1/message/schemas/stream-events.schema.js +20 -1
  81. package/build/v1/message/schemas/stream-events.schema.js.map +1 -1
  82. package/build/v1/wallet/queries/get-balance-summary.query.d.ts +9 -0
  83. package/build/v1/wallet/schemas/balance-response.schema.d.ts +19 -0
  84. package/build/v1/wallet/schemas/balance-response.schema.js +11 -1
  85. package/build/v1/wallet/schemas/balance-response.schema.js.map +1 -1
  86. package/build/v1/wallet/schemas/index.d.ts +1 -1
  87. package/build/v1/wallet/schemas/index.js +2 -1
  88. package/build/v1/wallet/schemas/index.js.map +1 -1
  89. package/package.json +1 -1
  90. package/build/v1/billing/queries/get-billing-balance.query.d.ts +0 -23
  91. package/build/v1/billing/queries/get-billing-balance.query.js +0 -15
  92. package/build/v1/billing/queries/get-billing-balance.query.js.map +0 -1
  93. package/build/v1/billing/queries/get-message-billing-details.query.d.ts +0 -36
  94. package/build/v1/billing/queries/get-message-billing-details.query.js +0 -17
  95. package/build/v1/billing/queries/get-message-billing-details.query.js.map +0 -1
  96. package/build/v1/billing/queries/list-transactions.query.d.ts +0 -26
  97. package/build/v1/billing/queries/list-transactions.query.js +0 -14
  98. package/build/v1/billing/queries/list-transactions.query.js.map +0 -1
  99. package/build/v1/billing/schemas/billing-balance.schema.d.ts +0 -26
  100. package/build/v1/billing/schemas/billing-balance.schema.js +0 -21
  101. package/build/v1/billing/schemas/billing-balance.schema.js.map +0 -1
  102. package/build/v1/billing/schemas/billing-transactions.schema.d.ts +0 -34
  103. package/build/v1/billing/schemas/billing-transactions.schema.js +0 -34
  104. package/build/v1/billing/schemas/billing-transactions.schema.js.map +0 -1
  105. package/build/v1/billing/schemas/message-billing-details.schema.d.ts +0 -59
  106. package/build/v1/billing/schemas/message-billing-details.schema.js +0 -33
  107. package/build/v1/billing/schemas/message-billing-details.schema.js.map +0 -1
@@ -0,0 +1,72 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.UsageMessageDetailsResponseSchema = exports.UsageMessageStepSchema = exports.UsageMessagesListRequestSchema = exports.UsageMessagesListResponseSchema = exports.UsageMessageItemSchema = exports.UsageChatRefSchema = exports.UsageModelSummarySchema = exports.UsageFinishReasonSchema = exports.UsageFinishReason = void 0;
4
+ const zod_1 = require("zod");
5
+ const chart_schema_1 = require("./chart.schema");
6
+ var UsageFinishReason;
7
+ (function (UsageFinishReason) {
8
+ UsageFinishReason["COMPLETED"] = "completed";
9
+ UsageFinishReason["CANCELLED"] = "cancelled";
10
+ UsageFinishReason["TIMEOUT"] = "timeout";
11
+ UsageFinishReason["INSUFFICIENT_BALANCE"] = "insufficient_balance";
12
+ UsageFinishReason["ERROR"] = "error";
13
+ })(UsageFinishReason || (exports.UsageFinishReason = UsageFinishReason = {}));
14
+ exports.UsageFinishReasonSchema = zod_1.z.nativeEnum(UsageFinishReason);
15
+ exports.UsageModelSummarySchema = zod_1.z.object({
16
+ id: zod_1.z.string().uuid().nullable(),
17
+ title: zod_1.z.string().min(1).nullable(),
18
+ providerTitle: zod_1.z.string().nullable(),
19
+ });
20
+ exports.UsageChatRefSchema = zod_1.z.object({
21
+ id: zod_1.z.string().uuid(),
22
+ title: zod_1.z.string().nullable(),
23
+ });
24
+ exports.UsageMessageItemSchema = zod_1.z.object({
25
+ messageId: zod_1.z.string().uuid(),
26
+ chat: exports.UsageChatRefSchema,
27
+ createdAt: zod_1.z.string().datetime(),
28
+ durationMs: zod_1.z.number().int().nonnegative().nullable(),
29
+ model: exports.UsageModelSummarySchema,
30
+ stepsCount: zod_1.z.number().int().nonnegative(),
31
+ internalTotalPrice: zod_1.z.number().int().nonnegative(),
32
+ status: chart_schema_1.UsageMessageStatusSchema,
33
+ finishReason: exports.UsageFinishReasonSchema,
34
+ });
35
+ exports.UsageMessagesListResponseSchema = zod_1.z.object({
36
+ items: zod_1.z.array(exports.UsageMessageItemSchema),
37
+ nextCursor: zod_1.z.string().nullable(),
38
+ hasMore: zod_1.z.boolean(),
39
+ });
40
+ exports.UsageMessagesListRequestSchema = zod_1.z.object({
41
+ from: zod_1.z.string().datetime().optional(),
42
+ to: zod_1.z.string().datetime().optional(),
43
+ cursor: zod_1.z.string().max(512).optional(),
44
+ limit: zod_1.z.number().int().min(1).max(100).default(50),
45
+ modelIds: zod_1.z.array(zod_1.z.string().uuid()).max(50).optional(),
46
+ status: zod_1.z.array(chart_schema_1.UsageMessageStatusSchema).max(3).optional(),
47
+ });
48
+ exports.UsageMessageStepSchema = zod_1.z.object({
49
+ stepId: zod_1.z.string().uuid(),
50
+ type: zod_1.z.string().min(1),
51
+ status: zod_1.z.string().min(1),
52
+ index: zod_1.z.number().int().nonnegative(),
53
+ startedAt: zod_1.z.string().datetime().nullable(),
54
+ completedAt: zod_1.z.string().datetime().nullable(),
55
+ durationMs: zod_1.z.number().int().nonnegative().nullable(),
56
+ internalPriceTokens: zod_1.z.number().int().nonnegative(),
57
+ });
58
+ exports.UsageMessageDetailsResponseSchema = zod_1.z.object({
59
+ messageId: zod_1.z.string().uuid(),
60
+ chat: exports.UsageChatRefSchema,
61
+ createdAt: zod_1.z.string().datetime(),
62
+ updatedAt: zod_1.z.string().datetime(),
63
+ durationMs: zod_1.z.number().int().nonnegative().nullable(),
64
+ status: chart_schema_1.UsageMessageStatusSchema,
65
+ finishReason: exports.UsageFinishReasonSchema,
66
+ model: exports.UsageModelSummarySchema.extend({
67
+ canonicalId: zod_1.z.string().nullable(),
68
+ }),
69
+ internalTotalPrice: zod_1.z.number().int().nonnegative(),
70
+ steps: zod_1.z.array(exports.UsageMessageStepSchema),
71
+ });
72
+ //# sourceMappingURL=message.schema.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"message.schema.js","sourceRoot":"","sources":["../../../../v1/analytics/schemas/message.schema.ts"],"names":[],"mappings":";;;AAAA,6BAAwB;AACxB,iDAA0D;AAa1D,IAAY,iBAMX;AAND,WAAY,iBAAiB;IACzB,4CAAuB,CAAA;IACvB,4CAAuB,CAAA;IACvB,wCAAmB,CAAA;IACnB,kEAA6C,CAAA;IAC7C,oCAAe,CAAA;AACnB,CAAC,EANW,iBAAiB,iCAAjB,iBAAiB,QAM5B;AACY,QAAA,uBAAuB,GAAG,OAAC,CAAC,UAAU,CAAC,iBAAiB,CAAC,CAAC;AAY1D,QAAA,uBAAuB,GAAG,OAAC,CAAC,MAAM,CAAC;IAC5C,EAAE,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,IAAI,EAAE,CAAC,QAAQ,EAAE;IAChC,KAAK,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,QAAQ,EAAE;IACnC,aAAa,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;CACvC,CAAC,CAAC;AAWU,QAAA,kBAAkB,GAAG,OAAC,CAAC,MAAM,CAAC;IACvC,EAAE,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,IAAI,EAAE;IACrB,KAAK,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;CAC/B,CAAC,CAAC;AAUU,QAAA,sBAAsB,GAAG,OAAC,CAAC,MAAM,CAAC;IAC3C,SAAS,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,IAAI,EAAE;IAC5B,IAAI,EAAE,0BAAkB;IACxB,SAAS,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;IAChC,UAAU,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,GAAG,EAAE,CAAC,WAAW,EAAE,CAAC,QAAQ,EAAE;IACrD,KAAK,EAAE,+BAAuB;I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CAAC,WAAW,EAAE;IAClD,KAAK,EAAE,OAAC,CAAC,KAAK,CAAC,8BAAsB,CAAC;CACzC,CAAC,CAAC"}
@@ -10,7 +10,6 @@ export declare enum BillingErrorCode {
10
10
  HOLD_NOT_OWNED_BY_USER = "HOLD_NOT_OWNED_BY_USER",
11
11
  BILLING_FINALIZE_FAILED = "BILLING_FINALIZE_FAILED",
12
12
  INVALID_PERCENT = "INVALID_PERCENT",
13
- INVALID_AMOUNT_RANGE = "INVALID_AMOUNT_RANGE",
14
- MESSAGE_BILLING_NOT_FOUND = "MESSAGE_BILLING_NOT_FOUND"
13
+ INVALID_AMOUNT_RANGE = "INVALID_AMOUNT_RANGE"
15
14
  }
16
15
  export declare const BILLING_ERRORS: Record<BillingErrorCode, ErrorMetadata>;
@@ -14,7 +14,6 @@ var BillingErrorCode;
14
14
  BillingErrorCode["BILLING_FINALIZE_FAILED"] = "BILLING_FINALIZE_FAILED";
15
15
  BillingErrorCode["INVALID_PERCENT"] = "INVALID_PERCENT";
16
16
  BillingErrorCode["INVALID_AMOUNT_RANGE"] = "INVALID_AMOUNT_RANGE";
17
- BillingErrorCode["MESSAGE_BILLING_NOT_FOUND"] = "MESSAGE_BILLING_NOT_FOUND";
18
17
  })(BillingErrorCode || (exports.BillingErrorCode = BillingErrorCode = {}));
19
18
  exports.BILLING_ERRORS = {
20
19
  [BillingErrorCode.MARKUP_TIER_NOT_FOUND]: {
@@ -61,9 +60,5 @@ exports.BILLING_ERRORS = {
61
60
  code: BillingErrorCode.INVALID_AMOUNT_RANGE,
62
61
  statusCode: 400,
63
62
  },
64
- [BillingErrorCode.MESSAGE_BILLING_NOT_FOUND]: {
65
- code: BillingErrorCode.MESSAGE_BILLING_NOT_FOUND,
66
- statusCode: 404,
67
- },
68
63
  };
69
64
  //# sourceMappingURL=billing.errors.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"billing.errors.js","sourceRoot":"","sources":["../../../v1/billing/billing.errors.ts"],"names":[],"mappings":";;;AAEA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C,gBAAgB,CAAC,0BAA0B,CAAC,EAAE;QAC3C,IAAI,EAAE,gBAAgB,CAAC,0BAA0B;QACjD,UAAU,EAAE,GAAG;KAClB;IACD,CAAC,gBAAgB,CAAC,qBAAqB,CAAC,EAAE;QACtC,IAAI,EAAE,gBAAgB,CAAC,qBAAqB;QAC5C,UAAU,EAAE,GAAG;KAClB;IACD,CAAC,gBAAgB,CAAC,0BAA0B,CAAC,EAAE;QAC3C,IAAI,EAAE,gBAAgB,CAAC,0BAA0B;QACjD,UAAU,EAAE,GAAG;KAClB;IACD,CAAC,gBAAgB,CAAC,kBAAkB,CAAC,EAAE;QACnC,IAAI,EAAE,gBAAgB,CAAC,kBAAkB;QACzC,UAAU,EAAE,GAAG;KAClB;IACD,CAAC,gBAAgB,CAAC,aAAa,CAAC,EAAE;QAC9B,IAAI,EAAE,gBAAgB,CAAC,aAAa;QACpC,UAAU,EAAE,GAAG;KAClB;IACD,CAAC,gBAAgB,CAAC,sBAAsB,CAAC,EAAE;QACvC,IAAI,EAAE,gBAAgB,CAAC,sBAAsB;QAC7C,UAAU,EAAE,GAAG;KAClB;IACD,CAAC,gBAAgB,CAAC,uBAAuB,CAAC,EAAE;QACxC,IAAI,EAAE,gBAAgB,CAAC,uBAAuB;QAC9C,UAAU,EAAE,GAAG;KAClB;IACD,CAAC,gBAAgB,CAAC,eAAe,CAAC,EAAE;QAChC,IAAI,EAAE,gBAAgB,CAAC,eAAe;QACtC,UAAU,EAAE,GAAG;KAClB;IACD,CAAC,gBAAgB,CAAC,oBAAoB,CAAC,EAAE;QACrC,IAAI,EAAE,gBAAgB,CAAC,oBAAoB;QAC3C,UAAU,EAAE,GAAG;KAClB;CACK,CAAC"}
@@ -2,5 +2,5 @@ export * from './schemas';
2
2
  export * from './queries';
3
3
  export * from './commands';
4
4
  export * from './billing.errors';
5
- export { BILLING_CONTROLLER, ADMIN_BILLING_CONTROLLER, } from '../../controllers';
6
- export { BILLING_ROUTES, ADMIN_BILLING_ROUTES, } from '../../routes';
5
+ export { ADMIN_BILLING_CONTROLLER } from '../../controllers';
6
+ export { ADMIN_BILLING_ROUTES } from '../../routes';
@@ -14,15 +14,13 @@ 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
- exports.ADMIN_BILLING_ROUTES = exports.BILLING_ROUTES = exports.ADMIN_BILLING_CONTROLLER = exports.BILLING_CONTROLLER = void 0;
17
+ exports.ADMIN_BILLING_ROUTES = exports.ADMIN_BILLING_CONTROLLER = void 0;
18
18
  __exportStar(require("./schemas"), exports);
19
19
  __exportStar(require("./queries"), exports);
20
20
  __exportStar(require("./commands"), exports);
21
21
  __exportStar(require("./billing.errors"), exports);
22
22
  var controllers_1 = require("../../controllers");
23
- Object.defineProperty(exports, "BILLING_CONTROLLER", { enumerable: true, get: function () { return controllers_1.BILLING_CONTROLLER; } });
24
23
  Object.defineProperty(exports, "ADMIN_BILLING_CONTROLLER", { enumerable: true, get: function () { return controllers_1.ADMIN_BILLING_CONTROLLER; } });
25
24
  var routes_1 = require("../../routes");
26
- Object.defineProperty(exports, "BILLING_ROUTES", { enumerable: true, get: function () { return routes_1.BILLING_ROUTES; } });
27
25
  Object.defineProperty(exports, "ADMIN_BILLING_ROUTES", { enumerable: true, get: function () { return routes_1.ADMIN_BILLING_ROUTES; } });
28
26
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../v1/billing/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;AAAA,4CAA0B;AAC1B,4CAA0B;AAC1B,6CAA2B;AAC3B,mDAAiC;AACjC,iDAG2B;AAFvB,iHAAA,kBAAkB,OAAA;AAClB,uHAAA,wBAAwB,OAAA;AAE5B,uCAGsB;AAFlB,wGAAA,cAAc,OAAA;AACd,8GAAA,oBAAoB,OAAA"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../v1/billing/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;AAAA,4CAA0B;AAC1B,4CAA0B;AAC1B,6CAA2B;AAC3B,mDAAiC;AACjC,iDAA6D;AAApD,uHAAA,wBAAwB,OAAA;AACjC,uCAAoD;AAA3C,8GAAA,oBAAoB,OAAA"}
@@ -1,4 +1 @@
1
- export * from './get-billing-balance.query';
2
- export * from './list-transactions.query';
3
- export * from './get-message-billing-details.query';
4
1
  export * from './admin-list-markup-tiers.query';
@@ -14,8 +14,5 @@ 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("./get-billing-balance.query"), exports);
18
- __exportStar(require("./list-transactions.query"), exports);
19
- __exportStar(require("./get-message-billing-details.query"), exports);
20
17
  __exportStar(require("./admin-list-markup-tiers.query"), exports);
21
18
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../v1/billing/queries/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,8DAA4C;AAC5C,4DAA0C;AAC1C,sEAAoD;AACpD,kEAAgD"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../v1/billing/queries/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,kEAAgD"}
@@ -1,6 +1,3 @@
1
1
  export * from './markup-tier.schema';
2
- export * from './billing-balance.schema';
3
- export * from './billing-transactions.schema';
4
- export * from './message-billing-details.schema';
5
2
  export * from './finalization-action.enum';
6
3
  export * from './finalization-status.enum';
@@ -15,9 +15,6 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
15
15
  };
16
16
  Object.defineProperty(exports, "__esModule", { value: true });
17
17
  __exportStar(require("./markup-tier.schema"), exports);
18
- __exportStar(require("./billing-balance.schema"), exports);
19
- __exportStar(require("./billing-transactions.schema"), exports);
20
- __exportStar(require("./message-billing-details.schema"), exports);
21
18
  __exportStar(require("./finalization-action.enum"), exports);
22
19
  __exportStar(require("./finalization-status.enum"), exports);
23
20
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../v1/billing/schemas/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,uDAAqC;AACrC,2DAAyC;AACzC,gEAA8C;AAC9C,mEAAiD;AACjD,6DAA2C;AAC3C,6DAA2C"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../v1/billing/schemas/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,uDAAqC;AACrC,6DAA2C;AAC3C,6DAA2C"}
@@ -22,6 +22,7 @@ export * from './verification';
22
22
  export * from './sitemap';
23
23
  export * from './wallet';
24
24
  export * from './billing';
25
+ export * from './analytics';
25
26
  export * from './email-validation';
26
27
  export * from './s3';
27
28
  export * from './s2s';
package/build/v1/index.js CHANGED
@@ -38,6 +38,7 @@ __exportStar(require("./verification"), exports);
38
38
  __exportStar(require("./sitemap"), exports);
39
39
  __exportStar(require("./wallet"), exports);
40
40
  __exportStar(require("./billing"), exports);
41
+ __exportStar(require("./analytics"), exports);
41
42
  __exportStar(require("./email-validation"), exports);
42
43
  __exportStar(require("./s3"), exports);
43
44
  __exportStar(require("./s2s"), exports);
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../v1/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,2CAAyB;AACzB,yCAAuB;AACvB,uDAAqC;AACrC,yCAAuB;AACvB,0CAAwB;AACxB,0CAAwB;AACxB,kDAAgC;AAChC,sDAAoC;AACpC,gDAA8B;AAC9B,+CAA6B;AAC7B,yDAAuC;AACvC,oDAAkC;AAClC,8CAA4B;AAC5B,gDAA8B;AAC9B,6CAA2B;AAC3B,yCAAuB;AACvB,iDAA+B;AAC/B,yCAAuB;AACvB,4CAA0B;AAC1B,uCAAqB;AACrB,iDAA+B;AAC/B,4CAA0B;AAC1B,2CAAyB;AACzB,4CAA0B;AAC1B,qDAAmC;AACnC,uCAAqB;AACrB,wCAAsB;AACtB,kDAAgC;AAChC,qDAAmC;AACnC,iDAA+B;AAC/B,4CAA0B;AAC1B,+CAA6B;AAC7B,gDAA8B;AAC9B,mDAAiC;AACjC,+CAA6B;AAC7B,gDAA8B;AAC9B,2CAAyB;AACzB,yCAAuB;AACvB,0CAAwB;AACxB,+CAA6B;AAC7B,kDAAgC;AAChC,0CAAwB;AACxB,oDAAkC;AAClC,gDAA8B"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../v1/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,2CAAyB;AACzB,yCAAuB;AACvB,uDAAqC;AACrC,yCAAuB;AACvB,0CAAwB;AACxB,0CAAwB;AACxB,kDAAgC;AAChC,sDAAoC;AACpC,gDAA8B;AAC9B,+CAA6B;AAC7B,yDAAuC;AACvC,oDAAkC;AAClC,8CAA4B;AAC5B,gDAA8B;AAC9B,6CAA2B;AAC3B,yCAAuB;AACvB,iDAA+B;AAC/B,yCAAuB;AACvB,4CAA0B;AAC1B,uCAAqB;AACrB,iDAA+B;AAC/B,4CAA0B;AAC1B,2CAAyB;AACzB,4CAA0B;AAC1B,8CAA4B;AAC5B,qDAAmC;AACnC,uCAAqB;AACrB,wCAAsB;AACtB,kDAAgC;AAChC,qDAAmC;AACnC,iDAA+B;AAC/B,4CAA0B;AAC1B,+CAA6B;AAC7B,gDAA8B;AAC9B,mDAAiC;AACjC,+CAA6B;AAC7B,gDAA8B;AAC9B,2CAAyB;AACzB,yCAAuB;AACvB,0CAAwB;AACxB,+CAA6B;AAC7B,kDAAgC;AAChC,0CAAwB;AACxB,oDAAkC;AAClC,gDAA8B"}
@@ -153,21 +153,40 @@ export declare namespace CreateMessageCommand {
153
153
  }, z.core.$strip>, z.ZodObject<{
154
154
  type: z.ZodLiteral<import("../schemas").StreamEventType.HEARTBEAT>;
155
155
  timestamp: z.ZodString;
156
+ }, z.core.$strip>, z.ZodObject<{
157
+ id: z.ZodNumber;
158
+ chatId: z.ZodString;
159
+ messageId: z.ZodString;
160
+ type: z.ZodLiteral<import("../schemas").StreamEventType.BILLING_ESTIMATE>;
161
+ holdId: z.ZodString;
162
+ estimatedTokens: z.ZodNumber;
163
+ }, z.core.$strip>, z.ZodObject<{
164
+ id: z.ZodNumber;
165
+ chatId: z.ZodString;
166
+ messageId: z.ZodString;
167
+ type: z.ZodLiteral<import("../schemas").StreamEventType.STEP_BILLED>;
168
+ holdId: z.ZodString;
169
+ stepId: z.ZodString;
170
+ stepTokens: z.ZodNumber;
171
+ heldTokens: z.ZodNumber;
156
172
  }, z.core.$strip>, z.ZodObject<{
157
173
  id: z.ZodNumber;
158
174
  chatId: z.ZodString;
159
175
  messageId: z.ZodString;
160
176
  type: z.ZodLiteral<import("../schemas").StreamEventType.DONE>;
177
+ chargedTokens: z.ZodOptional<z.ZodNumber>;
161
178
  }, z.core.$strip>, z.ZodObject<{
162
179
  id: z.ZodNumber;
163
180
  chatId: z.ZodString;
164
181
  messageId: z.ZodString;
165
182
  type: z.ZodLiteral<import("../schemas").StreamEventType.CANCELLED>;
183
+ chargedTokens: z.ZodOptional<z.ZodNumber>;
166
184
  }, z.core.$strip>, z.ZodObject<{
167
185
  id: z.ZodNumber;
168
186
  chatId: z.ZodString;
169
187
  messageId: z.ZodString;
170
188
  type: z.ZodLiteral<import("../schemas").StreamEventType.ERROR>;
189
+ chargedTokens: z.ZodOptional<z.ZodNumber>;
171
190
  }, z.core.$strip>], "type">;
172
191
  const StepStartEvent: z.ZodObject<{
173
192
  id: z.ZodNumber;
@@ -282,12 +301,14 @@ export declare namespace CreateMessageCommand {
282
301
  chatId: z.ZodString;
283
302
  messageId: z.ZodString;
284
303
  type: z.ZodLiteral<import("../schemas").StreamEventType.DONE>;
304
+ chargedTokens: z.ZodOptional<z.ZodNumber>;
285
305
  }, z.core.$strip>;
286
306
  const ErrorEvent: z.ZodObject<{
287
307
  id: z.ZodNumber;
288
308
  chatId: z.ZodString;
289
309
  messageId: z.ZodString;
290
310
  type: z.ZodLiteral<import("../schemas").StreamEventType.ERROR>;
311
+ chargedTokens: z.ZodOptional<z.ZodNumber>;
291
312
  }, z.core.$strip>;
292
313
  const URL: (chatId: string) => string;
293
314
  const METHOD = HttpMethod.POST;
@@ -134,21 +134,40 @@ export declare namespace GetMessageStreamRegQuery {
134
134
  }, z.core.$strip>, z.ZodObject<{
135
135
  type: z.ZodLiteral<import("../schemas").StreamEventType.HEARTBEAT>;
136
136
  timestamp: z.ZodString;
137
+ }, z.core.$strip>, z.ZodObject<{
138
+ id: z.ZodNumber;
139
+ chatId: z.ZodString;
140
+ messageId: z.ZodString;
141
+ type: z.ZodLiteral<import("../schemas").StreamEventType.BILLING_ESTIMATE>;
142
+ holdId: z.ZodString;
143
+ estimatedTokens: z.ZodNumber;
144
+ }, z.core.$strip>, z.ZodObject<{
145
+ id: z.ZodNumber;
146
+ chatId: z.ZodString;
147
+ messageId: z.ZodString;
148
+ type: z.ZodLiteral<import("../schemas").StreamEventType.STEP_BILLED>;
149
+ holdId: z.ZodString;
150
+ stepId: z.ZodString;
151
+ stepTokens: z.ZodNumber;
152
+ heldTokens: z.ZodNumber;
137
153
  }, z.core.$strip>, z.ZodObject<{
138
154
  id: z.ZodNumber;
139
155
  chatId: z.ZodString;
140
156
  messageId: z.ZodString;
141
157
  type: z.ZodLiteral<import("../schemas").StreamEventType.DONE>;
158
+ chargedTokens: z.ZodOptional<z.ZodNumber>;
142
159
  }, z.core.$strip>, z.ZodObject<{
143
160
  id: z.ZodNumber;
144
161
  chatId: z.ZodString;
145
162
  messageId: z.ZodString;
146
163
  type: z.ZodLiteral<import("../schemas").StreamEventType.CANCELLED>;
164
+ chargedTokens: z.ZodOptional<z.ZodNumber>;
147
165
  }, z.core.$strip>, z.ZodObject<{
148
166
  id: z.ZodNumber;
149
167
  chatId: z.ZodString;
150
168
  messageId: z.ZodString;
151
169
  type: z.ZodLiteral<import("../schemas").StreamEventType.ERROR>;
170
+ chargedTokens: z.ZodOptional<z.ZodNumber>;
152
171
  }, z.core.$strip>], "type">;
153
172
  const URL: (chatId: string, messageId: string) => string;
154
173
  const METHOD = HttpMethod.GET;
@@ -134,21 +134,40 @@ export declare namespace GetMessageStreamUnregQuery {
134
134
  }, z.core.$strip>, z.ZodObject<{
135
135
  type: z.ZodLiteral<import("../schemas").StreamEventType.HEARTBEAT>;
136
136
  timestamp: z.ZodString;
137
+ }, z.core.$strip>, z.ZodObject<{
138
+ id: z.ZodNumber;
139
+ chatId: z.ZodString;
140
+ messageId: z.ZodString;
141
+ type: z.ZodLiteral<import("../schemas").StreamEventType.BILLING_ESTIMATE>;
142
+ holdId: z.ZodString;
143
+ estimatedTokens: z.ZodNumber;
144
+ }, z.core.$strip>, z.ZodObject<{
145
+ id: z.ZodNumber;
146
+ chatId: z.ZodString;
147
+ messageId: z.ZodString;
148
+ type: z.ZodLiteral<import("../schemas").StreamEventType.STEP_BILLED>;
149
+ holdId: z.ZodString;
150
+ stepId: z.ZodString;
151
+ stepTokens: z.ZodNumber;
152
+ heldTokens: z.ZodNumber;
137
153
  }, z.core.$strip>, z.ZodObject<{
138
154
  id: z.ZodNumber;
139
155
  chatId: z.ZodString;
140
156
  messageId: z.ZodString;
141
157
  type: z.ZodLiteral<import("../schemas").StreamEventType.DONE>;
158
+ chargedTokens: z.ZodOptional<z.ZodNumber>;
142
159
  }, z.core.$strip>, z.ZodObject<{
143
160
  id: z.ZodNumber;
144
161
  chatId: z.ZodString;
145
162
  messageId: z.ZodString;
146
163
  type: z.ZodLiteral<import("../schemas").StreamEventType.CANCELLED>;
164
+ chargedTokens: z.ZodOptional<z.ZodNumber>;
147
165
  }, z.core.$strip>, z.ZodObject<{
148
166
  id: z.ZodNumber;
149
167
  chatId: z.ZodString;
150
168
  messageId: z.ZodString;
151
169
  type: z.ZodLiteral<import("../schemas").StreamEventType.ERROR>;
170
+ chargedTokens: z.ZodOptional<z.ZodNumber>;
152
171
  }, z.core.$strip>], "type">;
153
172
  const URL: (chatId: string, messageId: string) => string;
154
173
  const METHOD = HttpMethod.GET;
@@ -9,6 +9,8 @@ export declare enum StreamEventType {
9
9
  IMAGE_GENERATION_ERROR = "image_generation_error",
10
10
  CITATIONS = "citations",
11
11
  HEARTBEAT = "heartbeat",
12
+ BILLING_ESTIMATE = "billing_estimate",
13
+ STEP_BILLED = "step_billed",
12
14
  DONE = "done",
13
15
  CANCELLED = "cancelled",
14
16
  ERROR = "error"
@@ -121,23 +123,44 @@ export declare const StreamStepDoneEventSchema: z.ZodObject<{
121
123
  imageUrls: z.ZodArray<z.ZodString>;
122
124
  }, z.core.$strip>, z.ZodObject<{}, z.core.$strip>]>>;
123
125
  }, z.core.$strip>;
126
+ export declare const StreamBillingEstimateEventSchema: z.ZodObject<{
127
+ id: z.ZodNumber;
128
+ chatId: z.ZodString;
129
+ messageId: z.ZodString;
130
+ type: z.ZodLiteral<StreamEventType.BILLING_ESTIMATE>;
131
+ holdId: z.ZodString;
132
+ estimatedTokens: z.ZodNumber;
133
+ }, z.core.$strip>;
134
+ export declare const StreamStepBilledEventSchema: z.ZodObject<{
135
+ id: z.ZodNumber;
136
+ chatId: z.ZodString;
137
+ messageId: z.ZodString;
138
+ type: z.ZodLiteral<StreamEventType.STEP_BILLED>;
139
+ holdId: z.ZodString;
140
+ stepId: z.ZodString;
141
+ stepTokens: z.ZodNumber;
142
+ heldTokens: z.ZodNumber;
143
+ }, z.core.$strip>;
124
144
  export declare const StreamDoneEventSchema: z.ZodObject<{
125
145
  id: z.ZodNumber;
126
146
  chatId: z.ZodString;
127
147
  messageId: z.ZodString;
128
148
  type: z.ZodLiteral<StreamEventType.DONE>;
149
+ chargedTokens: z.ZodOptional<z.ZodNumber>;
129
150
  }, z.core.$strip>;
130
151
  export declare const StreamCancelledEventSchema: z.ZodObject<{
131
152
  id: z.ZodNumber;
132
153
  chatId: z.ZodString;
133
154
  messageId: z.ZodString;
134
155
  type: z.ZodLiteral<StreamEventType.CANCELLED>;
156
+ chargedTokens: z.ZodOptional<z.ZodNumber>;
135
157
  }, z.core.$strip>;
136
158
  export declare const StreamErrorEventSchema: z.ZodObject<{
137
159
  id: z.ZodNumber;
138
160
  chatId: z.ZodString;
139
161
  messageId: z.ZodString;
140
162
  type: z.ZodLiteral<StreamEventType.ERROR>;
163
+ chargedTokens: z.ZodOptional<z.ZodNumber>;
141
164
  }, z.core.$strip>;
142
165
  export declare const StreamImageEventSchema: z.ZodObject<{
143
166
  id: z.ZodNumber;
@@ -303,19 +326,38 @@ export declare const StreamEventSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
303
326
  }, z.core.$strip>, z.ZodObject<{
304
327
  type: z.ZodLiteral<StreamEventType.HEARTBEAT>;
305
328
  timestamp: z.ZodString;
329
+ }, z.core.$strip>, z.ZodObject<{
330
+ id: z.ZodNumber;
331
+ chatId: z.ZodString;
332
+ messageId: z.ZodString;
333
+ type: z.ZodLiteral<StreamEventType.BILLING_ESTIMATE>;
334
+ holdId: z.ZodString;
335
+ estimatedTokens: z.ZodNumber;
336
+ }, z.core.$strip>, z.ZodObject<{
337
+ id: z.ZodNumber;
338
+ chatId: z.ZodString;
339
+ messageId: z.ZodString;
340
+ type: z.ZodLiteral<StreamEventType.STEP_BILLED>;
341
+ holdId: z.ZodString;
342
+ stepId: z.ZodString;
343
+ stepTokens: z.ZodNumber;
344
+ heldTokens: z.ZodNumber;
306
345
  }, z.core.$strip>, z.ZodObject<{
307
346
  id: z.ZodNumber;
308
347
  chatId: z.ZodString;
309
348
  messageId: z.ZodString;
310
349
  type: z.ZodLiteral<StreamEventType.DONE>;
350
+ chargedTokens: z.ZodOptional<z.ZodNumber>;
311
351
  }, z.core.$strip>, z.ZodObject<{
312
352
  id: z.ZodNumber;
313
353
  chatId: z.ZodString;
314
354
  messageId: z.ZodString;
315
355
  type: z.ZodLiteral<StreamEventType.CANCELLED>;
356
+ chargedTokens: z.ZodOptional<z.ZodNumber>;
316
357
  }, z.core.$strip>, z.ZodObject<{
317
358
  id: z.ZodNumber;
318
359
  chatId: z.ZodString;
319
360
  messageId: z.ZodString;
320
361
  type: z.ZodLiteral<StreamEventType.ERROR>;
362
+ chargedTokens: z.ZodOptional<z.ZodNumber>;
321
363
  }, z.core.$strip>], "type">;
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.StreamEventSchema = exports.StreamHeartbeatEventSchema = exports.StreamCitationsEventSchema = exports.StreamImageGenerationErrorEventSchema = exports.StreamImageEventSchema = exports.StreamErrorEventSchema = exports.StreamCancelledEventSchema = exports.StreamDoneEventSchema = exports.StreamStepDoneEventSchema = exports.StreamStepErrorEventSchema = exports.StreamStepChunkEventSchema = exports.StreamStepStartEventSchema = exports.StreamEventType = void 0;
3
+ exports.StreamEventSchema = exports.StreamHeartbeatEventSchema = exports.StreamCitationsEventSchema = exports.StreamImageGenerationErrorEventSchema = exports.StreamImageEventSchema = exports.StreamErrorEventSchema = exports.StreamCancelledEventSchema = exports.StreamDoneEventSchema = exports.StreamStepBilledEventSchema = exports.StreamBillingEstimateEventSchema = exports.StreamStepDoneEventSchema = exports.StreamStepErrorEventSchema = exports.StreamStepChunkEventSchema = exports.StreamStepStartEventSchema = exports.StreamEventType = void 0;
4
4
  const zod_1 = require("zod");
5
5
  const generation_step_schema_1 = require("./generation-step.schema");
6
6
  const citation_schema_1 = require("./citation.schema");
@@ -16,6 +16,8 @@ var StreamEventType;
16
16
  StreamEventType["IMAGE_GENERATION_ERROR"] = "image_generation_error";
17
17
  StreamEventType["CITATIONS"] = "citations";
18
18
  StreamEventType["HEARTBEAT"] = "heartbeat";
19
+ StreamEventType["BILLING_ESTIMATE"] = "billing_estimate";
20
+ StreamEventType["STEP_BILLED"] = "step_billed";
19
21
  StreamEventType["DONE"] = "done";
20
22
  StreamEventType["CANCELLED"] = "cancelled";
21
23
  StreamEventType["ERROR"] = "error";
@@ -56,14 +58,29 @@ exports.StreamStepDoneEventSchema = BaseStreamEventSchema.extend({
56
58
  structuredContent: zod_1.z.record(zod_1.z.string(), zod_1.z.unknown()).optional(),
57
59
  metadata: step_metadata_schema_1.StepDoneMetadataSchema,
58
60
  });
61
+ exports.StreamBillingEstimateEventSchema = BaseStreamEventSchema.extend({
62
+ type: zod_1.z.literal(StreamEventType.BILLING_ESTIMATE),
63
+ holdId: zod_1.z.string().uuid(),
64
+ estimatedTokens: zod_1.z.number().int().nonnegative(),
65
+ });
66
+ exports.StreamStepBilledEventSchema = BaseStreamEventSchema.extend({
67
+ type: zod_1.z.literal(StreamEventType.STEP_BILLED),
68
+ holdId: zod_1.z.string().uuid(),
69
+ stepId: zod_1.z.string().uuid(),
70
+ stepTokens: zod_1.z.number().int().nonnegative(),
71
+ heldTokens: zod_1.z.number().int().nonnegative(),
72
+ });
59
73
  exports.StreamDoneEventSchema = BaseStreamEventSchema.extend({
60
74
  type: zod_1.z.literal(StreamEventType.DONE),
75
+ chargedTokens: zod_1.z.number().int().nonnegative().optional(),
61
76
  });
62
77
  exports.StreamCancelledEventSchema = BaseStreamEventSchema.extend({
63
78
  type: zod_1.z.literal(StreamEventType.CANCELLED),
79
+ chargedTokens: zod_1.z.number().int().nonnegative().optional(),
64
80
  });
65
81
  exports.StreamErrorEventSchema = BaseStreamEventSchema.extend({
66
82
  type: zod_1.z.literal(StreamEventType.ERROR),
83
+ chargedTokens: zod_1.z.number().int().nonnegative().optional(),
67
84
  });
68
85
  exports.StreamImageEventSchema = BaseStreamEventSchema.extend({
69
86
  type: zod_1.z.literal(StreamEventType.IMAGE),
@@ -91,6 +108,8 @@ exports.StreamEventSchema = zod_1.z.discriminatedUnion('type', [
91
108
  exports.StreamImageGenerationErrorEventSchema,
92
109
  exports.StreamCitationsEventSchema,
93
110
  exports.StreamHeartbeatEventSchema,
111
+ exports.StreamBillingEstimateEventSchema,
112
+ exports.StreamStepBilledEventSchema,
94
113
  exports.StreamDoneEventSchema,
95
114
  exports.StreamCancelledEventSchema,
96
115
  exports.StreamErrorEventSchema,
@@ -1 +1 @@
1
- {"version":3,"file":"stream-events.schema.js","sourceRoot":"","sources":["../../../../v1/message/schemas/stream-events.schema.ts"],"names":[],"mappings":";;;AAAA,6BAAwB;AACxB,qEAA8D;AAC9D,uDAAmD;AACnD,iEAGgC;AAChC,6EAAuE;AAKvE,IAAY,eAuBX;AAvBD,WAAY,eAAe;IAEvB,4CAAyB,CAAA;IAEzB,4CAAyB,CAAA;IAEzB,4CAAyB,CAAA;IAEzB,0CAAuB,CAAA;IAEvB,kCAAe,CAAA;IAEf,oEAAiD,CAAA;IAEjD,0CAAuB,CAAA;IAEvB,0CAAuB,CAAA;IAEvB,gCAAa,CAAA;IAEb,0CAAuB,CAAA;IAEvB,kCAAe,CAAA;AACnB,CAAC,EAvBW,eAAe,+BAAf,eAAe,QAuB1B;AAMD,MAAM,qBAAqB,GAAG,OAAC,CAAC,MAAM,CAAC;IAEnC,EAAE,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,GAAG,EAAE,CAAC,QAAQ,EAAE;IAE/B,MAAM,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,IAAI,EAAE;IAEzB,SAAS,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,IAAI,EAAE;CAC/B,CAAC,CAAC;AASU,QAAA,0BAA0B,GAAG,qBAAqB,CAAC,MAAM,CAAC;IACnE,IAAI,EAAE,OAAC,CAAC,OAAO,CAAC,eAAe,CAAC,UAAU,CAAC;IAE3C,QAAQ,EAAE,OAAC,CAAC,UAAU,CAAC,2CAAkB,CAAC;IAE1C,MAAM,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,IAAI,EAAE;IAEzB,SAAS,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,GAAG,EAAE,CAAC,WAAW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AAC,OAAO,CAAC,eAAe,CAAC,sBAAsB,CAAC;CAC1D,CAAC,CAAC;AAKU,QAAA,0BAA0B,GAAG,qBAAqB,CAAC,MAAM,CAAC;IACnE,IAAI,EAAE,OAAC,CAAC,OAAO,CAAC,eAAe,CAAC,SAAS,CAAC;IAE1C,SAAS,EAAE,OAAC,CAAC,KAAK,CAAC,gCAAc,CAAC;CACrC,CAAC,CAAC;AAMU,QAAA,0BAA0B,GAAG,OAAC,CAAC,MAAM,CAAC;IAC/C,IAAI,EAAE,OAAC,CAAC,OAAO,CAAC,eAAe,CAAC,SAAS,CAAC;IAE1C,SAAS,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;CACnC,CAAC,CAAC;AAUU,QAAA,iBAAiB,GAAG,OAAC,CAAC,kBAAkB,CAAC,MAAM,EAAE;IAC1D,kCAA0B;IAC1B,kCAA0B;IAC1B,kCAA0B;IAC1B,iCAAyB;IACzB,8BAAsB;IACtB,6CAAqC;IACrC,kCAA0B;IAC1B,kCAA0B;IAC1B,wCAAgC;IAChC,mCAA2B;IAC3B,6BAAqB;IACrB,kCAA0B;IAC1B,8BAAsB;CACzB,CAAC,CAAC"}
@@ -17,6 +17,15 @@ export declare namespace GetBalanceSummaryQuery {
17
17
  expiresAt: z.ZodNullable<z.ZodString>;
18
18
  createdAt: z.ZodString;
19
19
  }, z.core.$strip>>;
20
+ activeHolds: z.ZodArray<z.ZodObject<{
21
+ holdId: z.ZodString;
22
+ amount: z.ZodString;
23
+ operationType: z.ZodString;
24
+ operationId: z.ZodString;
25
+ description: z.ZodNullable<z.ZodString>;
26
+ createdAt: z.ZodString;
27
+ expiresAt: z.ZodNullable<z.ZodString>;
28
+ }, z.core.$strip>>;
20
29
  }, z.core.$strip>;
21
30
  const URL: "/api/v1/wallet/balance";
22
31
  const METHOD = HttpMethod.GET;
@@ -11,6 +11,15 @@ export declare const BalanceItemResponseSchema: z.ZodObject<{
11
11
  expiresAt: z.ZodNullable<z.ZodString>;
12
12
  createdAt: z.ZodString;
13
13
  }, z.core.$strip>;
14
+ export declare const BalanceActiveHoldSchema: z.ZodObject<{
15
+ holdId: z.ZodString;
16
+ amount: z.ZodString;
17
+ operationType: z.ZodString;
18
+ operationId: z.ZodString;
19
+ description: z.ZodNullable<z.ZodString>;
20
+ createdAt: z.ZodString;
21
+ expiresAt: z.ZodNullable<z.ZodString>;
22
+ }, z.core.$strip>;
14
23
  export declare const BalanceSummaryResponseSchema: z.ZodObject<{
15
24
  userId: z.ZodString;
16
25
  totalAvailable: z.ZodString;
@@ -26,6 +35,16 @@ export declare const BalanceSummaryResponseSchema: z.ZodObject<{
26
35
  expiresAt: z.ZodNullable<z.ZodString>;
27
36
  createdAt: z.ZodString;
28
37
  }, z.core.$strip>>;
38
+ activeHolds: z.ZodArray<z.ZodObject<{
39
+ holdId: z.ZodString;
40
+ amount: z.ZodString;
41
+ operationType: z.ZodString;
42
+ operationId: z.ZodString;
43
+ description: z.ZodNullable<z.ZodString>;
44
+ createdAt: z.ZodString;
45
+ expiresAt: z.ZodNullable<z.ZodString>;
46
+ }, z.core.$strip>>;
29
47
  }, z.core.$strip>;
30
48
  export type BalanceItemResponse = z.infer<typeof BalanceItemResponseSchema>;
49
+ export type BalanceActiveHold = z.infer<typeof BalanceActiveHoldSchema>;
31
50
  export type BalanceSummaryResponse = z.infer<typeof BalanceSummaryResponseSchema>;
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.BalanceSummaryResponseSchema = exports.BalanceItemResponseSchema = void 0;
3
+ exports.BalanceSummaryResponseSchema = exports.BalanceActiveHoldSchema = exports.BalanceItemResponseSchema = void 0;
4
4
  const zod_1 = require("zod");
5
5
  const shared_1 = require("../../../shared");
6
6
  const balance_status_enum_1 = require("./balance-status.enum");
@@ -15,10 +15,20 @@ exports.BalanceItemResponseSchema = zod_1.z.object({
15
15
  expiresAt: zod_1.z.string().datetime().nullable(),
16
16
  createdAt: zod_1.z.string().datetime(),
17
17
  });
18
+ exports.BalanceActiveHoldSchema = zod_1.z.object({
19
+ holdId: zod_1.z.string().regex(shared_1.UUID_REGEX),
20
+ amount: shared_1.BigIntStringSchema,
21
+ operationType: zod_1.z.string(),
22
+ operationId: zod_1.z.string(),
23
+ description: zod_1.z.string().nullable(),
24
+ createdAt: zod_1.z.string().datetime(),
25
+ expiresAt: zod_1.z.string().datetime().nullable(),
26
+ });
18
27
  exports.BalanceSummaryResponseSchema = zod_1.z.object({
19
28
  userId: zod_1.z.string().uuid(),
20
29
  totalAvailable: shared_1.BigIntStringSchema,
21
30
  totalHeld: shared_1.BigIntStringSchema,
22
31
  balances: zod_1.z.array(exports.BalanceItemResponseSchema),
32
+ activeHolds: zod_1.z.array(exports.BalanceActiveHoldSchema),
23
33
  });
24
34
  //# sourceMappingURL=balance-response.schema.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"balance-response.schema.js","sourceRoot":"","sources":["../../../../v1/wallet/schemas/balance-response.schema.ts"],"names":[],"mappings":";;;AAAA,6BAAwB;AACxB,4CAAqD;AACrD,+DAAsD;AAMzC,QAAA,yBAAyB,GAAG,OAAC,CAAC,MAAM,CAAC;IAC9C,EAAE,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,IAAI,EAAE;IACrB,QAAQ,EAAE,OAAC,CAAC,MAAM,EAAE;IACpB,QAAQ,EAAE,OAAC,CAAC,MAAM,EAAE;IACpB,MAAM,EAAE,2BAAkB;IAC1B,IAAI,EAAE,2BAAkB;IACxB,SAAS,EAAE,2BAAkB;IAC7B,MAAM,EAAE,OAAC,CAAC,UAAU,CAAC,mCAAa,CAAC;IACnC,SAAS,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE,CAAC,QAAQ,EAAE;IAC3C,SAAS,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;CACnC,CAAC,CAAC;AAOU,QAAA,4BAA4B,GAAG,OAAC,CAAC,MAAM,CAA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CAAC,QAAQ,EAAE,CAAC,QAAQ,EAAE;CAC9C,CAAC,CAAC;AAOU,QAAA,4BAA4B,GAAG,OAAC,CAAC,MAAM,CAAC;IACjD,MAAM,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,IAAI,EAAE;IACzB,cAAc,EAAE,2BAAkB;IAClC,SAAS,EAAE,2BAAkB;IAC7B,QAAQ,EAAE,OAAC,CAAC,KAAK,CAAC,iCAAyB,CAAC;IAC5C,WAAW,EAAE,OAAC,CAAC,KAAK,CAAC,+BAAuB,CAAC;CAChD,CAAC,CAAC"}
@@ -4,5 +4,5 @@ export { HoldStatus } from './hold-status.enum';
4
4
  export { TransactionType, isValidTransactionType } from './transaction-type.enum';
5
5
  export { SourceType } from './source-type.enum';
6
6
  export { InitiatorType } from './initiator-type.enum';
7
- export { BalanceItemResponseSchema, BalanceSummaryResponseSchema, type BalanceItemResponse, type BalanceSummaryResponse, } from './balance-response.schema';
7
+ export { BalanceItemResponseSchema, BalanceActiveHoldSchema, BalanceSummaryResponseSchema, type BalanceItemResponse, type BalanceActiveHold, type BalanceSummaryResponse, } from './balance-response.schema';
8
8
  export { MetadataSchema, validateMetadata, MAX_METADATA_SIZE, MAX_NESTING_DEPTH, MAX_METADATA_KEYS, type Metadata, } from './metadata.schema';