Add new contacts `WSC_RPC_API_URL`, which points to the RPC endpoint
authorCyperghost <olaf_schmitz_1@t-online.de>
Fri, 6 Sep 2024 08:52:58 +0000 (10:52 +0200)
committerCyperghost <olaf_schmitz_1@t-online.de>
Fri, 6 Sep 2024 08:52:58 +0000 (10:52 +0200)
43 files changed:
com.woltlab.wcf/templates/headIncludeJavaScript.tpl
ts/WoltLabSuite/Core/Api/Comments/CreateComment.ts
ts/WoltLabSuite/Core/Api/Comments/DeleteComment.ts
ts/WoltLabSuite/Core/Api/Comments/EditComment.ts
ts/WoltLabSuite/Core/Api/Comments/EnableComment.ts
ts/WoltLabSuite/Core/Api/Comments/RenderComment.ts
ts/WoltLabSuite/Core/Api/Comments/RenderComments.ts
ts/WoltLabSuite/Core/Api/Comments/Responses/CreateResponse.ts
ts/WoltLabSuite/Core/Api/Comments/Responses/DeleteResponse.ts
ts/WoltLabSuite/Core/Api/Comments/Responses/EditResponse.ts
ts/WoltLabSuite/Core/Api/Comments/Responses/EnableResponse.ts
ts/WoltLabSuite/Core/Api/Comments/Responses/RenderResponse.ts
ts/WoltLabSuite/Core/Api/Comments/Responses/RenderResponses.ts
ts/WoltLabSuite/Core/Api/Comments/Responses/UpdateResponse.ts
ts/WoltLabSuite/Core/Api/Comments/UpdateComment.ts
ts/WoltLabSuite/Core/Api/Files/Chunk/Chunk.ts
ts/WoltLabSuite/Core/Api/Files/DeleteFile.ts
ts/WoltLabSuite/Core/Api/Files/GenerateThumbnails.ts
ts/WoltLabSuite/Core/Api/Files/Upload.ts
ts/WoltLabSuite/Core/Api/Messages/MentionSuggestions.ts
ts/WoltLabSuite/Core/Api/Sessions/DeleteSession.ts
ts/global.d.ts
wcfsetup/install/files/acp/templates/header.tpl
wcfsetup/install/files/js/WoltLabSuite/Core/Api/Comments/CreateComment.js
wcfsetup/install/files/js/WoltLabSuite/Core/Api/Comments/DeleteComment.js
wcfsetup/install/files/js/WoltLabSuite/Core/Api/Comments/EditComment.js
wcfsetup/install/files/js/WoltLabSuite/Core/Api/Comments/EnableComment.js
wcfsetup/install/files/js/WoltLabSuite/Core/Api/Comments/RenderComment.js
wcfsetup/install/files/js/WoltLabSuite/Core/Api/Comments/RenderComments.js
wcfsetup/install/files/js/WoltLabSuite/Core/Api/Comments/Responses/CreateResponse.js
wcfsetup/install/files/js/WoltLabSuite/Core/Api/Comments/Responses/DeleteResponse.js
wcfsetup/install/files/js/WoltLabSuite/Core/Api/Comments/Responses/EditResponse.js
wcfsetup/install/files/js/WoltLabSuite/Core/Api/Comments/Responses/EnableResponse.js
wcfsetup/install/files/js/WoltLabSuite/Core/Api/Comments/Responses/RenderResponse.js
wcfsetup/install/files/js/WoltLabSuite/Core/Api/Comments/Responses/RenderResponses.js
wcfsetup/install/files/js/WoltLabSuite/Core/Api/Comments/Responses/UpdateResponse.js
wcfsetup/install/files/js/WoltLabSuite/Core/Api/Comments/UpdateComment.js
wcfsetup/install/files/js/WoltLabSuite/Core/Api/Files/Chunk/Chunk.js
wcfsetup/install/files/js/WoltLabSuite/Core/Api/Files/DeleteFile.js
wcfsetup/install/files/js/WoltLabSuite/Core/Api/Files/GenerateThumbnails.js
wcfsetup/install/files/js/WoltLabSuite/Core/Api/Files/Upload.js
wcfsetup/install/files/js/WoltLabSuite/Core/Api/Messages/MentionSuggestions.js
wcfsetup/install/files/js/WoltLabSuite/Core/Api/Sessions/DeleteSession.js

index 9b0631fe40e04c6f3645f9f0755bd228d302c663..aec2dfe1f9c3a8fdc35fe871ae61072b89b589bb 100644 (file)
@@ -4,7 +4,8 @@
 
 <script data-cfasync="false">
        var WCF_PATH = '{@$__wcf->getPath()}';
-       var WSC_API_URL = '{@$__wcf->getPath()}';
+    var WSC_API_URL = '{@$__wcf->getPath()}';
+    var WSC_RPC_API_URL = '{link controller="Api" id="rpc"}{/link}';
        {* The SECURITY_TOKEN is defined in wcf.globalHelper.js *}
        var LANGUAGE_ID = {@$__wcf->getLanguage()->languageID};
        var LANGUAGE_USE_INFORMAL_VARIANT = {if LANGUAGE_USE_INFORMAL_VARIANT}true{else}false{/if};
index ae0cbd70887cd458eda12f48b18618fc3b4bb376..a896b88d4b5aef6c0d5b2e1b2746f671c75dec19 100644 (file)
@@ -21,7 +21,7 @@ export async function createComment(
   message: string,
   guestToken: string = "",
 ): Promise<ApiResult<Response>> {
-  const url = new URL(`${window.WSC_API_URL}index.php?api/rpc/core/comments`);
+  const url = new URL(`${window.WSC_RPC_API_URL}core/comments`);
 
   const payload = {
     objectTypeID: objectTypeId,
index 2f554c64e91e2c3e82926fb061ba4e4cbe46140c..de6339576a30ad3e3e4b118fbdcc9e03fd9bb950 100644 (file)
@@ -13,7 +13,7 @@ import { ApiResult, apiResultFromError, apiResultFromValue } from "../Result";
 
 export async function deleteComment(commentId: number): Promise<ApiResult<[]>> {
   try {
-    await prepareRequest(`${window.WSC_API_URL}index.php?api/rpc/core/comments/${commentId}`).delete().fetchAsJson();
+    await prepareRequest(`${window.WSC_RPC_API_URL}core/comments/${commentId}`).delete().fetchAsJson();
   } catch (e) {
     return apiResultFromError(e);
   }
index 57e31d6968a0f79ba3d4685eecdf548382f2ddf6..fab30b86b8dfe50ae5a6528f832aab1965287bf7 100644 (file)
@@ -15,7 +15,7 @@ type Response = {
 };
 
 export async function editComment(commentId: number): Promise<ApiResult<Response>> {
-  const url = new URL(`${window.WSC_API_URL}index.php?api/rpc/core/comments/${commentId}/edit`);
+  const url = new URL(`${window.WSC_RPC_API_URL}core/comments/${commentId}/edit`);
 
   let response: Response;
   try {
index ec0d403c68e8ac353f4ce2142cd82f76ebce1bb8..efb5d7891f01ba1b1f92884bd130fcb1984708bc 100644 (file)
@@ -13,9 +13,7 @@ import { ApiResult, apiResultFromError, apiResultFromValue } from "../Result";
 
 export async function enableComment(commentId: number): Promise<ApiResult<[]>> {
   try {
-    await prepareRequest(`${window.WSC_API_URL}index.php?api/rpc/core/comments/${commentId}/enable`)
-      .post()
-      .fetchAsJson();
+    await prepareRequest(`${window.WSC_RPC_API_URL}core/comments/${commentId}/enable`).post().fetchAsJson();
   } catch (e) {
     return apiResultFromError(e);
   }
index f68aaf08bdfb624fccccf8cfae7b00a83f30d36e..198d898eebbead08964de4ec3dc77c63c98b9b42 100644 (file)
@@ -21,7 +21,7 @@ export async function renderComment(
   messageOnly: boolean = false,
   objectTypeId: number | undefined = undefined,
 ): Promise<ApiResult<Response>> {
-  const url = new URL(`${window.WSC_API_URL}index.php?api/rpc/core/comments/${commentId}/render`);
+  const url = new URL(`${window.WSC_RPC_API_URL}core/comments/${commentId}/render`);
   url.searchParams.set("messageOnly", messageOnly.toString());
   if (responseId !== undefined) {
     url.searchParams.set("responseID", responseId.toString());
index da89fcb670ed592dae17daf6fb525c5a3c52fc31..9a3aeb607ba3e139a22cac7278663a09022bee0e 100644 (file)
@@ -20,7 +20,7 @@ export async function renderComments(
   objectId: number,
   lastCommentTime: number = 0,
 ): Promise<ApiResult<Response>> {
-  const url = new URL(`${window.WSC_API_URL}index.php?api/rpc/core/comments/render`);
+  const url = new URL(`${window.WSC_RPC_API_URL}core/comments/render`);
   url.searchParams.set("objectTypeID", objectTypeId.toString());
   url.searchParams.set("objectID", objectId.toString());
   url.searchParams.set("lastCommentTime", lastCommentTime.toString());
index 7a59427b6f06396e812cc1a55915a3adff9c4733..5138def8b0449194eddc2b6a817cb9dd569759c5 100644 (file)
@@ -20,7 +20,7 @@ export async function createResponse(
   message: string,
   guestToken: string = "",
 ): Promise<ApiResult<Response>> {
-  const url = new URL(`${window.WSC_API_URL}index.php?api/rpc/core/comments/responses`);
+  const url = new URL(`${window.WSC_RPC_API_URL}core/comments/responses`);
 
   const payload = {
     commentID: commentId,
index 546da6dd3fe0d19fdb73ecfc252715cfa56e03da..8bd2c86b6931970e43d1e325e4538686c98890c2 100644 (file)
@@ -13,9 +13,7 @@ import { ApiResult, apiResultFromError, apiResultFromValue } from "../../Result"
 
 export async function deleteResponse(responseId: number): Promise<ApiResult<[]>> {
   try {
-    await prepareRequest(`${window.WSC_API_URL}index.php?api/rpc/core/comments/responses/${responseId}`)
-      .delete()
-      .fetchAsJson();
+    await prepareRequest(`${window.WSC_RPC_API_URL}core/comments/responses/${responseId}`).delete().fetchAsJson();
   } catch (e) {
     return apiResultFromError(e);
   }
index bc02af18d9aaa18cda11bb0436acfe5f58d7123f..7d8db15eaf6372382ad063091f779360a9d3233e 100644 (file)
@@ -15,7 +15,7 @@ type Response = {
 };
 
 export async function editResponse(responseId: number): Promise<ApiResult<Response>> {
-  const url = new URL(`${window.WSC_API_URL}index.php?api/rpc/core/comments/responses/${responseId}/edit`);
+  const url = new URL(`${window.WSC_RPC_API_URL}core/comments/responses/${responseId}/edit`);
 
   let response: Response;
   try {
index 73cab4daae6b0681a5133a570abb80d07f55fed7..e7368e236a976d15880eeb6420f69c858cbb111e 100644 (file)
@@ -13,9 +13,7 @@ import { ApiResult, apiResultFromError, apiResultFromValue } from "../../Result"
 
 export async function enableResponse(responseId: number): Promise<ApiResult<[]>> {
   try {
-    await prepareRequest(`${window.WSC_API_URL}index.php?api/rpc/core/comments/responses/${responseId}/enable`)
-      .post()
-      .fetchAsJson();
+    await prepareRequest(`${window.WSC_RPC_API_URL}core/comments/responses/${responseId}/enable`).post().fetchAsJson();
   } catch (e) {
     return apiResultFromError(e);
   }
index 6b4b55457f008f11d71d21c8184732c889d3c95f..a04580d4f56e012a2dcf186239b2df76a8aa77c2 100644 (file)
@@ -19,7 +19,7 @@ export async function renderResponse(
   messageOnly: boolean = false,
   objectTypeId: number | undefined = undefined,
 ): Promise<ApiResult<Response>> {
-  const url = new URL(`${window.WSC_API_URL}index.php?api/rpc/core/comments/responses/${responseId}/render`);
+  const url = new URL(`${window.WSC_RPC_API_URL}core/comments/responses/${responseId}/render`);
   url.searchParams.set("messageOnly", messageOnly.toString());
   if (objectTypeId !== undefined) {
     url.searchParams.set("objectTypeID", objectTypeId.toString());
index c2c749a6f99cbadcafb6294b2d420ccd52ebdc7b..e9659e5b3f49cd7540c15255734e04eefa8ecf3b 100644 (file)
@@ -22,7 +22,7 @@ export async function renderResponses(
   lastResponseId: number,
   loadAllResponses: boolean,
 ): Promise<ApiResult<Response>> {
-  const url = new URL(`${window.WSC_API_URL}index.php?api/rpc/core/comments/responses/render`);
+  const url = new URL(`${window.WSC_RPC_API_URL}core/comments/responses/render`);
   url.searchParams.set("commentID", commentId.toString());
   url.searchParams.set("lastResponseTime", lastResponseTime.toString());
   url.searchParams.set("lastResponseID", lastResponseId.toString());
index c3853483b01ae402041301f263c10f03dda2c5a9..b28b93058975aed305766d1a6e978db277b34e62 100644 (file)
@@ -13,7 +13,7 @@ import { ApiResult, apiResultFromError, apiResultFromValue } from "../../Result"
 
 export async function updateResponse(responseId: number, message: string): Promise<ApiResult<[]>> {
   try {
-    await prepareRequest(`${window.WSC_API_URL}index.php?api/rpc/core/comments/responses/${responseId}`)
+    await prepareRequest(`${window.WSC_RPC_API_URL}core/comments/responses/${responseId}`)
       .post({
         message,
       })
index ec16da6428c21a880ce58af94b17b26e51c56293..51be928edf7a0d637cb7ed484b61c3caf72f4358 100644 (file)
@@ -13,7 +13,7 @@ import { ApiResult, apiResultFromError, apiResultFromValue } from "../Result";
 
 export async function updateComment(commentId: number, message: string): Promise<ApiResult<[]>> {
   try {
-    await prepareRequest(`${window.WSC_API_URL}index.php?api/rpc/core/comments/${commentId}`)
+    await prepareRequest(`${window.WSC_RPC_API_URL}core/comments/${commentId}`)
       .post({
         message,
       })
index 683c6ae32a922f74e360f125235a1f54a01796be..25af08adc2d51db35382f67763fb1d013a64a3e7 100644 (file)
@@ -22,7 +22,7 @@ export async function uploadChunk(
   checksum: string,
   payload: Blob,
 ): Promise<ApiResult<Response>> {
-  const url = new URL(`${window.WSC_API_URL}index.php?api/rpc/core/files/upload/${identifier}/chunk/${sequenceNo}`);
+  const url = new URL(`${window.WSC_RPC_API_URL}core/files/upload/${identifier}/chunk/${sequenceNo}`);
 
   let response: Response;
   try {
index b6a1b7f603a1aea018bede5c3812630b39ca92ed..e4a9beb259b5163d80d5df14a941716cb5fcb064 100644 (file)
@@ -3,7 +3,7 @@ import { ApiResult, apiResultFromError, apiResultFromValue } from "../Result";
 
 export async function deleteFile(fileId: number): Promise<ApiResult<[]>> {
   try {
-    await prepareRequest(`${window.WSC_API_URL}index.php?api/rpc/core/files/${fileId}`).delete().fetchAsJson();
+    await prepareRequest(`${window.WSC_RPC_API_URL}core/files/${fileId}`).delete().fetchAsJson();
   } catch (e) {
     return apiResultFromError(e);
   }
index d93bf8e7d4988f4a09711a424eeb7f70ddbc615d..8ca1953916aceda8c7cb3b4db4a326037700edda 100644 (file)
@@ -8,7 +8,7 @@ type Thumbnail = {
 type Response = Thumbnail[];
 
 export async function generateThumbnails(fileID: number): Promise<ApiResult<Response>> {
-  const url = new URL(`${window.WSC_API_URL}index.php?api/rpc/core/files/${fileID}/generatethumbnails`);
+  const url = new URL(`${window.WSC_RPC_API_URL}core/files/${fileID}/generatethumbnails`);
 
   let response: Response;
   try {
index a0f76254f48134b3c73f2f193a11b556c3a0b2fa..3d4087a146bb088f718558f596c27e5264affeee 100644 (file)
@@ -13,7 +13,7 @@ export async function upload(
   objectType: string,
   context: string,
 ): Promise<ApiResult<Response>> {
-  const url = new URL(`${window.WSC_API_URL}index.php?api/rpc/core/files/upload`);
+  const url = new URL(`${window.WSC_RPC_API_URL}core/files/upload`);
 
   const payload = {
     filename,
index 98838157a8ed5f671f106142828127c0529f48ab..0be4d784d6911e29dca1c70f5b8905fcca27546d 100644 (file)
@@ -26,7 +26,7 @@ type Item =
 type Response = Item[];
 
 export async function mentionSuggestions(query: string): Promise<ApiResult<Response>> {
-  const url = new URL(window.WSC_API_URL + "index.php?api/rpc/core/messages/mentionsuggestions");
+  const url = new URL(window.WSC_API_URL + "core/messages/mentionsuggestions");
   url.searchParams.set("query", query);
 
   let response: Response;
index aca60c618922670e7041e8c87789e53b5ae06020..2c8bc11030ee116b6b658750c5f4a70d0bd30d7f 100644 (file)
@@ -14,7 +14,7 @@ import { ApiResult, apiResultFromError, apiResultFromValue } from "../Result";
 
 export async function deleteSession(sessionId: string): Promise<ApiResult<[]>> {
   try {
-    await prepareRequest(`${window.WSC_API_URL}index.php?api/rpc/core/sessions/${sessionId}`).delete().fetchAsJson();
+    await prepareRequest(`${window.WSC_RPC_API_URL}core/sessions/${sessionId}`).delete().fetchAsJson();
   } catch (e) {
     return apiResultFromError(e);
   }
index a4b7648c0b91d298e0b44419ac2f4ece9d539225..e17ba42deb9c26633ae6396bfd1e6fbda7e85201 100644 (file)
@@ -36,6 +36,7 @@ declare global {
     TIME_NOW: number;
     WCF_PATH: string;
     WSC_API_URL: string;
+    WSC_RPC_API_URL: string;
 
     getFontAwesome6Metadata: () => Map<string, IconMetadata>;
     getFontAwesome6IconMetadata: (name: string) => IconMetadata | undefined;
index 1429f386838431e104baca4a39a61dbdb0d0070f..ce1718575f1bbfd7ea18bc19cbee3581b6ba05db 100644 (file)
@@ -50,6 +50,7 @@
        <script data-eager="true">
                var WCF_PATH = '{@$__wcf->getPath()}';
                var WSC_API_URL = '{@$__wcf->getPath()}acp/';
+        var WSC_RPC_API_URL = '{link controller="Api" forceFrontend=true id="rpc"}{/link}';
                {* The SECURITY_TOKEN is defined in wcf.globalHelper.js *}
                var LANGUAGE_ID = {@$__wcf->getLanguage()->languageID};
                var LANGUAGE_USE_INFORMAL_VARIANT = {if LANGUAGE_USE_INFORMAL_VARIANT}true{else}false{/if};
index 1c6264def3e32f428d1eeb18138f34e47818cfb6..079996e3957cc96727df416e05dfba4744b7216e 100644 (file)
@@ -12,7 +12,7 @@ define(["require", "exports", "WoltLabSuite/Core/Ajax/Backend", "../Result"], fu
     Object.defineProperty(exports, "__esModule", { value: true });
     exports.createComment = void 0;
     async function createComment(objectTypeId, objectId, message, guestToken = "") {
-        const url = new URL(`${window.WSC_API_URL}index.php?api/rpc/core/comments`);
+        const url = new URL(`${window.WSC_RPC_API_URL}core/comments`);
         const payload = {
             objectTypeID: objectTypeId,
             objectID: objectId,
index 083cda3b5ae5dfa42d22f5a1b298160d7fc5c154..4ddbc67c0a53167684100122dd07c250c88d8a4f 100644 (file)
@@ -13,7 +13,7 @@ define(["require", "exports", "WoltLabSuite/Core/Ajax/Backend", "../Result"], fu
     exports.deleteComment = void 0;
     async function deleteComment(commentId) {
         try {
-            await (0, Backend_1.prepareRequest)(`${window.WSC_API_URL}index.php?api/rpc/core/comments/${commentId}`).delete().fetchAsJson();
+            await (0, Backend_1.prepareRequest)(`${window.WSC_RPC_API_URL}core/comments/${commentId}`).delete().fetchAsJson();
         }
         catch (e) {
             return (0, Result_1.apiResultFromError)(e);
index 1cf11efb58e1a266a0c03e559fa546ba23191102..7a400a73423730b106e8bfd00468dc653cbb4c79 100644 (file)
@@ -11,7 +11,7 @@ define(["require", "exports", "WoltLabSuite/Core/Ajax/Backend", "../Result"], fu
     Object.defineProperty(exports, "__esModule", { value: true });
     exports.editComment = void 0;
     async function editComment(commentId) {
-        const url = new URL(`${window.WSC_API_URL}index.php?api/rpc/core/comments/${commentId}/edit`);
+        const url = new URL(`${window.WSC_RPC_API_URL}core/comments/${commentId}/edit`);
         let response;
         try {
             response = (await (0, Backend_1.prepareRequest)(url).get().fetchAsJson());
index 7b243b7512d1ecd546091f481f884e2f6bff1809..384cfbd88e9f45d4d5fa10c8a7bd1a8474ee9c72 100644 (file)
@@ -13,9 +13,7 @@ define(["require", "exports", "WoltLabSuite/Core/Ajax/Backend", "../Result"], fu
     exports.enableComment = void 0;
     async function enableComment(commentId) {
         try {
-            await (0, Backend_1.prepareRequest)(`${window.WSC_API_URL}index.php?api/rpc/core/comments/${commentId}/enable`)
-                .post()
-                .fetchAsJson();
+            await (0, Backend_1.prepareRequest)(`${window.WSC_RPC_API_URL}core/comments/${commentId}/enable`).post().fetchAsJson();
         }
         catch (e) {
             return (0, Result_1.apiResultFromError)(e);
index 8d946b9cf63e1a52af86643d9e9ce75ca86f6ad6..9825c2ecf0de1acea4761806bbacd458ab89717c 100644 (file)
@@ -11,7 +11,7 @@ define(["require", "exports", "WoltLabSuite/Core/Ajax/Backend", "../Result"], fu
     Object.defineProperty(exports, "__esModule", { value: true });
     exports.renderComment = void 0;
     async function renderComment(commentId, responseId = undefined, messageOnly = false, objectTypeId = undefined) {
-        const url = new URL(`${window.WSC_API_URL}index.php?api/rpc/core/comments/${commentId}/render`);
+        const url = new URL(`${window.WSC_RPC_API_URL}core/comments/${commentId}/render`);
         url.searchParams.set("messageOnly", messageOnly.toString());
         if (responseId !== undefined) {
             url.searchParams.set("responseID", responseId.toString());
index 71231cda5472b2c547a6ca6c7a354cc8cd927b2f..8574924fb4b27f224cef7e9bfdab8ebd3211ec9e 100644 (file)
@@ -11,7 +11,7 @@ define(["require", "exports", "WoltLabSuite/Core/Ajax/Backend", "../Result"], fu
     Object.defineProperty(exports, "__esModule", { value: true });
     exports.renderComments = void 0;
     async function renderComments(objectTypeId, objectId, lastCommentTime = 0) {
-        const url = new URL(`${window.WSC_API_URL}index.php?api/rpc/core/comments/render`);
+        const url = new URL(`${window.WSC_RPC_API_URL}core/comments/render`);
         url.searchParams.set("objectTypeID", objectTypeId.toString());
         url.searchParams.set("objectID", objectId.toString());
         url.searchParams.set("lastCommentTime", lastCommentTime.toString());
index d367f9af99483b41b3905b6e2f5f1a62730ee350..7b8912091ef1ce33ad667b1dc5b974affe0a7bc9 100644 (file)
@@ -12,7 +12,7 @@ define(["require", "exports", "WoltLabSuite/Core/Ajax/Backend", "../../Result"],
     Object.defineProperty(exports, "__esModule", { value: true });
     exports.createResponse = void 0;
     async function createResponse(commentId, message, guestToken = "") {
-        const url = new URL(`${window.WSC_API_URL}index.php?api/rpc/core/comments/responses`);
+        const url = new URL(`${window.WSC_RPC_API_URL}core/comments/responses`);
         const payload = {
             commentID: commentId,
             message,
index 5de9ccfdf2d28d06354dae7001c482760d4edd2e..bd2d0e68c1fab398fde0d99cad3efbe1f56bcacd 100644 (file)
@@ -13,9 +13,7 @@ define(["require", "exports", "WoltLabSuite/Core/Ajax/Backend", "../../Result"],
     exports.deleteResponse = void 0;
     async function deleteResponse(responseId) {
         try {
-            await (0, Backend_1.prepareRequest)(`${window.WSC_API_URL}index.php?api/rpc/core/comments/responses/${responseId}`)
-                .delete()
-                .fetchAsJson();
+            await (0, Backend_1.prepareRequest)(`${window.WSC_RPC_API_URL}core/comments/responses/${responseId}`).delete().fetchAsJson();
         }
         catch (e) {
             return (0, Result_1.apiResultFromError)(e);
index c3f2264821d0a28e23b850f18ec24f9213ecf546..053d0f8ff5484db655d532e846725f0b7d991af4 100644 (file)
@@ -11,7 +11,7 @@ define(["require", "exports", "WoltLabSuite/Core/Ajax/Backend", "../../Result"],
     Object.defineProperty(exports, "__esModule", { value: true });
     exports.editResponse = void 0;
     async function editResponse(responseId) {
-        const url = new URL(`${window.WSC_API_URL}index.php?api/rpc/core/comments/responses/${responseId}/edit`);
+        const url = new URL(`${window.WSC_RPC_API_URL}core/comments/responses/${responseId}/edit`);
         let response;
         try {
             response = (await (0, Backend_1.prepareRequest)(url).get().fetchAsJson());
index 7d5cf3569ac0172e71a53bdba85b253d3a22e4c7..b50ca2a4db55c753d53627ac8449c7ed274e61bf 100644 (file)
@@ -13,9 +13,7 @@ define(["require", "exports", "WoltLabSuite/Core/Ajax/Backend", "../../Result"],
     exports.enableResponse = void 0;
     async function enableResponse(responseId) {
         try {
-            await (0, Backend_1.prepareRequest)(`${window.WSC_API_URL}index.php?api/rpc/core/comments/responses/${responseId}/enable`)
-                .post()
-                .fetchAsJson();
+            await (0, Backend_1.prepareRequest)(`${window.WSC_RPC_API_URL}core/comments/responses/${responseId}/enable`).post().fetchAsJson();
         }
         catch (e) {
             return (0, Result_1.apiResultFromError)(e);
index 7f85c4a77f1fb08a9a0f0f4470e129d46f827965..a1cac77fd1fc06daf7092e697c08b30dc8512ed3 100644 (file)
@@ -11,7 +11,7 @@ define(["require", "exports", "WoltLabSuite/Core/Ajax/Backend", "../../Result"],
     Object.defineProperty(exports, "__esModule", { value: true });
     exports.renderResponse = void 0;
     async function renderResponse(responseId, messageOnly = false, objectTypeId = undefined) {
-        const url = new URL(`${window.WSC_API_URL}index.php?api/rpc/core/comments/responses/${responseId}/render`);
+        const url = new URL(`${window.WSC_RPC_API_URL}core/comments/responses/${responseId}/render`);
         url.searchParams.set("messageOnly", messageOnly.toString());
         if (objectTypeId !== undefined) {
             url.searchParams.set("objectTypeID", objectTypeId.toString());
index 4ffc9909a39a986671ce63e8f2b7c093e476c25f..bec7071b574b3f3d64811a25c3525921af2313f7 100644 (file)
@@ -11,7 +11,7 @@ define(["require", "exports", "WoltLabSuite/Core/Ajax/Backend", "../../Result"],
     Object.defineProperty(exports, "__esModule", { value: true });
     exports.renderResponses = void 0;
     async function renderResponses(commentId, lastResponseTime, lastResponseId, loadAllResponses) {
-        const url = new URL(`${window.WSC_API_URL}index.php?api/rpc/core/comments/responses/render`);
+        const url = new URL(`${window.WSC_RPC_API_URL}core/comments/responses/render`);
         url.searchParams.set("commentID", commentId.toString());
         url.searchParams.set("lastResponseTime", lastResponseTime.toString());
         url.searchParams.set("lastResponseID", lastResponseId.toString());
index cd19546d69b36012e3689da94be21e9c0385ac20..6e4cdb4d3ff17b4d1ab6871c7f890037e441d42e 100644 (file)
@@ -13,7 +13,7 @@ define(["require", "exports", "WoltLabSuite/Core/Ajax/Backend", "../../Result"],
     exports.updateResponse = void 0;
     async function updateResponse(responseId, message) {
         try {
-            await (0, Backend_1.prepareRequest)(`${window.WSC_API_URL}index.php?api/rpc/core/comments/responses/${responseId}`)
+            await (0, Backend_1.prepareRequest)(`${window.WSC_RPC_API_URL}core/comments/responses/${responseId}`)
                 .post({
                 message,
             })
index 883348facca019b66e5bcae131d155adbd09efb8..4b62ba57a70042df4ea568d7d092637c11cbabe2 100644 (file)
@@ -13,7 +13,7 @@ define(["require", "exports", "WoltLabSuite/Core/Ajax/Backend", "../Result"], fu
     exports.updateComment = void 0;
     async function updateComment(commentId, message) {
         try {
-            await (0, Backend_1.prepareRequest)(`${window.WSC_API_URL}index.php?api/rpc/core/comments/${commentId}`)
+            await (0, Backend_1.prepareRequest)(`${window.WSC_RPC_API_URL}core/comments/${commentId}`)
                 .post({
                 message,
             })
index 26d78260afef6a9ddf4da8f714be55a6217c125b..4bfe43c2193221fb416c50e3793052727ba5422b 100644 (file)
@@ -3,7 +3,7 @@ define(["require", "exports", "WoltLabSuite/Core/Ajax/Backend", "../../Result"],
     Object.defineProperty(exports, "__esModule", { value: true });
     exports.uploadChunk = void 0;
     async function uploadChunk(identifier, sequenceNo, checksum, payload) {
-        const url = new URL(`${window.WSC_API_URL}index.php?api/rpc/core/files/upload/${identifier}/chunk/${sequenceNo}`);
+        const url = new URL(`${window.WSC_RPC_API_URL}core/files/upload/${identifier}/chunk/${sequenceNo}`);
         let response;
         try {
             response = (await (0, Backend_1.prepareRequest)(url)
index 6d6c419df76148356779e15f9c8498e5f6cbfba9..5ef380759cc5eb3a9df23ce5dcf755be2d2a8f16 100644 (file)
@@ -4,7 +4,7 @@ define(["require", "exports", "WoltLabSuite/Core/Ajax/Backend", "../Result"], fu
     exports.deleteFile = void 0;
     async function deleteFile(fileId) {
         try {
-            await (0, Backend_1.prepareRequest)(`${window.WSC_API_URL}index.php?api/rpc/core/files/${fileId}`).delete().fetchAsJson();
+            await (0, Backend_1.prepareRequest)(`${window.WSC_RPC_API_URL}core/files/${fileId}`).delete().fetchAsJson();
         }
         catch (e) {
             return (0, Result_1.apiResultFromError)(e);
index 8332a8dc7e4230b93afd9f48718dd33ed0850e9f..964c5086e0b7f80d6ee8de0d22b0e4bfc0fdf79c 100644 (file)
@@ -3,7 +3,7 @@ define(["require", "exports", "WoltLabSuite/Core/Ajax/Backend", "../Result"], fu
     Object.defineProperty(exports, "__esModule", { value: true });
     exports.generateThumbnails = void 0;
     async function generateThumbnails(fileID) {
-        const url = new URL(`${window.WSC_API_URL}index.php?api/rpc/core/files/${fileID}/generatethumbnails`);
+        const url = new URL(`${window.WSC_RPC_API_URL}core/files/${fileID}/generatethumbnails`);
         let response;
         try {
             response = (await (0, Backend_1.prepareRequest)(url).post().fetchAsJson());
index fb89cbbfbf09a12a70beacae56701de61d02ea47..ab89d8a687fe5a96d80cb57e28243d6452a999f3 100644 (file)
@@ -3,7 +3,7 @@ define(["require", "exports", "WoltLabSuite/Core/Ajax/Backend", "../Result"], fu
     Object.defineProperty(exports, "__esModule", { value: true });
     exports.upload = void 0;
     async function upload(filename, fileSize, fileHash, objectType, context) {
-        const url = new URL(`${window.WSC_API_URL}index.php?api/rpc/core/files/upload`);
+        const url = new URL(`${window.WSC_RPC_API_URL}core/files/upload`);
         const payload = {
             filename,
             fileSize,
index 0d6eb9c2c810a6c7acf4d80d60820d8e91175a11..aac867763e5304aade766b0eea877e08ab967d63 100644 (file)
@@ -12,7 +12,7 @@ define(["require", "exports", "WoltLabSuite/Core/Ajax/Backend", "../Result"], fu
     Object.defineProperty(exports, "__esModule", { value: true });
     exports.mentionSuggestions = void 0;
     async function mentionSuggestions(query) {
-        const url = new URL(window.WSC_API_URL + "index.php?api/rpc/core/messages/mentionsuggestions");
+        const url = new URL(window.WSC_API_URL + "core/messages/mentionsuggestions");
         url.searchParams.set("query", query);
         let response;
         try {
index b3e953f8367c878748af788a72c80c676808c7bf..60d54bfce5205652b7b8ab3a75c0ad5d0baadd72 100644 (file)
@@ -14,7 +14,7 @@ define(["require", "exports", "WoltLabSuite/Core/Ajax/Backend", "../Result"], fu
     exports.deleteSession = void 0;
     async function deleteSession(sessionId) {
         try {
-            await (0, Backend_1.prepareRequest)(`${window.WSC_API_URL}index.php?api/rpc/core/sessions/${sessionId}`).delete().fetchAsJson();
+            await (0, Backend_1.prepareRequest)(`${window.WSC_RPC_API_URL}core/sessions/${sessionId}`).delete().fetchAsJson();
         }
         catch (e) {
             return (0, Result_1.apiResultFromError)(e);