@itm-studio/partner-sdk 0.2.9 → 0.3.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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@itm-studio/partner-sdk",
3
- "version": "0.2.9",
3
+ "version": "0.3.0",
4
4
  "description": "TypeScript SDK for the ITM Partner API — typed GraphQL client with zero introspection required",
5
5
  "main": "dist/index.js",
6
6
  "module": "dist/index.mjs",
@@ -9,6 +9,49 @@ scalar JSON
9
9
 
10
10
  # ─── Enums ───────────────────────────────────────────────────────────────────
11
11
 
12
+ enum ConsentStatus {
13
+ NEVER_SUBSCRIBED
14
+ SUBSCRIBED
15
+ UNSUBSCRIBED
16
+ }
17
+
18
+ enum UserSource {
19
+ BRAND
20
+ DICE
21
+ ITM
22
+ }
23
+
24
+ enum SortDirection {
25
+ ASC
26
+ DESC
27
+ }
28
+
29
+ enum BrandAgentEmailSendBatchStatus {
30
+ PENDING
31
+ SENDING
32
+ SENT
33
+ PARTIAL
34
+ FAILED
35
+ UNKNOWN
36
+ }
37
+
38
+ enum BrandAgentEmailSendMessageStatus {
39
+ PENDING
40
+ SENDING
41
+ SENT
42
+ FAILED
43
+ UNKNOWN
44
+ }
45
+
46
+ enum PartnerAudienceSortField {
47
+ CITY
48
+ CREATED_AT
49
+ NAME
50
+ NUM_MOMENTS
51
+ TOTAL_SPEND_USD
52
+ UPDATED_AT
53
+ }
54
+
12
55
  enum MomentStatus {
13
56
  UPCOMING
14
57
  LIVE
@@ -497,8 +540,35 @@ type PartnerCustomer {
497
540
  tickets: [Ticket!]!
498
541
  }
499
542
 
543
+ type PartnerAudienceCustomer {
544
+ uid: String!
545
+ name: String
546
+ email: String
547
+ emailVerified: Boolean!
548
+ phoneNumber: String
549
+ city: String
550
+ country: String
551
+ source: UserSource!
552
+ isSubscribed: Boolean!
553
+ emailConsentStatus: ConsentStatus!
554
+ smsConsentStatus: ConsentStatus!
555
+ communicationsOptedOut: Boolean!
556
+ isSuppressed: Boolean!
557
+ totalSpendUsdCents: Int!
558
+ numMoments: Int!
559
+ numProducts: Int!
560
+ numEchoes: Int!
561
+ createdAt: DateTime!
562
+ updatedAt: DateTime!
563
+ }
564
+
500
565
  type PartnerMomentStats {
566
+ generatedAt: DateTime!
501
567
  ticketsCount: Int!
568
+ """Confirmed tickets whose materialized price is greater than zero."""
569
+ paidTicketsCount: Int!
570
+ """Confirmed tickets whose materialized price is zero."""
571
+ freeTicketsCount: Int!
502
572
  waitlistCount: Int!
503
573
  externalRsvpCount: Int!
504
574
  ticketRsvpRequestsCount: Int!
@@ -718,6 +788,13 @@ type GetPartnerCustomersResponse {
718
788
  nextCursor: String
719
789
  }
720
790
 
791
+ type GetPartnerAudienceResponse {
792
+ customers: [PartnerAudienceCustomer!]!
793
+ hasNextPage: Boolean!
794
+ nextCursor: String
795
+ totalCount: Int
796
+ }
797
+
721
798
  type GetBrandEchoesForUserResponse {
722
799
  echoes: [Echo!]!
723
800
  totalCount: Int!
@@ -944,20 +1021,110 @@ type MomentLineupResponseResult {
944
1021
  }
945
1022
 
946
1023
  input PartnerMomentsFiltersInput {
1024
+ """
1025
+ Case-insensitive search over moment name and slug. Whitespace-only values are ignored.
1026
+ """
1027
+ search: String
1028
+
947
1029
  """
948
1030
  When true, includes private moments owned by the authenticated brand. Default: false.
949
1031
  """
950
1032
  includePrivate: Boolean
951
1033
  }
952
1034
 
1035
+ input PartnerAudienceFiltersInput {
1036
+ customerUids: [String!]
1037
+ search: String
1038
+ hasEmail: Boolean
1039
+ hasPhone: Boolean
1040
+ isSubscribed: Boolean
1041
+ emailConsentStatuses: [ConsentStatus!]
1042
+ smsConsentStatuses: [ConsentStatus!]
1043
+ communicationsOptedOut: Boolean
1044
+ isSuppressed: Boolean
1045
+ sources: [UserSource!]
1046
+ cities: [String!]
1047
+ countries: [String!]
1048
+ createdAtFrom: DateTime
1049
+ createdAtBefore: DateTime
1050
+ updatedAtFrom: DateTime
1051
+ updatedAtBefore: DateTime
1052
+ minTotalSpendUsdCents: Int
1053
+ maxTotalSpendUsdCents: Int
1054
+ minNumMoments: Int
1055
+ maxNumMoments: Int
1056
+ momentUids: [String!]
1057
+ ticketTierUids: [String!]
1058
+ brandListUids: [String!]
1059
+ membershipTierUids: [String!]
1060
+ }
1061
+
1062
+ input PartnerAudienceSortInput {
1063
+ field: PartnerAudienceSortField!
1064
+ direction: SortDirection!
1065
+ }
1066
+
1067
+ input GetPartnerAudienceInput {
1068
+ filters: PartnerAudienceFiltersInput
1069
+ sort: PartnerAudienceSortInput
1070
+ cursor: String
1071
+ take: Int
1072
+ includeTotalCount: Boolean
1073
+ }
1074
+
953
1075
  # ─── Queries ─────────────────────────────────────────────────────────────────
954
1076
 
1077
+ type BrandAgentEmailSendMessage {
1078
+ uid: String!
1079
+ position: Int!
1080
+ recipient: String!
1081
+ subject: String!
1082
+ text: String!
1083
+ status: BrandAgentEmailSendMessageStatus!
1084
+ agentMailMessageId: String
1085
+ agentMailThreadId: String
1086
+ sentAt: DateTime
1087
+ failedAt: DateTime
1088
+ lastErrorCode: String
1089
+ lastErrorMessage: String
1090
+ }
1091
+
1092
+ type BrandAgentEmailSendBatch {
1093
+ uid: String!
1094
+ createdAt: DateTime!
1095
+ status: BrandAgentEmailSendBatchStatus!
1096
+ senderEmailAddress: String!
1097
+ acceptedCount: Int!
1098
+ messages: [BrandAgentEmailSendMessage!]!
1099
+ }
1100
+
1101
+ type AgentThreadSeedContext {
1102
+ """
1103
+ Rendered prior-conversation transcript to seed a fresh agent session with,
1104
+ or null when the thread has no renderable history.
1105
+ """
1106
+ seed: String
1107
+ includedMessages: Int!
1108
+ totalMessages: Int!
1109
+ truncated: Boolean!
1110
+ }
1111
+
955
1112
  type Query {
956
1113
  """
957
1114
  Get details for the brand associated with the partner token.
958
1115
  """
959
1116
  getPartnerBrand: PartnerBrand!
960
1117
 
1118
+ """Retrieve one AgentMail send batch owned by the authenticated partner brand."""
1119
+ getPartnerAgentEmailBatch(batchUid: String!): BrandAgentEmailSendBatch!
1120
+
1121
+ """
1122
+ Seed context for restoring a conversation thread into a fresh agent
1123
+ session. Agent-access-token mode only: admin, brand, and thread scope all
1124
+ derive from the verified token claims, so the operation takes no arguments.
1125
+ """
1126
+ getAgentThreadSeed: AgentThreadSeedContext!
1127
+
961
1128
  """
962
1129
  Get paginated moments for the brand associated with the partner token.
963
1130
  """
@@ -1027,6 +1194,12 @@ type Query {
1027
1194
  take: Int
1028
1195
  ): GetPartnerCustomersResponse!
1029
1196
 
1197
+ """
1198
+ Get the authenticated brand's customer audience using an allowlisted profile,
1199
+ effective consent, and aggregate-metrics projection.
1200
+ """
1201
+ getPartnerAudience(input: GetPartnerAudienceInput): GetPartnerAudienceResponse!
1202
+
1030
1203
  """
1031
1204
  Get a moment collection by slug.
1032
1205
  Returns the collection with its moments and links.
@@ -1092,6 +1265,22 @@ input DimensionsInput {
1092
1265
  height: Float!
1093
1266
  }
1094
1267
 
1268
+ input BrandAgentEmailMessageInput {
1269
+ """One normalized recipient. Each item is sent as a separate email."""
1270
+ to: String!
1271
+ subject: String!
1272
+ text: String!
1273
+ }
1274
+
1275
+ input SendPartnerAgentEmailInput {
1276
+ """Stable business idempotency key for this logical batch."""
1277
+ idempotencyKey: String!
1278
+ """One to ten personalized, single-recipient plain-text emails."""
1279
+ messages: [BrandAgentEmailMessageInput!]!
1280
+ """Brand-agent session callers only; rejected for partner API keys"""
1281
+ toolCallId: String
1282
+ }
1283
+
1095
1284
  input VenueInput {
1096
1285
  name: String!
1097
1286
  city: String!
@@ -1156,6 +1345,10 @@ input CreatePartnerMomentInput {
1156
1345
  subcategory: MomentSubcategory
1157
1346
  """Ticket tiers to create along with the moment."""
1158
1347
  ticketTiers: [CreatePartnerTicketTierInput!]
1348
+ """Brand-agent session callers only; rejected for partner API keys"""
1349
+ idempotencyKey: String
1350
+ """Brand-agent session callers only; rejected for partner API keys"""
1351
+ toolCallId: String
1159
1352
  }
1160
1353
 
1161
1354
  input GetPartnerTicketTiersForMomentInput {
@@ -1413,6 +1606,11 @@ type Mutation {
1413
1606
  """
1414
1607
  createPartnerMoment(input: CreatePartnerMomentInput!): Moment!
1415
1608
 
1609
+ """Queue one to ten emails from the authenticated brand's AgentMail inbox."""
1610
+ sendPartnerAgentEmail(
1611
+ input: SendPartnerAgentEmailInput!
1612
+ ): BrandAgentEmailSendBatch!
1613
+
1416
1614
  """
1417
1615
  Bulk edit partner-owned ticket tiers for a moment.
1418
1616
  Supports per-tier price, facility-fee, and supply updates.