@hasna/shortlinks 0.2.4 → 0.2.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/README.md +35 -0
- package/dist/cli/index.js +443 -236
- package/dist/index.js +21 -21
- package/dist/mcp/index.js +1 -1
- package/dist/serve/index.js +21 -21
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -1196,7 +1196,7 @@ class PgShortlinksStore {
|
|
|
1196
1196
|
throw new Error("Could not generate an unused slug after 32 attempts.");
|
|
1197
1197
|
}
|
|
1198
1198
|
}
|
|
1199
|
-
// node_modules
|
|
1199
|
+
// node_modules/@hasna/contracts/dist/client/storage.js
|
|
1200
1200
|
var __defProp2 = Object.defineProperty;
|
|
1201
1201
|
var __returnValue = (v) => v;
|
|
1202
1202
|
function __exportSetter(name, newValue) {
|
|
@@ -7815,7 +7815,7 @@ async function withStore(fn, env = process.env, options = {}) {
|
|
|
7815
7815
|
await store.close();
|
|
7816
7816
|
}
|
|
7817
7817
|
}
|
|
7818
|
-
// node_modules
|
|
7818
|
+
// node_modules/@hasna/contracts/dist/auth/index.js
|
|
7819
7819
|
import { createHash as createHash3, createHmac, randomBytes as randomBytes3, timingSafeEqual } from "crypto";
|
|
7820
7820
|
var API_KEY_TOKEN_VERSION = 1;
|
|
7821
7821
|
var API_KEY_NAMESPACE = "hasna";
|
|
@@ -8315,7 +8315,7 @@ var SHORTLINKS_MIGRATIONS = [
|
|
|
8315
8315
|
...CORE_MIGRATIONS,
|
|
8316
8316
|
...apiKeyMigrations().map((m) => defineMigration(m.id, m.sql))
|
|
8317
8317
|
];
|
|
8318
|
-
// node_modules
|
|
8318
|
+
// node_modules/hono/dist/compose.js
|
|
8319
8319
|
var compose = (middleware, onError, onNotFound) => {
|
|
8320
8320
|
return (context, next) => {
|
|
8321
8321
|
let index = -1;
|
|
@@ -8359,10 +8359,10 @@ var compose = (middleware, onError, onNotFound) => {
|
|
|
8359
8359
|
};
|
|
8360
8360
|
};
|
|
8361
8361
|
|
|
8362
|
-
// node_modules
|
|
8362
|
+
// node_modules/hono/dist/request/constants.js
|
|
8363
8363
|
var GET_MATCH_RESULT = /* @__PURE__ */ Symbol();
|
|
8364
8364
|
|
|
8365
|
-
// node_modules
|
|
8365
|
+
// node_modules/hono/dist/utils/body.js
|
|
8366
8366
|
var parseBody = async (request, options = /* @__PURE__ */ Object.create(null)) => {
|
|
8367
8367
|
const { all = false, dot = false } = options;
|
|
8368
8368
|
const headers = request instanceof HonoRequest ? request.raw.headers : request.headers;
|
|
@@ -8433,7 +8433,7 @@ var handleParsingNestedValues = (form, key, value) => {
|
|
|
8433
8433
|
});
|
|
8434
8434
|
};
|
|
8435
8435
|
|
|
8436
|
-
// node_modules
|
|
8436
|
+
// node_modules/hono/dist/utils/url.js
|
|
8437
8437
|
var splitPath = (path) => {
|
|
8438
8438
|
const paths = path.split("/");
|
|
8439
8439
|
if (paths[0] === "") {
|
|
@@ -8633,7 +8633,7 @@ var getQueryParams = (url, key) => {
|
|
|
8633
8633
|
};
|
|
8634
8634
|
var decodeURIComponent_ = decodeURIComponent;
|
|
8635
8635
|
|
|
8636
|
-
// node_modules
|
|
8636
|
+
// node_modules/hono/dist/request.js
|
|
8637
8637
|
var tryDecodeURIComponent = (str) => tryDecode(str, decodeURIComponent_);
|
|
8638
8638
|
var HonoRequest = class {
|
|
8639
8639
|
raw;
|
|
@@ -8747,7 +8747,7 @@ var HonoRequest = class {
|
|
|
8747
8747
|
}
|
|
8748
8748
|
};
|
|
8749
8749
|
|
|
8750
|
-
// node_modules
|
|
8750
|
+
// node_modules/hono/dist/utils/html.js
|
|
8751
8751
|
var HtmlEscapedCallbackPhase = {
|
|
8752
8752
|
Stringify: 1,
|
|
8753
8753
|
BeforeStream: 2,
|
|
@@ -8785,7 +8785,7 @@ var resolveCallback = async (str, phase, preserveCallbacks, context, buffer) =>
|
|
|
8785
8785
|
}
|
|
8786
8786
|
};
|
|
8787
8787
|
|
|
8788
|
-
// node_modules
|
|
8788
|
+
// node_modules/hono/dist/context.js
|
|
8789
8789
|
var TEXT_PLAIN = "text/plain; charset=UTF-8";
|
|
8790
8790
|
var setDefaultContentType = (contentType, headers) => {
|
|
8791
8791
|
return {
|
|
@@ -8952,7 +8952,7 @@ var Context = class {
|
|
|
8952
8952
|
};
|
|
8953
8953
|
};
|
|
8954
8954
|
|
|
8955
|
-
// node_modules
|
|
8955
|
+
// node_modules/hono/dist/router.js
|
|
8956
8956
|
var METHOD_NAME_ALL = "ALL";
|
|
8957
8957
|
var METHOD_NAME_ALL_LOWERCASE = "all";
|
|
8958
8958
|
var METHODS = ["get", "post", "put", "delete", "options", "patch"];
|
|
@@ -8960,10 +8960,10 @@ var MESSAGE_MATCHER_IS_ALREADY_BUILT = "Can not add a route since the matcher is
|
|
|
8960
8960
|
var UnsupportedPathError = class extends Error {
|
|
8961
8961
|
};
|
|
8962
8962
|
|
|
8963
|
-
// node_modules
|
|
8963
|
+
// node_modules/hono/dist/utils/constants.js
|
|
8964
8964
|
var COMPOSED_HANDLER = "__COMPOSED_HANDLER";
|
|
8965
8965
|
|
|
8966
|
-
// node_modules
|
|
8966
|
+
// node_modules/hono/dist/hono-base.js
|
|
8967
8967
|
var notFoundHandler = (c) => {
|
|
8968
8968
|
return c.text("404 Not Found", 404);
|
|
8969
8969
|
};
|
|
@@ -9187,7 +9187,7 @@ var Hono = class _Hono {
|
|
|
9187
9187
|
};
|
|
9188
9188
|
};
|
|
9189
9189
|
|
|
9190
|
-
// node_modules
|
|
9190
|
+
// node_modules/hono/dist/router/reg-exp-router/matcher.js
|
|
9191
9191
|
var emptyParam = [];
|
|
9192
9192
|
function match(method, path) {
|
|
9193
9193
|
const matchers = this.buildAllMatchers();
|
|
@@ -9208,7 +9208,7 @@ function match(method, path) {
|
|
|
9208
9208
|
return match2(method, path);
|
|
9209
9209
|
}
|
|
9210
9210
|
|
|
9211
|
-
// node_modules
|
|
9211
|
+
// node_modules/hono/dist/router/reg-exp-router/node.js
|
|
9212
9212
|
var LABEL_REG_EXP_STR = "[^/]+";
|
|
9213
9213
|
var ONLY_WILDCARD_REG_EXP_STR = ".*";
|
|
9214
9214
|
var TAIL_WILDCARD_REG_EXP_STR = "(?:|/.*)";
|
|
@@ -9312,7 +9312,7 @@ var Node = class _Node {
|
|
|
9312
9312
|
}
|
|
9313
9313
|
};
|
|
9314
9314
|
|
|
9315
|
-
// node_modules
|
|
9315
|
+
// node_modules/hono/dist/router/reg-exp-router/trie.js
|
|
9316
9316
|
var Trie = class {
|
|
9317
9317
|
#context = { varIndex: 0 };
|
|
9318
9318
|
#root = new Node;
|
|
@@ -9368,7 +9368,7 @@ var Trie = class {
|
|
|
9368
9368
|
}
|
|
9369
9369
|
};
|
|
9370
9370
|
|
|
9371
|
-
// node_modules
|
|
9371
|
+
// node_modules/hono/dist/router/reg-exp-router/router.js
|
|
9372
9372
|
var nullMatcher = [/^$/, [], /* @__PURE__ */ Object.create(null)];
|
|
9373
9373
|
var wildcardRegExpCache = /* @__PURE__ */ Object.create(null);
|
|
9374
9374
|
function buildWildcardRegExp(path) {
|
|
@@ -9533,7 +9533,7 @@ var RegExpRouter = class {
|
|
|
9533
9533
|
}
|
|
9534
9534
|
};
|
|
9535
9535
|
|
|
9536
|
-
// node_modules
|
|
9536
|
+
// node_modules/hono/dist/router/reg-exp-router/prepared-router.js
|
|
9537
9537
|
var PreparedRegExpRouter = class {
|
|
9538
9538
|
name = "PreparedRegExpRouter";
|
|
9539
9539
|
#matchers;
|
|
@@ -9605,7 +9605,7 @@ var PreparedRegExpRouter = class {
|
|
|
9605
9605
|
match = match;
|
|
9606
9606
|
};
|
|
9607
9607
|
|
|
9608
|
-
// node_modules
|
|
9608
|
+
// node_modules/hono/dist/router/smart-router/router.js
|
|
9609
9609
|
var SmartRouter = class {
|
|
9610
9610
|
name = "SmartRouter";
|
|
9611
9611
|
#routers = [];
|
|
@@ -9660,7 +9660,7 @@ var SmartRouter = class {
|
|
|
9660
9660
|
}
|
|
9661
9661
|
};
|
|
9662
9662
|
|
|
9663
|
-
// node_modules
|
|
9663
|
+
// node_modules/hono/dist/router/trie-router/node.js
|
|
9664
9664
|
var emptyParams = /* @__PURE__ */ Object.create(null);
|
|
9665
9665
|
var hasChildren = (children) => {
|
|
9666
9666
|
for (const _ in children) {
|
|
@@ -9829,7 +9829,7 @@ var Node2 = class _Node2 {
|
|
|
9829
9829
|
}
|
|
9830
9830
|
};
|
|
9831
9831
|
|
|
9832
|
-
// node_modules
|
|
9832
|
+
// node_modules/hono/dist/router/trie-router/router.js
|
|
9833
9833
|
var TrieRouter = class {
|
|
9834
9834
|
name = "TrieRouter";
|
|
9835
9835
|
#node;
|
|
@@ -9851,7 +9851,7 @@ var TrieRouter = class {
|
|
|
9851
9851
|
}
|
|
9852
9852
|
};
|
|
9853
9853
|
|
|
9854
|
-
// node_modules
|
|
9854
|
+
// node_modules/hono/dist/hono.js
|
|
9855
9855
|
var Hono2 = class extends Hono {
|
|
9856
9856
|
constructor(options = {}) {
|
|
9857
9857
|
super(options);
|
package/dist/mcp/index.js
CHANGED
|
@@ -38,7 +38,7 @@ import { Server } from "@modelcontextprotocol/sdk/server/index.js";
|
|
|
38
38
|
import { StdioServerTransport } from "@modelcontextprotocol/sdk/server/stdio.js";
|
|
39
39
|
import { CallToolRequestSchema, ListToolsRequestSchema } from "@modelcontextprotocol/sdk/types.js";
|
|
40
40
|
|
|
41
|
-
// node_modules
|
|
41
|
+
// node_modules/@hasna/contracts/dist/client/storage.js
|
|
42
42
|
var __defProp2 = Object.defineProperty;
|
|
43
43
|
var __returnValue = (v) => v;
|
|
44
44
|
function __exportSetter(name, newValue) {
|
package/dist/serve/index.js
CHANGED
|
@@ -4907,7 +4907,7 @@ var require_lib2 = __commonJS((exports, module) => {
|
|
|
4907
4907
|
var require_package = __commonJS((exports, module) => {
|
|
4908
4908
|
module.exports = {
|
|
4909
4909
|
name: "@hasna/shortlinks",
|
|
4910
|
-
version: "0.2.
|
|
4910
|
+
version: "0.2.7",
|
|
4911
4911
|
description: "Shortlink manager for custom domains and click tracking, with local SQLite or self-hosted cloud (/v1 API + bearer key) storage and Cloudflare setup helpers",
|
|
4912
4912
|
type: "module",
|
|
4913
4913
|
main: "dist/index.js",
|
|
@@ -5951,7 +5951,7 @@ class MigrationLedger {
|
|
|
5951
5951
|
}
|
|
5952
5952
|
}
|
|
5953
5953
|
|
|
5954
|
-
// node_modules
|
|
5954
|
+
// node_modules/@hasna/contracts/dist/auth/index.js
|
|
5955
5955
|
import { createHash as createHash3, createHmac, randomBytes as randomBytes3, timingSafeEqual } from "crypto";
|
|
5956
5956
|
var API_KEY_TOKEN_VERSION = 1;
|
|
5957
5957
|
var API_KEY_NAMESPACE = "hasna";
|
|
@@ -6370,7 +6370,7 @@ var SHORTLINKS_MIGRATIONS = [
|
|
|
6370
6370
|
...apiKeyMigrations().map((m) => defineMigration(m.id, m.sql))
|
|
6371
6371
|
];
|
|
6372
6372
|
|
|
6373
|
-
// node_modules
|
|
6373
|
+
// node_modules/hono/dist/compose.js
|
|
6374
6374
|
var compose = (middleware, onError, onNotFound) => {
|
|
6375
6375
|
return (context, next) => {
|
|
6376
6376
|
let index = -1;
|
|
@@ -6414,10 +6414,10 @@ var compose = (middleware, onError, onNotFound) => {
|
|
|
6414
6414
|
};
|
|
6415
6415
|
};
|
|
6416
6416
|
|
|
6417
|
-
// node_modules
|
|
6417
|
+
// node_modules/hono/dist/request/constants.js
|
|
6418
6418
|
var GET_MATCH_RESULT = /* @__PURE__ */ Symbol();
|
|
6419
6419
|
|
|
6420
|
-
// node_modules
|
|
6420
|
+
// node_modules/hono/dist/utils/body.js
|
|
6421
6421
|
var parseBody = async (request, options = /* @__PURE__ */ Object.create(null)) => {
|
|
6422
6422
|
const { all = false, dot = false } = options;
|
|
6423
6423
|
const headers = request instanceof HonoRequest ? request.raw.headers : request.headers;
|
|
@@ -6488,7 +6488,7 @@ var handleParsingNestedValues = (form, key, value) => {
|
|
|
6488
6488
|
});
|
|
6489
6489
|
};
|
|
6490
6490
|
|
|
6491
|
-
// node_modules
|
|
6491
|
+
// node_modules/hono/dist/utils/url.js
|
|
6492
6492
|
var splitPath = (path) => {
|
|
6493
6493
|
const paths = path.split("/");
|
|
6494
6494
|
if (paths[0] === "") {
|
|
@@ -6688,7 +6688,7 @@ var getQueryParams = (url, key) => {
|
|
|
6688
6688
|
};
|
|
6689
6689
|
var decodeURIComponent_ = decodeURIComponent;
|
|
6690
6690
|
|
|
6691
|
-
// node_modules
|
|
6691
|
+
// node_modules/hono/dist/request.js
|
|
6692
6692
|
var tryDecodeURIComponent = (str) => tryDecode(str, decodeURIComponent_);
|
|
6693
6693
|
var HonoRequest = class {
|
|
6694
6694
|
raw;
|
|
@@ -6802,7 +6802,7 @@ var HonoRequest = class {
|
|
|
6802
6802
|
}
|
|
6803
6803
|
};
|
|
6804
6804
|
|
|
6805
|
-
// node_modules
|
|
6805
|
+
// node_modules/hono/dist/utils/html.js
|
|
6806
6806
|
var HtmlEscapedCallbackPhase = {
|
|
6807
6807
|
Stringify: 1,
|
|
6808
6808
|
BeforeStream: 2,
|
|
@@ -6840,7 +6840,7 @@ var resolveCallback = async (str, phase, preserveCallbacks, context, buffer) =>
|
|
|
6840
6840
|
}
|
|
6841
6841
|
};
|
|
6842
6842
|
|
|
6843
|
-
// node_modules
|
|
6843
|
+
// node_modules/hono/dist/context.js
|
|
6844
6844
|
var TEXT_PLAIN = "text/plain; charset=UTF-8";
|
|
6845
6845
|
var setDefaultContentType = (contentType, headers) => {
|
|
6846
6846
|
return {
|
|
@@ -7007,7 +7007,7 @@ var Context = class {
|
|
|
7007
7007
|
};
|
|
7008
7008
|
};
|
|
7009
7009
|
|
|
7010
|
-
// node_modules
|
|
7010
|
+
// node_modules/hono/dist/router.js
|
|
7011
7011
|
var METHOD_NAME_ALL = "ALL";
|
|
7012
7012
|
var METHOD_NAME_ALL_LOWERCASE = "all";
|
|
7013
7013
|
var METHODS = ["get", "post", "put", "delete", "options", "patch"];
|
|
@@ -7015,10 +7015,10 @@ var MESSAGE_MATCHER_IS_ALREADY_BUILT = "Can not add a route since the matcher is
|
|
|
7015
7015
|
var UnsupportedPathError = class extends Error {
|
|
7016
7016
|
};
|
|
7017
7017
|
|
|
7018
|
-
// node_modules
|
|
7018
|
+
// node_modules/hono/dist/utils/constants.js
|
|
7019
7019
|
var COMPOSED_HANDLER = "__COMPOSED_HANDLER";
|
|
7020
7020
|
|
|
7021
|
-
// node_modules
|
|
7021
|
+
// node_modules/hono/dist/hono-base.js
|
|
7022
7022
|
var notFoundHandler = (c) => {
|
|
7023
7023
|
return c.text("404 Not Found", 404);
|
|
7024
7024
|
};
|
|
@@ -7242,7 +7242,7 @@ var Hono = class _Hono {
|
|
|
7242
7242
|
};
|
|
7243
7243
|
};
|
|
7244
7244
|
|
|
7245
|
-
// node_modules
|
|
7245
|
+
// node_modules/hono/dist/router/reg-exp-router/matcher.js
|
|
7246
7246
|
var emptyParam = [];
|
|
7247
7247
|
function match(method, path) {
|
|
7248
7248
|
const matchers = this.buildAllMatchers();
|
|
@@ -7263,7 +7263,7 @@ function match(method, path) {
|
|
|
7263
7263
|
return match2(method, path);
|
|
7264
7264
|
}
|
|
7265
7265
|
|
|
7266
|
-
// node_modules
|
|
7266
|
+
// node_modules/hono/dist/router/reg-exp-router/node.js
|
|
7267
7267
|
var LABEL_REG_EXP_STR = "[^/]+";
|
|
7268
7268
|
var ONLY_WILDCARD_REG_EXP_STR = ".*";
|
|
7269
7269
|
var TAIL_WILDCARD_REG_EXP_STR = "(?:|/.*)";
|
|
@@ -7367,7 +7367,7 @@ var Node = class _Node {
|
|
|
7367
7367
|
}
|
|
7368
7368
|
};
|
|
7369
7369
|
|
|
7370
|
-
// node_modules
|
|
7370
|
+
// node_modules/hono/dist/router/reg-exp-router/trie.js
|
|
7371
7371
|
var Trie = class {
|
|
7372
7372
|
#context = { varIndex: 0 };
|
|
7373
7373
|
#root = new Node;
|
|
@@ -7423,7 +7423,7 @@ var Trie = class {
|
|
|
7423
7423
|
}
|
|
7424
7424
|
};
|
|
7425
7425
|
|
|
7426
|
-
// node_modules
|
|
7426
|
+
// node_modules/hono/dist/router/reg-exp-router/router.js
|
|
7427
7427
|
var nullMatcher = [/^$/, [], /* @__PURE__ */ Object.create(null)];
|
|
7428
7428
|
var wildcardRegExpCache = /* @__PURE__ */ Object.create(null);
|
|
7429
7429
|
function buildWildcardRegExp(path) {
|
|
@@ -7588,7 +7588,7 @@ var RegExpRouter = class {
|
|
|
7588
7588
|
}
|
|
7589
7589
|
};
|
|
7590
7590
|
|
|
7591
|
-
// node_modules
|
|
7591
|
+
// node_modules/hono/dist/router/reg-exp-router/prepared-router.js
|
|
7592
7592
|
var PreparedRegExpRouter = class {
|
|
7593
7593
|
name = "PreparedRegExpRouter";
|
|
7594
7594
|
#matchers;
|
|
@@ -7660,7 +7660,7 @@ var PreparedRegExpRouter = class {
|
|
|
7660
7660
|
match = match;
|
|
7661
7661
|
};
|
|
7662
7662
|
|
|
7663
|
-
// node_modules
|
|
7663
|
+
// node_modules/hono/dist/router/smart-router/router.js
|
|
7664
7664
|
var SmartRouter = class {
|
|
7665
7665
|
name = "SmartRouter";
|
|
7666
7666
|
#routers = [];
|
|
@@ -7715,7 +7715,7 @@ var SmartRouter = class {
|
|
|
7715
7715
|
}
|
|
7716
7716
|
};
|
|
7717
7717
|
|
|
7718
|
-
// node_modules
|
|
7718
|
+
// node_modules/hono/dist/router/trie-router/node.js
|
|
7719
7719
|
var emptyParams = /* @__PURE__ */ Object.create(null);
|
|
7720
7720
|
var hasChildren = (children) => {
|
|
7721
7721
|
for (const _ in children) {
|
|
@@ -7884,7 +7884,7 @@ var Node2 = class _Node2 {
|
|
|
7884
7884
|
}
|
|
7885
7885
|
};
|
|
7886
7886
|
|
|
7887
|
-
// node_modules
|
|
7887
|
+
// node_modules/hono/dist/router/trie-router/router.js
|
|
7888
7888
|
var TrieRouter = class {
|
|
7889
7889
|
name = "TrieRouter";
|
|
7890
7890
|
#node;
|
|
@@ -7906,7 +7906,7 @@ var TrieRouter = class {
|
|
|
7906
7906
|
}
|
|
7907
7907
|
};
|
|
7908
7908
|
|
|
7909
|
-
// node_modules
|
|
7909
|
+
// node_modules/hono/dist/hono.js
|
|
7910
7910
|
var Hono2 = class extends Hono {
|
|
7911
7911
|
constructor(options = {}) {
|
|
7912
7912
|
super(options);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@hasna/shortlinks",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.7",
|
|
4
4
|
"description": "Shortlink manager for custom domains and click tracking, with local SQLite or self-hosted cloud (/v1 API + bearer key) storage and Cloudflare setup helpers",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "dist/index.js",
|