View 00 Introduction.md

These are work-in-progress payloads demonstrating enhancements to the VersionOne API to extend Create, Update, and Execute Operation to the query.v1 syntax.

As an example of an integration that utilizes this support, see this code:

https://github.com/JogoShugh/SpaceMiner/blob/Hackweek_V1/client/lib/integrations/V1Integration.next.js#L1-L29

The following lines (from the link above) of EcmaScript produce the large payload in the 02 Create Deep Graph of Assets.yaml or 02 Create Deep Graph of Assets.json files of this gist (these enhancements will, like query.v1, support input as either YAML or JSON). You can see how this eases sending data into VersionOne from objects in memory of a script or program. Most importantly, this builds up a nested set of Assets so that you don't have to fire off dozens of HTTP requests. You just send ONE REQUEST!

const lessonToAssetApiPayload = (lesson, scopeName) => {
View SpaceMiner.json
{
"AssetType": "Epic",
"Scope": "zoozoo's Project",
"Description": "Beginners writing games with HTML5 and JavaScript of today (ES5) must master challenging recursion, asynchronous game loops, and callback hell. See how ES2015 and ES2016's powerful new features simplify all of this, reducing the cognitive burden for beginners and seasoned pros!",
"Name": "ES2015 and Beyond",
"Subs": [
{
"AssetType": "Story",
"Name": "Powered up JavaScript",
"Description": "Learn about how ES2015 and beyond will powerup your code!",
View gist:cd3a2819be66583df4f9634d28c6d1da
https://docs.google.com/presentation/d/1YTtCXa_xoLU7CWCMoR2hxTwRmce1R99WTfIonKhb2eA/edit#slide=id.g241e8433b8_0_97
View 00 - Explanation.md

Background

To process a Batch API request, we need to be able to break it into multiple steps and process it on the background as a "Job", essentially. This Job will be capable of surviving App Domain failures or restarts. This means that if it has, for example, 1,000 discrete commands to process (creating assets, updating existing assets, executing operations against existing assets), it will resume where it left off when the application restarts and the Job processor notices that it is not finished.

Eventually, the entire process will look roughly like this:

  • Ingest the entire payload, convert it from YAML, XML, Excel or whatever into an easiest-to-work with Json.NET structure (Currently it's converting JSON into Yaml!)
  • Persist this to DB, return a URI to caller that indicates where to request status updates for the Batch Job
  • On background, begin breaking down the payload into a linear and finite list of projected commands of the following types:
    • Create new Asset
View sample.txt
curl -i -X GET -H "Authorization:Bearer 1.ssLSvrWNRgUHG0/64uz6oczqVfw=" "http://localhost/VersionOneWin/rest-1.oauth.v1/Data/Member?where=IsSelf='true'"
curl -i -X GET -H "Authorization:Bearer 1.ssLSvrWNRgUHG0/64uz6oczqVfw=" 'http://localhost/VersionOneWin/rest-1.oauth.v1/Data/Member?where=IsSelf="true"'
curl -i -X GET -H "Authorization:Bearer 1.ssLSvrWNRgUHG0/64uz6oczqVfw=" "http://localhost/VersionOneWin/rest-1.oauth.v1/Data/Member?where=IsSelf=\"true\""
View create.yaml
# Delete existing items
from: Workitem
filter:
- AssetType!='Epic'
- Scope.Name='SM Josh''s Project'
execute: Delete
---
from: Epic
where:
Scope.Name: SM Josh's Project
View VersionOne_Batch_Assets_API.json
{"front-version":"1.4.2.1", "version":3, "nodes":[{"id":"BE8F33FF-B9A5-409D-831F-DC21EC15103A", "lastModified":"2017-02-09T13:16:36.146-05:00", "name":"VersionOne Batch Assets API", "type":"Project"},{"id":"07F1A78B-5F13-4833-A461-47ADF9BE0208", "lastModified":"2017-02-07T18:31:17.382-05:00", "name":"_ Execute QuickClose on Story Assets", "headers":[{"enabled":true, "name":"Content-Type", "value":"text/yaml"},{"enabled":true, "name":"Authorization", "value":"Basic YWRtaW46YWRtaW4="}], "metaInfo":{"ownerId":"Local repository id"}, "type":"Request", "method":{"requestBody":true, "link":"http://tools.ietf.org/html/rfc7231#section-4.3.3", "name":"POST"}, "body":{"autoSetLength":true, "textBodyEditorHeight":351, "textBody":"from: Story\nwhere:\n Scope: Scope:0\nexecute: QuickClose", "bodyType":"Text"}, "headersType":"Form", "uri":{"host":"localhost", "path":"/VersionOne.Web/api/asset/batch", "scheme":{"name":"http", "version":"V11"}}, "parentId":"BE8F33FF-B9A5-409D-831F-DC21EC15103A"},{"id":"2726D020-6CD7-40DB-A48
View _ DHC Project.json
{
"front-version": "1.4.2.1",
"version": 3,
"nodes": [
{
"id": "BE8F33FF-B9A5-409D-831F-DC21EC15103A",
"lastModified": "2017-02-07T14:34:13.049-05:00",
"name": "Batch Assets API",
"type": "Project"
},
View GenerateTestSet.json
{
"ContextOid": "RegressionSuite:125538",
"ContextManager": {
"PrimaryScopeContext": "Scope:0",
"ScopeRollup": true,
"AssetContext": "Scope:11198",
"AssetListContext": "",
"Bubble": "Scope:0",
"ScopeLabel": "-"
},
View VBA.bas
Option Explicit
'Constants
Const V1METAURL = "/meta.v1"
Const V1RESTHISTURL = "/rest-1.v1/Hist"
Const V1RESTDATAURL = "/rest-1.v1/Data"
Const V1OAUTHHISTURL = "/rest-1.oauth.v1/Hist"
Const V1OAUTHDATAURL = "/rest-1.oauth.v1/Data"
Const V1LOCURL = "/loc.v1"