tiime-sdk 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.
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 Youness Abbal
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 ADDED
@@ -0,0 +1,107 @@
1
+ # Tiime SDK
2
+
3
+ SDK TypeScript pour l'API de comptabilite [Tiime](https://www.tiime.fr) — integrez Tiime dans vos applications Node.js.
4
+
5
+ ## Installation
6
+
7
+ ```bash
8
+ npm install tiime-sdk
9
+ ```
10
+
11
+ ## Pre-requis
12
+
13
+ Authentifiez-vous via le CLI [`tiime-cli`](https://www.npmjs.com/package/tiime-cli) :
14
+
15
+ ```bash
16
+ npm install -g tiime-cli
17
+ tiime auth login
18
+ tiime company use --id 12345
19
+ ```
20
+
21
+ ## Utilisation
22
+
23
+ ```typescript
24
+ import { TiimeClient } from "tiime-sdk";
25
+
26
+ const client = new TiimeClient({ companyId: 12345 });
27
+
28
+ // Factures
29
+ const invoices = await client.invoices.list({ status: "paid" });
30
+ const invoice = await client.invoices.get(42);
31
+ const created = await client.invoices.create({
32
+ emission_date: "2026-03-01",
33
+ client: { id: 100 },
34
+ lines: [
35
+ {
36
+ description: "Prestation de conseil",
37
+ quantity: 5,
38
+ unit_amount: 800,
39
+ vat_type: { code: "normal" },
40
+ invoicing_unit: { id: 3, code: "day" },
41
+ },
42
+ ],
43
+ status: "draft",
44
+ });
45
+
46
+ // Envoyer une facture
47
+ await client.invoices.send(42, {
48
+ recipients: [{ email: "client@example.com" }],
49
+ });
50
+
51
+ // Telecharger un PDF
52
+ const pdf = await client.invoices.downloadPdf(42);
53
+
54
+ // Banque
55
+ const balances = await client.bankAccounts.balance();
56
+ const transactions = await client.bankTransactions.listAll({
57
+ from: "2026-01-01",
58
+ to: "2026-01-31",
59
+ search: "loyer",
60
+ });
61
+
62
+ // Clients
63
+ const clients = await client.clients.list({ archived: false });
64
+
65
+ // Devis
66
+ const quotations = await client.quotations.list();
67
+
68
+ // Utilisateur
69
+ const me = await client.users.me();
70
+ ```
71
+
72
+ ## Ressources disponibles
73
+
74
+ | Ressource | Acces | Description |
75
+ |-----------|-------|-------------|
76
+ | Factures | `client.invoices` | CRUD + envoi + PDF + duplication |
77
+ | Devis | `client.quotations` | CRUD + envoi + PDF |
78
+ | Clients | `client.clients` | CRUD + recherche |
79
+ | Comptes bancaires | `client.bankAccounts` | Liste + details + soldes |
80
+ | Transactions | `client.bankTransactions` | Liste + pagination auto + imputation |
81
+ | Notes de frais | `client.expenseReports` | CRUD |
82
+ | Documents | `client.documents` | Liste + categories + upload + download |
83
+ | Labels | `client.labels` | Personnalises + standards + tags |
84
+ | Utilisateurs | `client.users` | Profil + infos legales + settings |
85
+ | Entreprise | `client.company` | Details + config + dashboard |
86
+
87
+ ## Gestion des erreurs
88
+
89
+ ```typescript
90
+ import { TiimeClient, TiimeError } from "tiime-sdk";
91
+
92
+ try {
93
+ const invoice = await client.invoices.get(99999);
94
+ } catch (error) {
95
+ if (error instanceof TiimeError) {
96
+ console.error(`Erreur ${error.status}: ${error.message}`);
97
+ }
98
+ }
99
+ ```
100
+
101
+ ## Documentation
102
+
103
+ Voir la [documentation complete](https://yabbal.github.io/tiime-cli/docs/sdk).
104
+
105
+ ## Licence
106
+
107
+ MIT — Youness Abbal