@cesteral/dbm-mcp 1.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (227) hide show
  1. package/LICENSE.md +201 -0
  2. package/README.md +197 -0
  3. package/dist/config/index.d.ts +112 -0
  4. package/dist/config/index.d.ts.map +1 -0
  5. package/dist/config/index.js +55 -0
  6. package/dist/config/index.js.map +1 -0
  7. package/dist/generated/compatibility-rules.d.ts +26 -0
  8. package/dist/generated/compatibility-rules.d.ts.map +1 -0
  9. package/dist/generated/compatibility-rules.js +142 -0
  10. package/dist/generated/compatibility-rules.js.map +1 -0
  11. package/dist/generated/filters.d.ts +19 -0
  12. package/dist/generated/filters.d.ts.map +1 -0
  13. package/dist/generated/filters.js +2541 -0
  14. package/dist/generated/filters.js.map +1 -0
  15. package/dist/generated/index.d.ts +5 -0
  16. package/dist/generated/index.d.ts.map +1 -0
  17. package/dist/generated/index.js +5 -0
  18. package/dist/generated/index.js.map +1 -0
  19. package/dist/generated/metrics.d.ts +28 -0
  20. package/dist/generated/metrics.d.ts.map +1 -0
  21. package/dist/generated/metrics.js +961 -0
  22. package/dist/generated/metrics.js.map +1 -0
  23. package/dist/generated/report-types.d.ts +14 -0
  24. package/dist/generated/report-types.d.ts.map +1 -0
  25. package/dist/generated/report-types.js +94 -0
  26. package/dist/generated/report-types.js.map +1 -0
  27. package/dist/index.d.ts +3 -0
  28. package/dist/index.d.ts.map +1 -0
  29. package/dist/index.js +51 -0
  30. package/dist/index.js.map +1 -0
  31. package/dist/mcp-server/prompts/definitions/cross-platform-campaign-setup.prompt.d.ts +4 -0
  32. package/dist/mcp-server/prompts/definitions/cross-platform-campaign-setup.prompt.d.ts.map +1 -0
  33. package/dist/mcp-server/prompts/definitions/cross-platform-campaign-setup.prompt.js +299 -0
  34. package/dist/mcp-server/prompts/definitions/cross-platform-campaign-setup.prompt.js.map +1 -0
  35. package/dist/mcp-server/prompts/definitions/cross-platform-performance.prompt.d.ts +4 -0
  36. package/dist/mcp-server/prompts/definitions/cross-platform-performance.prompt.d.ts.map +1 -0
  37. package/dist/mcp-server/prompts/definitions/cross-platform-performance.prompt.js +170 -0
  38. package/dist/mcp-server/prompts/definitions/cross-platform-performance.prompt.js.map +1 -0
  39. package/dist/mcp-server/prompts/definitions/custom-query-workflow.prompt.d.ts +4 -0
  40. package/dist/mcp-server/prompts/definitions/custom-query-workflow.prompt.d.ts.map +1 -0
  41. package/dist/mcp-server/prompts/definitions/custom-query-workflow.prompt.js +164 -0
  42. package/dist/mcp-server/prompts/definitions/custom-query-workflow.prompt.js.map +1 -0
  43. package/dist/mcp-server/prompts/definitions/pacing-performance-analysis.prompt.d.ts +4 -0
  44. package/dist/mcp-server/prompts/definitions/pacing-performance-analysis.prompt.d.ts.map +1 -0
  45. package/dist/mcp-server/prompts/definitions/pacing-performance-analysis.prompt.js +204 -0
  46. package/dist/mcp-server/prompts/definitions/pacing-performance-analysis.prompt.js.map +1 -0
  47. package/dist/mcp-server/prompts/definitions/tool-schema-exploration.prompt.d.ts +4 -0
  48. package/dist/mcp-server/prompts/definitions/tool-schema-exploration.prompt.d.ts.map +1 -0
  49. package/dist/mcp-server/prompts/definitions/tool-schema-exploration.prompt.js +66 -0
  50. package/dist/mcp-server/prompts/definitions/tool-schema-exploration.prompt.js.map +1 -0
  51. package/dist/mcp-server/prompts/definitions/troubleshoot-report.prompt.d.ts +4 -0
  52. package/dist/mcp-server/prompts/definitions/troubleshoot-report.prompt.d.ts.map +1 -0
  53. package/dist/mcp-server/prompts/definitions/troubleshoot-report.prompt.js +179 -0
  54. package/dist/mcp-server/prompts/definitions/troubleshoot-report.prompt.js.map +1 -0
  55. package/dist/mcp-server/prompts/definitions/types.d.ts +15 -0
  56. package/dist/mcp-server/prompts/definitions/types.d.ts.map +1 -0
  57. package/dist/mcp-server/prompts/definitions/types.js +2 -0
  58. package/dist/mcp-server/prompts/definitions/types.js.map +1 -0
  59. package/dist/mcp-server/prompts/index.d.ts +6 -0
  60. package/dist/mcp-server/prompts/index.d.ts.map +1 -0
  61. package/dist/mcp-server/prompts/index.js +57 -0
  62. package/dist/mcp-server/prompts/index.js.map +1 -0
  63. package/dist/mcp-server/resources/definitions/compatibility-rules.resource.d.ts +3 -0
  64. package/dist/mcp-server/resources/definitions/compatibility-rules.resource.d.ts.map +1 -0
  65. package/dist/mcp-server/resources/definitions/compatibility-rules.resource.js +130 -0
  66. package/dist/mcp-server/resources/definitions/compatibility-rules.resource.js.map +1 -0
  67. package/dist/mcp-server/resources/definitions/filter-types.resource.d.ts +4 -0
  68. package/dist/mcp-server/resources/definitions/filter-types.resource.d.ts.map +1 -0
  69. package/dist/mcp-server/resources/definitions/filter-types.resource.js +198 -0
  70. package/dist/mcp-server/resources/definitions/filter-types.resource.js.map +1 -0
  71. package/dist/mcp-server/resources/definitions/index.d.ts +8 -0
  72. package/dist/mcp-server/resources/definitions/index.d.ts.map +1 -0
  73. package/dist/mcp-server/resources/definitions/index.js +49 -0
  74. package/dist/mcp-server/resources/definitions/index.js.map +1 -0
  75. package/dist/mcp-server/resources/definitions/metric-types.resource.d.ts +4 -0
  76. package/dist/mcp-server/resources/definitions/metric-types.resource.d.ts.map +1 -0
  77. package/dist/mcp-server/resources/definitions/metric-types.resource.js +221 -0
  78. package/dist/mcp-server/resources/definitions/metric-types.resource.js.map +1 -0
  79. package/dist/mcp-server/resources/definitions/query-examples.resource.d.ts +169 -0
  80. package/dist/mcp-server/resources/definitions/query-examples.resource.d.ts.map +1 -0
  81. package/dist/mcp-server/resources/definitions/query-examples.resource.js +261 -0
  82. package/dist/mcp-server/resources/definitions/query-examples.resource.js.map +1 -0
  83. package/dist/mcp-server/resources/definitions/report-types.resource.d.ts +3 -0
  84. package/dist/mcp-server/resources/definitions/report-types.resource.d.ts.map +1 -0
  85. package/dist/mcp-server/resources/definitions/report-types.resource.js +198 -0
  86. package/dist/mcp-server/resources/definitions/report-types.resource.js.map +1 -0
  87. package/dist/mcp-server/resources/index.d.ts +3 -0
  88. package/dist/mcp-server/resources/index.d.ts.map +1 -0
  89. package/dist/mcp-server/resources/index.js +2 -0
  90. package/dist/mcp-server/resources/index.js.map +1 -0
  91. package/dist/mcp-server/resources/types.d.ts +16 -0
  92. package/dist/mcp-server/resources/types.d.ts.map +1 -0
  93. package/dist/mcp-server/resources/types.js +2 -0
  94. package/dist/mcp-server/resources/types.js.map +1 -0
  95. package/dist/mcp-server/server.d.ts +5 -0
  96. package/dist/mcp-server/server.d.ts.map +1 -0
  97. package/dist/mcp-server/server.js +115 -0
  98. package/dist/mcp-server/server.js.map +1 -0
  99. package/dist/mcp-server/tools/definitions/get-campaign-delivery.tool.d.ts +89 -0
  100. package/dist/mcp-server/tools/definitions/get-campaign-delivery.tool.d.ts.map +1 -0
  101. package/dist/mcp-server/tools/definitions/get-campaign-delivery.tool.js +128 -0
  102. package/dist/mcp-server/tools/definitions/get-campaign-delivery.tool.js.map +1 -0
  103. package/dist/mcp-server/tools/definitions/get-historical-metrics.tool.d.ts +155 -0
  104. package/dist/mcp-server/tools/definitions/get-historical-metrics.tool.d.ts.map +1 -0
  105. package/dist/mcp-server/tools/definitions/get-historical-metrics.tool.js +160 -0
  106. package/dist/mcp-server/tools/definitions/get-historical-metrics.tool.js.map +1 -0
  107. package/dist/mcp-server/tools/definitions/get-pacing-status.tool.d.ts +138 -0
  108. package/dist/mcp-server/tools/definitions/get-pacing-status.tool.d.ts.map +1 -0
  109. package/dist/mcp-server/tools/definitions/get-pacing-status.tool.js +171 -0
  110. package/dist/mcp-server/tools/definitions/get-pacing-status.tool.js.map +1 -0
  111. package/dist/mcp-server/tools/definitions/get-performance-metrics.tool.d.ts +122 -0
  112. package/dist/mcp-server/tools/definitions/get-performance-metrics.tool.d.ts.map +1 -0
  113. package/dist/mcp-server/tools/definitions/get-performance-metrics.tool.js +143 -0
  114. package/dist/mcp-server/tools/definitions/get-performance-metrics.tool.js.map +1 -0
  115. package/dist/mcp-server/tools/definitions/index.d.ts +8 -0
  116. package/dist/mcp-server/tools/definitions/index.d.ts.map +1 -0
  117. package/dist/mcp-server/tools/definitions/index.js +23 -0
  118. package/dist/mcp-server/tools/definitions/index.js.map +1 -0
  119. package/dist/mcp-server/tools/definitions/run-custom-query-async.tool.d.ts +4 -0
  120. package/dist/mcp-server/tools/definitions/run-custom-query-async.tool.d.ts.map +1 -0
  121. package/dist/mcp-server/tools/definitions/run-custom-query-async.tool.js +46 -0
  122. package/dist/mcp-server/tools/definitions/run-custom-query-async.tool.js.map +1 -0
  123. package/dist/mcp-server/tools/definitions/run-custom-query.tool.d.ts +186 -0
  124. package/dist/mcp-server/tools/definitions/run-custom-query.tool.d.ts.map +1 -0
  125. package/dist/mcp-server/tools/definitions/run-custom-query.tool.js +202 -0
  126. package/dist/mcp-server/tools/definitions/run-custom-query.tool.js.map +1 -0
  127. package/dist/mcp-server/tools/index.d.ts +2 -0
  128. package/dist/mcp-server/tools/index.d.ts.map +1 -0
  129. package/dist/mcp-server/tools/index.js +2 -0
  130. package/dist/mcp-server/tools/index.js.map +1 -0
  131. package/dist/mcp-server/tools/utils/query-validation.d.ts +44 -0
  132. package/dist/mcp-server/tools/utils/query-validation.d.ts.map +1 -0
  133. package/dist/mcp-server/tools/utils/query-validation.js +107 -0
  134. package/dist/mcp-server/tools/utils/query-validation.js.map +1 -0
  135. package/dist/mcp-server/tools/utils/resolve-session.d.ts +4 -0
  136. package/dist/mcp-server/tools/utils/resolve-session.d.ts.map +1 -0
  137. package/dist/mcp-server/tools/utils/resolve-session.js +6 -0
  138. package/dist/mcp-server/tools/utils/resolve-session.js.map +1 -0
  139. package/dist/mcp-server/transports/streamable-http-transport.d.ts +55 -0
  140. package/dist/mcp-server/transports/streamable-http-transport.d.ts.map +1 -0
  141. package/dist/mcp-server/transports/streamable-http-transport.js +55 -0
  142. package/dist/mcp-server/transports/streamable-http-transport.js.map +1 -0
  143. package/dist/services/bid-manager/BidManagerService.d.ts +68 -0
  144. package/dist/services/bid-manager/BidManagerService.d.ts.map +1 -0
  145. package/dist/services/bid-manager/BidManagerService.js +464 -0
  146. package/dist/services/bid-manager/BidManagerService.js.map +1 -0
  147. package/dist/services/bid-manager/auth-bridge.d.ts +6 -0
  148. package/dist/services/bid-manager/auth-bridge.d.ts.map +1 -0
  149. package/dist/services/bid-manager/auth-bridge.js +13 -0
  150. package/dist/services/bid-manager/auth-bridge.js.map +1 -0
  151. package/dist/services/bid-manager/client.d.ts +4 -0
  152. package/dist/services/bid-manager/client.d.ts.map +1 -0
  153. package/dist/services/bid-manager/client.js +2 -0
  154. package/dist/services/bid-manager/client.js.map +1 -0
  155. package/dist/services/bid-manager/index.d.ts +6 -0
  156. package/dist/services/bid-manager/index.d.ts.map +1 -0
  157. package/dist/services/bid-manager/index.js +4 -0
  158. package/dist/services/bid-manager/index.js.map +1 -0
  159. package/dist/services/bid-manager/report-parser.d.ts +26 -0
  160. package/dist/services/bid-manager/report-parser.d.ts.map +1 -0
  161. package/dist/services/bid-manager/report-parser.js +141 -0
  162. package/dist/services/bid-manager/report-parser.js.map +1 -0
  163. package/dist/services/bid-manager/types.d.ts +668 -0
  164. package/dist/services/bid-manager/types.d.ts.map +1 -0
  165. package/dist/services/bid-manager/types.js +256 -0
  166. package/dist/services/bid-manager/types.js.map +1 -0
  167. package/dist/services/session-services.d.ts +12 -0
  168. package/dist/services/session-services.d.ts.map +1 -0
  169. package/dist/services/session-services.js +18 -0
  170. package/dist/services/session-services.js.map +1 -0
  171. package/dist/types-global/bid-manager.d.ts +76 -0
  172. package/dist/types-global/bid-manager.d.ts.map +1 -0
  173. package/dist/types-global/bid-manager.js +2 -0
  174. package/dist/types-global/bid-manager.js.map +1 -0
  175. package/dist/types-global/index.d.ts +2 -0
  176. package/dist/types-global/index.d.ts.map +1 -0
  177. package/dist/types-global/index.js +2 -0
  178. package/dist/types-global/index.js.map +1 -0
  179. package/dist/types-global/mcp.d.ts +2 -0
  180. package/dist/types-global/mcp.d.ts.map +1 -0
  181. package/dist/types-global/mcp.js +2 -0
  182. package/dist/types-global/mcp.js.map +1 -0
  183. package/dist/utils/date.d.ts +2 -0
  184. package/dist/utils/date.d.ts.map +1 -0
  185. package/dist/utils/date.js +7 -0
  186. package/dist/utils/date.js.map +1 -0
  187. package/dist/utils/errors/bid-manager-errors.d.ts +57 -0
  188. package/dist/utils/errors/bid-manager-errors.d.ts.map +1 -0
  189. package/dist/utils/errors/bid-manager-errors.js +119 -0
  190. package/dist/utils/errors/bid-manager-errors.js.map +1 -0
  191. package/dist/utils/errors/index.d.ts +3 -0
  192. package/dist/utils/errors/index.d.ts.map +1 -0
  193. package/dist/utils/errors/index.js +3 -0
  194. package/dist/utils/errors/index.js.map +1 -0
  195. package/dist/utils/index.d.ts +4 -0
  196. package/dist/utils/index.d.ts.map +1 -0
  197. package/dist/utils/index.js +4 -0
  198. package/dist/utils/index.js.map +1 -0
  199. package/dist/utils/math.d.ts +9 -0
  200. package/dist/utils/math.d.ts.map +1 -0
  201. package/dist/utils/math.js +38 -0
  202. package/dist/utils/math.js.map +1 -0
  203. package/dist/utils/metrics.d.ts +21 -0
  204. package/dist/utils/metrics.d.ts.map +1 -0
  205. package/dist/utils/metrics.js +92 -0
  206. package/dist/utils/metrics.js.map +1 -0
  207. package/dist/utils/platform.d.ts +3 -0
  208. package/dist/utils/platform.d.ts.map +1 -0
  209. package/dist/utils/platform.js +5 -0
  210. package/dist/utils/platform.js.map +1 -0
  211. package/dist/utils/security/index.d.ts +2 -0
  212. package/dist/utils/security/index.d.ts.map +1 -0
  213. package/dist/utils/security/index.js +2 -0
  214. package/dist/utils/security/index.js.map +1 -0
  215. package/dist/utils/security/rate-limiter.d.ts +3 -0
  216. package/dist/utils/security/rate-limiter.d.ts.map +1 -0
  217. package/dist/utils/security/rate-limiter.js +5 -0
  218. package/dist/utils/security/rate-limiter.js.map +1 -0
  219. package/dist/utils/telemetry/index.d.ts +2 -0
  220. package/dist/utils/telemetry/index.d.ts.map +1 -0
  221. package/dist/utils/telemetry/index.js +2 -0
  222. package/dist/utils/telemetry/index.js.map +1 -0
  223. package/dist/utils/telemetry/tracing.d.ts +3 -0
  224. package/dist/utils/telemetry/tracing.d.ts.map +1 -0
  225. package/dist/utils/telemetry/tracing.js +4 -0
  226. package/dist/utils/telemetry/tracing.js.map +1 -0
  227. package/package.json +60 -0
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/services/bid-manager/types.ts"],"names":[],"mappings":"AAUA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAUxB,eAAO,MAAM,gBAAgB,yJAS3B,CAAC;AACH,MAAM,MAAM,UAAU,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,gBAAgB,CAAC,CAAC;AAM1D,eAAO,MAAM,eAAe,yUAoB1B,CAAC;AACH,MAAM,MAAM,SAAS,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,eAAe,CAAC,CAAC;AAKxD,eAAO,MAAM,kBAAkB,4BAA0B,CAAC;AAC1D,MAAM,MAAM,YAAY,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,kBAAkB,CAAC,CAAC;AAK9D,eAAO,MAAM,gBAAgB,ovBAiD3B,CAAC;AACH,MAAM,MAAM,UAAU,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,gBAAgB,CAAC,CAAC;AAK1D,eAAO,MAAM,gBAAgB,woDAsE3B,CAAC;AACH,MAAM,MAAM,UAAU,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,gBAAgB,CAAC,CAAC;AAM1D,eAAO,MAAM,kBAAkB,yEAM7B,CAAC;AACH,MAAM,MAAM,YAAY,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,kBAAkB,CAAC,CAAC;AAS9D,eAAO,MAAM,gBAAgB;;;;;;;;;;;;EAI3B,CAAC;AACH,MAAM,MAAM,UAAU,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,gBAAgB,CAAC,CAAC;AAK1D,eAAO,MAAM,iBAAiB;;;;;;;;;EAG5B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;;;;;;;;;;;;EAKzC,CAAC;AACH,MAAM,MAAM,wBAAwB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,8BAA8B,CAAC,CAAC;AAMtF,eAAO,MAAM,4BAA4B;;;;;;;;;;;;;;;;;;EAMvC,CAAC;AACH,MAAM,MAAM,sBAAsB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,4BAA4B,CAAC,CAAC;AAUlF,eAAO,MAAM,mBAAmB,EAAE,MAAM,CAAC,MAAM,EAAE,UAAU,CAkB1D,CAAC;AAKF,eAAO,MAAM,oBAAoB,EAAE,MAAM,CAAC,UAAU,EAAE,MAAM,CAE7B,CAAC"}
@@ -0,0 +1,256 @@
1
+ import { z } from "zod";
2
+ export const ReportTypeSchema = z.enum([
3
+ "STANDARD",
4
+ "FLOODLIGHT",
5
+ "YOUTUBE",
6
+ "GRP",
7
+ "YOUTUBE_PROGRAMMATIC_GUARANTEED",
8
+ "REACH",
9
+ "UNIQUE_REACH_AUDIENCE",
10
+ "REPORT_TYPE_UNSPECIFIED",
11
+ ]);
12
+ export const DataRangeSchema = z.enum([
13
+ "RANGE_UNSPECIFIED",
14
+ "CUSTOM_DATES",
15
+ "CURRENT_DAY",
16
+ "PREVIOUS_DAY",
17
+ "WEEK_TO_DATE",
18
+ "MONTH_TO_DATE",
19
+ "QUARTER_TO_DATE",
20
+ "YEAR_TO_DATE",
21
+ "PREVIOUS_WEEK",
22
+ "PREVIOUS_MONTH",
23
+ "PREVIOUS_QUARTER",
24
+ "PREVIOUS_YEAR",
25
+ "LAST_7_DAYS",
26
+ "LAST_14_DAYS",
27
+ "LAST_30_DAYS",
28
+ "LAST_60_DAYS",
29
+ "LAST_90_DAYS",
30
+ "LAST_365_DAYS",
31
+ "ALL_TIME",
32
+ ]);
33
+ export const ReportFormatSchema = z.enum(["CSV", "XLSX"]);
34
+ export const FilterTypeSchema = z.enum([
35
+ "FILTER_DATE",
36
+ "FILTER_MONTH",
37
+ "FILTER_YEAR",
38
+ "FILTER_WEEK",
39
+ "FILTER_TIME_OF_DAY",
40
+ "FILTER_DAY_OF_WEEK",
41
+ "FILTER_PARTNER",
42
+ "FILTER_ADVERTISER",
43
+ "FILTER_ADVERTISER_CURRENCY",
44
+ "FILTER_MEDIA_PLAN",
45
+ "FILTER_INSERTION_ORDER",
46
+ "FILTER_LINE_ITEM",
47
+ "FILTER_CREATIVE",
48
+ "FILTER_DEVICE_TYPE",
49
+ "FILTER_BROWSER",
50
+ "FILTER_COUNTRY",
51
+ "FILTER_REGION",
52
+ "FILTER_CITY",
53
+ "FILTER_DMA",
54
+ "FILTER_OS",
55
+ "FILTER_AUDIENCE_LIST",
56
+ "FILTER_AGE",
57
+ "FILTER_GENDER",
58
+ "FILTER_HOUSEHOLD_INCOME",
59
+ "FILTER_PARENTAL_STATUS",
60
+ "FILTER_INVENTORY_SOURCE",
61
+ "FILTER_INVENTORY_SOURCE_TYPE",
62
+ "FILTER_EXCHANGE",
63
+ "FILTER_SITE_ID",
64
+ "FILTER_APP_URL",
65
+ "FILTER_VIDEO_PLAYER_SIZE",
66
+ "FILTER_VIDEO_CREATIVE_DURATION",
67
+ "FILTER_VIDEO_AD_POSITION",
68
+ "FILTER_ORDER_ID",
69
+ "FILTER_TRUEVIEW_CONVERSION_TYPE",
70
+ ]);
71
+ export const MetricTypeSchema = z.enum([
72
+ "METRIC_IMPRESSIONS",
73
+ "METRIC_CLICKS",
74
+ "METRIC_CTR",
75
+ "METRIC_TOTAL_CONVERSIONS",
76
+ "METRIC_POST_CLICK_CONVERSIONS",
77
+ "METRIC_POST_VIEW_CONVERSIONS",
78
+ "METRIC_TOTAL_MEDIA_COST_ADVERTISER",
79
+ "METRIC_TOTAL_MEDIA_COST_PARTNER",
80
+ "METRIC_TOTAL_MEDIA_COST_USD",
81
+ "METRIC_CPM_ADVERTISER",
82
+ "METRIC_CPM_PARTNER",
83
+ "METRIC_CPM_USD",
84
+ "METRIC_CPC_ADVERTISER",
85
+ "METRIC_CPA_ADVERTISER",
86
+ "METRIC_REVENUE_ADVERTISER",
87
+ "METRIC_REVENUE_PARTNER",
88
+ "METRIC_REVENUE_USD",
89
+ "METRIC_ACTIVE_VIEW_MEASURABLE_IMPRESSIONS",
90
+ "METRIC_ACTIVE_VIEW_VIEWABLE_IMPRESSIONS",
91
+ "METRIC_ACTIVE_VIEW_ELIGIBLE_IMPRESSIONS",
92
+ "METRIC_ACTIVE_VIEW_PCT_MEASURABLE_IMPRESSIONS",
93
+ "METRIC_ACTIVE_VIEW_PCT_VIEWABLE_IMPRESSIONS",
94
+ "METRIC_VIDEO_PLAYS",
95
+ "METRIC_VIDEO_COMPLETIONS",
96
+ "METRIC_VIDEO_COMPLETION_RATE",
97
+ "METRIC_VIDEO_FIRST_QUARTILE_COMPLETIONS",
98
+ "METRIC_VIDEO_MIDPOINTS",
99
+ "METRIC_VIDEO_THIRD_QUARTILE_COMPLETIONS",
100
+ "METRIC_VIDEO_SKIPS",
101
+ "METRIC_VIDEO_PAUSE_EVENTS",
102
+ "METRIC_VIDEO_MUTES",
103
+ "METRIC_VIDEO_UNMUTES",
104
+ "METRIC_RICH_MEDIA_VIDEO_PLAYS",
105
+ "METRIC_RICH_MEDIA_VIDEO_COMPLETIONS",
106
+ "METRIC_RICH_MEDIA_SCROLLS",
107
+ "METRIC_RICH_MEDIA_ENGAGEMENTS",
108
+ "METRIC_RICH_MEDIA_EXPANSIONS",
109
+ "METRIC_RICH_MEDIA_FULL_SCREEN_IMPRESSIONS",
110
+ "METRIC_UNIQUE_REACH_IMPRESSION_REACH",
111
+ "METRIC_UNIQUE_REACH_CLICK_REACH",
112
+ "METRIC_UNIQUE_REACH_TOTAL_REACH",
113
+ "METRIC_UNIQUE_REACH_AVERAGE_IMPRESSION_FREQUENCY",
114
+ "METRIC_FLOODLIGHT_IMPRESSIONS",
115
+ "METRIC_FLOODLIGHT_CLICKS",
116
+ "METRIC_CM_POST_CLICK_REVENUE",
117
+ "METRIC_CM_POST_VIEW_REVENUE",
118
+ "METRIC_TRUEVIEW_VIEWS",
119
+ "METRIC_TRUEVIEW_VIEW_RATE",
120
+ "METRIC_TRUEVIEW_EARNED_VIEWS",
121
+ "METRIC_TRUEVIEW_EARNED_SUBSCRIBERS",
122
+ "METRIC_TRUEVIEW_EARNED_PLAYLIST_ADDITIONS",
123
+ "METRIC_TRUEVIEW_EARNED_SHARES",
124
+ ]);
125
+ export const ReportStatusSchema = z.enum([
126
+ "STATE_UNSPECIFIED",
127
+ "QUEUED",
128
+ "RUNNING",
129
+ "DONE",
130
+ "FAILED",
131
+ ]);
132
+ export const DateObjectSchema = z.object({
133
+ year: z.number().int().min(2000).max(2100),
134
+ month: z.number().int().min(1).max(12),
135
+ day: z.number().int().min(1).max(31),
136
+ });
137
+ export const QueryFilterSchema = z.object({
138
+ type: FilterTypeSchema,
139
+ value: z.string(),
140
+ });
141
+ export const DataRangeConfigSchema = z.object({
142
+ range: DataRangeSchema,
143
+ customStartDate: DateObjectSchema.optional(),
144
+ customEndDate: DateObjectSchema.optional(),
145
+ });
146
+ export const QueryMetadataSchema = z.object({
147
+ title: z.string().min(1).max(1024),
148
+ dataRange: DataRangeConfigSchema,
149
+ format: ReportFormatSchema.default("CSV"),
150
+ });
151
+ export const QueryParamsSchema = z.object({
152
+ type: ReportTypeSchema.default("STANDARD"),
153
+ groupBys: z.array(FilterTypeSchema).min(1),
154
+ metrics: z.array(MetricTypeSchema).min(1),
155
+ filters: z.array(QueryFilterSchema).optional(),
156
+ });
157
+ export const QuerySpecSchema = z.object({
158
+ metadata: QueryMetadataSchema,
159
+ params: QueryParamsSchema,
160
+ });
161
+ export const ReportKeySchema = z.object({
162
+ queryId: z.string(),
163
+ reportId: z.string(),
164
+ });
165
+ export const ReportStatusDetailsSchema = z.object({
166
+ state: ReportStatusSchema,
167
+ format: z.string().optional(),
168
+ });
169
+ export const ReportMetadataSchema = z.object({
170
+ status: ReportStatusDetailsSchema,
171
+ googleCloudStoragePath: z.string().optional(),
172
+ });
173
+ export const DeliveryMetricsSchema = z.object({
174
+ impressions: z.number().int().min(0),
175
+ clicks: z.number().int().min(0),
176
+ spend: z.number().min(0),
177
+ conversions: z.number().int().min(0),
178
+ revenue: z.number().min(0),
179
+ });
180
+ export const PerformanceMetricsSchema = DeliveryMetricsSchema.extend({
181
+ cpm: z.number().min(0),
182
+ ctr: z.number().min(0).max(100),
183
+ cpc: z.number().min(0),
184
+ cpa: z.number().min(0),
185
+ roas: z.number().min(0),
186
+ });
187
+ export const HistoricalDataPointSchema = z.object({
188
+ date: z.string().regex(/^\d{4}-\d{2}-\d{2}$/),
189
+ metrics: DeliveryMetricsSchema,
190
+ });
191
+ export const PacingStatusSchema = z.object({
192
+ advertiserId: z.string(),
193
+ campaignId: z.string(),
194
+ budgetTotal: z.number().min(0),
195
+ spendToDate: z.number().min(0),
196
+ expectedDeliveryPercent: z.number().min(0).max(100),
197
+ actualDeliveryPercent: z.number().min(0).max(100),
198
+ pacingRatio: z.number().min(0),
199
+ status: z.enum(["ON_PACE", "AHEAD", "BEHIND", "SEVERELY_BEHIND"]),
200
+ daysRemaining: z.number().int().min(0),
201
+ projectedEndSpend: z.number().min(0),
202
+ });
203
+ export const GetDeliveryMetricsInputSchema = z.object({
204
+ advertiserId: z.string().min(1),
205
+ campaignId: z.string().min(1),
206
+ startDate: z.string().regex(/^\d{4}-\d{2}-\d{2}$/),
207
+ endDate: z.string().regex(/^\d{4}-\d{2}-\d{2}$/),
208
+ });
209
+ export const GetHistoricalMetricsInputSchema = z.object({
210
+ advertiserId: z.string().min(1),
211
+ campaignId: z.string().min(1),
212
+ startDate: z.string().regex(/^\d{4}-\d{2}-\d{2}$/),
213
+ endDate: z.string().regex(/^\d{4}-\d{2}-\d{2}$/),
214
+ granularity: z.enum(["daily", "weekly", "monthly"]).default("daily"),
215
+ });
216
+ export const GetPacingStatusInputSchema = z.object({
217
+ advertiserId: z.string().min(1),
218
+ campaignId: z.string().min(1),
219
+ budgetTotal: z.number().min(0),
220
+ flightStartDate: z.string().regex(/^\d{4}-\d{2}-\d{2}$/),
221
+ flightEndDate: z.string().regex(/^\d{4}-\d{2}-\d{2}$/),
222
+ });
223
+ export const ExponentialBackoffConfigSchema = z.object({
224
+ initialDelayMs: z.number().int().min(100).default(2000),
225
+ maxDelayMs: z.number().int().min(1000).default(60000),
226
+ maxRetries: z.number().int().min(1).default(10),
227
+ backoffMultiplier: z.number().min(1).default(2),
228
+ });
229
+ export const QueryContinuationStateSchema = z.object({
230
+ queryId: z.string().optional(),
231
+ reportId: z.string().optional(),
232
+ lastStatus: ReportStatusSchema.optional(),
233
+ attemptCount: z.number().int().min(0).default(0),
234
+ gcsPath: z.string().optional(),
235
+ });
236
+ export const CSV_COLUMN_MAPPINGS = {
237
+ Impressions: "METRIC_IMPRESSIONS",
238
+ Clicks: "METRIC_CLICKS",
239
+ "Click Rate": "METRIC_CTR",
240
+ "Total Conversions": "METRIC_TOTAL_CONVERSIONS",
241
+ "Post-Click Conversions": "METRIC_POST_CLICK_CONVERSIONS",
242
+ "Post-View Conversions": "METRIC_POST_VIEW_CONVERSIONS",
243
+ "Media Cost (Advertiser Currency)": "METRIC_TOTAL_MEDIA_COST_ADVERTISER",
244
+ "Media Cost (Partner Currency)": "METRIC_TOTAL_MEDIA_COST_PARTNER",
245
+ "Media Cost (USD)": "METRIC_TOTAL_MEDIA_COST_USD",
246
+ "Revenue (Advertiser Currency)": "METRIC_REVENUE_ADVERTISER",
247
+ "Revenue (Partner Currency)": "METRIC_REVENUE_PARTNER",
248
+ "Revenue (USD)": "METRIC_REVENUE_USD",
249
+ "Active View: Measurable Impressions": "METRIC_ACTIVE_VIEW_MEASURABLE_IMPRESSIONS",
250
+ "Active View: Viewable Impressions": "METRIC_ACTIVE_VIEW_VIEWABLE_IMPRESSIONS",
251
+ "Video Plays": "METRIC_VIDEO_PLAYS",
252
+ "Video Completions": "METRIC_VIDEO_COMPLETIONS",
253
+ "Video Completion Rate": "METRIC_VIDEO_COMPLETION_RATE",
254
+ };
255
+ export const METRIC_TO_CSV_COLUMN = Object.fromEntries(Object.entries(CSV_COLUMN_MAPPINGS).map(([col, metric]) => [metric, col]));
256
+ //# sourceMappingURL=types.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.js","sourceRoot":"","sources":["../../../src/services/bid-manager/types.ts"],"names":[],"mappings":"AAUA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAUxB,MAAM,CAAC,MAAM,gBAAgB,GAAG,CAAC,CAAC,IAAI,CAAC;IACrC,UAAU;IACV,YAAY;IACZ,SAAS;IACT,KAAK;IACL,iCAAiC;IACjC,OAAO;IACP,uBAAuB;IACvB,yBAAyB;CAC1B,CAAC,CAAC;AAOH,MAAM,CAAC,MAAM,eAAe,GAAG,CAAC,CAAC,IAAI,CAAC;IACpC,mBAAmB;IACnB,cAAc;IACd,aAAa;IACb,cAAc;IACd,cAAc;IACd,eAAe;IACf,iBAAiB;IACjB,cAAc;IACd,eAAe;IACf,gBAAgB;IAChB,kBAAkB;IAClB,eAAe;IACf,aAAa;IACb,cAAc;IACd,cAAc;IACd,cAAc;IACd,cAAc;IACd,eAAe;IACf,UAAU;CACX,CAAC,CAAC;AAMH,MAAM,CAAC,MAAM,kBAAkB,GAAG,CAAC,CAAC,IAAI,CAAC,CAAC,KAAK,EAAE,MAAM,CAAC,CAAC,CAAC;AAM1D,MAAM,CAAC,MAAM,gBAAgB,GAAG,CAAC,CAAC,IAAI,CAAC;IAErC,aAAa;IACb,cAAc;IACd,aAAa;IACb,aAAa;IACb,oBAAoB;IACpB,oBAAoB;IAGpB,gBAAgB;IAChB,mBAAmB;IACnB,4BAA4B;IAC5B,mBAAmB;IACnB,wBAAwB;IACxB,kBAAkB;IAClB,iBAAiB;IAGjB,oBAAoB;IACpB,gBAAgB;IAChB,gBAAgB;IAChB,eAAe;IACf,aAAa;IACb,YAAY;IACZ,WAAW;IAGX,sBAAsB;IACtB,YAAY;IACZ,eAAe;IACf,yBAAyB;IACzB,wBAAwB;IAGxB,yBAA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AE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC;IAChD,OAAO,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;CAC/B,CAAC,CAAC;AAWH,MAAM,CAAC,MAAM,mBAAmB,GAA+B;IAC7D,WAAW,EAAE,oBAAoB;IACjC,MAAM,EAAE,eAAe;IACvB,YAAY,EAAE,YAAY;IAC1B,mBAAmB,EAAE,0BAA0B;IAC/C,wBAAwB,EAAE,+BAA+B;IACzD,uBAAuB,EAAE,8BAA8B;IACvD,kCAAkC,EAAE,oCAAoC;IACxE,+BAA+B,EAAE,iCAAiC;IAClE,kBAAkB,EAAE,6BAA6B;IACjD,+BAA+B,EAAE,2BAA2B;IAC5D,4BAA4B,EAAE,wBAAwB;IACtD,eAAe,EAAE,oBAAoB;IACrC,qCAAqC,EAAE,2CAA2C;IAClF,mCAAmC,EAAE,yCAAyC;IAC9E,aAAa,EAAE,oBAAoB;IACnC,mBAAmB,EAAE,0BAA0B;IAC/C,uBAAuB,EAAE,8BAA8B;CACxD,CAAC;AAKF,MAAM,CAAC,MAAM,oBAAoB,GAA+B,MAAM,CAAC,WAAW,CAChF,MAAM,CAAC,OAAO,CAAC,mBAAmB,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,GAAG,EAAE,MAAM,CAAC,EAAE,EAAE,CAAC,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC,CAC5C,CAAC"}
@@ -0,0 +1,12 @@
1
+ import type { Logger } from "pino";
2
+ import type { GoogleAuthAdapter, RateLimiter } from "@cesteral/shared";
3
+ import { SessionServiceStore } from "@cesteral/shared";
4
+ export { SessionServiceStore } from "@cesteral/shared";
5
+ import { BidManagerService } from "./bid-manager/BidManagerService.js";
6
+ import type { AppConfig } from "../config/index.js";
7
+ export interface SessionServices {
8
+ bidManagerService: BidManagerService;
9
+ }
10
+ export declare function createSessionServices(authAdapter: GoogleAuthAdapter, config: AppConfig, logger: Logger, rateLimiter: RateLimiter): SessionServices;
11
+ export declare const sessionServiceStore: SessionServiceStore<SessionServices>;
12
+ //# sourceMappingURL=session-services.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"session-services.d.ts","sourceRoot":"","sources":["../../src/services/session-services.ts"],"names":[],"mappings":"AAYA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,MAAM,CAAC;AACnC,OAAO,KAAK,EAAE,iBAAiB,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;AACvE,OAAO,EAAE,mBAAmB,EAAE,MAAM,kBAAkB,CAAC;AACvD,OAAO,EAAE,mBAAmB,EAAE,MAAM,kBAAkB,CAAC;AACvD,OAAO,EAAE,iBAAiB,EAAE,MAAM,oCAAoC,CAAC;AAEvE,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,oBAAoB,CAAC;AAKpD,MAAM,WAAW,eAAe;IAC9B,iBAAiB,EAAE,iBAAiB,CAAC;CACtC;AAKD,wBAAgB,qBAAqB,CACnC,WAAW,EAAE,iBAAiB,EAC9B,MAAM,EAAE,SAAS,EACjB,MAAM,EAAE,MAAM,EACd,WAAW,EAAE,WAAW,GACvB,eAAe,CAgBjB;AAED,eAAO,MAAM,mBAAmB,sCAA6C,CAAC"}
@@ -0,0 +1,18 @@
1
+ import { google } from "googleapis";
2
+ import { SessionServiceStore } from "@cesteral/shared";
3
+ export { SessionServiceStore } from "@cesteral/shared";
4
+ import { BidManagerService } from "./bid-manager/BidManagerService.js";
5
+ import { createGoogleAuthFromAdapter } from "./bid-manager/auth-bridge.js";
6
+ export function createSessionServices(authAdapter, config, logger, rateLimiter) {
7
+ const googleAuth = createGoogleAuthFromAdapter(authAdapter);
8
+ const bidManagerClient = google.doubleclickbidmanager({
9
+ version: "v2",
10
+ auth: googleAuth,
11
+ });
12
+ const bidManagerService = new BidManagerService(config, logger, bidManagerClient, rateLimiter);
13
+ return {
14
+ bidManagerService,
15
+ };
16
+ }
17
+ export const sessionServiceStore = new SessionServiceStore();
18
+ //# sourceMappingURL=session-services.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"session-services.js","sourceRoot":"","sources":["../../src/services/session-services.ts"],"names":[],"mappings":"AAWA,OAAO,EAAE,MAAM,EAAE,MAAM,YAAY,CAAC;AAGpC,OAAO,EAAE,mBAAmB,EAAE,MAAM,kBAAkB,CAAC;AACvD,OAAO,EAAE,mBAAmB,EAAE,MAAM,kBAAkB,CAAC;AACvD,OAAO,EAAE,iBAAiB,EAAE,MAAM,oCAAoC,CAAC;AACvE,OAAO,EAAE,2BAA2B,EAAE,MAAM,8BAA8B,CAAC;AAa3E,MAAM,UAAU,qBAAqB,CACnC,WAA8B,EAC9B,MAAiB,EACjB,MAAc,EACd,WAAwB;IAGxB,MAAM,UAAU,GAAG,2BAA2B,CAAC,WAAW,CAAC,CAAC;IAG5D,MAAM,gBAAgB,GAAG,MAAM,CAAC,qBAAqB,CAAC;QACpD,OAAO,EAAE,IAAI;QACb,IAAI,EAAE,UAAU;KACjB,CAAC,CAAC;IAGH,MAAM,iBAAiB,GAAG,IAAI,iBAAiB,CAAC,MAAM,EAAE,MAAM,EAAE,gBAAgB,EAAE,WAAW,CAAC,CAAC;IAE/F,OAAO;QACL,iBAAiB;KAClB,CAAC;AACJ,CAAC;AAED,MAAM,CAAC,MAAM,mBAAmB,GAAG,IAAI,mBAAmB,EAAmB,CAAC"}
@@ -0,0 +1,76 @@
1
+ export interface QueryMetadata {
2
+ title: string;
3
+ dataRange: {
4
+ range: "CUSTOM_DATES" | "LAST_7_DAYS" | "LAST_30_DAYS" | "PREVIOUS_MONTH";
5
+ customStartDate?: DateObject;
6
+ customEndDate?: DateObject;
7
+ };
8
+ format: "CSV" | "XLSX";
9
+ }
10
+ export interface QueryParams {
11
+ type: QueryType;
12
+ groupBys: FilterType[];
13
+ metrics: MetricType[];
14
+ filters?: QueryFilter[];
15
+ }
16
+ export interface QueryFilter {
17
+ type: FilterType;
18
+ value: string;
19
+ }
20
+ export type QueryType = "TYPE_GENERAL" | "TYPE_AUDIENCE_COMPOSITION" | "TYPE_REACH_FREQUENCY" | "TYPE_YOUTUBE";
21
+ export type FilterType = "FILTER_DATE" | "FILTER_ADVERTISER" | "FILTER_MEDIA_PLAN" | "FILTER_INSERTION_ORDER" | "FILTER_LINE_ITEM" | "FILTER_CREATIVE" | "FILTER_PARTNER" | "FILTER_DEVICE_TYPE" | "FILTER_COUNTRY";
22
+ export type MetricType = "METRIC_IMPRESSIONS" | "METRIC_CLICKS" | "METRIC_TOTAL_MEDIA_COST_ADVERTISER" | "METRIC_CONVERSIONS" | "METRIC_REVENUE_ADVERTISER" | "METRIC_CTR" | "METRIC_CPM" | "METRIC_CPC" | "METRIC_CPA" | "METRIC_ACTIVE_VIEW_MEASURABLE_IMPRESSIONS" | "METRIC_ACTIVE_VIEW_VIEWABLE_IMPRESSIONS";
23
+ export interface DateObject {
24
+ year: number;
25
+ month: number;
26
+ day: number;
27
+ }
28
+ export type ReportStatus = "RUNNING" | "DONE" | "FAILED";
29
+ export interface ReportMetadata {
30
+ status: {
31
+ state: ReportStatus;
32
+ format?: string;
33
+ };
34
+ googleCloudStoragePath?: string;
35
+ }
36
+ export interface ReportKey {
37
+ queryId: string;
38
+ reportId: string;
39
+ }
40
+ export interface DeliveryMetrics {
41
+ impressions: number;
42
+ clicks: number;
43
+ spend: number;
44
+ conversions: number;
45
+ revenue: number;
46
+ }
47
+ export interface PerformanceMetrics extends DeliveryMetrics {
48
+ cpm: number;
49
+ ctr: number;
50
+ cpc: number;
51
+ cpa: number;
52
+ roas: number;
53
+ }
54
+ export interface HistoricalDataPoint {
55
+ date: string;
56
+ metrics: DeliveryMetrics;
57
+ }
58
+ export interface PacingStatus {
59
+ advertiserId: string;
60
+ campaignId: string;
61
+ expectedDeliveryPercent: number;
62
+ actualDeliveryPercent: number;
63
+ pacingRatio: number;
64
+ status: "ON_PACE" | "AHEAD" | "BEHIND" | "SEVERELY_BEHIND";
65
+ daysRemaining: number;
66
+ projectedEndSpend: number;
67
+ }
68
+ export interface PlatformEntity {
69
+ id: string;
70
+ name: string;
71
+ type: "advertiser" | "campaign" | "insertionOrder" | "lineItem";
72
+ status: "ACTIVE" | "PAUSED" | "DRAFT" | "ARCHIVED";
73
+ parentId?: string;
74
+ children?: PlatformEntity[];
75
+ }
76
+ //# sourceMappingURL=bid-manager.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"bid-manager.d.ts","sourceRoot":"","sources":["../../src/types-global/bid-manager.ts"],"names":[],"mappings":"AAWA,MAAM,WAAW,aAAa;IAC5B,KAAK,EAAE,MAAM,CAAC;IACd,SAAS,EAAE;QACT,KAAK,EAAE,cAAc,GAAG,aAAa,GAAG,cAAc,GAAG,gBAAgB,CAAC;QAC1E,eAAe,CAAC,EAAE,UAAU,CAAC;QAC7B,aAAa,CAAC,EAAE,UAAU,CAAC;KAC5B,CAAC;IACF,MAAM,EAAE,KAAK,GAAG,MAAM,CAAC;CACxB;AAKD,MAAM,WAAW,WAAW;IAC1B,IAAI,EAAE,SAAS,CAAC;IAChB,QAAQ,EAAE,UAAU,EAAE,CAAC;IACvB,OAAO,EAAE,UAAU,EAAE,CAAC;IACtB,OAAO,CAAC,EAAE,WAAW,EAAE,CAAC;CACzB;AAKD,MAAM,WAAW,WAAW;IAC1B,IAAI,EAAE,UAAU,CAAC;IACjB,KAAK,EAAE,MAAM,CAAC;CACf;AAKD,MAAM,MAAM,SAAS,GACjB,cAAc,GACd,2BAA2B,GAC3B,sBAAsB,GACtB,cAAc,CAAC;AAKnB,MAAM,MAAM,UAAU,GAClB,aAAa,GACb,mBAAmB,GACnB,mBAAmB,GACnB,wBAAwB,GACxB,kBAAkB,GAClB,iBAAiB,GACjB,gBAAgB,GAChB,oBAAoB,GACpB,gBAAgB,CAAC;AAKrB,MAAM,MAAM,UAAU,GAClB,oBAAoB,GACpB,eAAe,GACf,oCAAoC,GACpC,oBAAoB,GACpB,2BAA2B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iBAAiB,CAAC;IAC3D,aAAa,EAAE,MAAM,CAAC;IACtB,iBAAiB,EAAE,MAAM,CAAC;CAC3B;AAKD,MAAM,WAAW,cAAc;IAC7B,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,YAAY,GAAG,UAAU,GAAG,gBAAgB,GAAG,UAAU,CAAC;IAChE,MAAM,EAAE,QAAQ,GAAG,QAAQ,GAAG,OAAO,GAAG,UAAU,CAAC;IACnD,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,QAAQ,CAAC,EAAE,cAAc,EAAE,CAAC;CAC7B"}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=bid-manager.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"bid-manager.js","sourceRoot":"","sources":["../../src/types-global/bid-manager.ts"],"names":[],"mappings":""}
@@ -0,0 +1,2 @@
1
+ export * from "./bid-manager.js";
2
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/types-global/index.ts"],"names":[],"mappings":"AAQA,cAAc,kBAAkB,CAAC"}
@@ -0,0 +1,2 @@
1
+ export * from "./bid-manager.js";
2
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/types-global/index.ts"],"names":[],"mappings":"AAQA,cAAc,kBAAkB,CAAC"}
@@ -0,0 +1,2 @@
1
+ export type { ToolDefinition, ResourceDefinition, SdkContext } from "@cesteral/shared";
2
+ //# sourceMappingURL=mcp.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"mcp.d.ts","sourceRoot":"","sources":["../../src/types-global/mcp.ts"],"names":[],"mappings":"AAIA,YAAY,EAAE,cAAc,EAAE,kBAAkB,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC"}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=mcp.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"mcp.js","sourceRoot":"","sources":["../../src/types-global/mcp.ts"],"names":[],"mappings":""}
@@ -0,0 +1,2 @@
1
+ export declare function daysBetween(startDate: string, endDate: string): number;
2
+ //# sourceMappingURL=date.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"date.d.ts","sourceRoot":"","sources":["../../src/utils/date.ts"],"names":[],"mappings":"AAMA,wBAAgB,WAAW,CAAC,SAAS,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,GAAG,MAAM,CAKtE"}
@@ -0,0 +1,7 @@
1
+ export function daysBetween(startDate, endDate) {
2
+ const start = new Date(startDate);
3
+ const end = new Date(endDate);
4
+ const diffTime = Math.abs(end.getTime() - start.getTime());
5
+ return Math.ceil(diffTime / (1000 * 60 * 60 * 24));
6
+ }
7
+ //# sourceMappingURL=date.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"date.js","sourceRoot":"","sources":["../../src/utils/date.ts"],"names":[],"mappings":"AAMA,MAAM,UAAU,WAAW,CAAC,SAAiB,EAAE,OAAe;IAC5D,MAAM,KAAK,GAAG,IAAI,IAAI,CAAC,SAAS,CAAC,CAAC;IAClC,MAAM,GAAG,GAAG,IAAI,IAAI,CAAC,OAAO,CAAC,CAAC;IAC9B,MAAM,QAAQ,GAAG,IAAI,CAAC,GAAG,CAAC,GAAG,CAAC,OAAO,EAAE,GAAG,KAAK,CAAC,OAAO,EAAE,CAAC,CAAC;IAC3D,OAAO,IAAI,CAAC,IAAI,CAAC,QAAQ,GAAG,CAAC,IAAI,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,CAAC,CAAC,CAAC;AACrD,CAAC"}
@@ -0,0 +1,57 @@
1
+ import { McpError, JsonRpcErrorCode } from "@cesteral/shared";
2
+ export declare class BidManagerError extends McpError {
3
+ readonly apiErrorCode?: string;
4
+ readonly httpStatus?: number;
5
+ constructor(message: string, options?: {
6
+ code?: JsonRpcErrorCode;
7
+ apiErrorCode?: string;
8
+ httpStatus?: number;
9
+ cause?: unknown;
10
+ data?: Record<string, unknown>;
11
+ });
12
+ }
13
+ export declare class QueryCreationError extends BidManagerError {
14
+ constructor(message: string, cause?: unknown);
15
+ }
16
+ export declare class QueryExecutionError extends BidManagerError {
17
+ readonly queryId: string;
18
+ constructor(queryId: string, message: string, cause?: unknown);
19
+ }
20
+ export declare class ReportGenerationError extends BidManagerError {
21
+ readonly queryId: string;
22
+ readonly reportId: string;
23
+ readonly failureReason?: string;
24
+ constructor(queryId: string, reportId: string, failureReason?: string, cause?: unknown);
25
+ }
26
+ export declare class ReportFetchError extends BidManagerError {
27
+ readonly gcsPath?: string;
28
+ constructor(message: string, gcsPath?: string, cause?: unknown);
29
+ }
30
+ export declare class ReportParseError extends BidManagerError {
31
+ readonly format?: string;
32
+ readonly rowNumber?: number;
33
+ constructor(message: string, options?: {
34
+ format?: string;
35
+ rowNumber?: number;
36
+ cause?: unknown;
37
+ });
38
+ }
39
+ export declare class AuthenticationError extends BidManagerError {
40
+ constructor(message: string, cause?: unknown);
41
+ }
42
+ export declare class CredentialsNotConfiguredError extends BidManagerError {
43
+ constructor();
44
+ }
45
+ export declare class RetryExhaustedError extends BidManagerError {
46
+ readonly queryId?: string;
47
+ readonly reportId?: string;
48
+ readonly attemptCount: number;
49
+ readonly lastError?: Error;
50
+ constructor(attemptCount: number, options?: {
51
+ queryId?: string;
52
+ reportId?: string;
53
+ lastError?: Error;
54
+ lastStatus?: string;
55
+ });
56
+ }
57
+ //# sourceMappingURL=bid-manager-errors.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"bid-manager-errors.d.ts","sourceRoot":"","sources":["../../../src/utils/errors/bid-manager-errors.ts"],"names":[],"mappings":"AAUA,OAAO,EAAE,QAAQ,EAAE,gBAAgB,EAAE,MAAM,kBAAkB,CAAC;AAK9D,qBAAa,eAAgB,SAAQ,QAAQ;IAC3C,SAAgB,YAAY,CAAC,EAAE,MAAM,CAAC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,SAAS,CAAC,EAAE,MAAM,CAAC;QAAC,KAAK,CAAC,EAAE,OAAO,CAAA;KAAE;CAUhG;AAKD,qBAAa,mBAAoB,SAAQ,eAAe;gBAC1C,OAAO,EAAE,MAAM,EAAE,KAAK,CAAC,EAAE,OAAO;CAO7C;AAKD,qBAAa,6BAA8B,SAAQ,eAAe;;CAUjE;AAQD,qBAAa,mBAAoB,SAAQ,eAAe;IACtD,SAAgB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjC,SAAgB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClC,SAAgB,YAAY,EAAE,MAAM,CAAC;IACrC,SAAgB,SAAS,CAAC,EAAE,KAAK,CAAC;gBAGhC,YAAY,EAAE,MAAM,EACpB,OAAO,CAAC,EAAE;QACR,OAAO,CAAC,EAAE,MAAM,CAAC;QACjB,QAAQ,CAAC,EAAE,MAAM,CAAC;QAClB,SAAS,CAAC,EAAE,KAAK,CAAC;QAClB,UAAU,CAAC,EAAE,MAAM,CAAC;KACrB;CAqBJ"}
@@ -0,0 +1,119 @@
1
+ import { McpError, JsonRpcErrorCode } from "@cesteral/shared";
2
+ export class BidManagerError extends McpError {
3
+ apiErrorCode;
4
+ httpStatus;
5
+ constructor(message, options) {
6
+ super(options?.code ?? JsonRpcErrorCode.InternalError, message, options?.data, {
7
+ cause: options?.cause,
8
+ });
9
+ this.name = "BidManagerError";
10
+ this.apiErrorCode = options?.apiErrorCode;
11
+ this.httpStatus = options?.httpStatus;
12
+ }
13
+ }
14
+ export class QueryCreationError extends BidManagerError {
15
+ constructor(message, cause) {
16
+ super(`Failed to create Bid Manager query: ${message}`, {
17
+ code: JsonRpcErrorCode.InternalError,
18
+ cause,
19
+ });
20
+ this.name = "QueryCreationError";
21
+ }
22
+ }
23
+ export class QueryExecutionError extends BidManagerError {
24
+ queryId;
25
+ constructor(queryId, message, cause) {
26
+ super(`Failed to execute query ${queryId}: ${message}`, {
27
+ code: JsonRpcErrorCode.InternalError,
28
+ cause,
29
+ data: { queryId },
30
+ });
31
+ this.name = "QueryExecutionError";
32
+ this.queryId = queryId;
33
+ }
34
+ }
35
+ export class ReportGenerationError extends BidManagerError {
36
+ queryId;
37
+ reportId;
38
+ failureReason;
39
+ constructor(queryId, reportId, failureReason, cause) {
40
+ super(`Report ${reportId} generation failed: ${failureReason || "Unknown reason"}`, {
41
+ code: JsonRpcErrorCode.InternalError,
42
+ cause,
43
+ data: { queryId, reportId, failureReason },
44
+ });
45
+ this.name = "ReportGenerationError";
46
+ this.queryId = queryId;
47
+ this.reportId = reportId;
48
+ this.failureReason = failureReason;
49
+ }
50
+ }
51
+ export class ReportFetchError extends BidManagerError {
52
+ gcsPath;
53
+ constructor(message, gcsPath, cause) {
54
+ super(`Failed to fetch report data: ${message}`, {
55
+ code: JsonRpcErrorCode.InternalError,
56
+ cause,
57
+ data: { gcsPath },
58
+ });
59
+ this.name = "ReportFetchError";
60
+ this.gcsPath = gcsPath;
61
+ }
62
+ }
63
+ export class ReportParseError extends BidManagerError {
64
+ format;
65
+ rowNumber;
66
+ constructor(message, options) {
67
+ super(`Failed to parse report data: ${message}`, {
68
+ code: JsonRpcErrorCode.InternalError,
69
+ cause: options?.cause,
70
+ data: { format: options?.format, rowNumber: options?.rowNumber },
71
+ });
72
+ this.name = "ReportParseError";
73
+ this.format = options?.format;
74
+ this.rowNumber = options?.rowNumber;
75
+ }
76
+ }
77
+ export class AuthenticationError extends BidManagerError {
78
+ constructor(message, cause) {
79
+ super(`Bid Manager authentication failed: ${message}`, {
80
+ code: JsonRpcErrorCode.Unauthorized,
81
+ cause,
82
+ });
83
+ this.name = "AuthenticationError";
84
+ }
85
+ }
86
+ export class CredentialsNotConfiguredError extends BidManagerError {
87
+ constructor() {
88
+ super("Bid Manager API credentials not configured. Set SERVICE_ACCOUNT_JSON or SERVICE_ACCOUNT_FILE.", {
89
+ code: JsonRpcErrorCode.Unauthorized,
90
+ });
91
+ this.name = "CredentialsNotConfiguredError";
92
+ }
93
+ }
94
+ export class RetryExhaustedError extends BidManagerError {
95
+ queryId;
96
+ reportId;
97
+ attemptCount;
98
+ lastError;
99
+ constructor(attemptCount, options) {
100
+ const queryInfo = options?.queryId ? ` for query ${options.queryId}` : "";
101
+ const statusInfo = options?.lastStatus ? ` (last status: ${options.lastStatus})` : "";
102
+ super(`All ${attemptCount} retry attempts exhausted${queryInfo}${statusInfo}`, {
103
+ code: JsonRpcErrorCode.Timeout,
104
+ cause: options?.lastError,
105
+ data: {
106
+ attemptCount,
107
+ queryId: options?.queryId,
108
+ reportId: options?.reportId,
109
+ lastStatus: options?.lastStatus,
110
+ },
111
+ });
112
+ this.name = "RetryExhaustedError";
113
+ this.queryId = options?.queryId;
114
+ this.reportId = options?.reportId;
115
+ this.attemptCount = attemptCount;
116
+ this.lastError = options?.lastError;
117
+ }
118
+ }
119
+ //# sourceMappingURL=bid-manager-errors.js.map