@embedreach/components 0.3.42 → 0.3.43

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.
@@ -1,6 +1,6 @@
1
1
  import { jsx, jsxs } from "react/jsx-runtime";
2
2
  import { useState, useEffect } from "react";
3
- import { C as ChannelAccountTypeEnum, R as ReachClientEnum, H as H3 } from "./index.js";
3
+ import { C as ChannelAccountTypeEnum, z as z$2, R as ReachClientEnum, H as H3 } from "./index.js";
4
4
  var POSITIONALS_EXP$1 = /(%?)(%([sdijo]))/g;
5
5
  function serializePositional$1(positional, flag) {
6
6
  switch (flag) {
@@ -24495,6 +24495,27 @@ const reputationHandlers = [
24495
24495
  }
24496
24496
  )
24497
24497
  ];
24498
+ var VoiceForwardingTestStatusEnum;
24499
+ (function(VoiceForwardingTestStatusEnum2) {
24500
+ VoiceForwardingTestStatusEnum2["PENDING"] = "pending";
24501
+ VoiceForwardingTestStatusEnum2["PASSED"] = "passed";
24502
+ VoiceForwardingTestStatusEnum2["ERROR"] = "error";
24503
+ VoiceForwardingTestStatusEnum2["CANCELLED"] = "cancelled";
24504
+ })(VoiceForwardingTestStatusEnum || (VoiceForwardingTestStatusEnum = {}));
24505
+ const voiceForwardingTestStatusSchema = z$2.enum([
24506
+ "pending",
24507
+ "passed",
24508
+ "error",
24509
+ "cancelled"
24510
+ ]);
24511
+ z$2.object({
24512
+ id: z$2.string().uuid(),
24513
+ phoneNumberId: z$2.string().uuid(),
24514
+ status: voiceForwardingTestStatusSchema,
24515
+ message: z$2.string().optional(),
24516
+ createdAt: z$2.string(),
24517
+ completedAt: z$2.string().optional()
24518
+ });
24498
24519
  const generatePlainPhoneNumber = () => {
24499
24520
  const areaCode = f.number.int({ min: 200, max: 999 });
24500
24521
  const centralOffice = f.number.int({ min: 200, max: 999 });
@@ -25183,12 +25204,12 @@ const voiceHandlers = [
25183
25204
  ),
25184
25205
  // Update phone number
25185
25206
  http.put(
25186
- `${HOSTNAME}/api/voice/agents/:agentId/phone-numbers/:phoneNumberId`,
25207
+ `${HOSTNAME}/api/voice/phone-numbers/:phoneNumberId`,
25187
25208
  async ({ params, request }) => {
25188
- const { agentId, phoneNumberId } = params;
25209
+ const { phoneNumberId } = params;
25189
25210
  const body = await request.json();
25190
25211
  const phoneNumberIndex = mockStore.phoneNumbers.findIndex(
25191
- (pn) => pn.id === phoneNumberId && pn.agentId === agentId
25212
+ (pn) => pn.id === phoneNumberId
25192
25213
  );
25193
25214
  if (phoneNumberIndex === -1) {
25194
25215
  return HttpResponse.json(
@@ -25210,64 +25231,57 @@ const voiceHandlers = [
25210
25231
  }
25211
25232
  ),
25212
25233
  // Start forwarding test
25213
- http.post(
25214
- `${HOSTNAME}/api/voice/agents/:agentId/phone-numbers/:phoneNumberId/forwarding-tests`,
25215
- async ({ params }) => {
25216
- const agentId = params.agentId;
25217
- const phoneNumberId = params.phoneNumberId;
25218
- const test = {
25219
- id: `forwarding-test-${Date.now()}`,
25220
- agentId,
25221
- phoneNumberId,
25222
- status: "in-progress",
25223
- createdAt: (/* @__PURE__ */ new Date()).toISOString()
25224
- };
25225
- mockStore.forwardingTests.push(test);
25226
- setTimeout(() => {
25227
- const testIndex = mockStore.forwardingTests.findIndex(
25228
- (t2) => t2.id === test.id
25229
- );
25230
- if (testIndex !== -1 && mockStore.forwardingTests[testIndex].status === "in-progress") {
25231
- mockStore.forwardingTests[testIndex] = {
25232
- ...mockStore.forwardingTests[testIndex],
25233
- status: "success",
25234
- message: "Call was successfully forwarded to your number",
25235
- completedAt: (/* @__PURE__ */ new Date()).toISOString()
25236
- };
25237
- }
25238
- }, 15e3);
25239
- return HttpResponse.json({
25240
- success: true,
25241
- message: "Forwarding test started (Sandbox)",
25242
- data: test
25243
- });
25244
- }
25245
- ),
25246
- // Get forwarding test status
25247
- http.get(
25248
- `${HOSTNAME}/api/voice/agents/:agentId/phone-numbers/:phoneNumberId/forwarding-tests/:testId`,
25249
- ({ params }) => {
25250
- const { testId } = params;
25251
- const test = mockStore.forwardingTests.find((t2) => t2.id === testId);
25252
- if (!test) {
25253
- return HttpResponse.json(
25254
- {
25255
- success: false,
25256
- message: `Forwarding test with ID ${testId} not found (Sandbox)`
25257
- },
25258
- { status: 404 }
25259
- );
25234
+ http.post(`${HOSTNAME}/api/voice/forwarding-tests`, async ({ request }) => {
25235
+ const body = await request.json();
25236
+ const phoneNumberId = body.phoneNumberId;
25237
+ const test = {
25238
+ id: `forwarding-test-${Date.now()}`,
25239
+ phoneNumberId,
25240
+ status: VoiceForwardingTestStatusEnum.PENDING,
25241
+ createdAt: (/* @__PURE__ */ new Date()).toISOString()
25242
+ };
25243
+ mockStore.forwardingTests.push(test);
25244
+ setTimeout(() => {
25245
+ const testIndex = mockStore.forwardingTests.findIndex(
25246
+ (t2) => t2.id === test.id
25247
+ );
25248
+ if (testIndex !== -1 && mockStore.forwardingTests[testIndex].status === VoiceForwardingTestStatusEnum.PENDING) {
25249
+ mockStore.forwardingTests[testIndex] = {
25250
+ ...mockStore.forwardingTests[testIndex],
25251
+ status: VoiceForwardingTestStatusEnum.PASSED,
25252
+ message: "Call was successfully forwarded to your number",
25253
+ completedAt: (/* @__PURE__ */ new Date()).toISOString()
25254
+ };
25260
25255
  }
25261
- return HttpResponse.json({
25262
- success: true,
25263
- message: "Success (Sandbox)",
25264
- data: test
25265
- });
25256
+ }, 15e3);
25257
+ return HttpResponse.json({
25258
+ success: true,
25259
+ message: "Forwarding test started (Sandbox)",
25260
+ data: test
25261
+ });
25262
+ }),
25263
+ // Get forwarding test status
25264
+ http.get(`${HOSTNAME}/api/voice/forwarding-tests/:testId`, ({ params }) => {
25265
+ const { testId } = params;
25266
+ const test = mockStore.forwardingTests.find((t2) => t2.id === testId);
25267
+ if (!test) {
25268
+ return HttpResponse.json(
25269
+ {
25270
+ success: false,
25271
+ message: `Forwarding test with ID ${testId} not found (Sandbox)`
25272
+ },
25273
+ { status: 404 }
25274
+ );
25266
25275
  }
25267
- ),
25276
+ return HttpResponse.json({
25277
+ success: true,
25278
+ message: "Success (Sandbox)",
25279
+ data: test
25280
+ });
25281
+ }),
25268
25282
  // Cancel forwarding test
25269
25283
  http.post(
25270
- `${HOSTNAME}/api/voice/agents/:agentId/phone-numbers/:phoneNumberId/forwarding-tests/:testId/cancel`,
25284
+ `${HOSTNAME}/api/voice/forwarding-tests/:testId/cancel`,
25271
25285
  ({ params }) => {
25272
25286
  const { testId } = params;
25273
25287
  const testIndex = mockStore.forwardingTests.findIndex(
package/dist/index.d.ts CHANGED
@@ -294,7 +294,7 @@ declare interface SMSSetupBusinessFormRef {
294
294
  declare const SMSSetupBusinessFormSchema: z.ZodDiscriminatedUnion<"type", [z.ZodObject<{
295
295
  type: z.ZodLiteral<SmsRegistrationApplicationType>;
296
296
  tollFreeNumber: z.ZodString;
297
- company: z.ZodObject<{
297
+ company: z.ZodEffects<z.ZodObject<{
298
298
  name: z.ZodString;
299
299
  address1: z.ZodString;
300
300
  address2: z.ZodOptional<z.ZodString>;
@@ -302,6 +302,8 @@ declare const SMSSetupBusinessFormSchema: z.ZodDiscriminatedUnion<"type", [z.Zod
302
302
  stateProvince: z.ZodString;
303
303
  zipCode: z.ZodString;
304
304
  country: z.ZodString;
305
+ businessRegistrationNumber: z.ZodOptional<z.ZodString>;
306
+ businessType: z.ZodOptional<z.ZodEnum<["SOLE_PROPRIETOR"]>>;
305
307
  }, "strip", z.ZodTypeAny, {
306
308
  name: string;
307
309
  country: string;
@@ -310,6 +312,8 @@ declare const SMSSetupBusinessFormSchema: z.ZodDiscriminatedUnion<"type", [z.Zod
310
312
  stateProvince: string;
311
313
  zipCode: string;
312
314
  address2?: string | undefined;
315
+ businessRegistrationNumber?: string | undefined;
316
+ businessType?: "SOLE_PROPRIETOR" | undefined;
313
317
  }, {
314
318
  name: string;
315
319
  country: string;
@@ -318,6 +322,28 @@ declare const SMSSetupBusinessFormSchema: z.ZodDiscriminatedUnion<"type", [z.Zod
318
322
  stateProvince: string;
319
323
  zipCode: string;
320
324
  address2?: string | undefined;
325
+ businessRegistrationNumber?: string | undefined;
326
+ businessType?: "SOLE_PROPRIETOR" | undefined;
327
+ }>, {
328
+ name: string;
329
+ country: string;
330
+ address1: string;
331
+ city: string;
332
+ stateProvince: string;
333
+ zipCode: string;
334
+ address2?: string | undefined;
335
+ businessRegistrationNumber?: string | undefined;
336
+ businessType?: "SOLE_PROPRIETOR" | undefined;
337
+ }, {
338
+ name: string;
339
+ country: string;
340
+ address1: string;
341
+ city: string;
342
+ stateProvince: string;
343
+ zipCode: string;
344
+ address2?: string | undefined;
345
+ businessRegistrationNumber?: string | undefined;
346
+ businessType?: "SOLE_PROPRIETOR" | undefined;
321
347
  }>;
322
348
  contact: z.ZodObject<{
323
349
  firstName: z.ZodString;
@@ -359,6 +385,8 @@ declare const SMSSetupBusinessFormSchema: z.ZodDiscriminatedUnion<"type", [z.Zod
359
385
  stateProvince: string;
360
386
  zipCode: string;
361
387
  address2?: string | undefined;
388
+ businessRegistrationNumber?: string | undefined;
389
+ businessType?: "SOLE_PROPRIETOR" | undefined;
362
390
  };
363
391
  contact: {
364
392
  email: string;
@@ -383,6 +411,8 @@ declare const SMSSetupBusinessFormSchema: z.ZodDiscriminatedUnion<"type", [z.Zod
383
411
  stateProvince: string;
384
412
  zipCode: string;
385
413
  address2?: string | undefined;
414
+ businessRegistrationNumber?: string | undefined;
415
+ businessType?: "SOLE_PROPRIETOR" | undefined;
386
416
  };
387
417
  contact: {
388
418
  email: string;