datacontract-cli 0.10.3__py3-none-any.whl → 0.10.5__py3-none-any.whl

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.

Potentially problematic release.


This version of datacontract-cli might be problematic. Click here for more details.

Files changed (41) hide show
  1. datacontract/breaking/breaking.py +12 -0
  2. datacontract/breaking/breaking_rules.py +4 -0
  3. datacontract/catalog/catalog.py +2 -2
  4. datacontract/cli.py +42 -8
  5. datacontract/data_contract.py +84 -134
  6. datacontract/engines/soda/check_soda_execute.py +5 -0
  7. datacontract/engines/soda/connections/duckdb.py +1 -2
  8. datacontract/engines/soda/connections/sqlserver.py +43 -0
  9. datacontract/export/avro_converter.py +23 -2
  10. datacontract/export/bigquery_converter.py +107 -0
  11. datacontract/export/dbml_converter.py +118 -0
  12. datacontract/export/go_converter.py +98 -0
  13. datacontract/export/html_export.py +4 -2
  14. datacontract/export/jsonschema_converter.py +41 -2
  15. datacontract/export/rdf_converter.py +1 -2
  16. datacontract/export/sql_converter.py +1 -0
  17. datacontract/export/sql_type_converter.py +125 -4
  18. datacontract/imports/avro_importer.py +41 -14
  19. datacontract/imports/bigquery_importer.py +178 -0
  20. datacontract/imports/jsonschema_importer.py +148 -0
  21. datacontract/imports/sql_importer.py +2 -2
  22. datacontract/lint/resolve.py +1 -2
  23. datacontract/model/data_contract_specification.py +65 -1
  24. datacontract/publish/publish.py +32 -0
  25. datacontract/py.typed +0 -0
  26. datacontract/templates/datacontract.html +37 -346
  27. datacontract/templates/index.html +70 -5
  28. datacontract/templates/partials/datacontract_information.html +66 -0
  29. datacontract/templates/partials/datacontract_servicelevels.html +253 -0
  30. datacontract/templates/partials/datacontract_terms.html +44 -0
  31. datacontract/templates/partials/definition.html +99 -0
  32. datacontract/templates/partials/example.html +27 -0
  33. datacontract/templates/partials/model_field.html +97 -0
  34. datacontract/templates/partials/server.html +144 -0
  35. datacontract/templates/style/output.css +99 -13
  36. {datacontract_cli-0.10.3.dist-info → datacontract_cli-0.10.5.dist-info}/METADATA +276 -139
  37. {datacontract_cli-0.10.3.dist-info → datacontract_cli-0.10.5.dist-info}/RECORD +41 -26
  38. {datacontract_cli-0.10.3.dist-info → datacontract_cli-0.10.5.dist-info}/LICENSE +0 -0
  39. {datacontract_cli-0.10.3.dist-info → datacontract_cli-0.10.5.dist-info}/WHEEL +0 -0
  40. {datacontract_cli-0.10.3.dist-info → datacontract_cli-0.10.5.dist-info}/entry_points.txt +0 -0
  41. {datacontract_cli-0.10.3.dist-info → datacontract_cli-0.10.5.dist-info}/top_level.txt +0 -0
@@ -0,0 +1,253 @@
1
+ <div class="px-4 sm:px-0">
2
+ <h1 class="text-base font-semibold leading-6 text-gray-900">Service Levels</h1>
3
+ <p class="text-sm text-gray-500">Service levels of the data contract</p>
4
+ </div>
5
+ <div class="mt-2 overflow-hidden shadow sm:rounded-lg bg-white">
6
+ <div class="px-4 py-5 sm:px-6">
7
+ <dl class="grid grid-cols-1 gap-x-4 gap-y-6 divide-y">
8
+ {% if datacontract.servicelevels.availability %}
9
+ <div class="grid sm:grid-cols-2" >
10
+ <h2 class="sm:col-span-2 mt-2 text-base font-semibold leading-6 text-gray-900" id="availability">
11
+ Availability
12
+ </h2>
13
+ {% if datacontract.servicelevels.availability.description %}
14
+ <div class="sm:col-span-1">
15
+ <dt class="text-sm font-medium text-gray-500">Description</dt>
16
+ <dd class="mt-1 text-sm text-gray-900">
17
+ <span class="whitespace-pre-wrap">{{ datacontract.servicelevels.availability.description }}</span>
18
+ </dd>
19
+ </div>
20
+ {% endif %}
21
+ {% if datacontract.servicelevels.availability.percentage %}
22
+ <div class="sm:col-span-1">
23
+ <dt class="text-sm font-medium text-gray-500">Percentage</dt>
24
+ <dd class="mt-1 text-sm text-gray-900">
25
+ <span class="whitespace-pre-wrap">{{ datacontract.servicelevels.availability.percentage }}</span>
26
+ </dd>
27
+ </div>
28
+ {% endif %}
29
+ </div>
30
+ {% endif %}
31
+ {% if datacontract.servicelevels.retention %}
32
+ <div class="grid sm:grid-cols-2" >
33
+ <h2 class="sm:col-span-2 mt-2 text-base font-semibold leading-6 text-gray-900" id="retention">
34
+ Retention
35
+ </h2>
36
+ {% if datacontract.servicelevels.retention.description %}
37
+ <div class="sm:col-span-1">
38
+ <dt class="text-sm font-medium text-gray-500">Description</dt>
39
+ <dd class="mt-1 text-sm text-gray-900">
40
+ <span class="whitespace-pre-wrap">{{ datacontract.servicelevels.retention.description }}</span>
41
+ </dd>
42
+ </div>
43
+ {% endif %}
44
+ {% if datacontract.servicelevels.retention.period %}
45
+ <div class="sm:col-span-1">
46
+ <dt class="text-sm font-medium text-gray-500">Period</dt>
47
+ <dd class="mt-1 text-sm text-gray-900">
48
+ <span class="whitespace-pre-wrap">{{ datacontract.servicelevels.retention.period }}</span>
49
+ </dd>
50
+ </div>
51
+ {% endif %}
52
+ {% if datacontract.servicelevels.retention.unlimited %}
53
+ <div class="sm:col-span-1">
54
+ <dt class="text-sm font-medium text-gray-500">Unlimited</dt>
55
+ <dd class="mt-1 text-sm text-gray-900">
56
+ <span class="whitespace-pre-wrap font-mono">{{ datacontract.servicelevels.retention.unlimited }}</span>
57
+ </dd>
58
+ </div>
59
+ {% endif %}
60
+ </div>
61
+ {% endif %}
62
+ {% if datacontract.servicelevels.latency %}
63
+ <div class="grid sm:grid-cols-2" >
64
+ <h2 class="sm:col-span-2 mt-2 text-base font-semibold leading-6 text-gray-900" id="latency">
65
+ Latency
66
+ </h2>
67
+ {% if datacontract.servicelevels.latency.description %}
68
+ <div class="sm:col-span-1">
69
+ <dt class="text-sm font-medium text-gray-500">Description</dt>
70
+ <dd class="mt-1 text-sm text-gray-900">
71
+ <span class="whitespace-pre-wrap">{{ datacontract.servicelevels.latency.description }}</span>
72
+ </dd>
73
+ </div>
74
+ {% endif %}
75
+ {% if datacontract.servicelevels.latency.threshold %}
76
+ <div class="sm:col-span-1">
77
+ <dt class="text-sm font-medium text-gray-500">Threshold</dt>
78
+ <dd class="mt-1 text-sm text-gray-900">
79
+ <span class="whitespace-pre-wrap">{{ datacontract.servicelevels.latency.threshold }}</span>
80
+ </dd>
81
+ </div>
82
+ {% endif %}
83
+ {% if datacontract.servicelevels.latency.sourceTimestampField %}
84
+ <div class="sm:col-span-1">
85
+ <dt class="text-sm font-medium text-gray-500">Source Timestamp field</dt>
86
+ <dd class="mt-1 text-sm text-gray-900">
87
+ <span class="whitespace-pre-wrap font-mono">{{ datacontract.servicelevels.latency.sourceTimestampField
88
+ }}</span>
89
+ </dd>
90
+ </div>
91
+ {% endif %}
92
+ {% if datacontract.servicelevels.latency.processedTimestampField %}
93
+ <div class="sm:col-span-1">
94
+ <dt class="text-sm font-medium text-gray-500">Processed Timestamp field</dt>
95
+ <dd class="mt-1 text-sm text-gray-900">
96
+ <span class="whitespace-pre-wrap font-mono">{{ datacontract.servicelevels.latency.processedTimestampField
97
+ }}</span>
98
+ </dd>
99
+ </div>
100
+ {% endif %}
101
+ </div>
102
+ {% endif %}
103
+ {% if datacontract.servicelevels.freshness %}
104
+ <div class="grid sm:grid-cols-2" >
105
+ <h2 class="sm:col-span-2 mt-2 text-base font-semibold leading-6 text-gray-900" id="freshness">
106
+ Freshness
107
+ </h2>
108
+ {% if datacontract.servicelevels.freshness.description %}
109
+ <div class="sm:col-span-1">
110
+ <dt class="text-sm font-medium text-gray-500">Description</dt>
111
+ <dd class="mt-1 text-sm text-gray-900">
112
+ <span class="whitespace-pre-wrap">{{ datacontract.servicelevels.freshness.description }}</span>
113
+ </dd>
114
+ </div>
115
+ {% endif %}
116
+ {% if datacontract.servicelevels.freshness.threshold %}
117
+ <div class="sm:col-span-1">
118
+ <dt class="text-sm font-medium text-gray-500">Threshold</dt>
119
+ <dd class="mt-1 text-sm text-gray-900">
120
+ <span class="whitespace-pre-wrap">{{ datacontract.servicelevels.freshness.threshold }}</span>
121
+ </dd>
122
+ </div>
123
+ {% endif %}
124
+ {% if datacontract.servicelevels.freshness.timestampField %}
125
+ <div class="sm:col-span-1">
126
+ <dt class="text-sm font-medium text-gray-500">Timestamp field</dt>
127
+ <dd class="mt-1 text-sm text-gray-900">
128
+ <span class="whitespace-pre-wrap font-mono">{{ datacontract.servicelevels.freshness.timestampField }}</span>
129
+ </dd>
130
+ </div>
131
+ {% endif %}
132
+ </div>
133
+ {% endif %}
134
+ {% if datacontract.servicelevels.frequency %}
135
+ <div class="grid sm:grid-cols-2" >
136
+ <h2 class="sm:col-span-2 mt-2 text-base font-semibold leading-6 text-gray-900" id="frequency">
137
+ Frequency
138
+ </h2>
139
+ {% if datacontract.servicelevels.frequency.description %}
140
+ <div class="sm:col-span-1">
141
+ <dt class="text-sm font-medium text-gray-500">Description</dt>
142
+ <dd class="mt-1 text-sm text-gray-900">
143
+ <span class="whitespace-pre-wrap">{{ datacontract.servicelevels.frequency.description }}</span>
144
+ </dd>
145
+ </div>
146
+ {% endif %}
147
+ {% if datacontract.servicelevels.frequency.type %}
148
+ <div class="sm:col-span-1">
149
+ <dt class="text-sm font-medium text-gray-500">Type</dt>
150
+ <dd class="mt-1 text-sm text-gray-900">
151
+ <span class="whitespace-pre-wrap">{{ datacontract.servicelevels.frequency.type }}</span>
152
+ </dd>
153
+ </div>
154
+ {% endif %}
155
+ {% if datacontract.servicelevels.frequency.interval %}
156
+ <div class="sm:col-span-1">
157
+ <dt class="text-sm font-medium text-gray-500">Interval</dt>
158
+ <dd class="mt-1 text-sm text-gray-900">
159
+ <span class="whitespace-pre-wrap">{{ datacontract.servicelevels.frequency.interval }}</span>
160
+ </dd>
161
+ </div>
162
+ {% endif %}
163
+ {% if datacontract.servicelevels.frequency.cron %}
164
+ <div class="sm:col-span-1">
165
+ <dt class="text-sm font-medium text-gray-500">Cron</dt>
166
+ <dd class="mt-1 text-sm text-gray-900">
167
+ <span class="whitespace-pre-wrap font-mono">{{ datacontract.servicelevels.frequency.cron }}</span>
168
+ </dd>
169
+ </div>
170
+ {% endif %}
171
+ </div>
172
+ {% endif %}
173
+ {% if datacontract.servicelevels.support %}
174
+ <div class="grid sm:grid-cols-2" >
175
+ <h2 class="sm:col-span-2 mt-2 text-base font-semibold leading-6 text-gray-900" id="support">
176
+ Support
177
+ </h2>
178
+ {% if datacontract.servicelevels.support.description %}
179
+ <div class="sm:col-span-1">
180
+ <dt class="text-sm font-medium text-gray-500">Description</dt>
181
+ <dd class="mt-1 text-sm text-gray-900">
182
+ <span class="whitespace-pre-wrap">{{ datacontract.servicelevels.support.description }}</span>
183
+ </dd>
184
+ </div>
185
+ {% endif %}
186
+ {% if datacontract.servicelevels.support.time %}
187
+ <div class="sm:col-span-1">
188
+ <dt class="text-sm font-medium text-gray-500">Time</dt>
189
+ <dd class="mt-1 text-sm text-gray-900">
190
+ <span class="whitespace-pre-wrap">{{ datacontract.servicelevels.support.time }}</span>
191
+ </dd>
192
+ </div>
193
+ {% endif %}
194
+ {% if datacontract.servicelevels.support.responseTime %}
195
+ <div class="sm:col-span-1">
196
+ <dt class="text-sm font-medium text-gray-500">Response Time</dt>
197
+ <dd class="mt-1 text-sm text-gray-900">
198
+ <span class="whitespace-pre-wrap">{{ datacontract.servicelevels.support.responseTime }}</span>
199
+ </dd>
200
+ </div>
201
+ {% endif %}
202
+ </div>
203
+ {% endif %}
204
+ {% if datacontract.servicelevels.backup %}
205
+ <div class="grid sm:grid-cols-2" >
206
+ <h2 class="sm:col-span-2 mt-2 text-base font-semibold leading-6 text-gray-900" id="backup">
207
+ Backup
208
+ </h2>
209
+ {% if datacontract.servicelevels.backup.description %}
210
+ <div class="sm:col-span-1">
211
+ <dt class="text-sm font-medium text-gray-500">Description</dt>
212
+ <dd class="mt-1 text-sm text-gray-900">
213
+ <span class="whitespace-pre-wrap">{{ datacontract.servicelevels.backup.description }}</span>
214
+ </dd>
215
+ </div>
216
+ {% endif %}
217
+ {% if datacontract.servicelevels.backup.internal %}
218
+ <div class="sm:col-span-1">
219
+ <dt class="text-sm font-medium text-gray-500">Interval</dt>
220
+ <dd class="mt-1 text-sm text-gray-900">
221
+ <span class="whitespace-pre-wrap">{{ datacontract.servicelevels.backup.interval }}</span>
222
+ </dd>
223
+ </div>
224
+ {% endif %}
225
+ {% if datacontract.servicelevels.backup.cron %}
226
+ <div class="sm:col-span-1">
227
+ <dt class="text-sm font-medium text-gray-500">Cron</dt>
228
+ <dd class="mt-1 text-sm text-gray-900">
229
+ <span class="whitespace-pre-wrap font-mono">{{ datacontract.servicelevels.backup.cron }}</span>
230
+ </dd>
231
+ </div>
232
+ {% endif %}
233
+ {% if datacontract.servicelevels.backup.recoveryTime %}
234
+ <div class="sm:col-span-1">
235
+ <dt class="text-sm font-medium text-gray-500">Recovery Time</dt>
236
+ <dd class="mt-1 text-sm text-gray-900">
237
+ <span class="whitespace-pre-wrap">{{ datacontract.servicelevels.backup.recoveryTime }}</span>
238
+ </dd>
239
+ </div>
240
+ {% endif %}
241
+ {% if datacontract.servicelevels.backup.recoveryPoint %}
242
+ <div class="sm:col-span-1">
243
+ <dt class="text-sm font-medium text-gray-500">Recovery Point</dt>
244
+ <dd class="mt-1 text-sm text-gray-900">
245
+ <span class="whitespace-pre-wrap">{{ datacontract.servicelevels.backup.recoveryPoint }}</span>
246
+ </dd>
247
+ </div>
248
+ {% endif %}
249
+ </div>
250
+ {% endif %}
251
+ </dl>
252
+ </div>
253
+ </div>
@@ -0,0 +1,44 @@
1
+ <div class="px-4 sm:px-0">
2
+ <h1 class="text-base font-semibold leading-6 text-gray-900" id="terms">Terms</h1>
3
+ <p class="text-sm text-gray-500">Terms and conditions of the data contract</p>
4
+ </div>
5
+ <div class="mt-2 overflow-hidden shadow sm:rounded-lg bg-white">
6
+
7
+ <div class="px-4 py-5 sm:px-6">
8
+
9
+ <dl class="grid grid-cols-1 gap-x-4 gap-y-6 sm:grid-cols-2">
10
+ <div class="sm:col-span-1">
11
+ <dt class="text-sm font-medium text-gray-500">Usage</dt>
12
+ <dd class="mt-1 text-sm text-gray-900" >
13
+ <span class="whitespace-pre-wrap">{{ datacontract.terms.usage }}</span>
14
+ </dd>
15
+ </div>
16
+
17
+ <div class="sm:col-span-1">
18
+ <dt class="text-sm font-medium text-gray-500">Limitations</dt>
19
+ <dd class="mt-1 text-sm text-gray-900" >
20
+ <span class="whitespace-pre-wrap">{{ datacontract.terms.limitations }}</span>
21
+ </dd>
22
+ </div>
23
+
24
+ {% if datacontract.terms.billing %}
25
+ <div class="sm:col-span-1">
26
+ <dt class="text-sm font-medium text-gray-500">Billing</dt>
27
+ <dd class="mt-1 text-sm text-gray-900" >
28
+ <span class="whitespace-pre-wrap">{{ datacontract.terms.billing }}</span>
29
+ </dd>
30
+ </div>
31
+ {% endif %}
32
+
33
+ {% if datacontract.terms.noticePeriod %}
34
+ <div class="sm:col-span-1">
35
+ <dt class="text-sm font-medium text-gray-500">Notice Period</dt>
36
+ <dd class="mt-1 text-sm text-gray-900 flex" >
37
+ <span class="whitespace-pre-wrap">{{ datacontract.terms.noticePeriod }}</span>
38
+ </dd>
39
+ </div>
40
+ {% endif %}
41
+
42
+ </dl>
43
+ </div>
44
+ </div>
@@ -0,0 +1,99 @@
1
+ <div class="mt-3 flow-root">
2
+ <div class="-mx-4 -my-2 overflow-x-auto sm:-mx-6 lg:-mx-8">
3
+ <div class="inline-block min-w-full py-2 align-middle sm:px-6 lg:px-8">
4
+ <div class="overflow-hidden shadow ring-1 ring-black ring-opacity-5 sm:rounded-lg">
5
+
6
+ <table class="min-w-full divide-y divide-gray-300">
7
+ <thead class="bg-gray-50">
8
+ <tr>
9
+ <th scope="colgroup" colspan="3" class="py-2 pl-4 pr-3 text-left font-semibold text-gray-900 sm:pl-6">
10
+ <span>{{ definition_name }}</span>
11
+ <span class="inline-flex items-center rounded-md bg-gray-50 px-2 py-1 text-xs font-medium text-gray-600 ring-1 ring-inset ring-gray-500/10">{{ definition.domain }}</span>
12
+ <div class="text-sm font-medium text-gray-500">{{ definition.description }}</div>
13
+ </th>
14
+ </tr>
15
+ </thead>
16
+ <tbody class="divide-y divide-gray-200 bg-white">
17
+ <tr>
18
+ <td class="whitespace-nowrap py-2 pl-4 pr-2 text-sm font-medium text-gray-900 sm:pl-6 w-2/12">
19
+ <div class="py-2 text-sm">
20
+ {% if definition.title %}
21
+ <div>{{ definition.title }}</div>
22
+ {% endif %}
23
+ <div class="font-mono">{{ definition.name }}</div>
24
+ </div>
25
+ </td>
26
+ <td class="whitespace-nowrap px-1 py-2 text-sm text-gray-500 w-1/12">
27
+ <div class="py-2 text-sm">
28
+ {{ definition.type }}
29
+ {% if definition.format %}
30
+ <span class="inline-flex items-center rounded-md bg-blue-50 px-1 py-1 text-xs font-medium text-blue-600 ring-1 ring-inset ring-blue-500/10 mr-1 mt-1">{{ definition.format }}</span>
31
+ {% endif %}
32
+ </div>
33
+ </td>
34
+ <td class="px-3 py-2 text-sm text-gray-500 w-9/12">
35
+ {% if definition.example %}
36
+ <div class="mt-1">
37
+ <span class="text-gray-600 font-medium">Example:</span> <span class="font-mono">{{ definition.example }}</span>
38
+ </div>
39
+ {% endif %}
40
+ {% if definition.tags %}
41
+ <div>
42
+ <span class="text-gray-600 font-medium">Tags:</span>
43
+ {% for tag in definition.tags %}
44
+ <span class="inline-flex items-center rounded-md bg-gray-50 px-1 py-1 text-xs font-medium text-gray-600 ring-1 ring-inset ring-gray-500/10 mr-1 mt-1">{{ tag }}</span>
45
+ {% endfor %}
46
+ </div>
47
+ {% endif %}
48
+ {% if definition.enum %}
49
+ <div class="py-2 text-sm">
50
+ <span class="text-gray-600 font-medium">Enum:</span>
51
+ {% for value in definition.enum %}
52
+ <span class="inline-flex items-center rounded-md bg-gray-50 px-1 py-1 text-xs font-medium text-gray-600 ring-1 ring-inset ring-gray-500/10 mr-1 mt-1">{{ value }}</span>
53
+ {% endfor %}
54
+ </div>
55
+ {% endif %}
56
+ <div>
57
+ {% if definition.minLength %}
58
+ <span class="inline-flex items-center rounded-md bg-gray-50 px-1 py-1 text-xs font-medium text-gray-600 ring-1 ring-inset ring-gray-500/10 mr-1 mt-1">minLength:{{ definition.minLength }}</span>
59
+ {% endif %}
60
+ {% if definition.maxLength %}
61
+ <span class="inline-flex items-center rounded-md bg-gray-50 px-1 py-1 text-xs font-medium text-gray-600 ring-1 ring-inset ring-gray-500/10 mr-1 mt-1">maxLength:{{ definition.maxLength }}</span>
62
+ {% endif %}
63
+ {% if definition.pattern %}
64
+ <span class="inline-flex items-center rounded-md bg-gray-50 px-1 py-1 text-xs font-medium text-gray-600 ring-1 ring-inset ring-gray-500/10 mr-1 mt-1">pattern:{{ definition.pattern }}</span>
65
+ {% endif %}
66
+ {% if definition.precision %}
67
+ <span class="inline-flex items-center rounded-md bg-gray-50 px-1 py-1 text-xs font-medium text-gray-600 ring-1 ring-inset ring-gray-500/10 mr-1 mt-1">precision:{{ definition.precision }}</span>
68
+ {% endif %}
69
+ {% if definition.scale %}
70
+ <span class="inline-flex items-center rounded-md bg-gray-50 px-1 py-1 text-xs font-medium text-gray-600 ring-1 ring-inset ring-gray-500/10 mr-1 mt-1">scale:{{ definition.scale }}</span>
71
+ {% endif %}
72
+ {% if definition.minimum %}
73
+ <span class="inline-flex items-center rounded-md bg-gray-50 px-1 py-1 text-xs font-medium text-gray-600 ring-1 ring-inset ring-gray-500/10 mr-1 mt-1">minimum:{{ definition.minimum }}</span>
74
+ {% endif %}
75
+ {% if definition.exclusiveMinimum %}
76
+ <span class="inline-flex items-center rounded-md bg-gray-50 px-1 py-1 text-xs font-medium text-gray-600 ring-1 ring-inset ring-gray-500/10 mr-1 mt-1">exclusiveMinimum:{{ definition.exclusiveMinimum }}</span>
77
+ {% endif %}
78
+ {% if definition.maximum %}
79
+ <span class="inline-flex items-center rounded-md bg-gray-50 px-1 py-1 text-xs font-medium text-gray-600 ring-1 ring-inset ring-gray-500/10 mr-1 mt-1">maximum:{{ definition.maximum }}</span>
80
+ {% endif %}
81
+ {% if definition.exclusiveMaximum %}
82
+ <span class="inline-flex items-center rounded-md bg-gray-50 px-1 py-1 text-xs font-medium text-gray-600 ring-1 ring-inset ring-gray-500/10 mr-1 mt-1">exclusiveMaximum:{{ definition.exclusiveMaximum }}</span>
83
+ {% endif %}
84
+ {% if definition.classification %}
85
+ <span class="inline-flex items-center rounded-md bg-blue-50 px-1 py-1 text-xs font-medium text-blue-600 ring-1 ring-inset ring-blue-500/10 mr-1 mt-1">{{ definition.classification }}</span>
86
+ {% endif %}
87
+ {% if definition.pii %}
88
+ <span class="inline-flex items-center rounded-md bg-yellow-50 px-1 py-1 text-xs font-medium text-yellow-600 ring-1 ring-inset ring-yellow-500/10 mr-1 mt-1">PII</span>
89
+ {% endif %}
90
+ </div>
91
+ </td>
92
+
93
+ </tr>
94
+ </tbody>
95
+ </table>
96
+ </div>
97
+ </div>
98
+ </div>
99
+ </div>
@@ -0,0 +1,27 @@
1
+ <div class="mt-3 flow-root">
2
+ <div class="-mx-4 -my-2 overflow-x-auto sm:-mx-6 lg:-mx-8">
3
+ <div class="inline-block min-w-full py-2 align-middle sm:px-6 lg:px-8">
4
+ <div class="overflow-hidden shadow ring-1 ring-black ring-opacity-5 sm:rounded-lg">
5
+
6
+ <table class="min-w-full divide-y divide-gray-300">
7
+ <thead class="bg-gray-50">
8
+ <tr>
9
+ <th scope="colgroup" colspan="3" class="py-2 pl-4 pr-3 text-left font-semibold text-gray-900 sm:pl-6">
10
+ <span>{{ example.model }}</span>
11
+ <span class="inline-flex items-center rounded-md bg-gray-50 px-2 py-1 text-xs font-medium text-gray-600 ring-1 ring-inset ring-gray-500/10">{{ example.type }}</span>
12
+ <div class="text-sm font-medium text-gray-500">{{ example.description }}</div>
13
+ </th>
14
+ </tr>
15
+ </thead>
16
+ <tbody class="divide-y divide-gray-200 bg-white">
17
+ <tr>
18
+ <td class="whitespace-nowrap py-2 pl-4 pr-2 text-sm font-medium text-gray-900 sm:pl-6 w-12/12">
19
+ <pre>{{ example.data }}</pre>
20
+ </td>
21
+ </tr>
22
+ </tbody>
23
+ </table>
24
+ </div>
25
+ </div>
26
+ </div>
27
+ </div>
@@ -0,0 +1,97 @@
1
+ {% if nested %}
2
+ <tr class="bg-gray-50">
3
+ <td class="whitespace-nowrap py-2 pl-4 pr-2 text-sm font-medium text-gray-900 sm:pl-6 w-2/12 flex items-center gap-x-4">
4
+ {# poor mans approach to indenting things a bit #}
5
+ {% for i in range(0,level)%}
6
+ <div class="w-2">&nbsp;</div>
7
+ {% endfor %}
8
+ <div>
9
+ &#x21b3;
10
+ </div>
11
+ {% else %}
12
+ <tr>
13
+ <td class="whitespace-nowrap py-2 pl-4 pr-2 text-sm font-medium text-gray-900 sm:pl-6 w-2/12">
14
+ {% endif %}
15
+ <div class="py-2 text-sm">
16
+ {% if field.title %}
17
+ <div>{{ field.title }}</div>
18
+ {% endif %}
19
+ <div class="font-mono">{{ field_name }}</div>
20
+ </div>
21
+ </td>
22
+ <td class="whitespace-nowrap px-1 py-2 text-sm text-gray-500 w-1/12">
23
+ {% if field.type %}
24
+ {{ field.type }}
25
+ {% endif %}
26
+ </td>
27
+ <td class="px-3 py-2 text-sm text-gray-500 w-7/12">
28
+ {% if field.description %}
29
+ <div class="text-gray-500">{{ field.description }}</div>
30
+ {% else %}
31
+ <div class="text-gray-400">No description</div>
32
+ {% endif %}
33
+
34
+ {% if field.example %}
35
+ <div class="mt-1 italic">
36
+ Example: <span class="font-mono">{{ field.example }}</span>
37
+ </div>
38
+ {% endif %}
39
+
40
+ <div>
41
+ {% if field.primary %}
42
+ <span class="inline-flex items-center rounded-md bg-gray-50 px-1 py-1 text-xs font-medium text-gray-600 ring-1 ring-inset ring-gray-500/10 mr-1 mt-1">primary</span>
43
+ {% endif %}
44
+ {% if field.required %}
45
+ <span class="inline-flex items-center rounded-md bg-gray-50 px-1 py-1 text-xs font-medium text-gray-600 ring-1 ring-inset ring-gray-500/10 mr-1 mt-1">required</span>
46
+ {% endif %}
47
+ {% if field.unique %}
48
+ <span class="inline-flex items-center rounded-md bg-gray-50 px-1 py-1 text-xs font-medium text-gray-600 ring-1 ring-inset ring-gray-500/10 mr-1 mt-1">unique</span>
49
+ {% endif %}
50
+ {% if field.format %}
51
+ <span class="inline-flex items-center rounded-md bg-gray-50 px-1 py-1 text-xs font-medium text-gray-600 ring-1 ring-inset ring-gray-500/10 mr-1 mt-1">format:{{ field.format }}</span>
52
+ {% endif %}
53
+ {% if field.minLength %}
54
+ <span class="inline-flex items-center rounded-md bg-gray-50 px-1 py-1 text-xs font-medium text-gray-600 ring-1 ring-inset ring-gray-500/10 mr-1 mt-1">minLength:{{ field.minLength }}</span>
55
+ {% endif %}
56
+ {% if field.maxLength %}
57
+ <span class="inline-flex items-center rounded-md bg-gray-50 px-1 py-1 text-xs font-medium text-gray-600 ring-1 ring-inset ring-gray-500/10 mr-1 mt-1">maxLength:{{ field.maxLength }}</span>
58
+ {% endif %}
59
+ {% if field.pattern %}
60
+ <span class="inline-flex items-center rounded-md bg-gray-50 px-1 py-1 text-xs font-medium text-gray-600 ring-1 ring-inset ring-gray-500/10 mr-1 mt-1">pattern:{{ field.pattern }}</span>
61
+ {% endif %}
62
+ {% if field.precision %}
63
+ <span class="inline-flex items-center rounded-md bg-gray-50 px-1 py-1 text-xs font-medium text-gray-600 ring-1 ring-inset ring-gray-500/10 mr-1 mt-1">precision:{{ field.precision }}</span>
64
+ {% endif %}
65
+ {% if field.scale %}
66
+ <span class="inline-flex items-center rounded-md bg-gray-50 px-1 py-1 text-xs font-medium text-gray-600 ring-1 ring-inset ring-gray-500/10 mr-1 mt-1">scale:{{ field.scale }}</span>
67
+ {% endif %}
68
+ {% if field.minimum %}
69
+ <span class="inline-flex items-center rounded-md bg-gray-50 px-1 py-1 text-xs font-medium text-gray-600 ring-1 ring-inset ring-gray-500/10 mr-1 mt-1">minimum:{{ field.minimum }}</span>
70
+ {% endif %}
71
+ {% if field.exclusiveMinimum %}
72
+ <span class="inline-flex items-center rounded-md bg-gray-50 px-1 py-1 text-xs font-medium text-gray-600 ring-1 ring-inset ring-gray-500/10 mr-1 mt-1">exclusiveMinimum:{{ field.exclusiveMinimum }}</span>
73
+ {% endif %}
74
+ {% if field.maximum %}
75
+ <span class="inline-flex items-center rounded-md bg-gray-50 px-1 py-1 text-xs font-medium text-gray-600 ring-1 ring-inset ring-gray-500/10 mr-1 mt-1">maximum:{{ field.maximum }}</span>
76
+ {% endif %}
77
+ {% if field.exclusiveMaximum %}
78
+ <span class="inline-flex items-center rounded-md bg-gray-50 px-1 py-1 text-xs font-medium text-gray-600 ring-1 ring-inset ring-gray-500/10 mr-1 mt-1">exclusiveMaximum:{{ field.exclusiveMaximum }}</span>
79
+ {% endif %}
80
+ {% if field.classification %}
81
+ <span class="inline-flex items-center rounded-md bg-blue-50 px-1 py-1 text-xs font-medium text-blue-600 ring-1 ring-inset ring-blue-500/10 mr-1 mt-1">{{ field.classification }}</span>
82
+ {% endif %}
83
+ {% if field.pii %}
84
+ <span class="inline-flex items-center rounded-md bg-yellow-50 px-1 py-1 text-xs font-medium text-yellow-600 ring-1 ring-inset ring-yellow-500/10 mr-1 mt-1">PII</span>
85
+ {% endif %}
86
+ </div>
87
+ </td>
88
+ </tr>
89
+
90
+ {% if field.fields %}
91
+ {% for field_name, field in field.fields.items() %}
92
+ {{ render_partial('partials/model_field.html', nested = True, field_name=field_name, field = field, level = level + 1) }}
93
+ {% endfor %}
94
+ <!-- Mark the end of the contained fields -->
95
+ <tr style="--tw-divide-y-reverse: 2">
96
+ </tr>
97
+ {% endif %}
@@ -0,0 +1,144 @@
1
+ <li class="relative flex gap-x-6 px-4 py-5 sm:px-6">
2
+ <div class="flex items-center gap-x-4">
3
+ <div class="hidden sm:flex sm:flex-col">
4
+ <dt class="text-sm font-medium text-gray-500">Server</dt>
5
+ <dd class="mt-1 text-sm text-gray-900">{{server_name}}</dd>
6
+ </div>
7
+ </div>
8
+
9
+ {% if server.type %}
10
+ <div class="flex items-center gap-x-4">
11
+ <div class="hidden sm:flex sm:flex-col">
12
+ <dt class="text-sm font-medium text-gray-500">Type</dt>
13
+ <dd class="mt-1 text-sm text-gray-900">{{server.type}}</dd>
14
+ </div>
15
+ </div>
16
+ {% endif %}
17
+
18
+ {% if server.project %}
19
+ <div class="flex items-center gap-x-4">
20
+ <div class="hidden sm:flex sm:flex-col">
21
+ <dt class="text-sm font-medium text-gray-500">Project</dt>
22
+ <dd class="mt-1 text-sm text-gray-900">{{server.project}}</dd>
23
+ </div>
24
+ </div>
25
+ {% endif %}
26
+
27
+ {% if server.dataset %}
28
+ <div class="flex items-center gap-x-4">
29
+ <div class="hidden sm:flex sm:flex-col">
30
+ <dt class="text-sm font-medium text-gray-500">Dataset</dt>
31
+ <dd class="mt-1 text-sm text-gray-900">{{server.dataset}}</dd>
32
+ </div>
33
+ </div>
34
+ {% endif %}
35
+
36
+ {% if server.location %}
37
+ <div class="flex items-center gap-x-4">
38
+ <div class="hidden sm:flex sm:flex-col">
39
+ <dt class="text-sm font-medium text-gray-500">Location</dt>
40
+ <dd class="mt-1 text-sm text-gray-900">{{server.location}}</dd>
41
+ </div>
42
+ </div>
43
+ {% endif %}
44
+
45
+ {% if server.endpointUrl %}
46
+ <div class="flex items-center gap-x-4">
47
+ <div class="hidden sm:flex sm:flex-col">
48
+ <dt class="text-sm font-medium text-gray-500">Endpoint URL</dt>
49
+ <dd class="mt-1 text-sm text-gray-900">{{server.endpointUrl}}</dd>
50
+ </div>
51
+ </div>
52
+ {% endif %}
53
+
54
+ {% if server.account %}
55
+ <div class="flex items-center gap-x-4">
56
+ <div class="hidden sm:flex sm:flex-col">
57
+ <dt class="text-sm font-medium text-gray-500">Account</dt>
58
+ <dd class="mt-1 text-sm text-gray-900">{{server.account}}</dd>
59
+ </div>
60
+ </div>
61
+ {% endif %}
62
+
63
+ {% if server.host %}
64
+ <div class="flex items-center gap-x-4">
65
+ <div class="hidden sm:flex sm:flex-col">
66
+ <dt class="text-sm font-medium text-gray-500">Host</dt>
67
+ <dd class="mt-1 text-sm text-gray-900">{{server.host}}</dd>
68
+ </div>
69
+ </div>
70
+ {% endif %}
71
+
72
+ {% if server.port %}
73
+ <div class="flex items-center gap-x-4">
74
+ <div class="hidden sm:flex sm:flex-col">
75
+ <dt class="text-sm font-medium text-gray-500">Port</dt>
76
+ <dd class="mt-1 text-sm text-gray-900">{{server.port}}</dd>
77
+ </div>
78
+ </div>
79
+ {% endif %}
80
+
81
+ {% if server.catalog %}
82
+ <div class="flex items-center gap-x-4">
83
+ <div class="hidden sm:flex sm:flex-col">
84
+ <dt class="text-sm font-medium text-gray-500">Catalog</dt>
85
+ <dd class="mt-1 text-sm text-gray-900">{{server.catalog}}</dd>
86
+ </div>
87
+ </div>
88
+ {% endif %}
89
+
90
+ {% if server.database %}
91
+ <div class="flex items-center gap-x-4">
92
+ <div class="hidden sm:flex sm:flex-col">
93
+ <dt class="text-sm font-medium text-gray-500">Database</dt>
94
+ <dd class="mt-1 text-sm text-gray-900">{{server.database}}</dd>
95
+ </div>
96
+ </div>
97
+ {% endif %}
98
+
99
+ {% if server.schema_ %}
100
+ <div class="flex items-center gap-x-4">
101
+ <div class="hidden sm:flex sm:flex-col">
102
+ <dt class="text-sm font-medium text-gray-500">Schema</dt>
103
+ <dd class="mt-1 text-sm text-gray-900">{{server.schema_}}</dd>
104
+ </div>
105
+ </div>
106
+ {% endif %}
107
+
108
+ {% if server.topic %}
109
+ <div class="flex items-center gap-x-4">
110
+ <div class="hidden sm:flex sm:flex-col">
111
+ <dt class="text-sm font-medium text-gray-500">Topic</dt>
112
+ <dd class="mt-1 text-sm text-gray-900">{{server.topic}}</dd>
113
+ </div>
114
+ </div>
115
+ {% endif %}
116
+
117
+ {% if server.path %}
118
+ <div class="flex items-center gap-x-4">
119
+ <div class="hidden sm:flex sm:flex-col">
120
+ <dt class="text-sm font-medium text-gray-500">Path</dt>
121
+ <dd class="mt-1 text-sm text-gray-900">{{server.path}}</dd>
122
+ </div>
123
+ </div>
124
+ {% endif %}
125
+
126
+ {% if server.format %}
127
+ <div class="flex items-center gap-x-4">
128
+ <div class="hidden sm:flex sm:flex-col">
129
+ <dt class="text-sm font-medium text-gray-500">Format</dt>
130
+ <dd class="mt-1 text-sm text-gray-900">{{server.format}}</dd>
131
+ </div>
132
+ </div>
133
+ {% endif %}
134
+
135
+ {% if server.delimiter %}
136
+ <div class="flex items-center gap-x-4">
137
+ <div class="hidden sm:flex sm:flex-col">
138
+ <dt class="text-sm font-medium text-gray-500">Delimiter</dt>
139
+ <dd class="mt-1 text-sm text-gray-900">{{server.delimiter}}</dd>
140
+ </div>
141
+ </div>
142
+ {% endif %}
143
+
144
+ </li>