js editor + fix js runner
This commit is contained in:
@@ -295,6 +295,19 @@ paths:
|
|||||||
description: New activities fetched and stored
|
description: New activities fetched and stored
|
||||||
"400":
|
"400":
|
||||||
description: No character with this id
|
description: No character with this id
|
||||||
|
/rule-books/script-definitions:
|
||||||
|
get:
|
||||||
|
tags:
|
||||||
|
- rule-book
|
||||||
|
summary: Download the TypeScript definitions for the rule script runtime
|
||||||
|
operationId: getScriptDefinitions
|
||||||
|
responses:
|
||||||
|
"200":
|
||||||
|
description: The rule-runner.d.ts type definitions
|
||||||
|
content:
|
||||||
|
text/plain:
|
||||||
|
schema:
|
||||||
|
type: string
|
||||||
/ledgers:
|
/ledgers:
|
||||||
get:
|
get:
|
||||||
tags:
|
tags:
|
||||||
|
|||||||
@@ -1377,6 +1377,36 @@ export const RuleBookApiAxiosParamCreator = function (configuration?: Configurat
|
|||||||
options: localVarRequestOptions,
|
options: localVarRequestOptions,
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* @summary Download the TypeScript definitions for the rule script runtime
|
||||||
|
* @param {*} [options] Override http request option.
|
||||||
|
* @throws {RequiredError}
|
||||||
|
*/
|
||||||
|
getScriptDefinitions: async (options: RawAxiosRequestConfig = {}): Promise<RequestArgs> => {
|
||||||
|
const localVarPath = `/rule-books/script-definitions`;
|
||||||
|
// use dummy base URL string because the URL constructor only accepts absolute URLs.
|
||||||
|
const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
|
||||||
|
let baseOptions;
|
||||||
|
if (configuration) {
|
||||||
|
baseOptions = configuration.baseOptions;
|
||||||
|
}
|
||||||
|
|
||||||
|
const localVarRequestOptions = { method: 'GET', ...baseOptions, ...options};
|
||||||
|
const localVarHeaderParameter = {} as any;
|
||||||
|
const localVarQueryParameter = {} as any;
|
||||||
|
|
||||||
|
localVarHeaderParameter['Accept'] = 'text/plain';
|
||||||
|
|
||||||
|
setSearchParams(localVarUrlObj, localVarQueryParameter);
|
||||||
|
let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
|
||||||
|
localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers};
|
||||||
|
|
||||||
|
return {
|
||||||
|
url: toPathString(localVarUrlObj),
|
||||||
|
options: localVarRequestOptions,
|
||||||
|
};
|
||||||
|
},
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
* @summary Update a rule book
|
* @summary Update a rule book
|
||||||
@@ -1463,6 +1493,18 @@ export const RuleBookApiFp = function(configuration?: Configuration) {
|
|||||||
const localVarOperationServerBasePath = operationServerMap['RuleBookApi.findRuleBookById']?.[localVarOperationServerIndex]?.url;
|
const localVarOperationServerBasePath = operationServerMap['RuleBookApi.findRuleBookById']?.[localVarOperationServerIndex]?.url;
|
||||||
return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath);
|
return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath);
|
||||||
},
|
},
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* @summary Download the TypeScript definitions for the rule script runtime
|
||||||
|
* @param {*} [options] Override http request option.
|
||||||
|
* @throws {RequiredError}
|
||||||
|
*/
|
||||||
|
async getScriptDefinitions(options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<string>> {
|
||||||
|
const localVarAxiosArgs = await localVarAxiosParamCreator.getScriptDefinitions(options);
|
||||||
|
const localVarOperationServerIndex = configuration?.serverIndex ?? 0;
|
||||||
|
const localVarOperationServerBasePath = operationServerMap['RuleBookApi.getScriptDefinitions']?.[localVarOperationServerIndex]?.url;
|
||||||
|
return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath);
|
||||||
|
},
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
* @summary Update a rule book
|
* @summary Update a rule book
|
||||||
@@ -1515,6 +1557,15 @@ export const RuleBookApiFactory = function (configuration?: Configuration, baseP
|
|||||||
findRuleBookById(ruleBookId: string, options?: RawAxiosRequestConfig): AxiosPromise<RuleBookResponse> {
|
findRuleBookById(ruleBookId: string, options?: RawAxiosRequestConfig): AxiosPromise<RuleBookResponse> {
|
||||||
return localVarFp.findRuleBookById(ruleBookId, options).then((request) => request(axios, basePath));
|
return localVarFp.findRuleBookById(ruleBookId, options).then((request) => request(axios, basePath));
|
||||||
},
|
},
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* @summary Download the TypeScript definitions for the rule script runtime
|
||||||
|
* @param {*} [options] Override http request option.
|
||||||
|
* @throws {RequiredError}
|
||||||
|
*/
|
||||||
|
getScriptDefinitions(options?: RawAxiosRequestConfig): AxiosPromise<string> {
|
||||||
|
return localVarFp.getScriptDefinitions(options).then((request) => request(axios, basePath));
|
||||||
|
},
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
* @summary Update a rule book
|
* @summary Update a rule book
|
||||||
@@ -1565,6 +1616,16 @@ export class RuleBookApi extends BaseAPI {
|
|||||||
return RuleBookApiFp(this.configuration).findRuleBookById(ruleBookId, options).then((request) => request(this.axios, this.basePath));
|
return RuleBookApiFp(this.configuration).findRuleBookById(ruleBookId, options).then((request) => request(this.axios, this.basePath));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* @summary Download the TypeScript definitions for the rule script runtime
|
||||||
|
* @param {*} [options] Override http request option.
|
||||||
|
* @throws {RequiredError}
|
||||||
|
*/
|
||||||
|
public getScriptDefinitions(options?: RawAxiosRequestConfig) {
|
||||||
|
return RuleBookApiFp(this.configuration).getScriptDefinitions(options).then((request) => request(this.axios, this.basePath));
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
* @summary Update a rule book
|
* @summary Update a rule book
|
||||||
|
|||||||
@@ -23,12 +23,6 @@ const mammonAxiosInstance = axios.create({
|
|||||||
})
|
})
|
||||||
logResource(mammonAxiosInstance)
|
logResource(mammonAxiosInstance)
|
||||||
|
|
||||||
export const fetchScriptDefinitions = (): Promise<string> =>
|
|
||||||
mammonAxiosInstance.get<string>('rule-books/script-definitions', {
|
|
||||||
responseType: 'text',
|
|
||||||
headers: {Accept: 'text/plain'},
|
|
||||||
}).then(response => response.data);
|
|
||||||
|
|
||||||
export const ledgerApi = new LedgerApi(undefined, mammonUrl, mammonAxiosInstance);
|
export const ledgerApi = new LedgerApi(undefined, mammonUrl, mammonAxiosInstance);
|
||||||
export const transactionApi = new TransactionApi(undefined, mammonUrl, mammonAxiosInstance);
|
export const transactionApi = new TransactionApi(undefined, mammonUrl, mammonAxiosInstance);
|
||||||
export const characterApi = new CharacterApi(undefined, mammonUrl, mammonAxiosInstance);
|
export const characterApi = new CharacterApi(undefined, mammonUrl, mammonAxiosInstance);
|
||||||
|
|||||||
@@ -3,7 +3,7 @@ import * as monaco from 'monaco-editor';
|
|||||||
import editorWorker from 'monaco-editor/esm/vs/editor/editor.worker?worker';
|
import editorWorker from 'monaco-editor/esm/vs/editor/editor.worker?worker';
|
||||||
import tsWorker from 'monaco-editor/esm/vs/language/typescript/ts.worker?worker';
|
import tsWorker from 'monaco-editor/esm/vs/language/typescript/ts.worker?worker';
|
||||||
import {onBeforeUnmount, onMounted, ref, watch} from 'vue';
|
import {onBeforeUnmount, onMounted, ref, watch} from 'vue';
|
||||||
import {fetchScriptDefinitions} from '@/mammon';
|
import {fetchScriptDefinitions} from './rules';
|
||||||
|
|
||||||
(self as unknown as { MonacoEnvironment: { getWorker(workerId: string, label: string): Worker } }).MonacoEnvironment = {
|
(self as unknown as { MonacoEnvironment: { getWorker(workerId: string, label: string): Worker } }).MonacoEnvironment = {
|
||||||
getWorker(_workerId: string, label: string) {
|
getWorker(_workerId: string, label: string) {
|
||||||
|
|||||||
@@ -46,3 +46,6 @@ export const findCharacterRuleBookByCharacterId = (characterId: number): Promise
|
|||||||
|
|
||||||
export const setCharacterRuleBookForCharacter = (characterId: number, ruleBook: SetCharacterRuleBookRequest): Promise<CharacterRuleBookResponse> => characterRuleBookApi.setCharacterRuleBookForCharacter(characterId, ruleBook)
|
export const setCharacterRuleBookForCharacter = (characterId: number, ruleBook: SetCharacterRuleBookRequest): Promise<CharacterRuleBookResponse> => characterRuleBookApi.setCharacterRuleBookForCharacter(characterId, ruleBook)
|
||||||
.then(response => response.data);
|
.then(response => response.data);
|
||||||
|
|
||||||
|
export const fetchScriptDefinitions = (): Promise<string> =>
|
||||||
|
ruleBookApi.getScriptDefinitions({responseType: 'text'}).then(response => response.data);
|
||||||
Reference in New Issue
Block a user