@scell/sdk 1.4.0 → 1.5.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.
Files changed (46) hide show
  1. package/LICENSE +0 -0
  2. package/README.md +0 -0
  3. package/dist/index.d.mts +37 -3
  4. package/dist/index.d.ts +37 -3
  5. package/dist/index.js +50 -4
  6. package/dist/index.js.map +1 -1
  7. package/dist/index.mjs +50 -4
  8. package/dist/index.mjs.map +1 -1
  9. package/package.json +1 -1
  10. package/src/client.ts +0 -0
  11. package/src/errors.ts +0 -0
  12. package/src/index.ts +28 -4
  13. package/src/resources/api-keys.ts +0 -0
  14. package/src/resources/auth.ts +0 -0
  15. package/src/resources/balance.ts +0 -0
  16. package/src/resources/billing.ts +0 -0
  17. package/src/resources/companies.ts +0 -0
  18. package/src/resources/fiscal.ts +0 -0
  19. package/src/resources/invoices.ts +0 -0
  20. package/src/resources/signatures.ts +33 -0
  21. package/src/resources/stats.ts +0 -0
  22. package/src/resources/sub-tenants.ts +0 -0
  23. package/src/resources/tenant-credit-notes.ts +0 -0
  24. package/src/resources/tenant-direct-credit-notes.ts +0 -0
  25. package/src/resources/tenant-direct-invoices.ts +0 -0
  26. package/src/resources/tenant-incoming-invoices.ts +0 -0
  27. package/src/resources/webhooks.ts +0 -0
  28. package/src/tenant-client.ts +0 -0
  29. package/src/types/api-keys.ts +0 -0
  30. package/src/types/auth.ts +0 -0
  31. package/src/types/balance.ts +0 -0
  32. package/src/types/billing.ts +0 -0
  33. package/src/types/common.ts +0 -0
  34. package/src/types/companies.ts +0 -0
  35. package/src/types/fiscal.ts +0 -0
  36. package/src/types/index.ts +0 -0
  37. package/src/types/invoices.ts +0 -0
  38. package/src/types/signatures.ts +0 -0
  39. package/src/types/stats.ts +0 -0
  40. package/src/types/sub-tenants.ts +0 -0
  41. package/src/types/tenant-credit-notes.ts +0 -0
  42. package/src/types/tenant-invoices.ts +0 -0
  43. package/src/types/tenant-profile.ts +0 -0
  44. package/src/types/webhooks.ts +0 -0
  45. package/src/utils/retry.ts +0 -0
  46. package/src/utils/webhook-verify.ts +0 -0
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@scell/sdk",
3
- "version": "1.4.0",
3
+ "version": "1.5.0",
4
4
  "description": "Official TypeScript SDK for Scell.io - Electronic invoicing (Factur-X) and signatures (eIDAS) API",
5
5
  "author": "Scell.io <contact@scell.io>",
6
6
  "license": "MIT",
package/src/client.ts CHANGED
File without changes
package/src/errors.ts CHANGED
File without changes
package/src/index.ts CHANGED
@@ -38,10 +38,16 @@ import { ScellTenantClient } from './tenant-client.js';
38
38
  import { ApiKeysResource } from './resources/api-keys.js';
39
39
  import { AuthResource, ScellAuth } from './resources/auth.js';
40
40
  import { BalanceResource } from './resources/balance.js';
41
+ import { BillingResource } from './resources/billing.js';
41
42
  import { CompaniesResource } from './resources/companies.js';
43
+ import { FiscalResource } from './resources/fiscal.js';
42
44
  import { InvoicesResource } from './resources/invoices.js';
43
45
  import { SignaturesResource } from './resources/signatures.js';
46
+ import { StatsResource } from './resources/stats.js';
47
+ import { SubTenantsResource } from './resources/sub-tenants.js';
44
48
  import { TenantCreditNotesResource } from './resources/tenant-credit-notes.js';
49
+ import { TenantDirectInvoicesResource } from './resources/tenant-direct-invoices.js';
50
+ import { TenantIncomingInvoicesResource } from './resources/tenant-incoming-invoices.js';
45
51
  import { WebhooksResource } from './resources/webhooks.js';
46
52
 
47
53
  // Utilities
@@ -153,13 +159,25 @@ export class ScellApiClient {
153
159
  public readonly invoices: InvoicesResource;
154
160
  /** Signature operations (create, download, remind, cancel) */
155
161
  public readonly signatures: SignaturesResource;
156
- /** Tenant credit notes operations (create, send, download) */
157
- public readonly tenantCreditNotes: TenantCreditNotesResource;
162
+ /** Sub-tenant management (provision, update, list) */
163
+ public readonly subTenants: SubTenantsResource;
164
+ /** NF525 fiscal compliance (closings, FEC, attestation) */
165
+ public readonly fiscal: FiscalResource;
166
+ /** Platform statistics */
167
+ public readonly stats: StatsResource;
168
+ /** Platform billing (usage, top-up, transactions) */
169
+ public readonly billing: BillingResource;
170
+ /** Credit notes operations (create, send, download) */
171
+ public readonly creditNotes: TenantCreditNotesResource;
172
+ /** Tenant invoice operations (create, submit, update, delete) */
173
+ public readonly tenantInvoices: TenantDirectInvoicesResource;
174
+ /** Incoming invoice operations (list, accept, reject) */
175
+ public readonly incomingInvoices: TenantIncomingInvoicesResource;
158
176
 
159
177
  /**
160
178
  * Create a new Scell API Client
161
179
  *
162
- * @param apiKey - Your API key (from dashboard)
180
+ * @param apiKey - Your API key (sk_live_xxx or sk_test_xxx)
163
181
  * @param config - Client configuration
164
182
  *
165
183
  * @example
@@ -178,7 +196,13 @@ export class ScellApiClient {
178
196
 
179
197
  this.invoices = new InvoicesResource(this.http);
180
198
  this.signatures = new SignaturesResource(this.http);
181
- this.tenantCreditNotes = new TenantCreditNotesResource(this.http);
199
+ this.subTenants = new SubTenantsResource(this.http);
200
+ this.fiscal = new FiscalResource(this.http);
201
+ this.stats = new StatsResource(this.http);
202
+ this.billing = new BillingResource(this.http);
203
+ this.creditNotes = new TenantCreditNotesResource(this.http);
204
+ this.tenantInvoices = new TenantDirectInvoicesResource(this.http);
205
+ this.incomingInvoices = new TenantIncomingInvoicesResource(this.http);
182
206
  }
183
207
  }
184
208
 
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
@@ -11,6 +11,7 @@ import type {
11
11
  PaginatedResponse,
12
12
  SingleResponse,
13
13
  } from '../types/common.js';
14
+ import type { AuditTrailResponse } from '../types/invoices.js';
14
15
  import type {
15
16
  CreateSignatureInput,
16
17
  Signature,
@@ -242,4 +243,36 @@ export class SignaturesResource {
242
243
  requestOptions
243
244
  );
244
245
  }
246
+
247
+ /**
248
+ * Get signature audit trail (JSON)
249
+ *
250
+ * Returns the complete history of actions on the signature:
251
+ * creation, delivery, opening, signing, refusal, etc.
252
+ *
253
+ * @param id - Signature UUID
254
+ * @param requestOptions - Request options
255
+ * @returns Audit trail entries with integrity validation
256
+ *
257
+ * @example
258
+ * ```typescript
259
+ * const { data: entries, integrity_valid } = await client.signatures.auditTrail(
260
+ * 'signature-uuid'
261
+ * );
262
+ *
263
+ * if (integrity_valid) {
264
+ * entries.forEach(e => console.log(e.action, e.created_at));
265
+ * }
266
+ * ```
267
+ */
268
+ async auditTrail(
269
+ id: string,
270
+ requestOptions?: RequestOptions
271
+ ): Promise<AuditTrailResponse> {
272
+ return this.http.get<AuditTrailResponse>(
273
+ `/signatures/${id}/audit-trail`,
274
+ undefined,
275
+ requestOptions
276
+ );
277
+ }
245
278
  }
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
package/src/types/auth.ts CHANGED
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes