@sockethub/platform-xmpp 5.0.0-alpha.18 → 5.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 +87 -43
- package/dist/index.js.map +7 -6
- package/package.json +5 -5
package/dist/index.js
CHANGED
|
@@ -10388,7 +10388,7 @@ var require_core3 = __commonJS((exports) => {
|
|
|
10388
10388
|
};
|
|
10389
10389
|
}
|
|
10390
10390
|
|
|
10391
|
-
class
|
|
10391
|
+
class Ajv2 {
|
|
10392
10392
|
constructor(opts = {}) {
|
|
10393
10393
|
this.schemas = {};
|
|
10394
10394
|
this.refs = {};
|
|
@@ -10745,9 +10745,9 @@ var require_core3 = __commonJS((exports) => {
|
|
|
10745
10745
|
}
|
|
10746
10746
|
}
|
|
10747
10747
|
}
|
|
10748
|
-
exports.default =
|
|
10749
|
-
|
|
10750
|
-
|
|
10748
|
+
exports.default = Ajv2;
|
|
10749
|
+
Ajv2.ValidationError = validation_error_1.default;
|
|
10750
|
+
Ajv2.MissingRefError = ref_error_1.default;
|
|
10751
10751
|
function checkOptions(checkOpts, options, msg, log = "error") {
|
|
10752
10752
|
for (const key in checkOpts) {
|
|
10753
10753
|
const opt = key;
|
|
@@ -12708,7 +12708,7 @@ var require_ajv2 = __commonJS((exports, module) => {
|
|
|
12708
12708
|
var META_SUPPORT_DATA = ["/properties"];
|
|
12709
12709
|
var META_SCHEMA_ID = "http://json-schema.org/draft-07/schema";
|
|
12710
12710
|
|
|
12711
|
-
class
|
|
12711
|
+
class Ajv2 extends core_1.default {
|
|
12712
12712
|
_addVocabularies() {
|
|
12713
12713
|
super._addVocabularies();
|
|
12714
12714
|
draft7_1.default.forEach((v) => this.addVocabulary(v));
|
|
@@ -12727,9 +12727,9 @@ var require_ajv2 = __commonJS((exports, module) => {
|
|
|
12727
12727
|
return this.opts.defaultMeta = super.defaultMeta() || (this.getSchema(META_SCHEMA_ID) ? META_SCHEMA_ID : undefined);
|
|
12728
12728
|
}
|
|
12729
12729
|
}
|
|
12730
|
-
module.exports = exports =
|
|
12730
|
+
module.exports = exports = Ajv2;
|
|
12731
12731
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12732
|
-
exports.default =
|
|
12732
|
+
exports.default = Ajv2;
|
|
12733
12733
|
var validate_1 = require_validate2();
|
|
12734
12734
|
Object.defineProperty(exports, "KeywordCxt", { enumerable: true, get: function() {
|
|
12735
12735
|
return validate_1.KeywordCxt;
|
|
@@ -12825,9 +12825,9 @@ var require_limit = __commonJS((exports) => {
|
|
|
12825
12825
|
},
|
|
12826
12826
|
dependencies: ["format"]
|
|
12827
12827
|
};
|
|
12828
|
-
var formatLimitPlugin = (
|
|
12829
|
-
|
|
12830
|
-
return
|
|
12828
|
+
var formatLimitPlugin = (ajv2) => {
|
|
12829
|
+
ajv2.addKeyword(exports.formatLimitDefinition);
|
|
12830
|
+
return ajv2;
|
|
12831
12831
|
};
|
|
12832
12832
|
exports.default = formatLimitPlugin;
|
|
12833
12833
|
});
|
|
@@ -12840,17 +12840,17 @@ var require_dist = __commonJS((exports, module) => {
|
|
|
12840
12840
|
var codegen_1 = require_codegen2();
|
|
12841
12841
|
var fullName = new codegen_1.Name("fullFormats");
|
|
12842
12842
|
var fastName = new codegen_1.Name("fastFormats");
|
|
12843
|
-
var formatsPlugin = (
|
|
12843
|
+
var formatsPlugin = (ajv2, opts = { keywords: true }) => {
|
|
12844
12844
|
if (Array.isArray(opts)) {
|
|
12845
|
-
addFormats(
|
|
12846
|
-
return
|
|
12845
|
+
addFormats(ajv2, opts, formats_1.fullFormats, fullName);
|
|
12846
|
+
return ajv2;
|
|
12847
12847
|
}
|
|
12848
12848
|
const [formats, exportName] = opts.mode === "fast" ? [formats_1.fastFormats, fastName] : [formats_1.fullFormats, fullName];
|
|
12849
12849
|
const list = opts.formats || formats_1.formatNames;
|
|
12850
|
-
addFormats(
|
|
12850
|
+
addFormats(ajv2, list, formats, exportName);
|
|
12851
12851
|
if (opts.keywords)
|
|
12852
|
-
limit_1.default(
|
|
12853
|
-
return
|
|
12852
|
+
limit_1.default(ajv2);
|
|
12853
|
+
return ajv2;
|
|
12854
12854
|
};
|
|
12855
12855
|
formatsPlugin.get = (name, mode = "full") => {
|
|
12856
12856
|
const formats = mode === "fast" ? formats_1.fastFormats : formats_1.fullFormats;
|
|
@@ -12859,12 +12859,12 @@ var require_dist = __commonJS((exports, module) => {
|
|
|
12859
12859
|
throw new Error(`Unknown format "${name}"`);
|
|
12860
12860
|
return f;
|
|
12861
12861
|
};
|
|
12862
|
-
function addFormats(
|
|
12862
|
+
function addFormats(ajv2, list, fs, exportName) {
|
|
12863
12863
|
var _a;
|
|
12864
12864
|
var _b;
|
|
12865
|
-
(_a = (_b =
|
|
12865
|
+
(_a = (_b = ajv2.opts.code).formats) !== null && _a !== undefined || (_b.formats = codegen_1._`require("ajv-formats/dist/formats").${exportName}`);
|
|
12866
12866
|
for (const f of list)
|
|
12867
|
-
|
|
12867
|
+
ajv2.addFormat(f, fs[f]);
|
|
12868
12868
|
}
|
|
12869
12869
|
module.exports = exports = formatsPlugin;
|
|
12870
12870
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
@@ -15775,7 +15775,7 @@ var require_formats2 = __commonJS((exports, module) => {
|
|
|
15775
15775
|
// ../../node_modules/ajv-formats-draft2019/index.js
|
|
15776
15776
|
var require_ajv_formats_draft2019 = __commonJS((exports, module) => {
|
|
15777
15777
|
var formats = require_formats2();
|
|
15778
|
-
module.exports = (
|
|
15778
|
+
module.exports = (ajv2, options = {}) => {
|
|
15779
15779
|
const allFormats = Object.keys(formats);
|
|
15780
15780
|
let formatsToInstall = allFormats;
|
|
15781
15781
|
if (options.formats) {
|
|
@@ -15784,9 +15784,9 @@ var require_ajv_formats_draft2019 = __commonJS((exports, module) => {
|
|
|
15784
15784
|
formatsToInstall = options.formats;
|
|
15785
15785
|
}
|
|
15786
15786
|
allFormats.filter((format) => formatsToInstall.includes(format)).forEach((key) => {
|
|
15787
|
-
|
|
15787
|
+
ajv2.addFormat(key, formats[key]);
|
|
15788
15788
|
});
|
|
15789
|
-
return
|
|
15789
|
+
return ajv2;
|
|
15790
15790
|
};
|
|
15791
15791
|
});
|
|
15792
15792
|
|
|
@@ -28051,6 +28051,10 @@ function registerPlatformContext(platformId, platformContextUrl, schemaId, crede
|
|
|
28051
28051
|
platformContextToCredentialsSchemaId.set(platformContextUrl, credentialsSchemaId);
|
|
28052
28052
|
}
|
|
28053
28053
|
|
|
28054
|
+
// ../schemas/src/examples-config.ts
|
|
28055
|
+
var import_ajv = __toESM(require_ajv(), 1);
|
|
28056
|
+
var ajv = new import_ajv.default({ strictTypes: false, allErrors: true });
|
|
28057
|
+
|
|
28054
28058
|
// ../schemas/src/helpers/objects.ts
|
|
28055
28059
|
var ObjectTypesSchema = {
|
|
28056
28060
|
feed: {
|
|
@@ -28184,6 +28188,19 @@ var ObjectTypesSchema = {
|
|
|
28184
28188
|
}
|
|
28185
28189
|
}
|
|
28186
28190
|
}
|
|
28191
|
+
},
|
|
28192
|
+
addressBook: {
|
|
28193
|
+
required: ["id", "type"],
|
|
28194
|
+
additionalProperties: false,
|
|
28195
|
+
properties: {
|
|
28196
|
+
id: {
|
|
28197
|
+
type: "string",
|
|
28198
|
+
format: "iri"
|
|
28199
|
+
},
|
|
28200
|
+
type: {
|
|
28201
|
+
enum: ["addressBook"]
|
|
28202
|
+
}
|
|
28203
|
+
}
|
|
28187
28204
|
}
|
|
28188
28205
|
};
|
|
28189
28206
|
var ObjectTypesList = Object.keys(ObjectTypesSchema);
|
|
@@ -28203,7 +28220,8 @@ var TargetTypesList = [
|
|
|
28203
28220
|
"website",
|
|
28204
28221
|
"platform",
|
|
28205
28222
|
"address",
|
|
28206
|
-
"calendar"
|
|
28223
|
+
"calendar",
|
|
28224
|
+
"addressBook"
|
|
28207
28225
|
];
|
|
28208
28226
|
var validActorRefs = ActorTypesList.map((type) => ({
|
|
28209
28227
|
$ref: `#/definitions/type/${type}`
|
|
@@ -28272,7 +28290,7 @@ var ActivityStreamSchema = {
|
|
|
28272
28290
|
var package_default = {
|
|
28273
28291
|
name: "@sockethub/schemas",
|
|
28274
28292
|
description: "JSON schema files for validating Sockethub Activity Streams",
|
|
28275
|
-
version: "3.0.0-alpha.
|
|
28293
|
+
version: "3.0.0-alpha.20",
|
|
28276
28294
|
type: "module",
|
|
28277
28295
|
private: false,
|
|
28278
28296
|
author: "Nick Jennings <nick@silverbucket.net>",
|
|
@@ -28297,8 +28315,17 @@ var package_default = {
|
|
|
28297
28315
|
import: "./dist/object-types.js",
|
|
28298
28316
|
default: "./dist/object-types.js"
|
|
28299
28317
|
},
|
|
28318
|
+
"./examples-config": {
|
|
28319
|
+
types: "./dist/examples-config.d.ts",
|
|
28320
|
+
bun: "./src/examples-config.ts",
|
|
28321
|
+
import: "./dist/examples-config.js",
|
|
28322
|
+
default: "./dist/examples-config.js"
|
|
28323
|
+
},
|
|
28300
28324
|
"./schemas/json/sockethub-config.json": {
|
|
28301
28325
|
default: "./dist/schemas/json/sockethub-config.json"
|
|
28326
|
+
},
|
|
28327
|
+
"./schemas/json/examples-config.json": {
|
|
28328
|
+
default: "./dist/schemas/json/examples-config.json"
|
|
28302
28329
|
}
|
|
28303
28330
|
},
|
|
28304
28331
|
files: [
|
|
@@ -28324,7 +28351,7 @@ var package_default = {
|
|
|
28324
28351
|
"@types/bun": "latest"
|
|
28325
28352
|
},
|
|
28326
28353
|
scripts: {
|
|
28327
|
-
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",
|
|
28354
|
+
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",
|
|
28328
28355
|
clean: "rm -rf dist",
|
|
28329
28356
|
"clean:deps": "rm -rf node_modules"
|
|
28330
28357
|
},
|
|
@@ -28333,7 +28360,7 @@ var package_default = {
|
|
|
28333
28360
|
"ajv-formats": "^2.1.1",
|
|
28334
28361
|
"ajv-formats-draft2019": "^1.6.1"
|
|
28335
28362
|
},
|
|
28336
|
-
gitHead: "
|
|
28363
|
+
gitHead: "194422de2ffe1a95ffff45063bc988da8594756a",
|
|
28337
28364
|
types: "./dist/index.d.ts"
|
|
28338
28365
|
};
|
|
28339
28366
|
|
|
@@ -28390,6 +28417,7 @@ var SockethubConfigSchema = {
|
|
|
28390
28417
|
},
|
|
28391
28418
|
description: "Platform packages to load",
|
|
28392
28419
|
default: [
|
|
28420
|
+
"@sockethub/platform-carddav",
|
|
28393
28421
|
"@sockethub/platform-caldav",
|
|
28394
28422
|
"@sockethub/platform-dummy",
|
|
28395
28423
|
"@sockethub/platform-feeds",
|
|
@@ -28403,6 +28431,16 @@ var SockethubConfigSchema = {
|
|
|
28403
28431
|
default: {},
|
|
28404
28432
|
description: "Per-platform config keyed by package name, validated against " + "each platform's config schema and forwarded to its child process",
|
|
28405
28433
|
properties: {
|
|
28434
|
+
"@sockethub/platform-carddav": {
|
|
28435
|
+
type: "object",
|
|
28436
|
+
additionalProperties: false,
|
|
28437
|
+
properties: {
|
|
28438
|
+
connectTimeoutMs: { type: "integer", minimum: 1 },
|
|
28439
|
+
allowPrivateAddresses: { type: "boolean" },
|
|
28440
|
+
allowInsecureHttp: { type: "boolean" },
|
|
28441
|
+
concurrency: { type: "integer", minimum: 1 }
|
|
28442
|
+
}
|
|
28443
|
+
},
|
|
28406
28444
|
"@sockethub/platform-caldav": {
|
|
28407
28445
|
type: "object",
|
|
28408
28446
|
additionalProperties: false,
|
|
@@ -28521,7 +28559,7 @@ var SockethubConfigSchema = {
|
|
|
28521
28559
|
maxConnectionsPerIp: {
|
|
28522
28560
|
type: "number",
|
|
28523
28561
|
minimum: 0,
|
|
28524
|
-
default:
|
|
28562
|
+
default: 20,
|
|
28525
28563
|
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."
|
|
28526
28564
|
}
|
|
28527
28565
|
}
|
|
@@ -28533,7 +28571,7 @@ var SockethubConfigSchema = {
|
|
|
28533
28571
|
maxPlatformInstances: {
|
|
28534
28572
|
type: "number",
|
|
28535
28573
|
minimum: 0,
|
|
28536
|
-
default:
|
|
28574
|
+
default: 100,
|
|
28537
28575
|
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."
|
|
28538
28576
|
}
|
|
28539
28577
|
}
|
|
@@ -28593,6 +28631,12 @@ var SockethubConfigSchema = {
|
|
|
28593
28631
|
type: "string",
|
|
28594
28632
|
default: "/sockethub"
|
|
28595
28633
|
},
|
|
28634
|
+
maxPayloadBytes: {
|
|
28635
|
+
type: "integer",
|
|
28636
|
+
minimum: 1,
|
|
28637
|
+
default: 262144,
|
|
28638
|
+
description: "Maximum size in bytes of a single Socket.IO message."
|
|
28639
|
+
},
|
|
28596
28640
|
cors: {
|
|
28597
28641
|
type: "object",
|
|
28598
28642
|
additionalProperties: false,
|
|
@@ -28669,28 +28713,28 @@ var SockethubConfigSchema = {
|
|
|
28669
28713
|
var SockethubConfigSchemaId = versionedSchemaId(SockethubConfigSchema.$id, package_default.version);
|
|
28670
28714
|
|
|
28671
28715
|
// ../schemas/src/validator.ts
|
|
28672
|
-
var
|
|
28716
|
+
var import_ajv2 = __toESM(require_ajv(), 1);
|
|
28673
28717
|
var import_ajv_formats = __toESM(require_dist(), 1);
|
|
28674
28718
|
var import_ajv_formats_draft2019 = __toESM(require_ajv_formats_draft2019(), 1);
|
|
28675
|
-
var
|
|
28676
|
-
import_ajv_formats.default(
|
|
28677
|
-
import_ajv_formats_draft2019.default(
|
|
28719
|
+
var ajv2 = new import_ajv2.default({ strictTypes: false, allErrors: true });
|
|
28720
|
+
import_ajv_formats.default(ajv2);
|
|
28721
|
+
import_ajv_formats_draft2019.default(ajv2);
|
|
28678
28722
|
var schemaURL = "https://sockethub.org/schemas/v0";
|
|
28679
28723
|
var schemas = {};
|
|
28680
28724
|
var systemContextsRegistered = false;
|
|
28681
28725
|
schemas[`${schemaURL}/activity-stream`] = ActivityStreamSchema;
|
|
28682
28726
|
for (const uri in schemas) {
|
|
28683
|
-
|
|
28727
|
+
ajv2.addSchema(schemas[uri], uri);
|
|
28684
28728
|
}
|
|
28685
28729
|
function registerSystemContext(platformId, contextUrl) {
|
|
28686
28730
|
registerPlatformContext(platformId, contextUrl, `${schemaURL}/context/${platformId}/messages`, `${schemaURL}/context/${platformId}/credentials`);
|
|
28687
28731
|
const messageSchemaRef = `${schemaURL}/context/${platformId}/messages`;
|
|
28688
|
-
if (!
|
|
28689
|
-
|
|
28732
|
+
if (!ajv2.getSchema(messageSchemaRef)) {
|
|
28733
|
+
ajv2.addSchema({}, messageSchemaRef);
|
|
28690
28734
|
}
|
|
28691
28735
|
const credentialsSchemaRef = `${schemaURL}/context/${platformId}/credentials`;
|
|
28692
|
-
if (!
|
|
28693
|
-
|
|
28736
|
+
if (!ajv2.getSchema(credentialsSchemaRef)) {
|
|
28737
|
+
ajv2.addSchema({}, credentialsSchemaRef);
|
|
28694
28738
|
}
|
|
28695
28739
|
}
|
|
28696
28740
|
function registerSystemPlatformContexts() {
|
|
@@ -28794,7 +28838,7 @@ var $client = client;
|
|
|
28794
28838
|
var package_default2 = {
|
|
28795
28839
|
name: "@sockethub/platform-xmpp",
|
|
28796
28840
|
description: "A sockethub platform module implementing XMPP functionality",
|
|
28797
|
-
version: "5.0.0-alpha.
|
|
28841
|
+
version: "5.0.0-alpha.20",
|
|
28798
28842
|
private: false,
|
|
28799
28843
|
type: "module",
|
|
28800
28844
|
author: "Nick Jennings <nick@silverbucket.net>",
|
|
@@ -28838,11 +28882,11 @@ var package_default2 = {
|
|
|
28838
28882
|
doc: "typedoc --options typedoc.json"
|
|
28839
28883
|
},
|
|
28840
28884
|
dependencies: {
|
|
28841
|
-
"@sockethub/util": "^1.0.0-alpha.
|
|
28885
|
+
"@sockethub/util": "^1.0.0-alpha.8",
|
|
28842
28886
|
"@xmpp/client": "^0.13.6"
|
|
28843
28887
|
},
|
|
28844
28888
|
devDependencies: {
|
|
28845
|
-
"@sockethub/schemas": "^3.0.0-alpha.
|
|
28889
|
+
"@sockethub/schemas": "^3.0.0-alpha.20",
|
|
28846
28890
|
"@types/bun": "latest",
|
|
28847
28891
|
"@xmpp/xml": "^0.13.2",
|
|
28848
28892
|
ajv: "^8.17.1",
|
|
@@ -28850,14 +28894,14 @@ var package_default2 = {
|
|
|
28850
28894
|
typedoc: "^0.28.14"
|
|
28851
28895
|
},
|
|
28852
28896
|
peerDependencies: {
|
|
28853
|
-
"@sockethub/server": "^5.0.0-alpha.
|
|
28897
|
+
"@sockethub/server": "^5.0.0-alpha.20"
|
|
28854
28898
|
},
|
|
28855
28899
|
peerDependenciesMeta: {
|
|
28856
28900
|
"@sockethub/server": {
|
|
28857
28901
|
optional: true
|
|
28858
28902
|
}
|
|
28859
28903
|
},
|
|
28860
|
-
gitHead: "
|
|
28904
|
+
gitHead: "194422de2ffe1a95ffff45063bc988da8594756a",
|
|
28861
28905
|
types: "./dist/index.d.ts"
|
|
28862
28906
|
};
|
|
28863
28907
|
|
|
@@ -29955,4 +29999,4 @@ export {
|
|
|
29955
29999
|
XMPP as default
|
|
29956
30000
|
};
|
|
29957
30001
|
|
|
29958
|
-
//# debugId=
|
|
30002
|
+
//# debugId=D5BA6C56AB68312164756E2164756E21
|