@driveflux/api-functions 0.0.7-next.18 → 0.0.7-next.2
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 +325 -66
- package/dist/auth/emails.js +210 -42
- package/dist/auth/formatter.js +9 -9
- package/dist/auth/otp.js +374 -120
- package/dist/auth/register.js +383 -95
- package/dist/auth/register.js.map +1 -1
- package/dist/auth/tokens.d.ts +3 -3
- package/dist/auth/tokens.js +426 -114
- package/dist/auth/verifications.js +581 -176
- package/dist/constants.js +4 -4
- package/dist/mailjet/calls/manage-contacts-in-list.d.ts +2 -2
- package/dist/mailjet/calls/manage-contacts-in-list.d.ts.map +1 -1
- package/dist/mailjet/calls/manage-contacts-in-list.js +167 -22
- 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 +154 -13
- package/dist/mailjet/calls/manage-subscription-status.js.map +1 -1
- package/dist/mailjet/calls/request-service.js +182 -18
- package/dist/mailjet/refresh-email-preferences.js +221 -21
- 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 +213 -21
- 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/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 +56 -9
- 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 +214 -37
- package/dist/mailjet/utils/lists.js +248 -28
- 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 +207 -27
- package/dist/mailjet/utils/update-email-references.js.map +1 -1
- package/dist/notion/client.js +196 -50
- package/dist/notion/helpful.js +169 -25
- package/dist/notion/schemas/block.js +1 -1
- package/dist/notion/schemas/common.js +9 -7
- package/dist/notion/schemas/database.d.ts +1 -1
- package/dist/notion/schemas/database.js +100 -68
- package/dist/notion/schemas/emoji.js +1 -1
- package/dist/notion/schemas/file.js +1 -1
- package/dist/notion/schemas/kb.js +3 -3
- package/dist/notion/schemas/page.d.ts +1 -1
- package/dist/notion/schemas/page.js +103 -69
- package/dist/notion/schemas/parent.js +4 -4
- package/dist/notion/schemas/user.js +2 -2
- package/dist/reservation/agree.d.ts +1 -1
- package/dist/reservation/agree.d.ts.map +1 -1
- package/dist/reservation/agree.js +157 -17
- package/dist/reservation/checks.d.ts +1 -1
- package/dist/reservation/checks.d.ts.map +1 -1
- package/dist/reservation/checks.js +177 -21
- package/dist/reservation/display-vehicle.d.ts +1 -1
- package/dist/reservation/display-vehicle.js +500 -122
- package/dist/reservation/display-vehicle.js.map +1 -1
- package/dist/reservation/fetch-or-create.d.ts +2 -2
- package/dist/reservation/fetch-or-create.d.ts.map +1 -1
- package/dist/reservation/fetch-or-create.js +478 -188
- package/dist/reservation/fetch-or-create.js.map +1 -1
- package/dist/reservation/invoice.d.ts +3 -3
- package/dist/reservation/invoice.d.ts.map +1 -1
- package/dist/reservation/invoice.js +492 -182
- 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 +175 -25
- package/dist/reservation/reserve.d.ts +1 -1
- package/dist/reservation/reserve.d.ts.map +1 -1
- package/dist/reservation/reserve.js +196 -35
- package/dist/reservation/reserve.js.map +1 -1
- package/dist/reservation/types.d.ts +0 -1
- package/dist/reservation/types.d.ts.map +1 -1
- package/dist/reservation/vehicle.d.ts +1 -1
- package/dist/reservation/vehicle.d.ts.map +1 -1
- package/dist/reservation/vehicle.js +188 -23
- package/dist/reservation/vehicle.js.map +1 -1
- package/dist/slack.js +268 -57
- package/dist/validation.js +98 -38
- 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 +16 -16
- 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 +259 -87
- package/dist/vehicle/vehicle-pricing/index.js.map +1 -1
- package/package.json +21 -21
package/dist/notion/helpful.js
CHANGED
|
@@ -1,29 +1,173 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
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
|
+
};
|
|
14
50
|
}
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
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;
|
|
25
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;
|
|
26
113
|
}
|
|
27
|
-
|
|
28
|
-
|
|
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
|
+
import { getNotion } from '@driveflux/api-functions/notion';
|
|
122
|
+
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
|
+
];
|
|
170
|
+
}
|
|
171
|
+
});
|
|
172
|
+
})();
|
|
29
173
|
};
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
|
-
export
|
|
3
|
-
export
|
|
4
|
-
export
|
|
5
|
-
export
|
|
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([
|
|
6
6
|
'blue',
|
|
7
7
|
'brown',
|
|
8
8
|
'default',
|
|
@@ -14,13 +14,15 @@ export const notionCommonColorEnum = z.enum([
|
|
|
14
14
|
'red',
|
|
15
15
|
'yellow'
|
|
16
16
|
]);
|
|
17
|
-
export
|
|
17
|
+
export var 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
|
|
22
|
+
export var commonPropertyValues = function(type) {
|
|
23
|
+
return {
|
|
23
24
|
id: z.string(),
|
|
24
25
|
type: z.literal(type),
|
|
25
26
|
name: z.string().optional()
|
|
26
|
-
}
|
|
27
|
+
};
|
|
28
|
+
};
|
|
@@ -190,8 +190,8 @@ export declare const notionDatabasePropertyRollupSchema: ZodObject<{
|
|
|
190
190
|
type: z.ZodEnum<{
|
|
191
191
|
number: "number";
|
|
192
192
|
date: "date";
|
|
193
|
-
incomplete: "incomplete";
|
|
194
193
|
array: "array";
|
|
194
|
+
incomplete: "incomplete";
|
|
195
195
|
unsupported: "unsupported";
|
|
196
196
|
}>;
|
|
197
197
|
}, z.core.$strip>;
|
|
@@ -1,3 +1,55 @@
|
|
|
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
55
|
import { commonPropertyValues, notionCommonColorEnum, notionTimeFormat } from './common.js';
|
|
@@ -5,46 +57,36 @@ 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
|
|
9
|
-
...commonPropertyValues('checkbox'),
|
|
60
|
+
export var notionDatabasePropertyCheckboxSchema = z.object(_object_spread_props(_object_spread({}, commonPropertyValues('checkbox')), {
|
|
10
61
|
checkbox: z.object({})
|
|
11
|
-
});
|
|
12
|
-
export
|
|
13
|
-
...commonPropertyValues('created_by'),
|
|
62
|
+
}));
|
|
63
|
+
export var notionDatabasePropertyCreatedBySchema = z.object(_object_spread_props(_object_spread({}, commonPropertyValues('created_by')), {
|
|
14
64
|
created_by: z.object({})
|
|
15
|
-
});
|
|
16
|
-
export
|
|
17
|
-
...commonPropertyValues('created_time'),
|
|
65
|
+
}));
|
|
66
|
+
export var notionDatabasePropertyCreatedTimeSchema = z.object(_object_spread_props(_object_spread({}, commonPropertyValues('created_time')), {
|
|
18
67
|
created_time: z.object({})
|
|
19
|
-
});
|
|
20
|
-
export
|
|
21
|
-
...commonPropertyValues('date'),
|
|
68
|
+
}));
|
|
69
|
+
export var notionDatabasePropertyDateSchema = z.object(_object_spread_props(_object_spread({}, commonPropertyValues('date')), {
|
|
22
70
|
date: z.object({})
|
|
23
|
-
});
|
|
24
|
-
export
|
|
25
|
-
...commonPropertyValues('email'),
|
|
71
|
+
}));
|
|
72
|
+
export var notionDatabasePropertyEmailSchema = z.object(_object_spread_props(_object_spread({}, commonPropertyValues('email')), {
|
|
26
73
|
email: z.object({})
|
|
27
|
-
});
|
|
28
|
-
export
|
|
29
|
-
...commonPropertyValues('files'),
|
|
74
|
+
}));
|
|
75
|
+
export var notionDatabasePropertyFilesSchema = z.object(_object_spread_props(_object_spread({}, commonPropertyValues('files')), {
|
|
30
76
|
files: z.object({})
|
|
31
|
-
});
|
|
32
|
-
export
|
|
33
|
-
...commonPropertyValues('formula'),
|
|
77
|
+
}));
|
|
78
|
+
export var notionDatabasePropertyFormulaSchema = z.object(_object_spread_props(_object_spread({}, commonPropertyValues('formula')), {
|
|
34
79
|
formula: z.object({
|
|
35
80
|
expression: z.string()
|
|
36
81
|
})
|
|
37
|
-
});
|
|
38
|
-
export
|
|
39
|
-
...commonPropertyValues('last_edited_by'),
|
|
82
|
+
}));
|
|
83
|
+
export var notionDatabasePropertyLastEditedBySchema = z.object(_object_spread_props(_object_spread({}, commonPropertyValues('last_edited_by')), {
|
|
40
84
|
last_edited_by: z.object({}).optional()
|
|
41
|
-
});
|
|
42
|
-
export
|
|
43
|
-
...commonPropertyValues('last_edited_time'),
|
|
85
|
+
}));
|
|
86
|
+
export var notionDatabasePropertyLastEditedTimeSchema = z.object(_object_spread_props(_object_spread({}, commonPropertyValues('last_edited_time')), {
|
|
44
87
|
last_edited_time: z.object({})
|
|
45
|
-
});
|
|
46
|
-
export
|
|
47
|
-
...commonPropertyValues('multi_select'),
|
|
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(),
|
|
@@ -52,9 +94,8 @@ export const notionDatabasePropertyMultiSelectSchema = z.object({
|
|
|
52
94
|
color: notionCommonColorEnum
|
|
53
95
|
}))
|
|
54
96
|
})
|
|
55
|
-
});
|
|
56
|
-
export
|
|
57
|
-
...commonPropertyValues('number'),
|
|
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',
|
|
@@ -99,29 +140,24 @@ export const notionDatabasePropertyNumberSchema = z.object({
|
|
|
99
140
|
'zloty'
|
|
100
141
|
])
|
|
101
142
|
})
|
|
102
|
-
});
|
|
103
|
-
export
|
|
104
|
-
...commonPropertyValues('people'),
|
|
143
|
+
}));
|
|
144
|
+
export var notionDatabasePropertyPeopleSchema = z.object(_object_spread_props(_object_spread({}, commonPropertyValues('people')), {
|
|
105
145
|
people: z.object({})
|
|
106
|
-
});
|
|
107
|
-
export
|
|
108
|
-
...commonPropertyValues('phone_number'),
|
|
146
|
+
}));
|
|
147
|
+
export var notionDatabasePropertyPhoneNumberSchema = z.object(_object_spread_props(_object_spread({}, commonPropertyValues('phone_number')), {
|
|
109
148
|
phone_number: z.object({})
|
|
110
|
-
});
|
|
111
|
-
export
|
|
112
|
-
...commonPropertyValues('relation'),
|
|
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
154
|
synced_property_id: z.string().optional()
|
|
117
155
|
})
|
|
118
|
-
});
|
|
119
|
-
export
|
|
120
|
-
...commonPropertyValues('rich_text'),
|
|
156
|
+
}));
|
|
157
|
+
export var notionDatabasePropertyRichTextSchema = z.object(_object_spread_props(_object_spread({}, commonPropertyValues('rich_text')), {
|
|
121
158
|
rich_text: z.object({})
|
|
122
|
-
});
|
|
123
|
-
export
|
|
124
|
-
...commonPropertyValues('rollup'),
|
|
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(),
|
|
@@ -161,9 +197,8 @@ export const notionDatabasePropertyRollupSchema = z.object({
|
|
|
161
197
|
'unsupported'
|
|
162
198
|
])
|
|
163
199
|
})
|
|
164
|
-
});
|
|
165
|
-
export
|
|
166
|
-
...commonPropertyValues('select'),
|
|
200
|
+
}));
|
|
201
|
+
export var notionDatabasePropertySelectSchema = z.object(_object_spread_props(_object_spread({}, commonPropertyValues('select')), {
|
|
167
202
|
select: z.object({
|
|
168
203
|
options: z.array(z.object({
|
|
169
204
|
id: z.string(),
|
|
@@ -171,9 +206,8 @@ export const notionDatabasePropertySelectSchema = z.object({
|
|
|
171
206
|
color: notionCommonColorEnum
|
|
172
207
|
}))
|
|
173
208
|
})
|
|
174
|
-
});
|
|
175
|
-
export
|
|
176
|
-
...commonPropertyValues('status'),
|
|
209
|
+
}));
|
|
210
|
+
export var notionDatabasePropertyStatusSchema = z.object(_object_spread_props(_object_spread({}, commonPropertyValues('status')), {
|
|
177
211
|
status: z.object({
|
|
178
212
|
options: z.array(z.object({
|
|
179
213
|
id: z.string(),
|
|
@@ -187,24 +221,21 @@ export const notionDatabasePropertyStatusSchema = z.object({
|
|
|
187
221
|
option_ids: z.array(z.string())
|
|
188
222
|
})).nullable().optional()
|
|
189
223
|
})
|
|
190
|
-
});
|
|
191
|
-
export
|
|
192
|
-
...commonPropertyValues('title'),
|
|
224
|
+
}));
|
|
225
|
+
export var notionDatabasePropertyTitleSchema = z.object(_object_spread_props(_object_spread({}, commonPropertyValues('title')), {
|
|
193
226
|
title: z.object({})
|
|
194
|
-
});
|
|
195
|
-
export
|
|
196
|
-
...commonPropertyValues('url'),
|
|
227
|
+
}));
|
|
228
|
+
export var notionDatabasePropertyUrlSchema = z.object(_object_spread_props(_object_spread({}, commonPropertyValues('url')), {
|
|
197
229
|
url: z.object({})
|
|
198
|
-
});
|
|
199
|
-
export
|
|
200
|
-
...commonPropertyValues('unique_id'),
|
|
230
|
+
}));
|
|
231
|
+
export var notionDatabasePropertyUniqueIdSchema = z.object(_object_spread_props(_object_spread({}, commonPropertyValues('unique_id')), {
|
|
201
232
|
unique_id: z.object({})
|
|
202
|
-
});
|
|
203
|
-
export
|
|
204
|
-
...commonPropertyValues('verification'),
|
|
233
|
+
}));
|
|
234
|
+
export var notionDatabasePropertyVerificationSchema = z.object(_object_spread_props(_object_spread({}, commonPropertyValues('verification')), {
|
|
205
235
|
verification: z.object({})
|
|
206
|
-
});
|
|
207
|
-
export
|
|
236
|
+
}));
|
|
237
|
+
export var notionDatabaseSchema = function(properties) {
|
|
238
|
+
return z.object({
|
|
208
239
|
object: z.literal('database'),
|
|
209
240
|
id: z.string(),
|
|
210
241
|
created_time: notionTimeFormat,
|
|
@@ -215,10 +246,11 @@ export const notionDatabaseSchema = (properties)=>z.object({
|
|
|
215
246
|
description: z.array(notionRichTextSchema),
|
|
216
247
|
icon: notionFileSchema.or(notionEmojiSchema),
|
|
217
248
|
cover: notionFileSchema.nullable(),
|
|
218
|
-
properties,
|
|
249
|
+
properties: properties,
|
|
219
250
|
parent: notionWorkspaceParentSchema,
|
|
220
251
|
url: z.string().url(),
|
|
221
252
|
archived: z.boolean(),
|
|
222
253
|
is_inline: z.boolean(),
|
|
223
254
|
public_url: z.string().nullable()
|
|
224
255
|
});
|
|
256
|
+
};
|
|
@@ -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
|
|
4
|
+
export var knowledgeBaseRetrieveDatabaseSchema = notionDatabaseSchema(z.object({
|
|
5
5
|
Title: notionDatabasePropertyTitleSchema,
|
|
6
6
|
Status: notionDatabasePropertyStatusSchema,
|
|
7
7
|
Topic: notionDatabasePropertySelectSchema,
|
|
@@ -24,7 +24,7 @@ export const knowledgeBaseRetrieveDatabaseSchema = notionDatabaseSchema(z.object
|
|
|
24
24
|
Helpful: notionDatabasePropertyNumberSchema,
|
|
25
25
|
Unhelpful: notionDatabasePropertyNumberSchema
|
|
26
26
|
}));
|
|
27
|
-
export
|
|
27
|
+
export var knowledgeBaseRetrievePageSchema = notionPageSchema(z.object({
|
|
28
28
|
Title: notionPagePropertyTitleSchema,
|
|
29
29
|
'Seo Title': notionPagePropertyRichTextSchema,
|
|
30
30
|
Status: notionPagePropertyStatusSchema,
|
|
@@ -48,7 +48,7 @@ export const knowledgeBaseRetrievePageSchema = notionPageSchema(z.object({
|
|
|
48
48
|
Helpful: notionPagePropertyNumberSchema,
|
|
49
49
|
Unhelpful: notionPagePropertyNumberSchema
|
|
50
50
|
}));
|
|
51
|
-
export
|
|
51
|
+
export var 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
|
-
incomplete: "incomplete";
|
|
235
234
|
array: "array";
|
|
235
|
+
incomplete: "incomplete";
|
|
236
236
|
unsupported: "unsupported";
|
|
237
237
|
}>;
|
|
238
238
|
}, z.core.$strip>;
|