@mydoormot/app-types 1.1.6 → 1.1.8

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,13 +1,14 @@
1
- yarn run v1.22.19
2
- $ tsup src/index.ts --format cjs --dts
1
+
2
+ > @mydoormot/app-types@1.1.7 build /Users/chuksben/Desktop/projects/microservices/mydoormot/packages/app-types
3
+ > tsup src/index.ts --format cjs --dts
4
+
3
5
  CLI Building entry: src/index.ts
4
6
  CLI Using tsconfig: tsconfig.json
5
7
  CLI tsup v7.2.0
6
8
  CLI Target: node16
7
9
  CJS Build start
8
- CJS dist/index.js 5.41 KB
9
- CJS ⚡️ Build success in 63ms
10
+ CJS dist/index.js 5.51 KB
11
+ CJS ⚡️ Build success in 28ms
10
12
  DTS Build start
11
- DTS ⚡️ Build success in 1161ms
12
- DTS dist/index.d.ts 8.85 KB
13
- Done in 3.13s.
13
+ DTS ⚡️ Build success in 879ms
14
+ DTS dist/index.d.ts 9.31 KB
package/CHANGELOG.md CHANGED
@@ -1,5 +1,17 @@
1
1
  # @mydoormot/app-types
2
2
 
3
+ ## 1.1.8
4
+
5
+ ### Patch Changes
6
+
7
+ - Modified coupon types
8
+
9
+ ## 1.1.7
10
+
11
+ ### Patch Changes
12
+
13
+ - Modified app types for user address
14
+
3
15
  ## 1.1.6
4
16
 
5
17
  ### Patch Changes
package/dist/index.d.ts CHANGED
@@ -1,8 +1,40 @@
1
+ type City = {
2
+ id: string;
3
+ state: string | State;
4
+ name: string;
5
+ slug: string;
6
+ location: {
7
+ coordinates: number[];
8
+ };
9
+ population: string;
10
+ populationProper: string;
11
+ updatedAt: Date;
12
+ createdAt: Date;
13
+ version: number;
14
+ isRiderActive: boolean;
15
+ isPropertyActive: boolean;
16
+ errandPrice?: number;
17
+ };
18
+ type State = {
19
+ id: string;
20
+ name: string;
21
+ slug: string;
22
+ location: {
23
+ coordinates: number[];
24
+ };
25
+ alias: string;
26
+ updatedAt: Date;
27
+ createdAt: Date;
28
+ };
29
+ type LatLng = `${number},${number}`;
30
+
1
31
  declare enum RoleType {
2
32
  Rider = "rider",
3
33
  User = "user",
4
- RootAdmin = "root-admin",
5
- Admin = "admin"
34
+ EnterpriseAdmin = "enterprise-admin",
35
+ EnterpriseUser = "enterprise-user",
36
+ Admin = "admin",
37
+ RootAdmin = "root-admin"
6
38
  }
7
39
  declare enum AuthType {
8
40
  Email = "email",
@@ -32,9 +64,11 @@ type User = {
32
64
  appleUserId?: string;
33
65
  };
34
66
  type UserAddress = {
67
+ id: string;
35
68
  user: string;
36
69
  name: string;
37
- city: string;
70
+ city: string | City;
71
+ state: string | State;
38
72
  address: string;
39
73
  landmark?: string;
40
74
  location?: {
@@ -96,36 +130,6 @@ interface Invoice {
96
130
  accessCode?: string;
97
131
  }
98
132
 
99
- type City = {
100
- id: string;
101
- state: string | State;
102
- name: string;
103
- slug: string;
104
- location: {
105
- coordinates: number[];
106
- };
107
- population: string;
108
- populationProper: string;
109
- updatedAt: Date;
110
- createdAt: Date;
111
- version: number;
112
- isRiderActive: boolean;
113
- isPropertyActive: boolean;
114
- errandPrice?: number;
115
- };
116
- type State = {
117
- id: string;
118
- name: string;
119
- slug: string;
120
- location: {
121
- coordinates: number[];
122
- };
123
- alias: string;
124
- updatedAt: Date;
125
- createdAt: Date;
126
- };
127
- type LatLng = `${number},${number}`;
128
-
129
133
  type Rider = {
130
134
  id: string;
131
135
  user: string | User;
@@ -253,7 +257,9 @@ interface Errand {
253
257
  additionalData?: string;
254
258
  deliveryDate?: Date;
255
259
  city?: City;
256
- price?: number;
260
+ couponPrice?: number;
261
+ price: number;
262
+ coupon?: string;
257
263
  }
258
264
  interface AggragatedErrand extends Errand {
259
265
  parcelSize: `${ParcelSize}`;
@@ -365,6 +371,21 @@ type Notification = {
365
371
  updatedAt: string;
366
372
  };
367
373
 
374
+ interface Coupon {
375
+ id: string;
376
+ phoneNumber: string;
377
+ couponType: 'errand';
378
+ isUsed: boolean;
379
+ expiresAt: Date;
380
+ couponCode: string;
381
+ updatedAt: Date;
382
+ createdAt: Date;
383
+ hasExpired: boolean;
384
+ couponValue: number;
385
+ ref?: string;
386
+ fullName?: string;
387
+ }
388
+
368
389
  interface PaginateResult<T> {
369
390
  docs: T[];
370
391
  totalDocs: number;
@@ -386,4 +407,4 @@ declare enum LinkDestination {
386
407
  RiderApp = "mydoormot:rider"
387
408
  }
388
409
 
389
- export { AddressDetails, AddressTypes, AggragatedErrand, AuthType, City, DeliveryStatus, Enterprise, EnterpriseType, Errand, ErrandRating, ErrandStatus, ErrandTimeline, Invoice, InvoiceStatus, LatLng, LinkDestination, Notification, NotificationData, NotificationType, PaginateResult, ParcelSize, PaymentOptions, PendingErrand, Rider, RoleType, State, User, UserAddress, Vehicle, errandTimeline };
410
+ export { AddressDetails, AddressTypes, AggragatedErrand, AuthType, City, Coupon, DeliveryStatus, Enterprise, EnterpriseType, 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
@@ -39,8 +39,10 @@ module.exports = __toCommonJS(src_exports);
39
39
  var RoleType = /* @__PURE__ */ ((RoleType2) => {
40
40
  RoleType2["Rider"] = "rider";
41
41
  RoleType2["User"] = "user";
42
- RoleType2["RootAdmin"] = "root-admin";
42
+ RoleType2["EnterpriseAdmin"] = "enterprise-admin";
43
+ RoleType2["EnterpriseUser"] = "enterprise-user";
43
44
  RoleType2["Admin"] = "admin";
45
+ RoleType2["RootAdmin"] = "root-admin";
44
46
  return RoleType2;
45
47
  })(RoleType || {});
46
48
  var AuthType = /* @__PURE__ */ ((AuthType2) => {
package/package.json CHANGED
@@ -1,14 +1,10 @@
1
1
  {
2
2
  "name": "@mydoormot/app-types",
3
- "version": "1.1.6",
3
+ "version": "1.1.8",
4
4
  "description": "",
5
5
  "mains": "./dist/index.js",
6
6
  "typess": "./dist/index.d.ts",
7
7
  "main": "./src/index.ts",
8
- "scripts": {
9
- "clean": "del ./build/*",
10
- "build": "tsup src/index.ts --format cjs --dts"
11
- },
12
8
  "keywords": [],
13
9
  "author": "",
14
10
  "license": "ISC",
@@ -18,5 +14,9 @@
18
14
  },
19
15
  "devDependencies": {
20
16
  "tsup": "^7.2.0"
17
+ },
18
+ "scripts": {
19
+ "clean": "del ./build/*",
20
+ "build": "tsup src/index.ts --format cjs --dts"
21
21
  }
22
- }
22
+ }
package/src/coupon.ts ADDED
@@ -0,0 +1,14 @@
1
+ export interface Coupon {
2
+ id: string;
3
+ phoneNumber: string;
4
+ couponType: 'errand';
5
+ isUsed: boolean;
6
+ expiresAt: Date;
7
+ couponCode: string;
8
+ updatedAt: Date;
9
+ createdAt: Date;
10
+ hasExpired: boolean;
11
+ couponValue: number;
12
+ ref?: string;
13
+ fullName?: string;
14
+ }
package/src/errand.ts CHANGED
@@ -126,7 +126,9 @@ export interface Errand {
126
126
  additionalData?: string;
127
127
  deliveryDate?: Date;
128
128
  city?: City;
129
- price?: number;
129
+ couponPrice?: number;
130
+ price: number;
131
+ coupon?: string;
130
132
  }
131
133
 
132
134
  export interface AggragatedErrand extends Errand {
package/src/index.ts CHANGED
@@ -27,3 +27,4 @@ export * from './invoice';
27
27
  export * from './notification';
28
28
  export * from './rider';
29
29
  export * from './enterprise';
30
+ export * from './coupon';
package/src/user.ts CHANGED
@@ -1,8 +1,12 @@
1
+ import { City, State } from './location';
2
+
1
3
  export enum RoleType {
2
4
  Rider = 'rider',
3
5
  User = 'user',
4
- RootAdmin = 'root-admin',
6
+ EnterpriseAdmin = 'enterprise-admin',
7
+ EnterpriseUser = 'enterprise-user',
5
8
  Admin = 'admin',
9
+ RootAdmin = 'root-admin',
6
10
  }
7
11
 
8
12
  export enum AuthType {
@@ -35,9 +39,11 @@ export type User = {
35
39
  };
36
40
 
37
41
  export type UserAddress = {
42
+ id: string;
38
43
  user: string;
39
44
  name: string;
40
- city: string;
45
+ city: string | City;
46
+ state: string | State;
41
47
  address: string;
42
48
  landmark?: string;
43
49
  location?: {
package/tsconfig.json CHANGED
@@ -33,7 +33,9 @@
33
33
  // "paths": {}, /* Specify a set of entries that re-map imports to additional lookup locations. */
34
34
  // "rootDirs": [], /* Allow multiple folders to be treated as one when resolving modules. */
35
35
  // "typeRoots": [], /* Specify multiple folders that act like './node_modules/@types'. */
36
- // "types": [], /* Specify type package names to be included without being referenced in a source file. */
36
+ "types": [
37
+ "node"
38
+ ] /* Specify type package names to be included without being referenced in a source file. */,
37
39
  // "allowUmdGlobalAccess": true, /* Allow accessing UMD globals from modules. */
38
40
  // "moduleSuffixes": [], /* List of file name suffixes to search when resolving a module. */
39
41
  // "resolveJsonModule": true, /* Enable importing .json files. */