UNPKG

@sumup/sdk

Version:

The official TypeScript SDK for the SumUp API

126 lines 3.46 kB
import * as Core from "../../core"; /** * Object attributes that are modifiable only by SumUp applications. */ export type Attributes = Record<string, unknown>; /** * The status of the membership. */ export type MembershipStatus = "accepted" | "pending" | "expired" | "disabled" | "unknown"; /** * The type of the membership resource. * Possible values are: * * `merchant` - merchant account(s) * * `organization` - organization(s) */ export type ResourceType = string; /** * Invite * * Pending invitation for membership. */ export type Invite = { /** * Email address of the invited user. */ email: string; expires_at: string; }; /** * Set of user-defined key-value pairs attached to the object. Partial updates are not supported. When updating, always submit whole metadata. Maximum of 64 parameters are allowed in the object. */ export type Metadata = Record<string, unknown>; /** * Resource * * Information about the resource the membership is in. */ export type MembershipResource = { /** * ID of the resource the membership is in. */ id: string; type: ResourceType; /** * Display name of the resource. */ name: string; /** * Logo fo the resource. */ logo?: string; /** * The timestamp of when the membership resource was created. */ created_at: string; /** * The timestamp of when the membership resource was last updated. */ updated_at: string; attributes?: Attributes; }; /** * Membership * * A membership associates a user with a resource, memberships is defined by user, resource, resource type, and associated roles. */ export type Membership = { /** * ID of the membership. */ id: string; /** * ID of the resource the membership is in. */ resource_id: string; type: ResourceType; /** * User's roles. */ roles: string[]; /** * User's permissions. * * @deprecated: Permissions include only legacy permissions, please use roles instead. Member access is based on their roles within a given resource and the permissions these roles grant. */ permissions: string[]; /** * The timestamp of when the membership was created. */ created_at: string; /** * The timestamp of when the membership was last updated. */ updated_at: string; invite?: Invite; status: MembershipStatus; metadata?: Metadata; attributes?: Attributes; resource: MembershipResource; }; export type ListMembershipsQueryParams = { offset?: number; limit?: number; kind?: ResourceType; status?: MembershipStatus; "resource.type"?: ResourceType; "resource.attributes.sandbox"?: boolean; "resource.name"?: string; "resource.parent.id"?: string | null; "resource.parent.type"?: ResourceType | null; roles?: string[]; }; export type ListMembershipsResponse = { items: Membership[]; total_count: number; }; export declare class Memberships extends Core.APIResource { /** * List memberships of the current user. */ list(query?: ListMembershipsQueryParams, params?: Core.FetchParams): Core.APIPromise<ListMembershipsResponse>; } export declare namespace Memberships { export type { Attributes, Invite, ListMembershipsQueryParams, Membership, MembershipResource, MembershipStatus, Metadata, ResourceType, }; } //# sourceMappingURL=index.d.ts.map