[{"data":1,"prerenderedAt":845},["ShallowReactive",2],{"/docs/jobs/jobcreator/api/server-exports":3,"/docs/jobs/jobcreator/api/server-exports-surround":831,"/docs/jobs/jobcreator/api/server-exports-implemented-suggestions":844},{"id":4,"title":5,"body":6,"description":820,"extension":821,"head":822,"implementedSuggestions":822,"meta":823,"navigation":824,"path":826,"schemaOrg":822,"seo":827,"sitemap":828,"stem":829,"__hash__":830},"docs/1.docs/0.jobs/6.jobcreator/5.api/2.server-exports.md","Server Exports",{"type":7,"value":8,"toc":812},"minimark",[9,25,91,95,161,176,179,214,217,220,329,369,376,387,390,393,396,536,593,598,697,712,716,786,800,808],[10,11,12,13,20,21,24],"p",{},"All three exports belong to ",[14,15,16],"strong",{},[17,18,19],"code",{},"sky_jobcreator"," and run on the ",[14,22,23],{},"server",". They take no arguments. They expose installation and definition-startup state; they do not create jobs or authorize an administrator.",[26,27,28,44],"table",{},[29,30,31],"thead",{},[32,33,34,38,41],"tr",{},[35,36,37],"th",{},"Export",[35,39,40],{},"Returns",[35,42,43],{},"Purpose",[45,46,47,63,78],"tbody",{},[32,48,49,55,60],{},[50,51,52],"td",{},[17,53,54],{},"GetAutoInstallFramework()",[50,56,57],{},[17,58,59],{},"boolean",[50,61,62],{},"Read the plaintext automatic-installation switch.",[32,64,65,70,75],{},[50,66,67],{},[17,68,69],{},"AwaitFrameworkDefinitions()",[50,71,72,74],{},[17,73,59],{},", after yielding if necessary",[50,76,77],{},"Wait for Creator's one-time definition-startup result.",[32,79,80,85,88],{},[50,81,82],{},[17,83,84],{},"GetInstallerStatus()",[50,86,87],{},"Status table/object",[50,89,90],{},"Inspect the framework-file installer's current result.",[92,93,54],"h2",{"id":94},"getautoinstallframework",[96,97,103],"pre",{"className":98,"code":99,"filename":100,"language":101,"meta":102,"style":102},"language-lua shiki shiki-themes material-theme-lighter material-theme material-theme-palenight","local automatic_installation = exports[\"sky_jobcreator\"]:GetAutoInstallFramework()\nprint(\"Automatic framework installation:\", automatic_installation)\n","server.lua","lua","",[17,104,105,142],{"__ignoreMap":102},[106,107,110,114,118,121,124,127,130,132,135,139],"span",{"class":108,"line":109},"line",1,[106,111,113],{"class":112},"sMK4o","local",[106,115,117],{"class":116},"sTEyZ"," automatic_installation ",[106,119,120],{"class":112},"=",[106,122,123],{"class":116}," exports[",[106,125,126],{"class":112},"\"",[106,128,19],{"class":129},"sfazB",[106,131,126],{"class":112},[106,133,134],{"class":116},"]:",[106,136,138],{"class":137},"s2Zo4","GetAutoInstallFramework",[106,140,141],{"class":116},"()\n",[106,143,145,148,151,153,156,158],{"class":108,"line":144},2,[106,146,147],{"class":137},"print",[106,149,150],{"class":116},"(",[106,152,126],{"class":112},[106,154,155],{"class":129},"Automatic framework installation:",[106,157,126],{"class":112},[106,159,160],{"class":116},", automatic_installation)\n",[10,162,163,164,167,168,171,172,175],{},"Returns the current boolean ",[17,165,166],{},"Config.AutoInstallFramework"," from ",[17,169,170],{},"sky_jobcreator/config/config.lua",". An invalid non-boolean setting raises an error. The call does not start installation, change the setting, read ",[17,173,174],{},"/jobconfig"," overrides or report whether hooks have loaded.",[10,177,178],{},"The equivalent JavaScript call is:",[96,180,185],{"className":181,"code":182,"filename":183,"language":184,"meta":102,"style":102},"language-js shiki shiki-themes material-theme-lighter material-theme material-theme-palenight","const enabled = exports.sky_jobcreator.GetAutoInstallFramework();\n","server.js","js",[17,186,187],{"__ignoreMap":102},[106,188,189,193,196,198,201,203,206,208,211],{"class":108,"line":109},[106,190,192],{"class":191},"spNyl","const",[106,194,195],{"class":116}," enabled ",[106,197,120],{"class":112},[106,199,200],{"class":112}," exports.",[106,202,19],{"class":116},[106,204,205],{"class":112},".",[106,207,138],{"class":137},[106,209,210],{"class":116},"()",[106,212,213],{"class":112},";\n",[92,215,69],{"id":216},"awaitframeworkdefinitions",[10,218,219],{},"Use this only when your server workflow must wait for Creator's definitions. Call from a yielding FiveM Lua context, such as a thread or an existing scheduled event/callback:",[96,221,223],{"className":98,"code":222,"filename":100,"language":101,"meta":102,"style":102},"CreateThread(function()\n    local definitions_ready = exports[\"sky_jobcreator\"]:AwaitFrameworkDefinitions()\n    if not definitions_ready then\n        print(\"Creator definitions failed to initialize; dependent work was stopped\")\n        return\n    end\n\n    -- Continue the server workflow that requires restored framework definitions.\nend)\n",[17,224,225,238,263,277,295,301,307,314,321],{"__ignoreMap":102},[106,226,227,230,232,236],{"class":108,"line":109},[106,228,229],{"class":137},"CreateThread",[106,231,150],{"class":116},[106,233,235],{"class":234},"s7zQu","function",[106,237,141],{"class":112},[106,239,240,243,246,248,250,252,254,256,258,261],{"class":108,"line":144},[106,241,242],{"class":112},"    local",[106,244,245],{"class":116}," definitions_ready ",[106,247,120],{"class":112},[106,249,123],{"class":116},[106,251,126],{"class":112},[106,253,19],{"class":129},[106,255,126],{"class":112},[106,257,134],{"class":116},[106,259,260],{"class":137},"AwaitFrameworkDefinitions",[106,262,141],{"class":116},[106,264,266,269,272,274],{"class":108,"line":265},3,[106,267,268],{"class":234},"    if",[106,270,271],{"class":112}," not",[106,273,245],{"class":116},[106,275,276],{"class":234},"then\n",[106,278,280,283,285,287,290,292],{"class":108,"line":279},4,[106,281,282],{"class":137},"        print",[106,284,150],{"class":116},[106,286,126],{"class":112},[106,288,289],{"class":129},"Creator definitions failed to initialize; dependent work was stopped",[106,291,126],{"class":112},[106,293,294],{"class":116},")\n",[106,296,298],{"class":108,"line":297},5,[106,299,300],{"class":234},"        return\n",[106,302,304],{"class":108,"line":303},6,[106,305,306],{"class":234},"    end\n",[106,308,310],{"class":108,"line":309},7,[106,311,313],{"emptyLinePlaceholder":312},true,"\n",[106,315,317],{"class":108,"line":316},8,[106,318,320],{"class":319},"sHwdD","    -- Continue the server workflow that requires restored framework definitions.\n",[106,322,324,327],{"class":108,"line":323},9,[106,325,326],{"class":234},"end",[106,328,294],{"class":116},[26,330,331,341],{},[29,332,333],{},[32,334,335,338],{},[35,336,337],{},"Result",[35,339,340],{},"Meaning",[45,342,343,357],{},[32,344,345,350],{},[50,346,347],{},[17,348,349],{},"true",[50,351,352,353,356],{},"Creator received a successful result from its ",[17,354,355],{},"sky_jobscreator_migration"," database/definition startup stage.",[32,358,359,364],{},[50,360,361],{},[17,362,363],{},"false",[50,365,366,367,205],{},"That stage failed, or the unresolved gate reached its 60-second startup deadline. The resource-stop handler also attempts to resolve an unfinished gate as ",[17,368,363],{},[10,370,371,372,375],{},"The deadline starts when Creator loads ",[17,373,374],{},"framework_ready.lua",", not when your script calls the export. The first resolution wins and is reused for later calls during that resource lifetime. There is no timeout argument, reset argument or retry action on this export.",[10,377,378,379,382,383,386],{},"The successful resolution happens ",[14,380,381],{},"before"," ",[17,384,385],{},"Sky_Jobs.GenericJobs.Start()"," in Creator's main startup path. It therefore does not establish that generic gameplay, society-account activation, all Jobs Base stages, the framework installer or a player's client/NUI is ready. Inspect the relevant owner's state separately.",[10,388,389],{},"A stopped resource or interrupted export call can fail at the runtime boundary; do not treat a lost reply as a successful gate result. The supplied QBCore/Qbox login hook uses this gate to stop character loading when definitions did not initialize. Do not add another copied login hook if the installer has already installed it.",[92,391,84],{"id":392},"getinstallerstatus",[10,394,395],{},"This is a read-only status lookup. It does not wait for installation and does not run it again.",[96,397,399],{"className":98,"code":398,"filename":100,"language":101,"meta":102,"style":102},"local installation = exports[\"sky_jobcreator\"]:GetInstallerStatus()\nprint(\"Creator installer:\", installation.state)\n\nif installation.state == \"failed\" then\n    print(\"Installer error:\", installation.error)\nelseif installation.state == \"restart_required\" then\n    print(\"Framework files were updated on disk; plan a full server restart\")\nend\n",[17,400,401,425,447,451,475,496,516,531],{"__ignoreMap":102},[106,402,403,405,408,410,412,414,416,418,420,423],{"class":108,"line":109},[106,404,113],{"class":112},[106,406,407],{"class":116}," installation ",[106,409,120],{"class":112},[106,411,123],{"class":116},[106,413,126],{"class":112},[106,415,19],{"class":129},[106,417,126],{"class":112},[106,419,134],{"class":116},[106,421,422],{"class":137},"GetInstallerStatus",[106,424,141],{"class":116},[106,426,427,429,431,433,436,438,441,445],{"class":108,"line":144},[106,428,147],{"class":137},[106,430,150],{"class":116},[106,432,126],{"class":112},[106,434,435],{"class":129},"Creator installer:",[106,437,126],{"class":112},[106,439,440],{"class":116},", installation.",[106,442,444],{"class":443},"sBMFI","state",[106,446,294],{"class":116},[106,448,449],{"class":108,"line":265},[106,450,313],{"emptyLinePlaceholder":312},[106,452,453,456,459,461,464,467,470,473],{"class":108,"line":279},[106,454,455],{"class":234},"if",[106,457,458],{"class":116}," installation.",[106,460,444],{"class":443},[106,462,463],{"class":112}," ==",[106,465,466],{"class":112}," \"",[106,468,469],{"class":129},"failed",[106,471,472],{"class":112},"\" ",[106,474,276],{"class":234},[106,476,477,480,482,484,487,489,491,494],{"class":108,"line":297},[106,478,479],{"class":137},"    print",[106,481,150],{"class":116},[106,483,126],{"class":112},[106,485,486],{"class":129},"Installer error:",[106,488,126],{"class":112},[106,490,440],{"class":116},[106,492,493],{"class":443},"error",[106,495,294],{"class":116},[106,497,498,501,503,505,507,509,512,514],{"class":108,"line":303},[106,499,500],{"class":234},"elseif",[106,502,458],{"class":116},[106,504,444],{"class":443},[106,506,463],{"class":112},[106,508,466],{"class":112},[106,510,511],{"class":129},"restart_required",[106,513,472],{"class":112},[106,515,276],{"class":234},[106,517,518,520,522,524,527,529],{"class":108,"line":309},[106,519,479],{"class":137},[106,521,150],{"class":116},[106,523,126],{"class":112},[106,525,526],{"class":129},"Framework files were updated on disk; plan a full server restart",[106,528,126],{"class":112},[106,530,294],{"class":116},[106,532,533],{"class":108,"line":316},[106,534,535],{"class":234},"end\n",[96,537,539],{"className":181,"code":538,"filename":183,"language":184,"meta":102,"style":102},"const installation = exports.sky_jobcreator.GetInstallerStatus();\nconsole.log('Creator installer:', installation.state);\n",[17,540,541,561],{"__ignoreMap":102},[106,542,543,545,547,549,551,553,555,557,559],{"class":108,"line":109},[106,544,192],{"class":191},[106,546,407],{"class":116},[106,548,120],{"class":112},[106,550,200],{"class":112},[106,552,19],{"class":116},[106,554,205],{"class":112},[106,556,422],{"class":137},[106,558,210],{"class":116},[106,560,213],{"class":112},[106,562,563,566,568,571,573,576,578,580,583,586,588,591],{"class":108,"line":144},[106,564,565],{"class":116},"console",[106,567,205],{"class":112},[106,569,570],{"class":137},"log",[106,572,150],{"class":116},[106,574,575],{"class":112},"'",[106,577,435],{"class":129},[106,579,575],{"class":112},[106,581,582],{"class":112},",",[106,584,585],{"class":116}," installation",[106,587,205],{"class":112},[106,589,590],{"class":116},"state)",[106,592,213],{"class":112},[594,595,597],"h3",{"id":596},"status-fields","Status fields",[26,599,600,612],{},[29,601,602],{},[32,603,604,607,610],{},[35,605,606],{},"Field",[35,608,609],{},"Type",[35,611,340],{},[45,613,614,628,654,677],{},[32,615,616,620,625],{},[50,617,618],{},[17,619,444],{},[50,621,622],{},[17,623,624],{},"string",[50,626,627],{},"One of the states below.",[32,629,630,635,640],{},[50,631,632],{},[17,633,634],{},"framework",[50,636,637,638],{},"Optional ",[17,639,624],{},[50,641,642,645,646,649,650,653],{},[17,643,644],{},"esx",", ",[17,647,648],{},"qb"," or ",[17,651,652],{},"qbox"," on a successful completed check/write. Absent on pending, disabled and failure results.",[32,655,656,661,664],{},[50,657,658],{},[17,659,660],{},"changed",[50,662,663],{},"List",[50,665,666,667,645,670,673,674,205],{},"Confirmed changes for a successful write, otherwise empty. Each entry contains ",[17,668,669],{},"file",[17,671,672],{},"backup"," and ",[17,675,676],{},"removed",[32,678,679,683,694],{},[50,680,681],{},[17,682,493],{},[50,684,685,649,687,690,691],{},[17,686,624],{},[17,688,689],{},"nil","/",[17,692,693],{},"null",[50,695,696],{},"Failure message, otherwise no error.",[10,698,699,700,702,703,705,706,708,709,711],{},"Each ",[17,701,660],{}," entry contains a framework-relative ",[17,704,669],{}," path, the private absolute ",[17,707,672],{}," path and a list of replaced integration labels in ",[17,710,676],{},". Keep backup paths and diagnostic errors on the server; do not send the full object to ordinary clients or public logs.",[594,713,715],{"id":714},"installer-states","Installer states",[26,717,718,728],{},[29,719,720],{},[32,721,722,725],{},[35,723,724],{},"State",[35,726,727],{},"Meaning and next step",[45,729,730,740,755,765,774],{},[32,731,732,737],{},[50,733,734],{},[17,735,736],{},"pending",[50,738,739],{},"Installation has not finished. A lookup immediately after startup can return this state. Check the subsequent startup report or read the status again when needed.",[32,741,742,747],{},[50,743,744],{},[17,745,746],{},"disabled",[50,748,749,751,752,754],{},[17,750,166],{}," is ",[17,753,363],{},". This does not verify a manual installation.",[32,756,757,762],{},[50,758,759],{},[17,760,761],{},"installed",[50,763,764],{},"The recognized framework files already match the generated hooks; this run changed no files. This does not prove that the currently running framework has loaded those files.",[32,766,767,771],{},[50,768,769],{},[17,770,511],{},[50,772,773],{},"Planned changes were written and verified on disk. A planned full server restart is needed to load them. The export does not perform that restart.",[32,775,776,780],{},[50,777,778],{},[17,779,469],{},[50,781,782,783,785],{},"Detection, validation or writing failed. Read ",[17,784,493],{}," and the startup report before making another attempt.",[10,787,788,789,795,796,799],{},"On failure, ",[14,790,791,792,794],{},"an empty ",[17,793,660],{}," list does not prove that no file was written",". A multi-file write or worker timeout can leave partial changes before a failure is reported. Inspect the actual framework files and ",[17,797,798],{},".sky_jobscreator-installer-backups/"," before retrying or restoring. Do not interpret a timed-out worker as a rollback.",[10,801,802,803,205],{},"For permissions, backups and normal startup order, see ",[804,805,807],"a",{"href":806},"/docs/jobs/jobcreator/setup/installation","Installation",[809,810,811],"style",{},"html pre.shiki code .sMK4o, html code.shiki .sMK4o{--shiki-light:#39ADB5;--shiki-default:#89DDFF;--shiki-dark:#89DDFF}html pre.shiki code .sTEyZ, html code.shiki .sTEyZ{--shiki-light:#90A4AE;--shiki-default:#EEFFFF;--shiki-dark:#BABED8}html pre.shiki code .sfazB, html code.shiki .sfazB{--shiki-light:#91B859;--shiki-default:#C3E88D;--shiki-dark:#C3E88D}html pre.shiki code .s2Zo4, html code.shiki .s2Zo4{--shiki-light:#6182B8;--shiki-default:#82AAFF;--shiki-dark:#82AAFF}html .light .shiki span {color: var(--shiki-light);background: var(--shiki-light-bg);font-style: var(--shiki-light-font-style);font-weight: var(--shiki-light-font-weight);text-decoration: var(--shiki-light-text-decoration);}html.light .shiki span {color: var(--shiki-light);background: var(--shiki-light-bg);font-style: var(--shiki-light-font-style);font-weight: var(--shiki-light-font-weight);text-decoration: var(--shiki-light-text-decoration);}html .default .shiki span {color: var(--shiki-default);background: var(--shiki-default-bg);font-style: var(--shiki-default-font-style);font-weight: var(--shiki-default-font-weight);text-decoration: var(--shiki-default-text-decoration);}html .shiki span {color: var(--shiki-default);background: var(--shiki-default-bg);font-style: var(--shiki-default-font-style);font-weight: var(--shiki-default-font-weight);text-decoration: var(--shiki-default-text-decoration);}html .dark .shiki span {color: var(--shiki-dark);background: var(--shiki-dark-bg);font-style: var(--shiki-dark-font-style);font-weight: var(--shiki-dark-font-weight);text-decoration: var(--shiki-dark-text-decoration);}html.dark .shiki span {color: var(--shiki-dark);background: var(--shiki-dark-bg);font-style: var(--shiki-dark-font-style);font-weight: var(--shiki-dark-font-weight);text-decoration: var(--shiki-dark-text-decoration);}html pre.shiki code .spNyl, html code.shiki .spNyl{--shiki-light:#9C3EDA;--shiki-default:#C792EA;--shiki-dark:#C792EA}html pre.shiki code .s7zQu, html code.shiki .s7zQu{--shiki-light:#39ADB5;--shiki-light-font-style:italic;--shiki-default:#89DDFF;--shiki-default-font-style:italic;--shiki-dark:#89DDFF;--shiki-dark-font-style:italic}html pre.shiki code .sHwdD, html code.shiki .sHwdD{--shiki-light:#90A4AE;--shiki-light-font-style:italic;--shiki-default:#546E7A;--shiki-default-font-style:italic;--shiki-dark:#676E95;--shiki-dark-font-style:italic}html pre.shiki code .sBMFI, html code.shiki .sBMFI{--shiki-light:#E2931D;--shiki-default:#FFCB6B;--shiki-dark:#FFCB6B}",{"title":102,"searchDepth":109,"depth":144,"links":813},[814,815,816],{"id":94,"depth":144,"text":54},{"id":216,"depth":144,"text":69},{"id":392,"depth":144,"text":84,"children":817},[818,819],{"id":596,"depth":265,"text":597},{"id":714,"depth":265,"text":715},"Exact signatures, return values and startup limits for Job Creator's three server exports.","md",null,{},{"icon":825},"i-lucide-server","/docs/jobs/jobcreator/api/server-exports",{"title":5,"description":820},{"loc":826},"1.docs/0.jobs/6.jobcreator/5.api/2.server-exports","yQWBcsnTsawxbXEWYLA8HzBJu1iPOc2SRQ-0R9GuW1k",[832,838],{"title":833,"path":834,"stem":835,"description":836,"icon":837,"children":-1},"API Overview","/docs/jobs/jobcreator/api/overview","1.docs/0.jobs/6.jobcreator/5.api/1.overview","Choose the correct Job Creator export, shared Jobs Base API or administrator integration.","i-lucide-code-xml",{"title":839,"path":840,"stem":841,"description":842,"icon":843,"children":-1},"Shared Job APIs","/docs/jobs/jobcreator/api/shared-job-apis","1.docs/0.jobs/6.jobcreator/5.api/3.shared-job-apis","Connect Creator jobs to Jobs Base duty, employees, salary, garage, business and tablet APIs.","i-lucide-blocks",[],1792510394090]