@mydoormot/app-types 1.1.3 → 1.1.5

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.
@@ -5,9 +5,9 @@ CLI Using tsconfig: tsconfig.json
5
5
  CLI tsup v7.2.0
6
6
  CLI Target: node16
7
7
  CJS Build start
8
- CJS dist/index.js 4.42 KB
9
- CJS ⚡️ Build success in 92ms
8
+ CJS dist/index.js 5.07 KB
9
+ CJS ⚡️ Build success in 38ms
10
10
  DTS Build start
11
- DTS ⚡️ Build success in 1800ms
12
- DTS dist/index.d.ts 7.92 KB
13
- Done in 3.55s.
11
+ DTS ⚡️ Build success in 1061ms
12
+ DTS dist/index.d.ts 9.12 KB
13
+ Done in 1.73s.
package/CHANGELOG.md CHANGED
@@ -1,5 +1,17 @@
1
1
  # @mydoormot/app-types
2
2
 
3
+ ## 1.1.5
4
+
5
+ ### Patch Changes
6
+
7
+ - Modified app types
8
+
9
+ ## 1.1.4
10
+
11
+ ### Patch Changes
12
+
13
+ - Added notification type
14
+
3
15
  ## 1.1.3
4
16
 
5
17
  ### Patch Changes
package/dist/index.d.ts CHANGED
@@ -39,6 +39,9 @@ type User = {
39
39
  googleToken?: string;
40
40
  appleToken?: string;
41
41
  authType?: AuthType | `${AuthType}`;
42
+ passwordChangedAt?: string;
43
+ passwordResetToken?: string;
44
+ passwordResetExpires?: string;
42
45
  };
43
46
  type UserAddress = {
44
47
  user: string;
@@ -59,6 +62,27 @@ declare enum EnterpriseType {
59
62
  Property = "property",
60
63
  Store = "store"
61
64
  }
65
+ type Enterprise = {
66
+ id: string;
67
+ user: string | User;
68
+ name: string;
69
+ city: string;
70
+ verified: boolean;
71
+ enterpriseType: EnterpriseType | `${EnterpriseType}`;
72
+ deleted: boolean;
73
+ updatedAt: Date;
74
+ createdAt: Date;
75
+ isActive: boolean;
76
+ version: number;
77
+ officeNumber?: string;
78
+ address?: {
79
+ coordinates?: number[];
80
+ address?: string;
81
+ };
82
+ image?: string;
83
+ coverImage?: string;
84
+ activationDate?: string;
85
+ };
62
86
 
63
87
  declare enum InvoiceStatus {
64
88
  Pending = "pending",
@@ -84,6 +108,73 @@ interface Invoice {
84
108
  accessCode?: string;
85
109
  }
86
110
 
111
+ type City = {
112
+ id: string;
113
+ state: string | State;
114
+ name: string;
115
+ slug: string;
116
+ location: {
117
+ coordinates: number[];
118
+ };
119
+ population: string;
120
+ populationProper: string;
121
+ updatedAt: Date;
122
+ createdAt: Date;
123
+ version: number;
124
+ isRiderActive: boolean;
125
+ isPropertyActive: boolean;
126
+ errandPrice?: number;
127
+ };
128
+ type State = {
129
+ id: string;
130
+ name: string;
131
+ slug: string;
132
+ location: {
133
+ coordinates: number[];
134
+ };
135
+ alias: string;
136
+ updatedAt: Date;
137
+ createdAt: Date;
138
+ };
139
+ type LatLng = `${number},${number}`;
140
+
141
+ type Rider = {
142
+ id: string;
143
+ user: string | User;
144
+ city: string | City;
145
+ currLocation: {
146
+ coordinates: number[];
147
+ };
148
+ vehicle: string | Vehicle;
149
+ vehicleNumber: string;
150
+ verified: boolean;
151
+ active: boolean;
152
+ updatedAt: Date;
153
+ createdAt: Date;
154
+ rating: number;
155
+ version: number;
156
+ hasBeenRated: boolean;
157
+ enterprise: string | Enterprise;
158
+ isTracking: boolean;
159
+ state?: string | State;
160
+ currentErrand?: Errand;
161
+ lastDeliveredErrand?: Errand;
162
+ };
163
+ declare enum VehicleType {
164
+ Bike = "bike",
165
+ Shuttle = "shuttle"
166
+ }
167
+ type Vehicle = {
168
+ user: string;
169
+ vehicleNumber: string;
170
+ enterprise: string;
171
+ version: number;
172
+ createdAt: string;
173
+ updatedAt: string;
174
+ vehicleType: VehicleType | `${VehicleType}`;
175
+ rider?: string;
176
+ };
177
+
87
178
  declare enum ErrandStatus {
88
179
  Pending = "pending",
89
180
  RiderAssigned = "rider-assigned",
@@ -152,7 +243,7 @@ interface PendingErrand {
152
243
  interface Errand {
153
244
  id: string;
154
245
  rider: string | Rider;
155
- customerId: string;
246
+ customerId: string | User;
156
247
  nameOfItem: string;
157
248
  pickupDetails: AddressDetails;
158
249
  deliveryDetails: AddressDetails;
@@ -163,7 +254,7 @@ interface Errand {
163
254
  refId: string;
164
255
  authorizationUrl: string;
165
256
  accessCode: string;
166
- invoiceId?: string;
257
+ invoiceId?: string | Invoice;
167
258
  };
168
259
  aliasId: string;
169
260
  errandTimeline: string | ErrandTimeline;
@@ -173,6 +264,7 @@ interface Errand {
173
264
  payOnDeliveryAmount?: string;
174
265
  additionalData?: string;
175
266
  deliveryDate?: Date;
267
+ city?: City;
176
268
  }
177
269
  interface AggragatedErrand extends Errand {
178
270
  parcelSize: `${ParcelSize}`;
@@ -211,47 +303,6 @@ declare enum AddressTypes {
211
303
  DeliveryAddress = "deliveryAddress",
212
304
  PickupAddress = "pickupAddress"
213
305
  }
214
- interface Rider {
215
- id: string;
216
- _id: string;
217
- user: string | User;
218
- city: string;
219
- currLocation?: {
220
- coordinates: number[];
221
- };
222
- name?: string;
223
- vehicle: string;
224
- vehicleNumber: string;
225
- verified: boolean;
226
- active: boolean;
227
- updatedAt: Date;
228
- createdAt: Date;
229
- rating?: number;
230
- hasBeenRated: boolean;
231
- enterprise: string;
232
- isTracking: boolean;
233
- }
234
- interface ActiveRider {
235
- _id: string;
236
- user: string;
237
- enterprise: string;
238
- city: string;
239
- verified: boolean;
240
- currLocation: {
241
- type: 'Point';
242
- coordinates: [];
243
- };
244
- active: boolean;
245
- vehicleNumber: string;
246
- rating: number;
247
- hasBeenRated: number;
248
- createdAt: string;
249
- updatedAt: string;
250
- version: number;
251
- numErrands: number;
252
- available: boolean;
253
- fullName: string;
254
- }
255
306
  declare enum DeliveryStatus {
256
307
  Pending = "pending",
257
308
  EnRoute = "en-route",
@@ -304,35 +355,27 @@ type AddressDetails = {
304
355
  addressId?: string;
305
356
  };
306
357
 
307
- type City = {
358
+ declare enum NotificationType {
359
+ Errand = "errand",
360
+ ErrandTimeline = "errand-timeline"
361
+ }
362
+ interface NotificationData {
363
+ notificationType: NotificationType;
308
364
  id: string;
309
- state: string | State;
310
- name: string;
311
- slug: string;
312
- location: {
313
- coordinates: number[];
314
- };
315
- population: string;
316
- populationProper: string;
317
- updatedAt: Date;
318
- createdAt: Date;
319
- version: number;
320
- isRiderActive: boolean;
321
- isPropertyActive: boolean;
322
- errandPrice?: number;
323
- };
324
- type State = {
365
+ }
366
+ type Notification = {
325
367
  id: string;
326
- name: string;
327
- slug: string;
328
- location: {
329
- coordinates: number[];
368
+ title: string;
369
+ user: string;
370
+ description: string;
371
+ isRead: boolean;
372
+ notificationData: {
373
+ notificationType: NotificationType | `${NotificationType}`;
374
+ id: string;
330
375
  };
331
- alias: string;
332
- updatedAt: Date;
333
- createdAt: Date;
376
+ createdAt: string;
377
+ updatedAt: string;
334
378
  };
335
- type LatLng = `${number},${number}`;
336
379
 
337
380
  interface PaginateResult<T> {
338
381
  docs: T[];
@@ -349,5 +392,10 @@ interface PaginateResult<T> {
349
392
  meta?: any;
350
393
  [customLabel: string]: T[] | number | boolean | null | undefined;
351
394
  }
395
+ declare enum LinkDestination {
396
+ Website = "web",
397
+ MainApp = "mydoormot:app",
398
+ RiderApp = "mydoormot:rider"
399
+ }
352
400
 
353
- export { ActiveRider, AddressDetails, AddressTypes, AggragatedErrand, AuthType, City, DeliveryStatus, Errand, ErrandRating, ErrandStatus, ErrandTimeline, Invoice, InvoiceStatus, LatLng, PaginateResult, ParcelSize, PaymentOptions, PendingErrand, Rider, RoleType, State, User, UserAddress, errandTimeline };
401
+ export { AddressDetails, AddressTypes, AggragatedErrand, AuthType, City, DeliveryStatus, Errand, ErrandRating, ErrandStatus, ErrandTimeline, Invoice, InvoiceStatus, LatLng, LinkDestination, Notification, NotificationData, NotificationType, PaginateResult, ParcelSize, PaymentOptions, PendingErrand, Rider, RoleType, State, User, UserAddress, Vehicle, errandTimeline };
package/dist/index.js CHANGED
@@ -25,6 +25,8 @@ __export(src_exports, {
25
25
  DeliveryStatus: () => DeliveryStatus,
26
26
  ErrandStatus: () => ErrandStatus,
27
27
  InvoiceStatus: () => InvoiceStatus,
28
+ LinkDestination: () => LinkDestination,
29
+ NotificationType: () => NotificationType,
28
30
  ParcelSize: () => ParcelSize,
29
31
  PaymentOptions: () => PaymentOptions,
30
32
  RoleType: () => RoleType,
@@ -59,6 +61,7 @@ var ErrandStatus = /* @__PURE__ */ ((ErrandStatus2) => {
59
61
  ErrandStatus2["Cancelled"] = "cancelled";
60
62
  return ErrandStatus2;
61
63
  })(ErrandStatus || {});
64
+ console.log("hello");
62
65
  var errandTimeline = [
63
66
  {
64
67
  status: "pending" /* Pending */,
@@ -119,6 +122,21 @@ var PaymentOptions = /* @__PURE__ */ ((PaymentOptions2) => {
119
122
  PaymentOptions2["Card"] = "card";
120
123
  return PaymentOptions2;
121
124
  })(PaymentOptions || {});
125
+
126
+ // src/notification.ts
127
+ var NotificationType = /* @__PURE__ */ ((NotificationType2) => {
128
+ NotificationType2["Errand"] = "errand";
129
+ NotificationType2["ErrandTimeline"] = "errand-timeline";
130
+ return NotificationType2;
131
+ })(NotificationType || {});
132
+
133
+ // src/index.ts
134
+ var LinkDestination = /* @__PURE__ */ ((LinkDestination2) => {
135
+ LinkDestination2["Website"] = "web";
136
+ LinkDestination2["MainApp"] = "mydoormot:app";
137
+ LinkDestination2["RiderApp"] = "mydoormot:rider";
138
+ return LinkDestination2;
139
+ })(LinkDestination || {});
122
140
  // Annotate the CommonJS export names for ESM import in node:
123
141
  0 && (module.exports = {
124
142
  AddressTypes,
@@ -126,6 +144,8 @@ var PaymentOptions = /* @__PURE__ */ ((PaymentOptions2) => {
126
144
  DeliveryStatus,
127
145
  ErrandStatus,
128
146
  InvoiceStatus,
147
+ LinkDestination,
148
+ NotificationType,
129
149
  ParcelSize,
130
150
  PaymentOptions,
131
151
  RoleType,
package/package.json CHANGED
@@ -1,9 +1,10 @@
1
1
  {
2
2
  "name": "@mydoormot/app-types",
3
- "version": "1.1.3",
3
+ "version": "1.1.5",
4
4
  "description": "",
5
- "main": "./dist/index.js",
6
- "types": "./dist/index.d.ts",
5
+ "mains": "./dist/index.js",
6
+ "typess": "./dist/index.d.ts",
7
+ "main": "./src/index.ts",
7
8
  "scripts": {
8
9
  "clean": "del ./build/*",
9
10
  "build": "tsup src/index.ts --format cjs --dts"
package/src/enterprise.ts CHANGED
@@ -1,4 +1,4 @@
1
- // NOTE: Modify Enterprise Types
1
+ import { User } from './user';
2
2
 
3
3
  export enum EnterpriseType {
4
4
  Restaurant = 'restaurant',
@@ -6,3 +6,25 @@ export enum EnterpriseType {
6
6
  Property = 'property',
7
7
  Store = 'store',
8
8
  }
9
+
10
+ export type Enterprise = {
11
+ id: string;
12
+ user: string | User;
13
+ name: string;
14
+ city: string;
15
+ verified: boolean;
16
+ enterpriseType: EnterpriseType | `${EnterpriseType}`;
17
+ deleted: boolean;
18
+ updatedAt: Date;
19
+ createdAt: Date;
20
+ isActive: boolean;
21
+ version: number;
22
+ officeNumber?: string;
23
+ address?: {
24
+ coordinates?: number[];
25
+ address?: string;
26
+ };
27
+ image?: string;
28
+ coverImage?: string;
29
+ activationDate?: string;
30
+ };
package/src/errand.ts CHANGED
@@ -1,4 +1,6 @@
1
1
  import { Invoice, InvoiceStatus } from './invoice';
2
+ import { City } from './location';
3
+ import { Rider } from './rider';
2
4
  import { User } from './user';
3
5
 
4
6
  export enum ErrandStatus {
@@ -12,6 +14,7 @@ export enum ErrandStatus {
12
14
  Cancelled = 'cancelled',
13
15
  }
14
16
 
17
+ console.log('hello');
15
18
  export const errandTimeline = [
16
19
  {
17
20
  status: ErrandStatus.Pending,
@@ -102,7 +105,7 @@ export interface PendingErrand {
102
105
  export interface Errand {
103
106
  id: string;
104
107
  rider: string | Rider;
105
- customerId: string;
108
+ customerId: string | User;
106
109
  nameOfItem: string;
107
110
  pickupDetails: AddressDetails;
108
111
  deliveryDetails: AddressDetails;
@@ -113,17 +116,17 @@ export interface Errand {
113
116
  refId: string;
114
117
  authorizationUrl: string;
115
118
  accessCode: string;
116
- invoiceId?: string;
119
+ invoiceId?: string | Invoice;
117
120
  };
118
121
  aliasId: string;
119
122
  errandTimeline: string | ErrandTimeline;
120
123
  updatedAt: Date;
121
124
  createdAt: Date;
122
-
123
125
  errandRating?: string;
124
126
  payOnDeliveryAmount?: string;
125
127
  additionalData?: string;
126
128
  deliveryDate?: Date;
129
+ city?: City;
127
130
  }
128
131
 
129
132
  export interface AggragatedErrand extends Errand {
@@ -181,49 +184,6 @@ export enum AddressTypes {
181
184
  PickupAddress = 'pickupAddress',
182
185
  }
183
186
 
184
- export interface Rider {
185
- id: string;
186
- _id: string;
187
- user: string | User;
188
- city: string;
189
- currLocation?: {
190
- coordinates: number[];
191
- };
192
- name?: string;
193
- vehicle: string;
194
- vehicleNumber: string;
195
- verified: boolean;
196
- active: boolean;
197
- updatedAt: Date;
198
- createdAt: Date;
199
- rating?: number;
200
- hasBeenRated: boolean; // NOTE: This tells app if the rider has an existing rating
201
- enterprise: string;
202
- isTracking: boolean;
203
- }
204
-
205
- export interface ActiveRider {
206
- _id: string;
207
- user: string;
208
- enterprise: string;
209
- city: string;
210
- verified: boolean;
211
- currLocation: {
212
- type: 'Point';
213
- coordinates: [];
214
- };
215
- active: boolean;
216
- vehicleNumber: string;
217
- rating: number;
218
- hasBeenRated: number;
219
- createdAt: string;
220
- updatedAt: string;
221
- version: number;
222
- numErrands: number;
223
- available: boolean;
224
- fullName: string;
225
- }
226
-
227
187
  export enum DeliveryStatus {
228
188
  Pending = 'pending',
229
189
  EnRoute = 'en-route',
package/src/index.ts CHANGED
@@ -14,7 +14,15 @@ export interface PaginateResult<T> {
14
14
  [customLabel: string]: T[] | number | boolean | null | undefined;
15
15
  }
16
16
 
17
+ export enum LinkDestination {
18
+ Website = 'web',
19
+ MainApp = 'mydoormot:app',
20
+ RiderApp = 'mydoormot:rider',
21
+ }
22
+
17
23
  export * from './user';
18
24
  export * from './errand';
19
25
  export * from './location';
20
26
  export * from './invoice';
27
+ export * from './notification';
28
+ export * from './rider';
@@ -7,3 +7,18 @@ export interface NotificationData {
7
7
  notificationType: NotificationType;
8
8
  id: string;
9
9
  }
10
+
11
+ export type Notification = {
12
+ id: string;
13
+
14
+ title: string;
15
+ user: string;
16
+ description: string;
17
+ isRead: boolean;
18
+ notificationData: {
19
+ notificationType: NotificationType | `${NotificationType}`;
20
+ id: string;
21
+ };
22
+ createdAt: string;
23
+ updatedAt: string;
24
+ };
package/src/rider.ts ADDED
@@ -0,0 +1,44 @@
1
+ import { Enterprise } from './enterprise';
2
+ import { Errand } from './errand';
3
+ import { City, State } from './location';
4
+ import { User } from './user';
5
+
6
+ export type Rider = {
7
+ id: string;
8
+ user: string | User;
9
+ city: string | City;
10
+ currLocation: {
11
+ coordinates: number[];
12
+ };
13
+ vehicle: string | Vehicle;
14
+ vehicleNumber: string;
15
+ verified: boolean;
16
+ active: boolean;
17
+ updatedAt: Date;
18
+ createdAt: Date;
19
+ rating: number;
20
+ version: number;
21
+ hasBeenRated: boolean;
22
+ enterprise: string | Enterprise;
23
+ isTracking: boolean;
24
+
25
+ state?: string | State;
26
+ currentErrand?: Errand;
27
+ lastDeliveredErrand?: Errand;
28
+ };
29
+
30
+ enum VehicleType {
31
+ Bike = 'bike',
32
+ Shuttle = 'shuttle',
33
+ }
34
+
35
+ export type Vehicle = {
36
+ user: string;
37
+ vehicleNumber: string;
38
+ enterprise: string;
39
+ version: number;
40
+ createdAt: string;
41
+ updatedAt: string;
42
+ vehicleType: VehicleType | `${VehicleType}`;
43
+ rider?: string;
44
+ };
package/src/user.ts CHANGED
@@ -41,6 +41,9 @@ export type User = {
41
41
  googleToken?: string;
42
42
  appleToken?: string;
43
43
  authType?: AuthType | `${AuthType}`;
44
+ passwordChangedAt?: string;
45
+ passwordResetToken?: string;
46
+ passwordResetExpires?: string;
44
47
  };
45
48
 
46
49
  export type UserAddress = {