ProtectedapiTracks the number of actual HTTP requests made since last reset. Useful for callers that need accurate API call counts (e.g., bulk data).
ProtectedapiLearnWorlds API version
ProtectedintegrationThe integration name to look up in the Integration entity
ProtectedlmsThe LMS provider this action is designed for (e.g., 'LearnWorlds', 'Moodle', etc.)
ProtectedparamsCurrent action parameters (set by the framework or by SetCompanyContext)
Protected Static ReadonlyALLOWED_Allowed user roles in LearnWorlds.
Protected Static ReadonlyCONCURRENCY_Concurrency limit for parallel API calls to avoid overwhelming the API.
Protected Static ReadonlyLW_Maximum number of items per page supported by the LearnWorlds API
Protected Static ReadonlyMAX_Safety limit for pagination to prevent infinite loops if the API misbehaves.
Public accessor for the running API call count.
Metadata about this action
Define the parameters this action expects
ProtectedbuildBuild a standard error ActionResultSimple
Optionalparams: ActionParam[]ProtectedbuildProtectedbuildBuild a standard success ActionResultSimple
Optionalparams: ActionParam[]ProtectedcalculateCalculate progress from LearnWorlds data
ProtectedcalculateCalculate progress percentage
Shared utility: find a LearnWorlds user by email. Returns the user if found, null if not found (empty results). Re-throws errors for network failures, auth errors, rate limiting, etc.
ProtectedformatFormat duration in seconds to human readable format
ProtectedformatFormat date for LearnWorlds API (ISO 8601)
ProtectedformatStandard date format for LMS systems (ISO 8601)
ProtectedgetGets the base URL for API calls
ProtectedgetGets API credentials - first tries environment variables, then falls back to database
Retrieves bulk data from LearnWorlds, orchestrating multiple retrieval actions. Each data type is optional and controlled via Include* boolean params. Partial failures are collected into errors without aborting the whole operation.
ProtectedgetCommon LMS parameters that many actions will need
ProtectedgetGets the company integration record for the specified company and LMS
ProtectedgetGets credentials from environment variables Format: BIZAPPS_{PROVIDER}{COMPANY_ID}{CREDENTIAL_TYPE} Example: BIZAPPS_LEARNWORLDS_12345_API_KEY
ProtectedgetGets an optional boolean parameter with a default value. When defaultValue is undefined, returns undefined if the parameter is missing.
Gets an optional boolean parameter with a default value. When defaultValue is undefined, returns undefined if the parameter is missing.
ProtectedgetGets an optional number parameter with a default value. When defaultValue is undefined, returns undefined if the parameter is missing.
Gets an optional number parameter with a default value. When defaultValue is undefined, returns undefined if the parameter is missing.
ProtectedgetGets an optional string array parameter.
ProtectedgetGets an optional string parameter.
ProtectedgetHelper to get parameter value from an ActionParam array
ProtectedgetGets a required string parameter, throwing if missing or empty.
ProtectedInternalFramework entry point that delegates to the typed public method
ProtectedmakeProtectedmakeProtectedmakeMakes an authenticated request to LearnWorlds API. The body parameter accepts any object that will be JSON-serialized.
Optionalbody: object | nullOptionalcontextUser: UserInfoProtectedmapCommon enrollment status mapping
ProtectedmapMap LearnWorlds enrollment status
ProtectedmapMap LearnWorlds user status to standard status
ProtectedparseConvert LearnWorlds date format to Date object
ProtectedparseParse date from LMS format
ProtectedprocessProcesses items in batches with controlled concurrency. Prevents unbounded parallel API calls from overwhelming the target API.
Executes the action with the provided parameters.
The action execution parameters including context
Promise resolving to the action result
ProtectedsafeSafely parses a date string to ISO format. Returns undefined if the input is falsy or produces an invalid date.
Set the company context for direct (non-framework) calls.
This populates this.params so that makeLearnWorldsRequest can find the CompanyID.
ProtectedsetHelper to set an output parameter, creating it if it doesn't exist
ProtectedvalidateValidates that a string is a plausible email address.
ProtectedvalidateValidates that a value is safe to use as a URL path segment. Rejects values containing path traversal or URL manipulation characters.
ProtectedvalidateValidates that a redirect URL is either a relative path or an absolute URL that belongs to the LearnWorlds school domain and uses http(s).
OptionalschoolDomain: stringProtectedvalidateValidates that a role is in the allowed set.
ProtectedvalidateValidates that a string is a valid UUID format to prevent SQL injection. Exposed as a reusable helper for subclasses to validate CompanyID, UserID, etc.
StaticResetReset the global rate-limiter state. Intended for test teardown only.
Orchestrates bulk data retrieval from all LearnWorlds retrieval actions into a single LearnWorldsSyncPayload for downstream consumers.