@driveflux/api-functions 0.0.7-next.2 → 0.0.7-next.21
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 +73 -327
- package/dist/auth/emails.js +43 -210
- package/dist/auth/formatter.js +11 -11
- package/dist/auth/otp.js +122 -392
- package/dist/auth/register.d.ts +1 -1
- package/dist/auth/register.js +102 -398
- package/dist/auth/register.js.map +1 -1
- package/dist/auth/tokens.js +115 -430
- package/dist/auth/verifications.js +177 -583
- package/dist/constants.js +5 -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 +24 -168
- 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 +14 -154
- package/dist/mailjet/calls/manage-subscription-status.js.map +1 -1
- package/dist/mailjet/calls/request-service.d.ts +1 -1
- package/dist/mailjet/calls/request-service.d.ts.map +1 -1
- package/dist/mailjet/calls/request-service.js +18 -183
- package/dist/mailjet/refresh-email-preferences.js +26 -225
- 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 +26 -217
- 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/types.js +2 -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 -58
- 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 +41 -217
- package/dist/mailjet/utils/lists.js +30 -249
- 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 -208
- package/dist/mailjet/utils/update-email-references.js.map +1 -1
- package/dist/notion/client.js +48 -197
- package/dist/notion/helpful.js +29 -170
- package/dist/notion/schemas/block.js +49 -43
- package/dist/notion/schemas/common.js +17 -14
- package/dist/notion/schemas/database.js +125 -159
- package/dist/notion/schemas/emoji.js +3 -2
- package/dist/notion/schemas/file.js +10 -10
- package/dist/notion/schemas/kb.js +9 -8
- package/dist/notion/schemas/page.js +126 -171
- package/dist/notion/schemas/parent.js +9 -8
- package/dist/notion/schemas/user.js +21 -20
- package/dist/reservation/agree.d.ts +1 -1
- package/dist/reservation/agree.d.ts.map +1 -1
- package/dist/reservation/agree.js +19 -158
- package/dist/reservation/checks.d.ts +1 -1
- package/dist/reservation/checks.d.ts.map +1 -1
- package/dist/reservation/checks.js +23 -178
- package/dist/reservation/display-vehicle.d.ts +17 -17
- package/dist/reservation/display-vehicle.js +142 -514
- 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 +199 -482
- 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 +198 -496
- 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 +28 -177
- package/dist/reservation/reserve.d.ts +1 -1
- package/dist/reservation/reserve.d.ts.map +1 -1
- package/dist/reservation/reserve.js +36 -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/types.js +2 -1
- package/dist/reservation/vehicle.d.ts +1 -1
- package/dist/reservation/vehicle.d.ts.map +1 -1
- package/dist/reservation/vehicle.js +26 -188
- package/dist/reservation/vehicle.js.map +1 -1
- package/dist/slack.d.ts +2 -2
- package/dist/slack.d.ts.map +1 -1
- package/dist/slack.js +67 -273
- package/dist/validation.d.ts +4 -4
- package/dist/validation.d.ts.map +1 -1
- package/dist/validation.js +89 -139
- package/dist/validation.js.map +1 -1
- 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 +33 -36
- 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 +101 -259
- package/dist/vehicle/vehicle-pricing/index.js.map +1 -1
- package/dist/vehicle/vehicle-pricing/types.js +2 -1
- package/package.json +21 -21
|
@@ -1,123 +1,81 @@
|
|
|
1
|
-
function _define_property(obj, key, value) {
|
|
2
|
-
if (key in obj) {
|
|
3
|
-
Object.defineProperty(obj, key, {
|
|
4
|
-
value: value,
|
|
5
|
-
enumerable: true,
|
|
6
|
-
configurable: true,
|
|
7
|
-
writable: true
|
|
8
|
-
});
|
|
9
|
-
} else {
|
|
10
|
-
obj[key] = value;
|
|
11
|
-
}
|
|
12
|
-
return obj;
|
|
13
|
-
}
|
|
14
|
-
function _object_spread(target) {
|
|
15
|
-
for(var i = 1; i < arguments.length; i++){
|
|
16
|
-
var source = arguments[i] != null ? arguments[i] : {};
|
|
17
|
-
var ownKeys = Object.keys(source);
|
|
18
|
-
if (typeof Object.getOwnPropertySymbols === "function") {
|
|
19
|
-
ownKeys = ownKeys.concat(Object.getOwnPropertySymbols(source).filter(function(sym) {
|
|
20
|
-
return Object.getOwnPropertyDescriptor(source, sym).enumerable;
|
|
21
|
-
}));
|
|
22
|
-
}
|
|
23
|
-
ownKeys.forEach(function(key) {
|
|
24
|
-
_define_property(target, key, source[key]);
|
|
25
|
-
});
|
|
26
|
-
}
|
|
27
|
-
return target;
|
|
28
|
-
}
|
|
29
|
-
function ownKeys(object, enumerableOnly) {
|
|
30
|
-
var keys = Object.keys(object);
|
|
31
|
-
if (Object.getOwnPropertySymbols) {
|
|
32
|
-
var symbols = Object.getOwnPropertySymbols(object);
|
|
33
|
-
if (enumerableOnly) {
|
|
34
|
-
symbols = symbols.filter(function(sym) {
|
|
35
|
-
return Object.getOwnPropertyDescriptor(object, sym).enumerable;
|
|
36
|
-
});
|
|
37
|
-
}
|
|
38
|
-
keys.push.apply(keys, symbols);
|
|
39
|
-
}
|
|
40
|
-
return keys;
|
|
41
|
-
}
|
|
42
|
-
function _object_spread_props(target, source) {
|
|
43
|
-
source = source != null ? source : {};
|
|
44
|
-
if (Object.getOwnPropertyDescriptors) {
|
|
45
|
-
Object.defineProperties(target, Object.getOwnPropertyDescriptors(source));
|
|
46
|
-
} else {
|
|
47
|
-
ownKeys(Object(source)).forEach(function(key) {
|
|
48
|
-
Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));
|
|
49
|
-
});
|
|
50
|
-
}
|
|
51
|
-
return target;
|
|
52
|
-
}
|
|
53
1
|
import { z } from 'zod';
|
|
54
2
|
import { notionRichTextSchema } from './block.js';
|
|
55
|
-
import { commonPropertyValues, notionCommonColorEnum, notionDateFormat, notionDateSchema, notionTimeFormat } from './common.js';
|
|
3
|
+
import { commonPropertyValues, notionCommonColorEnum, notionDateFormat, notionDateSchema, notionTimeFormat, } from './common.js';
|
|
56
4
|
import { notionEmojiSchema } from './emoji.js';
|
|
57
5
|
import { notionFileSchema } from './file.js';
|
|
58
6
|
import { notionDatabaseParentSchema } from './parent.js';
|
|
59
7
|
import { notionPartialUserSchema, notionUserSchema } from './user.js';
|
|
60
|
-
export
|
|
61
|
-
checkbox
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
})
|
|
72
|
-
export
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
8
|
+
export const notionPagePropertyCheckboxSchema = z.object({
|
|
9
|
+
...commonPropertyValues('checkbox'),
|
|
10
|
+
checkbox: z.boolean(),
|
|
11
|
+
});
|
|
12
|
+
export const notionPagePropertyCreatedBySchema = z.object({
|
|
13
|
+
...commonPropertyValues('created_by'),
|
|
14
|
+
created_by: notionUserSchema,
|
|
15
|
+
});
|
|
16
|
+
export const notionPagePropertyCreatedTimeSchema = z.object({
|
|
17
|
+
...commonPropertyValues('created_time'),
|
|
18
|
+
created_time: notionTimeFormat,
|
|
19
|
+
});
|
|
20
|
+
export const notionPagePropertyDateSchema = z.object({
|
|
21
|
+
...commonPropertyValues('date'),
|
|
22
|
+
date: notionDateSchema.nullable(),
|
|
23
|
+
});
|
|
24
|
+
export const notionPagePropertyEmailSchema = z.object({
|
|
25
|
+
...commonPropertyValues('email'),
|
|
26
|
+
email: z.string(),
|
|
27
|
+
});
|
|
28
|
+
export const notionPagePropertyFilesSchema = z.object({
|
|
29
|
+
...commonPropertyValues('files'),
|
|
30
|
+
files: z.array(notionFileSchema),
|
|
31
|
+
});
|
|
32
|
+
export const notionPagePropertyFormulaSchema = z.object({
|
|
33
|
+
...commonPropertyValues('formula'),
|
|
79
34
|
formula: z.object({
|
|
80
|
-
type: z.enum([
|
|
81
|
-
'boolean',
|
|
82
|
-
'date',
|
|
83
|
-
'number',
|
|
84
|
-
'string'
|
|
85
|
-
]),
|
|
35
|
+
type: z.enum(['boolean', 'date', 'number', 'string']),
|
|
86
36
|
boolean: z.boolean().optional(),
|
|
87
37
|
date: notionDateFormat.optional(),
|
|
88
38
|
number: z.number().optional(),
|
|
89
|
-
string: z.string().optional()
|
|
90
|
-
})
|
|
91
|
-
})
|
|
92
|
-
export
|
|
93
|
-
last_edited_by
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
39
|
+
string: z.string().optional(),
|
|
40
|
+
}),
|
|
41
|
+
});
|
|
42
|
+
export const notionPagePropertyLastEditedBySchema = z.object({
|
|
43
|
+
...commonPropertyValues('last_edited_by'),
|
|
44
|
+
last_edited_by: notionUserSchema,
|
|
45
|
+
});
|
|
46
|
+
export const notionPagePropertyLastEditedTimeSchema = z.object({
|
|
47
|
+
...commonPropertyValues('last_edited_time'),
|
|
48
|
+
last_edited_time: notionTimeFormat,
|
|
49
|
+
});
|
|
50
|
+
export const notionPagePropertyMultiSelectSchema = z.object({
|
|
51
|
+
...commonPropertyValues('multi_select'),
|
|
99
52
|
multi_select: z.array(z.object({
|
|
100
53
|
id: z.string(),
|
|
101
54
|
name: z.string(),
|
|
102
|
-
color: notionCommonColorEnum
|
|
103
|
-
}))
|
|
104
|
-
})
|
|
105
|
-
export
|
|
106
|
-
number
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
55
|
+
color: notionCommonColorEnum,
|
|
56
|
+
})),
|
|
57
|
+
});
|
|
58
|
+
export const notionPagePropertyNumberSchema = z.object({
|
|
59
|
+
...commonPropertyValues('number'),
|
|
60
|
+
number: z.number().nullable(),
|
|
61
|
+
});
|
|
62
|
+
export const notionPagePropertyPeopleSchema = z.object({
|
|
63
|
+
...commonPropertyValues('people'),
|
|
64
|
+
people: z.array(notionUserSchema),
|
|
65
|
+
});
|
|
66
|
+
export const notionPagePropertyPhoneNumberSchema = z.object({
|
|
67
|
+
...commonPropertyValues('phone_number'),
|
|
68
|
+
phone_number: z.string(),
|
|
69
|
+
});
|
|
70
|
+
export const notionPagePropertyRelationSchema = z.object({
|
|
71
|
+
...commonPropertyValues('relation'),
|
|
115
72
|
relation: z.array(z.object({
|
|
116
|
-
id: z.string()
|
|
73
|
+
id: z.string(),
|
|
117
74
|
})),
|
|
118
|
-
has_more: z.boolean()
|
|
119
|
-
})
|
|
120
|
-
export
|
|
75
|
+
has_more: z.boolean(),
|
|
76
|
+
});
|
|
77
|
+
export const notionPagePropertyRollupSchema = z.object({
|
|
78
|
+
...commonPropertyValues('rollup'),
|
|
121
79
|
rollup: z.object({
|
|
122
80
|
array: z.array(z.any()).optional(),
|
|
123
81
|
date: notionDateFormat.optional(),
|
|
@@ -148,79 +106,76 @@ export var notionPagePropertyRollupSchema = z.object(_object_spread_props(_objec
|
|
|
148
106
|
'show_unique',
|
|
149
107
|
'sum',
|
|
150
108
|
'unchecked',
|
|
151
|
-
'unique'
|
|
109
|
+
'unique',
|
|
152
110
|
]),
|
|
153
|
-
type: z.enum([
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
}));
|
|
165
|
-
export var notionPagePropertySelectSchema = z.object(_object_spread_props(_object_spread({}, commonPropertyValues('select')), {
|
|
166
|
-
select: z.object({
|
|
111
|
+
type: z.enum(['array', 'date', 'incomplete', 'number', 'unsupported']),
|
|
112
|
+
}),
|
|
113
|
+
});
|
|
114
|
+
export const notionPagePropertyRichTextSchema = z.object({
|
|
115
|
+
...commonPropertyValues('rich_text'),
|
|
116
|
+
rich_text: z.array(notionRichTextSchema),
|
|
117
|
+
});
|
|
118
|
+
export const notionPagePropertySelectSchema = z.object({
|
|
119
|
+
...commonPropertyValues('select'),
|
|
120
|
+
select: z
|
|
121
|
+
.object({
|
|
167
122
|
id: z.string(),
|
|
168
123
|
name: z.string(),
|
|
169
|
-
color: notionCommonColorEnum
|
|
170
|
-
})
|
|
171
|
-
|
|
172
|
-
|
|
124
|
+
color: notionCommonColorEnum,
|
|
125
|
+
})
|
|
126
|
+
.nullable(),
|
|
127
|
+
});
|
|
128
|
+
export const notionPagePropertyStatusSchema = z.object({
|
|
129
|
+
...commonPropertyValues('status'),
|
|
173
130
|
status: z.object({
|
|
174
131
|
id: z.string(),
|
|
175
132
|
name: z.string(),
|
|
176
|
-
color: notionCommonColorEnum
|
|
177
|
-
})
|
|
178
|
-
})
|
|
179
|
-
export
|
|
180
|
-
title
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
133
|
+
color: notionCommonColorEnum,
|
|
134
|
+
}),
|
|
135
|
+
});
|
|
136
|
+
export const notionPagePropertyTitleSchema = z.object({
|
|
137
|
+
...commonPropertyValues('title'),
|
|
138
|
+
title: z.array(notionRichTextSchema),
|
|
139
|
+
});
|
|
140
|
+
export const notionPagePropertyUrlSchema = z.object({
|
|
141
|
+
...commonPropertyValues('url'),
|
|
142
|
+
url: z.string().url().nullable(),
|
|
143
|
+
});
|
|
144
|
+
export const notionPagePropertyUniqueIdSchema = z.object({
|
|
145
|
+
...commonPropertyValues('unique_id'),
|
|
186
146
|
unique_id: z.object({
|
|
187
147
|
number: z.number(),
|
|
188
|
-
prefix: z.string().nullable().optional()
|
|
189
|
-
})
|
|
190
|
-
})
|
|
191
|
-
export
|
|
148
|
+
prefix: z.string().nullable().optional(),
|
|
149
|
+
}),
|
|
150
|
+
});
|
|
151
|
+
export const notionPagePropertyVerificationSchema = z.object({
|
|
152
|
+
...commonPropertyValues('verification'),
|
|
192
153
|
verification: z.object({
|
|
193
|
-
state: z.enum([
|
|
194
|
-
'verified',
|
|
195
|
-
'unverified'
|
|
196
|
-
]),
|
|
154
|
+
state: z.enum(['verified', 'unverified']),
|
|
197
155
|
verified_by: notionUserSchema.nullable(),
|
|
198
|
-
date: notionDateSchema
|
|
199
|
-
})
|
|
200
|
-
})
|
|
201
|
-
export
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
results: z.array(notionPageSchema(properties))
|
|
225
|
-
});
|
|
226
|
-
};
|
|
156
|
+
date: notionDateSchema,
|
|
157
|
+
}),
|
|
158
|
+
});
|
|
159
|
+
export const notionPageSchema = (properties) => z.object({
|
|
160
|
+
object: z.literal('page'),
|
|
161
|
+
id: z.string(),
|
|
162
|
+
created_time: notionTimeFormat,
|
|
163
|
+
created_by: notionPartialUserSchema,
|
|
164
|
+
last_edited_time: notionTimeFormat,
|
|
165
|
+
last_edited_by: notionPartialUserSchema,
|
|
166
|
+
archived: z.boolean(),
|
|
167
|
+
icon: notionFileSchema.or(notionEmojiSchema).nullable(),
|
|
168
|
+
properties,
|
|
169
|
+
parent: notionDatabaseParentSchema,
|
|
170
|
+
url: z.string().url(),
|
|
171
|
+
public_url: z.string().nullable(),
|
|
172
|
+
});
|
|
173
|
+
export const notionPagesSchema = (properties) => z.object({
|
|
174
|
+
has_more: z.boolean(),
|
|
175
|
+
next_cursor: z.string().nullable(),
|
|
176
|
+
object: z.literal('list'),
|
|
177
|
+
page_or_database: z.object({}),
|
|
178
|
+
type: z.literal('page_or_database'),
|
|
179
|
+
results: z.array(notionPageSchema(properties)),
|
|
180
|
+
});
|
|
181
|
+
//# sourceMappingURL=page.js.map
|
|
@@ -1,17 +1,18 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
|
-
export
|
|
2
|
+
export const notionDatabaseParentSchema = z.object({
|
|
3
3
|
type: z.literal('database_id'),
|
|
4
|
-
database_id: z.string()
|
|
4
|
+
database_id: z.string(),
|
|
5
5
|
});
|
|
6
|
-
export
|
|
6
|
+
export const notionPageParentSchema = z.object({
|
|
7
7
|
type: z.literal('page_id'),
|
|
8
|
-
page_id: z.string()
|
|
8
|
+
page_id: z.string(),
|
|
9
9
|
});
|
|
10
|
-
export
|
|
10
|
+
export const notionWorkspaceParentSchema = z.object({
|
|
11
11
|
type: z.literal('workspace'),
|
|
12
|
-
workspace: z.literal(true)
|
|
12
|
+
workspace: z.literal(true),
|
|
13
13
|
});
|
|
14
|
-
export
|
|
14
|
+
export const notionBlockParentSchema = z.object({
|
|
15
15
|
type: z.literal('block_id'),
|
|
16
|
-
block_id: z.string()
|
|
16
|
+
block_id: z.string(),
|
|
17
17
|
});
|
|
18
|
+
//# sourceMappingURL=parent.js.map
|
|
@@ -1,30 +1,31 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
|
-
export
|
|
2
|
+
export const notionPartialUserSchema = z.object({
|
|
3
3
|
object: z.literal('user'),
|
|
4
|
-
user: z.string().optional()
|
|
4
|
+
user: z.string().optional(),
|
|
5
5
|
});
|
|
6
|
-
export
|
|
6
|
+
export const notionUserSchema = z.object({
|
|
7
7
|
object: z.literal('user'),
|
|
8
8
|
id: z.string(),
|
|
9
|
-
type: z.enum([
|
|
10
|
-
'person',
|
|
11
|
-
'bot'
|
|
12
|
-
]).optional(),
|
|
9
|
+
type: z.enum(['person', 'bot']).optional(),
|
|
13
10
|
name: z.string().optional(),
|
|
14
11
|
avatar_url: z.string().nullable().optional(),
|
|
15
12
|
// type person
|
|
16
|
-
person: z
|
|
17
|
-
|
|
18
|
-
|
|
13
|
+
person: z
|
|
14
|
+
.object({
|
|
15
|
+
email: z.string().email(),
|
|
16
|
+
})
|
|
17
|
+
.optional(),
|
|
19
18
|
// type bot
|
|
20
|
-
bot: z
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
workspace_name: z.string().optional()
|
|
29
|
-
})
|
|
19
|
+
bot: z
|
|
20
|
+
.object({
|
|
21
|
+
owner: z
|
|
22
|
+
.object({
|
|
23
|
+
type: z.enum(['workspace', 'user']),
|
|
24
|
+
workspace: z.boolean(),
|
|
25
|
+
})
|
|
26
|
+
.optional(),
|
|
27
|
+
workspace_name: z.string().optional(),
|
|
28
|
+
})
|
|
29
|
+
.optional(),
|
|
30
30
|
});
|
|
31
|
+
//# sourceMappingURL=user.js.map
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import type { ReserveVehicleParams } from './types';
|
|
1
|
+
import type { ReserveVehicleParams } from './types.js';
|
|
2
2
|
export declare const handleAgreeToTerms: ({ agreedToTerms, subscribingUser, ipAddress, }: Pick<ReserveVehicleParams, "agreedToTerms" | "subscribingUser" | "ipAddress">) => Promise<void>;
|
|
3
3
|
//# sourceMappingURL=agree.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"agree.d.ts","sourceRoot":"","sources":["../../src/reservation/agree.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"agree.d.ts","sourceRoot":"","sources":["../../src/reservation/agree.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,YAAY,CAAA;AAEtD,eAAO,MAAM,kBAAkB,GAAU,gDAItC,IAAI,CACN,oBAAoB,EACpB,eAAe,GAAG,iBAAiB,GAAG,WAAW,CACjD,kBAmBA,CAAA"}
|
|
@@ -1,162 +1,23 @@
|
|
|
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 { generateId } from '@driveflux/db/id';
|
|
123
|
-
export
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
consented: true,
|
|
141
|
-
consents: {
|
|
142
|
-
create: {
|
|
143
|
-
id: generateId('UserConsent'),
|
|
144
|
-
ipAddress: ipAddress,
|
|
145
|
-
consentType: 'terms',
|
|
146
|
-
email: subscribingUser.email
|
|
147
|
-
}
|
|
148
|
-
}
|
|
149
|
-
}
|
|
150
|
-
})
|
|
151
|
-
];
|
|
152
|
-
case 1:
|
|
153
|
-
subscribingUser = _state.sent();
|
|
154
|
-
_state.label = 2;
|
|
155
|
-
case 2:
|
|
156
|
-
return [
|
|
157
|
-
2
|
|
158
|
-
];
|
|
159
|
-
}
|
|
3
|
+
export const handleAgreeToTerms = async ({ agreedToTerms, subscribingUser, ipAddress, }) => {
|
|
4
|
+
if (agreedToTerms && !subscribingUser.consented) {
|
|
5
|
+
subscribingUser = await prisma.user.update({
|
|
6
|
+
where: {
|
|
7
|
+
id: subscribingUser.id,
|
|
8
|
+
},
|
|
9
|
+
data: {
|
|
10
|
+
consented: true,
|
|
11
|
+
consents: {
|
|
12
|
+
create: {
|
|
13
|
+
id: generateId('UserConsent'),
|
|
14
|
+
ipAddress,
|
|
15
|
+
consentType: 'terms',
|
|
16
|
+
email: subscribingUser.email,
|
|
17
|
+
},
|
|
18
|
+
},
|
|
19
|
+
},
|
|
160
20
|
});
|
|
161
|
-
}
|
|
21
|
+
}
|
|
162
22
|
};
|
|
23
|
+
//# sourceMappingURL=agree.js.map
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { Host, PlanType, Vehicle } 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 checkIfUserCanReserve: ({ requestUser, subscribingUser, }: Pick<ReserveVehicleParams, "requestUser" | "subscribingUser">) => Promise<import("@driveflux/auth/authorization/types").AppAbility>;
|
|
5
5
|
export declare const checkIfVehicleIsAvailableForReservation: (vehicle: Vehicle & {
|
|
6
6
|
host: Pick<Host, "id"> | null;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"checks.d.ts","sourceRoot":"","sources":["../../src/reservation/checks.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,IAAI,EAAE,QAAQ,EAAQ,OAAO,EAAE,MAAM,eAAe,CAAA;AAMlE,OAAO,EAAW,KAAK,cAAc,EAAE,MAAM,mBAAmB,CAAA;AAChE,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"checks.d.ts","sourceRoot":"","sources":["../../src/reservation/checks.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,IAAI,EAAE,QAAQ,EAAQ,OAAO,EAAE,MAAM,eAAe,CAAA;AAMlE,OAAO,EAAW,KAAK,cAAc,EAAE,MAAM,mBAAmB,CAAA;AAChE,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,YAAY,CAAA;AAEtD,eAAO,MAAM,qBAAqB,GAAU,mCAGzC,IAAI,CAAC,oBAAoB,EAAE,aAAa,GAAG,iBAAiB,CAAC,sEAU/D,CAAA;AAED,eAAO,MAAM,uCAAuC,GACnD,SAAS,OAAO,GAAG;IAAE,IAAI,EAAE,IAAI,CAAC,IAAI,EAAE,IAAI,CAAC,GAAG,IAAI,CAAA;CAAE,EACpD,MAAM,QAAQ,EACd,gBAAgB,OAAO,KACrB,cAAc,CAAC,OAAO,CAuCxB,CAAA"}
|