@driveflux/api-functions 0.0.7-next.2 → 0.0.7-next.20
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/dist/auth/confirm.js +66 -325
- package/dist/auth/emails.js +42 -210
- package/dist/auth/formatter.js +9 -9
- package/dist/auth/otp.js +120 -374
- package/dist/auth/register.js +95 -383
- package/dist/auth/register.js.map +1 -1
- package/dist/auth/tokens.d.ts +3 -3
- package/dist/auth/tokens.js +114 -426
- package/dist/auth/verifications.js +176 -581
- package/dist/constants.js +4 -4
- package/dist/mailjet/calls/manage-contacts-in-list.d.ts +2 -2
- package/dist/mailjet/calls/manage-contacts-in-list.d.ts.map +1 -1
- package/dist/mailjet/calls/manage-contacts-in-list.js +22 -167
- package/dist/mailjet/calls/manage-contacts-in-list.js.map +1 -1
- package/dist/mailjet/calls/manage-subscription-status.d.ts +2 -2
- package/dist/mailjet/calls/manage-subscription-status.d.ts.map +1 -1
- package/dist/mailjet/calls/manage-subscription-status.js +13 -154
- package/dist/mailjet/calls/manage-subscription-status.js.map +1 -1
- package/dist/mailjet/calls/request-service.js +18 -182
- package/dist/mailjet/refresh-email-preferences.js +21 -221
- package/dist/mailjet/set-contact.d.ts +2 -2
- package/dist/mailjet/set-contact.d.ts.map +1 -1
- package/dist/mailjet/set-contact.js +21 -213
- package/dist/mailjet/set-contact.js.map +1 -1
- package/dist/mailjet/types.d.ts +2 -2
- package/dist/mailjet/types.d.ts.map +1 -1
- package/dist/mailjet/utils/convert-to-array.d.ts +1 -1
- package/dist/mailjet/utils/convert-to-array.d.ts.map +1 -1
- package/dist/mailjet/utils/convert-to-array.js +9 -56
- package/dist/mailjet/utils/extract-email-preferences.d.ts +1 -1
- package/dist/mailjet/utils/extract-email-preferences.d.ts.map +1 -1
- package/dist/mailjet/utils/extract-email-preferences.js +37 -214
- package/dist/mailjet/utils/lists.js +28 -248
- package/dist/mailjet/utils/update-email-references.d.ts +2 -2
- package/dist/mailjet/utils/update-email-references.d.ts.map +1 -1
- package/dist/mailjet/utils/update-email-references.js +27 -207
- package/dist/mailjet/utils/update-email-references.js.map +1 -1
- package/dist/notion/client.js +50 -196
- package/dist/notion/helpful.js +25 -169
- package/dist/notion/schemas/block.js +1 -1
- package/dist/notion/schemas/common.js +7 -9
- package/dist/notion/schemas/database.d.ts +1 -1
- package/dist/notion/schemas/database.js +68 -100
- package/dist/notion/schemas/emoji.js +1 -1
- package/dist/notion/schemas/file.js +1 -1
- package/dist/notion/schemas/kb.js +3 -3
- package/dist/notion/schemas/page.d.ts +1 -1
- package/dist/notion/schemas/page.js +69 -103
- package/dist/notion/schemas/parent.js +4 -4
- package/dist/notion/schemas/user.js +2 -2
- package/dist/reservation/agree.d.ts +1 -1
- package/dist/reservation/agree.d.ts.map +1 -1
- package/dist/reservation/agree.js +17 -157
- package/dist/reservation/checks.d.ts +1 -1
- package/dist/reservation/checks.d.ts.map +1 -1
- package/dist/reservation/checks.js +21 -177
- package/dist/reservation/display-vehicle.d.ts +1 -1
- package/dist/reservation/display-vehicle.js +122 -500
- package/dist/reservation/display-vehicle.js.map +1 -1
- package/dist/reservation/fetch-or-create.d.ts +2 -2
- package/dist/reservation/fetch-or-create.d.ts.map +1 -1
- package/dist/reservation/fetch-or-create.js +188 -478
- package/dist/reservation/fetch-or-create.js.map +1 -1
- package/dist/reservation/invoice.d.ts +3 -3
- package/dist/reservation/invoice.d.ts.map +1 -1
- package/dist/reservation/invoice.js +182 -492
- package/dist/reservation/invoice.js.map +1 -1
- package/dist/reservation/payer.d.ts +1 -1
- package/dist/reservation/payer.d.ts.map +1 -1
- package/dist/reservation/payer.js +25 -175
- package/dist/reservation/reserve.d.ts +1 -1
- package/dist/reservation/reserve.d.ts.map +1 -1
- package/dist/reservation/reserve.js +35 -196
- package/dist/reservation/reserve.js.map +1 -1
- package/dist/reservation/types.d.ts +1 -0
- package/dist/reservation/types.d.ts.map +1 -1
- package/dist/reservation/vehicle.d.ts +1 -1
- package/dist/reservation/vehicle.d.ts.map +1 -1
- package/dist/reservation/vehicle.js +23 -188
- package/dist/reservation/vehicle.js.map +1 -1
- package/dist/slack.js +57 -268
- package/dist/validation.js +38 -98
- package/dist/vehicle/vehicle-pricing/constants.d.ts +1 -1
- package/dist/vehicle/vehicle-pricing/constants.d.ts.map +1 -1
- package/dist/vehicle/vehicle-pricing/constants.js +16 -16
- package/dist/vehicle/vehicle-pricing/index.d.ts +1 -1
- package/dist/vehicle/vehicle-pricing/index.d.ts.map +1 -1
- package/dist/vehicle/vehicle-pricing/index.js +87 -259
- package/dist/vehicle/vehicle-pricing/index.js.map +1 -1
- package/package.json +21 -21
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"invoice.js","sourceRoot":"","sources":["../../src/reservation/invoice.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,MAAM,EAAE,MAAM,2BAA2B,CAAA;AAClD,OAAO,EAAE,UAAU,EAAE,4BAA4B,EAAE,MAAM,mBAAmB,CAAA;AAC5E,OAAO,EAGN,MAAM,GAGN,MAAM,eAAe,CAAA;AACtB,OAAO,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAA;AAC7C,OAAO,EAAE,qBAAqB,EAAE,MAAM,4BAA4B,CAAA;AAClE,OAAO,EAAE,mBAAmB,EAAE,MAAM,mCAAmC,CAAA;AACvE,OAAO,EAAE,QAAQ,EAAE,MAAM,2BAA2B,CAAA;AACpD,OAAO,EAAE,WAAW,EAAE,MAAM,8BAA8B,CAAA;AAC1D,OAAO,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,mBAAmB,CAAA;AACnD,OAAO,EAAE,YAAY,EAAE,MAAM,yBAAyB,CAAA;AACtD,OAAO,EAAE,EAAE,EAAuB,MAAM,mBAAmB,CAAA;AAC3D,OAAO,EAAE,MAAM,EAAE,MAAM,iBAAiB,CAAA;AACxC,OAAO,EAAE,OAAO,EAAE,MAAM,kBAAkB,CAAA;AAC1C,OAAO,EAAE,UAAU,EAAE,MAAM,qB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AAO,EAAE,OAAO,CAAC,OAAO;YACxB,IAAI,EAAE,OAAO,CAAC,IAAI;YAClB,IAAI,EAAE,IAAI;YACV,cAAc,EAAE,cAAc;SAC9B;QACD,qBAAqB,EAAE,eAAe;QACtC,gBAAgB,EAAE;YACjB,IAAI;YACJ,cAAc;YACd,SAAS,EAAE,OAAO,CAAC,EAAE;YACrB,WAAW,EAAE,WAAW,CAAC,OAAO,CAAC;YACjC,GAAG,CAAC,aAAa,CAAC,CAAC,CAAC,EAAE,aAAa,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;YAC3C,GAAG,CAAC,UAAU,CAAC,CAAC,CAAC,EAAE,UAAU,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;SACrC;QACD,SAAS,EAAE;YACV,OAAO,EAAE,KAAK;YACd,QAAQ,EAAE,CAAC;YACX,WAAW,EAAE,CAAC;YACd,QAAQ,EAAE,CAAC;SACX;QACD,QAAQ,EAAE;YACT,OAAO,EAAE,mBAAmB;YAC5B,aAAa;YACb,WAAW,EAAE,WAAW,CAAC,OAAO,CAAC;YACjC,IAAI;YACJ,cAAc;YACd,UAAU;YACV,GAAG,CAAC,eAAe,IAAI,qBAAqB;gBAC3C,CAAC,CAAC,EAAE,qBAAqB,EAAE;gBAC3B,CAAC,CAAC,EAAE,CAAC;YACN,SAAS;SACT;KAC+B,CAAA;AAClC,CAAC,CAAA"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { type Business, type User } from '@driveflux/db';
|
|
2
2
|
import { type PromisedResult } from '@driveflux/result';
|
|
3
|
-
import type { ReserveVehicleParams } from './types';
|
|
3
|
+
import type { ReserveVehicleParams } from './types.js';
|
|
4
4
|
export declare const getPayer: ({ subscribingUser, asBusiness, }: Pick<ReserveVehicleParams, "subscribingUser" | "asBusiness">) => PromisedResult<User | Business>;
|
|
5
5
|
//# sourceMappingURL=payer.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"payer.d.ts","sourceRoot":"","sources":["../../src/reservation/payer.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,QAAQ,EAAU,KAAK,IAAI,EAAE,MAAM,eAAe,CAAA;AAMhE,OAAO,EAAW,KAAK,cAAc,EAAE,MAAM,mBAAmB,CAAA;AAChE,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"payer.d.ts","sourceRoot":"","sources":["../../src/reservation/payer.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,QAAQ,EAAU,KAAK,IAAI,EAAE,MAAM,eAAe,CAAA;AAMhE,OAAO,EAAW,KAAK,cAAc,EAAE,MAAM,mBAAmB,CAAA;AAChE,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,YAAY,CAAA;AAEtD,eAAO,MAAM,QAAQ,GAAU,kCAG5B,IAAI,CACN,oBAAoB,EACpB,iBAAiB,GAAG,YAAY,CAChC,KAAG,cAAc,CAAC,IAAI,GAAG,QAAQ,CAsCjC,CAAA"}
|
|
@@ -1,187 +1,37 @@
|
|
|
1
|
-
function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) {
|
|
2
|
-
try {
|
|
3
|
-
var info = gen[key](arg);
|
|
4
|
-
var value = info.value;
|
|
5
|
-
} catch (error) {
|
|
6
|
-
reject(error);
|
|
7
|
-
return;
|
|
8
|
-
}
|
|
9
|
-
if (info.done) {
|
|
10
|
-
resolve(value);
|
|
11
|
-
} else {
|
|
12
|
-
Promise.resolve(value).then(_next, _throw);
|
|
13
|
-
}
|
|
14
|
-
}
|
|
15
|
-
function _async_to_generator(fn) {
|
|
16
|
-
return function() {
|
|
17
|
-
var self = this, args = arguments;
|
|
18
|
-
return new Promise(function(resolve, reject) {
|
|
19
|
-
var gen = fn.apply(self, args);
|
|
20
|
-
function _next(value) {
|
|
21
|
-
asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value);
|
|
22
|
-
}
|
|
23
|
-
function _throw(err) {
|
|
24
|
-
asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err);
|
|
25
|
-
}
|
|
26
|
-
_next(undefined);
|
|
27
|
-
});
|
|
28
|
-
};
|
|
29
|
-
}
|
|
30
|
-
function _ts_generator(thisArg, body) {
|
|
31
|
-
var f, y, t, _ = {
|
|
32
|
-
label: 0,
|
|
33
|
-
sent: function() {
|
|
34
|
-
if (t[0] & 1) throw t[1];
|
|
35
|
-
return t[1];
|
|
36
|
-
},
|
|
37
|
-
trys: [],
|
|
38
|
-
ops: []
|
|
39
|
-
}, g = Object.create((typeof Iterator === "function" ? Iterator : Object).prototype);
|
|
40
|
-
return g.next = verb(0), g["throw"] = verb(1), g["return"] = verb(2), typeof Symbol === "function" && (g[Symbol.iterator] = function() {
|
|
41
|
-
return this;
|
|
42
|
-
}), g;
|
|
43
|
-
function verb(n) {
|
|
44
|
-
return function(v) {
|
|
45
|
-
return step([
|
|
46
|
-
n,
|
|
47
|
-
v
|
|
48
|
-
]);
|
|
49
|
-
};
|
|
50
|
-
}
|
|
51
|
-
function step(op) {
|
|
52
|
-
if (f) throw new TypeError("Generator is already executing.");
|
|
53
|
-
while(g && (g = 0, op[0] && (_ = 0)), _)try {
|
|
54
|
-
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
|
|
55
|
-
if (y = 0, t) op = [
|
|
56
|
-
op[0] & 2,
|
|
57
|
-
t.value
|
|
58
|
-
];
|
|
59
|
-
switch(op[0]){
|
|
60
|
-
case 0:
|
|
61
|
-
case 1:
|
|
62
|
-
t = op;
|
|
63
|
-
break;
|
|
64
|
-
case 4:
|
|
65
|
-
_.label++;
|
|
66
|
-
return {
|
|
67
|
-
value: op[1],
|
|
68
|
-
done: false
|
|
69
|
-
};
|
|
70
|
-
case 5:
|
|
71
|
-
_.label++;
|
|
72
|
-
y = op[1];
|
|
73
|
-
op = [
|
|
74
|
-
0
|
|
75
|
-
];
|
|
76
|
-
continue;
|
|
77
|
-
case 7:
|
|
78
|
-
op = _.ops.pop();
|
|
79
|
-
_.trys.pop();
|
|
80
|
-
continue;
|
|
81
|
-
default:
|
|
82
|
-
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) {
|
|
83
|
-
_ = 0;
|
|
84
|
-
continue;
|
|
85
|
-
}
|
|
86
|
-
if (op[0] === 3 && (!t || op[1] > t[0] && op[1] < t[3])) {
|
|
87
|
-
_.label = op[1];
|
|
88
|
-
break;
|
|
89
|
-
}
|
|
90
|
-
if (op[0] === 6 && _.label < t[1]) {
|
|
91
|
-
_.label = t[1];
|
|
92
|
-
t = op;
|
|
93
|
-
break;
|
|
94
|
-
}
|
|
95
|
-
if (t && _.label < t[2]) {
|
|
96
|
-
_.label = t[2];
|
|
97
|
-
_.ops.push(op);
|
|
98
|
-
break;
|
|
99
|
-
}
|
|
100
|
-
if (t[2]) _.ops.pop();
|
|
101
|
-
_.trys.pop();
|
|
102
|
-
continue;
|
|
103
|
-
}
|
|
104
|
-
op = body.call(thisArg, _);
|
|
105
|
-
} catch (e) {
|
|
106
|
-
op = [
|
|
107
|
-
6,
|
|
108
|
-
e
|
|
109
|
-
];
|
|
110
|
-
y = 0;
|
|
111
|
-
} finally{
|
|
112
|
-
f = t = 0;
|
|
113
|
-
}
|
|
114
|
-
if (op[0] & 5) throw op[1];
|
|
115
|
-
return {
|
|
116
|
-
value: op[0] ? op[1] : void 0,
|
|
117
|
-
done: true
|
|
118
|
-
};
|
|
119
|
-
}
|
|
120
|
-
}
|
|
121
1
|
import { prisma } from '@driveflux/db';
|
|
122
2
|
import { makeProblem, PROBLEM_CONDITION_FAILED, PROBLEM_NOT_FOUND } from '@driveflux/problem';
|
|
123
3
|
import { Err, Ok } from '@driveflux/result';
|
|
124
|
-
export
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
2
|
|
136
|
-
];
|
|
137
|
-
if (!subscribingUser.businessId) {
|
|
138
|
-
return [
|
|
139
|
-
2,
|
|
140
|
-
new Err(makeProblem(PROBLEM_CONDITION_FAILED, 'You are not associated with any business'))
|
|
141
|
-
];
|
|
142
|
-
}
|
|
143
|
-
return [
|
|
144
|
-
4,
|
|
145
|
-
prisma.business.findUnique({
|
|
146
|
-
where: {
|
|
147
|
-
id: subscribingUser.businessId
|
|
148
|
-
}
|
|
149
|
-
})
|
|
150
|
-
];
|
|
151
|
-
case 1:
|
|
152
|
-
// load business
|
|
153
|
-
business = _state.sent();
|
|
154
|
-
if (!business) {
|
|
155
|
-
return [
|
|
156
|
-
2,
|
|
157
|
-
new Err(makeProblem(PROBLEM_NOT_FOUND, "The business ".concat(subscribingUser.businessId, " was not found.")))
|
|
158
|
-
];
|
|
159
|
-
}
|
|
160
|
-
payer = business;
|
|
161
|
-
_state.label = 2;
|
|
162
|
-
case 2:
|
|
163
|
-
// Sanity check
|
|
164
|
-
subscriberSanityResult = checkPayerObjectSanity(payer);
|
|
165
|
-
if (subscriberSanityResult.err) {
|
|
166
|
-
return [
|
|
167
|
-
2,
|
|
168
|
-
subscriberSanityResult
|
|
169
|
-
];
|
|
170
|
-
}
|
|
171
|
-
return [
|
|
172
|
-
2,
|
|
173
|
-
new Ok(payer)
|
|
174
|
-
];
|
|
4
|
+
export const getPayer = async ({ subscribingUser, asBusiness })=>{
|
|
5
|
+
let business = null;
|
|
6
|
+
let payer = subscribingUser;
|
|
7
|
+
if (asBusiness) {
|
|
8
|
+
if (!subscribingUser.businessId) {
|
|
9
|
+
return new Err(makeProblem(PROBLEM_CONDITION_FAILED, 'You are not associated with any business'));
|
|
10
|
+
}
|
|
11
|
+
// load business
|
|
12
|
+
business = await prisma.business.findUnique({
|
|
13
|
+
where: {
|
|
14
|
+
id: subscribingUser.businessId
|
|
175
15
|
}
|
|
176
16
|
});
|
|
177
|
-
|
|
17
|
+
if (!business) {
|
|
18
|
+
return new Err(makeProblem(PROBLEM_NOT_FOUND, `The business ${subscribingUser.businessId} was not found.`));
|
|
19
|
+
}
|
|
20
|
+
payer = business;
|
|
21
|
+
}
|
|
22
|
+
// Sanity check
|
|
23
|
+
const subscriberSanityResult = checkPayerObjectSanity(payer);
|
|
24
|
+
if (subscriberSanityResult.err) {
|
|
25
|
+
return subscriberSanityResult;
|
|
26
|
+
}
|
|
27
|
+
return new Ok(payer);
|
|
178
28
|
};
|
|
179
|
-
|
|
29
|
+
const checkPayerObjectSanity = (subscriber)=>{
|
|
180
30
|
if (!subscriber.email) {
|
|
181
|
-
return new Err(makeProblem(PROBLEM_CONDITION_FAILED,
|
|
31
|
+
return new Err(makeProblem(PROBLEM_CONDITION_FAILED, `Subscriber ${subscriber.id} has no email. Please add a verified email first.`));
|
|
182
32
|
}
|
|
183
33
|
if (!subscriber.phoneNumber) {
|
|
184
|
-
return new Err(makeProblem(PROBLEM_CONDITION_FAILED,
|
|
34
|
+
return new Err(makeProblem(PROBLEM_CONDITION_FAILED, `Subscriber ${subscriber.id} has no phone number. Please add a phone number first.`));
|
|
185
35
|
}
|
|
186
36
|
return new Ok(true);
|
|
187
37
|
};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { SubscriptionReservation } from '@driveflux/db';
|
|
2
2
|
import { type PromisedResult } from '@driveflux/result';
|
|
3
|
-
import type { ReserveVehicleParams } from './types';
|
|
3
|
+
import type { ReserveVehicleParams } from './types.js';
|
|
4
4
|
export declare const reserveVehicle: (vehicleId: string, unprocessed: ReserveVehicleParams) => PromisedResult<SubscriptionReservation>;
|
|
5
5
|
//# sourceMappingURL=reserve.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"reserve.d.ts","sourceRoot":"","sources":["../../src/reservation/reserve.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,eAAe,CAAA;AAC5D,OAAO,EAAM,KAAK,cAAc,EAAE,MAAM,mBAAmB,CAAA;AAK3D,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"reserve.d.ts","sourceRoot":"","sources":["../../src/reservation/reserve.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,eAAe,CAAA;AAC5D,OAAO,EAAM,KAAK,cAAc,EAAE,MAAM,mBAAmB,CAAA;AAK3D,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,YAAY,CAAA;AAYtD,eAAO,MAAM,cAAc,GAC1B,WAAW,MAAM,EACjB,aAAa,oBAAoB,KAC/B,cAAc,CAAC,uBAAuB,CAkCxC,CAAA"}
|
|
@@ -1,204 +1,43 @@
|
|
|
1
|
-
function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) {
|
|
2
|
-
try {
|
|
3
|
-
var info = gen[key](arg);
|
|
4
|
-
var value = info.value;
|
|
5
|
-
} catch (error) {
|
|
6
|
-
reject(error);
|
|
7
|
-
return;
|
|
8
|
-
}
|
|
9
|
-
if (info.done) {
|
|
10
|
-
resolve(value);
|
|
11
|
-
} else {
|
|
12
|
-
Promise.resolve(value).then(_next, _throw);
|
|
13
|
-
}
|
|
14
|
-
}
|
|
15
|
-
function _async_to_generator(fn) {
|
|
16
|
-
return function() {
|
|
17
|
-
var self = this, args = arguments;
|
|
18
|
-
return new Promise(function(resolve, reject) {
|
|
19
|
-
var gen = fn.apply(self, args);
|
|
20
|
-
function _next(value) {
|
|
21
|
-
asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value);
|
|
22
|
-
}
|
|
23
|
-
function _throw(err) {
|
|
24
|
-
asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err);
|
|
25
|
-
}
|
|
26
|
-
_next(undefined);
|
|
27
|
-
});
|
|
28
|
-
};
|
|
29
|
-
}
|
|
30
|
-
function _ts_generator(thisArg, body) {
|
|
31
|
-
var f, y, t, _ = {
|
|
32
|
-
label: 0,
|
|
33
|
-
sent: function() {
|
|
34
|
-
if (t[0] & 1) throw t[1];
|
|
35
|
-
return t[1];
|
|
36
|
-
},
|
|
37
|
-
trys: [],
|
|
38
|
-
ops: []
|
|
39
|
-
}, g = Object.create((typeof Iterator === "function" ? Iterator : Object).prototype);
|
|
40
|
-
return g.next = verb(0), g["throw"] = verb(1), g["return"] = verb(2), typeof Symbol === "function" && (g[Symbol.iterator] = function() {
|
|
41
|
-
return this;
|
|
42
|
-
}), g;
|
|
43
|
-
function verb(n) {
|
|
44
|
-
return function(v) {
|
|
45
|
-
return step([
|
|
46
|
-
n,
|
|
47
|
-
v
|
|
48
|
-
]);
|
|
49
|
-
};
|
|
50
|
-
}
|
|
51
|
-
function step(op) {
|
|
52
|
-
if (f) throw new TypeError("Generator is already executing.");
|
|
53
|
-
while(g && (g = 0, op[0] && (_ = 0)), _)try {
|
|
54
|
-
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
|
|
55
|
-
if (y = 0, t) op = [
|
|
56
|
-
op[0] & 2,
|
|
57
|
-
t.value
|
|
58
|
-
];
|
|
59
|
-
switch(op[0]){
|
|
60
|
-
case 0:
|
|
61
|
-
case 1:
|
|
62
|
-
t = op;
|
|
63
|
-
break;
|
|
64
|
-
case 4:
|
|
65
|
-
_.label++;
|
|
66
|
-
return {
|
|
67
|
-
value: op[1],
|
|
68
|
-
done: false
|
|
69
|
-
};
|
|
70
|
-
case 5:
|
|
71
|
-
_.label++;
|
|
72
|
-
y = op[1];
|
|
73
|
-
op = [
|
|
74
|
-
0
|
|
75
|
-
];
|
|
76
|
-
continue;
|
|
77
|
-
case 7:
|
|
78
|
-
op = _.ops.pop();
|
|
79
|
-
_.trys.pop();
|
|
80
|
-
continue;
|
|
81
|
-
default:
|
|
82
|
-
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) {
|
|
83
|
-
_ = 0;
|
|
84
|
-
continue;
|
|
85
|
-
}
|
|
86
|
-
if (op[0] === 3 && (!t || op[1] > t[0] && op[1] < t[3])) {
|
|
87
|
-
_.label = op[1];
|
|
88
|
-
break;
|
|
89
|
-
}
|
|
90
|
-
if (op[0] === 6 && _.label < t[1]) {
|
|
91
|
-
_.label = t[1];
|
|
92
|
-
t = op;
|
|
93
|
-
break;
|
|
94
|
-
}
|
|
95
|
-
if (t && _.label < t[2]) {
|
|
96
|
-
_.label = t[2];
|
|
97
|
-
_.ops.push(op);
|
|
98
|
-
break;
|
|
99
|
-
}
|
|
100
|
-
if (t[2]) _.ops.pop();
|
|
101
|
-
_.trys.pop();
|
|
102
|
-
continue;
|
|
103
|
-
}
|
|
104
|
-
op = body.call(thisArg, _);
|
|
105
|
-
} catch (e) {
|
|
106
|
-
op = [
|
|
107
|
-
6,
|
|
108
|
-
e
|
|
109
|
-
];
|
|
110
|
-
y = 0;
|
|
111
|
-
} finally{
|
|
112
|
-
f = t = 0;
|
|
113
|
-
}
|
|
114
|
-
if (op[0] & 5) throw op[1];
|
|
115
|
-
return {
|
|
116
|
-
value: op[0] ? op[1] : void 0,
|
|
117
|
-
done: true
|
|
118
|
-
};
|
|
119
|
-
}
|
|
120
|
-
}
|
|
121
1
|
import { Ok } from '@driveflux/result';
|
|
122
|
-
import { handleAgreeToTerms } from './agree';
|
|
123
|
-
import { checkIfUserCanReserve } from './checks';
|
|
124
|
-
import { fetchOrCreateReservation } from './fetch-or-create';
|
|
125
|
-
import { getPayer } from './payer';
|
|
126
|
-
import { getVehicle } from './vehicle';
|
|
127
|
-
|
|
2
|
+
import { handleAgreeToTerms } from './agree.js';
|
|
3
|
+
import { checkIfUserCanReserve } from './checks.js';
|
|
4
|
+
import { fetchOrCreateReservation } from './fetch-or-create.js';
|
|
5
|
+
import { getPayer } from './payer.js';
|
|
6
|
+
import { getVehicle } from './vehicle.js';
|
|
7
|
+
const processBody = (body)=>{
|
|
128
8
|
// Switch mileage package
|
|
129
9
|
if (body.plan === 'plan1' || body.plan === 'planWeekly') {
|
|
130
10
|
body.mileagePackage = 'unlimited';
|
|
131
11
|
}
|
|
132
12
|
return body;
|
|
133
13
|
};
|
|
134
|
-
export
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
payerResult
|
|
164
|
-
];
|
|
165
|
-
}
|
|
166
|
-
payer = payerResult.val;
|
|
167
|
-
return [
|
|
168
|
-
4,
|
|
169
|
-
getVehicle(vehicleId, body, requesterAbility)
|
|
170
|
-
];
|
|
171
|
-
case 4:
|
|
172
|
-
vehicleResult = _state.sent();
|
|
173
|
-
if (vehicleResult.err) {
|
|
174
|
-
return [
|
|
175
|
-
2,
|
|
176
|
-
vehicleResult
|
|
177
|
-
];
|
|
178
|
-
}
|
|
179
|
-
vehicle = vehicleResult.val;
|
|
180
|
-
return [
|
|
181
|
-
4,
|
|
182
|
-
fetchOrCreateReservation({
|
|
183
|
-
vehicle: vehicle,
|
|
184
|
-
payer: payer,
|
|
185
|
-
body: body
|
|
186
|
-
})
|
|
187
|
-
];
|
|
188
|
-
case 5:
|
|
189
|
-
reservationResult = _state.sent();
|
|
190
|
-
if (reservationResult.err) {
|
|
191
|
-
return [
|
|
192
|
-
2,
|
|
193
|
-
reservationResult
|
|
194
|
-
];
|
|
195
|
-
}
|
|
196
|
-
reservation = reservationResult.val;
|
|
197
|
-
return [
|
|
198
|
-
2,
|
|
199
|
-
new Ok(reservation)
|
|
200
|
-
];
|
|
201
|
-
}
|
|
202
|
-
});
|
|
203
|
-
})();
|
|
14
|
+
export const reserveVehicle = async (vehicleId, unprocessed)=>{
|
|
15
|
+
const body = processBody(unprocessed);
|
|
16
|
+
// Agree to terms if not done yet
|
|
17
|
+
await handleAgreeToTerms(body);
|
|
18
|
+
// Check if the user can reserve
|
|
19
|
+
const requesterAbility = await checkIfUserCanReserve(body);
|
|
20
|
+
// Payer
|
|
21
|
+
const payerResult = await getPayer(body);
|
|
22
|
+
if (payerResult.err) {
|
|
23
|
+
return payerResult;
|
|
24
|
+
}
|
|
25
|
+
const payer = payerResult.val;
|
|
26
|
+
// Vehicle
|
|
27
|
+
const vehicleResult = await getVehicle(vehicleId, body, requesterAbility);
|
|
28
|
+
if (vehicleResult.err) {
|
|
29
|
+
return vehicleResult;
|
|
30
|
+
}
|
|
31
|
+
const vehicle = vehicleResult.val;
|
|
32
|
+
// Make or fetch the reservation
|
|
33
|
+
const reservationResult = await fetchOrCreateReservation({
|
|
34
|
+
vehicle,
|
|
35
|
+
payer,
|
|
36
|
+
body
|
|
37
|
+
});
|
|
38
|
+
if (reservationResult.err) {
|
|
39
|
+
return reservationResult;
|
|
40
|
+
}
|
|
41
|
+
const reservation = reservationResult.val;
|
|
42
|
+
return new Ok(reservation);
|
|
204
43
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"reserve.js","sourceRoot":"","sources":["../../src/reservation/reserve.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,EAAE,EAAuB,MAAM,mBAAmB,CAAA;AAC3D,OAAO,EAAE,kBAAkB,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"reserve.js","sourceRoot":"","sources":["../../src/reservation/reserve.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,EAAE,EAAuB,MAAM,mBAAmB,CAAA;AAC3D,OAAO,EAAE,kBAAkB,EAAE,MAAM,YAAY,CAAA;AAC/C,OAAO,EAAE,qBAAqB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CAAA;IACF,IAAI,iBAAiB,CAAC,GAAG,EAAE,CAAC;QAC3B,OAAO,iBAAiB,CAAA;IACzB,CAAC;IACD,MAAM,WAAW,GAAG,iBAAiB,CAAC,GAAG,CAAA;IAEzC,OAAO,IAAI,EAAE,CAAC,WAAW,CAAC,CAAA;AAC3B,CAAC,CAAA"}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import type { MileagePackage, PlanType, ReservationSource, User } from '@driveflux/db';
|
|
2
2
|
import type { Address } from '@driveflux/db/types/helpers';
|
|
3
3
|
export type ReserveVehicleParams = {
|
|
4
|
+
invoiceId?: string;
|
|
4
5
|
plan: PlanType;
|
|
5
6
|
mileagePackage: MileagePackage;
|
|
6
7
|
asBusiness?: boolean;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/reservation/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACX,cAAc,EACd,QAAQ,EACR,iBAAiB,EACjB,IAAI,EACJ,MAAM,eAAe,CAAA;AACtB,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,6BAA6B,CAAA;AAE1D,MAAM,MAAM,oBAAoB,GAAG;IAClC,IAAI,EAAE,QAAQ,CAAA;IACd,cAAc,EAAE,cAAc,CAAA;IAC9B,UAAU,CAAC,EAAE,OAAO,CAAA;IACpB,UAAU,CAAC,EAAE,MAAM,CAAA;IACnB,YAAY,CAAC,EAAE,MAAM,CAAA;IACrB,eAAe,CAAC,EAAE,MAAM,CAAA;IACxB,SAAS,CAAC,EAAE;QACX,UAAU,CAAC,EAAE,MAAM,CAAA;QACnB,WAAW,CAAC,EAAE,MAAM,CAAA;KACpB,CAAA;IACD,iBAAiB,CAAC,EAAE;QACnB,IAAI,EAAE,OAAO,CAAA;QACb,OAAO,EAAE,OAAO,CAAA;KAChB,CAAA;IACD,YAAY,CAAC,EAAE,IAAI,CAAA;IACnB,aAAa,CAAC,EAAE,MAAM,GAAG,IAAI,CA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M,CAAA;IACjB,aAAa,CAAC,EAAE,OAAO,CAAA;CACvB,CAAA"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { AppAbility } from '@driveflux/auth/authorization/types';
|
|
2
2
|
import type { Vehicle } from '@driveflux/db';
|
|
3
3
|
import { type PromisedResult } from '@driveflux/result';
|
|
4
|
-
import type { ReserveVehicleParams } from './types';
|
|
4
|
+
import type { ReserveVehicleParams } from './types.js';
|
|
5
5
|
export declare const getVehicle: (id: string, { selectedColor, plan, requestUser, }: Pick<ReserveVehicleParams, "selectedColor" | "plan" | "requestUser">, requesterAbility: AppAbility) => PromisedResult<Vehicle>;
|
|
6
6
|
//# sourceMappingURL=vehicle.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"vehicle.d.ts","sourceRoot":"","sources":["../../src/reservation/vehicle.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,qCAAqC,CAAA;AACrE,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,eAAe,CAAA;AAG5C,OAAO,EAAW,KAAK,cAAc,EAAE,MAAM,mBAAmB,CAAA;AAGhE,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"vehicle.d.ts","sourceRoot":"","sources":["../../src/reservation/vehicle.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,qCAAqC,CAAA;AACrE,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,eAAe,CAAA;AAG5C,OAAO,EAAW,KAAK,cAAc,EAAE,MAAM,mBAAmB,CAAA;AAGhE,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,YAAY,CAAA;AAEtD,eAAO,MAAM,UAAU,GACtB,IAAI,MAAM,EACV,uCAIG,IAAI,CAAC,oBAAoB,EAAE,eAAe,GAAG,MAAM,GAAG,aAAa,CAAC,EACvE,kBAAkB,UAAU,KAC1B,cAAc,CAAC,OAAO,CAmCxB,CAAA"}
|