@driveflux/api-functions 0.0.4 → 0.0.5
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 +327 -73
- package/dist/auth/emails.js +210 -43
- package/dist/auth/formatter.js +11 -11
- package/dist/auth/otp.js +392 -122
- package/dist/auth/register.js +396 -100
- package/dist/auth/tokens.js +430 -115
- package/dist/auth/verifications.js +512 -154
- package/dist/constants.js +4 -5
- package/dist/mailjet/calls/manage-contacts-in-list.js +166 -22
- package/dist/mailjet/calls/manage-subscription-status.js +153 -13
- package/dist/mailjet/calls/request-service.js +183 -18
- package/dist/mailjet/refresh-email-preferences.d.ts +10 -10
- package/dist/mailjet/refresh-email-preferences.d.ts.map +1 -1
- package/dist/mailjet/refresh-email-preferences.js +226 -27
- package/dist/mailjet/refresh-email-preferences.js.map +1 -1
- package/dist/mailjet/set-contact.d.ts +10 -10
- package/dist/mailjet/set-contact.d.ts.map +1 -1
- package/dist/mailjet/set-contact.js +215 -24
- package/dist/mailjet/set-contact.js.map +1 -1
- package/dist/mailjet/types.js +1 -2
- package/dist/mailjet/utils/convert-to-array.js +58 -9
- package/dist/mailjet/utils/extract-email-preferences.d.ts +8 -8
- package/dist/mailjet/utils/extract-email-preferences.d.ts.map +1 -1
- package/dist/mailjet/utils/extract-email-preferences.js +218 -42
- package/dist/mailjet/utils/extract-email-preferences.js.map +1 -1
- package/dist/mailjet/utils/lists.js +249 -30
- package/dist/mailjet/utils/update-email-references.js +208 -27
- package/dist/notion/client.js +197 -48
- package/dist/notion/helpful.js +170 -29
- package/dist/notion/schemas/block.js +43 -49
- package/dist/notion/schemas/common.js +14 -17
- package/dist/notion/schemas/database.js +159 -125
- package/dist/notion/schemas/emoji.js +2 -3
- package/dist/notion/schemas/file.js +10 -10
- package/dist/notion/schemas/kb.js +8 -9
- package/dist/notion/schemas/page.js +171 -126
- package/dist/notion/schemas/parent.js +8 -9
- package/dist/notion/schemas/user.js +20 -21
- package/dist/reservation/agree.js +158 -19
- package/dist/reservation/checks.js +178 -23
- package/dist/reservation/display-vehicle.js +514 -142
- package/dist/reservation/fetch-or-create.js +482 -197
- package/dist/reservation/invoice.js +496 -198
- package/dist/reservation/payer.js +177 -28
- package/dist/reservation/reserve.js +191 -31
- package/dist/reservation/types.js +1 -2
- package/dist/reservation/vehicle.js +186 -24
- package/dist/slack.js +273 -67
- package/dist/validation.d.ts +19 -13
- package/dist/validation.d.ts.map +1 -1
- package/dist/validation.js +144 -63
- package/dist/validation.js.map +1 -1
- package/dist/vehicle/vehicle-pricing/constants.js +36 -33
- package/dist/vehicle/vehicle-pricing/index.js +257 -99
- package/dist/vehicle/vehicle-pricing/types.js +1 -2
- package/package.json +9 -9
package/dist/slack.js
CHANGED
|
@@ -1,3 +1,148 @@
|
|
|
1
|
+
function _array_like_to_array(arr, len) {
|
|
2
|
+
if (len == null || len > arr.length) len = arr.length;
|
|
3
|
+
for(var i = 0, arr2 = new Array(len); i < len; i++)arr2[i] = arr[i];
|
|
4
|
+
return arr2;
|
|
5
|
+
}
|
|
6
|
+
function _array_without_holes(arr) {
|
|
7
|
+
if (Array.isArray(arr)) return _array_like_to_array(arr);
|
|
8
|
+
}
|
|
9
|
+
function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) {
|
|
10
|
+
try {
|
|
11
|
+
var info = gen[key](arg);
|
|
12
|
+
var value = info.value;
|
|
13
|
+
} catch (error) {
|
|
14
|
+
reject(error);
|
|
15
|
+
return;
|
|
16
|
+
}
|
|
17
|
+
if (info.done) {
|
|
18
|
+
resolve(value);
|
|
19
|
+
} else {
|
|
20
|
+
Promise.resolve(value).then(_next, _throw);
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
function _async_to_generator(fn) {
|
|
24
|
+
return function() {
|
|
25
|
+
var self = this, args = arguments;
|
|
26
|
+
return new Promise(function(resolve, reject) {
|
|
27
|
+
var gen = fn.apply(self, args);
|
|
28
|
+
function _next(value) {
|
|
29
|
+
asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value);
|
|
30
|
+
}
|
|
31
|
+
function _throw(err) {
|
|
32
|
+
asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err);
|
|
33
|
+
}
|
|
34
|
+
_next(undefined);
|
|
35
|
+
});
|
|
36
|
+
};
|
|
37
|
+
}
|
|
38
|
+
function _iterable_to_array(iter) {
|
|
39
|
+
if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter);
|
|
40
|
+
}
|
|
41
|
+
function _non_iterable_spread() {
|
|
42
|
+
throw new TypeError("Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
|
|
43
|
+
}
|
|
44
|
+
function _to_consumable_array(arr) {
|
|
45
|
+
return _array_without_holes(arr) || _iterable_to_array(arr) || _unsupported_iterable_to_array(arr) || _non_iterable_spread();
|
|
46
|
+
}
|
|
47
|
+
function _unsupported_iterable_to_array(o, minLen) {
|
|
48
|
+
if (!o) return;
|
|
49
|
+
if (typeof o === "string") return _array_like_to_array(o, minLen);
|
|
50
|
+
var n = Object.prototype.toString.call(o).slice(8, -1);
|
|
51
|
+
if (n === "Object" && o.constructor) n = o.constructor.name;
|
|
52
|
+
if (n === "Map" || n === "Set") return Array.from(n);
|
|
53
|
+
if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _array_like_to_array(o, minLen);
|
|
54
|
+
}
|
|
55
|
+
function _ts_generator(thisArg, body) {
|
|
56
|
+
var f, y, t, _ = {
|
|
57
|
+
label: 0,
|
|
58
|
+
sent: function() {
|
|
59
|
+
if (t[0] & 1) throw t[1];
|
|
60
|
+
return t[1];
|
|
61
|
+
},
|
|
62
|
+
trys: [],
|
|
63
|
+
ops: []
|
|
64
|
+
}, g = Object.create((typeof Iterator === "function" ? Iterator : Object).prototype);
|
|
65
|
+
return g.next = verb(0), g["throw"] = verb(1), g["return"] = verb(2), typeof Symbol === "function" && (g[Symbol.iterator] = function() {
|
|
66
|
+
return this;
|
|
67
|
+
}), g;
|
|
68
|
+
function verb(n) {
|
|
69
|
+
return function(v) {
|
|
70
|
+
return step([
|
|
71
|
+
n,
|
|
72
|
+
v
|
|
73
|
+
]);
|
|
74
|
+
};
|
|
75
|
+
}
|
|
76
|
+
function step(op) {
|
|
77
|
+
if (f) throw new TypeError("Generator is already executing.");
|
|
78
|
+
while(g && (g = 0, op[0] && (_ = 0)), _)try {
|
|
79
|
+
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;
|
|
80
|
+
if (y = 0, t) op = [
|
|
81
|
+
op[0] & 2,
|
|
82
|
+
t.value
|
|
83
|
+
];
|
|
84
|
+
switch(op[0]){
|
|
85
|
+
case 0:
|
|
86
|
+
case 1:
|
|
87
|
+
t = op;
|
|
88
|
+
break;
|
|
89
|
+
case 4:
|
|
90
|
+
_.label++;
|
|
91
|
+
return {
|
|
92
|
+
value: op[1],
|
|
93
|
+
done: false
|
|
94
|
+
};
|
|
95
|
+
case 5:
|
|
96
|
+
_.label++;
|
|
97
|
+
y = op[1];
|
|
98
|
+
op = [
|
|
99
|
+
0
|
|
100
|
+
];
|
|
101
|
+
continue;
|
|
102
|
+
case 7:
|
|
103
|
+
op = _.ops.pop();
|
|
104
|
+
_.trys.pop();
|
|
105
|
+
continue;
|
|
106
|
+
default:
|
|
107
|
+
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) {
|
|
108
|
+
_ = 0;
|
|
109
|
+
continue;
|
|
110
|
+
}
|
|
111
|
+
if (op[0] === 3 && (!t || op[1] > t[0] && op[1] < t[3])) {
|
|
112
|
+
_.label = op[1];
|
|
113
|
+
break;
|
|
114
|
+
}
|
|
115
|
+
if (op[0] === 6 && _.label < t[1]) {
|
|
116
|
+
_.label = t[1];
|
|
117
|
+
t = op;
|
|
118
|
+
break;
|
|
119
|
+
}
|
|
120
|
+
if (t && _.label < t[2]) {
|
|
121
|
+
_.label = t[2];
|
|
122
|
+
_.ops.push(op);
|
|
123
|
+
break;
|
|
124
|
+
}
|
|
125
|
+
if (t[2]) _.ops.pop();
|
|
126
|
+
_.trys.pop();
|
|
127
|
+
continue;
|
|
128
|
+
}
|
|
129
|
+
op = body.call(thisArg, _);
|
|
130
|
+
} catch (e) {
|
|
131
|
+
op = [
|
|
132
|
+
6,
|
|
133
|
+
e
|
|
134
|
+
];
|
|
135
|
+
y = 0;
|
|
136
|
+
} finally{
|
|
137
|
+
f = t = 0;
|
|
138
|
+
}
|
|
139
|
+
if (op[0] & 5) throw op[1];
|
|
140
|
+
return {
|
|
141
|
+
value: op[0] ? op[1] : void 0,
|
|
142
|
+
done: true
|
|
143
|
+
};
|
|
144
|
+
}
|
|
145
|
+
}
|
|
1
146
|
import { config } from '@driveflux/config/backend';
|
|
2
147
|
import { enhancedFetch } from '@driveflux/fetch';
|
|
3
148
|
import { createTaskLater } from '@driveflux/scheduler';
|
|
@@ -6,100 +151,161 @@ import { TASK_COMMIT_SLACK_CHANNEL, TASK_PIPELINE_SLACK } from './constants.js';
|
|
|
6
151
|
if (!global.__slackBlocks) {
|
|
7
152
|
global.__slackBlocks = new Map();
|
|
8
153
|
}
|
|
9
|
-
|
|
154
|
+
var slackBlocks = global.__slackBlocks;
|
|
10
155
|
/**
|
|
11
156
|
*
|
|
12
157
|
* @deprecated Use slackLater instead and commitSlack to commit
|
|
13
|
-
*/
|
|
14
|
-
|
|
15
|
-
return
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
158
|
+
*/ export var slack = function(message) {
|
|
159
|
+
var channel = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : config.slack.defaultChannelId;
|
|
160
|
+
return _async_to_generator(function() {
|
|
161
|
+
return _ts_generator(this, function(_state) {
|
|
162
|
+
switch(_state.label){
|
|
163
|
+
case 0:
|
|
164
|
+
return [
|
|
165
|
+
4,
|
|
166
|
+
enhancedFetch('https://slack.com/api/chat.postMessage', {
|
|
167
|
+
method: 'POST',
|
|
168
|
+
headers: {
|
|
169
|
+
Authorization: "Bearer ".concat(config.slack.token)
|
|
170
|
+
},
|
|
171
|
+
body: JSON.stringify({
|
|
172
|
+
channel: channel,
|
|
173
|
+
blocks: [
|
|
174
|
+
{
|
|
175
|
+
type: 'section',
|
|
176
|
+
text: {
|
|
177
|
+
type: 'mrkdwn',
|
|
178
|
+
text: message
|
|
179
|
+
}
|
|
180
|
+
}
|
|
181
|
+
]
|
|
182
|
+
})
|
|
183
|
+
})
|
|
184
|
+
];
|
|
185
|
+
case 1:
|
|
186
|
+
return [
|
|
187
|
+
2,
|
|
188
|
+
_state.sent()
|
|
189
|
+
];
|
|
190
|
+
}
|
|
191
|
+
});
|
|
192
|
+
})();
|
|
193
|
+
};
|
|
194
|
+
export var getSlackBlocks = function(channel) {
|
|
195
|
+
return channel ? slackBlocks.get(channel) : slackBlocks;
|
|
33
196
|
};
|
|
34
|
-
export const getSlackBlocks = (channel) => channel ? slackBlocks.get(channel) : slackBlocks;
|
|
35
197
|
/**
|
|
36
198
|
* Naive implementation, however, for now (uncrowded serverless env), this works
|
|
37
199
|
* @param blocks
|
|
38
200
|
* @param channel
|
|
39
|
-
*/
|
|
40
|
-
|
|
41
|
-
const targetChannel = (config.appEnv === 'production'
|
|
42
|
-
? channel
|
|
43
|
-
: config.slack.defaultChannelId) || config.slack.defaultChannelId;
|
|
201
|
+
*/ export function slackLater(blocks, channel) {
|
|
202
|
+
var targetChannel = (config.appEnv === 'production' ? channel : config.slack.defaultChannelId) || config.slack.defaultChannelId;
|
|
44
203
|
if (!targetChannel || !blocks) {
|
|
45
204
|
return;
|
|
46
205
|
}
|
|
47
|
-
|
|
206
|
+
var messages = slackBlocks.get(targetChannel) || new Set();
|
|
48
207
|
if (typeof blocks === 'string') {
|
|
49
208
|
messages.add({
|
|
50
209
|
type: 'section',
|
|
51
210
|
text: {
|
|
52
211
|
type: 'mrkdwn',
|
|
53
|
-
text: blocks
|
|
54
|
-
}
|
|
212
|
+
text: blocks
|
|
213
|
+
}
|
|
55
214
|
});
|
|
56
|
-
}
|
|
57
|
-
else if (!Array.isArray(blocks)) {
|
|
215
|
+
} else if (!Array.isArray(blocks)) {
|
|
58
216
|
messages.add(blocks);
|
|
59
|
-
}
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
217
|
+
} else {
|
|
218
|
+
var _iteratorNormalCompletion = true, _didIteratorError = false, _iteratorError = undefined;
|
|
219
|
+
try {
|
|
220
|
+
for(var _iterator = blocks[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true){
|
|
221
|
+
var b = _step.value;
|
|
222
|
+
messages.add(b);
|
|
223
|
+
}
|
|
224
|
+
} catch (err) {
|
|
225
|
+
_didIteratorError = true;
|
|
226
|
+
_iteratorError = err;
|
|
227
|
+
} finally{
|
|
228
|
+
try {
|
|
229
|
+
if (!_iteratorNormalCompletion && _iterator.return != null) {
|
|
230
|
+
_iterator.return();
|
|
231
|
+
}
|
|
232
|
+
} finally{
|
|
233
|
+
if (_didIteratorError) {
|
|
234
|
+
throw _iteratorError;
|
|
235
|
+
}
|
|
236
|
+
}
|
|
63
237
|
}
|
|
64
238
|
}
|
|
65
239
|
slackBlocks.set(targetChannel, messages);
|
|
66
240
|
}
|
|
67
|
-
export
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
241
|
+
export function sendSlackMessages(channel, blocks) {
|
|
242
|
+
return _async_to_generator(function() {
|
|
243
|
+
var targetChannel;
|
|
244
|
+
return _ts_generator(this, function(_state) {
|
|
245
|
+
switch(_state.label){
|
|
246
|
+
case 0:
|
|
247
|
+
targetChannel = config.appEnv === 'production' ? channel : config.slack.defaultChannelId;
|
|
248
|
+
return [
|
|
249
|
+
4,
|
|
250
|
+
enhancedFetch('https://slack.com/api/chat.postMessage', {
|
|
251
|
+
method: 'POST',
|
|
252
|
+
headers: {
|
|
253
|
+
Authorization: "Bearer ".concat(config.slack.token)
|
|
254
|
+
},
|
|
255
|
+
body: JSON.stringify({
|
|
256
|
+
channel: targetChannel,
|
|
257
|
+
blocks: Array.from(blocks)
|
|
258
|
+
})
|
|
259
|
+
})
|
|
260
|
+
];
|
|
261
|
+
case 1:
|
|
262
|
+
return [
|
|
263
|
+
2,
|
|
264
|
+
_state.sent()
|
|
265
|
+
];
|
|
266
|
+
}
|
|
267
|
+
});
|
|
268
|
+
})();
|
|
79
269
|
}
|
|
80
|
-
export
|
|
270
|
+
export var commitSlack = function() {
|
|
81
271
|
if (!slackBlocks.size) {
|
|
82
272
|
return;
|
|
83
273
|
}
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
274
|
+
var channels = slackBlocks.keys();
|
|
275
|
+
var i = 1;
|
|
276
|
+
var baseUrl = config.appEnv === 'development' ? config.tunnelUrl : config.appUrl;
|
|
277
|
+
var _iteratorNormalCompletion = true, _didIteratorError = false, _iteratorError = undefined;
|
|
278
|
+
try {
|
|
279
|
+
for(var _iterator = channels[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true){
|
|
280
|
+
var channel = _step.value;
|
|
281
|
+
var blocks = slackBlocks.get(channel);
|
|
282
|
+
if (!(blocks === null || blocks === void 0 ? void 0 : blocks.size)) {
|
|
283
|
+
continue;
|
|
284
|
+
}
|
|
285
|
+
createTaskLater({
|
|
286
|
+
pipeline: TASK_PIPELINE_SLACK,
|
|
287
|
+
name: TASK_COMMIT_SLACK_CHANNEL,
|
|
288
|
+
metadata: {
|
|
289
|
+
channel: channel,
|
|
290
|
+
blocks: _to_consumable_array(blocks)
|
|
291
|
+
},
|
|
292
|
+
taskHandlerUrl: "".concat(baseUrl || config.appUrl, "/api/hooks/slack-pipeline"),
|
|
293
|
+
scheduledAt: addSeconds(new Date(), i++)
|
|
294
|
+
});
|
|
295
|
+
}
|
|
296
|
+
} catch (err) {
|
|
297
|
+
_didIteratorError = true;
|
|
298
|
+
_iteratorError = err;
|
|
299
|
+
} finally{
|
|
300
|
+
try {
|
|
301
|
+
if (!_iteratorNormalCompletion && _iterator.return != null) {
|
|
302
|
+
_iterator.return();
|
|
303
|
+
}
|
|
304
|
+
} finally{
|
|
305
|
+
if (_didIteratorError) {
|
|
306
|
+
throw _iteratorError;
|
|
307
|
+
}
|
|
91
308
|
}
|
|
92
|
-
createTaskLater({
|
|
93
|
-
pipeline: TASK_PIPELINE_SLACK,
|
|
94
|
-
name: TASK_COMMIT_SLACK_CHANNEL,
|
|
95
|
-
metadata: {
|
|
96
|
-
channel,
|
|
97
|
-
blocks: [...blocks],
|
|
98
|
-
},
|
|
99
|
-
taskHandlerUrl: `${baseUrl || config.appUrl}/api/hooks/slack-pipeline`,
|
|
100
|
-
scheduledAt: addSeconds(new Date(), i++),
|
|
101
|
-
});
|
|
102
309
|
}
|
|
103
310
|
slackBlocks.clear();
|
|
104
311
|
};
|
|
105
|
-
//# sourceMappingURL=slack.js.map
|
package/dist/validation.d.ts
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { type StandardResult } from '@driveflux/result';
|
|
2
|
-
import { type ZodDate, type ZodError, type ZodNumber, z } from 'zod';
|
|
3
|
-
export declare const makeValidationErrorResult: (zodError: ZodError<
|
|
4
|
-
export declare const getIdOrObjectValidation: <ObjectName extends string, ExtendObjectValidation extends z.ZodRawShape>(object: ObjectName, extendObjectValidation?: ExtendObjectValidation) =>
|
|
2
|
+
import { type ZodArray, type ZodCodec, type ZodDate, type ZodEnum, type ZodError, type ZodNumber, type ZodUnion, z } from 'zod';
|
|
3
|
+
export declare const makeValidationErrorResult: (zodError: ZodError<unknown>) => StandardResult<never>;
|
|
4
|
+
export declare const getIdOrObjectValidation: <ObjectName extends string, ExtendObjectValidation extends z.ZodRawShape>(object: ObjectName, extendObjectValidation?: ExtendObjectValidation) => ZodUnion<readonly [z.ZodString, z.ZodObject<{
|
|
5
5
|
object: z.ZodLiteral<ObjectName>;
|
|
6
6
|
}, z.core.$catchall<z.ZodAny>>]>;
|
|
7
7
|
export declare const nonEmptyStringValidator: z.ZodString;
|
|
8
|
-
export declare const metadataValidation: z.ZodObject<{}, z.core.$catchall<
|
|
8
|
+
export declare const metadataValidation: z.ZodObject<{}, z.core.$catchall<ZodUnion<readonly [z.ZodString, ZodNumber, z.ZodBoolean, ZodArray<z.ZodString>, ZodArray<ZodNumber>, ZodArray<z.ZodBoolean>, z.ZodNull, z.ZodUndefined]>>>;
|
|
9
9
|
export declare const addressValidation: z.ZodObject<{
|
|
10
10
|
name: z.ZodNullable<z.ZodOptional<z.ZodString>>;
|
|
11
11
|
coordinates: z.ZodOptional<z.ZodNullable<z.ZodObject<{
|
|
@@ -19,8 +19,8 @@ export declare const addressValidation: z.ZodObject<{
|
|
|
19
19
|
postalCode: z.ZodString;
|
|
20
20
|
country: z.ZodString;
|
|
21
21
|
}, z.core.$strip>;
|
|
22
|
-
export declare const getIsoDatetimeToDate: (dateValidation?: ZodDate) =>
|
|
23
|
-
export declare const dateValidation:
|
|
22
|
+
export declare const getIsoDatetimeToDate: (dateValidation?: ZodDate) => ZodCodec<z.ZodISODateTime, ZodDate>;
|
|
23
|
+
export declare const dateValidation: ZodCodec<z.ZodISODateTime, ZodDate>;
|
|
24
24
|
export declare const enhancedImageValidation: z.ZodObject<{
|
|
25
25
|
default: z.ZodString;
|
|
26
26
|
blurBase64: z.ZodOptional<z.ZodString>;
|
|
@@ -30,7 +30,7 @@ export declare const enhancedImageValidation: z.ZodObject<{
|
|
|
30
30
|
large: z.ZodOptional<z.ZodString>;
|
|
31
31
|
description: z.ZodOptional<z.ZodString>;
|
|
32
32
|
}, z.core.$strip>;
|
|
33
|
-
export declare const getObjectValidation: <T extends string>(o: T) => z.ZodOptional<
|
|
33
|
+
export declare const getObjectValidation: <T extends string>(o: T) => z.ZodOptional<ZodEnum<{ [k_1 in T]: k_1; } extends infer T_1 ? { [k in keyof T_1]: T_1[k]; } : never>>;
|
|
34
34
|
export declare const contactValidation: z.ZodObject<{
|
|
35
35
|
id: z.ZodString;
|
|
36
36
|
firstName: z.ZodString;
|
|
@@ -45,7 +45,7 @@ export declare const documentFileValidation: z.ZodObject<{
|
|
|
45
45
|
name: z.ZodString;
|
|
46
46
|
description: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
47
47
|
url: z.ZodString;
|
|
48
|
-
fileType: z.ZodPipe<z.ZodTransform<unknown, unknown>, z.ZodOptional<
|
|
48
|
+
fileType: z.ZodPipe<z.ZodTransform<unknown, unknown>, z.ZodOptional<ZodEnum<{
|
|
49
49
|
image: "image";
|
|
50
50
|
jpg: "jpg";
|
|
51
51
|
jpeg: "jpeg";
|
|
@@ -54,10 +54,16 @@ export declare const documentFileValidation: z.ZodObject<{
|
|
|
54
54
|
}>>>;
|
|
55
55
|
mimeType: z.ZodOptional<z.ZodString>;
|
|
56
56
|
uploaded: z.ZodDefault<z.ZodBoolean>;
|
|
57
|
-
createdAt: z.ZodOptional<z.ZodNullable<
|
|
58
|
-
updatedAt: z.ZodOptional<z.ZodNullable<
|
|
59
|
-
metadata: z.ZodOptional<z.ZodNullable<z.ZodObject<{}, z.core.$catchall<
|
|
57
|
+
createdAt: z.ZodOptional<z.ZodNullable<ZodCodec<z.ZodISODateTime, ZodDate>>>;
|
|
58
|
+
updatedAt: z.ZodOptional<z.ZodNullable<ZodCodec<z.ZodISODateTime, ZodDate>>>;
|
|
59
|
+
metadata: z.ZodOptional<z.ZodNullable<z.ZodObject<{}, z.core.$catchall<ZodUnion<readonly [z.ZodString, ZodNumber, z.ZodBoolean, ZodArray<z.ZodString>, ZodArray<ZodNumber>, ZodArray<z.ZodBoolean>, z.ZodNull, z.ZodUndefined]>>>>>;
|
|
60
60
|
}, z.core.$strip>;
|
|
61
|
-
export declare const queryBooleanValidator:
|
|
62
|
-
export declare const queryNumberValidator:
|
|
61
|
+
export declare const queryBooleanValidator: ZodCodec<z.ZodString, z.ZodBoolean>;
|
|
62
|
+
export declare const queryNumberValidator: ZodCodec<z.ZodString, ZodNumber>;
|
|
63
|
+
export declare function queryEnumArrayValidator<const T extends readonly string[]>(enumValue: T): ZodUnion<[
|
|
64
|
+
ZodCodec<z.ZodString, ZodArray<ZodEnum<z.util.ToEnum<T[number]>>>>,
|
|
65
|
+
ZodArray<ZodEnum<z.util.ToEnum<T[number]>>>
|
|
66
|
+
]>;
|
|
67
|
+
export declare function queryEnumArrayValidator<const T extends z.util.EnumLike>(entries: T): ZodUnion<[ZodCodec<z.ZodString, ZodArray<ZodEnum<T>>>, ZodArray<ZodEnum<T>>]>;
|
|
68
|
+
export declare function queryEnumArrayValidator<const T extends z.util.EnumLike>(validation: ZodEnum<T>): ZodUnion<[ZodCodec<z.ZodString, ZodArray<ZodEnum<T>>>, ZodArray<ZodEnum<T>>]>;
|
|
63
69
|
//# sourceMappingURL=validation.d.ts.map
|
package/dist/validation.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"validation.d.ts","sourceRoot":"","sources":["../src/validation.ts"],"names":[],"mappings":"AACA,OAAO,EAAO,KAAK,cAAc,EAAE,MAAM,mBAAmB,CAAA;AAC5D,OAAO,EACN,KAAK,OAAO,EACZ,KAAK,QAAQ,EAEb,KAAK,SAAS,EACd,CAAC,EACD,MAAM,KAAK,CAAA;AAEZ,eAAO,MAAM,yBAAyB,GACrC,UAAU,QAAQ,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