@driveflux/api-functions 0.0.6 → 0.0.7-next.1

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 (53) hide show
  1. package/dist/auth/confirm.js +73 -327
  2. package/dist/auth/emails.js +43 -210
  3. package/dist/auth/formatter.js +11 -11
  4. package/dist/auth/otp.js +122 -392
  5. package/dist/auth/register.js +100 -396
  6. package/dist/auth/tokens.d.ts +3 -3
  7. package/dist/auth/tokens.js +115 -430
  8. package/dist/auth/verifications.d.ts.map +1 -1
  9. package/dist/auth/verifications.js +191 -514
  10. package/dist/auth/verifications.js.map +1 -1
  11. package/dist/constants.js +5 -4
  12. package/dist/mailjet/calls/manage-contacts-in-list.js +22 -166
  13. package/dist/mailjet/calls/manage-subscription-status.js +13 -153
  14. package/dist/mailjet/calls/request-service.d.ts +1 -1
  15. package/dist/mailjet/calls/request-service.d.ts.map +1 -1
  16. package/dist/mailjet/calls/request-service.js +18 -183
  17. package/dist/mailjet/refresh-email-preferences.js +26 -225
  18. package/dist/mailjet/set-contact.js +23 -214
  19. package/dist/mailjet/types.js +2 -1
  20. package/dist/mailjet/utils/convert-to-array.js +9 -58
  21. package/dist/mailjet/utils/extract-email-preferences.js +41 -217
  22. package/dist/mailjet/utils/lists.js +30 -249
  23. package/dist/mailjet/utils/update-email-references.js +27 -208
  24. package/dist/notion/client.js +48 -197
  25. package/dist/notion/helpful.js +29 -170
  26. package/dist/notion/schemas/block.js +49 -43
  27. package/dist/notion/schemas/common.js +17 -14
  28. package/dist/notion/schemas/database.js +125 -159
  29. package/dist/notion/schemas/emoji.js +3 -2
  30. package/dist/notion/schemas/file.js +10 -10
  31. package/dist/notion/schemas/kb.js +9 -8
  32. package/dist/notion/schemas/page.js +126 -171
  33. package/dist/notion/schemas/parent.js +9 -8
  34. package/dist/notion/schemas/user.js +21 -20
  35. package/dist/reservation/agree.js +19 -158
  36. package/dist/reservation/checks.js +23 -178
  37. package/dist/reservation/display-vehicle.d.ts +37 -37
  38. package/dist/reservation/display-vehicle.d.ts.map +1 -1
  39. package/dist/reservation/display-vehicle.js +142 -514
  40. package/dist/reservation/fetch-or-create.js +197 -482
  41. package/dist/reservation/invoice.js +198 -496
  42. package/dist/reservation/payer.js +28 -177
  43. package/dist/reservation/reserve.js +31 -191
  44. package/dist/reservation/types.js +2 -1
  45. package/dist/reservation/vehicle.js +24 -186
  46. package/dist/slack.d.ts +2 -2
  47. package/dist/slack.d.ts.map +1 -1
  48. package/dist/slack.js +67 -273
  49. package/dist/validation.js +81 -139
  50. package/dist/vehicle/vehicle-pricing/constants.js +33 -36
  51. package/dist/vehicle/vehicle-pricing/index.js +99 -257
  52. package/dist/vehicle/vehicle-pricing/types.js +2 -1
  53. package/package.json +12 -12
@@ -1,101 +1,60 @@
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, notionTimeFormat } from './common.js';
3
+ import { commonPropertyValues, notionCommonColorEnum, notionTimeFormat, } from './common.js';
56
4
  import { notionEmojiSchema } from './emoji.js';
57
5
  import { notionFileSchema } from './file.js';
58
6
  import { notionWorkspaceParentSchema } from './parent.js';
59
7
  import { notionPartialUserSchema } from './user.js';
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')), {
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'),
79
34
  formula: z.object({
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')), {
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'),
90
48
  multi_select: z.object({
91
49
  options: z.array(z.object({
92
50
  id: z.string(),
93
51
  name: z.string(),
94
- color: notionCommonColorEnum
95
- }))
96
- })
97
- }));
98
- export var notionDatabasePropertyNumberSchema = z.object(_object_spread_props(_object_spread({}, commonPropertyValues('number')), {
52
+ color: notionCommonColorEnum,
53
+ })),
54
+ }),
55
+ });
56
+ export const notionDatabasePropertyNumberSchema = z.object({
57
+ ...commonPropertyValues('number'),
99
58
  number: z.object({
100
59
  format: z.enum([
101
60
  'argentine_peso',
@@ -137,27 +96,32 @@ export var notionDatabasePropertyNumberSchema = z.object(_object_spread_props(_o
137
96
  'yen,',
138
97
  'yuan',
139
98
  'won',
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')), {
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'),
151
113
  relation: z.object({
152
114
  database_id: z.string(),
153
115
  synced_property_name: z.string().optional(),
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')), {
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'),
161
125
  rollup: z.object({
162
126
  rollup_property_name: z.string(),
163
127
  relation_property_name: z.string(),
@@ -187,70 +151,72 @@ export var notionDatabasePropertyRollupSchema = z.object(_object_spread_props(_o
187
151
  'show_unique',
188
152
  'sum',
189
153
  'unchecked',
190
- 'unique'
154
+ 'unique',
191
155
  ]),
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')), {
156
+ type: z.enum(['array', 'date', 'incomplete', 'number', 'unsupported']),
157
+ }),
158
+ });
159
+ export const notionDatabasePropertySelectSchema = z.object({
160
+ ...commonPropertyValues('select'),
202
161
  select: z.object({
203
162
  options: z.array(z.object({
204
163
  id: z.string(),
205
164
  name: z.string(),
206
- color: notionCommonColorEnum
207
- }))
208
- })
209
- }));
210
- export var notionDatabasePropertyStatusSchema = z.object(_object_spread_props(_object_spread({}, commonPropertyValues('status')), {
165
+ color: notionCommonColorEnum,
166
+ })),
167
+ }),
168
+ });
169
+ export const notionDatabasePropertyStatusSchema = z.object({
170
+ ...commonPropertyValues('status'),
211
171
  status: z.object({
212
172
  options: z.array(z.object({
213
173
  id: z.string(),
214
174
  name: z.string(),
215
- color: notionCommonColorEnum
175
+ color: notionCommonColorEnum,
216
176
  })),
217
- group: z.array(z.object({
177
+ group: z
178
+ .array(z.object({
218
179
  id: z.string(),
219
180
  name: z.string(),
220
181
  color: notionCommonColorEnum,
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
- };
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
@@ -1,5 +1,6 @@
1
1
  import { z } from 'zod';
2
- export var notionEmojiSchema = z.object({
2
+ export const 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 var notionFileSchema = z.object({
4
- type: z.enum([
5
- 'file',
6
- 'external'
7
- ]),
3
+ export const notionFileSchema = z.object({
4
+ type: z.enum(['file', 'external']),
8
5
  name: z.string().optional(),
9
6
  // type file
10
- file: z.object({
7
+ file: z
8
+ .object({
11
9
  url: z.string().url(),
12
- expiry_time: notionTimeFormat
13
- }).optional(),
10
+ expiry_time: notionTimeFormat,
11
+ })
12
+ .optional(),
14
13
  // type external
15
14
  external: z.object({
16
- url: z.string().url()
17
- })
15
+ url: z.string().url(),
16
+ }),
18
17
  });
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 var 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 const knowledgeBaseRetrieveDatabaseSchema = notionDatabaseSchema(z.object({
5
5
  Title: notionDatabasePropertyTitleSchema,
6
6
  Status: notionDatabasePropertyStatusSchema,
7
7
  Topic: notionDatabasePropertySelectSchema,
@@ -22,9 +22,9 @@ export var 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 var knowledgeBaseRetrievePageSchema = notionPageSchema(z.object({
27
+ export const knowledgeBaseRetrievePageSchema = notionPageSchema(z.object({
28
28
  Title: notionPagePropertyTitleSchema,
29
29
  'Seo Title': notionPagePropertyRichTextSchema,
30
30
  Status: notionPagePropertyStatusSchema,
@@ -46,9 +46,9 @@ export var 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 var knowledgeBaseQueryDatabaseSchema = notionPagesSchema(z.object({
51
+ export const knowledgeBaseQueryDatabaseSchema = notionPagesSchema(z.object({
52
52
  Title: notionPagePropertyTitleSchema,
53
53
  Status: notionPagePropertyStatusSchema,
54
54
  Topic: notionPagePropertySelectSchema,
@@ -69,5 +69,6 @@ export var 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