react-easy-wall 1.0.5 → 1.0.6
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/dist/cjs/_virtual/after-task-async-storage-instance.js +6 -0
- package/dist/cjs/_virtual/after-task-async-storage-instance.js.map +1 -0
- package/dist/cjs/_virtual/after-task-async-storage.external.js +6 -0
- package/dist/cjs/_virtual/after-task-async-storage.external.js.map +1 -0
- package/dist/cjs/_virtual/cookies.js +6 -0
- package/dist/cjs/_virtual/cookies.js.map +1 -0
- package/dist/cjs/_virtual/cookies2.js +6 -0
- package/dist/cjs/_virtual/cookies2.js.map +1 -0
- package/dist/cjs/_virtual/create-deduped-by-callsite-server-error-logger.js +6 -0
- package/dist/cjs/_virtual/create-deduped-by-callsite-server-error-logger.js.map +1 -0
- package/dist/cjs/_virtual/draft-mode.js +6 -0
- package/dist/cjs/_virtual/draft-mode.js.map +1 -0
- package/dist/cjs/_virtual/headers.js +8 -0
- package/dist/cjs/_virtual/headers.js.map +1 -0
- package/dist/cjs/_virtual/headers2.js +6 -0
- package/dist/cjs/_virtual/headers2.js.map +1 -0
- package/dist/cjs/_virtual/headers3.js +6 -0
- package/dist/cjs/_virtual/headers3.js.map +1 -0
- package/dist/cjs/_virtual/headers4.js +6 -0
- package/dist/cjs/_virtual/headers4.js.map +1 -0
- package/dist/cjs/_virtual/reflect.js +6 -0
- package/dist/cjs/_virtual/reflect.js.map +1 -0
- package/dist/cjs/_virtual/request-cookies.js +6 -0
- package/dist/cjs/_virtual/request-cookies.js.map +1 -0
- package/dist/cjs/_virtual/utils.js +6 -0
- package/dist/cjs/_virtual/utils.js.map +1 -0
- package/dist/cjs/components/session/SessionProvider.js +3 -12
- package/dist/cjs/components/session/SessionProvider.js.map +1 -1
- package/dist/cjs/components/session/session.server.actions.js +33 -0
- package/dist/cjs/components/session/session.server.actions.js.map +1 -0
- package/dist/cjs/node_modules/next/dist/compiled/@edge-runtime/cookies/index.js +343 -0
- package/dist/cjs/node_modules/next/dist/compiled/@edge-runtime/cookies/index.js.map +1 -0
- package/dist/cjs/node_modules/next/dist/server/app-render/after-task-async-storage-instance.js +30 -0
- package/dist/cjs/node_modules/next/dist/server/app-render/after-task-async-storage-instance.js.map +1 -0
- package/dist/cjs/node_modules/next/dist/server/app-render/after-task-async-storage.external.js +29 -0
- package/dist/cjs/node_modules/next/dist/server/app-render/after-task-async-storage.external.js.map +1 -0
- package/dist/cjs/node_modules/next/dist/server/create-deduped-by-callsite-server-error-logger.js +112 -0
- package/dist/cjs/node_modules/next/dist/server/create-deduped-by-callsite-server-error-logger.js.map +1 -0
- package/dist/cjs/node_modules/next/dist/server/request/cookies.js +415 -0
- package/dist/cjs/node_modules/next/dist/server/request/cookies.js.map +1 -0
- package/dist/cjs/node_modules/next/dist/server/request/draft-mode.js +293 -0
- package/dist/cjs/node_modules/next/dist/server/request/draft-mode.js.map +1 -0
- package/dist/cjs/node_modules/next/dist/server/request/headers.js +366 -0
- package/dist/cjs/node_modules/next/dist/server/request/headers.js.map +1 -0
- package/dist/cjs/node_modules/next/dist/server/request/utils.js +73 -0
- package/dist/cjs/node_modules/next/dist/server/request/utils.js.map +1 -0
- package/dist/cjs/node_modules/next/dist/server/web/spec-extension/adapters/headers.js +204 -0
- package/dist/cjs/node_modules/next/dist/server/web/spec-extension/adapters/headers.js.map +1 -0
- package/dist/cjs/node_modules/next/dist/server/web/spec-extension/adapters/reflect.js +45 -0
- package/dist/cjs/node_modules/next/dist/server/web/spec-extension/adapters/reflect.js.map +1 -0
- package/dist/cjs/node_modules/next/dist/server/web/spec-extension/adapters/request-cookies.js +218 -0
- package/dist/cjs/node_modules/next/dist/server/web/spec-extension/adapters/request-cookies.js.map +1 -0
- package/dist/cjs/node_modules/next/dist/server/web/spec-extension/cookies.js +40 -0
- package/dist/cjs/node_modules/next/dist/server/web/spec-extension/cookies.js.map +1 -0
- package/dist/cjs/node_modules/next/headers.js +20 -0
- package/dist/cjs/node_modules/next/headers.js.map +1 -0
- package/dist/esm/_virtual/after-task-async-storage-instance.js +4 -0
- package/dist/esm/_virtual/after-task-async-storage-instance.js.map +1 -0
- package/dist/esm/_virtual/after-task-async-storage.external.js +4 -0
- package/dist/esm/_virtual/after-task-async-storage.external.js.map +1 -0
- package/dist/esm/_virtual/cookies.js +4 -0
- package/dist/esm/_virtual/cookies.js.map +1 -0
- package/dist/esm/_virtual/cookies2.js +4 -0
- package/dist/esm/_virtual/cookies2.js.map +1 -0
- package/dist/esm/_virtual/create-deduped-by-callsite-server-error-logger.js +4 -0
- package/dist/esm/_virtual/create-deduped-by-callsite-server-error-logger.js.map +1 -0
- package/dist/esm/_virtual/draft-mode.js +4 -0
- package/dist/esm/_virtual/draft-mode.js.map +1 -0
- package/dist/esm/_virtual/headers.js +6 -0
- package/dist/esm/_virtual/headers.js.map +1 -0
- package/dist/esm/_virtual/headers2.js +4 -0
- package/dist/esm/_virtual/headers2.js.map +1 -0
- package/dist/esm/_virtual/headers3.js +4 -0
- package/dist/esm/_virtual/headers3.js.map +1 -0
- package/dist/esm/_virtual/headers4.js +4 -0
- package/dist/esm/_virtual/headers4.js.map +1 -0
- package/dist/esm/_virtual/reflect.js +4 -0
- package/dist/esm/_virtual/reflect.js.map +1 -0
- package/dist/esm/_virtual/request-cookies.js +4 -0
- package/dist/esm/_virtual/request-cookies.js.map +1 -0
- package/dist/esm/_virtual/utils.js +4 -0
- package/dist/esm/_virtual/utils.js.map +1 -0
- package/dist/esm/components/session/SessionProvider.js +3 -12
- package/dist/esm/components/session/SessionProvider.js.map +1 -1
- package/dist/esm/components/session/session.server.actions.js +31 -0
- package/dist/esm/components/session/session.server.actions.js.map +1 -0
- package/dist/esm/node_modules/next/dist/compiled/@edge-runtime/cookies/index.js +341 -0
- package/dist/esm/node_modules/next/dist/compiled/@edge-runtime/cookies/index.js.map +1 -0
- package/dist/esm/node_modules/next/dist/server/app-render/after-task-async-storage-instance.js +28 -0
- package/dist/esm/node_modules/next/dist/server/app-render/after-task-async-storage-instance.js.map +1 -0
- package/dist/esm/node_modules/next/dist/server/app-render/after-task-async-storage.external.js +27 -0
- package/dist/esm/node_modules/next/dist/server/app-render/after-task-async-storage.external.js.map +1 -0
- package/dist/esm/node_modules/next/dist/server/create-deduped-by-callsite-server-error-logger.js +110 -0
- package/dist/esm/node_modules/next/dist/server/create-deduped-by-callsite-server-error-logger.js.map +1 -0
- package/dist/esm/node_modules/next/dist/server/request/cookies.js +413 -0
- package/dist/esm/node_modules/next/dist/server/request/cookies.js.map +1 -0
- package/dist/esm/node_modules/next/dist/server/request/draft-mode.js +291 -0
- package/dist/esm/node_modules/next/dist/server/request/draft-mode.js.map +1 -0
- package/dist/esm/node_modules/next/dist/server/request/headers.js +364 -0
- package/dist/esm/node_modules/next/dist/server/request/headers.js.map +1 -0
- package/dist/esm/node_modules/next/dist/server/request/utils.js +71 -0
- package/dist/esm/node_modules/next/dist/server/request/utils.js.map +1 -0
- package/dist/esm/node_modules/next/dist/server/web/spec-extension/adapters/headers.js +202 -0
- package/dist/esm/node_modules/next/dist/server/web/spec-extension/adapters/headers.js.map +1 -0
- package/dist/esm/node_modules/next/dist/server/web/spec-extension/adapters/reflect.js +43 -0
- package/dist/esm/node_modules/next/dist/server/web/spec-extension/adapters/reflect.js.map +1 -0
- package/dist/esm/node_modules/next/dist/server/web/spec-extension/adapters/request-cookies.js +216 -0
- package/dist/esm/node_modules/next/dist/server/web/spec-extension/adapters/request-cookies.js.map +1 -0
- package/dist/esm/node_modules/next/dist/server/web/spec-extension/cookies.js +38 -0
- package/dist/esm/node_modules/next/dist/server/web/spec-extension/cookies.js.map +1 -0
- package/dist/esm/node_modules/next/headers.js +18 -0
- package/dist/esm/node_modules/next/headers.js.map +1 -0
- package/dist/esm/types/components/session/session.server.actions.d.ts +50 -0
- package/dist/esm/types/config/config.types.d.ts +1 -0
- package/dist/index.d.ts +1 -0
- package/package.json +1 -1
package/dist/cjs/node_modules/next/dist/server/app-render/after-task-async-storage-instance.js
ADDED
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var afterTaskAsyncStorageInstance = require('../../../../../_virtual/after-task-async-storage-instance.js');
|
|
4
|
+
var asyncLocalStorage = require('./async-local-storage.js');
|
|
5
|
+
|
|
6
|
+
var hasRequiredAfterTaskAsyncStorageInstance;
|
|
7
|
+
|
|
8
|
+
function requireAfterTaskAsyncStorageInstance () {
|
|
9
|
+
if (hasRequiredAfterTaskAsyncStorageInstance) return afterTaskAsyncStorageInstance.__exports;
|
|
10
|
+
hasRequiredAfterTaskAsyncStorageInstance = 1;
|
|
11
|
+
(function (exports$1) {
|
|
12
|
+
Object.defineProperty(exports$1, "__esModule", {
|
|
13
|
+
value: true
|
|
14
|
+
});
|
|
15
|
+
Object.defineProperty(exports$1, "afterTaskAsyncStorageInstance", {
|
|
16
|
+
enumerable: true,
|
|
17
|
+
get: function() {
|
|
18
|
+
return afterTaskAsyncStorageInstance;
|
|
19
|
+
}
|
|
20
|
+
});
|
|
21
|
+
const _asynclocalstorage = asyncLocalStorage.__require();
|
|
22
|
+
const afterTaskAsyncStorageInstance = (0, _asynclocalstorage.createAsyncLocalStorage)();
|
|
23
|
+
|
|
24
|
+
|
|
25
|
+
} (afterTaskAsyncStorageInstance.__exports));
|
|
26
|
+
return afterTaskAsyncStorageInstance.__exports;
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
exports.__require = requireAfterTaskAsyncStorageInstance;
|
|
30
|
+
//# sourceMappingURL=after-task-async-storage-instance.js.map
|
package/dist/cjs/node_modules/next/dist/server/app-render/after-task-async-storage-instance.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"after-task-async-storage-instance.js","sources":["../../../../../../../node_modules/next/dist/server/app-render/after-task-async-storage-instance.js"],"sourcesContent":["\"use strict\";\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nObject.defineProperty(exports, \"afterTaskAsyncStorageInstance\", {\n enumerable: true,\n get: function() {\n return afterTaskAsyncStorageInstance;\n }\n});\nconst _asynclocalstorage = require(\"./async-local-storage\");\nconst afterTaskAsyncStorageInstance = (0, _asynclocalstorage.createAsyncLocalStorage)();\n\n//# sourceMappingURL=after-task-async-storage-instance.js.map"],"names":["exports","require$$0"],"mappings":";;;;;;;;;;;AACA,EAAA,MAAM,CAAC,cAAc,CAAAA,SAAA,EAAU,YAAY,EAAE;AAC7C,MAAI,KAAK,EAAE;AACX,GAAC,CAAC;AACF,EAAA,MAAM,CAAC,cAAc,CAACA,SAAO,EAAE,+BAA+B,EAAE;MAC5D,UAAU,EAAE,IAAI;MAChB,GAAG,EAAE,WAAW;AACpB,UAAQ,OAAO,6BAA6B;AAC5C,MAAA;AACA,GAAC,CAAC;EACF,MAAM,kBAAkB,GAAGC,2BAAA,EAAgC;EAC3D,MAAM,6BAA6B,GAAG,IAAI,kBAAkB,CAAC,uBAAuB,GAAG;;AAEvF;;;;;;;","x_google_ignoreList":[0]}
|
package/dist/cjs/node_modules/next/dist/server/app-render/after-task-async-storage.external.js
ADDED
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var afterTaskAsyncStorage_external = require('../../../../../_virtual/after-task-async-storage.external.js');
|
|
4
|
+
var afterTaskAsyncStorageInstance = require('./after-task-async-storage-instance.js');
|
|
5
|
+
|
|
6
|
+
var hasRequiredAfterTaskAsyncStorage_external;
|
|
7
|
+
|
|
8
|
+
function requireAfterTaskAsyncStorage_external () {
|
|
9
|
+
if (hasRequiredAfterTaskAsyncStorage_external) return afterTaskAsyncStorage_external.__exports;
|
|
10
|
+
hasRequiredAfterTaskAsyncStorage_external = 1;
|
|
11
|
+
(function (exports$1) {
|
|
12
|
+
Object.defineProperty(exports$1, "__esModule", {
|
|
13
|
+
value: true
|
|
14
|
+
});
|
|
15
|
+
Object.defineProperty(exports$1, "afterTaskAsyncStorage", {
|
|
16
|
+
enumerable: true,
|
|
17
|
+
get: function() {
|
|
18
|
+
return _aftertaskasyncstorageinstance.afterTaskAsyncStorageInstance;
|
|
19
|
+
}
|
|
20
|
+
});
|
|
21
|
+
const _aftertaskasyncstorageinstance = afterTaskAsyncStorageInstance.__require();
|
|
22
|
+
|
|
23
|
+
|
|
24
|
+
} (afterTaskAsyncStorage_external.__exports));
|
|
25
|
+
return afterTaskAsyncStorage_external.__exports;
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
exports.__require = requireAfterTaskAsyncStorage_external;
|
|
29
|
+
//# sourceMappingURL=after-task-async-storage.external.js.map
|
package/dist/cjs/node_modules/next/dist/server/app-render/after-task-async-storage.external.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"after-task-async-storage.external.js","sources":["../../../../../../../node_modules/next/dist/server/app-render/after-task-async-storage.external.js"],"sourcesContent":["\"use strict\";\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nObject.defineProperty(exports, \"afterTaskAsyncStorage\", {\n enumerable: true,\n get: function() {\n return _aftertaskasyncstorageinstance.afterTaskAsyncStorageInstance;\n }\n});\nconst _aftertaskasyncstorageinstance = require(\"./after-task-async-storage-instance\");\n\n//# sourceMappingURL=after-task-async-storage.external.js.map"],"names":["exports","require$$0"],"mappings":";;;;;;;;;;;AACA,EAAA,MAAM,CAAC,cAAc,CAAAA,SAAA,EAAU,YAAY,EAAE;AAC7C,MAAI,KAAK,EAAE;AACX,GAAC,CAAC;AACF,EAAA,MAAM,CAAC,cAAc,CAACA,SAAO,EAAE,uBAAuB,EAAE;MACpD,UAAU,EAAE,IAAI;MAChB,GAAG,EAAE,WAAW;UACZ,OAAO,8BAA8B,CAAC,6BAA6B;AAC3E,MAAA;AACA,GAAC,CAAC;EACF,MAAM,8BAA8B,GAAGC,uCAAA,EAA8C;;AAErF;;;;;;;","x_google_ignoreList":[0]}
|
package/dist/cjs/node_modules/next/dist/server/create-deduped-by-callsite-server-error-logger.js
ADDED
|
@@ -0,0 +1,112 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var createDedupedByCallsiteServerErrorLogger = require('../../../../_virtual/create-deduped-by-callsite-server-error-logger.js');
|
|
4
|
+
var React = require('react');
|
|
5
|
+
|
|
6
|
+
var hasRequiredCreateDedupedByCallsiteServerErrorLogger;
|
|
7
|
+
|
|
8
|
+
function requireCreateDedupedByCallsiteServerErrorLogger () {
|
|
9
|
+
if (hasRequiredCreateDedupedByCallsiteServerErrorLogger) return createDedupedByCallsiteServerErrorLogger.__exports;
|
|
10
|
+
hasRequiredCreateDedupedByCallsiteServerErrorLogger = 1;
|
|
11
|
+
(function (exports$1) {
|
|
12
|
+
Object.defineProperty(exports$1, "__esModule", {
|
|
13
|
+
value: true
|
|
14
|
+
});
|
|
15
|
+
Object.defineProperty(exports$1, "createDedupedByCallsiteServerErrorLoggerDev", {
|
|
16
|
+
enumerable: true,
|
|
17
|
+
get: function() {
|
|
18
|
+
return createDedupedByCallsiteServerErrorLoggerDev;
|
|
19
|
+
}
|
|
20
|
+
});
|
|
21
|
+
const _react = /*#__PURE__*/ _interop_require_wildcard(React);
|
|
22
|
+
function _getRequireWildcardCache(nodeInterop) {
|
|
23
|
+
if (typeof WeakMap !== "function") return null;
|
|
24
|
+
var cacheBabelInterop = new WeakMap();
|
|
25
|
+
var cacheNodeInterop = new WeakMap();
|
|
26
|
+
return (_getRequireWildcardCache = function(nodeInterop) {
|
|
27
|
+
return nodeInterop ? cacheNodeInterop : cacheBabelInterop;
|
|
28
|
+
})(nodeInterop);
|
|
29
|
+
}
|
|
30
|
+
function _interop_require_wildcard(obj, nodeInterop) {
|
|
31
|
+
if (obj && obj.__esModule) {
|
|
32
|
+
return obj;
|
|
33
|
+
}
|
|
34
|
+
if (obj === null || typeof obj !== "object" && typeof obj !== "function") {
|
|
35
|
+
return {
|
|
36
|
+
default: obj
|
|
37
|
+
};
|
|
38
|
+
}
|
|
39
|
+
var cache = _getRequireWildcardCache(nodeInterop);
|
|
40
|
+
if (cache && cache.has(obj)) {
|
|
41
|
+
return cache.get(obj);
|
|
42
|
+
}
|
|
43
|
+
var newObj = {
|
|
44
|
+
__proto__: null
|
|
45
|
+
};
|
|
46
|
+
var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor;
|
|
47
|
+
for(var key in obj){
|
|
48
|
+
if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) {
|
|
49
|
+
var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null;
|
|
50
|
+
if (desc && (desc.get || desc.set)) {
|
|
51
|
+
Object.defineProperty(newObj, key, desc);
|
|
52
|
+
} else {
|
|
53
|
+
newObj[key] = obj[key];
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
newObj.default = obj;
|
|
58
|
+
if (cache) {
|
|
59
|
+
cache.set(obj, newObj);
|
|
60
|
+
}
|
|
61
|
+
return newObj;
|
|
62
|
+
}
|
|
63
|
+
const errorRef = {
|
|
64
|
+
current: null
|
|
65
|
+
};
|
|
66
|
+
// React.cache is currently only available in canary/experimental React channels.
|
|
67
|
+
const cache = typeof _react.cache === 'function' ? _react.cache : (fn)=>fn;
|
|
68
|
+
// When Cache Components is enabled, we record these as errors so that they
|
|
69
|
+
// are captured by the dev overlay as it's more critical to fix these
|
|
70
|
+
// when enabled.
|
|
71
|
+
const logErrorOrWarn = process.env.__NEXT_CACHE_COMPONENTS ? console.error : console.warn;
|
|
72
|
+
// We don't want to dedupe across requests.
|
|
73
|
+
// The developer might've just attempted to fix the warning so we should warn again if it still happens.
|
|
74
|
+
const flushCurrentErrorIfNew = cache(// eslint-disable-next-line @typescript-eslint/no-unused-vars -- cache key
|
|
75
|
+
(key)=>{
|
|
76
|
+
try {
|
|
77
|
+
logErrorOrWarn(errorRef.current);
|
|
78
|
+
} finally{
|
|
79
|
+
errorRef.current = null;
|
|
80
|
+
}
|
|
81
|
+
});
|
|
82
|
+
function createDedupedByCallsiteServerErrorLoggerDev(getMessage) {
|
|
83
|
+
return function logDedupedError(...args) {
|
|
84
|
+
const message = getMessage(...args);
|
|
85
|
+
if (process.env.NODE_ENV !== 'production') {
|
|
86
|
+
var _stack;
|
|
87
|
+
const callStackFrames = (_stack = new Error().stack) == null ? void 0 : _stack.split('\n');
|
|
88
|
+
if (callStackFrames === undefined || callStackFrames.length < 4) {
|
|
89
|
+
logErrorOrWarn(message);
|
|
90
|
+
} else {
|
|
91
|
+
// Error:
|
|
92
|
+
// logDedupedError
|
|
93
|
+
// asyncApiBeingAccessedSynchronously
|
|
94
|
+
// <userland callsite>
|
|
95
|
+
// TODO: This breaks if sourcemaps with ignore lists are enabled.
|
|
96
|
+
const key = callStackFrames[4];
|
|
97
|
+
errorRef.current = message;
|
|
98
|
+
flushCurrentErrorIfNew(key);
|
|
99
|
+
}
|
|
100
|
+
} else {
|
|
101
|
+
logErrorOrWarn(message);
|
|
102
|
+
}
|
|
103
|
+
};
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
|
|
107
|
+
} (createDedupedByCallsiteServerErrorLogger.__exports));
|
|
108
|
+
return createDedupedByCallsiteServerErrorLogger.__exports;
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
exports.__require = requireCreateDedupedByCallsiteServerErrorLogger;
|
|
112
|
+
//# sourceMappingURL=create-deduped-by-callsite-server-error-logger.js.map
|
package/dist/cjs/node_modules/next/dist/server/create-deduped-by-callsite-server-error-logger.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"create-deduped-by-callsite-server-error-logger.js","sources":["../../../../../../node_modules/next/dist/server/create-deduped-by-callsite-server-error-logger.js"],"sourcesContent":["\"use strict\";\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nObject.defineProperty(exports, \"createDedupedByCallsiteServerErrorLoggerDev\", {\n enumerable: true,\n get: function() {\n return createDedupedByCallsiteServerErrorLoggerDev;\n }\n});\nconst _react = /*#__PURE__*/ _interop_require_wildcard(require(\"react\"));\nfunction _getRequireWildcardCache(nodeInterop) {\n if (typeof WeakMap !== \"function\") return null;\n var cacheBabelInterop = new WeakMap();\n var cacheNodeInterop = new WeakMap();\n return (_getRequireWildcardCache = function(nodeInterop) {\n return nodeInterop ? cacheNodeInterop : cacheBabelInterop;\n })(nodeInterop);\n}\nfunction _interop_require_wildcard(obj, nodeInterop) {\n if (!nodeInterop && obj && obj.__esModule) {\n return obj;\n }\n if (obj === null || typeof obj !== \"object\" && typeof obj !== \"function\") {\n return {\n default: obj\n };\n }\n var cache = _getRequireWildcardCache(nodeInterop);\n if (cache && cache.has(obj)) {\n return cache.get(obj);\n }\n var newObj = {\n __proto__: null\n };\n var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor;\n for(var key in obj){\n if (key !== \"default\" && Object.prototype.hasOwnProperty.call(obj, key)) {\n var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null;\n if (desc && (desc.get || desc.set)) {\n Object.defineProperty(newObj, key, desc);\n } else {\n newObj[key] = obj[key];\n }\n }\n }\n newObj.default = obj;\n if (cache) {\n cache.set(obj, newObj);\n }\n return newObj;\n}\nconst errorRef = {\n current: null\n};\n// React.cache is currently only available in canary/experimental React channels.\nconst cache = typeof _react.cache === 'function' ? _react.cache : (fn)=>fn;\n// When Cache Components is enabled, we record these as errors so that they\n// are captured by the dev overlay as it's more critical to fix these\n// when enabled.\nconst logErrorOrWarn = process.env.__NEXT_CACHE_COMPONENTS ? console.error : console.warn;\n// We don't want to dedupe across requests.\n// The developer might've just attempted to fix the warning so we should warn again if it still happens.\nconst flushCurrentErrorIfNew = cache(// eslint-disable-next-line @typescript-eslint/no-unused-vars -- cache key\n(key)=>{\n try {\n logErrorOrWarn(errorRef.current);\n } finally{\n errorRef.current = null;\n }\n});\nfunction createDedupedByCallsiteServerErrorLoggerDev(getMessage) {\n return function logDedupedError(...args) {\n const message = getMessage(...args);\n if (process.env.NODE_ENV !== 'production') {\n var _stack;\n const callStackFrames = (_stack = new Error().stack) == null ? void 0 : _stack.split('\\n');\n if (callStackFrames === undefined || callStackFrames.length < 4) {\n logErrorOrWarn(message);\n } else {\n // Error:\n // logDedupedError\n // asyncApiBeingAccessedSynchronously\n // <userland callsite>\n // TODO: This breaks if sourcemaps with ignore lists are enabled.\n const key = callStackFrames[4];\n errorRef.current = message;\n flushCurrentErrorIfNew(key);\n }\n } else {\n logErrorOrWarn(message);\n }\n };\n}\n\n//# sourceMappingURL=create-deduped-by-callsite-server-error-logger.js.map"],"names":["exports","require$$0"],"mappings":"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","x_google_ignoreList":[0]}
|
|
@@ -0,0 +1,415 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var cookies = require('../../../../../_virtual/cookies.js');
|
|
4
|
+
var requestCookies = require('../web/spec-extension/adapters/request-cookies.js');
|
|
5
|
+
var cookies$1 = require('../web/spec-extension/cookies.js');
|
|
6
|
+
var workAsyncStorage_external = require('../app-render/work-async-storage.external.js');
|
|
7
|
+
var workUnitAsyncStorage_external = require('../app-render/work-unit-async-storage.external.js');
|
|
8
|
+
var dynamicRendering = require('../app-render/dynamic-rendering.js');
|
|
9
|
+
var staticGenerationBailout = require('../../client/components/static-generation-bailout.js');
|
|
10
|
+
var dynamicRenderingUtils = require('../dynamic-rendering-utils.js');
|
|
11
|
+
var createDedupedByCallsiteServerErrorLogger = require('../create-deduped-by-callsite-server-error-logger.js');
|
|
12
|
+
var utils = require('./utils.js');
|
|
13
|
+
var invariantError = require('../../shared/lib/invariant-error.js');
|
|
14
|
+
var reflect = require('../web/spec-extension/adapters/reflect.js');
|
|
15
|
+
|
|
16
|
+
var hasRequiredCookies;
|
|
17
|
+
|
|
18
|
+
function requireCookies () {
|
|
19
|
+
if (hasRequiredCookies) return cookies.__exports;
|
|
20
|
+
hasRequiredCookies = 1;
|
|
21
|
+
(function (exports$1) {
|
|
22
|
+
Object.defineProperty(exports$1, "__esModule", {
|
|
23
|
+
value: true
|
|
24
|
+
});
|
|
25
|
+
Object.defineProperty(exports$1, "cookies", {
|
|
26
|
+
enumerable: true,
|
|
27
|
+
get: function() {
|
|
28
|
+
return cookies;
|
|
29
|
+
}
|
|
30
|
+
});
|
|
31
|
+
const _requestcookies = requestCookies.__require();
|
|
32
|
+
const _cookies = cookies$1.__require();
|
|
33
|
+
const _workasyncstorageexternal = workAsyncStorage_external.__require();
|
|
34
|
+
const _workunitasyncstorageexternal = workUnitAsyncStorage_external.__require();
|
|
35
|
+
const _dynamicrendering = dynamicRendering.__require();
|
|
36
|
+
const _staticgenerationbailout = staticGenerationBailout.__require();
|
|
37
|
+
const _dynamicrenderingutils = dynamicRenderingUtils.__require();
|
|
38
|
+
const _creatededupedbycallsiteservererrorlogger = createDedupedByCallsiteServerErrorLogger.__require();
|
|
39
|
+
const _utils = utils.__require();
|
|
40
|
+
const _invarianterror = invariantError.__require();
|
|
41
|
+
const _reflect = reflect.__require();
|
|
42
|
+
function cookies() {
|
|
43
|
+
const callingExpression = 'cookies';
|
|
44
|
+
const workStore = _workasyncstorageexternal.workAsyncStorage.getStore();
|
|
45
|
+
const workUnitStore = _workunitasyncstorageexternal.workUnitAsyncStorage.getStore();
|
|
46
|
+
if (workStore) {
|
|
47
|
+
if (workUnitStore && workUnitStore.phase === 'after' && !(0, _utils.isRequestAPICallableInsideAfter)()) {
|
|
48
|
+
throw Object.defineProperty(new Error(// TODO(after): clarify that this only applies to pages?
|
|
49
|
+
`Route ${workStore.route} used "cookies" inside "after(...)". This is not supported. If you need this data inside an "after" callback, use "cookies" outside of the callback. See more info here: https://nextjs.org/docs/canary/app/api-reference/functions/after`), "__NEXT_ERROR_CODE", {
|
|
50
|
+
value: "E88",
|
|
51
|
+
enumerable: false,
|
|
52
|
+
configurable: true
|
|
53
|
+
});
|
|
54
|
+
}
|
|
55
|
+
if (workStore.forceStatic) {
|
|
56
|
+
// When using forceStatic we override all other logic and always just return an empty
|
|
57
|
+
// cookies object without tracking
|
|
58
|
+
const underlyingCookies = createEmptyCookies();
|
|
59
|
+
return makeUntrackedExoticCookies(underlyingCookies);
|
|
60
|
+
}
|
|
61
|
+
if (workStore.dynamicShouldError) {
|
|
62
|
+
throw Object.defineProperty(new _staticgenerationbailout.StaticGenBailoutError(`Route ${workStore.route} with \`dynamic = "error"\` couldn't be rendered statically because it used \`cookies\`. See more info here: https://nextjs.org/docs/app/building-your-application/rendering/static-and-dynamic#dynamic-rendering`), "__NEXT_ERROR_CODE", {
|
|
63
|
+
value: "E549",
|
|
64
|
+
enumerable: false,
|
|
65
|
+
configurable: true
|
|
66
|
+
});
|
|
67
|
+
}
|
|
68
|
+
if (workUnitStore) {
|
|
69
|
+
switch(workUnitStore.type){
|
|
70
|
+
case 'cache':
|
|
71
|
+
const error = Object.defineProperty(new Error(`Route ${workStore.route} used "cookies" inside "use cache". Accessing Dynamic data sources inside a cache scope is not supported. If you need this data inside a cached function use "cookies" outside of the cached function and pass the required dynamic data in as an argument. See more info here: https://nextjs.org/docs/messages/next-request-in-use-cache`), "__NEXT_ERROR_CODE", {
|
|
72
|
+
value: "E398",
|
|
73
|
+
enumerable: false,
|
|
74
|
+
configurable: true
|
|
75
|
+
});
|
|
76
|
+
Error.captureStackTrace(error, cookies);
|
|
77
|
+
workStore.invalidDynamicUsageError ??= error;
|
|
78
|
+
throw error;
|
|
79
|
+
case 'unstable-cache':
|
|
80
|
+
throw Object.defineProperty(new Error(`Route ${workStore.route} used "cookies" inside a function cached with "unstable_cache(...)". Accessing Dynamic data sources inside a cache scope is not supported. If you need this data inside a cached function use "cookies" outside of the cached function and pass the required dynamic data in as an argument. See more info here: https://nextjs.org/docs/app/api-reference/functions/unstable_cache`), "__NEXT_ERROR_CODE", {
|
|
81
|
+
value: "E157",
|
|
82
|
+
enumerable: false,
|
|
83
|
+
configurable: true
|
|
84
|
+
});
|
|
85
|
+
case 'prerender':
|
|
86
|
+
return makeHangingCookies(workStore, workUnitStore);
|
|
87
|
+
case 'prerender-client':
|
|
88
|
+
const exportName = '`cookies`';
|
|
89
|
+
throw Object.defineProperty(new _invarianterror.InvariantError(`${exportName} must not be used within a client component. Next.js should be preventing ${exportName} from being included in client components statically, but did not in this case.`), "__NEXT_ERROR_CODE", {
|
|
90
|
+
value: "E693",
|
|
91
|
+
enumerable: false,
|
|
92
|
+
configurable: true
|
|
93
|
+
});
|
|
94
|
+
case 'prerender-ppr':
|
|
95
|
+
// We need track dynamic access here eagerly to keep continuity with
|
|
96
|
+
// how cookies has worked in PPR without cacheComponents.
|
|
97
|
+
return (0, _dynamicrendering.postponeWithTracking)(workStore.route, callingExpression, workUnitStore.dynamicTracking);
|
|
98
|
+
case 'prerender-legacy':
|
|
99
|
+
// We track dynamic access here so we don't need to wrap the cookies
|
|
100
|
+
// in individual property access tracking.
|
|
101
|
+
return (0, _dynamicrendering.throwToInterruptStaticGeneration)(callingExpression, workStore, workUnitStore);
|
|
102
|
+
case 'prerender-runtime':
|
|
103
|
+
return (0, _dynamicrendering.delayUntilRuntimeStage)(workUnitStore, makeUntrackedCookies(workUnitStore.cookies));
|
|
104
|
+
case 'private-cache':
|
|
105
|
+
if (process.env.__NEXT_CACHE_COMPONENTS) {
|
|
106
|
+
return makeUntrackedCookies(workUnitStore.cookies);
|
|
107
|
+
}
|
|
108
|
+
return makeUntrackedExoticCookies(workUnitStore.cookies);
|
|
109
|
+
case 'request':
|
|
110
|
+
(0, _dynamicrendering.trackDynamicDataInDynamicRender)(workUnitStore);
|
|
111
|
+
let underlyingCookies;
|
|
112
|
+
if ((0, _requestcookies.areCookiesMutableInCurrentPhase)(workUnitStore)) {
|
|
113
|
+
// We can't conditionally return different types here based on the context.
|
|
114
|
+
// To avoid confusion, we always return the readonly type here.
|
|
115
|
+
underlyingCookies = workUnitStore.userspaceMutableCookies;
|
|
116
|
+
} else {
|
|
117
|
+
underlyingCookies = workUnitStore.cookies;
|
|
118
|
+
}
|
|
119
|
+
if (process.env.NODE_ENV === 'development') {
|
|
120
|
+
// Semantically we only need the dev tracking when running in `next dev`
|
|
121
|
+
// but since you would never use next dev with production NODE_ENV we use this
|
|
122
|
+
// as a proxy so we can statically exclude this code from production builds.
|
|
123
|
+
if (process.env.__NEXT_CACHE_COMPONENTS) {
|
|
124
|
+
return makeUntrackedCookiesWithDevWarnings(underlyingCookies, workStore == null ? void 0 : workStore.route);
|
|
125
|
+
}
|
|
126
|
+
return makeUntrackedExoticCookiesWithDevWarnings(underlyingCookies, workStore == null ? void 0 : workStore.route);
|
|
127
|
+
} else {
|
|
128
|
+
if (process.env.__NEXT_CACHE_COMPONENTS) {
|
|
129
|
+
return makeUntrackedCookies(underlyingCookies);
|
|
130
|
+
}
|
|
131
|
+
return makeUntrackedExoticCookies(underlyingCookies);
|
|
132
|
+
}
|
|
133
|
+
}
|
|
134
|
+
}
|
|
135
|
+
}
|
|
136
|
+
// If we end up here, there was no work store or work unit store present.
|
|
137
|
+
(0, _workunitasyncstorageexternal.throwForMissingRequestStore)(callingExpression);
|
|
138
|
+
}
|
|
139
|
+
function createEmptyCookies() {
|
|
140
|
+
return _requestcookies.RequestCookiesAdapter.seal(new _cookies.RequestCookies(new Headers({})));
|
|
141
|
+
}
|
|
142
|
+
const CachedCookies = new WeakMap();
|
|
143
|
+
function makeHangingCookies(workStore, prerenderStore) {
|
|
144
|
+
const cachedPromise = CachedCookies.get(prerenderStore);
|
|
145
|
+
if (cachedPromise) {
|
|
146
|
+
return cachedPromise;
|
|
147
|
+
}
|
|
148
|
+
const promise = (0, _dynamicrenderingutils.makeHangingPromise)(prerenderStore.renderSignal, workStore.route, '`cookies()`');
|
|
149
|
+
CachedCookies.set(prerenderStore, promise);
|
|
150
|
+
return promise;
|
|
151
|
+
}
|
|
152
|
+
function makeUntrackedCookies(underlyingCookies) {
|
|
153
|
+
const cachedCookies = CachedCookies.get(underlyingCookies);
|
|
154
|
+
if (cachedCookies) {
|
|
155
|
+
return cachedCookies;
|
|
156
|
+
}
|
|
157
|
+
const promise = Promise.resolve(underlyingCookies);
|
|
158
|
+
CachedCookies.set(underlyingCookies, promise);
|
|
159
|
+
return promise;
|
|
160
|
+
}
|
|
161
|
+
function makeUntrackedExoticCookies(underlyingCookies) {
|
|
162
|
+
const cachedCookies = CachedCookies.get(underlyingCookies);
|
|
163
|
+
if (cachedCookies) {
|
|
164
|
+
return cachedCookies;
|
|
165
|
+
}
|
|
166
|
+
const promise = Promise.resolve(underlyingCookies);
|
|
167
|
+
CachedCookies.set(underlyingCookies, promise);
|
|
168
|
+
Object.defineProperties(promise, {
|
|
169
|
+
[Symbol.iterator]: {
|
|
170
|
+
value: underlyingCookies[Symbol.iterator] ? underlyingCookies[Symbol.iterator].bind(underlyingCookies) : // We should remove this and unify our cookies types. We could just let this continue to throw lazily
|
|
171
|
+
// but that's already a hard thing to debug so we may as well implement it consistently. The biggest problem with
|
|
172
|
+
// implementing this in this way is the underlying cookie type is a ResponseCookie and not a RequestCookie and so it
|
|
173
|
+
// has extra properties not available on RequestCookie instances.
|
|
174
|
+
polyfilledResponseCookiesIterator.bind(underlyingCookies)
|
|
175
|
+
},
|
|
176
|
+
size: {
|
|
177
|
+
get () {
|
|
178
|
+
return underlyingCookies.size;
|
|
179
|
+
}
|
|
180
|
+
},
|
|
181
|
+
get: {
|
|
182
|
+
value: underlyingCookies.get.bind(underlyingCookies)
|
|
183
|
+
},
|
|
184
|
+
getAll: {
|
|
185
|
+
value: underlyingCookies.getAll.bind(underlyingCookies)
|
|
186
|
+
},
|
|
187
|
+
has: {
|
|
188
|
+
value: underlyingCookies.has.bind(underlyingCookies)
|
|
189
|
+
},
|
|
190
|
+
set: {
|
|
191
|
+
value: underlyingCookies.set.bind(underlyingCookies)
|
|
192
|
+
},
|
|
193
|
+
delete: {
|
|
194
|
+
value: underlyingCookies.delete.bind(underlyingCookies)
|
|
195
|
+
},
|
|
196
|
+
clear: {
|
|
197
|
+
value: // @ts-expect-error clear is defined in RequestCookies implementation but not in the type
|
|
198
|
+
typeof underlyingCookies.clear === 'function' ? underlyingCookies.clear.bind(underlyingCookies) : // We should remove this and unify our cookies types. We could just let this continue to throw lazily
|
|
199
|
+
// but that's already a hard thing to debug so we may as well implement it consistently. The biggest problem with
|
|
200
|
+
// implementing this in this way is the underlying cookie type is a ResponseCookie and not a RequestCookie and so it
|
|
201
|
+
// has extra properties not available on RequestCookie instances.
|
|
202
|
+
polyfilledResponseCookiesClear.bind(underlyingCookies, promise)
|
|
203
|
+
},
|
|
204
|
+
toString: {
|
|
205
|
+
value: underlyingCookies.toString.bind(underlyingCookies)
|
|
206
|
+
}
|
|
207
|
+
});
|
|
208
|
+
return promise;
|
|
209
|
+
}
|
|
210
|
+
function makeUntrackedExoticCookiesWithDevWarnings(underlyingCookies, route) {
|
|
211
|
+
const cachedCookies = CachedCookies.get(underlyingCookies);
|
|
212
|
+
if (cachedCookies) {
|
|
213
|
+
return cachedCookies;
|
|
214
|
+
}
|
|
215
|
+
const promise = (0, _dynamicrenderingutils.makeDevtoolsIOAwarePromise)(underlyingCookies);
|
|
216
|
+
CachedCookies.set(underlyingCookies, promise);
|
|
217
|
+
Object.defineProperties(promise, {
|
|
218
|
+
[Symbol.iterator]: {
|
|
219
|
+
value: function() {
|
|
220
|
+
const expression = '`...cookies()` or similar iteration';
|
|
221
|
+
syncIODev(route, expression);
|
|
222
|
+
return underlyingCookies[Symbol.iterator] ? underlyingCookies[Symbol.iterator].apply(underlyingCookies, arguments) : // We should remove this and unify our cookies types. We could just let this continue to throw lazily
|
|
223
|
+
// but that's already a hard thing to debug so we may as well implement it consistently. The biggest problem with
|
|
224
|
+
// implementing this in this way is the underlying cookie type is a ResponseCookie and not a RequestCookie and so it
|
|
225
|
+
// has extra properties not available on RequestCookie instances.
|
|
226
|
+
polyfilledResponseCookiesIterator.call(underlyingCookies);
|
|
227
|
+
},
|
|
228
|
+
writable: false
|
|
229
|
+
},
|
|
230
|
+
size: {
|
|
231
|
+
get () {
|
|
232
|
+
const expression = '`cookies().size`';
|
|
233
|
+
syncIODev(route, expression);
|
|
234
|
+
return underlyingCookies.size;
|
|
235
|
+
}
|
|
236
|
+
},
|
|
237
|
+
get: {
|
|
238
|
+
value: function get() {
|
|
239
|
+
let expression;
|
|
240
|
+
if (arguments.length === 0) {
|
|
241
|
+
expression = '`cookies().get()`';
|
|
242
|
+
} else {
|
|
243
|
+
expression = `\`cookies().get(${describeNameArg(arguments[0])})\``;
|
|
244
|
+
}
|
|
245
|
+
syncIODev(route, expression);
|
|
246
|
+
return underlyingCookies.get.apply(underlyingCookies, arguments);
|
|
247
|
+
},
|
|
248
|
+
writable: false
|
|
249
|
+
},
|
|
250
|
+
getAll: {
|
|
251
|
+
value: function getAll() {
|
|
252
|
+
let expression;
|
|
253
|
+
if (arguments.length === 0) {
|
|
254
|
+
expression = '`cookies().getAll()`';
|
|
255
|
+
} else {
|
|
256
|
+
expression = `\`cookies().getAll(${describeNameArg(arguments[0])})\``;
|
|
257
|
+
}
|
|
258
|
+
syncIODev(route, expression);
|
|
259
|
+
return underlyingCookies.getAll.apply(underlyingCookies, arguments);
|
|
260
|
+
},
|
|
261
|
+
writable: false
|
|
262
|
+
},
|
|
263
|
+
has: {
|
|
264
|
+
value: function get() {
|
|
265
|
+
let expression;
|
|
266
|
+
if (arguments.length === 0) {
|
|
267
|
+
expression = '`cookies().has()`';
|
|
268
|
+
} else {
|
|
269
|
+
expression = `\`cookies().has(${describeNameArg(arguments[0])})\``;
|
|
270
|
+
}
|
|
271
|
+
syncIODev(route, expression);
|
|
272
|
+
return underlyingCookies.has.apply(underlyingCookies, arguments);
|
|
273
|
+
},
|
|
274
|
+
writable: false
|
|
275
|
+
},
|
|
276
|
+
set: {
|
|
277
|
+
value: function set() {
|
|
278
|
+
let expression;
|
|
279
|
+
if (arguments.length === 0) {
|
|
280
|
+
expression = '`cookies().set()`';
|
|
281
|
+
} else {
|
|
282
|
+
const arg = arguments[0];
|
|
283
|
+
if (arg) {
|
|
284
|
+
expression = `\`cookies().set(${describeNameArg(arg)}, ...)\``;
|
|
285
|
+
} else {
|
|
286
|
+
expression = '`cookies().set(...)`';
|
|
287
|
+
}
|
|
288
|
+
}
|
|
289
|
+
syncIODev(route, expression);
|
|
290
|
+
return underlyingCookies.set.apply(underlyingCookies, arguments);
|
|
291
|
+
},
|
|
292
|
+
writable: false
|
|
293
|
+
},
|
|
294
|
+
delete: {
|
|
295
|
+
value: function() {
|
|
296
|
+
let expression;
|
|
297
|
+
if (arguments.length === 0) {
|
|
298
|
+
expression = '`cookies().delete()`';
|
|
299
|
+
} else if (arguments.length === 1) {
|
|
300
|
+
expression = `\`cookies().delete(${describeNameArg(arguments[0])})\``;
|
|
301
|
+
} else {
|
|
302
|
+
expression = `\`cookies().delete(${describeNameArg(arguments[0])}, ...)\``;
|
|
303
|
+
}
|
|
304
|
+
syncIODev(route, expression);
|
|
305
|
+
return underlyingCookies.delete.apply(underlyingCookies, arguments);
|
|
306
|
+
},
|
|
307
|
+
writable: false
|
|
308
|
+
},
|
|
309
|
+
clear: {
|
|
310
|
+
value: function clear() {
|
|
311
|
+
const expression = '`cookies().clear()`';
|
|
312
|
+
syncIODev(route, expression);
|
|
313
|
+
// @ts-ignore clear is defined in RequestCookies implementation but not in the type
|
|
314
|
+
return typeof underlyingCookies.clear === 'function' ? underlyingCookies.clear.apply(underlyingCookies, arguments) : // We should remove this and unify our cookies types. We could just let this continue to throw lazily
|
|
315
|
+
// but that's already a hard thing to debug so we may as well implement it consistently. The biggest problem with
|
|
316
|
+
// implementing this in this way is the underlying cookie type is a ResponseCookie and not a RequestCookie and so it
|
|
317
|
+
// has extra properties not available on RequestCookie instances.
|
|
318
|
+
polyfilledResponseCookiesClear.call(underlyingCookies, promise);
|
|
319
|
+
},
|
|
320
|
+
writable: false
|
|
321
|
+
},
|
|
322
|
+
toString: {
|
|
323
|
+
value: function toString() {
|
|
324
|
+
const expression = '`cookies().toString()` or implicit casting';
|
|
325
|
+
syncIODev(route, expression);
|
|
326
|
+
return underlyingCookies.toString.apply(underlyingCookies, arguments);
|
|
327
|
+
},
|
|
328
|
+
writable: false
|
|
329
|
+
}
|
|
330
|
+
});
|
|
331
|
+
return promise;
|
|
332
|
+
}
|
|
333
|
+
// Similar to `makeUntrackedExoticCookiesWithDevWarnings`, but just logging the
|
|
334
|
+
// sync access without actually defining the cookies properties on the promise.
|
|
335
|
+
function makeUntrackedCookiesWithDevWarnings(underlyingCookies, route) {
|
|
336
|
+
const cachedCookies = CachedCookies.get(underlyingCookies);
|
|
337
|
+
if (cachedCookies) {
|
|
338
|
+
return cachedCookies;
|
|
339
|
+
}
|
|
340
|
+
const promise = (0, _dynamicrenderingutils.makeDevtoolsIOAwarePromise)(underlyingCookies);
|
|
341
|
+
const proxiedPromise = new Proxy(promise, {
|
|
342
|
+
get (target, prop, receiver) {
|
|
343
|
+
switch(prop){
|
|
344
|
+
case Symbol.iterator:
|
|
345
|
+
{
|
|
346
|
+
warnForSyncAccess(route, '`...cookies()` or similar iteration');
|
|
347
|
+
break;
|
|
348
|
+
}
|
|
349
|
+
case 'size':
|
|
350
|
+
case 'get':
|
|
351
|
+
case 'getAll':
|
|
352
|
+
case 'has':
|
|
353
|
+
case 'set':
|
|
354
|
+
case 'delete':
|
|
355
|
+
case 'clear':
|
|
356
|
+
case 'toString':
|
|
357
|
+
{
|
|
358
|
+
warnForSyncAccess(route, `\`cookies().${prop}\``);
|
|
359
|
+
break;
|
|
360
|
+
}
|
|
361
|
+
}
|
|
362
|
+
return _reflect.ReflectAdapter.get(target, prop, receiver);
|
|
363
|
+
}
|
|
364
|
+
});
|
|
365
|
+
CachedCookies.set(underlyingCookies, proxiedPromise);
|
|
366
|
+
return proxiedPromise;
|
|
367
|
+
}
|
|
368
|
+
function describeNameArg(arg) {
|
|
369
|
+
return typeof arg === 'object' && arg !== null && typeof arg.name === 'string' ? `'${arg.name}'` : typeof arg === 'string' ? `'${arg}'` : '...';
|
|
370
|
+
}
|
|
371
|
+
function syncIODev(route, expression) {
|
|
372
|
+
const workUnitStore = _workunitasyncstorageexternal.workUnitAsyncStorage.getStore();
|
|
373
|
+
if (workUnitStore) {
|
|
374
|
+
switch(workUnitStore.type){
|
|
375
|
+
case 'request':
|
|
376
|
+
if (workUnitStore.prerenderPhase === true) {
|
|
377
|
+
// When we're rendering dynamically in dev, we need to advance out of
|
|
378
|
+
// the Prerender environment when we read Request data synchronously.
|
|
379
|
+
(0, _dynamicrendering.trackSynchronousRequestDataAccessInDev)(workUnitStore);
|
|
380
|
+
}
|
|
381
|
+
break;
|
|
382
|
+
}
|
|
383
|
+
}
|
|
384
|
+
// In all cases we warn normally
|
|
385
|
+
warnForSyncAccess(route, expression);
|
|
386
|
+
}
|
|
387
|
+
const warnForSyncAccess = (0, _creatededupedbycallsiteservererrorlogger.createDedupedByCallsiteServerErrorLoggerDev)(createCookiesAccessError);
|
|
388
|
+
function createCookiesAccessError(route, expression) {
|
|
389
|
+
const prefix = route ? `Route "${route}" ` : 'This route ';
|
|
390
|
+
return Object.defineProperty(new Error(`${prefix}used ${expression}. ` + `\`cookies()\` should be awaited before using its value. ` + `Learn more: https://nextjs.org/docs/messages/sync-dynamic-apis`), "__NEXT_ERROR_CODE", {
|
|
391
|
+
value: "E223",
|
|
392
|
+
enumerable: false,
|
|
393
|
+
configurable: true
|
|
394
|
+
});
|
|
395
|
+
}
|
|
396
|
+
function polyfilledResponseCookiesIterator() {
|
|
397
|
+
return this.getAll().map((c)=>[
|
|
398
|
+
c.name,
|
|
399
|
+
c
|
|
400
|
+
]).values();
|
|
401
|
+
}
|
|
402
|
+
function polyfilledResponseCookiesClear(returnable) {
|
|
403
|
+
for (const cookie of this.getAll()){
|
|
404
|
+
this.delete(cookie.name);
|
|
405
|
+
}
|
|
406
|
+
return returnable;
|
|
407
|
+
}
|
|
408
|
+
|
|
409
|
+
|
|
410
|
+
} (cookies.__exports));
|
|
411
|
+
return cookies.__exports;
|
|
412
|
+
}
|
|
413
|
+
|
|
414
|
+
exports.__require = requireCookies;
|
|
415
|
+
//# sourceMappingURL=cookies.js.map
|