Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
Object.defineProperty(exports, "__esModule", { value: true });
var quick_start_1 = require("./quick-start");
exports.Aurelia = quick_start_1.Aurelia;
exports.default = quick_start_1.Aurelia;
var debug_1 = require("@aurelia/debug");
exports.DebugConfiguration = debug_1.DebugConfiguration;
exports.TraceConfiguration = debug_1.TraceConfiguration;
var fetch_client_1 = require("@aurelia/fetch-client");
// RetryConfiguration,
// RetryableRequest,
// ValidInterceptorMethodName,
exports.json = fetch_client_1.json;
// retryStrategy,
// RetryInterceptor,
exports.HttpClientConfiguration = fetch_client_1.HttpClientConfiguration;
exports.HttpClient = fetch_client_1.HttpClient;
var jit_1 = require("@aurelia/jit");
// AttrSyntax,
// IAttributeParser,
exports.attributePattern = jit_1.attributePattern;
// AttributePatternDefinition,
exports.IAttributePattern = jit_1.IAttributePattern;
// IAttributePatternHandler,
// Interpretation,
// ISyntaxInterpreter,
// AtPrefixedTriggerAttributePattern,
// ColonPrefixedBindAttributePattern,
// DotSeparatedAttributePattern,
// RefAttributePattern,
exports.bindingCommand = jit_1.bindingCommand;
// BindingCommandDefinition,
// BindingCommandKind,
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
var quick_start_1 = require("./quick-start");
exports.Aurelia = quick_start_1.Aurelia;
exports.default = quick_start_1.Aurelia;
var debug_1 = require("@aurelia/debug");
exports.DebugConfiguration = debug_1.DebugConfiguration;
exports.TraceConfiguration = debug_1.TraceConfiguration;
var fetch_client_1 = require("@aurelia/fetch-client");
// RetryConfiguration,
// RetryableRequest,
// ValidInterceptorMethodName,
exports.json = fetch_client_1.json;
// retryStrategy,
// RetryInterceptor,
exports.HttpClientConfiguration = fetch_client_1.HttpClientConfiguration;
exports.HttpClient = fetch_client_1.HttpClient;
var jit_1 = require("@aurelia/jit");
// AttrSyntax,
// IAttributeParser,
exports.attributePattern = jit_1.attributePattern;
// AttributePatternDefinition,
exports.IAttributePattern = jit_1.IAttributePattern;
// IAttributePatternHandler,
// Interpretation,
// ISyntaxInterpreter,
// AtPrefixedTriggerAttributePattern,
// ColonPrefixedBindAttributePattern,
// DotSeparatedAttributePattern,
// RefAttributePattern,
exports.bindingCommand = jit_1.bindingCommand;
// BindingCommandDefinition,
public async post(path: string, body = {}) {
const options = {
body: json(body),
headers: this.setHeaders(),
method: 'POST',
};
try {
const response = await this.http.fetch(`${config.apiUrl}${path}`, options);
return await status(response);
} catch (error) {
try {
return await parseError(error);
} catch {
return undefined;
}
}
}
public async put(path: string, body = {}) {
const options = {
body: json(body),
headers: this.setHeaders(),
method: 'PUT',
};
try {
const response = await this.http.fetch(`${config.apiUrl}${path}`, options);
return await status(response);
} catch (error) {
try {
return await parseError(error);
} catch {
return undefined;
}
}
}