@deliverart/sdk-js-lead 2.20.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/README.md ADDED
@@ -0,0 +1,68 @@
1
+ # @deliverart/sdk-js-lead
2
+
3
+ Lead management package for the DeliverArt JavaScript SDK.
4
+
5
+ ## Installation
6
+
7
+ ```bash
8
+ npm install @deliverart/sdk-js-lead @deliverart/sdk-js-core
9
+ ```
10
+
11
+ ## Available Requests
12
+
13
+ - `GetLeads`
14
+ - `CreateLead`
15
+ - `GetLeadDetails`
16
+ - `UpdateLead`
17
+ - `DeleteLead`
18
+ - `InitializeLead`
19
+ - `GenerateLeadApiToken`
20
+
21
+ ## Usage
22
+
23
+ ```typescript
24
+ import { CreateLead, GetLeads, InitializeLead } from '@deliverart/sdk-js-lead'
25
+
26
+ const lead = await sdk.call(
27
+ new CreateLead({
28
+ email: 'owner@example.com',
29
+ firstName: 'Mario',
30
+ lastName: 'Rossi',
31
+ businessName: 'Pizzeria Rossi SRL',
32
+ posName: 'Pizzeria Rossi',
33
+ vat: 'IT12345678901',
34
+ billingAddress: {
35
+ line1: 'Via Roma 1',
36
+ city: 'Milano',
37
+ region: 'MI',
38
+ postalCode: '20121',
39
+ country: 'IT',
40
+ },
41
+ posAddress: {
42
+ line1: 'Via Roma 1',
43
+ city: 'Milano',
44
+ region: 'MI',
45
+ postalCode: '20121',
46
+ country: 'IT',
47
+ },
48
+ billingData: {
49
+ pec: 'amministrazione@pec.example.it',
50
+ },
51
+ }),
52
+ )
53
+
54
+ const leads = await sdk.call(
55
+ new GetLeads({
56
+ query: {
57
+ status: 'pending',
58
+ 'order[createdAt]': 'desc',
59
+ },
60
+ }),
61
+ )
62
+
63
+ const initialized = await sdk.call(
64
+ new InitializeLead(lead.id, {
65
+ convertLeadIntegrations: true,
66
+ }),
67
+ )
68
+ ```