@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.
- package/LICENSE +0 -0
- package/README.md +0 -0
- package/dist/index.d.mts +37 -3
- package/dist/index.d.ts +37 -3
- package/dist/index.js +50 -4
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +50 -4
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
- package/src/client.ts +0 -0
- package/src/errors.ts +0 -0
- package/src/index.ts +28 -4
- package/src/resources/api-keys.ts +0 -0
- package/src/resources/auth.ts +0 -0
- package/src/resources/balance.ts +0 -0
- package/src/resources/billing.ts +0 -0
- package/src/resources/companies.ts +0 -0
- package/src/resources/fiscal.ts +0 -0
- package/src/resources/invoices.ts +0 -0
- package/src/resources/signatures.ts +33 -0
- package/src/resources/stats.ts +0 -0
- package/src/resources/sub-tenants.ts +0 -0
- package/src/resources/tenant-credit-notes.ts +0 -0
- package/src/resources/tenant-direct-credit-notes.ts +0 -0
- package/src/resources/tenant-direct-invoices.ts +0 -0
- package/src/resources/tenant-incoming-invoices.ts +0 -0
- package/src/resources/webhooks.ts +0 -0
- package/src/tenant-client.ts +0 -0
- package/src/types/api-keys.ts +0 -0
- package/src/types/auth.ts +0 -0
- package/src/types/balance.ts +0 -0
- package/src/types/billing.ts +0 -0
- package/src/types/common.ts +0 -0
- package/src/types/companies.ts +0 -0
- package/src/types/fiscal.ts +0 -0
- package/src/types/index.ts +0 -0
- package/src/types/invoices.ts +0 -0
- package/src/types/signatures.ts +0 -0
- package/src/types/stats.ts +0 -0
- package/src/types/sub-tenants.ts +0 -0
- package/src/types/tenant-credit-notes.ts +0 -0
- package/src/types/tenant-invoices.ts +0 -0
- package/src/types/tenant-profile.ts +0 -0
- package/src/types/webhooks.ts +0 -0
- package/src/utils/retry.ts +0 -0
- package/src/utils/webhook-verify.ts +0 -0
package/package.json
CHANGED
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
|
-
/**
|
|
157
|
-
public readonly
|
|
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 (
|
|
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.
|
|
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
|
package/src/resources/auth.ts
CHANGED
|
File without changes
|
package/src/resources/balance.ts
CHANGED
|
File without changes
|
package/src/resources/billing.ts
CHANGED
|
File without changes
|
|
File without changes
|
package/src/resources/fiscal.ts
CHANGED
|
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
|
}
|
package/src/resources/stats.ts
CHANGED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
package/src/tenant-client.ts
CHANGED
|
File without changes
|
package/src/types/api-keys.ts
CHANGED
|
File without changes
|
package/src/types/auth.ts
CHANGED
|
File without changes
|
package/src/types/balance.ts
CHANGED
|
File without changes
|
package/src/types/billing.ts
CHANGED
|
File without changes
|
package/src/types/common.ts
CHANGED
|
File without changes
|
package/src/types/companies.ts
CHANGED
|
File without changes
|
package/src/types/fiscal.ts
CHANGED
|
File without changes
|
package/src/types/index.ts
CHANGED
|
File without changes
|
package/src/types/invoices.ts
CHANGED
|
File without changes
|
package/src/types/signatures.ts
CHANGED
|
File without changes
|
package/src/types/stats.ts
CHANGED
|
File without changes
|
package/src/types/sub-tenants.ts
CHANGED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
package/src/types/webhooks.ts
CHANGED
|
File without changes
|
package/src/utils/retry.ts
CHANGED
|
File without changes
|
|
File without changes
|