@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/LICENSE CHANGED
File without changes
package/README.md CHANGED
File without changes
package/dist/index.d.mts CHANGED
@@ -3925,6 +3925,28 @@ declare class SignaturesResource {
3925
3925
  * ```
3926
3926
  */
3927
3927
  cancel(id: string, requestOptions?: RequestOptions): Promise<MessageResponse>;
3928
+ /**
3929
+ * Get signature audit trail (JSON)
3930
+ *
3931
+ * Returns the complete history of actions on the signature:
3932
+ * creation, delivery, opening, signing, refusal, etc.
3933
+ *
3934
+ * @param id - Signature UUID
3935
+ * @param requestOptions - Request options
3936
+ * @returns Audit trail entries with integrity validation
3937
+ *
3938
+ * @example
3939
+ * ```typescript
3940
+ * const { data: entries, integrity_valid } = await client.signatures.auditTrail(
3941
+ * 'signature-uuid'
3942
+ * );
3943
+ *
3944
+ * if (integrity_valid) {
3945
+ * entries.forEach(e => console.log(e.action, e.created_at));
3946
+ * }
3947
+ * ```
3948
+ */
3949
+ auditTrail(id: string, requestOptions?: RequestOptions): Promise<AuditTrailResponse>;
3928
3950
  }
3929
3951
 
3930
3952
  /**
@@ -4599,12 +4621,24 @@ declare class ScellApiClient {
4599
4621
  readonly invoices: InvoicesResource;
4600
4622
  /** Signature operations (create, download, remind, cancel) */
4601
4623
  readonly signatures: SignaturesResource;
4602
- /** Tenant credit notes operations (create, send, download) */
4603
- readonly tenantCreditNotes: TenantCreditNotesResource;
4624
+ /** Sub-tenant management (provision, update, list) */
4625
+ readonly subTenants: SubTenantsResource;
4626
+ /** NF525 fiscal compliance (closings, FEC, attestation) */
4627
+ readonly fiscal: FiscalResource;
4628
+ /** Platform statistics */
4629
+ readonly stats: StatsResource;
4630
+ /** Platform billing (usage, top-up, transactions) */
4631
+ readonly billing: BillingResource;
4632
+ /** Credit notes operations (create, send, download) */
4633
+ readonly creditNotes: TenantCreditNotesResource;
4634
+ /** Tenant invoice operations (create, submit, update, delete) */
4635
+ readonly tenantInvoices: TenantDirectInvoicesResource;
4636
+ /** Incoming invoice operations (list, accept, reject) */
4637
+ readonly incomingInvoices: TenantIncomingInvoicesResource;
4604
4638
  /**
4605
4639
  * Create a new Scell API Client
4606
4640
  *
4607
- * @param apiKey - Your API key (from dashboard)
4641
+ * @param apiKey - Your API key (sk_live_xxx or sk_test_xxx)
4608
4642
  * @param config - Client configuration
4609
4643
  *
4610
4644
  * @example
package/dist/index.d.ts CHANGED
@@ -3925,6 +3925,28 @@ declare class SignaturesResource {
3925
3925
  * ```
3926
3926
  */
3927
3927
  cancel(id: string, requestOptions?: RequestOptions): Promise<MessageResponse>;
3928
+ /**
3929
+ * Get signature audit trail (JSON)
3930
+ *
3931
+ * Returns the complete history of actions on the signature:
3932
+ * creation, delivery, opening, signing, refusal, etc.
3933
+ *
3934
+ * @param id - Signature UUID
3935
+ * @param requestOptions - Request options
3936
+ * @returns Audit trail entries with integrity validation
3937
+ *
3938
+ * @example
3939
+ * ```typescript
3940
+ * const { data: entries, integrity_valid } = await client.signatures.auditTrail(
3941
+ * 'signature-uuid'
3942
+ * );
3943
+ *
3944
+ * if (integrity_valid) {
3945
+ * entries.forEach(e => console.log(e.action, e.created_at));
3946
+ * }
3947
+ * ```
3948
+ */
3949
+ auditTrail(id: string, requestOptions?: RequestOptions): Promise<AuditTrailResponse>;
3928
3950
  }
3929
3951
 
3930
3952
  /**
@@ -4599,12 +4621,24 @@ declare class ScellApiClient {
4599
4621
  readonly invoices: InvoicesResource;
4600
4622
  /** Signature operations (create, download, remind, cancel) */
4601
4623
  readonly signatures: SignaturesResource;
4602
- /** Tenant credit notes operations (create, send, download) */
4603
- readonly tenantCreditNotes: TenantCreditNotesResource;
4624
+ /** Sub-tenant management (provision, update, list) */
4625
+ readonly subTenants: SubTenantsResource;
4626
+ /** NF525 fiscal compliance (closings, FEC, attestation) */
4627
+ readonly fiscal: FiscalResource;
4628
+ /** Platform statistics */
4629
+ readonly stats: StatsResource;
4630
+ /** Platform billing (usage, top-up, transactions) */
4631
+ readonly billing: BillingResource;
4632
+ /** Credit notes operations (create, send, download) */
4633
+ readonly creditNotes: TenantCreditNotesResource;
4634
+ /** Tenant invoice operations (create, submit, update, delete) */
4635
+ readonly tenantInvoices: TenantDirectInvoicesResource;
4636
+ /** Incoming invoice operations (list, accept, reject) */
4637
+ readonly incomingInvoices: TenantIncomingInvoicesResource;
4604
4638
  /**
4605
4639
  * Create a new Scell API Client
4606
4640
  *
4607
- * @param apiKey - Your API key (from dashboard)
4641
+ * @param apiKey - Your API key (sk_live_xxx or sk_test_xxx)
4608
4642
  * @param config - Client configuration
4609
4643
  *
4610
4644
  * @example
package/dist/index.js CHANGED
@@ -2810,6 +2810,34 @@ var SignaturesResource = class {
2810
2810
  requestOptions
2811
2811
  );
2812
2812
  }
2813
+ /**
2814
+ * Get signature audit trail (JSON)
2815
+ *
2816
+ * Returns the complete history of actions on the signature:
2817
+ * creation, delivery, opening, signing, refusal, etc.
2818
+ *
2819
+ * @param id - Signature UUID
2820
+ * @param requestOptions - Request options
2821
+ * @returns Audit trail entries with integrity validation
2822
+ *
2823
+ * @example
2824
+ * ```typescript
2825
+ * const { data: entries, integrity_valid } = await client.signatures.auditTrail(
2826
+ * 'signature-uuid'
2827
+ * );
2828
+ *
2829
+ * if (integrity_valid) {
2830
+ * entries.forEach(e => console.log(e.action, e.created_at));
2831
+ * }
2832
+ * ```
2833
+ */
2834
+ async auditTrail(id, requestOptions) {
2835
+ return this.http.get(
2836
+ `/signatures/${id}/audit-trail`,
2837
+ void 0,
2838
+ requestOptions
2839
+ );
2840
+ }
2813
2841
  };
2814
2842
 
2815
2843
  // src/resources/webhooks.ts
@@ -3214,12 +3242,24 @@ var ScellApiClient = class {
3214
3242
  invoices;
3215
3243
  /** Signature operations (create, download, remind, cancel) */
3216
3244
  signatures;
3217
- /** Tenant credit notes operations (create, send, download) */
3218
- tenantCreditNotes;
3245
+ /** Sub-tenant management (provision, update, list) */
3246
+ subTenants;
3247
+ /** NF525 fiscal compliance (closings, FEC, attestation) */
3248
+ fiscal;
3249
+ /** Platform statistics */
3250
+ stats;
3251
+ /** Platform billing (usage, top-up, transactions) */
3252
+ billing;
3253
+ /** Credit notes operations (create, send, download) */
3254
+ creditNotes;
3255
+ /** Tenant invoice operations (create, submit, update, delete) */
3256
+ tenantInvoices;
3257
+ /** Incoming invoice operations (list, accept, reject) */
3258
+ incomingInvoices;
3219
3259
  /**
3220
3260
  * Create a new Scell API Client
3221
3261
  *
3222
- * @param apiKey - Your API key (from dashboard)
3262
+ * @param apiKey - Your API key (sk_live_xxx or sk_test_xxx)
3223
3263
  * @param config - Client configuration
3224
3264
  *
3225
3265
  * @example
@@ -3237,7 +3277,13 @@ var ScellApiClient = class {
3237
3277
  this.http = new HttpClient("api-key", apiKey, config);
3238
3278
  this.invoices = new InvoicesResource(this.http);
3239
3279
  this.signatures = new SignaturesResource(this.http);
3240
- this.tenantCreditNotes = new TenantCreditNotesResource(this.http);
3280
+ this.subTenants = new SubTenantsResource(this.http);
3281
+ this.fiscal = new FiscalResource(this.http);
3282
+ this.stats = new StatsResource(this.http);
3283
+ this.billing = new BillingResource(this.http);
3284
+ this.creditNotes = new TenantCreditNotesResource(this.http);
3285
+ this.tenantInvoices = new TenantDirectInvoicesResource(this.http);
3286
+ this.incomingInvoices = new TenantIncomingInvoicesResource(this.http);
3241
3287
  }
3242
3288
  };
3243
3289