{"id":21064009,"url":"https://github.com/vladinator/sharepoint-batch","last_synced_at":"2025-03-14T01:24:54.307Z","repository":{"id":40321214,"uuid":"42931201","full_name":"Vladinator/sharepoint-batch","owner":"Vladinator","description":"Javascript library for executing SharePoint REST requests against $batch.","archived":false,"fork":false,"pushed_at":"2022-05-22T13:46:25.000Z","size":430,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"master","last_synced_at":"2024-04-25T04:21:10.001Z","etag":null,"topics":["batch","batch-processing","batching","javascript","javascript-library","rest","sharepoint","sharepoint-2016","sharepoint-online","typescript"],"latest_commit_sha":null,"homepage":"","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Vladinator.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2015-09-22T12:03:30.000Z","updated_at":"2022-05-22T13:53:46.000Z","dependencies_parsed_at":"2022-08-09T17:10:55.870Z","dependency_job_id":null,"html_url":"https://github.com/Vladinator/sharepoint-batch","commit_stats":null,"previous_names":["vladinator89/sharepoint-batch"],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Vladinator%2Fsharepoint-batch","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Vladinator%2Fsharepoint-batch/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Vladinator%2Fsharepoint-batch/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Vladinator%2Fsharepoint-batch/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Vladinator","download_url":"https://codeload.github.com/Vladinator/sharepoint-batch/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243506813,"owners_count":20301757,"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":["batch","batch-processing","batching","javascript","javascript-library","rest","sharepoint","sharepoint-2016","sharepoint-online","typescript"],"created_at":"2024-11-19T17:48:00.115Z","updated_at":"2025-03-14T01:24:54.284Z","avatar_url":"https://github.com/Vladinator.png","language":"TypeScript","readme":"# SharePointBatch\nInspiration drawn from the MSDN article [\"Make batch requests with the REST APIs\"](https://msdn.microsoft.com/en-us/library/office/dn903506.aspx)\n\nThis Javascript library is supposed to help developers efficiently build batch jobs and parsing the response from the server. The reason I made this was that the existing code provided by Microsoft seemed a bit underwhelming and the examples were too specific. There is a need for a general purpose library to utilize the API in existing projects.\n\nPlease note that this library is a work in progress. It's a mix between a research project and experimenting writing typescript to compile into JavaScript to then be used in other projects.\n\n## API\nThe project can be loaded as both a module and a javascript browser script.\n\n### TypeScript\nYou can import the package as a module. You will need to specify the url and digest manually.\n\n```typescript\nimport { SharePointBatch, Changeset } from 'sharepoint-batch';\nconst batch = new SharePointBatch({ url: 'https://my.sharepoint.com', digest: '...' });\nbatch.add(new Changeset({ method: 'POST', url: '/_api/ContextInfo' }));\nbatch.add(new Changeset({ method: 'GET', url: '/_api/Site', params: { '$select': 'Id, Url, ReadOnly, WriteLocked' } }));\nbatch.add(new Changeset({ method: 'GET', url: '/_api/Web', params: { '$select': 'Id, Title, WebTemplate, Created' } }));\nconst response = await batch.send();\nconsole.log(response.ok ? 'Done!' : 'Fail!', response.results);\n```\n\n### JavaScript\nThe pre-built `build.min.js` file can be loaded directly into a ES6 compatible browser.\n\n```javascript\nconst options = SharePointBatch.GetSharePointOptions();\nconst batch = new SharePointBatch(options);\nbatch.add(new SharePointBatch.Changeset({ method: 'POST', url: '/_api/ContextInfo' }));\nbatch.add(new SharePointBatch.Changeset({ method: 'GET', url: '/_api/Site', params: { '$select': 'Id, Url, ReadOnly, WriteLocked' } }));\nbatch.add(new SharePointBatch.Changeset({ method: 'GET', url: '/_api/Web', params: { '$select': 'Id, Title, WebTemplate, Created' } }));\nconst response = await batch.send();\nconsole.log(response.ok ? 'Done!' : 'Fail!', response.results);\n```\n\n### Documentation\nFull documentation can be created by building the project and looking in the `docs` folder.\n\n## Scripts\n- `npm run build`\n- `npm run build-src`\n- `npm run build-docs`\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fvladinator%2Fsharepoint-batch","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fvladinator%2Fsharepoint-batch","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fvladinator%2Fsharepoint-batch/lists"}