bridgelist 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.
@@ -0,0 +1,299 @@
1
+
2
+ <!DOCTYPE html>
3
+ <html lang="en">
4
+ <head>
5
+ <title>bridgelist</title>
6
+ <style>
7
+ * {
8
+ margin: 0;
9
+ padding: 0;
10
+ box-sizing: border-box;
11
+ }
12
+ h1 {
13
+ margin-bottom: 2rem;
14
+ }
15
+ h3, p {
16
+ margin-bottom: 1rem;
17
+ }
18
+ body {
19
+ font-family: Roboto, Helvetica, sans-serif;
20
+ padding: 2rem;
21
+ }
22
+ .mapping-container {
23
+ width: 100%;
24
+ display: flex;
25
+ flex-direction: column;
26
+ align-items: flex-start;
27
+ border: 1px solid #ddd;
28
+ border-radius: 5px;
29
+ padding: 1rem;
30
+ margin: 1rem 0;
31
+ }
32
+ table {
33
+ border-collapse: collapse;
34
+ width: 100%;
35
+ margin: 1rem 0;
36
+ }
37
+ th, td {
38
+ border: 1px solid #ddd;
39
+ padding: 8px;
40
+ }
41
+ th {
42
+ background-color: #f2f2f2;
43
+ text-align: left;
44
+ }
45
+ .arrow {
46
+ color: #666;
47
+ }
48
+ .hidden {
49
+ display: none;
50
+ }
51
+ .show-hide-mapping {
52
+ cursor: pointer;
53
+ padding: 1rem;
54
+ width: 100%;
55
+ background-color: #7ac29d44;
56
+ display: flex;
57
+ justify-content: flex-start;
58
+ gap: 1rem;
59
+ align-items: center;
60
+ user-select: none;
61
+ }
62
+ .collapse {
63
+ width: 24px;
64
+ height: 24px;
65
+ border: 1px solid #000;
66
+ border-radius: 50%;
67
+ display: flex;
68
+ justify-content: center;
69
+ align-items: center;
70
+ pointer-events: none;
71
+ }
72
+ .rotate {
73
+ transform: rotate(180deg);
74
+ }
75
+ input[type="text"] {
76
+ padding: 0.5rem;
77
+ }
78
+ .header {
79
+ position: fixed;
80
+ top: 0;
81
+ left: 0;
82
+ display: flex;
83
+ justify-content: space-between;
84
+ align-items: center;
85
+ height: 5rem;
86
+ padding: 1rem 2rem;
87
+ background-color: #c2e5da;
88
+ width: 100%;
89
+ z-index: 100;
90
+ }
91
+ .container {
92
+ margin-top: 7rem;
93
+ }
94
+ .constant-value {
95
+ background-color: #f9dcbe44;
96
+ }
97
+ .transformed-value {
98
+ background-color: #dae6e366;
99
+ }
100
+ .styled-text {
101
+ font-size: 1.2rem;
102
+ font-weight: lighter;
103
+ }
104
+ .class-method {
105
+ width: 100%;
106
+ display: flex;
107
+ flex-wrap: wrap;
108
+ justify-content: space-between;
109
+ align-items: center;
110
+ }
111
+ .class-method-col {
112
+ width: 33%;
113
+ display: flex;
114
+ flex-direction: column;
115
+ }
116
+ @media (max-width: 1024px) {
117
+ .last {
118
+ display: none;
119
+ }
120
+ }
121
+ </style>
122
+ </head>
123
+ <body>
124
+ <div class="header">
125
+ <h1 style="margin: 0; flex: 1">bridgelist</h1>
126
+ <input style="flex: 1;" type="text" id="searchInput" name="search" size="30" placeholder="Search for method or class..." />
127
+ <div style="flex: 1"></div>
128
+ </div>
129
+ <div class="container">
130
+
131
+
132
+ <div class="mapping-container">
133
+ <div class="class-method">
134
+ <div class="class-method-col">
135
+ <span class="styled-text">Class:</span><h3>ComplexMapper</h3>
136
+ </div>
137
+ <div class="class-method-col">
138
+ <span class="styled-text"> Method:</span><h3>mapContactToCustomer</h3>
139
+ </div>
140
+ <div class="class-method-col last">
141
+ </div>
142
+ </div>
143
+ <p>Converts CRM contacts to ERP customers</p>
144
+ <div class="show-hide-mapping">
145
+ <div class="collapse">
146
+ <svg width="800px" height="800px" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
147
+ <g id="Arrow / Caret_Down_MD">
148
+ <path id="Vector" d="M16 10L12 14L8 10" stroke="#000000" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/>
149
+ </g>
150
+ </svg>
151
+ </div>
152
+ <span>Mapping from <strong>CRM</strong> to <strong>ERP</strong></span>
153
+ </div>
154
+ <table class="mapping-table hidden">
155
+ <tr>
156
+ <th>CRM Field</th>
157
+ <th></th>
158
+ <th>ERP Field</th>
159
+ <th>Transformation</th>
160
+ </tr>
161
+
162
+ <tr>
163
+ <td>contact.id</td>
164
+ <td class="arrow">&rarr;</td>
165
+ <td>customerId</td>
166
+ <td>Direct mapping</td>
167
+ </tr>
168
+
169
+ <tr>
170
+ <td>contact.firstName, contact.lastName</td>
171
+ <td class="arrow">&rarr;</td>
172
+ <td>fullName</td>
173
+ <td>Transformed</td>
174
+ </tr>
175
+
176
+ <tr>
177
+ <td>contact.address.streetName</td>
178
+ <td class="arrow">&rarr;</td>
179
+ <td>address.street</td>
180
+ <td>Direct mapping</td>
181
+ </tr>
182
+
183
+ <tr>
184
+ <td>contact.address.city</td>
185
+ <td class="arrow">&rarr;</td>
186
+ <td>address.city</td>
187
+ <td>Direct mapping</td>
188
+ </tr>
189
+
190
+ <tr>
191
+ <td>Constant value</td>
192
+ <td class="arrow">&rarr;</td>
193
+ <td>address.country</td>
194
+ <td>defaultCountry</td>
195
+ </tr>
196
+ </table>
197
+ </div>
198
+ </div>
199
+
200
+ <div class="mapping-container">
201
+ <div class="class-method">
202
+ <div class="class-method-col">
203
+ <span class="styled-text">Class:</span><h3>SimpleMapper</h3>
204
+ </div>
205
+ <div class="class-method-col">
206
+ <span class="styled-text"> Method:</span><h3>mapAToB</h3>
207
+ </div>
208
+ <div class="class-method-col last">
209
+ </div>
210
+ </div>
211
+ <p>Simple mapping example</p>
212
+ <div class="show-hide-mapping">
213
+ <div class="collapse">
214
+ <svg width="800px" height="800px" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
215
+ <g id="Arrow / Caret_Down_MD">
216
+ <path id="Vector" d="M16 10L12 14L8 10" stroke="#000000" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/>
217
+ </g>
218
+ </svg>
219
+ </div>
220
+ <span>Mapping from <strong>System A</strong> to <strong>System B</strong></span>
221
+ </div>
222
+ <table class="mapping-table hidden">
223
+ <tr>
224
+ <th>System A Field</th>
225
+ <th></th>
226
+ <th>System B Field</th>
227
+ <th>Transformation</th>
228
+ </tr>
229
+
230
+ <tr>
231
+ <td>sourceObject.id</td>
232
+ <td class="arrow">&rarr;</td>
233
+ <td>objectId</td>
234
+ <td>Direct mapping</td>
235
+ </tr>
236
+
237
+ <tr>
238
+ <td>sourceObject.firstname</td>
239
+ <td class="arrow">&rarr;</td>
240
+ <td>name</td>
241
+ <td>Direct mapping</td>
242
+ </tr>
243
+
244
+ <tr>
245
+ <td>sourceObject.details</td>
246
+ <td class="arrow">&rarr;</td>
247
+ <td>description</td>
248
+ <td>Direct mapping</td>
249
+ </tr>
250
+ </table>
251
+ </div>
252
+ </div>
253
+ <script>
254
+ const collapseButtons = document.querySelectorAll('.show-hide-mapping');
255
+ const mappingTables = document.querySelectorAll('.mapping-table');
256
+ const search = document.getElementById('searchInput');
257
+ const mappingContainers = document.querySelectorAll('.mapping-container');
258
+ const tableRows = document.querySelectorAll('tr');
259
+
260
+ tableRows.forEach(row => {
261
+ const sourceField = row.cells[0].textContent;
262
+ const transformation = row.cells[3].textContent;
263
+ if (sourceField.includes('Constant value')) {
264
+ row.classList.add('constant-value');
265
+ } else if (transformation.includes('Transformed')) {
266
+ row.classList.add('transformed-value');
267
+ } else if (!sourceField.includes('Constant value') && !transformation.includes('Direct mapping')) {
268
+ row.classList.add('transformed-value');
269
+ }
270
+ });
271
+
272
+ search.addEventListener('input', (e) => {
273
+ const searchTerm = e.target.value.toLowerCase();
274
+ mappingContainers.forEach(container => {
275
+ let classMethodName = '';
276
+ const names = container.querySelectorAll('h3');
277
+ names.forEach(name => {
278
+ classMethodName += name.textContent.toLowerCase();
279
+ })
280
+ console.log(classMethodName);
281
+ if (!classMethodName.includes(searchTerm)) {
282
+ container.style.display = 'none';
283
+ } else {
284
+ container.style.display = 'flex';
285
+ }
286
+ });
287
+ });
288
+
289
+ collapseButtons.forEach(button => {
290
+ button.addEventListener('click', function() {
291
+ const table = button.nextElementSibling;
292
+ const caret = button.querySelector('.collapse');
293
+ table.classList.toggle('hidden');
294
+ caret.classList.toggle('rotate');
295
+ });
296
+ });
297
+ </script>
298
+ </body>
299
+ </html>
package/img.png ADDED
Binary file
package/package.json ADDED
@@ -0,0 +1,38 @@
1
+ {
2
+ "name": "bridgelist",
3
+ "version": "1.0.0",
4
+ "description": "A TypeScript-based tool for automatically documenting field mappings between different API systems",
5
+ "main": "dist/index.js",
6
+ "types": "dist/index.d.ts",
7
+ "scripts": {
8
+ "build": "tsc",
9
+ "prepare": "npm run build",
10
+ "start": "npm run build",
11
+ "test": "echo \"Error: no test specified\" && exit 1",
12
+ "compile": "npx tsc",
13
+ "example": "ts-node examples/simple-mapper.ts",
14
+ "debug": "nodemon ./src/index.ts"
15
+ },
16
+ "repository": {
17
+ "type": "git",
18
+ "url": "git+https://github.com/Biga-Software/bridgelist.git"
19
+ },
20
+ "keywords": [
21
+ "typescript",
22
+ "api",
23
+ "mapping",
24
+ "documentation",
25
+ "code-generation"
26
+ ],
27
+ "author": "Biga Software GmbH",
28
+ "license": "MIT",
29
+ "bugs": {
30
+ "url": "https://biga.de/kontakt/"
31
+ },
32
+ "homepage": "https://biga.de",
33
+ "devDependencies": {
34
+ "typescript": "^5.9.2",
35
+ "@types/node": "^24.3.0",
36
+ "ts-node": "^10.9.2"
37
+ }
38
+ }
package/tsconfig.json ADDED
@@ -0,0 +1,24 @@
1
+ {
2
+ "compilerOptions": {
3
+ "lib": ["esnext"],
4
+ "esModuleInterop": true,
5
+ "experimentalDecorators": true,
6
+ "emitDecoratorMetadata": true,
7
+ "outDir": "./dist",
8
+ "module": "commonjs",
9
+ "target": "es6",
10
+ "declaration": true,
11
+ "sourceMap": true,
12
+ "strict": true,
13
+ "types": ["node"],
14
+ "moduleResolution": "node"
15
+ },
16
+ "include": [
17
+ "src/**/*"
18
+ ],
19
+ "exclude": [
20
+ "node_modules",
21
+ "**/*.test.ts",
22
+ "examples/**/*"
23
+ ]
24
+ }