Hierarchy

  • ReactQueryNetworkClient
    • AccountClient

Constructors

Properties

addAccountMemberFavoriteResource addMembersToGroup addMemberToGroups addResourcesToGroup addRolesToGroup addRolesToMember addRoleToGroups addRoleToMembers addServiceCredentialToGroups allGroups allMembers allResources allResourceTypes allRoles allSCMCredentials allServiceCredentials allSSO allSSOGroupMappings allUserSCMCredentials createFeatureFlag createGroup createMember createPartner createRole createSCMCredential createServiceCredential createSSOGroupMapping createUserSCMCredential deactivatePartner deleteGroup deleteRole deleteSCMCredentials deleteSSO deleteSSOGroupMapping disableFidoCredentials disablePATGeneration enableFidoCredentials enablePATGeneration featureFlags fidoCredentials generatePersonalClientCredentials getAccountMemberFavoriteResources getMemberFavoriteResourcesByType group groupMembers groupResources groupRoles isAvailable member memberGroups memberResources memberRoles parseSSOConfig partner partners patchSSO patGenerationEnabled preferences removeMemberFromGroup removeResourceFromGroup removeResourceFromMemberFavorites removeRoleFromGroup removeRoleFromMember removeServiceCredentialFromGroup resetMemberPassword resetOtp revokeServiceCredential role roleGroups roleMembers rolePermissions scmCredentialStatus scmProvider sendDownloadCLIEmail serviceCredential serviceCredentialGroups serviceCredentialPermissions setupSSO sso ssoAttributes updateGroup updateMember updatePartner updatePartnerAdmin updatePreferences updateRole updateRolePermission updateRolePermissions updateSCMCredential updateSSO updateSSOAttributes updateSSOGroupMapping updateUserSCMCredential userHasSCMCredential validateNewPartnerData validatePartnerAssociationLimit validatePermissionAccess

Methods

Constructors

Properties

addAccountMemberFavoriteResource: MutationObject<
    {
        createFavoriteResourceRequest: CreateFavoriteResourceRequest;
        memberId: string;
    },
    unknown,
> = ...

Add account member favorite resource

addMembersToGroup: MutationObject<
    { groupId: string; groupMemberIdsRequest: GroupMemberIdsRequest },
    unknown,
> = ...

Adds several members to a group

addMemberToGroups: MutationObject<
    { memberId: string; memberIdsCommonRequest: MemberIdsCommonRequest },
    unknown,
> = ...

Adds a member to several groups.

addResourcesToGroup: MutationObject<
    {
        addResourcesToGroupRequest: AddResourcesToGroupRequest;
        groupId: string;
    },
    unknown,
> = ...

Adds several resources to a group.

addRolesToGroup: MutationObject<
    { groupId: string; groupRoleIdsRequest: GroupRoleIdsRequest },
    unknown,
> = ...

Adds several roles to a group.

addRolesToMember: MutationObject<
    { memberId: string; memberIdsCommonRequest: MemberIdsCommonRequest },
    unknown,
> = ...

Attributes several roles to a member.

addRoleToGroups: MutationObject<
    { roleGroupIdsRequest: RoleGroupIdsRequest; roleId: string },
    unknown,
> = ...

Adds a role to several groups

addRoleToMembers: MutationObject<
    { addRoleToMemberRequest: AddRoleToMemberRequest; roleId: string },
    AddUsersToRoleResponse,
> = ...

Adds a role to several members

addServiceCredentialToGroups: MutationObject<
    {
        id: string;
        serviceCredentialAssociateGroupRequest: ServiceCredentialAssociateGroupRequest;
    },
    unknown,
> = ...

Adds a service credential to several groups.

allGroups: InfiniteQueryObject<
    {
        direction?: "ASC"
        | "DESC";
        filterBy?: string;
        filterIn?: any;
        filterMode?: "MATCH" | "CONTAINS" | "IN";
        filterValue?: string;
        includeDefaultGroup?: boolean;
        multiFilterMode?: string;
        page?: any;
        search?: string;
        size?: any;
        sort?: string;
    },
    GroupReadResponse[],
    "",
> = ...

Get all groups (paginated).

allMembers: InfiniteQueryObject<
    {
        direction?: "ASC"
        | "DESC";
        filterBy?: string;
        filterIn?: any;
        filterMode?: "MATCH" | "CONTAINS" | "IN";
        filterValue?: string;
        multiFilterMode?: string;
        page?: any;
        search?: string;
        size?: any;
        sort?: string;
    },
    AccountMemberResponse[],
    "",
> = ...

Gets all members (paginated).

allResources: InfiniteQueryObject<
    {
        direction?: "ASC"
        | "DESC";
        filterBy?: string;
        filterIn?: any;
        filterMode?: "MATCH" | "CONTAINS" | "IN";
        filterValue?: string;
        multiFilterMode?: string;
        page?: any;
        search?: string;
        size?: any;
        sort?: string;
    },
    ResourceResponse[],
    "",
> = ...

Gets all resources (paginated)

allResourceTypes: InfiniteQueryObject<
    {
        direction?: "ASC"
        | "DESC";
        filterBy?: string;
        filterIn?: any;
        filterMode?: "MATCH" | "CONTAINS" | "IN";
        filterValue?: string;
        multiFilterMode?: string;
        page?: any;
        search?: string;
        size?: any;
        sort?: string;
    },
    ResourceTypeResponse[],
    "",
> = ...

Gets all resource types (paginated)

allRoles: InfiniteQueryObject<
    {
        direction?: "ASC"
        | "DESC";
        filterBy?: string;
        filterIn?: any;
        filterMode?: "MATCH" | "CONTAINS" | "IN";
        filterValue?: string;
        multiFilterMode?: string;
        page?: any;
        search?: string;
        size?: any;
        sort?: string;
    },
    RoleResponse[],
    "",
> = ...

Gets all roles in the account (paginated)

allSCMCredentials: QueryObject<void, AccountScmInfoResponse[]> = ...

Gets all SCM credentials (account level).

allServiceCredentials: InfiniteQueryObject<
    { name?: string; page?: string; size?: string; status?: string },
    ServiceCredentialResponse[],
    "",
> = ...

Gets all service credentials (paginated).

allSSO: QueryObject<
    {
        direction?: "ASC"
        | "DESC";
        filterBy?: string;
        filterIn?: any;
        filterMode?: "MATCH" | "CONTAINS" | "IN";
        filterValue?: string;
        multiFilterMode?: string;
        page?: any;
        search?: string;
        size?: any;
        sort?: string;
    },
    PageResponseAccountSsoResponse,
> = ...

Gets all SSOs.

allSSOGroupMappings: InfiniteQueryObject<
    {
        direction?: "ASC"
        | "DESC";
        filterBy?: string;
        filterIn?: any;
        filterMode?: "MATCH" | "CONTAINS" | "IN";
        filterValue?: string;
        id: string;
        multiFilterMode?: string;
        page?: any;
        search?: string;
        size?: any;
        sort?: string;
    },
    PageResponseAccountSsoGroupMappingResponse,
    "items",
> = ...

Get All SSO Group Mappings (paginated).

allUserSCMCredentials: QueryObject<void, UserScmInfoResponse[]> = ...

Gets all SCM credentials for the user currently logged in.

createFeatureFlag: MutationObject<
    { createFeatureFlagRequest: CreateFeatureFlagRequest },
    unknown,
> = ...

Creates a Feature Flag

createGroup: MutationObject<{ newGroupRequest: NewGroupRequest }, IamIdResponse> = ...

Creates a group.

createMember: MutationObject<
    { createUserRequest: CreateUserRequest },
    CreateUserResponse,
> = ...

Creates member on current tenant.

createPartner: MutationObject<
    { createAccountPartnerOrderRequest: CreateAccountPartnerOrderRequest },
    IdDefaultResponse,
> = ...

Creates an Account Order for Partner

createRole: MutationObject<
    { createAccountRoleRequest: CreateAccountRoleRequest },
    IdResponse,
> = ...

Creates a role

createSCMCredential: MutationObject<CreateSCMRequest, unknown> = ...

Creates an SCM credential (account level).

createServiceCredential: MutationObject<
    { serviceCredentialCreateRequest: ServiceCredentialCreateRequest },
    ServiceCredentialCreateResponse,
> = ...

Creates a service credential.

createSSOGroupMapping: MutationObject<
    {
        accountGroupMappingCreateRequest: AccountGroupMappingCreateRequest;
        id: string;
    },
    unknown,
> = ...

Creates a group mapping within an SSO.

createUserSCMCredential: MutationObject<
    { userScmInfoRequest: UserScmInfoRequest },
    unknown,
> = ...

Creates an SCM credential for the user currently logged in.

deactivatePartner: MutationObject<{ id: string }, unknown> = ...

Deletes Partner

deleteGroup: MutationObject<{ groupId: string }, unknown> = ...

Deletes a group.

deleteRole: MutationObject<{ roleId: string }, unknown> = ...

Deletes a role

deleteSCMCredentials: MutationObject<void, unknown> = ...

Deletes the SCM credentials for the user currently logged in.

deleteSSO: MutationObject<{ id: string }, unknown> = ...

Deletes an SSO.

deleteSSOGroupMapping: MutationObject<
    { attributeImporterId: string; id: string },
    unknown,
> = ...

Deletes a group mapping from an SSO.

disableFidoCredentials: MutationObject<{ memberId: string }, unknown> = ...

Disables Fido credentials for the given member.

disablePATGeneration: MutationObject<void, unknown> = ...

Disables Personal Access Token (PAT) generation.

enableFidoCredentials: MutationObject<{ memberId: string }, unknown> = ...

Enables Fido credentials for the given member.

enablePATGeneration: MutationObject<void, unknown> = ...

Enables Personal Access Token (PAT) generation.

featureFlags: QueryObject<void, FeatureFlagsResponse[]> = ...

Lists all Feature Flags in an Account

fidoCredentials: InfiniteQueryObject<
    {
        direction?: "ASC"
        | "DESC";
        filterBy?: string;
        filterIn?: any;
        filterMode?: "MATCH" | "CONTAINS" | "IN";
        filterValue?: string;
        memberId: string;
        multiFilterMode?: string;
        page?: any;
        search?: string;
        size?: any;
        sort?: string;
    },
    MemberCredentialsListResponse,
    "items",
> = ...

Gets All Fido credentials for the given member (paginated).

generatePersonalClientCredentials: MutationObject<
    void,
    PersonalClientCredentialsResponse,
> = ...

Gets credentials from personal service client (create if not exists one to the logged user).

getAccountMemberFavoriteResources: QueryObject<
    { memberId: string },
    FavoriteResourcesResponse[],
> = ...

Get account member favorite resources

getMemberFavoriteResourcesByType: QueryObject<
    { memberId: string; resourceType: string },
    any,
> = ...

Get member favorite resources by type

group: QueryObject<{ groupId: string }, GroupReadDetailResponse> = ...

Gets group by id.

groupMembers: InfiniteQueryObject<
    {
        direction?: "ASC"
        | "DESC";
        filterBy?: string;
        filterIn?: any;
        filterMode?: "MATCH" | "CONTAINS" | "IN";
        filterValue?: string;
        groupId: string;
        multiFilterMode?: string;
        page?: any;
        search?: string;
        size?: any;
        sort?: string;
    },
    ReadGroupMembersResponse[],
    "",
> = ...

Gets all members in a group (paginated).

groupResources: InfiniteQueryObject<
    {
        direction?: "ASC"
        | "DESC";
        filterBy?: string;
        filterIn?: any;
        filterMode?: "MATCH" | "CONTAINS" | "IN";
        filterValue?: string;
        groupId: string;
        multiFilterMode?: string;
        page?: any;
        search?: string;
        size?: any;
        sort?: string;
    },
    ResourceResponse[],
    "",
> = ...

Gets all resources of a group (paginated).

groupRoles: InfiniteQueryObject<
    {
        direction?: "ASC"
        | "DESC";
        filterBy?: string;
        filterIn?: any;
        filterMode?: "MATCH" | "CONTAINS" | "IN";
        filterValue?: string;
        groupId: string;
        multiFilterMode?: string;
        page?: any;
        search?: string;
        size?: any;
        sort?: string;
    },
    RoleResponse[],
    "",
> = ...

Gets all roles of a group.

isAvailable: QueryObject<
    { name: string; slug: string },
    AccountDataAvailableResponse,
> = ...

Returns information if account data (name and slug) are available to be registered

member: QueryObject<{ memberId: string }, AccountMemberStackspotIamDto> = ...

Gets member by id.

memberGroups: InfiniteQueryObject<
    {
        direction?: "ASC"
        | "DESC";
        filterBy?: string;
        filterIn?: any;
        filterMode?: "MATCH" | "CONTAINS" | "IN";
        filterValue?: string;
        memberId: string;
        multiFilterMode?: string;
        page?: any;
        search?: string;
        size?: any;
        sort?: string;
    },
    GroupReadResponse[],
    "",
> = ...

Gets member Groups (paginated).

memberResources: QueryObject<{ memberId: string }, ResourceDto[]> = ...

Gets member resources.

memberRoles: InfiniteQueryObject<
    {
        direction?: "ASC"
        | "DESC";
        filterBy?: string;
        filterIn?: any;
        filterMode?: "MATCH" | "CONTAINS" | "IN";
        filterValue?: string;
        memberId: string;
        multiFilterMode?: string;
        page?: any;
        search?: string;
        size?: any;
        sort?: string;
    },
    ReadMemberRoleResponse[],
    "",
> = ...

Gets member roles (paginated).

parseSSOConfig: MutationObject<
    {
        body?: { alias?: string; file: Blob; name?: string };
        protocol: "SAML" | "OPENID";
    },
    AccountSsoParserResponse,
> = ...

Parses a file with a configuration for an SSO. The protocol can be either SAML or OPENID.

partner: QueryObject<{ id: string }, AccountResponse> = ...

Gets Partner by account Id

partners: QueryObject<{ name?: string }, AccountPartnerResponse[]> = ...

Gets Partners with whom it is allowed to share content.

patchSSO: MutationObject<
    {
        accountSsoPartialUpdateRequest: AccountSsoPartialUpdateRequest;
        id: string;
    },
    unknown,
> = ...

Patches an SSO with a partial configuration change.

patGenerationEnabled: Omit<
    QueryObject<void, boolean>,
    "isAllowed" | "useAllowed" | "getPermissionKey",
> = ...

Verifies if Personal Access Token (PAT) generation is enabled.

preferences: QueryObject<{ memberId: string }, ReadPreferencesResponse> = ...

Gets the preferences of a member.

removeMemberFromGroup: MutationObject<
    { groupId: string; memberId: string },
    unknown,
> = ...

Removes a member from a group

removeResourceFromGroup: MutationObject<
    { groupId: string; resourceId: string },
    unknown,
> = ...

Removes a resource from a group.

removeResourceFromMemberFavorites: MutationObject<
    { memberId: string; resourceId: string; resourceType: string },
    unknown,
> = ...

Remove resource from member favorites

removeRoleFromGroup: MutationObject<
    { groupId: string; roleId: string },
    unknown,
> = ...

Removes a role from a group.

removeRoleFromMember: MutationObject<
    { memberId: string; roleId: string },
    unknown,
> = ...

Removes a role from a member.

removeServiceCredentialFromGroup: MutationObject<
    { groupId: string; id: string },
    unknown,
> = ...

Removes a service credential from a group.

resetMemberPassword: MutationObject<
    { memberEmailRequest: MemberEmailRequest },
    unknown,
> = ...

Sends an e-mail to reset the password of the member with the provided e-mail address.

resetOtp: MutationObject<{ memberId: string }, unknown> = ...

Reset member OTP

revokeServiceCredential: MutationObject<{ id: string }, unknown> = ...

Revokes a service credential.

role: Omit<
    QueryObject<{ id: string }, RoleResponse>,
    "isAllowed" | "useAllowed" | "getPermissionKey",
> = ...

Get a role by id

roleGroups: InfiniteQueryObject<
    {
        direction?: "ASC"
        | "DESC";
        filterBy?: string;
        filterIn?: any;
        filterMode?: "MATCH" | "CONTAINS" | "IN";
        filterValue?: string;
        multiFilterMode?: string;
        page?: any;
        roleId: string;
        search?: string;
        size?: any;
        sort?: string;
    },
    RoleGroupResponse[],
    "",
> = ...

Gets all groups with the provided role (paginated)

roleMembers: InfiniteQueryObject<
    {
        direction?: "ASC"
        | "DESC";
        filterBy?: string;
        filterIn?: any;
        filterMode?: "MATCH" | "CONTAINS" | "IN";
        filterValue?: string;
        multiFilterMode?: string;
        page?: any;
        roleId: string;
        search?: string;
        size?: any;
        sort?: string;
    },
    RoleMemberResponse[],
    "",
> = ...

Gets all members with the provided role (paginated)

rolePermissions: InfiniteQueryObject<
    {
        direction?: "ASC"
        | "DESC";
        filterBy?: string;
        filterIn?: any;
        filterMode?: "MATCH" | "CONTAINS" | "IN";
        filterValue?: string;
        multiFilterMode?: string;
        page?: any;
        roleId: string;
        search?: string;
        size?: any;
        sort?: string;
    },
    IamResourceType[],
    "",
> = ...

Get the actions a role is allowed to perform

scmCredentialStatus: Omit<
    QueryObject<void, SCMStatus>,
    "isAllowed" | "useAllowed" | "getPermissionKey",
> = ...

Gets the status for the SCM credential.

  • If the SCM status is invalid because there's no configuration at the account level, it returns { status: 'missing-account' }.
  • If the SCM status is invalid because, although the SCM integration is configured, the SCM access is not, it returns { status: 'missing-user' }.
  • If the SCM status is valid, it returns { status: 'valid', mandate: boolean, hasUserConfiguration: boolean }. mandate indicates if the SCM credential is mandatory at the account level for every user. hasUserConfiguration indicates if the user currently logged in has an SCM credential configured or not.
scmProvider: QueryObject<void, AccountScmProviderResponse> = ...

Gets the SCM provider.

sendDownloadCLIEmail: MutationObject<void, unknown> = ...

Sends an email for downloading the CLI

serviceCredential: QueryObject<{ id: string }, ServiceCredentialDetailsResponse> = ...

Gets a service credential by id.

serviceCredentialGroups: QueryObject<{ id: string }, GroupReadResponse[]> = ...

Gets all groups linked to a service credential.

serviceCredentialPermissions: QueryObject<
    { id: string },
    FullResourceResponse[],
> = ...

Gets all the permissions linked to a service credential.

setupSSO: MutationObject<
    {
        accountSsoCreateRequest: AccountSsoCreateRequest;
        protocol: "SAML"
        | "OPENID";
    },
    SsoIdResponse,
> = ...

Creates an SSO. The protocol can be either SAML or OPENID.

sso: QueryObject<{ id: string }, AccountSsoDetailedResponse> = ...

Gets an SSO by id.

ssoAttributes: QueryObject<{ id: string }, AccountSsoAttributesConfigResponse> = ...

Gets the attributes of an SSO.

updateGroup: MutationObject<
    { groupId: string; updateGroupRequest: UpdateGroupRequest },
    IamIdResponse,
> = ...

Updates a group.

updateMember: MutationObject<
    { memberId: string; updateUserRequest: UpdateUserRequest },
    UpdateUserResponse,
> = ...

Updates member on current tenant.

updatePartner: MutationObject<
    {
        accountPartnerAccountDataUpdateRequest: AccountPartnerAccountDataUpdateRequest;
        id: string;
    },
    unknown,
> = ...

Updates Partner Account data.

updatePartnerAdmin: MutationObject<
    {
        accountPartnerAdminDataUpdateRequest: AccountPartnerAdminDataUpdateRequest;
        id: string;
    },
    unknown,
> = ...

Updates Partner Account Admin data.

updatePreferences: MutationObject<
    {
        memberId: string;
        updateMemberPreferencesRequest: UpdateMemberPreferencesRequest;
    },
    unknown,
> = ...

Updates the preferences of a member.

updateRole: MutationObject<
    { roleId: string; updateAccountRoleRequest: UpdateAccountRoleRequest },
    unknown,
> = ...

Updates a role

updateRolePermission: MutationObject<
    {
        resourceId: string;
        roleId: string;
        updateResourceActionsRequest: UpdateResourceActionsRequest;
    },
    unknown,
> = ...

Updates a specific role permission

updateRolePermissions: MutationObject<
    { body: IamCreateStatementRequest[]; roleId: string },
    unknown,
> = ...

Updates a role with new list of permissions

updateSCMCredential: MutationObject<UpdateSCMRequest, unknown> = ...

Updates an SCM credential (account level).

updateSSO: MutationObject<
    { accountSsoUpdateRequest: AccountSsoUpdateRequest; id: string },
    unknown,
> = ...

Updates an SSO. The payload will replace everything in the current configuration (won't be merged). Use patchSSO for merging.

updateSSOAttributes: MutationObject<
    {
        accountSsoAddAttributesConfigRequest: AccountSsoAddAttributesConfigRequest;
        id: string;
    },
    unknown,
> = ...

Updates the attributes in a SSO.

updateSSOGroupMapping: MutationObject<
    {
        accountGroupMappingUpdateRequest: AccountGroupMappingUpdateRequest;
        attributeImporterId: string;
        id: string;
    },
    unknown,
> = ...

Updates a group mapping within an SSO.

updateUserSCMCredential: MutationObject<
    { userScmInfoRequest: UserScmInfoRequest },
    unknown,
> = ...

Updates an SCM credential for the user currently logged in.

userHasSCMCredential: Omit<
    QueryObject<void, boolean>,
    "isAllowed" | "useAllowed" | "getPermissionKey",
> = ...

Verifies if the current user has an SCM credential configured.

validateNewPartnerData: MutationObject<
    { validateAccountPartnerDataRequest: ValidateAccountPartnerDataRequest },
    unknown,
> = ...

Validates new Partner account data

validatePartnerAssociationLimit: Omit<
    QueryObject<void, { isValid: boolean; message: string }>,
    "isAllowed" | "useAllowed" | "getPermissionKey",
> = ...

Validates the association limit for the partner. Yields { isValid: true } if valid or { isValid: false, message: string } otherwise.

validatePermissionAccess: QueryObject<
    {
        action: string;
        attribute?: string;
        resource: string;
        resourceType: string;
    },
    boolean,
> = ...

Validate permission access

Methods

  • Receives an HttpError and returns a StackspotAPIError.

    Parameters

    • error: HttpError

      the original HttpError created by oazapfts.

    Returns StackspotAPIError

  • Creates a function that checks the permission for a request generated by an oazapfts function.

    This is intended to help creating a manual operation.

    Type Parameters

    • Args extends [variables: Record<string, any>, opts?: RequestOpts] | [opts?: RequestOpts]

    Parameters

    • fn: (...args: Args) => Promise<any>

      the function generated by oazapfts.

    Returns (
        ...args: Args extends [opts?: RequestOpts]
            ? []
            : [variables?: Partial<Args[0]>],
    ) => Promise<boolean>

    a function that receives the variables of fn (if any) and returns a promise that resolves to true if the request is allowed and false otherwise.

    myOperation = this.mutation({
    // ...
    permission: this.createPermissionFunctionFor(oazapftsFnForMyOperation)
    })
  • Creates a function that runs a oazapfts function with an abort signal.

    This is intended to help creating a manual operation.

    Type Parameters

    • Args extends [variables: Record<string, any>, opts?: RequestOpts] | [opts?: RequestOpts]
    • Result

    Parameters

    • fn: (...args: Args) => Promise<Result>

      the function generated by oazapfts.

    Returns (
        ...args: Args extends [opts?: RequestOpts]
            ? [signal: AbortSignal]
            : [signal: AbortSignal, variables: Args[0]],
    ) => Promise<Result>

    a function that receives a signal and the variables of fn (if any) and returns the same as fn.

    myOperation = this.mutation({
    // ...
    request: this.createRequestFunctionFor(oazapftsFnForMyOperation)
    })
  • Makes a request (same signature as globalThis.fetch). This request will prepend the base url to the url and, if there's an active session, include authentication headers.

    Parameters

    • input: string | URL | Request

      the url or request object.

    • Optionalinit: RequestInit

      the fetch options.

    Returns Promise<Response>

    a promise with the Response.

  • Checks whether or not the current account is freemium.

    Returns boolean

    true if it's a freemium account, false otherwise.

  • Builds a mutation manually by using a configuration object.

    Type Parameters

    • Args extends [AbortSignal, Record<string, any>] | [AbortSignal]
    • Result

    Parameters

    • config: OperationConfig<Args, Result>

      the configuration object containing the name, a request function and a permission function.

    Returns MutationObject<Args extends [AbortSignal] ? void : Args[1], Result>

  • Builds a mutation manually by using a configuration object.

    Type Parameters

    • Args extends [AbortSignal, Record<string, any>] | [AbortSignal]
    • Result

    Parameters

    • config: Omit<OperationConfig<Args, Result>, "permission">

      the configuration object containing the name and a request function.

    Returns Omit<
        MutationObject<Args extends [AbortSignal] ? void : Args[1], Result>,
        keyof OperationObject<any>,
    >

  • Builds a mutation automatically by using a function generated by oazapfts.

    Type Parameters

    • Args extends [opts?: RequestOpts] | [variables: Record<string, any>, opts?: RequestOpts]
    • Result

    Parameters

    • fn: (...args: Args) => Promise<Result>

      the oazapfts function.

    Returns Args extends [variables: Variables, opts?: RequestOpts]
        ? MutationObject<Variables, Result>
        : MutationObject<void, Result>

  • Builds a query manually by using a configuration object.

    Type Parameters

    • Args extends [AbortSignal, Record<string, any>] | [AbortSignal]
    • Result

    Parameters

    • config: OperationConfig<Args, Result>

      the configuration object containing the name, a request function and a permission function.

    Returns QueryObject<Args extends [AbortSignal] ? void : Args[1], Result>

  • Builds a query manually by using a configuration object.

    Type Parameters

    • Args extends [AbortSignal, Record<string, any>] | [AbortSignal]
    • Result

    Parameters

    • config: Omit<OperationConfig<Args, Result>, "permission">

      the configuration object containing the name and a request function.

    Returns Omit<
        QueryObject<Args extends [AbortSignal] ? void : Args[1], Result>,
        "isAllowed" | "useAllowed" | "getPermissionKey",
    >

  • Builds a query automatically by using a function generated by oazapfts.

    Type Parameters

    • Args extends [opts?: RequestOpts] | [variables: Record<string, any>, opts?: RequestOpts]
    • Result

    Parameters

    • fn: (...args: Args) => Promise<Result>

      the oazapfts function.

    Returns Args extends [variables: Variables, opts?: RequestOpts]
        ? QueryObject<Variables, Result>
        : QueryObject<void, Result>

  • Verifies if the current user is allowed to send the given request.

    Parameters

    • method: HTTPMethod

      the request's method.

    • path: string

      the path to the resource.

    • Optionalbody: string | object

      the request's body.

    Returns Promise<boolean>

    a promise that resolves to true if it's allowed or false otherwise.

  • Builds a URL with the baseUrl of this network client and the path passed as parameter.

    Parameters

    • path: string

      the path to the resource.

    Returns URL

    a full URL.

  • Reads an EventSource from the endpoint. Differently than the original specification, this allows common HTTP requests with method and body to be made.

    Parameters

    • input: string | URL | Request

      the url or request object.

    • Optionalinit: RequestInit

      the fetch options.

    Returns Promise<FetchEventStream>

    a promise with a FetchEventStream, which is an AsyncGenerator.

    let events = this.stream('url', options)
    for await (let event of events) {
    console.log('<<', event.data)
    }
  • Sets up all network clients. Must be called before attempting to make any request.

    Parameters

    • sessionManager: SessionManager

      An object with functions capable of checking, retrieving and ending the current session.

    • env: Env

      The environment to send the requests to.

    Returns void