@driveflux/api-functions 0.0.7-next.2 → 0.0.7-next.20

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (90) hide show
  1. package/dist/auth/confirm.js +66 -325
  2. package/dist/auth/emails.js +42 -210
  3. package/dist/auth/formatter.js +9 -9
  4. package/dist/auth/otp.js +120 -374
  5. package/dist/auth/register.js +95 -383
  6. package/dist/auth/register.js.map +1 -1
  7. package/dist/auth/tokens.d.ts +3 -3
  8. package/dist/auth/tokens.js +114 -426
  9. package/dist/auth/verifications.js +176 -581
  10. package/dist/constants.js +4 -4
  11. package/dist/mailjet/calls/manage-contacts-in-list.d.ts +2 -2
  12. package/dist/mailjet/calls/manage-contacts-in-list.d.ts.map +1 -1
  13. package/dist/mailjet/calls/manage-contacts-in-list.js +22 -167
  14. package/dist/mailjet/calls/manage-contacts-in-list.js.map +1 -1
  15. package/dist/mailjet/calls/manage-subscription-status.d.ts +2 -2
  16. package/dist/mailjet/calls/manage-subscription-status.d.ts.map +1 -1
  17. package/dist/mailjet/calls/manage-subscription-status.js +13 -154
  18. package/dist/mailjet/calls/manage-subscription-status.js.map +1 -1
  19. package/dist/mailjet/calls/request-service.js +18 -182
  20. package/dist/mailjet/refresh-email-preferences.js +21 -221
  21. package/dist/mailjet/set-contact.d.ts +2 -2
  22. package/dist/mailjet/set-contact.d.ts.map +1 -1
  23. package/dist/mailjet/set-contact.js +21 -213
  24. package/dist/mailjet/set-contact.js.map +1 -1
  25. package/dist/mailjet/types.d.ts +2 -2
  26. package/dist/mailjet/types.d.ts.map +1 -1
  27. package/dist/mailjet/utils/convert-to-array.d.ts +1 -1
  28. package/dist/mailjet/utils/convert-to-array.d.ts.map +1 -1
  29. package/dist/mailjet/utils/convert-to-array.js +9 -56
  30. package/dist/mailjet/utils/extract-email-preferences.d.ts +1 -1
  31. package/dist/mailjet/utils/extract-email-preferences.d.ts.map +1 -1
  32. package/dist/mailjet/utils/extract-email-preferences.js +37 -214
  33. package/dist/mailjet/utils/lists.js +28 -248
  34. package/dist/mailjet/utils/update-email-references.d.ts +2 -2
  35. package/dist/mailjet/utils/update-email-references.d.ts.map +1 -1
  36. package/dist/mailjet/utils/update-email-references.js +27 -207
  37. package/dist/mailjet/utils/update-email-references.js.map +1 -1
  38. package/dist/notion/client.js +50 -196
  39. package/dist/notion/helpful.js +25 -169
  40. package/dist/notion/schemas/block.js +1 -1
  41. package/dist/notion/schemas/common.js +7 -9
  42. package/dist/notion/schemas/database.d.ts +1 -1
  43. package/dist/notion/schemas/database.js +68 -100
  44. package/dist/notion/schemas/emoji.js +1 -1
  45. package/dist/notion/schemas/file.js +1 -1
  46. package/dist/notion/schemas/kb.js +3 -3
  47. package/dist/notion/schemas/page.d.ts +1 -1
  48. package/dist/notion/schemas/page.js +69 -103
  49. package/dist/notion/schemas/parent.js +4 -4
  50. package/dist/notion/schemas/user.js +2 -2
  51. package/dist/reservation/agree.d.ts +1 -1
  52. package/dist/reservation/agree.d.ts.map +1 -1
  53. package/dist/reservation/agree.js +17 -157
  54. package/dist/reservation/checks.d.ts +1 -1
  55. package/dist/reservation/checks.d.ts.map +1 -1
  56. package/dist/reservation/checks.js +21 -177
  57. package/dist/reservation/display-vehicle.d.ts +1 -1
  58. package/dist/reservation/display-vehicle.js +122 -500
  59. package/dist/reservation/display-vehicle.js.map +1 -1
  60. package/dist/reservation/fetch-or-create.d.ts +2 -2
  61. package/dist/reservation/fetch-or-create.d.ts.map +1 -1
  62. package/dist/reservation/fetch-or-create.js +188 -478
  63. package/dist/reservation/fetch-or-create.js.map +1 -1
  64. package/dist/reservation/invoice.d.ts +3 -3
  65. package/dist/reservation/invoice.d.ts.map +1 -1
  66. package/dist/reservation/invoice.js +182 -492
  67. package/dist/reservation/invoice.js.map +1 -1
  68. package/dist/reservation/payer.d.ts +1 -1
  69. package/dist/reservation/payer.d.ts.map +1 -1
  70. package/dist/reservation/payer.js +25 -175
  71. package/dist/reservation/reserve.d.ts +1 -1
  72. package/dist/reservation/reserve.d.ts.map +1 -1
  73. package/dist/reservation/reserve.js +35 -196
  74. package/dist/reservation/reserve.js.map +1 -1
  75. package/dist/reservation/types.d.ts +1 -0
  76. package/dist/reservation/types.d.ts.map +1 -1
  77. package/dist/reservation/vehicle.d.ts +1 -1
  78. package/dist/reservation/vehicle.d.ts.map +1 -1
  79. package/dist/reservation/vehicle.js +23 -188
  80. package/dist/reservation/vehicle.js.map +1 -1
  81. package/dist/slack.js +57 -268
  82. package/dist/validation.js +38 -98
  83. package/dist/vehicle/vehicle-pricing/constants.d.ts +1 -1
  84. package/dist/vehicle/vehicle-pricing/constants.d.ts.map +1 -1
  85. package/dist/vehicle/vehicle-pricing/constants.js +16 -16
  86. package/dist/vehicle/vehicle-pricing/index.d.ts +1 -1
  87. package/dist/vehicle/vehicle-pricing/index.d.ts.map +1 -1
  88. package/dist/vehicle/vehicle-pricing/index.js +87 -259
  89. package/dist/vehicle/vehicle-pricing/index.js.map +1 -1
  90. package/package.json +21 -21
@@ -1,173 +1,29 @@
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 { getNotion } from '@driveflux/api-functions/notion';
122
2
  import { knowledgeBaseRetrievePageSchema } from './schemas/kb.js';
123
- export var processHelpful = function(options) {
124
- return _async_to_generator(function() {
125
- var pageId, isHelpful, hasSubmittedBefore, notion, page, kbPageValidation, validatedPage;
126
- return _ts_generator(this, function(_state) {
127
- switch(_state.label){
128
- case 0:
129
- pageId = options.pageId, isHelpful = options.isHelpful, hasSubmittedBefore = options.hasSubmittedBefore;
130
- // get original page
131
- notion = getNotion();
132
- return [
133
- 4,
134
- notion.pages.retrieve({
135
- page_id: pageId
136
- })
137
- ];
138
- case 1:
139
- page = _state.sent();
140
- // validate page
141
- kbPageValidation = knowledgeBaseRetrievePageSchema.safeParse(page);
142
- if (!kbPageValidation.success) {
143
- return [
144
- 2,
145
- false
146
- ];
147
- }
148
- validatedPage = kbPageValidation.data;
149
- // update helpful/unhelpful number
150
- return [
151
- 4,
152
- notion.pages.update({
153
- page_id: pageId,
154
- properties: {
155
- Helpful: {
156
- number: (validatedPage.properties.Helpful.number || 0) + (hasSubmittedBefore && !isHelpful ? -1 : isHelpful ? 1 : 0)
157
- },
158
- Unhelpful: {
159
- number: (validatedPage.properties.Unhelpful.number || 0) + (hasSubmittedBefore && isHelpful ? -1 : !isHelpful ? 1 : 0)
160
- }
161
- }
162
- })
163
- ];
164
- case 2:
165
- _state.sent();
166
- return [
167
- 2,
168
- true
169
- ];
3
+ export const processHelpful = async (options)=>{
4
+ const { pageId, isHelpful, hasSubmittedBefore } = options;
5
+ // get original page
6
+ const notion = getNotion();
7
+ const page = await notion.pages.retrieve({
8
+ page_id: pageId
9
+ });
10
+ // validate page
11
+ const kbPageValidation = knowledgeBaseRetrievePageSchema.safeParse(page);
12
+ if (!kbPageValidation.success) {
13
+ return false;
14
+ }
15
+ const validatedPage = kbPageValidation.data;
16
+ // update helpful/unhelpful number
17
+ await notion.pages.update({
18
+ page_id: pageId,
19
+ properties: {
20
+ Helpful: {
21
+ number: (validatedPage.properties.Helpful.number || 0) + (hasSubmittedBefore && !isHelpful ? -1 : isHelpful ? 1 : 0)
22
+ },
23
+ Unhelpful: {
24
+ number: (validatedPage.properties.Unhelpful.number || 0) + (hasSubmittedBefore && isHelpful ? -1 : !isHelpful ? 1 : 0)
170
25
  }
171
- });
172
- })();
26
+ }
27
+ });
28
+ return true;
173
29
  };
@@ -1,7 +1,7 @@
1
1
  import { z } from 'zod';
2
2
  import { notionDateSchema } from './common.js';
3
3
  import { notionPartialUserSchema } from './user.js';
4
- export var notionRichTextSchema = z.object({
4
+ export const notionRichTextSchema = z.object({
5
5
  type: z.enum([
6
6
  'text',
7
7
  'mention',
@@ -1,8 +1,8 @@
1
1
  import { z } from 'zod';
2
- export var notionDateOrTimeFormat = z.string().regex(/^\d{4}-\d{2}-\d{2}(T\d{2}:\d{2}:\d{2}(\.\d{3})?(Z|\+\d{2}:\d{2}))?$/);
3
- export var notionDateFormat = z.string().regex(/^\d{4}-\d{2}-\d{2}$/);
4
- export var notionTimeFormat = z.string().regex(/^\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}.\d{3}Z$/);
5
- export var notionCommonColorEnum = z.enum([
2
+ export const notionDateOrTimeFormat = z.string().regex(/^\d{4}-\d{2}-\d{2}(T\d{2}:\d{2}:\d{2}(\.\d{3})?(Z|\+\d{2}:\d{2}))?$/);
3
+ export const notionDateFormat = z.string().regex(/^\d{4}-\d{2}-\d{2}$/);
4
+ export const notionTimeFormat = z.string().regex(/^\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}.\d{3}Z$/);
5
+ export const notionCommonColorEnum = z.enum([
6
6
  'blue',
7
7
  'brown',
8
8
  'default',
@@ -14,15 +14,13 @@ export var notionCommonColorEnum = z.enum([
14
14
  'red',
15
15
  'yellow'
16
16
  ]);
17
- export var notionDateSchema = z.object({
17
+ export const notionDateSchema = z.object({
18
18
  start: notionDateOrTimeFormat,
19
19
  end: notionDateOrTimeFormat.nullable().optional(),
20
20
  time_zone: z.string().nullable().optional()
21
21
  });
22
- export var commonPropertyValues = function(type) {
23
- return {
22
+ export const commonPropertyValues = (type)=>({
24
23
  id: z.string(),
25
24
  type: z.literal(type),
26
25
  name: z.string().optional()
27
- };
28
- };
26
+ });
@@ -190,8 +190,8 @@ export declare const notionDatabasePropertyRollupSchema: ZodObject<{
190
190
  type: z.ZodEnum<{
191
191
  number: "number";
192
192
  date: "date";
193
- array: "array";
194
193
  incomplete: "incomplete";
194
+ array: "array";
195
195
  unsupported: "unsupported";
196
196
  }>;
197
197
  }, z.core.$strip>;
@@ -1,55 +1,3 @@
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
3
  import { commonPropertyValues, notionCommonColorEnum, notionTimeFormat } from './common.js';
@@ -57,36 +5,46 @@ 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')), {
8
+ export const notionDatabasePropertyCheckboxSchema = z.object({
9
+ ...commonPropertyValues('checkbox'),
61
10
  checkbox: z.object({})
62
- }));
63
- export var notionDatabasePropertyCreatedBySchema = z.object(_object_spread_props(_object_spread({}, commonPropertyValues('created_by')), {
11
+ });
12
+ export const notionDatabasePropertyCreatedBySchema = z.object({
13
+ ...commonPropertyValues('created_by'),
64
14
  created_by: z.object({})
65
- }));
66
- export var notionDatabasePropertyCreatedTimeSchema = z.object(_object_spread_props(_object_spread({}, commonPropertyValues('created_time')), {
15
+ });
16
+ export const notionDatabasePropertyCreatedTimeSchema = z.object({
17
+ ...commonPropertyValues('created_time'),
67
18
  created_time: z.object({})
68
- }));
69
- export var notionDatabasePropertyDateSchema = z.object(_object_spread_props(_object_spread({}, commonPropertyValues('date')), {
19
+ });
20
+ export const notionDatabasePropertyDateSchema = z.object({
21
+ ...commonPropertyValues('date'),
70
22
  date: z.object({})
71
- }));
72
- export var notionDatabasePropertyEmailSchema = z.object(_object_spread_props(_object_spread({}, commonPropertyValues('email')), {
23
+ });
24
+ export const notionDatabasePropertyEmailSchema = z.object({
25
+ ...commonPropertyValues('email'),
73
26
  email: z.object({})
74
- }));
75
- export var notionDatabasePropertyFilesSchema = z.object(_object_spread_props(_object_spread({}, commonPropertyValues('files')), {
27
+ });
28
+ export const notionDatabasePropertyFilesSchema = z.object({
29
+ ...commonPropertyValues('files'),
76
30
  files: z.object({})
77
- }));
78
- export var notionDatabasePropertyFormulaSchema = z.object(_object_spread_props(_object_spread({}, commonPropertyValues('formula')), {
31
+ });
32
+ export const notionDatabasePropertyFormulaSchema = z.object({
33
+ ...commonPropertyValues('formula'),
79
34
  formula: z.object({
80
35
  expression: z.string()
81
36
  })
82
- }));
83
- export var notionDatabasePropertyLastEditedBySchema = z.object(_object_spread_props(_object_spread({}, commonPropertyValues('last_edited_by')), {
37
+ });
38
+ export const notionDatabasePropertyLastEditedBySchema = z.object({
39
+ ...commonPropertyValues('last_edited_by'),
84
40
  last_edited_by: z.object({}).optional()
85
- }));
86
- export var notionDatabasePropertyLastEditedTimeSchema = z.object(_object_spread_props(_object_spread({}, commonPropertyValues('last_edited_time')), {
41
+ });
42
+ export const notionDatabasePropertyLastEditedTimeSchema = z.object({
43
+ ...commonPropertyValues('last_edited_time'),
87
44
  last_edited_time: z.object({})
88
- }));
89
- export var notionDatabasePropertyMultiSelectSchema = z.object(_object_spread_props(_object_spread({}, commonPropertyValues('multi_select')), {
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(),
@@ -94,8 +52,9 @@ export var notionDatabasePropertyMultiSelectSchema = z.object(_object_spread_pro
94
52
  color: notionCommonColorEnum
95
53
  }))
96
54
  })
97
- }));
98
- export var notionDatabasePropertyNumberSchema = z.object(_object_spread_props(_object_spread({}, commonPropertyValues('number')), {
55
+ });
56
+ export const notionDatabasePropertyNumberSchema = z.object({
57
+ ...commonPropertyValues('number'),
99
58
  number: z.object({
100
59
  format: z.enum([
101
60
  'argentine_peso',
@@ -140,24 +99,29 @@ export var notionDatabasePropertyNumberSchema = z.object(_object_spread_props(_o
140
99
  'zloty'
141
100
  ])
142
101
  })
143
- }));
144
- export var notionDatabasePropertyPeopleSchema = z.object(_object_spread_props(_object_spread({}, commonPropertyValues('people')), {
102
+ });
103
+ export const notionDatabasePropertyPeopleSchema = z.object({
104
+ ...commonPropertyValues('people'),
145
105
  people: z.object({})
146
- }));
147
- export var notionDatabasePropertyPhoneNumberSchema = z.object(_object_spread_props(_object_spread({}, commonPropertyValues('phone_number')), {
106
+ });
107
+ export const notionDatabasePropertyPhoneNumberSchema = z.object({
108
+ ...commonPropertyValues('phone_number'),
148
109
  phone_number: z.object({})
149
- }));
150
- export var notionDatabasePropertyRelationSchema = z.object(_object_spread_props(_object_spread({}, commonPropertyValues('relation')), {
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
116
  synced_property_id: z.string().optional()
155
117
  })
156
- }));
157
- export var notionDatabasePropertyRichTextSchema = z.object(_object_spread_props(_object_spread({}, commonPropertyValues('rich_text')), {
118
+ });
119
+ export const notionDatabasePropertyRichTextSchema = z.object({
120
+ ...commonPropertyValues('rich_text'),
158
121
  rich_text: z.object({})
159
- }));
160
- export var notionDatabasePropertyRollupSchema = z.object(_object_spread_props(_object_spread({}, commonPropertyValues('rollup')), {
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(),
@@ -197,8 +161,9 @@ export var notionDatabasePropertyRollupSchema = z.object(_object_spread_props(_o
197
161
  'unsupported'
198
162
  ])
199
163
  })
200
- }));
201
- export var notionDatabasePropertySelectSchema = z.object(_object_spread_props(_object_spread({}, commonPropertyValues('select')), {
164
+ });
165
+ export const notionDatabasePropertySelectSchema = z.object({
166
+ ...commonPropertyValues('select'),
202
167
  select: z.object({
203
168
  options: z.array(z.object({
204
169
  id: z.string(),
@@ -206,8 +171,9 @@ export var notionDatabasePropertySelectSchema = z.object(_object_spread_props(_o
206
171
  color: notionCommonColorEnum
207
172
  }))
208
173
  })
209
- }));
210
- export var notionDatabasePropertyStatusSchema = z.object(_object_spread_props(_object_spread({}, commonPropertyValues('status')), {
174
+ });
175
+ export const notionDatabasePropertyStatusSchema = z.object({
176
+ ...commonPropertyValues('status'),
211
177
  status: z.object({
212
178
  options: z.array(z.object({
213
179
  id: z.string(),
@@ -221,21 +187,24 @@ export var notionDatabasePropertyStatusSchema = z.object(_object_spread_props(_o
221
187
  option_ids: z.array(z.string())
222
188
  })).nullable().optional()
223
189
  })
224
- }));
225
- export var notionDatabasePropertyTitleSchema = z.object(_object_spread_props(_object_spread({}, commonPropertyValues('title')), {
190
+ });
191
+ export const notionDatabasePropertyTitleSchema = z.object({
192
+ ...commonPropertyValues('title'),
226
193
  title: z.object({})
227
- }));
228
- export var notionDatabasePropertyUrlSchema = z.object(_object_spread_props(_object_spread({}, commonPropertyValues('url')), {
194
+ });
195
+ export const notionDatabasePropertyUrlSchema = z.object({
196
+ ...commonPropertyValues('url'),
229
197
  url: z.object({})
230
- }));
231
- export var notionDatabasePropertyUniqueIdSchema = z.object(_object_spread_props(_object_spread({}, commonPropertyValues('unique_id')), {
198
+ });
199
+ export const notionDatabasePropertyUniqueIdSchema = z.object({
200
+ ...commonPropertyValues('unique_id'),
232
201
  unique_id: z.object({})
233
- }));
234
- export var notionDatabasePropertyVerificationSchema = z.object(_object_spread_props(_object_spread({}, commonPropertyValues('verification')), {
202
+ });
203
+ export const notionDatabasePropertyVerificationSchema = z.object({
204
+ ...commonPropertyValues('verification'),
235
205
  verification: z.object({})
236
- }));
237
- export var notionDatabaseSchema = function(properties) {
238
- return z.object({
206
+ });
207
+ export const notionDatabaseSchema = (properties)=>z.object({
239
208
  object: z.literal('database'),
240
209
  id: z.string(),
241
210
  created_time: notionTimeFormat,
@@ -246,11 +215,10 @@ export var notionDatabaseSchema = function(properties) {
246
215
  description: z.array(notionRichTextSchema),
247
216
  icon: notionFileSchema.or(notionEmojiSchema),
248
217
  cover: notionFileSchema.nullable(),
249
- properties: properties,
218
+ properties,
250
219
  parent: notionWorkspaceParentSchema,
251
220
  url: z.string().url(),
252
221
  archived: z.boolean(),
253
222
  is_inline: z.boolean(),
254
223
  public_url: z.string().nullable()
255
224
  });
256
- };
@@ -1,5 +1,5 @@
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
4
  emoji: z.string().emoji()
5
5
  });
@@ -1,6 +1,6 @@
1
1
  import { z } from 'zod';
2
2
  import { notionTimeFormat } from './common.js';
3
- export var notionFileSchema = z.object({
3
+ export const notionFileSchema = z.object({
4
4
  type: z.enum([
5
5
  'file',
6
6
  'external'
@@ -1,7 +1,7 @@
1
1
  import { z } from 'zod';
2
2
  import { notionDatabasePropertyCheckboxSchema, notionDatabasePropertyCreatedBySchema, notionDatabasePropertyCreatedTimeSchema, notionDatabasePropertyDateSchema, notionDatabasePropertyFormulaSchema, notionDatabasePropertyLastEditedBySchema, notionDatabasePropertyLastEditedTimeSchema, notionDatabasePropertyMultiSelectSchema, notionDatabasePropertyNumberSchema, notionDatabasePropertyRelationSchema, notionDatabasePropertySelectSchema, notionDatabasePropertyStatusSchema, notionDatabasePropertyTitleSchema, notionDatabasePropertyUniqueIdSchema, notionDatabaseSchema } from './database.js';
3
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({
4
+ export const knowledgeBaseRetrieveDatabaseSchema = notionDatabaseSchema(z.object({
5
5
  Title: notionDatabasePropertyTitleSchema,
6
6
  Status: notionDatabasePropertyStatusSchema,
7
7
  Topic: notionDatabasePropertySelectSchema,
@@ -24,7 +24,7 @@ export var knowledgeBaseRetrieveDatabaseSchema = notionDatabaseSchema(z.object({
24
24
  Helpful: notionDatabasePropertyNumberSchema,
25
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,
@@ -48,7 +48,7 @@ export var knowledgeBaseRetrievePageSchema = notionPageSchema(z.object({
48
48
  Helpful: notionPagePropertyNumberSchema,
49
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,
@@ -231,8 +231,8 @@ export declare const notionPagePropertyRollupSchema: ZodObject<{
231
231
  type: z.ZodEnum<{
232
232
  number: "number";
233
233
  date: "date";
234
- array: "array";
235
234
  incomplete: "incomplete";
235
+ array: "array";
236
236
  unsupported: "unsupported";
237
237
  }>;
238
238
  }, z.core.$strip>;