@livepreso/api 6.43.0 → 6.44.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -27,9 +27,9 @@ function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o =
27
27
 
28
28
  function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; }
29
29
 
30
- function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) { symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); } keys.push.apply(keys, symbols); } return keys; }
30
+ function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
31
31
 
32
- function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { (0, _defineProperty2.default)(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }
32
+ function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { (0, _defineProperty2.default)(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
33
33
 
34
34
  /**
35
35
  * @constructor
@@ -126,6 +126,9 @@ var ManifestJSONModel = _base.BaseModel.extend(
126
126
  return {
127
127
  appointment: {
128
128
  show_visible_default: false
129
+ },
130
+ fieldsets: {
131
+ enforce_required: false
129
132
  }
130
133
  };
131
134
  }
@@ -356,8 +359,13 @@ ManifestJSONModel.createFromProject = function (projectFile) {
356
359
 
357
360
  if (projectFile.app_settings) {
358
361
  manifest.app_settings = _objectSpread(_objectSpread({}, manifest.app_settings), projectFile.app_settings);
359
- }
362
+ } // For all new decks going forward, this should be set to true.
363
+ // This means we validate that a fieldset field has a value. Before
364
+ // this change, it was possible to save with a required field unfilled.
365
+ // This just keeps backwards compatability.
366
+
360
367
 
368
+ manifest.app_settings.fieldsets.enforce_required = true;
361
369
  return manifest;
362
370
  };
363
371
 
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/models/manifest-json.js"],"names":["ManifestJSONModel","BaseModel","extend","props","key","maintainer","common","feeds","hooks","fixtures","limits","ordering","tags","titles","templates","content_editors","persistentcontext","type","default","screenshotpreferences","vector","dimensions","width","height","pdfpreferences","quality_level","has_editable_share_support","point_in_time_share_policy","notify_salesperson_after_feeds_fetched","require_verification","companywide_editable","app_settings","appointment","show_visible_default","getAssetPath","split","sectionKey","slideKey","sectionKeyPath","url2","resolve","url","getTemplateAssetPath","parent","modelName","getPlainURL","prototype","call","createFromProject","projectFile","impostor","maxAdjunctSlides","sections","reduce","num","section","title","name","slides","newSection","concat","push","slide","template","index","adjunctslide","slideIndex","welcome","manifest","canBeEmpty"],"mappings":";;;;;;;;;;;;;;;AAAA;;AAEA;;AACA;;AACA;;;;;;;;;;;;AAEA;AACA;AACA;AACA;AACA;AACO,IAAMA,iBAAiB,GAAGC,gBAAUC,MAAV;AAChC;AAAwC;AACvC;AACF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACEC,EAAAA,KAAK,EAAE;AACNC,IAA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,0BAAhB,EAA4C;AAC3C0C,IAAAA,QAAQ,CAAC1C,0BAAT,GACCuB,WAAW,CAACvB,0BADb;AAEA;;AAED,MAAIuB,WAAW,CAACtB,0BAAhB,EAA4C;AAC3CyC,IAAAA,QAAQ,CAACzC,0BAAT,GACCsB,WAAW,CAACtB,0BADb;AAEA;;AAED,MAAIsB,WAAW,CAACrB,sCAAhB,EAAwD;AACvDwC,IAAAA,QAAQ,CAACxC,sCAAT,GACCqB,WAAW,CAACrB,sCADb;AAEA;;AAED,MAAIqB,WAAW,CAACpB,oBAAhB,EAAsC;AACrCuC,IAAAA,QAAQ,CAACvC,oBAAT,GAAgCoB,WAAW,CAACpB,oBAA5C;AACA;;AAED,MAAIoB,WAAW,CAAClB,YAAhB,EAA8B;AAC7BqC,IAAAA,QAAQ,CAACrC,YAAT,mCACIqC,QAAQ,CAACrC,YADb,GAEIkB,WAAW,CAAClB,YAFhB;AAIA;;AAED,SAAOqC,QAAP;AACA,CA5JD;;AA8JApE,iBAAiB,CAACqE,UAAlB,GAA+B,IAA/B;AAEA,6BAAS,mBAAT,EAA8BrE,iBAA9B","sourcesContent":["import \"./pack.js\";\n\nimport { BaseModel } from \"./base.js\";\nimport { register } from \"../state-register.js\";\nimport url2 from \"url\";\n\n/**\n * @constructor\n * @alias models.ManifestJSONModel\n * @extends models.BaseModel\n */\nexport const ManifestJSONModel = BaseModel.extend(\n\t/** @lends models.ManifestJSONModel# */ {\n\t\t/**\n\t\t * @property {string} key\n\t\t * @property {string} maintainer\n\t\t * @property {object} common\n\t\t * @property {object} feeds\n\t\t * @property {object} hooks\n\t\t * @property {object} limits\n\t\t * @property {object} ordering\n\t\t * @property {object} tags\n\t\t * @property {object} titles\n\t\t * @property {object} templates\n\t\t * @property {object} screenshotpreferences\n\t\t * @property {object} dimensions\n\t\t * @property {object} pdfpreferences\n\t\t * @property {boolean} has_editable_share_support\n\t\t * @property {boolean} notify_salesperson_after_feeds_fetched\n\t\t * @property {boolean} require_verification\n\t\t * @property {boolean} companywide_editable\n\t\t * @property {object} content_editors\n\t\t */\n\t\tprops: {\n\t\t\tkey: \"string\",\n\t\t\tmaintainer: \"string\",\n\t\t\tcommon: \"object\",\n\t\t\tfeeds: \"object\",\n\t\t\thooks: \"string\",\n\t\t\tfixtures: \"object\",\n\t\t\tlimits: \"object\",\n\t\t\tordering: \"object\",\n\t\t\ttags: \"object\",\n\t\t\ttitles: \"object\",\n\t\t\ttemplates: \"object\",\n\t\t\tcontent_editors: \"object\",\n\t\t\tpersistentcontext: {\n\t\t\t\ttype: \"boolean\",\n\t\t\t\tdefault: false,\n\t\t\t},\n\t\t\tscreenshotpreferences: {\n\t\t\t\ttype: \"object\",\n\t\t\t\tdefault: function () {\n\t\t\t\t\treturn {\n\t\t\t\t\t\tvector: false,\n\t\t\t\t\t};\n\t\t\t\t},\n\t\t\t},\n\t\t\tdimensions: {\n\t\t\t\ttype: \"object\",\n\t\t\t\tdefault: function () {\n\t\t\t\t\treturn {\n\t\t\t\t\t\twidth: 1024,\n\t\t\t\t\t\theight: 768,\n\t\t\t\t\t};\n\t\t\t\t},\n\t\t\t},\n\t\t\tpdfpreferences: {\n\t\t\t\ttype: \"object\",\n\t\t\t\tdefault: function () {\n\t\t\t\t\treturn {\n\t\t\t\t\t\tquality_level: \"prepress\",\n\t\t\t\t\t};\n\t\t\t\t},\n\t\t\t},\n\t\t\thas_editable_share_support: {\n\t\t\t\ttype: \"boolean\",\n\t\t\t\tdefault: false,\n\t\t\t},\n\t\t\tpoint_in_time_share_policy: {\n\t\t\t\ttype: \"string\",\n\t\t\t},\n\t\t\tnotify_salesperson_after_feeds_fetched: {\n\t\t\t\ttype: \"boolean\",\n\t\t\t\tdefault: false,\n\t\t\t},\n\t\t\trequire_verification: {\n\t\t\t\ttype: \"boolean\",\n\t\t\t\tdefault: false,\n\t\t\t},\n\t\t\tcompanywide_editable: {\n\t\t\t\ttype: \"boolean\",\n\t\t\t\tdefault: false,\n\t\t\t},\n\t\t\tapp_settings: {\n\t\t\t\ttype: \"object\",\n\t\t\t\tdefault: function () {\n\t\t\t\t\treturn {\n\t\t\t\t\t\tappointment: {\n\t\t\t\t\t\t\tshow_visible_default: false,\n\t\t\t\t\t\t},\n\t\t\t\t\t};\n\t\t\t\t},\n\t\t\t},\n\t\t},\n\n\t\t/**\n\t\t * Returns the path to a manifest asset, using its url as the base.\n\t\t * @param {?string} key\n\t\t * @returns {?string}\n\t\t */\n\t\tgetAssetPath(key = null) {\n\t\t\tif (key) {\n\t\t\t\tconst [sectionKey, slideKey = null] = key.split(\"/\");\n\t\t\t\tconst sectionKeyPath = url2.resolve(\n\t\t\t\t\tthis.url(),\n\t\t\t\t\t`sections/${sectionKey}/`\n\t\t\t\t);\n\t\t\t\tif (slideKey) {\n\t\t\t\t\treturn url2.resolve(sectionKeyPath, `slides/${slideKey}/`);\n\t\t\t\t}\n\t\t\t\treturn sectionKeyPath;\n\t\t\t}\n\n\t\t\treturn this.url();\n\t\t},\n\n\t\t/**\n\t\t Returns path to template assets, which are exceptional to regular slide assets\n\t\t * @param {?string} key\n\t\t * @returns {?string}\n\t\t */\n\t\tgetTemplateAssetPath(key) {\n\t\t\treturn url2.resolve(this.getAssetPath(), `templates/${key}/`);\n\t\t},\n\n\t\turl() {\n\t\t\tif (this.parent && this.parent.modelName === \"deckversions\") {\n\t\t\t\treturn `${this.parent.getPlainURL()}manifest/`;\n\t\t\t}\n\n\t\t\treturn BaseModel.prototype.url.call(this);\n\t\t},\n\t}\n);\n\n/**\n * Converts a project file into a manifest json object. This expected\n * the project.yaml file to have been already read into a javascript\n * object.\n */\nManifestJSONModel.createFromProject = function (projectFile) {\n\t// If the deck is an impostor deck, we have to update some things for\n\t// them to make sense in the impostor format\n\tif (projectFile.impostor) {\n\t\t// There is only one real section; all of the \"sections\" defined in the\n\t\t// project.yaml are actually slides, and slides can't have a maxAdjunctSlides\n\t\t// value. We get around this by totalling up all of the maxAdjunctSlides values\n\t\t// across the sections and give that number to the real section. Later e.g. in the\n\t\t// app, that number will be taken and divided by the number of impostor sections\n\t\t// to get the maxAdjunctSlides value for each impostor section\n\t\tconst maxAdjunctSlides = projectFile.sections.reduce((num, section) => {\n\t\t\treturn num + (section.maxAdjunctSlides || 0);\n\t\t}, 0);\n\n\t\t// Create a \"real\" section (that will never be seen by the user) and give\n\t\t// it all of the sections & slides. Impostor sections (which are technically\n\t\t// slides) are given the \"section-header\" tag to mark them as sections\n\t\tprojectFile.sections = [\n\t\t\t{\n\t\t\t\tmaxAdjunctSlides,\n\t\t\t\tkey: projectFile.key,\n\t\t\t\ttitle: projectFile.name,\n\t\t\t\tslides: projectFile.sections.reduce((sections, section) => {\n\t\t\t\t\tconst newSection = {\n\t\t\t\t\t\t...section,\n\t\t\t\t\t\tslides: [],\n\t\t\t\t\t};\n\t\t\t\t\tnewSection.tags = [\"section-header\"].concat(newSection.tags || []);\n\n\t\t\t\t\tsections.push(newSection, ...(section.slides || []));\n\t\t\t\t\treturn sections;\n\t\t\t\t}, []),\n\t\t\t},\n\t\t];\n\t}\n\n\tconst titles = projectFile.sections.reduce((titles, section) => {\n\t\ttitles[section.key] = section.title;\n\t\tfor (const slide of section.slides || []) {\n\t\t\ttitles[`${section.key}/${slide.key}`] = slide.title;\n\t\t}\n\t\treturn titles;\n\t}, {});\n\n\tconst templates = (projectFile.templates || []).reduce(\n\t\t(templates, template, index) => {\n\t\t\ttemplates[template.key] = {\n\t\t\t\ttitle: template.title,\n\t\t\t\tordering: index + 1,\n\t\t\t};\n\t\t\treturn templates;\n\t\t},\n\t\t{}\n\t);\n\n\tconst limits = {\n\t\tadjunctslide: projectFile.sections.reduce((limits, section) => {\n\t\t\tif (typeof section.maxAdjunctSlides === \"number\") {\n\t\t\t\tlimits[section.key] = section.maxAdjunctSlides;\n\t\t\t}\n\t\t\treturn limits;\n\t\t}, {}),\n\t};\n\n\tconst ordering = projectFile.sections.reduce((ordering, section, index) => {\n\t\tordering[section.key] = index + 1;\n\t\tlet slideIndex = 0;\n\t\tfor (const slide of section.slides || []) {\n\t\t\tslideIndex++;\n\t\t\tordering[`${section.key}/${slide.key}`] = slideIndex;\n\t\t}\n\t\treturn ordering;\n\t}, {});\n\n\tconst tags = projectFile.sections.reduce((tags, section) => {\n\t\ttags[section.key] = section.tags || [];\n\t\tfor (const slide of section.slides || []) {\n\t\t\ttags[`${section.key}/${slide.key}`] = slide.tags || [];\n\t\t}\n\t\treturn tags;\n\t}, {});\n\n\t// Add config for the Welcome slide here - it's namespaced in\n\t// the project.yaml under the \"welcome\" key\n\tif (projectFile.welcome) {\n\t\tif (projectFile.welcome.tags) {\n\t\t\t// It's convention to use an empty string for the\n\t\t\t// Welcome slide's key\n\t\t\ttags[\"\"] = projectFile.welcome.tags || [];\n\t\t}\n\t}\n\n\tconst manifest = new ManifestJSONModel({\n\t\tcommon: projectFile.common,\n\t\tfeeds: projectFile.feeds,\n\t\thooks: projectFile.hooks,\n\t\tfixtures: projectFile.fixtures,\n\t\ttitles,\n\t\ttemplates,\n\t\tordering,\n\t\tlimits,\n\t\ttags,\n\t\tkey: projectFile.key,\n\t});\n\n\tif (projectFile.content_editors) {\n\t\tmanifest.content_editors = projectFile.content_editors;\n\t}\n\n\tif (projectFile.screenshotpreferences) {\n\t\tmanifest.screenshotpreferences = projectFile.screenshotpreferences;\n\t}\n\n\tif (projectFile.pdfpreferences) {\n\t\tmanifest.pdfpreferences = projectFile.pdfpreferences;\n\t}\n\n\tif (projectFile.persistentcontext) {\n\t\tmanifest.persistentcontext = projectFile.persistentcontext;\n\t}\n\n\tif (projectFile.maintainer) {\n\t\tmanifest.maintainer = projectFile.maintainer;\n\t}\n\n\tif (projectFile.dimensions) {\n\t\tmanifest.dimensions = projectFile.dimensions;\n\t}\n\n\tif (projectFile.has_editable_share_support) {\n\t\tmanifest.has_editable_share_support =\n\t\t\tprojectFile.has_editable_share_support;\n\t}\n\n\tif (projectFile.point_in_time_share_policy) {\n\t\tmanifest.point_in_time_share_policy =\n\t\t\tprojectFile.point_in_time_share_policy;\n\t}\n\n\tif (projectFile.notify_salesperson_after_feeds_fetched) {\n\t\tmanifest.notify_salesperson_after_feeds_fetched =\n\t\t\tprojectFile.notify_salesperson_after_feeds_fetched;\n\t}\n\n\tif (projectFile.require_verification) {\n\t\tmanifest.require_verification = projectFile.require_verification;\n\t}\n\n\tif (projectFile.app_settings) {\n\t\tmanifest.app_settings = {\n\t\t\t...manifest.app_settings,\n\t\t\t...projectFile.app_settings,\n\t\t};\n\t}\n\n\treturn manifest;\n};\n\nManifestJSONModel.canBeEmpty = true;\n\nregister(\"ManifestJSONModel\", ManifestJSONModel);\n"],"file":"manifest-json.js"}
1
+ {"version":3,"sources":["../../src/models/manifest-json.js"],"names":["ManifestJSONModel","BaseModel","extend","props","key","maintainer","common","feeds","hooks","fixtures","limits","ordering","tags","titles","templates","content_editors","persistentcontext","type","default","screenshotpreferences","vector","dimensions","width","height","pdfpreferences","quality_level","has_editable_share_support","point_in_time_share_policy","notify_salesperson_after_feeds_fetched","require_verification","companywide_editable","app_settings","appointment","show_visible_default","fieldsets","enforce_required","getAssetPath","split","sectionKey","slideKey","sectionKeyPath","url2","resolve","url","getTemplateAssetPath","parent","modelName","getPlainURL","prototype","call","createFromProject","projectFile","impostor","maxAdjunctSlides","sections","reduce","num","section","title","name","slides","newSection","concat","push","slide","template","index","adjunctslide","slideIndex","welcome","manifest","canBeEmpty"],"mappings":";;;;;;;;;;;;;;;AAAA;;AAEA;;AACA;;AACA;;;;;;;;;;;;AAEA;AACA;AACA;AACA;AACA;AACO,IAAMA,iBAAiB,GAAGC,gBAAUC,MAAV;AAChC;AAAwC;AACvC;AACF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACEC,EAAAA,KAAK,EAAE;AACNC,IAAAA,GAAG,EAAE,QADC;AAENC,IAAAA,UAAU,EAAE,QAFN;AAGNC,IAAAA,MAAM,EAAE,QAHF;AAINC,IAAAA,KAAK,EAAE,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0BAAT,GACCyB,WAAW,CAACzB,0BADb;AAEA;;AAED,MAAIyB,WAAW,CAACxB,0BAAhB,EAA4C;AAC3C2C,IAAAA,QAAQ,CAAC3C,0BAAT,GACCwB,WAAW,CAACxB,0BADb;AAEA;;AAED,MAAIwB,WAAW,CAACvB,sCAAhB,EAAwD;AACvD0C,IAAAA,QAAQ,CAAC1C,sCAAT,GACCuB,WAAW,CAACvB,sCADb;AAEA;;AAED,MAAIuB,WAAW,CAACtB,oBAAhB,EAAsC;AACrCyC,IAAAA,QAAQ,CAACzC,oBAAT,GAAgCsB,WAAW,CAACtB,oBAA5C;AACA;;AAED,MAAIsB,WAAW,CAACpB,YAAhB,EAA8B;AAC7BuC,IAAAA,QAAQ,CAACvC,YAAT,mCACIuC,QAAQ,CAACvC,YADb,GAEIoB,WAAW,CAACpB,YAFhB;AAIA,GAzJ2D,CA2J5D;AACA;AACA;AACA;;;AACAuC,EAAAA,QAAQ,CAACvC,YAAT,CAAsBG,SAAtB,CAAgCC,gBAAhC,GAAmD,IAAnD;AAEA,SAAOmC,QAAP;AACA,CAlKD;;AAoKAtE,iBAAiB,CAACuE,UAAlB,GAA+B,IAA/B;AAEA,6BAAS,mBAAT,EAA8BvE,iBAA9B","sourcesContent":["import \"./pack.js\";\n\nimport { BaseModel } from \"./base.js\";\nimport { register } from \"../state-register.js\";\nimport url2 from \"url\";\n\n/**\n * @constructor\n * @alias models.ManifestJSONModel\n * @extends models.BaseModel\n */\nexport const ManifestJSONModel = BaseModel.extend(\n\t/** @lends models.ManifestJSONModel# */ {\n\t\t/**\n\t\t * @property {string} key\n\t\t * @property {string} maintainer\n\t\t * @property {object} common\n\t\t * @property {object} feeds\n\t\t * @property {object} hooks\n\t\t * @property {object} limits\n\t\t * @property {object} ordering\n\t\t * @property {object} tags\n\t\t * @property {object} titles\n\t\t * @property {object} templates\n\t\t * @property {object} screenshotpreferences\n\t\t * @property {object} dimensions\n\t\t * @property {object} pdfpreferences\n\t\t * @property {boolean} has_editable_share_support\n\t\t * @property {boolean} notify_salesperson_after_feeds_fetched\n\t\t * @property {boolean} require_verification\n\t\t * @property {boolean} companywide_editable\n\t\t * @property {object} content_editors\n\t\t */\n\t\tprops: {\n\t\t\tkey: \"string\",\n\t\t\tmaintainer: \"string\",\n\t\t\tcommon: \"object\",\n\t\t\tfeeds: \"object\",\n\t\t\thooks: \"string\",\n\t\t\tfixtures: \"object\",\n\t\t\tlimits: \"object\",\n\t\t\tordering: \"object\",\n\t\t\ttags: \"object\",\n\t\t\ttitles: \"object\",\n\t\t\ttemplates: \"object\",\n\t\t\tcontent_editors: \"object\",\n\t\t\tpersistentcontext: {\n\t\t\t\ttype: \"boolean\",\n\t\t\t\tdefault: false,\n\t\t\t},\n\t\t\tscreenshotpreferences: {\n\t\t\t\ttype: \"object\",\n\t\t\t\tdefault: function () {\n\t\t\t\t\treturn {\n\t\t\t\t\t\tvector: false,\n\t\t\t\t\t};\n\t\t\t\t},\n\t\t\t},\n\t\t\tdimensions: {\n\t\t\t\ttype: \"object\",\n\t\t\t\tdefault: function () {\n\t\t\t\t\treturn {\n\t\t\t\t\t\twidth: 1024,\n\t\t\t\t\t\theight: 768,\n\t\t\t\t\t};\n\t\t\t\t},\n\t\t\t},\n\t\t\tpdfpreferences: {\n\t\t\t\ttype: \"object\",\n\t\t\t\tdefault: function () {\n\t\t\t\t\treturn {\n\t\t\t\t\t\tquality_level: \"prepress\",\n\t\t\t\t\t};\n\t\t\t\t},\n\t\t\t},\n\t\t\thas_editable_share_support: {\n\t\t\t\ttype: \"boolean\",\n\t\t\t\tdefault: false,\n\t\t\t},\n\t\t\tpoint_in_time_share_policy: {\n\t\t\t\ttype: \"string\",\n\t\t\t},\n\t\t\tnotify_salesperson_after_feeds_fetched: {\n\t\t\t\ttype: \"boolean\",\n\t\t\t\tdefault: false,\n\t\t\t},\n\t\t\trequire_verification: {\n\t\t\t\ttype: \"boolean\",\n\t\t\t\tdefault: false,\n\t\t\t},\n\t\t\tcompanywide_editable: {\n\t\t\t\ttype: \"boolean\",\n\t\t\t\tdefault: false,\n\t\t\t},\n\t\t\tapp_settings: {\n\t\t\t\ttype: \"object\",\n\t\t\t\tdefault: function () {\n\t\t\t\t\treturn {\n\t\t\t\t\t\tappointment: {\n\t\t\t\t\t\t\tshow_visible_default: false,\n\t\t\t\t\t\t},\n\t\t\t\t\t\tfieldsets: {\n\t\t\t\t\t\t\tenforce_required: false,\n\t\t\t\t\t\t},\n\t\t\t\t\t};\n\t\t\t\t},\n\t\t\t},\n\t\t},\n\n\t\t/**\n\t\t * Returns the path to a manifest asset, using its url as the base.\n\t\t * @param {?string} key\n\t\t * @returns {?string}\n\t\t */\n\t\tgetAssetPath(key = null) {\n\t\t\tif (key) {\n\t\t\t\tconst [sectionKey, slideKey = null] = key.split(\"/\");\n\t\t\t\tconst sectionKeyPath = url2.resolve(\n\t\t\t\t\tthis.url(),\n\t\t\t\t\t`sections/${sectionKey}/`\n\t\t\t\t);\n\t\t\t\tif (slideKey) {\n\t\t\t\t\treturn url2.resolve(sectionKeyPath, `slides/${slideKey}/`);\n\t\t\t\t}\n\t\t\t\treturn sectionKeyPath;\n\t\t\t}\n\n\t\t\treturn this.url();\n\t\t},\n\n\t\t/**\n\t\t Returns path to template assets, which are exceptional to regular slide assets\n\t\t * @param {?string} key\n\t\t * @returns {?string}\n\t\t */\n\t\tgetTemplateAssetPath(key) {\n\t\t\treturn url2.resolve(this.getAssetPath(), `templates/${key}/`);\n\t\t},\n\n\t\turl() {\n\t\t\tif (this.parent && this.parent.modelName === \"deckversions\") {\n\t\t\t\treturn `${this.parent.getPlainURL()}manifest/`;\n\t\t\t}\n\n\t\t\treturn BaseModel.prototype.url.call(this);\n\t\t},\n\t}\n);\n\n/**\n * Converts a project file into a manifest json object. This expected\n * the project.yaml file to have been already read into a javascript\n * object.\n */\nManifestJSONModel.createFromProject = function (projectFile) {\n\t// If the deck is an impostor deck, we have to update some things for\n\t// them to make sense in the impostor format\n\tif (projectFile.impostor) {\n\t\t// There is only one real section; all of the \"sections\" defined in the\n\t\t// project.yaml are actually slides, and slides can't have a maxAdjunctSlides\n\t\t// value. We get around this by totalling up all of the maxAdjunctSlides values\n\t\t// across the sections and give that number to the real section. Later e.g. in the\n\t\t// app, that number will be taken and divided by the number of impostor sections\n\t\t// to get the maxAdjunctSlides value for each impostor section\n\t\tconst maxAdjunctSlides = projectFile.sections.reduce((num, section) => {\n\t\t\treturn num + (section.maxAdjunctSlides || 0);\n\t\t}, 0);\n\n\t\t// Create a \"real\" section (that will never be seen by the user) and give\n\t\t// it all of the sections & slides. Impostor sections (which are technically\n\t\t// slides) are given the \"section-header\" tag to mark them as sections\n\t\tprojectFile.sections = [\n\t\t\t{\n\t\t\t\tmaxAdjunctSlides,\n\t\t\t\tkey: projectFile.key,\n\t\t\t\ttitle: projectFile.name,\n\t\t\t\tslides: projectFile.sections.reduce((sections, section) => {\n\t\t\t\t\tconst newSection = {\n\t\t\t\t\t\t...section,\n\t\t\t\t\t\tslides: [],\n\t\t\t\t\t};\n\t\t\t\t\tnewSection.tags = [\"section-header\"].concat(newSection.tags || []);\n\n\t\t\t\t\tsections.push(newSection, ...(section.slides || []));\n\t\t\t\t\treturn sections;\n\t\t\t\t}, []),\n\t\t\t},\n\t\t];\n\t}\n\n\tconst titles = projectFile.sections.reduce((titles, section) => {\n\t\ttitles[section.key] = section.title;\n\t\tfor (const slide of section.slides || []) {\n\t\t\ttitles[`${section.key}/${slide.key}`] = slide.title;\n\t\t}\n\t\treturn titles;\n\t}, {});\n\n\tconst templates = (projectFile.templates || []).reduce(\n\t\t(templates, template, index) => {\n\t\t\ttemplates[template.key] = {\n\t\t\t\ttitle: template.title,\n\t\t\t\tordering: index + 1,\n\t\t\t};\n\t\t\treturn templates;\n\t\t},\n\t\t{}\n\t);\n\n\tconst limits = {\n\t\tadjunctslide: projectFile.sections.reduce((limits, section) => {\n\t\t\tif (typeof section.maxAdjunctSlides === \"number\") {\n\t\t\t\tlimits[section.key] = section.maxAdjunctSlides;\n\t\t\t}\n\t\t\treturn limits;\n\t\t}, {}),\n\t};\n\n\tconst ordering = projectFile.sections.reduce((ordering, section, index) => {\n\t\tordering[section.key] = index + 1;\n\t\tlet slideIndex = 0;\n\t\tfor (const slide of section.slides || []) {\n\t\t\tslideIndex++;\n\t\t\tordering[`${section.key}/${slide.key}`] = slideIndex;\n\t\t}\n\t\treturn ordering;\n\t}, {});\n\n\tconst tags = projectFile.sections.reduce((tags, section) => {\n\t\ttags[section.key] = section.tags || [];\n\t\tfor (const slide of section.slides || []) {\n\t\t\ttags[`${section.key}/${slide.key}`] = slide.tags || [];\n\t\t}\n\t\treturn tags;\n\t}, {});\n\n\t// Add config for the Welcome slide here - it's namespaced in\n\t// the project.yaml under the \"welcome\" key\n\tif (projectFile.welcome) {\n\t\tif (projectFile.welcome.tags) {\n\t\t\t// It's convention to use an empty string for the\n\t\t\t// Welcome slide's key\n\t\t\ttags[\"\"] = projectFile.welcome.tags || [];\n\t\t}\n\t}\n\n\tconst manifest = new ManifestJSONModel({\n\t\tcommon: projectFile.common,\n\t\tfeeds: projectFile.feeds,\n\t\thooks: projectFile.hooks,\n\t\tfixtures: projectFile.fixtures,\n\t\ttitles,\n\t\ttemplates,\n\t\tordering,\n\t\tlimits,\n\t\ttags,\n\t\tkey: projectFile.key,\n\t});\n\n\tif (projectFile.content_editors) {\n\t\tmanifest.content_editors = projectFile.content_editors;\n\t}\n\n\tif (projectFile.screenshotpreferences) {\n\t\tmanifest.screenshotpreferences = projectFile.screenshotpreferences;\n\t}\n\n\tif (projectFile.pdfpreferences) {\n\t\tmanifest.pdfpreferences = projectFile.pdfpreferences;\n\t}\n\n\tif (projectFile.persistentcontext) {\n\t\tmanifest.persistentcontext = projectFile.persistentcontext;\n\t}\n\n\tif (projectFile.maintainer) {\n\t\tmanifest.maintainer = projectFile.maintainer;\n\t}\n\n\tif (projectFile.dimensions) {\n\t\tmanifest.dimensions = projectFile.dimensions;\n\t}\n\n\tif (projectFile.has_editable_share_support) {\n\t\tmanifest.has_editable_share_support =\n\t\t\tprojectFile.has_editable_share_support;\n\t}\n\n\tif (projectFile.point_in_time_share_policy) {\n\t\tmanifest.point_in_time_share_policy =\n\t\t\tprojectFile.point_in_time_share_policy;\n\t}\n\n\tif (projectFile.notify_salesperson_after_feeds_fetched) {\n\t\tmanifest.notify_salesperson_after_feeds_fetched =\n\t\t\tprojectFile.notify_salesperson_after_feeds_fetched;\n\t}\n\n\tif (projectFile.require_verification) {\n\t\tmanifest.require_verification = projectFile.require_verification;\n\t}\n\n\tif (projectFile.app_settings) {\n\t\tmanifest.app_settings = {\n\t\t\t...manifest.app_settings,\n\t\t\t...projectFile.app_settings,\n\t\t};\n\t}\n\n\t// For all new decks going forward, this should be set to true.\n\t// This means we validate that a fieldset field has a value. Before\n\t// this change, it was possible to save with a required field unfilled.\n\t// This just keeps backwards compatability.\n\tmanifest.app_settings.fieldsets.enforce_required = true;\n\n\treturn manifest;\n};\n\nManifestJSONModel.canBeEmpty = true;\n\nregister(\"ManifestJSONModel\", ManifestJSONModel);\n"],"file":"manifest-json.js"}
@@ -29,9 +29,9 @@ var _presentationDeck = require("./presentation-deck.js");
29
29
 
30
30
  var _stateRegister = require("../state-register.js");
31
31
 
32
- function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) { symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); } keys.push.apply(keys, symbols); } return keys; }
32
+ function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
33
33
 
34
- function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { (0, _defineProperty2.default)(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }
34
+ function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { (0, _defineProperty2.default)(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
35
35
 
36
36
  /**
37
37
  * @constructor
@@ -39,9 +39,9 @@ function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "functio
39
39
 
40
40
  function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
41
41
 
42
- function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) { symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); } keys.push.apply(keys, symbols); } return keys; }
42
+ function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
43
43
 
44
- function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { (0, _defineProperty2.default)(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }
44
+ function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { (0, _defineProperty2.default)(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
45
45
 
46
46
  /**
47
47
  * @constructor
@@ -25,9 +25,9 @@ var _stateRegister = require("../state-register.js");
25
25
 
26
26
  var _url = _interopRequireDefault(require("url"));
27
27
 
28
- function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) { symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); } keys.push.apply(keys, symbols); } return keys; }
28
+ function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
29
29
 
30
- function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { (0, _defineProperty2.default)(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }
30
+ function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { (0, _defineProperty2.default)(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
31
31
 
32
32
  /**
33
33
  * @constructor
@@ -35,9 +35,9 @@ function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "functio
35
35
 
36
36
  function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
37
37
 
38
- function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) { symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); } keys.push.apply(keys, symbols); } return keys; }
38
+ function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
39
39
 
40
- function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { (0, _defineProperty2.default)(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }
40
+ function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { (0, _defineProperty2.default)(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
41
41
 
42
42
  /**
43
43
  * @constructor
@@ -7,47 +7,5 @@
7
7
  */
8
8
  // "extends": "my-rig/profiles/default/config/rush-project.json",
9
9
 
10
- /**
11
- * Specify the folders where your toolchain writes its output files. If enabled, the Rush build cache will
12
- * restore these folders from the cache.
13
- *
14
- * The strings are folder names under the project root folder. These folders should not be tracked by Git.
15
- * They must not contain symlinks.
16
- */
17
- "projectOutputFolderNames": [],
18
-
19
- /**
20
- * Configuration for the build cache feature.
21
- */
22
- "buildCacheOptions": {
23
- /**
24
- * Selectively disables the build cache for this project. The project will never be restored from cache.
25
- *
26
- * This is a useful workaround if that project's build scripts violate the assumptions of the cache,
27
- * for example by writing files outside the project folder. Where possible, a better solution is to improve
28
- * the build scripts to be compatible with caching.
29
- */
30
- // "disableBuildCache": true,
31
-
32
- /**
33
- * Allows for fine-grained control of cache for individual Rush commands.
34
- */
35
- "optionsForCommands": [
36
- // {
37
- // /**
38
- // * The Rush command name, as defined in custom-commands.json
39
- // */
40
- // "name": "my-command",
41
- //
42
- // /**
43
- // * Selectively disables the build cache for this project. The project will never be restored from cache.
44
- // *
45
- // * This is a useful workaround if that project's build scripts violate the assumptions of the cache,
46
- // * for example by writing files outside the project folder. Where possible, a better solution is to improve
47
- // * the build scripts to be compatible with caching.
48
- // */
49
- // "disableBuildCache": true
50
- // }
51
- ]
52
- }
10
+ "operationSettings": []
53
11
  }
package/package.json CHANGED
@@ -1,6 +1,7 @@
1
1
  {
2
2
  "name": "@livepreso/api",
3
- "version": "6.43.0",
3
+ "license": "UNLICENSED",
4
+ "version": "6.44.0",
4
5
  "description": "Everything to do with talking to the SalePreso API",
5
6
  "main": "index.js",
6
7
  "module": "esm/index.js",
@@ -43,7 +44,7 @@
43
44
  "esdoc": "^1.1.0",
44
45
  "esdoc-standard-plugin": "^1.0.0",
45
46
  "git-hooks": "^1.0.2",
46
- "jest": "24.8.0",
47
+ "jest": "~27.4.7",
47
48
  "jsdom-global": "^2.1.1",
48
49
  "npm-run-all": "^4.1.5",
49
50
  "sinon": "^2.1.0",
@@ -57,9 +58,10 @@
57
58
  },
58
59
  "scripts": {
59
60
  "test:debug": "node --inspect node_modules/.bin/jest --watch --runInBand",
60
- "test": "node_modules/.bin/jest --coverage",
61
+ "test": "jest --silent 2>&1",
61
62
  "build:cjs": "BABEL_ENV=cjs babel --delete-dir-on-start src/ --out-dir=cjs/ -s",
62
63
  "build": "run-p build:*",
63
64
  "prepublish": "npm run build"
64
- }
65
+ },
66
+ "readme": "# API\n\nThe single point of entry for interacting with the SalesPreso API. Contains functionality for contacting and authorizing\nwi the API endpoint, as well as middleware, models and collections for sending and retrieving data.\n\n## Install\n\n```bash\nnpm install sp-api\n```\n\nor\n\n```bash\nyarn add sp-api\n```\n\n## Examples\n\n```javascript\nimport {Auth, Api} from \"sp-api\";\nimport {registerMiddleware} from \"sp-api/middleware\";\nimport AuthMiddleware from \"sp-api/middlewares/auth\";\nimport RedirectMiddleware from \"sp-api/middlewares/redirect\";\n\nconst middlewares = [\n new AuthMiddleware(),\n new RedirectMiddleware(),\n new JSONMiddleware()\n];\n\nmiddlewares.map(registerMiddleware);\n\nApi.initialize(\"http://localhost:8000/api/\")\n .then(() => {\n return Auth.login(\"yourlogin\", \"yourpassword\");\n });\n```\n\n## Documentation\n\nhttp://developers.salespreso.com/modules/sp-api/\n"
65
67
  }
@@ -8,6 +8,10 @@ import qs from "qs";
8
8
  import { registeredStates } from "../state-register.js";
9
9
  import { sync } from "../sync.js";
10
10
 
11
+ // Current hardcoded limit for maximum number of pages fetched
12
+ // automatically by fetchAll
13
+ const pageLimit = 20;
14
+
11
15
  /**
12
16
  * @constructor
13
17
  * @alias collections.BaseCollection
@@ -220,6 +224,73 @@ export const BaseCollection = Collection.extend(
220
224
  });
221
225
  },
222
226
 
227
+ fetchAll(opts = {}) {
228
+ const options = _.cloneDeep(opts);
229
+
230
+ // Add default params to the fetch (ie ?per_page=1000)
231
+ options.data = _.extend({}, this.queryData, options.data || {});
232
+ this._options = _.extend({}, this._options, options);
233
+
234
+ this.queryData = { ...this._options.data };
235
+
236
+ if (this._options.url) {
237
+ this._url = options.url;
238
+ }
239
+
240
+ const checkPages = (response) => {
241
+ const notLastPage = response.total_pages > response.page;
242
+ const belowPageLimit = response.page < pageLimit;
243
+
244
+ if (notLastPage && belowPageLimit) {
245
+ const options = {
246
+ ...this._options,
247
+ data: {
248
+ ...this._options.data,
249
+ page: response.page + 1,
250
+ },
251
+ };
252
+
253
+ // Update the collection with the new data & page number
254
+ this._options = options;
255
+ this.queryData = { ...options.data };
256
+
257
+ return this.fetchPage().then((response) => {
258
+ checkPages(response);
259
+ });
260
+ } else {
261
+ // The collection's models are replaced with the latest
262
+ // batch of models every time a new page is fetched.
263
+ // Here we add back all of the previously-fetched models.
264
+ this.add(this._data.results);
265
+ return this._data;
266
+ }
267
+ };
268
+
269
+ return this.fetchPage().then((response) => {
270
+ return checkPages(response);
271
+ });
272
+ },
273
+
274
+ fetchPage() {
275
+ return Collection.prototype.fetch
276
+ .call(this, this._options)
277
+ .then((response) => {
278
+ // Add the response data to this._data - if we're fetching
279
+ // multiple pages, this._data.results will contain all of the
280
+ // results fetched from all pages so far
281
+ if (this._data.results?.length) {
282
+ this._data = {
283
+ ...response,
284
+ results: [...this._data.results, ...response.results],
285
+ };
286
+ } else {
287
+ this._data = response;
288
+ }
289
+
290
+ return response;
291
+ });
292
+ },
293
+
223
294
  toServer() {
224
295
  return this.map(function (model) {
225
296
  if (model.toServer) {
@@ -1,7 +1,9 @@
1
1
  import { BaseCollection } from "./base.js";
2
2
  import { BaseModel } from "../models/base.js";
3
+ import AmpersandCollection from "ampersand-rest-collection";
3
4
  import { G } from "sp-test/api";
4
5
  import td from "testdouble";
6
+ import Promise from "bluebird";
5
7
 
6
8
  it("should parse an array of urls into models", () => {
7
9
  G(BaseModel, "TestModel").extend({ modelName: "tests" });
@@ -119,3 +121,94 @@ it("should be empty on initialize", () => {
119
121
  const collection = new Collection();
120
122
  expect(collection.length).toEqual(0);
121
123
  });
124
+
125
+ const mockFetchResults = (dataFn) => {
126
+ jest
127
+ .spyOn(AmpersandCollection.prototype, "fetch")
128
+ .mockImplementation((opts) => {
129
+ const fetchResults = dataFn(opts);
130
+ return Promise.resolve(fetchResults);
131
+ });
132
+ };
133
+
134
+ describe("fetchAll", () => {
135
+ it("calls Collection.prototype.fetch", async () => {
136
+ mockFetchResults(() => {
137
+ return {
138
+ results: [{ id: 20 }, { id: 21 }, { id: 22 }],
139
+ };
140
+ });
141
+
142
+ G(BaseModel, "TestModel");
143
+ const Collection = G(BaseCollection.extend({ model: "TestModel" }));
144
+ const baseCollection = new Collection();
145
+
146
+ await baseCollection.fetchAll();
147
+
148
+ expect(baseCollection.length).toEqual(3);
149
+ expect(baseCollection.first().id).toEqual(20);
150
+ });
151
+
152
+ it("adds results to existing results", async () => {
153
+ mockFetchResults(() => {
154
+ return {
155
+ results: [{ id: 22 }],
156
+ };
157
+ });
158
+
159
+ G(BaseModel, "TestModel");
160
+ const Collection = G(BaseCollection.extend({ model: "TestModel" }));
161
+ const baseCollection = new Collection([{ id: 15 }]);
162
+
163
+ await baseCollection.fetchAll();
164
+
165
+ expect(baseCollection.length).toEqual(2);
166
+ // The models are sorted by ID
167
+ expect(baseCollection.first().id).toEqual(15);
168
+ expect(baseCollection.last().id).toEqual(22);
169
+ });
170
+
171
+ it("fetches multiple pages", async () => {
172
+ mockFetchResults((opts) => {
173
+ const page = opts.data.page || 1;
174
+ const fetchResults = {
175
+ total_pages: 5,
176
+ page,
177
+ results: [{ id: page + 10 }],
178
+ };
179
+ return Promise.resolve(fetchResults);
180
+ });
181
+
182
+ G(BaseModel, "TestModel");
183
+ const Collection = G(BaseCollection.extend({ model: "TestModel" }));
184
+ const baseCollection = new Collection();
185
+
186
+ await baseCollection.fetchAll();
187
+
188
+ expect(baseCollection.length).toEqual(5);
189
+ expect(baseCollection.first().id).toEqual(11);
190
+ expect(baseCollection.last().id).toEqual(15);
191
+ });
192
+
193
+ it("stops fetching pages at the hardcoded limit", async () => {
194
+ mockFetchResults((opts) => {
195
+ const page = opts.data.page || 1;
196
+ const fetchResults = {
197
+ total_pages: 50,
198
+ page,
199
+ results: [{ id: page + 10 }],
200
+ };
201
+ return Promise.resolve(fetchResults);
202
+ });
203
+
204
+ G(BaseModel, "TestModel");
205
+ const Collection = G(BaseCollection.extend({ model: "TestModel" }));
206
+ const baseCollection = new Collection();
207
+
208
+ await baseCollection.fetchAll();
209
+
210
+ expect(baseCollection.length).toEqual(20);
211
+ expect(baseCollection.first().id).toEqual(11);
212
+ expect(baseCollection.last().id).toEqual(30);
213
+ });
214
+ });
@@ -99,6 +99,9 @@ export const ManifestJSONModel = BaseModel.extend(
99
99
  appointment: {
100
100
  show_visible_default: false,
101
101
  },
102
+ fieldsets: {
103
+ enforce_required: false,
104
+ },
102
105
  };
103
106
  },
104
107
  },
@@ -304,6 +307,12 @@ ManifestJSONModel.createFromProject = function (projectFile) {
304
307
  };
305
308
  }
306
309
 
310
+ // For all new decks going forward, this should be set to true.
311
+ // This means we validate that a fieldset field has a value. Before
312
+ // this change, it was possible to save with a required field unfilled.
313
+ // This just keeps backwards compatability.
314
+ manifest.app_settings.fieldsets.enforce_required = true;
315
+
307
316
  return manifest;
308
317
  };
309
318