@agnostack/next-shopify 1.15.0-beta.5 → 1.15.0-beta.7
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.
- package/CHANGELOG.md +14 -0
- package/dist/lib/index.d.ts +0 -1
- package/dist/lib/index.d.ts.map +1 -1
- package/dist/lib/index.js +0 -1
- package/dist/lib/index.js.map +1 -1
- package/dist/plugins/index.d.ts +2 -0
- package/dist/plugins/index.d.ts.map +1 -0
- package/dist/plugins/index.js +2 -0
- package/dist/plugins/index.js.map +1 -0
- package/dist/plugins/types.d.ts +1 -0
- package/dist/plugins/types.d.ts.map +1 -0
- package/dist/plugins/types.js +1 -0
- package/dist/plugins/types.js.map +1 -0
- package/dist/plugins/withShopify.d.ts.map +1 -0
- package/dist/{lib → plugins}/withShopify.js +1 -1
- package/dist/plugins/withShopify.js.map +1 -0
- package/dist/umd/lib/index.d.ts +0 -1
- package/dist/umd/lib/index.d.ts.map +1 -1
- package/dist/umd/plugins/index.d.ts +2 -0
- package/dist/umd/plugins/index.d.ts.map +1 -0
- package/dist/umd/plugins/types.d.ts +1 -0
- package/dist/umd/plugins/types.d.ts.map +1 -0
- package/dist/umd/plugins/withShopify.d.ts.map +1 -0
- package/dist/umd/verification/utils/errors.d.ts.map +1 -0
- package/dist/umd/verification/utils/index.d.ts +3 -0
- package/dist/umd/verification/utils/index.d.ts.map +1 -0
- package/dist/umd/verification/utils/rawbody.d.ts.map +1 -0
- package/dist/umd/verification/verification.d.ts.map +1 -1
- package/dist/umd/verification.js +26 -370
- package/dist/umd/verification.js.map +1 -1
- package/dist/verification/utils/errors.d.ts.map +1 -0
- package/dist/verification/utils/errors.js.map +1 -0
- package/dist/verification/utils/index.d.ts +3 -0
- package/dist/verification/utils/index.d.ts.map +1 -0
- package/dist/verification/utils/index.js +3 -0
- package/dist/verification/utils/index.js.map +1 -0
- package/dist/verification/utils/rawbody.d.ts.map +1 -0
- package/dist/verification/{rawbody.js → utils/rawbody.js} +29 -12
- package/dist/verification/utils/rawbody.js.map +1 -0
- package/dist/verification/verification.d.ts.map +1 -1
- package/dist/verification/verification.js +2 -3
- package/dist/verification/verification.js.map +1 -1
- package/package.json +7 -6
- package/dist/lib/withShopify.d.ts.map +0 -1
- package/dist/lib/withShopify.js.map +0 -1
- package/dist/umd/lib/withShopify.d.ts.map +0 -1
- package/dist/umd/verification/errors.d.ts.map +0 -1
- package/dist/umd/verification/rawbody.d.ts.map +0 -1
- package/dist/verification/errors.d.ts.map +0 -1
- package/dist/verification/errors.js.map +0 -1
- package/dist/verification/rawbody.d.ts.map +0 -1
- package/dist/verification/rawbody.js.map +0 -1
- package/node_modules/browser-monads-ts/LICENSE +0 -21
- package/node_modules/browser-monads-ts/README.md +0 -46
- package/node_modules/browser-monads-ts/dist/browser-monads-ts.cjs.js +0 -2
- package/node_modules/browser-monads-ts/dist/browser-monads-ts.cjs.js.map +0 -1
- package/node_modules/browser-monads-ts/dist/browser-monads-ts.es.js +0 -12
- package/node_modules/browser-monads-ts/dist/browser-monads-ts.es.js.map +0 -1
- package/node_modules/browser-monads-ts/dist/index.d.ts +0 -5
- package/node_modules/browser-monads-ts/dist/index.d.ts.map +0 -1
- package/node_modules/browser-monads-ts/package.json +0 -79
- package/node_modules/bytes/History.md +0 -97
- package/node_modules/bytes/LICENSE +0 -23
- package/node_modules/bytes/Readme.md +0 -152
- package/node_modules/bytes/index.js +0 -170
- package/node_modules/bytes/package.json +0 -42
- package/node_modules/depd/History.md +0 -103
- package/node_modules/depd/LICENSE +0 -22
- package/node_modules/depd/Readme.md +0 -280
- package/node_modules/depd/index.js +0 -538
- package/node_modules/depd/lib/browser/index.js +0 -77
- package/node_modules/depd/package.json +0 -45
- package/node_modules/http-errors/HISTORY.md +0 -180
- package/node_modules/http-errors/LICENSE +0 -23
- package/node_modules/http-errors/README.md +0 -169
- package/node_modules/http-errors/index.js +0 -289
- package/node_modules/http-errors/package.json +0 -50
- package/node_modules/iconv-lite/Changelog.md +0 -162
- package/node_modules/iconv-lite/LICENSE +0 -21
- package/node_modules/iconv-lite/README.md +0 -156
- package/node_modules/iconv-lite/encodings/dbcs-codec.js +0 -555
- package/node_modules/iconv-lite/encodings/dbcs-data.js +0 -176
- package/node_modules/iconv-lite/encodings/index.js +0 -22
- package/node_modules/iconv-lite/encodings/internal.js +0 -188
- package/node_modules/iconv-lite/encodings/sbcs-codec.js +0 -72
- package/node_modules/iconv-lite/encodings/sbcs-data-generated.js +0 -451
- package/node_modules/iconv-lite/encodings/sbcs-data.js +0 -174
- package/node_modules/iconv-lite/encodings/tables/big5-added.json +0 -122
- package/node_modules/iconv-lite/encodings/tables/cp936.json +0 -264
- package/node_modules/iconv-lite/encodings/tables/cp949.json +0 -273
- package/node_modules/iconv-lite/encodings/tables/cp950.json +0 -177
- package/node_modules/iconv-lite/encodings/tables/eucjp.json +0 -182
- package/node_modules/iconv-lite/encodings/tables/gb18030-ranges.json +0 -1
- package/node_modules/iconv-lite/encodings/tables/gbk-added.json +0 -55
- package/node_modules/iconv-lite/encodings/tables/shiftjis.json +0 -125
- package/node_modules/iconv-lite/encodings/utf16.js +0 -177
- package/node_modules/iconv-lite/encodings/utf7.js +0 -290
- package/node_modules/iconv-lite/lib/bom-handling.js +0 -52
- package/node_modules/iconv-lite/lib/extend-node.js +0 -217
- package/node_modules/iconv-lite/lib/index.d.ts +0 -24
- package/node_modules/iconv-lite/lib/index.js +0 -153
- package/node_modules/iconv-lite/lib/streams.js +0 -121
- package/node_modules/iconv-lite/package.json +0 -46
- package/node_modules/inherits/LICENSE +0 -16
- package/node_modules/inherits/README.md +0 -42
- package/node_modules/inherits/inherits.js +0 -9
- package/node_modules/inherits/inherits_browser.js +0 -27
- package/node_modules/inherits/package.json +0 -29
- package/node_modules/nothing-mock/LICENSE +0 -21
- package/node_modules/nothing-mock/README.md +0 -266
- package/node_modules/nothing-mock/dist/nothing-mock.es.js +0 -2
- package/node_modules/nothing-mock/dist/nothing-mock.es.js.map +0 -1
- package/node_modules/nothing-mock/dist/nothing-mock.js +0 -2
- package/node_modules/nothing-mock/dist/nothing-mock.js.map +0 -1
- package/node_modules/nothing-mock/dist/nothing-mock.modern.js +0 -2
- package/node_modules/nothing-mock/dist/nothing-mock.modern.js.map +0 -1
- package/node_modules/nothing-mock/dist/nothing-mock.umd.js +0 -2
- package/node_modules/nothing-mock/dist/nothing-mock.umd.js.map +0 -1
- package/node_modules/nothing-mock/index.d.ts +0 -6
- package/node_modules/nothing-mock/package.json +0 -29
- package/node_modules/nothing-mock/src/index.js +0 -15
- package/node_modules/raw-body/HISTORY.md +0 -308
- package/node_modules/raw-body/LICENSE +0 -22
- package/node_modules/raw-body/README.md +0 -223
- package/node_modules/raw-body/SECURITY.md +0 -24
- package/node_modules/raw-body/index.d.ts +0 -87
- package/node_modules/raw-body/index.js +0 -336
- package/node_modules/raw-body/package.json +0 -49
- package/node_modules/safer-buffer/LICENSE +0 -21
- package/node_modules/safer-buffer/Porting-Buffer.md +0 -268
- package/node_modules/safer-buffer/Readme.md +0 -156
- package/node_modules/safer-buffer/dangerous.js +0 -58
- package/node_modules/safer-buffer/package.json +0 -34
- package/node_modules/safer-buffer/safer.js +0 -77
- package/node_modules/safer-buffer/tests.js +0 -406
- package/node_modules/setprototypeof/LICENSE +0 -13
- package/node_modules/setprototypeof/README.md +0 -31
- package/node_modules/setprototypeof/index.d.ts +0 -2
- package/node_modules/setprototypeof/index.js +0 -17
- package/node_modules/setprototypeof/package.json +0 -38
- package/node_modules/setprototypeof/test/index.js +0 -24
- package/node_modules/statuses/HISTORY.md +0 -82
- package/node_modules/statuses/LICENSE +0 -23
- package/node_modules/statuses/README.md +0 -136
- package/node_modules/statuses/codes.json +0 -65
- package/node_modules/statuses/index.js +0 -146
- package/node_modules/statuses/package.json +0 -49
- package/node_modules/toidentifier/HISTORY.md +0 -9
- package/node_modules/toidentifier/LICENSE +0 -21
- package/node_modules/toidentifier/README.md +0 -61
- package/node_modules/toidentifier/index.js +0 -32
- package/node_modules/toidentifier/package.json +0 -38
- package/node_modules/unpipe/HISTORY.md +0 -4
- package/node_modules/unpipe/LICENSE +0 -22
- package/node_modules/unpipe/README.md +0 -43
- package/node_modules/unpipe/index.js +0 -69
- package/node_modules/unpipe/package.json +0 -27
- /package/dist/{lib → plugins}/withShopify.d.ts +0 -0
- /package/dist/umd/{lib → plugins}/withShopify.d.ts +0 -0
- /package/dist/umd/verification/{errors.d.ts → utils/errors.d.ts} +0 -0
- /package/dist/umd/verification/{rawbody.d.ts → utils/rawbody.d.ts} +0 -0
- /package/dist/verification/{errors.d.ts → utils/errors.d.ts} +0 -0
- /package/dist/verification/{errors.js → utils/errors.js} +0 -0
- /package/dist/verification/{rawbody.d.ts → utils/rawbody.d.ts} +0 -0
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,17 @@
|
|
|
1
|
+
# [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)
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
### Features
|
|
5
|
+
|
|
6
|
+
* removed dep on raw-body ([761931c](https://github.com/agnostack/next-shopify/commit/761931c0c76be995d7217f96874ab7eaf642a659))
|
|
7
|
+
|
|
8
|
+
# [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)
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
### Features
|
|
12
|
+
|
|
13
|
+
* added 'plugins' export for next-config ([e550e3f](https://github.com/agnostack/next-shopify/commit/e550e3f8b9a1fba2a232760cf1ca6bb946b66494))
|
|
14
|
+
|
|
1
15
|
# [1.15.0-beta.5](https://github.com/agnostack/next-shopify/compare/v1.15.0-beta.4...v1.15.0-beta.5) (2023-12-08)
|
|
2
16
|
|
|
3
17
|
|
package/dist/lib/index.d.ts
CHANGED
package/dist/lib/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/lib/index.ts"],"names":[],"mappings":"AAAA,cAAc,WAAW,CAAA;AACzB,cAAc,iBAAiB,CAAA;AAC/B,cAAc,YAAY,CAAA;AAC1B,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/lib/index.ts"],"names":[],"mappings":"AAAA,cAAc,WAAW,CAAA;AACzB,cAAc,iBAAiB,CAAA;AAC/B,cAAc,YAAY,CAAA;AAC1B,OAAO,EACL,iBAAiB,EACjB,cAAc,EACf,MAAM,SAAS,CAAA"}
|
package/dist/lib/index.js
CHANGED
package/dist/lib/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/lib/index.ts"],"names":[],"mappings":"AAAA,cAAc,WAAW,CAAA;AACzB,cAAc,iBAAiB,CAAA;AAC/B,cAAc,YAAY,CAAA;AAC1B,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/lib/index.ts"],"names":[],"mappings":"AAAA,cAAc,WAAW,CAAA;AACzB,cAAc,iBAAiB,CAAA;AAC/B,cAAc,YAAY,CAAA;AAC1B,OAAO,EACL,iBAAiB,EACjB,cAAc,EACf,MAAM,SAAS,CAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/plugins/index.ts"],"names":[],"mappings":"AAAA,cAAc,eAAe,CAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/plugins/index.ts"],"names":[],"mappings":"AAAA,cAAc,eAAe,CAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
//# sourceMappingURL=types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/plugins/types.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
//# sourceMappingURL=types.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../src/plugins/types.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"withShopify.d.ts","sourceRoot":"","sources":["../../src/plugins/withShopify.js"],"names":[],"mappings":"AA0BO;;;;iBAmZN"}
|
|
@@ -21,7 +21,7 @@ var __rest = (this && this.__rest) || function (s, e) {
|
|
|
21
21
|
import { LATEST_API_VERSION } from '@shopify/shopify-api';
|
|
22
22
|
import { ensureArray, getPrompts } from '@agnostack/next-plugins';
|
|
23
23
|
import { isTrue, arrayEmpty, arrayNotEmpty, objectNotEmpty, stringNotEmpty, ensureString, ensureObject, BILLING_INTERVALS, PAGE_ROUTE_NAMES, API_ROUTE_NAMES, API_WEBHOOK_TOPICS, } from '../shared';
|
|
24
|
-
import { generateHMAC, generatePaymentConfig, } from '
|
|
24
|
+
import { generateHMAC, generatePaymentConfig, } from '../lib/utils';
|
|
25
25
|
const VALID_WEBHOOK_TOPICS = Object.values(API_WEBHOOK_TOPICS);
|
|
26
26
|
// NOTE: 'defaultConfig' is here in case we need anything from it
|
|
27
27
|
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"withShopify.js","sourceRoot":"","sources":["../../src/plugins/withShopify.js"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA,OAAO,EAAE,kBAAkB,EAAE,MAAM,sBAAsB,CAAA;AAEzD,OAAO,EAAE,WAAW,EAAE,UAAU,EAAE,MAAM,yBAAyB,CAAA;AAEjE,OAAO,EACL,MAAM,EACN,UAAU,EACV,aAAa,EACb,cAAc,EACd,cAAc,EACd,YAAY,EACZ,YAAY,EACZ,iBAAiB,EACjB,gBAAgB,EAChB,eAAe,EACf,kBAAkB,GACnB,MAAM,WAAW,CAAA;AAClB,OAAO,EACL,YAAY,EACZ,qB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"index.d.ts","sourceRoot":"","sources":["../../src/lib/index.ts"],"names":[],"mappings":"AAAA,cAAc,WAAW,CAAA;AACzB,cAAc,iBAAiB,CAAA;AAC/B,cAAc,YAAY,CAAA;AAC1B,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/lib/index.ts"],"names":[],"mappings":"AAAA,cAAc,WAAW,CAAA;AACzB,cAAc,iBAAiB,CAAA;AAC/B,cAAc,YAAY,CAAA;AAC1B,OAAO,EACL,iBAAiB,EACjB,cAAc,EACf,MAAM,SAAS,CAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/plugins/index.ts"],"names":[],"mappings":"AAAA,cAAc,eAAe,CAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
//# sourceMappingURL=types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/plugins/types.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"withShopify.d.ts","sourceRoot":"","sources":["../../src/plugins/withShopify.js"],"names":[],"mappings":"AA0BO;;;;iBAmZN"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"errors.d.ts","sourceRoot":"","sources":["../../../src/verification/utils/errors.js"],"names":[],"mappings":"AAAA;IACE,sCAOC;IAJC,UAAgB;IAChB,UAAgB;CAInB"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/verification/utils/index.js"],"names":[],"mappings":""}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"rawbody.d.ts","sourceRoot":"","sources":["../../../src/verification/utils/rawbody.js"],"names":[],"mappings":"AAeO,sDAmBN"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"verification.d.ts","sourceRoot":"","sources":["../../src/verification/verification.js"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"verification.d.ts","sourceRoot":"","sources":["../../src/verification/verification.js"],"names":[],"mappings":"AAgBO;;;;;;GA2FN"}
|
package/dist/umd/verification.js
CHANGED
|
@@ -1,14 +1,8 @@
|
|
|
1
1
|
(function (global, factory) {
|
|
2
|
-
typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports) :
|
|
3
|
-
typeof define === 'function' && define.amd ? define(['exports'], factory) :
|
|
4
|
-
(global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory(global["@agnostack/next-shopify/umd-verification"] = {}));
|
|
5
|
-
})(this, (function (exports) { 'use strict';
|
|
6
|
-
|
|
7
|
-
var n,r=((n=function(){return r}).toString=n.toLocaleString=n[Symbol.toPrimitive]=function(){return ""},n.valueOf=function(){return !1},new Proxy(Object.freeze(n),{get:function(n,t){return n.hasOwnProperty(t)?n[t]:r}})),u=function(n){return n===r};
|
|
8
|
-
|
|
9
|
-
let win = global.window;
|
|
10
|
-
let exists = (variable) => !u(variable);
|
|
11
|
-
let window = typeof win !== "undefined" ? win : r;
|
|
2
|
+
typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('browser-monads-ts')) :
|
|
3
|
+
typeof define === 'function' && define.amd ? define(['exports', 'browser-monads-ts'], factory) :
|
|
4
|
+
(global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory(global["@agnostack/next-shopify/umd-verification"] = {}, global["browser-monads-ts"]));
|
|
5
|
+
})(this, (function (exports, browserMonadsTs) { 'use strict';
|
|
12
6
|
|
|
13
7
|
/* eslint-disable no-use-before-define */
|
|
14
8
|
|
|
@@ -121,8 +115,8 @@
|
|
|
121
115
|
};
|
|
122
116
|
|
|
123
117
|
const getTextDecoder = async () => {
|
|
124
|
-
if (exists(window) && (typeof window?.TextDecoder === 'function')) {
|
|
125
|
-
return window.TextDecoder
|
|
118
|
+
if (browserMonadsTs.exists(browserMonadsTs.window) && (typeof browserMonadsTs.window?.TextDecoder === 'function')) {
|
|
119
|
+
return browserMonadsTs.window.TextDecoder
|
|
126
120
|
}
|
|
127
121
|
|
|
128
122
|
try {
|
|
@@ -135,8 +129,8 @@
|
|
|
135
129
|
};
|
|
136
130
|
|
|
137
131
|
const getTextEncoder = async () => {
|
|
138
|
-
if (exists(window) && (typeof window?.TextEncoder === 'function')) {
|
|
139
|
-
return window.TextEncoder
|
|
132
|
+
if (browserMonadsTs.exists(browserMonadsTs.window) && (typeof browserMonadsTs.window?.TextEncoder === 'function')) {
|
|
133
|
+
return browserMonadsTs.window.TextEncoder
|
|
140
134
|
}
|
|
141
135
|
|
|
142
136
|
try {
|
|
@@ -493,362 +487,35 @@
|
|
|
493
487
|
}
|
|
494
488
|
};
|
|
495
489
|
|
|
496
|
-
|
|
497
|
-
|
|
498
|
-
|
|
499
|
-
|
|
500
|
-
|
|
501
|
-
|
|
502
|
-
|
|
503
|
-
|
|
504
|
-
* Module dependencies.
|
|
505
|
-
* @private
|
|
506
|
-
*/
|
|
507
|
-
|
|
508
|
-
var asyncHooks = tryRequireAsyncHooks();
|
|
509
|
-
var bytes = require('bytes');
|
|
510
|
-
var createError = require('http-errors');
|
|
511
|
-
var iconv = require('iconv-lite');
|
|
512
|
-
var unpipe = require('unpipe');
|
|
513
|
-
|
|
514
|
-
/**
|
|
515
|
-
* Module exports.
|
|
516
|
-
* @public
|
|
517
|
-
*/
|
|
518
|
-
|
|
519
|
-
module.exports = getRawBody;
|
|
520
|
-
|
|
521
|
-
/**
|
|
522
|
-
* Module variables.
|
|
523
|
-
* @private
|
|
524
|
-
*/
|
|
525
|
-
|
|
526
|
-
var ICONV_ENCODING_MESSAGE_REGEXP = /^Encoding not recognized: /;
|
|
527
|
-
|
|
528
|
-
/**
|
|
529
|
-
* Get the decoder for a given encoding.
|
|
530
|
-
*
|
|
531
|
-
* @param {string} encoding
|
|
532
|
-
* @private
|
|
533
|
-
*/
|
|
534
|
-
|
|
535
|
-
function getDecoder (encoding) {
|
|
536
|
-
if (!encoding) return null
|
|
537
|
-
|
|
538
|
-
try {
|
|
539
|
-
return iconv.getDecoder(encoding)
|
|
540
|
-
} catch (e) {
|
|
541
|
-
// error getting decoder
|
|
542
|
-
if (!ICONV_ENCODING_MESSAGE_REGEXP.test(e.message)) throw e
|
|
543
|
-
|
|
544
|
-
// the encoding was not found
|
|
545
|
-
throw createError(415, 'specified encoding unsupported', {
|
|
546
|
-
encoding: encoding,
|
|
547
|
-
type: 'encoding.unsupported'
|
|
548
|
-
})
|
|
549
|
-
}
|
|
550
|
-
}
|
|
551
|
-
|
|
552
|
-
/**
|
|
553
|
-
* Get the raw body of a stream (typically HTTP).
|
|
554
|
-
*
|
|
555
|
-
* @param {object} stream
|
|
556
|
-
* @param {object|string|function} [options]
|
|
557
|
-
* @param {function} [callback]
|
|
558
|
-
* @public
|
|
559
|
-
*/
|
|
560
|
-
|
|
561
|
-
function getRawBody (stream, options, callback) {
|
|
562
|
-
var done = callback;
|
|
563
|
-
var opts = options || {};
|
|
564
|
-
|
|
565
|
-
// light validation
|
|
566
|
-
if (stream === undefined) {
|
|
567
|
-
throw new TypeError('argument stream is required')
|
|
568
|
-
} else if (typeof stream !== 'object' || stream === null || typeof stream.on !== 'function') {
|
|
569
|
-
throw new TypeError('argument stream must be a stream')
|
|
570
|
-
}
|
|
571
|
-
|
|
572
|
-
if (options === true || typeof options === 'string') {
|
|
573
|
-
// short cut for encoding
|
|
574
|
-
opts = {
|
|
575
|
-
encoding: options
|
|
576
|
-
};
|
|
577
|
-
}
|
|
578
|
-
|
|
579
|
-
if (typeof options === 'function') {
|
|
580
|
-
done = options;
|
|
581
|
-
opts = {};
|
|
582
|
-
}
|
|
583
|
-
|
|
584
|
-
// validate callback is a function, if provided
|
|
585
|
-
if (done !== undefined && typeof done !== 'function') {
|
|
586
|
-
throw new TypeError('argument callback must be a function')
|
|
587
|
-
}
|
|
588
|
-
|
|
589
|
-
// require the callback without promises
|
|
590
|
-
if (!done && !global.Promise) {
|
|
591
|
-
throw new TypeError('argument callback is required')
|
|
592
|
-
}
|
|
593
|
-
|
|
594
|
-
// get encoding
|
|
595
|
-
var encoding = opts.encoding !== true
|
|
596
|
-
? opts.encoding
|
|
597
|
-
: 'utf-8';
|
|
598
|
-
|
|
599
|
-
// convert the limit to an integer
|
|
600
|
-
var limit = bytes.parse(opts.limit);
|
|
601
|
-
|
|
602
|
-
// convert the expected length to an integer
|
|
603
|
-
var length = opts.length != null && !isNaN(opts.length)
|
|
604
|
-
? parseInt(opts.length, 10)
|
|
605
|
-
: null;
|
|
606
|
-
|
|
607
|
-
if (done) {
|
|
608
|
-
// classic callback style
|
|
609
|
-
return readStream(stream, encoding, length, limit, wrap(done))
|
|
610
|
-
}
|
|
611
|
-
|
|
612
|
-
return new Promise(function executor (resolve, reject) {
|
|
613
|
-
readStream(stream, encoding, length, limit, function onRead (err, buf) {
|
|
614
|
-
if (err) return reject(err)
|
|
615
|
-
resolve(buf);
|
|
616
|
-
});
|
|
617
|
-
})
|
|
618
|
-
}
|
|
619
|
-
|
|
620
|
-
/**
|
|
621
|
-
* Halt a stream.
|
|
622
|
-
*
|
|
623
|
-
* @param {Object} stream
|
|
624
|
-
* @private
|
|
625
|
-
*/
|
|
626
|
-
|
|
627
|
-
function halt (stream) {
|
|
628
|
-
// unpipe everything from the stream
|
|
629
|
-
unpipe(stream);
|
|
630
|
-
|
|
631
|
-
// pause stream
|
|
632
|
-
if (typeof stream.pause === 'function') {
|
|
633
|
-
stream.pause();
|
|
634
|
-
}
|
|
635
|
-
}
|
|
636
|
-
|
|
637
|
-
/**
|
|
638
|
-
* Read the data from the stream.
|
|
639
|
-
*
|
|
640
|
-
* @param {object} stream
|
|
641
|
-
* @param {string} encoding
|
|
642
|
-
* @param {number} length
|
|
643
|
-
* @param {number} limit
|
|
644
|
-
* @param {function} callback
|
|
645
|
-
* @public
|
|
646
|
-
*/
|
|
647
|
-
|
|
648
|
-
function readStream (stream, encoding, length, limit, callback) {
|
|
649
|
-
var complete = false;
|
|
650
|
-
var sync = true;
|
|
651
|
-
|
|
652
|
-
// check the length and limit options.
|
|
653
|
-
// note: we intentionally leave the stream paused,
|
|
654
|
-
// so users should handle the stream themselves.
|
|
655
|
-
if (limit !== null && length !== null && length > limit) {
|
|
656
|
-
return done(createError(413, 'request entity too large', {
|
|
657
|
-
expected: length,
|
|
658
|
-
length: length,
|
|
659
|
-
limit: limit,
|
|
660
|
-
type: 'entity.too.large'
|
|
661
|
-
}))
|
|
662
|
-
}
|
|
663
|
-
|
|
664
|
-
// streams1: assert request encoding is buffer.
|
|
665
|
-
// streams2+: assert the stream encoding is buffer.
|
|
666
|
-
// stream._decoder: streams1
|
|
667
|
-
// state.encoding: streams2
|
|
668
|
-
// state.decoder: streams2, specifically < 0.10.6
|
|
669
|
-
var state = stream._readableState;
|
|
670
|
-
if (stream._decoder || (state && (state.encoding || state.decoder))) {
|
|
671
|
-
// developer error
|
|
672
|
-
return done(createError(500, 'stream encoding should not be set', {
|
|
673
|
-
type: 'stream.encoding.set'
|
|
674
|
-
}))
|
|
675
|
-
}
|
|
676
|
-
|
|
677
|
-
if (typeof stream.readable !== 'undefined' && !stream.readable) {
|
|
678
|
-
return done(createError(500, 'stream is not readable', {
|
|
679
|
-
type: 'stream.not.readable'
|
|
680
|
-
}))
|
|
681
|
-
}
|
|
682
|
-
|
|
683
|
-
var received = 0;
|
|
684
|
-
var decoder;
|
|
685
|
-
|
|
686
|
-
try {
|
|
687
|
-
decoder = getDecoder(encoding);
|
|
688
|
-
} catch (err) {
|
|
689
|
-
return done(err)
|
|
690
|
-
}
|
|
691
|
-
|
|
692
|
-
var buffer = decoder
|
|
693
|
-
? ''
|
|
694
|
-
: [];
|
|
695
|
-
|
|
696
|
-
// attach listeners
|
|
697
|
-
stream.on('aborted', onAborted);
|
|
698
|
-
stream.on('close', cleanup);
|
|
699
|
-
stream.on('data', onData);
|
|
700
|
-
stream.on('end', onEnd);
|
|
701
|
-
stream.on('error', onEnd);
|
|
702
|
-
|
|
703
|
-
// mark sync section complete
|
|
704
|
-
sync = false;
|
|
705
|
-
|
|
706
|
-
function done () {
|
|
707
|
-
var args = new Array(arguments.length);
|
|
708
|
-
|
|
709
|
-
// copy arguments
|
|
710
|
-
for (var i = 0; i < args.length; i++) {
|
|
711
|
-
args[i] = arguments[i];
|
|
712
|
-
}
|
|
713
|
-
|
|
714
|
-
// mark complete
|
|
715
|
-
complete = true;
|
|
716
|
-
|
|
717
|
-
if (sync) {
|
|
718
|
-
process.nextTick(invokeCallback);
|
|
719
|
-
} else {
|
|
720
|
-
invokeCallback();
|
|
721
|
-
}
|
|
722
|
-
|
|
723
|
-
function invokeCallback () {
|
|
724
|
-
cleanup();
|
|
725
|
-
|
|
726
|
-
if (args[0]) {
|
|
727
|
-
// halt the stream on error
|
|
728
|
-
halt(stream);
|
|
729
|
-
}
|
|
730
|
-
|
|
731
|
-
callback.apply(null, args);
|
|
732
|
-
}
|
|
733
|
-
}
|
|
734
|
-
|
|
735
|
-
function onAborted () {
|
|
736
|
-
if (complete) return
|
|
737
|
-
|
|
738
|
-
done(createError(400, 'request aborted', {
|
|
739
|
-
code: 'ECONNABORTED',
|
|
740
|
-
expected: length,
|
|
741
|
-
length: length,
|
|
742
|
-
received: received,
|
|
743
|
-
type: 'request.aborted'
|
|
744
|
-
}));
|
|
745
|
-
}
|
|
746
|
-
|
|
747
|
-
function onData (chunk) {
|
|
748
|
-
if (complete) return
|
|
749
|
-
|
|
750
|
-
received += chunk.length;
|
|
751
|
-
|
|
752
|
-
if (limit !== null && received > limit) {
|
|
753
|
-
done(createError(413, 'request entity too large', {
|
|
754
|
-
limit: limit,
|
|
755
|
-
received: received,
|
|
756
|
-
type: 'entity.too.large'
|
|
757
|
-
}));
|
|
758
|
-
} else if (decoder) {
|
|
759
|
-
buffer += decoder.write(chunk);
|
|
760
|
-
} else {
|
|
761
|
-
buffer.push(chunk);
|
|
762
|
-
}
|
|
763
|
-
}
|
|
764
|
-
|
|
765
|
-
function onEnd (err) {
|
|
766
|
-
if (complete) return
|
|
767
|
-
if (err) return done(err)
|
|
768
|
-
|
|
769
|
-
if (length !== null && received !== length) {
|
|
770
|
-
done(createError(400, 'request size did not match content length', {
|
|
771
|
-
expected: length,
|
|
772
|
-
length: length,
|
|
773
|
-
received: received,
|
|
774
|
-
type: 'request.size.invalid'
|
|
775
|
-
}));
|
|
776
|
-
} else {
|
|
777
|
-
var string = decoder
|
|
778
|
-
? buffer + (decoder.end() || '')
|
|
779
|
-
: Buffer.concat(buffer);
|
|
780
|
-
done(null, string);
|
|
781
|
-
}
|
|
782
|
-
}
|
|
783
|
-
|
|
784
|
-
function cleanup () {
|
|
785
|
-
buffer = null;
|
|
786
|
-
|
|
787
|
-
stream.removeListener('aborted', onAborted);
|
|
788
|
-
stream.removeListener('data', onData);
|
|
789
|
-
stream.removeListener('end', onEnd);
|
|
790
|
-
stream.removeListener('error', onEnd);
|
|
791
|
-
stream.removeListener('close', cleanup);
|
|
792
|
-
}
|
|
793
|
-
}
|
|
794
|
-
|
|
795
|
-
/**
|
|
796
|
-
* Try to require async_hooks
|
|
797
|
-
* @private
|
|
798
|
-
*/
|
|
799
|
-
|
|
800
|
-
function tryRequireAsyncHooks () {
|
|
801
|
-
try {
|
|
802
|
-
return require('async_hooks')
|
|
803
|
-
} catch (e) {
|
|
804
|
-
return {}
|
|
805
|
-
}
|
|
806
|
-
}
|
|
807
|
-
|
|
808
|
-
/**
|
|
809
|
-
* Wrap function with async resource, if possible.
|
|
810
|
-
* AsyncResource.bind static method backported.
|
|
811
|
-
* @private
|
|
812
|
-
*/
|
|
813
|
-
|
|
814
|
-
function wrap (fn) {
|
|
815
|
-
var res;
|
|
816
|
-
|
|
817
|
-
// create anonymous resource
|
|
818
|
-
if (asyncHooks.AsyncResource) {
|
|
819
|
-
res = new asyncHooks.AsyncResource(fn.name || 'bound-anonymous-fn');
|
|
820
|
-
}
|
|
821
|
-
|
|
822
|
-
// incompatible node.js
|
|
823
|
-
if (!res || !res.runInAsyncScope) {
|
|
824
|
-
return fn
|
|
490
|
+
class VerificationError extends Error {
|
|
491
|
+
constructor(message, _data) {
|
|
492
|
+
super(message);
|
|
493
|
+
const { code = 500, ...data } = _data ?? {};
|
|
494
|
+
this.code = code;
|
|
495
|
+
this.data = data;
|
|
496
|
+
this.name = 'VerificationError';
|
|
497
|
+
Object.setPrototypeOf(this, VerificationError.prototype);
|
|
825
498
|
}
|
|
826
|
-
|
|
827
|
-
// return bound function
|
|
828
|
-
return res.runInAsyncScope.bind(res, fn, null)
|
|
829
499
|
}
|
|
830
500
|
|
|
831
|
-
var getRawBody$1 = /*#__PURE__*/Object.freeze({
|
|
832
|
-
__proto__: null
|
|
833
|
-
});
|
|
834
|
-
|
|
835
501
|
// import getRawBody from 'raw-body'
|
|
502
|
+
// import * as getRawBody from 'raw-body'
|
|
836
503
|
|
|
837
|
-
|
|
838
|
-
|
|
504
|
+
const getChunkedRawBody = async (readable) => {
|
|
505
|
+
const chunks = [];
|
|
839
506
|
|
|
840
|
-
|
|
841
|
-
|
|
842
|
-
|
|
507
|
+
for await (const chunk of readable) {
|
|
508
|
+
chunks.push(typeof chunk === "string" ? Buffer.from(chunk) : chunk);
|
|
509
|
+
}
|
|
843
510
|
|
|
844
|
-
|
|
845
|
-
|
|
511
|
+
return Buffer.concat(chunks)
|
|
512
|
+
};
|
|
846
513
|
|
|
847
514
|
// TODO: explore returning mutated request object adding on req.rawBody??
|
|
848
515
|
// TODO: move to req.text() after next 13.5: https://github.com/vercel/next.js/discussions/13405
|
|
849
516
|
const ensureRawBody = async (req) => (
|
|
850
|
-
|
|
851
|
-
getRawBody
|
|
517
|
+
getChunkedRawBody(req)
|
|
518
|
+
// getRawBody(req)
|
|
852
519
|
.then((_rawBody) => _rawBody.toString())
|
|
853
520
|
.catch((error) => {
|
|
854
521
|
// NOTE: this is intended to ensure if getRawBody is called 2x w/in a route that it returns the already streamed body
|
|
@@ -867,17 +534,6 @@
|
|
|
867
534
|
})
|
|
868
535
|
);
|
|
869
536
|
|
|
870
|
-
class VerificationError extends Error {
|
|
871
|
-
constructor(message, _data) {
|
|
872
|
-
super(message);
|
|
873
|
-
const { code = 500, ...data } = _data ?? {};
|
|
874
|
-
this.code = code;
|
|
875
|
-
this.data = data;
|
|
876
|
-
this.name = 'VerificationError';
|
|
877
|
-
Object.setPrototypeOf(this, VerificationError.prototype);
|
|
878
|
-
}
|
|
879
|
-
}
|
|
880
|
-
|
|
881
537
|
const getVerificationHelpers = ({ keyPairs }) => (
|
|
882
538
|
async (req, params) => {
|
|
883
539
|
const {
|