diff --git a/src/graphql/schema.graphql b/src/graphql/schema.graphql index f9ec279f..14cb2997 100644 --- a/src/graphql/schema.graphql +++ b/src/graphql/schema.graphql @@ -57,7 +57,7 @@ interface CollectiveInterface { endsAt: DateString timezone: String hostFeePercent: Float - platformFeePercent: Int + platformFeePercent: Float currency: String image: String imageUrl(height: Int, format: ImageFormat): String @@ -175,10 +175,11 @@ interface CollectiveInterface { """ supportedExpenseTypes: [String!]! role: String - twitterHandle: String + twitterHandle: String @deprecated(reason: "2023-01-16: Please use socialLinks") githubHandle: String @deprecated(reason: "2022-06-03: Please use repositoryUrl") - repositoryUrl: String - website: String + repositoryUrl: String @deprecated(reason: "2023-01-16: Please use socialLinks") + website: String @deprecated(reason: "2023-01-16: Please use socialLinks") + socialLinks: [SocialLink!]! updates(limit: Int, offset: Int, onlyPublishedUpdates: Boolean): [UpdateType] @deprecated(reason: "2022-09-09: Updates moved to GQLV2") events( @@ -287,6 +288,13 @@ type UserDetails { """ isLimited: Boolean hasSeenLatestChangelogEntry: Boolean! + hasTwoFactorAuth: Boolean + + """ + Has the account a password set? + """ + hasPassword: Boolean + isRoot: Boolean! } """ @@ -542,7 +550,7 @@ type Contributor { """ True if the contributor is a fundraiser """ - isFundraiser: Boolean! + isFundraiser: Boolean @deprecated(reason: "2022-09-12: This role does not exist anymore") """ A list of tier ids that this contributors is a member of. A null value indicates that a membership without tier. @@ -609,7 +617,6 @@ enum ContributorRole { MEMBER CONTRIBUTOR BACKER - FUNDRAISER ATTENDEE FOLLOWER CONNECTED_COLLECTIVE @@ -758,6 +765,7 @@ enum OrderStatus { REQUIRE_CLIENT_CONFIRMATION PAID ERROR + PROCESSING ACTIVE CANCELLED PENDING @@ -979,6 +987,52 @@ type ExpenseAttachedFile { url: String } +""" +A social link +""" +type SocialLink { + type: SocialLinkType! + url: URL! + createdAt: DateTime + updatedAt: DateTime +} + +""" +The type of social link +""" +enum SocialLinkType { + TWITTER + TUMBLR + MASTODON + MATTERMOST + SLACK + LINKEDIN + MEETUP + FACEBOOK + INSTAGRAM + DISCORD + YOUTUBE + GITHUB + GITLAB + GIT + WEBSITE + DISCOURSE + PIXELFED + GHOST + PEERTUBE + TIKTOK +} + +""" +A field whose value conforms to the standard URL format as specified in RFC3986: https://www.ietf.org/rfc/rfc3986.txt. +""" +scalar URL + +""" +A date-time string at UTC, such as 2007-12-03T10:15:30Z, compliant with the `date-time` format outlined in section 5.6 of the RFC 3339 profile of the ISO 8601 standard for representation of dates and times using the Gregorian calendar. +""" +scalar DateTime + """ This represents an Update """ @@ -1116,6 +1170,7 @@ type CollectiveFeatures { HOST_DASHBOARD: CollectiveFeatureStatus CONNECTED_ACCOUNTS: CollectiveFeatureStatus ALIPAY: CollectiveFeatureStatus + STRIPE_PAYMENT_INTENT: CollectiveFeatureStatus USE_PAYMENT_METHODS: CollectiveFeatureStatus EMIT_GIFT_CARDS: CollectiveFeatureStatus EMAIL_NOTIFICATIONS_PANEL: CollectiveFeatureStatus @@ -1167,8 +1222,17 @@ type PlanType { } type Policies { - EXPENSE_AUTHOR_CANNOT_APPROVE: Boolean + EXPENSE_AUTHOR_CANNOT_APPROVE: EXPENSE_AUTHOR_CANNOT_APPROVE + REQUIRE_2FA_FOR_ADMINS: Boolean COLLECTIVE_MINIMUM_ADMINS: COLLECTIVE_MINIMUM_ADMINS + MAXIMUM_VIRTUAL_CARD_LIMIT_AMOUNT_FOR_INTERVAL: MAXIMUM_VIRTUAL_CARD_LIMIT_AMOUNT_FOR_INTERVAL +} + +type EXPENSE_AUTHOR_CANNOT_APPROVE { + amountInCents: Int + enabled: Boolean + appliesToHostedCollectives: Boolean + appliesToSingleAdminCollectives: Boolean } type COLLECTIVE_MINIMUM_ADMINS { @@ -1185,6 +1249,751 @@ enum PolicyApplication { NEW_COLLECTIVES } +type MAXIMUM_VIRTUAL_CARD_LIMIT_AMOUNT_FOR_INTERVAL { + ALL_TIME: Amount + DAILY: Amount + MONTHLY: Amount + PER_AUTHORIZATION: Amount + WEEKLY: Amount + YEARLY: Amount +} + +""" +A financial amount. +""" +type Amount { + value: Float + currency: Currency + valueInCents: Float + + """ + If the amount was generated from a currency conversion, this field contains details about the conversion + """ + exchangeRate: CurrencyExchangeRate +} + +""" +All supported currencies +""" +enum Currency { + """ + US Dollar + """ + USD + + """ + UAE Dirham + """ + AED + + """ + Afghani + """ + AFN + + """ + Lek + """ + ALL + + """ + Armenian Dram + """ + AMD + + """ + Netherlands Antillean Guilder + """ + ANG + + """ + Kwanza + """ + AOA + + """ + Argentine Peso + """ + ARS + + """ + Australian Dollar + """ + AUD + + """ + Aruban Florin + """ + AWG + + """ + Azerbaijanian Manat + """ + AZN + + """ + Convertible Mark + """ + BAM + + """ + Barbados Dollar + """ + BBD + + """ + Taka + """ + BDT + + """ + Bulgarian Lev + """ + BGN + + """ + Burundi Franc + """ + BIF + + """ + Bermudian Dollar + """ + BMD + + """ + Brunei Dollar + """ + BND + + """ + Boliviano + """ + BOB + + """ + Brazilian Real + """ + BRL + + """ + Bahamian Dollar + """ + BSD + + """ + Pula + """ + BWP + + """ + Belarussian Ruble + """ + BYN + + """ + Belize Dollar + """ + BZD + + """ + Canadian Dollar + """ + CAD + + """ + Congolese Franc + """ + CDF + + """ + Swiss Franc + """ + CHF + + """ + Chilean Peso + """ + CLP + + """ + Yuan Renminbi + """ + CNY + + """ + Colombian Peso + """ + COP + + """ + Costa Rican Colon + """ + CRC + + """ + Cabo Verde Escudo + """ + CVE + + """ + Czech Koruna + """ + CZK + + """ + Djibouti Franc + """ + DJF + + """ + Danish Krone + """ + DKK + + """ + Dominican Peso + """ + DOP + + """ + Algerian Dinar + """ + DZD + + """ + Egyptian Pound + """ + EGP + + """ + Ethiopian Birr + """ + ETB + + """ + Euro + """ + EUR + + """ + Fiji Dollar + """ + FJD + + """ + Falkland Islands Pound + """ + FKP + + """ + Pound Sterling + """ + GBP + + """ + Lari + """ + GEL + + """ + Gibraltar Pound + """ + GIP + + """ + Dalasi + """ + GMD + + """ + Guinea Franc + """ + GNF + + """ + Quetzal + """ + GTQ + + """ + Guyana Dollar + """ + GYD + + """ + Hong Kong Dollar + """ + HKD + + """ + Lempira + """ + HNL + + """ + Kuna + """ + HRK + + """ + Gourde + """ + HTG + + """ + Forint + """ + HUF + + """ + Rupiah + """ + IDR + + """ + New Israeli Sheqel + """ + ILS + + """ + Indian Rupee + """ + INR + + """ + Iceland Krona + """ + ISK + + """ + Jamaican Dollar + """ + JMD + + """ + Yen + """ + JPY + + """ + Kenyan Shilling + """ + KES + + """ + Som + """ + KGS + + """ + Riel + """ + KHR + + """ + Comoro Franc + """ + KMF + + """ + Won + """ + KRW + + """ + Cayman Islands Dollar + """ + KYD + + """ + Tenge + """ + KZT + + """ + Kip + """ + LAK + + """ + Lebanese Pound + """ + LBP + + """ + Sri Lanka Rupee + """ + LKR + + """ + Liberian Dollar + """ + LRD + + """ + Loti + """ + LSL + + """ + Moroccan Dirham + """ + MAD + + """ + Moldovan Leu + """ + MDL + + """ + Malagasy Ariary + """ + MGA + + """ + Denar + """ + MKD + + """ + Kyat + """ + MMK + + """ + Tugrik + """ + MNT + + """ + Pataca + """ + MOP + + """ + Mauritius Rupee + """ + MUR + + """ + Rufiyaa + """ + MVR + + """ + Kwacha + """ + MWK + + """ + Mexican Peso + """ + MXN + + """ + Malaysian Ringgit + """ + MYR + + """ + Mozambique Metical + """ + MZN + + """ + Namibia Dollar + """ + NAD + + """ + Naira + """ + NGN + + """ + Cordoba Oro + """ + NIO + + """ + Norwegian Krone + """ + NOK + + """ + Nepalese Rupee + """ + NPR + + """ + New Zealand Dollar + """ + NZD + + """ + Balboa + """ + PAB + + """ + Nuevo Sol + """ + PEN + + """ + Kina + """ + PGK + + """ + Philippine Peso + """ + PHP + + """ + Pakistan Rupee + """ + PKR + + """ + Zloty + """ + PLN + + """ + Guarani + """ + PYG + + """ + Qatari Rial + """ + QAR + + """ + Romanian Leu + """ + RON + + """ + Serbian Dinar + """ + RSD + + """ + Russian Ruble + """ + RUB + + """ + Rwanda Franc + """ + RWF + + """ + Saudi Riyal + """ + SAR + + """ + Solomon Islands Dollar + """ + SBD + + """ + Seychelles Rupee + """ + SCR + + """ + Swedish Krona + """ + SEK + + """ + Singapore Dollar + """ + SGD + + """ + Saint Helena Pound + """ + SHP + + """ + Leone + """ + SLL + + """ + Somali Shilling + """ + SOS + + """ + Surinam Dollar + """ + SRD + + """ + Lilangeni + """ + SZL + + """ + Baht + """ + THB + + """ + Somoni + """ + TJS + + """ + Pa’anga + """ + TOP + + """ + Turkish Lira + """ + TRY + + """ + Trinidad and Tobago Dollar + """ + TTD + + """ + New Taiwan Dollar + """ + TWD + + """ + Tanzanian Shilling + """ + TZS + + """ + Hryvnia + """ + UAH + + """ + Uganda Shilling + """ + UGX + + """ + Peso Uruguayo + """ + UYU + + """ + Uzbekistan Sum + """ + UZS + + """ + Dong + """ + VND + + """ + Vatu + """ + VUV + + """ + Tala + """ + WST + + """ + CFA Franc BEAC + """ + XAF + + """ + East Caribbean Dollar + """ + XCD + + """ + CFA Franc BCEAO + """ + XOF + + """ + CFP Franc + """ + XPF + + """ + Yemeni Rial + """ + YER + + """ + Rand + """ + ZAR + + """ + Zambian Kwacha + """ + ZMW +} + +""" +Fields for a currency fx rate +""" +type CurrencyExchangeRate { + """ + Exchange rate value as a scalar (e.g 1.15 or 0.86) + """ + value: Float! + + """ + Where does the FX rate comes from + """ + source: CurrencyExchangeRateSourceType! + fromCurrency: Currency! + toCurrency: Currency! + + """ + Date of the FX rate + """ + date: DateTime! + + """ + Is the FX rate approximate or a fixed value? + """ + isApproximate: Boolean! +} + +""" +Where does the FX rate come from +""" +enum CurrencyExchangeRateSourceType { + """ + Open Collective internal system, relying on caching and 3rd party APIs + """ + OPENCOLLECTIVE + + """ + PayPal API + """ + PAYPAL + + """ + Wise API + """ + WISE +} + """ The results from searching for collectives with pagination info """ @@ -1400,7 +2209,7 @@ type Collective implements CollectiveInterface { endsAt: DateString timezone: String hostFeePercent: Float - platformFeePercent: Int + platformFeePercent: Float currency: String image: String imageUrl(height: Int, format: ImageFormat): String @@ -1432,6 +2241,11 @@ type Collective implements CollectiveInterface { """ isTrustedHost: Boolean! + """ + Returns whether this user has two factor authentication enabled + """ + isTwoFactorAuthEnabled: Boolean + """ Returns whether this host accepts applications for new collectives """ @@ -1550,14 +2364,15 @@ type Collective implements CollectiveInterface { """ supportedExpenseTypes: [String!]! role: String - twitterHandle: String + twitterHandle: String @deprecated(reason: "2023-01-16: Please use socialLinks") githubHandle: String @deprecated(reason: "2022-06-03: Please use repositoryUrl") """ The URL of the repository """ - repositoryUrl: String - website: String + repositoryUrl: String @deprecated(reason: "2023-01-16: Please use socialLinks") + website: String @deprecated(reason: "2023-01-16: Please use socialLinks") + socialLinks: [SocialLink!]! updates(limit: Int, offset: Int, onlyPublishedUpdates: Boolean): [UpdateType] @deprecated(reason: "2022-09-09: Updates moved to GQLV2") events( @@ -1652,7 +2467,7 @@ type Event implements CollectiveInterface { endsAt: DateString timezone: String hostFeePercent: Float - platformFeePercent: Int + platformFeePercent: Float currency: String image: String imageUrl(height: Int, format: ImageFormat): String @@ -1684,6 +2499,11 @@ type Event implements CollectiveInterface { """ isTrustedHost: Boolean! + """ + Returns whether this user has two factor authentication enabled + """ + isTwoFactorAuthEnabled: Boolean + """ Returns whether this host accepts applications for new collectives """ @@ -1802,14 +2622,15 @@ type Event implements CollectiveInterface { """ supportedExpenseTypes: [String!]! role: String - twitterHandle: String + twitterHandle: String @deprecated(reason: "2023-01-16: Please use socialLinks") githubHandle: String @deprecated(reason: "2022-06-03: Please use repositoryUrl") """ The URL of the repository """ - repositoryUrl: String - website: String + repositoryUrl: String @deprecated(reason: "2023-01-16: Please use socialLinks") + website: String @deprecated(reason: "2023-01-16: Please use socialLinks") + socialLinks: [SocialLink!]! updates(limit: Int, offset: Int, onlyPublishedUpdates: Boolean): [UpdateType] @deprecated(reason: "2022-09-09: Updates moved to GQLV2") events( @@ -1904,7 +2725,7 @@ type Fund implements CollectiveInterface { endsAt: DateString timezone: String hostFeePercent: Float - platformFeePercent: Int + platformFeePercent: Float currency: String image: String imageUrl(height: Int, format: ImageFormat): String @@ -1936,6 +2757,11 @@ type Fund implements CollectiveInterface { """ isTrustedHost: Boolean! + """ + Returns whether this user has two factor authentication enabled + """ + isTwoFactorAuthEnabled: Boolean + """ Returns whether this host accepts applications for new collectives """ @@ -2054,14 +2880,15 @@ type Fund implements CollectiveInterface { """ supportedExpenseTypes: [String!]! role: String - twitterHandle: String + twitterHandle: String @deprecated(reason: "2023-01-16: Please use socialLinks") githubHandle: String @deprecated(reason: "2022-06-03: Please use repositoryUrl") """ The URL of the repository """ - repositoryUrl: String - website: String + repositoryUrl: String @deprecated(reason: "2023-01-16: Please use socialLinks") + website: String @deprecated(reason: "2023-01-16: Please use socialLinks") + socialLinks: [SocialLink!]! updates(limit: Int, offset: Int, onlyPublishedUpdates: Boolean): [UpdateType] @deprecated(reason: "2022-09-09: Updates moved to GQLV2") events( @@ -2156,7 +2983,7 @@ type Organization implements CollectiveInterface { endsAt: DateString timezone: String hostFeePercent: Float - platformFeePercent: Int + platformFeePercent: Float currency: String image: String imageUrl(height: Int, format: ImageFormat): String @@ -2188,6 +3015,11 @@ type Organization implements CollectiveInterface { """ isTrustedHost: Boolean! + """ + Returns whether this user has two factor authentication enabled + """ + isTwoFactorAuthEnabled: Boolean + """ Returns whether this host accepts applications for new collectives """ @@ -2306,14 +3138,15 @@ type Organization implements CollectiveInterface { """ supportedExpenseTypes: [String!]! role: String - twitterHandle: String + twitterHandle: String @deprecated(reason: "2023-01-16: Please use socialLinks") githubHandle: String @deprecated(reason: "2022-06-03: Please use repositoryUrl") """ The URL of the repository """ - repositoryUrl: String - website: String + repositoryUrl: String @deprecated(reason: "2023-01-16: Please use socialLinks") + website: String @deprecated(reason: "2023-01-16: Please use socialLinks") + socialLinks: [SocialLink!]! updates(limit: Int, offset: Int, onlyPublishedUpdates: Boolean): [UpdateType] @deprecated(reason: "2022-09-09: Updates moved to GQLV2") events( @@ -2409,7 +3242,7 @@ type Project implements CollectiveInterface { endsAt: DateString timezone: String hostFeePercent: Float - platformFeePercent: Int + platformFeePercent: Float currency: String image: String imageUrl(height: Int, format: ImageFormat): String @@ -2441,6 +3274,11 @@ type Project implements CollectiveInterface { """ isTrustedHost: Boolean! + """ + Returns whether this user has two factor authentication enabled + """ + isTwoFactorAuthEnabled: Boolean + """ Returns whether this host accepts applications for new collectives """ @@ -2559,14 +3397,15 @@ type Project implements CollectiveInterface { """ supportedExpenseTypes: [String!]! role: String - twitterHandle: String + twitterHandle: String @deprecated(reason: "2023-01-16: Please use socialLinks") githubHandle: String @deprecated(reason: "2022-06-03: Please use repositoryUrl") """ The URL of the repository """ - repositoryUrl: String - website: String + repositoryUrl: String @deprecated(reason: "2023-01-16: Please use socialLinks") + website: String @deprecated(reason: "2023-01-16: Please use socialLinks") + socialLinks: [SocialLink!]! updates(limit: Int, offset: Int, onlyPublishedUpdates: Boolean): [UpdateType] @deprecated(reason: "2022-09-09: Updates moved to GQLV2") events( @@ -2903,7 +3742,7 @@ type User implements CollectiveInterface { endsAt: DateString timezone: String hostFeePercent: Float - platformFeePercent: Int + platformFeePercent: Float currency: String image: String imageUrl(height: Int, format: ImageFormat): String @@ -2935,6 +3774,11 @@ type User implements CollectiveInterface { """ isTrustedHost: Boolean! + """ + Returns whether this user has two factor authentication enabled + """ + isTwoFactorAuthEnabled: Boolean + """ Returns whether this host accepts applications for new collectives """ @@ -3053,14 +3897,15 @@ type User implements CollectiveInterface { """ supportedExpenseTypes: [String!]! role: String - twitterHandle: String + twitterHandle: String @deprecated(reason: "2023-01-16: Please use socialLinks") githubHandle: String @deprecated(reason: "2022-06-03: Please use repositoryUrl") """ The URL of the repository """ - repositoryUrl: String - website: String + repositoryUrl: String @deprecated(reason: "2023-01-16: Please use socialLinks") + website: String @deprecated(reason: "2023-01-16: Please use socialLinks") + socialLinks: [SocialLink!]! updates(limit: Int, offset: Int, onlyPublishedUpdates: Boolean): [UpdateType] @deprecated(reason: "2022-09-09: Updates moved to GQLV2") events( @@ -3157,7 +4002,7 @@ type Vendor implements CollectiveInterface { endsAt: DateString timezone: String hostFeePercent: Float - platformFeePercent: Int + platformFeePercent: Float currency: String image: String imageUrl(height: Int, format: ImageFormat): String @@ -3189,6 +4034,11 @@ type Vendor implements CollectiveInterface { """ isTrustedHost: Boolean! + """ + Returns whether this user has two factor authentication enabled + """ + isTwoFactorAuthEnabled: Boolean + """ Returns whether this host accepts applications for new collectives """ @@ -3307,14 +4157,15 @@ type Vendor implements CollectiveInterface { """ supportedExpenseTypes: [String!]! role: String - twitterHandle: String + twitterHandle: String @deprecated(reason: "2023-01-16: Please use socialLinks") githubHandle: String @deprecated(reason: "2022-06-03: Please use repositoryUrl") """ The URL of the repository """ - repositoryUrl: String - website: String + repositoryUrl: String @deprecated(reason: "2023-01-16: Please use socialLinks") + website: String @deprecated(reason: "2023-01-16: Please use socialLinks") + socialLinks: [SocialLink!]! updates(limit: Int, offset: Int, onlyPublishedUpdates: Boolean): [UpdateType] @deprecated(reason: "2022-09-09: Updates moved to GQLV2") events( @@ -3421,9 +4272,12 @@ type Query { """ includeExpenseTransactions: Boolean fetchDataFromLedger: Boolean + @deprecated( + reason: "2023-01-11: Removed support for this in 2019 (https://github.com/opencollective/opencollective-api/pull/2384)" + ) includeHostedCollectivesTransactions: Boolean ): [Transaction] - Application(id: Int): Application + Application(id: Int): Application @deprecated(reason: "2023-01-03: Please use PersonalToken from GQLV2") Transaction(id: Int, uuid: String): Transaction allCollectives( """ @@ -3697,8 +4551,6 @@ type Mutation { deleteUserCollective(id: Int!): CollectiveInterface archiveCollective(id: Int!): CollectiveInterface unarchiveCollective(id: Int!): CollectiveInterface - sendMessageToCollective(collectiveId: Int!, message: String!, subject: String): SendMessageToCollectiveResult - @deprecated(reason: "2022-08-01: Please use the sendMessage mutation from GraphQL v2 instead.") """ Create a user with an optional organization. @@ -3779,11 +4631,10 @@ type Mutation { editPublicMessage(FromCollectiveId: Int!, CollectiveId: Int!, message: String): [Member] @deprecated(reason: "2021-01-27: Please use editPublicMessage from GQLV2") createOrder(order: OrderInputType!): OrderType - @deprecated(reason: "2020-10-13: This endpoint has been moved to GQLV2") - confirmOrder(order: ConfirmOrderInputType!): OrderType - refundTransaction(id: Int!): Transaction @deprecated(reason: "2022-01-27: Please use refundTransaction from GQLV2") + @deprecated(reason: "2020-10-13: This mutation has been moved to GQLV2") createApplication(application: ApplicationInput!): Application - deleteApplication(id: Int!): Application + @deprecated(reason: "2023-01-03: Please use createPersonalToken from GQLV2") + deleteApplication(id: Int!): Application @deprecated(reason: "2023-01-03: Please use deletePersonalToken from GQLV2") """ Update a payment method @@ -3960,10 +4811,11 @@ input CollectiveInputType { name: String legalName: String company: String - website: String - twitterHandle: String + website: String @deprecated(reason: "2023-01-16: Please use socialLinks") + twitterHandle: String @deprecated(reason: "2023-01-16: Please use socialLinks") githubHandle: String @deprecated(reason: "2022-06-03: Please use repositoryUrl") - repositoryUrl: String + repositoryUrl: String @deprecated(reason: "2023-01-16: Please use socialLinks") + socialLinks: [SocialLinkInput!] description: String longDescription: String expensePolicy: String @@ -3994,6 +4846,11 @@ input CollectiveInputType { contributionPolicy: String } +input SocialLinkInput { + type: SocialLinkType! + url: URL! +} + """ Input type for Location """ @@ -4133,10 +4990,10 @@ input CollectiveAttributesInputType { description: String longDescription: String expensePolicy: String - website: String - twitterHandle: String + website: String @deprecated(reason: "2023-01-16: Please use socialLinks") + twitterHandle: String @deprecated(reason: "2023-01-16: Please use socialLinks") githubHandle: String @deprecated(reason: "2022-06-03: Please use repositoryUrl") - repositoryUrl: String + repositoryUrl: String @deprecated(reason: "2023-01-16: Please use socialLinks") location: LocationInputType startsAt: String endsAt: String @@ -4157,10 +5014,6 @@ input NotificationInputType { webhookUrl: String } -type SendMessageToCollectiveResult { - success: Boolean -} - type CreateUserResult { user: UserDetails organization: CollectiveInterface @@ -4178,10 +5031,10 @@ input UserInputType { image: String username: String @deprecated(reason: "2022-01-13: Not used anymore. Will be ignored") description: String - twitterHandle: String + twitterHandle: String @deprecated(reason: "2023-01-16: Please use socialLinks") githubHandle: String @deprecated(reason: "2022-06-03: Please use repositoryUrl") - repositoryUrl: String - website: String + repositoryUrl: String @deprecated(reason: "2023-01-16: Please use socialLinks") + website: String @deprecated(reason: "2023-01-16: Please use socialLinks") newsletterOptIn: Boolean location: LocationInputType } @@ -4204,7 +5057,7 @@ input OrderInputType { quantity: Int = 1 totalAmount: Int hostFeePercent: Float - platformFeePercent: Int + platformFeePercent: Float platformFee: Int isFeesOnTop: Boolean currency: String @@ -4316,13 +5169,6 @@ enum CaptchaProvider { RECAPTCHA } -""" -Input type for ConfirmOrderType -""" -input ConfirmOrderInputType { - id: Int -} - """ Input for stripe credit card data """ diff --git a/src/graphql/schemaV2.graphql b/src/graphql/schemaV2.graphql index d5ca02d4..62b48de4 100644 --- a/src/graphql/schemaV2.graphql +++ b/src/graphql/schemaV2.graphql @@ -1,5 +1,5 @@ """ -An OAuth application or a personal token +An OAuth application. """ type Application { id: String! @@ -184,10 +184,11 @@ interface Account { description: String longDescription: String tags: [String] - website: String - twitterHandle: String + website: String @deprecated(reason: "2023-01-16: Please use socialLinks") + twitterHandle: String @deprecated(reason: "2023-01-16: Please use socialLinks") githubHandle: String @deprecated(reason: "2022-06-03: Please use repositoryUrl") - repositoryUrl: String + repositoryUrl: String @deprecated(reason: "2023-01-16: Please use socialLinks") + socialLinks: [SocialLink!]! currency: String expensePolicy: String @@ -232,7 +233,7 @@ interface Account { Returns true if the remote user is an admin of this account """ isAdmin: Boolean! - parentAccount: Account + parentAccount: Account @deprecated(reason: "2022-12-16: use parent on AccountWithParent instead") members( limit: Int! = 100 offset: Int! = 0 @@ -247,6 +248,7 @@ interface Account { Type of accounts (BOT/COLLECTIVE/EVENT/ORGANIZATION/INDIVIDUAL) """ accountType: [AccountType] + includeInherited: Boolean = true ): MemberCollection! """ @@ -416,6 +418,11 @@ interface Account { """ includeHostedAccounts: Boolean + """ + Only return orders that were paid with this payment method. Must be an admin of the account owning the payment method. + """ + paymentMethod: PaymentMethodReferenceInput + """ Whether to include incognito orders. Must be admin or root. Only with filter null or OUTGOING. """ @@ -471,6 +478,11 @@ interface Account { Only returns orders that have a subscription (monthly/yearly). Don't use together with frequency. """ onlySubscriptions: Boolean + + """ + Same as onlySubscriptions, but returns only orders with active subscriptions + """ + onlyActiveSubscriptions: Boolean ): OrderCollection! settings: JSON! conversations( @@ -529,6 +541,11 @@ interface Account { includeExpired: Boolean ): [PaymentMethod] + """ + The list of payment methods for this account that are pending a client confirmation (3D Secure / SCA) + """ + paymentMethodsWithPendingConfirmation: [PaymentMethod] + """ The list of connected accounts (Stripe, Twitter, etc ...) """ @@ -645,6 +662,42 @@ enum AccountType { VENDOR } +""" +A social link +""" +type SocialLink { + type: SocialLinkType! + url: URL! + createdAt: DateTime + updatedAt: DateTime +} + +""" +The type of social link +""" +enum SocialLinkType { + TWITTER + TUMBLR + MASTODON + MATTERMOST + SLACK + LINKEDIN + MEETUP + FACEBOOK + INSTAGRAM + DISCORD + YOUTUBE + GITHUB + GITLAB + GIT + WEBSITE + DISCOURSE + PIXELFED + GHOST + PEERTUBE + TIKTOK +} + enum ImageFormat { txt png @@ -682,7 +735,7 @@ enum MemberRole { HOST ATTENDEE MEMBER - FUNDRAISER + FUNDRAISER @deprecated(reason: "2022-09-12: This role does not exist anymore") FOLLOWER ACCOUNTANT CONNECTED_ACCOUNT @@ -745,6 +798,7 @@ type Tier { endsAt: DateTime invoiceTemplate: String useStandalonePage: Boolean + singleTicket: Boolean } """ @@ -795,6 +849,11 @@ type Order { totalDonations: Amount! paymentMethod: PaymentMethod + """ + Host fee percent attached to the Order. + """ + hostFeePercent: Float + """ Platform Tip attached to the Order. """ @@ -827,25 +886,46 @@ type Order { Memo field which adds additional details about the order. For example in added funds this can be a note to mark what method (cheque, money order) the funds were received. """ memo: String + + """ + The account who created this order + """ + createdByAccount: Account + + """ + Date the funds were received. + """ + processedAt: DateTime + + """ + Data about the pending contribution + """ + pendingContributionData: PendingOrderData + + """ + Whether the order needs confirmation (3DSecure/SCA) + """ + needsConfirmation: Boolean } """ All order statuses """ enum OrderStatus { - ACTIVE - CANCELLED - DISPUTED - ERROR - EXPIRED - IN_REVIEW NEW + REQUIRE_CLIENT_CONFIRMATION PAID + ERROR + PROCESSING + ACTIVE + CANCELLED PENDING + EXPIRED PLEDGED - REFUNDED REJECTED - REQUIRE_CLIENT_CONFIRMATION + DISPUTED + REFUNDED + IN_REVIEW } enum ContributionFrequency { @@ -1057,7 +1137,7 @@ type Expense { """ Source of the currency to express the amount. Defaults to the expense currency """ - currencySource: ExpenseCurrencySource + currencySource: ExpenseCurrencySource = EXPENSE ): Amount """ @@ -1210,6 +1290,11 @@ enum ExpenseCurrencySource { The expense currency expressed as the expense currency """ EXPENSE + + """ + The expense currency expressed as the expense currency + """ + CREATED_BY_ACCOUNT } """ @@ -1971,8 +2056,6 @@ type Comment { Returns the list of reactions added to this comment by logged in user """ userReactions: [String] - fromCollective: Account @deprecated(reason: "2020-02-25: Please use fromAccount") - collective: Account @deprecated(reason: "2020-02-25: Please use account") } """ @@ -2100,6 +2183,16 @@ type ExpenseAttachedFile { """ id: String! url: URL + + """ + The file info associated with this item (if any) + """ + info: FileInfo + + """ + The original filename + """ + name: String @deprecated(reason: "2023-01-23: We're moving this field to \"file.name\"") } """ @@ -2136,6 +2229,11 @@ type ExpenseItem { """ description: String url: URL + + """ + The file associated with this item (if any) + """ + file: FileInfo } """ @@ -2240,6 +2338,7 @@ type ExpensePermissions { type Permission { allowed: Boolean! reason: String + reasonDetails: JSON } """ @@ -2291,6 +2390,11 @@ type Activity { """ order: Order + """ + The transaction related to this activity, if any + """ + transaction: Transaction + """ Data attached to this activity (if any) """ @@ -2305,6 +2409,7 @@ type Activity { enum ActivityType { ACTIVITY_ALL CONNECTED_ACCOUNT_CREATED + CONNECTED_ACCOUNT_ERROR COLLECTIVE_CREATED_GITHUB COLLECTIVE_APPLY COLLECTIVE_APPROVED @@ -2316,7 +2421,6 @@ enum ActivityType { ORGANIZATION_COLLECTIVE_CREATED COLLECTIVE_FROZEN COLLECTIVE_UNFROZEN - COLLECTIVE_COMMENT_CREATED COLLECTIVE_CONVERSATION_CREATED UPDATE_COMMENT_CREATED EXPENSE_COMMENT_CREATED @@ -2334,6 +2438,7 @@ enum ActivityType { COLLECTIVE_EXPENSE_MARKED_AS_INCOMPLETE COLLECTIVE_EXPENSE_PROCESSING COLLECTIVE_EXPENSE_SCHEDULED_FOR_PAYMENT + COLLECTIVE_EXPENSE_UNSCHEDULED_FOR_PAYMENT COLLECTIVE_EXPENSE_ERROR COLLECTIVE_EXPENSE_INVITE_DRAFTED COLLECTIVE_EXPENSE_RECURRING_DRAFTED @@ -2360,15 +2465,19 @@ enum ActivityType { HOST_APPLICATION_CONTACT CONTRIBUTION_REJECTED SUBSCRIPTION_ACTIVATED - SUBSCRIPTION_CONFIRMED SUBSCRIPTION_CANCELED TICKET_CONFIRMED ORDER_CANCELED_ARCHIVED_COLLECTIVE - ORDER_PROCESSING - ORDER_PROCESSING_CRYPTO + ORDER_PENDING + ORDER_PENDING_CRYPTO ORDER_PENDING_CONTRIBUTION_NEW ORDER_PENDING_CONTRIBUTION_REMINDER + ORDER_PROCESSING + ORDER_PAYMENT_FAILED ORDER_THANKYOU + ORDER_PENDING_CREATED + ORDER_PENDING_FOLLOWUP + ORDER_PENDING_RECEIVED ORDERS_SUSPICIOUS BACKYOURSTACK_DISPATCH_CONFIRMED PAYMENT_FAILED @@ -2376,11 +2485,14 @@ enum ActivityType { PAYMENT_CREDITCARD_EXPIRING USER_CREATED USER_NEW_TOKEN + USER_SIGNIN + USER_RESET_PASSWORD OAUTH_APPLICATION_AUTHORIZED TWO_FACTOR_CODE_ADDED TWO_FACTOR_CODE_DELETED USER_CHANGE_EMAIL USER_PAYMENT_METHOD_CREATED + USER_PASSWORD_SET USER_CARD_CLAIMED USER_CARD_INVITED WEBHOOK_STRIPE_RECEIVED @@ -2394,6 +2506,8 @@ enum ActivityType { COLLECTIVE_USER_ADDED COLLECTIVE_VIRTUAL_CARD_ASSIGNED COLLECTIVE_VIRTUAL_CARD_CREATED + SUBSCRIPTION_CONFIRMED + COLLECTIVE_COMMENT_CREATED } """ @@ -2421,10 +2535,11 @@ type Host implements Account & AccountWithContributions { description: String longDescription: String tags: [String] - website: String - twitterHandle: String + website: String @deprecated(reason: "2023-01-16: Please use socialLinks") + twitterHandle: String @deprecated(reason: "2023-01-16: Please use socialLinks") githubHandle: String @deprecated(reason: "2022-06-03: Please use repositoryUrl") - repositoryUrl: String + repositoryUrl: String @deprecated(reason: "2023-01-16: Please use socialLinks") + socialLinks: [SocialLink!]! currency: String expensePolicy: String @@ -2465,7 +2580,7 @@ type Host implements Account & AccountWithContributions { Returns true if the remote user is an admin of this account """ isAdmin: Boolean! - parentAccount: Account + parentAccount: Account @deprecated(reason: "2022-12-16: use parent on AccountWithParent instead") """ Get all members (admins, members, backers, followers) @@ -2485,6 +2600,7 @@ type Host implements Account & AccountWithContributions { Order of the results """ orderBy: ChronologicalOrderInput! = { field: CREATED_AT, direction: ASC } + includeInherited: Boolean = true ): MemberCollection! """ @@ -2685,6 +2801,11 @@ type Host implements Account & AccountWithContributions { """ includeHostedAccounts: Boolean + """ + Only return orders that were paid with this payment method. Must be an admin of the account owning the payment method. + """ + paymentMethod: PaymentMethodReferenceInput + """ Whether to include incognito orders. Must be admin or root. Only with filter null or OUTGOING. """ @@ -2740,6 +2861,11 @@ type Host implements Account & AccountWithContributions { Only returns orders that have a subscription (monthly/yearly). Don't use together with frequency. """ onlySubscriptions: Boolean + + """ + Same as onlySubscriptions, but returns only orders with active subscriptions + """ + onlyActiveSubscriptions: Boolean ): OrderCollection! settings: JSON! conversations( @@ -2787,6 +2913,11 @@ type Host implements Account & AccountWithContributions { includeExpired: Boolean ): [PaymentMethod] + """ + The list of payment methods for this account that are pending a client confirmation (3D Secure / SCA) + """ + paymentMethodsWithPendingConfirmation: [PaymentMethod] + """ The list of connected accounts (Stripe, Twitter, etc ...). Admin only. Scope: "connectedAccounts". """ @@ -2936,7 +3067,7 @@ type Host implements Account & AccountWithContributions { """ How much platform fees are charged for this account """ - platformFeePercent: Int! + platformFeePercent: Float! """ Returns true if a custom contribution to Open Collective can be submitted for contributions made to this account @@ -3149,7 +3280,7 @@ interface AccountWithContributions { """ How much platform fees are charged for this account """ - platformFeePercent: Int! + platformFeePercent: Float! """ Returns true if a custom contribution to Open Collective can be submitted for contributions made to this account @@ -3260,7 +3391,6 @@ enum ContributorRole { MEMBER CONTRIBUTOR BACKER - FUNDRAISER ATTENDEE FOLLOWER CONNECTED_COLLECTIVE @@ -3381,6 +3511,11 @@ enum PaymentMethodType { giftcard @deprecated(reason: "Please use uppercase values") manual @deprecated(reason: "Please use uppercase values") crypto @deprecated(reason: "Please use uppercase values") + paymentintent @deprecated(reason: "Please use uppercase values") + us_bank_account @deprecated(reason: "Please use uppercase values") + sepa_debit @deprecated(reason: "Please use uppercase values") + bacs_debit @deprecated(reason: "Please use uppercase values") + bancontact @deprecated(reason: "Please use uppercase values") ALIPAY CREDITCARD PREPAID @@ -3392,6 +3527,18 @@ enum PaymentMethodType { GIFTCARD MANUAL CRYPTO + PAYMENT_INTENT + US_BANK_ACCOUNT + SEPA_DEBIT + BACS_DEBIT + BANCONTACT +} + +input PaymentMethodReferenceInput { + """ + The id assigned to the payment method + """ + id: String } """ @@ -3423,9 +3570,7 @@ type Conversation { updatedAt: DateTime! tags: [String] summary: String! - collective: Account @deprecated(reason: "2022-09-14: Please use account") account: Account - fromCollective: Account @deprecated(reason: "2022-09-14: Please use fromAccount") fromAccount: Account """ @@ -3482,7 +3627,7 @@ type TagStat { """ Total amount for this tag """ - amount: Amount! + amount: Amount } """ @@ -3514,6 +3659,92 @@ type PaymentMethod { limitedToHosts: [Host] expiryDate: DateTime createdAt: DateTime + + """ + For monthly gift cards, this field will return the monthly limit + """ + monthlyLimit: Amount + + """ + Get all the orders associated with this payment method + """ + orders( + """ + The number of results to fetch (default 10, max 1000) + """ + limit: Int! = 100 + + """ + The offset to use to fetch + """ + offset: Int! = 0 + + """ + If account is a host, also include hosted accounts orders + """ + includeHostedAccounts: Boolean + + """ + Whether to include incognito orders. Must be admin or root. Only with filter null or OUTGOING. + """ + includeIncognito: Boolean = false + + """ + Account orders filter (INCOMING or OUTGOING) + """ + filter: AccountOrdersFilter + + """ + Use this field to filter orders on their frequency (ONETIME, MONTHLY or YEARLY) + """ + frequency: ContributionFrequency + + """ + Use this field to filter orders on their statuses + """ + status: [OrderStatus] + + """ + The order of results + """ + orderBy: ChronologicalOrderInput! = { field: CREATED_AT, direction: DESC } + + """ + Only return orders where the amount is greater than or equal to this value (in cents) + """ + minAmount: Int + + """ + Only return orders where the amount is lower than or equal to this value (in cents) + """ + maxAmount: Int + + """ + Only return orders that were created after this date + """ + dateFrom: DateTime + + """ + Only return orders that were created after this date + """ + dateTo: DateTime + + """ + The term to search + """ + searchTerm: String + tierSlug: String @deprecated(reason: "2022-02-25: Should be replaced by a tier reference. Not existing yet.") + + """ + Only returns orders that have a subscription (monthly/yearly). Don't use together with frequency. + """ + onlySubscriptions: Boolean + + """ + Same as onlySubscriptions, but returns only orders with active subscriptions + """ + onlyActiveSubscriptions: Boolean + ): OrderCollection } enum PaymentMethodService { @@ -3534,6 +3765,11 @@ enum PaymentMethodLegacyType { BANK_TRANSFER ADDED_FUNDS CRYPTO + PAYMENT_INTENT + US_BANK_ACCOUNT + SEPA_DEBIT + BACS_DEBIT + BANCONTACT } """ @@ -3569,6 +3805,7 @@ All supported services a user can connect with enum ConnectedAccountService { paypal stripe + stripe_customer github twitter transferwise @@ -3596,26 +3833,31 @@ type AccountStats { """ Amount of money in cents in the currency of the collective currently available to spend """ - balanceWithBlockedFunds: Amount! + balanceWithBlockedFunds: Amount! @deprecated(reason: "2022-12-13: Use balance + withBlockedFunds instead") """ Amount of money in cents in the currency of the collective """ balance( """ - Calculate balance beginning from this date. + Calculate amount before this date """ - dateFrom: DateTime + dateTo: DateTime """ - Calculate balance until this date. + Include transactions from children (Projects and Events) """ - dateTo: DateTime + includeChildren: Boolean = false """ - Include balance from children (Projects and Events) + An optional currency. If not provided, will use the collective currency. """ - includeChildren: Boolean = false + currency: Currency + + """ + Remove blocked funds from the balance + """ + withBlockedFunds: Boolean = false ): Amount! """ @@ -3632,125 +3874,261 @@ type AccountStats { Total amount spent """ totalAmountSpent( + """ + Return the net amount (with payment processor fees removed) + """ + net: Boolean = false + """ Filter by kind """ kind: [TransactionKind] """ - Calculate total amount spent before this date + Calculate amount after this date """ - dateTo: DateTime + dateFrom: DateTime """ - Calculate total amount spent after this date + Calculate amount before this date """ - dateFrom: DateTime + dateTo: DateTime """ - Calculate total amount spent in the last x months. Cannot be used with startDate/endDate + Calculate amount for the last x months. Cannot be used with startDate/endDate """ periodInMonths: Int """ - Include money spent in children (Projects and Events) + Include transactions from children (Projects and Events) """ includeChildren: Boolean = false + + """ + An optional currency. If not provided, will use the collective currency. + """ + currency: Currency + + """ + Include transactions using Gift Cards (not working together with includeChildren) + """ + includeGiftCards: Boolean = false ): Amount! """ Total amount received """ totalAmountReceived( + """ + Return the net amount (with payment processor fees removed) + """ + net: Boolean = false + """ Filter by kind """ kind: [TransactionKind] """ - Calculate total amount received before this date + Calculate amount after this date """ - dateTo: DateTime + dateFrom: DateTime """ - Calculate total amount received after this date + Calculate amount before this date """ - dateFrom: DateTime + dateTo: DateTime """ - Computes contributions from the last x months. Cannot be used with startDate/endDate + Calculate amount for the last x months. Cannot be used with startDate/endDate """ periodInMonths: Int """ - Set this to true to use cached data + Include transactions from children (Projects and Events) """ - useCache: Boolean! = false + includeChildren: Boolean = false """ - Include money received in children (Projects and Events) + An optional currency. If not provided, will use the collective currency. + """ + currency: Currency + """ - includeChildren: Boolean = false + Set this to true to use cached data + """ + useCache: Boolean! = false + @deprecated(reason: "2022-12-14: this is not used anymore as results should be fast by default") ): Amount! """ - Total of paid expenses to the account, filter per expense type + Total amount received time series """ - totalPaidExpenses( + totalAmountReceivedTimeSeries( """ - Filter by ExpenseType + The start date of the time series """ - expenseType: [ExpenseType] + dateFrom: DateTime """ - Calculate total amount received before this date + The end date of the time series """ dateTo: DateTime """ - Calculate total amount received after this date + The time unit of the time series (such as MONTH, YEAR, WEEK etc). If no value is provided this is calculated using the dateFrom and dateTo values. """ - dateFrom: DateTime + timeUnit: TimeUnit """ - An optional currency. If not provided, will use the collective currency. + Return the net amount (with payment processor fees removed) """ - currency: Currency - ): Amount! - yearlyBudget: Amount! - yearlyBudgetManaged: Amount! + net: Boolean = false - """ - Total net amount received - """ - totalNetAmountReceived: Amount! - activeRecurringContributions: JSON - @deprecated(reason: "2022-10-21: Use activeRecurringContributionsV2 while we migrate to better semantics.") - activeRecurringContributionsV2( """ - The frequency of the recurring contribution (MONTHLY or YEARLY) + Filter by kind """ - frequency: ContributionFrequency! = MONTHLY - ): Amount - - """ - Returns expense tags for collective sorted by popularity - """ - expensesTags( - limit: Int! = 30 + kind: [TransactionKind] """ - The start date of the time series + Calculate amount for the last x months. Cannot be used with startDate/endDate """ - dateFrom: DateTime + periodInMonths: Int """ - The end date of the time series + Include transactions from children (Projects and Events) """ - dateTo: DateTime + includeChildren: Boolean = false + + """ + An optional currency. If not provided, will use the collective currency. + """ + currency: Currency + ): TimeSeriesAmount! + + """ + Total of paid expenses to the account, filter per expense type + """ + totalPaidExpenses( + """ + Calculate amount after this date + """ + dateFrom: DateTime + + """ + Calculate amount before this date + """ + dateTo: DateTime + + """ + An optional currency. If not provided, will use the collective currency. + """ + currency: Currency + + """ + Filter by ExpenseType + """ + expenseType: [ExpenseType] + ): Amount! + yearlyBudget: Amount! + yearlyBudgetManaged: Amount! + + """ + Total net amount received + """ + totalNetAmountReceived( + """ + Filter by kind + """ + kind: [TransactionKind] + + """ + Calculate amount after this date + """ + dateFrom: DateTime + + """ + Calculate amount before this date + """ + dateTo: DateTime + + """ + Calculate amount for the last x months. Cannot be used with startDate/endDate + """ + periodInMonths: Int + + """ + Include transactions from children (Projects and Events) + """ + includeChildren: Boolean = false + ): Amount! @deprecated(reason: "2022-12-13: Use totalAmountReceived + net=true instead") + + """ + Total net amount received time series + """ + totalNetAmountReceivedTimeSeries( + """ + The start date of the time series + """ + dateFrom: DateTime + + """ + The end date of the time series + """ + dateTo: DateTime + + """ + The time unit of the time series (such as MONTH, YEAR, WEEK etc). If no value is provided this is calculated using the dateFrom and dateTo values. + """ + timeUnit: TimeUnit + + """ + Filter by kind + """ + kind: [TransactionKind] + + """ + Calculate amount for the last x months. Cannot be used with startDate/endDate + """ + periodInMonths: Int + + """ + Include transactions from children (Projects and Events) + """ + includeChildren: Boolean = false + + """ + An optional currency. If not provided, will use the collective currency. + """ + currency: Currency + ): TimeSeriesAmount! @deprecated(reason: "2022-12-13: Use totalAmountReceivedTimeSeries + net=true instead") + activeRecurringContributions: JSON + @deprecated(reason: "2022-10-21: Use activeRecurringContributionsV2 while we migrate to better semantics.") + activeRecurringContributionsV2( + """ + The frequency of the recurring contribution (MONTHLY or YEARLY) + """ + frequency: ContributionFrequency! = MONTHLY + ): Amount + + """ + Returns expense tags for collective sorted by popularity + """ + expensesTags( + limit: Int! = 30 + + """ + Calculate amount after this date + """ + dateFrom: DateTime + + """ + Calculate amount before this date + """ + dateTo: DateTime """ - Include contributions to children (Projects and Events) + Include transactions from children (Projects and Events) """ includeChildren: Boolean = false ): [AmountStats] @@ -3775,27 +4153,59 @@ type AccountStats { timeUnit: TimeUnit """ - Include expense to children (Projects and Events) + Include transactions from children (Projects and Events) """ includeChildren: Boolean = false ): TimeSeriesAmount! + contributionsCount( + """ + Calculate amount after this date + """ + dateFrom: DateTime + + """ + Calculate amount before this date + """ + dateTo: DateTime + + """ + Include transactions from children (Projects and Events) + """ + includeChildren: Boolean = false + ): Int! + contributorsCount( + """ + Calculate amount after this date + """ + dateFrom: DateTime + + """ + Calculate amount before this date + """ + dateTo: DateTime + + """ + Include transactions from children (Projects and Events) + """ + includeChildren: Boolean = false + ): Int! """ Return amount stats for contributions (default, and only for now: one-time vs recurring) """ contributionsAmount( """ - The start date of the time series + Calculate amount after this date """ dateFrom: DateTime """ - The end date of the time series + Calculate amount before this date """ dateTo: DateTime """ - Include contributions to children (Projects and Events) + Include transactions from children (Projects and Events) """ includeChildren: Boolean = false ): [AmountStats] @@ -3820,32 +4230,12 @@ type AccountStats { timeUnit: TimeUnit """ - Include contributions to children (Projects and Events) + Include transactions from children (Projects and Events) """ includeChildren: Boolean = false ): TimeSeriesAmount! } -""" -Statistics aith amounts -""" -type AmountStats { - """ - Name/Label for the amount - """ - label: String! - - """ - Total amount for this label - """ - amount: Amount! - - """ - Number of entries for this label - """ - count: Int -} - """ Amount time series """ @@ -3904,6 +4294,26 @@ type TimeSeriesAmountNode { label: String } +""" +Statistics aith amounts +""" +type AmountStats { + """ + Name/Label for the amount + """ + label: String! + + """ + Total amount for this label + """ + amount: Amount! + + """ + Number of entries for this label + """ + count: Int +} + """ A collection of "Updates" """ @@ -4078,6 +4488,7 @@ type CollectiveFeatures { HOST_DASHBOARD: CollectiveFeatureStatus CONNECTED_ACCOUNTS: CollectiveFeatureStatus ALIPAY: CollectiveFeatureStatus + STRIPE_PAYMENT_INTENT: CollectiveFeatureStatus USE_PAYMENT_METHODS: CollectiveFeatureStatus EMIT_GIFT_CARDS: CollectiveFeatureStatus EMAIL_NOTIFICATIONS_PANEL: CollectiveFeatureStatus @@ -4118,11 +4529,19 @@ type VirtualCardCollection implements Collection { } type Policies { - EXPENSE_AUTHOR_CANNOT_APPROVE: Boolean + EXPENSE_AUTHOR_CANNOT_APPROVE: EXPENSE_AUTHOR_CANNOT_APPROVE + REQUIRE_2FA_FOR_ADMINS: Boolean COLLECTIVE_MINIMUM_ADMINS: COLLECTIVE_MINIMUM_ADMINS MAXIMUM_VIRTUAL_CARD_LIMIT_AMOUNT_FOR_INTERVAL: MAXIMUM_VIRTUAL_CARD_LIMIT_AMOUNT_FOR_INTERVAL } +type EXPENSE_AUTHOR_CANNOT_APPROVE { + amountInCents: Int + enabled: Boolean + appliesToHostedCollectives: Boolean + appliesToSingleAdminCollectives: Boolean +} + type COLLECTIVE_MINIMUM_ADMINS { numberOfAdmins: Int applies: PolicyApplication @@ -4549,11 +4968,6 @@ type ExpenseStats { """ expensesCount: Int! - """ - The total number of expenses over time - """ - expenseAmountOverTime: TimeSeriesAmount @deprecated(reason: "2022-04-21: Please use hostMetricsTimeSeries.totalSpent") - """ The daily average paid in expenses """ @@ -4592,7 +5006,7 @@ type ExpenseQuote { """ Amount of this item """ - totalAmount: Amount! + sourceAmount: Amount! """ Amount of payment processor fee @@ -4732,6 +5146,24 @@ type OrderPermissions { Whether the current user can mark this order as unpaid """ canMarkAsPaid: Boolean! + + """ + Whether the current user edit this pending order + """ + canEdit: Boolean! +} + +type PendingOrderData { + expectedAt: DateTime + paymentMethod: String + ponumber: String + memo: String + fromAccountInfo: PendingOrderFromAccountInfo +} + +type PendingOrderFromAccountInfo { + name: String + email: String } enum TierType { @@ -4847,10 +5279,11 @@ type Bot implements Account { description: String longDescription: String tags: [String] - website: String - twitterHandle: String + website: String @deprecated(reason: "2023-01-16: Please use socialLinks") + twitterHandle: String @deprecated(reason: "2023-01-16: Please use socialLinks") githubHandle: String @deprecated(reason: "2022-06-03: Please use repositoryUrl") - repositoryUrl: String + repositoryUrl: String @deprecated(reason: "2023-01-16: Please use socialLinks") + socialLinks: [SocialLink!]! currency: String expensePolicy: String @@ -4891,7 +5324,7 @@ type Bot implements Account { Returns true if the remote user is an admin of this account """ isAdmin: Boolean! - parentAccount: Account + parentAccount: Account @deprecated(reason: "2022-12-16: use parent on AccountWithParent instead") """ Get all members (admins, members, backers, followers) @@ -4911,6 +5344,7 @@ type Bot implements Account { Order of the results """ orderBy: ChronologicalOrderInput! = { field: CREATED_AT, direction: ASC } + includeInherited: Boolean = true ): MemberCollection! """ @@ -5111,6 +5545,11 @@ type Bot implements Account { """ includeHostedAccounts: Boolean + """ + Only return orders that were paid with this payment method. Must be an admin of the account owning the payment method. + """ + paymentMethod: PaymentMethodReferenceInput + """ Whether to include incognito orders. Must be admin or root. Only with filter null or OUTGOING. """ @@ -5166,6 +5605,11 @@ type Bot implements Account { Only returns orders that have a subscription (monthly/yearly). Don't use together with frequency. """ onlySubscriptions: Boolean + + """ + Same as onlySubscriptions, but returns only orders with active subscriptions + """ + onlyActiveSubscriptions: Boolean ): OrderCollection! settings: JSON! conversations( @@ -5213,6 +5657,11 @@ type Bot implements Account { includeExpired: Boolean ): [PaymentMethod] + """ + The list of payment methods for this account that are pending a client confirmation (3D Secure / SCA) + """ + paymentMethodsWithPendingConfirmation: [PaymentMethod] + """ The list of connected accounts (Stripe, Twitter, etc ...). Admin only. Scope: "connectedAccounts". """ @@ -5348,10 +5797,11 @@ type Collective implements Account & AccountWithHost & AccountWithContributions description: String longDescription: String tags: [String] - website: String - twitterHandle: String + website: String @deprecated(reason: "2023-01-16: Please use socialLinks") + twitterHandle: String @deprecated(reason: "2023-01-16: Please use socialLinks") githubHandle: String @deprecated(reason: "2022-06-03: Please use repositoryUrl") - repositoryUrl: String + repositoryUrl: String @deprecated(reason: "2023-01-16: Please use socialLinks") + socialLinks: [SocialLink!]! currency: String expensePolicy: String @@ -5392,7 +5842,7 @@ type Collective implements Account & AccountWithHost & AccountWithContributions Returns true if the remote user is an admin of this account """ isAdmin: Boolean! - parentAccount: Account + parentAccount: Account @deprecated(reason: "2022-12-16: use parent on AccountWithParent instead") """ Get all members (admins, members, backers, followers) @@ -5412,6 +5862,7 @@ type Collective implements Account & AccountWithHost & AccountWithContributions Order of the results """ orderBy: ChronologicalOrderInput! = { field: CREATED_AT, direction: ASC } + includeInherited: Boolean = true ): MemberCollection! """ @@ -5612,6 +6063,11 @@ type Collective implements Account & AccountWithHost & AccountWithContributions """ includeHostedAccounts: Boolean + """ + Only return orders that were paid with this payment method. Must be an admin of the account owning the payment method. + """ + paymentMethod: PaymentMethodReferenceInput + """ Whether to include incognito orders. Must be admin or root. Only with filter null or OUTGOING. """ @@ -5667,6 +6123,11 @@ type Collective implements Account & AccountWithHost & AccountWithContributions Only returns orders that have a subscription (monthly/yearly). Don't use together with frequency. """ onlySubscriptions: Boolean + + """ + Same as onlySubscriptions, but returns only orders with active subscriptions + """ + onlyActiveSubscriptions: Boolean ): OrderCollection! settings: JSON! conversations( @@ -5714,6 +6175,11 @@ type Collective implements Account & AccountWithHost & AccountWithContributions includeExpired: Boolean ): [PaymentMethod] + """ + The list of payment methods for this account that are pending a client confirmation (3D Secure / SCA) + """ + paymentMethodsWithPendingConfirmation: [PaymentMethod] + """ The list of connected accounts (Stripe, Twitter, etc ...). Admin only. Scope: "connectedAccounts". """ @@ -5841,7 +6307,7 @@ type Collective implements Account & AccountWithHost & AccountWithContributions """ How much platform fees are charged for this account """ - platformFeePercent: Int! + platformFeePercent: Float! """ Date of approval by the Fiscal Host. @@ -5919,7 +6385,7 @@ interface AccountWithHost { """ Fees percentage that the platform takes for this collective """ - platformFeePercent: Int + platformFeePercent: Float """ Date of approval by the Fiscal Host. @@ -6178,10 +6644,11 @@ type Event implements Account & AccountWithHost & AccountWithContributions & Acc description: String longDescription: String tags: [String] - website: String - twitterHandle: String + website: String @deprecated(reason: "2023-01-16: Please use socialLinks") + twitterHandle: String @deprecated(reason: "2023-01-16: Please use socialLinks") githubHandle: String @deprecated(reason: "2022-06-03: Please use repositoryUrl") - repositoryUrl: String + repositoryUrl: String @deprecated(reason: "2023-01-16: Please use socialLinks") + socialLinks: [SocialLink!]! currency: String expensePolicy: String @@ -6222,7 +6689,7 @@ type Event implements Account & AccountWithHost & AccountWithContributions & Acc Returns true if the remote user is an admin of this account """ isAdmin: Boolean! - parentAccount: Account + parentAccount: Account @deprecated(reason: "2022-12-16: use parent on AccountWithParent instead") """ Get all members (admins, members, backers, followers) @@ -6242,6 +6709,7 @@ type Event implements Account & AccountWithHost & AccountWithContributions & Acc Order of the results """ orderBy: ChronologicalOrderInput! = { field: CREATED_AT, direction: ASC } + includeInherited: Boolean = true ): MemberCollection! """ @@ -6442,6 +6910,11 @@ type Event implements Account & AccountWithHost & AccountWithContributions & Acc """ includeHostedAccounts: Boolean + """ + Only return orders that were paid with this payment method. Must be an admin of the account owning the payment method. + """ + paymentMethod: PaymentMethodReferenceInput + """ Whether to include incognito orders. Must be admin or root. Only with filter null or OUTGOING. """ @@ -6497,6 +6970,11 @@ type Event implements Account & AccountWithHost & AccountWithContributions & Acc Only returns orders that have a subscription (monthly/yearly). Don't use together with frequency. """ onlySubscriptions: Boolean + + """ + Same as onlySubscriptions, but returns only orders with active subscriptions + """ + onlyActiveSubscriptions: Boolean ): OrderCollection! settings: JSON! conversations( @@ -6544,6 +7022,11 @@ type Event implements Account & AccountWithHost & AccountWithContributions & Acc includeExpired: Boolean ): [PaymentMethod] + """ + The list of payment methods for this account that are pending a client confirmation (3D Secure / SCA) + """ + paymentMethodsWithPendingConfirmation: [PaymentMethod] + """ The list of connected accounts (Stripe, Twitter, etc ...). Admin only. Scope: "connectedAccounts". """ @@ -6671,7 +7154,7 @@ type Event implements Account & AccountWithHost & AccountWithContributions & Acc """ How much platform fees are charged for this account """ - platformFeePercent: Int! + platformFeePercent: Float! """ Date of approval by the Fiscal Host. @@ -6758,43 +7241,146 @@ interface AccountWithParent { } """ -This represents an Individual account +Exposes information about an uploaded file (image, pdf, etc.) """ -type Individual implements Account { +interface FileInfo { + """ + Unique identifier for the file + """ id: String! - legacyId: Int! """ - The slug identifying the account (ie: babel) + URL to access the file """ - slug: String! - type: AccountType! + url: URL! """ - Public name + Name of the file """ name: String """ - Private, legal name. Used for expense receipts, taxes, etc. Scope: "account". + Mime type of the file """ - legalName: String - description: String - longDescription: String - tags: [String] - website: String - twitterHandle: String - githubHandle: String @deprecated(reason: "2022-06-03: Please use repositoryUrl") - repositoryUrl: String - currency: String - expensePolicy: String + type: String! """ - Defines if the contributors wants to be incognito (name not displayed) + Size of the file in bytes """ - isIncognito: Boolean! - imageUrl(height: Int, format: ImageFormat): String - backgroundImageUrl(height: Int, format: ImageFormat): String + size: Int +} + +""" +Exposes information about an uploaded image file +""" +type ImageFileInfo implements FileInfo { + """ + Unique identifier for the file + """ + id: String! + + """ + URL to access the file + """ + url: URL! + + """ + Name of the file + """ + name: String + + """ + Mime type of the file + """ + type: String! + + """ + Size of the file in bytes + """ + size: Int + + """ + If the file is an image, this will be the width of the image in pixels + """ + width: Int + + """ + If the file is an image, this will be the height of the image in pixels + """ + height: Int + + """ + Blurhash of the image + """ + blurHash: String +} + +type GenericFileInfo implements FileInfo { + """ + Unique identifier for the file + """ + id: String! + + """ + URL to access the file + """ + url: URL! + + """ + Name of the file + """ + name: String + + """ + Mime type of the file + """ + type: String! + + """ + Size of the file in bytes + """ + size: Int +} + +""" +This represents an Individual account +""" +type Individual implements Account { + id: String! + legacyId: Int! + + """ + The slug identifying the account (ie: babel) + """ + slug: String! + type: AccountType! + + """ + Public name + """ + name: String + + """ + Private, legal name. Used for expense receipts, taxes, etc. Scope: "account". + """ + legalName: String + description: String + longDescription: String + tags: [String] + website: String @deprecated(reason: "2023-01-16: Please use socialLinks") + twitterHandle: String @deprecated(reason: "2023-01-16: Please use socialLinks") + githubHandle: String @deprecated(reason: "2022-06-03: Please use repositoryUrl") + repositoryUrl: String @deprecated(reason: "2023-01-16: Please use socialLinks") + socialLinks: [SocialLink!]! + currency: String + expensePolicy: String + + """ + Defines if the contributors wants to be incognito (name not displayed) + """ + isIncognito: Boolean! + imageUrl(height: Int, format: ImageFormat): String + backgroundImageUrl(height: Int, format: ImageFormat): String """ The time of creation @@ -6826,7 +7412,7 @@ type Individual implements Account { Returns true if the remote user is an admin of this account """ isAdmin: Boolean! - parentAccount: Account + parentAccount: Account @deprecated(reason: "2022-12-16: use parent on AccountWithParent instead") """ Get all members (admins, members, backers, followers) @@ -6846,6 +7432,7 @@ type Individual implements Account { Order of the results """ orderBy: ChronologicalOrderInput! = { field: CREATED_AT, direction: ASC } + includeInherited: Boolean = true ): MemberCollection! """ @@ -7046,6 +7633,11 @@ type Individual implements Account { """ includeHostedAccounts: Boolean + """ + Only return orders that were paid with this payment method. Must be an admin of the account owning the payment method. + """ + paymentMethod: PaymentMethodReferenceInput + """ Whether to include incognito orders. Must be admin or root. Only with filter null or OUTGOING. """ @@ -7101,6 +7693,11 @@ type Individual implements Account { Only returns orders that have a subscription (monthly/yearly). Don't use together with frequency. """ onlySubscriptions: Boolean + + """ + Same as onlySubscriptions, but returns only orders with active subscriptions + """ + onlyActiveSubscriptions: Boolean ): OrderCollection! settings: JSON! conversations( @@ -7148,6 +7745,11 @@ type Individual implements Account { includeExpired: Boolean ): [PaymentMethod] + """ + The list of payment methods for this account that are pending a client confirmation (3D Secure / SCA) + """ + paymentMethodsWithPendingConfirmation: [PaymentMethod] + """ The list of connected accounts (Stripe, Twitter, etc ...). Admin only. Scope: "connectedAccounts". """ @@ -7280,6 +7882,26 @@ type Individual implements Account { """ offset: Int! = 0 ): OAuthAuthorizationCollection + + """ + The list of personal tokens created by this account. Admin only. Scope: "applications". + """ + personalTokens( + """ + The number of results to fetch (default 10, max 1000) + """ + limit: Int! = 10 + + """ + The offset to use to fetch + """ + offset: Int! = 0 + ): PersonalTokenCollection + + """ + Has the account a password set? For authenticated user: scope: "account". + """ + hasPassword: Boolean } """ @@ -7292,6 +7914,61 @@ type OAuthAuthorizationCollection implements Collection { nodes: [OAuthAuthorization] } +""" +A collection of "PersonalToken" +""" +type PersonalTokenCollection implements Collection { + offset: Int + limit: Int + totalCount: Int + nodes: [PersonalToken] +} + +""" +A personal token +""" +type PersonalToken { + """ + Unique identifier for this personal token + """ + id: String! + + """ + A friendly name for users to easily find their personal tokens + """ + name: String + + """ + The personal token + """ + token: String + + """ + The date on which the personal token expires + """ + expiresAt: DateTime + + """ + The scopes of the personal token + """ + scope: [OAuthScope] + + """ + The account that owns this personal token + """ + account: Individual! + + """ + The date on which the personal token was created + """ + createdAt: DateTime + + """ + The date on which the personal token was last updated + """ + updatedAt: DateTime +} + """ This represents a Member relationship (ie: Organization backing a Collective) """ @@ -7317,6 +7994,11 @@ type Member { Custom user description """ description: String + + """ + If membership is inherited from parent collective + """ + inherited: Boolean account: Account } @@ -7345,6 +8027,11 @@ type MemberOf { Custom user description """ description: String + + """ + If membership is inherited from parent collective + """ + inherited: Boolean account: Account } @@ -7373,10 +8060,11 @@ type Organization implements Account & AccountWithContributions { description: String longDescription: String tags: [String] - website: String - twitterHandle: String + website: String @deprecated(reason: "2023-01-16: Please use socialLinks") + twitterHandle: String @deprecated(reason: "2023-01-16: Please use socialLinks") githubHandle: String @deprecated(reason: "2022-06-03: Please use repositoryUrl") - repositoryUrl: String + repositoryUrl: String @deprecated(reason: "2023-01-16: Please use socialLinks") + socialLinks: [SocialLink!]! currency: String expensePolicy: String @@ -7417,7 +8105,7 @@ type Organization implements Account & AccountWithContributions { Returns true if the remote user is an admin of this account """ isAdmin: Boolean! - parentAccount: Account + parentAccount: Account @deprecated(reason: "2022-12-16: use parent on AccountWithParent instead") """ Get all members (admins, members, backers, followers) @@ -7437,6 +8125,7 @@ type Organization implements Account & AccountWithContributions { Order of the results """ orderBy: ChronologicalOrderInput! = { field: CREATED_AT, direction: ASC } + includeInherited: Boolean = true ): MemberCollection! """ @@ -7637,6 +8326,11 @@ type Organization implements Account & AccountWithContributions { """ includeHostedAccounts: Boolean + """ + Only return orders that were paid with this payment method. Must be an admin of the account owning the payment method. + """ + paymentMethod: PaymentMethodReferenceInput + """ Whether to include incognito orders. Must be admin or root. Only with filter null or OUTGOING. """ @@ -7692,6 +8386,11 @@ type Organization implements Account & AccountWithContributions { Only returns orders that have a subscription (monthly/yearly). Don't use together with frequency. """ onlySubscriptions: Boolean + + """ + Same as onlySubscriptions, but returns only orders with active subscriptions + """ + onlyActiveSubscriptions: Boolean ): OrderCollection! settings: JSON! conversations( @@ -7739,6 +8438,11 @@ type Organization implements Account & AccountWithContributions { includeExpired: Boolean ): [PaymentMethod] + """ + The list of payment methods for this account that are pending a client confirmation (3D Secure / SCA) + """ + paymentMethodsWithPendingConfirmation: [PaymentMethod] + """ The list of connected accounts (Stripe, Twitter, etc ...). Admin only. Scope: "connectedAccounts". """ @@ -7886,7 +8590,7 @@ type Organization implements Account & AccountWithContributions { """ How much platform fees are charged for this account """ - platformFeePercent: Int! + platformFeePercent: Float! """ Returns true if a custom contribution to Open Collective can be submitted for contributions made to this account @@ -7989,10 +8693,11 @@ type Vendor implements Account & AccountWithHost & AccountWithContributions { description: String longDescription: String tags: [String] - website: String - twitterHandle: String + website: String @deprecated(reason: "2023-01-16: Please use socialLinks") + twitterHandle: String @deprecated(reason: "2023-01-16: Please use socialLinks") githubHandle: String @deprecated(reason: "2022-06-03: Please use repositoryUrl") - repositoryUrl: String + repositoryUrl: String @deprecated(reason: "2023-01-16: Please use socialLinks") + socialLinks: [SocialLink!]! currency: String expensePolicy: String @@ -8033,7 +8738,7 @@ type Vendor implements Account & AccountWithHost & AccountWithContributions { Returns true if the remote user is an admin of this account """ isAdmin: Boolean! - parentAccount: Account + parentAccount: Account @deprecated(reason: "2022-12-16: use parent on AccountWithParent instead") """ Get all members (admins, members, backers, followers) @@ -8053,6 +8758,7 @@ type Vendor implements Account & AccountWithHost & AccountWithContributions { Order of the results """ orderBy: ChronologicalOrderInput! = { field: CREATED_AT, direction: ASC } + includeInherited: Boolean = true ): MemberCollection! """ @@ -8253,6 +8959,11 @@ type Vendor implements Account & AccountWithHost & AccountWithContributions { """ includeHostedAccounts: Boolean + """ + Only return orders that were paid with this payment method. Must be an admin of the account owning the payment method. + """ + paymentMethod: PaymentMethodReferenceInput + """ Whether to include incognito orders. Must be admin or root. Only with filter null or OUTGOING. """ @@ -8308,6 +9019,11 @@ type Vendor implements Account & AccountWithHost & AccountWithContributions { Only returns orders that have a subscription (monthly/yearly). Don't use together with frequency. """ onlySubscriptions: Boolean + + """ + Same as onlySubscriptions, but returns only orders with active subscriptions + """ + onlyActiveSubscriptions: Boolean ): OrderCollection! settings: JSON! conversations( @@ -8355,6 +9071,11 @@ type Vendor implements Account & AccountWithHost & AccountWithContributions { includeExpired: Boolean ): [PaymentMethod] + """ + The list of payment methods for this account that are pending a client confirmation (3D Secure / SCA) + """ + paymentMethodsWithPendingConfirmation: [PaymentMethod] + """ The list of connected accounts (Stripe, Twitter, etc ...). Admin only. Scope: "connectedAccounts". """ @@ -8482,7 +9203,7 @@ type Vendor implements Account & AccountWithHost & AccountWithContributions { """ How much platform fees are charged for this account """ - platformFeePercent: Int! + platformFeePercent: Float! """ Date of approval by the Fiscal Host. @@ -8615,6 +9336,16 @@ type Query { """ tag: [String] + """ + Operator to use when searching with tags. Defaults to 'AND' + """ + tagSearchOperator: TagSearchOperator! = AND + + """ + Host hosting the account + """ + host: [AccountReferenceInput] + """ Only return accounts that match these account types (COLLECTIVE, FUND, EVENT, PROJECT, ORGANIZATION or INDIVIDUAL) """ @@ -8815,6 +9546,11 @@ type Query { """ host: AccountReferenceInput + """ + Return expenses only created by this INDIVIDUAL account + """ + createdByAccount: AccountReferenceInput + """ Use this field to filter expenses on their statuses """ @@ -9006,6 +9742,11 @@ type Query { """ includeHostedAccounts: Boolean + """ + Only return orders that were paid with this payment method. Must be an admin of the account owning the payment method. + """ + paymentMethod: PaymentMethodReferenceInput + """ Whether to include incognito orders. Must be admin or root. Only with filter null or OUTGOING. """ @@ -9061,6 +9802,11 @@ type Query { Only returns orders that have a subscription (monthly/yearly). Don't use together with frequency. """ onlySubscriptions: Boolean + + """ + Same as onlySubscriptions, but returns only orders with active subscriptions + """ + onlyActiveSubscriptions: Boolean ): OrderCollection! organization( """ @@ -9106,9 +9852,19 @@ type Query { ): Project tagStats( """ - Return tags from collectives which includes this search term + Return tags from collectives which includes this search term. Using this argument will ignore tagSearchTerm. Skipping this argument will use a more efficient query. """ searchTerm: String + + """ + Return tags which includes this search term. Using this argument will ignore searchTerm. + """ + tagSearchTerm: String + + """ + Return tags from collectives hosted by this host. + """ + host: AccountReferenceInput limit: Int! = 10 offset: Int! = 0 ): TagStatsCollection! @@ -9255,6 +10011,32 @@ type Query { """ account: AccountReferenceInput ): Update + updates( + """ + The number of results to fetch (default 10, max 1000) + """ + limit: Int! = 10 + + """ + The offset to use to fetch + """ + offset: Int! = 0 + + """ + Only return updates from accounts that have one of these tags + """ + accountTag: [String] + + """ + Only return updates from accounts that match these types (COLLECTIVE, FUND, EVENT, PROJECT, ORGANIZATION or INDIVIDUAL) + """ + accountType: [AccountType] + + """ + Host for the accounts for which to get updates + """ + host: [AccountReferenceInput] + ): UpdatesCollection! paypalPlan( """ The account that serves as a payment target @@ -9272,10 +10054,33 @@ type Query { """ tier: TierReferenceInput ): PaypalPlan! + + """ + Get a personal token by reference + """ + personalToken( + """ + The public id identifying the personal-token (ie: dgm9bnk8-0437xqry-ejpvzeol-jdayw5re) + """ + id: String + + """ + The legacy public id identifying the personal-token (ie: 4242) + """ + legacyId: Int + ): PersonalToken loggedInAccount: Individual me: Individual } +""" +The operator to use when searching with tags +""" +enum TagSearchOperator { + AND + OR +} + """ Two-letters country code following ISO3166_1 """ @@ -10524,6 +11329,7 @@ type ActivityCollection implements Collection { enum ActivityAndClassesType { ACTIVITY_ALL CONNECTED_ACCOUNT_CREATED + CONNECTED_ACCOUNT_ERROR COLLECTIVE_CREATED_GITHUB COLLECTIVE_APPLY COLLECTIVE_APPROVED @@ -10535,7 +11341,6 @@ enum ActivityAndClassesType { ORGANIZATION_COLLECTIVE_CREATED COLLECTIVE_FROZEN COLLECTIVE_UNFROZEN - COLLECTIVE_COMMENT_CREATED COLLECTIVE_CONVERSATION_CREATED UPDATE_COMMENT_CREATED EXPENSE_COMMENT_CREATED @@ -10553,6 +11358,7 @@ enum ActivityAndClassesType { COLLECTIVE_EXPENSE_MARKED_AS_INCOMPLETE COLLECTIVE_EXPENSE_PROCESSING COLLECTIVE_EXPENSE_SCHEDULED_FOR_PAYMENT + COLLECTIVE_EXPENSE_UNSCHEDULED_FOR_PAYMENT COLLECTIVE_EXPENSE_ERROR COLLECTIVE_EXPENSE_INVITE_DRAFTED COLLECTIVE_EXPENSE_RECURRING_DRAFTED @@ -10579,15 +11385,19 @@ enum ActivityAndClassesType { HOST_APPLICATION_CONTACT CONTRIBUTION_REJECTED SUBSCRIPTION_ACTIVATED - SUBSCRIPTION_CONFIRMED SUBSCRIPTION_CANCELED TICKET_CONFIRMED ORDER_CANCELED_ARCHIVED_COLLECTIVE - ORDER_PROCESSING - ORDER_PROCESSING_CRYPTO + ORDER_PENDING + ORDER_PENDING_CRYPTO ORDER_PENDING_CONTRIBUTION_NEW ORDER_PENDING_CONTRIBUTION_REMINDER + ORDER_PROCESSING + ORDER_PAYMENT_FAILED ORDER_THANKYOU + ORDER_PENDING_CREATED + ORDER_PENDING_FOLLOWUP + ORDER_PENDING_RECEIVED ORDERS_SUSPICIOUS BACKYOURSTACK_DISPATCH_CONFIRMED PAYMENT_FAILED @@ -10595,11 +11405,14 @@ enum ActivityAndClassesType { PAYMENT_CREDITCARD_EXPIRING USER_CREATED USER_NEW_TOKEN + USER_SIGNIN + USER_RESET_PASSWORD OAUTH_APPLICATION_AUTHORIZED TWO_FACTOR_CODE_ADDED TWO_FACTOR_CODE_DELETED USER_CHANGE_EMAIL USER_PAYMENT_METHOD_CREATED + USER_PASSWORD_SET USER_CARD_CLAIMED USER_CARD_INVITED WEBHOOK_STRIPE_RECEIVED @@ -10613,6 +11426,8 @@ enum ActivityAndClassesType { COLLECTIVE_USER_ADDED COLLECTIVE_VIRTUAL_CARD_ASSIGNED COLLECTIVE_VIRTUAL_CARD_CREATED + SUBSCRIPTION_CONFIRMED + COLLECTIVE_COMMENT_CREATED COLLECTIVE EXPENSES CONTRIBUTIONS @@ -10692,10 +11507,11 @@ type Fund implements Account & AccountWithHost & AccountWithContributions { description: String longDescription: String tags: [String] - website: String - twitterHandle: String + website: String @deprecated(reason: "2023-01-16: Please use socialLinks") + twitterHandle: String @deprecated(reason: "2023-01-16: Please use socialLinks") githubHandle: String @deprecated(reason: "2022-06-03: Please use repositoryUrl") - repositoryUrl: String + repositoryUrl: String @deprecated(reason: "2023-01-16: Please use socialLinks") + socialLinks: [SocialLink!]! currency: String expensePolicy: String @@ -10736,7 +11552,7 @@ type Fund implements Account & AccountWithHost & AccountWithContributions { Returns true if the remote user is an admin of this account """ isAdmin: Boolean! - parentAccount: Account + parentAccount: Account @deprecated(reason: "2022-12-16: use parent on AccountWithParent instead") """ Get all members (admins, members, backers, followers) @@ -10756,6 +11572,7 @@ type Fund implements Account & AccountWithHost & AccountWithContributions { Order of the results """ orderBy: ChronologicalOrderInput! = { field: CREATED_AT, direction: ASC } + includeInherited: Boolean = true ): MemberCollection! """ @@ -10956,6 +11773,11 @@ type Fund implements Account & AccountWithHost & AccountWithContributions { """ includeHostedAccounts: Boolean + """ + Only return orders that were paid with this payment method. Must be an admin of the account owning the payment method. + """ + paymentMethod: PaymentMethodReferenceInput + """ Whether to include incognito orders. Must be admin or root. Only with filter null or OUTGOING. """ @@ -11011,6 +11833,11 @@ type Fund implements Account & AccountWithHost & AccountWithContributions { Only returns orders that have a subscription (monthly/yearly). Don't use together with frequency. """ onlySubscriptions: Boolean + + """ + Same as onlySubscriptions, but returns only orders with active subscriptions + """ + onlyActiveSubscriptions: Boolean ): OrderCollection! settings: JSON! conversations( @@ -11058,6 +11885,11 @@ type Fund implements Account & AccountWithHost & AccountWithContributions { includeExpired: Boolean ): [PaymentMethod] + """ + The list of payment methods for this account that are pending a client confirmation (3D Secure / SCA) + """ + paymentMethodsWithPendingConfirmation: [PaymentMethod] + """ The list of connected accounts (Stripe, Twitter, etc ...). Admin only. Scope: "connectedAccounts". """ @@ -11185,7 +12017,7 @@ type Fund implements Account & AccountWithHost & AccountWithContributions { """ How much platform fees are charged for this account """ - platformFeePercent: Int! + platformFeePercent: Float! """ Date of approval by the Fiscal Host. @@ -11288,10 +12120,11 @@ type Project implements Account & AccountWithHost & AccountWithContributions & A description: String longDescription: String tags: [String] - website: String - twitterHandle: String + website: String @deprecated(reason: "2023-01-16: Please use socialLinks") + twitterHandle: String @deprecated(reason: "2023-01-16: Please use socialLinks") githubHandle: String @deprecated(reason: "2022-06-03: Please use repositoryUrl") - repositoryUrl: String + repositoryUrl: String @deprecated(reason: "2023-01-16: Please use socialLinks") + socialLinks: [SocialLink!]! currency: String expensePolicy: String @@ -11332,7 +12165,7 @@ type Project implements Account & AccountWithHost & AccountWithContributions & A Returns true if the remote user is an admin of this account """ isAdmin: Boolean! - parentAccount: Account + parentAccount: Account @deprecated(reason: "2022-12-16: use parent on AccountWithParent instead") """ Get all members (admins, members, backers, followers) @@ -11352,6 +12185,7 @@ type Project implements Account & AccountWithHost & AccountWithContributions & A Order of the results """ orderBy: ChronologicalOrderInput! = { field: CREATED_AT, direction: ASC } + includeInherited: Boolean = true ): MemberCollection! """ @@ -11552,6 +12386,11 @@ type Project implements Account & AccountWithHost & AccountWithContributions & A """ includeHostedAccounts: Boolean + """ + Only return orders that were paid with this payment method. Must be an admin of the account owning the payment method. + """ + paymentMethod: PaymentMethodReferenceInput + """ Whether to include incognito orders. Must be admin or root. Only with filter null or OUTGOING. """ @@ -11607,6 +12446,11 @@ type Project implements Account & AccountWithHost & AccountWithContributions & A Only returns orders that have a subscription (monthly/yearly). Don't use together with frequency. """ onlySubscriptions: Boolean + + """ + Same as onlySubscriptions, but returns only orders with active subscriptions + """ + onlyActiveSubscriptions: Boolean ): OrderCollection! settings: JSON! conversations( @@ -11654,6 +12498,11 @@ type Project implements Account & AccountWithHost & AccountWithContributions & A includeExpired: Boolean ): [PaymentMethod] + """ + The list of payment methods for this account that are pending a client confirmation (3D Secure / SCA) + """ + paymentMethodsWithPendingConfirmation: [PaymentMethod] + """ The list of connected accounts (Stripe, Twitter, etc ...). Admin only. Scope: "connectedAccounts". """ @@ -11781,7 +12630,7 @@ type Project implements Account & AccountWithHost & AccountWithContributions & A """ How much platform fees are charged for this account """ - platformFeePercent: Int! + platformFeePercent: Float! """ Date of approval by the Fiscal Host. @@ -11869,6 +12718,16 @@ input TierReferenceInput { isCustom: Boolean } +""" +A collection of "Updates" +""" +type UpdatesCollection implements Collection { + offset: Int + limit: Int + totalCount: Int + nodes: [Update!] +} + """ A PayPal plan to associate with a contribution """ @@ -11910,6 +12769,7 @@ type Mutation { amount: AmountInput! description: String! memo: String + processedAt: DateTime hostFeePercent: Float invoiceTemplate: String ): Order! @@ -12495,6 +13355,21 @@ type Mutation { """ setNewsletterOptIn(newsletterOptIn: Boolean!): Individual! + """ + Set password to Individual. Scope: "account". 2FA. + """ + setPassword( + """ + The password to set. + """ + password: String! + + """ + The current password (if any) to confirm password change. + """ + currentPassword: String + ): SetPasswordResponse! + """ Invite a new member to the Collective. Scope: "account". """ @@ -12746,6 +13621,21 @@ type Mutation { makeIncognito: Boolean ): [Order]! + """ + Creates a Stripe payment intent + """ + createPaymentIntent(paymentIntent: PaymentIntentInput!): PaymentIntent! + + """ + To submit a new order. Scope: "orders". + """ + createPendingOrder(order: PendingOrderCreateInput!): Order! + + """ + To edit a pending order. Scope: "orders". + """ + editPendingOrder(order: PendingOrderEditInput!): Order! + """ Add a new payment method to be used with an Order. Scope: "orders". """ @@ -12814,6 +13704,11 @@ type Mutation { Specify whether the account is a trusted host """ isTrustedHost: Boolean + + """ + Set this to false to disable 2FA. Other values have no effect. + """ + isTwoFactorAuthEnabled: Boolean ): Account! """ @@ -13136,6 +14031,32 @@ type Mutation { Delete a tier. """ deleteTier(tier: TierReferenceInput!, stopRecurringContributions: Boolean! = false): Tier! + createPersonalToken(personalToken: PersonalTokenCreateInput!): PersonalToken + updatePersonalToken(personalToken: PersonalTokenUpdateInput!): PersonalToken + deletePersonalToken(personalToken: PersonalTokenReferenceInput!): PersonalToken + + """ + Updates collective social links + """ + updateSocialLinks( + """ + Account where the social link will be associated + """ + account: AccountReferenceInput! + + """ + The social links in order of preference + """ + socialLinks: [SocialLinkInput!]! + ): [SocialLink!]! + setTags( + """ + Tags associated with the object being updated + """ + tags: [String] + order: OrderReferenceInput + expense: ExpenseReferenceInput + ): TagResponse! } input CollectiveCreateInput { @@ -13144,7 +14065,7 @@ input CollectiveCreateInput { description: String! tags: [String] githubHandle: String @deprecated(reason: "2022-06-03: Please use repositoryUrl") - repositoryUrl: String + repositoryUrl: String @deprecated(reason: "2023-01-16: Please use socialLinks") settings: JSON } @@ -13254,10 +14175,18 @@ input AccountUpdateInput { } input PoliciesInput { - EXPENSE_AUTHOR_CANNOT_APPROVE: Boolean + EXPENSE_AUTHOR_CANNOT_APPROVE: PoliciesCollectiveExpenseAuthorCannotApprove + REQUIRE_2FA_FOR_ADMINS: Boolean COLLECTIVE_MINIMUM_ADMINS: PoliciesCollectiveMinimumAdminsInput } +input PoliciesCollectiveExpenseAuthorCannotApprove { + amountInCents: Int + enabled: Boolean + appliesToHostedCollectives: Boolean + appliesToSingleAdminCollectives: Boolean +} + input PoliciesCollectiveMinimumAdminsInput { numberOfAdmins: Int applies: PolicyApplication @@ -13536,6 +14465,14 @@ input ExpenseAttachedFileInput { """ id: String + """ + Original filename + """ + name: String + @deprecated( + reason: "2023-02-02: This must now be provided when uploading the file. This parameter will be ignored." + ) + """ URL of the file """ @@ -13810,9 +14747,14 @@ Parameters for paying an expense """ input ProcessExpensePaymentParams { """ - The fee charged by payment processor in collective currency + The fee charged by payment processor in host currency + """ + paymentProcessorFeeInHostCurrency: Int + + """ + The total amount paid in host currency """ - paymentProcessorFee: Int + totalAmountPaidInHostCurrency: Int """ Whether the payment processor fees should be refunded when triggering MARK_AS_UNPAID @@ -13825,12 +14767,7 @@ input ProcessExpensePaymentParams { forceManual: Boolean """ - 2FA code for if the host account has 2FA for payouts turned on. - """ - twoFactorAuthenticatorCode: String - - """ - 2FA code for if the host account has 2FA for payouts turned on. + Who is responsible for paying any due fees. """ feesPayer: FeesPayer = COLLECTIVE } @@ -13965,6 +14902,11 @@ enum ProcessHostApplicationAction { SEND_PUBLIC_MESSAGE } +type SetPasswordResponse { + individual: Individual! + token: String +} + input MemberInvitationReferenceInput { """ The public id identifying the member invitation (ie: dgm9bnk8-0437xqry-ejpvzeol-jdayw5re) @@ -14094,6 +15036,7 @@ input OrderFromAccountInfo { """ location: LocationInput name: String + email: String legalName: String } @@ -14194,16 +15137,21 @@ input PaymentMethodInput { To pass when type is PAYPAL """ paypalInfo: PaypalPaymentInput + + """ + The Payment Intent ID used in this checkout + """ + paymentIntentId: String } input CreditCardCreateInput { token: String! - brand: String! - country: String! - expMonth: Int! - expYear: Int! - fullName: String - funding: String + brand: String @deprecated(reason: "2022-11-22: the `token` parameter is sufficient") + country: String @deprecated(reason: "2022-11-22: the `token` parameter is sufficient") + expMonth: Int @deprecated(reason: "2022-11-22: the `token` parameter is sufficient") + expYear: Int @deprecated(reason: "2022-11-22: the `token` parameter is sufficient") + fullName: String @deprecated(reason: "2022-11-22: the field was not used since 2017") + funding: String @deprecated(reason: "2022-11-22: the `token` parameter is sufficient") zip: String } @@ -14242,13 +15190,6 @@ input OrderContextInput { isEmbed: Boolean } -input PaymentMethodReferenceInput { - """ - The id assigned to the payment method - """ - id: String -} - input OrderUpdateInput { """ The public id identifying the order (ie: dgm9bnk8-0437xqry-ejpvzeol-jdayw5re) @@ -14279,6 +15220,11 @@ input OrderUpdateInput { Host fee percent to be applied to the order """ hostFeePercent: Float + + """ + Date the funds were received + """ + processedAt: DateTime } """ @@ -14296,6 +15242,162 @@ enum ProcessOrderAction { MARK_AS_PAID } +""" +A Stripe payment intent +""" +type PaymentIntent { + id: String! + paymentIntentClientSecret: String! + stripeAccount: String! + stripeAccountPublishableSecret: String! +} + +""" +Input to create a Stripe payment intent +""" +input PaymentIntentInput { + amount: AmountInput! + fromAccount: AccountReferenceInput + toAccount: AccountReferenceInput! +} + +""" +Input to create a new pending order +""" +input PendingOrderCreateInput { + """ + The contribution amount, without platform contribution and taxes + """ + amount: AmountInput! + + """ + The profile making the contribution. + """ + fromAccount: AccountReferenceInput! + + """ + Additional information about the contributing profile + """ + fromAccountInfo: OrderFromAccountInfo + + """ + The collective you want to contribute to + """ + toAccount: AccountReferenceInput! + + """ + Platform tip attached to this order + """ + platformTipAmount: AmountInput + + """ + Use this field to set the taxes associated to this order + """ + taxes: [OrderTaxInput] + + """ + The tier you are contributing to + """ + tier: TierReferenceInput + + """ + Public order description + """ + description: String + + """ + Private memo for the host + """ + memo: String + + """ + External identifier for the order + """ + ponumber: String + + """ + Payment method expected for this order + """ + paymentMethod: String + + """ + When is the money expected? + """ + expectedAt: DateString + hostFeePercent: Float +} + +""" +Input to edit an existing pending order +""" +input PendingOrderEditInput { + """ + The public id identifying the order (ie: dgm9bnk8-0437xqry-ejpvzeol-jdayw5re) + """ + id: String + + """ + The legacy public id identifying the order (ie: 4242) + """ + legacyId: Int + + """ + The contribution amount, without platform contribution and taxes + """ + amount: AmountInput! + + """ + The profile making the contribution. + """ + fromAccount: AccountReferenceInput + + """ + Additional information about the contributing profile + """ + fromAccountInfo: OrderFromAccountInfo + + """ + Platform tip attached to this order + """ + platformTipAmount: AmountInput + + """ + Use this field to set the taxes associated to this order + """ + taxes: [OrderTaxInput] + + """ + The tier you are contributing to + """ + tier: TierReferenceInput + + """ + Public order description + """ + description: String + + """ + Private memo for the host + """ + memo: String + + """ + External identifier for the order + """ + ponumber: String + + """ + Payment method expected for this order + """ + paymentMethod: String + + """ + When is the money expected? + """ + expectedAt: DateString + hostFeePercent: Float +} + type CreditCardWithStripeError { """ The payment method created @@ -14447,23 +15549,25 @@ input TierUpdateInput { The public id identifying the tier (ie: dgm9bnk8-0437xqry-ejpvzeol-jdayw5re) """ id: String! - amount: AmountInput! + amount: AmountInput name: NonEmptyString description: String button: String goal: AmountInput - type: TierType! - amountType: TierAmountType! - frequency: TierFrequency! + type: TierType + amountType: TierAmountType + frequency: TierFrequency presets: [Int!] maxQuantity: Int minimumAmount: AmountInput useStandalonePage: Boolean + invoiceTemplate: String + singleTicket: Boolean } input TierCreateInput { - amount: AmountInput! - name: NonEmptyString + amount: AmountInput + name: NonEmptyString! description: String button: String goal: AmountInput @@ -14474,4 +15578,60 @@ input TierCreateInput { maxQuantity: Int minimumAmount: AmountInput useStandalonePage: Boolean + invoiceTemplate: String + singleTicket: Boolean +} + +""" +Input type for PersonalToken +""" +input PersonalTokenCreateInput { + name: String + scope: [OAuthScope] + expiresAt: String + + """ + The account to use as the owner of the application. Defaults to currently logged in user. + """ + account: AccountReferenceInput +} + +""" +Input type for PersonalToken +""" +input PersonalTokenUpdateInput { + """ + The public id identifying the personal-token (ie: dgm9bnk8-0437xqry-ejpvzeol-jdayw5re) + """ + id: String + + """ + The legacy public id identifying the personal-token (ie: 4242) + """ + legacyId: Int + name: String + scope: [OAuthScope] + expiresAt: String +} + +input PersonalTokenReferenceInput { + """ + The public id identifying the personal-token (ie: dgm9bnk8-0437xqry-ejpvzeol-jdayw5re) + """ + id: String + + """ + The legacy public id identifying the personal-token (ie: 4242) + """ + legacyId: Int +} + +input SocialLinkInput { + type: SocialLinkType! + url: URL! +} + +type TagResponse { + order: Order + expense: Expense } diff --git a/src/server/controllers/account-transactions.js b/src/server/controllers/account-transactions.js index bf66a137..2ada484b 100644 --- a/src/server/controllers/account-transactions.js +++ b/src/server/controllers/account-transactions.js @@ -88,6 +88,7 @@ export const transactionsFragment = gqlV2/* GraphQL */ ` createdAt frequency memo + processedAt } paymentMethod { service @@ -261,6 +262,7 @@ const csvMapping = { payoutMethodType: (t) => get(t, 'expense.payoutMethod.type'), merchantId: (t) => get(t, 'merchantId'), orderMemo: (t) => get(t, 'order.memo'), + orderProcessedDate: (t) => (t.order?.processedAt ? moment.utc(t.order.processedAt).format('YYYY-MM-DD') : ''), }; const allKinds = [ @@ -312,6 +314,7 @@ const defaultFields = [ // Extra fields 'merchantId', 'orderMemo', + 'orderProcessedDate', ]; const applyMapping = (mapping, row) => {