@deliverart/sdk-js-user 0.0.0-dev-20260721002647
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 +182 -0
- package/dist/index.cjs +441 -0
- package/dist/index.d.cts +1414 -0
- package/dist/index.d.ts +1414 -0
- package/dist/index.js +372 -0
- package/package.json +32 -0
package/README.md
ADDED
|
@@ -0,0 +1,182 @@
|
|
|
1
|
+
# @deliverart/sdk-js-user
|
|
2
|
+
|
|
3
|
+
User management package for the DeliverArt JavaScript SDK.
|
|
4
|
+
|
|
5
|
+
## Installation
|
|
6
|
+
|
|
7
|
+
```bash
|
|
8
|
+
npm install @deliverart/sdk-js-user @deliverart/sdk-js-core
|
|
9
|
+
```
|
|
10
|
+
|
|
11
|
+
## Exported Types
|
|
12
|
+
|
|
13
|
+
### Core Types
|
|
14
|
+
- `User` - User information
|
|
15
|
+
- `UserDetails` - Extended user with roles and permissions
|
|
16
|
+
- `UserRole` - User role type
|
|
17
|
+
|
|
18
|
+
### User Role Types
|
|
19
|
+
```typescript
|
|
20
|
+
type UserRole =
|
|
21
|
+
| 'ROLE_ADMIN'
|
|
22
|
+
| 'ROLE_COMPANY_ADMIN'
|
|
23
|
+
| 'ROLE_MANAGER'
|
|
24
|
+
| 'ROLE_STAFF'
|
|
25
|
+
| 'ROLE_DRIVER'
|
|
26
|
+
| 'ROLE_CUSTOMER'
|
|
27
|
+
| 'ROLE_ECOMMERCE_CUSTOMER'
|
|
28
|
+
```
|
|
29
|
+
|
|
30
|
+
### IRI Types
|
|
31
|
+
- `UserIri` - User IRI (`/users/:id`)
|
|
32
|
+
|
|
33
|
+
## Available Requests
|
|
34
|
+
|
|
35
|
+
### CreateUser
|
|
36
|
+
```typescript
|
|
37
|
+
import { CreateUser } from '@deliverart/sdk-js-user';
|
|
38
|
+
|
|
39
|
+
const user = await sdk.call(new CreateUser({
|
|
40
|
+
email: 'user@example.com',
|
|
41
|
+
password: 'securePassword123',
|
|
42
|
+
firstName: 'John',
|
|
43
|
+
lastName: 'Doe',
|
|
44
|
+
roles: ['ROLE_STAFF'],
|
|
45
|
+
company: '/companies/123'
|
|
46
|
+
}));
|
|
47
|
+
```
|
|
48
|
+
|
|
49
|
+
**Input Parameters:**
|
|
50
|
+
- `email: string` (required) - Email address
|
|
51
|
+
- `password: string` (required) - Password
|
|
52
|
+
- `firstName: string` (required) - First name
|
|
53
|
+
- `lastName: string` (required) - Last name
|
|
54
|
+
- `roles: UserRole[]` (required) - User roles
|
|
55
|
+
- `company?: string` (optional) - Company IRI
|
|
56
|
+
- `phoneNumber?: string` (optional) - Phone number
|
|
57
|
+
|
|
58
|
+
---
|
|
59
|
+
|
|
60
|
+
### GetUsers
|
|
61
|
+
```typescript
|
|
62
|
+
import { GetUsers } from '@deliverart/sdk-js-user';
|
|
63
|
+
|
|
64
|
+
const users = await sdk.call(new GetUsers({
|
|
65
|
+
query: {
|
|
66
|
+
'roles[]': ['ROLE_STAFF', 'ROLE_MANAGER'],
|
|
67
|
+
company: '/companies/123',
|
|
68
|
+
page: 1
|
|
69
|
+
}
|
|
70
|
+
}));
|
|
71
|
+
```
|
|
72
|
+
|
|
73
|
+
**Query Parameters:**
|
|
74
|
+
- `email?: string` - Filter by email
|
|
75
|
+
- `roles[]?: UserRole[]` - Filter by roles
|
|
76
|
+
- `company?: string` - Filter by company
|
|
77
|
+
- `page?: number` - Page number
|
|
78
|
+
|
|
79
|
+
---
|
|
80
|
+
|
|
81
|
+
### GetUserDetails
|
|
82
|
+
```typescript
|
|
83
|
+
import { GetUserDetails } from '@deliverart/sdk-js-user';
|
|
84
|
+
|
|
85
|
+
const user = await sdk.call(new GetUserDetails('user-123'));
|
|
86
|
+
```
|
|
87
|
+
|
|
88
|
+
---
|
|
89
|
+
|
|
90
|
+
### UpdateUser
|
|
91
|
+
```typescript
|
|
92
|
+
import { UpdateUser } from '@deliverart/sdk-js-user';
|
|
93
|
+
|
|
94
|
+
const updated = await sdk.call(new UpdateUser('user-123', {
|
|
95
|
+
firstName: 'Jane',
|
|
96
|
+
roles: ['ROLE_MANAGER']
|
|
97
|
+
}));
|
|
98
|
+
```
|
|
99
|
+
|
|
100
|
+
---
|
|
101
|
+
|
|
102
|
+
### DeleteUser
|
|
103
|
+
```typescript
|
|
104
|
+
import { DeleteUser } from '@deliverart/sdk-js-user';
|
|
105
|
+
|
|
106
|
+
await sdk.call(new DeleteUser('user-123'));
|
|
107
|
+
```
|
|
108
|
+
|
|
109
|
+
---
|
|
110
|
+
|
|
111
|
+
### Current User Email Verification
|
|
112
|
+
```typescript
|
|
113
|
+
import {
|
|
114
|
+
SendCurrentUserEmailVerificationCode,
|
|
115
|
+
VerifyCurrentUserEmailVerificationCode
|
|
116
|
+
} from '@deliverart/sdk-js-user';
|
|
117
|
+
|
|
118
|
+
await sdk.call(new SendCurrentUserEmailVerificationCode());
|
|
119
|
+
|
|
120
|
+
const status = await sdk.call(new VerifyCurrentUserEmailVerificationCode({
|
|
121
|
+
code: '123456'
|
|
122
|
+
}));
|
|
123
|
+
```
|
|
124
|
+
|
|
125
|
+
Use these requests for first-party ecommerce customer accounts. The API sends a six-digit email code and returns the verification status, cooldown, expiry, and remaining attempts.
|
|
126
|
+
|
|
127
|
+
For pending ecommerce registrations that are not logged in yet, call the email-scoped requests with a server-side registration token. Do this only from a backend/BFF boundary; the registration token must never be exposed to browser code:
|
|
128
|
+
|
|
129
|
+
```typescript
|
|
130
|
+
import {
|
|
131
|
+
SendEmailVerificationCodeByEmail,
|
|
132
|
+
VerifyEmailVerificationCodeByEmail
|
|
133
|
+
} from '@deliverart/sdk-js-user';
|
|
134
|
+
|
|
135
|
+
await sdk.call(new SendEmailVerificationCodeByEmail({
|
|
136
|
+
email: 'customer@example.com'
|
|
137
|
+
}));
|
|
138
|
+
|
|
139
|
+
const status = await sdk.call(new VerifyEmailVerificationCodeByEmail({
|
|
140
|
+
email: 'customer@example.com',
|
|
141
|
+
code: '123456'
|
|
142
|
+
}));
|
|
143
|
+
```
|
|
144
|
+
|
|
145
|
+
---
|
|
146
|
+
|
|
147
|
+
## Complete Usage Example
|
|
148
|
+
|
|
149
|
+
```typescript
|
|
150
|
+
import { sdk } from './lib/sdk';
|
|
151
|
+
import { CreateUser, GetUsers, UpdateUser } from '@deliverart/sdk-js-user';
|
|
152
|
+
|
|
153
|
+
async function userManagement() {
|
|
154
|
+
// Create staff user
|
|
155
|
+
const staff = await sdk.call(new CreateUser({
|
|
156
|
+
email: 'staff@restaurant.com',
|
|
157
|
+
password: 'tempPassword123',
|
|
158
|
+
firstName: 'Mario',
|
|
159
|
+
lastName: 'Rossi',
|
|
160
|
+
roles: ['ROLE_STAFF'],
|
|
161
|
+
company: '/companies/123',
|
|
162
|
+
phoneNumber: '+39123456789'
|
|
163
|
+
}));
|
|
164
|
+
|
|
165
|
+
// Get all staff members
|
|
166
|
+
const staffMembers = await sdk.call(new GetUsers({
|
|
167
|
+
query: {
|
|
168
|
+
'roles[]': ['ROLE_STAFF'],
|
|
169
|
+
company: '/companies/123'
|
|
170
|
+
}
|
|
171
|
+
}));
|
|
172
|
+
|
|
173
|
+
// Promote to manager
|
|
174
|
+
await sdk.call(new UpdateUser(staff.id, {
|
|
175
|
+
roles: ['ROLE_MANAGER']
|
|
176
|
+
}));
|
|
177
|
+
}
|
|
178
|
+
```
|
|
179
|
+
|
|
180
|
+
## License
|
|
181
|
+
|
|
182
|
+
MIT
|
package/dist/index.cjs
ADDED
|
@@ -0,0 +1,441 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
+
var __export = (target, all) => {
|
|
7
|
+
for (var name in all)
|
|
8
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
9
|
+
};
|
|
10
|
+
var __copyProps = (to, from, except, desc) => {
|
|
11
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
12
|
+
for (let key of __getOwnPropNames(from))
|
|
13
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
14
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
15
|
+
}
|
|
16
|
+
return to;
|
|
17
|
+
};
|
|
18
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
|
+
|
|
20
|
+
// src/index.ts
|
|
21
|
+
var index_exports = {};
|
|
22
|
+
__export(index_exports, {
|
|
23
|
+
CreateUser: () => CreateUser,
|
|
24
|
+
DeleteUser: () => DeleteUser,
|
|
25
|
+
GetMe: () => GetMe,
|
|
26
|
+
GetUserDetails: () => GetUserDetails,
|
|
27
|
+
GetUsers: () => GetUsers,
|
|
28
|
+
SendCurrentUserEmailVerificationCode: () => SendCurrentUserEmailVerificationCode,
|
|
29
|
+
SendEmailVerificationCodeByEmail: () => SendEmailVerificationCodeByEmail,
|
|
30
|
+
UpdateUser: () => UpdateUser,
|
|
31
|
+
VerifyCurrentUserEmailVerificationCode: () => VerifyCurrentUserEmailVerificationCode,
|
|
32
|
+
VerifyEmailVerificationCodeByEmail: () => VerifyEmailVerificationCodeByEmail,
|
|
33
|
+
createUserInputSchema: () => createUserInputSchema,
|
|
34
|
+
createUserResponseSchema: () => createUserResponseSchema,
|
|
35
|
+
deleteUserInputSchema: () => deleteUserInputSchema,
|
|
36
|
+
deleteUserResponseSchema: () => deleteUserResponseSchema,
|
|
37
|
+
emailVerificationCodeStatusSchema: () => emailVerificationCodeStatusSchema,
|
|
38
|
+
getMeInputSchema: () => getMeInputSchema,
|
|
39
|
+
getMeResponseSchema: () => getMeResponseSchema,
|
|
40
|
+
getUserDetailsInputSchema: () => getUserDetailsInputSchema,
|
|
41
|
+
getUserDetailsResponseSchema: () => getUserDetailsResponseSchema,
|
|
42
|
+
getUsersInputSchema: () => getUsersInputSchema,
|
|
43
|
+
getUsersQuerySchema: () => getUsersQuerySchema,
|
|
44
|
+
getUsersResponseSchema: () => getUsersResponseSchema,
|
|
45
|
+
securityRoleSchema: () => securityRoleSchema,
|
|
46
|
+
securityRoles: () => securityRoles,
|
|
47
|
+
sendCurrentUserEmailVerificationCodeInputSchema: () => sendCurrentUserEmailVerificationCodeInputSchema,
|
|
48
|
+
sendCurrentUserEmailVerificationCodeResponseSchema: () => sendCurrentUserEmailVerificationCodeResponseSchema,
|
|
49
|
+
sendEmailVerificationCodeByEmailInputSchema: () => sendEmailVerificationCodeByEmailInputSchema,
|
|
50
|
+
sendEmailVerificationCodeByEmailResponseSchema: () => sendEmailVerificationCodeByEmailResponseSchema,
|
|
51
|
+
updateUserInputSchema: () => updateUserInputSchema,
|
|
52
|
+
updateUserResponseSchema: () => updateUserResponseSchema,
|
|
53
|
+
userIriSchema: () => userIriSchema,
|
|
54
|
+
userNullableIriSchema: () => userNullableIriSchema,
|
|
55
|
+
userPreferredLocaleSchema: () => userPreferredLocaleSchema,
|
|
56
|
+
userPreferredLocales: () => userPreferredLocales,
|
|
57
|
+
userSchema: () => userSchema,
|
|
58
|
+
userStepSchema: () => userStepSchema,
|
|
59
|
+
userSteps: () => userSteps,
|
|
60
|
+
usersQuerySchema: () => usersQuerySchema,
|
|
61
|
+
verifyCurrentUserEmailVerificationCodeInputSchema: () => verifyCurrentUserEmailVerificationCodeInputSchema,
|
|
62
|
+
verifyCurrentUserEmailVerificationCodeResponseSchema: () => verifyCurrentUserEmailVerificationCodeResponseSchema,
|
|
63
|
+
verifyEmailVerificationCodeByEmailInputSchema: () => verifyEmailVerificationCodeByEmailInputSchema,
|
|
64
|
+
verifyEmailVerificationCodeByEmailResponseSchema: () => verifyEmailVerificationCodeByEmailResponseSchema,
|
|
65
|
+
writableUserSchema: () => writableUserSchema
|
|
66
|
+
});
|
|
67
|
+
module.exports = __toCommonJS(index_exports);
|
|
68
|
+
|
|
69
|
+
// src/models.ts
|
|
70
|
+
var import_sdk_js_global_types2 = require("@deliverart/sdk-js-global-types");
|
|
71
|
+
var import_zod2 = require("zod");
|
|
72
|
+
|
|
73
|
+
// src/types.ts
|
|
74
|
+
var import_sdk_js_global_types = require("@deliverart/sdk-js-global-types");
|
|
75
|
+
var import_zod = require("zod");
|
|
76
|
+
var securityRoles = [
|
|
77
|
+
// Role used for describe single operations
|
|
78
|
+
"ROLE_CUSTOMER_ACCESS",
|
|
79
|
+
"ROLE_BUNDLE_ACCESS",
|
|
80
|
+
"ROLE_DELIVERY_ACCESS",
|
|
81
|
+
"ROLE_POINT_OF_SALE_ACCESS",
|
|
82
|
+
"ROLE_MENU_ACCESS",
|
|
83
|
+
"ROLE_INTEGRATION_ACCESS",
|
|
84
|
+
"ROLE_ORDER_ACCESS",
|
|
85
|
+
"ROLE_LEAD_ACCESS",
|
|
86
|
+
"ROLE_COMPANY_ACCESS",
|
|
87
|
+
"ROLE_USER_ACCESS",
|
|
88
|
+
"ROLE_SUBSCRIPTION_ACCESS",
|
|
89
|
+
"ROLE_PAYMENT_ACCESS",
|
|
90
|
+
"ROLE_PAYMENT_CONFIG_ACCESS",
|
|
91
|
+
"ROLE_STATS_ACCESS",
|
|
92
|
+
"ROLE_DEV_ACCESS",
|
|
93
|
+
// Role ADMIN for single operations
|
|
94
|
+
"ROLE_CUSTOMER_ADMIN",
|
|
95
|
+
"ROLE_BUNDLE_ADMIN",
|
|
96
|
+
"ROLE_DELIVERY_ADMIN",
|
|
97
|
+
"ROLE_POINT_OF_SALE_ADMIN",
|
|
98
|
+
"ROLE_MENU_ADMIN",
|
|
99
|
+
"ROLE_INTEGRATION_ADMIN",
|
|
100
|
+
"ROLE_ORDER_ADMIN",
|
|
101
|
+
"ROLE_LEAD_ADMIN",
|
|
102
|
+
"ROLE_COMPANY_ADMIN",
|
|
103
|
+
"ROLE_USER_ADMIN",
|
|
104
|
+
"ROLE_SUBSCRIPTION_ADMIN",
|
|
105
|
+
"ROLE_PAYMENT_ADMIN",
|
|
106
|
+
"ROLE_PAYMENT_CONFIG_ADMIN",
|
|
107
|
+
"ROLE_STATS_ADMIN",
|
|
108
|
+
"ROLE_DEV_ADMIN",
|
|
109
|
+
// Role for the users
|
|
110
|
+
"ROLE_COURIER",
|
|
111
|
+
"ROLE_CUSTOMER",
|
|
112
|
+
"ROLE_ECOMMERCE_CUSTOMER",
|
|
113
|
+
"ROLE_MANAGER",
|
|
114
|
+
"ROLE_SUPER_ADMIN",
|
|
115
|
+
"ROLE_KITCHEN",
|
|
116
|
+
// Default user role
|
|
117
|
+
"ROLE_USER"
|
|
118
|
+
];
|
|
119
|
+
var securityRoleSchema = import_zod.z.enum(securityRoles);
|
|
120
|
+
var userSteps = [
|
|
121
|
+
"registration",
|
|
122
|
+
"verify_email",
|
|
123
|
+
"create_company",
|
|
124
|
+
"create_point_of_sale"
|
|
125
|
+
];
|
|
126
|
+
var userStepSchema = import_zod.z.enum(userSteps);
|
|
127
|
+
var userPreferredLocales = ["it", "en"];
|
|
128
|
+
var userPreferredLocaleSchema = import_zod.z.enum(userPreferredLocales);
|
|
129
|
+
var userIriSchema = (0, import_sdk_js_global_types.iriSchema)("/users/:id");
|
|
130
|
+
var userNullableIriSchema = (0, import_sdk_js_global_types.iriNullableSchema)("/users/:id");
|
|
131
|
+
|
|
132
|
+
// src/models.ts
|
|
133
|
+
var userSchema = import_zod2.z.object({
|
|
134
|
+
id: import_zod2.z.string(),
|
|
135
|
+
firstName: import_zod2.z.string(),
|
|
136
|
+
lastName: import_zod2.z.string(),
|
|
137
|
+
email: import_zod2.z.email(),
|
|
138
|
+
preferredLocale: userPreferredLocaleSchema,
|
|
139
|
+
roles: securityRoleSchema.array(),
|
|
140
|
+
completedSteps: userStepSchema.array(),
|
|
141
|
+
emailVerified: import_zod2.z.boolean(),
|
|
142
|
+
suspended: import_zod2.z.boolean(),
|
|
143
|
+
createdAt: import_sdk_js_global_types2.datetimeSchema,
|
|
144
|
+
updatedAt: import_sdk_js_global_types2.datetimeSchema
|
|
145
|
+
});
|
|
146
|
+
var writableUserSchema = userSchema.pick({
|
|
147
|
+
firstName: true,
|
|
148
|
+
lastName: true,
|
|
149
|
+
roles: true,
|
|
150
|
+
email: true,
|
|
151
|
+
preferredLocale: true
|
|
152
|
+
}).extend({
|
|
153
|
+
plainPassword: import_zod2.z.string().optional()
|
|
154
|
+
}).partial();
|
|
155
|
+
var emailVerificationCodeStatusSchema = import_zod2.z.object({
|
|
156
|
+
email: import_zod2.z.email().nullable(),
|
|
157
|
+
emailVerified: import_zod2.z.boolean(),
|
|
158
|
+
expiresInSeconds: import_zod2.z.number().int().nullable(),
|
|
159
|
+
cooldownSeconds: import_zod2.z.number().int(),
|
|
160
|
+
remainingAttempts: import_zod2.z.number().int()
|
|
161
|
+
});
|
|
162
|
+
var usersQuerySchema = import_zod2.z.object({
|
|
163
|
+
email: import_zod2.z.string().optional(),
|
|
164
|
+
firstName: import_zod2.z.string().optional(),
|
|
165
|
+
lastName: import_zod2.z.string().optional(),
|
|
166
|
+
suspended: import_zod2.z.string().optional(),
|
|
167
|
+
"order[createdAt]": import_zod2.z.enum(["asc", "desc"]).optional(),
|
|
168
|
+
page: import_zod2.z.coerce.number().optional(),
|
|
169
|
+
roles: import_zod2.z.array(import_zod2.z.enum(securityRoles)).optional()
|
|
170
|
+
});
|
|
171
|
+
|
|
172
|
+
// src/requests/CreateUser.ts
|
|
173
|
+
var import_sdk_js_core = require("@deliverart/sdk-js-core");
|
|
174
|
+
var createUserInputSchema = writableUserSchema.required();
|
|
175
|
+
var createUserResponseSchema = userSchema;
|
|
176
|
+
var CreateUser = class extends import_sdk_js_core.AbstractApiRequest {
|
|
177
|
+
constructor(input) {
|
|
178
|
+
super(input);
|
|
179
|
+
this.method = "POST";
|
|
180
|
+
this.contentType = "application/json";
|
|
181
|
+
this.accept = "application/json";
|
|
182
|
+
this.inputSchema = createUserInputSchema;
|
|
183
|
+
this.outputSchema = createUserResponseSchema;
|
|
184
|
+
this.querySchema = void 0;
|
|
185
|
+
this.headersSchema = void 0;
|
|
186
|
+
}
|
|
187
|
+
getPath() {
|
|
188
|
+
return "/users";
|
|
189
|
+
}
|
|
190
|
+
};
|
|
191
|
+
|
|
192
|
+
// src/requests/DeleteUser.ts
|
|
193
|
+
var import_sdk_js_core2 = require("@deliverart/sdk-js-core");
|
|
194
|
+
var import_sdk_js_global_types3 = require("@deliverart/sdk-js-global-types");
|
|
195
|
+
var import_zod3 = require("zod");
|
|
196
|
+
var deleteUserInputSchema = import_zod3.z.undefined();
|
|
197
|
+
var deleteUserResponseSchema = import_sdk_js_global_types3.emptyResponseSchema;
|
|
198
|
+
var DeleteUser = class extends import_sdk_js_core2.AbstractApiRequest {
|
|
199
|
+
constructor(userId) {
|
|
200
|
+
super(void 0);
|
|
201
|
+
this.method = "DELETE";
|
|
202
|
+
this.contentType = "application/json";
|
|
203
|
+
this.accept = "application/json";
|
|
204
|
+
this.inputSchema = deleteUserInputSchema;
|
|
205
|
+
this.outputSchema = deleteUserResponseSchema;
|
|
206
|
+
this.querySchema = void 0;
|
|
207
|
+
this.headersSchema = void 0;
|
|
208
|
+
this.userId = userId;
|
|
209
|
+
}
|
|
210
|
+
getPath() {
|
|
211
|
+
return `/users/${this.userId}`;
|
|
212
|
+
}
|
|
213
|
+
};
|
|
214
|
+
|
|
215
|
+
// src/requests/GetMe.ts
|
|
216
|
+
var import_sdk_js_core3 = require("@deliverart/sdk-js-core");
|
|
217
|
+
var import_zod4 = require("zod");
|
|
218
|
+
var getMeInputSchema = import_zod4.z.undefined();
|
|
219
|
+
var getMeResponseSchema = userSchema;
|
|
220
|
+
var GetMe = class extends import_sdk_js_core3.AbstractApiRequest {
|
|
221
|
+
constructor() {
|
|
222
|
+
super(void 0);
|
|
223
|
+
this.method = "GET";
|
|
224
|
+
this.contentType = "application/json";
|
|
225
|
+
this.accept = "application/json";
|
|
226
|
+
this.inputSchema = getMeInputSchema;
|
|
227
|
+
this.outputSchema = getMeResponseSchema;
|
|
228
|
+
this.querySchema = void 0;
|
|
229
|
+
this.headersSchema = void 0;
|
|
230
|
+
}
|
|
231
|
+
getPath() {
|
|
232
|
+
return "/me";
|
|
233
|
+
}
|
|
234
|
+
};
|
|
235
|
+
|
|
236
|
+
// src/requests/GetUserDetails.ts
|
|
237
|
+
var import_sdk_js_core4 = require("@deliverart/sdk-js-core");
|
|
238
|
+
var import_zod5 = require("zod");
|
|
239
|
+
var getUserDetailsInputSchema = import_zod5.z.undefined();
|
|
240
|
+
var getUserDetailsResponseSchema = userSchema;
|
|
241
|
+
var GetUserDetails = class extends import_sdk_js_core4.AbstractApiRequest {
|
|
242
|
+
constructor(userId) {
|
|
243
|
+
super(void 0);
|
|
244
|
+
this.method = "GET";
|
|
245
|
+
this.contentType = "application/json";
|
|
246
|
+
this.accept = "application/json";
|
|
247
|
+
this.inputSchema = getUserDetailsInputSchema;
|
|
248
|
+
this.outputSchema = getUserDetailsResponseSchema;
|
|
249
|
+
this.querySchema = void 0;
|
|
250
|
+
this.headersSchema = void 0;
|
|
251
|
+
this.userId = userId;
|
|
252
|
+
}
|
|
253
|
+
getPath() {
|
|
254
|
+
return `/users/${this.userId}`;
|
|
255
|
+
}
|
|
256
|
+
};
|
|
257
|
+
|
|
258
|
+
// src/requests/GetUsers.ts
|
|
259
|
+
var import_sdk_js_core5 = require("@deliverart/sdk-js-core");
|
|
260
|
+
var import_sdk_js_global_types4 = require("@deliverart/sdk-js-global-types");
|
|
261
|
+
var import_zod6 = require("zod");
|
|
262
|
+
var getUsersQuerySchema = usersQuerySchema;
|
|
263
|
+
var getUsersInputSchema = import_zod6.z.undefined();
|
|
264
|
+
var getUsersResponseSchema = (0, import_sdk_js_global_types4.createPaginatedSchema)(userSchema);
|
|
265
|
+
var GetUsers = class extends import_sdk_js_core5.AbstractApiRequest {
|
|
266
|
+
constructor(options) {
|
|
267
|
+
super(void 0, options);
|
|
268
|
+
this.method = "GET";
|
|
269
|
+
this.contentType = "application/json";
|
|
270
|
+
this.accept = "application/json";
|
|
271
|
+
this.inputSchema = getUsersInputSchema;
|
|
272
|
+
this.outputSchema = getUsersResponseSchema;
|
|
273
|
+
this.querySchema = getUsersQuerySchema;
|
|
274
|
+
this.headersSchema = void 0;
|
|
275
|
+
// Declare list behavior
|
|
276
|
+
this.listItemSchema = userSchema;
|
|
277
|
+
this.paginationDefaultEnabled = true;
|
|
278
|
+
}
|
|
279
|
+
getPath() {
|
|
280
|
+
return "/users";
|
|
281
|
+
}
|
|
282
|
+
};
|
|
283
|
+
|
|
284
|
+
// src/requests/SendCurrentUserEmailVerificationCode.ts
|
|
285
|
+
var import_sdk_js_core6 = require("@deliverart/sdk-js-core");
|
|
286
|
+
var import_zod7 = require("zod");
|
|
287
|
+
var sendCurrentUserEmailVerificationCodeInputSchema = import_zod7.z.undefined();
|
|
288
|
+
var sendCurrentUserEmailVerificationCodeResponseSchema = emailVerificationCodeStatusSchema;
|
|
289
|
+
var SendCurrentUserEmailVerificationCode = class extends import_sdk_js_core6.AbstractApiRequest {
|
|
290
|
+
constructor() {
|
|
291
|
+
super(void 0);
|
|
292
|
+
this.method = "POST";
|
|
293
|
+
this.contentType = "application/json";
|
|
294
|
+
this.accept = "application/json";
|
|
295
|
+
this.inputSchema = sendCurrentUserEmailVerificationCodeInputSchema;
|
|
296
|
+
this.outputSchema = sendCurrentUserEmailVerificationCodeResponseSchema;
|
|
297
|
+
this.querySchema = void 0;
|
|
298
|
+
this.headersSchema = void 0;
|
|
299
|
+
}
|
|
300
|
+
getPath() {
|
|
301
|
+
return "/users/me/email-verification/send";
|
|
302
|
+
}
|
|
303
|
+
};
|
|
304
|
+
|
|
305
|
+
// src/requests/SendEmailVerificationCodeByEmail.ts
|
|
306
|
+
var import_sdk_js_core7 = require("@deliverart/sdk-js-core");
|
|
307
|
+
var import_zod8 = require("zod");
|
|
308
|
+
var sendEmailVerificationCodeByEmailInputSchema = import_zod8.z.object({
|
|
309
|
+
email: import_zod8.z.email(),
|
|
310
|
+
enforceCooldown: import_zod8.z.boolean().optional()
|
|
311
|
+
});
|
|
312
|
+
var sendEmailVerificationCodeByEmailResponseSchema = emailVerificationCodeStatusSchema;
|
|
313
|
+
var SendEmailVerificationCodeByEmail = class extends import_sdk_js_core7.AbstractApiRequest {
|
|
314
|
+
constructor(input) {
|
|
315
|
+
super(input);
|
|
316
|
+
this.method = "POST";
|
|
317
|
+
this.contentType = "application/json";
|
|
318
|
+
this.accept = "application/json";
|
|
319
|
+
this.inputSchema = sendEmailVerificationCodeByEmailInputSchema;
|
|
320
|
+
this.outputSchema = sendEmailVerificationCodeByEmailResponseSchema;
|
|
321
|
+
this.querySchema = void 0;
|
|
322
|
+
this.headersSchema = void 0;
|
|
323
|
+
}
|
|
324
|
+
getPath() {
|
|
325
|
+
return "/users/email-verification/send";
|
|
326
|
+
}
|
|
327
|
+
};
|
|
328
|
+
|
|
329
|
+
// src/requests/UpdateUser.ts
|
|
330
|
+
var import_sdk_js_core8 = require("@deliverart/sdk-js-core");
|
|
331
|
+
var updateUserInputSchema = writableUserSchema;
|
|
332
|
+
var updateUserResponseSchema = userSchema;
|
|
333
|
+
var UpdateUser = class extends import_sdk_js_core8.AbstractApiRequest {
|
|
334
|
+
constructor(userId, input) {
|
|
335
|
+
super(input);
|
|
336
|
+
this.method = "PATCH";
|
|
337
|
+
this.contentType = "application/merge-patch+json";
|
|
338
|
+
this.accept = "application/json";
|
|
339
|
+
this.inputSchema = updateUserInputSchema;
|
|
340
|
+
this.outputSchema = updateUserResponseSchema;
|
|
341
|
+
this.querySchema = void 0;
|
|
342
|
+
this.headersSchema = void 0;
|
|
343
|
+
this.userId = userId;
|
|
344
|
+
}
|
|
345
|
+
getPath() {
|
|
346
|
+
return `/users/${this.userId}`;
|
|
347
|
+
}
|
|
348
|
+
};
|
|
349
|
+
|
|
350
|
+
// src/requests/VerifyCurrentUserEmailVerificationCode.ts
|
|
351
|
+
var import_sdk_js_core9 = require("@deliverart/sdk-js-core");
|
|
352
|
+
var import_zod9 = require("zod");
|
|
353
|
+
var verifyCurrentUserEmailVerificationCodeInputSchema = import_zod9.z.object({
|
|
354
|
+
code: import_zod9.z.string().regex(/^\d{6}$/)
|
|
355
|
+
});
|
|
356
|
+
var verifyCurrentUserEmailVerificationCodeResponseSchema = emailVerificationCodeStatusSchema;
|
|
357
|
+
var VerifyCurrentUserEmailVerificationCode = class extends import_sdk_js_core9.AbstractApiRequest {
|
|
358
|
+
constructor(input) {
|
|
359
|
+
super(input);
|
|
360
|
+
this.method = "POST";
|
|
361
|
+
this.contentType = "application/json";
|
|
362
|
+
this.accept = "application/json";
|
|
363
|
+
this.inputSchema = verifyCurrentUserEmailVerificationCodeInputSchema;
|
|
364
|
+
this.outputSchema = verifyCurrentUserEmailVerificationCodeResponseSchema;
|
|
365
|
+
this.querySchema = void 0;
|
|
366
|
+
this.headersSchema = void 0;
|
|
367
|
+
}
|
|
368
|
+
getPath() {
|
|
369
|
+
return "/users/me/email-verification/verify";
|
|
370
|
+
}
|
|
371
|
+
};
|
|
372
|
+
|
|
373
|
+
// src/requests/VerifyEmailVerificationCodeByEmail.ts
|
|
374
|
+
var import_sdk_js_core10 = require("@deliverart/sdk-js-core");
|
|
375
|
+
var import_zod10 = require("zod");
|
|
376
|
+
var verifyEmailVerificationCodeByEmailInputSchema = import_zod10.z.object({
|
|
377
|
+
email: import_zod10.z.email(),
|
|
378
|
+
code: import_zod10.z.string().regex(/^\d{6}$/)
|
|
379
|
+
});
|
|
380
|
+
var verifyEmailVerificationCodeByEmailResponseSchema = emailVerificationCodeStatusSchema;
|
|
381
|
+
var VerifyEmailVerificationCodeByEmail = class extends import_sdk_js_core10.AbstractApiRequest {
|
|
382
|
+
constructor(input) {
|
|
383
|
+
super(input);
|
|
384
|
+
this.method = "POST";
|
|
385
|
+
this.contentType = "application/json";
|
|
386
|
+
this.accept = "application/json";
|
|
387
|
+
this.inputSchema = verifyEmailVerificationCodeByEmailInputSchema;
|
|
388
|
+
this.outputSchema = verifyEmailVerificationCodeByEmailResponseSchema;
|
|
389
|
+
this.querySchema = void 0;
|
|
390
|
+
this.headersSchema = void 0;
|
|
391
|
+
}
|
|
392
|
+
getPath() {
|
|
393
|
+
return "/users/email-verification/verify";
|
|
394
|
+
}
|
|
395
|
+
};
|
|
396
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
397
|
+
0 && (module.exports = {
|
|
398
|
+
CreateUser,
|
|
399
|
+
DeleteUser,
|
|
400
|
+
GetMe,
|
|
401
|
+
GetUserDetails,
|
|
402
|
+
GetUsers,
|
|
403
|
+
SendCurrentUserEmailVerificationCode,
|
|
404
|
+
SendEmailVerificationCodeByEmail,
|
|
405
|
+
UpdateUser,
|
|
406
|
+
VerifyCurrentUserEmailVerificationCode,
|
|
407
|
+
VerifyEmailVerificationCodeByEmail,
|
|
408
|
+
createUserInputSchema,
|
|
409
|
+
createUserResponseSchema,
|
|
410
|
+
deleteUserInputSchema,
|
|
411
|
+
deleteUserResponseSchema,
|
|
412
|
+
emailVerificationCodeStatusSchema,
|
|
413
|
+
getMeInputSchema,
|
|
414
|
+
getMeResponseSchema,
|
|
415
|
+
getUserDetailsInputSchema,
|
|
416
|
+
getUserDetailsResponseSchema,
|
|
417
|
+
getUsersInputSchema,
|
|
418
|
+
getUsersQuerySchema,
|
|
419
|
+
getUsersResponseSchema,
|
|
420
|
+
securityRoleSchema,
|
|
421
|
+
securityRoles,
|
|
422
|
+
sendCurrentUserEmailVerificationCodeInputSchema,
|
|
423
|
+
sendCurrentUserEmailVerificationCodeResponseSchema,
|
|
424
|
+
sendEmailVerificationCodeByEmailInputSchema,
|
|
425
|
+
sendEmailVerificationCodeByEmailResponseSchema,
|
|
426
|
+
updateUserInputSchema,
|
|
427
|
+
updateUserResponseSchema,
|
|
428
|
+
userIriSchema,
|
|
429
|
+
userNullableIriSchema,
|
|
430
|
+
userPreferredLocaleSchema,
|
|
431
|
+
userPreferredLocales,
|
|
432
|
+
userSchema,
|
|
433
|
+
userStepSchema,
|
|
434
|
+
userSteps,
|
|
435
|
+
usersQuerySchema,
|
|
436
|
+
verifyCurrentUserEmailVerificationCodeInputSchema,
|
|
437
|
+
verifyCurrentUserEmailVerificationCodeResponseSchema,
|
|
438
|
+
verifyEmailVerificationCodeByEmailInputSchema,
|
|
439
|
+
verifyEmailVerificationCodeByEmailResponseSchema,
|
|
440
|
+
writableUserSchema
|
|
441
|
+
});
|