@contractspec/example.analytics-dashboard 1.44.0 → 1.45.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.
- package/dist/dashboard/dashboard.enum.d.ts +4 -4
- package/dist/dashboard/dashboard.enum.d.ts.map +1 -1
- package/dist/dashboard/dashboard.operation.d.ts +132 -132
- package/dist/dashboard/dashboard.operation.js +6 -6
- package/dist/dashboard/dashboard.operation.js.map +1 -1
- package/dist/dashboard/dashboard.presentation.js +3 -3
- package/dist/dashboard/dashboard.presentation.js.map +1 -1
- package/dist/dashboard/dashboard.schema.d.ts +79 -79
- package/dist/dashboard.feature.js +30 -30
- package/dist/dashboard.feature.js.map +1 -1
- package/dist/events.d.ts +39 -39
- package/dist/events.js +3 -3
- package/dist/events.js.map +1 -1
- package/dist/example.d.ts +3 -36
- package/dist/example.d.ts.map +1 -1
- package/dist/example.js +16 -11
- package/dist/example.js.map +1 -1
- package/dist/query/query.enum.d.ts +2 -2
- package/dist/query/query.operation.d.ts +45 -45
- package/dist/query/query.operation.js +3 -3
- package/dist/query/query.operation.js.map +1 -1
- package/dist/query/query.presentation.js +2 -2
- package/dist/query/query.presentation.js.map +1 -1
- package/dist/query/query.schema.d.ts +34 -34
- package/package.json +10 -10
|
@@ -1,123 +1,123 @@
|
|
|
1
|
-
import * as
|
|
1
|
+
import * as _contractspec_lib_schema210 from "@contractspec/lib.schema";
|
|
2
2
|
import * as _contractspec_lib_contracts3 from "@contractspec/lib.contracts";
|
|
3
3
|
|
|
4
4
|
//#region src/query/query.operation.d.ts
|
|
5
5
|
/**
|
|
6
6
|
* Create a data query.
|
|
7
7
|
*/
|
|
8
|
-
declare const CreateQueryContract: _contractspec_lib_contracts3.OperationSpec<
|
|
8
|
+
declare const CreateQueryContract: _contractspec_lib_contracts3.OperationSpec<_contractspec_lib_schema210.SchemaModel<{
|
|
9
9
|
name: {
|
|
10
|
-
type:
|
|
10
|
+
type: _contractspec_lib_schema210.FieldType<string, string>;
|
|
11
11
|
isOptional: false;
|
|
12
12
|
};
|
|
13
13
|
description: {
|
|
14
|
-
type:
|
|
14
|
+
type: _contractspec_lib_schema210.FieldType<string, string>;
|
|
15
15
|
isOptional: true;
|
|
16
16
|
};
|
|
17
17
|
type: {
|
|
18
|
-
type:
|
|
18
|
+
type: _contractspec_lib_schema210.EnumType<[string, string, string, string]>;
|
|
19
19
|
isOptional: false;
|
|
20
20
|
};
|
|
21
21
|
definition: {
|
|
22
|
-
type:
|
|
22
|
+
type: _contractspec_lib_schema210.FieldType<unknown, unknown>;
|
|
23
23
|
isOptional: false;
|
|
24
24
|
};
|
|
25
25
|
sql: {
|
|
26
|
-
type:
|
|
26
|
+
type: _contractspec_lib_schema210.FieldType<string, string>;
|
|
27
27
|
isOptional: true;
|
|
28
28
|
};
|
|
29
29
|
metricIds: {
|
|
30
|
-
type:
|
|
30
|
+
type: _contractspec_lib_schema210.FieldType<string, string>;
|
|
31
31
|
isArray: true;
|
|
32
32
|
isOptional: true;
|
|
33
33
|
};
|
|
34
34
|
cacheTtlSeconds: {
|
|
35
|
-
type:
|
|
35
|
+
type: _contractspec_lib_schema210.FieldType<number, number>;
|
|
36
36
|
isOptional: true;
|
|
37
37
|
};
|
|
38
38
|
isShared: {
|
|
39
|
-
type:
|
|
39
|
+
type: _contractspec_lib_schema210.FieldType<boolean, boolean>;
|
|
40
40
|
isOptional: true;
|
|
41
41
|
};
|
|
42
|
-
}>,
|
|
42
|
+
}>, _contractspec_lib_schema210.SchemaModel<{
|
|
43
43
|
id: {
|
|
44
|
-
type:
|
|
44
|
+
type: _contractspec_lib_schema210.FieldType<string, string>;
|
|
45
45
|
isOptional: false;
|
|
46
46
|
};
|
|
47
47
|
name: {
|
|
48
|
-
type:
|
|
48
|
+
type: _contractspec_lib_schema210.FieldType<string, string>;
|
|
49
49
|
isOptional: false;
|
|
50
50
|
};
|
|
51
51
|
description: {
|
|
52
|
-
type:
|
|
52
|
+
type: _contractspec_lib_schema210.FieldType<string, string>;
|
|
53
53
|
isOptional: true;
|
|
54
54
|
};
|
|
55
55
|
type: {
|
|
56
|
-
type:
|
|
56
|
+
type: _contractspec_lib_schema210.EnumType<[string, string, string, string]>;
|
|
57
57
|
isOptional: false;
|
|
58
58
|
};
|
|
59
59
|
definition: {
|
|
60
|
-
type:
|
|
60
|
+
type: _contractspec_lib_schema210.FieldType<unknown, unknown>;
|
|
61
61
|
isOptional: false;
|
|
62
62
|
};
|
|
63
63
|
sql: {
|
|
64
|
-
type:
|
|
64
|
+
type: _contractspec_lib_schema210.FieldType<string, string>;
|
|
65
65
|
isOptional: true;
|
|
66
66
|
};
|
|
67
67
|
cacheTtlSeconds: {
|
|
68
|
-
type:
|
|
68
|
+
type: _contractspec_lib_schema210.FieldType<number, number>;
|
|
69
69
|
isOptional: false;
|
|
70
70
|
};
|
|
71
71
|
isShared: {
|
|
72
|
-
type:
|
|
72
|
+
type: _contractspec_lib_schema210.FieldType<boolean, boolean>;
|
|
73
73
|
isOptional: false;
|
|
74
74
|
};
|
|
75
75
|
createdAt: {
|
|
76
|
-
type:
|
|
76
|
+
type: _contractspec_lib_schema210.FieldType<Date, string>;
|
|
77
77
|
isOptional: false;
|
|
78
78
|
};
|
|
79
79
|
}>, {
|
|
80
80
|
key: string;
|
|
81
|
-
version:
|
|
81
|
+
version: string;
|
|
82
82
|
stability: string;
|
|
83
83
|
owners: "@example.analytics-dashboard"[];
|
|
84
84
|
tags: string[];
|
|
85
85
|
when: string;
|
|
86
|
-
payload:
|
|
86
|
+
payload: _contractspec_lib_schema210.SchemaModel<{
|
|
87
87
|
id: {
|
|
88
|
-
type:
|
|
88
|
+
type: _contractspec_lib_schema210.FieldType<string, string>;
|
|
89
89
|
isOptional: false;
|
|
90
90
|
};
|
|
91
91
|
name: {
|
|
92
|
-
type:
|
|
92
|
+
type: _contractspec_lib_schema210.FieldType<string, string>;
|
|
93
93
|
isOptional: false;
|
|
94
94
|
};
|
|
95
95
|
description: {
|
|
96
|
-
type:
|
|
96
|
+
type: _contractspec_lib_schema210.FieldType<string, string>;
|
|
97
97
|
isOptional: true;
|
|
98
98
|
};
|
|
99
99
|
type: {
|
|
100
|
-
type:
|
|
100
|
+
type: _contractspec_lib_schema210.EnumType<[string, string, string, string]>;
|
|
101
101
|
isOptional: false;
|
|
102
102
|
};
|
|
103
103
|
definition: {
|
|
104
|
-
type:
|
|
104
|
+
type: _contractspec_lib_schema210.FieldType<unknown, unknown>;
|
|
105
105
|
isOptional: false;
|
|
106
106
|
};
|
|
107
107
|
sql: {
|
|
108
|
-
type:
|
|
108
|
+
type: _contractspec_lib_schema210.FieldType<string, string>;
|
|
109
109
|
isOptional: true;
|
|
110
110
|
};
|
|
111
111
|
cacheTtlSeconds: {
|
|
112
|
-
type:
|
|
112
|
+
type: _contractspec_lib_schema210.FieldType<number, number>;
|
|
113
113
|
isOptional: false;
|
|
114
114
|
};
|
|
115
115
|
isShared: {
|
|
116
|
-
type:
|
|
116
|
+
type: _contractspec_lib_schema210.FieldType<boolean, boolean>;
|
|
117
117
|
isOptional: false;
|
|
118
118
|
};
|
|
119
119
|
createdAt: {
|
|
120
|
-
type:
|
|
120
|
+
type: _contractspec_lib_schema210.FieldType<Date, string>;
|
|
121
121
|
isOptional: false;
|
|
122
122
|
};
|
|
123
123
|
}>;
|
|
@@ -125,54 +125,54 @@ declare const CreateQueryContract: _contractspec_lib_contracts3.OperationSpec<_c
|
|
|
125
125
|
/**
|
|
126
126
|
* Execute a data query.
|
|
127
127
|
*/
|
|
128
|
-
declare const ExecuteQueryContract: _contractspec_lib_contracts3.OperationSpec<
|
|
128
|
+
declare const ExecuteQueryContract: _contractspec_lib_contracts3.OperationSpec<_contractspec_lib_schema210.SchemaModel<{
|
|
129
129
|
queryId: {
|
|
130
|
-
type:
|
|
130
|
+
type: _contractspec_lib_schema210.FieldType<string, string>;
|
|
131
131
|
isOptional: false;
|
|
132
132
|
};
|
|
133
133
|
parameters: {
|
|
134
|
-
type:
|
|
134
|
+
type: _contractspec_lib_schema210.FieldType<unknown, unknown>;
|
|
135
135
|
isOptional: true;
|
|
136
136
|
};
|
|
137
137
|
dateRange: {
|
|
138
|
-
type:
|
|
138
|
+
type: _contractspec_lib_schema210.FieldType<unknown, unknown>;
|
|
139
139
|
isOptional: true;
|
|
140
140
|
};
|
|
141
141
|
filters: {
|
|
142
|
-
type:
|
|
142
|
+
type: _contractspec_lib_schema210.FieldType<unknown, unknown>;
|
|
143
143
|
isOptional: true;
|
|
144
144
|
};
|
|
145
145
|
forceRefresh: {
|
|
146
|
-
type:
|
|
146
|
+
type: _contractspec_lib_schema210.FieldType<boolean, boolean>;
|
|
147
147
|
isOptional: true;
|
|
148
148
|
};
|
|
149
|
-
}>,
|
|
149
|
+
}>, _contractspec_lib_schema210.SchemaModel<{
|
|
150
150
|
queryId: {
|
|
151
|
-
type:
|
|
151
|
+
type: _contractspec_lib_schema210.FieldType<string, string>;
|
|
152
152
|
isOptional: false;
|
|
153
153
|
};
|
|
154
154
|
data: {
|
|
155
|
-
type:
|
|
155
|
+
type: _contractspec_lib_schema210.FieldType<unknown, unknown>;
|
|
156
156
|
isOptional: false;
|
|
157
157
|
};
|
|
158
158
|
columns: {
|
|
159
|
-
type:
|
|
159
|
+
type: _contractspec_lib_schema210.FieldType<unknown, unknown>;
|
|
160
160
|
isOptional: false;
|
|
161
161
|
};
|
|
162
162
|
rowCount: {
|
|
163
|
-
type:
|
|
163
|
+
type: _contractspec_lib_schema210.FieldType<number, number>;
|
|
164
164
|
isOptional: false;
|
|
165
165
|
};
|
|
166
166
|
executionTimeMs: {
|
|
167
|
-
type:
|
|
167
|
+
type: _contractspec_lib_schema210.FieldType<number, number>;
|
|
168
168
|
isOptional: false;
|
|
169
169
|
};
|
|
170
170
|
cachedAt: {
|
|
171
|
-
type:
|
|
171
|
+
type: _contractspec_lib_schema210.FieldType<Date, string>;
|
|
172
172
|
isOptional: true;
|
|
173
173
|
};
|
|
174
174
|
error: {
|
|
175
|
-
type:
|
|
175
|
+
type: _contractspec_lib_schema210.FieldType<string, string>;
|
|
176
176
|
isOptional: true;
|
|
177
177
|
};
|
|
178
178
|
}>, undefined>;
|
|
@@ -9,7 +9,7 @@ const OWNERS = ["@example.analytics-dashboard"];
|
|
|
9
9
|
const CreateQueryContract = defineCommand({
|
|
10
10
|
meta: {
|
|
11
11
|
key: "analytics.query.create",
|
|
12
|
-
version: 1,
|
|
12
|
+
version: "1.0.0",
|
|
13
13
|
stability: "stable",
|
|
14
14
|
owners: [...OWNERS],
|
|
15
15
|
tags: [
|
|
@@ -29,7 +29,7 @@ const CreateQueryContract = defineCommand({
|
|
|
29
29
|
sideEffects: {
|
|
30
30
|
emits: [{
|
|
31
31
|
key: "analytics.query.created",
|
|
32
|
-
version: 1,
|
|
32
|
+
version: "1.0.0",
|
|
33
33
|
stability: "stable",
|
|
34
34
|
owners: [...OWNERS],
|
|
35
35
|
tags: [
|
|
@@ -69,7 +69,7 @@ const CreateQueryContract = defineCommand({
|
|
|
69
69
|
const ExecuteQueryContract = defineQuery({
|
|
70
70
|
meta: {
|
|
71
71
|
key: "analytics.query.execute",
|
|
72
|
-
version: 1,
|
|
72
|
+
version: "1.0.0",
|
|
73
73
|
stability: "stable",
|
|
74
74
|
owners: [...OWNERS],
|
|
75
75
|
tags: [
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"query.operation.js","names":[],"sources":["../../src/query/query.operation.ts"],"sourcesContent":["import {\n defineCommand,\n defineQuery,\n} from '@contractspec/lib.contracts/operations';\nimport {\n QueryModel,\n QueryResultModel,\n CreateQueryInputModel,\n ExecuteQueryInputModel,\n} from './query.schema';\n\nconst OWNERS = ['@example.analytics-dashboard'] as const;\n\n/**\n * Create a data query.\n */\nexport const CreateQueryContract = defineCommand({\n meta: {\n key: 'analytics.query.create',\n version: 1,\n stability: 'stable',\n owners: [...OWNERS],\n tags: ['analytics', 'query', 'create'],\n description: 'Create a data query.',\n goal: 'Define reusable data queries.',\n context: 'Query builder.',\n },\n io: { input: CreateQueryInputModel, output: QueryModel },\n policy: { auth: 'user' },\n sideEffects: {\n emits: [\n {\n key: 'analytics.query.created',\n version: 1,\n stability: 'stable',\n owners: [...OWNERS],\n tags: ['analytics', 'query', 'created'],\n when: 'Query created',\n payload: QueryModel,\n },\n ],\n audit: ['analytics.query.created'],\n },\n acceptance: {\n scenarios: [\n {\n key: 'create-query-happy-path',\n given: ['User is authenticated'],\n when: ['User submits valid query definition'],\n then: ['Query is created', 'QueryCreated event is emitted'],\n },\n ],\n examples: [\n {\n key: 'create-sql-query',\n input: {\n name: 'Monthly Revenue',\n sql: 'SELECT SUM(amount) FROM orders WHERE date >= :startDate',\n },\n output: { id: 'query-123', name: 'Monthly Revenue', type: 'sql' },\n },\n ],\n },\n});\n\n/**\n * Execute a data query.\n */\nexport const ExecuteQueryContract = defineQuery({\n meta: {\n key: 'analytics.query.execute',\n version: 1,\n stability: 'stable',\n owners: [...OWNERS],\n tags: ['analytics', 'query', 'execute'],\n description: 'Execute a data query.',\n goal: 'Fetch data for visualizations.',\n context: 'Dashboard rendering.',\n },\n io: { input: ExecuteQueryInputModel, output: QueryResultModel },\n policy: { auth: 'user' },\n acceptance: {\n scenarios: [\n {\n key: 'execute-query-happy-path',\n given: ['Query exists'],\n when: ['User executes query with parameters'],\n then: ['Query results are returned'],\n },\n ],\n examples: [\n {\n key: 'execute-with-params',\n input: { queryId: 'query-123', params: { startDate: '2025-01-01' } },\n output: { columns: ['total'], rows: [{ total: 50000 }], rowCount: 1 },\n },\n ],\n },\n});\n"],"mappings":";;;;AAWA,MAAM,SAAS,CAAC,+BAA+B;;;;AAK/C,MAAa,sBAAsB,cAAc;CAC/C,MAAM;EACJ,KAAK;EACL,SAAS;EACT,WAAW;EACX,QAAQ,CAAC,GAAG,OAAO;EACnB,MAAM;GAAC;GAAa;GAAS;GAAS;EACtC,aAAa;EACb,MAAM;EACN,SAAS;EACV;CACD,IAAI;EAAE,OAAO;EAAuB,QAAQ;EAAY;CACxD,QAAQ,EAAE,MAAM,QAAQ;CACxB,aAAa;EACX,OAAO,CACL;GACE,KAAK;GACL,SAAS;GACT,WAAW;GACX,QAAQ,CAAC,GAAG,OAAO;GACnB,MAAM;IAAC;IAAa;IAAS;IAAU;GACvC,MAAM;GACN,SAAS;GACV,CACF;EACD,OAAO,CAAC,0BAA0B;EACnC;CACD,YAAY;EACV,WAAW,CACT;GACE,KAAK;GACL,OAAO,CAAC,wBAAwB;GAChC,MAAM,CAAC,sCAAsC;GAC7C,MAAM,CAAC,oBAAoB,gCAAgC;GAC5D,CACF;EACD,UAAU,CACR;GACE,KAAK;GACL,OAAO;IACL,MAAM;IACN,KAAK;IACN;GACD,QAAQ;IAAE,IAAI;IAAa,MAAM;IAAmB,MAAM;IAAO;GAClE,CACF;EACF;CACF,CAAC;;;;AAKF,MAAa,uBAAuB,YAAY;CAC9C,MAAM;EACJ,KAAK;EACL,SAAS;EACT,WAAW;EACX,QAAQ,CAAC,GAAG,OAAO;EACnB,MAAM;GAAC;GAAa;GAAS;GAAU;EACvC,aAAa;EACb,MAAM;EACN,SAAS;EACV;CACD,IAAI;EAAE,OAAO;EAAwB,QAAQ;EAAkB;CAC/D,QAAQ,EAAE,MAAM,QAAQ;CACxB,YAAY;EACV,WAAW,CACT;GACE,KAAK;GACL,OAAO,CAAC,eAAe;GACvB,MAAM,CAAC,sCAAsC;GAC7C,MAAM,CAAC,6BAA6B;GACrC,CACF;EACD,UAAU,CACR;GACE,KAAK;GACL,OAAO;IAAE,SAAS;IAAa,QAAQ,EAAE,WAAW,cAAc;IAAE;GACpE,QAAQ;IAAE,SAAS,CAAC,QAAQ;IAAE,MAAM,CAAC,EAAE,OAAO,KAAO,CAAC;IAAE,UAAU;IAAG;GACtE,CACF;EACF;CACF,CAAC"}
|
|
1
|
+
{"version":3,"file":"query.operation.js","names":[],"sources":["../../src/query/query.operation.ts"],"sourcesContent":["import {\n defineCommand,\n defineQuery,\n} from '@contractspec/lib.contracts/operations';\nimport {\n QueryModel,\n QueryResultModel,\n CreateQueryInputModel,\n ExecuteQueryInputModel,\n} from './query.schema';\n\nconst OWNERS = ['@example.analytics-dashboard'] as const;\n\n/**\n * Create a data query.\n */\nexport const CreateQueryContract = defineCommand({\n meta: {\n key: 'analytics.query.create',\n version: '1.0.0',\n stability: 'stable',\n owners: [...OWNERS],\n tags: ['analytics', 'query', 'create'],\n description: 'Create a data query.',\n goal: 'Define reusable data queries.',\n context: 'Query builder.',\n },\n io: { input: CreateQueryInputModel, output: QueryModel },\n policy: { auth: 'user' },\n sideEffects: {\n emits: [\n {\n key: 'analytics.query.created',\n version: '1.0.0',\n stability: 'stable',\n owners: [...OWNERS],\n tags: ['analytics', 'query', 'created'],\n when: 'Query created',\n payload: QueryModel,\n },\n ],\n audit: ['analytics.query.created'],\n },\n acceptance: {\n scenarios: [\n {\n key: 'create-query-happy-path',\n given: ['User is authenticated'],\n when: ['User submits valid query definition'],\n then: ['Query is created', 'QueryCreated event is emitted'],\n },\n ],\n examples: [\n {\n key: 'create-sql-query',\n input: {\n name: 'Monthly Revenue',\n sql: 'SELECT SUM(amount) FROM orders WHERE date >= :startDate',\n },\n output: { id: 'query-123', name: 'Monthly Revenue', type: 'sql' },\n },\n ],\n },\n});\n\n/**\n * Execute a data query.\n */\nexport const ExecuteQueryContract = defineQuery({\n meta: {\n key: 'analytics.query.execute',\n version: '1.0.0',\n stability: 'stable',\n owners: [...OWNERS],\n tags: ['analytics', 'query', 'execute'],\n description: 'Execute a data query.',\n goal: 'Fetch data for visualizations.',\n context: 'Dashboard rendering.',\n },\n io: { input: ExecuteQueryInputModel, output: QueryResultModel },\n policy: { auth: 'user' },\n acceptance: {\n scenarios: [\n {\n key: 'execute-query-happy-path',\n given: ['Query exists'],\n when: ['User executes query with parameters'],\n then: ['Query results are returned'],\n },\n ],\n examples: [\n {\n key: 'execute-with-params',\n input: { queryId: 'query-123', params: { startDate: '2025-01-01' } },\n output: { columns: ['total'], rows: [{ total: 50000 }], rowCount: 1 },\n },\n ],\n },\n});\n"],"mappings":";;;;AAWA,MAAM,SAAS,CAAC,+BAA+B;;;;AAK/C,MAAa,sBAAsB,cAAc;CAC/C,MAAM;EACJ,KAAK;EACL,SAAS;EACT,WAAW;EACX,QAAQ,CAAC,GAAG,OAAO;EACnB,MAAM;GAAC;GAAa;GAAS;GAAS;EACtC,aAAa;EACb,MAAM;EACN,SAAS;EACV;CACD,IAAI;EAAE,OAAO;EAAuB,QAAQ;EAAY;CACxD,QAAQ,EAAE,MAAM,QAAQ;CACxB,aAAa;EACX,OAAO,CACL;GACE,KAAK;GACL,SAAS;GACT,WAAW;GACX,QAAQ,CAAC,GAAG,OAAO;GACnB,MAAM;IAAC;IAAa;IAAS;IAAU;GACvC,MAAM;GACN,SAAS;GACV,CACF;EACD,OAAO,CAAC,0BAA0B;EACnC;CACD,YAAY;EACV,WAAW,CACT;GACE,KAAK;GACL,OAAO,CAAC,wBAAwB;GAChC,MAAM,CAAC,sCAAsC;GAC7C,MAAM,CAAC,oBAAoB,gCAAgC;GAC5D,CACF;EACD,UAAU,CACR;GACE,KAAK;GACL,OAAO;IACL,MAAM;IACN,KAAK;IACN;GACD,QAAQ;IAAE,IAAI;IAAa,MAAM;IAAmB,MAAM;IAAO;GAClE,CACF;EACF;CACF,CAAC;;;;AAKF,MAAa,uBAAuB,YAAY;CAC9C,MAAM;EACJ,KAAK;EACL,SAAS;EACT,WAAW;EACX,QAAQ,CAAC,GAAG,OAAO;EACnB,MAAM;GAAC;GAAa;GAAS;GAAU;EACvC,aAAa;EACb,MAAM;EACN,SAAS;EACV;CACD,IAAI;EAAE,OAAO;EAAwB,QAAQ;EAAkB;CAC/D,QAAQ,EAAE,MAAM,QAAQ;CACxB,YAAY;EACV,WAAW,CACT;GACE,KAAK;GACL,OAAO,CAAC,eAAe;GACvB,MAAM,CAAC,sCAAsC;GAC7C,MAAM,CAAC,6BAA6B;GACrC,CACF;EACD,UAAU,CACR;GACE,KAAK;GACL,OAAO;IAAE,SAAS;IAAa,QAAQ,EAAE,WAAW,cAAc;IAAE;GACpE,QAAQ;IAAE,SAAS,CAAC,QAAQ;IAAE,MAAM,CAAC,EAAE,OAAO,KAAO,CAAC;IAAE,UAAU;IAAG;GACtE,CACF;EACF;CACF,CAAC"}
|
|
@@ -5,7 +5,7 @@ import { StabilityEnum } from "@contractspec/lib.contracts";
|
|
|
5
5
|
const QueriesListPresentation = {
|
|
6
6
|
meta: {
|
|
7
7
|
key: "analytics.query.list",
|
|
8
|
-
version: 1,
|
|
8
|
+
version: "1.0.0",
|
|
9
9
|
title: "Queries List",
|
|
10
10
|
description: "List of saved queries",
|
|
11
11
|
domain: "analytics",
|
|
@@ -31,7 +31,7 @@ const QueriesListPresentation = {
|
|
|
31
31
|
const QueryBuilderPresentation = {
|
|
32
32
|
meta: {
|
|
33
33
|
key: "analytics.query.builder",
|
|
34
|
-
version: 1,
|
|
34
|
+
version: "1.0.0",
|
|
35
35
|
title: "Query Builder",
|
|
36
36
|
description: "Visual query builder interface",
|
|
37
37
|
domain: "analytics",
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"query.presentation.js","names":["QueriesListPresentation: PresentationSpec","QueryBuilderPresentation: PresentationSpec"],"sources":["../../src/query/query.presentation.ts"],"sourcesContent":["import type { PresentationSpec } from '@contractspec/lib.contracts';\nimport { StabilityEnum } from '@contractspec/lib.contracts';\nimport { QueryModel } from './query.schema';\n\nexport const QueriesListPresentation: PresentationSpec = {\n meta: {\n key: 'analytics.query.list',\n version: 1,\n title: 'Queries List',\n description: 'List of saved queries',\n domain: 'analytics',\n owners: ['@analytics-dashboard'],\n tags: ['analytics', 'queries', 'list'],\n stability: StabilityEnum.Experimental,\n goal: 'Browse and manage saved data queries.',\n context: 'The library of reusable data definitions.',\n },\n source: {\n type: 'component',\n framework: 'react',\n componentKey: 'QueriesList',\n props: QueryModel,\n },\n targets: ['react', 'markdown'],\n policy: {\n flags: ['analytics.queries.enabled'],\n },\n};\n\nexport const QueryBuilderPresentation: PresentationSpec = {\n meta: {\n key: 'analytics.query.builder',\n version: 1,\n title: 'Query Builder',\n description: 'Visual query builder interface',\n domain: 'analytics',\n owners: ['@analytics-dashboard'],\n tags: ['analytics', 'query', 'builder'],\n stability: StabilityEnum.Experimental,\n goal: 'Visually construct data queries and transformations.',\n context: 'Developer tool for data analysis.',\n },\n source: {\n type: 'component',\n framework: 'react',\n componentKey: 'QueryBuilder',\n props: QueryModel,\n },\n targets: ['react'],\n policy: {\n flags: ['analytics.queries.enabled'],\n },\n};\n"],"mappings":";;;;AAIA,MAAaA,0BAA4C;CACvD,MAAM;EACJ,KAAK;EACL,SAAS;EACT,OAAO;EACP,aAAa;EACb,QAAQ;EACR,QAAQ,CAAC,uBAAuB;EAChC,MAAM;GAAC;GAAa;GAAW;GAAO;EACtC,WAAW,cAAc;EACzB,MAAM;EACN,SAAS;EACV;CACD,QAAQ;EACN,MAAM;EACN,WAAW;EACX,cAAc;EACd,OAAO;EACR;CACD,SAAS,CAAC,SAAS,WAAW;CAC9B,QAAQ,EACN,OAAO,CAAC,4BAA4B,EACrC;CACF;AAED,MAAaC,2BAA6C;CACxD,MAAM;EACJ,KAAK;EACL,SAAS;EACT,OAAO;EACP,aAAa;EACb,QAAQ;EACR,QAAQ,CAAC,uBAAuB;EAChC,MAAM;GAAC;GAAa;GAAS;GAAU;EACvC,WAAW,cAAc;EACzB,MAAM;EACN,SAAS;EACV;CACD,QAAQ;EACN,MAAM;EACN,WAAW;EACX,cAAc;EACd,OAAO;EACR;CACD,SAAS,CAAC,QAAQ;CAClB,QAAQ,EACN,OAAO,CAAC,4BAA4B,EACrC;CACF"}
|
|
1
|
+
{"version":3,"file":"query.presentation.js","names":["QueriesListPresentation: PresentationSpec","QueryBuilderPresentation: PresentationSpec"],"sources":["../../src/query/query.presentation.ts"],"sourcesContent":["import type { PresentationSpec } from '@contractspec/lib.contracts';\nimport { StabilityEnum } from '@contractspec/lib.contracts';\nimport { QueryModel } from './query.schema';\n\nexport const QueriesListPresentation: PresentationSpec = {\n meta: {\n key: 'analytics.query.list',\n version: '1.0.0',\n title: 'Queries List',\n description: 'List of saved queries',\n domain: 'analytics',\n owners: ['@analytics-dashboard'],\n tags: ['analytics', 'queries', 'list'],\n stability: StabilityEnum.Experimental,\n goal: 'Browse and manage saved data queries.',\n context: 'The library of reusable data definitions.',\n },\n source: {\n type: 'component',\n framework: 'react',\n componentKey: 'QueriesList',\n props: QueryModel,\n },\n targets: ['react', 'markdown'],\n policy: {\n flags: ['analytics.queries.enabled'],\n },\n};\n\nexport const QueryBuilderPresentation: PresentationSpec = {\n meta: {\n key: 'analytics.query.builder',\n version: '1.0.0',\n title: 'Query Builder',\n description: 'Visual query builder interface',\n domain: 'analytics',\n owners: ['@analytics-dashboard'],\n tags: ['analytics', 'query', 'builder'],\n stability: StabilityEnum.Experimental,\n goal: 'Visually construct data queries and transformations.',\n context: 'Developer tool for data analysis.',\n },\n source: {\n type: 'component',\n framework: 'react',\n componentKey: 'QueryBuilder',\n props: QueryModel,\n },\n targets: ['react'],\n policy: {\n flags: ['analytics.queries.enabled'],\n },\n};\n"],"mappings":";;;;AAIA,MAAaA,0BAA4C;CACvD,MAAM;EACJ,KAAK;EACL,SAAS;EACT,OAAO;EACP,aAAa;EACb,QAAQ;EACR,QAAQ,CAAC,uBAAuB;EAChC,MAAM;GAAC;GAAa;GAAW;GAAO;EACtC,WAAW,cAAc;EACzB,MAAM;EACN,SAAS;EACV;CACD,QAAQ;EACN,MAAM;EACN,WAAW;EACX,cAAc;EACd,OAAO;EACR;CACD,SAAS,CAAC,SAAS,WAAW;CAC9B,QAAQ,EACN,OAAO,CAAC,4BAA4B,EACrC;CACF;AAED,MAAaC,2BAA6C;CACxD,MAAM;EACJ,KAAK;EACL,SAAS;EACT,OAAO;EACP,aAAa;EACb,QAAQ;EACR,QAAQ,CAAC,uBAAuB;EAChC,MAAM;GAAC;GAAa;GAAS;GAAU;EACvC,WAAW,cAAc;EACzB,MAAM;EACN,SAAS;EACV;CACD,QAAQ;EACN,MAAM;EACN,WAAW;EACX,cAAc;EACd,OAAO;EACR;CACD,SAAS,CAAC,QAAQ;CAClB,QAAQ,EACN,OAAO,CAAC,4BAA4B,EACrC;CACF"}
|
|
@@ -1,140 +1,140 @@
|
|
|
1
|
-
import * as
|
|
1
|
+
import * as _contractspec_lib_schema253 from "@contractspec/lib.schema";
|
|
2
2
|
|
|
3
3
|
//#region src/query/query.schema.d.ts
|
|
4
4
|
/**
|
|
5
5
|
* A data query.
|
|
6
6
|
*/
|
|
7
|
-
declare const QueryModel:
|
|
7
|
+
declare const QueryModel: _contractspec_lib_schema253.SchemaModel<{
|
|
8
8
|
id: {
|
|
9
|
-
type:
|
|
9
|
+
type: _contractspec_lib_schema253.FieldType<string, string>;
|
|
10
10
|
isOptional: false;
|
|
11
11
|
};
|
|
12
12
|
name: {
|
|
13
|
-
type:
|
|
13
|
+
type: _contractspec_lib_schema253.FieldType<string, string>;
|
|
14
14
|
isOptional: false;
|
|
15
15
|
};
|
|
16
16
|
description: {
|
|
17
|
-
type:
|
|
17
|
+
type: _contractspec_lib_schema253.FieldType<string, string>;
|
|
18
18
|
isOptional: true;
|
|
19
19
|
};
|
|
20
20
|
type: {
|
|
21
|
-
type:
|
|
21
|
+
type: _contractspec_lib_schema253.EnumType<[string, string, string, string]>;
|
|
22
22
|
isOptional: false;
|
|
23
23
|
};
|
|
24
24
|
definition: {
|
|
25
|
-
type:
|
|
25
|
+
type: _contractspec_lib_schema253.FieldType<unknown, unknown>;
|
|
26
26
|
isOptional: false;
|
|
27
27
|
};
|
|
28
28
|
sql: {
|
|
29
|
-
type:
|
|
29
|
+
type: _contractspec_lib_schema253.FieldType<string, string>;
|
|
30
30
|
isOptional: true;
|
|
31
31
|
};
|
|
32
32
|
cacheTtlSeconds: {
|
|
33
|
-
type:
|
|
33
|
+
type: _contractspec_lib_schema253.FieldType<number, number>;
|
|
34
34
|
isOptional: false;
|
|
35
35
|
};
|
|
36
36
|
isShared: {
|
|
37
|
-
type:
|
|
37
|
+
type: _contractspec_lib_schema253.FieldType<boolean, boolean>;
|
|
38
38
|
isOptional: false;
|
|
39
39
|
};
|
|
40
40
|
createdAt: {
|
|
41
|
-
type:
|
|
41
|
+
type: _contractspec_lib_schema253.FieldType<Date, string>;
|
|
42
42
|
isOptional: false;
|
|
43
43
|
};
|
|
44
44
|
}>;
|
|
45
45
|
/**
|
|
46
46
|
* Query execution result.
|
|
47
47
|
*/
|
|
48
|
-
declare const QueryResultModel:
|
|
48
|
+
declare const QueryResultModel: _contractspec_lib_schema253.SchemaModel<{
|
|
49
49
|
queryId: {
|
|
50
|
-
type:
|
|
50
|
+
type: _contractspec_lib_schema253.FieldType<string, string>;
|
|
51
51
|
isOptional: false;
|
|
52
52
|
};
|
|
53
53
|
data: {
|
|
54
|
-
type:
|
|
54
|
+
type: _contractspec_lib_schema253.FieldType<unknown, unknown>;
|
|
55
55
|
isOptional: false;
|
|
56
56
|
};
|
|
57
57
|
columns: {
|
|
58
|
-
type:
|
|
58
|
+
type: _contractspec_lib_schema253.FieldType<unknown, unknown>;
|
|
59
59
|
isOptional: false;
|
|
60
60
|
};
|
|
61
61
|
rowCount: {
|
|
62
|
-
type:
|
|
62
|
+
type: _contractspec_lib_schema253.FieldType<number, number>;
|
|
63
63
|
isOptional: false;
|
|
64
64
|
};
|
|
65
65
|
executionTimeMs: {
|
|
66
|
-
type:
|
|
66
|
+
type: _contractspec_lib_schema253.FieldType<number, number>;
|
|
67
67
|
isOptional: false;
|
|
68
68
|
};
|
|
69
69
|
cachedAt: {
|
|
70
|
-
type:
|
|
70
|
+
type: _contractspec_lib_schema253.FieldType<Date, string>;
|
|
71
71
|
isOptional: true;
|
|
72
72
|
};
|
|
73
73
|
error: {
|
|
74
|
-
type:
|
|
74
|
+
type: _contractspec_lib_schema253.FieldType<string, string>;
|
|
75
75
|
isOptional: true;
|
|
76
76
|
};
|
|
77
77
|
}>;
|
|
78
78
|
/**
|
|
79
79
|
* Input for creating a query.
|
|
80
80
|
*/
|
|
81
|
-
declare const CreateQueryInputModel:
|
|
81
|
+
declare const CreateQueryInputModel: _contractspec_lib_schema253.SchemaModel<{
|
|
82
82
|
name: {
|
|
83
|
-
type:
|
|
83
|
+
type: _contractspec_lib_schema253.FieldType<string, string>;
|
|
84
84
|
isOptional: false;
|
|
85
85
|
};
|
|
86
86
|
description: {
|
|
87
|
-
type:
|
|
87
|
+
type: _contractspec_lib_schema253.FieldType<string, string>;
|
|
88
88
|
isOptional: true;
|
|
89
89
|
};
|
|
90
90
|
type: {
|
|
91
|
-
type:
|
|
91
|
+
type: _contractspec_lib_schema253.EnumType<[string, string, string, string]>;
|
|
92
92
|
isOptional: false;
|
|
93
93
|
};
|
|
94
94
|
definition: {
|
|
95
|
-
type:
|
|
95
|
+
type: _contractspec_lib_schema253.FieldType<unknown, unknown>;
|
|
96
96
|
isOptional: false;
|
|
97
97
|
};
|
|
98
98
|
sql: {
|
|
99
|
-
type:
|
|
99
|
+
type: _contractspec_lib_schema253.FieldType<string, string>;
|
|
100
100
|
isOptional: true;
|
|
101
101
|
};
|
|
102
102
|
metricIds: {
|
|
103
|
-
type:
|
|
103
|
+
type: _contractspec_lib_schema253.FieldType<string, string>;
|
|
104
104
|
isArray: true;
|
|
105
105
|
isOptional: true;
|
|
106
106
|
};
|
|
107
107
|
cacheTtlSeconds: {
|
|
108
|
-
type:
|
|
108
|
+
type: _contractspec_lib_schema253.FieldType<number, number>;
|
|
109
109
|
isOptional: true;
|
|
110
110
|
};
|
|
111
111
|
isShared: {
|
|
112
|
-
type:
|
|
112
|
+
type: _contractspec_lib_schema253.FieldType<boolean, boolean>;
|
|
113
113
|
isOptional: true;
|
|
114
114
|
};
|
|
115
115
|
}>;
|
|
116
116
|
/**
|
|
117
117
|
* Input for executing a query.
|
|
118
118
|
*/
|
|
119
|
-
declare const ExecuteQueryInputModel:
|
|
119
|
+
declare const ExecuteQueryInputModel: _contractspec_lib_schema253.SchemaModel<{
|
|
120
120
|
queryId: {
|
|
121
|
-
type:
|
|
121
|
+
type: _contractspec_lib_schema253.FieldType<string, string>;
|
|
122
122
|
isOptional: false;
|
|
123
123
|
};
|
|
124
124
|
parameters: {
|
|
125
|
-
type:
|
|
125
|
+
type: _contractspec_lib_schema253.FieldType<unknown, unknown>;
|
|
126
126
|
isOptional: true;
|
|
127
127
|
};
|
|
128
128
|
dateRange: {
|
|
129
|
-
type:
|
|
129
|
+
type: _contractspec_lib_schema253.FieldType<unknown, unknown>;
|
|
130
130
|
isOptional: true;
|
|
131
131
|
};
|
|
132
132
|
filters: {
|
|
133
|
-
type:
|
|
133
|
+
type: _contractspec_lib_schema253.FieldType<unknown, unknown>;
|
|
134
134
|
isOptional: true;
|
|
135
135
|
};
|
|
136
136
|
forceRefresh: {
|
|
137
|
-
type:
|
|
137
|
+
type: _contractspec_lib_schema253.FieldType<boolean, boolean>;
|
|
138
138
|
isOptional: true;
|
|
139
139
|
};
|
|
140
140
|
}>;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@contractspec/example.analytics-dashboard",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.45.0",
|
|
4
4
|
"description": "Analytics Dashboard example with widgets and query engine for ContractSpec",
|
|
5
5
|
"main": "./dist/index.js",
|
|
6
6
|
"types": "./dist/index.d.ts",
|
|
@@ -18,18 +18,18 @@
|
|
|
18
18
|
"lint:check": "eslint src"
|
|
19
19
|
},
|
|
20
20
|
"dependencies": {
|
|
21
|
-
"@contractspec/lib.schema": "1.
|
|
22
|
-
"@contractspec/lib.contracts": "1.
|
|
23
|
-
"@contractspec/lib.bus": "1.
|
|
24
|
-
"@contractspec/lib.identity-rbac": "1.
|
|
25
|
-
"@contractspec/lib.metering": "1.
|
|
26
|
-
"@contractspec/lib.jobs": "1.
|
|
27
|
-
"@contractspec/module.audit-trail": "1.
|
|
21
|
+
"@contractspec/lib.schema": "1.45.0",
|
|
22
|
+
"@contractspec/lib.contracts": "1.45.0",
|
|
23
|
+
"@contractspec/lib.bus": "1.45.0",
|
|
24
|
+
"@contractspec/lib.identity-rbac": "1.45.0",
|
|
25
|
+
"@contractspec/lib.metering": "1.45.0",
|
|
26
|
+
"@contractspec/lib.jobs": "1.45.0",
|
|
27
|
+
"@contractspec/module.audit-trail": "1.45.0",
|
|
28
28
|
"zod": "^4.1.13"
|
|
29
29
|
},
|
|
30
30
|
"devDependencies": {
|
|
31
|
-
"@contractspec/tool.typescript": "1.
|
|
32
|
-
"@contractspec/tool.tsdown": "1.
|
|
31
|
+
"@contractspec/tool.typescript": "1.45.0",
|
|
32
|
+
"@contractspec/tool.tsdown": "1.45.0",
|
|
33
33
|
"typescript": "^5.9.3"
|
|
34
34
|
},
|
|
35
35
|
"exports": {
|