@mydoormot/app-types 1.1.4 → 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.
@@ -1,11 +1,13 @@
1
+ yarn run v1.22.19
1
2
  $ tsup src/index.ts --format cjs --dts
2
3
  CLI Building entry: src/index.ts
3
4
  CLI Using tsconfig: tsconfig.json
4
5
  CLI tsup v7.2.0
5
6
  CLI Target: node16
6
7
  CJS Build start
7
- CJS dist/index.js 4.72 KB
8
- CJS ⚡️ Build success in 83ms
8
+ CJS dist/index.js 5.07 KB
9
+ CJS ⚡️ Build success in 38ms
9
10
  DTS Build start
10
- DTS ⚡️ Build success in 1977ms
11
- DTS dist/index.d.ts 8.43 KB
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,11 @@
1
1
  # @mydoormot/app-types
2
2
 
3
+ ## 1.1.5
4
+
5
+ ### Patch Changes
6
+
7
+ - Modified app types
8
+
3
9
  ## 1.1.4
4
10
 
5
11
  ### 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,36 +355,6 @@ type AddressDetails = {
304
355
  addressId?: string;
305
356
  };
306
357
 
307
- type City = {
308
- 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 = {
325
- id: string;
326
- name: string;
327
- slug: string;
328
- location: {
329
- coordinates: number[];
330
- };
331
- alias: string;
332
- updatedAt: Date;
333
- createdAt: Date;
334
- };
335
- type LatLng = `${number},${number}`;
336
-
337
358
  declare enum NotificationType {
338
359
  Errand = "errand",
339
360
  ErrandTimeline = "errand-timeline"
@@ -371,5 +392,10 @@ interface PaginateResult<T> {
371
392
  meta?: any;
372
393
  [customLabel: string]: T[] | number | boolean | null | undefined;
373
394
  }
395
+ declare enum LinkDestination {
396
+ Website = "web",
397
+ MainApp = "mydoormot:app",
398
+ RiderApp = "mydoormot:rider"
399
+ }
374
400
 
375
- export { ActiveRider, AddressDetails, AddressTypes, AggragatedErrand, AuthType, City, DeliveryStatus, Errand, ErrandRating, ErrandStatus, ErrandTimeline, Invoice, InvoiceStatus, LatLng, Notification, NotificationData, NotificationType, 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,7 @@ __export(src_exports, {
25
25
  DeliveryStatus: () => DeliveryStatus,
26
26
  ErrandStatus: () => ErrandStatus,
27
27
  InvoiceStatus: () => InvoiceStatus,
28
+ LinkDestination: () => LinkDestination,
28
29
  NotificationType: () => NotificationType,
29
30
  ParcelSize: () => ParcelSize,
30
31
  PaymentOptions: () => PaymentOptions,
@@ -60,6 +61,7 @@ var ErrandStatus = /* @__PURE__ */ ((ErrandStatus2) => {
60
61
  ErrandStatus2["Cancelled"] = "cancelled";
61
62
  return ErrandStatus2;
62
63
  })(ErrandStatus || {});
64
+ console.log("hello");
63
65
  var errandTimeline = [
64
66
  {
65
67
  status: "pending" /* Pending */,
@@ -127,6 +129,14 @@ var NotificationType = /* @__PURE__ */ ((NotificationType2) => {
127
129
  NotificationType2["ErrandTimeline"] = "errand-timeline";
128
130
  return NotificationType2;
129
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 || {});
130
140
  // Annotate the CommonJS export names for ESM import in node:
131
141
  0 && (module.exports = {
132
142
  AddressTypes,
@@ -134,6 +144,7 @@ var NotificationType = /* @__PURE__ */ ((NotificationType2) => {
134
144
  DeliveryStatus,
135
145
  ErrandStatus,
136
146
  InvoiceStatus,
147
+ LinkDestination,
137
148
  NotificationType,
138
149
  ParcelSize,
139
150
  PaymentOptions,
package/package.json CHANGED
@@ -1,9 +1,10 @@
1
1
  {
2
2
  "name": "@mydoormot/app-types",
3
- "version": "1.1.4",
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,8 +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';
21
27
  export * from './notification';
28
+ export * from './rider';
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 = {