GS2-Version Script Trigger Reference

Reference of event triggers that call extended scripts

Trigger

acceptVersion

Version approval

Synchronous Execution Script

The script is executed synchronously before the version approval process.

Request
TypeDescription
namespaceNamespaceNamespace
versionModelVersionModelVersion Model
acceptVersionAcceptVersionAgreed Version
currentAcceptVersionAcceptVersionCurrent Agreed Version
Result
TypeRequiredDefaultValue LimitsDescription
permitbool
Whether to allow version approval
Implementation Example
-- Request
local namespace = args.namespace
local versionModel = args.versionModel
local acceptVersion = args.acceptVersion
local currentAcceptVersion = args.currentAcceptVersion

-- Business logic:
local permit = true

-- Result
result = {
  permit=permit
}

Asynchronous Execution Script

The script is executed asynchronously after the version approval process.

Request
TypeDescription
namespaceNamespaceNamespace
versionModelVersionModelVersion Model
acceptVersionAcceptVersionAgreed Version
Implementation Example
-- Request
local namespace = args.namespace
local versionModel = args.versionModel
local acceptVersion = args.acceptVersion

-- Asynchronous scripts typically do not affect the API response.
-- Use for logging, analytics, external notifications, etc.

result = {
}

checkVersion

Version check

Synchronous Execution Script

The script is executed synchronously before the version check process.

Request
TypeDescription
namespaceNamespaceNamespace
versionModelVersionModelVersion Model
currentVersionVersionCurrent Version
userIdstringUser ID
warningStatusIf the normal version check results in a warning
errorStatusIf the normal version check results in an error
Result
TypeRequiredDefaultValue LimitsDescription
overrideWarningStatusWarning for overwritten version check results
overrideErrorStatusError for overwritten version check results
Implementation Example
-- Request
local namespace = args.namespace
local versionModel = args.versionModel
local currentVersion = args.currentVersion
local userId = args.userId
local warning = args.warning
local error = args.error

-- Business logic:
local overrideWarning = nil
local overrideError = nil

-- Result
result = {
  overrideWarning=overrideWarning,
  overrideError=overrideError
}