@getlatedev/node 0.2.1674 → 0.2.1676

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.
@@ -17361,6 +17361,18 @@ export type Profile = {
17361
17361
  * The mode that applies to this profile: `none` when the profile or the whole team uses zero content retention.
17362
17362
  */
17363
17363
  effectiveContentRetention?: 'standard' | 'none';
17364
+ /**
17365
+ * Most outbound calls placed from this profile's numbers in any rolling hour. Null means only the team limits apply.
17366
+ */
17367
+ maxOutboundCallsPerHour?: (number) | null;
17368
+ /**
17369
+ * Most billed spend, in USD, on outbound calls and calls forwarded to a phone from this profile's numbers in any rolling 24 hours. Null means only the team limits apply.
17370
+ */
17371
+ maxDailyCallSpendUsd?: (number) | null;
17372
+ /**
17373
+ * Most minutes of inbound calls forwarded to a phone from this profile's numbers in any rolling 24 hours. Null means only the team limits apply.
17374
+ */
17375
+ maxForwardedMinutesPerDay?: (number) | null;
17364
17376
  isDefault?: boolean;
17365
17377
  /**
17366
17378
  * Only present when includeOverLimit=true. Indicates if this profile exceeds the plan limit.
@@ -17383,6 +17395,57 @@ export type contentRetention = 'standard' | 'none';
17383
17395
  */
17384
17396
  export type effectiveContentRetention = 'standard' | 'none';
17385
17397
 
17398
+ export type ProfileCallLimit = {
17399
+ /**
17400
+ * The limit, or null when none is set at this level.
17401
+ */
17402
+ limit: (number) | null;
17403
+ /**
17404
+ * Used in the current window, calls still in progress included.
17405
+ */
17406
+ used: number;
17407
+ /**
17408
+ * What is left before the limit; null when there is no limit.
17409
+ */
17410
+ remaining: (number) | null;
17411
+ /**
17412
+ * `concurrent` counts calls in progress now; the rolling windows end now.
17413
+ */
17414
+ window: 'concurrent' | 'rolling_hour' | 'rolling_24h';
17415
+ };
17416
+
17417
+ /**
17418
+ * `concurrent` counts calls in progress now; the rolling windows end now.
17419
+ */
17420
+ export type window = 'concurrent' | 'rolling_hour' | 'rolling_24h';
17421
+
17422
+ export type ProfileCallLimitsResponse = {
17423
+ profileId: string;
17424
+ /**
17425
+ * The limits set on this profile. They apply inside the team limits, never above them.
17426
+ */
17427
+ profile: {
17428
+ outboundCallsPerHour?: ProfileCallLimit;
17429
+ dailyCallSpendUsd?: ProfileCallLimit;
17430
+ forwardedMinutesPerDay?: ProfileCallLimit;
17431
+ };
17432
+ /**
17433
+ * The limits of the whole team (every profile and member). Contact support to raise them.
17434
+ */
17435
+ team: {
17436
+ concurrentCalls?: ProfileCallLimit;
17437
+ /**
17438
+ * Billed spend (USD) on outbound calls and calls forwarded to a phone across the team over the rolling 24 hours, in the same unit as `maxDailyCallSpendUsd`.
17439
+ */
17440
+ dailyCallSpendUsd?: (ProfileCallLimit);
17441
+ /**
17442
+ * Billed spend (USD) on calls forwarded to a phone across the team over the rolling 24 hours.
17443
+ */
17444
+ dailyForwardSpendUsd?: (ProfileCallLimit);
17445
+ forwardedMinutesPerHour?: ProfileCallLimit;
17446
+ };
17447
+ };
17448
+
17386
17449
  export type ProfileCreateResponse = {
17387
17450
  message?: string;
17388
17451
  profile?: Profile;
@@ -20233,6 +20296,14 @@ export type UsageAttributionGroup = UsageAttributionSlice & {
20233
20296
  * Profile id or account id, per `groupBy`.
20234
20297
  */
20235
20298
  key: string;
20299
+ /**
20300
+ * With `groupBy=profile` only: the profile id (same as `key`).
20301
+ */
20302
+ profileId?: string;
20303
+ /**
20304
+ * With `groupBy=profile` only: the externalId set on the profile, null when it has none.
20305
+ */
20306
+ externalId?: (string) | null;
20236
20307
  };
20237
20308
 
20238
20309
  export type UsageAttributionSlice = {
@@ -20406,11 +20477,9 @@ export type UsageMetering = {
20406
20477
  restricted?: boolean;
20407
20478
  };
20408
20479
  /**
20409
- * Present with `profileId` / `accountId`: echoes the group the payload was projected onto.
20480
+ * Present with `profileId` / `externalId` / `accountId`: echoes the group the payload was projected onto. A profile scope carries both ids.
20410
20481
  */
20411
- scope?: ({
20412
- profileId: string;
20413
- } | {
20482
+ scope?: (UsageProfileRef | {
20414
20483
  accountId: string;
20415
20484
  });
20416
20485
  };
@@ -20424,6 +20493,14 @@ export type source5 = 'cycle' | 'window';
20424
20493
 
20425
20494
  export type groupBy = 'profile' | 'account';
20426
20495
 
20496
+ export type UsageProfileRef = {
20497
+ profileId: string;
20498
+ /**
20499
+ * The externalId set on the profile, null when it has none.
20500
+ */
20501
+ externalId: (string) | null;
20502
+ };
20503
+
20427
20504
  /**
20428
20505
  * Plan and usage stats. The response shape depends on `billingSystem`:
20429
20506
  *
@@ -20526,6 +20603,25 @@ export type UsageStats = {
20526
20603
  [key: string]: (number);
20527
20604
  };
20528
20605
  };
20606
+ /**
20607
+ * Profile-scoped API keys and members only, without a filter: one block per profile the caller can see, shaped like `profile`.
20608
+ */
20609
+ profiles?: Array<(UsageProfileRef & {
20610
+ usage?: {
20611
+ connectedAccounts?: number;
20612
+ };
20613
+ })>;
20614
+ /**
20615
+ * Present with `profileId` / `externalId` on `GET /v1/usage-stats`: the per-profile counters. Everything outside this block stays team-level.
20616
+ */
20617
+ profile?: (UsageProfileRef & {
20618
+ usage?: {
20619
+ /**
20620
+ * Billable connected accounts on this profile, counted like the team-level figure.
20621
+ */
20622
+ connectedAccounts?: number;
20623
+ };
20624
+ });
20529
20625
  /**
20530
20626
  * Usage-based billing only. Current-period spend summary.
20531
20627
  */
@@ -32468,9 +32564,13 @@ export type GetXApiPricingError = (ErrorResponse);
32468
32564
  export type GetUsageData = {
32469
32565
  query?: {
32470
32566
  /**
32471
- * Metering mode (pair with `range`). Project the payload onto this account's attributed share. Mutually exclusive with `profileId`, and `groupBy` (if given) must be `account`; 404 when the account is not visible to the caller.
32567
+ * Metering mode (pair with `range`). Project the payload onto this account's attributed share. Mutually exclusive with `profileId` and `externalId`, and `groupBy` (if given) must be `account`; 404 when the account is not visible to the caller.
32472
32568
  */
32473
32569
  accountId?: string;
32570
+ /**
32571
+ * Metering mode (pair with `range`). Same as `profileId`, naming the profile by the `externalId` you set on it. Ignored without metering params. 404 when none of your visible profiles carries it; 400 when two of them do (externalId is unique per user, not per team), then filter by `profileId`.
32572
+ */
32573
+ externalId?: string;
32474
32574
  /**
32475
32575
  * Inclusive start (UTC date). Required when `range=custom`.
32476
32576
  */
@@ -32487,7 +32587,7 @@ export type GetUsageData = {
32487
32587
  */
32488
32588
  groupBy?: 'profile' | 'account';
32489
32589
  /**
32490
- * Metering mode (pair with `range`). Project the payload onto this profile's attributed share. Mutually exclusive with `accountId`, and `groupBy` (if given) must be `profile`; 404 when the profile is not in your team (or outside a scoped key's profiles).
32590
+ * Metering mode (pair with `range`). Project the payload onto this profile's attributed share. Mutually exclusive with `externalId` and `accountId`, and `groupBy` (if given) must be `profile`; 404 when the profile is not in your team (or outside a scoped key's profiles).
32491
32591
  */
32492
32592
  profileId?: string;
32493
32593
  /**
@@ -32514,12 +32614,18 @@ export type GetUsageData = {
32514
32614
 
32515
32615
  export type GetUsageResponse = ((UsageStats | UsageMetering));
32516
32616
 
32517
- export type GetUsageError = (unknown | ErrorResponse | {
32518
- error?: string;
32519
- });
32617
+ export type GetUsageError = (unknown | ErrorResponse);
32520
32618
 
32521
32619
  export type GetUsageStatsData = {
32522
32620
  query?: {
32621
+ /**
32622
+ * Same as `profileId`, naming the profile by the `externalId` you set on it. 404 when none of your visible profiles carries it; 400 when two of them do.
32623
+ */
32624
+ externalId?: string;
32625
+ /**
32626
+ * Add the `profile` block for this profile. Mutually exclusive with `externalId`. 404 when the profile is not in your team or outside a scoped key's profiles.
32627
+ */
32628
+ profileId?: string;
32523
32629
  /**
32524
32630
  * For Stripe subscription users, `true` forces a subscription
32525
32631
  * reconciliation pass even when cached plan data looks complete.
@@ -32534,18 +32640,24 @@ export type GetUsageStatsData = {
32534
32640
 
32535
32641
  export type GetUsageStatsResponse = (UsageStats);
32536
32642
 
32537
- export type GetUsageStatsError = (unknown | ErrorResponse | {
32538
- error?: string;
32539
- });
32643
+ export type GetUsageStatsError = (unknown | ErrorResponse);
32540
32644
 
32541
32645
  export type GetCallsUsageData = {
32542
32646
  query?: {
32543
32647
  channel?: 'whatsapp' | 'pstn';
32544
- groupBy?: 'day' | 'number' | 'channel';
32648
+ /**
32649
+ * Same as `profileId`, naming the profile by the `externalId` you set on it. 404 when none of your visible profiles carries it; 400 when two of them do.
32650
+ */
32651
+ externalId?: string;
32652
+ groupBy?: 'day' | 'number' | 'channel' | 'profile';
32545
32653
  /**
32546
32654
  * Scope to calls involving this number (typically one of YOUR numbers). E.164, leading + optional.
32547
32655
  */
32548
32656
  number?: string;
32657
+ /**
32658
+ * Scope to the calls of this profile. Mutually exclusive with `externalId`. 404 when the profile is not in your team or outside a scoped key's profiles.
32659
+ */
32660
+ profileId?: string;
32549
32661
  /**
32550
32662
  * Start of the window (inclusive). Default 30 days before `until`.
32551
32663
  */
@@ -32560,7 +32672,11 @@ export type GetCallsUsageData = {
32560
32672
  export type GetCallsUsageResponse = ({
32561
32673
  since?: string;
32562
32674
  until?: string;
32563
- groupBy?: ('day' | 'number' | 'channel') | null;
32675
+ groupBy?: ('day' | 'number' | 'channel' | 'profile') | null;
32676
+ /**
32677
+ * Present with `profileId` / `externalId`: the profile the figures are scoped to.
32678
+ */
32679
+ profile?: UsageProfileRef;
32564
32680
  totals?: {
32565
32681
  calls?: number;
32566
32682
  answered?: number;
@@ -32587,9 +32703,17 @@ export type GetCallsUsageResponse = ({
32587
32703
  */
32588
32704
  groups?: Array<{
32589
32705
  /**
32590
- * The group key: a `YYYY-MM-DD` UTC day, one of your numbers, or a channel.
32706
+ * The group key: a `YYYY-MM-DD` UTC day, one of your numbers, a channel, or a profile id.
32591
32707
  */
32592
32708
  key?: string;
32709
+ /**
32710
+ * With `groupBy=profile` only: the profile id (same as `key`).
32711
+ */
32712
+ profileId?: string;
32713
+ /**
32714
+ * With `groupBy=profile` only: the externalId set on the profile, null when it has none.
32715
+ */
32716
+ externalId?: (string) | null;
32593
32717
  calls?: number;
32594
32718
  answered?: number;
32595
32719
  minutes?: number;
@@ -32604,11 +32728,19 @@ export type GetCallsUsageError = (unknown | ErrorResponse);
32604
32728
 
32605
32729
  export type GetSmsUsageData = {
32606
32730
  query?: {
32607
- groupBy?: 'day' | 'number';
32731
+ /**
32732
+ * Same as `profileId`, naming the profile by the `externalId` you set on it. 404 when none of your visible profiles carries it; 400 when two of them do.
32733
+ */
32734
+ externalId?: string;
32735
+ groupBy?: 'day' | 'number' | 'profile';
32608
32736
  /**
32609
32737
  * Scope to one of YOUR SMS-enabled numbers (E.164, leading + optional).
32610
32738
  */
32611
32739
  number?: string;
32740
+ /**
32741
+ * Scope to the messages of this profile. Mutually exclusive with `externalId`. 404 when the profile is not in your team or outside a scoped key's profiles.
32742
+ */
32743
+ profileId?: string;
32612
32744
  /**
32613
32745
  * Start of the window (inclusive). Default 30 days before `until`.
32614
32746
  */
@@ -32623,7 +32755,11 @@ export type GetSmsUsageData = {
32623
32755
  export type GetSmsUsageResponse = ({
32624
32756
  since?: string;
32625
32757
  until?: string;
32626
- groupBy?: ('day' | 'number') | null;
32758
+ groupBy?: ('day' | 'number' | 'profile') | null;
32759
+ /**
32760
+ * Present with `profileId` / `externalId`: the profile the counts are scoped to.
32761
+ */
32762
+ profile?: UsageProfileRef;
32627
32763
  totals?: {
32628
32764
  sent?: number;
32629
32765
  received?: number;
@@ -32634,9 +32770,17 @@ export type GetSmsUsageResponse = ({
32634
32770
  */
32635
32771
  groups?: Array<{
32636
32772
  /**
32637
- * A `YYYY-MM-DD` UTC day or one of your numbers.
32773
+ * A `YYYY-MM-DD` UTC day, one of your numbers, or a profile id.
32638
32774
  */
32639
32775
  key?: string;
32776
+ /**
32777
+ * With `groupBy=profile` only: the profile id (same as `key`).
32778
+ */
32779
+ profileId?: string;
32780
+ /**
32781
+ * With `groupBy=profile` only: the externalId set on the profile, null when it has none.
32782
+ */
32783
+ externalId?: (string) | null;
32640
32784
  sent?: number;
32641
32785
  received?: number;
32642
32786
  total?: number;
@@ -33430,6 +33574,18 @@ export type CreateProfileData = {
33430
33574
  * Set `none` to create the profile with zero content retention, so nothing of its accounts is stored from the first sync. Only the team owner can, with a session or a full-access key; anyone else gets 403.
33431
33575
  */
33432
33576
  contentRetention?: 'standard' | 'none';
33577
+ /**
33578
+ * Caps outbound calls from this profile's numbers per rolling hour, inside the team limits. Omit for no profile cap.
33579
+ */
33580
+ maxOutboundCallsPerHour?: number;
33581
+ /**
33582
+ * Caps billed call spend (USD) from this profile's numbers per rolling 24 hours, inside the team limits. Omit for no profile cap.
33583
+ */
33584
+ maxDailyCallSpendUsd?: number;
33585
+ /**
33586
+ * Caps minutes forwarded to a phone from this profile's numbers per rolling 24 hours, inside the team limits. Omit for no profile cap.
33587
+ */
33588
+ maxForwardedMinutesPerDay?: number;
33433
33589
  };
33434
33590
  headers?: {
33435
33591
  /**
@@ -33540,6 +33696,18 @@ export type UpdateProfileData = {
33540
33696
  * Turns zero content retention on (`none`) or off (`standard`) for this profile only, for new data within about a minute. Only the team owner can change it. `standard` answers 409 while the whole team has it on; `none` answers 409 during a WhatsApp verification of a number of this profile.
33541
33697
  */
33542
33698
  contentRetention?: 'standard' | 'none';
33699
+ /**
33700
+ * Caps outbound calls from this profile's numbers per rolling hour, inside the team limits. Null clears it.
33701
+ */
33702
+ maxOutboundCallsPerHour?: (number) | null;
33703
+ /**
33704
+ * Caps billed call spend (USD) from this profile's numbers per rolling 24 hours, inside the team limits. Null clears it.
33705
+ */
33706
+ maxDailyCallSpendUsd?: (number) | null;
33707
+ /**
33708
+ * Caps minutes forwarded to a phone from this profile's numbers per rolling 24 hours, inside the team limits. Null clears it.
33709
+ */
33710
+ maxForwardedMinutesPerDay?: (number) | null;
33543
33711
  };
33544
33712
  path: {
33545
33713
  profileId: string;
@@ -33564,6 +33732,18 @@ export type DeleteProfileError = (unknown | ErrorResponse | {
33564
33732
  error?: string;
33565
33733
  });
33566
33734
 
33735
+ export type GetProfileLimitsData = {
33736
+ path: {
33737
+ profileId: string;
33738
+ };
33739
+ };
33740
+
33741
+ export type GetProfileLimitsResponse = (ProfileCallLimitsResponse);
33742
+
33743
+ export type GetProfileLimitsError = (ErrorResponse | unknown | {
33744
+ error?: string;
33745
+ });
33746
+
33567
33747
  export type ListAccountsData = {
33568
33748
  query?: {
33569
33749
  /**
@@ -49839,11 +50019,19 @@ export type ListVoiceCallsData = {
49839
50019
  query?: {
49840
50020
  before?: string;
49841
50021
  direction?: 'inbound' | 'outbound';
50022
+ /**
50023
+ * Same as `profileId`, naming the profile by the `externalId` you set on it. 404 when none of your visible profiles carries it; 400 when two of them do.
50024
+ */
50025
+ externalId?: string;
49842
50026
  limit?: number;
49843
50027
  /**
49844
50028
  * Exact filter: calls involving this number (typically one of your DIDs). E.164, leading + optional.
49845
50029
  */
49846
50030
  number?: string;
50031
+ /**
50032
+ * Only calls of this profile. Mutually exclusive with `externalId`. 404 when the profile is not in your team or outside a scoped key's profiles.
50033
+ */
50034
+ profileId?: string;
49847
50035
  status?: 'ringing' | 'answered' | 'ended' | 'failed';
49848
50036
  };
49849
50037
  };
@@ -49853,7 +50041,7 @@ export type ListVoiceCallsResponse = ({
49853
50041
  nextCursor?: (string) | null;
49854
50042
  });
49855
50043
 
49856
- export type ListVoiceCallsError = (ErrorResponse);
50044
+ export type ListVoiceCallsError = (unknown | ErrorResponse);
49857
50045
 
49858
50046
  export type GetVoiceCallData = {
49859
50047
  path: {