@sockethub/platform-feeds 4.0.0-alpha.18 → 4.0.0-alpha.20
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/index.js +102 -46
- package/dist/index.js.map +8 -7
- package/package.json +5 -5
package/dist/index.js
CHANGED
|
@@ -10356,7 +10356,7 @@ var require_core3 = __commonJS((exports) => {
|
|
|
10356
10356
|
};
|
|
10357
10357
|
}
|
|
10358
10358
|
|
|
10359
|
-
class
|
|
10359
|
+
class Ajv2 {
|
|
10360
10360
|
constructor(opts = {}) {
|
|
10361
10361
|
this.schemas = {};
|
|
10362
10362
|
this.refs = {};
|
|
@@ -10713,9 +10713,9 @@ var require_core3 = __commonJS((exports) => {
|
|
|
10713
10713
|
}
|
|
10714
10714
|
}
|
|
10715
10715
|
}
|
|
10716
|
-
exports.default =
|
|
10717
|
-
|
|
10718
|
-
|
|
10716
|
+
exports.default = Ajv2;
|
|
10717
|
+
Ajv2.ValidationError = validation_error_1.default;
|
|
10718
|
+
Ajv2.MissingRefError = ref_error_1.default;
|
|
10719
10719
|
function checkOptions(checkOpts, options, msg, log = "error") {
|
|
10720
10720
|
for (const key in checkOpts) {
|
|
10721
10721
|
const opt = key;
|
|
@@ -12676,7 +12676,7 @@ var require_ajv2 = __commonJS((exports, module) => {
|
|
|
12676
12676
|
var META_SUPPORT_DATA = ["/properties"];
|
|
12677
12677
|
var META_SCHEMA_ID = "http://json-schema.org/draft-07/schema";
|
|
12678
12678
|
|
|
12679
|
-
class
|
|
12679
|
+
class Ajv2 extends core_1.default {
|
|
12680
12680
|
_addVocabularies() {
|
|
12681
12681
|
super._addVocabularies();
|
|
12682
12682
|
draft7_1.default.forEach((v) => this.addVocabulary(v));
|
|
@@ -12695,9 +12695,9 @@ var require_ajv2 = __commonJS((exports, module) => {
|
|
|
12695
12695
|
return this.opts.defaultMeta = super.defaultMeta() || (this.getSchema(META_SCHEMA_ID) ? META_SCHEMA_ID : undefined);
|
|
12696
12696
|
}
|
|
12697
12697
|
}
|
|
12698
|
-
module.exports = exports =
|
|
12698
|
+
module.exports = exports = Ajv2;
|
|
12699
12699
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12700
|
-
exports.default =
|
|
12700
|
+
exports.default = Ajv2;
|
|
12701
12701
|
var validate_1 = require_validate2();
|
|
12702
12702
|
Object.defineProperty(exports, "KeywordCxt", { enumerable: true, get: function() {
|
|
12703
12703
|
return validate_1.KeywordCxt;
|
|
@@ -12793,9 +12793,9 @@ var require_limit = __commonJS((exports) => {
|
|
|
12793
12793
|
},
|
|
12794
12794
|
dependencies: ["format"]
|
|
12795
12795
|
};
|
|
12796
|
-
var formatLimitPlugin = (
|
|
12797
|
-
|
|
12798
|
-
return
|
|
12796
|
+
var formatLimitPlugin = (ajv2) => {
|
|
12797
|
+
ajv2.addKeyword(exports.formatLimitDefinition);
|
|
12798
|
+
return ajv2;
|
|
12799
12799
|
};
|
|
12800
12800
|
exports.default = formatLimitPlugin;
|
|
12801
12801
|
});
|
|
@@ -12808,17 +12808,17 @@ var require_dist = __commonJS((exports, module) => {
|
|
|
12808
12808
|
var codegen_1 = require_codegen2();
|
|
12809
12809
|
var fullName = new codegen_1.Name("fullFormats");
|
|
12810
12810
|
var fastName = new codegen_1.Name("fastFormats");
|
|
12811
|
-
var formatsPlugin = (
|
|
12811
|
+
var formatsPlugin = (ajv2, opts = { keywords: true }) => {
|
|
12812
12812
|
if (Array.isArray(opts)) {
|
|
12813
|
-
addFormats(
|
|
12814
|
-
return
|
|
12813
|
+
addFormats(ajv2, opts, formats_1.fullFormats, fullName);
|
|
12814
|
+
return ajv2;
|
|
12815
12815
|
}
|
|
12816
12816
|
const [formats, exportName] = opts.mode === "fast" ? [formats_1.fastFormats, fastName] : [formats_1.fullFormats, fullName];
|
|
12817
12817
|
const list = opts.formats || formats_1.formatNames;
|
|
12818
|
-
addFormats(
|
|
12818
|
+
addFormats(ajv2, list, formats, exportName);
|
|
12819
12819
|
if (opts.keywords)
|
|
12820
|
-
limit_1.default(
|
|
12821
|
-
return
|
|
12820
|
+
limit_1.default(ajv2);
|
|
12821
|
+
return ajv2;
|
|
12822
12822
|
};
|
|
12823
12823
|
formatsPlugin.get = (name, mode = "full") => {
|
|
12824
12824
|
const formats = mode === "fast" ? formats_1.fastFormats : formats_1.fullFormats;
|
|
@@ -12827,12 +12827,12 @@ var require_dist = __commonJS((exports, module) => {
|
|
|
12827
12827
|
throw new Error(`Unknown format "${name}"`);
|
|
12828
12828
|
return f;
|
|
12829
12829
|
};
|
|
12830
|
-
function addFormats(
|
|
12830
|
+
function addFormats(ajv2, list, fs, exportName) {
|
|
12831
12831
|
var _a;
|
|
12832
12832
|
var _b;
|
|
12833
|
-
(_a = (_b =
|
|
12833
|
+
(_a = (_b = ajv2.opts.code).formats) !== null && _a !== undefined || (_b.formats = codegen_1._`require("ajv-formats/dist/formats").${exportName}`);
|
|
12834
12834
|
for (const f of list)
|
|
12835
|
-
|
|
12835
|
+
ajv2.addFormat(f, fs[f]);
|
|
12836
12836
|
}
|
|
12837
12837
|
module.exports = exports = formatsPlugin;
|
|
12838
12838
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
@@ -15743,7 +15743,7 @@ var require_formats2 = __commonJS((exports, module) => {
|
|
|
15743
15743
|
// ../../node_modules/ajv-formats-draft2019/index.js
|
|
15744
15744
|
var require_ajv_formats_draft2019 = __commonJS((exports, module) => {
|
|
15745
15745
|
var formats = require_formats2();
|
|
15746
|
-
module.exports = (
|
|
15746
|
+
module.exports = (ajv2, options = {}) => {
|
|
15747
15747
|
const allFormats = Object.keys(formats);
|
|
15748
15748
|
let formatsToInstall = allFormats;
|
|
15749
15749
|
if (options.formats) {
|
|
@@ -15752,9 +15752,9 @@ var require_ajv_formats_draft2019 = __commonJS((exports, module) => {
|
|
|
15752
15752
|
formatsToInstall = options.formats;
|
|
15753
15753
|
}
|
|
15754
15754
|
allFormats.filter((format) => formatsToInstall.includes(format)).forEach((key) => {
|
|
15755
|
-
|
|
15755
|
+
ajv2.addFormat(key, formats[key]);
|
|
15756
15756
|
});
|
|
15757
|
-
return
|
|
15757
|
+
return ajv2;
|
|
15758
15758
|
};
|
|
15759
15759
|
});
|
|
15760
15760
|
|
|
@@ -38450,6 +38450,10 @@ function registerPlatformContext(platformId, platformContextUrl, schemaId, crede
|
|
|
38450
38450
|
platformContextToCredentialsSchemaId.set(platformContextUrl, credentialsSchemaId);
|
|
38451
38451
|
}
|
|
38452
38452
|
|
|
38453
|
+
// ../schemas/src/examples-config.ts
|
|
38454
|
+
var import_ajv = __toESM(require_ajv(), 1);
|
|
38455
|
+
var ajv = new import_ajv.default({ strictTypes: false, allErrors: true });
|
|
38456
|
+
|
|
38453
38457
|
// ../schemas/src/helpers/objects.ts
|
|
38454
38458
|
var ObjectTypesSchema = {
|
|
38455
38459
|
feed: {
|
|
@@ -38583,6 +38587,19 @@ var ObjectTypesSchema = {
|
|
|
38583
38587
|
}
|
|
38584
38588
|
}
|
|
38585
38589
|
}
|
|
38590
|
+
},
|
|
38591
|
+
addressBook: {
|
|
38592
|
+
required: ["id", "type"],
|
|
38593
|
+
additionalProperties: false,
|
|
38594
|
+
properties: {
|
|
38595
|
+
id: {
|
|
38596
|
+
type: "string",
|
|
38597
|
+
format: "iri"
|
|
38598
|
+
},
|
|
38599
|
+
type: {
|
|
38600
|
+
enum: ["addressBook"]
|
|
38601
|
+
}
|
|
38602
|
+
}
|
|
38586
38603
|
}
|
|
38587
38604
|
};
|
|
38588
38605
|
var ObjectTypesList = Object.keys(ObjectTypesSchema);
|
|
@@ -38602,7 +38619,8 @@ var TargetTypesList = [
|
|
|
38602
38619
|
"website",
|
|
38603
38620
|
"platform",
|
|
38604
38621
|
"address",
|
|
38605
|
-
"calendar"
|
|
38622
|
+
"calendar",
|
|
38623
|
+
"addressBook"
|
|
38606
38624
|
];
|
|
38607
38625
|
var validActorRefs = ActorTypesList.map((type) => ({
|
|
38608
38626
|
$ref: `#/definitions/type/${type}`
|
|
@@ -38671,7 +38689,7 @@ var ActivityStreamSchema = {
|
|
|
38671
38689
|
var package_default = {
|
|
38672
38690
|
name: "@sockethub/schemas",
|
|
38673
38691
|
description: "JSON schema files for validating Sockethub Activity Streams",
|
|
38674
|
-
version: "3.0.0-alpha.
|
|
38692
|
+
version: "3.0.0-alpha.20",
|
|
38675
38693
|
type: "module",
|
|
38676
38694
|
private: false,
|
|
38677
38695
|
author: "Nick Jennings <nick@silverbucket.net>",
|
|
@@ -38696,8 +38714,17 @@ var package_default = {
|
|
|
38696
38714
|
import: "./dist/object-types.js",
|
|
38697
38715
|
default: "./dist/object-types.js"
|
|
38698
38716
|
},
|
|
38717
|
+
"./examples-config": {
|
|
38718
|
+
types: "./dist/examples-config.d.ts",
|
|
38719
|
+
bun: "./src/examples-config.ts",
|
|
38720
|
+
import: "./dist/examples-config.js",
|
|
38721
|
+
default: "./dist/examples-config.js"
|
|
38722
|
+
},
|
|
38699
38723
|
"./schemas/json/sockethub-config.json": {
|
|
38700
38724
|
default: "./dist/schemas/json/sockethub-config.json"
|
|
38725
|
+
},
|
|
38726
|
+
"./schemas/json/examples-config.json": {
|
|
38727
|
+
default: "./dist/schemas/json/examples-config.json"
|
|
38701
38728
|
}
|
|
38702
38729
|
},
|
|
38703
38730
|
files: [
|
|
@@ -38723,7 +38750,7 @@ var package_default = {
|
|
|
38723
38750
|
"@types/bun": "latest"
|
|
38724
38751
|
},
|
|
38725
38752
|
scripts: {
|
|
38726
|
-
build: "bun ./scripts/export-json-schema.ts && bun ./scripts/export-canonical-assets.ts && bun build src/index.ts src/object-types.ts --outdir dist --target node --format esm --sourcemap=external && bun build src/context.ts src/activity-stream-helper.ts --outdir dist --target browser --format esm --sourcemap=external",
|
|
38753
|
+
build: "bun ./scripts/export-json-schema.ts && bun ./scripts/export-canonical-assets.ts && bun build src/index.ts src/object-types.ts --outdir dist --target node --format esm --sourcemap=external && bun build src/context.ts src/activity-stream-helper.ts src/examples-config.ts --outdir dist --target browser --format esm --sourcemap=external",
|
|
38727
38754
|
clean: "rm -rf dist",
|
|
38728
38755
|
"clean:deps": "rm -rf node_modules"
|
|
38729
38756
|
},
|
|
@@ -38732,7 +38759,7 @@ var package_default = {
|
|
|
38732
38759
|
"ajv-formats": "^2.1.1",
|
|
38733
38760
|
"ajv-formats-draft2019": "^1.6.1"
|
|
38734
38761
|
},
|
|
38735
|
-
gitHead: "
|
|
38762
|
+
gitHead: "194422de2ffe1a95ffff45063bc988da8594756a",
|
|
38736
38763
|
types: "./dist/index.d.ts"
|
|
38737
38764
|
};
|
|
38738
38765
|
|
|
@@ -38789,6 +38816,7 @@ var SockethubConfigSchema = {
|
|
|
38789
38816
|
},
|
|
38790
38817
|
description: "Platform packages to load",
|
|
38791
38818
|
default: [
|
|
38819
|
+
"@sockethub/platform-carddav",
|
|
38792
38820
|
"@sockethub/platform-caldav",
|
|
38793
38821
|
"@sockethub/platform-dummy",
|
|
38794
38822
|
"@sockethub/platform-feeds",
|
|
@@ -38802,6 +38830,16 @@ var SockethubConfigSchema = {
|
|
|
38802
38830
|
default: {},
|
|
38803
38831
|
description: "Per-platform config keyed by package name, validated against " + "each platform's config schema and forwarded to its child process",
|
|
38804
38832
|
properties: {
|
|
38833
|
+
"@sockethub/platform-carddav": {
|
|
38834
|
+
type: "object",
|
|
38835
|
+
additionalProperties: false,
|
|
38836
|
+
properties: {
|
|
38837
|
+
connectTimeoutMs: { type: "integer", minimum: 1 },
|
|
38838
|
+
allowPrivateAddresses: { type: "boolean" },
|
|
38839
|
+
allowInsecureHttp: { type: "boolean" },
|
|
38840
|
+
concurrency: { type: "integer", minimum: 1 }
|
|
38841
|
+
}
|
|
38842
|
+
},
|
|
38805
38843
|
"@sockethub/platform-caldav": {
|
|
38806
38844
|
type: "object",
|
|
38807
38845
|
additionalProperties: false,
|
|
@@ -38920,7 +38958,7 @@ var SockethubConfigSchema = {
|
|
|
38920
38958
|
maxConnectionsPerIp: {
|
|
38921
38959
|
type: "number",
|
|
38922
38960
|
minimum: 0,
|
|
38923
|
-
default:
|
|
38961
|
+
default: 20,
|
|
38924
38962
|
description: "Maximum concurrent socket connections per client IP. " + "The per-event rate limiter is keyed by socket id, so " + "without a connection cap a client can bypass it by " + "opening more sockets. 0 disables the cap."
|
|
38925
38963
|
}
|
|
38926
38964
|
}
|
|
@@ -38932,7 +38970,7 @@ var SockethubConfigSchema = {
|
|
|
38932
38970
|
maxPlatformInstances: {
|
|
38933
38971
|
type: "number",
|
|
38934
38972
|
minimum: 0,
|
|
38935
|
-
default:
|
|
38973
|
+
default: 100,
|
|
38936
38974
|
description: "Upper bound on concurrently running platform instances " + "(child processes). Each persistent-platform actor forks " + "its own process, so an unbounded count is a resource " + "exhaustion risk on public instances. 0 disables the cap."
|
|
38937
38975
|
}
|
|
38938
38976
|
}
|
|
@@ -38992,6 +39030,12 @@ var SockethubConfigSchema = {
|
|
|
38992
39030
|
type: "string",
|
|
38993
39031
|
default: "/sockethub"
|
|
38994
39032
|
},
|
|
39033
|
+
maxPayloadBytes: {
|
|
39034
|
+
type: "integer",
|
|
39035
|
+
minimum: 1,
|
|
39036
|
+
default: 262144,
|
|
39037
|
+
description: "Maximum size in bytes of a single Socket.IO message."
|
|
39038
|
+
},
|
|
38995
39039
|
cors: {
|
|
38996
39040
|
type: "object",
|
|
38997
39041
|
additionalProperties: false,
|
|
@@ -39068,28 +39112,28 @@ var SockethubConfigSchema = {
|
|
|
39068
39112
|
var SockethubConfigSchemaId = versionedSchemaId(SockethubConfigSchema.$id, package_default.version);
|
|
39069
39113
|
|
|
39070
39114
|
// ../schemas/src/validator.ts
|
|
39071
|
-
var
|
|
39115
|
+
var import_ajv2 = __toESM(require_ajv(), 1);
|
|
39072
39116
|
var import_ajv_formats = __toESM(require_dist(), 1);
|
|
39073
39117
|
var import_ajv_formats_draft2019 = __toESM(require_ajv_formats_draft2019(), 1);
|
|
39074
|
-
var
|
|
39075
|
-
import_ajv_formats.default(
|
|
39076
|
-
import_ajv_formats_draft2019.default(
|
|
39118
|
+
var ajv2 = new import_ajv2.default({ strictTypes: false, allErrors: true });
|
|
39119
|
+
import_ajv_formats.default(ajv2);
|
|
39120
|
+
import_ajv_formats_draft2019.default(ajv2);
|
|
39077
39121
|
var schemaURL = "https://sockethub.org/schemas/v0";
|
|
39078
39122
|
var schemas = {};
|
|
39079
39123
|
var systemContextsRegistered = false;
|
|
39080
39124
|
schemas[`${schemaURL}/activity-stream`] = ActivityStreamSchema;
|
|
39081
39125
|
for (const uri in schemas) {
|
|
39082
|
-
|
|
39126
|
+
ajv2.addSchema(schemas[uri], uri);
|
|
39083
39127
|
}
|
|
39084
39128
|
function registerSystemContext(platformId, contextUrl) {
|
|
39085
39129
|
registerPlatformContext(platformId, contextUrl, `${schemaURL}/context/${platformId}/messages`, `${schemaURL}/context/${platformId}/credentials`);
|
|
39086
39130
|
const messageSchemaRef = `${schemaURL}/context/${platformId}/messages`;
|
|
39087
|
-
if (!
|
|
39088
|
-
|
|
39131
|
+
if (!ajv2.getSchema(messageSchemaRef)) {
|
|
39132
|
+
ajv2.addSchema({}, messageSchemaRef);
|
|
39089
39133
|
}
|
|
39090
39134
|
const credentialsSchemaRef = `${schemaURL}/context/${platformId}/credentials`;
|
|
39091
|
-
if (!
|
|
39092
|
-
|
|
39135
|
+
if (!ajv2.getSchema(credentialsSchemaRef)) {
|
|
39136
|
+
ajv2.addSchema({}, credentialsSchemaRef);
|
|
39093
39137
|
}
|
|
39094
39138
|
}
|
|
39095
39139
|
function registerSystemPlatformContexts() {
|
|
@@ -39111,6 +39155,7 @@ function errorMessage(value) {
|
|
|
39111
39155
|
|
|
39112
39156
|
// ../util/dist/net/index.js
|
|
39113
39157
|
import { lookup as dnsLookup } from "node:dns";
|
|
39158
|
+
import { isIP } from "node:net";
|
|
39114
39159
|
|
|
39115
39160
|
// ../../node_modules/undici/index.js
|
|
39116
39161
|
var Client = require_client();
|
|
@@ -39155,6 +39200,7 @@ var $cacheStores = {
|
|
|
39155
39200
|
};
|
|
39156
39201
|
var SqliteCacheStore = require_sqlite_cache_store();
|
|
39157
39202
|
$cacheStores.SqliteCacheStore = SqliteCacheStore;
|
|
39203
|
+
var $buildConnector = buildConnector;
|
|
39158
39204
|
var $util = {
|
|
39159
39205
|
parseHeaders: util.parseHeaders,
|
|
39160
39206
|
headerNameToString: util.headerNameToString
|
|
@@ -39339,6 +39385,18 @@ function createGuardedLookup(allowPrivateAddresses) {
|
|
|
39339
39385
|
});
|
|
39340
39386
|
};
|
|
39341
39387
|
}
|
|
39388
|
+
function createGuardedConnector(allowPrivateAddresses, connector = $buildConnector({
|
|
39389
|
+
lookup: createGuardedLookup(allowPrivateAddresses)
|
|
39390
|
+
})) {
|
|
39391
|
+
return (options, callback) => {
|
|
39392
|
+
const hostname = options.hostname.replace(/^\[|\]$/g, "");
|
|
39393
|
+
if (!allowPrivateAddresses && isIP(hostname) !== 0 && isBlockedAddress(hostname)) {
|
|
39394
|
+
callback(new Error(`blocked non-public address ${hostname}`), null);
|
|
39395
|
+
return;
|
|
39396
|
+
}
|
|
39397
|
+
connector(options, callback);
|
|
39398
|
+
};
|
|
39399
|
+
}
|
|
39342
39400
|
function createGuardedDispatcher(options = {}) {
|
|
39343
39401
|
const {
|
|
39344
39402
|
allowPrivateAddresses = false,
|
|
@@ -39346,9 +39404,7 @@ function createGuardedDispatcher(options = {}) {
|
|
|
39346
39404
|
} = options;
|
|
39347
39405
|
return new $Agent({
|
|
39348
39406
|
maxResponseSize: maxResponseBytes,
|
|
39349
|
-
connect:
|
|
39350
|
-
lookup: createGuardedLookup(allowPrivateAddresses)
|
|
39351
|
-
}
|
|
39407
|
+
connect: createGuardedConnector(allowPrivateAddresses)
|
|
39352
39408
|
});
|
|
39353
39409
|
}
|
|
39354
39410
|
function redactUrl(url) {
|
|
@@ -39526,7 +39582,7 @@ var import_podparse = __toESM(require_podparse(), 1);
|
|
|
39526
39582
|
var package_default2 = {
|
|
39527
39583
|
name: "@sockethub/platform-feeds",
|
|
39528
39584
|
description: "A sockethub platform module implementing RSS/Atom functionality",
|
|
39529
|
-
version: "4.0.0-alpha.
|
|
39585
|
+
version: "4.0.0-alpha.20",
|
|
39530
39586
|
type: "module",
|
|
39531
39587
|
private: false,
|
|
39532
39588
|
author: "Nick Jennings <nick@silverbucket.net>",
|
|
@@ -39571,24 +39627,24 @@ var package_default2 = {
|
|
|
39571
39627
|
"clean:deps": "rm -rf node_modules"
|
|
39572
39628
|
},
|
|
39573
39629
|
dependencies: {
|
|
39574
|
-
"@sockethub/util": "^1.0.0-alpha.
|
|
39630
|
+
"@sockethub/util": "^1.0.0-alpha.8",
|
|
39575
39631
|
"html-tags": "^3.3.1",
|
|
39576
39632
|
htmlparser2: "^9.1.0",
|
|
39577
39633
|
podparse: "^1.6.0"
|
|
39578
39634
|
},
|
|
39579
39635
|
devDependencies: {
|
|
39580
|
-
"@sockethub/schemas": "^3.0.0-alpha.
|
|
39636
|
+
"@sockethub/schemas": "^3.0.0-alpha.20",
|
|
39581
39637
|
"@types/bun": "latest"
|
|
39582
39638
|
},
|
|
39583
39639
|
peerDependencies: {
|
|
39584
|
-
"@sockethub/server": "5.0.0-alpha.
|
|
39640
|
+
"@sockethub/server": "5.0.0-alpha.20"
|
|
39585
39641
|
},
|
|
39586
39642
|
peerDependenciesMeta: {
|
|
39587
39643
|
"@sockethub/server": {
|
|
39588
39644
|
optional: true
|
|
39589
39645
|
}
|
|
39590
39646
|
},
|
|
39591
|
-
gitHead: "
|
|
39647
|
+
gitHead: "194422de2ffe1a95ffff45063bc988da8594756a",
|
|
39592
39648
|
types: "./dist/index.d.ts"
|
|
39593
39649
|
};
|
|
39594
39650
|
|
|
@@ -39853,4 +39909,4 @@ export {
|
|
|
39853
39909
|
applyFetchFilters
|
|
39854
39910
|
};
|
|
39855
39911
|
|
|
39856
|
-
//# debugId=
|
|
39912
|
+
//# debugId=1E32DC71E51F8BD264756E2164756E21
|