@avallon-labs/sdk 10.0.0 → 11.0.0-staging.281

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/index.d.ts CHANGED
@@ -2100,6 +2100,10 @@ type GetCallAnalyticsParams = {
2100
2100
  from: string;
2101
2101
  to: string;
2102
2102
  timezone?: string;
2103
+ /**
2104
+ * Comma-separated list of agent UUIDs to filter by
2105
+ */
2106
+ agent_ids?: string;
2103
2107
  };
2104
2108
 
2105
2109
  /**
@@ -5465,31 +5469,62 @@ declare const useListAgentWebhooks: <TError = ErrorType<ErrorResponse>>(voiceAge
5465
5469
  swrKey: string | false | readonly [any, ...unknown[]] | Record<any, any> | (() => Arguments);
5466
5470
  };
5467
5471
  /**
5468
- * Create a webhook that fires when events occur for the specified email agent.
5469
- * @summary Create email agent webhook
5472
+ * Create a webhook that fires when events occur for the specified inbox.
5473
+
5474
+ For compatibility this endpoint is also available using the following (deprecated) paths:
5475
+ `POST /v1/email-agents/{id}/webhooks`
5476
+ * @summary Create inbox webhook
5470
5477
  */
5471
- declare const getCreateEmailAgentWebhookUrl: (id: string) => string;
5472
- declare const createEmailAgentWebhook: (id: string, createEmailAgentWebhookBody: CreateEmailAgentWebhookBody, options?: RequestInit) => Promise<Webhook>;
5473
- declare const getCreateEmailAgentWebhookMutationFetcher: (id: string, options?: SecondParameter<typeof customFetch>) => (_: Key, { arg }: {
5478
+ declare const getCreateEmailAgentWebhookUrl: (inboxId: string) => string;
5479
+ declare const createEmailAgentWebhook: (inboxId: string, createEmailAgentWebhookBody: CreateEmailAgentWebhookBody, options?: RequestInit) => Promise<Webhook>;
5480
+ declare const getCreateEmailAgentWebhookMutationFetcher: (inboxId: string, options?: SecondParameter<typeof customFetch>) => (_: Key, { arg }: {
5474
5481
  arg: CreateEmailAgentWebhookBody;
5475
5482
  }) => Promise<Webhook>;
5476
- declare const getCreateEmailAgentWebhookMutationKey: (id: string) => readonly [`/v1/email-agents/${string}/webhooks`];
5483
+ declare const getCreateEmailAgentWebhookMutationKey: (inboxId: string) => readonly [`/v1/inboxes/${string}/webhooks`];
5477
5484
  type CreateEmailAgentWebhookMutationResult = NonNullable<Awaited<ReturnType<typeof createEmailAgentWebhook>>>;
5478
5485
  /**
5479
- * @summary Create email agent webhook
5486
+ * @summary Create inbox webhook
5480
5487
  */
5481
- declare const useCreateEmailAgentWebhook: <TError = ErrorType<ErrorResponse>>(id: string, options?: {
5488
+ declare const useCreateEmailAgentWebhook: <TError = ErrorType<ErrorResponse>>(inboxId: string, options?: {
5482
5489
  swr?: SWRMutationConfiguration<Awaited<ReturnType<typeof createEmailAgentWebhook>>, TError, Key, CreateEmailAgentWebhookBody, Awaited<ReturnType<typeof createEmailAgentWebhook>>> & {
5483
5490
  swrKey?: string;
5484
5491
  };
5485
5492
  request?: SecondParameter<typeof customFetch>;
5486
5493
  }) => {
5487
5494
  isMutating: boolean;
5488
- trigger: swr_mutation.TriggerWithArgs<Webhook, TError, string | readonly [`/v1/email-agents/${string}/webhooks`], CreateEmailAgentWebhookBody>;
5495
+ trigger: swr_mutation.TriggerWithArgs<Webhook, TError, string | readonly [`/v1/inboxes/${string}/webhooks`], CreateEmailAgentWebhookBody>;
5489
5496
  reset: () => void;
5490
5497
  data: Webhook | undefined;
5491
5498
  error: TError | undefined;
5492
- swrKey: string | readonly [`/v1/email-agents/${string}/webhooks`];
5499
+ swrKey: string | readonly [`/v1/inboxes/${string}/webhooks`];
5500
+ };
5501
+ /**
5502
+ * List all webhooks configured for a specific inbox.
5503
+
5504
+ For compatibility this endpoint is also available using the following (deprecated) paths:
5505
+ `GET /v1/email-agents/{id}/webhooks`
5506
+ * @summary List inbox webhooks
5507
+ */
5508
+ declare const getListInboxWebhooksUrl: (inboxId: string) => string;
5509
+ declare const listInboxWebhooks: (inboxId: string, options?: RequestInit) => Promise<InboxWebhookList>;
5510
+ declare const getListInboxWebhooksKey: (inboxId: string) => readonly [`/v1/inboxes/${string}/webhooks`];
5511
+ type ListInboxWebhooksQueryResult = NonNullable<Awaited<ReturnType<typeof listInboxWebhooks>>>;
5512
+ /**
5513
+ * @summary List inbox webhooks
5514
+ */
5515
+ declare const useListInboxWebhooks: <TError = ErrorType<ErrorResponse>>(inboxId: string, options?: {
5516
+ swr?: SWRConfiguration<Awaited<ReturnType<typeof listInboxWebhooks>>, TError> & {
5517
+ swrKey?: Key;
5518
+ enabled?: boolean;
5519
+ };
5520
+ request?: SecondParameter<typeof customFetch>;
5521
+ }) => {
5522
+ data: InboxWebhookList | undefined;
5523
+ error: TError | undefined;
5524
+ mutate: swr.KeyedMutator<InboxWebhookList>;
5525
+ isValidating: boolean;
5526
+ isLoading: swr__internal.IsLoadingResponse<Data, Config>;
5527
+ swrKey: string | false | readonly [any, ...unknown[]] | Record<any, any> | (() => Arguments);
5493
5528
  };
5494
5529
  /**
5495
5530
  * Create a webhook that fires when extraction events occur for the specified extractor.
@@ -5595,34 +5630,6 @@ declare const useGetWebhook: <TError = ErrorType<ErrorResponse>>(id: string, opt
5595
5630
  isLoading: swr__internal.IsLoadingResponse<Data, Config>;
5596
5631
  swrKey: string | false | readonly [any, ...unknown[]] | Record<any, any> | (() => Arguments);
5597
5632
  };
5598
- /**
5599
- * List all webhooks configured for a specific inbox.
5600
-
5601
- For compatibility this endpoint is also available using the following (deprecated) paths:
5602
- `GET /v1/email-agents/{id}/webhooks`
5603
- * @summary List inbox webhooks
5604
- */
5605
- declare const getListInboxWebhooksUrl: (inboxId: string) => string;
5606
- declare const listInboxWebhooks: (inboxId: string, options?: RequestInit) => Promise<InboxWebhookList>;
5607
- declare const getListInboxWebhooksKey: (inboxId: string) => readonly [`/v1/inboxes/${string}/webhooks`];
5608
- type ListInboxWebhooksQueryResult = NonNullable<Awaited<ReturnType<typeof listInboxWebhooks>>>;
5609
- /**
5610
- * @summary List inbox webhooks
5611
- */
5612
- declare const useListInboxWebhooks: <TError = ErrorType<ErrorResponse>>(inboxId: string, options?: {
5613
- swr?: SWRConfiguration<Awaited<ReturnType<typeof listInboxWebhooks>>, TError> & {
5614
- swrKey?: Key;
5615
- enabled?: boolean;
5616
- };
5617
- request?: SecondParameter<typeof customFetch>;
5618
- }) => {
5619
- data: InboxWebhookList | undefined;
5620
- error: TError | undefined;
5621
- mutate: swr.KeyedMutator<InboxWebhookList>;
5622
- isValidating: boolean;
5623
- isLoading: swr__internal.IsLoadingResponse<Data, Config>;
5624
- swrKey: string | false | readonly [any, ...unknown[]] | Record<any, any> | (() => Arguments);
5625
- };
5626
5633
  /**
5627
5634
  * List delivery attempts for a specific webhook, with pagination and sorting. Useful for debugging webhook issues.
5628
5635
  * @summary List webhook deliveries
package/dist/index.js CHANGED
@@ -1926,33 +1926,61 @@ var useListAgentWebhooks = (voiceAgentId, options) => {
1926
1926
  ...query
1927
1927
  };
1928
1928
  };
1929
- var getCreateEmailAgentWebhookUrl = (id) => {
1930
- return `/v1/email-agents/${id}/webhooks`;
1929
+ var getCreateEmailAgentWebhookUrl = (inboxId) => {
1930
+ return `/v1/inboxes/${inboxId}/webhooks`;
1931
1931
  };
1932
- var createEmailAgentWebhook = async (id, createEmailAgentWebhookBody, options) => {
1933
- return customFetch(getCreateEmailAgentWebhookUrl(id), {
1932
+ var createEmailAgentWebhook = async (inboxId, createEmailAgentWebhookBody, options) => {
1933
+ return customFetch(getCreateEmailAgentWebhookUrl(inboxId), {
1934
1934
  ...options,
1935
1935
  method: "POST",
1936
1936
  headers: { "Content-Type": "application/json", ...options?.headers },
1937
1937
  body: JSON.stringify(createEmailAgentWebhookBody)
1938
1938
  });
1939
1939
  };
1940
- var getCreateEmailAgentWebhookMutationFetcher = (id, options) => {
1940
+ var getCreateEmailAgentWebhookMutationFetcher = (inboxId, options) => {
1941
1941
  return (_, { arg }) => {
1942
- return createEmailAgentWebhook(id, arg, options);
1942
+ return createEmailAgentWebhook(inboxId, arg, options);
1943
1943
  };
1944
1944
  };
1945
- var getCreateEmailAgentWebhookMutationKey = (id) => [`/v1/email-agents/${id}/webhooks`];
1946
- var useCreateEmailAgentWebhook = (id, options) => {
1945
+ var getCreateEmailAgentWebhookMutationKey = (inboxId) => [`/v1/inboxes/${inboxId}/webhooks`];
1946
+ var useCreateEmailAgentWebhook = (inboxId, options) => {
1947
1947
  const { swr: swrOptions, request: requestOptions } = options ?? {};
1948
- const swrKey = swrOptions?.swrKey ?? getCreateEmailAgentWebhookMutationKey(id);
1949
- const swrFn = getCreateEmailAgentWebhookMutationFetcher(id, requestOptions);
1948
+ const swrKey = swrOptions?.swrKey ?? getCreateEmailAgentWebhookMutationKey(inboxId);
1949
+ const swrFn = getCreateEmailAgentWebhookMutationFetcher(
1950
+ inboxId,
1951
+ requestOptions
1952
+ );
1950
1953
  const query = useSWRMutation12(swrKey, swrFn, swrOptions);
1951
1954
  return {
1952
1955
  swrKey,
1953
1956
  ...query
1954
1957
  };
1955
1958
  };
1959
+ var getListInboxWebhooksUrl = (inboxId) => {
1960
+ return `/v1/inboxes/${inboxId}/webhooks`;
1961
+ };
1962
+ var listInboxWebhooks = async (inboxId, options) => {
1963
+ return customFetch(getListInboxWebhooksUrl(inboxId), {
1964
+ ...options,
1965
+ method: "GET"
1966
+ });
1967
+ };
1968
+ var getListInboxWebhooksKey = (inboxId) => [`/v1/inboxes/${inboxId}/webhooks`];
1969
+ var useListInboxWebhooks = (inboxId, options) => {
1970
+ const { swr: swrOptions, request: requestOptions } = options ?? {};
1971
+ const isEnabled = swrOptions?.enabled !== false && !!inboxId;
1972
+ const swrKey = swrOptions?.swrKey ?? (() => isEnabled ? getListInboxWebhooksKey(inboxId) : null);
1973
+ const swrFn = () => listInboxWebhooks(inboxId, requestOptions);
1974
+ const query = useSwr16(
1975
+ swrKey,
1976
+ swrFn,
1977
+ swrOptions
1978
+ );
1979
+ return {
1980
+ swrKey,
1981
+ ...query
1982
+ };
1983
+ };
1956
1984
  var getCreateExtractorWebhookUrl = (id) => {
1957
1985
  return `/v1/extractors/${id}/webhooks`;
1958
1986
  };
@@ -2055,31 +2083,6 @@ var useGetWebhook = (id, options) => {
2055
2083
  ...query
2056
2084
  };
2057
2085
  };
2058
- var getListInboxWebhooksUrl = (inboxId) => {
2059
- return `/v1/inboxes/${inboxId}/webhooks`;
2060
- };
2061
- var listInboxWebhooks = async (inboxId, options) => {
2062
- return customFetch(getListInboxWebhooksUrl(inboxId), {
2063
- ...options,
2064
- method: "GET"
2065
- });
2066
- };
2067
- var getListInboxWebhooksKey = (inboxId) => [`/v1/inboxes/${inboxId}/webhooks`];
2068
- var useListInboxWebhooks = (inboxId, options) => {
2069
- const { swr: swrOptions, request: requestOptions } = options ?? {};
2070
- const isEnabled = swrOptions?.enabled !== false && !!inboxId;
2071
- const swrKey = swrOptions?.swrKey ?? (() => isEnabled ? getListInboxWebhooksKey(inboxId) : null);
2072
- const swrFn = () => listInboxWebhooks(inboxId, requestOptions);
2073
- const query = useSwr16(
2074
- swrKey,
2075
- swrFn,
2076
- swrOptions
2077
- );
2078
- return {
2079
- swrKey,
2080
- ...query
2081
- };
2082
- };
2083
2086
  var getListWebhookDeliveriesUrl = (id, params) => {
2084
2087
  const normalizedParams = new URLSearchParams();
2085
2088
  Object.entries(params || {}).forEach(([key, value]) => {