@promptpartner/bexio-mcp-server 2.0.0 → 2.0.2
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/LICENSE +21 -21
- package/README.md +165 -161
- package/dist/tools/payroll/handlers.js +13 -13
- package/dist/ui/ui/contact-card/contact-card.html +187 -0
- package/dist/ui/ui/dashboard/dashboard.html +186 -0
- package/dist/ui/ui/invoice-preview/invoice-preview.html +196 -0
- package/dist/ui-resources.js +2 -2
- package/dist/vite.config.js +1 -1
- package/package.json +78 -78
- package/dist/ui/contact-card/mcp-app.d.ts +0 -1
- package/dist/ui/contact-card/mcp-app.js +0 -108
- package/dist/ui/dashboard/mcp-app.d.ts +0 -1
- package/dist/ui/dashboard/mcp-app.js +0 -81
- package/dist/ui/invoice-preview/mcp-app.d.ts +0 -1
- package/dist/ui/invoice-preview/mcp-app.js +0 -96
package/LICENSE
CHANGED
|
@@ -1,21 +1,21 @@
|
|
|
1
|
-
MIT License
|
|
2
|
-
|
|
3
|
-
Copyright (c) 2024 Bexio MCP Contributors
|
|
4
|
-
|
|
5
|
-
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
-
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
-
in the Software without restriction, including without limitation the rights
|
|
8
|
-
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
-
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
-
furnished to do so, subject to the following conditions:
|
|
11
|
-
|
|
12
|
-
The above copyright notice and this permission notice shall be included in all
|
|
13
|
-
copies or substantial portions of the Software.
|
|
14
|
-
|
|
15
|
-
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
-
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
-
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
-
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
-
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
-
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
-
SOFTWARE.
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2024 Bexio MCP Contributors
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
CHANGED
|
@@ -1,161 +1,165 @@
|
|
|
1
|
-
# @promptpartner/bexio-mcp-server
|
|
2
|
-
|
|
3
|
-
Complete Swiss accounting integration for [Bexio](https://www.bexio.com/) with [Claude Desktop](https://claude.com/desktop). Manage invoices, contacts, projects, time tracking, and 200+ more tools through natural conversation.
|
|
4
|
-
|
|
5
|
-
## Quick Start
|
|
6
|
-
|
|
7
|
-
### Option 1: MCPB Bundle (Recommended)
|
|
8
|
-
|
|
9
|
-
1. Download `bexio-mcp-server.mcpb` from [Releases](https://github.com/promptpartner/bexio-mcp-server/releases)
|
|
10
|
-
2. Double-click to install in Claude Desktop
|
|
11
|
-
3. Enter your Bexio API token when prompted
|
|
12
|
-
|
|
13
|
-
### Option 2: npm
|
|
14
|
-
|
|
15
|
-
```bash
|
|
16
|
-
npx @promptpartner/bexio-mcp-server
|
|
17
|
-
```
|
|
18
|
-
|
|
19
|
-
Add to Claude Desktop config:
|
|
20
|
-
|
|
21
|
-
**macOS:** `~/Library/Application Support/Claude/claude_desktop_config.json`
|
|
22
|
-
**Windows:** `%APPDATA%\Claude\claude_desktop_config.json`
|
|
23
|
-
|
|
24
|
-
```json
|
|
25
|
-
{
|
|
26
|
-
"mcpServers": {
|
|
27
|
-
"bexio": {
|
|
28
|
-
"command": "npx",
|
|
29
|
-
"args": ["@promptpartner/bexio-mcp-server"],
|
|
30
|
-
"env": {
|
|
31
|
-
"BEXIO_API_TOKEN": "your-token-here"
|
|
32
|
-
}
|
|
33
|
-
}
|
|
34
|
-
}
|
|
35
|
-
}
|
|
36
|
-
```
|
|
37
|
-
|
|
38
|
-
### Option 3: From Source
|
|
39
|
-
|
|
40
|
-
```bash
|
|
41
|
-
git clone https://github.com/promptpartner/bexio-mcp-server
|
|
42
|
-
cd bexio-mcp-server/src
|
|
43
|
-
npm install
|
|
44
|
-
npm run build
|
|
45
|
-
```
|
|
46
|
-
|
|
47
|
-
Add to Claude Desktop config:
|
|
48
|
-
|
|
49
|
-
```json
|
|
50
|
-
{
|
|
51
|
-
"mcpServers": {
|
|
52
|
-
"bexio": {
|
|
53
|
-
"command": "node",
|
|
54
|
-
"args": ["/path/to/bexio-mcp-server/src/dist/index.js"],
|
|
55
|
-
"env": {
|
|
56
|
-
"BEXIO_API_TOKEN": "your-token-here"
|
|
57
|
-
}
|
|
58
|
-
}
|
|
59
|
-
}
|
|
60
|
-
}
|
|
61
|
-
```
|
|
62
|
-
|
|
63
|
-
## Getting Your Bexio API Token
|
|
64
|
-
|
|
65
|
-
1. Log in to [Bexio](https://office.bexio.com/)
|
|
66
|
-
2. Go to **Settings** > **API Tokens**
|
|
67
|
-
3. Click **Create Token**
|
|
68
|
-
4. Copy the token and use it in your configuration
|
|
69
|
-
|
|
70
|
-
## Features
|
|
71
|
-
|
|
72
|
-
This MCP server provides **221 tools** across all Bexio domains:
|
|
73
|
-
|
|
74
|
-
### Contacts & CRM
|
|
75
|
-
- Create, update, search contacts
|
|
76
|
-
- Contact groups, sectors, salutations, titles
|
|
77
|
-
- Contact relations management
|
|
78
|
-
|
|
79
|
-
### Invoices & Sales
|
|
80
|
-
- Full invoice lifecycle (create, issue, send, cancel)
|
|
81
|
-
- Quotes with accept/decline workflows
|
|
82
|
-
- Orders with delivery management
|
|
83
|
-
- Incoming payments tracking
|
|
84
|
-
- Interactive invoice preview
|
|
85
|
-
|
|
86
|
-
### Banking & Payments
|
|
87
|
-
- Swiss QR-bill payment support (QR-IBAN)
|
|
88
|
-
- Standard IBAN payments (ISO 20022)
|
|
89
|
-
- Currency management (CHF, EUR)
|
|
90
|
-
- Bank account management
|
|
91
|
-
|
|
92
|
-
### Projects & Time Tracking
|
|
93
|
-
- Project management with types and statuses
|
|
94
|
-
- Milestones and work packages
|
|
95
|
-
- Timesheet entries with duration tracking
|
|
96
|
-
- Business activities and communication types
|
|
97
|
-
|
|
98
|
-
### Accounting
|
|
99
|
-
- Chart of accounts
|
|
100
|
-
- Manual journal entries
|
|
101
|
-
- Business years and VAT periods
|
|
102
|
-
- Account groups
|
|
103
|
-
|
|
104
|
-
### Purchase & Expenses
|
|
105
|
-
- Bills (creditor invoices)
|
|
106
|
-
- Expenses and purchase orders
|
|
107
|
-
- Outgoing payments
|
|
108
|
-
|
|
109
|
-
### Files & Documents
|
|
110
|
-
- Document upload/download
|
|
111
|
-
- File management
|
|
112
|
-
|
|
113
|
-
### Payroll (requires Bexio Payroll module)
|
|
114
|
-
- Employee management
|
|
115
|
-
- Absence tracking
|
|
116
|
-
- Payroll documents
|
|
117
|
-
|
|
118
|
-
## HTTP Mode
|
|
119
|
-
|
|
120
|
-
For integration with n8n or other automation tools:
|
|
121
|
-
|
|
122
|
-
```bash
|
|
123
|
-
npx @promptpartner/bexio-mcp-server --mode http --port 8000
|
|
124
|
-
```
|
|
125
|
-
|
|
126
|
-
## Environment Variables
|
|
127
|
-
|
|
128
|
-
| Variable | Required | Default | Description |
|
|
129
|
-
|----------|----------|---------|-------------|
|
|
130
|
-
| `BEXIO_API_TOKEN` | Yes | - | Your Bexio API token |
|
|
131
|
-
| `BEXIO_BASE_URL` | No | `https://api.bexio.com/2.0` | API endpoint URL |
|
|
132
|
-
|
|
133
|
-
## Troubleshooting
|
|
134
|
-
|
|
135
|
-
### "Invalid API token" error
|
|
136
|
-
- Verify your token in Bexio Settings > API Tokens
|
|
137
|
-
- Ensure the token has not expired
|
|
138
|
-
- Check that the token has the required permissions
|
|
139
|
-
|
|
140
|
-
### "Connection refused" error
|
|
141
|
-
- Check your internet connection
|
|
142
|
-
- Verify BEXIO_BASE_URL is correct (default: https://api.bexio.com/2.0)
|
|
143
|
-
|
|
144
|
-
### Payroll tools return "module not available"
|
|
145
|
-
- Payroll tools require the Bexio Payroll module subscription
|
|
146
|
-
- Contact Bexio support to enable the module
|
|
147
|
-
|
|
148
|
-
### Claude Desktop doesn't see the server
|
|
149
|
-
- Restart Claude Desktop after configuration changes
|
|
150
|
-
- Verify the config file path is correct for your OS
|
|
151
|
-
- Check Claude Desktop logs for error messages
|
|
152
|
-
|
|
153
|
-
##
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
##
|
|
158
|
-
|
|
159
|
-
- [
|
|
160
|
-
|
|
161
|
-
|
|
1
|
+
# @promptpartner/bexio-mcp-server
|
|
2
|
+
|
|
3
|
+
Complete Swiss accounting integration for [Bexio](https://www.bexio.com/) with [Claude Desktop](https://claude.com/desktop). Manage invoices, contacts, projects, time tracking, and 200+ more tools through natural conversation.
|
|
4
|
+
|
|
5
|
+
## Quick Start
|
|
6
|
+
|
|
7
|
+
### Option 1: MCPB Bundle (Recommended)
|
|
8
|
+
|
|
9
|
+
1. Download `bexio-mcp-server.mcpb` from [Releases](https://github.com/promptpartner/bexio-mcp-server/releases)
|
|
10
|
+
2. Double-click to install in Claude Desktop
|
|
11
|
+
3. Enter your Bexio API token when prompted
|
|
12
|
+
|
|
13
|
+
### Option 2: npm
|
|
14
|
+
|
|
15
|
+
```bash
|
|
16
|
+
npx @promptpartner/bexio-mcp-server
|
|
17
|
+
```
|
|
18
|
+
|
|
19
|
+
Add to Claude Desktop config:
|
|
20
|
+
|
|
21
|
+
**macOS:** `~/Library/Application Support/Claude/claude_desktop_config.json`
|
|
22
|
+
**Windows:** `%APPDATA%\Claude\claude_desktop_config.json`
|
|
23
|
+
|
|
24
|
+
```json
|
|
25
|
+
{
|
|
26
|
+
"mcpServers": {
|
|
27
|
+
"bexio": {
|
|
28
|
+
"command": "npx",
|
|
29
|
+
"args": ["@promptpartner/bexio-mcp-server"],
|
|
30
|
+
"env": {
|
|
31
|
+
"BEXIO_API_TOKEN": "your-token-here"
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
```
|
|
37
|
+
|
|
38
|
+
### Option 3: From Source
|
|
39
|
+
|
|
40
|
+
```bash
|
|
41
|
+
git clone https://github.com/promptpartner/bexio-mcp-server
|
|
42
|
+
cd bexio-mcp-server/src
|
|
43
|
+
npm install
|
|
44
|
+
npm run build
|
|
45
|
+
```
|
|
46
|
+
|
|
47
|
+
Add to Claude Desktop config:
|
|
48
|
+
|
|
49
|
+
```json
|
|
50
|
+
{
|
|
51
|
+
"mcpServers": {
|
|
52
|
+
"bexio": {
|
|
53
|
+
"command": "node",
|
|
54
|
+
"args": ["/path/to/bexio-mcp-server/src/dist/index.js"],
|
|
55
|
+
"env": {
|
|
56
|
+
"BEXIO_API_TOKEN": "your-token-here"
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
```
|
|
62
|
+
|
|
63
|
+
## Getting Your Bexio API Token
|
|
64
|
+
|
|
65
|
+
1. Log in to [Bexio](https://office.bexio.com/)
|
|
66
|
+
2. Go to **Settings** > **API Tokens**
|
|
67
|
+
3. Click **Create Token**
|
|
68
|
+
4. Copy the token and use it in your configuration
|
|
69
|
+
|
|
70
|
+
## Features
|
|
71
|
+
|
|
72
|
+
This MCP server provides **221 tools** across all Bexio domains:
|
|
73
|
+
|
|
74
|
+
### Contacts & CRM
|
|
75
|
+
- Create, update, search contacts
|
|
76
|
+
- Contact groups, sectors, salutations, titles
|
|
77
|
+
- Contact relations management
|
|
78
|
+
|
|
79
|
+
### Invoices & Sales
|
|
80
|
+
- Full invoice lifecycle (create, issue, send, cancel)
|
|
81
|
+
- Quotes with accept/decline workflows
|
|
82
|
+
- Orders with delivery management
|
|
83
|
+
- Incoming payments tracking
|
|
84
|
+
- Interactive invoice preview
|
|
85
|
+
|
|
86
|
+
### Banking & Payments
|
|
87
|
+
- Swiss QR-bill payment support (QR-IBAN)
|
|
88
|
+
- Standard IBAN payments (ISO 20022)
|
|
89
|
+
- Currency management (CHF, EUR)
|
|
90
|
+
- Bank account management
|
|
91
|
+
|
|
92
|
+
### Projects & Time Tracking
|
|
93
|
+
- Project management with types and statuses
|
|
94
|
+
- Milestones and work packages
|
|
95
|
+
- Timesheet entries with duration tracking
|
|
96
|
+
- Business activities and communication types
|
|
97
|
+
|
|
98
|
+
### Accounting
|
|
99
|
+
- Chart of accounts
|
|
100
|
+
- Manual journal entries
|
|
101
|
+
- Business years and VAT periods
|
|
102
|
+
- Account groups
|
|
103
|
+
|
|
104
|
+
### Purchase & Expenses
|
|
105
|
+
- Bills (creditor invoices)
|
|
106
|
+
- Expenses and purchase orders
|
|
107
|
+
- Outgoing payments
|
|
108
|
+
|
|
109
|
+
### Files & Documents
|
|
110
|
+
- Document upload/download
|
|
111
|
+
- File management
|
|
112
|
+
|
|
113
|
+
### Payroll (requires Bexio Payroll module)
|
|
114
|
+
- Employee management
|
|
115
|
+
- Absence tracking
|
|
116
|
+
- Payroll documents
|
|
117
|
+
|
|
118
|
+
## HTTP Mode
|
|
119
|
+
|
|
120
|
+
For integration with n8n or other automation tools:
|
|
121
|
+
|
|
122
|
+
```bash
|
|
123
|
+
npx @promptpartner/bexio-mcp-server --mode http --port 8000
|
|
124
|
+
```
|
|
125
|
+
|
|
126
|
+
## Environment Variables
|
|
127
|
+
|
|
128
|
+
| Variable | Required | Default | Description |
|
|
129
|
+
|----------|----------|---------|-------------|
|
|
130
|
+
| `BEXIO_API_TOKEN` | Yes | - | Your Bexio API token |
|
|
131
|
+
| `BEXIO_BASE_URL` | No | `https://api.bexio.com/2.0` | API endpoint URL |
|
|
132
|
+
|
|
133
|
+
## Troubleshooting
|
|
134
|
+
|
|
135
|
+
### "Invalid API token" error
|
|
136
|
+
- Verify your token in Bexio Settings > API Tokens
|
|
137
|
+
- Ensure the token has not expired
|
|
138
|
+
- Check that the token has the required permissions
|
|
139
|
+
|
|
140
|
+
### "Connection refused" error
|
|
141
|
+
- Check your internet connection
|
|
142
|
+
- Verify BEXIO_BASE_URL is correct (default: https://api.bexio.com/2.0)
|
|
143
|
+
|
|
144
|
+
### Payroll tools return "module not available"
|
|
145
|
+
- Payroll tools require the Bexio Payroll module subscription
|
|
146
|
+
- Contact Bexio support to enable the module
|
|
147
|
+
|
|
148
|
+
### Claude Desktop doesn't see the server
|
|
149
|
+
- Restart Claude Desktop after configuration changes
|
|
150
|
+
- Verify the config file path is correct for your OS
|
|
151
|
+
- Check Claude Desktop logs for error messages
|
|
152
|
+
|
|
153
|
+
## Acknowledgments
|
|
154
|
+
|
|
155
|
+
This project builds upon the original Bexio MCP server created by [Sebastian Bryner](https://www.linkedin.com/in/sebastian-bryner/) of [bryner.tech](https://bryner.tech/). His v1.0 implementation provided the foundational architecture and initial 83 tools that made this expanded v2.0 possible.
|
|
156
|
+
|
|
157
|
+
## License
|
|
158
|
+
|
|
159
|
+
MIT - See [LICENSE](LICENSE) for details.
|
|
160
|
+
|
|
161
|
+
## Links
|
|
162
|
+
|
|
163
|
+
- [Bexio API Documentation](https://docs.bexio.com/)
|
|
164
|
+
- [MCP Protocol Specification](https://modelcontextprotocol.io/)
|
|
165
|
+
- [Report Issues](https://github.com/promptpartner/bexio-mcp-server/issues)
|
|
@@ -61,19 +61,19 @@ async function checkPayrollModule(client) {
|
|
|
61
61
|
* Explains what the module provides and how to enable it.
|
|
62
62
|
*/
|
|
63
63
|
function payrollUnavailableError() {
|
|
64
|
-
return new McpError("BEXIO_API_ERROR", `Payroll module is not enabled for your Bexio account.
|
|
65
|
-
|
|
66
|
-
The Payroll module provides:
|
|
67
|
-
- Employee management (work contracts, hourly rates)
|
|
68
|
-
- Absence tracking (vacation, sick leave, etc.)
|
|
69
|
-
- Payroll documents (payslips, tax statements)
|
|
70
|
-
|
|
71
|
-
To enable the Payroll module:
|
|
72
|
-
1. Go to Bexio Settings > Subscriptions
|
|
73
|
-
2. Select a plan that includes Payroll features
|
|
74
|
-
3. Contact Bexio support if you need help choosing the right plan
|
|
75
|
-
|
|
76
|
-
Note: Payroll features are typically available in Bexio Pro and Enterprise plans.
|
|
64
|
+
return new McpError("BEXIO_API_ERROR", `Payroll module is not enabled for your Bexio account.
|
|
65
|
+
|
|
66
|
+
The Payroll module provides:
|
|
67
|
+
- Employee management (work contracts, hourly rates)
|
|
68
|
+
- Absence tracking (vacation, sick leave, etc.)
|
|
69
|
+
- Payroll documents (payslips, tax statements)
|
|
70
|
+
|
|
71
|
+
To enable the Payroll module:
|
|
72
|
+
1. Go to Bexio Settings > Subscriptions
|
|
73
|
+
2. Select a plan that includes Payroll features
|
|
74
|
+
3. Contact Bexio support if you need help choosing the right plan
|
|
75
|
+
|
|
76
|
+
Note: Payroll features are typically available in Bexio Pro and Enterprise plans.
|
|
77
77
|
Visit https://www.bexio.com/en/pricing for plan details.`, { module: "payroll", available: false });
|
|
78
78
|
}
|
|
79
79
|
/**
|
|
@@ -0,0 +1,187 @@
|
|
|
1
|
+
<!DOCTYPE html>
|
|
2
|
+
<html lang="en">
|
|
3
|
+
<head>
|
|
4
|
+
<meta charset="UTF-8">
|
|
5
|
+
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
|
6
|
+
<title>Contact Card</title>
|
|
7
|
+
<style>
|
|
8
|
+
* {
|
|
9
|
+
box-sizing: border-box;
|
|
10
|
+
margin: 0;
|
|
11
|
+
padding: 0;
|
|
12
|
+
}
|
|
13
|
+
body {
|
|
14
|
+
font-family: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
|
|
15
|
+
line-height: 1.5;
|
|
16
|
+
color: #1a1a1a;
|
|
17
|
+
background: #f9fafb;
|
|
18
|
+
padding: 1.5rem;
|
|
19
|
+
}
|
|
20
|
+
.card {
|
|
21
|
+
max-width: 400px;
|
|
22
|
+
margin: 0 auto;
|
|
23
|
+
background: #fff;
|
|
24
|
+
border-radius: 1rem;
|
|
25
|
+
box-shadow: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
|
|
26
|
+
overflow: hidden;
|
|
27
|
+
}
|
|
28
|
+
.card-header {
|
|
29
|
+
background: linear-gradient(135deg, #3b82f6 0%, #1d4ed8 100%);
|
|
30
|
+
color: white;
|
|
31
|
+
padding: 1.5rem;
|
|
32
|
+
text-align: center;
|
|
33
|
+
}
|
|
34
|
+
.avatar {
|
|
35
|
+
width: 80px;
|
|
36
|
+
height: 80px;
|
|
37
|
+
background: rgba(255, 255, 255, 0.2);
|
|
38
|
+
border-radius: 50%;
|
|
39
|
+
display: flex;
|
|
40
|
+
align-items: center;
|
|
41
|
+
justify-content: center;
|
|
42
|
+
margin: 0 auto 1rem;
|
|
43
|
+
font-size: 2rem;
|
|
44
|
+
font-weight: 600;
|
|
45
|
+
}
|
|
46
|
+
.card-header h1 {
|
|
47
|
+
font-size: 1.25rem;
|
|
48
|
+
font-weight: 600;
|
|
49
|
+
margin-bottom: 0.25rem;
|
|
50
|
+
}
|
|
51
|
+
.card-header .company {
|
|
52
|
+
font-size: 0.875rem;
|
|
53
|
+
opacity: 0.9;
|
|
54
|
+
}
|
|
55
|
+
.card-body {
|
|
56
|
+
padding: 1.25rem;
|
|
57
|
+
}
|
|
58
|
+
.info-section {
|
|
59
|
+
margin-bottom: 1.25rem;
|
|
60
|
+
}
|
|
61
|
+
.info-section:last-child {
|
|
62
|
+
margin-bottom: 0;
|
|
63
|
+
}
|
|
64
|
+
.info-label {
|
|
65
|
+
font-size: 0.7rem;
|
|
66
|
+
font-weight: 600;
|
|
67
|
+
text-transform: uppercase;
|
|
68
|
+
color: #6b7280;
|
|
69
|
+
margin-bottom: 0.25rem;
|
|
70
|
+
}
|
|
71
|
+
.info-row {
|
|
72
|
+
display: flex;
|
|
73
|
+
align-items: center;
|
|
74
|
+
padding: 0.5rem 0;
|
|
75
|
+
border-bottom: 1px solid #f3f4f6;
|
|
76
|
+
}
|
|
77
|
+
.info-row:last-child {
|
|
78
|
+
border-bottom: none;
|
|
79
|
+
}
|
|
80
|
+
.info-icon {
|
|
81
|
+
width: 20px;
|
|
82
|
+
height: 20px;
|
|
83
|
+
margin-right: 0.75rem;
|
|
84
|
+
color: #6b7280;
|
|
85
|
+
}
|
|
86
|
+
.info-value {
|
|
87
|
+
color: #374151;
|
|
88
|
+
}
|
|
89
|
+
.info-value a {
|
|
90
|
+
color: #3b82f6;
|
|
91
|
+
text-decoration: none;
|
|
92
|
+
}
|
|
93
|
+
.info-value a:hover {
|
|
94
|
+
text-decoration: underline;
|
|
95
|
+
}
|
|
96
|
+
.address-block {
|
|
97
|
+
color: #374151;
|
|
98
|
+
font-size: 0.95rem;
|
|
99
|
+
}
|
|
100
|
+
.loading {
|
|
101
|
+
display: flex;
|
|
102
|
+
align-items: center;
|
|
103
|
+
justify-content: center;
|
|
104
|
+
min-height: 200px;
|
|
105
|
+
color: #6b7280;
|
|
106
|
+
background: #fff;
|
|
107
|
+
}
|
|
108
|
+
.type-badge {
|
|
109
|
+
display: inline-block;
|
|
110
|
+
padding: 0.125rem 0.5rem;
|
|
111
|
+
border-radius: 9999px;
|
|
112
|
+
font-size: 0.7rem;
|
|
113
|
+
font-weight: 600;
|
|
114
|
+
text-transform: uppercase;
|
|
115
|
+
margin-top: 0.5rem;
|
|
116
|
+
}
|
|
117
|
+
.type-company { background: rgba(255, 255, 255, 0.2); }
|
|
118
|
+
.type-person { background: rgba(255, 255, 255, 0.2); }
|
|
119
|
+
</style>
|
|
120
|
+
<script type="module" crossorigin>import{g as f}from"./app-CW49uSHM.js";const o=document.getElementById("app"),t=new f({name:"Contact Card",version:"1.0.0"});t.ontoolresult=e=>{var n,a;const s=(a=(n=e.content)==null?void 0:n.find(i=>i.type==="text"))==null?void 0:a.text;if(s)try{const i=JSON.parse(s);m(i)}catch{o.innerHTML='<div class="loading">Error parsing contact data</div>'}};t.connect();function c(e,s){return[e,s].filter(Boolean).map(a=>a.charAt(0).toUpperCase()).join("").slice(0,2)||"?"}function h(e){return e?{1:"Switzerland",2:"Germany",3:"Austria",4:"France",5:"Italy",6:"Liechtenstein"}[e]||`Country #${e}`:""}function m(e){const s=[e.name_1,e.name_2].filter(Boolean).join(" "),n=c(e.name_1,e.name_2),a=e.contact_type_id===1,i=a?"Company":"Person",v=a?"type-company":"type-person",l=[e.address,[e.postcode,e.city].filter(Boolean).join(" "),h(e.country_id)].filter(Boolean),r=e.mail||e.phone_fixed||e.phone_mobile||e.fax,d=l.length>0;o.className="card",o.innerHTML=`
|
|
121
|
+
<div class="card-header">
|
|
122
|
+
<div class="avatar">${n}</div>
|
|
123
|
+
<h1>${s}</h1>
|
|
124
|
+
${e.url?`<div class="company">${e.url}</div>`:""}
|
|
125
|
+
<span class="type-badge ${v}">${i}</span>
|
|
126
|
+
</div>
|
|
127
|
+
<div class="card-body">
|
|
128
|
+
${r?`
|
|
129
|
+
<div class="info-section">
|
|
130
|
+
<div class="info-label">Contact Information</div>
|
|
131
|
+
${e.mail?`
|
|
132
|
+
<div class="info-row">
|
|
133
|
+
<svg class="info-icon" fill="none" stroke="currentColor" viewBox="0 0 24 24">
|
|
134
|
+
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M3 8l7.89 5.26a2 2 0 002.22 0L21 8M5 19h14a2 2 0 002-2V7a2 2 0 00-2-2H5a2 2 0 00-2 2v10a2 2 0 002 2z"/>
|
|
135
|
+
</svg>
|
|
136
|
+
<span class="info-value"><a href="mailto:${e.mail}">${e.mail}</a></span>
|
|
137
|
+
</div>
|
|
138
|
+
`:""}
|
|
139
|
+
${e.phone_fixed?`
|
|
140
|
+
<div class="info-row">
|
|
141
|
+
<svg class="info-icon" fill="none" stroke="currentColor" viewBox="0 0 24 24">
|
|
142
|
+
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M3 5a2 2 0 012-2h3.28a1 1 0 01.948.684l1.498 4.493a1 1 0 01-.502 1.21l-2.257 1.13a11.042 11.042 0 005.516 5.516l1.13-2.257a1 1 0 011.21-.502l4.493 1.498a1 1 0 01.684.949V19a2 2 0 01-2 2h-1C9.716 21 3 14.284 3 6V5z"/>
|
|
143
|
+
</svg>
|
|
144
|
+
<span class="info-value"><a href="tel:${e.phone_fixed}">${e.phone_fixed}</a></span>
|
|
145
|
+
</div>
|
|
146
|
+
`:""}
|
|
147
|
+
${e.phone_mobile?`
|
|
148
|
+
<div class="info-row">
|
|
149
|
+
<svg class="info-icon" fill="none" stroke="currentColor" viewBox="0 0 24 24">
|
|
150
|
+
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M12 18h.01M8 21h8a2 2 0 002-2V5a2 2 0 00-2-2H8a2 2 0 00-2 2v14a2 2 0 002 2z"/>
|
|
151
|
+
</svg>
|
|
152
|
+
<span class="info-value"><a href="tel:${e.phone_mobile}">${e.phone_mobile}</a></span>
|
|
153
|
+
</div>
|
|
154
|
+
`:""}
|
|
155
|
+
${e.fax?`
|
|
156
|
+
<div class="info-row">
|
|
157
|
+
<svg class="info-icon" fill="none" stroke="currentColor" viewBox="0 0 24 24">
|
|
158
|
+
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M17 17h2a2 2 0 002-2v-4a2 2 0 00-2-2H5a2 2 0 00-2 2v4a2 2 0 002 2h2m2 4h6a2 2 0 002-2v-4a2 2 0 00-2-2H9a2 2 0 00-2 2v4a2 2 0 002 2zm8-12V5a2 2 0 00-2-2H9a2 2 0 00-2 2v4h10z"/>
|
|
159
|
+
</svg>
|
|
160
|
+
<span class="info-value">${e.fax}</span>
|
|
161
|
+
</div>
|
|
162
|
+
`:""}
|
|
163
|
+
</div>
|
|
164
|
+
`:""}
|
|
165
|
+
|
|
166
|
+
${d?`
|
|
167
|
+
<div class="info-section">
|
|
168
|
+
<div class="info-label">Address</div>
|
|
169
|
+
<div class="address-block">
|
|
170
|
+
${l.map(p=>`<div>${p}</div>`).join("")}
|
|
171
|
+
</div>
|
|
172
|
+
</div>
|
|
173
|
+
`:""}
|
|
174
|
+
|
|
175
|
+
${!r&&!d?`
|
|
176
|
+
<div class="info-section" style="text-align: center; color: #6b7280;">
|
|
177
|
+
No contact details available
|
|
178
|
+
</div>
|
|
179
|
+
`:""}
|
|
180
|
+
</div>
|
|
181
|
+
`}</script>
|
|
182
|
+
<link rel="modulepreload" crossorigin href="../../app-CW49uSHM.js">
|
|
183
|
+
</head>
|
|
184
|
+
<body>
|
|
185
|
+
<div id="app" class="card loading">Loading contact...</div>
|
|
186
|
+
</body>
|
|
187
|
+
</html>
|