@deliverart/sdk-js-point-of-sale 2.1.53 → 2.1.55

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 (2) hide show
  1. package/README.md +281 -0
  2. package/package.json +5 -5
package/README.md CHANGED
@@ -0,0 +1,281 @@
1
+ # @deliverart/sdk-js-point-of-sale
2
+
3
+ Point of Sale (POS) management package for the DeliverArt JavaScript SDK. Provides methods for managing points of sale, their users, menu versions, time overrides, and availability times.
4
+
5
+ ## Installation
6
+
7
+ ```bash
8
+ npm install @deliverart/sdk-js-point-of-sale @deliverart/sdk-js-core
9
+ # or
10
+ pnpm add @deliverart/sdk-js-point-of-sale @deliverart/sdk-js-core
11
+ # or
12
+ yarn add @deliverart/sdk-js-point-of-sale @deliverart/sdk-js-core
13
+ ```
14
+
15
+ ## Features
16
+
17
+ - **Points of Sale**: Full CRUD operations for points of sale with advanced filtering
18
+ - **POS Users**: Manage users associated with points of sale
19
+ - **POS Menu Versions**: Retrieve menu versions for specific points of sale
20
+ - **POS Time Overrides**: Manage special opening hours and closures
21
+ - **Availability Times**: Get available delivery and take-away time slots
22
+
23
+ ## Usage
24
+
25
+ ### Points of Sale
26
+
27
+ #### Get Points of Sale
28
+
29
+ ```typescript
30
+ import { GetPointOfSales } from '@deliverart/sdk-js-point-of-sale'
31
+
32
+ const pointsOfSale = await client.call(new GetPointOfSales({
33
+ query: {
34
+ page: 1,
35
+ itemsPerPage: 20,
36
+ company: 'company-iri',
37
+ salesMode: ['delivery', 'pickup'],
38
+ }
39
+ }))
40
+ ```
41
+
42
+ #### Location-Based Search
43
+
44
+ You can filter points of sale by address or by geographic coordinates:
45
+
46
+ ```typescript
47
+ // Filter by address
48
+ const nearby = await client.call(new GetPointOfSales({
49
+ query: {
50
+ address: '123 Main St, New York, NY',
51
+ maxDistance: 5000, // meters
52
+ }
53
+ }))
54
+
55
+ // Filter by coordinates (latitude|longitude)
56
+ const nearbyByCoords = await client.call(new GetPointOfSales({
57
+ query: {
58
+ location: '40.7128|-74.0060', // New York coordinates
59
+ maxDistance: 5000, // meters
60
+ }
61
+ }))
62
+ ```
63
+
64
+ **Note**: Both `address` and `location` are optional. If neither is provided, distance-based filtering will be skipped and all points of sale will be returned (subject to other filters).
65
+
66
+ #### Get Company Points of Sale
67
+
68
+ ```typescript
69
+ import { GetCompanyPointOfSales } from '@deliverart/sdk-js-point-of-sale'
70
+
71
+ const companyPOS = await client.call(new GetCompanyPointOfSales('company-id', {
72
+ query: {
73
+ page: 1,
74
+ itemsPerPage: 20,
75
+ }
76
+ }))
77
+ ```
78
+
79
+ #### Get Point of Sale Details
80
+
81
+ ```typescript
82
+ import { GetPointOfSaleDetails } from '@deliverart/sdk-js-point-of-sale'
83
+
84
+ const pos = await client.call(new GetPointOfSaleDetails('pos-id'))
85
+ ```
86
+
87
+ #### Create Point of Sale
88
+
89
+ ```typescript
90
+ import { CreatePointOfSale } from '@deliverart/sdk-js-point-of-sale'
91
+
92
+ const newPOS = await client.call(new CreatePointOfSale({
93
+ name: [
94
+ { locale: 'en', value: 'Downtown Store' },
95
+ { locale: 'it', value: 'Negozio Centro' }
96
+ ],
97
+ company: '/api/companies/123',
98
+ address: {
99
+ street: '123 Main St',
100
+ city: 'New York',
101
+ postalCode: '10001',
102
+ country: 'US',
103
+ },
104
+ // ... other fields
105
+ }))
106
+ ```
107
+
108
+ #### Update Point of Sale
109
+
110
+ ```typescript
111
+ import { UpdatePointOfSale } from '@deliverart/sdk-js-point-of-sale'
112
+
113
+ const updated = await client.call(new UpdatePointOfSale('pos-id', {
114
+ name: [
115
+ { locale: 'en', value: 'Updated Store Name' }
116
+ ]
117
+ }))
118
+ ```
119
+
120
+ #### Delete Point of Sale
121
+
122
+ ```typescript
123
+ import { DeletePointOfSale } from '@deliverart/sdk-js-point-of-sale'
124
+
125
+ await client.call(new DeletePointOfSale('pos-id'))
126
+ ```
127
+
128
+ ### POS Menu Versions
129
+
130
+ #### Get Point of Sale Menu Versions
131
+
132
+ ```typescript
133
+ import { GetPointOfSaleMenuVersions } from '@deliverart/sdk-js-point-of-sale'
134
+
135
+ const menuVersions = await client.call(new GetPointOfSaleMenuVersions('pos-id', {
136
+ query: {
137
+ page: 1,
138
+ itemsPerPage: 20,
139
+ }
140
+ }))
141
+ ```
142
+
143
+ #### Get Point of Sale Menu Version Details
144
+
145
+ ```typescript
146
+ import { GetPointOfSaleMenuVersionDetails } from '@deliverart/sdk-js-point-of-sale'
147
+
148
+ const menuVersion = await client.call(new GetPointOfSaleMenuVersionDetails('pos-id', 'menu-version-id'))
149
+ ```
150
+
151
+ ### POS Users
152
+
153
+ #### Get Point of Sale Users
154
+
155
+ ```typescript
156
+ import { GetPointOfSaleUsers } from '@deliverart/sdk-js-point-of-sale'
157
+
158
+ const users = await client.call(new GetPointOfSaleUsers({
159
+ query: {
160
+ page: 1,
161
+ itemsPerPage: 20,
162
+ }
163
+ }))
164
+ ```
165
+
166
+ #### Get Point of Sale Users from Point of Sale
167
+
168
+ ```typescript
169
+ import { GetPointOfSaleUsersFromPointOfSale } from '@deliverart/sdk-js-point-of-sale'
170
+
171
+ const users = await client.call(new GetPointOfSaleUsersFromPointOfSale('pos-id', {
172
+ query: {
173
+ page: 1,
174
+ itemsPerPage: 20,
175
+ }
176
+ }))
177
+ ```
178
+
179
+ #### Get Point of Sale Users from User
180
+
181
+ ```typescript
182
+ import { GetPointOfSaleUsersFromUser } from '@deliverart/sdk-js-point-of-sale'
183
+
184
+ const associations = await client.call(new GetPointOfSaleUsersFromUser('user-id', {
185
+ query: {
186
+ page: 1,
187
+ itemsPerPage: 20,
188
+ }
189
+ }))
190
+ ```
191
+
192
+ #### Get Point of Sale User Details
193
+
194
+ ```typescript
195
+ import { GetPointOfSaleUserDetails } from '@deliverart/sdk-js-point-of-sale'
196
+
197
+ const userDetails = await client.call(new GetPointOfSaleUserDetails('pos-user-id'))
198
+ ```
199
+
200
+ #### Update Point of Sale User
201
+
202
+ ```typescript
203
+ import { UpdatePointOfSaleUser } from '@deliverart/sdk-js-point-of-sale'
204
+
205
+ const updated = await client.call(new UpdatePointOfSaleUser('pos-user-id', {
206
+ role: 'manager',
207
+ // ... other fields
208
+ }))
209
+ ```
210
+
211
+ #### Delete Point of Sale User
212
+
213
+ ```typescript
214
+ import { DeletePointOfSaleUser } from '@deliverart/sdk-js-point-of-sale'
215
+
216
+ await client.call(new DeletePointOfSaleUser('pos-user-id'))
217
+ ```
218
+
219
+ ### Availability Times
220
+
221
+ #### Get Available Delivery Times
222
+
223
+ ```typescript
224
+ import { GetAvailablePointOfSaleDeliveryTimes } from '@deliverart/sdk-js-point-of-sale'
225
+
226
+ const deliveryTimes = await client.call(new GetAvailablePointOfSaleDeliveryTimes('pos-id', {
227
+ query: {
228
+ date: '2025-10-18',
229
+ }
230
+ }))
231
+ ```
232
+
233
+ #### Get Available Take-Away Times
234
+
235
+ ```typescript
236
+ import { GetAvailablePointOfSaleTakeAwayTimes } from '@deliverart/sdk-js-point-of-sale'
237
+
238
+ const takeAwayTimes = await client.call(new GetAvailablePointOfSaleTakeAwayTimes('pos-id', {
239
+ query: {
240
+ date: '2025-10-18',
241
+ }
242
+ }))
243
+ ```
244
+
245
+ ### POS Time Overrides
246
+
247
+ Manage special opening hours, closures, and time exceptions for points of sale.
248
+
249
+ ```typescript
250
+ import {
251
+ GetPointOfTimeOverrides,
252
+ GetPointOfTimeOverrideDetails,
253
+ CreatePointOfTimeOverride,
254
+ UpdatePointOfTimeOverride,
255
+ DeletePointOfTimeOverride
256
+ } from '@deliverart/sdk-js-point-of-sale'
257
+
258
+ // Get time overrides
259
+ const overrides = await client.call(new GetPointOfTimeOverrides({
260
+ query: {
261
+ page: 1,
262
+ itemsPerPage: 20,
263
+ pointOfSale: '/api/point-of-sales/123',
264
+ }
265
+ }))
266
+
267
+ // Create a time override (e.g., holiday closure)
268
+ const override = await client.call(new CreatePointOfTimeOverride({
269
+ pointOfSale: '/api/point-of-sales/123',
270
+ date: '2025-12-25',
271
+ closed: true,
272
+ reason: [
273
+ { locale: 'en', value: 'Christmas Day' },
274
+ { locale: 'it', value: 'Natale' }
275
+ ],
276
+ }))
277
+ ```
278
+
279
+ ## License
280
+
281
+ MIT
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@deliverart/sdk-js-point-of-sale",
3
3
  "description": "Deliverart JavaScript SDK for Point of Sale Management",
4
- "version": "2.1.53",
4
+ "version": "2.1.55",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",
7
7
  "types": "dist/index.d.ts",
@@ -18,10 +18,10 @@
18
18
  "dist"
19
19
  ],
20
20
  "dependencies": {
21
- "@deliverart/sdk-js-company": "2.1.53",
22
- "@deliverart/sdk-js-core": "2.1.53",
23
- "@deliverart/sdk-js-global-types": "2.1.53",
24
- "@deliverart/sdk-js-user": "2.1.53"
21
+ "@deliverart/sdk-js-company": "2.1.55",
22
+ "@deliverart/sdk-js-core": "2.1.55",
23
+ "@deliverart/sdk-js-global-types": "2.1.55",
24
+ "@deliverart/sdk-js-user": "2.1.55"
25
25
  },
26
26
  "publishConfig": {
27
27
  "access": "public"