@agnostack/next-shopify 1.15.0-beta.6 → 1.15.0-beta.8

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.
Files changed (89) hide show
  1. package/CHANGELOG.md +14 -0
  2. package/dist/umd/verification.js +10 -348
  3. package/dist/umd/verification.js.map +1 -1
  4. package/dist/verification/utils/rawbody.js +29 -12
  5. package/dist/verification/utils/rawbody.js.map +1 -1
  6. package/package.json +3 -9
  7. package/node_modules/bytes/History.md +0 -97
  8. package/node_modules/bytes/LICENSE +0 -23
  9. package/node_modules/bytes/Readme.md +0 -152
  10. package/node_modules/bytes/index.js +0 -170
  11. package/node_modules/bytes/package.json +0 -42
  12. package/node_modules/depd/History.md +0 -103
  13. package/node_modules/depd/LICENSE +0 -22
  14. package/node_modules/depd/Readme.md +0 -280
  15. package/node_modules/depd/index.js +0 -538
  16. package/node_modules/depd/lib/browser/index.js +0 -77
  17. package/node_modules/depd/package.json +0 -45
  18. package/node_modules/http-errors/HISTORY.md +0 -180
  19. package/node_modules/http-errors/LICENSE +0 -23
  20. package/node_modules/http-errors/README.md +0 -169
  21. package/node_modules/http-errors/index.js +0 -289
  22. package/node_modules/http-errors/package.json +0 -50
  23. package/node_modules/iconv-lite/Changelog.md +0 -162
  24. package/node_modules/iconv-lite/LICENSE +0 -21
  25. package/node_modules/iconv-lite/README.md +0 -156
  26. package/node_modules/iconv-lite/encodings/dbcs-codec.js +0 -555
  27. package/node_modules/iconv-lite/encodings/dbcs-data.js +0 -176
  28. package/node_modules/iconv-lite/encodings/index.js +0 -22
  29. package/node_modules/iconv-lite/encodings/internal.js +0 -188
  30. package/node_modules/iconv-lite/encodings/sbcs-codec.js +0 -72
  31. package/node_modules/iconv-lite/encodings/sbcs-data-generated.js +0 -451
  32. package/node_modules/iconv-lite/encodings/sbcs-data.js +0 -174
  33. package/node_modules/iconv-lite/encodings/tables/big5-added.json +0 -122
  34. package/node_modules/iconv-lite/encodings/tables/cp936.json +0 -264
  35. package/node_modules/iconv-lite/encodings/tables/cp949.json +0 -273
  36. package/node_modules/iconv-lite/encodings/tables/cp950.json +0 -177
  37. package/node_modules/iconv-lite/encodings/tables/eucjp.json +0 -182
  38. package/node_modules/iconv-lite/encodings/tables/gb18030-ranges.json +0 -1
  39. package/node_modules/iconv-lite/encodings/tables/gbk-added.json +0 -55
  40. package/node_modules/iconv-lite/encodings/tables/shiftjis.json +0 -125
  41. package/node_modules/iconv-lite/encodings/utf16.js +0 -177
  42. package/node_modules/iconv-lite/encodings/utf7.js +0 -290
  43. package/node_modules/iconv-lite/lib/bom-handling.js +0 -52
  44. package/node_modules/iconv-lite/lib/extend-node.js +0 -217
  45. package/node_modules/iconv-lite/lib/index.d.ts +0 -24
  46. package/node_modules/iconv-lite/lib/index.js +0 -153
  47. package/node_modules/iconv-lite/lib/streams.js +0 -121
  48. package/node_modules/iconv-lite/package.json +0 -46
  49. package/node_modules/inherits/LICENSE +0 -16
  50. package/node_modules/inherits/README.md +0 -42
  51. package/node_modules/inherits/inherits.js +0 -9
  52. package/node_modules/inherits/inherits_browser.js +0 -27
  53. package/node_modules/inherits/package.json +0 -29
  54. package/node_modules/raw-body/HISTORY.md +0 -308
  55. package/node_modules/raw-body/LICENSE +0 -22
  56. package/node_modules/raw-body/README.md +0 -223
  57. package/node_modules/raw-body/SECURITY.md +0 -24
  58. package/node_modules/raw-body/index.d.ts +0 -87
  59. package/node_modules/raw-body/index.js +0 -336
  60. package/node_modules/raw-body/package.json +0 -49
  61. package/node_modules/safer-buffer/LICENSE +0 -21
  62. package/node_modules/safer-buffer/Porting-Buffer.md +0 -268
  63. package/node_modules/safer-buffer/Readme.md +0 -156
  64. package/node_modules/safer-buffer/dangerous.js +0 -58
  65. package/node_modules/safer-buffer/package.json +0 -34
  66. package/node_modules/safer-buffer/safer.js +0 -77
  67. package/node_modules/safer-buffer/tests.js +0 -406
  68. package/node_modules/setprototypeof/LICENSE +0 -13
  69. package/node_modules/setprototypeof/README.md +0 -31
  70. package/node_modules/setprototypeof/index.d.ts +0 -2
  71. package/node_modules/setprototypeof/index.js +0 -17
  72. package/node_modules/setprototypeof/package.json +0 -38
  73. package/node_modules/setprototypeof/test/index.js +0 -24
  74. package/node_modules/statuses/HISTORY.md +0 -82
  75. package/node_modules/statuses/LICENSE +0 -23
  76. package/node_modules/statuses/README.md +0 -136
  77. package/node_modules/statuses/codes.json +0 -65
  78. package/node_modules/statuses/index.js +0 -146
  79. package/node_modules/statuses/package.json +0 -49
  80. package/node_modules/toidentifier/HISTORY.md +0 -9
  81. package/node_modules/toidentifier/LICENSE +0 -21
  82. package/node_modules/toidentifier/README.md +0 -61
  83. package/node_modules/toidentifier/index.js +0 -32
  84. package/node_modules/toidentifier/package.json +0 -38
  85. package/node_modules/unpipe/HISTORY.md +0 -4
  86. package/node_modules/unpipe/LICENSE +0 -22
  87. package/node_modules/unpipe/README.md +0 -43
  88. package/node_modules/unpipe/index.js +0 -69
  89. package/node_modules/unpipe/package.json +0 -27
package/CHANGELOG.md CHANGED
@@ -1,3 +1,17 @@
1
+ # [1.15.0-beta.8](https://github.com/agnostack/next-shopify/compare/v1.15.0-beta.7...v1.15.0-beta.8) (2023-12-08)
2
+
3
+
4
+ ### Features
5
+
6
+ * added back bundle for monads ([99f8aa2](https://github.com/agnostack/next-shopify/commit/99f8aa25add4f7d1e7e364e9a6c33bd524ef3140))
7
+
8
+ # [1.15.0-beta.7](https://github.com/agnostack/next-shopify/compare/v1.15.0-beta.6...v1.15.0-beta.7) (2023-12-08)
9
+
10
+
11
+ ### Features
12
+
13
+ * removed dep on raw-body ([761931c](https://github.com/agnostack/next-shopify/commit/761931c0c76be995d7217f96874ab7eaf642a659))
14
+
1
15
  # [1.15.0-beta.6](https://github.com/agnostack/next-shopify/compare/v1.15.0-beta.5...v1.15.0-beta.6) (2023-12-08)
2
16
 
3
17
 
@@ -504,362 +504,24 @@
504
504
  }
505
505
  }
506
506
 
507
- /*!
508
- * raw-body
509
- * Copyright(c) 2013-2014 Jonathan Ong
510
- * Copyright(c) 2014-2022 Douglas Christopher Wilson
511
- * MIT Licensed
512
- */
513
-
514
- /**
515
- * Module dependencies.
516
- * @private
517
- */
518
-
519
- var asyncHooks = tryRequireAsyncHooks();
520
- var bytes = require('bytes');
521
- var createError = require('http-errors');
522
- var iconv = require('iconv-lite');
523
- var unpipe = require('unpipe');
524
-
525
- /**
526
- * Module exports.
527
- * @public
528
- */
529
-
530
- module.exports = getRawBody;
531
-
532
- /**
533
- * Module variables.
534
- * @private
535
- */
536
-
537
- var ICONV_ENCODING_MESSAGE_REGEXP = /^Encoding not recognized: /;
538
-
539
- /**
540
- * Get the decoder for a given encoding.
541
- *
542
- * @param {string} encoding
543
- * @private
544
- */
545
-
546
- function getDecoder (encoding) {
547
- if (!encoding) return null
548
-
549
- try {
550
- return iconv.getDecoder(encoding)
551
- } catch (e) {
552
- // error getting decoder
553
- if (!ICONV_ENCODING_MESSAGE_REGEXP.test(e.message)) throw e
554
-
555
- // the encoding was not found
556
- throw createError(415, 'specified encoding unsupported', {
557
- encoding: encoding,
558
- type: 'encoding.unsupported'
559
- })
560
- }
561
- }
562
-
563
- /**
564
- * Get the raw body of a stream (typically HTTP).
565
- *
566
- * @param {object} stream
567
- * @param {object|string|function} [options]
568
- * @param {function} [callback]
569
- * @public
570
- */
571
-
572
- function getRawBody (stream, options, callback) {
573
- var done = callback;
574
- var opts = options || {};
575
-
576
- // light validation
577
- if (stream === undefined) {
578
- throw new TypeError('argument stream is required')
579
- } else if (typeof stream !== 'object' || stream === null || typeof stream.on !== 'function') {
580
- throw new TypeError('argument stream must be a stream')
581
- }
582
-
583
- if (options === true || typeof options === 'string') {
584
- // short cut for encoding
585
- opts = {
586
- encoding: options
587
- };
588
- }
589
-
590
- if (typeof options === 'function') {
591
- done = options;
592
- opts = {};
593
- }
594
-
595
- // validate callback is a function, if provided
596
- if (done !== undefined && typeof done !== 'function') {
597
- throw new TypeError('argument callback must be a function')
598
- }
599
-
600
- // require the callback without promises
601
- if (!done && !global.Promise) {
602
- throw new TypeError('argument callback is required')
603
- }
604
-
605
- // get encoding
606
- var encoding = opts.encoding !== true
607
- ? opts.encoding
608
- : 'utf-8';
609
-
610
- // convert the limit to an integer
611
- var limit = bytes.parse(opts.limit);
612
-
613
- // convert the expected length to an integer
614
- var length = opts.length != null && !isNaN(opts.length)
615
- ? parseInt(opts.length, 10)
616
- : null;
617
-
618
- if (done) {
619
- // classic callback style
620
- return readStream(stream, encoding, length, limit, wrap(done))
621
- }
622
-
623
- return new Promise(function executor (resolve, reject) {
624
- readStream(stream, encoding, length, limit, function onRead (err, buf) {
625
- if (err) return reject(err)
626
- resolve(buf);
627
- });
628
- })
629
- }
630
-
631
- /**
632
- * Halt a stream.
633
- *
634
- * @param {Object} stream
635
- * @private
636
- */
637
-
638
- function halt (stream) {
639
- // unpipe everything from the stream
640
- unpipe(stream);
641
-
642
- // pause stream
643
- if (typeof stream.pause === 'function') {
644
- stream.pause();
645
- }
646
- }
647
-
648
- /**
649
- * Read the data from the stream.
650
- *
651
- * @param {object} stream
652
- * @param {string} encoding
653
- * @param {number} length
654
- * @param {number} limit
655
- * @param {function} callback
656
- * @public
657
- */
658
-
659
- function readStream (stream, encoding, length, limit, callback) {
660
- var complete = false;
661
- var sync = true;
662
-
663
- // check the length and limit options.
664
- // note: we intentionally leave the stream paused,
665
- // so users should handle the stream themselves.
666
- if (limit !== null && length !== null && length > limit) {
667
- return done(createError(413, 'request entity too large', {
668
- expected: length,
669
- length: length,
670
- limit: limit,
671
- type: 'entity.too.large'
672
- }))
673
- }
674
-
675
- // streams1: assert request encoding is buffer.
676
- // streams2+: assert the stream encoding is buffer.
677
- // stream._decoder: streams1
678
- // state.encoding: streams2
679
- // state.decoder: streams2, specifically < 0.10.6
680
- var state = stream._readableState;
681
- if (stream._decoder || (state && (state.encoding || state.decoder))) {
682
- // developer error
683
- return done(createError(500, 'stream encoding should not be set', {
684
- type: 'stream.encoding.set'
685
- }))
686
- }
687
-
688
- if (typeof stream.readable !== 'undefined' && !stream.readable) {
689
- return done(createError(500, 'stream is not readable', {
690
- type: 'stream.not.readable'
691
- }))
692
- }
693
-
694
- var received = 0;
695
- var decoder;
696
-
697
- try {
698
- decoder = getDecoder(encoding);
699
- } catch (err) {
700
- return done(err)
701
- }
702
-
703
- var buffer = decoder
704
- ? ''
705
- : [];
706
-
707
- // attach listeners
708
- stream.on('aborted', onAborted);
709
- stream.on('close', cleanup);
710
- stream.on('data', onData);
711
- stream.on('end', onEnd);
712
- stream.on('error', onEnd);
713
-
714
- // mark sync section complete
715
- sync = false;
716
-
717
- function done () {
718
- var args = new Array(arguments.length);
719
-
720
- // copy arguments
721
- for (var i = 0; i < args.length; i++) {
722
- args[i] = arguments[i];
723
- }
724
-
725
- // mark complete
726
- complete = true;
727
-
728
- if (sync) {
729
- process.nextTick(invokeCallback);
730
- } else {
731
- invokeCallback();
732
- }
733
-
734
- function invokeCallback () {
735
- cleanup();
736
-
737
- if (args[0]) {
738
- // halt the stream on error
739
- halt(stream);
740
- }
741
-
742
- callback.apply(null, args);
743
- }
744
- }
745
-
746
- function onAborted () {
747
- if (complete) return
748
-
749
- done(createError(400, 'request aborted', {
750
- code: 'ECONNABORTED',
751
- expected: length,
752
- length: length,
753
- received: received,
754
- type: 'request.aborted'
755
- }));
756
- }
757
-
758
- function onData (chunk) {
759
- if (complete) return
760
-
761
- received += chunk.length;
762
-
763
- if (limit !== null && received > limit) {
764
- done(createError(413, 'request entity too large', {
765
- limit: limit,
766
- received: received,
767
- type: 'entity.too.large'
768
- }));
769
- } else if (decoder) {
770
- buffer += decoder.write(chunk);
771
- } else {
772
- buffer.push(chunk);
773
- }
774
- }
775
-
776
- function onEnd (err) {
777
- if (complete) return
778
- if (err) return done(err)
779
-
780
- if (length !== null && received !== length) {
781
- done(createError(400, 'request size did not match content length', {
782
- expected: length,
783
- length: length,
784
- received: received,
785
- type: 'request.size.invalid'
786
- }));
787
- } else {
788
- var string = decoder
789
- ? buffer + (decoder.end() || '')
790
- : Buffer.concat(buffer);
791
- done(null, string);
792
- }
793
- }
794
-
795
- function cleanup () {
796
- buffer = null;
797
-
798
- stream.removeListener('aborted', onAborted);
799
- stream.removeListener('data', onData);
800
- stream.removeListener('end', onEnd);
801
- stream.removeListener('error', onEnd);
802
- stream.removeListener('close', cleanup);
803
- }
804
- }
805
-
806
- /**
807
- * Try to require async_hooks
808
- * @private
809
- */
810
-
811
- function tryRequireAsyncHooks () {
812
- try {
813
- return require('async_hooks')
814
- } catch (e) {
815
- return {}
816
- }
817
- }
818
-
819
- /**
820
- * Wrap function with async resource, if possible.
821
- * AsyncResource.bind static method backported.
822
- * @private
823
- */
824
-
825
- function wrap (fn) {
826
- var res;
827
-
828
- // create anonymous resource
829
- if (asyncHooks.AsyncResource) {
830
- res = new asyncHooks.AsyncResource(fn.name || 'bound-anonymous-fn');
831
- }
832
-
833
- // incompatible node.js
834
- if (!res || !res.runInAsyncScope) {
835
- return fn
836
- }
837
-
838
- // return bound function
839
- return res.runInAsyncScope.bind(res, fn, null)
840
- }
841
-
842
- var getRawBody$1 = /*#__PURE__*/Object.freeze({
843
- __proto__: null
844
- });
845
-
846
507
  // import getRawBody from 'raw-body'
508
+ // import * as getRawBody from 'raw-body'
847
509
 
848
- // const getChunkedRawBody = async (readable) => {
849
- // const chunks = []
510
+ const getChunkedRawBody = async (readable) => {
511
+ const chunks = [];
850
512
 
851
- // for await (const chunk of readable) {
852
- // chunks.push(typeof chunk === "string" ? Buffer.from(chunk) : chunk)
853
- // }
513
+ for await (const chunk of readable) {
514
+ chunks.push(typeof chunk === "string" ? Buffer.from(chunk) : chunk);
515
+ }
854
516
 
855
- // return Buffer.concat(chunks)
856
- // }
517
+ return Buffer.concat(chunks)
518
+ };
857
519
 
858
520
  // TODO: explore returning mutated request object adding on req.rawBody??
859
521
  // TODO: move to req.text() after next 13.5: https://github.com/vercel/next.js/discussions/13405
860
522
  const ensureRawBody = async (req) => (
861
- // getChunkedRawBody(req)
862
- getRawBody$1(req)
523
+ getChunkedRawBody(req)
524
+ // getRawBody(req)
863
525
  .then((_rawBody) => _rawBody.toString())
864
526
  .catch((error) => {
865
527
  // NOTE: this is intended to ensure if getRawBody is called 2x w/in a route that it returns the already streamed body