Skip to content
Esc
navigateopen⌘Jpreview
Dashboard
On this page

@supertokens-plugins/progressive-profiling-nodejs

Public root exports for @supertokens-plugins/progressive-profiling-nodejs 0.3.0.

Package version: 0.3.0

Plugin protocol version (PLUGIN_VERSION): 0.0.1

The protocol version is an internal plugin compatibility constant. It is not the npm package version.

Generated from the packed release’s root declaration, ./dist/index.d.ts. Only exports reachable from that root are listed. See the immutable release source.

Public root exports

Export Kind
default Constant
getAllSections Constant
getSectionValues Constant
init Constant
PLUGIN_ID Constant
PLUGIN_VERSION Constant
RegisterSection Type
registerSections Constant
setSectionValues Constant

default

Published from the emitted _default declaration.

Root export:

export { PLUGIN_ID, PLUGIN_VERSION, type RegisterSections as RegisterSection, _default as default, getAllSections, getSectionValues, init, registerSections, setSectionValues };

Resolved declaration:

import * as _shared_js from '@shared/js';
import * as supertokens_node_types from 'supertokens-node/types';
import { SessionContainerInterface } from 'supertokens-node/recipe/session/types';
import { FormSection as FormSection$1, ProfileFormData, FormField, FormFieldValue } from '@supertokens-plugins/progressive-profiling-shared';
import { FilterGlobalClaimValidators } from '@shared/tenants';
declare const _default: {
    init: (config?: (SuperTokensPluginProfileProgressiveProfilingConfig & {
        override?: ((oI: _shared_js.OverridableFunctions<Implementation>) => _shared_js.OverridableFunctions<Implementation>) | undefined;
    }) | undefined) => supertokens_node_types.SuperTokensPlugin;
    PLUGIN_ID: string;
    PLUGIN_VERSION: string;
    getSectionValues: (input: {
        session: SessionContainerInterface;
        userContext?: Record<string, any>;
    }) => Promise<{
        status: string;
        data: ProfileFormData;
    }>;
    setSectionValues: (input: {
        session: SessionContainerInterface;
        data: ProfileFormData;
        userContext?: Record<string, any>;
    }) => Promise<{
        status: string;
        errors: {
            id: string;
            error: string;
        }[];
    } | {
        status: string;
        errors?: undefined;
    }>;
    registerSections: (payload: Parameters<RegisterSections>[0]) => void;
    getAllSections: (input: {
        session: SessionContainerInterface;
        userContext?: Record<string, any>;
    }) => (FormSection & {
        storageHandlerId: string;
    })[];
    registerGlobalClaimValidatorOverride: (fn: FilterGlobalClaimValidators) => Promise<void>;
};

getAllSections

Root export:

export { PLUGIN_ID, PLUGIN_VERSION, type RegisterSections as RegisterSection, _default as default, getAllSections, getSectionValues, init, registerSections, setSectionValues };

Resolved declaration:

import { SessionContainerInterface } from 'supertokens-node/recipe/session/types';
declare const getAllSections: (input: {
    session: SessionContainerInterface;
    userContext?: Record<string, any>;
}) => (FormSection & {
    storageHandlerId: string;
})[];

getSectionValues

Root export:

export { PLUGIN_ID, PLUGIN_VERSION, type RegisterSections as RegisterSection, _default as default, getAllSections, getSectionValues, init, registerSections, setSectionValues };

Resolved declaration:

import { SessionContainerInterface } from 'supertokens-node/recipe/session/types';
import { FormSection as FormSection$1, ProfileFormData, FormField, FormFieldValue } from '@supertokens-plugins/progressive-profiling-shared';
declare const getSectionValues: (input: {
    session: SessionContainerInterface;
    userContext?: Record<string, any>;
}) => Promise<{
    status: string;
    data: ProfileFormData;
}>;

init

Root export:

export { PLUGIN_ID, PLUGIN_VERSION, type RegisterSections as RegisterSection, _default as default, getAllSections, getSectionValues, init, registerSections, setSectionValues };

Resolved declaration:

import * as _shared_js from '@shared/js';
import { SuperTokensPlugin } from 'supertokens-node/types';
declare const init: (config?: (SuperTokensPluginProfileProgressiveProfilingConfig & {
    override?: ((oI: _shared_js.OverridableFunctions<Implementation>) => _shared_js.OverridableFunctions<Implementation>) | undefined;
}) | undefined) => SuperTokensPlugin;

PLUGIN_ID

Root export:

export { PLUGIN_ID, PLUGIN_VERSION, type RegisterSections as RegisterSection, _default as default, getAllSections, getSectionValues, init, registerSections, setSectionValues };

Resolved declaration:

declare const PLUGIN_ID = "supertokens-plugin-progressive-profiling";

PLUGIN_VERSION

Root export:

export { PLUGIN_ID, PLUGIN_VERSION, type RegisterSections as RegisterSection, _default as default, getAllSections, getSectionValues, init, registerSections, setSectionValues };

Resolved declaration:

declare const PLUGIN_VERSION = "0.0.1";

RegisterSection

Published from the emitted RegisterSections declaration.

Root export:

export { PLUGIN_ID, PLUGIN_VERSION, type RegisterSections as RegisterSection, _default as default, getAllSections, getSectionValues, init, registerSections, setSectionValues };

Resolved declaration:

import { FormSection as FormSection$1, ProfileFormData, FormField, FormFieldValue } from '@supertokens-plugins/progressive-profiling-shared';
import { SessionContainerInterface } from 'supertokens-node/recipe/session/types';
type RegisterSections = (payload: {
    storageHandlerId: string;
    sections: FormSection[];
    set: (data: ProfileFormData, session: SessionContainerInterface, userContext?: Record<string, any>) => Promise<void>;
    get: (session: SessionContainerInterface, userContext?: Record<string, any>) => Promise<ProfileFormData>;
}) => void;

registerSections

Root export:

export { PLUGIN_ID, PLUGIN_VERSION, type RegisterSections as RegisterSection, _default as default, getAllSections, getSectionValues, init, registerSections, setSectionValues };

Resolved declaration:

declare const registerSections: (payload: Parameters<RegisterSections>[0]) => void;

setSectionValues

Root export:

export { PLUGIN_ID, PLUGIN_VERSION, type RegisterSections as RegisterSection, _default as default, getAllSections, getSectionValues, init, registerSections, setSectionValues };

Resolved declaration:

import { SessionContainerInterface } from 'supertokens-node/recipe/session/types';
import { FormSection as FormSection$1, ProfileFormData, FormField, FormFieldValue } from '@supertokens-plugins/progressive-profiling-shared';
declare const setSectionValues: (input: {
    session: SessionContainerInterface;
    data: ProfileFormData;
    userContext?: Record<string, any>;
}) => Promise<{
    status: string;
    errors: {
        id: string;
        error: string;
    }[];
} | {
    status: string;
    errors?: undefined;
}>;

Required signature types

These declarations are not additional package-root exports. They are included because the public signatures above depend on them.

FormSection

import { FormSection as FormSection$1, ProfileFormData, FormField, FormFieldValue } from '@supertokens-plugins/progressive-profiling-shared';
type FormSection = Omit<FormSection$1, "completed">;

Implementation

import { FilterGlobalClaimValidators } from '@shared/tenants';
import { BooleanClaim } from 'supertokens-node/recipe/session/claims';
import { FormSection as FormSection$1, ProfileFormData, FormField, FormFieldValue } from '@supertokens-plugins/progressive-profiling-shared';
import { SessionContainerInterface } from 'supertokens-node/recipe/session/types';
declare class Implementation {
    static instance: Implementation | undefined;
    protected existingSections: (FormSection & {
        storageHandlerId: string;
    })[];
    protected existingStorageHandlers: Record<string, Pick<Parameters<RegisterSections>[0], "set" | "get">>;
    protected metadata: {
        get: (userId: string, userContext?: Record<string, any>) => Promise<{
            profileConfig?: UserMetadataConfig;
        }>;
        set: (userId: string, metadata: {
            profileConfig?: UserMetadataConfig;
        }, userContext?: Record<string, any>) => Promise<void>;
    };
    protected globalClaimValidatorOverrides: FilterGlobalClaimValidators[];
    static ProgressiveProfilingCompletedClaim: BooleanClaim;
    static init(): Implementation;
    static getInstanceOrThrow(): Implementation;
    static reset(): void;
    constructor();
    defaultStorageHandlerGetFields: (this: Implementation, { pluginFormFields, session, userContext, }: {
        pluginFormFields: (Pick<FormField, "id" | "defaultValue"> & {
            sectionId: string;
        })[];
        session: SessionContainerInterface;
        userContext?: Record<string, any>;
    }) => Promise<ProfileFormData>;
    defaultStorageHandlerSetFields: (this: Implementation, { pluginFormFields, data, session, userContext, }: {
        pluginFormFields: (Pick<FormField, "id" | "defaultValue"> & {
            sectionId: string;
        })[];
        data: ProfileFormData;
        session: SessionContainerInterface;
        userContext?: Record<string, any>;
    }) => Promise<void>;
    registerSections: RegisterSections;
    getAllSections: (this: Implementation, input: {
        session: SessionContainerInterface;
        userContext?: Record<string, any>;
    }) => (FormSection & {
        storageHandlerId: string;
    })[];
    getSessionUserSections: (this: Implementation, { session, userContext }: {
        session: SessionContainerInterface;
        userContext?: Record<string, any>;
    }) => Promise<{
        status: string;
        sections: {
            id: string;
            label: string;
            description: string | undefined;
            completed: boolean;
            fields: {
                id: string;
                label: string;
                type: "string" | "number" | "boolean" | "text" | "email" | "phone" | "date" | "select" | "multiselect" | "password" | "url" | "image-url" | "toggle";
                required: boolean;
                defaultValue: FormFieldValue;
                placeholder: string | undefined;
                description: string | undefined;
                options: {
                    value: FormFieldValue;
                    label: string;
                }[] | undefined;
            }[];
        }[];
    }>;
    setSectionValues: (this: Implementation, { data, session, userContext, }: {
        session: SessionContainerInterface;
        data: ProfileFormData;
        userContext?: Record<string, any>;
    }) => Promise<{
        status: string;
        errors: {
            id: string;
            error: string;
        }[];
    } | {
        status: string;
        errors?: undefined;
    }>;
    getSectionValues: (this: Implementation, { session, userContext }: {
        session: SessionContainerInterface;
        userContext?: Record<string, any>;
    }) => Promise<{
        status: string;
        data: ProfileFormData;
    }>;
    validateField: (this: Implementation, { field, value, }: {
        field: FormField;
        value: FormFieldValue;
        session: SessionContainerInterface;
        userContext?: Record<string, any>;
    }) => string | string[] | undefined;
    isSectionValid: (this: Implementation, { data, section, ...rest }: {
        section: FormSection;
        data: ProfileFormData;
        session: SessionContainerInterface;
        userContext?: Record<string, any>;
    }) => Promise<boolean>;
    areAllSectionsCompleted: (this: Implementation, { userId, userContext }: {
        userId: string;
        recipeUserId: string;
        tenantId: string;
        userContext: any;
    }) => Promise<boolean>;
    storeCompletedSections: (this: Implementation, { sectionsCompleted, userId, userContext, }: {
        sectionsCompleted: Record<string, boolean>;
        userId: string;
        session: SessionContainerInterface;
        userContext: any;
    }) => Promise<void>;
    registerGlobalClaimValidatorOverride: (this: Implementation, fn: FilterGlobalClaimValidators) => Promise<void>;
    getGlobalClaimValidatorOverrides: (this: Implementation) => FilterGlobalClaimValidators[];
}

SuperTokensPluginProfileProgressiveProfilingConfig

type SuperTokensPluginProfileProgressiveProfilingConfig = {
    sections?: FormSection[];
};

UserMetadataConfig

type UserMetadataConfig = {
    sectionsCompleted: Record<string, boolean>;
};

API reference

API schema and response details