@mydoormot/app-types 1.1.10 → 1.3.0
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/.turbo/turbo-build.log +6 -6
- package/CHANGELOG.md +18 -0
- package/dist/index.cjs +173 -0
- package/dist/index.d.cts +482 -0
- package/dist/index.d.ts +43 -9
- package/dist/index.js +2 -0
- package/package.json +2 -1
- package/src/business.ts +45 -0
- package/src/errand.ts +11 -2
- package/src/index.ts +3 -0
- package/src/location.ts +5 -4
- package/src/notification.ts +4 -5
- package/src/user.ts +1 -0
- package/tsconfig.json +5 -3
package/.turbo/turbo-build.log
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
|
|
2
|
-
> @mydoormot/app-types@1.1
|
|
2
|
+
> @mydoormot/app-types@1.2.1 build /Users/chuksben/Desktop/projects/microservices/mydoormot/packages/app-types
|
|
3
3
|
> tsup src/index.ts --format cjs --dts
|
|
4
4
|
|
|
5
5
|
CLI Building entry: src/index.ts
|
|
6
6
|
CLI Using tsconfig: tsconfig.json
|
|
7
7
|
CLI tsup v7.2.0
|
|
8
|
-
CLI Target:
|
|
8
|
+
CLI Target: es2021
|
|
9
9
|
CJS Build start
|
|
10
|
-
CJS dist/index.
|
|
11
|
-
CJS ⚡️ Build success in
|
|
10
|
+
CJS dist/index.cjs 5.86 KB
|
|
11
|
+
CJS ⚡️ Build success in 48ms
|
|
12
12
|
DTS Build start
|
|
13
|
-
DTS ⚡️ Build success in
|
|
14
|
-
DTS dist/index.d.
|
|
13
|
+
DTS ⚡️ Build success in 604ms
|
|
14
|
+
DTS dist/index.d.cts 11.48 KB
|
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,23 @@
|
|
|
1
1
|
# @mydoormot/app-types
|
|
2
2
|
|
|
3
|
+
## 1.3.0
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- Added business category types
|
|
8
|
+
|
|
9
|
+
## 1.2.1
|
|
10
|
+
|
|
11
|
+
### Patch Changes
|
|
12
|
+
|
|
13
|
+
- Added business types
|
|
14
|
+
|
|
15
|
+
## 1.2.0
|
|
16
|
+
|
|
17
|
+
### Minor Changes
|
|
18
|
+
|
|
19
|
+
- Added errand patch
|
|
20
|
+
|
|
3
21
|
## 1.1.10
|
|
4
22
|
|
|
5
23
|
### Patch Changes
|
package/dist/index.cjs
ADDED
|
@@ -0,0 +1,173 @@
|
|
|
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 src_exports = {};
|
|
22
|
+
__export(src_exports, {
|
|
23
|
+
AddressTypes: () => AddressTypes,
|
|
24
|
+
AuthType: () => AuthType,
|
|
25
|
+
DeliveryStatus: () => DeliveryStatus,
|
|
26
|
+
EnterpriseType: () => EnterpriseType,
|
|
27
|
+
ErrandStatus: () => ErrandStatus,
|
|
28
|
+
InvoiceStatus: () => InvoiceStatus,
|
|
29
|
+
LinkDestination: () => LinkDestination,
|
|
30
|
+
NotificationType: () => NotificationType,
|
|
31
|
+
ParcelSize: () => ParcelSize,
|
|
32
|
+
PaymentOptions: () => PaymentOptions,
|
|
33
|
+
RoleType: () => RoleType,
|
|
34
|
+
errandTimeline: () => errandTimeline
|
|
35
|
+
});
|
|
36
|
+
module.exports = __toCommonJS(src_exports);
|
|
37
|
+
|
|
38
|
+
// src/user.ts
|
|
39
|
+
var RoleType = /* @__PURE__ */ ((RoleType2) => {
|
|
40
|
+
RoleType2["Rider"] = "rider";
|
|
41
|
+
RoleType2["User"] = "user";
|
|
42
|
+
RoleType2["EnterpriseAdmin"] = "enterprise-admin";
|
|
43
|
+
RoleType2["EnterpriseUser"] = "enterprise-user";
|
|
44
|
+
RoleType2["Admin"] = "admin";
|
|
45
|
+
RoleType2["RootAdmin"] = "root-admin";
|
|
46
|
+
return RoleType2;
|
|
47
|
+
})(RoleType || {});
|
|
48
|
+
var AuthType = /* @__PURE__ */ ((AuthType2) => {
|
|
49
|
+
AuthType2["Email"] = "email";
|
|
50
|
+
AuthType2["Google"] = "google";
|
|
51
|
+
AuthType2["Apple"] = "apple";
|
|
52
|
+
return AuthType2;
|
|
53
|
+
})(AuthType || {});
|
|
54
|
+
|
|
55
|
+
// src/errand.ts
|
|
56
|
+
var ErrandStatus = /* @__PURE__ */ ((ErrandStatus2) => {
|
|
57
|
+
ErrandStatus2["Pending"] = "pending";
|
|
58
|
+
ErrandStatus2["RiderAssigned"] = "rider-assigned";
|
|
59
|
+
ErrandStatus2["Started"] = "started";
|
|
60
|
+
ErrandStatus2["PickedUp"] = "picked-up";
|
|
61
|
+
ErrandStatus2["EnRoute"] = "en-route";
|
|
62
|
+
ErrandStatus2["Delivered"] = "delivered";
|
|
63
|
+
ErrandStatus2["Paused"] = "paused";
|
|
64
|
+
ErrandStatus2["Cancelled"] = "cancelled";
|
|
65
|
+
return ErrandStatus2;
|
|
66
|
+
})(ErrandStatus || {});
|
|
67
|
+
var errandTimeline = [
|
|
68
|
+
{
|
|
69
|
+
status: "pending" /* Pending */,
|
|
70
|
+
title: "pending" /* Pending */,
|
|
71
|
+
description: "Your errand is pending, you would be notified as soon as it is started"
|
|
72
|
+
},
|
|
73
|
+
{
|
|
74
|
+
status: "rider-assigned" /* RiderAssigned */,
|
|
75
|
+
title: "rider-assigned" /* RiderAssigned */,
|
|
76
|
+
description: "Your errand has been assigned to a dispatch rider, you would be notified by the dispatch rider shortly"
|
|
77
|
+
},
|
|
78
|
+
{
|
|
79
|
+
status: "started" /* Started */,
|
|
80
|
+
title: "started" /* Started */,
|
|
81
|
+
description: "Your errand has just been started, you would be contacted by the delivery agent shortly, the delivery agent is headed to the pickup address"
|
|
82
|
+
},
|
|
83
|
+
{
|
|
84
|
+
status: "picked-up" /* PickedUp */,
|
|
85
|
+
title: "picked-up" /* PickedUp */,
|
|
86
|
+
description: "Your package has been picked up from its destination"
|
|
87
|
+
},
|
|
88
|
+
{
|
|
89
|
+
status: "en-route" /* EnRoute */,
|
|
90
|
+
title: "en-route" /* EnRoute */,
|
|
91
|
+
description: "Your package is en-route to the delivery address"
|
|
92
|
+
},
|
|
93
|
+
{
|
|
94
|
+
status: "delivered" /* Delivered */,
|
|
95
|
+
title: "delivered" /* Delivered */,
|
|
96
|
+
description: "Your package has been delivered and the errand closed, please leave a review and a rating for the rider"
|
|
97
|
+
}
|
|
98
|
+
];
|
|
99
|
+
var AddressTypes = /* @__PURE__ */ ((AddressTypes2) => {
|
|
100
|
+
AddressTypes2["DeliveryAddress"] = "deliveryAddress";
|
|
101
|
+
AddressTypes2["PickupAddress"] = "pickupAddress";
|
|
102
|
+
return AddressTypes2;
|
|
103
|
+
})(AddressTypes || {});
|
|
104
|
+
var DeliveryStatus = /* @__PURE__ */ ((DeliveryStatus2) => {
|
|
105
|
+
DeliveryStatus2["Pending"] = "pending";
|
|
106
|
+
DeliveryStatus2["EnRoute"] = "en-route";
|
|
107
|
+
DeliveryStatus2["Delivered"] = "delivered";
|
|
108
|
+
DeliveryStatus2["Cancelled"] = "cancelled";
|
|
109
|
+
return DeliveryStatus2;
|
|
110
|
+
})(DeliveryStatus || {});
|
|
111
|
+
var ParcelSize = /* @__PURE__ */ ((ParcelSize2) => {
|
|
112
|
+
ParcelSize2["Bike"] = "bike";
|
|
113
|
+
ParcelSize2["Large"] = "large";
|
|
114
|
+
ParcelSize2["Medium"] = "medium";
|
|
115
|
+
ParcelSize2["Small"] = "small";
|
|
116
|
+
return ParcelSize2;
|
|
117
|
+
})(ParcelSize || {});
|
|
118
|
+
|
|
119
|
+
// src/invoice.ts
|
|
120
|
+
var InvoiceStatus = /* @__PURE__ */ ((InvoiceStatus2) => {
|
|
121
|
+
InvoiceStatus2["Pending"] = "pending";
|
|
122
|
+
InvoiceStatus2["Processing"] = "processing";
|
|
123
|
+
InvoiceStatus2["Paid"] = "paid";
|
|
124
|
+
InvoiceStatus2["Cancelled"] = "cancelled";
|
|
125
|
+
InvoiceStatus2["Failed"] = "failed";
|
|
126
|
+
return InvoiceStatus2;
|
|
127
|
+
})(InvoiceStatus || {});
|
|
128
|
+
var PaymentOptions = /* @__PURE__ */ ((PaymentOptions2) => {
|
|
129
|
+
PaymentOptions2["Cash"] = "cash";
|
|
130
|
+
PaymentOptions2["Card"] = "card";
|
|
131
|
+
return PaymentOptions2;
|
|
132
|
+
})(PaymentOptions || {});
|
|
133
|
+
|
|
134
|
+
// src/notification.ts
|
|
135
|
+
var NotificationType = /* @__PURE__ */ ((NotificationType2) => {
|
|
136
|
+
NotificationType2["Errand"] = "errand";
|
|
137
|
+
NotificationType2["ErrandTimeline"] = "errand-timeline";
|
|
138
|
+
NotificationType2["Coupon"] = "coupon";
|
|
139
|
+
NotificationType2["Campaign"] = "campaign";
|
|
140
|
+
return NotificationType2;
|
|
141
|
+
})(NotificationType || {});
|
|
142
|
+
|
|
143
|
+
// src/enterprise.ts
|
|
144
|
+
var EnterpriseType = /* @__PURE__ */ ((EnterpriseType2) => {
|
|
145
|
+
EnterpriseType2["Restaurant"] = "restaurant";
|
|
146
|
+
EnterpriseType2["Dispatch"] = "dispatch";
|
|
147
|
+
EnterpriseType2["Property"] = "property";
|
|
148
|
+
EnterpriseType2["Store"] = "store";
|
|
149
|
+
return EnterpriseType2;
|
|
150
|
+
})(EnterpriseType || {});
|
|
151
|
+
|
|
152
|
+
// src/index.ts
|
|
153
|
+
var LinkDestination = /* @__PURE__ */ ((LinkDestination2) => {
|
|
154
|
+
LinkDestination2["Website"] = "web";
|
|
155
|
+
LinkDestination2["MainApp"] = "mydoormot:app";
|
|
156
|
+
LinkDestination2["RiderApp"] = "mydoormot:rider";
|
|
157
|
+
return LinkDestination2;
|
|
158
|
+
})(LinkDestination || {});
|
|
159
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
160
|
+
0 && (module.exports = {
|
|
161
|
+
AddressTypes,
|
|
162
|
+
AuthType,
|
|
163
|
+
DeliveryStatus,
|
|
164
|
+
EnterpriseType,
|
|
165
|
+
ErrandStatus,
|
|
166
|
+
InvoiceStatus,
|
|
167
|
+
LinkDestination,
|
|
168
|
+
NotificationType,
|
|
169
|
+
ParcelSize,
|
|
170
|
+
PaymentOptions,
|
|
171
|
+
RoleType,
|
|
172
|
+
errandTimeline
|
|
173
|
+
});
|
package/dist/index.d.cts
ADDED
|
@@ -0,0 +1,482 @@
|
|
|
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 | string;
|
|
12
|
+
createdAt: Date | string;
|
|
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
|
+
version: number;
|
|
27
|
+
updatedAt: Date | string;
|
|
28
|
+
createdAt: Date | string;
|
|
29
|
+
};
|
|
30
|
+
type LatLng = `${number},${number}`;
|
|
31
|
+
|
|
32
|
+
declare enum RoleType {
|
|
33
|
+
Rider = "rider",
|
|
34
|
+
User = "user",
|
|
35
|
+
EnterpriseAdmin = "enterprise-admin",
|
|
36
|
+
EnterpriseUser = "enterprise-user",
|
|
37
|
+
Admin = "admin",
|
|
38
|
+
RootAdmin = "root-admin"
|
|
39
|
+
}
|
|
40
|
+
declare enum AuthType {
|
|
41
|
+
Email = "email",
|
|
42
|
+
Google = "google",
|
|
43
|
+
Apple = "apple"
|
|
44
|
+
}
|
|
45
|
+
type User = {
|
|
46
|
+
id: string;
|
|
47
|
+
email: string;
|
|
48
|
+
password: string;
|
|
49
|
+
firstName: string;
|
|
50
|
+
lastName: string;
|
|
51
|
+
emailVerified: boolean;
|
|
52
|
+
mobileVerified: boolean;
|
|
53
|
+
role: RoleType | `${RoleType}`;
|
|
54
|
+
mobileNumber: string;
|
|
55
|
+
updatedAt: string;
|
|
56
|
+
createdAt: string;
|
|
57
|
+
enterprise: string[];
|
|
58
|
+
authType: AuthType | `${AuthType}`;
|
|
59
|
+
version: number;
|
|
60
|
+
pushTokens?: string[];
|
|
61
|
+
avatarUrl?: string;
|
|
62
|
+
state?: string;
|
|
63
|
+
city?: string;
|
|
64
|
+
googleUserId?: string;
|
|
65
|
+
appleUserId?: string;
|
|
66
|
+
accountType?: 'business' | 'personal';
|
|
67
|
+
hasOnboarded?: boolean;
|
|
68
|
+
lastActivity?: string;
|
|
69
|
+
};
|
|
70
|
+
type UserAddress = {
|
|
71
|
+
id: string;
|
|
72
|
+
user: string;
|
|
73
|
+
name: string;
|
|
74
|
+
city: string | City;
|
|
75
|
+
state: string | State;
|
|
76
|
+
address: string;
|
|
77
|
+
landmark?: string;
|
|
78
|
+
location?: {
|
|
79
|
+
coordinates: number[];
|
|
80
|
+
};
|
|
81
|
+
placeId?: string;
|
|
82
|
+
direction?: string;
|
|
83
|
+
};
|
|
84
|
+
|
|
85
|
+
interface Coupon {
|
|
86
|
+
id: string;
|
|
87
|
+
phoneNumber: string;
|
|
88
|
+
couponType: 'errand';
|
|
89
|
+
isUsed: boolean;
|
|
90
|
+
expiresAt: Date;
|
|
91
|
+
couponCode: string;
|
|
92
|
+
updatedAt: Date;
|
|
93
|
+
createdAt: Date;
|
|
94
|
+
hasExpired: boolean;
|
|
95
|
+
couponValue: number;
|
|
96
|
+
ref?: string;
|
|
97
|
+
fullName?: string;
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
declare enum EnterpriseType {
|
|
101
|
+
Restaurant = "restaurant",
|
|
102
|
+
Dispatch = "dispatch",
|
|
103
|
+
Property = "property",
|
|
104
|
+
Store = "store"
|
|
105
|
+
}
|
|
106
|
+
type Enterprise = {
|
|
107
|
+
id: string;
|
|
108
|
+
user: string | User;
|
|
109
|
+
name: string;
|
|
110
|
+
city: string;
|
|
111
|
+
verified: boolean;
|
|
112
|
+
mobileNumber?: string;
|
|
113
|
+
enterpriseType: EnterpriseType | `${EnterpriseType}`;
|
|
114
|
+
deleted: boolean;
|
|
115
|
+
updatedAt: Date;
|
|
116
|
+
createdAt: Date;
|
|
117
|
+
isActive: boolean;
|
|
118
|
+
version: number;
|
|
119
|
+
officeNumber?: string;
|
|
120
|
+
address?: {
|
|
121
|
+
coordinates?: number[];
|
|
122
|
+
address?: string;
|
|
123
|
+
};
|
|
124
|
+
image?: string;
|
|
125
|
+
coverImage?: string;
|
|
126
|
+
activationDate?: string;
|
|
127
|
+
category: EnterpriseCategoryDoc[] | string[];
|
|
128
|
+
subCategory: EnterpriseSubCategoryDoc[] | string[];
|
|
129
|
+
socialLinks: {
|
|
130
|
+
name: string;
|
|
131
|
+
url: string;
|
|
132
|
+
active: boolean;
|
|
133
|
+
}[];
|
|
134
|
+
};
|
|
135
|
+
interface EnterpriseCategoryDoc {
|
|
136
|
+
id: string;
|
|
137
|
+
name: string;
|
|
138
|
+
slug: string;
|
|
139
|
+
subCategories: EnterpriseSubCategoryDoc[];
|
|
140
|
+
updatedAt: string;
|
|
141
|
+
createdAt: string;
|
|
142
|
+
image?: string;
|
|
143
|
+
}
|
|
144
|
+
interface EnterpriseSubCategoryDoc {
|
|
145
|
+
id: string;
|
|
146
|
+
name: string;
|
|
147
|
+
category: string;
|
|
148
|
+
slug: string;
|
|
149
|
+
image?: string;
|
|
150
|
+
serviceItems: string[];
|
|
151
|
+
updatedAt: string;
|
|
152
|
+
createdAt: string;
|
|
153
|
+
}
|
|
154
|
+
|
|
155
|
+
declare enum InvoiceStatus {
|
|
156
|
+
Pending = "pending",
|
|
157
|
+
Processing = "processing",
|
|
158
|
+
Paid = "paid",
|
|
159
|
+
Cancelled = "cancelled",
|
|
160
|
+
Failed = "failed"
|
|
161
|
+
}
|
|
162
|
+
declare enum PaymentOptions {
|
|
163
|
+
Cash = "cash",
|
|
164
|
+
Card = "card"
|
|
165
|
+
}
|
|
166
|
+
interface Invoice {
|
|
167
|
+
id: string;
|
|
168
|
+
user: string;
|
|
169
|
+
invoiceType: EnterpriseType | `${EnterpriseType}`;
|
|
170
|
+
amount: number;
|
|
171
|
+
paymentType: PaymentOptions | `${PaymentOptions}`;
|
|
172
|
+
status: InvoiceStatus | `${InvoiceStatus}`;
|
|
173
|
+
version: number;
|
|
174
|
+
referenceId?: string;
|
|
175
|
+
errandId?: string;
|
|
176
|
+
authorizationUrl?: string;
|
|
177
|
+
accessCode?: string;
|
|
178
|
+
}
|
|
179
|
+
|
|
180
|
+
type Rider = {
|
|
181
|
+
id: string;
|
|
182
|
+
user: string | User;
|
|
183
|
+
city: string | City;
|
|
184
|
+
currLocation: {
|
|
185
|
+
coordinates: number[];
|
|
186
|
+
};
|
|
187
|
+
vehicle: string | Vehicle;
|
|
188
|
+
vehicleNumber: string;
|
|
189
|
+
verified: boolean;
|
|
190
|
+
active: boolean;
|
|
191
|
+
updatedAt: Date;
|
|
192
|
+
createdAt: Date;
|
|
193
|
+
rating: number;
|
|
194
|
+
version: number;
|
|
195
|
+
hasBeenRated: boolean;
|
|
196
|
+
enterprise: string | Enterprise;
|
|
197
|
+
isTracking: boolean;
|
|
198
|
+
state?: string | State;
|
|
199
|
+
currentErrand?: Errand;
|
|
200
|
+
lastDeliveredErrand?: Errand;
|
|
201
|
+
};
|
|
202
|
+
declare enum VehicleType {
|
|
203
|
+
Bike = "bike",
|
|
204
|
+
Shuttle = "shuttle"
|
|
205
|
+
}
|
|
206
|
+
type Vehicle = {
|
|
207
|
+
user: string;
|
|
208
|
+
vehicleNumber: string;
|
|
209
|
+
enterprise: string;
|
|
210
|
+
version: number;
|
|
211
|
+
createdAt: string;
|
|
212
|
+
updatedAt: string;
|
|
213
|
+
vehicleType: VehicleType | `${VehicleType}`;
|
|
214
|
+
rider?: string;
|
|
215
|
+
};
|
|
216
|
+
|
|
217
|
+
declare enum ErrandStatus {
|
|
218
|
+
Pending = "pending",
|
|
219
|
+
RiderAssigned = "rider-assigned",
|
|
220
|
+
Started = "started",
|
|
221
|
+
PickedUp = "picked-up",
|
|
222
|
+
EnRoute = "en-route",
|
|
223
|
+
Delivered = "delivered",
|
|
224
|
+
Paused = "paused",
|
|
225
|
+
Cancelled = "cancelled"
|
|
226
|
+
}
|
|
227
|
+
declare const errandTimeline: {
|
|
228
|
+
status: ErrandStatus;
|
|
229
|
+
title: ErrandStatus;
|
|
230
|
+
description: string;
|
|
231
|
+
}[];
|
|
232
|
+
interface PendingErrand {
|
|
233
|
+
_id: string;
|
|
234
|
+
rider: string;
|
|
235
|
+
customerId: string;
|
|
236
|
+
parcelSize: ParcelSize;
|
|
237
|
+
deliveryStatus: ErrandStatus;
|
|
238
|
+
invoice: {
|
|
239
|
+
invoiceStatus: string;
|
|
240
|
+
refId: string;
|
|
241
|
+
transactionId: string;
|
|
242
|
+
};
|
|
243
|
+
nameOfItem: string;
|
|
244
|
+
pickupDetails: {
|
|
245
|
+
cityId: string;
|
|
246
|
+
address: string;
|
|
247
|
+
landmark: string;
|
|
248
|
+
fullName: string;
|
|
249
|
+
mobileNumber: string;
|
|
250
|
+
};
|
|
251
|
+
deliveryDetails: {
|
|
252
|
+
cityId: string;
|
|
253
|
+
address: string;
|
|
254
|
+
landmark: string;
|
|
255
|
+
fullName: string;
|
|
256
|
+
mobileNumber: string;
|
|
257
|
+
};
|
|
258
|
+
scheduleDate: string;
|
|
259
|
+
additionalData: string;
|
|
260
|
+
createdAt: string;
|
|
261
|
+
updatedAt: string;
|
|
262
|
+
version: number;
|
|
263
|
+
pickupLocation: {
|
|
264
|
+
cityId: string;
|
|
265
|
+
cityName: string;
|
|
266
|
+
cityCoords: number[];
|
|
267
|
+
stateId: string;
|
|
268
|
+
stateName: string;
|
|
269
|
+
stateCoords: number[];
|
|
270
|
+
};
|
|
271
|
+
deliveryLocation: {
|
|
272
|
+
cityId: string;
|
|
273
|
+
cityName: string;
|
|
274
|
+
cityCoords: number[];
|
|
275
|
+
stateId: string;
|
|
276
|
+
stateName: string;
|
|
277
|
+
stateCoords: number[];
|
|
278
|
+
};
|
|
279
|
+
errandTimeline: string;
|
|
280
|
+
id: string;
|
|
281
|
+
ownerMobileNumber?: string;
|
|
282
|
+
}
|
|
283
|
+
interface Errand {
|
|
284
|
+
id: string;
|
|
285
|
+
rider: string | Rider;
|
|
286
|
+
customerId?: string | User;
|
|
287
|
+
nameOfItem: string;
|
|
288
|
+
pickupDetails: AddressDetails;
|
|
289
|
+
deliveryDetails: AddressDetails;
|
|
290
|
+
parcelSize: `${ParcelSize}`;
|
|
291
|
+
deliveryStatus: ErrandStatus | `${ErrandStatus}`;
|
|
292
|
+
invoice: {
|
|
293
|
+
invoiceStatus: InvoiceStatus | `${InvoiceStatus}`;
|
|
294
|
+
refId: string;
|
|
295
|
+
authorizationUrl: string;
|
|
296
|
+
accessCode: string;
|
|
297
|
+
invoiceId?: string | Invoice;
|
|
298
|
+
};
|
|
299
|
+
aliasId: string;
|
|
300
|
+
updatedAt: Date;
|
|
301
|
+
createdAt: Date;
|
|
302
|
+
errandRating?: string | ErrandRating;
|
|
303
|
+
payOnDeliveryAmount?: string;
|
|
304
|
+
additionalData?: string;
|
|
305
|
+
deliveryDate?: Date;
|
|
306
|
+
city?: City;
|
|
307
|
+
couponPrice?: number;
|
|
308
|
+
price: number;
|
|
309
|
+
coupon?: string | Coupon;
|
|
310
|
+
ownerMobileNumber?: string;
|
|
311
|
+
errandTimeline?: string | ErrandTimeline;
|
|
312
|
+
}
|
|
313
|
+
interface AggragatedErrand extends Errand {
|
|
314
|
+
parcelSize: `${ParcelSize}`;
|
|
315
|
+
invoiceDetails: Invoice;
|
|
316
|
+
pickupLocation: {
|
|
317
|
+
cityId: string;
|
|
318
|
+
cityName: string;
|
|
319
|
+
cityCoords: number[];
|
|
320
|
+
stateId: string;
|
|
321
|
+
stateName: string;
|
|
322
|
+
stateCoords: number[];
|
|
323
|
+
};
|
|
324
|
+
deliveryLocation: {
|
|
325
|
+
cityId: string;
|
|
326
|
+
cityName: string;
|
|
327
|
+
cityCoords: number[];
|
|
328
|
+
stateId: string;
|
|
329
|
+
stateName: string;
|
|
330
|
+
stateCoords: number[];
|
|
331
|
+
};
|
|
332
|
+
riderUserDetails: User;
|
|
333
|
+
}
|
|
334
|
+
interface ErrandRating {
|
|
335
|
+
createdAt: string;
|
|
336
|
+
errandId: string;
|
|
337
|
+
rating: number;
|
|
338
|
+
ratingText: string;
|
|
339
|
+
riderId: string;
|
|
340
|
+
updatedAt: string;
|
|
341
|
+
userId: string;
|
|
342
|
+
version: number;
|
|
343
|
+
_id: string;
|
|
344
|
+
}
|
|
345
|
+
declare enum AddressTypes {
|
|
346
|
+
DeliveryAddress = "deliveryAddress",
|
|
347
|
+
PickupAddress = "pickupAddress"
|
|
348
|
+
}
|
|
349
|
+
declare enum DeliveryStatus {
|
|
350
|
+
Pending = "pending",
|
|
351
|
+
EnRoute = "en-route",
|
|
352
|
+
Delivered = "delivered",
|
|
353
|
+
Cancelled = "cancelled"
|
|
354
|
+
}
|
|
355
|
+
declare enum ParcelSize {
|
|
356
|
+
Bike = "bike",
|
|
357
|
+
Large = "large",
|
|
358
|
+
Medium = "medium",
|
|
359
|
+
Small = "small"
|
|
360
|
+
}
|
|
361
|
+
interface ErrandTimeline {
|
|
362
|
+
id: string;
|
|
363
|
+
errandId: string;
|
|
364
|
+
timeline: {
|
|
365
|
+
status: ErrandStatus;
|
|
366
|
+
title: string;
|
|
367
|
+
description: string;
|
|
368
|
+
time?: string;
|
|
369
|
+
date?: Date;
|
|
370
|
+
}[];
|
|
371
|
+
currTimelineIndex: number;
|
|
372
|
+
updatedAt: Date;
|
|
373
|
+
createdAt: Date;
|
|
374
|
+
}
|
|
375
|
+
interface ErrandTimeline {
|
|
376
|
+
id: string;
|
|
377
|
+
errandId: string;
|
|
378
|
+
timeline: {
|
|
379
|
+
status: ErrandStatus;
|
|
380
|
+
title: string;
|
|
381
|
+
description: string;
|
|
382
|
+
time?: string;
|
|
383
|
+
date?: Date;
|
|
384
|
+
}[];
|
|
385
|
+
currTimelineIndex: number;
|
|
386
|
+
updatedAt: Date;
|
|
387
|
+
createdAt: Date;
|
|
388
|
+
}
|
|
389
|
+
type AddressDetails = {
|
|
390
|
+
cityId: string;
|
|
391
|
+
address: string;
|
|
392
|
+
fullName: string;
|
|
393
|
+
location: {
|
|
394
|
+
coordinates: number[];
|
|
395
|
+
};
|
|
396
|
+
mobileNumber?: string;
|
|
397
|
+
landmark?: string;
|
|
398
|
+
addressId?: string;
|
|
399
|
+
};
|
|
400
|
+
|
|
401
|
+
declare enum NotificationType {
|
|
402
|
+
Errand = "errand",
|
|
403
|
+
ErrandTimeline = "errand-timeline",
|
|
404
|
+
Coupon = "coupon",
|
|
405
|
+
Campaign = "campaign"
|
|
406
|
+
}
|
|
407
|
+
interface NotificationData {
|
|
408
|
+
notificationType: NotificationType | `${NotificationType}`;
|
|
409
|
+
id: string;
|
|
410
|
+
}
|
|
411
|
+
type Notification = {
|
|
412
|
+
id: string;
|
|
413
|
+
title: string;
|
|
414
|
+
user: string;
|
|
415
|
+
description: string;
|
|
416
|
+
isRead: boolean;
|
|
417
|
+
notificationData: NotificationData;
|
|
418
|
+
createdAt: string;
|
|
419
|
+
updatedAt: string;
|
|
420
|
+
};
|
|
421
|
+
|
|
422
|
+
interface Business {
|
|
423
|
+
pgId: string;
|
|
424
|
+
seqId: number;
|
|
425
|
+
userId: string;
|
|
426
|
+
name: string;
|
|
427
|
+
description: string;
|
|
428
|
+
officeNumber: string;
|
|
429
|
+
categoryId: string;
|
|
430
|
+
address: string | NullOrUndefined;
|
|
431
|
+
addressCoordinates: number[] | NullOrUndefined | [number, number];
|
|
432
|
+
loggedIn: boolean | NullOrUndefined;
|
|
433
|
+
slug: string;
|
|
434
|
+
verified: boolean | NullOrUndefined;
|
|
435
|
+
isVirtual: boolean | NullOrUndefined;
|
|
436
|
+
registrationCompleted: boolean | NullOrUndefined;
|
|
437
|
+
stateId: string | NullOrUndefined;
|
|
438
|
+
cityId: string | NullOrUndefined;
|
|
439
|
+
orginalLogoUrl: string | NullOrUndefined;
|
|
440
|
+
logoUrl: string | NullOrUndefined;
|
|
441
|
+
logoBlurHash: string | NullOrUndefined;
|
|
442
|
+
coverImageUrl: string | NullOrUndefined;
|
|
443
|
+
orginalCoverImageUrl: string | NullOrUndefined;
|
|
444
|
+
coverImageBlurHash: string | NullOrUndefined;
|
|
445
|
+
createdAt: string | Date;
|
|
446
|
+
updatedAt: string | NullOrUndefined | Date;
|
|
447
|
+
verifiedAt: string | NullOrUndefined | Date;
|
|
448
|
+
registrationCompletedAt: string | NullOrUndefined | Date;
|
|
449
|
+
version: number;
|
|
450
|
+
}
|
|
451
|
+
interface BusinessCategory {
|
|
452
|
+
id: string;
|
|
453
|
+
seqId: number;
|
|
454
|
+
name: string;
|
|
455
|
+
slug: string;
|
|
456
|
+
createdAt: string;
|
|
457
|
+
updatedAt: string;
|
|
458
|
+
}
|
|
459
|
+
|
|
460
|
+
interface PaginateResult<T> {
|
|
461
|
+
docs: T[];
|
|
462
|
+
totalDocs: number;
|
|
463
|
+
limit: number;
|
|
464
|
+
hasPrevPage: boolean;
|
|
465
|
+
hasNextPage: boolean;
|
|
466
|
+
page?: number | undefined;
|
|
467
|
+
totalPages: number;
|
|
468
|
+
offset: number;
|
|
469
|
+
prevPage?: number | null | undefined;
|
|
470
|
+
nextPage?: number | null | undefined;
|
|
471
|
+
pagingCounter: number;
|
|
472
|
+
meta?: any;
|
|
473
|
+
[customLabel: string]: T[] | number | boolean | null | undefined;
|
|
474
|
+
}
|
|
475
|
+
declare enum LinkDestination {
|
|
476
|
+
Website = "web",
|
|
477
|
+
MainApp = "mydoormot:app",
|
|
478
|
+
RiderApp = "mydoormot:rider"
|
|
479
|
+
}
|
|
480
|
+
type NullOrUndefined = null | undefined;
|
|
481
|
+
|
|
482
|
+
export { AddressDetails, AddressTypes, AggragatedErrand, AuthType, Business, BusinessCategory, City, Coupon, DeliveryStatus, Enterprise, EnterpriseCategoryDoc, EnterpriseSubCategoryDoc, EnterpriseType, Errand, ErrandRating, ErrandStatus, ErrandTimeline, Invoice, InvoiceStatus, LatLng, LinkDestination, Notification, NotificationData, NotificationType, NullOrUndefined, PaginateResult, ParcelSize, PaymentOptions, PendingErrand, Rider, RoleType, State, User, UserAddress, Vehicle, errandTimeline };
|
package/dist/index.d.ts
CHANGED
|
@@ -23,6 +23,7 @@ type State = {
|
|
|
23
23
|
coordinates: number[];
|
|
24
24
|
};
|
|
25
25
|
alias: string;
|
|
26
|
+
version: number;
|
|
26
27
|
updatedAt: Date;
|
|
27
28
|
createdAt: Date;
|
|
28
29
|
};
|
|
@@ -64,6 +65,7 @@ type User = {
|
|
|
64
65
|
appleUserId?: string;
|
|
65
66
|
accountType?: 'business' | 'personal';
|
|
66
67
|
hasOnboarded?: boolean;
|
|
68
|
+
lastActivity?: string;
|
|
67
69
|
};
|
|
68
70
|
type UserAddress = {
|
|
69
71
|
id: string;
|
|
@@ -276,11 +278,12 @@ interface PendingErrand {
|
|
|
276
278
|
};
|
|
277
279
|
errandTimeline: string;
|
|
278
280
|
id: string;
|
|
281
|
+
ownerMobileNumber?: string;
|
|
279
282
|
}
|
|
280
283
|
interface Errand {
|
|
281
284
|
id: string;
|
|
282
285
|
rider: string | Rider;
|
|
283
|
-
customerId
|
|
286
|
+
customerId?: string | User;
|
|
284
287
|
nameOfItem: string;
|
|
285
288
|
pickupDetails: AddressDetails;
|
|
286
289
|
deliveryDetails: AddressDetails;
|
|
@@ -294,7 +297,6 @@ interface Errand {
|
|
|
294
297
|
invoiceId?: string | Invoice;
|
|
295
298
|
};
|
|
296
299
|
aliasId: string;
|
|
297
|
-
errandTimeline: string | ErrandTimeline;
|
|
298
300
|
updatedAt: Date;
|
|
299
301
|
createdAt: Date;
|
|
300
302
|
errandRating?: string | ErrandRating;
|
|
@@ -305,6 +307,8 @@ interface Errand {
|
|
|
305
307
|
couponPrice?: number;
|
|
306
308
|
price: number;
|
|
307
309
|
coupon?: string | Coupon;
|
|
310
|
+
ownerMobileNumber?: string;
|
|
311
|
+
errandTimeline?: string | ErrandTimeline;
|
|
308
312
|
}
|
|
309
313
|
interface AggragatedErrand extends Errand {
|
|
310
314
|
parcelSize: `${ParcelSize}`;
|
|
@@ -396,10 +400,12 @@ type AddressDetails = {
|
|
|
396
400
|
|
|
397
401
|
declare enum NotificationType {
|
|
398
402
|
Errand = "errand",
|
|
399
|
-
ErrandTimeline = "errand-timeline"
|
|
403
|
+
ErrandTimeline = "errand-timeline",
|
|
404
|
+
Coupon = "coupon",
|
|
405
|
+
Campaign = "campaign"
|
|
400
406
|
}
|
|
401
407
|
interface NotificationData {
|
|
402
|
-
notificationType: NotificationType
|
|
408
|
+
notificationType: NotificationType | `${NotificationType}`;
|
|
403
409
|
id: string;
|
|
404
410
|
}
|
|
405
411
|
type Notification = {
|
|
@@ -408,14 +414,41 @@ type Notification = {
|
|
|
408
414
|
user: string;
|
|
409
415
|
description: string;
|
|
410
416
|
isRead: boolean;
|
|
411
|
-
notificationData:
|
|
412
|
-
notificationType: NotificationType | `${NotificationType}`;
|
|
413
|
-
id: string;
|
|
414
|
-
};
|
|
417
|
+
notificationData: NotificationData;
|
|
415
418
|
createdAt: string;
|
|
416
419
|
updatedAt: string;
|
|
417
420
|
};
|
|
418
421
|
|
|
422
|
+
interface Business {
|
|
423
|
+
pgId: string;
|
|
424
|
+
seqId: number;
|
|
425
|
+
userId: string;
|
|
426
|
+
name: string;
|
|
427
|
+
description: string;
|
|
428
|
+
officeNumber: string;
|
|
429
|
+
categoryId: string;
|
|
430
|
+
address: string | NullOrUndefined;
|
|
431
|
+
addressCoordinates: number[] | NullOrUndefined | [number, number];
|
|
432
|
+
loggedIn: boolean | NullOrUndefined;
|
|
433
|
+
slug: string;
|
|
434
|
+
verified: boolean | NullOrUndefined;
|
|
435
|
+
isVirtual: boolean | NullOrUndefined;
|
|
436
|
+
registrationCompleted: boolean | NullOrUndefined;
|
|
437
|
+
stateId: string | NullOrUndefined;
|
|
438
|
+
cityId: string | NullOrUndefined;
|
|
439
|
+
orginalLogoUrl: string | NullOrUndefined;
|
|
440
|
+
logoUrl: string | NullOrUndefined;
|
|
441
|
+
logoBlurHash: string | NullOrUndefined;
|
|
442
|
+
coverImageUrl: string | NullOrUndefined;
|
|
443
|
+
orginalCoverImageUrl: string | NullOrUndefined;
|
|
444
|
+
coverImageBlurHash: string | NullOrUndefined;
|
|
445
|
+
createdAt: string | Date;
|
|
446
|
+
updatedAt: string | NullOrUndefined | Date;
|
|
447
|
+
verifiedAt: string | NullOrUndefined | Date;
|
|
448
|
+
registrationCompletedAt: string | NullOrUndefined | Date;
|
|
449
|
+
version: number;
|
|
450
|
+
}
|
|
451
|
+
|
|
419
452
|
interface PaginateResult<T> {
|
|
420
453
|
docs: T[];
|
|
421
454
|
totalDocs: number;
|
|
@@ -436,5 +469,6 @@ declare enum LinkDestination {
|
|
|
436
469
|
MainApp = "mydoormot:app",
|
|
437
470
|
RiderApp = "mydoormot:rider"
|
|
438
471
|
}
|
|
472
|
+
type NullOrUndefined = null | undefined;
|
|
439
473
|
|
|
440
|
-
export { AddressDetails, AddressTypes, AggragatedErrand, AuthType, City, Coupon, DeliveryStatus, Enterprise, EnterpriseCategoryDoc, EnterpriseSubCategoryDoc, EnterpriseType, Errand, ErrandRating, ErrandStatus, ErrandTimeline, Invoice, InvoiceStatus, LatLng, LinkDestination, Notification, NotificationData, NotificationType, PaginateResult, ParcelSize, PaymentOptions, PendingErrand, Rider, RoleType, State, User, UserAddress, Vehicle, errandTimeline };
|
|
474
|
+
export { AddressDetails, AddressTypes, AggragatedErrand, AuthType, Business, City, Coupon, DeliveryStatus, Enterprise, EnterpriseCategoryDoc, EnterpriseSubCategoryDoc, EnterpriseType, Errand, ErrandRating, ErrandStatus, ErrandTimeline, Invoice, InvoiceStatus, LatLng, LinkDestination, Notification, NotificationData, NotificationType, NullOrUndefined, PaginateResult, ParcelSize, PaymentOptions, PendingErrand, Rider, RoleType, State, User, UserAddress, Vehicle, errandTimeline };
|
package/dist/index.js
CHANGED
|
@@ -130,6 +130,8 @@ var PaymentOptions = /* @__PURE__ */ ((PaymentOptions2) => {
|
|
|
130
130
|
var NotificationType = /* @__PURE__ */ ((NotificationType2) => {
|
|
131
131
|
NotificationType2["Errand"] = "errand";
|
|
132
132
|
NotificationType2["ErrandTimeline"] = "errand-timeline";
|
|
133
|
+
NotificationType2["Coupon"] = "coupon";
|
|
134
|
+
NotificationType2["Campaign"] = "campaign";
|
|
133
135
|
return NotificationType2;
|
|
134
136
|
})(NotificationType || {});
|
|
135
137
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@mydoormot/app-types",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.3.0",
|
|
4
4
|
"description": "",
|
|
5
5
|
"mains": "./dist/index.js",
|
|
6
6
|
"typess": "./dist/index.d.ts",
|
|
@@ -15,6 +15,7 @@
|
|
|
15
15
|
"devDependencies": {
|
|
16
16
|
"tsup": "^7.2.0"
|
|
17
17
|
},
|
|
18
|
+
"type": "module",
|
|
18
19
|
"scripts": {
|
|
19
20
|
"clean": "del ./build/*",
|
|
20
21
|
"build": "tsup src/index.ts --format cjs --dts"
|
package/src/business.ts
ADDED
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import { NullOrUndefined } from '.';
|
|
2
|
+
|
|
3
|
+
export interface Business {
|
|
4
|
+
pgId: string;
|
|
5
|
+
seqId: number;
|
|
6
|
+
userId: string;
|
|
7
|
+
name: string;
|
|
8
|
+
description: string;
|
|
9
|
+
officeNumber: string;
|
|
10
|
+
categoryId: string;
|
|
11
|
+
|
|
12
|
+
address: string | NullOrUndefined;
|
|
13
|
+
addressCoordinates: number[] | NullOrUndefined | [number, number];
|
|
14
|
+
loggedIn: boolean | NullOrUndefined;
|
|
15
|
+
|
|
16
|
+
slug: string;
|
|
17
|
+
verified: boolean | NullOrUndefined;
|
|
18
|
+
isVirtual: boolean | NullOrUndefined;
|
|
19
|
+
registrationCompleted: boolean | NullOrUndefined;
|
|
20
|
+
stateId: string | NullOrUndefined;
|
|
21
|
+
cityId: string | NullOrUndefined;
|
|
22
|
+
|
|
23
|
+
orginalLogoUrl: string | NullOrUndefined;
|
|
24
|
+
logoUrl: string | NullOrUndefined;
|
|
25
|
+
logoBlurHash: string | NullOrUndefined;
|
|
26
|
+
|
|
27
|
+
coverImageUrl: string | NullOrUndefined;
|
|
28
|
+
orginalCoverImageUrl: string | NullOrUndefined;
|
|
29
|
+
coverImageBlurHash: string | NullOrUndefined;
|
|
30
|
+
|
|
31
|
+
createdAt: string | Date;
|
|
32
|
+
updatedAt: string | NullOrUndefined | Date;
|
|
33
|
+
verifiedAt: string | NullOrUndefined | Date;
|
|
34
|
+
registrationCompletedAt: string | NullOrUndefined | Date;
|
|
35
|
+
version: number;
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
export interface BusinessCategory {
|
|
39
|
+
id: string;
|
|
40
|
+
seqId: number;
|
|
41
|
+
name: string;
|
|
42
|
+
slug: string;
|
|
43
|
+
createdAt: string;
|
|
44
|
+
updatedAt: string;
|
|
45
|
+
}
|
package/src/errand.ts
CHANGED
|
@@ -23,6 +23,13 @@ export const errandTimeline = [
|
|
|
23
23
|
'Your errand is pending, you would be notified as soon as it is started',
|
|
24
24
|
},
|
|
25
25
|
|
|
26
|
+
{
|
|
27
|
+
status: ErrandStatus.RiderAssigned,
|
|
28
|
+
title: ErrandStatus.RiderAssigned,
|
|
29
|
+
description:
|
|
30
|
+
'Your errand has been assigned to a dispatch rider, you would be notified by the dispatch rider shortly',
|
|
31
|
+
},
|
|
32
|
+
|
|
26
33
|
{
|
|
27
34
|
status: ErrandStatus.Started,
|
|
28
35
|
title: ErrandStatus.Started,
|
|
@@ -100,12 +107,13 @@ export interface PendingErrand {
|
|
|
100
107
|
};
|
|
101
108
|
errandTimeline: string;
|
|
102
109
|
id: string;
|
|
110
|
+
ownerMobileNumber?: string;
|
|
103
111
|
}
|
|
104
112
|
|
|
105
113
|
export interface Errand {
|
|
106
114
|
id: string;
|
|
107
115
|
rider: string | Rider;
|
|
108
|
-
customerId
|
|
116
|
+
customerId?: string | User;
|
|
109
117
|
nameOfItem: string;
|
|
110
118
|
pickupDetails: AddressDetails;
|
|
111
119
|
deliveryDetails: AddressDetails;
|
|
@@ -119,7 +127,6 @@ export interface Errand {
|
|
|
119
127
|
invoiceId?: string | Invoice;
|
|
120
128
|
};
|
|
121
129
|
aliasId: string;
|
|
122
|
-
errandTimeline: string | ErrandTimeline;
|
|
123
130
|
updatedAt: Date;
|
|
124
131
|
createdAt: Date;
|
|
125
132
|
errandRating?: string | ErrandRating;
|
|
@@ -130,6 +137,8 @@ export interface Errand {
|
|
|
130
137
|
couponPrice?: number;
|
|
131
138
|
price: number;
|
|
132
139
|
coupon?: string | Coupon;
|
|
140
|
+
ownerMobileNumber?: string;
|
|
141
|
+
errandTimeline?: string | ErrandTimeline;
|
|
133
142
|
}
|
|
134
143
|
|
|
135
144
|
export interface AggragatedErrand extends Errand {
|
package/src/index.ts
CHANGED
|
@@ -20,6 +20,8 @@ export enum LinkDestination {
|
|
|
20
20
|
RiderApp = 'mydoormot:rider',
|
|
21
21
|
}
|
|
22
22
|
|
|
23
|
+
export type NullOrUndefined = null | undefined;
|
|
24
|
+
|
|
23
25
|
export * from './user';
|
|
24
26
|
export * from './errand';
|
|
25
27
|
export * from './location';
|
|
@@ -28,3 +30,4 @@ export * from './notification';
|
|
|
28
30
|
export * from './rider';
|
|
29
31
|
export * from './enterprise';
|
|
30
32
|
export * from './coupon';
|
|
33
|
+
export * from './business';
|
package/src/location.ts
CHANGED
|
@@ -8,8 +8,8 @@ export type City = {
|
|
|
8
8
|
};
|
|
9
9
|
population: string;
|
|
10
10
|
populationProper: string;
|
|
11
|
-
updatedAt: Date;
|
|
12
|
-
createdAt: Date;
|
|
11
|
+
updatedAt: Date | string;
|
|
12
|
+
createdAt: Date | string;
|
|
13
13
|
version: number;
|
|
14
14
|
isRiderActive: boolean;
|
|
15
15
|
isPropertyActive: boolean;
|
|
@@ -25,8 +25,9 @@ export type State = {
|
|
|
25
25
|
coordinates: number[];
|
|
26
26
|
};
|
|
27
27
|
alias: string;
|
|
28
|
-
|
|
29
|
-
|
|
28
|
+
version: number;
|
|
29
|
+
updatedAt: Date | string;
|
|
30
|
+
createdAt: Date | string;
|
|
30
31
|
};
|
|
31
32
|
|
|
32
33
|
export type LatLng = `${number},${number}`;
|
package/src/notification.ts
CHANGED
|
@@ -1,10 +1,12 @@
|
|
|
1
1
|
export enum NotificationType {
|
|
2
2
|
Errand = 'errand',
|
|
3
3
|
ErrandTimeline = 'errand-timeline',
|
|
4
|
+
Coupon = 'coupon',
|
|
5
|
+
Campaign = 'campaign',
|
|
4
6
|
}
|
|
5
7
|
|
|
6
8
|
export interface NotificationData {
|
|
7
|
-
notificationType: NotificationType
|
|
9
|
+
notificationType: NotificationType | `${NotificationType}`;
|
|
8
10
|
id: string;
|
|
9
11
|
}
|
|
10
12
|
|
|
@@ -15,10 +17,7 @@ export type Notification = {
|
|
|
15
17
|
user: string;
|
|
16
18
|
description: string;
|
|
17
19
|
isRead: boolean;
|
|
18
|
-
notificationData:
|
|
19
|
-
notificationType: NotificationType | `${NotificationType}`;
|
|
20
|
-
id: string;
|
|
21
|
-
};
|
|
20
|
+
notificationData: NotificationData;
|
|
22
21
|
createdAt: string;
|
|
23
22
|
updatedAt: string;
|
|
24
23
|
};
|
package/src/user.ts
CHANGED
package/tsconfig.json
CHANGED
|
@@ -11,8 +11,10 @@
|
|
|
11
11
|
// "disableReferencedProjectLoad": true, /* Reduce the number of projects loaded automatically by TypeScript. */
|
|
12
12
|
|
|
13
13
|
/* Language and Environment */
|
|
14
|
-
|
|
15
|
-
// "lib": [
|
|
14
|
+
"target": "ES2021" /* Set the JavaScript language version for emitted JavaScript and include compatible library declarations. */,
|
|
15
|
+
// "lib": [
|
|
16
|
+
// "ES2020"
|
|
17
|
+
// ] /* Specify a set of bundled library declaration files that describe the target runtime environment. */,
|
|
16
18
|
// "jsx": "preserve", /* Specify what JSX code is generated. */
|
|
17
19
|
// "experimentalDecorators": true, /* Enable experimental support for TC39 stage 2 draft decorators. */
|
|
18
20
|
// "emitDecoratorMetadata": true, /* Emit design-type metadata for decorated declarations in source files. */
|
|
@@ -26,7 +28,7 @@
|
|
|
26
28
|
|
|
27
29
|
"preserveWatchOutput": true,
|
|
28
30
|
/* Modules */
|
|
29
|
-
"module": "
|
|
31
|
+
"module": "ESNext" /* Specify what module code is generated. */,
|
|
30
32
|
// "rootDir": "./", /* Specify the root folder within your source files. */
|
|
31
33
|
"moduleResolution": "node" /* Specify how TypeScript looks up a file from a given module specifier. */,
|
|
32
34
|
// "baseUrl": "./", /* Specify the base directory to resolve non-relative module names. */
|