{"id":23331080,"url":"https://github.com/sassoftware/restaf-demos","last_synced_at":"2025-04-07T10:48:11.482Z","repository":{"id":30495146,"uuid":"123502237","full_name":"sassoftware/restaf-demos","owner":"sassoftware","description":"A collection of examples using restaf in a nodejs environment.","archived":false,"fork":false,"pushed_at":"2024-11-19T20:20:02.000Z","size":18880,"stargazers_count":6,"open_issues_count":2,"forks_count":1,"subscribers_count":8,"default_branch":"main","last_synced_at":"2025-04-04T00:11:47.384Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"SAS","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/sassoftware.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","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":"2018-03-01T22:59:15.000Z","updated_at":"2023-03-25T11:15:55.000Z","dependencies_parsed_at":"2024-04-23T21:01:29.132Z","dependency_job_id":"67bd1f09-f3f1-4d81-9c23-156fe2a2a10a","html_url":"https://github.com/sassoftware/restaf-demos","commit_stats":{"total_commits":104,"total_committers":3,"mean_commits":"34.666666666666664","dds":"0.24038461538461542","last_synced_commit":"bcdee459a55c6c107a9d081c761fb20cdc2f7f31"},"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sassoftware%2Frestaf-demos","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sassoftware%2Frestaf-demos/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sassoftware%2Frestaf-demos/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sassoftware%2Frestaf-demos/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/sassoftware","download_url":"https://codeload.github.com/sassoftware/restaf-demos/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247640508,"owners_count":20971553,"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-12-20T22:30:45.342Z","updated_at":"2025-04-07T10:48:11.452Z","avatar_url":"https://github.com/sassoftware.png","language":"SAS","funding_links":[],"categories":[],"sub_categories":[],"readme":"# restaf-demos\n\nA collection of examples demonstrating then use of restaf in nodejs\nThe demos cover typical SAS software usages - running datastep, running cas actions,\naccessing VA reports etc...\n\nPlease review the source code to see how restaf is used to achieve\nthe desired goal with minimal coding.\n\n\n## Install\n```\nexample:\ngit clone https://github.com/sassoftware/restaf-demos -b restaf-demos\ncd restaf-demos\nnpm install\n```\n\n## Configure the app\n### Server setup\nTo run this application you need to do the following:\n\nAsk your system administrator to give you a clientid and clientSecret appropriate\nfor password flow.\n\n\u003e A note on password flow:  With the advent of TFA you should start transistioning away from using userid+password to run the examples in this repository. Instead use a saved token to execute these programs.\n\n\n### How to get token\n\nYou can use the standard sas-cli.\n\n```cmd\nsas-viya auth login\n```\n\nOr you can use the newer version which uses authorization_code flow to get the token\n\n```cmd\nsas-viya auth loginCode\n```\n\nSave the token in some secure place (the .sas directory is a good place)\n\n### Edit the .env file\n\nThe .env file is the way to specify configurations. \n\n```env\nVIYA_SERVER= \u003cyour viya server url : ex: http://myviya.sas.com\u003e\n# Preferred way\n# TOKENFILE=\u003cpath to a persisted viya authentication token\u003e\n# ex: TOKENFILE=../../token\n\n## Alternate setup: Will work until the use of password flow is phased out.\n\n# CLIENTID=sas.ec\n# CLIENTSECRET=\n# USER=xxx\n# PASSWORD=ppp\n\n# if Viya server still has the unsigned certificate and your protocol is https\nNODE_TLS_REJECT_UNAUTHORIZED=0\n\n```\n\n\n## Running the application\n\n```md\nnpm test testname\n```\n\n### Debugging your code.\n\n```md\nnpm debug testname\n```\n\nThen use your favorite nodejs debugger. I use the chrome://inspect on Google chrome.\n\n## List of examples\n\n- addServices - initialization of specific Viya Services\n\n- appdata -  adding and retrieving app specific information from restaf\n\n- casds -  executing datastep in CAS\n\n- casEcho - executing echo action\n\n- casFetch - fetching data from CAS\n\n- casSentiment - sentiment analysis in CAS\n\n- casSessions - creating CAS sessions\n\n- casTables - list fileinfo for all tables in all caslibs\n\n- casUpload - upload a csv file and operate on it\n\n- casUploadAstore - upload a astore to cas\n\n- casUploadImages - upload images to file service\n\n- computeds - execute a compute service\n\n- computedsEasy - accessing compute service using restaflib\n\n- logon  - logon to a Viya server\n\n- paginate - paginate thru the file service and list the file names\n\n- reportElement - prints the named elements in a VA report\n\n- reportImage - generate an image(svg) for a report\n\n- reportList - list the names of all the reports\n\n- request - access an external url\n\n- submit - run a job in the background.\n\n- submitAction - run a cas job in the background\n\n- submitcasl - similar to submitAction for runcasl\n\n\n- reportList - list all the reports\n\n## Serverless Examples\n\nThese have been removed since they have not been kept up with changes to AWS serverless functions.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsassoftware%2Frestaf-demos","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsassoftware%2Frestaf-demos","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsassoftware%2Frestaf-demos/lists"}