@itm-studio/partner-sdk 0.6.9 → 0.6.11

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.6.9",
3
+ "version": "0.6.11",
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",
@@ -27,7 +27,7 @@
27
27
  "schema"
28
28
  ],
29
29
  "scripts": {
30
- "generate": "genql --schema ./schema/partner.graphql --output ./src/generated",
30
+ "generate": "genql --schema ./schema/partner.graphql --output ./src/generated && node scripts/generate-integration-contract.mjs",
31
31
  "build": "npm run generate && tsup",
32
32
  "test": "vitest run",
33
33
  "test:package-guards": "node scripts/verify-runtime-guards.mjs",
@@ -52,6 +52,7 @@
52
52
  "@types/pngjs": "^6.0.5",
53
53
  "@types/qrcode": "^1.5.6",
54
54
  "esbuild": "0.27.3",
55
+ "graphql": "^16.9.0",
55
56
  "jsqr": "^1.4.0",
56
57
  "msw": "^2.7.0",
57
58
  "pngjs": "^7.0.0",
@@ -0,0 +1,177 @@
1
+ {
2
+ "getPartnerBrand": {
3
+ "kind": "query",
4
+ "scope": "itm:workspace:read",
5
+ "fields": "uid name slug bio publicUrl customDomain spotifyUrl youtubeEmbedUrl"
6
+ },
7
+ "getPartnerMomentsForBrand": {
8
+ "kind": "query",
9
+ "scope": "itm:workspace:read",
10
+ "fields": "moments{uid name slug publicUrl blurb startDate endDate timezone status type category isPrivate soldOut capacity venue{name city country}} totalCount hasNextPage nextCursor"
11
+ },
12
+ "getPartnerMoment": {
13
+ "kind": "query",
14
+ "scope": "itm:workspace:read",
15
+ "fields": "uid name slug publicUrl blurb startDate endDate timezone status type category isPrivate soldOut capacity venue{name address city country postalCode} description minimumAge externalUrl lineupDisplayLabel coverImage{url} ticketTiers{uid name description currency{code} attendanceMode soldOut minPerUser maxPerUser}"
16
+ },
17
+ "getPartnerMomentStats": {
18
+ "kind": "query",
19
+ "scope": "itm:workspace:read",
20
+ "fields": "generatedAt ticketsCount paidTicketsCount freeTicketsCount waitlistCount externalRsvpCount ticketRsvpRequestsCount inPersonOrdersCount inPersonChargesCount guestlist{names namesAllIn namesPartial namesNotArrived people peopleCheckedIn peopleRemaining plusOnes}"
21
+ },
22
+ "getPartnerMomentAttendanceStats": {
23
+ "kind": "query",
24
+ "scope": "itm:workspace:read",
25
+ "fields": "momentUid momentSlug generatedAt tickets{total checkedIn tiers{tierUid name label total checkedIn}} guestlist{total checkedIn unlabeled{total checkedIn} labels{labelUid name total checkedIn}}"
26
+ },
27
+ "getPartnerTicketTiersForMoment": {
28
+ "kind": "query",
29
+ "scope": "itm:workspace:read",
30
+ "fields": "ticketTiers{uid name label price facilityFee currencyCode supply remainingSupply fillRate isActive isPrivate slotDate slotDurationHours} totalCount hasNextPage nextCursor"
31
+ },
32
+ "getPartnerMomentCollection": {
33
+ "kind": "query",
34
+ "scope": "itm:workspace:read",
35
+ "fields": "uid name slug description subLabel links{url label} moments{uid name slug startDate endDate status soldOut venue{name city}}"
36
+ },
37
+ "getPartnerDrops": {
38
+ "kind": "query",
39
+ "scope": "itm:workspace:read",
40
+ "fields": "drops{uid name slug publicUrl subtitle isPublic isActive ctaType ctaUrl captureName captureEmail createdAt} totalCount hasNextPage nextCursor"
41
+ },
42
+ "getPartnerPublicEchoes": {
43
+ "kind": "query",
44
+ "scope": "itm:workspace:read",
45
+ "fields": "echoes{uid type name slug publicUrl description postBody publishTime externalLink moment{uid name slug}} totalCount hasNextPage nextCursor"
46
+ },
47
+ "getPartnerMerch": {
48
+ "kind": "query",
49
+ "scope": "itm:workspace:read",
50
+ "fields": "items{uid name publicUrl description price currency{code} fulfillmentType isLive maxPerUser merchSizes{uid name isSoldOut}} totalCount hasNextPage nextCursor"
51
+ },
52
+ "getPartnerMembershipTiers": {
53
+ "kind": "query",
54
+ "scope": "itm:workspace:read",
55
+ "fields": "membershipTiers{uid name slug publicUrl description passType billingInterval currencyCode price yearlyPrice oneTimePrice trialDays isActive isPublic memberLimit activeMemberCount benefits} totalCount hasNextPage nextCursor"
56
+ },
57
+ "getPartnerContributionPages": {
58
+ "kind": "query",
59
+ "scope": "itm:workspace:read",
60
+ "fields": "items{uid brandUid slug title description isAccepting archivedAt publicUrl currency{code} successfulContributionCount refundCount grossAmountCents refundedAmountCents netAmountCents createdAt} totalCount hasNextPage nextCursor"
61
+ },
62
+ "getPartnerPlans": {
63
+ "kind": "query",
64
+ "scope": "itm:workspace:read",
65
+ "fields": "plans{uid name slug description kind status tags{name} moodboardItemCount createdAt updatedAt} totalCount hasNextPage nextCursor"
66
+ },
67
+ "getPartnerPlan": {
68
+ "kind": "query",
69
+ "scope": "itm:workspace:read",
70
+ "fields": "uid name slug description kind status tags{name} updatedAt schedule{type timezone startsAt endsAt startsOn endsOn frequency interval daysOfWeek count includeDates excludeDates occurrenceCount times{time durationMinutes}} moodboard{items{uid type title note linkUrl position}}"
71
+ },
72
+ "getPartnerPlanDatePoll": {
73
+ "kind": "query",
74
+ "scope": "itm:workspace:read",
75
+ "fields": "uid status timeMode timezone durationMinutes replyByDate chosenOptionUid answeredCount notAnsweredCount needsUpdateCount results{optionUid localDate startTime endTime status freeCount ifNeedBeCount unavailableCount unansweredCount bestSlot{startTime endTime}}"
76
+ },
77
+ "getPartnerPlanBudgets": {
78
+ "kind": "query",
79
+ "scope": "itm:workspace:read",
80
+ "fields": "uid name planUid currencyCode currencyExponent revision scheduleIsStale updatedAt"
81
+ },
82
+ "getPartnerPlanBudget": {
83
+ "kind": "query",
84
+ "scope": "itm:workspace:read",
85
+ "fields": "uid name planUid currencyCode currencyExponent revision scheduleIsStale document calculation updatedAt"
86
+ },
87
+ "getPartnerAudience": {
88
+ "kind": "query",
89
+ "scope": "itm:audience:read",
90
+ "fields": "customers{uid name email phoneNumber city country isSubscribed emailConsentStatus smsConsentStatus communicationsOptedOut totalSpendUsdCents numMoments numProducts createdAt} totalCount hasNextPage nextCursor"
91
+ },
92
+ "getPartnerCustomersForMoment": {
93
+ "kind": "query",
94
+ "scope": "itm:audience:read",
95
+ "fields": "customers{user{uid name primaryEmail phoneNumber} tickets{uid status price redeemedAt ticketTier{uid name}}} totalCount hasNextPage nextCursor"
96
+ },
97
+ "getPartnerMembers": {
98
+ "kind": "query",
99
+ "scope": "itm:audience:read",
100
+ "fields": "members{uid status membershipNumber source purchaseType billingInterval quantity issuedAt currentPeriodEnd cancelAtPeriodEnd cancelledAt customer{uid name email phoneNumber} membershipTier{uid name slug passType}} totalCount hasNextPage nextCursor"
101
+ },
102
+ "getPartnerTicketsForMoment": {
103
+ "kind": "query",
104
+ "scope": "itm:audience:read",
105
+ "fields": "tickets{uid status price redeemedAt hasExpired notes createdAt ticketTier{uid name} user{uid name primaryEmail phoneNumber} payment{status}} totalCount hasNextPage nextCursor"
106
+ },
107
+ "getPartnerTicketsForUser": {
108
+ "kind": "query",
109
+ "scope": "itm:audience:read",
110
+ "fields": "tickets{uid status price redeemedAt hasExpired createdAt ticketTier{uid name} moment{uid name slug startDate}} totalCount hasNextPage nextCursor"
111
+ },
112
+ "getPartnerGuestListForMoment": {
113
+ "kind": "query",
114
+ "scope": "itm:audience:read",
115
+ "fields": "guestLists{uid name email phoneNumber plusOnes numGuests numCheckedIn checkInStatus checkedInAt notes source respondedToInvitation labels{uid name} createdAt} totalCount hasNextPage nextCursor"
116
+ },
117
+ "getPartnerGuestListCheckIns": {
118
+ "kind": "query",
119
+ "scope": "itm:audience:read",
120
+ "fields": "batches{uid checkedInAt count activeCount source voidedAt voidReason} totalCount hasNextPage nextCursor"
121
+ },
122
+ "getPartnerContributions": {
123
+ "kind": "query",
124
+ "scope": "itm:audience:read",
125
+ "fields": "items{uid contributionPageUid pageTitle donorName donorEmail donorPhoneNumber source currencyCode amountCents refundedAmountCents status paidAt note isGuest createdAt} totalCount hasNextPage nextCursor"
126
+ },
127
+ "getPartnerInPersonOrdersForMoment": {
128
+ "kind": "query",
129
+ "scope": "itm:audience:read",
130
+ "fields": "orders{uid status momentSlug currencyCode grossAmount subtotalAmount taxAmount refundedAmount paidAt createdAt user{uid name primaryEmail phoneNumber} items{uid type category name variantName quantity unitAmount lineAmount refundedQuantity}} totalCount hasNextPage nextCursor"
131
+ },
132
+ "getPartnerInPersonOrder": {
133
+ "kind": "query",
134
+ "scope": "itm:audience:read",
135
+ "fields": "uid status momentSlug currencyCode grossAmount subtotalAmount taxAmount refundedAmount paidAt createdAt user{uid name primaryEmail phoneNumber} items{uid type category name variantName quantity unitAmount lineAmount refundedQuantity} cancellationReason charge{uid status amount category cardBrand cardLast4 billingEmail} refunds{uid amount status reason failureReason source createdAt}"
136
+ },
137
+ "getPartnerInPersonChargesForMoment": {
138
+ "kind": "query",
139
+ "scope": "itm:audience:read",
140
+ "fields": "charges{uid orderUid status category currencyCode amount subtotalAmount taxAmount quantity description cardBrand cardLast4 billingEmail linkingStatus createdAt} totalCount hasNextPage nextCursor"
141
+ },
142
+ "getPartnerSpaceLocations": {
143
+ "kind": "query",
144
+ "scope": "itm:workspace:read",
145
+ "fields": "locations{uid name city country timezone spaces{uid name kind capacity setupMinutes teardownMinutes parts{uid}}} totalCount hasNextPage nextCursor"
146
+ },
147
+ "getPartnerSpaceCalendar": {
148
+ "kind": "query",
149
+ "scope": "itm:workspace:read",
150
+ "fields": "locationUid locationName timezone spaces{uid name kind capacity parts{uid}} holds{uid spaceUid localDate startsAt endsAt occupiedStartsAt occupiedEndsAt status position expiresAt respondBy isLapsed isChallengeOverdue request{uid title requesterKind organization headcount}} blocks{uid spaceUid startsAt endsAt reason} closures{spaceUid localDate startsAt endsAt note}"
151
+ },
152
+ "getPartnerSpaceAvailability": {
153
+ "kind": "query",
154
+ "scope": "itm:workspace:read",
155
+ "fields": "timezone spaces{spaceUid name dates{localDate outcome lineSize closed conflicts{kind label startsAt endsAt}}}"
156
+ },
157
+ "getPartnerMediaAssets": {
158
+ "kind": "query",
159
+ "scope": "itm:media:write",
160
+ "fields": "mediaAssets{uid url mimeType size dimensions{width height} createdAt} totalCount hasNextPage nextCursor"
161
+ },
162
+ "getPartnerMediaAsset": {
163
+ "kind": "query",
164
+ "scope": "itm:media:write",
165
+ "fields": "uid url mimeType size dimensions{width height} createdAt"
166
+ },
167
+ "createPartnerMediaUpload": {
168
+ "kind": "mutation",
169
+ "scope": "itm:media:write",
170
+ "fields": "uploadKey uploadUrl expiresAt"
171
+ },
172
+ "completePartnerMediaUpload": {
173
+ "kind": "mutation",
174
+ "scope": "itm:media:write",
175
+ "fields": "uid url mimeType size dimensions{width height} createdAt"
176
+ }
177
+ }
@@ -1329,6 +1329,8 @@ type GetBrandEchoesForUserResponse {
1329
1329
  }
1330
1330
 
1331
1331
  type PartnerTicketTier {
1332
+ """ISO 4217 currency of the tier price and facility fee."""
1333
+ currencyCode: String!
1332
1334
  """Sold-through fill rate as a 0-1 ratio."""
1333
1335
  fillRate: Float!
1334
1336
  isActive: Boolean!
@@ -2264,12 +2266,29 @@ type Query {
2264
2266
  getMomentLineupByToken(token: String!): PublicMomentLineupInfo!
2265
2267
  getPartnerPlans(input: GetPlansInput!): GetPlansResponse!
2266
2268
  getPartnerPlan(planUid: String!): Plan!
2269
+ """Aggregate date-poll progress, or null if the plan has no poll."""
2270
+ getPartnerPlanDatePoll(planUid: String!): PartnerPlanDatePoll
2267
2271
  getPartnerPlanBudgets(planUid: String!): [PlanBudgetSummary!]!
2268
2272
  getPartnerPlanBudget(budgetUid: String!): PlanBudget!
2269
2273
  getPartnerPlanningSource(offset: Int! = 0, take: Int! = 50, uid: String!): PlanningSource!
2270
2274
  getPartnerPlanningProposal(uid: String!): PlanningProposal!
2271
2275
  getPartnerGuestListCheckIns(cursor: String, guestlistUid: String!, momentSlug: String!, take: Int): GetPartnerGuestListCheckInsResponse!
2272
2276
  getPartnerGuestListForMoment(cursor: String, filters: GetMomentGuestListFiltersInput, momentSlug: String!, sort: MomentGuestListSortInput, take: Int): GetPartnerMomentGuestListResponse!
2277
+
2278
+ """
2279
+ The brand's locations that have bookable spaces, with their active spaces and time zone.
2280
+ """
2281
+ getPartnerSpaceLocations(cursor: String, take: Int): PartnerSpaceLocationsPage!
2282
+
2283
+ """
2284
+ Holds, bookings, blocks and closed hours on a location's spaces over at most 62 local days.
2285
+ """
2286
+ getPartnerSpaceCalendar(input: SpaceCalendarInput!): PartnerSpaceCalendar!
2287
+
2288
+ """
2289
+ Whether each of a location's spaces is open, has holds in line, or is unavailable on each local date, for whole days or a local time window.
2290
+ """
2291
+ getPartnerSpaceAvailability(input: SpaceAvailabilityInput!): SpaceAvailability!
2273
2292
  }
2274
2293
 
2275
2294
  # ─── Input Types ──────────────────────────────────────────────────────────────
@@ -2921,6 +2940,55 @@ enum PlanMoodboardItemType {
2921
2940
  MEDIA
2922
2941
  }
2923
2942
 
2943
+ type PartnerPlanDatePoll {
2944
+ uid: ID!
2945
+ status: PlanDatePollStatus!
2946
+ timeMode: PlanDatePollTimeMode!
2947
+ timezone: String!
2948
+ durationMinutes: Int
2949
+ replyByDate: String
2950
+ chosenOptionUid: ID
2951
+ answeredCount: Int!
2952
+ notAnsweredCount: Int!
2953
+ needsUpdateCount: Int!
2954
+ results: [PartnerPlanDatePollOptionResult!]!
2955
+ }
2956
+
2957
+ type PartnerPlanDatePollOptionResult {
2958
+ optionUid: ID!
2959
+ localDate: String!
2960
+ startTime: String
2961
+ endTime: String
2962
+ status: PlanDatePollOptionStatus!
2963
+ freeCount: Int!
2964
+ ifNeedBeCount: Int!
2965
+ unavailableCount: Int!
2966
+ unansweredCount: Int!
2967
+ bestSlot: PlanDatePollSlot
2968
+ }
2969
+
2970
+ type PlanDatePollSlot {
2971
+ startTime: String!
2972
+ endTime: String!
2973
+ }
2974
+
2975
+ enum PlanDatePollStatus {
2976
+ CLOSED
2977
+ OPEN
2978
+ }
2979
+
2980
+ enum PlanDatePollTimeMode {
2981
+ ANY_TIME
2982
+ EXACT
2983
+ WINDOW
2984
+ }
2985
+
2986
+ enum PlanDatePollOptionStatus {
2987
+ BLOCKED
2988
+ WAITING
2989
+ WORKS
2990
+ }
2991
+
2924
2992
  type PlanBudgetSummary {
2925
2993
  createdAt: DateTime!
2926
2994
  currencyCode: String!
@@ -4072,3 +4140,184 @@ enum WalletOperationStatus {
4072
4140
  RETURNED
4073
4141
  REVIEW_REQUIRED
4074
4142
  }
4143
+
4144
+ # Venue spaces, calendar and availability
4145
+ enum SpaceKind {
4146
+ COMBINED
4147
+ SINGLE
4148
+ }
4149
+
4150
+ enum SpaceHoldStatus {
4151
+ CANCELLED
4152
+ CHALLENGED
4153
+ CONFIRMED
4154
+ EXPIRED
4155
+ HELD
4156
+ RELEASED
4157
+ REQUESTED
4158
+ }
4159
+
4160
+ enum SpaceRequestKind {
4161
+ PERSON
4162
+ PLAN
4163
+ TEAM
4164
+ }
4165
+
4166
+ enum SpaceHoldPreviewOutcome {
4167
+ IN_LINE
4168
+ OPEN
4169
+ UNAVAILABLE
4170
+ }
4171
+
4172
+ enum SpaceCalendarConflictKind {
4173
+ BLOCK
4174
+ BOOKING
4175
+ }
4176
+
4177
+ type PartnerSpace {
4178
+ capacity: Int
4179
+ kind: SpaceKind!
4180
+ name: String!
4181
+ """The spaces a COMBINED space is made of. Booking either side blocks the other."""
4182
+ parts: [PartnerSpace!]!
4183
+ setupMinutes: Int!
4184
+ teardownMinutes: Int!
4185
+ uid: ID!
4186
+ }
4187
+
4188
+ type PartnerSpaceLocation {
4189
+ city: String!
4190
+ country: String!
4191
+ name: String!
4192
+ spaces: [PartnerSpace!]!
4193
+ """IANA time zone. Calendar and availability reads fail for a location without one."""
4194
+ timezone: String
4195
+ uid: ID!
4196
+ }
4197
+
4198
+ type PartnerSpaceLocationsPage {
4199
+ hasNextPage: Boolean!
4200
+ locations: [PartnerSpaceLocation!]!
4201
+ nextCursor: String
4202
+ totalCount: Int!
4203
+ }
4204
+
4205
+ type PartnerSpaceRequest {
4206
+ headcount: Int
4207
+ organization: String
4208
+ requesterKind: SpaceRequestKind!
4209
+ title: String!
4210
+ uid: ID!
4211
+ }
4212
+
4213
+ type PartnerSpaceHold {
4214
+ aheadCount: Int!
4215
+ endsAt: DateTime!
4216
+ expiresAt: DateTime!
4217
+ isChallengeOverdue: Boolean!
4218
+ """Held past expiresAt. Holds are not expired automatically and still count in line."""
4219
+ isLapsed: Boolean!
4220
+ localDate: String!
4221
+ occupiedEndsAt: DateTime!
4222
+ occupiedStartsAt: DateTime!
4223
+ """Place in line among overlapping tentative holds; null once confirmed or released."""
4224
+ position: Int
4225
+ request: PartnerSpaceRequest!
4226
+ requestUid: ID!
4227
+ respondBy: DateTime
4228
+ spaceUid: ID!
4229
+ startsAt: DateTime!
4230
+ """CONFIRMED is a booking. HELD and CHALLENGED are tentative holds waiting in line."""
4231
+ status: SpaceHoldStatus!
4232
+ uid: ID!
4233
+ }
4234
+
4235
+ type PartnerSpaceBlock {
4236
+ endsAt: DateTime!
4237
+ reason: String!
4238
+ """Null when the block covers the whole location."""
4239
+ spaceUid: ID
4240
+ startsAt: DateTime!
4241
+ uid: ID!
4242
+ }
4243
+
4244
+ type SpaceCalendarClosure {
4245
+ endsAt: DateTime!
4246
+ localDate: String!
4247
+ note: String
4248
+ spaceUid: ID!
4249
+ startsAt: DateTime!
4250
+ }
4251
+
4252
+ type PartnerSpaceCalendar {
4253
+ blocks: [PartnerSpaceBlock!]!
4254
+ closures: [SpaceCalendarClosure!]!
4255
+ holds: [PartnerSpaceHold!]!
4256
+ locationName: String!
4257
+ locationUid: ID!
4258
+ spaces: [PartnerSpace!]!
4259
+ timezone: String
4260
+ }
4261
+
4262
+ type SpaceCalendarConflict {
4263
+ endsAt: DateTime!
4264
+ kind: SpaceCalendarConflictKind!
4265
+ """The booking's request title or the block's reason."""
4266
+ label: String!
4267
+ """For a booking, includes its setup and teardown."""
4268
+ startsAt: DateTime!
4269
+ """The booking (hold) uid or the block uid."""
4270
+ uid: ID!
4271
+ }
4272
+
4273
+ type SpaceAvailabilityDate {
4274
+ """
4275
+ For a whole day, no opening hours start on this date. With a time window,
4276
+ opening hours do not cover the window including setup and teardown, or the
4277
+ window falls entirely in a daylight saving gap.
4278
+ """
4279
+ closed: Boolean!
4280
+ conflicts: [SpaceCalendarConflict!]!
4281
+ """Tentative holds overlapping the checked time."""
4282
+ lineSize: Int!
4283
+ localDate: String!
4284
+ outcome: SpaceHoldPreviewOutcome!
4285
+ }
4286
+
4287
+ type SpaceAvailabilitySpace {
4288
+ dates: [SpaceAvailabilityDate!]!
4289
+ name: String!
4290
+ spaceUid: ID!
4291
+ }
4292
+
4293
+ type SpaceAvailability {
4294
+ spaces: [SpaceAvailabilitySpace!]!
4295
+ timezone: String!
4296
+ }
4297
+
4298
+ input SpaceCalendarInput {
4299
+ """Last local date, YYYY-MM-DD, inclusive."""
4300
+ endsOn: String!
4301
+ """Also return released holds."""
4302
+ includeReleased: Boolean
4303
+ locationUid: ID!
4304
+ """At most 50. Defaults to every active space."""
4305
+ spaceUids: [ID!]
4306
+ """First local date, YYYY-MM-DD."""
4307
+ startsOn: String!
4308
+ }
4309
+
4310
+ input SpaceAvailabilityInput {
4311
+ """Local HH:mm. Give with startTime, or neither for whole days."""
4312
+ endTime: String
4313
+ """Last local date, YYYY-MM-DD, inclusive; at most 31 days."""
4314
+ endsOn: String!
4315
+ locationUid: ID!
4316
+ """At most 50. Defaults to every active space."""
4317
+ spaceUids: [ID!]
4318
+ """Local HH:mm. A window ending at or before its start runs past midnight."""
4319
+ startTime: String
4320
+ """First local date, YYYY-MM-DD."""
4321
+ startsOn: String!
4322
+ }
4323
+ # End venue spaces, calendar and availability