@driveflux/api-functions 0.0.7-next.3 → 0.0.7-next.30
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 +24 -29
- package/dist/auth/emails.js +12 -13
- package/dist/auth/formatter.js +5 -5
- package/dist/auth/otp.js +66 -50
- package/dist/auth/register.d.ts +1 -1
- package/dist/auth/register.js +44 -36
- package/dist/auth/register.js.map +1 -1
- package/dist/auth/tokens.js +58 -55
- package/dist/auth/verifications.js +53 -52
- package/dist/constants.js +0 -1
- 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 +7 -8
- 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 +6 -7
- 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 +7 -6
- package/dist/mailjet/refresh-email-preferences.js +11 -12
- 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 +14 -15
- 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 +1 -2
- 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 +8 -6
- 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 +14 -15
- package/dist/mailjet/utils/lists.js +7 -8
- 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 +16 -15
- package/dist/mailjet/utils/update-email-references.js.map +1 -1
- package/dist/notion/client.js +22 -19
- package/dist/notion/helpful.js +6 -9
- package/dist/notion/schemas/block.js +42 -48
- package/dist/notion/schemas/common.js +9 -14
- package/dist/notion/schemas/database.js +62 -60
- package/dist/notion/schemas/emoji.js +1 -2
- package/dist/notion/schemas/file.js +9 -9
- package/dist/notion/schemas/kb.js +5 -6
- package/dist/notion/schemas/page.js +72 -61
- package/dist/notion/schemas/parent.js +4 -5
- package/dist/notion/schemas/user.js +18 -19
- package/dist/reservation/agree.d.ts +1 -1
- package/dist/reservation/agree.d.ts.map +1 -1
- package/dist/reservation/agree.js +6 -7
- package/dist/reservation/checks.d.ts +1 -1
- package/dist/reservation/checks.d.ts.map +1 -1
- package/dist/reservation/checks.js +3 -4
- package/dist/reservation/display-vehicle.js +65 -71
- package/dist/reservation/display-vehicle.js.map +1 -1
- package/dist/reservation/fetch-or-create.d.ts +1 -1
- package/dist/reservation/fetch-or-create.d.ts.map +1 -1
- package/dist/reservation/fetch-or-create.js +51 -55
- package/dist/reservation/fetch-or-create.js.map +1 -1
- package/dist/reservation/invoice.d.ts +3 -2
- package/dist/reservation/invoice.d.ts.map +1 -1
- package/dist/reservation/invoice.js +64 -76
- 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 +5 -6
- package/dist/reservation/reserve.d.ts +1 -1
- package/dist/reservation/reserve.d.ts.map +1 -1
- package/dist/reservation/reserve.js +8 -9
- package/dist/reservation/reserve.js.map +1 -1
- package/dist/reservation/types.js +1 -2
- package/dist/reservation/vehicle.d.ts +1 -1
- package/dist/reservation/vehicle.d.ts.map +1 -1
- package/dist/reservation/vehicle.js +15 -18
- 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 +24 -29
- package/dist/validation.d.ts +4 -4
- package/dist/validation.d.ts.map +1 -1
- package/dist/validation.js +77 -71
- 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 +22 -19
- 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 +30 -44
- package/dist/vehicle/vehicle-pricing/index.js.map +1 -1
- package/dist/vehicle/vehicle-pricing/types.js +1 -2
- package/package.json +21 -21
|
@@ -1,47 +1,47 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
2
|
import { notionRichTextSchema } from './block.js';
|
|
3
|
-
import { commonPropertyValues, notionCommonColorEnum, notionTimeFormat
|
|
3
|
+
import { commonPropertyValues, notionCommonColorEnum, notionTimeFormat } from './common.js';
|
|
4
4
|
import { notionEmojiSchema } from './emoji.js';
|
|
5
5
|
import { notionFileSchema } from './file.js';
|
|
6
6
|
import { notionWorkspaceParentSchema } from './parent.js';
|
|
7
7
|
import { notionPartialUserSchema } from './user.js';
|
|
8
8
|
export const notionDatabasePropertyCheckboxSchema = z.object({
|
|
9
9
|
...commonPropertyValues('checkbox'),
|
|
10
|
-
checkbox: z.object({})
|
|
10
|
+
checkbox: z.object({})
|
|
11
11
|
});
|
|
12
12
|
export const notionDatabasePropertyCreatedBySchema = z.object({
|
|
13
13
|
...commonPropertyValues('created_by'),
|
|
14
|
-
created_by: z.object({})
|
|
14
|
+
created_by: z.object({})
|
|
15
15
|
});
|
|
16
16
|
export const notionDatabasePropertyCreatedTimeSchema = z.object({
|
|
17
17
|
...commonPropertyValues('created_time'),
|
|
18
|
-
created_time: z.object({})
|
|
18
|
+
created_time: z.object({})
|
|
19
19
|
});
|
|
20
20
|
export const notionDatabasePropertyDateSchema = z.object({
|
|
21
21
|
...commonPropertyValues('date'),
|
|
22
|
-
date: z.object({})
|
|
22
|
+
date: z.object({})
|
|
23
23
|
});
|
|
24
24
|
export const notionDatabasePropertyEmailSchema = z.object({
|
|
25
25
|
...commonPropertyValues('email'),
|
|
26
|
-
email: z.object({})
|
|
26
|
+
email: z.object({})
|
|
27
27
|
});
|
|
28
28
|
export const notionDatabasePropertyFilesSchema = z.object({
|
|
29
29
|
...commonPropertyValues('files'),
|
|
30
|
-
files: z.object({})
|
|
30
|
+
files: z.object({})
|
|
31
31
|
});
|
|
32
32
|
export const notionDatabasePropertyFormulaSchema = z.object({
|
|
33
33
|
...commonPropertyValues('formula'),
|
|
34
34
|
formula: z.object({
|
|
35
|
-
expression: z.string()
|
|
36
|
-
})
|
|
35
|
+
expression: z.string()
|
|
36
|
+
})
|
|
37
37
|
});
|
|
38
38
|
export const notionDatabasePropertyLastEditedBySchema = z.object({
|
|
39
39
|
...commonPropertyValues('last_edited_by'),
|
|
40
|
-
last_edited_by: z.object({}).optional()
|
|
40
|
+
last_edited_by: z.object({}).optional()
|
|
41
41
|
});
|
|
42
42
|
export const notionDatabasePropertyLastEditedTimeSchema = z.object({
|
|
43
43
|
...commonPropertyValues('last_edited_time'),
|
|
44
|
-
last_edited_time: z.object({})
|
|
44
|
+
last_edited_time: z.object({})
|
|
45
45
|
});
|
|
46
46
|
export const notionDatabasePropertyMultiSelectSchema = z.object({
|
|
47
47
|
...commonPropertyValues('multi_select'),
|
|
@@ -49,9 +49,9 @@ export const notionDatabasePropertyMultiSelectSchema = z.object({
|
|
|
49
49
|
options: z.array(z.object({
|
|
50
50
|
id: z.string(),
|
|
51
51
|
name: z.string(),
|
|
52
|
-
color: notionCommonColorEnum
|
|
53
|
-
}))
|
|
54
|
-
})
|
|
52
|
+
color: notionCommonColorEnum
|
|
53
|
+
}))
|
|
54
|
+
})
|
|
55
55
|
});
|
|
56
56
|
export const notionDatabasePropertyNumberSchema = z.object({
|
|
57
57
|
...commonPropertyValues('number'),
|
|
@@ -96,29 +96,29 @@ export const notionDatabasePropertyNumberSchema = z.object({
|
|
|
96
96
|
'yen,',
|
|
97
97
|
'yuan',
|
|
98
98
|
'won',
|
|
99
|
-
'zloty'
|
|
100
|
-
])
|
|
101
|
-
})
|
|
99
|
+
'zloty'
|
|
100
|
+
])
|
|
101
|
+
})
|
|
102
102
|
});
|
|
103
103
|
export const notionDatabasePropertyPeopleSchema = z.object({
|
|
104
104
|
...commonPropertyValues('people'),
|
|
105
|
-
people: z.object({})
|
|
105
|
+
people: z.object({})
|
|
106
106
|
});
|
|
107
107
|
export const notionDatabasePropertyPhoneNumberSchema = z.object({
|
|
108
108
|
...commonPropertyValues('phone_number'),
|
|
109
|
-
phone_number: z.object({})
|
|
109
|
+
phone_number: z.object({})
|
|
110
110
|
});
|
|
111
111
|
export const notionDatabasePropertyRelationSchema = z.object({
|
|
112
112
|
...commonPropertyValues('relation'),
|
|
113
113
|
relation: z.object({
|
|
114
114
|
database_id: z.string(),
|
|
115
115
|
synced_property_name: z.string().optional(),
|
|
116
|
-
synced_property_id: z.string().optional()
|
|
117
|
-
})
|
|
116
|
+
synced_property_id: z.string().optional()
|
|
117
|
+
})
|
|
118
118
|
});
|
|
119
119
|
export const notionDatabasePropertyRichTextSchema = z.object({
|
|
120
120
|
...commonPropertyValues('rich_text'),
|
|
121
|
-
rich_text: z.object({})
|
|
121
|
+
rich_text: z.object({})
|
|
122
122
|
});
|
|
123
123
|
export const notionDatabasePropertyRollupSchema = z.object({
|
|
124
124
|
...commonPropertyValues('rollup'),
|
|
@@ -151,10 +151,16 @@ export const notionDatabasePropertyRollupSchema = z.object({
|
|
|
151
151
|
'show_unique',
|
|
152
152
|
'sum',
|
|
153
153
|
'unchecked',
|
|
154
|
-
'unique'
|
|
154
|
+
'unique'
|
|
155
155
|
]),
|
|
156
|
-
type: z.enum([
|
|
157
|
-
|
|
156
|
+
type: z.enum([
|
|
157
|
+
'array',
|
|
158
|
+
'date',
|
|
159
|
+
'incomplete',
|
|
160
|
+
'number',
|
|
161
|
+
'unsupported'
|
|
162
|
+
])
|
|
163
|
+
})
|
|
158
164
|
});
|
|
159
165
|
export const notionDatabasePropertySelectSchema = z.object({
|
|
160
166
|
...commonPropertyValues('select'),
|
|
@@ -162,9 +168,9 @@ export const notionDatabasePropertySelectSchema = z.object({
|
|
|
162
168
|
options: z.array(z.object({
|
|
163
169
|
id: z.string(),
|
|
164
170
|
name: z.string(),
|
|
165
|
-
color: notionCommonColorEnum
|
|
166
|
-
}))
|
|
167
|
-
})
|
|
171
|
+
color: notionCommonColorEnum
|
|
172
|
+
}))
|
|
173
|
+
})
|
|
168
174
|
});
|
|
169
175
|
export const notionDatabasePropertyStatusSchema = z.object({
|
|
170
176
|
...commonPropertyValues('status'),
|
|
@@ -172,51 +178,47 @@ export const notionDatabasePropertyStatusSchema = z.object({
|
|
|
172
178
|
options: z.array(z.object({
|
|
173
179
|
id: z.string(),
|
|
174
180
|
name: z.string(),
|
|
175
|
-
color: notionCommonColorEnum
|
|
181
|
+
color: notionCommonColorEnum
|
|
176
182
|
})),
|
|
177
|
-
group: z
|
|
178
|
-
.array(z.object({
|
|
183
|
+
group: z.array(z.object({
|
|
179
184
|
id: z.string(),
|
|
180
185
|
name: z.string(),
|
|
181
186
|
color: notionCommonColorEnum,
|
|
182
|
-
option_ids: z.array(z.string())
|
|
183
|
-
}))
|
|
184
|
-
|
|
185
|
-
.optional(),
|
|
186
|
-
}),
|
|
187
|
+
option_ids: z.array(z.string())
|
|
188
|
+
})).nullable().optional()
|
|
189
|
+
})
|
|
187
190
|
});
|
|
188
191
|
export const notionDatabasePropertyTitleSchema = z.object({
|
|
189
192
|
...commonPropertyValues('title'),
|
|
190
|
-
title: z.object({})
|
|
193
|
+
title: z.object({})
|
|
191
194
|
});
|
|
192
195
|
export const notionDatabasePropertyUrlSchema = z.object({
|
|
193
196
|
...commonPropertyValues('url'),
|
|
194
|
-
url: z.object({})
|
|
197
|
+
url: z.object({})
|
|
195
198
|
});
|
|
196
199
|
export const notionDatabasePropertyUniqueIdSchema = z.object({
|
|
197
200
|
...commonPropertyValues('unique_id'),
|
|
198
|
-
unique_id: z.object({})
|
|
201
|
+
unique_id: z.object({})
|
|
199
202
|
});
|
|
200
203
|
export const notionDatabasePropertyVerificationSchema = z.object({
|
|
201
204
|
...commonPropertyValues('verification'),
|
|
202
|
-
verification: z.object({})
|
|
203
|
-
});
|
|
204
|
-
export const notionDatabaseSchema = (properties)
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
});
|
|
222
|
-
//# sourceMappingURL=database.js.map
|
|
205
|
+
verification: z.object({})
|
|
206
|
+
});
|
|
207
|
+
export const notionDatabaseSchema = (properties)=>z.object({
|
|
208
|
+
object: z.literal('database'),
|
|
209
|
+
id: z.string(),
|
|
210
|
+
created_time: notionTimeFormat,
|
|
211
|
+
created_by: notionPartialUserSchema,
|
|
212
|
+
last_edited_time: notionTimeFormat,
|
|
213
|
+
last_edited_by: notionPartialUserSchema,
|
|
214
|
+
title: z.array(notionRichTextSchema),
|
|
215
|
+
description: z.array(notionRichTextSchema),
|
|
216
|
+
icon: notionFileSchema.or(notionEmojiSchema),
|
|
217
|
+
cover: notionFileSchema.nullable(),
|
|
218
|
+
properties,
|
|
219
|
+
parent: notionWorkspaceParentSchema,
|
|
220
|
+
url: z.string().url(),
|
|
221
|
+
archived: z.boolean(),
|
|
222
|
+
is_inline: z.boolean(),
|
|
223
|
+
public_url: z.string().nullable()
|
|
224
|
+
});
|
|
@@ -1,18 +1,18 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
2
|
import { notionTimeFormat } from './common.js';
|
|
3
3
|
export const notionFileSchema = z.object({
|
|
4
|
-
type: z.enum([
|
|
4
|
+
type: z.enum([
|
|
5
|
+
'file',
|
|
6
|
+
'external'
|
|
7
|
+
]),
|
|
5
8
|
name: z.string().optional(),
|
|
6
9
|
// type file
|
|
7
|
-
file: z
|
|
8
|
-
.object({
|
|
10
|
+
file: z.object({
|
|
9
11
|
url: z.string().url(),
|
|
10
|
-
expiry_time: notionTimeFormat
|
|
11
|
-
})
|
|
12
|
-
.optional(),
|
|
12
|
+
expiry_time: notionTimeFormat
|
|
13
|
+
}).optional(),
|
|
13
14
|
// type external
|
|
14
15
|
external: z.object({
|
|
15
|
-
url: z.string().url()
|
|
16
|
-
})
|
|
16
|
+
url: z.string().url()
|
|
17
|
+
})
|
|
17
18
|
});
|
|
18
|
-
//# sourceMappingURL=file.js.map
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
|
-
import { notionDatabasePropertyCheckboxSchema, notionDatabasePropertyCreatedBySchema, notionDatabasePropertyCreatedTimeSchema, notionDatabasePropertyDateSchema, notionDatabasePropertyFormulaSchema, notionDatabasePropertyLastEditedBySchema, notionDatabasePropertyLastEditedTimeSchema, notionDatabasePropertyMultiSelectSchema, notionDatabasePropertyNumberSchema, notionDatabasePropertyRelationSchema, notionDatabasePropertySelectSchema, notionDatabasePropertyStatusSchema, notionDatabasePropertyTitleSchema, notionDatabasePropertyUniqueIdSchema, notionDatabaseSchema
|
|
3
|
-
import { notionPagePropertyCheckboxSchema, notionPagePropertyCreatedBySchema, notionPagePropertyCreatedTimeSchema, notionPagePropertyDateSchema, notionPagePropertyFormulaSchema, notionPagePropertyLastEditedBySchema, notionPagePropertyLastEditedTimeSchema, notionPagePropertyMultiSelectSchema, notionPagePropertyNumberSchema, notionPagePropertyRelationSchema, notionPagePropertyRichTextSchema, notionPagePropertySelectSchema, notionPagePropertyStatusSchema, notionPagePropertyTitleSchema, notionPagePropertyUniqueIdSchema, notionPageSchema, notionPagesSchema
|
|
2
|
+
import { notionDatabasePropertyCheckboxSchema, notionDatabasePropertyCreatedBySchema, notionDatabasePropertyCreatedTimeSchema, notionDatabasePropertyDateSchema, notionDatabasePropertyFormulaSchema, notionDatabasePropertyLastEditedBySchema, notionDatabasePropertyLastEditedTimeSchema, notionDatabasePropertyMultiSelectSchema, notionDatabasePropertyNumberSchema, notionDatabasePropertyRelationSchema, notionDatabasePropertySelectSchema, notionDatabasePropertyStatusSchema, notionDatabasePropertyTitleSchema, notionDatabasePropertyUniqueIdSchema, notionDatabaseSchema } from './database.js';
|
|
3
|
+
import { notionPagePropertyCheckboxSchema, notionPagePropertyCreatedBySchema, notionPagePropertyCreatedTimeSchema, notionPagePropertyDateSchema, notionPagePropertyFormulaSchema, notionPagePropertyLastEditedBySchema, notionPagePropertyLastEditedTimeSchema, notionPagePropertyMultiSelectSchema, notionPagePropertyNumberSchema, notionPagePropertyRelationSchema, notionPagePropertyRichTextSchema, notionPagePropertySelectSchema, notionPagePropertyStatusSchema, notionPagePropertyTitleSchema, notionPagePropertyUniqueIdSchema, notionPageSchema, notionPagesSchema } from './page.js';
|
|
4
4
|
export const knowledgeBaseRetrieveDatabaseSchema = notionDatabaseSchema(z.object({
|
|
5
5
|
Title: notionDatabasePropertyTitleSchema,
|
|
6
6
|
Status: notionDatabasePropertyStatusSchema,
|
|
@@ -22,7 +22,7 @@ export const knowledgeBaseRetrieveDatabaseSchema = notionDatabaseSchema(z.object
|
|
|
22
22
|
'Section Slug': notionDatabasePropertyFormulaSchema,
|
|
23
23
|
'Topic Slug': notionDatabasePropertyFormulaSchema,
|
|
24
24
|
Helpful: notionDatabasePropertyNumberSchema,
|
|
25
|
-
Unhelpful: notionDatabasePropertyNumberSchema
|
|
25
|
+
Unhelpful: notionDatabasePropertyNumberSchema
|
|
26
26
|
}));
|
|
27
27
|
export const knowledgeBaseRetrievePageSchema = notionPageSchema(z.object({
|
|
28
28
|
Title: notionPagePropertyTitleSchema,
|
|
@@ -46,7 +46,7 @@ export const knowledgeBaseRetrievePageSchema = notionPageSchema(z.object({
|
|
|
46
46
|
'Section Slug': notionPagePropertyFormulaSchema,
|
|
47
47
|
'Topic Slug': notionPagePropertyFormulaSchema,
|
|
48
48
|
Helpful: notionPagePropertyNumberSchema,
|
|
49
|
-
Unhelpful: notionPagePropertyNumberSchema
|
|
49
|
+
Unhelpful: notionPagePropertyNumberSchema
|
|
50
50
|
}));
|
|
51
51
|
export const knowledgeBaseQueryDatabaseSchema = notionPagesSchema(z.object({
|
|
52
52
|
Title: notionPagePropertyTitleSchema,
|
|
@@ -69,6 +69,5 @@ export const knowledgeBaseQueryDatabaseSchema = notionPagesSchema(z.object({
|
|
|
69
69
|
'Section Slug': notionPagePropertyFormulaSchema,
|
|
70
70
|
'Topic Slug': notionPagePropertyFormulaSchema,
|
|
71
71
|
Helpful: notionPagePropertyNumberSchema,
|
|
72
|
-
Unhelpful: notionPagePropertyNumberSchema
|
|
72
|
+
Unhelpful: notionPagePropertyNumberSchema
|
|
73
73
|
}));
|
|
74
|
-
//# sourceMappingURL=kb.js.map
|
|
@@ -1,78 +1,83 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
2
|
import { notionRichTextSchema } from './block.js';
|
|
3
|
-
import { commonPropertyValues, notionCommonColorEnum, notionDateFormat, notionDateSchema, notionTimeFormat
|
|
3
|
+
import { commonPropertyValues, notionCommonColorEnum, notionDateFormat, notionDateSchema, notionTimeFormat } from './common.js';
|
|
4
4
|
import { notionEmojiSchema } from './emoji.js';
|
|
5
5
|
import { notionFileSchema } from './file.js';
|
|
6
6
|
import { notionDatabaseParentSchema } from './parent.js';
|
|
7
7
|
import { notionPartialUserSchema, notionUserSchema } from './user.js';
|
|
8
8
|
export const notionPagePropertyCheckboxSchema = z.object({
|
|
9
9
|
...commonPropertyValues('checkbox'),
|
|
10
|
-
checkbox: z.boolean()
|
|
10
|
+
checkbox: z.boolean()
|
|
11
11
|
});
|
|
12
12
|
export const notionPagePropertyCreatedBySchema = z.object({
|
|
13
13
|
...commonPropertyValues('created_by'),
|
|
14
|
-
created_by: notionUserSchema
|
|
14
|
+
created_by: notionUserSchema
|
|
15
15
|
});
|
|
16
16
|
export const notionPagePropertyCreatedTimeSchema = z.object({
|
|
17
17
|
...commonPropertyValues('created_time'),
|
|
18
|
-
created_time: notionTimeFormat
|
|
18
|
+
created_time: notionTimeFormat
|
|
19
19
|
});
|
|
20
20
|
export const notionPagePropertyDateSchema = z.object({
|
|
21
21
|
...commonPropertyValues('date'),
|
|
22
|
-
date: notionDateSchema.nullable()
|
|
22
|
+
date: notionDateSchema.nullable()
|
|
23
23
|
});
|
|
24
24
|
export const notionPagePropertyEmailSchema = z.object({
|
|
25
25
|
...commonPropertyValues('email'),
|
|
26
|
-
email: z.string()
|
|
26
|
+
email: z.string()
|
|
27
27
|
});
|
|
28
28
|
export const notionPagePropertyFilesSchema = z.object({
|
|
29
29
|
...commonPropertyValues('files'),
|
|
30
|
-
files: z.array(notionFileSchema)
|
|
30
|
+
files: z.array(notionFileSchema)
|
|
31
31
|
});
|
|
32
32
|
export const notionPagePropertyFormulaSchema = z.object({
|
|
33
33
|
...commonPropertyValues('formula'),
|
|
34
34
|
formula: z.object({
|
|
35
|
-
type: z.enum([
|
|
35
|
+
type: z.enum([
|
|
36
|
+
'boolean',
|
|
37
|
+
'date',
|
|
38
|
+
'number',
|
|
39
|
+
'string'
|
|
40
|
+
]),
|
|
36
41
|
boolean: z.boolean().optional(),
|
|
37
42
|
date: notionDateFormat.optional(),
|
|
38
43
|
number: z.number().optional(),
|
|
39
|
-
string: z.string().optional()
|
|
40
|
-
})
|
|
44
|
+
string: z.string().optional()
|
|
45
|
+
})
|
|
41
46
|
});
|
|
42
47
|
export const notionPagePropertyLastEditedBySchema = z.object({
|
|
43
48
|
...commonPropertyValues('last_edited_by'),
|
|
44
|
-
last_edited_by: notionUserSchema
|
|
49
|
+
last_edited_by: notionUserSchema
|
|
45
50
|
});
|
|
46
51
|
export const notionPagePropertyLastEditedTimeSchema = z.object({
|
|
47
52
|
...commonPropertyValues('last_edited_time'),
|
|
48
|
-
last_edited_time: notionTimeFormat
|
|
53
|
+
last_edited_time: notionTimeFormat
|
|
49
54
|
});
|
|
50
55
|
export const notionPagePropertyMultiSelectSchema = z.object({
|
|
51
56
|
...commonPropertyValues('multi_select'),
|
|
52
57
|
multi_select: z.array(z.object({
|
|
53
58
|
id: z.string(),
|
|
54
59
|
name: z.string(),
|
|
55
|
-
color: notionCommonColorEnum
|
|
56
|
-
}))
|
|
60
|
+
color: notionCommonColorEnum
|
|
61
|
+
}))
|
|
57
62
|
});
|
|
58
63
|
export const notionPagePropertyNumberSchema = z.object({
|
|
59
64
|
...commonPropertyValues('number'),
|
|
60
|
-
number: z.number().nullable()
|
|
65
|
+
number: z.number().nullable()
|
|
61
66
|
});
|
|
62
67
|
export const notionPagePropertyPeopleSchema = z.object({
|
|
63
68
|
...commonPropertyValues('people'),
|
|
64
|
-
people: z.array(notionUserSchema)
|
|
69
|
+
people: z.array(notionUserSchema)
|
|
65
70
|
});
|
|
66
71
|
export const notionPagePropertyPhoneNumberSchema = z.object({
|
|
67
72
|
...commonPropertyValues('phone_number'),
|
|
68
|
-
phone_number: z.string()
|
|
73
|
+
phone_number: z.string()
|
|
69
74
|
});
|
|
70
75
|
export const notionPagePropertyRelationSchema = z.object({
|
|
71
76
|
...commonPropertyValues('relation'),
|
|
72
77
|
relation: z.array(z.object({
|
|
73
|
-
id: z.string()
|
|
78
|
+
id: z.string()
|
|
74
79
|
})),
|
|
75
|
-
has_more: z.boolean()
|
|
80
|
+
has_more: z.boolean()
|
|
76
81
|
});
|
|
77
82
|
export const notionPagePropertyRollupSchema = z.object({
|
|
78
83
|
...commonPropertyValues('rollup'),
|
|
@@ -106,76 +111,82 @@ export const notionPagePropertyRollupSchema = z.object({
|
|
|
106
111
|
'show_unique',
|
|
107
112
|
'sum',
|
|
108
113
|
'unchecked',
|
|
109
|
-
'unique'
|
|
114
|
+
'unique'
|
|
110
115
|
]),
|
|
111
|
-
type: z.enum([
|
|
112
|
-
|
|
116
|
+
type: z.enum([
|
|
117
|
+
'array',
|
|
118
|
+
'date',
|
|
119
|
+
'incomplete',
|
|
120
|
+
'number',
|
|
121
|
+
'unsupported'
|
|
122
|
+
])
|
|
123
|
+
})
|
|
113
124
|
});
|
|
114
125
|
export const notionPagePropertyRichTextSchema = z.object({
|
|
115
126
|
...commonPropertyValues('rich_text'),
|
|
116
|
-
rich_text: z.array(notionRichTextSchema)
|
|
127
|
+
rich_text: z.array(notionRichTextSchema)
|
|
117
128
|
});
|
|
118
129
|
export const notionPagePropertySelectSchema = z.object({
|
|
119
130
|
...commonPropertyValues('select'),
|
|
120
|
-
select: z
|
|
121
|
-
.object({
|
|
131
|
+
select: z.object({
|
|
122
132
|
id: z.string(),
|
|
123
133
|
name: z.string(),
|
|
124
|
-
color: notionCommonColorEnum
|
|
125
|
-
})
|
|
126
|
-
.nullable(),
|
|
134
|
+
color: notionCommonColorEnum
|
|
135
|
+
}).nullable()
|
|
127
136
|
});
|
|
128
137
|
export const notionPagePropertyStatusSchema = z.object({
|
|
129
138
|
...commonPropertyValues('status'),
|
|
130
139
|
status: z.object({
|
|
131
140
|
id: z.string(),
|
|
132
141
|
name: z.string(),
|
|
133
|
-
color: notionCommonColorEnum
|
|
134
|
-
})
|
|
142
|
+
color: notionCommonColorEnum
|
|
143
|
+
})
|
|
135
144
|
});
|
|
136
145
|
export const notionPagePropertyTitleSchema = z.object({
|
|
137
146
|
...commonPropertyValues('title'),
|
|
138
|
-
title: z.array(notionRichTextSchema)
|
|
147
|
+
title: z.array(notionRichTextSchema)
|
|
139
148
|
});
|
|
140
149
|
export const notionPagePropertyUrlSchema = z.object({
|
|
141
150
|
...commonPropertyValues('url'),
|
|
142
|
-
url: z.string().url().nullable()
|
|
151
|
+
url: z.string().url().nullable()
|
|
143
152
|
});
|
|
144
153
|
export const notionPagePropertyUniqueIdSchema = z.object({
|
|
145
154
|
...commonPropertyValues('unique_id'),
|
|
146
155
|
unique_id: z.object({
|
|
147
156
|
number: z.number(),
|
|
148
|
-
prefix: z.string().nullable().optional()
|
|
149
|
-
})
|
|
157
|
+
prefix: z.string().nullable().optional()
|
|
158
|
+
})
|
|
150
159
|
});
|
|
151
160
|
export const notionPagePropertyVerificationSchema = z.object({
|
|
152
161
|
...commonPropertyValues('verification'),
|
|
153
162
|
verification: z.object({
|
|
154
|
-
state: z.enum([
|
|
163
|
+
state: z.enum([
|
|
164
|
+
'verified',
|
|
165
|
+
'unverified'
|
|
166
|
+
]),
|
|
155
167
|
verified_by: notionUserSchema.nullable(),
|
|
156
|
-
date: notionDateSchema
|
|
157
|
-
})
|
|
158
|
-
});
|
|
159
|
-
export const notionPageSchema = (properties)
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
});
|
|
173
|
-
export const notionPagesSchema = (properties)
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
});
|
|
181
|
-
//# sourceMappingURL=page.js.map
|
|
168
|
+
date: notionDateSchema
|
|
169
|
+
})
|
|
170
|
+
});
|
|
171
|
+
export const notionPageSchema = (properties)=>z.object({
|
|
172
|
+
object: z.literal('page'),
|
|
173
|
+
id: z.string(),
|
|
174
|
+
created_time: notionTimeFormat,
|
|
175
|
+
created_by: notionPartialUserSchema,
|
|
176
|
+
last_edited_time: notionTimeFormat,
|
|
177
|
+
last_edited_by: notionPartialUserSchema,
|
|
178
|
+
archived: z.boolean(),
|
|
179
|
+
icon: notionFileSchema.or(notionEmojiSchema).nullable(),
|
|
180
|
+
properties,
|
|
181
|
+
parent: notionDatabaseParentSchema,
|
|
182
|
+
url: z.string().url(),
|
|
183
|
+
public_url: z.string().nullable()
|
|
184
|
+
});
|
|
185
|
+
export const notionPagesSchema = (properties)=>z.object({
|
|
186
|
+
has_more: z.boolean(),
|
|
187
|
+
next_cursor: z.string().nullable(),
|
|
188
|
+
object: z.literal('list'),
|
|
189
|
+
page_or_database: z.object({}),
|
|
190
|
+
type: z.literal('page_or_database'),
|
|
191
|
+
results: z.array(notionPageSchema(properties))
|
|
192
|
+
});
|
|
@@ -1,18 +1,17 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
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
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
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
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,31 +1,30 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
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
6
|
export const notionUserSchema = z.object({
|
|
7
7
|
object: z.literal('user'),
|
|
8
8
|
id: z.string(),
|
|
9
|
-
type: z.enum([
|
|
9
|
+
type: z.enum([
|
|
10
|
+
'person',
|
|
11
|
+
'bot'
|
|
12
|
+
]).optional(),
|
|
10
13
|
name: z.string().optional(),
|
|
11
14
|
avatar_url: z.string().nullable().optional(),
|
|
12
15
|
// type person
|
|
13
|
-
person: z
|
|
14
|
-
.
|
|
15
|
-
|
|
16
|
-
})
|
|
17
|
-
.optional(),
|
|
16
|
+
person: z.object({
|
|
17
|
+
email: z.string().email()
|
|
18
|
+
}).optional(),
|
|
18
19
|
// type bot
|
|
19
|
-
bot: z
|
|
20
|
-
.object({
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
workspace_name: z.string().optional()
|
|
28
|
-
})
|
|
29
|
-
.optional(),
|
|
20
|
+
bot: z.object({
|
|
21
|
+
owner: z.object({
|
|
22
|
+
type: z.enum([
|
|
23
|
+
'workspace',
|
|
24
|
+
'user'
|
|
25
|
+
]),
|
|
26
|
+
workspace: z.boolean()
|
|
27
|
+
}).optional(),
|
|
28
|
+
workspace_name: z.string().optional()
|
|
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,10 +1,10 @@
|
|
|
1
1
|
import { prisma } from '@driveflux/db';
|
|
2
2
|
import { generateId } from '@driveflux/db/id';
|
|
3
|
-
export const handleAgreeToTerms = async ({ agreedToTerms, subscribingUser, ipAddress
|
|
3
|
+
export const handleAgreeToTerms = async ({ agreedToTerms, subscribingUser, ipAddress })=>{
|
|
4
4
|
if (agreedToTerms && !subscribingUser.consented) {
|
|
5
5
|
subscribingUser = await prisma.user.update({
|
|
6
6
|
where: {
|
|
7
|
-
id: subscribingUser.id
|
|
7
|
+
id: subscribingUser.id
|
|
8
8
|
},
|
|
9
9
|
data: {
|
|
10
10
|
consented: true,
|
|
@@ -13,11 +13,10 @@ export const handleAgreeToTerms = async ({ agreedToTerms, subscribingUser, ipAdd
|
|
|
13
13
|
id: generateId('UserConsent'),
|
|
14
14
|
ipAddress,
|
|
15
15
|
consentType: 'terms',
|
|
16
|
-
email: subscribingUser.email
|
|
17
|
-
}
|
|
18
|
-
}
|
|
19
|
-
}
|
|
16
|
+
email: subscribingUser.email
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
20
|
});
|
|
21
21
|
}
|
|
22
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"}
|