authscape 1.0.722 → 1.0.726
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/index.js +156 -144
- package/package.json +9 -1
- package/src/lib/sitemap-route.js +49 -45
- package/src/lib/sitemap.js +50 -47
- package/src/scripts/postinstall.js +8 -2
- package/.babelrc +0 -3
- package/.claude/settings.local.json +0 -12
- package/dist/Container.module.css +0 -103
- package/dist/Item.module.css +0 -135
package/index.js
CHANGED
|
@@ -8122,102 +8122,109 @@ function YesNoDialog(_ref) {
|
|
|
8122
8122
|
}
|
|
8123
8123
|
"use strict";
|
|
8124
8124
|
|
|
8125
|
+
function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
|
|
8125
8126
|
Object.defineProperty(exports, "__esModule", {
|
|
8126
8127
|
value: true
|
|
8127
8128
|
});
|
|
8128
|
-
exports.
|
|
8129
|
-
function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
|
|
8129
|
+
exports.createSitemapRoute = createSitemapRoute;
|
|
8130
8130
|
function _regeneratorRuntime() { "use strict"; /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */ _regeneratorRuntime = function _regeneratorRuntime() { return e; }; var t, e = {}, r = Object.prototype, n = r.hasOwnProperty, o = Object.defineProperty || function (t, e, r) { t[e] = r.value; }, i = "function" == typeof Symbol ? Symbol : {}, a = i.iterator || "@@iterator", c = i.asyncIterator || "@@asyncIterator", u = i.toStringTag || "@@toStringTag"; function define(t, e, r) { return Object.defineProperty(t, e, { value: r, enumerable: !0, configurable: !0, writable: !0 }), t[e]; } try { define({}, ""); } catch (t) { define = function define(t, e, r) { return t[e] = r; }; } function wrap(t, e, r, n) { var i = e && e.prototype instanceof Generator ? e : Generator, a = Object.create(i.prototype), c = new Context(n || []); return o(a, "_invoke", { value: makeInvokeMethod(t, r, c) }), a; } function tryCatch(t, e, r) { try { return { type: "normal", arg: t.call(e, r) }; } catch (t) { return { type: "throw", arg: t }; } } e.wrap = wrap; var h = "suspendedStart", l = "suspendedYield", f = "executing", s = "completed", y = {}; function Generator() {} function GeneratorFunction() {} function GeneratorFunctionPrototype() {} var p = {}; define(p, a, function () { return this; }); var d = Object.getPrototypeOf, v = d && d(d(values([]))); v && v !== r && n.call(v, a) && (p = v); var g = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(p); function defineIteratorMethods(t) { ["next", "throw", "return"].forEach(function (e) { define(t, e, function (t) { return this._invoke(e, t); }); }); } function AsyncIterator(t, e) { function invoke(r, o, i, a) { var c = tryCatch(t[r], t, o); if ("throw" !== c.type) { var u = c.arg, h = u.value; return h && "object" == _typeof(h) && n.call(h, "__await") ? e.resolve(h.__await).then(function (t) { invoke("next", t, i, a); }, function (t) { invoke("throw", t, i, a); }) : e.resolve(h).then(function (t) { u.value = t, i(u); }, function (t) { return invoke("throw", t, i, a); }); } a(c.arg); } var r; o(this, "_invoke", { value: function value(t, n) { function callInvokeWithMethodAndArg() { return new e(function (e, r) { invoke(t, n, e, r); }); } return r = r ? r.then(callInvokeWithMethodAndArg, callInvokeWithMethodAndArg) : callInvokeWithMethodAndArg(); } }); } function makeInvokeMethod(e, r, n) { var o = h; return function (i, a) { if (o === f) throw Error("Generator is already running"); if (o === s) { if ("throw" === i) throw a; return { value: t, done: !0 }; } for (n.method = i, n.arg = a;;) { var c = n.delegate; if (c) { var u = maybeInvokeDelegate(c, n); if (u) { if (u === y) continue; return u; } } if ("next" === n.method) n.sent = n._sent = n.arg;else if ("throw" === n.method) { if (o === h) throw o = s, n.arg; n.dispatchException(n.arg); } else "return" === n.method && n.abrupt("return", n.arg); o = f; var p = tryCatch(e, r, n); if ("normal" === p.type) { if (o = n.done ? s : l, p.arg === y) continue; return { value: p.arg, done: n.done }; } "throw" === p.type && (o = s, n.method = "throw", n.arg = p.arg); } }; } function maybeInvokeDelegate(e, r) { var n = r.method, o = e.iterator[n]; if (o === t) return r.delegate = null, "throw" === n && e.iterator["return"] && (r.method = "return", r.arg = t, maybeInvokeDelegate(e, r), "throw" === r.method) || "return" !== n && (r.method = "throw", r.arg = new TypeError("The iterator does not provide a '" + n + "' method")), y; var i = tryCatch(o, e.iterator, r.arg); if ("throw" === i.type) return r.method = "throw", r.arg = i.arg, r.delegate = null, y; var a = i.arg; return a ? a.done ? (r[e.resultName] = a.value, r.next = e.nextLoc, "return" !== r.method && (r.method = "next", r.arg = t), r.delegate = null, y) : a : (r.method = "throw", r.arg = new TypeError("iterator result is not an object"), r.delegate = null, y); } function pushTryEntry(t) { var e = { tryLoc: t[0] }; 1 in t && (e.catchLoc = t[1]), 2 in t && (e.finallyLoc = t[2], e.afterLoc = t[3]), this.tryEntries.push(e); } function resetTryEntry(t) { var e = t.completion || {}; e.type = "normal", delete e.arg, t.completion = e; } function Context(t) { this.tryEntries = [{ tryLoc: "root" }], t.forEach(pushTryEntry, this), this.reset(!0); } function values(e) { if (e || "" === e) { var r = e[a]; if (r) return r.call(e); if ("function" == typeof e.next) return e; if (!isNaN(e.length)) { var o = -1, i = function next() { for (; ++o < e.length;) if (n.call(e, o)) return next.value = e[o], next.done = !1, next; return next.value = t, next.done = !0, next; }; return i.next = i; } } throw new TypeError(_typeof(e) + " is not iterable"); } return GeneratorFunction.prototype = GeneratorFunctionPrototype, o(g, "constructor", { value: GeneratorFunctionPrototype, configurable: !0 }), o(GeneratorFunctionPrototype, "constructor", { value: GeneratorFunction, configurable: !0 }), GeneratorFunction.displayName = define(GeneratorFunctionPrototype, u, "GeneratorFunction"), e.isGeneratorFunction = function (t) { var e = "function" == typeof t && t.constructor; return !!e && (e === GeneratorFunction || "GeneratorFunction" === (e.displayName || e.name)); }, e.mark = function (t) { return Object.setPrototypeOf ? Object.setPrototypeOf(t, GeneratorFunctionPrototype) : (t.__proto__ = GeneratorFunctionPrototype, define(t, u, "GeneratorFunction")), t.prototype = Object.create(g), t; }, e.awrap = function (t) { return { __await: t }; }, defineIteratorMethods(AsyncIterator.prototype), define(AsyncIterator.prototype, c, function () { return this; }), e.AsyncIterator = AsyncIterator, e.async = function (t, r, n, o, i) { void 0 === i && (i = Promise); var a = new AsyncIterator(wrap(t, r, n, o), i); return e.isGeneratorFunction(r) ? a : a.next().then(function (t) { return t.done ? t.value : a.next(); }); }, defineIteratorMethods(g), define(g, u, "Generator"), define(g, a, function () { return this; }), define(g, "toString", function () { return "[object Generator]"; }), e.keys = function (t) { var e = Object(t), r = []; for (var n in e) r.push(n); return r.reverse(), function next() { for (; r.length;) { var t = r.pop(); if (t in e) return next.value = t, next.done = !1, next; } return next.done = !0, next; }; }, e.values = values, Context.prototype = { constructor: Context, reset: function reset(e) { if (this.prev = 0, this.next = 0, this.sent = this._sent = t, this.done = !1, this.delegate = null, this.method = "next", this.arg = t, this.tryEntries.forEach(resetTryEntry), !e) for (var r in this) "t" === r.charAt(0) && n.call(this, r) && !isNaN(+r.slice(1)) && (this[r] = t); }, stop: function stop() { this.done = !0; var t = this.tryEntries[0].completion; if ("throw" === t.type) throw t.arg; return this.rval; }, dispatchException: function dispatchException(e) { if (this.done) throw e; var r = this; function handle(n, o) { return a.type = "throw", a.arg = e, r.next = n, o && (r.method = "next", r.arg = t), !!o; } for (var o = this.tryEntries.length - 1; o >= 0; --o) { var i = this.tryEntries[o], a = i.completion; if ("root" === i.tryLoc) return handle("end"); if (i.tryLoc <= this.prev) { var c = n.call(i, "catchLoc"), u = n.call(i, "finallyLoc"); if (c && u) { if (this.prev < i.catchLoc) return handle(i.catchLoc, !0); if (this.prev < i.finallyLoc) return handle(i.finallyLoc); } else if (c) { if (this.prev < i.catchLoc) return handle(i.catchLoc, !0); } else { if (!u) throw Error("try statement without catch or finally"); if (this.prev < i.finallyLoc) return handle(i.finallyLoc); } } } }, abrupt: function abrupt(t, e) { for (var r = this.tryEntries.length - 1; r >= 0; --r) { var o = this.tryEntries[r]; if (o.tryLoc <= this.prev && n.call(o, "finallyLoc") && this.prev < o.finallyLoc) { var i = o; break; } } i && ("break" === t || "continue" === t) && i.tryLoc <= e && e <= i.finallyLoc && (i = null); var a = i ? i.completion : {}; return a.type = t, a.arg = e, i ? (this.method = "next", this.next = i.finallyLoc, y) : this.complete(a); }, complete: function complete(t, e) { if ("throw" === t.type) throw t.arg; return "break" === t.type || "continue" === t.type ? this.next = t.arg : "return" === t.type ? (this.rval = this.arg = t.arg, this.method = "return", this.next = "end") : "normal" === t.type && e && (this.next = e), y; }, finish: function finish(t) { for (var e = this.tryEntries.length - 1; e >= 0; --e) { var r = this.tryEntries[e]; if (r.finallyLoc === t) return this.complete(r.completion, r.afterLoc), resetTryEntry(r), y; } }, "catch": function _catch(t) { for (var e = this.tryEntries.length - 1; e >= 0; --e) { var r = this.tryEntries[e]; if (r.tryLoc === t) { var n = r.completion; if ("throw" === n.type) { var o = n.arg; resetTryEntry(r); } return o; } } throw Error("illegal catch attempt"); }, delegateYield: function delegateYield(e, r, n) { return this.delegate = { iterator: values(e), resultName: r, nextLoc: n }, "next" === this.method && (this.arg = t), y; } }, e; }
|
|
8131
8131
|
function asyncGeneratorStep(n, t, e, r, o, a, c) { try { var i = n[a](c), u = i.value; } catch (n) { return void e(n); } i.done ? t(u) : Promise.resolve(u).then(r, o); }
|
|
8132
8132
|
function _asyncToGenerator(n) { return function () { var t = this, e = arguments; return new Promise(function (r, o) { var a = n.apply(t, e); function _next(n) { asyncGeneratorStep(a, r, o, _next, _throw, "next", n); } function _throw(n) { asyncGeneratorStep(a, r, o, _next, _throw, "throw", n); } _next(void 0); }); }; }
|
|
8133
8133
|
/**
|
|
8134
8134
|
* AuthScape Sitemap - App Router Implementation
|
|
8135
8135
|
* This file contains the complete sitemap logic for Next.js App Router (Route Handlers)
|
|
8136
|
-
* Users will
|
|
8136
|
+
* Users will import and call createSitemapRoute from their app/sitemap.xml/route.js file
|
|
8137
8137
|
*/
|
|
8138
|
-
|
|
8139
|
-
|
|
8140
|
-
|
|
8141
|
-
|
|
8142
|
-
|
|
8143
|
-
|
|
8144
|
-
|
|
8145
|
-
|
|
8146
|
-
|
|
8147
|
-
|
|
8148
|
-
|
|
8149
|
-
|
|
8150
|
-
|
|
8151
|
-
|
|
8152
|
-
|
|
8153
|
-
|
|
8154
|
-
|
|
8155
|
-
|
|
8156
|
-
|
|
8157
|
-
|
|
8158
|
-
|
|
8159
|
-
|
|
8160
|
-
|
|
8161
|
-
status: 500,
|
|
8162
|
-
headers: {
|
|
8163
|
-
'Content-Type': 'text/plain'
|
|
8164
|
-
}
|
|
8165
|
-
}));
|
|
8166
|
-
case 10:
|
|
8167
|
-
_context.next = 12;
|
|
8168
|
-
return fetch("".concat(apiUrl, "/api/Sitemap?domain=").concat(encodedDomain));
|
|
8169
|
-
case 12:
|
|
8170
|
-
response = _context.sent;
|
|
8171
|
-
if (response.ok) {
|
|
8172
|
-
_context.next = 15;
|
|
8173
|
-
break;
|
|
8174
|
-
}
|
|
8175
|
-
throw new Error("API request failed with status ".concat(response.status));
|
|
8176
|
-
case 15:
|
|
8177
|
-
_context.next = 17;
|
|
8178
|
-
return response.text();
|
|
8179
|
-
case 17:
|
|
8180
|
-
sitemap = _context.sent;
|
|
8181
|
-
return _context.abrupt("return", new Response(sitemap, {
|
|
8182
|
-
status: 200,
|
|
8183
|
-
headers: {
|
|
8184
|
-
'Content-Type': 'text/xml; charset=utf-8',
|
|
8185
|
-
'Cache-Control': 'public, s-maxage=86400, stale-while-revalidate'
|
|
8138
|
+
|
|
8139
|
+
/**
|
|
8140
|
+
* Creates a sitemap route handler with the provided API URI
|
|
8141
|
+
* @param {string} apiUri - The AuthScape API base URI (from process.env.apiUri)
|
|
8142
|
+
* @returns {Function} GET route handler function
|
|
8143
|
+
*/
|
|
8144
|
+
function createSitemapRoute(apiUri) {
|
|
8145
|
+
return /*#__PURE__*/function () {
|
|
8146
|
+
var _GET = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee(request) {
|
|
8147
|
+
var url, protocol, host, domain, encodedDomain, response, sitemap;
|
|
8148
|
+
return _regeneratorRuntime().wrap(function _callee$(_context) {
|
|
8149
|
+
while (1) switch (_context.prev = _context.next) {
|
|
8150
|
+
case 0:
|
|
8151
|
+
_context.prev = 0;
|
|
8152
|
+
// Get the domain from the request
|
|
8153
|
+
url = new URL(request.url);
|
|
8154
|
+
protocol = request.headers.get('x-forwarded-proto') || url.protocol.replace(':', '');
|
|
8155
|
+
host = request.headers.get('host') || url.host;
|
|
8156
|
+
domain = "".concat(protocol, "://").concat(host); // URL encode the domain for the API request
|
|
8157
|
+
encodedDomain = encodeURIComponent(domain);
|
|
8158
|
+
if (apiUri) {
|
|
8159
|
+
_context.next = 9;
|
|
8160
|
+
break;
|
|
8186
8161
|
}
|
|
8187
|
-
|
|
8188
|
-
|
|
8189
|
-
|
|
8190
|
-
|
|
8191
|
-
|
|
8192
|
-
|
|
8193
|
-
|
|
8194
|
-
|
|
8195
|
-
|
|
8162
|
+
console.error('AuthScape Sitemap Error: apiUri is not configured in environment variables');
|
|
8163
|
+
return _context.abrupt("return", new Response('Sitemap configuration error: API URI not set. Please ensure apiUri is defined in your next.config.js env object or .env.local file.', {
|
|
8164
|
+
status: 500,
|
|
8165
|
+
headers: {
|
|
8166
|
+
'Content-Type': 'text/plain'
|
|
8167
|
+
}
|
|
8168
|
+
}));
|
|
8169
|
+
case 9:
|
|
8170
|
+
_context.next = 11;
|
|
8171
|
+
return fetch("".concat(apiUri, "/api/Sitemap?domain=").concat(encodedDomain));
|
|
8172
|
+
case 11:
|
|
8173
|
+
response = _context.sent;
|
|
8174
|
+
if (response.ok) {
|
|
8175
|
+
_context.next = 14;
|
|
8176
|
+
break;
|
|
8196
8177
|
}
|
|
8197
|
-
|
|
8198
|
-
|
|
8199
|
-
|
|
8200
|
-
|
|
8201
|
-
|
|
8202
|
-
|
|
8203
|
-
|
|
8204
|
-
|
|
8178
|
+
throw new Error("API request failed with status ".concat(response.status));
|
|
8179
|
+
case 14:
|
|
8180
|
+
_context.next = 16;
|
|
8181
|
+
return response.text();
|
|
8182
|
+
case 16:
|
|
8183
|
+
sitemap = _context.sent;
|
|
8184
|
+
return _context.abrupt("return", new Response(sitemap, {
|
|
8185
|
+
status: 200,
|
|
8186
|
+
headers: {
|
|
8187
|
+
'Content-Type': 'text/xml; charset=utf-8',
|
|
8188
|
+
'Cache-Control': 'public, s-maxage=86400, stale-while-revalidate'
|
|
8189
|
+
}
|
|
8190
|
+
}));
|
|
8191
|
+
case 20:
|
|
8192
|
+
_context.prev = 20;
|
|
8193
|
+
_context.t0 = _context["catch"](0);
|
|
8194
|
+
console.error('AuthScape Sitemap Error:', _context.t0);
|
|
8195
|
+
return _context.abrupt("return", new Response('Error generating sitemap', {
|
|
8196
|
+
status: 500,
|
|
8197
|
+
headers: {
|
|
8198
|
+
'Content-Type': 'text/plain'
|
|
8199
|
+
}
|
|
8200
|
+
}));
|
|
8201
|
+
case 24:
|
|
8202
|
+
case "end":
|
|
8203
|
+
return _context.stop();
|
|
8204
|
+
}
|
|
8205
|
+
}, _callee, null, [[0, 20]]);
|
|
8206
|
+
}));
|
|
8207
|
+
function GET(_x) {
|
|
8208
|
+
return _GET.apply(this, arguments);
|
|
8209
|
+
}
|
|
8210
|
+
return GET;
|
|
8211
|
+
}();
|
|
8205
8212
|
}
|
|
8206
8213
|
"use strict";
|
|
8207
8214
|
|
|
8215
|
+
function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
|
|
8208
8216
|
Object.defineProperty(exports, "__esModule", {
|
|
8209
8217
|
value: true
|
|
8210
8218
|
});
|
|
8211
|
-
exports
|
|
8212
|
-
exports.
|
|
8213
|
-
function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
|
|
8219
|
+
exports.Sitemap = Sitemap;
|
|
8220
|
+
exports.createSitemapHandler = createSitemapHandler;
|
|
8214
8221
|
function _regeneratorRuntime() { "use strict"; /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */ _regeneratorRuntime = function _regeneratorRuntime() { return e; }; var t, e = {}, r = Object.prototype, n = r.hasOwnProperty, o = Object.defineProperty || function (t, e, r) { t[e] = r.value; }, i = "function" == typeof Symbol ? Symbol : {}, a = i.iterator || "@@iterator", c = i.asyncIterator || "@@asyncIterator", u = i.toStringTag || "@@toStringTag"; function define(t, e, r) { return Object.defineProperty(t, e, { value: r, enumerable: !0, configurable: !0, writable: !0 }), t[e]; } try { define({}, ""); } catch (t) { define = function define(t, e, r) { return t[e] = r; }; } function wrap(t, e, r, n) { var i = e && e.prototype instanceof Generator ? e : Generator, a = Object.create(i.prototype), c = new Context(n || []); return o(a, "_invoke", { value: makeInvokeMethod(t, r, c) }), a; } function tryCatch(t, e, r) { try { return { type: "normal", arg: t.call(e, r) }; } catch (t) { return { type: "throw", arg: t }; } } e.wrap = wrap; var h = "suspendedStart", l = "suspendedYield", f = "executing", s = "completed", y = {}; function Generator() {} function GeneratorFunction() {} function GeneratorFunctionPrototype() {} var p = {}; define(p, a, function () { return this; }); var d = Object.getPrototypeOf, v = d && d(d(values([]))); v && v !== r && n.call(v, a) && (p = v); var g = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(p); function defineIteratorMethods(t) { ["next", "throw", "return"].forEach(function (e) { define(t, e, function (t) { return this._invoke(e, t); }); }); } function AsyncIterator(t, e) { function invoke(r, o, i, a) { var c = tryCatch(t[r], t, o); if ("throw" !== c.type) { var u = c.arg, h = u.value; return h && "object" == _typeof(h) && n.call(h, "__await") ? e.resolve(h.__await).then(function (t) { invoke("next", t, i, a); }, function (t) { invoke("throw", t, i, a); }) : e.resolve(h).then(function (t) { u.value = t, i(u); }, function (t) { return invoke("throw", t, i, a); }); } a(c.arg); } var r; o(this, "_invoke", { value: function value(t, n) { function callInvokeWithMethodAndArg() { return new e(function (e, r) { invoke(t, n, e, r); }); } return r = r ? r.then(callInvokeWithMethodAndArg, callInvokeWithMethodAndArg) : callInvokeWithMethodAndArg(); } }); } function makeInvokeMethod(e, r, n) { var o = h; return function (i, a) { if (o === f) throw Error("Generator is already running"); if (o === s) { if ("throw" === i) throw a; return { value: t, done: !0 }; } for (n.method = i, n.arg = a;;) { var c = n.delegate; if (c) { var u = maybeInvokeDelegate(c, n); if (u) { if (u === y) continue; return u; } } if ("next" === n.method) n.sent = n._sent = n.arg;else if ("throw" === n.method) { if (o === h) throw o = s, n.arg; n.dispatchException(n.arg); } else "return" === n.method && n.abrupt("return", n.arg); o = f; var p = tryCatch(e, r, n); if ("normal" === p.type) { if (o = n.done ? s : l, p.arg === y) continue; return { value: p.arg, done: n.done }; } "throw" === p.type && (o = s, n.method = "throw", n.arg = p.arg); } }; } function maybeInvokeDelegate(e, r) { var n = r.method, o = e.iterator[n]; if (o === t) return r.delegate = null, "throw" === n && e.iterator["return"] && (r.method = "return", r.arg = t, maybeInvokeDelegate(e, r), "throw" === r.method) || "return" !== n && (r.method = "throw", r.arg = new TypeError("The iterator does not provide a '" + n + "' method")), y; var i = tryCatch(o, e.iterator, r.arg); if ("throw" === i.type) return r.method = "throw", r.arg = i.arg, r.delegate = null, y; var a = i.arg; return a ? a.done ? (r[e.resultName] = a.value, r.next = e.nextLoc, "return" !== r.method && (r.method = "next", r.arg = t), r.delegate = null, y) : a : (r.method = "throw", r.arg = new TypeError("iterator result is not an object"), r.delegate = null, y); } function pushTryEntry(t) { var e = { tryLoc: t[0] }; 1 in t && (e.catchLoc = t[1]), 2 in t && (e.finallyLoc = t[2], e.afterLoc = t[3]), this.tryEntries.push(e); } function resetTryEntry(t) { var e = t.completion || {}; e.type = "normal", delete e.arg, t.completion = e; } function Context(t) { this.tryEntries = [{ tryLoc: "root" }], t.forEach(pushTryEntry, this), this.reset(!0); } function values(e) { if (e || "" === e) { var r = e[a]; if (r) return r.call(e); if ("function" == typeof e.next) return e; if (!isNaN(e.length)) { var o = -1, i = function next() { for (; ++o < e.length;) if (n.call(e, o)) return next.value = e[o], next.done = !1, next; return next.value = t, next.done = !0, next; }; return i.next = i; } } throw new TypeError(_typeof(e) + " is not iterable"); } return GeneratorFunction.prototype = GeneratorFunctionPrototype, o(g, "constructor", { value: GeneratorFunctionPrototype, configurable: !0 }), o(GeneratorFunctionPrototype, "constructor", { value: GeneratorFunction, configurable: !0 }), GeneratorFunction.displayName = define(GeneratorFunctionPrototype, u, "GeneratorFunction"), e.isGeneratorFunction = function (t) { var e = "function" == typeof t && t.constructor; return !!e && (e === GeneratorFunction || "GeneratorFunction" === (e.displayName || e.name)); }, e.mark = function (t) { return Object.setPrototypeOf ? Object.setPrototypeOf(t, GeneratorFunctionPrototype) : (t.__proto__ = GeneratorFunctionPrototype, define(t, u, "GeneratorFunction")), t.prototype = Object.create(g), t; }, e.awrap = function (t) { return { __await: t }; }, defineIteratorMethods(AsyncIterator.prototype), define(AsyncIterator.prototype, c, function () { return this; }), e.AsyncIterator = AsyncIterator, e.async = function (t, r, n, o, i) { void 0 === i && (i = Promise); var a = new AsyncIterator(wrap(t, r, n, o), i); return e.isGeneratorFunction(r) ? a : a.next().then(function (t) { return t.done ? t.value : a.next(); }); }, defineIteratorMethods(g), define(g, u, "Generator"), define(g, a, function () { return this; }), define(g, "toString", function () { return "[object Generator]"; }), e.keys = function (t) { var e = Object(t), r = []; for (var n in e) r.push(n); return r.reverse(), function next() { for (; r.length;) { var t = r.pop(); if (t in e) return next.value = t, next.done = !1, next; } return next.done = !0, next; }; }, e.values = values, Context.prototype = { constructor: Context, reset: function reset(e) { if (this.prev = 0, this.next = 0, this.sent = this._sent = t, this.done = !1, this.delegate = null, this.method = "next", this.arg = t, this.tryEntries.forEach(resetTryEntry), !e) for (var r in this) "t" === r.charAt(0) && n.call(this, r) && !isNaN(+r.slice(1)) && (this[r] = t); }, stop: function stop() { this.done = !0; var t = this.tryEntries[0].completion; if ("throw" === t.type) throw t.arg; return this.rval; }, dispatchException: function dispatchException(e) { if (this.done) throw e; var r = this; function handle(n, o) { return a.type = "throw", a.arg = e, r.next = n, o && (r.method = "next", r.arg = t), !!o; } for (var o = this.tryEntries.length - 1; o >= 0; --o) { var i = this.tryEntries[o], a = i.completion; if ("root" === i.tryLoc) return handle("end"); if (i.tryLoc <= this.prev) { var c = n.call(i, "catchLoc"), u = n.call(i, "finallyLoc"); if (c && u) { if (this.prev < i.catchLoc) return handle(i.catchLoc, !0); if (this.prev < i.finallyLoc) return handle(i.finallyLoc); } else if (c) { if (this.prev < i.catchLoc) return handle(i.catchLoc, !0); } else { if (!u) throw Error("try statement without catch or finally"); if (this.prev < i.finallyLoc) return handle(i.finallyLoc); } } } }, abrupt: function abrupt(t, e) { for (var r = this.tryEntries.length - 1; r >= 0; --r) { var o = this.tryEntries[r]; if (o.tryLoc <= this.prev && n.call(o, "finallyLoc") && this.prev < o.finallyLoc) { var i = o; break; } } i && ("break" === t || "continue" === t) && i.tryLoc <= e && e <= i.finallyLoc && (i = null); var a = i ? i.completion : {}; return a.type = t, a.arg = e, i ? (this.method = "next", this.next = i.finallyLoc, y) : this.complete(a); }, complete: function complete(t, e) { if ("throw" === t.type) throw t.arg; return "break" === t.type || "continue" === t.type ? this.next = t.arg : "return" === t.type ? (this.rval = this.arg = t.arg, this.method = "return", this.next = "end") : "normal" === t.type && e && (this.next = e), y; }, finish: function finish(t) { for (var e = this.tryEntries.length - 1; e >= 0; --e) { var r = this.tryEntries[e]; if (r.finallyLoc === t) return this.complete(r.completion, r.afterLoc), resetTryEntry(r), y; } }, "catch": function _catch(t) { for (var e = this.tryEntries.length - 1; e >= 0; --e) { var r = this.tryEntries[e]; if (r.tryLoc === t) { var n = r.completion; if ("throw" === n.type) { var o = n.arg; resetTryEntry(r); } return o; } } throw Error("illegal catch attempt"); }, delegateYield: function delegateYield(e, r, n) { return this.delegate = { iterator: values(e), resultName: r, nextLoc: n }, "next" === this.method && (this.arg = t), y; } }, e; }
|
|
8215
8222
|
function asyncGeneratorStep(n, t, e, r, o, a, c) { try { var i = n[a](c), u = i.value; } catch (n) { return void e(n); } i.done ? t(u) : Promise.resolve(u).then(r, o); }
|
|
8216
8223
|
function _asyncToGenerator(n) { return function () { var t = this, e = arguments; return new Promise(function (r, o) { var a = n.apply(t, e); function _next(n) { asyncGeneratorStep(a, r, o, _next, _throw, "next", n); } function _throw(n) { asyncGeneratorStep(a, r, o, _next, _throw, "throw", n); } _next(void 0); }); }; }
|
|
8217
8224
|
/**
|
|
8218
8225
|
* AuthScape Sitemap - Pages Router Implementation
|
|
8219
8226
|
* This file contains the complete sitemap logic for Next.js Pages Router
|
|
8220
|
-
* Users will
|
|
8227
|
+
* Users will import and call createSitemapHandler from their pages/sitemap.xml.js file
|
|
8221
8228
|
*/
|
|
8222
8229
|
|
|
8223
8230
|
// Empty component - sitemap is generated server-side only
|
|
@@ -8225,79 +8232,84 @@ function Sitemap() {
|
|
|
8225
8232
|
return null;
|
|
8226
8233
|
}
|
|
8227
8234
|
|
|
8228
|
-
|
|
8229
|
-
|
|
8230
|
-
|
|
8231
|
-
}
|
|
8232
|
-
|
|
8233
|
-
|
|
8234
|
-
|
|
8235
|
-
|
|
8236
|
-
|
|
8237
|
-
|
|
8238
|
-
|
|
8239
|
-
|
|
8240
|
-
|
|
8241
|
-
|
|
8242
|
-
|
|
8243
|
-
|
|
8244
|
-
|
|
8245
|
-
|
|
8246
|
-
|
|
8247
|
-
|
|
8248
|
-
|
|
8249
|
-
|
|
8250
|
-
|
|
8251
|
-
|
|
8252
|
-
|
|
8253
|
-
|
|
8254
|
-
|
|
8255
|
-
|
|
8256
|
-
|
|
8257
|
-
|
|
8258
|
-
|
|
8259
|
-
|
|
8260
|
-
|
|
8261
|
-
|
|
8262
|
-
|
|
8263
|
-
|
|
8264
|
-
|
|
8265
|
-
|
|
8266
|
-
|
|
8267
|
-
|
|
8268
|
-
|
|
8269
|
-
|
|
8270
|
-
|
|
8271
|
-
|
|
8272
|
-
|
|
8273
|
-
|
|
8274
|
-
|
|
8275
|
-
|
|
8235
|
+
/**
|
|
8236
|
+
* Creates a sitemap handler with the provided API URI
|
|
8237
|
+
* @param {string} apiUri - The AuthScape API base URI (from process.env.apiUri)
|
|
8238
|
+
* @returns {Function} getServerSideProps function
|
|
8239
|
+
*/
|
|
8240
|
+
function createSitemapHandler(apiUri) {
|
|
8241
|
+
return /*#__PURE__*/function () {
|
|
8242
|
+
var _getServerSideProps = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee(_ref) {
|
|
8243
|
+
var req, res, protocol, host, domain, encodedDomain, response, sitemap;
|
|
8244
|
+
return _regeneratorRuntime().wrap(function _callee$(_context) {
|
|
8245
|
+
while (1) switch (_context.prev = _context.next) {
|
|
8246
|
+
case 0:
|
|
8247
|
+
req = _ref.req, res = _ref.res;
|
|
8248
|
+
_context.prev = 1;
|
|
8249
|
+
// Get the domain from the request
|
|
8250
|
+
protocol = req.headers['x-forwarded-proto'] || 'http';
|
|
8251
|
+
host = req.headers.host;
|
|
8252
|
+
domain = "".concat(protocol, "://").concat(host); // URL encode the domain for the API request
|
|
8253
|
+
encodedDomain = encodeURIComponent(domain);
|
|
8254
|
+
if (apiUri) {
|
|
8255
|
+
_context.next = 13;
|
|
8256
|
+
break;
|
|
8257
|
+
}
|
|
8258
|
+
console.error('AuthScape Sitemap Error: apiUri is not configured in environment variables');
|
|
8259
|
+
res.statusCode = 500;
|
|
8260
|
+
res.setHeader('Content-Type', 'text/plain');
|
|
8261
|
+
res.write('Sitemap configuration error: API URI not set. Please ensure apiUri is defined in your next.config.js env object or .env.local file.');
|
|
8262
|
+
res.end();
|
|
8263
|
+
return _context.abrupt("return", {
|
|
8264
|
+
props: {}
|
|
8265
|
+
});
|
|
8266
|
+
case 13:
|
|
8267
|
+
_context.next = 15;
|
|
8268
|
+
return fetch("".concat(apiUri, "/api/Sitemap?domain=").concat(encodedDomain));
|
|
8269
|
+
case 15:
|
|
8270
|
+
response = _context.sent;
|
|
8271
|
+
if (response.ok) {
|
|
8272
|
+
_context.next = 18;
|
|
8273
|
+
break;
|
|
8274
|
+
}
|
|
8275
|
+
throw new Error("API request failed with status ".concat(response.status));
|
|
8276
|
+
case 18:
|
|
8277
|
+
_context.next = 20;
|
|
8278
|
+
return response.text();
|
|
8279
|
+
case 20:
|
|
8280
|
+
sitemap = _context.sent;
|
|
8281
|
+
// Set the appropriate headers for XML
|
|
8282
|
+
res.setHeader('Content-Type', 'text/xml; charset=utf-8');
|
|
8283
|
+
res.setHeader('Cache-Control', 'public, s-maxage=86400, stale-while-revalidate');
|
|
8276
8284
|
|
|
8277
|
-
|
|
8278
|
-
|
|
8279
|
-
|
|
8280
|
-
|
|
8281
|
-
|
|
8282
|
-
|
|
8283
|
-
|
|
8284
|
-
|
|
8285
|
-
|
|
8286
|
-
|
|
8287
|
-
|
|
8288
|
-
|
|
8289
|
-
|
|
8290
|
-
|
|
8291
|
-
|
|
8292
|
-
|
|
8293
|
-
|
|
8294
|
-
|
|
8295
|
-
|
|
8296
|
-
|
|
8297
|
-
|
|
8298
|
-
|
|
8299
|
-
|
|
8300
|
-
|
|
8285
|
+
// Send the XML response
|
|
8286
|
+
res.write(sitemap);
|
|
8287
|
+
res.end();
|
|
8288
|
+
return _context.abrupt("return", {
|
|
8289
|
+
props: {}
|
|
8290
|
+
});
|
|
8291
|
+
case 28:
|
|
8292
|
+
_context.prev = 28;
|
|
8293
|
+
_context.t0 = _context["catch"](1);
|
|
8294
|
+
console.error('AuthScape Sitemap Error:', _context.t0);
|
|
8295
|
+
res.statusCode = 500;
|
|
8296
|
+
res.setHeader('Content-Type', 'text/plain');
|
|
8297
|
+
res.write('Error generating sitemap');
|
|
8298
|
+
res.end();
|
|
8299
|
+
return _context.abrupt("return", {
|
|
8300
|
+
props: {}
|
|
8301
|
+
});
|
|
8302
|
+
case 36:
|
|
8303
|
+
case "end":
|
|
8304
|
+
return _context.stop();
|
|
8305
|
+
}
|
|
8306
|
+
}, _callee, null, [[1, 28]]);
|
|
8307
|
+
}));
|
|
8308
|
+
function getServerSideProps(_x) {
|
|
8309
|
+
return _getServerSideProps.apply(this, arguments);
|
|
8310
|
+
}
|
|
8311
|
+
return getServerSideProps;
|
|
8312
|
+
}();
|
|
8301
8313
|
}
|
|
8302
8314
|
"use strict";
|
|
8303
8315
|
|
package/package.json
CHANGED
|
@@ -1,8 +1,16 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "authscape",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.726",
|
|
4
4
|
"description": "",
|
|
5
5
|
"main": "index.js",
|
|
6
|
+
"files": [
|
|
7
|
+
"index.js",
|
|
8
|
+
"src/lib/**",
|
|
9
|
+
"src/scripts/**",
|
|
10
|
+
"src/services/**",
|
|
11
|
+
"src/components/**",
|
|
12
|
+
"readme.md"
|
|
13
|
+
],
|
|
6
14
|
"scripts": {
|
|
7
15
|
"test": "echo \"Error: no test specified\" && exit 1",
|
|
8
16
|
"build": "npx babel src --out-file index.js --ignore \"src/scripts/**\"",
|
package/src/lib/sitemap-route.js
CHANGED
|
@@ -1,58 +1,62 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* AuthScape Sitemap - App Router Implementation
|
|
3
3
|
* This file contains the complete sitemap logic for Next.js App Router (Route Handlers)
|
|
4
|
-
* Users will
|
|
4
|
+
* Users will import and call createSitemapRoute from their app/sitemap.xml/route.js file
|
|
5
5
|
*/
|
|
6
6
|
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
7
|
+
/**
|
|
8
|
+
* Creates a sitemap route handler with the provided API URI
|
|
9
|
+
* @param {string} apiUri - The AuthScape API base URI (from process.env.apiUri)
|
|
10
|
+
* @returns {Function} GET route handler function
|
|
11
|
+
*/
|
|
12
|
+
export function createSitemapRoute(apiUri) {
|
|
13
|
+
return async function GET(request) {
|
|
14
|
+
try {
|
|
15
|
+
// Get the domain from the request
|
|
16
|
+
const url = new URL(request.url);
|
|
17
|
+
const protocol = request.headers.get('x-forwarded-proto') || url.protocol.replace(':', '');
|
|
18
|
+
const host = request.headers.get('host') || url.host;
|
|
19
|
+
const domain = `${protocol}://${host}`;
|
|
20
|
+
|
|
21
|
+
// URL encode the domain for the API request
|
|
22
|
+
const encodedDomain = encodeURIComponent(domain);
|
|
23
|
+
|
|
24
|
+
if (!apiUri) {
|
|
25
|
+
console.error('AuthScape Sitemap Error: apiUri is not configured in environment variables');
|
|
26
|
+
return new Response('Sitemap configuration error: API URI not set. Please ensure apiUri is defined in your next.config.js env object or .env.local file.', {
|
|
27
|
+
status: 500,
|
|
28
|
+
headers: {
|
|
29
|
+
'Content-Type': 'text/plain',
|
|
30
|
+
},
|
|
31
|
+
});
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
const response = await fetch(`${apiUri}/api/Sitemap?domain=${encodedDomain}`);
|
|
35
|
+
|
|
36
|
+
if (!response.ok) {
|
|
37
|
+
throw new Error(`API request failed with status ${response.status}`);
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
// Get the sitemap XML
|
|
41
|
+
const sitemap = await response.text();
|
|
42
|
+
|
|
43
|
+
// Return the XML response with appropriate headers
|
|
44
|
+
return new Response(sitemap, {
|
|
45
|
+
status: 200,
|
|
46
|
+
headers: {
|
|
47
|
+
'Content-Type': 'text/xml; charset=utf-8',
|
|
48
|
+
'Cache-Control': 'public, s-maxage=86400, stale-while-revalidate',
|
|
49
|
+
},
|
|
50
|
+
});
|
|
51
|
+
} catch (error) {
|
|
52
|
+
console.error('AuthScape Sitemap Error:', error);
|
|
20
53
|
|
|
21
|
-
|
|
22
|
-
console.error('AuthScape Sitemap Error: apiUri is not configured in environment variables');
|
|
23
|
-
return new Response('Sitemap configuration error: API URI not set', {
|
|
54
|
+
return new Response('Error generating sitemap', {
|
|
24
55
|
status: 500,
|
|
25
56
|
headers: {
|
|
26
57
|
'Content-Type': 'text/plain',
|
|
27
58
|
},
|
|
28
59
|
});
|
|
29
60
|
}
|
|
30
|
-
|
|
31
|
-
const response = await fetch(`${apiUrl}/api/Sitemap?domain=${encodedDomain}`);
|
|
32
|
-
|
|
33
|
-
if (!response.ok) {
|
|
34
|
-
throw new Error(`API request failed with status ${response.status}`);
|
|
35
|
-
}
|
|
36
|
-
|
|
37
|
-
// Get the sitemap XML
|
|
38
|
-
const sitemap = await response.text();
|
|
39
|
-
|
|
40
|
-
// Return the XML response with appropriate headers
|
|
41
|
-
return new Response(sitemap, {
|
|
42
|
-
status: 200,
|
|
43
|
-
headers: {
|
|
44
|
-
'Content-Type': 'text/xml; charset=utf-8',
|
|
45
|
-
'Cache-Control': 'public, s-maxage=86400, stale-while-revalidate',
|
|
46
|
-
},
|
|
47
|
-
});
|
|
48
|
-
} catch (error) {
|
|
49
|
-
console.error('AuthScape Sitemap Error:', error);
|
|
50
|
-
|
|
51
|
-
return new Response('Error generating sitemap', {
|
|
52
|
-
status: 500,
|
|
53
|
-
headers: {
|
|
54
|
-
'Content-Type': 'text/plain',
|
|
55
|
-
},
|
|
56
|
-
});
|
|
57
|
-
}
|
|
61
|
+
};
|
|
58
62
|
}
|
package/src/lib/sitemap.js
CHANGED
|
@@ -1,67 +1,70 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* AuthScape Sitemap - Pages Router Implementation
|
|
3
3
|
* This file contains the complete sitemap logic for Next.js Pages Router
|
|
4
|
-
* Users will
|
|
4
|
+
* Users will import and call createSitemapHandler from their pages/sitemap.xml.js file
|
|
5
5
|
*/
|
|
6
6
|
|
|
7
7
|
// Empty component - sitemap is generated server-side only
|
|
8
|
-
export
|
|
8
|
+
export function Sitemap() {
|
|
9
9
|
return null;
|
|
10
10
|
}
|
|
11
11
|
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
12
|
+
/**
|
|
13
|
+
* Creates a sitemap handler with the provided API URI
|
|
14
|
+
* @param {string} apiUri - The AuthScape API base URI (from process.env.apiUri)
|
|
15
|
+
* @returns {Function} getServerSideProps function
|
|
16
|
+
*/
|
|
17
|
+
export function createSitemapHandler(apiUri) {
|
|
18
|
+
return async function getServerSideProps({ req, res }) {
|
|
19
|
+
try {
|
|
20
|
+
// Get the domain from the request
|
|
21
|
+
const protocol = req.headers['x-forwarded-proto'] || 'http';
|
|
22
|
+
const host = req.headers.host;
|
|
23
|
+
const domain = `${protocol}://${host}`;
|
|
19
24
|
|
|
20
|
-
|
|
21
|
-
|
|
25
|
+
// URL encode the domain for the API request
|
|
26
|
+
const encodedDomain = encodeURIComponent(domain);
|
|
22
27
|
|
|
23
|
-
|
|
24
|
-
|
|
28
|
+
if (!apiUri) {
|
|
29
|
+
console.error('AuthScape Sitemap Error: apiUri is not configured in environment variables');
|
|
30
|
+
res.statusCode = 500;
|
|
31
|
+
res.setHeader('Content-Type', 'text/plain');
|
|
32
|
+
res.write('Sitemap configuration error: API URI not set. Please ensure apiUri is defined in your next.config.js env object or .env.local file.');
|
|
33
|
+
res.end();
|
|
34
|
+
return { props: {} };
|
|
35
|
+
}
|
|
25
36
|
|
|
26
|
-
|
|
27
|
-
console.error('AuthScape Sitemap Error: apiUri is not configured in environment variables');
|
|
28
|
-
res.statusCode = 500;
|
|
29
|
-
res.setHeader('Content-Type', 'text/plain');
|
|
30
|
-
res.write('Sitemap configuration error: API URI not set');
|
|
31
|
-
res.end();
|
|
32
|
-
return { props: {} };
|
|
33
|
-
}
|
|
37
|
+
let response = await fetch(`${apiUri}/api/Sitemap?domain=${encodedDomain}`);
|
|
34
38
|
|
|
35
|
-
|
|
39
|
+
if (!response.ok) {
|
|
40
|
+
throw new Error(`API request failed with status ${response.status}`);
|
|
41
|
+
}
|
|
36
42
|
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
}
|
|
43
|
+
// Generate the sitemap XML
|
|
44
|
+
const sitemap = await response.text();
|
|
40
45
|
|
|
41
|
-
|
|
42
|
-
|
|
46
|
+
// Set the appropriate headers for XML
|
|
47
|
+
res.setHeader('Content-Type', 'text/xml; charset=utf-8');
|
|
48
|
+
res.setHeader('Cache-Control', 'public, s-maxage=86400, stale-while-revalidate');
|
|
43
49
|
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
// Send the XML response
|
|
49
|
-
res.write(sitemap);
|
|
50
|
-
res.end();
|
|
50
|
+
// Send the XML response
|
|
51
|
+
res.write(sitemap);
|
|
52
|
+
res.end();
|
|
51
53
|
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
54
|
+
return {
|
|
55
|
+
props: {},
|
|
56
|
+
};
|
|
57
|
+
} catch (error) {
|
|
58
|
+
console.error('AuthScape Sitemap Error:', error);
|
|
57
59
|
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
60
|
+
res.statusCode = 500;
|
|
61
|
+
res.setHeader('Content-Type', 'text/plain');
|
|
62
|
+
res.write('Error generating sitemap');
|
|
63
|
+
res.end();
|
|
62
64
|
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
65
|
+
return {
|
|
66
|
+
props: {},
|
|
67
|
+
};
|
|
68
|
+
}
|
|
69
|
+
};
|
|
67
70
|
}
|
|
@@ -10,12 +10,18 @@ const path = require('path');
|
|
|
10
10
|
|
|
11
11
|
// Template for Pages Router
|
|
12
12
|
const PAGES_ROUTER_TEMPLATE = `// Auto-generated by AuthScape - Do not edit manually
|
|
13
|
-
|
|
13
|
+
import { Sitemap, createSitemapHandler } from 'authscape/src/lib/sitemap';
|
|
14
|
+
|
|
15
|
+
export default Sitemap;
|
|
16
|
+
|
|
17
|
+
export const getServerSideProps = createSitemapHandler(process.env.apiUri);
|
|
14
18
|
`;
|
|
15
19
|
|
|
16
20
|
// Template for App Router
|
|
17
21
|
const APP_ROUTER_TEMPLATE = `// Auto-generated by AuthScape - Do not edit manually
|
|
18
|
-
|
|
22
|
+
import { createSitemapRoute } from 'authscape/src/lib/sitemap-route';
|
|
23
|
+
|
|
24
|
+
export const GET = createSitemapRoute(process.env.apiUri);
|
|
19
25
|
`;
|
|
20
26
|
|
|
21
27
|
function detectProjectStructure() {
|
package/.babelrc
DELETED
|
@@ -1,103 +0,0 @@
|
|
|
1
|
-
.Container {
|
|
2
|
-
display: flex;
|
|
3
|
-
flex-direction: column;
|
|
4
|
-
grid-auto-rows: max-content;
|
|
5
|
-
overflow: hidden;
|
|
6
|
-
box-sizing: border-box;
|
|
7
|
-
appearance: none;
|
|
8
|
-
outline: none;
|
|
9
|
-
min-width: 350px;
|
|
10
|
-
margin: 10px;
|
|
11
|
-
border-radius: 5px;
|
|
12
|
-
min-height: 200px;
|
|
13
|
-
transition: background-color 350ms ease;
|
|
14
|
-
background-color: rgba(246, 246, 246, 1);
|
|
15
|
-
border: 1px solid rgba(0, 0, 0, 0.05);
|
|
16
|
-
font-size: 1em;
|
|
17
|
-
|
|
18
|
-
.ul {
|
|
19
|
-
display: grid;
|
|
20
|
-
grid-gap: 10px;
|
|
21
|
-
grid-template-columns: repeat(var(--columns, 1), 1fr);
|
|
22
|
-
list-style: none;
|
|
23
|
-
padding: 20px;
|
|
24
|
-
margin: 0;
|
|
25
|
-
}
|
|
26
|
-
|
|
27
|
-
&.scrollable {
|
|
28
|
-
.ul {
|
|
29
|
-
overflow-y: auto;
|
|
30
|
-
}
|
|
31
|
-
}
|
|
32
|
-
|
|
33
|
-
&.placeholder {
|
|
34
|
-
justify-content: center;
|
|
35
|
-
align-items: center;
|
|
36
|
-
cursor: pointer;
|
|
37
|
-
color: rgba(0, 0, 0, 0.5);
|
|
38
|
-
background-color: transparent;
|
|
39
|
-
border-style: dashed;
|
|
40
|
-
border-color: rgba(0, 0, 0, 0.08);
|
|
41
|
-
|
|
42
|
-
/* &:hover {
|
|
43
|
-
border-color: rgba(0, 0, 0, 0.15);
|
|
44
|
-
} */
|
|
45
|
-
}
|
|
46
|
-
|
|
47
|
-
&.hover {
|
|
48
|
-
background-color: rgb(235, 235, 235, 1);
|
|
49
|
-
}
|
|
50
|
-
|
|
51
|
-
&.unstyled {
|
|
52
|
-
overflow: visible;
|
|
53
|
-
background-color: transparent !important;
|
|
54
|
-
border: none !important;
|
|
55
|
-
}
|
|
56
|
-
|
|
57
|
-
&.horizontal {
|
|
58
|
-
width: 100%;
|
|
59
|
-
|
|
60
|
-
.ul {
|
|
61
|
-
grid-auto-flow: column;
|
|
62
|
-
}
|
|
63
|
-
}
|
|
64
|
-
|
|
65
|
-
&.shadow {
|
|
66
|
-
box-shadow: 0 1px 10px 0 rgba(34, 33, 81, 0.1);
|
|
67
|
-
}
|
|
68
|
-
|
|
69
|
-
/* &:focus-visible {
|
|
70
|
-
border-color: transparent;
|
|
71
|
-
box-shadow: 0 0 0 2px rgba(255, 255, 255, 0), 0 0px 0px 2px #4c9ffe;
|
|
72
|
-
} */
|
|
73
|
-
}
|
|
74
|
-
|
|
75
|
-
.Header {
|
|
76
|
-
display: flex;
|
|
77
|
-
padding: 5px 20px;
|
|
78
|
-
padding-right: 8px;
|
|
79
|
-
align-items: center;
|
|
80
|
-
justify-content: space-between;
|
|
81
|
-
background-color: #fff;
|
|
82
|
-
border-top-left-radius: 5px;
|
|
83
|
-
border-top-right-radius: 5px;
|
|
84
|
-
border-bottom: 1px solid rgba(0, 0, 0, 0.08);
|
|
85
|
-
|
|
86
|
-
/* &:hover {
|
|
87
|
-
.Actions > * {
|
|
88
|
-
opacity: 1 !important;
|
|
89
|
-
}
|
|
90
|
-
} */
|
|
91
|
-
}
|
|
92
|
-
|
|
93
|
-
/* .Actions {
|
|
94
|
-
display: flex;
|
|
95
|
-
|
|
96
|
-
> *:first-child:not(:last-child) {
|
|
97
|
-
opacity: 0;
|
|
98
|
-
|
|
99
|
-
&:focus-visible {
|
|
100
|
-
opacity: 1;
|
|
101
|
-
}
|
|
102
|
-
}
|
|
103
|
-
} */
|
package/dist/Item.module.css
DELETED
|
@@ -1,135 +0,0 @@
|
|
|
1
|
-
@keyframes pop {
|
|
2
|
-
0% {
|
|
3
|
-
transform: scale(1);
|
|
4
|
-
box-shadow: var(--box-shadow);
|
|
5
|
-
}
|
|
6
|
-
100% {
|
|
7
|
-
transform: scale(var(--scale));
|
|
8
|
-
box-shadow: var(--box-shadow-picked-up);
|
|
9
|
-
}
|
|
10
|
-
}
|
|
11
|
-
|
|
12
|
-
@keyframes fadeIn {
|
|
13
|
-
0% {
|
|
14
|
-
opacity: 0;
|
|
15
|
-
}
|
|
16
|
-
100% {
|
|
17
|
-
opacity: 1;
|
|
18
|
-
}
|
|
19
|
-
}
|
|
20
|
-
|
|
21
|
-
.Wrapper {
|
|
22
|
-
display: flex;
|
|
23
|
-
box-sizing: border-box;
|
|
24
|
-
transform: translate3d(var(--translate-x, 0), var(--translate-y, 0), 0)
|
|
25
|
-
scaleX(var(--scale-x, 1)) scaleY(var(--scale-y, 1));
|
|
26
|
-
transform-origin: 0 0;
|
|
27
|
-
touch-action: manipulation;
|
|
28
|
-
|
|
29
|
-
&.fadeIn {
|
|
30
|
-
animation: fadeIn 500ms ease;
|
|
31
|
-
}
|
|
32
|
-
|
|
33
|
-
&.dragOverlay {
|
|
34
|
-
--scale: 1.05;
|
|
35
|
-
--box-shadow: $box-shadow;
|
|
36
|
-
--box-shadow-picked-up: $box-shadow-border,
|
|
37
|
-
-1px 0 15px 0 rgba(34, 33, 81, 0.01),
|
|
38
|
-
0px 15px 15px 0 rgba(34, 33, 81, 0.25);
|
|
39
|
-
z-index: 999;
|
|
40
|
-
}
|
|
41
|
-
}
|
|
42
|
-
|
|
43
|
-
.Item {
|
|
44
|
-
position: relative;
|
|
45
|
-
display: flex;
|
|
46
|
-
flex-grow: 1;
|
|
47
|
-
align-items: center;
|
|
48
|
-
padding: 18px 20px;
|
|
49
|
-
background-color: #fff;
|
|
50
|
-
box-shadow: 0 0 0 calc(1px / var(--scale-x, 1)) rgba(63, 63, 68, 0.05), 0 1px calc(3px / var(--scale-x, 1)) 0 rgba(34, 33, 81, 0.15);
|
|
51
|
-
outline: none;
|
|
52
|
-
border-radius: calc(4px / var(--scale-x, 1));
|
|
53
|
-
box-sizing: border-box;
|
|
54
|
-
list-style: none;
|
|
55
|
-
transform-origin: 50% 50%;
|
|
56
|
-
|
|
57
|
-
-webkit-tap-highlight-color: transparent;
|
|
58
|
-
|
|
59
|
-
color: #333;
|
|
60
|
-
font-weight: 400;
|
|
61
|
-
font-size: 1rem;
|
|
62
|
-
white-space: nowrap;
|
|
63
|
-
|
|
64
|
-
transform: scale(var(--scale, 1));
|
|
65
|
-
transition: box-shadow 200ms cubic-bezier(0.18, 0.67, 0.6, 1.22);
|
|
66
|
-
|
|
67
|
-
/* &:focus-visible {
|
|
68
|
-
box-shadow: 0 0px 4px 1px #4c9ffe, 0 0 0 calc(1px / var(--scale-x, 1)) rgba(63, 63, 68, 0.05), 0 1px calc(3px / var(--scale-x, 1)) 0 rgba(34, 33, 81, 0.15);
|
|
69
|
-
} */
|
|
70
|
-
|
|
71
|
-
&:not(.withHandle) {
|
|
72
|
-
touch-action: manipulation;
|
|
73
|
-
cursor: pointer;
|
|
74
|
-
}
|
|
75
|
-
|
|
76
|
-
&.dragging:not(.dragOverlay) {
|
|
77
|
-
opacity: var(--dragging-opacity, 0.5);
|
|
78
|
-
z-index: 0;
|
|
79
|
-
|
|
80
|
-
/* &:focus {
|
|
81
|
-
box-shadow: 0 0 0 calc(1px / var(--scale-x, 1)) rgba(63, 63, 68, 0.05), 0 1px calc(3px / var(--scale-x, 1)) 0 rgba(34, 33, 81, 0.15);
|
|
82
|
-
} */
|
|
83
|
-
}
|
|
84
|
-
|
|
85
|
-
&.disabled {
|
|
86
|
-
color: #999;
|
|
87
|
-
background-color: #f1f1f1;
|
|
88
|
-
/* &:focus {
|
|
89
|
-
box-shadow: 0 0px 4px 1px rgba(0, 0, 0, 0.1), 0 0 0 calc(1px / var(--scale-x, 1)) rgba(63, 63, 68, 0.05), 0 1px calc(3px / var(--scale-x, 1)) 0 rgba(34, 33, 81, 0.15);
|
|
90
|
-
} */
|
|
91
|
-
cursor: not-allowed;
|
|
92
|
-
}
|
|
93
|
-
|
|
94
|
-
&.dragOverlay {
|
|
95
|
-
cursor: inherit;
|
|
96
|
-
/* box-shadow: 0 0px 6px 2px $focused-outline-color; */
|
|
97
|
-
animation: pop 200ms cubic-bezier(0.18, 0.67, 0.6, 1.22);
|
|
98
|
-
transform: scale(var(--scale));
|
|
99
|
-
box-shadow: var(--box-shadow-picked-up);
|
|
100
|
-
opacity: 1;
|
|
101
|
-
}
|
|
102
|
-
|
|
103
|
-
&.color:before {
|
|
104
|
-
content: '';
|
|
105
|
-
position: absolute;
|
|
106
|
-
top: 50%;
|
|
107
|
-
transform: translateY(-50%);
|
|
108
|
-
left: 0;
|
|
109
|
-
height: 100%;
|
|
110
|
-
width: 3px;
|
|
111
|
-
display: block;
|
|
112
|
-
border-top-left-radius: 3px;
|
|
113
|
-
border-bottom-left-radius: 3px;
|
|
114
|
-
background-color: var(--color);
|
|
115
|
-
}
|
|
116
|
-
|
|
117
|
-
/* &:hover {
|
|
118
|
-
.Remove {
|
|
119
|
-
visibility: visible;
|
|
120
|
-
}
|
|
121
|
-
} */
|
|
122
|
-
}
|
|
123
|
-
|
|
124
|
-
.Remove {
|
|
125
|
-
visibility: hidden;
|
|
126
|
-
}
|
|
127
|
-
|
|
128
|
-
.Actions {
|
|
129
|
-
display: flex;
|
|
130
|
-
align-self: flex-start;
|
|
131
|
-
margin-top: -12px;
|
|
132
|
-
margin-left: auto;
|
|
133
|
-
margin-bottom: -15px;
|
|
134
|
-
margin-right: -10px;
|
|
135
|
-
}
|