Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

Status
colourGreen
titleAccurate

Code Block
languagejs
linenumberstrue
{
  "config": { // All clients listen here permanently
    "articleBaseUrl": "http://cloud-storage.com/articles/"
,
 },   "userslegalsUrl": {"http://impossible.am/legalstuff/",
    "user_id_01for7MW": {
//    Clients listen here permanently"facebookPage": "",
      "usernamefacebookGroup": "user",
// [default:null]
      "emailinstagramUser": "user@somewhere.com", // [default:null]
      "fitnessLevelfaqsUrl": 10,""
// [default:10]   },
    "fitnessBiasforAfterburner": 1, // [default:1]{
      "createdfacebookPage": 987654345"",
// Unix timestamp (seconds) [default:0]
      "maxImpactCreditfacebookGroup": 3"",
// [default:0]
      "impactCreditinstagramUser": 0.9"",
// [default:0]       "updatedICfaqsUrl": 987654345,""
// Unix timestamp (seconds) [default:0] }
  },
   "triggersFiredusers": {
"triggerId_01": true, "triggerId_02    "user_id_01": true },{ // [default:null]Clients listen here     "sessions": {permanently
          "for7MWusername": 2"user", // [default:0null]
 
      "forAfterburneremail": 0"user@somewhere.com", // [default:0]
      },null]
      "totalActivitiesfitnessLevel": 210, // [default:010]
      "totalActivities7MWfitnessBias": 1, // [default:01]
      "totalActivitiesAFcreated": 1987654345, // Unix timestamp (seconds) [default:0]
      "firstActivity7MWmaxImpactCredit": 9876543453, // Unix timestamp (seconds) [default:0]
      "impactCredit": 0.9, // [default:0]
      "firstActivityAFupdatedIC": 987654345, // Unix timestamp (seconds) [default:0]
    }   },
  "visibleWorkoutDefs": { // Workout defs that are visible to the user"triggersFired": { "triggerId_01": true, "triggerId_02": true }, // [default:null]
      "user_id_01sessions": {
        "for7MW": {2, // 7MW[default:0]
clients listen here permanently for ChildAdded, ChildChanged and ChildRemoved"forAfterburner": 0 // [default:0]
     "wktdef1": {
   },
       "recommendedtotalActivities": ""2, // Not recommended, just visible // [default:null0]
	      "lockedtotalActivities7MW": true1, // Not[default:0]
available to user (unlocked via IAP and/or journey trigger) "totalActivitiesAF": 1, // [default:false0]
 		     "lockStringfirstActivity7MW": "Finish 6 more workouts before Thurs 9th June"987654345, // DisplayedUnix totimestamp user(seconds) [default:null0]
  
       "MWIfirstActivityAF": 0.54987654345, // Unix timestamp (seconds) [default:0.5]
  
       "breakdowntimedNotifSeqVersion": {0, // Version of timed notif sequence user is on    "epoc": 0.1, // (server use) [default:0.25]
      "testMode": false, // Puts the app in 'test  "cardio": 0.1, //mode' for this user [default:0.25false]
      "notifTokens": { // APN tokens for "metabolic": 0.1, //the user's devices [default:0.25null]
        "for7MW": {   "strengthapn_token": 0.1 true }, // [default:0.25]
     Where 'api_token' is the actual token string
    }    "forAfterburner": {   "apn_token": true },
      }
 "wktdef2": {  }
    },
   "recommendedvisibles": "You{
need to work on your abs","workoutDefs": { // RecommendedWorkout anddefs reasonthat forare thisvisible to bethe shown to user
		  "locked": false,
// Available to user 		  "lockStringuser_id_01": "",{ 
         "MWIfor7MW": 0.54,
          "breakdown": {
  { // 7MW clients listen here permanently for ChildAdded, ChildChanged and ChildRemoved
          "epocwktdef1": 0.1,{
            "cardiorecommended": 0.1"", // Not recommended, just visible        "metabolic": 0.1,// [default:null]
             "strengthlocked": 0.1
          }
   true, // Not available to user (unlocked via IAP and/or journey trigger) [default:false]
  	     }   "lockString": "Finish 6 more },workouts before Thurs 9th    "forAfterburner": {June", // Displayed Afterburnerto clients listen here permanently for ChildAdded, ChildChanged and ChildRemoveduser [default:null]
            "MWI": 0.54,  "wktdef1": {// [default:0.5]
            "recommendedbreakdown": "", // Not recommended, just visible
	 {
              "lockedepoc": false0.1, // Available to user
		  "lockString": "",[default:0.25]
              "MWIcardio": 0.541, // [default:0.25]
        "breakdown": {             "epoc"metabolic": 0.1, // [default:0.25]
              "cardiostrength": 0.1, // [default:0.25]
            "metabolic": 0.1,}
          },
  "strength": 0.1
          }
        },         "wktdef2": {
            "recommended": "You need to work on your abs", // Recommended and reason for this to be shown to user
		
            "locked": false, // Available to user
		            "lockString": "",
            "MWI": 0.54,
            "breakdown": {
              "epoc": 0.1,
              "cardio": 0.1,
              "metabolic": 0.1,
              "strength": 0.1
          }  }
      }     }
 }     }   },
  "workouts": {     "activitiesforAfterburner": { // Afterburner clients listen here  "user_id_01": { // Clients listen here permanently for ChildAddedpermanently for ChildAdded, ChildChanged and ChildRemoved
        "workout_id_01  "wktdef1": {
// Clients post new activity to here with auto id, server listens           "workoutDefId"recommended": "wktdef1", // [no default]Not recommended, just visible
  	        "finishlocked": 987654345false, // UnixAvailable timestampto (seconds) [default:0]user
  	         "iterationslockString": 1.5, // Number of times it was performed [default:1]"",
            "exertionMWI": 0.554,
// [default:0.5]           "finalHeartRateBPMbreakdown": {
 160, // [default:140]           "finalHeartRateDelayepoc": 0.1,
 // Length of delay (in secs) after the workout before the HR was measured"cardio": (0.1,
 if they didn't press the 'start again' button) [default:0]
		      "appmetabolic": "7MW" // Short code of the app the activity was performed in: 7MW, AF, etc [default:null] 0.1,
              "strength": 0.1
            }
      }     },

   "receipts": {       "user_id_01wktdef2": {
            "receipt_auto_id_01recommended": {"You need to work on your abs", // Recommended and reason "receipt": "receipt_data", // Written by the client after an IAP purchasefor this to be shown to user
            "validationlocked": {false, // Written by the server after the receipt has been processedAvailable to user
            "lockString": "",
            "validationDateMWI": 3456789, // Timestamp0.54,
            "isValidbreakdown": true{
          }    "epoc": 0.1,
   }       }     },"cardio": 0.1,
     "results":  {       "user_id_01metabolic": { // Clients listen here permanently for ChildAdded, ChildChanged and ChildRemoved0.1,
               "workout_id_01strength": {0.1
// Server posts workout results here       }
   "workoutDefId": "wktdef1", // [no default]   }
       "finish": 987654345, // Unix timestamp (seconds) // [no default] }
      }
    },
     "AWIroutines": 0.1, // [default:0.5]
 {
      "user_id_01": { 
        "responseDurationfor7MW": 3456,{ // [default: 0]
     7MW clients listen here permanently for ChildAdded, ChildChanged and ChildRemoved
    "intensity": 0.9, // [default:0.5] 		  "approutine_id_01": "7MW", // Short code of the app the activity was performed in: 7MW, AF, etc [no default]
          "responses": { // [no default{
            "locked": true, // Not available to user (unlocked via IAP and/or journey trigger) [default:false]
            "cardiolockString": {"Finish 6 more workouts before Thurs 9th June" // Displayed to user [default:null]
     "stress": 43,    },
          "magnitudeProductroutine_id_02": 0.6,{
              "halflifeProductlocked": 0.3true,
 
            "durationlockString": 5678,"" // No lock string, so only unlocked via       "volume": 3456IAP [default:null]
            },
            "strength"routine_id_03": {
 
            "stresslocked": 43false, // Available
            "magnitudeProductlockString": 0.6,""
            }
 "halflifeProduct": 0.3,      },
        "durationforAfterburner": 5678,{ // 7MW clients listen here permanently for ChildAdded, ChildChanged and ChildRemoved
   "volume": 3456        "routine_id_03": {
    },             "epoclocked": {false, // Available
            "stresslockString": 43,""
          }
   "magnitudeProduct": 0.6,    }
      }
   "halflifeProduct": 0.3, }
  },
     "workouts": {
     "durationactivities": 5678,{
      "user_id_01": { // Clients listen here permanently  "volume": 3456
 for ChildAdded, ChildChanged and ChildRemoved
        "workout_id_01": { },// Clients post new activity to here with auto id, server listens
 "metabolic": {               "stress"workoutDefId": 43"wktdef1", // [no default]
           "magnitudeProductfinish": 0.6987654345, // Unix timestamp (seconds) [default:0]
          "halflifeProductiterations": 01.35, // Number of times it was performed [default:1]
          "durationexertion": 56780.5, // [default:0.5]
            "volumefinalHeartRateBPM": 3456160, // [default:140]
          }
          },
          "muscleGroups": {
            "upper": 0.3, // [default: 0.3]
            "lower": 0.3, // [default: 0.3"finalHeartRateDelay": 0, // Length of delay (in secs) after the workout before the HR was measured (0 if they didn't press the 'start again' button) [default:0]
		  "app": "7MW" // Short code of the app the activity was performed in: 7MW, AF, etc [default:null]
        }
   "core": 0.4 // [default: 0.3]}
    },
    "results": {
}      "user_id_01": { // }Clients listen here permanently for ChildAdded, ChildChanged }and ChildRemoved
   }   },   "afterburnworkout_id_01": { // Server posts workout results here
   "user_id_01       "workoutDefId": {"wktdef1", // Clients listen here permanently [no default]
          "startfinish": 345678987987654345, // Unix timestamp (seconds) // [no default]
          "responseAWI": {0.1, // [default:null0.5]
          "resolutionresponseDuration": 6003456, // Secs
[default: 0]
          "epocintensity": [0.6,9, // [default:0.5,0.3,0.2,0.1,0.0],]
		  "app": "7MW", // Short code of the app the activity was performed in: 7MW, AF, etc [no default]
          "responses": { // [no default]
            "cardio": {
              "stress": 43,
              "magnitudeProduct": 0.6,
              "halflifeProduct": 0.3,
              "duration": 5678,
              "volume": 3456
            },
            "strength": {
              "stress": 43,
              "magnitudeProduct": 0.6,
              "halflifeProduct": 0.3,
              "duration": 5678,
              "volume": 3456
            },
            "epoc": {
              "stress": 43,
              "magnitudeProduct": 0.6,
              "halflifeProduct": 0.3,
              "duration": 5678,
              "volume": 3456
            },
            "metabolic": {
              "stress": 43,
              "magnitudeProduct": 0.6,
              "halflifeProduct": 0.3,
              "duration": 5678,
              "volume": 3456
            }
          },
          "muscleGroups": {
            "upper": 0.3, // [default: 0.3]
            "lower": 0.3, // [default: 0.3]
            "core": 0.4 // [default: 0.3]
          }
        }
      }
    }
  },
  "afterburn": {
    "user_id_01": { // Clients listen here permanently
      "start": 345678987, // Unix timestamp (seconds) // [no default]
      "response": { // [default:null]
        "resolution": 600, // Secs
        "epoc": [0.6,0.5,0.3,0.2,0.1,0.0],
        "cardio": [0.6,0.5,0.3,0.2,0.1,0.0],
        "strength": [0.6,0.5,0.3,0.2,0.1,0.0],
        "metabolic": [0.6,0.5,0.3,0.2,0.1,0.0]
      },
      "impactCredit": { // [default:null]
        "resolution": 600, // Secs
        "futureCredit": 0.9,
        "pending": [0.0,0.1,0.2,0.3,0.4,0.5]
      },
      "messages": [ // Messages displayed below the radar chart [default:null]
        {"t":0,"body":"Restoring body temperature", "detail": ""},
        {"t":120,"body":"Replenishing glycogen stores", "detail": "detail/glycogen"}
      ],
      "notifications": [ // [default:null]
        {"t":6000,"body":"Great workout! You're still burning calories and building strength."},
        {"t":14400,"body":"Fitness test unlocked! You're ready to take another fitness test."}
      ]
    }
  },
  "timelineArticles": {
    "user_id_01": { // Clients listen here permanently for ChildAdded, ChildChanged and ChildRemoved
      "article_id_01": {
        "cardiodate": [0.6,0.5,0.3,0.2,0.1,0.0], 4567890987, // Unix timestamp (seconds) // [no default]
        "strengthtitle": [0.6,0.5,0.3,0.2,0.1,0.0], "Post title", // [no default]
        "metabolic": [0.6,0.5,0.3,0.2,0.1,0.0read": false, // [default:true]
      },  "location": "post/location.html", // [no default]
		"impactCrediticon": {"default", // [default:null"default"]
        "resolutionappMask": 600"7MW,AF", // Secs [default: all apps]
        "futureCreditpromptRating": 0.9,true // [default:false]
      }
 "pending": [0.0,0.1,0.2,0.3,0.4,0.5]
     }
  },
  "definitions": {
    "messagesroutines": [{ // MessagesClients displayedlisten belowhere thepermanently radarfor chart [default:null]
 ChildAdded, ChildChanged and ChildRemoved
      {"t":0,"body":"Restoring body temperature", "detailroutine_id_01": {
        "title": "The Wonder Routine"}, // [no default]
     {"t":120,"body":"Replenishing glycogen stores", "detailimage": "detail/glycogen"}
 wonder-routine", // [default:"default-routine"]
    ],    "desc": "Big long description"notifications":, [ // [default:null]
        {"tappStoreId7MW":6000, "bodyroutine01":"Great workout! You're still burning calories and building strength."},, // StoreKit product id [default:null]
        {"tin7MW":14400,"body":"Fitness test unlocked! You're ready to take another fitness test."}
      ] true, // For server use [default:false]
        "inAfterburner": false, // For server use [default:false]
      }  "lockedIn7MW": },false, // For server use [default:false]
  "timelineArticles": {     "user_id_01lockedInAfterburner": {false, // ClientsFor listenserver here permanently for ChildAdded, ChildChanged and ChildRemoveduse [default:false]
        "video": "",  "article_id_01": {// [default:null]
        "dateminFitnessLevel": 45678909874, // Unix timestamp (seconds) [default:1]
        "workoutDefs": { // [no default]
          "titlewktdef1": "Post{
title", // [no default]         "readtype": false1, // [default:true1]
            "locationtitle": "post/location.htmlAerobic", // [no default]
		"icon            "image": "defaultabs", // [default:"default"]
            "appMaskdesc": "7MW,AF"Aerobic Basic Movement", // [default: all apps]
 null]
    }     }   },
  "definitionsbreakDuration": {
    "exerciseDefs": { // Clients listen here permanently for ChildAdded, ChildChanged and ChildRemoved5, // // [default:10]
            "appStoreId7MW": "exdef1": {workout01", // StoreKit product id [default:null]
            "behaviourlocked": 1false, // For server use [default:1false]
        "title			"MWI": "Cruches"0.54, // [no default:0.5]
            "videoexercises": "01-Crunches.mp4",[ // [no default]
        "image": "abs", // [default:"default"]
       {
      "desc": "A crunch begins with lying face up on the floor with knees bent. The movement begins by curling the shoulders towards the pelvis. The hands can be behind or beside the neck or crossed over the chest. Injury can be caused by pushing against the head or neck with hands.", // [default:null]"id": "exdef1", // [no default]
                "duration": 20 // [no default]
              },
          "subtitle": "Target your abs for{
a balanced set of stomach muscles.", // [default:null]         "calPerSecid": 5"exdef2",
// [default:0]                "skillduration": 0.2, // [default:0.5]15
           "strength": 0.7, // [default:0.5] },
        "cardio": 0.1, // [default:0.5]   {
     "epoc": 0.4, // [default:0.5]         "metabolicid": 0.4"exdef3",
// [default:0.5]
        "upper": 0.5, // [default:0.5]         "coreduration": 0.5, // [default:0.5]10
         "lower": 0.5 // [default:0.5]  },
    },       "exdef2": {  {
      "behaviour": 1,         "titleid": "Squatsexdef4",
        "video": "02-Squats.mp4",
        "imageduration": "abs", 5
              "desc": "Squats are an excellent exercise for training the lower body and core muscles, if done regularly they help to define thighs and buttocks.",},
              {
                "subtitleid": "Train your lower body and core.","exdef5",
                "calPerSecduration": 10
4,          "skill": 0.2,   }
     "strength": 0.6,      ],
  "cardio": 0.3,         "epocadaptiveStress": 0.4,{
        "metabolic": 0.6,         "upperstrength": 0.52, // [default:1]
      "core": 0.5,           "lowercardio": 0.59, // [default:1]
    }     },     "workoutDefsmetabolic": {0.6, // Clients[default:1]
listen here permanently for ChildAdded, ChildChanged and ChildRemoved       "wktdef1epoc": {0.6 // [default:1]
           "type": 1},
  // [default:1]         "titlemuscleStress": "Aerobic", // [no default] {
              "imageupper": "abs"10, // [default:"default"1]
        "desc": "Aerobic Basic Movement", // [default:null]
        "breakDurationlower": 510, // // [default:101]
		"appStoreId: "workout01", // StoreKit product id [default:null]         "in7MWcore": true,10 // For server use [default:false1]
        "inAfterburner": false, // For server use [default:false]  }
        "exercises": [ //}
[no default]       }
   {   }
    },
    "idexerciseDefs": "exdef1",{ // Clients [nolisten default]here permanently for ChildAdded, ChildChanged and ChildRemoved
      "durationexdef1": 20{
// [no default]           }"behaviour": 1, // [default:1]
        {
   "title": "Cruches", // [no default]
        "idvideo": "exdef201-Crunches.mp4", // [no default]
         "durationimage": 15
 "abs", // [default:"default"]
        },
          {
            "id": "exdef3",
            "duration": 10
          },
          {
            "id": "exdef4",
   "desc": "A crunch begins with lying face up on the floor with knees bent. The movement begins by curling the shoulders towards the pelvis. The hands can be behind or beside the neck or crossed over the chest. Injury can be caused by pushing against the head or neck with hands.", // [default:null]
        "subtitle": "Target your abs for a balanced set of stomach muscles.", // [default:null]
        "durationcalPerSec": 5, // [default:0]
        }"skill": 0.2, // [default:0.5]
        {
   "strength": 0.7, // [default:0.5]
        "idcardio": "exdef5"0.1, // [default:0.5]
          "durationepoc": 10
 0.4, // [default:0.5]
        }
        ],"metabolic": 0.4, // [default:0.5]
        "adaptiveStressupper": {
 0.5, // [default:0.5]
        "strengthcore": 0.25, // [default:10.5]
          "cardiolower": 0.95, // [default:10.5]
 
        "metabolicneedsHalfwaySwap": 0.6,false // [default:1false]
      },
      "epocexdef2": 0.6 // [default:1] {
        "behaviour": 1,
        }"title": "Squats",
        "muscleStressvideo": {"02-Squats.mp4",
          "upperimage": 10, // [default:1]
          "lower": 10, // [default:1]
          "core": 10 // [default:1]"abs",
        "desc": "Squats are an excellent exercise for training the lower body and core muscles, if done regularly they help to define thighs and buttocks.",
        "subtitle": "Train your }lower body and core.",
   },       "wktdef2calPerSec": {4,
        "typeskill": 10.2,
        "titlestrength": "Thai Boxing"0.6,
        "imagecardio": "abs"0.3,
        "descepoc": "Boxing With Kicking"0.4,
        "breakDurationmetabolic": 40.6,
		"appStoreId: "", // StoreKit product id         "in7MWupper": false0.5,
// For server use         "inAfterburnercore": true, // For server use0.5,
        "exerciseslower": [0.5,
        "needsHalfwaySwap": true
{        }
    "id": "exdef5"},
    "journeyTriggers": {
      "durationforAfterburner": 15{
        "trigger01": {
},           {
"category": "achievement",
           "idtriggerType": "exdef3activeDaysInWeeks",

           "durationcondition1": 104, // 4 active days
      },    "condition2": 8, // every week for 8 {
 weeks
          "idactions": "exdef1",[
              "duration": 5
{"actionType":"postArticle","articleId":"article_id_01","data":"e.g. url parameters"},
         }         ],
        "stress": {{"actionType":"unlockWorkout","workoutDefId":"workoutDef_id_01","articleId":"article_id_02","data":""}
          "strength": 0.2,]
          "cardio": 0.9,
 },
        "metabolictrigger02": 0.6,{
          "epoccategory": 0.6 "education",
           },"triggerType": "totalActivities",
          "muscleStresscondition1": { 10, // 10 activities
          "uppercondition2": 100, // Not used
          "loweractions": [
10,            "core": 10{"actionType":"postArticle","articleId":"article_id_01","data":"e.g. url parameters"}
        }  ]
    }    }
},     "journeyTriggers: {},
      "forAfterburnerfor7MW": {
        "trigger01": {
          "category": "achievement",
          "triggerType": "activeDaysInWeeks",
          "condition1": 4, // 4 active days
          "condition2": 8, // every week for 8 weeks
          "actions": [
            {"actionType":"postArticle","articleId":"article_id_01","data":"e.g. url parameters"},
            {"actionType":"unlockWorkout","workoutDefId":"workoutDef_id_01","articleId":"article_id_02","data":""}
          ]
        },
        "trigger02": {
          "category": "education",
          "triggerType": "totalActivities",
          "condition1": 10, // 10 activities
          "condition2": 0, // Not used
          "actions": [
            {"actionType":"postArticle","articleId":"article_id_01","data":"e.g. url parameters"}}
          ]
        }
      }
    }
    "timedNotifs": {
      "forAfterburner": {
        "notif01": {
          "deltaHours": 24, ]// Delta after APN token reg that the notif }is delivered [no default]
   },       "for7MWseqVersion": {
        "trigger01": { 0, // Sequence version to allow future updates without flooding existing users [default:0]
          "categorytitle": "achievementTitle of notification", // [default:""]
          "triggerTypebody": "activeDaysInWeeksBody of notification", // [no default]
       "condition1": 4}, //
4 active days    },
      "condition2for7MW": 8, // every week for 8 weeks {
        "notif01": {
          "actionsdeltaHours": [24, 
           {"actionTypeseqVersion":"postArticle","articleId":"article_id_01","data":"e.g. url parameters"},
  0, 
         {"actionType":"unlockWorkout","workoutDefId":"workoutDef_id_01","articleId":"article_id_02","data":""}
  "title": "Title of notification",
          "body": "Body of notification"
        ]},
      }
 },   }
  },
  "trigger02receipts": {
    "user_id_01": {
      "categoryreceipt_auto_id_01": "education",
{
         "triggerTypereceipt": "totalActivitiesreceipt_data", //          "condition1": 10, // 10 activities
 Written by the client after an IAP purchase
        "condition2validation": 0,{ // NotWritten usedby the server after the receipt has been processed
  "actions": [       "validationDate": 3456789, //    {"actionType":"postArticle","articleId":"article_id_01","data":"e.g. url parameters"}Timestamp [default:0]
          "isValid": true [default:false]
        }
      }
    }
  },
}

Client-Side Data Validation & Error Handling

...