@livepreso/api 6.56.1 → 6.57.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.
@@ -1,5 +1,5 @@
1
1
  {
2
- "../../modules/api": "../../modules/api:QCKx6mu7S2WAYkH/LaftiMjtJvhlCtsAyuUHrdCXcQU=:",
2
+ "../../modules/api": "../../modules/api:BGgSHEgVMf10zu5gnBxRd8yMDd7Q3IitE/hUKrRpVqE=:",
3
3
  "@ampproject/remapping@2.3.0": "@ampproject/remapping@2.3.0:fDrdEVa91H1slIIy+b6+RH7zDaAIggs9ureFD7ljWCo=:",
4
4
  "@babel/cli@7.16.8(@babel/core@7.26.10)": "@babel/cli@7.16.8(@babel/core@7.26.10):edZg89FbeTzcBV5vqdZuKt2ir3wSVWfqh3ZG0Y4za84=:",
5
5
  "@babel/code-frame@7.29.0": "@babel/code-frame@7.29.0:kW1E61/G1tPYp8ZHZtSkSne0DKMWSVn35WiB3NdzlCw=:",
@@ -159,6 +159,8 @@
159
159
  "@jridgewell/sourcemap-codec@1.5.5": "@jridgewell/sourcemap-codec@1.5.5:71Yfrvd19gj93le3Y66XSyWfLjmtBnTpGbSvRdc5Y5w=:",
160
160
  "@jridgewell/trace-mapping@0.3.31": "@jridgewell/trace-mapping@0.3.31:YTSyGZQWP8FtkvRTnvBHkXWJD8rNKJaV3BqqrQIeZps=:",
161
161
  "@nicolo-ribaudo/chokidar-2@2.1.8-no-fsevents.3": "@nicolo-ribaudo/chokidar-2@2.1.8-no-fsevents.3:Ko0ekEEB/DoyZOHpIWVbQp1EIAXCJTRaW1Cvnz4DqiI=:",
162
+ "@noble/hashes@1.8.0": "@noble/hashes@1.8.0:fun4ZZqakdKFT+xXX8DO5aviwm27eWiQQM8iRBHrk9k=:",
163
+ "@paralleldrive/cuid2@2.3.1": "@paralleldrive/cuid2@2.3.1:w+Tuw2Ewz6nSrzwgspeVrx2BWf4QsyMcTq0zRl6EVJ8=:",
162
164
  "@sinclair/typebox@0.27.10": "@sinclair/typebox@0.27.10:vZtV0JeRhkNIYCoftW3Y/DuiYW2S8f84UJbpXDJG9Qw=:",
163
165
  "@sinonjs/commons@3.0.1": "@sinonjs/commons@3.0.1:2EtA7Jh6HDPaE/yV5sU5TmeLvdd/1EqMSaPIHU2J+hU=:",
164
166
  "@sinonjs/fake-timers@10.3.0": "@sinonjs/fake-timers@10.3.0:UPR1oogsfhjz5ZEAANeBIMYn0vBZIlqZURUXPHlcL5w=:",
@@ -242,6 +244,7 @@
242
244
  "array-unique@0.3.2": "array-unique@0.3.2:Risn5zAX+iC1t5B9Eqd9vjr33VQG6BuySpUDvipkwKM=:",
243
245
  "array.prototype.reduce@1.0.8": "array.prototype.reduce@1.0.8:9tVIrlRImVxzXpy43MIi6ZCiPGU48bsPy2NR52TZrdY=:",
244
246
  "arraybuffer.prototype.slice@1.0.4": "arraybuffer.prototype.slice@1.0.4:/TCMzZHt8DoL0fH6psbcmDzFcRzfiSevAAkMu0GzVtU=:",
247
+ "asap@2.0.6": "asap@2.0.6:NBwYRUYmpoHYkRtgHA4tTHpn9optFeuVKjIPpFdb+8M=:",
245
248
  "asn1@0.2.6": "asn1@0.2.6:13aodlN2dQS2G2CQHTA8dvrLeTYDiGJhDhmycPuO1cs=:",
246
249
  "assert-plus@1.0.0": "assert-plus@1.0.0:QCVuLhwXlc3FGrLRu1r95Q5TrE+iJkSEg8HV+IcP+A0=:",
247
250
  "assertion-error@1.1.0": "assertion-error@1.1.0:vNVJIjT3XIyfk+n6GqANBP0VNaedJbnSnu3bKpFYS4w=:",
@@ -355,7 +358,6 @@
355
358
  "data-view-byte-length@1.0.2": "data-view-byte-length@1.0.2:ZxNaK7L38dSo6tMFglMtzIbzv846WV5Df/ZXh6KUbEk=:",
356
359
  "data-view-byte-offset@1.0.1": "data-view-byte-offset@1.0.1:nAUc5gGjTFLfwA8LFQ78O2RNlxsgY5umn++Lhd5WYWg=:",
357
360
  "debug@2.6.9": "debug@2.6.9:V1ciVvmVdGGBHGAswhRqZv6HRJPwtOAhZ9kUO07Ib7U=:",
358
- "debug@3.2.7": "debug@3.2.7:+6e9kAn9jK9CDwDIrZcUTqPmLM1KJU51kdFjvdNl9O8=:",
359
361
  "debug@4.4.3(supports-color@5.5.0)": "debug@4.4.3(supports-color@5.5.0):YYaQHgWHPt+EGU8JKV4uyqCuZaGxpDv3x3CgfwrmYd8=:",
360
362
  "decode-uri-component@0.2.2": "decode-uri-component@0.2.2:FhU9rYG49cBdM5ZC7PJ9FyPsmYiddrG1qXGLQqFzprI=:",
361
363
  "dedent-js@1.0.1": "dedent-js@1.0.1:os46ZIWUDh3AXBTdjuaH7RrFhNnwzYv3eRiY2iKS7VM=:",
@@ -372,6 +374,7 @@
372
374
  "detect-indent@3.0.1": "detect-indent@3.0.1:/1Yf3IBjoK+/gycIlSLqrqH+2yoDFxlss+hhr+vItIU=:",
373
375
  "detect-indent@4.0.0": "detect-indent@4.0.0:pv3mF4gUn7iuwBGJ3RKCeC1DdsVPhMfhDJtQknyyPVk=:",
374
376
  "detect-newline@3.1.0": "detect-newline@3.1.0:nM6xO9uEttYiM0YEGx7s7zQImpqcITPCS6wiBTxGSBM=:",
377
+ "dezalgo@1.0.4": "dezalgo@1.0.4:QMfLI/0zNgvDw9r8VKu/+XkHvP0QG8N4yBYzpHqDIC0=:",
375
378
  "diff-sequences@29.6.3": "diff-sequences@29.6.3:WWrbFxZVFjC0rhwv3ZqRg6k7SXwEpzXJQJu5bkJHLyA=:",
376
379
  "diff@3.5.1": "diff@3.5.1:mmZAmWj8cBx+3hqbOTn3uJoJKLiqM3Enfx7GYqY19dI=:",
377
380
  "docdash@1.2.0": "docdash@1.2.0:uyLwSG90ACDXl1rOszj/JmJXbgS364lJH9xnn/6XmC4=:",
@@ -448,6 +451,7 @@
448
451
  "fast-deep-equal@3.1.3": "fast-deep-equal@3.1.3:sQzlu0W93kExDoLpH+J9nRYeCD3IKRR56QR+L5402As=:",
449
452
  "fast-json-stable-stringify@2.1.0": "fast-json-stable-stringify@2.1.0:K10zIkqqk5HN6fyP489Qokzz+PPha5DypCjM/vsSlHQ=:",
450
453
  "fast-levenshtein@2.0.6": "fast-levenshtein@2.0.6:cj7tvs40k4b5TCsQAzLpftvxrNH656DEVTohBtwuznY=:",
454
+ "fast-safe-stringify@2.1.1": "fast-safe-stringify@2.1.1:5L3wbZI/FZbOSnjXFEVkf1g5SI9Pxesaqp6AbQdX9kg=:",
451
455
  "fb-watchman@2.0.2": "fb-watchman@2.0.2:8SrVtQIPTJcsEOgit2+2XU4OOoQVvVg/4Z23xYoSM20=:",
452
456
  "file-entry-cache@8.0.0": "file-entry-cache@8.0.0:SQqaU0bN18sw2FrNETBKmQ2diPepNTukqj8c1h6Z17M=:",
453
457
  "file-uri-to-path@1.0.0": "file-uri-to-path@1.0.0:5TBcmJ6n9dhYS2B0HdLEvSnuKufgslYCmQa9uUjAyjU=:",
@@ -465,9 +469,9 @@
465
469
  "for-in@1.0.2": "for-in@1.0.2:tTmf9dYGHSUYwa76oaeK8CZXJC/MxPS0SiM1v/nkF9o=:",
466
470
  "forever-agent@0.6.1": "forever-agent@0.6.1:DAcS2BD7lAmh+sHDK9HLxuFyuKlWuVqhidz+cZqpCqM=:",
467
471
  "form-data@2.3.3": "form-data@2.3.3:FQdsmV2cKA72o/K80inubX849Hdvr74vf5k2AC4uubM=:",
468
- "form-data@2.5.5": "form-data@2.5.5:/9/bb3OFOlXP8FzYGhOnt6+97/j4UgZVAfmCpNJm7mg=:",
472
+ "form-data@4.0.5": "form-data@4.0.5:zMs6R09pfakWaCwOoSZFWGvgqAcf0JkZ81JCFjLOMpk=:",
469
473
  "formatio@1.2.0": "formatio@1.2.0:vM+z+axl9bsNUDdgqY9ogvxG+Y9tku7X4GqbElu67Vw=:",
470
- "formidable@1.2.6": "formidable@1.2.6:zfkuwwbq29j+1g3l9/fKXyDhIPZutIemKX+/XLnlPaA=:",
474
+ "formidable@3.5.4": "formidable@3.5.4:WCJuwKDeV9z+onkRHyC5OnJRc4QpHqQrQ0ZH0OWgYr0=:",
471
475
  "fragment-cache@0.2.1": "fragment-cache@0.2.1:zJPaBwadn7TM3WrzeldU3tkfgHWk7gn+3giXdyCV9Eg=:",
472
476
  "fs-extra@1.0.0": "fs-extra@1.0.0:93aZ+C22dGAZVpXf16vNIMA5jidLe9uUtu0TnR92e6I=:",
473
477
  "fs-extra@5.0.0": "fs-extra@5.0.0:hhpvyEGiC1k121riUzdALTm7bcFUzbraeELIfi1IrUM=:",
@@ -712,7 +716,7 @@
712
716
  "micromatch@4.0.8": "micromatch@4.0.8:jH1VKSVrH8YZclgyyfGxWl8r6eqRO8mIPQV+nIME14I=:",
713
717
  "mime-db@1.52.0": "mime-db@1.52.0:6fMQ6nwogpr6lZhpfIP+M0X1hBHfeuSW0h4eW4VvgAc=:",
714
718
  "mime-types@2.1.35": "mime-types@2.1.35:fXsJLd13P2byZsxVtiaDLcGIDYYwEpfxUoOXUFR/WPY=:",
715
- "mime@1.6.0": "mime@1.6.0:4bzm3mc0Re20vFg9fMLqqz9ZrD6ea1oNdB9bjssoThU=:",
719
+ "mime@2.6.0": "mime@2.6.0:uOQ/ljCdvR9M8sxZDEElgO3Do/l2oK7pwhJomZ7JbiI=:",
716
720
  "mimic-fn@2.1.0": "mimic-fn@2.1.0:gXKgL7Np3cz95m2xtLfaEFtkI1A2fTkTLxmTlNiK9Fg=:",
717
721
  "min-document@2.19.2": "min-document@2.19.2:+i65c1QHQkRLuGoA34toQ17RCfUjcHKkStR0ap2mxiw=:",
718
722
  "minimatch@3.1.2": "minimatch@3.1.2:760dxYkpzsi3CWx9C5IcpXx924w+anGnFHkN6mxMxto=:",
@@ -791,7 +795,6 @@
791
795
  "prelude-ls@1.2.1": "prelude-ls@1.2.1:77jm+R+stVYevlHR6mLJHVcOyB9clSWbWPCMOrhoFM4=:",
792
796
  "pretty-format@26.6.2": "pretty-format@26.6.2:WnwzxQ7x1DdSzmuEea43BAgSLpLORtkHgEB9nRtuIdg=:",
793
797
  "pretty-format@29.7.0": "pretty-format@29.7.0:kjCC9an5W1s5iN6bV5eXBVRhJ4afGWBY92rOtKEGzQQ=:",
794
- "process-nextick-args@2.0.1": "process-nextick-args@2.0.1:3lLDxuxZ8VQ/tTzKgnpxdVWZiDvBkyKjCR7Z8M/i6RA=:",
795
798
  "process@0.11.10": "process@0.11.10:kkBBapOdmg2tXUoV49mICrwryhCtyZJxBPdTzaK49Es=:",
796
799
  "prompts@2.4.2": "prompts@2.4.2:y4KDFdWwkvoi8X6Qn68GDD/rp/OAouRH7XeDfJvoFi4=:",
797
800
  "psl@1.15.0": "psl@1.15.0:CWzoMw7BzJQa87nzN/IzbAVvcTc40hXQUnstKAxhCKQ=:",
@@ -810,7 +813,6 @@
810
813
  "read-pkg@5.2.0": "read-pkg@5.2.0:ZWU1twuBNKhwhXQoQdubnl06guuz30bRHaqWsBZBLz0=:",
811
814
  "readable-stream@1.0.34": "readable-stream@1.0.34:fZDsdcjlQnuNuoJyIP3cJ5XZ2wMSDxRwcILu8hiawS0=:",
812
815
  "readable-stream@1.1.14": "readable-stream@1.1.14:j1g1MX2t9vrEZnLV2uX00FqP9qdVsDZTVD/EPNFbyGU=:",
813
- "readable-stream@2.3.8": "readable-stream@2.3.8:KHLJZi4r4rlU1Im5arK0hQi1Ovmpnr2NDZnRHLVK8pQ=:",
814
816
  "readable-stream@3.6.2": "readable-stream@3.6.2:wUQQG7LuaFpI1SB+0BJfJAtLANGnz7uQbK1XLPV7Ud8=:",
815
817
  "readdirp@3.6.0": "readdirp@3.6.0:poZ4zMZSd33hYmZBBbsJ/ityi69+zcwkDtt1THnusyg=:",
816
818
  "realpath-native@1.1.0": "realpath-native@1.1.0:i5Obvi3/EFZdUVsYSqdB35vcu1sZuOaWWP2cwNa8gwc=:",
@@ -843,7 +845,6 @@
843
845
  "rosie@2.1.1": "rosie@2.1.1:eG66iCzrNSdpKD7Po5tK42V9DFHYjjVJeo2rEwirKK4=:",
844
846
  "rsvp@4.8.5": "rsvp@4.8.5:s63b9fUz3T8ToEPv6HIP6UinF8rmrX1eqX0aEtUAqBI=:",
845
847
  "safe-array-concat@1.1.3": "safe-array-concat@1.1.3:frrinbUV5q2SrODjBpWiuHTqbhBFpbF/7aSXtp5KHqc=:",
846
- "safe-buffer@5.1.2": "safe-buffer@5.1.2:zrhGBRF9BEK+RcUxlnesj7cJX1IXYSxdXx7qoFG3k1M=:",
847
848
  "safe-buffer@5.2.1": "safe-buffer@5.2.1:9D9wokRmckZ+CU0YGnp9LGouiCJBuGOTgnotC5XpbuY=:",
848
849
  "safe-push-apply@1.0.0": "safe-push-apply@1.0.0:9x5700sZ7j4Ye0rn0fARk0le1AbANSUDiI3YGlfOqqI=:",
849
850
  "safe-regex-test@1.1.0": "safe-regex-test@1.1.0:n3mhlKmGpAP3WHvx04t5/0zrAdqK3HZt+WsC/a6+nJ8=:",
@@ -907,7 +908,6 @@
907
908
  "string.prototype.trimend@1.0.9": "string.prototype.trimend@1.0.9:nbolXKcBG1C9MdI38lPmQPf9lKgKVJ+tiKn936gir4M=:",
908
909
  "string.prototype.trimstart@1.0.8": "string.prototype.trimstart@1.0.8:XyBqU5AeFBvGuDD64h7S2KtboK1H0TaluP7HdOc2qRQ=:",
909
910
  "string_decoder@0.10.31": "string_decoder@0.10.31:bc7JB+EBE7dNm1sMP0mcfSJp2yk9EyHY1kd/SzPwBrA=:",
910
- "string_decoder@1.1.1": "string_decoder@1.1.1:FBxMo9lrc6yBHp3m9vR1EguE/dMZscx42xvoUXtUTgI=:",
911
911
  "string_decoder@1.3.0": "string_decoder@1.3.0:Mi4W4gJ1r6+E9jYZj1jYqayDxJJHcMdXDxi/IVuJOvI=:",
912
912
  "stringify-object-es5@2.5.0": "stringify-object-es5@2.5.0:IfDYyztuqqnYrptoWxOUMK8hexHhtssd9xEQ7INnTRc=:",
913
913
  "strip-ansi@3.0.1": "strip-ansi@3.0.1:R4gygVbvaQCsqd9N/ygqrbmE1LTBf+ySKpZhdHIu778=:",
@@ -917,8 +917,8 @@
917
917
  "strip-eof@1.0.0": "strip-eof@1.0.0:IOl06/S65qMjASDNlnyX3p4G8YKE+xhbigPPOuREHAw=:",
918
918
  "strip-final-newline@2.0.0": "strip-final-newline@2.0.0:XBwtg7uJ0K8EJ9UaFSmPRY4fR1GRD0VJB/jU9Gf9oAM=:",
919
919
  "strip-json-comments@3.1.1": "strip-json-comments@3.1.1:b7Guud8xp0BNfyZNDrMqD/tnkn5cu9tjzD+P3X7OI9Y=:",
920
- "superagent-bluebird-promise@4.2.0(bluebird@3.7.2)(superagent@3.8.3)": "superagent-bluebird-promise@4.2.0(bluebird@3.7.2)(superagent@3.8.3):i9ADuN22A4P4WPA7E52PYoKNoU9OkXXmrQULBCOVklE=:",
921
- "superagent@3.8.3": "superagent@3.8.3:h9d+c/OsJpZAtr6GGHwu8SbS0nqqcySCem6mzMTQJHI=:",
920
+ "superagent-bluebird-promise@4.2.0(bluebird@3.7.2)(superagent@10.3.0)": "superagent-bluebird-promise@4.2.0(bluebird@3.7.2)(superagent@10.3.0):7xEka4/VMX4/4stMc2oihlPnBJZGKlyXp9myoBs6Yyg=:",
921
+ "superagent@10.3.0": "superagent@10.3.0:JLqXFGP8D8KY69Hsk+q7YksoRQctR0V0OFwmbVaudyk=:",
922
922
  "supports-color@2.0.0": "supports-color@2.0.0:Lppzu4/XDL83VUnJzwnijTtk97Rgj226LKrvfCz1iKg=:",
923
923
  "supports-color@5.5.0": "supports-color@5.5.0:WRrBgS/TJ82EJRg6mqbwxImyQvH8K+7QNALlRAa7W2M=:",
924
924
  "supports-color@6.1.0": "supports-color@6.1.0:hIbXqA6HiFOLWQ6Wa1uYBmX8BsUdQoLm7c40qtyE53Y=:",
package/CHANGELOG.json CHANGED
@@ -1,6 +1,18 @@
1
1
  {
2
2
  "name": "@livepreso/api",
3
3
  "entries": [
4
+ {
5
+ "version": "6.57.0",
6
+ "tag": "@livepreso/api_v6.57.0",
7
+ "date": "Fri, 06 Mar 2026 05:02:20 GMT",
8
+ "comments": {
9
+ "minor": [
10
+ {
11
+ "comment": "Upgrade superagent to v10"
12
+ }
13
+ ]
14
+ }
15
+ },
4
16
  {
5
17
  "version": "6.56.1",
6
18
  "tag": "@livepreso/api_v6.56.1",
package/CHANGELOG.md CHANGED
@@ -1,6 +1,13 @@
1
1
  # Change Log - @livepreso/api
2
2
 
3
- This log was last generated on Fri, 06 Mar 2026 02:29:21 GMT and should not be manually modified.
3
+ This log was last generated on Fri, 06 Mar 2026 05:02:20 GMT and should not be manually modified.
4
+
5
+ ## 6.57.0
6
+ Fri, 06 Mar 2026 05:02:20 GMT
7
+
8
+ ### Minor changes
9
+
10
+ - Upgrade superagent to v10
4
11
 
5
12
  ## 6.56.1
6
13
  Fri, 06 Mar 2026 02:29:21 GMT
@@ -24,8 +24,6 @@ var DispatchPreviewModel = exports.DispatchPreviewModel = _base.BaseModel.extend
24
24
  return _superagent.default.get(this.url()).set(_auth.Auth.headers).set("Accept", "text/plain").then(function (resp) {
25
25
  _this.content = resp.text;
26
26
  return resp.text;
27
- }).catch(_superagent.default.SuperagentPromiseError, function (e) {
28
- throw e;
29
27
  });
30
28
  }
31
29
  });
@@ -1 +1 @@
1
- {"version":3,"file":"dispatch-preview.js","names":["require","_auth","_base","_stateRegister","_superagent","_interopRequireDefault","DispatchPreviewModel","exports","BaseModel","extend","props","content","fetch","_this","superagent","get","url","set","Auth","headers","then","resp","text","catch","SuperagentPromiseError","e","register"],"sources":["../../src/models/dispatch-preview.js"],"sourcesContent":["import \"./dispatch.js\";\n\nimport { Auth } from \"../auth.js\";\nimport { BaseModel } from \"./base.js\";\nimport { register } from \"../state-register.js\";\nimport superagent from \"superagent\";\n\n/**\n * @constructor\n * @alias models.DispatchPreviewModel\n * @extends models.BaseModel\n */\nexport const DispatchPreviewModel = BaseModel.extend(\n\t/** @lends models.DispatchPreviewModel# */ {\n\t\tprops: {\n\t\t\tcontent: \"string\",\n\t\t},\n\t\tfetch() {\n\t\t\treturn superagent\n\t\t\t\t.get(this.url())\n\t\t\t\t.set(Auth.headers)\n\t\t\t\t.set(\"Accept\", \"text/plain\")\n\t\t\t\t.then((resp) => {\n\t\t\t\t\tthis.content = resp.text;\n\t\t\t\t\treturn resp.text;\n\t\t\t\t})\n\t\t\t\t.catch(superagent.SuperagentPromiseError, (e) => {\n\t\t\t\t\tthrow e;\n\t\t\t\t});\n\t\t},\n\t},\n);\n\nregister(\"DispatchPreviewModel\", DispatchPreviewModel);\n"],"mappings":";;;;;;;AAAAA,OAAA;AAEA,IAAAC,KAAA,GAAAD,OAAA;AACA,IAAAE,KAAA,GAAAF,OAAA;AACA,IAAAG,cAAA,GAAAH,OAAA;AACA,IAAAI,WAAA,GAAAC,sBAAA,CAAAL,OAAA;AAEA;AACA;AACA;AACA;AACA;AACO,IAAMM,oBAAoB,GAAAC,OAAA,CAAAD,oBAAA,GAAGE,eAAS,CAACC,MAAM,CACnD,0CAA2C;EAC1CC,KAAK,EAAE;IACNC,OAAO,EAAE;EACV,CAAC;EACDC,KAAK,WAALA,KAAKA,CAAA,EAAG;IAAA,IAAAC,KAAA;IACP,OAAOC,mBAAU,CACfC,GAAG,CAAC,IAAI,CAACC,GAAG,CAAC,CAAC,CAAC,CACfC,GAAG,CAACC,UAAI,CAACC,OAAO,CAAC,CACjBF,GAAG,CAAC,QAAQ,EAAE,YAAY,CAAC,CAC3BG,IAAI,CAAC,UAACC,IAAI,EAAK;MACfR,KAAI,CAACF,OAAO,GAAGU,IAAI,CAACC,IAAI;MACxB,OAAOD,IAAI,CAACC,IAAI;IACjB,CAAC,CAAC,CACDC,KAAK,CAACT,mBAAU,CAACU,sBAAsB,EAAE,UAACC,CAAC,EAAK;MAChD,MAAMA,CAAC;IACR,CAAC,CAAC;EACJ;AACD,CACD,CAAC;AAED,IAAAC,uBAAQ,EAAC,sBAAsB,EAAEpB,oBAAoB,CAAC","ignoreList":[]}
1
+ {"version":3,"file":"dispatch-preview.js","names":["require","_auth","_base","_stateRegister","_superagent","_interopRequireDefault","DispatchPreviewModel","exports","BaseModel","extend","props","content","fetch","_this","superagent","get","url","set","Auth","headers","then","resp","text","register"],"sources":["../../src/models/dispatch-preview.js"],"sourcesContent":["import \"./dispatch.js\";\n\nimport { Auth } from \"../auth.js\";\nimport { BaseModel } from \"./base.js\";\nimport { register } from \"../state-register.js\";\nimport superagent from \"superagent\";\n\n/**\n * @constructor\n * @alias models.DispatchPreviewModel\n * @extends models.BaseModel\n */\nexport const DispatchPreviewModel = BaseModel.extend(\n\t/** @lends models.DispatchPreviewModel# */ {\n\t\tprops: {\n\t\t\tcontent: \"string\",\n\t\t},\n\t\tfetch() {\n\t\t\treturn superagent\n\t\t\t\t.get(this.url())\n\t\t\t\t.set(Auth.headers)\n\t\t\t\t.set(\"Accept\", \"text/plain\")\n\t\t\t\t.then((resp) => {\n\t\t\t\t\tthis.content = resp.text;\n\t\t\t\t\treturn resp.text;\n\t\t\t\t});\n\t\t},\n\t},\n);\n\nregister(\"DispatchPreviewModel\", DispatchPreviewModel);\n"],"mappings":";;;;;;;AAAAA,OAAA;AAEA,IAAAC,KAAA,GAAAD,OAAA;AACA,IAAAE,KAAA,GAAAF,OAAA;AACA,IAAAG,cAAA,GAAAH,OAAA;AACA,IAAAI,WAAA,GAAAC,sBAAA,CAAAL,OAAA;AAEA;AACA;AACA;AACA;AACA;AACO,IAAMM,oBAAoB,GAAAC,OAAA,CAAAD,oBAAA,GAAGE,eAAS,CAACC,MAAM,CACnD,0CAA2C;EAC1CC,KAAK,EAAE;IACNC,OAAO,EAAE;EACV,CAAC;EACDC,KAAK,WAALA,KAAKA,CAAA,EAAG;IAAA,IAAAC,KAAA;IACP,OAAOC,mBAAU,CACfC,GAAG,CAAC,IAAI,CAACC,GAAG,CAAC,CAAC,CAAC,CACfC,GAAG,CAACC,UAAI,CAACC,OAAO,CAAC,CACjBF,GAAG,CAAC,QAAQ,EAAE,YAAY,CAAC,CAC3BG,IAAI,CAAC,UAACC,IAAI,EAAK;MACfR,KAAI,CAACF,OAAO,GAAGU,IAAI,CAACC,IAAI;MACxB,OAAOD,IAAI,CAACC,IAAI;IACjB,CAAC,CAAC;EACJ;AACD,CACD,CAAC;AAED,IAAAC,uBAAQ,EAAC,sBAAsB,EAAEjB,oBAAoB,CAAC","ignoreList":[]}
@@ -222,8 +222,6 @@ var ManifestJSONModel = exports.ManifestJSONModel = _base.BaseModel.extend(/** @
222
222
  } else {
223
223
  fixtures[key] = response.body || {};
224
224
  }
225
- }).catch(_superagent.default.SuperagentPromiseError, function (e) {
226
- throw e;
227
225
  });
228
226
  });
229
227
  _context.next = 1;
@@ -1 +1 @@
1
- {"version":3,"file":"manifest-json.js","names":["_lodash","_interopRequireDefault","require","_superagent","_base","_stateRegister","_utils","_createForOfIteratorHelper","r","e","t","Symbol","iterator","Array","isArray","_unsupportedIterableToArray","length","_n","F","s","n","done","value","f","TypeError","o","a","u","call","next","return","_arrayLikeToArray","toString","slice","constructor","name","from","test","ownKeys","Object","keys","getOwnPropertySymbols","filter","getOwnPropertyDescriptor","enumerable","push","apply","_objectSpread","arguments","forEach","_defineProperty2","default","getOwnPropertyDescriptors","defineProperties","defineProperty","ManifestJSONModel","exports","BaseModel","extend","props","key","maintainer","common","feeds","hooks","fixtures","limits","ordering","tags","titles","templates","content_editors","persistentcontext","type","screenshotpreferences","vector","dimensions","width","height","pdfpreferences","quality_level","has_editable_share_support","has_signing_support","point_in_time_share_policy","notify_salesperson_after_feeds_fetched","require_verification","companywide_editable","app_settings","appointment","show_visible_default","fieldsets","enforce_required","requires_user_connectivity","derived","screenDimensions","deps","fn","getScreenDimensions","getDimensionsByName","dimension","find","d","_d$name","toLowerCase","getPDFDimensions","_this$pdfpreferences","defaultPDFDimensions","defaultDimensions","getAssetPath","undefined","_key$split","split","_key$split2","_slicedToArray2","sectionKey","_key$split2$","slideKey","sectionKeyPath","resolveURL","url","concat","getTemplateAssetPath","getFixtures","rootAssetUrl","_this","_asyncToGenerator2","_regenerator","mark","_callee","fixturePaths","imports","wrap","_context","prev","_","map","fixture","path","superagent","get","then","response","text","JSON","parse","body","catch","SuperagentPromiseError","Promise","all","abrupt","stop","parent","modelName","getPlainURL","prototype","createFromProject","projectFile","impostor","maxAdjunctSlides","sections","reduce","num","section","title","slides","newSection","_toConsumableArray2","_iterator","_step","slide","err","template","index","adjunctslide","slideIndex","_iterator2","_step2","_iterator3","_step3","welcome","manifest","screen","Error","canBeEmpty","register"],"sources":["../../src/models/manifest-json.js"],"sourcesContent":["import _ from \"lodash\";\nimport \"./pack.js\";\n\nimport superagent from \"superagent\";\nimport { BaseModel } from \"./base.js\";\nimport { register } from \"../state-register.js\";\nimport { resolveURL } from \"../utils.js\";\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} has_signing_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\t// This could be a list or an object\n\t\t\t\ttype: \"any\",\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\thas_signing_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\trequires_user_connectivity: {\n\t\t\t\ttype: \"array\",\n\t\t\t\tdefault: () => {\n\t\t\t\t\treturn [];\n\t\t\t\t},\n\t\t\t},\n\t\t},\n\n\t\tderived: {\n\t\t\t// Most places just need this value, and making it derived\n\t\t\t// gives us lower overhead (when we convert with .toJSON() it will\n\t\t\t// also include this value, and means we don't have to convert back to\n\t\t\t// a model just to get this again.)\n\t\t\tscreenDimensions: {\n\t\t\t\tdeps: [\"dimensions\"],\n\t\t\t\tfn: function () {\n\t\t\t\t\treturn this.getScreenDimensions();\n\t\t\t\t},\n\t\t\t},\n\t\t},\n\n\t\tgetDimensionsByName(name) {\n\t\t\tif (Array.isArray(this.dimensions)) {\n\t\t\t\tconst dimension = this.dimensions.find(\n\t\t\t\t\t(d) => d.name?.toLowerCase() === name.toLowerCase(),\n\t\t\t\t);\n\t\t\t\tif (!dimension) {\n\t\t\t\t\treturn { width: 1024, height: 767 };\n\t\t\t\t}\n\t\t\t\treturn { width: dimension.width, height: dimension.height };\n\t\t\t}\n\t\t\treturn this.dimensions;\n\t\t},\n\n\t\tgetScreenDimensions() {\n\t\t\treturn this.getDimensionsByName(\"screen\");\n\t\t},\n\n\t\tgetPDFDimensions() {\n\t\t\tif (Array.isArray(this.dimensions)) {\n\t\t\t\tconst defaultPDFDimensions =\n\t\t\t\t\tthis.pdfpreferences?.defaultDimensions || \"screen\";\n\t\t\t\treturn this.getDimensionsByName(defaultPDFDimensions);\n\t\t\t}\n\t\t\treturn this.dimensions;\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 = resolveURL(\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 resolveURL(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 resolveURL(this.getAssetPath(), `templates/${key}/`);\n\t\t},\n\n\t\tasync getFixtures(rootAssetUrl) {\n\t\t\tconst fixturePaths = this.fixtures || {};\n\t\t\tconst fixtures = {};\n\n\t\t\tconst imports = _.map(fixturePaths, (fixture, key) => {\n\t\t\t\tconst path = `${rootAssetUrl}${fixture}`;\n\n\t\t\t\treturn superagent\n\t\t\t\t\t.get(path)\n\t\t\t\t\t.then((response) => {\n\t\t\t\t\t\tif (response.text) {\n\t\t\t\t\t\t\tfixtures[key] = JSON.parse(response.text);\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tfixtures[key] = response.body || {};\n\t\t\t\t\t\t}\n\t\t\t\t\t})\n\t\t\t\t\t.catch(superagent.SuperagentPromiseError, (e) => {\n\t\t\t\t\t\tthrow e;\n\t\t\t\t\t});\n\t\t\t});\n\n\t\t\tawait Promise.all(imports);\n\n\t\t\treturn fixtures;\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\tconst { dimensions } = projectFile;\n\n\t\tif (Array.isArray(dimensions)) {\n\t\t\tconst screen = dimensions.filter((d) => d.name === \"Screen\");\n\t\t\tif (!screen.length || screen.length > 1) {\n\t\t\t\tthrow new Error(\n\t\t\t\t\t\"Dimensions must contain one value named 'Screen' in project.yaml\",\n\t\t\t\t);\n\t\t\t}\n\t\t}\n\n\t\tmanifest.dimensions = 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.has_signing_support) {\n\t\tmanifest.has_signing_support = projectFile.has_signing_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\tif (projectFile.requires_user_connectivity) {\n\t\tmanifest.requires_user_connectivity =\n\t\t\tprojectFile.requires_user_connectivity;\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 = false;\n\n\treturn manifest;\n};\n\nManifestJSONModel.canBeEmpty = true;\n\nregister(\"ManifestJSONModel\", ManifestJSONModel);\n"],"mappings":";;;;;;;;;;;;AAAA,IAAAA,OAAA,GAAAC,sBAAA,CAAAC,OAAA;AACAA,OAAA;AAEA,IAAAC,WAAA,GAAAF,sBAAA,CAAAC,OAAA;AACA,IAAAE,KAAA,GAAAF,OAAA;AACA,IAAAG,cAAA,GAAAH,OAAA;AACA,IAAAI,MAAA,GAAAJ,OAAA;AAAyC,SAAAK,2BAAAC,CAAA,EAAAC,CAAA,QAAAC,CAAA,yBAAAC,MAAA,IAAAH,CAAA,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3CyF,QAAQ,CAACzF,0BAA0B,GAClCiE,WAAW,CAACjE,0BAA0B;EACxC;;EAEA;EACA;EACA;EACA;EACAyF,QAAQ,CAAC9F,YAAY,CAACG,SAAS,CAACC,gBAAgB,GAAG,KAAK;EAExD,OAAO0F,QAAQ;AAChB,CAAC;AAED9H,iBAAiB,CAACiI,UAAU,GAAG,IAAI;AAEnC,IAAAC,uBAAQ,EAAC,mBAAmB,EAAElI,iBAAiB,CAAC","ignoreList":[]}
1
+ {"version":3,"file":"manifest-json.js","names":["_lodash","_interopRequireDefault","require","_superagent","_base","_stateRegister","_utils","_createForOfIteratorHelper","r","e","t","Symbol","iterator","Array","isArray","_unsupportedIterableToArray","length","_n","F","s","n","done","value","f","TypeError","o","a","u","call","next","return","_arrayLikeToArray","toString","slice","constructor","name","from","test","ownKeys","Object","keys","getOwnPropertySymbols","filter","getOwnPropertyDescriptor","enumerable","push","apply","_objectSpread","arguments","forEach","_defineProperty2","default","getOwnPropertyDescriptors","defineProperties","defineProperty","ManifestJSONModel","exports","BaseModel","extend","props","key","maintainer","common","feeds","hooks","fixtures","limits","ordering","tags","titles","templates","content_editors","persistentcontext","type","screenshotpreferences","vector","dimensions","width","height","pdfpreferences","quality_level","has_editable_share_support","has_signing_support","point_in_time_share_policy","notify_salesperson_after_feeds_fetched","require_verification","companywide_editable","app_settings","appointment","show_visible_default","fieldsets","enforce_required","requires_user_connectivity","derived","screenDimensions","deps","fn","getScreenDimensions","getDimensionsByName","dimension","find","d","_d$name","toLowerCase","getPDFDimensions","_this$pdfpreferences","defaultPDFDimensions","defaultDimensions","getAssetPath","undefined","_key$split","split","_key$split2","_slicedToArray2","sectionKey","_key$split2$","slideKey","sectionKeyPath","resolveURL","url","concat","getTemplateAssetPath","getFixtures","rootAssetUrl","_this","_asyncToGenerator2","_regenerator","mark","_callee","fixturePaths","imports","wrap","_context","prev","_","map","fixture","path","superagent","get","then","response","text","JSON","parse","body","Promise","all","abrupt","stop","parent","modelName","getPlainURL","prototype","createFromProject","projectFile","impostor","maxAdjunctSlides","sections","reduce","num","section","title","slides","newSection","_toConsumableArray2","_iterator","_step","slide","err","template","index","adjunctslide","slideIndex","_iterator2","_step2","_iterator3","_step3","welcome","manifest","screen","Error","canBeEmpty","register"],"sources":["../../src/models/manifest-json.js"],"sourcesContent":["import _ from \"lodash\";\nimport \"./pack.js\";\n\nimport superagent from \"superagent\";\nimport { BaseModel } from \"./base.js\";\nimport { register } from \"../state-register.js\";\nimport { resolveURL } from \"../utils.js\";\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} has_signing_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\t// This could be a list or an object\n\t\t\t\ttype: \"any\",\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\thas_signing_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\trequires_user_connectivity: {\n\t\t\t\ttype: \"array\",\n\t\t\t\tdefault: () => {\n\t\t\t\t\treturn [];\n\t\t\t\t},\n\t\t\t},\n\t\t},\n\n\t\tderived: {\n\t\t\t// Most places just need this value, and making it derived\n\t\t\t// gives us lower overhead (when we convert with .toJSON() it will\n\t\t\t// also include this value, and means we don't have to convert back to\n\t\t\t// a model just to get this again.)\n\t\t\tscreenDimensions: {\n\t\t\t\tdeps: [\"dimensions\"],\n\t\t\t\tfn: function () {\n\t\t\t\t\treturn this.getScreenDimensions();\n\t\t\t\t},\n\t\t\t},\n\t\t},\n\n\t\tgetDimensionsByName(name) {\n\t\t\tif (Array.isArray(this.dimensions)) {\n\t\t\t\tconst dimension = this.dimensions.find(\n\t\t\t\t\t(d) => d.name?.toLowerCase() === name.toLowerCase(),\n\t\t\t\t);\n\t\t\t\tif (!dimension) {\n\t\t\t\t\treturn { width: 1024, height: 767 };\n\t\t\t\t}\n\t\t\t\treturn { width: dimension.width, height: dimension.height };\n\t\t\t}\n\t\t\treturn this.dimensions;\n\t\t},\n\n\t\tgetScreenDimensions() {\n\t\t\treturn this.getDimensionsByName(\"screen\");\n\t\t},\n\n\t\tgetPDFDimensions() {\n\t\t\tif (Array.isArray(this.dimensions)) {\n\t\t\t\tconst defaultPDFDimensions =\n\t\t\t\t\tthis.pdfpreferences?.defaultDimensions || \"screen\";\n\t\t\t\treturn this.getDimensionsByName(defaultPDFDimensions);\n\t\t\t}\n\t\t\treturn this.dimensions;\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 = resolveURL(\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 resolveURL(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 resolveURL(this.getAssetPath(), `templates/${key}/`);\n\t\t},\n\n\t\tasync getFixtures(rootAssetUrl) {\n\t\t\tconst fixturePaths = this.fixtures || {};\n\t\t\tconst fixtures = {};\n\n\t\t\tconst imports = _.map(fixturePaths, (fixture, key) => {\n\t\t\t\tconst path = `${rootAssetUrl}${fixture}`;\n\n\t\t\t\treturn superagent.get(path).then((response) => {\n\t\t\t\t\tif (response.text) {\n\t\t\t\t\t\tfixtures[key] = JSON.parse(response.text);\n\t\t\t\t\t} else {\n\t\t\t\t\t\tfixtures[key] = response.body || {};\n\t\t\t\t\t}\n\t\t\t\t});\n\t\t\t});\n\n\t\t\tawait Promise.all(imports);\n\n\t\t\treturn fixtures;\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\tconst { dimensions } = projectFile;\n\n\t\tif (Array.isArray(dimensions)) {\n\t\t\tconst screen = dimensions.filter((d) => d.name === \"Screen\");\n\t\t\tif (!screen.length || screen.length > 1) {\n\t\t\t\tthrow new Error(\n\t\t\t\t\t\"Dimensions must contain one value named 'Screen' in project.yaml\",\n\t\t\t\t);\n\t\t\t}\n\t\t}\n\n\t\tmanifest.dimensions = 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.has_signing_support) {\n\t\tmanifest.has_signing_support = projectFile.has_signing_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\tif (projectFile.requires_user_connectivity) {\n\t\tmanifest.requires_user_connectivity =\n\t\t\tprojectFile.requires_user_connectivity;\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 = false;\n\n\treturn manifest;\n};\n\nManifestJSONModel.canBeEmpty = true;\n\nregister(\"ManifestJSONModel\", ManifestJSONModel);\n"],"mappings":";;;;;;;;;;;;AAAA,IAAAA,OAAA,GAAAC,sBAAA,CAAAC,OAAA;AACAA,OAAA;AAEA,IAAAC,WAAA,GAAAF,sBAAA,CAAAC,OAAA;AACA,IAAAE,KAAA,GAAAF,OAAA;AACA,IAAAG,cAAA,GAAAH,OAAA;AACA,IAAAI,MAAA,GAAAJ,OAAA;AAAyC,SAAAK,2BAAAC,CAAA,EAAAC,CAAA,QAAAC,CAAA,yBAAAC,MAAA,IAAAH,CAAA,CAAAG,MAAA,CAAAC,QAAA,KAAAJ,CAAA,qBAAAE,CAAA,QAAAG,KAAA,CAAAC,OAAA,CAAAN,CAAA,MAAAE,CAAA,GAAAK,2BAAA,CAAAP,CAAA,MAAAC,CAAA,IAAAD,CAAA,uBAAAA,CAAA,CAAAQ,MAAA,IAAAN,CAAA,KAAA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package/cjs/sync.js CHANGED
@@ -11,7 +11,6 @@ var _superagentBluebirdPromise = _interopRequireDefault(require("superagent-blue
11
11
  var _lodash = _interopRequireDefault(require("lodash"));
12
12
  var _log = _interopRequireDefault(require("./log.js"));
13
13
  var _middleware = require("./middleware.js");
14
- var _superagent = _interopRequireDefault(require("superagent"));
15
14
  var defaults = _lodash.default.defaults;
16
15
  var assign = _lodash.default.assign;
17
16
 
@@ -203,8 +202,9 @@ var ajaxSync = exports.ajaxSync = function ajaxSync(method, model, options) {
203
202
  request.emit("success", response);
204
203
  return data;
205
204
  });
206
- }).catch(_superagent.default.SuperagentPromiseError, function (e) {
207
- if (e.res && e.res.body && (e.status >= 400 && e.status < 500 || e.status === 503)) {
205
+ }).catch(function (e) {
206
+ var _e$res;
207
+ if (typeof e.status !== "undefined" && (_e$res = e.res) !== null && _e$res !== void 0 && _e$res.body && (e.status >= 400 && e.status < 500 || e.status === 503)) {
208
208
  e.message += "\nBody: ".concat(JSON.stringify(e.res.body));
209
209
  }
210
210
  throw e;
package/cjs/sync.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"sync.js","names":["_bluebird","_interopRequireDefault","require","_superagentBluebirdPromise","_lodash","_log","_middleware","_superagent","defaults","_","assign","urlError","Error","methodMap","exports","create","update","patch","delete","read","defaultFetchURL","_ref","model","log","warn","url","buildURL","_ref2","method","split","sync","defaultOpts","_this","syncArguments","arguments","syncActions","middlewares","forEach","middleware","push","apply","Promise","all","then","_len","length","newOpts","Array","_key","joinedOpts","merge","concat","_toConsumableArray2","default","flat","ajaxSync","call","options","type","emulateHTTP","emulateJSON","params","result","data","batch","json","attrs","toJSON","requestSettings","request","SuperAgentRequest","toServer","isArray","FormData","pick","Object","keys","send","xhr","preflight","mc","getNextMiddleware","middlewareInterceptor","response","intercept","resolve","trigger","ajaxConfig","headers","key","lowerKey","toLowerCase","header","cachedResponse","JSON","parse","text","each","success","catch","error","message","timeout","e","set","emit","superagent","SuperagentPromiseError","res","body","status","stringify","originalError","code"],"sources":["../src/sync.js"],"sourcesContent":["import Promise from \"bluebird\";\nimport SuperAgentRequest from \"superagent-bluebird-promise\";\nimport _ from \"lodash\";\nimport log from \"./log.js\";\nimport { middlewares } from \"./middleware.js\";\nimport superagent from \"superagent\";\n\nconst defaults = _.defaults;\nconst assign = _.assign;\n\n// Throw an error when a URL is needed, and none is supplied.\nconst urlError = function () {\n\tthrow new Error(`A \"url\" property or function must be specified`);\n};\n\n// Map from CRUD to HTTP for our default `Backbone.sync` implementation.\nexport const methodMap = {\n\tcreate: \"POST\",\n\tupdate: \"PUT\",\n\tpatch: \"PATCH\",\n\tdelete: \"DELETE\",\n\tread: \"GET\",\n};\n\nexport const defaultFetchURL = function ({ model }) {\n\tlog.warn(\"Deprecation: defaultFetchURL is deprecated. Just use .url()\");\n\treturn model.url();\n};\n\nexport const buildURL = function ({ method, model }) {\n\tconst url = model.url();\n\n\t// If not a GET request, strip the query params from the url\n\tif (method !== \"read\") {\n\t\treturn url.split(\"?\")[0];\n\t}\n\n\treturn url;\n};\n\nexport const sync = function (method, model, defaultOpts) {\n\tconst syncArguments = arguments;\n\n\tif (method === \"read\") {\n\t\t// look for sync methods\n\t\tconst syncActions = [];\n\t\tmiddlewares.forEach((middleware) => {\n\t\t\tif (middleware.sync) {\n\t\t\t\tsyncActions.push(middleware.sync.apply(this, syncArguments));\n\t\t\t}\n\t\t});\n\n\t\treturn Promise.all(syncActions).then((...newOpts) => {\n\t\t\tconst joinedOpts = _.merge({}, defaultOpts, ...newOpts.flat());\n\t\t\treturn ajaxSync.call(this, method, model, joinedOpts);\n\t\t});\n\t}\n\treturn ajaxSync.call(this, method, model, defaultOpts);\n};\n\nexport const ajaxSync = function (method, model, options) {\n\tconst type = methodMap[method];\n\n\t// Default options, unless specified.\n\tdefaults(options || {}, {\n\t\temulateHTTP: false,\n\t\temulateJSON: false,\n\t});\n\n\t// Default request options.\n\tconst params = { type: type };\n\n\t// Ensure that we have a URL.\n\tif (!options.url) {\n\t\toptions.url = _.result(model, \"url\") || urlError();\n\t}\n\n\t// Ensure that we have the appropriate request data.\n\tif (\n\t\toptions.data === null &&\n\t\tmodel &&\n\t\t(method === \"create\" ||\n\t\t\tmethod === \"update\" ||\n\t\t\tmethod === \"patch\" ||\n\t\t\t(method === \"delete\" && options.batch))\n\t) {\n\t\tparams.json = options.attrs || model.toJSON(options);\n\t}\n\n\tconst url = buildURL({ method, model, options });\n\n\tconst requestSettings = assign(params, options);\n\trequestSettings.method = type;\n\n\tconst request = SuperAgentRequest(type, url);\n\n\tif (\n\t\ttype === \"PATCH\" ||\n\t\ttype === \"POST\" ||\n\t\ttype === \"PUT\" ||\n\t\t(type === \"DELETE\" && options.batch)\n\t) {\n\t\tlet data = model.toServer();\n\n\t\t// Note we can use formdata to override the way a patch works - if we\n\t\t// are doing this it's for a particular patch with an image or file,\n\t\t// probably.\n\t\tif (type === \"PATCH\" && !_.isArray(data) && !(data instanceof FormData)) {\n\t\t\t// Make sure we're only updating data actually passed to the save\n\t\t\t// function, rather than automatically generated stuff\n\t\t\tdata = _.pick(options.attrs, Object.keys(data));\n\t\t}\n\t\trequest.send(data);\n\t}\n\n\toptions.xhr = request;\n\n\tmiddlewares.forEach((middleware) => {\n\t\tif (middleware.preflight) {\n\t\t\tmiddleware.preflight(request, model, options);\n\t\t}\n\t});\n\n\tlet mc = 0;\n\n\tfunction getNextMiddleware(request) {\n\t\treturn function middlewareInterceptor(response) {\n\t\t\tif (mc < middlewares.length) {\n\t\t\t\treturn middlewares[mc++]\n\t\t\t\t\t.intercept(request, response, model)\n\t\t\t\t\t.then(getNextMiddleware(request));\n\t\t\t}\n\t\t\treturn Promise.resolve(response);\n\t\t};\n\t}\n\n\tmodel.trigger(\"request\", model, request, options, requestSettings);\n\trequest.requestSettings = requestSettings;\n\n\tconst ajaxConfig = _.result(model, \"ajaxConfig\") || {};\n\n\t// Combine generated headers with user's headers.\n\tif (ajaxConfig.headers) {\n\t\tfor (const key in ajaxConfig.headers) {\n\t\t\tconst lowerKey = key.toLowerCase();\n\t\t\t// Use superagent's .type() method to explicitly set content-type\n\t\t\t// This ensures superagent respects the content-type and doesn't override it\n\t\t\tif (lowerKey === \"content-type\") {\n\t\t\t\trequest.type(ajaxConfig.headers[key].split(\";\")[0]);\n\t\t\t} else {\n\t\t\t\trequest.header[lowerKey] = ajaxConfig.headers[key];\n\t\t\t}\n\t\t}\n\t}\n\n\tif (options.headers) {\n\t\tfor (const key in options.headers) {\n\t\t\tconst lowerKey = key.toLowerCase();\n\t\t\tif (lowerKey === \"content-type\") {\n\t\t\t\trequest.type(options.headers[key].split(\";\")[0]);\n\t\t\t} else {\n\t\t\t\trequest.header[lowerKey] = options.headers[key];\n\t\t\t}\n\t\t}\n\t}\n\n\t// TODO: Remove me when this can be moved... for now this removal is quite a complex\n\t// process.\n\tif (options.cachedResponse) {\n\t\treturn Promise.resolve(options.cachedResponse)\n\t\t\t.then(getNextMiddleware(request))\n\t\t\t.then((response) => {\n\t\t\t\tif (!response.data) {\n\t\t\t\t\tresponse.data = JSON.parse(response.text);\n\t\t\t\t}\n\n\t\t\t\treturn Promise.each(middlewares, (middleware) => {\n\t\t\t\t\treturn middleware.success(request, response, model, true);\n\t\t\t\t}).then(() => {\n\t\t\t\t\tif (options.success) {\n\t\t\t\t\t\toptions.success(response.data, \"success\", response);\n\t\t\t\t\t}\n\n\t\t\t\t\treturn response.data;\n\t\t\t\t});\n\t\t\t})\n\t\t\t.catch((response) => {\n\t\t\t\treturn Promise.each(middlewares, (middleware) => {\n\t\t\t\t\treturn middleware.error(response, model);\n\t\t\t\t}).then(() => {\n\t\t\t\t\tif (options.error) {\n\t\t\t\t\t\toptions.error(response, \"error\", response.message);\n\t\t\t\t\t}\n\t\t\t\t\tthrow response;\n\t\t\t\t});\n\t\t\t});\n\t}\n\n\treturn (\n\t\trequest\n\t\t\t// Force a timeout on every request. Intermittent connections\n\t\t\t// can have the request continue trying for minutes otherwise.\n\t\t\t// 60 seconds is the timeout the server has, so we go for 65 seconds,\n\t\t\t// so we give the chance to the server to time out first - helps with\n\t\t\t// debugging.\n\t\t\t.timeout(65 * 1000)\n\t\t\t.then(getNextMiddleware(request))\n\t\t\t.then((response) => {\n\t\t\t\tlet data;\n\t\t\t\ttry {\n\t\t\t\t\tdata = JSON.parse(response.text);\n\t\t\t\t} catch (e) {\n\t\t\t\t\tdata = response;\n\t\t\t\t}\n\n\t\t\t\tif (type !== \"DELETE\") {\n\t\t\t\t\tmodel.set(data);\n\t\t\t\t}\n\n\t\t\t\treturn Promise.each(middlewares, (middleware) => {\n\t\t\t\t\treturn middleware.success(request, response, model, false);\n\t\t\t\t}).then(() => {\n\t\t\t\t\tif (options.success) {\n\t\t\t\t\t\toptions.success(data, \"success\", response);\n\t\t\t\t\t}\n\t\t\t\t\trequest.emit(\"success\", response);\n\t\t\t\t\treturn data;\n\t\t\t\t});\n\t\t\t})\n\t\t\t.catch(superagent.SuperagentPromiseError, (e) => {\n\t\t\t\tif (\n\t\t\t\t\te.res &&\n\t\t\t\t\te.res.body &&\n\t\t\t\t\t((e.status >= 400 && e.status < 500) || e.status === 503)\n\t\t\t\t) {\n\t\t\t\t\te.message += `\\nBody: ${JSON.stringify(e.res.body)}`;\n\t\t\t\t}\n\t\t\t\tthrow e;\n\t\t\t})\n\t\t\t.catch((response) => {\n\t\t\t\treturn Promise.each(middlewares, (middleware) => {\n\t\t\t\t\treturn middleware.error(response);\n\t\t\t\t}).then(() => {\n\t\t\t\t\tif (options.error) {\n\t\t\t\t\t\toptions.error(response, \"error\", response.message);\n\t\t\t\t\t}\n\n\t\t\t\t\t// Provide a more explanatory error message on timeout\n\t\t\t\t\tif (\n\t\t\t\t\t\tresponse &&\n\t\t\t\t\t\tresponse.originalError &&\n\t\t\t\t\t\tresponse.originalError.code === \"ECONNABORTED\"\n\t\t\t\t\t) {\n\t\t\t\t\t\tthrow new Error(\n\t\t\t\t\t\t\t`Failed ${type} request on url: ${url}. ${response.message}`,\n\t\t\t\t\t\t);\n\t\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C,CAAC,CAAC,CAACxC,IAAI,CAAC,YAAM;MACb,IAAIc,OAAO,CAAC2C,KAAK,EAAE;QAClB3C,OAAO,CAAC2C,KAAK,CAACjB,QAAQ,EAAE,OAAO,EAAEA,QAAQ,CAACkB,OAAO,CAAC;MACnD;;MAEA;MACA,IACClB,QAAQ,IACRA,QAAQ,CAAC6B,aAAa,IACtB7B,QAAQ,CAAC6B,aAAa,CAACC,IAAI,KAAK,cAAc,EAC7C;QACD,MAAM,IAAIrG,KAAK,WAAAuC,MAAA,CACJO,IAAI,uBAAAP,MAAA,CAAoB1B,GAAG,QAAA0B,MAAA,CAAKgC,QAAQ,CAACkB,OAAO,CAC3D,CAAC;MACF;MAEA,MAAMlB,QAAQ;IACf,CAAC,CAAC;EACH,CAAC,CAAC;AAEL,CAAC","ignoreList":[]}
1
+ {"version":3,"file":"sync.js","names":["_bluebird","_interopRequireDefault","require","_superagentBluebirdPromise","_lodash","_log","_middleware","defaults","_","assign","urlError","Error","methodMap","exports","create","update","patch","delete","read","defaultFetchURL","_ref","model","log","warn","url","buildURL","_ref2","method","split","sync","defaultOpts","_this","syncArguments","arguments","syncActions","middlewares","forEach","middleware","push","apply","Promise","all","then","_len","length","newOpts","Array","_key","joinedOpts","merge","concat","_toConsumableArray2","default","flat","ajaxSync","call","options","type","emulateHTTP","emulateJSON","params","result","data","batch","json","attrs","toJSON","requestSettings","request","SuperAgentRequest","toServer","isArray","FormData","pick","Object","keys","send","xhr","preflight","mc","getNextMiddleware","middlewareInterceptor","response","intercept","resolve","trigger","ajaxConfig","headers","key","lowerKey","toLowerCase","header","cachedResponse","JSON","parse","text","each","success","catch","error","message","timeout","e","set","emit","_e$res","status","res","body","stringify","originalError","code"],"sources":["../src/sync.js"],"sourcesContent":["import Promise from \"bluebird\";\nimport SuperAgentRequest from \"superagent-bluebird-promise\";\nimport _ from \"lodash\";\nimport log from \"./log.js\";\nimport { middlewares } from \"./middleware.js\";\n\nconst defaults = _.defaults;\nconst assign = _.assign;\n\n// Throw an error when a URL is needed, and none is supplied.\nconst urlError = function () {\n\tthrow new Error(`A \"url\" property or function must be specified`);\n};\n\n// Map from CRUD to HTTP for our default `Backbone.sync` implementation.\nexport const methodMap = {\n\tcreate: \"POST\",\n\tupdate: \"PUT\",\n\tpatch: \"PATCH\",\n\tdelete: \"DELETE\",\n\tread: \"GET\",\n};\n\nexport const defaultFetchURL = function ({ model }) {\n\tlog.warn(\"Deprecation: defaultFetchURL is deprecated. Just use .url()\");\n\treturn model.url();\n};\n\nexport const buildURL = function ({ method, model }) {\n\tconst url = model.url();\n\n\t// If not a GET request, strip the query params from the url\n\tif (method !== \"read\") {\n\t\treturn url.split(\"?\")[0];\n\t}\n\n\treturn url;\n};\n\nexport const sync = function (method, model, defaultOpts) {\n\tconst syncArguments = arguments;\n\n\tif (method === \"read\") {\n\t\t// look for sync methods\n\t\tconst syncActions = [];\n\t\tmiddlewares.forEach((middleware) => {\n\t\t\tif (middleware.sync) {\n\t\t\t\tsyncActions.push(middleware.sync.apply(this, syncArguments));\n\t\t\t}\n\t\t});\n\n\t\treturn Promise.all(syncActions).then((...newOpts) => {\n\t\t\tconst joinedOpts = _.merge({}, defaultOpts, ...newOpts.flat());\n\t\t\treturn ajaxSync.call(this, method, model, joinedOpts);\n\t\t});\n\t}\n\treturn ajaxSync.call(this, method, model, defaultOpts);\n};\n\nexport const ajaxSync = function (method, model, options) {\n\tconst type = methodMap[method];\n\n\t// Default options, unless specified.\n\tdefaults(options || {}, {\n\t\temulateHTTP: false,\n\t\temulateJSON: false,\n\t});\n\n\t// Default request options.\n\tconst params = { type: type };\n\n\t// Ensure that we have a URL.\n\tif (!options.url) {\n\t\toptions.url = _.result(model, \"url\") || urlError();\n\t}\n\n\t// Ensure that we have the appropriate request data.\n\tif (\n\t\toptions.data === null &&\n\t\tmodel &&\n\t\t(method === \"create\" ||\n\t\t\tmethod === \"update\" ||\n\t\t\tmethod === \"patch\" ||\n\t\t\t(method === \"delete\" && options.batch))\n\t) {\n\t\tparams.json = options.attrs || model.toJSON(options);\n\t}\n\n\tconst url = buildURL({ method, model, options });\n\n\tconst requestSettings = assign(params, options);\n\trequestSettings.method = type;\n\n\tconst request = SuperAgentRequest(type, url);\n\n\tif (\n\t\ttype === \"PATCH\" ||\n\t\ttype === \"POST\" ||\n\t\ttype === \"PUT\" ||\n\t\t(type === \"DELETE\" && options.batch)\n\t) {\n\t\tlet data = model.toServer();\n\n\t\t// Note we can use formdata to override the way a patch works - if we\n\t\t// are doing this it's for a particular patch with an image or file,\n\t\t// probably.\n\t\tif (type === \"PATCH\" && !_.isArray(data) && !(data instanceof FormData)) {\n\t\t\t// Make sure we're only updating data actually passed to the save\n\t\t\t// function, rather than automatically generated stuff\n\t\t\tdata = _.pick(options.attrs, Object.keys(data));\n\t\t}\n\t\trequest.send(data);\n\t}\n\n\toptions.xhr = request;\n\n\tmiddlewares.forEach((middleware) => {\n\t\tif (middleware.preflight) {\n\t\t\tmiddleware.preflight(request, model, options);\n\t\t}\n\t});\n\n\tlet mc = 0;\n\n\tfunction getNextMiddleware(request) {\n\t\treturn function middlewareInterceptor(response) {\n\t\t\tif (mc < middlewares.length) {\n\t\t\t\treturn middlewares[mc++]\n\t\t\t\t\t.intercept(request, response, model)\n\t\t\t\t\t.then(getNextMiddleware(request));\n\t\t\t}\n\t\t\treturn Promise.resolve(response);\n\t\t};\n\t}\n\n\tmodel.trigger(\"request\", model, request, options, requestSettings);\n\trequest.requestSettings = requestSettings;\n\n\tconst ajaxConfig = _.result(model, \"ajaxConfig\") || {};\n\n\t// Combine generated headers with user's headers.\n\tif (ajaxConfig.headers) {\n\t\tfor (const key in ajaxConfig.headers) {\n\t\t\tconst lowerKey = key.toLowerCase();\n\t\t\t// Use superagent's .type() method to explicitly set content-type\n\t\t\t// This ensures superagent respects the content-type and doesn't override it\n\t\t\tif (lowerKey === \"content-type\") {\n\t\t\t\trequest.type(ajaxConfig.headers[key].split(\";\")[0]);\n\t\t\t} else {\n\t\t\t\trequest.header[lowerKey] = ajaxConfig.headers[key];\n\t\t\t}\n\t\t}\n\t}\n\n\tif (options.headers) {\n\t\tfor (const key in options.headers) {\n\t\t\tconst lowerKey = key.toLowerCase();\n\t\t\tif (lowerKey === \"content-type\") {\n\t\t\t\trequest.type(options.headers[key].split(\";\")[0]);\n\t\t\t} else {\n\t\t\t\trequest.header[lowerKey] = options.headers[key];\n\t\t\t}\n\t\t}\n\t}\n\n\t// TODO: Remove me when this can be moved... for now this removal is quite a complex\n\t// process.\n\tif (options.cachedResponse) {\n\t\treturn Promise.resolve(options.cachedResponse)\n\t\t\t.then(getNextMiddleware(request))\n\t\t\t.then((response) => {\n\t\t\t\tif (!response.data) {\n\t\t\t\t\tresponse.data = JSON.parse(response.text);\n\t\t\t\t}\n\n\t\t\t\treturn Promise.each(middlewares, (middleware) => {\n\t\t\t\t\treturn middleware.success(request, response, model, true);\n\t\t\t\t}).then(() => {\n\t\t\t\t\tif (options.success) {\n\t\t\t\t\t\toptions.success(response.data, \"success\", response);\n\t\t\t\t\t}\n\n\t\t\t\t\treturn response.data;\n\t\t\t\t});\n\t\t\t})\n\t\t\t.catch((response) => {\n\t\t\t\treturn Promise.each(middlewares, (middleware) => {\n\t\t\t\t\treturn middleware.error(response, model);\n\t\t\t\t}).then(() => {\n\t\t\t\t\tif (options.error) {\n\t\t\t\t\t\toptions.error(response, \"error\", response.message);\n\t\t\t\t\t}\n\t\t\t\t\tthrow response;\n\t\t\t\t});\n\t\t\t});\n\t}\n\n\treturn (\n\t\trequest\n\t\t\t// Force a timeout on every request. Intermittent connections\n\t\t\t// can have the request continue trying for minutes otherwise.\n\t\t\t// 60 seconds is the timeout the server has, so we go for 65 seconds,\n\t\t\t// so we give the chance to the server to time out first - helps with\n\t\t\t// debugging.\n\t\t\t.timeout(65 * 1000)\n\t\t\t.then(getNextMiddleware(request))\n\t\t\t.then((response) => {\n\t\t\t\tlet data;\n\t\t\t\ttry {\n\t\t\t\t\tdata = JSON.parse(response.text);\n\t\t\t\t} catch (e) {\n\t\t\t\t\tdata = response;\n\t\t\t\t}\n\n\t\t\t\tif (type !== \"DELETE\") {\n\t\t\t\t\tmodel.set(data);\n\t\t\t\t}\n\n\t\t\t\treturn Promise.each(middlewares, (middleware) => {\n\t\t\t\t\treturn middleware.success(request, response, model, false);\n\t\t\t\t}).then(() => {\n\t\t\t\t\tif (options.success) {\n\t\t\t\t\t\toptions.success(data, \"success\", response);\n\t\t\t\t\t}\n\t\t\t\t\trequest.emit(\"success\", response);\n\t\t\t\t\treturn data;\n\t\t\t\t});\n\t\t\t})\n\t\t\t.catch((e) => {\n\t\t\t\tif (\n\t\t\t\t\ttypeof e.status !== \"undefined\" &&\n\t\t\t\t\te.res?.body &&\n\t\t\t\t\t((e.status >= 400 && e.status < 500) || e.status === 503)\n\t\t\t\t) {\n\t\t\t\t\te.message += `\\nBody: ${JSON.stringify(e.res.body)}`;\n\t\t\t\t}\n\t\t\t\tthrow e;\n\t\t\t})\n\t\t\t.catch((response) => {\n\t\t\t\treturn Promise.each(middlewares, (middleware) => {\n\t\t\t\t\treturn middleware.error(response);\n\t\t\t\t}).then(() => {\n\t\t\t\t\tif (options.error) {\n\t\t\t\t\t\toptions.error(response, \"error\", response.message);\n\t\t\t\t\t}\n\n\t\t\t\t\t// Provide a more explanatory error message on timeout\n\t\t\t\t\tif (\n\t\t\t\t\t\tresponse &&\n\t\t\t\t\t\tresponse.originalError &&\n\t\t\t\t\t\tresponse.originalError.code === \"ECONNABORTED\"\n\t\t\t\t\t) {\n\t\t\t\t\t\tthrow new Error(\n\t\t\t\t\t\t\t`Failed ${type} request on url: ${url}. ${response.message}`,\n\t\t\t\t\t\t);\n\t\t\t\t\t}\n\n\t\t\t\t\tthrow response;\n\t\t\t\t});\n\t\t\t})\n\t);\n};\n"],"mappings":";;;;;;;;AAAA,IAAAA,SAAA,GAAAC,sBAAA,CAAAC,OAAA;AACA,IAAAC,0BAAA,GAAAF,sBAAA,CAAAC,OAAA;AACA,IAAAE,OAAA,GAA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Q,IACRA,QAAQ,CAAC4B,aAAa,IACtB5B,QAAQ,CAAC4B,aAAa,CAACC,IAAI,KAAK,cAAc,EAC7C;QACD,MAAM,IAAIpG,KAAK,WAAAuC,MAAA,CACJO,IAAI,uBAAAP,MAAA,CAAoB1B,GAAG,QAAA0B,MAAA,CAAKgC,QAAQ,CAACkB,OAAO,CAC3D,CAAC;MACF;MAEA,MAAMlB,QAAQ;IACf,CAAC,CAAC;EACH,CAAC,CAAC;AAEL,CAAC","ignoreList":[]}
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@livepreso/api",
3
3
  "license": "UNLICENSED",
4
- "version": "6.56.1",
4
+ "version": "6.57.0",
5
5
  "description": "Everything to do with talking to the SalePreso API",
6
6
  "main": "index.js",
7
7
  "module": "esm/index.js",
@@ -23,7 +23,7 @@
23
23
  "lodash": "^4.17.4",
24
24
  "moment": "^2.18.1",
25
25
  "qs": "^6.4.0",
26
- "superagent": "^3.5.2",
26
+ "superagent": "~10.3.0",
27
27
  "superagent-bluebird-promise": "~4.2.0",
28
28
  "systemjs": "^6.9.0"
29
29
  },
@@ -56,8 +56,8 @@
56
56
  "jest-fixed-default-reporter": "~2.0.1",
57
57
  "rosie": "~2.1.0",
58
58
  "@faker-js/faker": "~7.5.0",
59
- "sp-test": "0.2.0",
60
- "@livepreso/eslint-config": "1.0.0"
59
+ "@livepreso/eslint-config": "1.0.0",
60
+ "sp-test": "0.2.0"
61
61
  },
62
62
  "scripts": {
63
63
  "test:debug": "node --inspect node_modules/.bin/jest --watch --runInBand",
@@ -23,9 +23,6 @@ export const DispatchPreviewModel = BaseModel.extend(
23
23
  .then((resp) => {
24
24
  this.content = resp.text;
25
25
  return resp.text;
26
- })
27
- .catch(superagent.SuperagentPromiseError, (e) => {
28
- throw e;
29
26
  });
30
27
  },
31
28
  },
@@ -197,18 +197,13 @@ export const ManifestJSONModel = BaseModel.extend(
197
197
  const imports = _.map(fixturePaths, (fixture, key) => {
198
198
  const path = `${rootAssetUrl}${fixture}`;
199
199
 
200
- return superagent
201
- .get(path)
202
- .then((response) => {
203
- if (response.text) {
204
- fixtures[key] = JSON.parse(response.text);
205
- } else {
206
- fixtures[key] = response.body || {};
207
- }
208
- })
209
- .catch(superagent.SuperagentPromiseError, (e) => {
210
- throw e;
211
- });
200
+ return superagent.get(path).then((response) => {
201
+ if (response.text) {
202
+ fixtures[key] = JSON.parse(response.text);
203
+ } else {
204
+ fixtures[key] = response.body || {};
205
+ }
206
+ });
212
207
  });
213
208
 
214
209
  await Promise.all(imports);
package/src/sync.js CHANGED
@@ -3,7 +3,6 @@ import SuperAgentRequest from "superagent-bluebird-promise";
3
3
  import _ from "lodash";
4
4
  import log from "./log.js";
5
5
  import { middlewares } from "./middleware.js";
6
- import superagent from "superagent";
7
6
 
8
7
  const defaults = _.defaults;
9
8
  const assign = _.assign;
@@ -227,10 +226,10 @@ export const ajaxSync = function (method, model, options) {
227
226
  return data;
228
227
  });
229
228
  })
230
- .catch(superagent.SuperagentPromiseError, (e) => {
229
+ .catch((e) => {
231
230
  if (
232
- e.res &&
233
- e.res.body &&
231
+ typeof e.status !== "undefined" &&
232
+ e.res?.body &&
234
233
  ((e.status >= 400 && e.status < 500) || e.status === 503)
235
234
  ) {
236
235
  e.message += `\nBody: ${JSON.stringify(e.res.body)}`;