<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};
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,
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);
}
};
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 {
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);
}
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());
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());
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,
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);
}
};
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 {
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);
}
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());
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());
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,
})
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,
})
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 {
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);
}
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 {
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,
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;
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);
}
TIME_NOW: number;
WCF_PATH: string;
WSC_API_URL: string;
+ WSC_RPC_API_URL: string;
getFontAwesome6Metadata: () => Map<string, IconMetadata>;
getFontAwesome6IconMetadata: (name: string) => IconMetadata | undefined;
<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};
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,
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);
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());
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);
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());
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());
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,
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);
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());
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);
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());
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());
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,
})
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,
})
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)
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);
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());
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,
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 {
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);