@contractspec/example.analytics-dashboard 1.57.0 → 1.59.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 (173) hide show
  1. package/dist/browser/dashboard/dashboard.enum.js +34 -0
  2. package/dist/browser/dashboard/dashboard.operation.js +289 -0
  3. package/dist/browser/dashboard/dashboard.presentation.js +197 -0
  4. package/dist/browser/dashboard/dashboard.schema.js +126 -0
  5. package/dist/browser/dashboard/dashboard.test-spec.js +213 -0
  6. package/dist/browser/dashboard/index.js +299 -0
  7. package/dist/browser/dashboard.feature.js +84 -0
  8. package/dist/browser/datasource/posthog-datasource.js +289 -0
  9. package/dist/browser/docs/analytics-dashboard.docblock.js +103 -0
  10. package/dist/browser/docs/index.js +103 -0
  11. package/dist/browser/events.js +81 -0
  12. package/dist/browser/example.js +42 -0
  13. package/dist/browser/handlers/analytics.handlers.js +278 -0
  14. package/dist/browser/handlers/index.js +571 -0
  15. package/dist/browser/handlers/query.handlers.js +294 -0
  16. package/dist/browser/index.js +1677 -0
  17. package/dist/browser/query/index.js +159 -0
  18. package/dist/browser/query/query.enum.js +11 -0
  19. package/dist/browser/query/query.operation.js +154 -0
  20. package/dist/browser/query/query.presentation.js +119 -0
  21. package/dist/browser/query/query.schema.js +70 -0
  22. package/dist/browser/query/query.test-spec.js +113 -0
  23. package/dist/browser/query-engine/index.js +491 -0
  24. package/dist/browser/seeders/index.js +20 -0
  25. package/dist/browser/ui/AnalyticsDashboard.js +394 -0
  26. package/dist/browser/ui/hooks/index.js +69 -0
  27. package/dist/browser/ui/hooks/useAnalyticsData.js +66 -0
  28. package/dist/browser/ui/index.js +671 -0
  29. package/dist/browser/ui/renderers/analytics.markdown.js +275 -0
  30. package/dist/browser/ui/renderers/index.js +275 -0
  31. package/dist/dashboard/dashboard.enum.d.ts +3 -8
  32. package/dist/dashboard/dashboard.enum.d.ts.map +1 -1
  33. package/dist/dashboard/dashboard.enum.js +31 -39
  34. package/dist/dashboard/dashboard.operation.d.ts +444 -450
  35. package/dist/dashboard/dashboard.operation.d.ts.map +1 -1
  36. package/dist/dashboard/dashboard.operation.js +284 -207
  37. package/dist/dashboard/dashboard.presentation.d.ts +3 -8
  38. package/dist/dashboard/dashboard.presentation.d.ts.map +1 -1
  39. package/dist/dashboard/dashboard.presentation.js +193 -85
  40. package/dist/dashboard/dashboard.schema.d.ts +289 -294
  41. package/dist/dashboard/dashboard.schema.d.ts.map +1 -1
  42. package/dist/dashboard/dashboard.schema.js +119 -228
  43. package/dist/dashboard/dashboard.test-spec.d.ts +4 -9
  44. package/dist/dashboard/dashboard.test-spec.d.ts.map +1 -1
  45. package/dist/dashboard/dashboard.test-spec.js +209 -228
  46. package/dist/dashboard/index.d.ts +7 -4
  47. package/dist/dashboard/index.d.ts.map +1 -0
  48. package/dist/dashboard/index.js +299 -4
  49. package/dist/dashboard.feature.d.ts +1 -6
  50. package/dist/dashboard.feature.d.ts.map +1 -1
  51. package/dist/dashboard.feature.js +83 -175
  52. package/dist/datasource/posthog-datasource.d.ts +15 -19
  53. package/dist/datasource/posthog-datasource.d.ts.map +1 -1
  54. package/dist/datasource/posthog-datasource.js +274 -238
  55. package/dist/docs/analytics-dashboard.docblock.d.ts +2 -1
  56. package/dist/docs/analytics-dashboard.docblock.d.ts.map +1 -0
  57. package/dist/docs/analytics-dashboard.docblock.js +45 -56
  58. package/dist/docs/index.d.ts +2 -1
  59. package/dist/docs/index.d.ts.map +1 -0
  60. package/dist/docs/index.js +104 -1
  61. package/dist/events.d.ts +109 -115
  62. package/dist/events.d.ts.map +1 -1
  63. package/dist/events.js +74 -120
  64. package/dist/example.d.ts +2 -6
  65. package/dist/example.d.ts.map +1 -1
  66. package/dist/example.js +41 -55
  67. package/dist/handlers/analytics.handlers.d.ts +110 -109
  68. package/dist/handlers/analytics.handlers.d.ts.map +1 -1
  69. package/dist/handlers/analytics.handlers.js +267 -298
  70. package/dist/handlers/index.d.ts +3 -3
  71. package/dist/handlers/index.d.ts.map +1 -0
  72. package/dist/handlers/index.js +571 -3
  73. package/dist/handlers/query.handlers.d.ts +7 -11
  74. package/dist/handlers/query.handlers.d.ts.map +1 -1
  75. package/dist/handlers/query.handlers.js +292 -7
  76. package/dist/index.d.ts +12 -13
  77. package/dist/index.d.ts.map +1 -0
  78. package/dist/index.js +1678 -14
  79. package/dist/node/dashboard/dashboard.enum.js +34 -0
  80. package/dist/node/dashboard/dashboard.operation.js +289 -0
  81. package/dist/node/dashboard/dashboard.presentation.js +197 -0
  82. package/dist/node/dashboard/dashboard.schema.js +126 -0
  83. package/dist/node/dashboard/dashboard.test-spec.js +213 -0
  84. package/dist/node/dashboard/index.js +299 -0
  85. package/dist/node/dashboard.feature.js +84 -0
  86. package/dist/node/datasource/posthog-datasource.js +289 -0
  87. package/dist/node/docs/analytics-dashboard.docblock.js +103 -0
  88. package/dist/node/docs/index.js +103 -0
  89. package/dist/node/events.js +81 -0
  90. package/dist/node/example.js +42 -0
  91. package/dist/node/handlers/analytics.handlers.js +278 -0
  92. package/dist/node/handlers/index.js +571 -0
  93. package/dist/node/handlers/query.handlers.js +294 -0
  94. package/dist/node/index.js +1677 -0
  95. package/dist/node/query/index.js +159 -0
  96. package/dist/node/query/query.enum.js +11 -0
  97. package/dist/node/query/query.operation.js +154 -0
  98. package/dist/node/query/query.presentation.js +119 -0
  99. package/dist/node/query/query.schema.js +70 -0
  100. package/dist/node/query/query.test-spec.js +113 -0
  101. package/dist/node/query-engine/index.js +491 -0
  102. package/dist/node/seeders/index.js +20 -0
  103. package/dist/node/ui/AnalyticsDashboard.js +394 -0
  104. package/dist/node/ui/hooks/index.js +69 -0
  105. package/dist/node/ui/hooks/useAnalyticsData.js +66 -0
  106. package/dist/node/ui/index.js +671 -0
  107. package/dist/node/ui/renderers/analytics.markdown.js +275 -0
  108. package/dist/node/ui/renderers/index.js +275 -0
  109. package/dist/query/index.d.ts +7 -4
  110. package/dist/query/index.d.ts.map +1 -0
  111. package/dist/query/index.js +159 -4
  112. package/dist/query/query.enum.d.ts +1 -6
  113. package/dist/query/query.enum.d.ts.map +1 -1
  114. package/dist/query/query.enum.js +10 -14
  115. package/dist/query/query.operation.d.ts +148 -154
  116. package/dist/query/query.operation.d.ts.map +1 -1
  117. package/dist/query/query.operation.js +151 -109
  118. package/dist/query/query.presentation.d.ts +2 -7
  119. package/dist/query/query.presentation.d.ts.map +1 -1
  120. package/dist/query/query.presentation.js +116 -56
  121. package/dist/query/query.schema.d.ts +121 -126
  122. package/dist/query/query.schema.d.ts.map +1 -1
  123. package/dist/query/query.schema.js +66 -152
  124. package/dist/query/query.test-spec.d.ts +2 -7
  125. package/dist/query/query.test-spec.d.ts.map +1 -1
  126. package/dist/query/query.test-spec.js +111 -121
  127. package/dist/query-engine/index.d.ts +84 -88
  128. package/dist/query-engine/index.d.ts.map +1 -1
  129. package/dist/query-engine/index.js +489 -188
  130. package/dist/seeders/index.d.ts +4 -8
  131. package/dist/seeders/index.d.ts.map +1 -1
  132. package/dist/seeders/index.js +18 -16
  133. package/dist/ui/AnalyticsDashboard.d.ts +1 -6
  134. package/dist/ui/AnalyticsDashboard.d.ts.map +1 -1
  135. package/dist/ui/AnalyticsDashboard.js +389 -259
  136. package/dist/ui/hooks/index.d.ts +2 -2
  137. package/dist/ui/hooks/index.d.ts.map +1 -0
  138. package/dist/ui/hooks/index.js +69 -4
  139. package/dist/ui/hooks/useAnalyticsData.d.ts +16 -20
  140. package/dist/ui/hooks/useAnalyticsData.d.ts.map +1 -1
  141. package/dist/ui/hooks/useAnalyticsData.js +63 -69
  142. package/dist/ui/index.d.ts +7 -6
  143. package/dist/ui/index.d.ts.map +1 -0
  144. package/dist/ui/index.js +671 -5
  145. package/dist/ui/renderers/analytics.markdown.d.ts +13 -14
  146. package/dist/ui/renderers/analytics.markdown.d.ts.map +1 -1
  147. package/dist/ui/renderers/analytics.markdown.js +266 -254
  148. package/dist/ui/renderers/index.d.ts +2 -2
  149. package/dist/ui/renderers/index.d.ts.map +1 -0
  150. package/dist/ui/renderers/index.js +275 -2
  151. package/package.json +328 -67
  152. package/dist/dashboard/dashboard.enum.js.map +0 -1
  153. package/dist/dashboard/dashboard.operation.js.map +0 -1
  154. package/dist/dashboard/dashboard.presentation.js.map +0 -1
  155. package/dist/dashboard/dashboard.schema.js.map +0 -1
  156. package/dist/dashboard/dashboard.test-spec.js.map +0 -1
  157. package/dist/dashboard.feature.js.map +0 -1
  158. package/dist/datasource/posthog-datasource.js.map +0 -1
  159. package/dist/docs/analytics-dashboard.docblock.js.map +0 -1
  160. package/dist/events.js.map +0 -1
  161. package/dist/example.js.map +0 -1
  162. package/dist/handlers/analytics.handlers.js.map +0 -1
  163. package/dist/handlers/query.handlers.js.map +0 -1
  164. package/dist/query/query.enum.js.map +0 -1
  165. package/dist/query/query.operation.js.map +0 -1
  166. package/dist/query/query.presentation.js.map +0 -1
  167. package/dist/query/query.schema.js.map +0 -1
  168. package/dist/query/query.test-spec.js.map +0 -1
  169. package/dist/query-engine/index.js.map +0 -1
  170. package/dist/seeders/index.js.map +0 -1
  171. package/dist/ui/AnalyticsDashboard.js.map +0 -1
  172. package/dist/ui/hooks/useAnalyticsData.js.map +0 -1
  173. package/dist/ui/renderers/analytics.markdown.js.map +0 -1
@@ -1,143 +1,138 @@
1
- import * as _contractspec_lib_schema0 from "@contractspec/lib.schema";
2
-
3
- //#region src/query/query.schema.d.ts
4
1
  /**
5
2
  * A data query.
6
3
  */
7
- declare const QueryModel: _contractspec_lib_schema0.SchemaModel<{
8
- id: {
9
- type: _contractspec_lib_schema0.FieldType<string, string>;
10
- isOptional: false;
11
- };
12
- name: {
13
- type: _contractspec_lib_schema0.FieldType<string, string>;
14
- isOptional: false;
15
- };
16
- description: {
17
- type: _contractspec_lib_schema0.FieldType<string, string>;
18
- isOptional: true;
19
- };
20
- type: {
21
- type: _contractspec_lib_schema0.EnumType<[string, string, string, string]>;
22
- isOptional: false;
23
- };
24
- definition: {
25
- type: _contractspec_lib_schema0.FieldType<unknown, unknown>;
26
- isOptional: false;
27
- };
28
- sql: {
29
- type: _contractspec_lib_schema0.FieldType<string, string>;
30
- isOptional: true;
31
- };
32
- cacheTtlSeconds: {
33
- type: _contractspec_lib_schema0.FieldType<number, number>;
34
- isOptional: false;
35
- };
36
- isShared: {
37
- type: _contractspec_lib_schema0.FieldType<boolean, boolean>;
38
- isOptional: false;
39
- };
40
- createdAt: {
41
- type: _contractspec_lib_schema0.FieldType<Date, string>;
42
- isOptional: false;
43
- };
4
+ export declare const QueryModel: import("@contractspec/lib.schema").SchemaModel<{
5
+ id: {
6
+ type: import("@contractspec/lib.schema").FieldType<string, string>;
7
+ isOptional: false;
8
+ };
9
+ name: {
10
+ type: import("@contractspec/lib.schema").FieldType<string, string>;
11
+ isOptional: false;
12
+ };
13
+ description: {
14
+ type: import("@contractspec/lib.schema").FieldType<string, string>;
15
+ isOptional: true;
16
+ };
17
+ type: {
18
+ type: import("@contractspec/lib.schema").EnumType<[string, string, string, string]>;
19
+ isOptional: false;
20
+ };
21
+ definition: {
22
+ type: import("@contractspec/lib.schema").FieldType<unknown, unknown>;
23
+ isOptional: false;
24
+ };
25
+ sql: {
26
+ type: import("@contractspec/lib.schema").FieldType<string, string>;
27
+ isOptional: true;
28
+ };
29
+ cacheTtlSeconds: {
30
+ type: import("@contractspec/lib.schema").FieldType<number, number>;
31
+ isOptional: false;
32
+ };
33
+ isShared: {
34
+ type: import("@contractspec/lib.schema").FieldType<boolean, boolean>;
35
+ isOptional: false;
36
+ };
37
+ createdAt: {
38
+ type: import("@contractspec/lib.schema").FieldType<Date, string>;
39
+ isOptional: false;
40
+ };
44
41
  }>;
45
42
  /**
46
43
  * Query execution result.
47
44
  */
48
- declare const QueryResultModel: _contractspec_lib_schema0.SchemaModel<{
49
- queryId: {
50
- type: _contractspec_lib_schema0.FieldType<string, string>;
51
- isOptional: false;
52
- };
53
- data: {
54
- type: _contractspec_lib_schema0.FieldType<unknown, unknown>;
55
- isOptional: false;
56
- };
57
- columns: {
58
- type: _contractspec_lib_schema0.FieldType<unknown, unknown>;
59
- isOptional: false;
60
- };
61
- rowCount: {
62
- type: _contractspec_lib_schema0.FieldType<number, number>;
63
- isOptional: false;
64
- };
65
- executionTimeMs: {
66
- type: _contractspec_lib_schema0.FieldType<number, number>;
67
- isOptional: false;
68
- };
69
- cachedAt: {
70
- type: _contractspec_lib_schema0.FieldType<Date, string>;
71
- isOptional: true;
72
- };
73
- error: {
74
- type: _contractspec_lib_schema0.FieldType<string, string>;
75
- isOptional: true;
76
- };
45
+ export declare const QueryResultModel: import("@contractspec/lib.schema").SchemaModel<{
46
+ queryId: {
47
+ type: import("@contractspec/lib.schema").FieldType<string, string>;
48
+ isOptional: false;
49
+ };
50
+ data: {
51
+ type: import("@contractspec/lib.schema").FieldType<unknown, unknown>;
52
+ isOptional: false;
53
+ };
54
+ columns: {
55
+ type: import("@contractspec/lib.schema").FieldType<unknown, unknown>;
56
+ isOptional: false;
57
+ };
58
+ rowCount: {
59
+ type: import("@contractspec/lib.schema").FieldType<number, number>;
60
+ isOptional: false;
61
+ };
62
+ executionTimeMs: {
63
+ type: import("@contractspec/lib.schema").FieldType<number, number>;
64
+ isOptional: false;
65
+ };
66
+ cachedAt: {
67
+ type: import("@contractspec/lib.schema").FieldType<Date, string>;
68
+ isOptional: true;
69
+ };
70
+ error: {
71
+ type: import("@contractspec/lib.schema").FieldType<string, string>;
72
+ isOptional: true;
73
+ };
77
74
  }>;
78
75
  /**
79
76
  * Input for creating a query.
80
77
  */
81
- declare const CreateQueryInputModel: _contractspec_lib_schema0.SchemaModel<{
82
- name: {
83
- type: _contractspec_lib_schema0.FieldType<string, string>;
84
- isOptional: false;
85
- };
86
- description: {
87
- type: _contractspec_lib_schema0.FieldType<string, string>;
88
- isOptional: true;
89
- };
90
- type: {
91
- type: _contractspec_lib_schema0.EnumType<[string, string, string, string]>;
92
- isOptional: false;
93
- };
94
- definition: {
95
- type: _contractspec_lib_schema0.FieldType<unknown, unknown>;
96
- isOptional: false;
97
- };
98
- sql: {
99
- type: _contractspec_lib_schema0.FieldType<string, string>;
100
- isOptional: true;
101
- };
102
- metricIds: {
103
- type: _contractspec_lib_schema0.FieldType<string, string>;
104
- isArray: true;
105
- isOptional: true;
106
- };
107
- cacheTtlSeconds: {
108
- type: _contractspec_lib_schema0.FieldType<number, number>;
109
- isOptional: true;
110
- };
111
- isShared: {
112
- type: _contractspec_lib_schema0.FieldType<boolean, boolean>;
113
- isOptional: true;
114
- };
78
+ export declare const CreateQueryInputModel: import("@contractspec/lib.schema").SchemaModel<{
79
+ name: {
80
+ type: import("@contractspec/lib.schema").FieldType<string, string>;
81
+ isOptional: false;
82
+ };
83
+ description: {
84
+ type: import("@contractspec/lib.schema").FieldType<string, string>;
85
+ isOptional: true;
86
+ };
87
+ type: {
88
+ type: import("@contractspec/lib.schema").EnumType<[string, string, string, string]>;
89
+ isOptional: false;
90
+ };
91
+ definition: {
92
+ type: import("@contractspec/lib.schema").FieldType<unknown, unknown>;
93
+ isOptional: false;
94
+ };
95
+ sql: {
96
+ type: import("@contractspec/lib.schema").FieldType<string, string>;
97
+ isOptional: true;
98
+ };
99
+ metricIds: {
100
+ type: import("@contractspec/lib.schema").FieldType<string, string>;
101
+ isArray: true;
102
+ isOptional: true;
103
+ };
104
+ cacheTtlSeconds: {
105
+ type: import("@contractspec/lib.schema").FieldType<number, number>;
106
+ isOptional: true;
107
+ };
108
+ isShared: {
109
+ type: import("@contractspec/lib.schema").FieldType<boolean, boolean>;
110
+ isOptional: true;
111
+ };
115
112
  }>;
116
113
  /**
117
114
  * Input for executing a query.
118
115
  */
119
- declare const ExecuteQueryInputModel: _contractspec_lib_schema0.SchemaModel<{
120
- queryId: {
121
- type: _contractspec_lib_schema0.FieldType<string, string>;
122
- isOptional: false;
123
- };
124
- parameters: {
125
- type: _contractspec_lib_schema0.FieldType<unknown, unknown>;
126
- isOptional: true;
127
- };
128
- dateRange: {
129
- type: _contractspec_lib_schema0.FieldType<unknown, unknown>;
130
- isOptional: true;
131
- };
132
- filters: {
133
- type: _contractspec_lib_schema0.FieldType<unknown, unknown>;
134
- isOptional: true;
135
- };
136
- forceRefresh: {
137
- type: _contractspec_lib_schema0.FieldType<boolean, boolean>;
138
- isOptional: true;
139
- };
116
+ export declare const ExecuteQueryInputModel: import("@contractspec/lib.schema").SchemaModel<{
117
+ queryId: {
118
+ type: import("@contractspec/lib.schema").FieldType<string, string>;
119
+ isOptional: false;
120
+ };
121
+ parameters: {
122
+ type: import("@contractspec/lib.schema").FieldType<unknown, unknown>;
123
+ isOptional: true;
124
+ };
125
+ dateRange: {
126
+ type: import("@contractspec/lib.schema").FieldType<unknown, unknown>;
127
+ isOptional: true;
128
+ };
129
+ filters: {
130
+ type: import("@contractspec/lib.schema").FieldType<unknown, unknown>;
131
+ isOptional: true;
132
+ };
133
+ forceRefresh: {
134
+ type: import("@contractspec/lib.schema").FieldType<boolean, boolean>;
135
+ isOptional: true;
136
+ };
140
137
  }>;
141
- //#endregion
142
- export { CreateQueryInputModel, ExecuteQueryInputModel, QueryModel, QueryResultModel };
143
138
  //# sourceMappingURL=query.schema.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"query.schema.d.ts","names":[],"sources":["../../src/query/query.schema.ts"],"mappings":";;;;;;cAMa,UAAA,4BAAU,WAAA;;UAarB,yBAAA,CAAA,SAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;cAKW,gBAAA,4BAAgB,WAAA;;UAW3B,yBAAA,CAAA,SAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;cAKW,qBAAA,4BAAqB,WAAA;;UAgBhC,yBAAA,CAAA,SAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;cAKW,sBAAA,4BAAsB,WAAA;;UASjC,yBAAA,CAAA,SAAA"}
1
+ {"version":3,"file":"query.schema.d.ts","sourceRoot":"","sources":["../../src/query/query.schema.ts"],"names":[],"mappings":"AAGA;;GAEG;AACH,eAAO,MAAM,UAAU;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAarB,CAAC;AAEH;;GAEG;AACH,eAAO,MAAM,gBAAgB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAW3B,CAAC;AAEH;;GAEG;AACH,eAAO,MAAM,qBAAqB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAgBhC,CAAC;AAEH;;GAEG;AACH,eAAO,MAAM,sBAAsB;;;;;;;;;;;;;;;;;;;;;EASjC,CAAC"}
@@ -1,157 +1,71 @@
1
- import { QueryTypeEnum } from "./query.enum.js";
2
- import { ScalarTypeEnum, defineSchemaModel } from "@contractspec/lib.schema";
1
+ // @bun
2
+ // src/query/query.enum.ts
3
+ import { defineEnum } from "@contractspec/lib.schema";
4
+ var QueryTypeEnum = defineEnum("QueryType", [
5
+ "SQL",
6
+ "METRIC",
7
+ "AGGREGATION",
8
+ "CUSTOM"
9
+ ]);
3
10
 
4
- //#region src/query/query.schema.ts
5
- /**
6
- * A data query.
7
- */
8
- const QueryModel = defineSchemaModel({
9
- name: "QueryModel",
10
- fields: {
11
- id: {
12
- type: ScalarTypeEnum.String_unsecure(),
13
- isOptional: false
14
- },
15
- name: {
16
- type: ScalarTypeEnum.String_unsecure(),
17
- isOptional: false
18
- },
19
- description: {
20
- type: ScalarTypeEnum.String_unsecure(),
21
- isOptional: true
22
- },
23
- type: {
24
- type: QueryTypeEnum,
25
- isOptional: false
26
- },
27
- definition: {
28
- type: ScalarTypeEnum.JSON(),
29
- isOptional: false
30
- },
31
- sql: {
32
- type: ScalarTypeEnum.String_unsecure(),
33
- isOptional: true
34
- },
35
- cacheTtlSeconds: {
36
- type: ScalarTypeEnum.Int_unsecure(),
37
- isOptional: false
38
- },
39
- isShared: {
40
- type: ScalarTypeEnum.Boolean(),
41
- isOptional: false
42
- },
43
- createdAt: {
44
- type: ScalarTypeEnum.DateTime(),
45
- isOptional: false
46
- }
47
- }
11
+ // src/query/query.schema.ts
12
+ import { defineSchemaModel, ScalarTypeEnum } from "@contractspec/lib.schema";
13
+ var QueryModel = defineSchemaModel({
14
+ name: "QueryModel",
15
+ fields: {
16
+ id: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },
17
+ name: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },
18
+ description: { type: ScalarTypeEnum.String_unsecure(), isOptional: true },
19
+ type: { type: QueryTypeEnum, isOptional: false },
20
+ definition: { type: ScalarTypeEnum.JSON(), isOptional: false },
21
+ sql: { type: ScalarTypeEnum.String_unsecure(), isOptional: true },
22
+ cacheTtlSeconds: { type: ScalarTypeEnum.Int_unsecure(), isOptional: false },
23
+ isShared: { type: ScalarTypeEnum.Boolean(), isOptional: false },
24
+ createdAt: { type: ScalarTypeEnum.DateTime(), isOptional: false }
25
+ }
48
26
  });
49
- /**
50
- * Query execution result.
51
- */
52
- const QueryResultModel = defineSchemaModel({
53
- name: "QueryResultModel",
54
- fields: {
55
- queryId: {
56
- type: ScalarTypeEnum.String_unsecure(),
57
- isOptional: false
58
- },
59
- data: {
60
- type: ScalarTypeEnum.JSON(),
61
- isOptional: false
62
- },
63
- columns: {
64
- type: ScalarTypeEnum.JSON(),
65
- isOptional: false
66
- },
67
- rowCount: {
68
- type: ScalarTypeEnum.Int_unsecure(),
69
- isOptional: false
70
- },
71
- executionTimeMs: {
72
- type: ScalarTypeEnum.Int_unsecure(),
73
- isOptional: false
74
- },
75
- cachedAt: {
76
- type: ScalarTypeEnum.DateTime(),
77
- isOptional: true
78
- },
79
- error: {
80
- type: ScalarTypeEnum.String_unsecure(),
81
- isOptional: true
82
- }
83
- }
27
+ var QueryResultModel = defineSchemaModel({
28
+ name: "QueryResultModel",
29
+ fields: {
30
+ queryId: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },
31
+ data: { type: ScalarTypeEnum.JSON(), isOptional: false },
32
+ columns: { type: ScalarTypeEnum.JSON(), isOptional: false },
33
+ rowCount: { type: ScalarTypeEnum.Int_unsecure(), isOptional: false },
34
+ executionTimeMs: { type: ScalarTypeEnum.Int_unsecure(), isOptional: false },
35
+ cachedAt: { type: ScalarTypeEnum.DateTime(), isOptional: true },
36
+ error: { type: ScalarTypeEnum.String_unsecure(), isOptional: true }
37
+ }
84
38
  });
85
- /**
86
- * Input for creating a query.
87
- */
88
- const CreateQueryInputModel = defineSchemaModel({
89
- name: "CreateQueryInput",
90
- fields: {
91
- name: {
92
- type: ScalarTypeEnum.NonEmptyString(),
93
- isOptional: false
94
- },
95
- description: {
96
- type: ScalarTypeEnum.String_unsecure(),
97
- isOptional: true
98
- },
99
- type: {
100
- type: QueryTypeEnum,
101
- isOptional: false
102
- },
103
- definition: {
104
- type: ScalarTypeEnum.JSON(),
105
- isOptional: false
106
- },
107
- sql: {
108
- type: ScalarTypeEnum.String_unsecure(),
109
- isOptional: true
110
- },
111
- metricIds: {
112
- type: ScalarTypeEnum.String_unsecure(),
113
- isArray: true,
114
- isOptional: true
115
- },
116
- cacheTtlSeconds: {
117
- type: ScalarTypeEnum.Int_unsecure(),
118
- isOptional: true
119
- },
120
- isShared: {
121
- type: ScalarTypeEnum.Boolean(),
122
- isOptional: true
123
- }
124
- }
39
+ var CreateQueryInputModel = defineSchemaModel({
40
+ name: "CreateQueryInput",
41
+ fields: {
42
+ name: { type: ScalarTypeEnum.NonEmptyString(), isOptional: false },
43
+ description: { type: ScalarTypeEnum.String_unsecure(), isOptional: true },
44
+ type: { type: QueryTypeEnum, isOptional: false },
45
+ definition: { type: ScalarTypeEnum.JSON(), isOptional: false },
46
+ sql: { type: ScalarTypeEnum.String_unsecure(), isOptional: true },
47
+ metricIds: {
48
+ type: ScalarTypeEnum.String_unsecure(),
49
+ isArray: true,
50
+ isOptional: true
51
+ },
52
+ cacheTtlSeconds: { type: ScalarTypeEnum.Int_unsecure(), isOptional: true },
53
+ isShared: { type: ScalarTypeEnum.Boolean(), isOptional: true }
54
+ }
125
55
  });
126
- /**
127
- * Input for executing a query.
128
- */
129
- const ExecuteQueryInputModel = defineSchemaModel({
130
- name: "ExecuteQueryInput",
131
- fields: {
132
- queryId: {
133
- type: ScalarTypeEnum.String_unsecure(),
134
- isOptional: false
135
- },
136
- parameters: {
137
- type: ScalarTypeEnum.JSON(),
138
- isOptional: true
139
- },
140
- dateRange: {
141
- type: ScalarTypeEnum.JSON(),
142
- isOptional: true
143
- },
144
- filters: {
145
- type: ScalarTypeEnum.JSON(),
146
- isOptional: true
147
- },
148
- forceRefresh: {
149
- type: ScalarTypeEnum.Boolean(),
150
- isOptional: true
151
- }
152
- }
56
+ var ExecuteQueryInputModel = defineSchemaModel({
57
+ name: "ExecuteQueryInput",
58
+ fields: {
59
+ queryId: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },
60
+ parameters: { type: ScalarTypeEnum.JSON(), isOptional: true },
61
+ dateRange: { type: ScalarTypeEnum.JSON(), isOptional: true },
62
+ filters: { type: ScalarTypeEnum.JSON(), isOptional: true },
63
+ forceRefresh: { type: ScalarTypeEnum.Boolean(), isOptional: true }
64
+ }
153
65
  });
154
-
155
- //#endregion
156
- export { CreateQueryInputModel, ExecuteQueryInputModel, QueryModel, QueryResultModel };
157
- //# sourceMappingURL=query.schema.js.map
66
+ export {
67
+ QueryResultModel,
68
+ QueryModel,
69
+ ExecuteQueryInputModel,
70
+ CreateQueryInputModel
71
+ };
@@ -1,8 +1,3 @@
1
- import * as _contractspec_lib_contracts0 from "@contractspec/lib.contracts";
2
-
3
- //#region src/query/query.test-spec.d.ts
4
- declare const CreateQueryTest: _contractspec_lib_contracts0.TestSpec;
5
- declare const ExecuteQueryTest: _contractspec_lib_contracts0.TestSpec;
6
- //#endregion
7
- export { CreateQueryTest, ExecuteQueryTest };
1
+ export declare const CreateQueryTest: import("@contractspec/lib.contracts").TestSpec;
2
+ export declare const ExecuteQueryTest: import("@contractspec/lib.contracts").TestSpec;
8
3
  //# sourceMappingURL=query.test-spec.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"query.test-spec.d.ts","names":[],"sources":["../../src/query/query.test-spec.ts"],"mappings":";;;cAEa,eAAA,EAqDX,4BAAA,CArD0B,QAAA;AAAA,cAuDf,gBAAA,EAoDX,4BAAA,CApD2B,QAAA"}
1
+ {"version":3,"file":"query.test-spec.d.ts","sourceRoot":"","sources":["../../src/query/query.test-spec.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,eAAe,gDAqD1B,CAAC;AAEH,eAAO,MAAM,gBAAgB,gDAoD3B,CAAC"}