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/",
    "legalsUrl": "http://impossible.am/legalstuff/",
    "for7MW": {
      "facebookPage": "",
      "facebookGroup": "",
      "instagramUser": "",
      "faqsUrl": ""
    },
    "forAfterburner": {
      "facebookPage": "",
      "facebookGroup": "",
      "instagramUser": "",
      "faqsUrl": ""
    }
  },
  "users": {
    "user_id_01": { // Clients listen here permanently
      "username": "user", // [default:null]
      "email": "user@somewhere.com", // [default:null]
      "fitnessLevel": 10, // [default:10]
      "fitnessBias": 1, // [default:1]
      "created": 987654345, // Unix timestamp (seconds) [default:0]
      "maxImpactCredit": 3, // [default:0]
      "impactCredit": 0.9, // [default:0]
      "updatedIC": 987654345, // Unix timestamp (seconds) [default:0]
      "triggersFired": { "triggerId_01": true, "triggerId_02": true }, // [default:null]
      "sessions": {
        "for7MW": 2, // [default:0]
        "forAfterburner": 0 // [default:0]
      },
      "totalActivities": 2, // [default:0]
      "totalActivities7MW": 1, // [default:0]
      "totalActivitiesAF": 1, // [default:0]
      "firstActivity7MW": 987654345, // Unix timestamp (seconds) [default:0]
      "firstActivityAF": 987654345, // Unix timestamp (seconds) [default:0]
   
}   },   "visiblestimedNotifSeqVersion": {0, // Version of timed "workoutDefs": { // Workout defs that are visible to the usernotif sequence user is on (server use) [default:0]
      "user_id_01testMode": {false, // Puts the app in 'test mode' for this "for7MWuser [default:false]
      "notifTokens": { // 7MW clients listen here permanentlyAPN tokens for ChildAdded, ChildChanged and ChildRemovedthe user's devices [default:null]
        "for7MW": { "wktdef1apn_token": {
    true }, // Where 'api_token' is the actual token string
        "recommendedforAfterburner": { "apn_token",: //true Not}
recommended, just visible // [default:null]  }
    }
  },
  "lockedvisibles": true,{
// Not available to user (unlocked via IAP and/or journey trigger) [default:false]
  	"workoutDefs": { // Workout defs that are visible to the user
       "lockStringuser_id_01": { 
 "Finish 6 more workouts before Thurs 9th June","for7MW": { // Displayed7MW toclients user [default:null]
     listen here permanently for ChildAdded, ChildChanged and ChildRemoved
      "MWI": 0.54, // [default:0.5]
            "breakdown"wktdef1": {
 
            "epocrecommended": 0.1"", // Not recommended, just visible // [default:0.25null]
 
            "cardiolocked": 0.1true, // [default:0.25]
              "metabolic": 0.1, // [default:0.25]
  Not available to user (unlocked via IAP and/or journey trigger) [default:false]
  	        "lockString": "Finish 6 more workouts before Thurs 9th June", // Displayed to user [default:null]
            "strengthMWI": 0.154, // [default:0.255]
            }"breakdown": {
         },     "epoc": 0.1,     "wktdef2": {// [default:0.25]
              "recommendedcardio": "You need to work on your abs", // Recommended and reason for this to be shown to user0.1, // [default:0.25]
                      "locked"metabolic": false0.1, // Available to user[default:0.25]
              "lockStringstrength": "",
      0.1 // [default:0.25]
     "MWI": 0.54,       }
     "breakdown": {    },
          "epocwktdef2": 0.1,{
              "cardiorecommended": 0.1,
              "metabolic": 0.1,
 "You need to work on your abs", // Recommended and reason for this to be shown to user
            "strengthlocked": 0.1
 false, // Available to user
           } "lockString": "",
        }    "MWI": 0.54,
   },         "forAfterburnerbreakdown": {
 //  Afterburner clients listen here permanently for ChildAdded, ChildChanged and ChildRemoved  "epoc": 0.1,
       "wktdef1       "cardio": {0.1,
              "recommendedmetabolic": ""0.1,
// Not recommended, just visible   	        "lockedstrength": false, // Available to user0.1
      	      }
 "lockString": "",         }
   "MWI": 0.54,    },
        "breakdownforAfterburner": { // Afterburner clients listen here permanently for ChildAdded, ChildChanged and ChildRemoved
          "epocwktdef1": 0.1,{
              "cardiorecommended": 0.1"", // Not recommended, just visible
  	        "metaboliclocked": 0.1false, // Available to user
  	        "strengthlockString": 0.1"",
            }
 "MWI": 0.54,
        },           "wktdef2"breakdown": {
              "recommendedepoc": 0.1,
"You need to work on your abs", // Recommended and reason for this to be shown to user"cardio": 0.1,
              "lockedmetabolic": false0.1,
// Available to user             "lockStringstrength": "", 0.1
            }
       "MWI": 0.54,  },
          "breakdownwktdef2": {
 
            "epocrecommended": 0.1,
              "cardio": 0.1,
 "You need to work on your abs", // Recommended and reason for this to be shown to user
            "metaboliclocked": 0.1,
 false, // Available to user
            "strengthlockString": 0.1"",
            }
"MWI": 0.54,
         }   "breakdown": {
    }       }   "epoc":  },0.1,
      "routines": {       "user_id_01cardio": {0.1,
         "for7MW": { // 7MW clients listen here permanently for ChildAdded, ChildChanged and ChildRemoved"metabolic": 0.1,
              "routine_id_01strength": {0.1
            "locked": true, // Not available to user (unlocked via IAP and/or journey trigger) [default:false]
  }
          }
        }
      }
    },
    "lockStringroutines": "Finish{
6 more workouts before Thurs 9th June" // Displayed to user [default:null]
          }, "user_id_01": { 
        "for7MW": { // 7MW clients listen here permanently for ChildAdded, ChildChanged and ChildRemoved
          "routine_id_0201": {
            "locked": true, // Not available to user (unlocked via IAP and/or journey trigger) [default:false]
            "lockString": "" // No lock string, so only unlocked via IAPFinish 6 more workouts before Thurs 9th June" // Displayed to user [default:null]
          },
          "routine_id_0302": {
            "locked": falsetrue, // Available
            "lockString": "" // No lock string, so only unlocked via IAP [default:null]
 }         },
          "forAfterburnerroutine_id_03": {
// 7MW clients listen here permanently for       "locked": false, // Available
            "lockString": ""
          }
        },
        "forAfterburner": { // 7MW clients listen here permanently for ChildAdded, ChildChanged and ChildRemoved
          "routine_id_03": {
            "locked": false, // Available
            "lockString": ""
          }
        }
      }
    }
  },
  "workouts": {
    "activities": {
      "user_id_01": { // Clients listen here permanently for ChildAdded, ChildChanged and ChildRemoved
        "workout_id_01": { // Clients post new activity to here with auto id, server listens
          "workoutDefId": "wktdef1", // [no default]
          "finish": 987654345, // Unix timestamp (seconds) [default:0]
          "iterations": 1.5, // Number of times it was performed [default:1]
          "exertion": 0.5, // [default:0.5]
          "finalHeartRateBPM": 160, // [default:140]
          "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]
        }
      }
    },
    "results": {
      "user_id_01": { // Clients listen here permanently for ChildAdded, ChildChanged and ChildRemoved
        "workout_id_01": { // Server posts workout results here
          "workoutDefId": "wktdef1", // [no default]
          "finish": 987654345, // Unix timestamp (seconds) // [no default]
          "AWI": 0.1, // [default:0.5]
          "responseDuration": 3456, // [default: 0]
          "intensity": 0.9, // [default:0.5]
		  "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": {
        "date": 4567890987, // Unix timestamp (seconds) // [no default]
        "title": "Post title", // [no default]
        "read": false, // [default:true]
        "location": "post/location.html", // [no default]
		"icon": "default", // [default:"default"]
        "appMask": "7MW,AF", // [default: all apps]
      }  "promptRating": true // [default:false]
      }
    }
  },
  "definitions": {
    "routines": { // Clients listen here permanently for ChildAdded, ChildChanged and ChildRemoved
      "routine_id_01": {
        "title": "The Wonder Routine", // [no default]
        "image": "wonder-routine", // [default:"default-routine"]
        "desc": "Big long description", // [default:null]
        "appStoreId7MW": "routine01", // StoreKit product id [default:null]
        "in7MW": true, // For server use [default:false]
        "inAfterburner": false, // For server use [default:false]
        "lockedIn7MW": false, // For server use [default:false]
        "lockedInAfterburner": false, // For server use [default:false]
        "video": "", // [default:null]
        "workoutDefsminFitnessLevel": [4, // [no default:1]
        "workoutDefs": { {// [no default]
          "idwktdef1": "wktDef01", // [no default]{
            "lockedtype": false1, // For server use [default:false1]

         },   "title": "Aerobic", //      {[no default]
            "idimage": "wktDef02abs", // [default:"default"]
            "lockeddesc": false "Aerobic Basic Movement", // For[default:null]
server use           }
        ]
   "breakDuration": 5, // // [default:10]
  }     },     "exerciseDefsappStoreId7MW": {"workout01", // StoreKit Clientsproduct listen here permanently for ChildAdded, ChildChanged and ChildRemovedid [default:null]
            "exdef1locked": {false, // For server use     "behaviour[default:false]
			"MWI": 10.54, // [default:1]0.5]
            "titleexercises": "Cruches",[ // [no default]
              {
          "video      "id": "01-Crunches.mp4exdef1", // [no default]
                "imageduration": "abs",20 // [default:"no 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": "exdef2",
                "duration": 15
    "subtitle": "Target your abs for a balanced set of stomach muscles."},
 // [default:null]         "calPerSec": 5, // [default:0]   {
                "skillid": 0.2, // [default:0.5]"exdef3",
                "strengthduration": 0.7, // [default:0.5]10
          "cardio": 0.1, // [default:0.5]
 },
       "epoc": 0.4, // [default:0.5]    {
    "metabolic": 0.4, // [default:0.5]         "upperid": 0.5, // [default:0.5]"exdef4",
                "coreduration": 0.5,
// [default:0.5]         "lower": 0.5, // [default:0.5]
    },
    "needsHalfwaySwap": false // [default:false]       },{
      "exdef2": {         "behaviourid": 1,         "title": "Squats"exdef5",
        "video": "02-Squats.mp4",
        "imageduration": "abs",10
        "desc": "Squats are an excellent exercise for}
training the lower body and core muscles, if done regularly they help to],
define thighs and buttocks.",         "subtitleadaptiveStress": {
"Train your lower body and core.",         "calPerSecstrength": 40.2, // [default:1]
      "skill": 0.2,         "strengthcardio": 0.69,    // [default:1]
    "cardio": 0.3,         "epocmetabolic": 0.46, // [default:1]
      "metabolic": 0.6,         "upperepoc": 0.5,6   // [default:1]
     "core": 0.5,      },
  "lower": 0.5,         "needsHalfwaySwapmuscleStress": true
 {
    }     },     "workoutDefsupper": {10, // Clients[default:1]
listen here permanently for ChildAdded, ChildChanged and ChildRemoved       "wktdef1lower": {10, // [default:1]
              "typecore": 1,10 // [default:1]
        "title": "Aerobic", // [no default]}
        "image": "abs", // [default:"default"] }
        }
"desc": "Aerobic Basic Movement", // [default:null] }
    },
    "breakDurationexerciseDefs": 5,{ // // [default:10]
		"appStoreId7MW": "workout01", // StoreKit product id [default:null] Clients listen here permanently for ChildAdded, ChildChanged and ChildRemoved
      "exdef1": {
        "in7MWbehaviour": true1, // For server use [default:false1]
        "inAfterburnertitle": false"Cruches", // For server use [default:false[no default]
        "exercisesvideo": ["01-Crunches.mp4", // [no default]
          {
            "id"image": "exdef1abs", // [no default:"default"]
            "durationdesc": 20"A //crunch [nobegins default]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 "id": "exdef2",
            "duration": 15can 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]
 {             "id"calPerSec": "exdef3"5,   // [default:0]
         "durationskill": 10
 0.2, // [default:0.5]
         }"strength": 0.7, // [default:0.5]
        {
  "cardio": 0.1, // [default:0.5]
         "idepoc": "exdef4"0.4,    // [default:0.5]
        "durationmetabolic": 0.4, // [default:0.5]
          }"upper": 0.5, // [default:0.5]
        {
  "core": 0.5, // [default:0.5]
         "idlower": "exdef5"0.5,    // [default:0.5]
        "durationneedsHalfwaySwap": 10false    // [default:false]
      },
        ],"exdef2": {
        "adaptiveStressbehaviour": {
1,
         "strengthtitle": 0.2, // [default:1]
 "Squats",
        "cardiovideo": 0.9, // [default:1]
 "02-Squats.mp4",
        "metabolicimage": 0.6"abs",
// [default:1]             "epocdesc": 0.6 // [default:1]
        },
        "muscleStress": {
 "Squats are an excellent exercise for training the lower body and core muscles, if done regularly they help to define thighs and buttocks.",
         "uppersubtitle": "Train 10,your // [default:1]
 lower body and core.",
        "lowercalPerSec": 104,
// [default:1]       "skill": 0.2,
  "core": 10 // [default:1]   "strength": 0.6,
    }    "cardio": 0.3,
 },       "wktdef2epoc": {0.4,
        "typemetabolic": 10.6,
        "titleupper": "Thai Boxing"0.5,
        "imagecore": "abs"0.5,
        "desclower": "Boxing With Kicking"0.5,
        "breakDurationneedsHalfwaySwap": 4,
		"appStoreId7MW": "", // StoreKit product id
true
      }
    },
    "in7MWjourneyTriggers": false,{
// For server use
        "inAfterburnerforAfterburner": true, // For server use{
        "exercisestrigger01": [{
          {
"category": "achievement",
           "idtriggerType": "exdef5activeDaysInWeeks",
 
          "durationcondition1": 154, // 4 active days
      },    "condition2": 8, // every week for 8 {
 weeks
          "idactions": "exdef3",[
            {"duration": 10
 actionType":"postArticle","articleId":"article_id_01","data":"e.g. url parameters"},
            },{"actionType":"unlockWorkout","workoutDefId":"workoutDef_id_01","articleId":"article_id_02","data":""}
          ]
    {    },
        "idtrigger02": "exdef1",
{
           "durationcategory": 5"education",
          }
"triggerType": "totalActivities",
       ],   "condition1": 10, // 10 activities
 "stress": {
          "strengthcondition2": 0.2,, // Not used
          "cardioactions": 0.9, [
            "metabolic": 0.6,
{"actionType":"postArticle","articleId":"article_id_01","data":"e.g. url parameters"}
         "epoc": 0.6 ]
        },
      },
      "muscleStressfor7MW": {
          "uppertrigger01": 10,{
          "lowercategory": 10"achievement",
          "coretriggerType": 10"activeDaysInWeeks",
         } "condition1": 4, // 4 active days
}     },     "journeyTriggerscondition2": {8, // every week for 8 weeks
"forAfterburner": {         "trigger01actions": [
 {           "category{"actionType":"postArticle","articleId": "achievementarticle_id_01","data":"e.g. url parameters"},
        "triggerType": "activeDaysInWeeks",    {"actionType":"unlockWorkout","workoutDefId":"workoutDef_id_01","articleId":"article_id_02","data":""}
          ]
 "condition1": 4, // 4 active days  },
        "condition2trigger02": 8, // every week for 8 weeks {
          "category": "education",
          "actionstriggerType": [
 "totalActivities",
          {"actionTypecondition1":"postArticle","articleId":"article_id_01","data":"e.g. url parameters"}, 10, // 10 activities
          "condition2": 0, // Not used
          "actions": [
            {"actionType":"unlockWorkout","workoutDefId":"workoutDef_id_01postArticle","articleId":"article_id_0201","data":"e.g. url parameters"}
          ]
        },
      }
 "trigger02": {  }
    "timedNotifs": {
      "categoryforAfterburner": "education",
 {
        "triggerTypenotif01": "totalActivities",{
          "condition1deltaHours": 1024, // 10 activities Delta after APN token reg that the notif is delivered [no default]
          "condition2seqVersion": 0, // NotSequence usedversion to allow future updates without flooding existing users [default:0]
 "actions": [        "title": "Title of notification",  {"actionType"// [default:"postArticle","articleId":"article_id_01","data":"e.g. url parameters"}
          ]
      
 }       },       "for7MWbody": {
        "trigger01":Body {
          "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": {of notification" // [no default]
        },
 "category": "education",    },
      "triggerTypefor7MW": "totalActivities",
 {
        "condition1notif01": 10, // 10 activities{
          "condition2deltaHours": 024, // Not used
          "actionsseqVersion": [0, 
           {"actionTypetitle": "postArticle","articleId":"article_id_01","data":"e.g. url parameters"}Title of notification",
          "body": "Body of ]notification"
        },
      }
    }
  },
  "receipts": {
    "user_id_01": {
      "receipt_auto_id_01": {
        "receipt": "receipt_data", // Written by the client after an IAP purchase
        "validation": { // Written by the server after the receipt has been processed
          "validationDate": 3456789, // Timestamp [default:0]
          "isValid": true [default:false]
        }
      }
    }
  },
}

...