sendlit 0.4.0 → 0.5.0

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
@@ -39,7 +39,7 @@ declare class HttpClient {
39
39
  private send;
40
40
  }
41
41
 
42
- declare const routes$8: {
42
+ declare const routes$b: {
43
43
  create: {
44
44
  summary: "Create a contact";
45
45
  description: "Creates a contact (subscriber). If a contact with the same email already exists for this team, the existing contact is returned.";
@@ -1713,13 +1713,13 @@ declare const routes$8: {
1713
1713
  path: "/contacts/:contactId";
1714
1714
  };
1715
1715
  };
1716
- type Contact = Ok<typeof routes$8.get>;
1717
- type CreateContactInput = Body<typeof routes$8.create>;
1718
- type UpdateContactInput = Body<typeof routes$8.update>;
1719
- type ListContactsQuery = Query<typeof routes$8.list>;
1720
- type ContactDelivery = Ok<typeof routes$8.deliveries>[number];
1721
- type ContactEvent = Ok<typeof routes$8.events>["items"][number];
1722
- type ListContactEventsQuery = Query<typeof routes$8.events>;
1716
+ type Contact = Ok<typeof routes$b.get>;
1717
+ type CreateContactInput = Body<typeof routes$b.create>;
1718
+ type UpdateContactInput = Body<typeof routes$b.update>;
1719
+ type ListContactsQuery = Query<typeof routes$b.list>;
1720
+ type ContactDelivery = Ok<typeof routes$b.deliveries>[number];
1721
+ type ContactEvent = Ok<typeof routes$b.events>["items"][number];
1722
+ type ListContactEventsQuery = Query<typeof routes$b.events>;
1723
1723
  declare class Contacts {
1724
1724
  private readonly http;
1725
1725
  constructor(http: HttpClient);
@@ -1731,7 +1731,7 @@ declare class Contacts {
1731
1731
  * here don't fire `tag:added`.
1732
1732
  */
1733
1733
  create(input: CreateContactInput): Promise<Contact>;
1734
- list(query?: ListContactsQuery): Promise<Ok<typeof routes$8.list>>;
1734
+ list(query?: ListContactsQuery): Promise<Ok<typeof routes$b.list>>;
1735
1735
  /** Iterates every contact matching `query`, fetching pages lazily. */
1736
1736
  listAll(query?: Omit<ListContactsQuery, "offset">): AsyncGenerator<Contact, void, undefined>;
1737
1737
  get(contactId: string): Promise<Contact>;
@@ -1743,10 +1743,10 @@ declare class Contacts {
1743
1743
  deliveries(contactId: string): Promise<ContactDelivery[]>;
1744
1744
  /** Custom events received for this contact, newest first, with the
1745
1745
  * sequences each one started. */
1746
- events(contactId: string, query?: ListContactEventsQuery): Promise<Ok<typeof routes$8.events>>;
1746
+ events(contactId: string, query?: ListContactEventsQuery): Promise<Ok<typeof routes$b.events>>;
1747
1747
  }
1748
1748
 
1749
- declare const routes$7: {
1749
+ declare const routes$a: {
1750
1750
  list: {
1751
1751
  query: zod.ZodObject<{
1752
1752
  espId: zod.ZodOptional<zod.ZodString>;
@@ -1923,18 +1923,18 @@ declare const routes$7: {
1923
1923
  path: "/delivery-events/:eventId";
1924
1924
  };
1925
1925
  };
1926
- type DeliveryEvent = Ok<typeof routes$7.get>;
1927
- type ListDeliveryEventsQuery = Query<typeof routes$7.list>;
1926
+ type DeliveryEvent = Ok<typeof routes$a.get>;
1927
+ type ListDeliveryEventsQuery = Query<typeof routes$a.list>;
1928
1928
  /** Normalized delivery history (delivered, bounced, complained, …). */
1929
1929
  declare class DeliveryEvents {
1930
1930
  private readonly http;
1931
1931
  constructor(http: HttpClient);
1932
- list(query?: ListDeliveryEventsQuery): Promise<Ok<typeof routes$7.list>>;
1932
+ list(query?: ListDeliveryEventsQuery): Promise<Ok<typeof routes$a.list>>;
1933
1933
  listAll(query?: Omit<ListDeliveryEventsQuery, "offset">): AsyncGenerator<DeliveryEvent, void, undefined>;
1934
1934
  get(eventId: string): Promise<DeliveryEvent>;
1935
1935
  }
1936
1936
 
1937
- declare const routes$6: {
1937
+ declare const routes$9: {
1938
1938
  send: {
1939
1939
  summary: "Send a transactional email";
1940
1940
  description: "Requires a non-empty mailing address in the team's general settings. `templateId` must identify a team-owned transactional template; marketing templates return 422 template_not_transactional. Unguarded Liquid variables must be supplied in `variables`, or the API returns 422 missing_template_variables without creating a row or queue job. Inline `html` is sent verbatim without Liquid rendering. address, unsubscribe_link, and subscriber are marketing-only server-owned values and are unavailable to transactional templates.";
@@ -1949,6 +1949,7 @@ declare const routes$6: {
1949
1949
  html: zod.ZodOptional<zod.ZodString>;
1950
1950
  text: zod.ZodOptional<zod.ZodString>;
1951
1951
  variables: zod.ZodOptional<zod.ZodRecord<zod.ZodString, zod.ZodAny>>;
1952
+ fromName: zod.ZodOptional<zod.ZodEffects<zod.ZodString, string, string>>;
1952
1953
  replyTo: zod.ZodOptional<zod.ZodString>;
1953
1954
  headers: zod.ZodOptional<zod.ZodEffects<zod.ZodRecord<zod.ZodString, zod.ZodString>, Record<string, string>, Record<string, string>>>;
1954
1955
  idempotencyKey: zod.ZodOptional<zod.ZodString>;
@@ -1977,6 +1978,7 @@ declare const routes$6: {
1977
1978
  idempotencyKey?: string | undefined;
1978
1979
  text?: string | undefined;
1979
1980
  html?: string | undefined;
1981
+ fromName?: string | undefined;
1980
1982
  replyTo?: string | undefined;
1981
1983
  deliverySource?: {
1982
1984
  type: "organization";
@@ -1995,6 +1997,7 @@ declare const routes$6: {
1995
1997
  idempotencyKey?: string | undefined;
1996
1998
  text?: string | undefined;
1997
1999
  html?: string | undefined;
2000
+ fromName?: string | undefined;
1998
2001
  replyTo?: string | undefined;
1999
2002
  deliverySource?: {
2000
2003
  type: "organization";
@@ -2013,6 +2016,7 @@ declare const routes$6: {
2013
2016
  idempotencyKey?: string | undefined;
2014
2017
  text?: string | undefined;
2015
2018
  html?: string | undefined;
2019
+ fromName?: string | undefined;
2016
2020
  replyTo?: string | undefined;
2017
2021
  deliverySource?: {
2018
2022
  type: "organization";
@@ -2031,6 +2035,7 @@ declare const routes$6: {
2031
2035
  idempotencyKey?: string | undefined;
2032
2036
  text?: string | undefined;
2033
2037
  html?: string | undefined;
2038
+ fromName?: string | undefined;
2034
2039
  replyTo?: string | undefined;
2035
2040
  deliverySource?: {
2036
2041
  type: "organization";
@@ -2049,6 +2054,7 @@ declare const routes$6: {
2049
2054
  idempotencyKey?: string | undefined;
2050
2055
  text?: string | undefined;
2051
2056
  html?: string | undefined;
2057
+ fromName?: string | undefined;
2052
2058
  replyTo?: string | undefined;
2053
2059
  deliverySource?: {
2054
2060
  type: "organization";
@@ -2067,6 +2073,7 @@ declare const routes$6: {
2067
2073
  idempotencyKey?: string | undefined;
2068
2074
  text?: string | undefined;
2069
2075
  html?: string | undefined;
2076
+ fromName?: string | undefined;
2070
2077
  replyTo?: string | undefined;
2071
2078
  deliverySource?: {
2072
2079
  type: "organization";
@@ -2358,11 +2365,11 @@ declare const routes$6: {
2358
2365
  path: "/emails";
2359
2366
  };
2360
2367
  };
2361
- type SendEmailInput = Body<typeof routes$6.send>;
2362
- type SendEmailResponse = Ok<typeof routes$6.send>;
2363
- type TransactionalEmail = Ok<typeof routes$6.list>["items"][number];
2364
- type TransactionalEmailDetail = Ok<typeof routes$6.get>;
2365
- type ListEmailsQuery = Query<typeof routes$6.list>;
2368
+ type SendEmailInput = Body<typeof routes$9.send>;
2369
+ type SendEmailResponse = Ok<typeof routes$9.send>;
2370
+ type TransactionalEmail = Ok<typeof routes$9.list>["items"][number];
2371
+ type TransactionalEmailDetail = Ok<typeof routes$9.get>;
2372
+ type ListEmailsQuery = Query<typeof routes$9.list>;
2366
2373
  /** Transactional (single, API-triggered) emails. */
2367
2374
  declare class Emails {
2368
2375
  private readonly http;
@@ -2374,11 +2381,11 @@ declare class Emails {
2374
2381
  */
2375
2382
  send(input: SendEmailInput): Promise<SendEmailResponse>;
2376
2383
  get(txeId: string): Promise<TransactionalEmailDetail>;
2377
- list(query?: ListEmailsQuery): Promise<Ok<typeof routes$6.list>>;
2384
+ list(query?: ListEmailsQuery): Promise<Ok<typeof routes$9.list>>;
2378
2385
  listAll(query?: Omit<ListEmailsQuery, "offset">): AsyncGenerator<TransactionalEmail, void, undefined>;
2379
2386
  }
2380
2387
 
2381
- declare const routes$5: {
2388
+ declare const routes$8: {
2382
2389
  track: {
2383
2390
  summary: "Track a custom event";
2384
2391
  description: "Stores the event, then starts every active sequence whose trigger is `event:custom` with this name and whose filters match. An unknown email creates the contact unless `createContact` is false (then 404). An unknown `contactId` is always 404. The same `idempotencyKey` within 30 days returns the original event with `duplicate: true`. Events with `backfill: true`, or an `occurredAt` more than 72 hours old, are stored but never start a sequence.";
@@ -2957,18 +2964,18 @@ declare const routes$5: {
2957
2964
  path: "/events/definitions/:name";
2958
2965
  };
2959
2966
  };
2960
- type TrackEventInput = Body<typeof routes$5.track>;
2961
- type TrackEventResponse = Ok<typeof routes$5.track>;
2962
- type EventDefinition = Ok<typeof routes$5.definitions>["items"][number];
2963
- type EventDefinitionDetail = Ok<typeof routes$5.definition>;
2964
- type CreateEventDefinitionInput = Body<typeof routes$5.createDefinition>;
2965
- type UpdateEventDefinitionInput = Body<typeof routes$5.updateDefinition>;
2967
+ type TrackEventInput = Body<typeof routes$8.track>;
2968
+ type TrackEventResponse = Ok<typeof routes$8.track>;
2969
+ type EventDefinition = Ok<typeof routes$8.definitions>["items"][number];
2970
+ type EventDefinitionDetail = Ok<typeof routes$8.definition>;
2971
+ type CreateEventDefinitionInput = Body<typeof routes$8.createDefinition>;
2972
+ type UpdateEventDefinitionInput = Body<typeof routes$8.updateDefinition>;
2966
2973
  /** The team's list of events: registered on first receipt, or by hand so
2967
2974
  * sequences can be built before the first event is sent. */
2968
2975
  declare class EventDefinitions {
2969
2976
  private readonly http;
2970
2977
  constructor(http: HttpClient);
2971
- list(): Promise<Ok<typeof routes$5.definitions>>;
2978
+ list(): Promise<Ok<typeof routes$8.definitions>>;
2972
2979
  /** One event with its last received payload. Names are case-sensitive. */
2973
2980
  get(name: string): Promise<EventDefinitionDetail>;
2974
2981
  create(input: CreateEventDefinitionInput): Promise<EventDefinitionDetail>;
@@ -3000,7 +3007,106 @@ declare class Events {
3000
3007
  track(input: TrackEventInput): Promise<TrackEventResponse>;
3001
3008
  }
3002
3009
 
3003
- declare const routes$4: {
3010
+ declare const routes$7: {
3011
+ get: {
3012
+ query: zod.ZodObject<{
3013
+ rangeDays: zod.ZodOptional<zod.ZodEffects<zod.ZodNumber, number, number>>;
3014
+ }, "strip", zod.ZodTypeAny, {
3015
+ rangeDays?: number | undefined;
3016
+ }, {
3017
+ rangeDays?: number | undefined;
3018
+ }>;
3019
+ summary: "Get team overview metrics for a delivery activity window";
3020
+ description: "Use `rangeDays` (1, 3, 7, or 30; default 7) to filter transactional delivery activity and scheduled broadcasts.";
3021
+ metadata: {
3022
+ tag: string;
3023
+ };
3024
+ method: "GET";
3025
+ responses: {
3026
+ 200: zod.ZodObject<{
3027
+ activeSequences: zod.ZodNumber;
3028
+ ongoingContacts: zod.ZodNumber;
3029
+ scheduledBroadcasts: zod.ZodNumber;
3030
+ mail: zod.ZodObject<{
3031
+ sent: zod.ZodNumber;
3032
+ queued: zod.ZodNumber;
3033
+ failed: zod.ZodNumber;
3034
+ bounced: zod.ZodNumber;
3035
+ }, "strip", zod.ZodTypeAny, {
3036
+ bounced: number;
3037
+ sent: number;
3038
+ queued: number;
3039
+ failed: number;
3040
+ }, {
3041
+ bounced: number;
3042
+ sent: number;
3043
+ queued: number;
3044
+ failed: number;
3045
+ }>;
3046
+ quota: zod.ZodObject<{
3047
+ dailyUsed: zod.ZodNumber;
3048
+ dailyLimit: zod.ZodNumber;
3049
+ monthlyUsed: zod.ZodNumber;
3050
+ monthlyLimit: zod.ZodNumber;
3051
+ }, "strip", zod.ZodTypeAny, {
3052
+ dailyLimit: number;
3053
+ monthlyLimit: number;
3054
+ dailyUsed: number;
3055
+ monthlyUsed: number;
3056
+ }, {
3057
+ dailyLimit: number;
3058
+ monthlyLimit: number;
3059
+ dailyUsed: number;
3060
+ monthlyUsed: number;
3061
+ }>;
3062
+ }, "strip", zod.ZodTypeAny, {
3063
+ mail: {
3064
+ bounced: number;
3065
+ sent: number;
3066
+ queued: number;
3067
+ failed: number;
3068
+ };
3069
+ activeSequences: number;
3070
+ ongoingContacts: number;
3071
+ scheduledBroadcasts: number;
3072
+ quota: {
3073
+ dailyLimit: number;
3074
+ monthlyLimit: number;
3075
+ dailyUsed: number;
3076
+ monthlyUsed: number;
3077
+ };
3078
+ }, {
3079
+ mail: {
3080
+ bounced: number;
3081
+ sent: number;
3082
+ queued: number;
3083
+ failed: number;
3084
+ };
3085
+ activeSequences: number;
3086
+ ongoingContacts: number;
3087
+ scheduledBroadcasts: number;
3088
+ quota: {
3089
+ dailyLimit: number;
3090
+ monthlyLimit: number;
3091
+ dailyUsed: number;
3092
+ monthlyUsed: number;
3093
+ };
3094
+ }>;
3095
+ };
3096
+ path: "/overview";
3097
+ };
3098
+ };
3099
+ /** The team's dashboard numbers: contacts, sends, opens and clicks over a
3100
+ * period. */
3101
+ type Overview = Ok<typeof routes$7.get>;
3102
+ type OverviewQuery = Query<typeof routes$7.get>;
3103
+ declare class OverviewResource {
3104
+ private readonly http;
3105
+ constructor(http: HttpClient);
3106
+ get(query?: OverviewQuery): Promise<Overview>;
3107
+ }
3108
+
3109
+ declare const routes$6: {
3004
3110
  getOrganization: {
3005
3111
  summary: "Get the organization bound to the calling API key";
3006
3112
  description: "Returns only the organization associated with the authenticated organization API key. Requires the organization:read scope; the organization cannot be selected in the request.";
@@ -3815,13 +3921,13 @@ declare const routes$4: {
3815
3921
  path: "/provisioning/teams/:teamId/usage";
3816
3922
  };
3817
3923
  };
3818
- type ProvisionTeamInput = Body<typeof routes$4.provisionTeam>;
3819
- type ProvisionTeamResponse = Ok<typeof routes$4.provisionTeam>;
3820
- type ProvisionedTeam = Ok<typeof routes$4.getTeam>;
3821
- type UpdateProvisionedTeamInput = Body<typeof routes$4.updateTeam>;
3822
- type CreateTeamKeyInput = Body<typeof routes$4.createTeamKey>;
3823
- type CreatedTeamKey = Ok<typeof routes$4.createTeamKey>;
3824
- type ProvisionedTeamUsage = Ok<typeof routes$4.getTeamUsage>;
3924
+ type ProvisionTeamInput = Body<typeof routes$6.provisionTeam>;
3925
+ type ProvisionTeamResponse = Ok<typeof routes$6.provisionTeam>;
3926
+ type ProvisionedTeam = Ok<typeof routes$6.getTeam>;
3927
+ type UpdateProvisionedTeamInput = Body<typeof routes$6.updateTeam>;
3928
+ type CreateTeamKeyInput = Body<typeof routes$6.createTeamKey>;
3929
+ type CreatedTeamKey = Ok<typeof routes$6.createTeamKey>;
3930
+ type ProvisionedTeamUsage = Ok<typeof routes$6.getTeamUsage>;
3825
3931
  /**
3826
3932
  * One SendLit team per tenant of a multi-tenant platform. Requires an
3827
3933
  * organization key (`sl_org_live_…`) with the scope noted on each method.
@@ -3852,7 +3958,7 @@ declare class Provisioning {
3852
3958
  getTeamUsage(teamId: string): Promise<ProvisionedTeamUsage>;
3853
3959
  }
3854
3960
 
3855
- declare const routes$3: {
3961
+ declare const routes$5: {
3856
3962
  create: {
3857
3963
  summary: "Create a saved segment";
3858
3964
  metadata: {
@@ -5116,9 +5222,9 @@ declare const routes$3: {
5116
5222
  path: "/segments/:segmentId";
5117
5223
  };
5118
5224
  };
5119
- type Segment = Ok<typeof routes$3.get>;
5120
- type CreateSegmentInput = Body<typeof routes$3.create>;
5121
- type UpdateSegmentInput = Body<typeof routes$3.update>;
5225
+ type Segment = Ok<typeof routes$5.get>;
5226
+ type CreateSegmentInput = Body<typeof routes$5.create>;
5227
+ type UpdateSegmentInput = Body<typeof routes$5.update>;
5122
5228
  declare class Segments {
5123
5229
  private readonly http;
5124
5230
  constructor(http: HttpClient);
@@ -5129,7 +5235,7 @@ declare class Segments {
5129
5235
  remove(segmentId: string): Promise<void>;
5130
5236
  }
5131
5237
 
5132
- declare const routes$2: {
5238
+ declare const routes$4: {
5133
5239
  create: {
5134
5240
  summary: "Create a broadcast or a sequence";
5135
5241
  description: "templateId must identify a marketing team template or marketing system starter. Transactional templates return 422 template_not_marketing.";
@@ -12272,22 +12378,24 @@ declare const routes$2: {
12272
12378
  };
12273
12379
  /** A broadcast or a sequence — they share one resource, told apart by
12274
12380
  * `type`. */
12275
- type Sequence = Ok<typeof routes$2.get>;
12276
- type SequenceStats = Ok<typeof routes$2.stats>;
12277
- type CreateSequenceInput = Body<typeof routes$2.create>;
12278
- type UpdateSequenceInput = Body<typeof routes$2.update>;
12279
- type AddSequenceEmailInput = Body<typeof routes$2.addEmail>;
12280
- type UpdateSequenceEmailInput = Body<typeof routes$2.updateEmail>;
12281
- type PublishSequenceChangesInput = Body<typeof routes$2.publishChanges>;
12282
- type DiscardSequenceChangesInput = Body<typeof routes$2.discardChanges>;
12283
- type SequenceEmailVersion = Ok<typeof routes$2.emailVersions>["items"][number];
12284
- type ListSequencesQuery = Query<typeof routes$2.list>;
12285
- type ListSequenceSubscribersQuery = Query<typeof routes$2.subscribers>;
12381
+ type Sequence = Ok<typeof routes$4.get>;
12382
+ type SequenceStats = Ok<typeof routes$4.stats>;
12383
+ type CreateSequenceInput = Body<typeof routes$4.create>;
12384
+ type UpdateSequenceInput = Body<typeof routes$4.update>;
12385
+ type AddSequenceEmailInput = Body<typeof routes$4.addEmail>;
12386
+ type UpdateSequenceEmailInput = Body<typeof routes$4.updateEmail>;
12387
+ type PublishSequenceChangesInput = Body<typeof routes$4.publishChanges>;
12388
+ type DiscardSequenceChangesInput = Body<typeof routes$4.discardChanges>;
12389
+ type SequenceEmailVersion = Ok<typeof routes$4.emailVersions>["items"][number];
12390
+ type ListSequencesQuery = Query<typeof routes$4.list>;
12391
+ type ListSequenceSubscribersQuery = Query<typeof routes$4.subscribers>;
12392
+ type SendSequenceEmailTestInput = Body<typeof routes$4.sendEmailTest>;
12393
+ type SequenceEmailTestResult = Ok<typeof routes$4.sendEmailTest>;
12286
12394
  declare class Sequences {
12287
12395
  private readonly http;
12288
12396
  constructor(http: HttpClient);
12289
12397
  create(input: CreateSequenceInput): Promise<Sequence>;
12290
- list(query: ListSequencesQuery): Promise<Ok<typeof routes$2.list>>;
12398
+ list(query: ListSequencesQuery): Promise<Ok<typeof routes$4.list>>;
12291
12399
  listAll(query: Omit<ListSequencesQuery, "offset">): AsyncGenerator<Sequence, void, undefined>;
12292
12400
  get(sequenceId: string): Promise<Sequence>;
12293
12401
  update(sequenceId: string, input: UpdateSequenceInput): Promise<Sequence>;
@@ -12311,11 +12419,81 @@ declare class Sequences {
12311
12419
  start(sequenceId: string): Promise<Sequence>;
12312
12420
  pause(sequenceId: string): Promise<Sequence>;
12313
12421
  stats(sequenceId: string): Promise<SequenceStats>;
12422
+ /** Sends a test of one broadcast or sequence email, rendered like a real
12423
+ * send with a `[Test]` subject prefix. Tests count against the team's test
12424
+ * limits (429 `test_send_limit_reached` / `test_send_email_limit_reached`). */
12425
+ sendEmailTest(sequenceId: string, emailId: string, input: SendSequenceEmailTestInput): Promise<SequenceEmailTestResult>;
12314
12426
  /** IDs of contacts that have received this broadcast or sequence. */
12315
12427
  subscribers(sequenceId: string, query?: ListSequenceSubscribersQuery): Promise<string[]>;
12316
12428
  }
12317
12429
 
12318
- declare const routes$1: {
12430
+ declare const routes$3: {
12431
+ get: {
12432
+ summary: "Get the team's general settings";
12433
+ description: "Returns defaults (all-null fields) when nothing has been saved yet.";
12434
+ metadata: {
12435
+ tag: string;
12436
+ };
12437
+ method: "GET";
12438
+ responses: {
12439
+ 200: zod.ZodObject<{
12440
+ mailingAddress: zod.ZodNullable<zod.ZodString>;
12441
+ updatedAt: zod.ZodOptional<zod.ZodNullable<zod.ZodString>>;
12442
+ }, "strip", zod.ZodTypeAny, {
12443
+ mailingAddress: string | null;
12444
+ updatedAt?: string | null | undefined;
12445
+ }, {
12446
+ mailingAddress: string | null;
12447
+ updatedAt?: string | null | undefined;
12448
+ }>;
12449
+ };
12450
+ path: "/settings/general";
12451
+ };
12452
+ update: {
12453
+ summary: "Update the team's general settings";
12454
+ description: "Omitted fields are left unchanged; send an empty string to clear a field.";
12455
+ metadata: {
12456
+ tag: string;
12457
+ };
12458
+ method: "PUT";
12459
+ body: zod.ZodObject<{
12460
+ mailingAddress: zod.ZodOptional<zod.ZodString>;
12461
+ }, "strip", zod.ZodTypeAny, {
12462
+ mailingAddress?: string | undefined;
12463
+ }, {
12464
+ mailingAddress?: string | undefined;
12465
+ }>;
12466
+ responses: {
12467
+ 200: zod.ZodObject<{
12468
+ mailingAddress: zod.ZodNullable<zod.ZodString>;
12469
+ updatedAt: zod.ZodOptional<zod.ZodNullable<zod.ZodString>>;
12470
+ }, "strip", zod.ZodTypeAny, {
12471
+ mailingAddress: string | null;
12472
+ updatedAt?: string | null | undefined;
12473
+ }, {
12474
+ mailingAddress: string | null;
12475
+ updatedAt?: string | null | undefined;
12476
+ }>;
12477
+ };
12478
+ path: "/settings/general";
12479
+ };
12480
+ };
12481
+ /** The team's general settings, such as the mailing address that broadcasts
12482
+ * and sequences need before they can send. */
12483
+ type GeneralSettings = Ok<typeof routes$3.get>;
12484
+ type UpdateGeneralSettingsInput = Body<typeof routes$3.update>;
12485
+ declare class GeneralSettingsResource {
12486
+ private readonly http;
12487
+ constructor(http: HttpClient);
12488
+ get(): Promise<GeneralSettings>;
12489
+ update(input: UpdateGeneralSettingsInput): Promise<GeneralSettings>;
12490
+ }
12491
+ declare class Settings {
12492
+ readonly general: GeneralSettingsResource;
12493
+ constructor(http: HttpClient);
12494
+ }
12495
+
12496
+ declare const routes$2: {
12319
12497
  list: {
12320
12498
  query: zod.ZodObject<{
12321
12499
  active: zod.ZodOptional<zod.ZodBoolean>;
@@ -12559,14 +12737,14 @@ declare const routes$1: {
12559
12737
  path: "/suppressions/:suppressionId/release";
12560
12738
  };
12561
12739
  };
12562
- type Suppression = Ok<typeof routes$1.get>;
12563
- type ListSuppressionsQuery = Query<typeof routes$1.list>;
12564
- type ReleaseSuppressionInput = Body<typeof routes$1.release>;
12740
+ type Suppression = Ok<typeof routes$2.get>;
12741
+ type ListSuppressionsQuery = Query<typeof routes$2.list>;
12742
+ type ReleaseSuppressionInput = Body<typeof routes$2.release>;
12565
12743
  /** The team's do-not-send list. */
12566
12744
  declare class Suppressions {
12567
12745
  private readonly http;
12568
12746
  constructor(http: HttpClient);
12569
- list(query?: ListSuppressionsQuery): Promise<Ok<typeof routes$1.list>>;
12747
+ list(query?: ListSuppressionsQuery): Promise<Ok<typeof routes$2.list>>;
12570
12748
  listAll(query?: Omit<ListSuppressionsQuery, "offset">): AsyncGenerator<Suppression, void, undefined>;
12571
12749
  get(suppressionId: string): Promise<Suppression>;
12572
12750
  /** Complaint suppressions can't be released (409
@@ -12574,6 +12752,350 @@ declare class Suppressions {
12574
12752
  release(suppressionId: string, input?: ReleaseSuppressionInput): Promise<Suppression>;
12575
12753
  }
12576
12754
 
12755
+ declare const routes$1: {
12756
+ list: {
12757
+ summary: "List tags";
12758
+ description: "Returns every tag carried by at least one of the team's contacts, sorted by name, with the number of contacts that carry it.";
12759
+ metadata: {
12760
+ tag: string;
12761
+ };
12762
+ method: "GET";
12763
+ responses: {
12764
+ 200: zod.ZodObject<{
12765
+ items: zod.ZodArray<zod.ZodObject<{
12766
+ tag: zod.ZodString;
12767
+ contactCount: zod.ZodNumber;
12768
+ }, "strip", zod.ZodTypeAny, {
12769
+ tag: string;
12770
+ contactCount: number;
12771
+ }, {
12772
+ tag: string;
12773
+ contactCount: number;
12774
+ }>, "many">;
12775
+ }, "strip", zod.ZodTypeAny, {
12776
+ items: {
12777
+ tag: string;
12778
+ contactCount: number;
12779
+ }[];
12780
+ }, {
12781
+ items: {
12782
+ tag: string;
12783
+ contactCount: number;
12784
+ }[];
12785
+ }>;
12786
+ };
12787
+ path: "/tags";
12788
+ };
12789
+ references: {
12790
+ summary: "List where a tag is used";
12791
+ description: "Returns how many contacts carry the tag and the segments, broadcasts, sequences (audience filters, tag triggers, email tag actions) and signup forms that name it. Call it before deleting a tag.";
12792
+ metadata: {
12793
+ tag: string;
12794
+ };
12795
+ method: "GET";
12796
+ responses: {
12797
+ 200: zod.ZodObject<{
12798
+ tag: zod.ZodString;
12799
+ contactCount: zod.ZodNumber;
12800
+ segments: zod.ZodArray<zod.ZodObject<{
12801
+ segmentId: zod.ZodString;
12802
+ name: zod.ZodString;
12803
+ }, "strip", zod.ZodTypeAny, {
12804
+ name: string;
12805
+ segmentId: string;
12806
+ }, {
12807
+ name: string;
12808
+ segmentId: string;
12809
+ }>, "many">;
12810
+ sequences: zod.ZodArray<zod.ZodObject<{
12811
+ sequenceId: zod.ZodString;
12812
+ title: zod.ZodString;
12813
+ type: zod.ZodEnum<["broadcast", "sequence"]>;
12814
+ status: zod.ZodString;
12815
+ usages: zod.ZodArray<zod.ZodEnum<["filter", "exclude_filter", "trigger", "email_action"]>, "many">;
12816
+ }, "strip", zod.ZodTypeAny, {
12817
+ type: "broadcast" | "sequence";
12818
+ status: string;
12819
+ sequenceId: string;
12820
+ title: string;
12821
+ usages: ("filter" | "exclude_filter" | "trigger" | "email_action")[];
12822
+ }, {
12823
+ type: "broadcast" | "sequence";
12824
+ status: string;
12825
+ sequenceId: string;
12826
+ title: string;
12827
+ usages: ("filter" | "exclude_filter" | "trigger" | "email_action")[];
12828
+ }>, "many">;
12829
+ signupForms: zod.ZodArray<zod.ZodObject<{
12830
+ formId: zod.ZodString;
12831
+ name: zod.ZodString;
12832
+ }, "strip", zod.ZodTypeAny, {
12833
+ name: string;
12834
+ formId: string;
12835
+ }, {
12836
+ name: string;
12837
+ formId: string;
12838
+ }>, "many">;
12839
+ }, "strip", zod.ZodTypeAny, {
12840
+ tag: string;
12841
+ contactCount: number;
12842
+ segments: {
12843
+ name: string;
12844
+ segmentId: string;
12845
+ }[];
12846
+ sequences: {
12847
+ type: "broadcast" | "sequence";
12848
+ status: string;
12849
+ sequenceId: string;
12850
+ title: string;
12851
+ usages: ("filter" | "exclude_filter" | "trigger" | "email_action")[];
12852
+ }[];
12853
+ signupForms: {
12854
+ name: string;
12855
+ formId: string;
12856
+ }[];
12857
+ }, {
12858
+ tag: string;
12859
+ contactCount: number;
12860
+ segments: {
12861
+ name: string;
12862
+ segmentId: string;
12863
+ }[];
12864
+ sequences: {
12865
+ type: "broadcast" | "sequence";
12866
+ status: string;
12867
+ sequenceId: string;
12868
+ title: string;
12869
+ usages: ("filter" | "exclude_filter" | "trigger" | "email_action")[];
12870
+ }[];
12871
+ signupForms: {
12872
+ name: string;
12873
+ formId: string;
12874
+ }[];
12875
+ }>;
12876
+ };
12877
+ path: "/tags/:tag/references";
12878
+ };
12879
+ rename: {
12880
+ summary: "Rename a tag";
12881
+ description: "Renames the tag on every contact, and in segments, broadcast and sequence filters and tag triggers, sequence email tag actions and signup forms. Renaming to a tag that already exists merges the two. Sent broadcasts keep their original filters. Renaming doesn't trigger tag-added or tag-removed sequences. 404 `tag_not_found` when nothing uses the tag; 400 `tag_unchanged` when the new name is the same.";
12882
+ metadata: {
12883
+ tag: string;
12884
+ };
12885
+ method: "PATCH";
12886
+ body: zod.ZodObject<{
12887
+ name: zod.ZodString;
12888
+ }, "strip", zod.ZodTypeAny, {
12889
+ name: string;
12890
+ }, {
12891
+ name: string;
12892
+ }>;
12893
+ responses: {
12894
+ 200: zod.ZodObject<{
12895
+ tag: zod.ZodString;
12896
+ previousTag: zod.ZodString;
12897
+ contactsUpdated: zod.ZodNumber;
12898
+ segmentsUpdated: zod.ZodNumber;
12899
+ sequencesUpdated: zod.ZodNumber;
12900
+ signupFormsUpdated: zod.ZodNumber;
12901
+ }, "strip", zod.ZodTypeAny, {
12902
+ tag: string;
12903
+ previousTag: string;
12904
+ contactsUpdated: number;
12905
+ segmentsUpdated: number;
12906
+ sequencesUpdated: number;
12907
+ signupFormsUpdated: number;
12908
+ }, {
12909
+ tag: string;
12910
+ previousTag: string;
12911
+ contactsUpdated: number;
12912
+ segmentsUpdated: number;
12913
+ sequencesUpdated: number;
12914
+ signupFormsUpdated: number;
12915
+ }>;
12916
+ 400: zod.ZodObject<{
12917
+ error: zod.ZodString;
12918
+ }, "strip", zod.ZodTypeAny, {
12919
+ error: string;
12920
+ }, {
12921
+ error: string;
12922
+ }>;
12923
+ 404: zod.ZodObject<{
12924
+ error: zod.ZodString;
12925
+ }, "strip", zod.ZodTypeAny, {
12926
+ error: string;
12927
+ }, {
12928
+ error: string;
12929
+ }>;
12930
+ };
12931
+ path: "/tags/:tag";
12932
+ };
12933
+ remove: {
12934
+ summary: "Delete a tag from every contact";
12935
+ description: "Removes the tag from every contact of the team. Segments, filters, triggers, email actions and signup forms that name the tag are left as they are and returned in `references`: a filter on a deleted tag matches nobody, and a trigger or form can add it again. Check `GET /tags/:tag/references` first. Deleting doesn't trigger tag-removed sequences. 404 `tag_not_found` when nothing uses the tag.";
12936
+ metadata: {
12937
+ tag: string;
12938
+ };
12939
+ method: "DELETE";
12940
+ body: typeof _ts_rest_core.ContractNoBody;
12941
+ responses: {
12942
+ 200: zod.ZodObject<{
12943
+ tag: zod.ZodString;
12944
+ contactsUpdated: zod.ZodNumber;
12945
+ references: zod.ZodObject<{
12946
+ tag: zod.ZodString;
12947
+ contactCount: zod.ZodNumber;
12948
+ segments: zod.ZodArray<zod.ZodObject<{
12949
+ segmentId: zod.ZodString;
12950
+ name: zod.ZodString;
12951
+ }, "strip", zod.ZodTypeAny, {
12952
+ name: string;
12953
+ segmentId: string;
12954
+ }, {
12955
+ name: string;
12956
+ segmentId: string;
12957
+ }>, "many">;
12958
+ sequences: zod.ZodArray<zod.ZodObject<{
12959
+ sequenceId: zod.ZodString;
12960
+ title: zod.ZodString;
12961
+ type: zod.ZodEnum<["broadcast", "sequence"]>;
12962
+ status: zod.ZodString;
12963
+ usages: zod.ZodArray<zod.ZodEnum<["filter", "exclude_filter", "trigger", "email_action"]>, "many">;
12964
+ }, "strip", zod.ZodTypeAny, {
12965
+ type: "broadcast" | "sequence";
12966
+ status: string;
12967
+ sequenceId: string;
12968
+ title: string;
12969
+ usages: ("filter" | "exclude_filter" | "trigger" | "email_action")[];
12970
+ }, {
12971
+ type: "broadcast" | "sequence";
12972
+ status: string;
12973
+ sequenceId: string;
12974
+ title: string;
12975
+ usages: ("filter" | "exclude_filter" | "trigger" | "email_action")[];
12976
+ }>, "many">;
12977
+ signupForms: zod.ZodArray<zod.ZodObject<{
12978
+ formId: zod.ZodString;
12979
+ name: zod.ZodString;
12980
+ }, "strip", zod.ZodTypeAny, {
12981
+ name: string;
12982
+ formId: string;
12983
+ }, {
12984
+ name: string;
12985
+ formId: string;
12986
+ }>, "many">;
12987
+ }, "strip", zod.ZodTypeAny, {
12988
+ tag: string;
12989
+ contactCount: number;
12990
+ segments: {
12991
+ name: string;
12992
+ segmentId: string;
12993
+ }[];
12994
+ sequences: {
12995
+ type: "broadcast" | "sequence";
12996
+ status: string;
12997
+ sequenceId: string;
12998
+ title: string;
12999
+ usages: ("filter" | "exclude_filter" | "trigger" | "email_action")[];
13000
+ }[];
13001
+ signupForms: {
13002
+ name: string;
13003
+ formId: string;
13004
+ }[];
13005
+ }, {
13006
+ tag: string;
13007
+ contactCount: number;
13008
+ segments: {
13009
+ name: string;
13010
+ segmentId: string;
13011
+ }[];
13012
+ sequences: {
13013
+ type: "broadcast" | "sequence";
13014
+ status: string;
13015
+ sequenceId: string;
13016
+ title: string;
13017
+ usages: ("filter" | "exclude_filter" | "trigger" | "email_action")[];
13018
+ }[];
13019
+ signupForms: {
13020
+ name: string;
13021
+ formId: string;
13022
+ }[];
13023
+ }>;
13024
+ }, "strip", zod.ZodTypeAny, {
13025
+ tag: string;
13026
+ contactsUpdated: number;
13027
+ references: {
13028
+ tag: string;
13029
+ contactCount: number;
13030
+ segments: {
13031
+ name: string;
13032
+ segmentId: string;
13033
+ }[];
13034
+ sequences: {
13035
+ type: "broadcast" | "sequence";
13036
+ status: string;
13037
+ sequenceId: string;
13038
+ title: string;
13039
+ usages: ("filter" | "exclude_filter" | "trigger" | "email_action")[];
13040
+ }[];
13041
+ signupForms: {
13042
+ name: string;
13043
+ formId: string;
13044
+ }[];
13045
+ };
13046
+ }, {
13047
+ tag: string;
13048
+ contactsUpdated: number;
13049
+ references: {
13050
+ tag: string;
13051
+ contactCount: number;
13052
+ segments: {
13053
+ name: string;
13054
+ segmentId: string;
13055
+ }[];
13056
+ sequences: {
13057
+ type: "broadcast" | "sequence";
13058
+ status: string;
13059
+ sequenceId: string;
13060
+ title: string;
13061
+ usages: ("filter" | "exclude_filter" | "trigger" | "email_action")[];
13062
+ }[];
13063
+ signupForms: {
13064
+ name: string;
13065
+ formId: string;
13066
+ }[];
13067
+ };
13068
+ }>;
13069
+ 404: zod.ZodObject<{
13070
+ error: zod.ZodString;
13071
+ }, "strip", zod.ZodTypeAny, {
13072
+ error: string;
13073
+ }, {
13074
+ error: string;
13075
+ }>;
13076
+ };
13077
+ path: "/tags/:tag";
13078
+ };
13079
+ };
13080
+ /** A tag in use in the team, with how many contacts carry it. */
13081
+ type Tag = Ok<typeof routes$1.list>["items"][number];
13082
+ /** Where a tag is still used (segments, sequence triggers, ...), so it can be
13083
+ * shown before the tag is renamed or deleted. */
13084
+ type TagReferences = Ok<typeof routes$1.references>;
13085
+ type RenameTagInput = Body<typeof routes$1.rename>;
13086
+ type RenameTagResult = Ok<typeof routes$1.rename>;
13087
+ type RemoveTagResult = Ok<typeof routes$1.remove>;
13088
+ declare class Tags {
13089
+ private readonly http;
13090
+ constructor(http: HttpClient);
13091
+ list(): Promise<Ok<typeof routes$1.list>>;
13092
+ references(tag: string): Promise<TagReferences>;
13093
+ /** Renames a tag on every contact and everywhere it's referenced. */
13094
+ rename(tag: string, input: RenameTagInput): Promise<RenameTagResult>;
13095
+ /** Removes a tag from every contact. */
13096
+ remove(tag: string): Promise<RemoveTagResult>;
13097
+ }
13098
+
12577
13099
  declare const routes: {
12578
13100
  listSystem: {
12579
13101
  query: zod.ZodObject<{
@@ -15809,6 +16331,12 @@ declare class SendLit {
15809
16331
  readonly provisioning: Provisioning;
15810
16332
  readonly suppressions: Suppressions;
15811
16333
  readonly deliveryEvents: DeliveryEvents;
16334
+ /** Tags across the team's contacts: list, rename and delete them. */
16335
+ readonly tags: Tags;
16336
+ /** Team settings, such as the mailing address. */
16337
+ readonly settings: Settings;
16338
+ /** The team's dashboard numbers. */
16339
+ readonly overview: OverviewResource;
15812
16340
  constructor(options?: SendLitOptions);
15813
16341
  }
15814
16342
 
@@ -15835,4 +16363,4 @@ declare class SendLitError extends Error {
15835
16363
  static fromResponse(status: number, body: unknown, headers?: Headers): SendLitError;
15836
16364
  }
15837
16365
 
15838
- export { AddSequenceEmailInput, Contact, ContactDelivery, ContactEvent, Contacts, CreateContactInput, CreateEventDefinitionInput, CreateSegmentInput, CreateSequenceInput, CreateTeamKeyInput, CreateTemplateInput, CreatedTeamKey, DEFAULT_ENDPOINT, DeliveryEvent, DeliveryEvents, DiscardSequenceChangesInput, DuplicateTemplateInput, EmailTemplate, Emails, EventDefinition, EventDefinitionDetail, EventDefinitions, Events, ListContactEventsQuery, ListContactsQuery, ListDeliveryEventsQuery, ListEmailsQuery, ListSequenceSubscribersQuery, ListSequencesQuery, ListSuppressionsQuery, ListTemplatesQuery, ProvisionTeamInput, ProvisionTeamResponse, ProvisionedTeam, ProvisionedTeamUsage, Provisioning, PublishSequenceChangesInput, ReleaseSuppressionInput, Segment, Segments, SendEmailInput, SendEmailResponse, SendLit, SendLitError, SendLitOptions, Sequence, SequenceEmailVersion, SequenceStats, Sequences, Suppression, Suppressions, SystemTemplate, Templates, TrackEventInput, TrackEventResponse, TransactionalEmail, TransactionalEmailDetail, UpdateContactInput, UpdateEventDefinitionInput, UpdateProvisionedTeamInput, UpdateSegmentInput, UpdateSequenceEmailInput, UpdateSequenceInput, UpdateTemplateInput };
16366
+ export { AddSequenceEmailInput, Contact, ContactDelivery, ContactEvent, Contacts, CreateContactInput, CreateEventDefinitionInput, CreateSegmentInput, CreateSequenceInput, CreateTeamKeyInput, CreateTemplateInput, CreatedTeamKey, DEFAULT_ENDPOINT, DeliveryEvent, DeliveryEvents, DiscardSequenceChangesInput, DuplicateTemplateInput, EmailTemplate, Emails, EventDefinition, EventDefinitionDetail, EventDefinitions, Events, GeneralSettings, GeneralSettingsResource, ListContactEventsQuery, ListContactsQuery, ListDeliveryEventsQuery, ListEmailsQuery, ListSequenceSubscribersQuery, ListSequencesQuery, ListSuppressionsQuery, ListTemplatesQuery, Overview, OverviewQuery, OverviewResource, ProvisionTeamInput, ProvisionTeamResponse, ProvisionedTeam, ProvisionedTeamUsage, Provisioning, PublishSequenceChangesInput, ReleaseSuppressionInput, RemoveTagResult, RenameTagInput, RenameTagResult, Segment, Segments, SendEmailInput, SendEmailResponse, SendLit, SendLitError, SendLitOptions, SendSequenceEmailTestInput, Sequence, SequenceEmailTestResult, SequenceEmailVersion, SequenceStats, Sequences, Settings, Suppression, Suppressions, SystemTemplate, Tag, TagReferences, Tags, Templates, TrackEventInput, TrackEventResponse, TransactionalEmail, TransactionalEmailDetail, UpdateContactInput, UpdateEventDefinitionInput, UpdateGeneralSettingsInput, UpdateProvisionedTeamInput, UpdateSegmentInput, UpdateSequenceEmailInput, UpdateSequenceInput, UpdateTemplateInput };