@driveflux/api-functions 0.0.2 → 0.0.3

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.
Files changed (44) hide show
  1. package/dist/auth/confirm.js +327 -73
  2. package/dist/auth/emails.js +210 -43
  3. package/dist/auth/formatter.js +11 -11
  4. package/dist/auth/otp.js +392 -122
  5. package/dist/auth/register.js +396 -100
  6. package/dist/auth/tokens.js +430 -115
  7. package/dist/auth/verifications.js +512 -154
  8. package/dist/constants.js +4 -5
  9. package/dist/mailjet/calls/manage-contacts-in-list.js +166 -22
  10. package/dist/mailjet/calls/manage-subscription-status.js +153 -13
  11. package/dist/mailjet/calls/request-service.js +183 -18
  12. package/dist/mailjet/refresh-email-preferences.js +225 -26
  13. package/dist/mailjet/set-contact.js +214 -23
  14. package/dist/mailjet/types.js +1 -2
  15. package/dist/mailjet/utils/convert-to-array.js +58 -9
  16. package/dist/mailjet/utils/extract-email-preferences.js +217 -41
  17. package/dist/mailjet/utils/lists.js +249 -30
  18. package/dist/mailjet/utils/update-email-references.js +208 -27
  19. package/dist/notion/client.js +197 -48
  20. package/dist/notion/helpful.js +170 -29
  21. package/dist/notion/schemas/block.js +43 -49
  22. package/dist/notion/schemas/common.js +14 -17
  23. package/dist/notion/schemas/database.js +159 -125
  24. package/dist/notion/schemas/emoji.js +2 -3
  25. package/dist/notion/schemas/file.js +10 -10
  26. package/dist/notion/schemas/kb.js +8 -9
  27. package/dist/notion/schemas/page.js +171 -126
  28. package/dist/notion/schemas/parent.js +8 -9
  29. package/dist/notion/schemas/user.js +20 -21
  30. package/dist/reservation/agree.js +158 -19
  31. package/dist/reservation/checks.js +178 -23
  32. package/dist/reservation/display-vehicle.js +514 -142
  33. package/dist/reservation/fetch-or-create.js +482 -197
  34. package/dist/reservation/invoice.js +501 -200
  35. package/dist/reservation/payer.js +177 -28
  36. package/dist/reservation/reserve.js +191 -31
  37. package/dist/reservation/types.js +1 -2
  38. package/dist/reservation/vehicle.js +186 -24
  39. package/dist/slack.js +273 -67
  40. package/dist/validation.js +92 -52
  41. package/dist/vehicle/vehicle-pricing/constants.js +36 -33
  42. package/dist/vehicle/vehicle-pricing/index.js +257 -99
  43. package/dist/vehicle/vehicle-pricing/types.js +1 -2
  44. package/package.json +1 -1
@@ -1,60 +1,101 @@
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
+ }
1
53
  import { z } from 'zod';
2
54
  import { notionRichTextSchema } from './block.js';
3
- import { commonPropertyValues, notionCommonColorEnum, notionTimeFormat, } from './common.js';
55
+ import { commonPropertyValues, notionCommonColorEnum, notionTimeFormat } from './common.js';
4
56
  import { notionEmojiSchema } from './emoji.js';
5
57
  import { notionFileSchema } from './file.js';
6
58
  import { notionWorkspaceParentSchema } from './parent.js';
7
59
  import { notionPartialUserSchema } from './user.js';
8
- export const notionDatabasePropertyCheckboxSchema = z.object({
9
- ...commonPropertyValues('checkbox'),
10
- checkbox: z.object({}),
11
- });
12
- export const notionDatabasePropertyCreatedBySchema = z.object({
13
- ...commonPropertyValues('created_by'),
14
- created_by: z.object({}),
15
- });
16
- export const notionDatabasePropertyCreatedTimeSchema = z.object({
17
- ...commonPropertyValues('created_time'),
18
- created_time: z.object({}),
19
- });
20
- export const notionDatabasePropertyDateSchema = z.object({
21
- ...commonPropertyValues('date'),
22
- date: z.object({}),
23
- });
24
- export const notionDatabasePropertyEmailSchema = z.object({
25
- ...commonPropertyValues('email'),
26
- email: z.object({}),
27
- });
28
- export const notionDatabasePropertyFilesSchema = z.object({
29
- ...commonPropertyValues('files'),
30
- files: z.object({}),
31
- });
32
- export const notionDatabasePropertyFormulaSchema = z.object({
33
- ...commonPropertyValues('formula'),
60
+ export var notionDatabasePropertyCheckboxSchema = z.object(_object_spread_props(_object_spread({}, commonPropertyValues('checkbox')), {
61
+ checkbox: z.object({})
62
+ }));
63
+ export var notionDatabasePropertyCreatedBySchema = z.object(_object_spread_props(_object_spread({}, commonPropertyValues('created_by')), {
64
+ created_by: z.object({})
65
+ }));
66
+ export var notionDatabasePropertyCreatedTimeSchema = z.object(_object_spread_props(_object_spread({}, commonPropertyValues('created_time')), {
67
+ created_time: z.object({})
68
+ }));
69
+ export var notionDatabasePropertyDateSchema = z.object(_object_spread_props(_object_spread({}, commonPropertyValues('date')), {
70
+ date: z.object({})
71
+ }));
72
+ export var notionDatabasePropertyEmailSchema = z.object(_object_spread_props(_object_spread({}, commonPropertyValues('email')), {
73
+ email: z.object({})
74
+ }));
75
+ export var notionDatabasePropertyFilesSchema = z.object(_object_spread_props(_object_spread({}, commonPropertyValues('files')), {
76
+ files: z.object({})
77
+ }));
78
+ export var notionDatabasePropertyFormulaSchema = z.object(_object_spread_props(_object_spread({}, commonPropertyValues('formula')), {
34
79
  formula: z.object({
35
- expression: z.string(),
36
- }),
37
- });
38
- export const notionDatabasePropertyLastEditedBySchema = z.object({
39
- ...commonPropertyValues('last_edited_by'),
40
- last_edited_by: z.object({}).optional(),
41
- });
42
- export const notionDatabasePropertyLastEditedTimeSchema = z.object({
43
- ...commonPropertyValues('last_edited_time'),
44
- last_edited_time: z.object({}),
45
- });
46
- export const notionDatabasePropertyMultiSelectSchema = z.object({
47
- ...commonPropertyValues('multi_select'),
80
+ expression: z.string()
81
+ })
82
+ }));
83
+ export var notionDatabasePropertyLastEditedBySchema = z.object(_object_spread_props(_object_spread({}, commonPropertyValues('last_edited_by')), {
84
+ last_edited_by: z.object({}).optional()
85
+ }));
86
+ export var notionDatabasePropertyLastEditedTimeSchema = z.object(_object_spread_props(_object_spread({}, commonPropertyValues('last_edited_time')), {
87
+ last_edited_time: z.object({})
88
+ }));
89
+ export var notionDatabasePropertyMultiSelectSchema = z.object(_object_spread_props(_object_spread({}, commonPropertyValues('multi_select')), {
48
90
  multi_select: z.object({
49
91
  options: z.array(z.object({
50
92
  id: z.string(),
51
93
  name: z.string(),
52
- color: notionCommonColorEnum,
53
- })),
54
- }),
55
- });
56
- export const notionDatabasePropertyNumberSchema = z.object({
57
- ...commonPropertyValues('number'),
94
+ color: notionCommonColorEnum
95
+ }))
96
+ })
97
+ }));
98
+ export var notionDatabasePropertyNumberSchema = z.object(_object_spread_props(_object_spread({}, commonPropertyValues('number')), {
58
99
  number: z.object({
59
100
  format: z.enum([
60
101
  'argentine_peso',
@@ -96,32 +137,27 @@ export const notionDatabasePropertyNumberSchema = z.object({
96
137
  'yen,',
97
138
  'yuan',
98
139
  'won',
99
- 'zloty',
100
- ]),
101
- }),
102
- });
103
- export const notionDatabasePropertyPeopleSchema = z.object({
104
- ...commonPropertyValues('people'),
105
- people: z.object({}),
106
- });
107
- export const notionDatabasePropertyPhoneNumberSchema = z.object({
108
- ...commonPropertyValues('phone_number'),
109
- phone_number: z.object({}),
110
- });
111
- export const notionDatabasePropertyRelationSchema = z.object({
112
- ...commonPropertyValues('relation'),
140
+ 'zloty'
141
+ ])
142
+ })
143
+ }));
144
+ export var notionDatabasePropertyPeopleSchema = z.object(_object_spread_props(_object_spread({}, commonPropertyValues('people')), {
145
+ people: z.object({})
146
+ }));
147
+ export var notionDatabasePropertyPhoneNumberSchema = z.object(_object_spread_props(_object_spread({}, commonPropertyValues('phone_number')), {
148
+ phone_number: z.object({})
149
+ }));
150
+ export var notionDatabasePropertyRelationSchema = z.object(_object_spread_props(_object_spread({}, commonPropertyValues('relation')), {
113
151
  relation: z.object({
114
152
  database_id: z.string(),
115
153
  synced_property_name: z.string().optional(),
116
- synced_property_id: z.string().optional(),
117
- }),
118
- });
119
- export const notionDatabasePropertyRichTextSchema = z.object({
120
- ...commonPropertyValues('rich_text'),
121
- rich_text: z.object({}),
122
- });
123
- export const notionDatabasePropertyRollupSchema = z.object({
124
- ...commonPropertyValues('rollup'),
154
+ synced_property_id: z.string().optional()
155
+ })
156
+ }));
157
+ export var notionDatabasePropertyRichTextSchema = z.object(_object_spread_props(_object_spread({}, commonPropertyValues('rich_text')), {
158
+ rich_text: z.object({})
159
+ }));
160
+ export var notionDatabasePropertyRollupSchema = z.object(_object_spread_props(_object_spread({}, commonPropertyValues('rollup')), {
125
161
  rollup: z.object({
126
162
  rollup_property_name: z.string(),
127
163
  relation_property_name: z.string(),
@@ -151,72 +187,70 @@ export const notionDatabasePropertyRollupSchema = z.object({
151
187
  'show_unique',
152
188
  'sum',
153
189
  'unchecked',
154
- 'unique',
190
+ 'unique'
155
191
  ]),
156
- type: z.enum(['array', 'date', 'incomplete', 'number', 'unsupported']),
157
- }),
158
- });
159
- export const notionDatabasePropertySelectSchema = z.object({
160
- ...commonPropertyValues('select'),
192
+ type: z.enum([
193
+ 'array',
194
+ 'date',
195
+ 'incomplete',
196
+ 'number',
197
+ 'unsupported'
198
+ ])
199
+ })
200
+ }));
201
+ export var notionDatabasePropertySelectSchema = z.object(_object_spread_props(_object_spread({}, commonPropertyValues('select')), {
161
202
  select: z.object({
162
203
  options: z.array(z.object({
163
204
  id: z.string(),
164
205
  name: z.string(),
165
- color: notionCommonColorEnum,
166
- })),
167
- }),
168
- });
169
- export const notionDatabasePropertyStatusSchema = z.object({
170
- ...commonPropertyValues('status'),
206
+ color: notionCommonColorEnum
207
+ }))
208
+ })
209
+ }));
210
+ export var notionDatabasePropertyStatusSchema = z.object(_object_spread_props(_object_spread({}, commonPropertyValues('status')), {
171
211
  status: z.object({
172
212
  options: z.array(z.object({
173
213
  id: z.string(),
174
214
  name: z.string(),
175
- color: notionCommonColorEnum,
215
+ color: notionCommonColorEnum
176
216
  })),
177
- group: z
178
- .array(z.object({
217
+ group: z.array(z.object({
179
218
  id: z.string(),
180
219
  name: z.string(),
181
220
  color: notionCommonColorEnum,
182
- option_ids: z.array(z.string()),
183
- }))
184
- .nullable()
185
- .optional(),
186
- }),
187
- });
188
- export const notionDatabasePropertyTitleSchema = z.object({
189
- ...commonPropertyValues('title'),
190
- title: z.object({}),
191
- });
192
- export const notionDatabasePropertyUrlSchema = z.object({
193
- ...commonPropertyValues('url'),
194
- url: z.object({}),
195
- });
196
- export const notionDatabasePropertyUniqueIdSchema = z.object({
197
- ...commonPropertyValues('unique_id'),
198
- unique_id: z.object({}),
199
- });
200
- export const notionDatabasePropertyVerificationSchema = z.object({
201
- ...commonPropertyValues('verification'),
202
- verification: z.object({}),
203
- });
204
- export const notionDatabaseSchema = (properties) => z.object({
205
- object: z.literal('database'),
206
- id: z.string(),
207
- created_time: notionTimeFormat,
208
- created_by: notionPartialUserSchema,
209
- last_edited_time: notionTimeFormat,
210
- last_edited_by: notionPartialUserSchema,
211
- title: z.array(notionRichTextSchema),
212
- description: z.array(notionRichTextSchema),
213
- icon: notionFileSchema.or(notionEmojiSchema),
214
- cover: notionFileSchema.nullable(),
215
- properties,
216
- parent: notionWorkspaceParentSchema,
217
- url: z.string().url(),
218
- archived: z.boolean(),
219
- is_inline: z.boolean(),
220
- public_url: z.string().nullable(),
221
- });
222
- //# sourceMappingURL=database.js.map
221
+ option_ids: z.array(z.string())
222
+ })).nullable().optional()
223
+ })
224
+ }));
225
+ export var notionDatabasePropertyTitleSchema = z.object(_object_spread_props(_object_spread({}, commonPropertyValues('title')), {
226
+ title: z.object({})
227
+ }));
228
+ export var notionDatabasePropertyUrlSchema = z.object(_object_spread_props(_object_spread({}, commonPropertyValues('url')), {
229
+ url: z.object({})
230
+ }));
231
+ export var notionDatabasePropertyUniqueIdSchema = z.object(_object_spread_props(_object_spread({}, commonPropertyValues('unique_id')), {
232
+ unique_id: z.object({})
233
+ }));
234
+ export var notionDatabasePropertyVerificationSchema = z.object(_object_spread_props(_object_spread({}, commonPropertyValues('verification')), {
235
+ verification: z.object({})
236
+ }));
237
+ export var notionDatabaseSchema = function(properties) {
238
+ return z.object({
239
+ object: z.literal('database'),
240
+ id: z.string(),
241
+ created_time: notionTimeFormat,
242
+ created_by: notionPartialUserSchema,
243
+ last_edited_time: notionTimeFormat,
244
+ last_edited_by: notionPartialUserSchema,
245
+ title: z.array(notionRichTextSchema),
246
+ description: z.array(notionRichTextSchema),
247
+ icon: notionFileSchema.or(notionEmojiSchema),
248
+ cover: notionFileSchema.nullable(),
249
+ properties: properties,
250
+ parent: notionWorkspaceParentSchema,
251
+ url: z.string().url(),
252
+ archived: z.boolean(),
253
+ is_inline: z.boolean(),
254
+ public_url: z.string().nullable()
255
+ });
256
+ };
@@ -1,6 +1,5 @@
1
1
  import { z } from 'zod';
2
- export const notionEmojiSchema = z.object({
2
+ export var notionEmojiSchema = z.object({
3
3
  type: z.literal('emoji'),
4
- emoji: z.string().emoji(),
4
+ emoji: z.string().emoji()
5
5
  });
6
- //# sourceMappingURL=emoji.js.map
@@ -1,18 +1,18 @@
1
1
  import { z } from 'zod';
2
2
  import { notionTimeFormat } from './common.js';
3
- export const notionFileSchema = z.object({
4
- type: z.enum(['file', 'external']),
3
+ export var notionFileSchema = z.object({
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,7 +1,7 @@
1
1
  import { z } from 'zod';
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
- export const knowledgeBaseRetrieveDatabaseSchema = notionDatabaseSchema(z.object({
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
+ export var knowledgeBaseRetrieveDatabaseSchema = notionDatabaseSchema(z.object({
5
5
  Title: notionDatabasePropertyTitleSchema,
6
6
  Status: notionDatabasePropertyStatusSchema,
7
7
  Topic: notionDatabasePropertySelectSchema,
@@ -22,9 +22,9 @@ 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
- export const knowledgeBaseRetrievePageSchema = notionPageSchema(z.object({
27
+ export var knowledgeBaseRetrievePageSchema = notionPageSchema(z.object({
28
28
  Title: notionPagePropertyTitleSchema,
29
29
  'Seo Title': notionPagePropertyRichTextSchema,
30
30
  Status: notionPagePropertyStatusSchema,
@@ -46,9 +46,9 @@ 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
- export const knowledgeBaseQueryDatabaseSchema = notionPagesSchema(z.object({
51
+ export var knowledgeBaseQueryDatabaseSchema = notionPagesSchema(z.object({
52
52
  Title: notionPagePropertyTitleSchema,
53
53
  Status: notionPagePropertyStatusSchema,
54
54
  Topic: notionPagePropertySelectSchema,
@@ -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