@itm-studio/partner-sdk 0.3.5 → 0.3.7

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.5",
3
+ "version": "0.3.7",
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",
@@ -438,6 +438,21 @@ enum TagSource {
438
438
  AUTO
439
439
  }
440
440
 
441
+ enum ContributionStatus {
442
+ EXPIRED
443
+ FAILED
444
+ PENDING
445
+ PROCESSING
446
+ REVIEW_REQUIRED
447
+ SUCCEEDED
448
+ }
449
+
450
+ enum ContributionPageStatusFilter {
451
+ ACCEPTING
452
+ ARCHIVED
453
+ PAUSED
454
+ }
455
+
441
456
  # ─── Types ───────────────────────────────────────────────────────────────────
442
457
 
443
458
  type Currency {
@@ -451,6 +466,102 @@ type Currency {
451
466
  updatedAt: DateTime!
452
467
  }
453
468
 
469
+ """
470
+ A contribution (tip/donation) page owned by the partner's brand, with confirmed
471
+ money totals. Amount fields are ITM cents (major units × 100, including
472
+ zero-decimal currencies). Totals are strings because they can exceed Int.
473
+ """
474
+ type ContributionPageAdmin {
475
+ uid: ID!
476
+ slug: String!
477
+ title: String!
478
+ description: String
479
+ """Legal/terms copy rendered beneath the page."""
480
+ finePrint: String
481
+ brandUid: String!
482
+ brandName: String!
483
+ brandSlug: String!
484
+ currency: Currency!
485
+ suggestedAmountsCents: [Int!]!
486
+ """Highlighted quick-pick; always one of suggestedAmountsCents."""
487
+ recommendedAmountCents: Int
488
+ minimumAmountCents: Int
489
+ maximumAmountCents: Int
490
+ requireItmAccount: Boolean!
491
+ """Shows an optional note field at checkout."""
492
+ allowContributorNote: Boolean!
493
+ isAccepting: Boolean!
494
+ """True when the page is accepting, not archived, and its payout account is verified."""
495
+ canContribute: Boolean!
496
+ """Public checkout URL for this page on ITM."""
497
+ publicUrl: String!
498
+ """Data URL of a QR code that resolves to publicUrl."""
499
+ qrCodeImageUrl: String!
500
+ archivedAt: DateTime
501
+ successfulContributionCount: Int!
502
+ """Number of successful refunds."""
503
+ refundCount: Int!
504
+ grossAmountCents: String!
505
+ refundedAmountCents: String!
506
+ """Brand net after platform and processing fees, reduced pro rata by successful refunds."""
507
+ netAmountCents: String!
508
+ createdAt: DateTime!
509
+ updatedAt: DateTime!
510
+ }
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
+
535
+ """
536
+ A single contribution to one of the brand's contribution pages.
537
+ Only SUCCEEDED contributions represent confirmed money.
538
+ """
539
+ type ContributionAdmin {
540
+ uid: ID!
541
+ contributionPageUid: String!
542
+ """Page title snapshotted at checkout."""
543
+ pageTitle: String!
544
+ donorName: String!
545
+ donorEmail: String
546
+ donorPhoneNumber: String
547
+ source: ContributionSource!
548
+ userUid: String
549
+ manualReceiptType: ManualContributionReceiptType
550
+ """Note left by the contributor at checkout; null when none was given."""
551
+ note: String
552
+ currencyCode: String!
553
+ amountCents: Int!
554
+ refundedAmountCents: Int!
555
+ status: ContributionStatus!
556
+ paidAt: DateTime
557
+ """Paid without an ITM account."""
558
+ isGuest: Boolean!
559
+ """When a guest contribution was linked to an ITM account."""
560
+ claimedAt: DateTime
561
+ createdAt: DateTime!
562
+ updatedAt: DateTime!
563
+ }
564
+
454
565
  """
455
566
  The authenticated partner's brand identity and public-facing details.
456
567
  The brand is derived from the partner token and cannot be selected by UID or slug.
@@ -480,6 +591,18 @@ type Venue {
480
591
  updatedAt: DateTime!
481
592
  }
482
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
+
483
606
  """
484
607
  A slim projection of the cover image media asset.
485
608
  Only the publicly useful fields (URL and MIME type) are exposed.
@@ -540,7 +663,10 @@ type Moment {
540
663
  lineupDisplayLabel: MomentLineupDisplayLabel!
541
664
  """Cover image for the moment. Null if no cover image is set."""
542
665
  coverImage: MomentCoverImage!
666
+ """Full venue details. Null when no venue is set or the caller cannot reveal it."""
543
667
  venue: Venue
668
+ """Public city/country location text. Null when no venue is set."""
669
+ publicVenuePreview: MomentPublicVenuePreview
544
670
  """Public tag assignments owned by the authenticated partner's brand."""
545
671
  momentTags(
546
672
  pagination: PaginationInput
@@ -602,6 +728,13 @@ type Ticket {
602
728
  uid: ID!
603
729
  price: Float!
604
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
+ """
605
738
  encryptedQRCode: String!
606
739
  notes: String
607
740
  externalId: String
@@ -735,6 +868,17 @@ enum EventImportPlatform {
735
868
  EVENTBRITE
736
869
  }
737
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
+
738
882
  input PartnerMomentAttendanceLookupInput {
739
883
  """
740
884
  ITM moment UID. Provide exactly one of momentUid, momentSlug, or externalPlatform with externalId.
@@ -883,6 +1027,20 @@ type GetPartnerDropsResponse {
883
1027
  nextCursor: String
884
1028
  }
885
1029
 
1030
+ type ContributionPagesResponse {
1031
+ items: [ContributionPageAdmin!]!
1032
+ totalCount: Int!
1033
+ hasNextPage: Boolean!
1034
+ nextCursor: String
1035
+ }
1036
+
1037
+ type ContributionsResponse {
1038
+ items: [ContributionAdmin!]!
1039
+ totalCount: Int!
1040
+ hasNextPage: Boolean!
1041
+ nextCursor: String
1042
+ }
1043
+
886
1044
  type GetMomentLineupsResponse {
887
1045
  lineups: [MomentLineup!]!
888
1046
  totalCount: Int!
@@ -1262,7 +1420,185 @@ type AgentMediaUploadReservation {
1262
1420
  mediaAsset: MediaAsset
1263
1421
  }
1264
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
+
1265
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
+
1266
1602
  """Get the authenticated agent operator email for the approval preview. Requires a brand-agent session with SEND_EMAIL; unavailable to partner API keys."""
1267
1603
  getPartnerAgentEmailContext: BrandAgentEmailContext!
1268
1604
  getAgentMediaUpload(uid: String!): AgentMediaUploadReservation!
@@ -1335,15 +1671,21 @@ type Query {
1335
1671
  ): PartnerMomentAttendanceStats
1336
1672
 
1337
1673
  """
1338
- 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.
1339
1678
  """
1340
1679
  getPartnerTicketsForMoment(
1341
1680
  momentSlug: String!
1342
1681
  """Cursor UID for pagination"""
1343
1682
  cursor: String
1683
+ """Page size. Defaults to 50; maximum 100."""
1344
1684
  take: Int
1345
1685
  """Filter by check-in status"""
1346
1686
  checkedIn: Boolean
1687
+ """Match the current ticket owner by exactly one of userUid, email, or phoneNumber."""
1688
+ user: PartnerTicketUserLookupInput
1347
1689
  ): GetTicketsResponse!
1348
1690
 
1349
1691
  """
@@ -1382,6 +1724,36 @@ type Query {
1382
1724
  take: Int
1383
1725
  ): GetBrandEchoesForUserResponse!
1384
1726
 
1727
+ """
1728
+ Paginated contribution pages for the brand associated with the partner token,
1729
+ newest first. Each page carries its public checkout URL and confirmed totals.
1730
+ """
1731
+ getPartnerContributionPages(
1732
+ """ACCEPTING, PAUSED or ARCHIVED; omit for all pages."""
1733
+ status: ContributionPageStatusFilter
1734
+ """Case-insensitive search over title and slug."""
1735
+ search: String
1736
+ cursor: String
1737
+ """1–100, default 25."""
1738
+ take: Int
1739
+ ): ContributionPagesResponse!
1740
+
1741
+ """
1742
+ Paginated contributions for the brand associated with the partner token,
1743
+ newest first. Filter status: SUCCEEDED for confirmed contributors.
1744
+ """
1745
+ getPartnerContributions(
1746
+ """Restrict to one contribution page owned by the brand."""
1747
+ contributionPageUid: String
1748
+ """Omit for all statuses; SUCCEEDED lists paid contributions."""
1749
+ status: ContributionStatus
1750
+ """Case-insensitive search over donor name and email."""
1751
+ search: String
1752
+ cursor: String
1753
+ """1–100, default 25."""
1754
+ take: Int
1755
+ ): ContributionsResponse!
1756
+
1385
1757
  """
1386
1758
  Get paginated ticket tiers for a partner-owned moment.
1387
1759
  Provide either momentSlug or momentUid. Omitted isActive defaults to active tiers only.
@@ -1764,6 +2136,9 @@ type CreatePartnerBrandSubscriptionResponse {
1764
2136
  # ─── Mutations ────────────────────────────────────────────────────────────────
1765
2137
 
1766
2138
  type Mutation {
2139
+ """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."""
2140
+ createPartnerManualContribution(input: CreateManualContributionInput!): ContributionAdmin!
2141
+
1767
2142
  reserveAgentMediaUpload(input: ReserveAgentMediaUploadInput!): AgentMediaUploadReservation!
1768
2143
  finishAgentMediaUpload(uid: String!): Boolean!
1769
2144