@itm-studio/partner-sdk 0.3.6 → 0.3.8

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.3.6",
3
+ "version": "0.3.8",
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",
@@ -49,8 +49,13 @@
49
49
  "devDependencies": {
50
50
  "@genql/cli": "^6.3.3",
51
51
  "@graphql-hive/cli": "^0.46.0",
52
+ "@types/pngjs": "^6.0.5",
53
+ "@types/qrcode": "^1.5.6",
52
54
  "esbuild": "0.27.3",
55
+ "jsqr": "^1.4.0",
53
56
  "msw": "^2.7.0",
57
+ "pngjs": "^7.0.0",
58
+ "qrcode": "^1.5.4",
54
59
  "tsup": "^8.4.0",
55
60
  "typescript": "^5.7.0",
56
61
  "vite": "^6.0.0",
@@ -509,6 +509,29 @@ type ContributionPageAdmin {
509
509
  updatedAt: DateTime!
510
510
  }
511
511
 
512
+ enum ContributionSource {
513
+ STRIPE
514
+ OFF_SITE
515
+ POS
516
+ }
517
+
518
+ enum ManualContributionReceiptType {
519
+ REGULAR
520
+ DONATION
521
+ }
522
+
523
+ input CreateManualContributionInput {
524
+ sendReceipt: Boolean
525
+ currencyCode: String!
526
+ contributionPageUid: String!
527
+ amountCents: Int!
528
+ requestUid: String!
529
+ name: String!
530
+ email: String
531
+ phoneNumber: String
532
+ note: String
533
+ }
534
+
512
535
  """
513
536
  A single contribution to one of the brand's contribution pages.
514
537
  Only SUCCEEDED contributions represent confirmed money.
@@ -519,7 +542,11 @@ type ContributionAdmin {
519
542
  """Page title snapshotted at checkout."""
520
543
  pageTitle: String!
521
544
  donorName: String!
522
- donorEmail: String!
545
+ donorEmail: String
546
+ donorPhoneNumber: String
547
+ source: ContributionSource!
548
+ userUid: String
549
+ manualReceiptType: ManualContributionReceiptType
523
550
  """Note left by the contributor at checkout; null when none was given."""
524
551
  note: String
525
552
  currencyCode: String!
@@ -564,6 +591,18 @@ type Venue {
564
591
  updatedAt: DateTime!
565
592
  }
566
593
 
594
+ """
595
+ Public location text for a moment, without the venue name or street address.
596
+ Available even when the full venue is hidden until RSVP.
597
+ """
598
+ type MomentPublicVenuePreview {
599
+ city: String!
600
+ """Display country label; use countryCode when an ISO country code is needed."""
601
+ country: String!
602
+ """ISO country code when available."""
603
+ countryCode: String
604
+ }
605
+
567
606
  """
568
607
  A slim projection of the cover image media asset.
569
608
  Only the publicly useful fields (URL and MIME type) are exposed.
@@ -624,7 +663,10 @@ type Moment {
624
663
  lineupDisplayLabel: MomentLineupDisplayLabel!
625
664
  """Cover image for the moment. Null if no cover image is set."""
626
665
  coverImage: MomentCoverImage!
666
+ """Full venue details. Null when no venue is set or the caller cannot reveal it."""
627
667
  venue: Venue
668
+ """Public city/country location text. Null when no venue is set."""
669
+ publicVenuePreview: MomentPublicVenuePreview
628
670
  """Public tag assignments owned by the authenticated partner's brand."""
629
671
  momentTags(
630
672
  pagination: PaginationInput
@@ -686,6 +728,13 @@ type Ticket {
686
728
  uid: ID!
687
729
  price: Float!
688
730
  redeemedAt: DateTime
731
+ """
732
+ Opaque ticket payload to encode unchanged as a QR image for ITM scanners.
733
+ This is not an image URL. No decryption key is needed to render it.
734
+ Fetch on a trusted server, verify the app user's current ticket ownership,
735
+ and refetch before display because transfers can rotate the payload.
736
+ Rendering a QR does not establish admission eligibility; ITM validates it at scan time.
737
+ """
689
738
  encryptedQRCode: String!
690
739
  notes: String
691
740
  externalId: String
@@ -819,6 +868,17 @@ enum EventImportPlatform {
819
868
  EVENTBRITE
820
869
  }
821
870
 
871
+ """
872
+ Match the current ITM ticket owner by exactly one of userUid, email, or phoneNumber.
873
+ For an attendee app, derive this identifier from the authenticated user's verified
874
+ ITM account association on your server; a caller-supplied identifier is not proof of ownership.
875
+ """
876
+ input PartnerTicketUserLookupInput {
877
+ userUid: String
878
+ email: String
879
+ phoneNumber: String
880
+ }
881
+
822
882
  input PartnerMomentAttendanceLookupInput {
823
883
  """
824
884
  ITM moment UID. Provide exactly one of momentUid, momentSlug, or externalPlatform with externalId.
@@ -1360,7 +1420,185 @@ type AgentMediaUploadReservation {
1360
1420
  mediaAsset: MediaAsset
1361
1421
  }
1362
1422
 
1423
+ enum MembershipBillingInterval {
1424
+ MONTHLY
1425
+ MONTHLY_OR_YEARLY
1426
+ YEARLY
1427
+ }
1428
+
1429
+ enum MembershipExpiryType {
1430
+ FIXED_DATE
1431
+ NO_EXPIRY
1432
+ ROLLING
1433
+ }
1434
+
1435
+ enum MembershipPassType {
1436
+ ONE_TIME
1437
+ RECURRING
1438
+ RECURRING_OR_ONE_TIME
1439
+ }
1440
+
1441
+ enum MembershipPurchaseType {
1442
+ ONE_TIME
1443
+ RECURRING
1444
+ }
1445
+
1446
+ enum MembershipSource {
1447
+ ADMIN_GRANT
1448
+ IMPORT
1449
+ PURCHASE
1450
+ }
1451
+
1452
+ enum MembershipStatus {
1453
+ ACTIVE
1454
+ CANCELLED
1455
+ EXPIRED
1456
+ PAST_DUE
1457
+ PENDING
1458
+ REFUNDED
1459
+ }
1460
+
1461
+ input GetPartnerMembersInput {
1462
+ """Only memberships set (or not set) to cancel at period end"""
1463
+ cancelAtPeriodEnd: Boolean
1464
+ """Membership created strictly before this instant"""
1465
+ createdAtBefore: DateTime
1466
+ """Membership created at or after this instant"""
1467
+ createdAtFrom: DateTime
1468
+ """Current period ends strictly before this instant (e.g. expiring soon)"""
1469
+ currentPeriodEndBefore: DateTime
1470
+ """Current period ends at or after this instant"""
1471
+ currentPeriodEndFrom: DateTime
1472
+ """Cursor UID returned as nextCursor by the previous page"""
1473
+ cursor: String
1474
+ """
1475
+ Restrict to these customer UIDs (PartnerMemberCustomer.uid, same as getPartnerAudience customer uid)
1476
+ """
1477
+ customerUids: [String!]
1478
+ """Restrict to these membership tier UIDs (must belong to the brand)"""
1479
+ membershipTierUids: [String!]
1480
+ """
1481
+ Case-insensitive search over member name, email, phone number, or exact membership number
1482
+ """
1483
+ search: String
1484
+ sources: [MembershipSource!]
1485
+ """
1486
+ Membership statuses to include. Omit for every status except PENDING (unpaid checkout reservations).
1487
+ """
1488
+ statuses: [MembershipStatus!]
1489
+ """Page size. Defaults to 50, maximum 100."""
1490
+ take: Int
1491
+ }
1492
+
1493
+ type GetPartnerMembersResponse {
1494
+ hasNextPage: Boolean!
1495
+ members: [PartnerMember!]!
1496
+ nextCursor: String
1497
+ totalCount: Int!
1498
+ }
1499
+
1500
+ input GetPartnerMembershipTiersInput {
1501
+ """Cursor UID returned as nextCursor by the previous page"""
1502
+ cursor: String
1503
+ isActive: Boolean
1504
+ isPublic: Boolean
1505
+ passTypes: [MembershipPassType!]
1506
+ """Case-insensitive search over tier name and slug"""
1507
+ search: String
1508
+ """Page size. Defaults to 50, maximum 100."""
1509
+ take: Int
1510
+ }
1511
+
1512
+ type GetPartnerMembershipTiersResponse {
1513
+ hasNextPage: Boolean!
1514
+ membershipTiers: [PartnerMembershipTier!]!
1515
+ nextCursor: String
1516
+ totalCount: Int!
1517
+ }
1518
+
1519
+ type PartnerMember {
1520
+ billingInterval: MembershipBillingInterval
1521
+ cancelAtPeriodEnd: Boolean!
1522
+ cancelledAt: DateTime
1523
+ createdAt: DateTime!
1524
+ currentPeriodEnd: DateTime
1525
+ currentPeriodStart: DateTime
1526
+ customer: PartnerMemberCustomer!
1527
+ """First issuance time; falls back to createdAt for legacy rows"""
1528
+ issuedAt: DateTime!
1529
+ membershipNumber: Int
1530
+ membershipTier: PartnerMemberTier!
1531
+ purchaseType: MembershipPurchaseType
1532
+ quantity: Int!
1533
+ refundedAt: DateTime
1534
+ """Uses the member can redeem now; null means unlimited"""
1535
+ remainingUses: Int
1536
+ source: MembershipSource!
1537
+ status: MembershipStatus!
1538
+ uid: ID!
1539
+ updatedAt: DateTime!
1540
+ }
1541
+
1542
+ type PartnerMemberCustomer {
1543
+ email: String
1544
+ emailVerified: Boolean!
1545
+ name: String
1546
+ phoneNumber: String
1547
+ uid: String!
1548
+ }
1549
+
1550
+ type PartnerMemberTier {
1551
+ name: String!
1552
+ passType: MembershipPassType!
1553
+ slug: String!
1554
+ uid: String!
1555
+ }
1556
+
1557
+ type PartnerMembershipTier {
1558
+ """Memberships currently ACTIVE or PAST_DUE on this tier"""
1559
+ activeMemberCount: Int!
1560
+ benefits: [String!]!
1561
+ billingInterval: MembershipBillingInterval
1562
+ createdAt: DateTime!
1563
+ """ISO 4217 currency code"""
1564
+ currencyCode: String!
1565
+ description: String
1566
+ durationDays: Int
1567
+ expiryType: MembershipExpiryType
1568
+ fixedEndDate: DateTime
1569
+ isActive: Boolean!
1570
+ isPublic: Boolean!
1571
+ memberLimit: Int
1572
+ name: String!
1573
+ """
1574
+ Amount in hundredths of the currency's major unit (always x100, including zero-decimal currencies such as JPY)
1575
+ """
1576
+ oneTimePrice: Int
1577
+ passType: MembershipPassType!
1578
+ """
1579
+ Amount in hundredths of the currency's major unit (always x100, including zero-decimal currencies such as JPY)
1580
+ """
1581
+ price: Int!
1582
+ slug: String!
1583
+ sortOrder: Int!
1584
+ supplyCap: Int
1585
+ totalUses: Int
1586
+ trialDays: Int!
1587
+ uid: ID!
1588
+ updatedAt: DateTime!
1589
+ """
1590
+ Amount in hundredths of the currency's major unit (always x100, including zero-decimal currencies such as JPY)
1591
+ """
1592
+ yearlyPrice: Int
1593
+ }
1594
+
1363
1595
  type Query {
1596
+ """List the authenticated partner brand's membership rows; PENDING is excluded by default."""
1597
+ getPartnerMembers(input: GetPartnerMembersInput): GetPartnerMembersResponse!
1598
+
1599
+ """List the authenticated partner brand's non-deleted membership tiers, including inactive and private tiers."""
1600
+ getPartnerMembershipTiers(input: GetPartnerMembershipTiersInput): GetPartnerMembershipTiersResponse!
1601
+
1364
1602
  """Get the authenticated agent operator email for the approval preview. Requires a brand-agent session with SEND_EMAIL; unavailable to partner API keys."""
1365
1603
  getPartnerAgentEmailContext: BrandAgentEmailContext!
1366
1604
  getAgentMediaUpload(uid: String!): AgentMediaUploadReservation!
@@ -1433,15 +1671,21 @@ type Query {
1433
1671
  ): PartnerMomentAttendanceStats
1434
1672
 
1435
1673
  """
1436
- Get paginated tickets for a moment.
1674
+ Get confirmed tickets for a moment owned by the partner token's brand.
1675
+ Use the user filter when retrieving an attendee's tickets for QR display.
1676
+ The partner token authorizes brand access, not the app user's identity.
1677
+ Follow hasNextPage/nextCursor to retrieve every ticket.
1437
1678
  """
1438
1679
  getPartnerTicketsForMoment(
1439
1680
  momentSlug: String!
1440
1681
  """Cursor UID for pagination"""
1441
1682
  cursor: String
1683
+ """Page size. Defaults to 50; maximum 100."""
1442
1684
  take: Int
1443
1685
  """Filter by check-in status"""
1444
1686
  checkedIn: Boolean
1687
+ """Match the current ticket owner by exactly one of userUid, email, or phoneNumber."""
1688
+ user: PartnerTicketUserLookupInput
1445
1689
  ): GetTicketsResponse!
1446
1690
 
1447
1691
  """
@@ -1805,7 +2049,25 @@ input PostSubscriptionMessageInput {
1805
2049
  push: PostSubscriptionPushInput
1806
2050
  }
1807
2051
 
2052
+ input CreatePartnerBrandDropInput {
2053
+ name: String!
2054
+ subtitle: String
2055
+ disclosures: String
2056
+ isPublic: Boolean
2057
+ """Only SUBSCRIBE is supported for partner-created drops."""
2058
+ ctaType: BrandDropCtaType!
2059
+ captureName: Boolean
2060
+ captureEmail: Boolean
2061
+ consentText: String
2062
+ """Active image asset belonging to the authenticated brand."""
2063
+ coverImageUid: String!
2064
+ coverImageMobileUid: String
2065
+ brandListUids: [String!]
2066
+ }
2067
+
1808
2068
  input CreatePartnerBrandSubscriptionInput {
2069
+ """Optional SUBSCRIBE drop UID belonging to the authenticated partner brand."""
2070
+ dropUid: String
1809
2071
  compliance: SubscriptionComplianceInput
1810
2072
 
1811
2073
  """
@@ -1892,6 +2154,9 @@ type CreatePartnerBrandSubscriptionResponse {
1892
2154
  # ─── Mutations ────────────────────────────────────────────────────────────────
1893
2155
 
1894
2156
  type Mutation {
2157
+ """Log a payment received off-site. Brand scope comes from the authenticated token or agent session. Amount is in ITM cents (major units times 100). Retain requestUid across retries."""
2158
+ createPartnerManualContribution(input: CreateManualContributionInput!): ContributionAdmin!
2159
+
1895
2160
  reserveAgentMediaUpload(input: ReserveAgentMediaUploadInput!): AgentMediaUploadReservation!
1896
2161
  finishAgentMediaUpload(uid: String!): Boolean!
1897
2162
 
@@ -1916,6 +2181,9 @@ type Mutation {
1916
2181
  reservationUid: String
1917
2182
  ): MediaAsset!
1918
2183
 
2184
+ """Create a SUBSCRIBE drop for the authenticated partner brand."""
2185
+ createPartnerBrandDrop(input: CreatePartnerBrandDropInput!): BrandDrop!
2186
+
1919
2187
  """
1920
2188
  Subscribe a user to the authenticated partner brand.
1921
2189
  Set requireOtpVerification to true to start a two-step OTP flow.