@sudoplatform/sudo-entitlements-admin
    Preparing search index...

    Interface SudoEntitlementsAdminClientBeta

    Client responsible for establishing entitlements of federated identities.

    interface SudoEntitlementsAdminClient {
        addEntitlementsSequence(
            newEntitlementsSequence: Omit<
                EntitlementsSequence,
                "createdAt"
                | "updatedAt"
                | "version",
            >,
        ): Promise<EntitlementsSequence>;
        addEntitlementsSet(
            newEntitlementsSet: Omit<
                EntitlementsSet,
                "createdAt"
                | "updatedAt"
                | "version",
            >,
        ): Promise<EntitlementsSet>;
        applyEntitlementsSequenceToUser(
            externalId: string,
            entitlementsSequenceName: string,
            transitionsRelativeTo?: Date,
            version?: number,
        ): Promise<ExternalUserEntitlements>;
        applyEntitlementsSequenceToUsers(
            operations: {
                entitlementsSequenceName: string;
                externalId: string;
                transitionsRelativeTo?: Date;
                version?: number;
            }[],
        ): Promise<ExternalUserEntitlementsResult[]>;
        applyEntitlementsSetToUser(
            externalId: string,
            entitlementsSetName: string,
            version?: number,
        ): Promise<ExternalUserEntitlements>;
        applyEntitlementsSetToUsers(
            operations: {
                entitlementsSetName: string;
                externalId: string;
                version?: number;
            }[],
        ): Promise<ExternalUserEntitlementsResult[]>;
        applyEntitlementsToUser(
            externalId: string,
            entitlements: Entitlement[],
            version?: number,
        ): Promise<ExternalUserEntitlements>;
        applyEntitlementsToUsers(
            operations: {
                entitlements: Entitlement[];
                externalId: string;
                version?: number;
            }[],
        ): Promise<ExternalUserEntitlementsResult[]>;
        applyExpendableEntitlementsToUser(
            externalId: string,
            expendableEntitlements: Entitlement[],
            requestId: string,
        ): Promise<ExternalUserEntitlements>;
        getEntitlementDefinition(
            name: string,
        ): Promise<EntitlementDefinition | undefined>;
        getEntitlementsForUser(
            externalId: string,
        ): Promise<ExternalEntitlementsConsumption>;
        getEntitlementsSequence(
            name: string,
        ): Promise<EntitlementsSequence | undefined>;
        getEntitlementsSet(name: string): Promise<EntitlementsSet | undefined>;
        listEntitlementDefinitions(
            limit?: number,
            nextToken?: string,
        ): Promise<EntitlementDefinitionConnection>;
        listEntitlementsSequences(
            nextToken?: string,
        ): Promise<EntitlementsSequencesConnection>;
        listEntitlementsSets(token?: string): Promise<EntitlementsSetsConnection>;
        removeEntitledUser(externalId: string): Promise<EntitledUser | undefined>;
        removeEntitlementsSequence(
            name: string,
        ): Promise<EntitlementsSequence | undefined>;
        removeEntitlementsSet(name: string): Promise<EntitlementsSet | undefined>;
        setEntitlementsSequence(
            newEntitlementsSequence: Omit<
                EntitlementsSequence,
                "createdAt"
                | "updatedAt"
                | "version",
            >,
        ): Promise<EntitlementsSequence>;
        setEntitlementsSet(
            newEntitlementsSet: Omit<
                EntitlementsSet,
                "createdAt"
                | "updatedAt"
                | "version",
            >,
        ): Promise<EntitlementsSet>;
    }

    Implemented by

    Index

    Methods

    • Beta

      Apply entitlements sequence directly to a user

      If a record for that user's entitlements sequence does not yet exist it will be created.

      Parameters

      • externalId: string

        External IDP user ID of user to apply entitlements sequence to

      • entitlementsSequenceName: string

        Name of the entitlements sequence to apply to the user

      • OptionaltransitionsRelativeTo: Date
      • Optionalversion: number

        If specified, version of any current entitlements that must be matched

      Returns Promise<ExternalUserEntitlements>

      The effective entitlements for the user

      AlreadyUpdatedError

      • if the user's entitlements have been updated with a later version

      EntitlementsSequenceNotFoundError

      • If the entitlements sequence named is not defined

      AlreadyUpdatedError

      • Specified version is less than the current entitlements version

      IllegalArgumentError

      • Specified version is greater than the current entitlements version
    • Beta

      Apply entitlements sequence to users

      Equivalent of multiple calls to applyEntitlementsSequenceToUser

      If a record for any user's entitlements sequence does not yet exist it will be created.

      Parameters

      • operations: {
            entitlementsSequenceName: string;
            externalId: string;
            transitionsRelativeTo?: Date;
            version?: number;
        }[]

        Array of applyEntitlementsSequenceToUser operations to perform.

      Returns Promise<ExternalUserEntitlementsResult[]>

      The effective entitlements for the user

      AlreadyUpdatedError

      • if the user's entitlements have been updated with a later version

      EntitlementsSequenceNotFoundError

      • If the entitlements sequence named is not defined
    • Beta

      Apply entitlements set to a user

      If a record for that user's entitlements does not yet exist it will be created.

      Parameters

      • externalId: string

        External IDP user ID of user to retrieve entitlements for

      • entitlementsSetName: string

        Name of the entitlements set to apply to the user

      • Optionalversion: number

        If specified, version of any current entitlements that must be matched

      Returns Promise<ExternalUserEntitlements>

      The effective entitlements for the user

      EntitlementSetNotFoundError

      • If the named entitlements set does not exist

      AlreadyUpdatedError

      • if the user's entitlements have been updated with a later version

      AlreadyUpdatedError

      • Specified version is less than the current entitlements version

      IllegalArgumentError

      • Specified version is greater than the current entitlements version
    • Beta

      Apply entitlements sets to users.

      Equivalent of multiple calls to applyEntitlementsSetToUser

      If a record for a user's entitlements does not yet exist it will be created.

      Parameters

      • operations: { entitlementsSetName: string; externalId: string; version?: number }[]

        Array of applyEntitlementsSetToUser operations to perform.

      Returns Promise<ExternalUserEntitlementsResult[]>

      The effective entitlements for the user

      EntitlementSetNotFoundError

      • If the named entitlements set does not exist

      AlreadyUpdatedError

      • if the user's entitlements have been updated with a later version
    • Beta

      Apply entitlements to a user

      If a record for that user's entitlements does not yet exist it will be created.

      Parameters

      • externalId: string

        External IDP user ID of user to retrieve entitlements for

      • entitlements: Entitlement[]

        The entitlements to apply to the user

      • Optionalversion: number

        If specified, version of any current entitlements that must be matched

      Returns Promise<ExternalUserEntitlements>

      The effective entitlements for the user

      InvalidEntitlementsError

      • Entitlements contains one or more entitlements with unrecognized names

      AlreadyUpdatedError

      • Specified version is less than the current entitlements version

      IllegalArgumentError

      • Specified version is greater than the current entitlements version
    • Beta

      Apply an expendable entitlements delta to a user

      If a record for the user's entitlements does not yet exist a NoEntitlementsForUserError is thrown. Call an applyEntitlements* method to assign entitlements before calling this method.

      Parameters

      • externalId: string

        External IDP user ID of user to retrieve entitlements for

      • expendableEntitlements: Entitlement[]

        The expendable entitlements delta to apply to the user

      • requestId: string

        Request of this delta. Repetition of requests for the same external ID with the same requestId are idempotent

      Returns Promise<ExternalUserEntitlements>

      The effective entitlements for the user

      InvalidEntitlementsError Entitlements contains one or more entitlements with unrecognized names or that are not expendable entitlements.

      NoEntitlementsForUserError User has not previously been assigned entitlements.

      DuplicateEntitlementError expendableEntitlements refers to the same entitlement more than once.

      NegativeEntitlementError expendableEntitlements would cause an expendable entitlement for the user to go negative.

      OverflowedEntitlementError expendableEntitlements would cause an expendable entitlement for the user to exceed the maximum allowable value.

    • Beta

      Remove entitlements and consumption records of the specified user.

      Parameters

      • externalId: string

        External IDP user ID of user to remove.

      Returns Promise<EntitledUser | undefined>

      The entitled user removed or undefined if the user is not found.