diff --git a/src/graphql/schema.graphql b/src/graphql/schema.graphql index 37fabb62..889fb725 100644 --- a/src/graphql/schema.graphql +++ b/src/graphql/schema.graphql @@ -967,27 +967,29 @@ type SocialLink { The type of social link """ enum SocialLinkType { - TWITTER - TUMBLR - MASTODON - MATTERMOST - SLACK - LINKEDIN - MEETUP - FACEBOOK - INSTAGRAM + BLUESKY DISCORD - YOUTUBE - GITHUB - GITLAB - GIT - WEBSITE DISCOURSE - PIXELFED + FACEBOOK GHOST + GIT + GITHUB + GITLAB + INSTAGRAM + LINKEDIN + MASTODON + MATTERMOST + MEETUP PEERTUBE + PIXELFED + SLACK + THREADS TIKTOK + TUMBLR TWITCH + TWITTER + WEBSITE + YOUTUBE } """ @@ -1134,6 +1136,7 @@ type PlanType { type Policies { id: String + EXPENSE_POLICIES: EXPENSE_POLICIES EXPENSE_AUTHOR_CANNOT_APPROVE: EXPENSE_AUTHOR_CANNOT_APPROVE REQUIRE_2FA_FOR_ADMINS: Boolean COLLECTIVE_ADMINS_CAN_REFUND: Boolean @@ -1144,6 +1147,12 @@ type Policies { COLLECTIVE_ADMINS_CAN_SEE_PAYOUT_METHODS: Boolean } +type EXPENSE_POLICIES { + invoicePolicy: String + receiptPolicy: String + titlePolicy: String +} + type EXPENSE_AUTHOR_CANNOT_APPROVE { amountInCents: Int enabled: Boolean diff --git a/src/graphql/schemaV2.graphql b/src/graphql/schemaV2.graphql index 84233034..e2f68a65 100644 --- a/src/graphql/schemaV2.graphql +++ b/src/graphql/schemaV2.graphql @@ -204,7 +204,7 @@ interface Account { The currency of the account """ currency: Currency! - expensePolicy: String + expensePolicy: String @deprecated(reason: "2024-11-04: Please use policies.EXPENSE_POLICIES") """ Defines if the contributors wants to be incognito (name not displayed) @@ -593,6 +593,16 @@ interface Account { """ expectedDateTo: DateTime + """ + Return orders that were charged after this date + """ + chargedDateFrom: DateTime + + """ + Return orders that were charged before this date + """ + chargedDateTo: DateTime + """ The term to search """ @@ -1030,27 +1040,29 @@ type SocialLink { The type of social link """ enum SocialLinkType { - TWITTER - TUMBLR - MASTODON - MATTERMOST - SLACK - LINKEDIN - MEETUP - FACEBOOK - INSTAGRAM + BLUESKY DISCORD - YOUTUBE - GITHUB - GITLAB - GIT - WEBSITE DISCOURSE - PIXELFED + FACEBOOK GHOST + GIT + GITHUB + GITLAB + INSTAGRAM + LINKEDIN + MASTODON + MATTERMOST + MEETUP PEERTUBE + PIXELFED + SLACK + THREADS TIKTOK + TUMBLR TWITCH + TWITTER + WEBSITE + YOUTUBE } """ @@ -1821,6 +1833,11 @@ enum DateTimeField { Transactions only: The date when a transaction was cleared by the payment processor """ EFFECTIVE_DATE + + """ + Orders only: The date when an order was last charged, defaults to createdAt if never charged + """ + LAST_CHARGED_AT } """ @@ -1950,6 +1967,7 @@ type Order { status: OrderStatus frequency: ContributionFrequency nextChargeDate: DateTime + lastChargedAt: DateTime tier: Tier fromAccount: Account toAccount: Account @@ -2531,6 +2549,11 @@ type Expense { """ securityChecks: [SecurityCheck] + """ + [Host Admin only] Key to access the draft of this expense + """ + draftKey: String + """ Custom data for this expense """ @@ -2540,6 +2563,16 @@ type Expense { The merchant ID for this expense """ merchantId: String + + """ + The reference text used in the payment transfer + """ + transferReference: String + + """ + Fields that cannot be edited on this expense + """ + lockedFields: [ExpenseLockableFields] } """ @@ -2659,7 +2692,7 @@ type Host implements Account & AccountWithContributions { The currency of the account """ currency: Currency! - expensePolicy: String + expensePolicy: String @deprecated(reason: "2024-11-04: Please use policies.EXPENSE_POLICIES") """ Defines if the contributors wants to be incognito (name not displayed) @@ -3075,6 +3108,16 @@ type Host implements Account & AccountWithContributions { """ expectedDateTo: DateTime + """ + Return orders that were charged after this date + """ + chargedDateFrom: DateTime + + """ + Return orders that were charged before this date + """ + chargedDateTo: DateTime + """ The term to search """ @@ -3517,6 +3560,24 @@ type Host implements Account & AccountWithContributions { roles: [MemberRole] ): ContributorCollection! + """ + [!] Warning: this query is currently in beta and the API might change + """ + activeContributors( + """ + The number of results to fetch (default 10, max 1000) + """ + limit: Int! = 10 + + """ + The offset to use to fetch + """ + offset: Int! = 0 + dateFrom: DateTime + dateTo: DateTime + includeActiveRecurringContributions: Boolean + ): AccountCollection! + """ How much platform fees are charged for this account """ @@ -4038,6 +4099,24 @@ interface AccountWithContributions { roles: [MemberRole] ): ContributorCollection! + """ + [!] Warning: this query is currently in beta and the API might change + """ + activeContributors( + """ + The number of results to fetch (default 10, max 1000) + """ + limit: Int! = 10 + + """ + The offset to use to fetch + """ + offset: Int! = 0 + dateFrom: DateTime + dateTo: DateTime + includeActiveRecurringContributions: Boolean + ): AccountCollection! + """ How much platform fees are charged for this account """ @@ -4146,7 +4225,7 @@ type Contributor { If the contributor has a page on Open Collective, this is the slug to link to it. Always null for incognito contributors """ collectiveSlug: String @deprecated(reason: "2024-08-26: Use account.slug instead") - account: String + account: Account """ Contributor avatar or logo @@ -4159,6 +4238,16 @@ type Contributor { publicMessage: String } +""" +A collection of "Accounts" +""" +type AccountCollection implements Collection { + offset: Int + limit: Int + totalCount: Int + nodes: [Account] +} + """ A legal document (e.g. W9, W8BEN, W8BEN-E) """ @@ -4302,6 +4391,7 @@ Possible fields you can use to order by """ enum OrderByFieldType { CREATED_AT + LAST_CHARGED_AT """ The financial activity of the collective (number of transactions) @@ -4685,16 +4775,6 @@ type CommentCollection implements Collection { nodes: [Comment] } -""" -A collection of "Accounts" -""" -type AccountCollection implements Collection { - offset: Int - limit: Int - totalCount: Int - nodes: [Account] -} - type ConversationStats { id: String! @@ -4888,6 +4968,16 @@ type PaymentMethod { """ expectedDateTo: DateTime + """ + Return orders that were charged after this date + """ + chargedDateFrom: DateTime + + """ + Return orders that were charged before this date + """ + chargedDateTo: DateTime + """ The term to search """ @@ -5836,6 +5926,7 @@ enum VirtualCardStatus { type Policies { id: String + EXPENSE_POLICIES: EXPENSE_POLICIES EXPENSE_AUTHOR_CANNOT_APPROVE: EXPENSE_AUTHOR_CANNOT_APPROVE REQUIRE_2FA_FOR_ADMINS: Boolean COLLECTIVE_ADMINS_CAN_REFUND: Boolean @@ -5846,6 +5937,12 @@ type Policies { COLLECTIVE_ADMINS_CAN_SEE_PAYOUT_METHODS: Boolean } +type EXPENSE_POLICIES { + invoicePolicy: String + receiptPolicy: String + titlePolicy: String +} + type EXPENSE_AUTHOR_CANNOT_APPROVE { amountInCents: Int enabled: Boolean @@ -7531,6 +7628,31 @@ enum SecurityCheckLevel { HIGH } +""" +All fields that can be locked on an expense draft +""" +enum ExpenseLockableFields { + """ + Locks items' amount and currency, and it also blocks the hability to add new items. + """ + AMOUNT + + """ + Locks the payee field, if the user is not on the platform it locks its email. + """ + PAYEE + + """ + Locks the description field. + """ + DESCRIPTION + + """ + Locks the type field. + """ + TYPE +} + """ Fields for the user permissions on an transaction """ @@ -7721,7 +7843,7 @@ type Bot implements Account { The currency of the account """ currency: Currency! - expensePolicy: String + expensePolicy: String @deprecated(reason: "2024-11-04: Please use policies.EXPENSE_POLICIES") """ Defines if the contributors wants to be incognito (name not displayed) @@ -8137,6 +8259,16 @@ type Bot implements Account { """ expectedDateTo: DateTime + """ + Return orders that were charged after this date + """ + chargedDateFrom: DateTime + + """ + Return orders that were charged before this date + """ + chargedDateTo: DateTime + """ The term to search """ @@ -8578,7 +8710,7 @@ type Collective implements Account & AccountWithHost & AccountWithContributions The currency of the account """ currency: Currency! - expensePolicy: String + expensePolicy: String @deprecated(reason: "2024-11-04: Please use policies.EXPENSE_POLICIES") """ Defines if the contributors wants to be incognito (name not displayed) @@ -8994,6 +9126,16 @@ type Collective implements Account & AccountWithHost & AccountWithContributions """ expectedDateTo: DateTime + """ + Return orders that were charged after this date + """ + chargedDateFrom: DateTime + + """ + Return orders that were charged before this date + """ + chargedDateTo: DateTime + """ The term to search """ @@ -9502,6 +9644,24 @@ type Collective implements Account & AccountWithHost & AccountWithContributions roles: [MemberRole] ): ContributorCollection! + """ + [!] Warning: this query is currently in beta and the API might change + """ + activeContributors( + """ + The number of results to fetch (default 10, max 1000) + """ + limit: Int! = 10 + + """ + The offset to use to fetch + """ + offset: Int! = 0 + dateFrom: DateTime + dateTo: DateTime + includeActiveRecurringContributions: Boolean + ): AccountCollection! + """ Returns true if a custom contribution to Open Collective can be submitted for contributions made to this account """ @@ -9966,7 +10126,7 @@ type Event implements Account & AccountWithHost & AccountWithContributions & Acc The currency of the account """ currency: Currency! - expensePolicy: String + expensePolicy: String @deprecated(reason: "2024-11-04: Please use policies.EXPENSE_POLICIES") """ Defines if the contributors wants to be incognito (name not displayed) @@ -10382,6 +10542,16 @@ type Event implements Account & AccountWithHost & AccountWithContributions & Acc """ expectedDateTo: DateTime + """ + Return orders that were charged after this date + """ + chargedDateFrom: DateTime + + """ + Return orders that were charged before this date + """ + chargedDateTo: DateTime + """ The term to search """ @@ -10890,6 +11060,24 @@ type Event implements Account & AccountWithHost & AccountWithContributions & Acc roles: [MemberRole] ): ContributorCollection! + """ + [!] Warning: this query is currently in beta and the API might change + """ + activeContributors( + """ + The number of results to fetch (default 10, max 1000) + """ + limit: Int! = 10 + + """ + The offset to use to fetch + """ + offset: Int! = 0 + dateFrom: DateTime + dateTo: DateTime + includeActiveRecurringContributions: Boolean + ): AccountCollection! + """ Returns true if a custom contribution to Open Collective can be submitted for contributions made to this account """ @@ -11074,7 +11262,7 @@ type Individual implements Account { The currency of the account """ currency: Currency! - expensePolicy: String + expensePolicy: String @deprecated(reason: "2024-11-04: Please use policies.EXPENSE_POLICIES") """ Defines if the contributors wants to be incognito (name not displayed) @@ -11490,6 +11678,16 @@ type Individual implements Account { """ expectedDateTo: DateTime + """ + Return orders that were charged after this date + """ + chargedDateFrom: DateTime + + """ + Return orders that were charged before this date + """ + chargedDateTo: DateTime + """ The term to search """ @@ -12137,7 +12335,7 @@ type Organization implements Account & AccountWithContributions { The currency of the account """ currency: Currency! - expensePolicy: String + expensePolicy: String @deprecated(reason: "2024-11-04: Please use policies.EXPENSE_POLICIES") """ Defines if the contributors wants to be incognito (name not displayed) @@ -12553,6 +12751,16 @@ type Organization implements Account & AccountWithContributions { """ expectedDateTo: DateTime + """ + Return orders that were charged after this date + """ + chargedDateFrom: DateTime + + """ + Return orders that were charged before this date + """ + chargedDateTo: DateTime + """ The term to search """ @@ -12993,6 +13201,24 @@ type Organization implements Account & AccountWithContributions { roles: [MemberRole] ): ContributorCollection! + """ + [!] Warning: this query is currently in beta and the API might change + """ + activeContributors( + """ + The number of results to fetch (default 10, max 1000) + """ + limit: Int! = 10 + + """ + The offset to use to fetch + """ + offset: Int! = 0 + dateFrom: DateTime + dateTo: DateTime + includeActiveRecurringContributions: Boolean + ): AccountCollection! + """ How much platform fees are charged for this account """ @@ -13089,7 +13315,7 @@ type Vendor implements Account & AccountWithContributions { The currency of the account """ currency: Currency! - expensePolicy: String + expensePolicy: String @deprecated(reason: "2024-11-04: Please use policies.EXPENSE_POLICIES") """ Defines if the contributors wants to be incognito (name not displayed) @@ -13505,6 +13731,16 @@ type Vendor implements Account & AccountWithContributions { """ expectedDateTo: DateTime + """ + Return orders that were charged after this date + """ + chargedDateFrom: DateTime + + """ + Return orders that were charged before this date + """ + chargedDateTo: DateTime + """ The term to search """ @@ -13947,6 +14183,24 @@ type Vendor implements Account & AccountWithContributions { roles: [MemberRole] ): ContributorCollection! + """ + [!] Warning: this query is currently in beta and the API might change + """ + activeContributors( + """ + The number of results to fetch (default 10, max 1000) + """ + limit: Int! = 10 + + """ + The offset to use to fetch + """ + offset: Int! = 0 + dateFrom: DateTime + dateTo: DateTime + includeActiveRecurringContributions: Boolean + ): AccountCollection! + """ How much platform fees are charged for this account """ @@ -14700,6 +14954,16 @@ type Query { """ expectedDateTo: DateTime + """ + Return orders that were charged after this date + """ + chargedDateFrom: DateTime + + """ + Return orders that were charged before this date + """ + chargedDateTo: DateTime + """ The term to search """ @@ -14793,11 +15057,6 @@ type Query { The default limit for each entity type """ defaultLimit: Int! = 10 - - """ - Whether to use ElasticSearch or not - """ - useElasticSearch: Boolean! = true ): SearchResponse! tagStats( """ @@ -16675,7 +16934,7 @@ type Fund implements Account & AccountWithHost & AccountWithContributions { The currency of the account """ currency: Currency! - expensePolicy: String + expensePolicy: String @deprecated(reason: "2024-11-04: Please use policies.EXPENSE_POLICIES") """ Defines if the contributors wants to be incognito (name not displayed) @@ -17091,6 +17350,16 @@ type Fund implements Account & AccountWithHost & AccountWithContributions { """ expectedDateTo: DateTime + """ + Return orders that were charged after this date + """ + chargedDateFrom: DateTime + + """ + Return orders that were charged before this date + """ + chargedDateTo: DateTime + """ The term to search """ @@ -17599,6 +17868,24 @@ type Fund implements Account & AccountWithHost & AccountWithContributions { roles: [MemberRole] ): ContributorCollection! + """ + [!] Warning: this query is currently in beta and the API might change + """ + activeContributors( + """ + The number of results to fetch (default 10, max 1000) + """ + limit: Int! = 10 + + """ + The offset to use to fetch + """ + offset: Int! = 0 + dateFrom: DateTime + dateTo: DateTime + includeActiveRecurringContributions: Boolean + ): AccountCollection! + """ Returns true if a custom contribution to Open Collective can be submitted for contributions made to this account """ @@ -17661,7 +17948,7 @@ type Project implements Account & AccountWithHost & AccountWithContributions & A The currency of the account """ currency: Currency! - expensePolicy: String + expensePolicy: String @deprecated(reason: "2024-11-04: Please use policies.EXPENSE_POLICIES") """ Defines if the contributors wants to be incognito (name not displayed) @@ -18077,6 +18364,16 @@ type Project implements Account & AccountWithHost & AccountWithContributions & A """ expectedDateTo: DateTime + """ + Return orders that were charged after this date + """ + chargedDateFrom: DateTime + + """ + Return orders that were charged before this date + """ + chargedDateTo: DateTime + """ The term to search """ @@ -18585,6 +18882,24 @@ type Project implements Account & AccountWithHost & AccountWithContributions & A roles: [MemberRole] ): ContributorCollection! + """ + [!] Warning: this query is currently in beta and the API might change + """ + activeContributors( + """ + The number of results to fetch (default 10, max 1000) + """ + limit: Int! = 10 + + """ + The offset to use to fetch + """ + offset: Int! = 0 + dateFrom: DateTime + dateTo: DateTime + includeActiveRecurringContributions: Boolean + ): AccountCollection! + """ Returns true if a custom contribution to Open Collective can be submitted for contributions made to this account """ @@ -18621,7 +18936,22 @@ type SearchResults { """ Search results for Accounts """ - accounts: SearchResultsAccounts + accounts( + """ + Type of account + """ + type: AccountType + + """ + Whether the account is a host or not + """ + isHost: Boolean + + """ + Tags to filter the accounts + """ + tags: [String] + ): SearchResultsAccounts """ Search results for Comments @@ -18662,41 +18992,49 @@ type SearchResults { type SearchResultsAccounts { collection: AccountCollection! highlights: JSONObject + maxScore: Float! } type SearchResultsComments { collection: CommentCollection! highlights: JSONObject + maxScore: Float! } type SearchResultsExpenses { collection: ExpenseCollection! highlights: JSONObject + maxScore: Float! } type SearchResultsHostApplications { collection: HostApplicationCollection! highlights: JSONObject + maxScore: Float! } type SearchResultsOrders { collection: OrderCollection! highlights: JSONObject + maxScore: Float! } type SearchResultsTiers { collection: TierCollection! highlights: JSONObject + maxScore: Float! } type SearchResultsTransactions { collection: TransactionCollection! highlights: JSONObject + maxScore: Float! } type SearchResultsUpdates { collection: UpdateCollection! highlights: JSONObject + maxScore: Float! } input TierReferenceInput { @@ -18780,11 +19118,6 @@ type Mutation { """ user: IndividualCreateInput - """ - Whether to trigger the automated approval for Open Source collectives with GitHub. - """ - automateApprovalWithGithub: Boolean = false @deprecated(reason: "2022-10-12: This is now automated") - """ A message to attach for the host to review the application """ @@ -18809,6 +19142,11 @@ type Mutation { List of members to invite on Collective creation. """ inviteMembers: [InviteMemberInput] + + """ + Marks the collective as approved directly. Only available in test/CI environments. + """ + skipApprovalTestOnly: Boolean = false ): Collective """ @@ -18869,6 +19207,11 @@ type Mutation { Reference to the parent Account creating the Project. """ parent: AccountReferenceInput + + """ + Set to true to disable contributions to this project. Host admins will still be able to add funds. + """ + disableContributions: Boolean! = false ): Project """ @@ -19415,6 +19758,11 @@ type Mutation { If the expense was imported, this is the reference to the row """ transactionsImportRow: TransactionsImportRowReferenceInput + + """ + A optional private comment to add to the created expense + """ + privateComment: String ): Expense! """ @@ -19485,6 +19833,16 @@ type Mutation { Account where the expense will be created """ account: AccountReferenceInput! + + """ + Skip sending the invite email + """ + skipInvite: Boolean! = false + + """ + Fields that the user should not be able to edit when submitting the draft + """ + lockedFields: [ExpenseLockableFields] ): Expense! """ @@ -20223,6 +20581,16 @@ type Mutation { destinationAccount: AccountReferenceInput! ): [Expense]! + """ + [Root only] Anonymizes an account + """ + rootAnonymizeAccount( + """ + Account to anonymize + """ + account: AccountReferenceInput! + ): Account! + """ Refunds a transaction. Scope: "transactions". """ @@ -20231,6 +20599,11 @@ type Mutation { Reference of the transaction to refund """ transaction: TransactionReferenceInput! + + """ + If true, the refund will be processed even if it exceeds the balance of the Collective + """ + ignoreBalanceCheck: Boolean ): Transaction """ @@ -20765,6 +21138,16 @@ input CollectiveCreateInput { githubHandle: String @deprecated(reason: "2022-06-03: Please use repositoryUrl") repositoryUrl: String @deprecated(reason: "2023-01-16: Please use socialLinks") settings: JSON + + """ + The profile avatar image + """ + image: Upload + + """ + The profile background image, for the banner and social media sharing + """ + backgroundImage: Upload } """ @@ -20802,6 +21185,11 @@ input LocationInput { structured: JSON } +""" +The `Upload` scalar type represents a file upload. +""" +scalar Upload + input IndividualCreateInput { name: String! email: String! @@ -20847,6 +21235,16 @@ input EventCreateInput { Timezone of the Event (TZ database format, e.g. UTC or Europe/Berlin) """ timezone: String! + + """ + The profile avatar image + """ + image: Upload + + """ + The profile background image, for the banner and social media sharing + """ + backgroundImage: Upload } input FundCreateInput { @@ -20855,6 +21253,16 @@ input FundCreateInput { description: String! tags: [String] settings: JSON + + """ + The profile avatar image + """ + image: Upload + + """ + The profile background image, for the banner and social media sharing + """ + backgroundImage: Upload } input OrganizationCreateInput { @@ -20862,8 +21270,18 @@ input OrganizationCreateInput { legalName: String slug: String! description: String! - website: String + website: String @deprecated(reason: "2024-11-12: Please use socialLinks") settings: JSON + + """ + The profile avatar image + """ + image: Upload + + """ + The profile background image, for the banner and social media sharing + """ + backgroundImage: Upload } input ProjectCreateInput { @@ -20872,6 +21290,26 @@ input ProjectCreateInput { description: String! tags: [String] settings: JSON + + """ + The social links in order of preference + """ + socialLinks: [SocialLinkInput!] + + """ + The profile avatar image + """ + image: Upload + + """ + The profile background image, for the banner and social media sharing + """ + backgroundImage: Upload +} + +input SocialLinkInput { + type: SocialLinkType! + url: URL! } """ @@ -20923,6 +21361,7 @@ input AccountUpdateInput { } input PoliciesInput { + EXPENSE_POLICIES: PoliciesExpensePolicies EXPENSE_AUTHOR_CANNOT_APPROVE: PoliciesCollectiveExpenseAuthorCannotApprove REQUIRE_2FA_FOR_ADMINS: Boolean COLLECTIVE_ADMINS_CAN_REFUND: Boolean @@ -20932,6 +21371,12 @@ input PoliciesInput { COLLECTIVE_ADMINS_CAN_SEE_PAYOUT_METHODS: Boolean } +input PoliciesExpensePolicies { + invoicePolicy: String + receiptPolicy: String + titlePolicy: String +} + input PoliciesCollectiveExpenseAuthorCannotApprove { amountInCents: Int enabled: Boolean @@ -21866,11 +22311,6 @@ type IndividualConfirmEmailResponse { sessionToken: String } -""" -The `Upload` scalar type represents a file upload. -""" -scalar Upload - input MemberInvitationReferenceInput { """ The public id identifying the member invitation (ie: dgm9bnk8-0437xqry-ejpvzeol-jdayw5re) @@ -22849,11 +23289,6 @@ input PersonalTokenReferenceInput { legacyId: Int } -input SocialLinkInput { - type: SocialLinkType! - url: URL! -} - type TagResponse { order: Order expense: Expense @@ -22876,9 +23311,19 @@ input VendorCreateInput { legalName: String tags: [NonEmptyString] location: LocationInput - imageUrl: String + imageUrl: String @deprecated(reason: "2024-11-26: Please use image + backgroundImage fields") vendorInfo: VendorInfoInput payoutMethod: PayoutMethodInput + + """ + The profile avatar image + """ + image: Upload + + """ + The profile background image, for the banner and social media sharing + """ + backgroundImage: Upload } """ @@ -22920,7 +23365,17 @@ input VendorEditInput { legalName: String tags: [NonEmptyString] location: LocationInput - imageUrl: String + imageUrl: String @deprecated(reason: "2024-11-26: Please use image + backgroundImage fields") vendorInfo: VendorInfoInput payoutMethod: PayoutMethodInput + + """ + The profile avatar image + """ + image: Upload + + """ + The profile background image, for the banner and social media sharing + """ + backgroundImage: Upload }