{"id":15984304,"url":"https://github.com/molda/clientschemas","last_synced_at":"2025-04-04T20:44:03.219Z","repository":{"id":208443233,"uuid":"76744329","full_name":"molda/clientschemas","owner":"molda","description":null,"archived":false,"fork":false,"pushed_at":"2016-12-22T19:43:15.000Z","size":226,"stargazers_count":0,"open_issues_count":0,"forks_count":1,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-03-29T10:48:10.866Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/molda.png","metadata":{"files":{"readme":"Readme.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2016-12-17T20:05:51.000Z","updated_at":"2016-12-17T20:06:00.000Z","dependencies_parsed_at":null,"dependency_job_id":"b5161bb6-d86e-44f2-801d-2486b83348e7","html_url":"https://github.com/molda/clientschemas","commit_stats":{"total_commits":18,"total_committers":1,"mean_commits":18.0,"dds":0.0,"last_synced_commit":"5a5a5d54eead4a60d9aa92433f294462bbd6d3c8"},"previous_names":["molda/clientschemas"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/molda%2Fclientschemas","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/molda%2Fclientschemas/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/molda%2Fclientschemas/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/molda%2Fclientschemas/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/molda","download_url":"https://codeload.github.com/molda/clientschemas/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247249600,"owners_count":20908211,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-10-08T02:06:34.662Z","updated_at":"2025-04-04T20:44:03.195Z","avatar_url":"https://github.com/molda.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Client-side schemas for Total.js\n\n## **BETA VERSION - use at your own risk**\n\n### How it works\n\nAll you need is the clientschemas.js module.\nThen initialize the module, by using bellow code in some definition file\n\n```javascript\nF.on('module#clientschemas', function(module) {\n\n\tmodule.init({\n\t\tschemas: {\n\t\t\t'Contact': {\t\t// this will allow access to Contact schema\n\t\t\t\tauthorize: true,// same as authorize flag in route definition, uses F.onAuthorize\n\t\t\t\trole: '@admin'  // same as @role flag in route definition\n\t\t\t}\n\t\t}\n\t});\n\n});\n```\n\n### Now it's time to use it on the client\n\nFirst add a script:\n```html\n\u003cscript src=\"/$$schemas/clientschemas.js\" type=\"text/javascript\"\u003e\u003c/script\u003e\n```\n\nNow you can use it. `SCHEMA` is a global variable\n```javascript\nSCHEMA('Contact').save({\"email\":\"smolamartin@seznam.dsf\"}, function(err, response){\n\n\tconsole.log('SAVE', err, response);\n\n}).workflow('some-workflow').exec();\n\n\nSCHEMA('Contact').get({id: \u003csome-id\u003e}, function(err, response){\n\n\tconsole.log('GET', err, response);\n\n}).exec(); \n\nSCHEMA('Contact').query(function(err, response){\n\n\tconsole.log('QUERY', err, response);\n\n}).exec();\n```","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmolda%2Fclientschemas","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmolda%2Fclientschemas","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmolda%2Fclientschemas/lists"}