@itm-studio/partner-sdk 0.2.10 → 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/README.md +114 -0
- package/dist/index.d.mts +248 -3
- package/dist/index.d.ts +248 -3
- package/dist/index.js +998 -680
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +998 -681
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
- package/schema/partner.graphql +129 -4
package/README.md
CHANGED
|
@@ -103,6 +103,71 @@ export function createITMClientForRequest(request: Request) {
|
|
|
103
103
|
|
|
104
104
|
If you also send `input.compliance`, the backend keeps the values you provide and backfills missing `ipAddress` and `userAgent` from the forwarded headers when available.
|
|
105
105
|
|
|
106
|
+
### Brand Agent session authentication (first-party only)
|
|
107
|
+
|
|
108
|
+
First-party ITM agents authenticate with a short-lived Brand Agent session
|
|
109
|
+
instead of a partner API token. This mode is not available to external
|
|
110
|
+
integrators: it requires workload identity (e.g. a Vercel OIDC token) trusted
|
|
111
|
+
by the ITM backend and a backend-registered agent session, and only the
|
|
112
|
+
capability-scoped operations granted to the session (`CREATE_MOMENT`,
|
|
113
|
+
`SEND_EMAIL`, `READ_MOMENT_ANALYTICS`) will authorize. Everything else stays
|
|
114
|
+
partner-token-only, and a request carrying both a partner API key and an
|
|
115
|
+
agent session is rejected as ambiguous.
|
|
116
|
+
|
|
117
|
+
```typescript
|
|
118
|
+
import { createITMPartnerClient } from "@itm-studio/partner-sdk";
|
|
119
|
+
|
|
120
|
+
const itm = createITMPartnerClient({
|
|
121
|
+
agentSession: {
|
|
122
|
+
// Minted fresh for every request; never cached or persisted.
|
|
123
|
+
workloadToken: () => getWorkloadOidcToken(),
|
|
124
|
+
sessionUid,
|
|
125
|
+
bootstrapToken, // optional one-time session bootstrap
|
|
126
|
+
},
|
|
127
|
+
});
|
|
128
|
+
```
|
|
129
|
+
|
|
130
|
+
The brand is always derived server-side from the session — this mode never
|
|
131
|
+
carries a brand identifier or a partner API key. Agent-session mutations must
|
|
132
|
+
supply `toolCallId` on their inputs, plus `idempotencyKey` where it is not
|
|
133
|
+
already required (`CreatePartnerMomentInput`; `SendPartnerAgentEmailInput`
|
|
134
|
+
requires `idempotencyKey` for every caller). Partner-token callers must omit
|
|
135
|
+
the agent-only fields (`toolCallId`, and `idempotencyKey` on
|
|
136
|
+
`CreatePartnerMomentInput`).
|
|
137
|
+
|
|
138
|
+
### Brand Agent access-token authentication (first-party only)
|
|
139
|
+
|
|
140
|
+
A third mode exists for the one moment in the session lifecycle when no agent
|
|
141
|
+
session exists yet: fetching a conversation thread's seed context while a new
|
|
142
|
+
session is being created. It authenticates with workload identity plus the
|
|
143
|
+
short-lived agent access token the caller presented, and it authorizes only
|
|
144
|
+
the operations guarded for it (currently `getAgentThreadSeed`, which takes no
|
|
145
|
+
arguments — the admin, brand, and thread scope all come from the token's
|
|
146
|
+
verified claims).
|
|
147
|
+
|
|
148
|
+
```typescript
|
|
149
|
+
const itm = createITMPartnerClient({
|
|
150
|
+
agentAccess: {
|
|
151
|
+
// Minted fresh for every request; never cached or persisted.
|
|
152
|
+
workloadToken: () => getWorkloadOidcToken(),
|
|
153
|
+
// The raw bearer from the inbound session-create request.
|
|
154
|
+
accessToken,
|
|
155
|
+
},
|
|
156
|
+
});
|
|
157
|
+
|
|
158
|
+
const { getAgentThreadSeed } = await itm.query({
|
|
159
|
+
getAgentThreadSeed: {
|
|
160
|
+
seed: true,
|
|
161
|
+
includedMessages: true,
|
|
162
|
+
totalMessages: true,
|
|
163
|
+
truncated: true,
|
|
164
|
+
},
|
|
165
|
+
});
|
|
166
|
+
```
|
|
167
|
+
|
|
168
|
+
Exactly one of `token`, `agentSession`, or `agentAccess` must be provided;
|
|
169
|
+
combining modes is rejected.
|
|
170
|
+
|
|
106
171
|
## Money Amounts
|
|
107
172
|
|
|
108
173
|
Dynamic-pricing price values use the currency's integer minor unit: cents for
|
|
@@ -676,6 +741,55 @@ const { getPartnerCustomersForMoment } = await itm.query({
|
|
|
676
741
|
});
|
|
677
742
|
```
|
|
678
743
|
|
|
744
|
+
### `getPartnerAudience`
|
|
745
|
+
|
|
746
|
+
Get the authenticated brand's customer audience with explicit filters, one
|
|
747
|
+
deterministic sort, and opaque cursor pagination. Call this only from a trusted
|
|
748
|
+
Node.js server: the partner token and returned customer data must never be
|
|
749
|
+
embedded in a browser/mobile bundle or written to application logs.
|
|
750
|
+
|
|
751
|
+
```typescript
|
|
752
|
+
const { getPartnerAudience } = await itm.query({
|
|
753
|
+
getPartnerAudience: {
|
|
754
|
+
__args: {
|
|
755
|
+
input: {
|
|
756
|
+
filters: {
|
|
757
|
+
search: "john@example.com",
|
|
758
|
+
emailConsentStatuses: ["SUBSCRIBED"],
|
|
759
|
+
momentUids: ["moment-uid"],
|
|
760
|
+
minTotalSpendUsdCents: 5000,
|
|
761
|
+
},
|
|
762
|
+
sort: { field: "TOTAL_SPEND_USD", direction: "DESC" },
|
|
763
|
+
take: 50, // maximum 100
|
|
764
|
+
includeTotalCount: true, // omitted by default to avoid the count query
|
|
765
|
+
},
|
|
766
|
+
},
|
|
767
|
+
customers: {
|
|
768
|
+
uid: true, // brand-scoped customer UID
|
|
769
|
+
name: true,
|
|
770
|
+
email: true,
|
|
771
|
+
phoneNumber: true,
|
|
772
|
+
emailConsentStatus: true,
|
|
773
|
+
smsConsentStatus: true,
|
|
774
|
+
communicationsOptedOut: true,
|
|
775
|
+
isSuppressed: true,
|
|
776
|
+
totalSpendUsdCents: true,
|
|
777
|
+
numMoments: true,
|
|
778
|
+
updatedAt: true,
|
|
779
|
+
},
|
|
780
|
+
totalCount: true,
|
|
781
|
+
hasNextPage: true,
|
|
782
|
+
nextCursor: true,
|
|
783
|
+
},
|
|
784
|
+
});
|
|
785
|
+
```
|
|
786
|
+
|
|
787
|
+
Filters are combined with AND; values inside one list are combined with OR.
|
|
788
|
+
`from` timestamps are inclusive and `before` timestamps are exclusive. Audience
|
|
789
|
+
pages and optional exact counts can be up to 30 seconds old. Consent and
|
|
790
|
+
suppression fields reflect ITM's current brand-scoped records but do not replace
|
|
791
|
+
your legal-purpose and communications-compliance checks.
|
|
792
|
+
|
|
679
793
|
### `getPartnerMomentCollection`
|
|
680
794
|
|
|
681
795
|
Get a moment collection by slug. Collections group related moments together (e.g. a summer series, a festival lineup). Returns the collection with its moments and links.
|
package/dist/index.d.mts
CHANGED
|
@@ -7,9 +7,13 @@ type Scalars = {
|
|
|
7
7
|
Int: number;
|
|
8
8
|
Float: number;
|
|
9
9
|
};
|
|
10
|
-
type
|
|
10
|
+
type ConsentStatus = 'NEVER_SUBSCRIBED' | 'SUBSCRIBED' | 'UNSUBSCRIBED';
|
|
11
|
+
type UserSource = 'BRAND' | 'DICE' | 'ITM';
|
|
12
|
+
type SortDirection = 'ASC' | 'DESC';
|
|
11
13
|
type BrandAgentEmailSendBatchStatus = 'PENDING' | 'SENDING' | 'SENT' | 'PARTIAL' | 'FAILED' | 'UNKNOWN';
|
|
12
14
|
type BrandAgentEmailSendMessageStatus = 'PENDING' | 'SENDING' | 'SENT' | 'FAILED' | 'UNKNOWN';
|
|
15
|
+
type PartnerAudienceSortField = 'CITY' | 'CREATED_AT' | 'NAME' | 'NUM_MOMENTS' | 'TOTAL_SPEND_USD' | 'UPDATED_AT';
|
|
16
|
+
type MomentStatus = 'UPCOMING' | 'LIVE' | 'ENDED';
|
|
13
17
|
type MomentSortOrder = 'ASC' | 'DESC';
|
|
14
18
|
type BrandDropCtaType = 'EXTERNAL_URL' | 'GATED_LINK' | 'MUSIC_LINK' | 'SUBSCRIBE';
|
|
15
19
|
type MusicReleaseType = 'ALBUM' | 'EP' | 'SINGLE';
|
|
@@ -211,6 +215,28 @@ interface PartnerCustomer {
|
|
|
211
215
|
tickets: Ticket[];
|
|
212
216
|
__typename: 'PartnerCustomer';
|
|
213
217
|
}
|
|
218
|
+
interface PartnerAudienceCustomer {
|
|
219
|
+
uid: Scalars['String'];
|
|
220
|
+
name: (Scalars['String'] | null);
|
|
221
|
+
email: (Scalars['String'] | null);
|
|
222
|
+
emailVerified: Scalars['Boolean'];
|
|
223
|
+
phoneNumber: (Scalars['String'] | null);
|
|
224
|
+
city: (Scalars['String'] | null);
|
|
225
|
+
country: (Scalars['String'] | null);
|
|
226
|
+
source: UserSource;
|
|
227
|
+
isSubscribed: Scalars['Boolean'];
|
|
228
|
+
emailConsentStatus: ConsentStatus;
|
|
229
|
+
smsConsentStatus: ConsentStatus;
|
|
230
|
+
communicationsOptedOut: Scalars['Boolean'];
|
|
231
|
+
isSuppressed: Scalars['Boolean'];
|
|
232
|
+
totalSpendUsdCents: Scalars['Int'];
|
|
233
|
+
numMoments: Scalars['Int'];
|
|
234
|
+
numProducts: Scalars['Int'];
|
|
235
|
+
numEchoes: Scalars['Int'];
|
|
236
|
+
createdAt: Scalars['DateTime'];
|
|
237
|
+
updatedAt: Scalars['DateTime'];
|
|
238
|
+
__typename: 'PartnerAudienceCustomer';
|
|
239
|
+
}
|
|
214
240
|
interface PartnerMomentStats {
|
|
215
241
|
generatedAt: Scalars['DateTime'];
|
|
216
242
|
ticketsCount: Scalars['Int'];
|
|
@@ -410,6 +436,13 @@ interface GetPartnerCustomersResponse {
|
|
|
410
436
|
nextCursor: (Scalars['String'] | null);
|
|
411
437
|
__typename: 'GetPartnerCustomersResponse';
|
|
412
438
|
}
|
|
439
|
+
interface GetPartnerAudienceResponse {
|
|
440
|
+
customers: PartnerAudienceCustomer[];
|
|
441
|
+
hasNextPage: Scalars['Boolean'];
|
|
442
|
+
nextCursor: (Scalars['String'] | null);
|
|
443
|
+
totalCount: (Scalars['Int'] | null);
|
|
444
|
+
__typename: 'GetPartnerAudienceResponse';
|
|
445
|
+
}
|
|
413
446
|
interface GetBrandEchoesForUserResponse {
|
|
414
447
|
echoes: Echo[];
|
|
415
448
|
totalCount: Scalars['Int'];
|
|
@@ -606,11 +639,28 @@ interface BrandAgentEmailSendBatch {
|
|
|
606
639
|
messages: BrandAgentEmailSendMessage[];
|
|
607
640
|
__typename: 'BrandAgentEmailSendBatch';
|
|
608
641
|
}
|
|
642
|
+
interface AgentThreadSeedContext {
|
|
643
|
+
/**
|
|
644
|
+
* Rendered prior-conversation transcript to seed a fresh agent session with,
|
|
645
|
+
* or null when the thread has no renderable history.
|
|
646
|
+
*/
|
|
647
|
+
seed: (Scalars['String'] | null);
|
|
648
|
+
includedMessages: Scalars['Int'];
|
|
649
|
+
totalMessages: Scalars['Int'];
|
|
650
|
+
truncated: Scalars['Boolean'];
|
|
651
|
+
__typename: 'AgentThreadSeedContext';
|
|
652
|
+
}
|
|
609
653
|
interface Query {
|
|
610
654
|
/** Get details for the brand associated with the partner token. */
|
|
611
655
|
getPartnerBrand: PartnerBrand;
|
|
612
656
|
/** Retrieve one AgentMail send batch owned by the authenticated partner brand. */
|
|
613
657
|
getPartnerAgentEmailBatch: BrandAgentEmailSendBatch;
|
|
658
|
+
/**
|
|
659
|
+
* Seed context for restoring a conversation thread into a fresh agent
|
|
660
|
+
* session. Agent-access-token mode only: admin, brand, and thread scope all
|
|
661
|
+
* derive from the verified token claims, so the operation takes no arguments.
|
|
662
|
+
*/
|
|
663
|
+
getAgentThreadSeed: AgentThreadSeedContext;
|
|
614
664
|
/** Get paginated moments for the brand associated with the partner token. */
|
|
615
665
|
getPartnerMomentsForBrand: GetPublicMomentsResponse;
|
|
616
666
|
/** Get paginated drops for the brand associated with the partner token. */
|
|
@@ -635,6 +685,11 @@ interface Query {
|
|
|
635
685
|
* Sorted by newest first (based on earliest ticket purchase time).
|
|
636
686
|
*/
|
|
637
687
|
getPartnerCustomersForMoment: GetPartnerCustomersResponse;
|
|
688
|
+
/**
|
|
689
|
+
* Get the authenticated brand's customer audience using an allowlisted profile,
|
|
690
|
+
* effective consent, and aggregate-metrics projection.
|
|
691
|
+
*/
|
|
692
|
+
getPartnerAudience: GetPartnerAudienceResponse;
|
|
638
693
|
/**
|
|
639
694
|
* Get a moment collection by slug.
|
|
640
695
|
* Returns the collection with its moments and links.
|
|
@@ -933,6 +988,29 @@ interface PartnerCustomerGenqlSelection {
|
|
|
933
988
|
__typename?: boolean | number;
|
|
934
989
|
__scalar?: boolean | number;
|
|
935
990
|
}
|
|
991
|
+
interface PartnerAudienceCustomerGenqlSelection {
|
|
992
|
+
uid?: boolean | number;
|
|
993
|
+
name?: boolean | number;
|
|
994
|
+
email?: boolean | number;
|
|
995
|
+
emailVerified?: boolean | number;
|
|
996
|
+
phoneNumber?: boolean | number;
|
|
997
|
+
city?: boolean | number;
|
|
998
|
+
country?: boolean | number;
|
|
999
|
+
source?: boolean | number;
|
|
1000
|
+
isSubscribed?: boolean | number;
|
|
1001
|
+
emailConsentStatus?: boolean | number;
|
|
1002
|
+
smsConsentStatus?: boolean | number;
|
|
1003
|
+
communicationsOptedOut?: boolean | number;
|
|
1004
|
+
isSuppressed?: boolean | number;
|
|
1005
|
+
totalSpendUsdCents?: boolean | number;
|
|
1006
|
+
numMoments?: boolean | number;
|
|
1007
|
+
numProducts?: boolean | number;
|
|
1008
|
+
numEchoes?: boolean | number;
|
|
1009
|
+
createdAt?: boolean | number;
|
|
1010
|
+
updatedAt?: boolean | number;
|
|
1011
|
+
__typename?: boolean | number;
|
|
1012
|
+
__scalar?: boolean | number;
|
|
1013
|
+
}
|
|
936
1014
|
interface PartnerMomentStatsGenqlSelection {
|
|
937
1015
|
generatedAt?: boolean | number;
|
|
938
1016
|
ticketsCount?: boolean | number;
|
|
@@ -1164,6 +1242,14 @@ interface GetPartnerCustomersResponseGenqlSelection {
|
|
|
1164
1242
|
__typename?: boolean | number;
|
|
1165
1243
|
__scalar?: boolean | number;
|
|
1166
1244
|
}
|
|
1245
|
+
interface GetPartnerAudienceResponseGenqlSelection {
|
|
1246
|
+
customers?: PartnerAudienceCustomerGenqlSelection;
|
|
1247
|
+
hasNextPage?: boolean | number;
|
|
1248
|
+
nextCursor?: boolean | number;
|
|
1249
|
+
totalCount?: boolean | number;
|
|
1250
|
+
__typename?: boolean | number;
|
|
1251
|
+
__scalar?: boolean | number;
|
|
1252
|
+
}
|
|
1167
1253
|
interface GetBrandEchoesForUserResponseGenqlSelection {
|
|
1168
1254
|
echoes?: EchoGenqlSelection;
|
|
1169
1255
|
totalCount?: boolean | number;
|
|
@@ -1348,6 +1434,43 @@ interface PartnerMomentsFiltersInput {
|
|
|
1348
1434
|
/** When true, includes private moments owned by the authenticated brand. Default: false. */
|
|
1349
1435
|
includePrivate?: (Scalars['Boolean'] | null);
|
|
1350
1436
|
}
|
|
1437
|
+
interface PartnerAudienceFiltersInput {
|
|
1438
|
+
customerUids?: (Scalars['String'][] | null);
|
|
1439
|
+
search?: (Scalars['String'] | null);
|
|
1440
|
+
hasEmail?: (Scalars['Boolean'] | null);
|
|
1441
|
+
hasPhone?: (Scalars['Boolean'] | null);
|
|
1442
|
+
isSubscribed?: (Scalars['Boolean'] | null);
|
|
1443
|
+
emailConsentStatuses?: (ConsentStatus[] | null);
|
|
1444
|
+
smsConsentStatuses?: (ConsentStatus[] | null);
|
|
1445
|
+
communicationsOptedOut?: (Scalars['Boolean'] | null);
|
|
1446
|
+
isSuppressed?: (Scalars['Boolean'] | null);
|
|
1447
|
+
sources?: (UserSource[] | null);
|
|
1448
|
+
cities?: (Scalars['String'][] | null);
|
|
1449
|
+
countries?: (Scalars['String'][] | null);
|
|
1450
|
+
createdAtFrom?: (Scalars['DateTime'] | null);
|
|
1451
|
+
createdAtBefore?: (Scalars['DateTime'] | null);
|
|
1452
|
+
updatedAtFrom?: (Scalars['DateTime'] | null);
|
|
1453
|
+
updatedAtBefore?: (Scalars['DateTime'] | null);
|
|
1454
|
+
minTotalSpendUsdCents?: (Scalars['Int'] | null);
|
|
1455
|
+
maxTotalSpendUsdCents?: (Scalars['Int'] | null);
|
|
1456
|
+
minNumMoments?: (Scalars['Int'] | null);
|
|
1457
|
+
maxNumMoments?: (Scalars['Int'] | null);
|
|
1458
|
+
momentUids?: (Scalars['String'][] | null);
|
|
1459
|
+
ticketTierUids?: (Scalars['String'][] | null);
|
|
1460
|
+
brandListUids?: (Scalars['String'][] | null);
|
|
1461
|
+
membershipTierUids?: (Scalars['String'][] | null);
|
|
1462
|
+
}
|
|
1463
|
+
interface PartnerAudienceSortInput {
|
|
1464
|
+
field: PartnerAudienceSortField;
|
|
1465
|
+
direction: SortDirection;
|
|
1466
|
+
}
|
|
1467
|
+
interface GetPartnerAudienceInput {
|
|
1468
|
+
filters?: (PartnerAudienceFiltersInput | null);
|
|
1469
|
+
sort?: (PartnerAudienceSortInput | null);
|
|
1470
|
+
cursor?: (Scalars['String'] | null);
|
|
1471
|
+
take?: (Scalars['Int'] | null);
|
|
1472
|
+
includeTotalCount?: (Scalars['Boolean'] | null);
|
|
1473
|
+
}
|
|
1351
1474
|
interface BrandAgentEmailSendMessageGenqlSelection {
|
|
1352
1475
|
uid?: boolean | number;
|
|
1353
1476
|
position?: boolean | number;
|
|
@@ -1374,6 +1497,18 @@ interface BrandAgentEmailSendBatchGenqlSelection {
|
|
|
1374
1497
|
__typename?: boolean | number;
|
|
1375
1498
|
__scalar?: boolean | number;
|
|
1376
1499
|
}
|
|
1500
|
+
interface AgentThreadSeedContextGenqlSelection {
|
|
1501
|
+
/**
|
|
1502
|
+
* Rendered prior-conversation transcript to seed a fresh agent session with,
|
|
1503
|
+
* or null when the thread has no renderable history.
|
|
1504
|
+
*/
|
|
1505
|
+
seed?: boolean | number;
|
|
1506
|
+
includedMessages?: boolean | number;
|
|
1507
|
+
totalMessages?: boolean | number;
|
|
1508
|
+
truncated?: boolean | number;
|
|
1509
|
+
__typename?: boolean | number;
|
|
1510
|
+
__scalar?: boolean | number;
|
|
1511
|
+
}
|
|
1377
1512
|
interface QueryGenqlSelection {
|
|
1378
1513
|
/** Get details for the brand associated with the partner token. */
|
|
1379
1514
|
getPartnerBrand?: PartnerBrandGenqlSelection;
|
|
@@ -1383,6 +1518,12 @@ interface QueryGenqlSelection {
|
|
|
1383
1518
|
batchUid: Scalars['String'];
|
|
1384
1519
|
};
|
|
1385
1520
|
});
|
|
1521
|
+
/**
|
|
1522
|
+
* Seed context for restoring a conversation thread into a fresh agent
|
|
1523
|
+
* session. Agent-access-token mode only: admin, brand, and thread scope all
|
|
1524
|
+
* derive from the verified token claims, so the operation takes no arguments.
|
|
1525
|
+
*/
|
|
1526
|
+
getAgentThreadSeed?: AgentThreadSeedContextGenqlSelection;
|
|
1386
1527
|
/** Get paginated moments for the brand associated with the partner token. */
|
|
1387
1528
|
getPartnerMomentsForBrand?: (GetPublicMomentsResponseGenqlSelection & {
|
|
1388
1529
|
__args: {
|
|
@@ -1455,6 +1596,15 @@ interface QueryGenqlSelection {
|
|
|
1455
1596
|
take?: (Scalars['Int'] | null);
|
|
1456
1597
|
};
|
|
1457
1598
|
});
|
|
1599
|
+
/**
|
|
1600
|
+
* Get the authenticated brand's customer audience using an allowlisted profile,
|
|
1601
|
+
* effective consent, and aggregate-metrics projection.
|
|
1602
|
+
*/
|
|
1603
|
+
getPartnerAudience?: (GetPartnerAudienceResponseGenqlSelection & {
|
|
1604
|
+
__args?: {
|
|
1605
|
+
input?: (GetPartnerAudienceInput | null);
|
|
1606
|
+
};
|
|
1607
|
+
});
|
|
1458
1608
|
/**
|
|
1459
1609
|
* Get a moment collection by slug.
|
|
1460
1610
|
* Returns the collection with its moments and links.
|
|
@@ -1539,6 +1689,8 @@ interface SendPartnerAgentEmailInput {
|
|
|
1539
1689
|
idempotencyKey: Scalars['String'];
|
|
1540
1690
|
/** One to ten personalized, single-recipient plain-text emails. */
|
|
1541
1691
|
messages: BrandAgentEmailMessageInput[];
|
|
1692
|
+
/** Brand-agent session callers only; rejected for partner API keys */
|
|
1693
|
+
toolCallId?: (Scalars['String'] | null);
|
|
1542
1694
|
}
|
|
1543
1695
|
interface VenueInput {
|
|
1544
1696
|
name: Scalars['String'];
|
|
@@ -1599,6 +1751,10 @@ interface CreatePartnerMomentInput {
|
|
|
1599
1751
|
subcategory?: (MomentSubcategory | null);
|
|
1600
1752
|
/** Ticket tiers to create along with the moment. */
|
|
1601
1753
|
ticketTiers?: (CreatePartnerTicketTierInput[] | null);
|
|
1754
|
+
/** Brand-agent session callers only; rejected for partner API keys */
|
|
1755
|
+
idempotencyKey?: (Scalars['String'] | null);
|
|
1756
|
+
/** Brand-agent session callers only; rejected for partner API keys */
|
|
1757
|
+
toolCallId?: (Scalars['String'] | null);
|
|
1602
1758
|
}
|
|
1603
1759
|
interface GetPartnerTicketTiersForMomentInput {
|
|
1604
1760
|
/** Moment UID to search ticket tiers for. Provide this or momentSlug. */
|
|
@@ -1915,6 +2071,24 @@ type Anify<T> = {
|
|
|
1915
2071
|
type FieldsToRemove = '__isUnion' | '__scalar' | '__name' | '__args';
|
|
1916
2072
|
type Nil = undefined | null;
|
|
1917
2073
|
|
|
2074
|
+
declare class GenqlError extends Error {
|
|
2075
|
+
errors: Array<GraphqlError>;
|
|
2076
|
+
/**
|
|
2077
|
+
* Partial data returned by the server
|
|
2078
|
+
*/
|
|
2079
|
+
data?: any;
|
|
2080
|
+
constructor(errors: any[], data: any);
|
|
2081
|
+
}
|
|
2082
|
+
interface GraphqlError {
|
|
2083
|
+
message: string;
|
|
2084
|
+
locations?: Array<{
|
|
2085
|
+
line: number;
|
|
2086
|
+
column: number;
|
|
2087
|
+
}>;
|
|
2088
|
+
path?: string[];
|
|
2089
|
+
extensions?: Record<string, any>;
|
|
2090
|
+
}
|
|
2091
|
+
|
|
1918
2092
|
interface Client {
|
|
1919
2093
|
query<R extends QueryGenqlSelection>(request: R & {
|
|
1920
2094
|
__name?: string;
|
|
@@ -1940,7 +2114,7 @@ declare const DEFAULT_API_URL = "https://itm-backend-production.up.railway.app/g
|
|
|
1940
2114
|
type MaybePromise<T> = T | Promise<T>;
|
|
1941
2115
|
type ITMPartnerHeadersObject = Record<string, string>;
|
|
1942
2116
|
type ITMPartnerHeaders = ITMPartnerHeadersObject | (() => MaybePromise<ITMPartnerHeadersObject | undefined>);
|
|
1943
|
-
interface
|
|
2117
|
+
interface ITMPartnerTokenConfig {
|
|
1944
2118
|
/**
|
|
1945
2119
|
* Partner API token (from backstage: Settings > Partner API).
|
|
1946
2120
|
* Sent as `x-partner-api-key` header on every request.
|
|
@@ -1958,6 +2132,77 @@ interface ITMPartnerClientConfig {
|
|
|
1958
2132
|
*/
|
|
1959
2133
|
headers?: ITMPartnerHeaders;
|
|
1960
2134
|
}
|
|
2135
|
+
interface ITMPartnerAgentSessionCredentials {
|
|
2136
|
+
/**
|
|
2137
|
+
* Mints a fresh, short-lived workload identity bearer for each request
|
|
2138
|
+
* (e.g. a Vercel workload OIDC token). Called per request so tokens are
|
|
2139
|
+
* never cached beyond their lifetime.
|
|
2140
|
+
*/
|
|
2141
|
+
workloadToken: () => MaybePromise<string>;
|
|
2142
|
+
/**
|
|
2143
|
+
* The backend-owned Brand Agent session id. The backend derives the brand
|
|
2144
|
+
* and the operation grants from this session server-side — the SDK never
|
|
2145
|
+
* carries a brand identifier or a partner API key in this mode.
|
|
2146
|
+
*/
|
|
2147
|
+
sessionUid: string;
|
|
2148
|
+
/**
|
|
2149
|
+
* Optional one-time session bootstrap secret, forwarded so the backend can
|
|
2150
|
+
* lazily register a session that the lifecycle hook has not bound yet.
|
|
2151
|
+
*/
|
|
2152
|
+
bootstrapToken?: string;
|
|
2153
|
+
}
|
|
2154
|
+
/**
|
|
2155
|
+
* First-party Brand Agent session authentication. Only capability-scoped
|
|
2156
|
+
* partner operations approved for agents accept this mode; everything else
|
|
2157
|
+
* remains partner-token-only and fails closed.
|
|
2158
|
+
*/
|
|
2159
|
+
interface ITMPartnerAgentSessionConfig {
|
|
2160
|
+
agentSession: ITMPartnerAgentSessionCredentials;
|
|
2161
|
+
/**
|
|
2162
|
+
* Base URL of the ITM GraphQL API.
|
|
2163
|
+
* @default DEFAULT_API_URL
|
|
2164
|
+
*/
|
|
2165
|
+
baseUrl?: string;
|
|
2166
|
+
/**
|
|
2167
|
+
* Additional headers to include on every request. Credential headers
|
|
2168
|
+
* always take precedence and cannot be overridden.
|
|
2169
|
+
*/
|
|
2170
|
+
headers?: ITMPartnerHeaders;
|
|
2171
|
+
}
|
|
2172
|
+
interface ITMPartnerAgentAccessCredentials {
|
|
2173
|
+
/**
|
|
2174
|
+
* Mints a fresh, short-lived workload identity bearer for each request
|
|
2175
|
+
* (e.g. a Vercel workload OIDC token). Called per request so tokens are
|
|
2176
|
+
* never cached beyond their lifetime.
|
|
2177
|
+
*/
|
|
2178
|
+
workloadToken: () => MaybePromise<string>;
|
|
2179
|
+
/**
|
|
2180
|
+
* The short-lived agent access token minted by the backend exchange (as
|
|
2181
|
+
* presented by the caller on the inbound request). The backend derives the
|
|
2182
|
+
* admin, brand, and thread scope from its verified claims server-side.
|
|
2183
|
+
*/
|
|
2184
|
+
accessToken: string;
|
|
2185
|
+
}
|
|
2186
|
+
/**
|
|
2187
|
+
* First-party Brand Agent access-token authentication, for the pre-session
|
|
2188
|
+
* moment in the session-create flow when no agent session exists yet (the
|
|
2189
|
+
* thread seed fetch). Only operations guarded for this mode accept it;
|
|
2190
|
+
* everything else remains partner-token- or session-only and fails closed.
|
|
2191
|
+
*/
|
|
2192
|
+
interface ITMPartnerAgentAccessConfig {
|
|
2193
|
+
agentAccess: ITMPartnerAgentAccessCredentials;
|
|
2194
|
+
/**
|
|
2195
|
+
* Base URL of the ITM GraphQL API.
|
|
2196
|
+
* @default DEFAULT_API_URL
|
|
2197
|
+
*/
|
|
2198
|
+
baseUrl?: string;
|
|
2199
|
+
/**
|
|
2200
|
+
* Additional headers to include on every request. Credential headers
|
|
2201
|
+
* always take precedence and cannot be overridden.
|
|
2202
|
+
*/
|
|
2203
|
+
headers?: ITMPartnerHeaders;
|
|
2204
|
+
}
|
|
2205
|
+
type ITMPartnerClientConfig = ITMPartnerTokenConfig | ITMPartnerAgentSessionConfig | ITMPartnerAgentAccessConfig;
|
|
1961
2206
|
type ITMPartnerClient = Client;
|
|
1962
2207
|
/**
|
|
1963
2208
|
* Create a typed ITM Partner API client.
|
|
@@ -1990,4 +2235,4 @@ type ITMPartnerClient = Client;
|
|
|
1990
2235
|
*/
|
|
1991
2236
|
declare function createITMPartnerClient(config: ITMPartnerClientConfig): ITMPartnerClient;
|
|
1992
2237
|
|
|
1993
|
-
export { type ApplyDynamicPricingInput, type BrandAgentEmailMessageInput, type BrandAgentEmailSendBatch, type BrandAgentEmailSendBatchStatus, type BrandAgentEmailSendMessage, type BrandAgentEmailSendMessageStatus, type BrandDrop, type BrandDropCtaType, type BrandDropMusicLink, type BrandSubscription, type CreateMomentOnlineConfigInput, type CreatePartnerBrandSubscriptionInput, type CreatePartnerBrandSubscriptionResponse, type CreatePartnerMomentInput, type CreatePartnerTicketTierInput, type Currency, DEFAULT_API_URL, type Dimensions, type DimensionsInput, type DynamicPricingActorType, type DynamicPricingAdmissionWindow, type DynamicPricingBatch, type DynamicPricingBatchEvent, type DynamicPricingBatchEventType, type DynamicPricingBatchItem, type DynamicPricingBatchItemStatus, type DynamicPricingBatchStatus, type DynamicPricingContext, type DynamicPricingExecutionMode, type DynamicPricingInventoryGuardInput, type DynamicPricingInventoryGuardMode, type DynamicPricingInventoryMetric, type DynamicPricingMomentInput, type DynamicPricingTierContext, type DynamicPricingTierUpdateInput, type Echo, type EchoMediaAsset, type EchoType, type EditPartnerTicketTiersForMomentInput, type EventImportPlatform, type GetBrandEchoesForUserResponse, type GetMomentLineupsResponse, type GetPartnerCustomersResponse, type GetPartnerDropsResponse, type GetPartnerTicketTiersForMomentInput, type GetPartnerTicketTiersForMomentResponse, type GetPublicMomentsResponse, type GetTicketsResponse, type ITMPartnerClient, type ITMPartnerClientConfig, type ITMPartnerHeaders, type ITMPartnerHeadersObject, type MediaAsset, type MediaAssetUploadUrl, type MerchPurchase, type Moment, type MomentCategory, type MomentCollection, type MomentCollectionLink, type MomentDiscountCodeUsage, type MomentDynamicPricingPolicy, type MomentDynamicPricingTierRule, type MomentLineup, type MomentLineupDisplayLabel, type MomentLineupResponseResult, type MomentLineupStatus, type MomentLineupType, type MomentOnlineProvider, type MomentSortOrder, type MomentStatus, type MomentSubcategory, type MomentType, type MusicReleaseType, type Mutation, type PartnerBrand, type PartnerCustomer, type PartnerMomentAttendanceCount, type PartnerMomentAttendanceLookupInput, type PartnerMomentAttendanceStats, type PartnerMomentGuestlistAttendance, type PartnerMomentGuestlistLabelAttendance, type PartnerMomentStats, type PartnerMomentTicketAttendance, type PartnerMomentTicketTierAttendance, type PartnerMomentsFiltersInput, type PartnerTicketTier, type PartnerTicketTierUpdateInput, type Payment, type PaymentStatus, type PostSubscriptionEmailInput, type PostSubscriptionMessageInput, type PostSubscriptionPushInput, type PostSubscriptionSmsInput, type PublicMomentLineupInfo, type Query, type RespondToMomentLineupInput, type SendPartnerAgentEmailInput, type SubscriptionComplianceInput, type ThirdPartyEchoType, type Ticket, type TicketAdmissionWindowSource, type TicketAttendanceMode, type TicketExtension, type TicketExtensionStatus, type TicketTier, type User, type Venue, type VenueInput, type VerifyPartnerBrandSubscriptionInput, createITMPartnerClient, everything, generateMutationOp, generateQueryOp };
|
|
2238
|
+
export { type AgentThreadSeedContext, type ApplyDynamicPricingInput, type BrandAgentEmailMessageInput, type BrandAgentEmailSendBatch, type BrandAgentEmailSendBatchStatus, type BrandAgentEmailSendMessage, type BrandAgentEmailSendMessageStatus, type BrandDrop, type BrandDropCtaType, type BrandDropMusicLink, type BrandSubscription, type ConsentStatus, type CreateMomentOnlineConfigInput, type CreatePartnerBrandSubscriptionInput, type CreatePartnerBrandSubscriptionResponse, type CreatePartnerMomentInput, type CreatePartnerTicketTierInput, type Currency, DEFAULT_API_URL, type Dimensions, type DimensionsInput, type DynamicPricingActorType, type DynamicPricingAdmissionWindow, type DynamicPricingBatch, type DynamicPricingBatchEvent, type DynamicPricingBatchEventType, type DynamicPricingBatchItem, type DynamicPricingBatchItemStatus, type DynamicPricingBatchStatus, type DynamicPricingContext, type DynamicPricingExecutionMode, type DynamicPricingInventoryGuardInput, type DynamicPricingInventoryGuardMode, type DynamicPricingInventoryMetric, type DynamicPricingMomentInput, type DynamicPricingTierContext, type DynamicPricingTierUpdateInput, type Echo, type EchoMediaAsset, type EchoType, type EditPartnerTicketTiersForMomentInput, type EventImportPlatform, GenqlError, type GetBrandEchoesForUserResponse, type GetMomentLineupsResponse, type GetPartnerAudienceInput, type GetPartnerAudienceResponse, type GetPartnerCustomersResponse, type GetPartnerDropsResponse, type GetPartnerTicketTiersForMomentInput, type GetPartnerTicketTiersForMomentResponse, type GetPublicMomentsResponse, type GetTicketsResponse, type ITMPartnerAgentAccessConfig, type ITMPartnerAgentAccessCredentials, type ITMPartnerAgentSessionConfig, type ITMPartnerAgentSessionCredentials, type ITMPartnerClient, type ITMPartnerClientConfig, type ITMPartnerHeaders, type ITMPartnerHeadersObject, type ITMPartnerTokenConfig, type MediaAsset, type MediaAssetUploadUrl, type MerchPurchase, type Moment, type MomentCategory, type MomentCollection, type MomentCollectionLink, type MomentDiscountCodeUsage, type MomentDynamicPricingPolicy, type MomentDynamicPricingTierRule, type MomentLineup, type MomentLineupDisplayLabel, type MomentLineupResponseResult, type MomentLineupStatus, type MomentLineupType, type MomentOnlineProvider, type MomentSortOrder, type MomentStatus, type MomentSubcategory, type MomentType, type MusicReleaseType, type Mutation, type PartnerAudienceCustomer, type PartnerAudienceFiltersInput, type PartnerAudienceSortField, type PartnerAudienceSortInput, type PartnerBrand, type PartnerCustomer, type PartnerMomentAttendanceCount, type PartnerMomentAttendanceLookupInput, type PartnerMomentAttendanceStats, type PartnerMomentGuestlistAttendance, type PartnerMomentGuestlistLabelAttendance, type PartnerMomentStats, type PartnerMomentTicketAttendance, type PartnerMomentTicketTierAttendance, type PartnerMomentsFiltersInput, type PartnerTicketTier, type PartnerTicketTierUpdateInput, type Payment, type PaymentStatus, type PostSubscriptionEmailInput, type PostSubscriptionMessageInput, type PostSubscriptionPushInput, type PostSubscriptionSmsInput, type PublicMomentLineupInfo, type Query, type RespondToMomentLineupInput, type SendPartnerAgentEmailInput, type SortDirection, type SubscriptionComplianceInput, type ThirdPartyEchoType, type Ticket, type TicketAdmissionWindowSource, type TicketAttendanceMode, type TicketExtension, type TicketExtensionStatus, type TicketTier, type User, type UserSource, type Venue, type VenueInput, type VerifyPartnerBrandSubscriptionInput, createITMPartnerClient, everything, generateMutationOp, generateQueryOp };
|