update apidoc wwws
This commit is contained in:
		| @@ -19,7 +19,7 @@ Wwws.initlocaldata = (tribe, appname, pagename, version, profils, lg) => { | |||||||
|       status: 200, |       status: 200, | ||||||
|       ref: "Wwws", |       ref: "Wwws", | ||||||
|       msg: "pagedoesnotexist", |       msg: "pagedoesnotexist", | ||||||
|       data: { pagename }, |       data: { pagename } | ||||||
|     }; |     }; | ||||||
|   } |   } | ||||||
|   if (locals.pages[pagename].version == version) { |   if (locals.pages[pagename].version == version) { | ||||||
| @@ -42,13 +42,13 @@ Wwws.initlocaldata = (tribe, appname, pagename, version, profils, lg) => { | |||||||
|   if (fs.existsSync(initname) && 1 != 1) { |   if (fs.existsSync(initname) && 1 != 1) { | ||||||
|     const init = fs.readJsonSync(initname); |     const init = fs.readJsonSync(initname); | ||||||
|     if (init.app.version == locals.app.version) { |     if (init.app.version == locals.app.version) { | ||||||
|       return { status: 200, ref: "Wwws", msg: "datamodelupdate", data: init }; |       return { status: 200, ref: "Wwws", msg: "datamodelnoupdate", data: init }; | ||||||
|     } |     } | ||||||
|   } |   } | ||||||
|   const localstorage = { |   const localstorage = { | ||||||
|     version: locals.pages[pagename].version, |     version: locals.pages[pagename].version, | ||||||
|     headers: locals.apxtri.headers, |     headers: locals.apxtri.headers, | ||||||
|     confpages:locals.pages[pagename].confpage, |     confpage:locals.pages[pagename].confpage, | ||||||
|     req: {}, |     req: {}, | ||||||
|     itm:{}, |     itm:{}, | ||||||
|     itms: {}, |     itms: {}, | ||||||
|   | |||||||
| @@ -31,19 +31,14 @@ router.post( | |||||||
| /** | /** | ||||||
|  * @api {get} /api/adminapi/wwws/updatelocaldbanonymous/:tribe/:appname/:pagename/:version - Get app data model for anonymous only |  * @api {get} /api/adminapi/wwws/updatelocaldbanonymous/:tribe/:appname/:pagename/:version - Get app data model for anonymous only | ||||||
|  * @apiGroup Wwws |  * @apiGroup Wwws | ||||||
|  * @apiName getappcontext |  * @apiName getappcontextforanonymous | ||||||
|  * @apiDescription Get data base from backend to localstorage |  * @apiDescription Get data base from backend to localstorage for anonymous (see Get app data model) | ||||||
|  * |  * | ||||||
|  * @apiParams {string} tribe (adminapi,smatchit,..) to looking for |  * @apiParams {string} tribe (adminapi,smatchit,..) to looking for | ||||||
|  * @apiParams {string} appname  agregate a full data referential to store localy |  * @apiParams {string} appname  agregate a full data referential to store localy | ||||||
|  * @apiParams {string} pagename app page name |  * @apiParams {string} pagename app page name | ||||||
|  * @apiParams {interger} version  the current version |  * @apiParams {interger} version  the current version | ||||||
|  * @apiSuccess {object} contain new version data model for a local web app in a PWA logical in the language of the header or if no new version exist then return | */ | ||||||
|  * @apiSuccessExample {json} Success-Response: |  | ||||||
|  * HTTP/1.1 200 OK |  | ||||||
|  * {"status":200, "ref":"Odmdb", "msg":"datamodelupdate", "data":{version,conpages,profils,...}} |  | ||||||
|  * {"status":200, "ref":"Odmdb", "msg":"nonewdatamodel", "data":{}} |  | ||||||
|  */ |  | ||||||
| router.get( | router.get( | ||||||
|   "/updatelocaldbanonymous/:tribe/:appname/:pagename/:version", |   "/updatelocaldbanonymous/:tribe/:appname/:pagename/:version", | ||||||
|   checkHeaders, |   checkHeaders, | ||||||
| @@ -68,17 +63,22 @@ router.get( | |||||||
|  * @api {get} /api/adminapi/wwws/updatelocaldb/:tribe/:appname/:pagename/:version - Get app data model |  * @api {get} /api/adminapi/wwws/updatelocaldb/:tribe/:appname/:pagename/:version - Get app data model | ||||||
|  * @apiGroup Wwws |  * @apiGroup Wwws | ||||||
|  * @apiName getappcontext |  * @apiName getappcontext | ||||||
|  * @apiDescription Get data base from backend to localstorage |  * @apiDescription Get data base from backend to localstorage for authenticated user | ||||||
|  * |  * | ||||||
|  * @apiParams {string} tribe (adminapi,smatchit,..) to looking for |  * @apiParams {string} tribe (adminapi,smatchit,..) to looking for | ||||||
|  * @apiParams {string} appname  agregate a full data referential to store localy |  * @apiParams {string} appname  agregate a full data referential to store localy | ||||||
|  * @apiParams {string} pagename app page name |  * @apiParams {string} pagename app page name | ||||||
|  * @apiParams {interger} version  the current version |  * @apiParams {interger} version  the current version | ||||||
|  * @apiSuccess {object} contain new version data model for a local web app in a PWA logical in the language of the header or if no new version exist then return |  * @apiSuccess {object} contain new version data model for a local web app in a PWA logical in the language of the header or if no new version exist then return | ||||||
|  * @apiSuccessExample {json} Success-Response: |  * @apiSuccessExample {json} datamodelupdate | ||||||
|  |  * {"status":200, "ref":"Wwws", "msg":"datamodelupdate", "data":{version,confpage,profils,schema,options,ref,tpl,tpldata}} | ||||||
|  |  * @apiSuccessExample {json} datamodelnoupdate | ||||||
|  * HTTP/1.1 200 OK |  * HTTP/1.1 200 OK | ||||||
|  * {"status":200, "ref":"Odmdb", "msg":"datamodelupdate", "data":{version,conpages,profils,...}} |  * {"status":200, "ref":"Wwws", "msg":"datamodelupdate", "data":{version,confpage,profils,schema,options,ref,tpl,tpldata}} | ||||||
|  * {"status":200, "ref":"Odmdb", "msg":"nonewdatamodel", "data":{}} |  *  @apiSuccessExample {json} pagedoesnotexist | ||||||
|  |  *  {status: 200,ref: "Wwws", msg: "pagedoesnotexist", data: { pagename } } | ||||||
|  |  *  @apiSuccessExample {json} forbidenaccess | ||||||
|  |  *  {status: 200,ref: "Wwws", msg: "forbidenaccess",data: { pagename, profils } } | ||||||
|  */ |  */ | ||||||
| router.get( | router.get( | ||||||
|   "/updatelocaldb/:tribe/:appname/:pagename/:version", |   "/updatelocaldb/:tribe/:appname/:pagename/:version", | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user