@unwanted/matrix-sdk-mini 34.12.0-6 → 34.12.0-7

Sign up to get free protection for your applications and to get access to all the features.
@@ -81,9 +81,9 @@ export function getHttpUriForMxc(baseUrl, mxc, width, height, resizeMethod) {
81
81
  var isThumbnailRequest = !!width || !!height || !!resizeMethod;
82
82
  var verb = isThumbnailRequest ? "thumbnail" : "download";
83
83
  if (useAuthentication) {
84
- prefix = "/_matrix/client/v1/media/".concat(verb);
84
+ prefix = "/im/_matrix/client/v1/media/".concat(verb);
85
85
  } else {
86
- prefix = "/_matrix/media/v3/".concat(verb);
86
+ prefix = "/im/_matrix/media/v3/".concat(verb);
87
87
  }
88
88
  var url = new URL("".concat(prefix, "/").concat(serverName, "/").concat(mediaId), baseUrl);
89
89
  if (width) {
@@ -1 +1 @@
1
- {"version":3,"file":"content-repo.js","names":["serverNameRegex","validateServerName","serverName","matches","exec","mediaIdRegex","validateMediaId","mediaId","getHttpUriForMxc","baseUrl","mxc","width","height","resizeMethod","allowDirectLinks","arguments","length","undefined","allowRedirects","useAuthentication","startsWith","rest","slice","split","prefix","isThumbnailRequest","verb","concat","url","URL","searchParams","set","Math","round","toString","JSON","stringify","href"],"sources":["../src/content-repo.ts"],"sourcesContent":["/*\nCopyright 2015 - 2024 The Matrix.org Foundation C.I.C.\n\nLicensed under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License.\nYou may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\nUnless required by applicable law or agreed to in writing, software\ndistributed under the License is distributed on an \"AS IS\" BASIS,\nWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\nSee the License for the specific language governing permissions and\nlimitations under the License.\n*/\n\n// Validation based on https://spec.matrix.org/v1.12/appendices/#server-name\n// We do not use the validation described in https://spec.matrix.org/v1.12/client-server-api/#security-considerations-5\n// as it'd wrongly make all MXCs invalid due to not allowing `[].:` in server names.\nconst serverNameRegex =\n /^(?:(?:\\d{1,3}\\.\\d{1,3}\\.\\d{1,3}\\.\\d{1,3})|(?:\\[[\\dA-Fa-f:.]{2,45}])|(?:[A-Za-z\\d\\-.]{1,255}))(?::\\d{1,5})?$/;\nfunction validateServerName(serverName: string): boolean {\n const matches = serverNameRegex.exec(serverName);\n return matches?.[0] === serverName;\n}\n\n// Validation based on https://spec.matrix.org/v1.12/client-server-api/#security-considerations-5\nconst mediaIdRegex = /^[\\w-]+$/;\nfunction validateMediaId(mediaId: string): boolean {\n const matches = mediaIdRegex.exec(mediaId);\n return matches?.[0] === mediaId;\n}\n\n/**\n * Get the HTTP URL for an MXC URI.\n * @param baseUrl - The base homeserver url which has a content repo.\n * @param mxc - The mxc:// URI.\n * @param width - The desired width of the thumbnail.\n * @param height - The desired height of the thumbnail.\n * @param resizeMethod - The thumbnail resize method to use, either\n * \"crop\" or \"scale\".\n * @param allowDirectLinks - If true, return any non-mxc URLs\n * directly. Fetching such URLs will leak information about the user to\n * anyone they share a room with. If false, will return the emptry string\n * for such URLs.\n * @param allowRedirects - If true, the caller supports the URL being 307 or\n * 308 redirected to another resource upon request. If false, redirects\n * are not expected. Implied `true` when `useAuthentication` is `true`.\n * @param useAuthentication - If true, the caller supports authenticated\n * media and wants an authentication-required URL. Note that server support\n * for authenticated media will *not* be checked - it is the caller's responsibility\n * to do so before calling this function. Note also that `useAuthentication`\n * implies `allowRedirects`. Defaults to false (unauthenticated endpoints).\n * @returns The complete URL to the content, may be an empty string if the provided mxc is not valid.\n */\nexport function getHttpUriForMxc(\n baseUrl: string,\n mxc?: string,\n width?: number,\n height?: number,\n resizeMethod?: string,\n allowDirectLinks = false,\n allowRedirects?: boolean,\n useAuthentication?: boolean,\n): string {\n if (typeof mxc !== \"string\" || !mxc) {\n return \"\";\n }\n if (!mxc.startsWith(\"mxc://\")) {\n if (allowDirectLinks) {\n return mxc;\n } else {\n return \"\";\n }\n }\n\n const [serverName, mediaId, ...rest] = mxc.slice(6).split(\"/\");\n if (rest.length > 0 || !validateServerName(serverName) || !validateMediaId(mediaId)) {\n return \"\";\n }\n\n if (useAuthentication) {\n allowRedirects = true; // per docs (MSC3916 always expects redirects)\n\n // Dev note: MSC3916 removes `allow_redirect` entirely, but\n // for explicitness we set it here. This makes it slightly more obvious to\n // callers, hopefully.\n }\n\n let prefix: string;\n const isThumbnailRequest = !!width || !!height || !!resizeMethod;\n const verb = isThumbnailRequest ? \"thumbnail\" : \"download\";\n if (useAuthentication) {\n prefix = `/_matrix/client/v1/media/${verb}`;\n } else {\n prefix = `/_matrix/media/v3/${verb}`;\n }\n\n const url = new URL(`${prefix}/${serverName}/${mediaId}`, baseUrl);\n\n if (width) {\n url.searchParams.set(\"width\", Math.round(width).toString());\n }\n if (height) {\n url.searchParams.set(\"height\", Math.round(height).toString());\n }\n if (resizeMethod) {\n url.searchParams.set(\"method\", resizeMethod);\n }\n\n if (typeof allowRedirects === \"boolean\") {\n // We add this after, so we don't convert everything to a thumbnail request.\n url.searchParams.set(\"allow_redirect\", JSON.stringify(allowRedirects));\n }\n\n return url.href;\n}\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,IAAMA,eAAe,GACjB,8GAA8G;AAClH,SAASC,kBAAkBA,CAACC,UAAkB,EAAW;EACrD,IAAMC,OAAO,GAAGH,eAAe,CAACI,IAAI,CAACF,UAAU,CAAC;EAChD,OAAO,CAAAC,OAAO,aAAPA,OAAO,uBAAPA,OAAO,CAAG,CAAC,CAAC,MAAKD,UAAU;AACtC;;AAEA;AACA,IAAMG,YAAY,GAAG,UAAU;AAC/B,SAASC,eAAeA,CAACC,OAAe,EAAW;EAC/C,IAAMJ,OAAO,GAAGE,YAAY,CAACD,IAAI,CAACG,OAAO,CAAC;EAC1C,OAAO,CAAAJ,OAAO,aAAPA,OAAO,uBAAPA,OAAO,CAAG,CAAC,CAAC,MAAKI,OAAO;AACnC;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A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AAAG,MAAA,CAA+BD,IAAI,CAAE;EAC/C,CAAC,MAAM;IACHF,MAAM,wBAAAG,MAAA,CAAwBD,IAAI,CAAE;EACxC;EAEA,IAAME,GAAG,GAAG,IAAIC,GAAG,IAAAF,MAAA,CAAIH,MAAM,OAAAG,MAAA,CAAIzB,UAAU,OAAAyB,MAAA,CAAIpB,OAAO,GAAIE,OAAO,CAAC;EAElE,IAAIE,KAAK,EAAE;IACPiB,GAAG,CAACE,YAAY,CAACC,GAAG,CAAC,OAAO,EAAEC,IAAI,CAACC,KAAK,CAACtB,KAAK,CAAC,CAACuB,QAAQ,CAAC,CAAC,CAAC;EAC/D;EACA,IAAItB,MAAM,EAAE;IACRgB,GAAG,CAACE,YAAY,CAACC,GAAG,CAAC,QAAQ,EAAEC,IAAI,CAACC,KAAK,CAACrB,MAAM,CAAC,CAACsB,QAAQ,CAAC,CAAC,CAAC;EACjE;EACA,IAAIrB,YAAY,EAAE;IACde,GAAG,CAACE,YAAY,CAACC,GAAG,CAAC,QAAQ,EAAElB,YAAY,CAAC;EAChD;EAEA,IAAI,OAAOK,cAAc,KAAK,SAAS,EAAE;IACrC;IACAU,GAAG,CAACE,YAAY,CAACC,GAAG,CAAC,gBAAgB,EAAEI,IAAI,CAACC,SAAS,CAAClB,cAAc,CAAC,CAAC;EAC1E;EAEA,OAAOU,GAAG,CAACS,IAAI;AACnB","ignoreList":[]}
1
+ {"version":3,"file":"content-repo.js","names":["serverNameRegex","validateServerName","serverName","matches","exec","mediaIdRegex","validateMediaId","mediaId","getHttpUriForMxc","baseUrl","mxc","width","height","resizeMethod","allowDirectLinks","arguments","length","undefined","allowRedirects","useAuthentication","startsWith","rest","slice","split","prefix","isThumbnailRequest","verb","concat","url","URL","searchParams","set","Math","round","toString","JSON","stringify","href"],"sources":["../src/content-repo.ts"],"sourcesContent":["/*\nCopyright 2015 - 2024 The Matrix.org Foundation C.I.C.\n\nLicensed under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License.\nYou may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\nUnless required by applicable law or agreed to in writing, software\ndistributed under the License is distributed on an \"AS IS\" BASIS,\nWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\nSee the License for the specific language governing permissions and\nlimitations under the License.\n*/\n\n// Validation based on https://spec.matrix.org/v1.12/appendices/#server-name\n// We do not use the validation described in https://spec.matrix.org/v1.12/client-server-api/#security-considerations-5\n// as it'd wrongly make all MXCs invalid due to not allowing `[].:` in server names.\nconst serverNameRegex =\n /^(?:(?:\\d{1,3}\\.\\d{1,3}\\.\\d{1,3}\\.\\d{1,3})|(?:\\[[\\dA-Fa-f:.]{2,45}])|(?:[A-Za-z\\d\\-.]{1,255}))(?::\\d{1,5})?$/;\nfunction validateServerName(serverName: string): boolean {\n const matches = serverNameRegex.exec(serverName);\n return matches?.[0] === serverName;\n}\n\n// Validation based on https://spec.matrix.org/v1.12/client-server-api/#security-considerations-5\nconst mediaIdRegex = /^[\\w-]+$/;\nfunction validateMediaId(mediaId: string): boolean {\n const matches = mediaIdRegex.exec(mediaId);\n return matches?.[0] === mediaId;\n}\n\n/**\n * Get the HTTP URL for an MXC URI.\n * @param baseUrl - The base homeserver url which has a content repo.\n * @param mxc - The mxc:// URI.\n * @param width - The desired width of the thumbnail.\n * @param height - The desired height of the thumbnail.\n * @param resizeMethod - The thumbnail resize method to use, either\n * \"crop\" or \"scale\".\n * @param allowDirectLinks - If true, return any non-mxc URLs\n * directly. Fetching such URLs will leak information about the user to\n * anyone they share a room with. If false, will return the emptry string\n * for such URLs.\n * @param allowRedirects - If true, the caller supports the URL being 307 or\n * 308 redirected to another resource upon request. If false, redirects\n * are not expected. Implied `true` when `useAuthentication` is `true`.\n * @param useAuthentication - If true, the caller supports authenticated\n * media and wants an authentication-required URL. Note that server support\n * for authenticated media will *not* be checked - it is the caller's responsibility\n * to do so before calling this function. Note also that `useAuthentication`\n * implies `allowRedirects`. Defaults to false (unauthenticated endpoints).\n * @returns The complete URL to the content, may be an empty string if the provided mxc is not valid.\n */\nexport function getHttpUriForMxc(\n baseUrl: string,\n mxc?: string,\n width?: number,\n height?: number,\n resizeMethod?: string,\n allowDirectLinks = false,\n allowRedirects?: boolean,\n useAuthentication?: boolean,\n): string {\n if (typeof mxc !== \"string\" || !mxc) {\n return \"\";\n }\n if (!mxc.startsWith(\"mxc://\")) {\n if (allowDirectLinks) {\n return mxc;\n } else {\n return \"\";\n }\n }\n\n const [serverName, mediaId, ...rest] = mxc.slice(6).split(\"/\");\n if (rest.length > 0 || !validateServerName(serverName) || !validateMediaId(mediaId)) {\n return \"\";\n }\n\n if (useAuthentication) {\n allowRedirects = true; // per docs (MSC3916 always expects redirects)\n\n // Dev note: MSC3916 removes `allow_redirect` entirely, but\n // for explicitness we set it here. This makes it slightly more obvious to\n // callers, hopefully.\n }\n\n let prefix: string;\n const isThumbnailRequest = !!width || !!height || !!resizeMethod;\n const verb = isThumbnailRequest ? \"thumbnail\" : \"download\";\n if (useAuthentication) {\n prefix = `/im/_matrix/client/v1/media/${verb}`;\n } else {\n prefix = `/im/_matrix/media/v3/${verb}`;\n }\n\n const url = new URL(`${prefix}/${serverName}/${mediaId}`, baseUrl);\n\n if (width) {\n url.searchParams.set(\"width\", Math.round(width).toString());\n }\n if (height) {\n url.searchParams.set(\"height\", Math.round(height).toString());\n }\n if (resizeMethod) {\n url.searchParams.set(\"method\", resizeMethod);\n }\n\n if (typeof allowRedirects === \"boolean\") {\n // We add this after, so we don't convert everything to a thumbnail request.\n url.searchParams.set(\"allow_redirect\", JSON.stringify(allowRedirects));\n }\n\n return url.href;\n}\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,IAAMA,eAAe,GACjB,8GAA8G;AAClH,SAASC,kBAAkBA,CAACC,UAAkB,EAAW;EACrD,IAAMC,OAAO,GAAGH,eAAe,CAACI,IAAI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AACS,IAAI;AACnB","ignoreList":[]}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@unwanted/matrix-sdk-mini",
3
- "version": "34.12.0-6",
3
+ "version": "34.12.0-7",
4
4
  "description": "Matrix Client-Server mini SDK for Javascript",
5
5
  "engines": {
6
6
  "node": ">=20.0.0"
@@ -244,7 +244,7 @@ export class AutoDiscovery {
244
244
 
245
245
  // Step 5b: Verify there is an identity server listening on the provided
246
246
  // URL.
247
- const isResponse = await this.fetchWellKnownObject(`${isUrl}/_matrix/identity/v2`);
247
+ const isResponse = await this.fetchWellKnownObject(`${isUrl}/im/_matrix/identity/v2`);
248
248
  if (!isResponse?.raw || isResponse.action !== AutoDiscoveryAction.SUCCESS) {
249
249
  logger.error("Invalid /v2 response");
250
250
  failingClientConfig["m.identity_server"].error = AutoDiscovery.ERROR_INVALID_IDENTITY_SERVER;
package/src/client.ts CHANGED
@@ -1694,7 +1694,7 @@ export class MatrixClient extends TypedEventEmitter<EmittedEvents, ClientEventHa
1694
1694
  });
1695
1695
  const options =
1696
1696
  msc3391DeleteAccountDataServerSupport === ServerSupport.Unstable
1697
- ? { prefix: "/_matrix/client/unstable/org.matrix.msc3391" }
1697
+ ? { prefix: "/im/_matrix/client/unstable/org.matrix.msc3391" }
1698
1698
  : undefined;
1699
1699
  return await this.http.authedRequest(Method.Delete, path, undefined, undefined, options);
1700
1700
  }
@@ -3900,7 +3900,7 @@ export class MatrixClient extends TypedEventEmitter<EmittedEvents, ClientEventHa
3900
3900
  prefix:
3901
3901
  Thread.hasServerSideListSupport === FeatureSupport.Stable
3902
3902
  ? ClientPrefix.V1
3903
- : "/_matrix/client/unstable/org.matrix.msc3856",
3903
+ : "/im/_matrix/client/unstable/org.matrix.msc3856",
3904
3904
  };
3905
3905
 
3906
3906
  return this.http
@@ -5219,7 +5219,7 @@ export class MatrixClient extends TypedEventEmitter<EmittedEvents, ClientEventHa
5219
5219
  case SERVICE_TYPES.IS:
5220
5220
  return this.http.getUrl("/terms", undefined, IdentityPrefix.V2, baseUrl);
5221
5221
  case SERVICE_TYPES.IM:
5222
- return this.http.getUrl("/terms", undefined, "/_matrix/integrations/v1", baseUrl);
5222
+ return this.http.getUrl("/terms", undefined, "/im/_matrix/integrations/v1", baseUrl);
5223
5223
  default:
5224
5224
  throw new Error("Unsupported service type");
5225
5225
  }
@@ -6056,7 +6056,7 @@ export class MatrixClient extends TypedEventEmitter<EmittedEvents, ClientEventHa
6056
6056
  if (await this.doesServerSupportUnstableFeature("uk.tcpip.msc4133.stable")) {
6057
6057
  return ClientPrefix.V3;
6058
6058
  }
6059
- return "/_matrix/client/unstable/uk.tcpip.msc4133";
6059
+ return "/im/_matrix/client/unstable/uk.tcpip.msc4133";
6060
6060
  }
6061
6061
 
6062
6062
  /**
@@ -7175,7 +7175,7 @@ export class MatrixClient extends TypedEventEmitter<EmittedEvents, ClientEventHa
7175
7175
  if (e.errcode === "M_UNRECOGNIZED") {
7176
7176
  // fall back to the prefixed hierarchy API.
7177
7177
  return this.http.authedRequest<IRoomHierarchy>(Method.Get, path, queryParams, undefined, {
7178
- prefix: "/_matrix/client/unstable/org.matrix.msc2946",
7178
+ prefix: "/im/_matrix/client/unstable/org.matrix.msc2946",
7179
7179
  });
7180
7180
  }
7181
7181
 
@@ -7269,7 +7269,7 @@ export class MatrixClient extends TypedEventEmitter<EmittedEvents, ClientEventHa
7269
7269
  const clientTimeout = req.clientTimeout;
7270
7270
  delete req.clientTimeout;
7271
7271
  return this.http.authedRequest<MSC3575SlidingSyncResponse>(Method.Post, "/sync", qps, req, {
7272
- prefix: "/_matrix/client/unstable/org.matrix.msc3575",
7272
+ prefix: "/im/_matrix/client/unstable/org.matrix.msc3575",
7273
7273
  baseUrl: proxyBaseUrl,
7274
7274
  localTimeoutMs: clientTimeout,
7275
7275
  abortSignal,
@@ -7301,7 +7301,7 @@ export class MatrixClient extends TypedEventEmitter<EmittedEvents, ClientEventHa
7301
7301
  */
7302
7302
  public async getRoomSummary(roomIdOrAlias: string, via?: string[]): Promise<RoomSummary> {
7303
7303
  const paramOpts = {
7304
- prefix: "/_matrix/client/unstable/im.nheko.summary",
7304
+ prefix: "/im/_matrix/client/unstable/im.nheko.summary",
7305
7305
  };
7306
7306
  try {
7307
7307
  const path = utils.encodeUri("/summary/$roomid", { $roomid: roomIdOrAlias });
@@ -7403,7 +7403,7 @@ export class MatrixClient extends TypedEventEmitter<EmittedEvents, ClientEventHa
7403
7403
  (<MatrixError>err).httpStatus === 405)
7404
7404
  ) {
7405
7405
  return await this.http.authedRequest(Method.Get, path, queryParams, undefined, {
7406
- prefix: "/_matrix/client/unstable/org.matrix.msc3030",
7406
+ prefix: "/im/_matrix/client/unstable/org.matrix.msc3030",
7407
7407
  });
7408
7408
  }
7409
7409
 
@@ -91,9 +91,9 @@ export function getHttpUriForMxc(
91
91
  const isThumbnailRequest = !!width || !!height || !!resizeMethod;
92
92
  const verb = isThumbnailRequest ? "thumbnail" : "download";
93
93
  if (useAuthentication) {
94
- prefix = `/_matrix/client/v1/media/${verb}`;
94
+ prefix = `/im/_matrix/client/v1/media/${verb}`;
95
95
  } else {
96
- prefix = `/_matrix/media/v3/${verb}`;
96
+ prefix = `/im/_matrix/media/v3/${verb}`;
97
97
  }
98
98
 
99
99
  const url = new URL(`${prefix}/${serverName}/${mediaId}`, baseUrl);