@driveflux/api-functions 0.0.7-next.27 → 0.0.7-next.28

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (44) hide show
  1. package/dist/auth/confirm.js +24 -29
  2. package/dist/auth/emails.js +12 -13
  3. package/dist/auth/formatter.js +5 -5
  4. package/dist/auth/otp.js +66 -50
  5. package/dist/auth/register.js +42 -34
  6. package/dist/auth/tokens.js +58 -55
  7. package/dist/auth/verifications.js +53 -52
  8. package/dist/constants.js +0 -1
  9. package/dist/mailjet/calls/manage-contacts-in-list.js +5 -6
  10. package/dist/mailjet/calls/manage-subscription-status.js +4 -5
  11. package/dist/mailjet/calls/request-service.js +7 -6
  12. package/dist/mailjet/refresh-email-preferences.js +11 -12
  13. package/dist/mailjet/set-contact.js +11 -12
  14. package/dist/mailjet/types.js +1 -2
  15. package/dist/mailjet/utils/convert-to-array.js +8 -6
  16. package/dist/mailjet/utils/extract-email-preferences.js +14 -15
  17. package/dist/mailjet/utils/lists.js +7 -8
  18. package/dist/mailjet/utils/update-email-references.js +16 -15
  19. package/dist/notion/client.js +22 -19
  20. package/dist/notion/helpful.js +6 -9
  21. package/dist/notion/schemas/block.js +42 -48
  22. package/dist/notion/schemas/common.js +9 -14
  23. package/dist/notion/schemas/database.js +62 -60
  24. package/dist/notion/schemas/emoji.js +1 -2
  25. package/dist/notion/schemas/file.js +9 -9
  26. package/dist/notion/schemas/kb.js +5 -6
  27. package/dist/notion/schemas/page.js +72 -61
  28. package/dist/notion/schemas/parent.js +4 -5
  29. package/dist/notion/schemas/user.js +18 -19
  30. package/dist/reservation/agree.js +6 -7
  31. package/dist/reservation/checks.js +3 -4
  32. package/dist/reservation/display-vehicle.js +65 -71
  33. package/dist/reservation/fetch-or-create.js +48 -54
  34. package/dist/reservation/invoice.js +62 -74
  35. package/dist/reservation/payer.js +5 -6
  36. package/dist/reservation/reserve.js +3 -4
  37. package/dist/reservation/types.js +1 -2
  38. package/dist/reservation/vehicle.js +13 -16
  39. package/dist/slack.js +24 -29
  40. package/dist/validation.js +77 -79
  41. package/dist/vehicle/vehicle-pricing/constants.js +22 -19
  42. package/dist/vehicle/vehicle-pricing/index.js +28 -42
  43. package/dist/vehicle/vehicle-pricing/types.js +1 -2
  44. package/package.json +8 -8
@@ -1,6 +1,6 @@
1
1
  import { config } from '@driveflux/config/backend';
2
2
  import { loadCoupon, PROBLEM_APPLICABLE_NOT_FOUND } from '@driveflux/coupon';
3
- import { prisma, } from '@driveflux/db';
3
+ import { prisma } from '@driveflux/db';
4
4
  import { generateId } from '@driveflux/db/id';
5
5
  import { EMPTY_BILLING_ADDRESS } from '@driveflux/db/models/other';
6
6
  import { PURPOSE_RESERVATION } from '@driveflux/db/models/subscription';
@@ -12,16 +12,15 @@ import { Ok } from '@driveflux/result';
12
12
  import { format } from '@driveflux/time';
13
13
  import { isAfter } from 'date-fns/isAfter';
14
14
  import { subMinutes } from 'date-fns/subMinutes';
15
- export const updateReservationInvoiceIfNeeded = async (oldReservationInvoice, newParams) => {
15
+ export const updateReservationInvoiceIfNeeded = async (oldReservationInvoice, newParams)=>{
16
16
  const couponIsDifferent = oldReservationInvoice.couponCode !== newParams.couponCode;
17
- if (!couponIsDifferent &&
18
- oldReservationInvoice.stripePaymentIntentId === newParams.paymentIntentId) {
17
+ if (!couponIsDifferent && oldReservationInvoice.stripePaymentIntentId === newParams.paymentIntentId) {
19
18
  return new Ok(oldReservationInvoice);
20
19
  }
21
20
  // If the coupon or payment intent are differnt we should update the invoice
22
21
  let update = {
23
22
  stripePaymentIntentId: newParams.paymentIntentId,
24
- couponCode: newParams.couponCode,
23
+ couponCode: newParams.couponCode
25
24
  };
26
25
  // If the coupon is different, we need to apply the coupon to the invoice
27
26
  if (couponIsDifferent) {
@@ -29,63 +28,56 @@ export const updateReservationInvoiceIfNeeded = async (oldReservationInvoice, ne
29
28
  const result = await coupons.applyCouponToUnsavedInvoice(newParams.couponCode, oldReservationInvoice);
30
29
  if (result.ok) {
31
30
  const { discounts, ...rest } = result.val;
32
- const toDisconnect = discounts
33
- ? oldReservationInvoice.discountIds?.filter((id) => !discounts.connect?.some((d) => d.id === id))
34
- : undefined;
35
- const disconnectClauses = toDisconnect?.length
36
- ? {
37
- disconnect: toDisconnect.map((id) => ({ id })),
38
- }
39
- : undefined;
31
+ const toDisconnect = discounts ? oldReservationInvoice.discountIds?.filter((id)=>!discounts.connect?.some((d)=>d.id === id)) : undefined;
32
+ const disconnectClauses = toDisconnect?.length ? {
33
+ disconnect: toDisconnect.map((id)=>({
34
+ id
35
+ }))
36
+ } : undefined;
40
37
  update = {
41
38
  ...update,
42
39
  ...rest,
43
- ...(discounts || disconnectClauses
44
- ? {
45
- discounts: {
46
- ...(discounts || {}),
47
- ...(disconnectClauses || {}),
48
- },
40
+ ...discounts || disconnectClauses ? {
41
+ discounts: {
42
+ ...discounts || {},
43
+ ...disconnectClauses || {}
49
44
  }
50
- : {}),
45
+ } : {},
51
46
  metadata: {
52
47
  ...update.metadata,
53
- couponCode: newParams.couponCode,
48
+ couponCode: newParams.couponCode
54
49
  },
55
50
  providerMetadata: {
56
51
  ...update.providerMetadata,
57
- couponCode: newParams.couponCode,
58
- },
52
+ couponCode: newParams.couponCode
53
+ }
59
54
  };
60
55
  }
61
56
  if (result.err && result.val.code !== PROBLEM_APPLICABLE_NOT_FOUND) {
62
57
  return result;
63
58
  }
64
- }
65
- else if (oldReservationInvoice.discountIds.length) {
59
+ } else if (oldReservationInvoice.discountIds.length) {
66
60
  // No discounts, so we disconnect all of them
67
61
  update = {
68
62
  discounts: {
69
- disconnect: oldReservationInvoice.discountIds.map((id) => ({
70
- id,
71
- })),
72
- },
63
+ disconnect: oldReservationInvoice.discountIds.map((id)=>({
64
+ id
65
+ }))
66
+ }
73
67
  };
74
68
  }
75
69
  }
76
70
  let updated = await wrapInResult(biller.updateInvoice(oldReservationInvoice.id, update));
77
71
  // If the invoice was locked due to pending status and we're more than 1 minute old, we unlock it
78
72
  if (updated.err && updated.val.code === 'invoice_pending') {
79
- if ((oldReservationInvoice.lockedAt &&
80
- isAfter(oldReservationInvoice.lockedAt, subMinutes(new Date(), 1))) ||
81
- !oldReservationInvoice.lockedAt) {
73
+ if (oldReservationInvoice.lockedAt && isAfter(oldReservationInvoice.lockedAt, subMinutes(new Date(), 1)) || !oldReservationInvoice.lockedAt) {
82
74
  updated = await wrapInResult(biller.updateInvoice(oldReservationInvoice.id, {
83
75
  ...update,
84
76
  locked: false,
85
77
  lockedAt: null,
86
78
  lockReason: null,
87
79
  unlockAt: null,
88
- status: 'draft',
80
+ status: 'draft'
89
81
  }));
90
82
  }
91
83
  }
@@ -94,7 +86,7 @@ export const updateReservationInvoiceIfNeeded = async (oldReservationInvoice, ne
94
86
  }
95
87
  return new Ok(updated.val);
96
88
  };
97
- export const createReservationInvoice = async ({ invoiceId, couponCode, plan, mileagePackage, referralCode, reservationId, paymentIntentId, freeReservation, freeReservationReason, analytics, vehicle, payer, subscribingUser, }) => {
89
+ export const createReservationInvoice = async ({ invoiceId, couponCode, plan, mileagePackage, referralCode, reservationId, paymentIntentId, freeReservation, freeReservationReason, analytics, vehicle, payer, subscribingUser })=>{
98
90
  if (freeReservation) {
99
91
  // It's a free reservation, so we don't need to add a coupon code
100
92
  return await wrapInResult(biller.createInvoice(getInvoiceCreateDetails({
@@ -107,21 +99,17 @@ export const createReservationInvoice = async ({ invoiceId, couponCode, plan, mi
107
99
  freeReservation,
108
100
  freeReservationReason,
109
101
  analytics,
110
- reservationId,
102
+ reservationId
111
103
  })));
112
104
  }
113
105
  let finalCouponCode = couponCode;
114
106
  // If we don't have a reservation coupon ID, we apply the referral discount if any
115
- const referral = referralCode &&
116
- (await prisma.referral.findUnique({
117
- where: {
118
- id: referralCode,
119
- },
120
- }));
121
- if (!finalCouponCode &&
122
- referral &&
123
- referral.discountToReceiverCouponId &&
124
- referral.discountToReceiverCouponApplicationName === 'reservationFee') {
107
+ const referral = referralCode && await prisma.referral.findUnique({
108
+ where: {
109
+ id: referralCode
110
+ }
111
+ });
112
+ if (!finalCouponCode && referral && referral.discountToReceiverCouponId && referral.discountToReceiverCouponApplicationName === 'reservationFee') {
125
113
  const referralCoupon = await loadCoupon(referral.discountToReceiverCouponId);
126
114
  if (referralCoupon) {
127
115
  finalCouponCode = referralCoupon.code;
@@ -140,15 +128,15 @@ export const createReservationInvoice = async ({ invoiceId, couponCode, plan, mi
140
128
  freeReservation,
141
129
  freeReservationReason,
142
130
  analytics,
143
- reservationId,
131
+ reservationId
144
132
  }),
145
133
  lines: [
146
134
  {
147
135
  amount: reservationAmount,
148
136
  description: `Reservation fee for ${vehicleName(vehicle)}`,
149
- chargingFor: 'reservationFee',
150
- },
151
- ],
137
+ chargingFor: 'reservationFee'
138
+ }
139
+ ]
152
140
  };
153
141
  if (finalCouponCode) {
154
142
  const withCoupon = await coupons.applyCouponToUnsavedInvoice(finalCouponCode, invoiceCreateDetails, 'reservationFee', {
@@ -158,10 +146,9 @@ export const createReservationInvoice = async ({ invoiceId, couponCode, plan, mi
158
146
  vehicleMake: vehicle.make,
159
147
  userId: subscribingUser.id,
160
148
  businessId: payer.object === 'business' ? payer.id : undefined,
161
- vehicleType: vehicle.type,
149
+ vehicleType: vehicle.type
162
150
  });
163
- if (withCoupon.err &&
164
- withCoupon.val.code !== PROBLEM_APPLICABLE_NOT_FOUND) {
151
+ if (withCoupon.err && withCoupon.val.code !== PROBLEM_APPLICABLE_NOT_FOUND) {
165
152
  return withCoupon;
166
153
  }
167
154
  if (withCoupon.ok) {
@@ -169,18 +156,18 @@ export const createReservationInvoice = async ({ invoiceId, couponCode, plan, mi
169
156
  ...withCoupon.val,
170
157
  metadata: {
171
158
  ...withCoupon.val.metadata,
172
- couponCode: finalCouponCode,
159
+ couponCode: finalCouponCode
173
160
  },
174
161
  providerMetadata: {
175
162
  ...withCoupon.val.providerMetadata,
176
- couponCode: finalCouponCode,
177
- },
163
+ couponCode: finalCouponCode
164
+ }
178
165
  };
179
166
  }
180
167
  }
181
168
  return await wrapInResult(biller.createInvoice(invoiceCreateDetails));
182
169
  };
183
- const getInvoiceCreateDetails = ({ invoiceId, payer, date, reservationDiscountId, vehicle, plan, mileagePackage, couponCode, paymentIntentId, freeReservation, freeReservationReason, analytics, reservationId, }) => {
170
+ const getInvoiceCreateDetails = ({ invoiceId, payer, date, reservationDiscountId, vehicle, plan, mileagePackage, couponCode, paymentIntentId, freeReservation, freeReservationReason, analytics, reservationId })=>{
184
171
  return {
185
172
  id: invoiceId || generateId('Invoice'),
186
173
  taxPercentage: 0,
@@ -196,15 +183,13 @@ const getInvoiceCreateDetails = ({ invoiceId, payer, date, reservationDiscountId
196
183
  description: 'Reservation fee for a FLUX subscription',
197
184
  footer: `Invoice for a FLUX subscription reservation. Due by ${format(date ?? new Date())}`,
198
185
  invoiceUrl: `${config.appUrl}/invoice-preview/${invoiceId}`,
199
- ...(reservationDiscountId
200
- ? {
201
- discounts: {
202
- connect: {
203
- id: reservationDiscountId,
204
- },
205
- },
186
+ ...reservationDiscountId ? {
187
+ discounts: {
188
+ connect: {
189
+ id: reservationDiscountId
190
+ }
206
191
  }
207
- : {}),
192
+ } : {},
208
193
  lines: [],
209
194
  subscriptionDetails: {
210
195
  vehicleId: vehicle.id,
@@ -213,7 +198,7 @@ const getInvoiceCreateDetails = ({ invoiceId, payer, date, reservationDiscountId
213
198
  variant: vehicle.variant,
214
199
  year: vehicle.year,
215
200
  plan: plan,
216
- mileagePackage: mileagePackage,
201
+ mileagePackage: mileagePackage
217
202
  },
218
203
  stripePaymentIntentId: paymentIntentId,
219
204
  providerMetadata: {
@@ -221,14 +206,18 @@ const getInvoiceCreateDetails = ({ invoiceId, payer, date, reservationDiscountId
221
206
  mileagePackage,
222
207
  vehicleId: vehicle.id,
223
208
  vehicleName: vehicleName(vehicle),
224
- ...(reservationId ? { reservationId } : {}),
225
- ...(couponCode ? { couponCode } : {}),
209
+ ...reservationId ? {
210
+ reservationId
211
+ } : {},
212
+ ...couponCode ? {
213
+ couponCode
214
+ } : {}
226
215
  },
227
216
  autoRetry: {
228
217
  enabled: false,
229
218
  interval: 0,
230
219
  maxAttempts: 0,
231
- attempts: 0,
220
+ attempts: 0
232
221
  },
233
222
  metadata: {
234
223
  purpose: PURPOSE_RESERVATION,
@@ -237,11 +226,10 @@ const getInvoiceCreateDetails = ({ invoiceId, payer, date, reservationDiscountId
237
226
  plan,
238
227
  mileagePackage,
239
228
  couponCode,
240
- ...(freeReservation && freeReservationReason
241
- ? { freeReservationReason }
242
- : {}),
243
- analytics,
244
- },
229
+ ...freeReservation && freeReservationReason ? {
230
+ freeReservationReason
231
+ } : {},
232
+ analytics
233
+ }
245
234
  };
246
235
  };
247
- //# sourceMappingURL=invoice.js.map
@@ -1,7 +1,7 @@
1
1
  import { prisma } from '@driveflux/db';
2
- import { makeProblem, PROBLEM_CONDITION_FAILED, PROBLEM_NOT_FOUND, } from '@driveflux/problem';
2
+ import { makeProblem, PROBLEM_CONDITION_FAILED, PROBLEM_NOT_FOUND } from '@driveflux/problem';
3
3
  import { Err, Ok } from '@driveflux/result';
4
- export const getPayer = async ({ subscribingUser, asBusiness, }) => {
4
+ export const getPayer = async ({ subscribingUser, asBusiness })=>{
5
5
  let business = null;
6
6
  let payer = subscribingUser;
7
7
  if (asBusiness) {
@@ -11,8 +11,8 @@ export const getPayer = async ({ subscribingUser, asBusiness, }) => {
11
11
  // load business
12
12
  business = await prisma.business.findUnique({
13
13
  where: {
14
- id: subscribingUser.businessId,
15
- },
14
+ id: subscribingUser.businessId
15
+ }
16
16
  });
17
17
  if (!business) {
18
18
  return new Err(makeProblem(PROBLEM_NOT_FOUND, `The business ${subscribingUser.businessId} was not found.`));
@@ -26,7 +26,7 @@ export const getPayer = async ({ subscribingUser, asBusiness, }) => {
26
26
  }
27
27
  return new Ok(payer);
28
28
  };
29
- const checkPayerObjectSanity = (subscriber) => {
29
+ const checkPayerObjectSanity = (subscriber)=>{
30
30
  if (!subscriber.email) {
31
31
  return new Err(makeProblem(PROBLEM_CONDITION_FAILED, `Subscriber ${subscriber.id} has no email. Please add a verified email first.`));
32
32
  }
@@ -35,4 +35,3 @@ const checkPayerObjectSanity = (subscriber) => {
35
35
  }
36
36
  return new Ok(true);
37
37
  };
38
- //# sourceMappingURL=payer.js.map
@@ -4,14 +4,14 @@ import { checkIfUserCanReserve } from './checks.js';
4
4
  import { fetchOrCreateReservation } from './fetch-or-create.js';
5
5
  import { getPayer } from './payer.js';
6
6
  import { getVehicle } from './vehicle.js';
7
- const processBody = (body) => {
7
+ const processBody = (body)=>{
8
8
  // Switch mileage package
9
9
  if (body.plan === 'plan1' || body.plan === 'planWeekly') {
10
10
  body.mileagePackage = 'unlimited';
11
11
  }
12
12
  return body;
13
13
  };
14
- export const reserveVehicle = async (vehicleId, unprocessed) => {
14
+ export const reserveVehicle = async (vehicleId, unprocessed)=>{
15
15
  const body = processBody(unprocessed);
16
16
  // Agree to terms if not done yet
17
17
  await handleAgreeToTerms(body);
@@ -33,7 +33,7 @@ export const reserveVehicle = async (vehicleId, unprocessed) => {
33
33
  const reservationResult = await fetchOrCreateReservation({
34
34
  vehicle,
35
35
  payer,
36
- body,
36
+ body
37
37
  });
38
38
  if (reservationResult.err) {
39
39
  return reservationResult;
@@ -41,4 +41,3 @@ export const reserveVehicle = async (vehicleId, unprocessed) => {
41
41
  const reservation = reservationResult.val;
42
42
  return new Ok(reservation);
43
43
  };
44
- //# sourceMappingURL=reserve.js.map
@@ -1,2 +1 @@
1
- export {};
2
- //# sourceMappingURL=types.js.map
1
+ export { };
@@ -4,21 +4,19 @@ import { makeProblem, PROBLEM_NOT_FOUND } from '@driveflux/problem';
4
4
  import { Err, Ok } from '@driveflux/result';
5
5
  import { checkIfVehicleIsAvailableForReservation } from './checks.js';
6
6
  import { createVehicleFromDisplayVehicle } from './display-vehicle.js';
7
- export const getVehicle = async (id, { selectedColor, plan, requestUser, }, requesterAbility) => {
8
- const vehicle = id.startsWith('DV_')
9
- ? await createVehicleFromDisplayVehicle(id, selectedColor || undefined)
10
- : await prisma.vehicle.findUnique({
11
- where: {
12
- id,
13
- },
14
- include: {
15
- host: {
16
- select: {
17
- id: true,
18
- },
19
- },
20
- },
21
- });
7
+ export const getVehicle = async (id, { selectedColor, plan, requestUser }, requesterAbility)=>{
8
+ const vehicle = id.startsWith('DV_') ? await createVehicleFromDisplayVehicle(id, selectedColor || undefined) : await prisma.vehicle.findUnique({
9
+ where: {
10
+ id
11
+ },
12
+ include: {
13
+ host: {
14
+ select: {
15
+ id: true
16
+ }
17
+ }
18
+ }
19
+ });
22
20
  if (!vehicle) {
23
21
  return new Err(makeProblem(PROBLEM_NOT_FOUND, 'Vehicle not found'));
24
22
  }
@@ -29,4 +27,3 @@ export const getVehicle = async (id, { selectedColor, plan, requestUser, }, requ
29
27
  }
30
28
  return new Ok(vehicle);
31
29
  };
32
- //# sourceMappingURL=vehicle.js.map
package/dist/slack.js CHANGED
@@ -10,12 +10,11 @@ const slackBlocks = global.__slackBlocks;
10
10
  /**
11
11
  *
12
12
  * @deprecated Use slackLater instead and commitSlack to commit
13
- */
14
- export const slack = async (message, channel = config.slack.defaultChannelId) => {
13
+ */ export const slack = async (message, channel = config.slack.defaultChannelId)=>{
15
14
  return await enhancedFetch('https://slack.com/api/chat.postMessage', {
16
15
  method: 'POST',
17
16
  headers: {
18
- Authorization: `Bearer ${config.slack.token}`,
17
+ Authorization: `Bearer ${config.slack.token}`
19
18
  },
20
19
  body: JSON.stringify({
21
20
  channel,
@@ -24,23 +23,20 @@ export const slack = async (message, channel = config.slack.defaultChannelId) =>
24
23
  type: 'section',
25
24
  text: {
26
25
  type: 'mrkdwn',
27
- text: message,
28
- },
29
- },
30
- ],
31
- }),
26
+ text: message
27
+ }
28
+ }
29
+ ]
30
+ })
32
31
  });
33
32
  };
34
- export const getSlackBlocks = (channel) => channel ? slackBlocks.get(channel) : slackBlocks;
33
+ export const getSlackBlocks = (channel)=>channel ? slackBlocks.get(channel) : slackBlocks;
35
34
  /**
36
35
  * Naive implementation, however, for now (uncrowded serverless env), this works
37
36
  * @param blocks
38
37
  * @param channel
39
- */
40
- export function slackLater(blocks, channel) {
41
- const targetChannel = (config.appEnv === 'production'
42
- ? channel
43
- : config.slack.defaultChannelId) || config.slack.defaultChannelId;
38
+ */ export function slackLater(blocks, channel) {
39
+ const targetChannel = (config.appEnv === 'production' ? channel : config.slack.defaultChannelId) || config.slack.defaultChannelId;
44
40
  if (!targetChannel || !blocks) {
45
41
  return;
46
42
  }
@@ -50,15 +46,13 @@ export function slackLater(blocks, channel) {
50
46
  type: 'section',
51
47
  text: {
52
48
  type: 'mrkdwn',
53
- text: blocks,
54
- },
49
+ text: blocks
50
+ }
55
51
  });
56
- }
57
- else if (!Array.isArray(blocks)) {
52
+ } else if (!Array.isArray(blocks)) {
58
53
  messages.add(blocks);
59
- }
60
- else {
61
- for (const b of blocks) {
54
+ } else {
55
+ for (const b of blocks){
62
56
  messages.add(b);
63
57
  }
64
58
  }
@@ -69,22 +63,22 @@ export async function sendSlackMessages(channel, blocks) {
69
63
  return await enhancedFetch('https://slack.com/api/chat.postMessage', {
70
64
  method: 'POST',
71
65
  headers: {
72
- Authorization: `Bearer ${config.slack.token}`,
66
+ Authorization: `Bearer ${config.slack.token}`
73
67
  },
74
68
  body: JSON.stringify({
75
69
  channel: targetChannel,
76
- blocks: Array.from(blocks),
77
- }),
70
+ blocks: Array.from(blocks)
71
+ })
78
72
  });
79
73
  }
80
- export const commitSlack = () => {
74
+ export const commitSlack = ()=>{
81
75
  if (!slackBlocks.size) {
82
76
  return;
83
77
  }
84
78
  const channels = slackBlocks.keys();
85
79
  let i = 1;
86
80
  const baseUrl = config.appEnv === 'development' ? config.tunnelUrl : config.appUrl;
87
- for (const channel of channels) {
81
+ for (const channel of channels){
88
82
  const blocks = slackBlocks.get(channel);
89
83
  if (!blocks?.size) {
90
84
  continue;
@@ -94,12 +88,13 @@ export const commitSlack = () => {
94
88
  name: TASK_COMMIT_SLACK_CHANNEL,
95
89
  metadata: {
96
90
  channel,
97
- blocks: [...blocks],
91
+ blocks: [
92
+ ...blocks
93
+ ]
98
94
  },
99
95
  taskHandlerUrl: `${baseUrl || config.appUrl}/api/hooks/slack-pipeline`,
100
- scheduledAt: addSeconds(new Date(), i++),
96
+ scheduledAt: addSeconds(new Date(), i++)
101
97
  });
102
98
  }
103
99
  slackBlocks.clear();
104
100
  };
105
- //# sourceMappingURL=slack.js.map