@itm-studio/partner-sdk 0.4.0 → 0.4.2
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 +321 -1
- package/dist/index.d.mts +179 -1
- package/dist/index.d.ts +179 -1
- package/dist/index.js +339 -115
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +339 -115
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
- package/schema/partner.graphql +173 -0
package/package.json
CHANGED
package/schema/partner.graphql
CHANGED
|
@@ -1612,7 +1612,160 @@ type PartnerMembershipTier {
|
|
|
1612
1612
|
yearlyPrice: Int
|
|
1613
1613
|
}
|
|
1614
1614
|
|
|
1615
|
+
# Login with ITM apps and headless partner login
|
|
1616
|
+
"""Whether a Login with ITM app can sign users in."""
|
|
1617
|
+
enum BrandAppStatus {
|
|
1618
|
+
ACTIVE
|
|
1619
|
+
DISABLED
|
|
1620
|
+
}
|
|
1621
|
+
|
|
1622
|
+
enum ConsentChannel {
|
|
1623
|
+
EMAIL
|
|
1624
|
+
PUSH
|
|
1625
|
+
SMS
|
|
1626
|
+
}
|
|
1627
|
+
|
|
1628
|
+
enum ConsentPromptCategory {
|
|
1629
|
+
CUSTOM
|
|
1630
|
+
MARKETING
|
|
1631
|
+
PRIVACY
|
|
1632
|
+
TERMS
|
|
1633
|
+
}
|
|
1634
|
+
|
|
1635
|
+
enum LoginCodeChannel {
|
|
1636
|
+
CALL
|
|
1637
|
+
EMAIL
|
|
1638
|
+
SMS
|
|
1639
|
+
WHATSAPP
|
|
1640
|
+
}
|
|
1641
|
+
|
|
1642
|
+
"""
|
|
1643
|
+
A brand-owned Login with ITM application: a public OAuth/OIDC client that uses PKCE and has no secret.
|
|
1644
|
+
"""
|
|
1645
|
+
type BrandApp {
|
|
1646
|
+
"""Public OAuth client_id. It is not a secret."""
|
|
1647
|
+
clientId: String!
|
|
1648
|
+
createdAt: DateTime!
|
|
1649
|
+
|
|
1650
|
+
"""
|
|
1651
|
+
OpenID Connect issuer URL apps authenticate against; null when Login with ITM is not configured.
|
|
1652
|
+
"""
|
|
1653
|
+
issuer: String
|
|
1654
|
+
name: String!
|
|
1655
|
+
|
|
1656
|
+
"""
|
|
1657
|
+
Exact redirect URIs. All share one origin; that origin may call the token and userinfo endpoints and hand logins to ITM embeds.
|
|
1658
|
+
"""
|
|
1659
|
+
redirectUris: [String!]!
|
|
1660
|
+
status: BrandAppStatus!
|
|
1661
|
+
uid: String!
|
|
1662
|
+
}
|
|
1663
|
+
|
|
1664
|
+
input CreateBrandAppInput {
|
|
1665
|
+
name: String!
|
|
1666
|
+
|
|
1667
|
+
"""
|
|
1668
|
+
Exact https redirect URIs (http is allowed only for localhost) on a single origin.
|
|
1669
|
+
"""
|
|
1670
|
+
redirectUris: [String!]!
|
|
1671
|
+
}
|
|
1672
|
+
|
|
1673
|
+
type CheckoutMarketingConsentPrompt {
|
|
1674
|
+
bodyMarkdown: String
|
|
1675
|
+
category: ConsentPromptCategory!
|
|
1676
|
+
channels: [ConsentChannel!]!
|
|
1677
|
+
labelMarkdown: String!
|
|
1678
|
+
promptUid: String!
|
|
1679
|
+
required: Boolean!
|
|
1680
|
+
version: Int!
|
|
1681
|
+
}
|
|
1682
|
+
|
|
1683
|
+
input CheckoutMarketingConsentInput {
|
|
1684
|
+
accepted: Boolean!
|
|
1685
|
+
language: String
|
|
1686
|
+
pageUrl: String
|
|
1687
|
+
referrerUrl: String
|
|
1688
|
+
screenHeight: Int
|
|
1689
|
+
screenWidth: Int
|
|
1690
|
+
submittedAt: DateTime
|
|
1691
|
+
timezone: String
|
|
1692
|
+
}
|
|
1693
|
+
|
|
1694
|
+
"""
|
|
1695
|
+
Starts a headless Login with ITM sign-in from the brand's server: ITM sends a code that only verifyPartnerAppLogin accepts for this app and partner credential.
|
|
1696
|
+
"""
|
|
1697
|
+
input StartPartnerAppLoginInput {
|
|
1698
|
+
"""The app's public client ID."""
|
|
1699
|
+
clientId: String!
|
|
1700
|
+
|
|
1701
|
+
"""
|
|
1702
|
+
The visitor's request details. ipAddress (the visitor's, not your server's) is required.
|
|
1703
|
+
"""
|
|
1704
|
+
compliance: SubscriptionComplianceInput!
|
|
1705
|
+
|
|
1706
|
+
"""Phone number or email address."""
|
|
1707
|
+
identifier: String!
|
|
1708
|
+
}
|
|
1709
|
+
|
|
1710
|
+
type PartnerAppLoginChallenge {
|
|
1711
|
+
channel: LoginCodeChannel!
|
|
1712
|
+
destinationHint: String
|
|
1713
|
+
|
|
1714
|
+
"""
|
|
1715
|
+
Show this text verbatim with the code field: it is what signing in shares.
|
|
1716
|
+
"""
|
|
1717
|
+
disclosure: String!
|
|
1718
|
+
expiresAt: DateTime!
|
|
1719
|
+
|
|
1720
|
+
"""
|
|
1721
|
+
Optional marketing opt-in. Render verbatim as an unchecked checkbox; signing in must not depend on it.
|
|
1722
|
+
"""
|
|
1723
|
+
marketingConsentPrompt: CheckoutMarketingConsentPrompt!
|
|
1724
|
+
}
|
|
1725
|
+
|
|
1726
|
+
input VerifyPartnerAppLoginInput {
|
|
1727
|
+
clientId: String!
|
|
1728
|
+
code: String!
|
|
1729
|
+
|
|
1730
|
+
"""The visitor's request details. ipAddress is required."""
|
|
1731
|
+
compliance: SubscriptionComplianceInput!
|
|
1732
|
+
|
|
1733
|
+
"""
|
|
1734
|
+
The identifier the code was sent to. Read it from your own session, not from the browser.
|
|
1735
|
+
"""
|
|
1736
|
+
identifier: String!
|
|
1737
|
+
|
|
1738
|
+
"""
|
|
1739
|
+
Send only when the visitor ticked the opt-in (accepted: true; pageUrl here or in compliance). Omit it otherwise; omission never unsubscribes anyone.
|
|
1740
|
+
"""
|
|
1741
|
+
marketingConsent: CheckoutMarketingConsentInput
|
|
1742
|
+
}
|
|
1743
|
+
|
|
1744
|
+
type PartnerAppLoginProfile {
|
|
1745
|
+
email: String
|
|
1746
|
+
emailVerified: Boolean!
|
|
1747
|
+
name: String
|
|
1748
|
+
phoneNumber: String
|
|
1749
|
+
phoneVerified: Boolean!
|
|
1750
|
+
}
|
|
1751
|
+
|
|
1752
|
+
"""
|
|
1753
|
+
A completed headless sign-in. It is not a credential: keep your own session keyed by customerUid.
|
|
1754
|
+
"""
|
|
1755
|
+
type PartnerAppLogin {
|
|
1756
|
+
"""
|
|
1757
|
+
The person's customer UID for your brand (getPartnerAudience customer uid).
|
|
1758
|
+
"""
|
|
1759
|
+
customerUid: String!
|
|
1760
|
+
profile: PartnerAppLoginProfile!
|
|
1761
|
+
}
|
|
1762
|
+
|
|
1615
1763
|
type Query {
|
|
1764
|
+
"""
|
|
1765
|
+
The brand's Login with ITM apps (at most 20), oldest first. Deleted apps are omitted.
|
|
1766
|
+
"""
|
|
1767
|
+
getPartnerBrandApps: [BrandApp!]!
|
|
1768
|
+
|
|
1616
1769
|
"""List the authenticated partner brand's membership rows; PENDING is excluded by default."""
|
|
1617
1770
|
getPartnerMembers(input: GetPartnerMembersInput): GetPartnerMembersResponse!
|
|
1618
1771
|
|
|
@@ -2180,6 +2333,26 @@ type CreatePartnerBrandSubscriptionResponse {
|
|
|
2180
2333
|
# ─── Mutations ────────────────────────────────────────────────────────────────
|
|
2181
2334
|
|
|
2182
2335
|
type Mutation {
|
|
2336
|
+
"""
|
|
2337
|
+
Registers a Login with ITM app for the brand. A brand can have up to 20 apps.
|
|
2338
|
+
"""
|
|
2339
|
+
createPartnerBrandApp(input: CreateBrandAppInput!): BrandApp!
|
|
2340
|
+
|
|
2341
|
+
"""
|
|
2342
|
+
Disables an app: new logins stop and its tokens and remembered consents are revoked immediately. A partner key cannot re-enable it; ask ITM.
|
|
2343
|
+
"""
|
|
2344
|
+
disablePartnerBrandApp(appUid: String!): BrandApp!
|
|
2345
|
+
|
|
2346
|
+
"""
|
|
2347
|
+
Sends a Login with ITM code for the brand's own sign-in form. Call it from your server; the response is the same whether or not the person has an ITM account.
|
|
2348
|
+
"""
|
|
2349
|
+
startPartnerAppLogin(input: StartPartnerAppLoginInput!): PartnerAppLoginChallenge!
|
|
2350
|
+
|
|
2351
|
+
"""
|
|
2352
|
+
Completes a headless sign-in: checks the code, adds the person to the brand's contacts and records an optional opt-in. Returns no ITM credential.
|
|
2353
|
+
"""
|
|
2354
|
+
verifyPartnerAppLogin(input: VerifyPartnerAppLoginInput!): PartnerAppLogin!
|
|
2355
|
+
|
|
2183
2356
|
"""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."""
|
|
2184
2357
|
createPartnerManualContribution(input: CreateManualContributionInput!): ContributionAdmin!
|
|
2185
2358
|
|