@tstdl/base 0.90.80 → 0.90.81

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -54,11 +54,12 @@ export function compileClient(definition, options = defaultOptions) {
54
54
  const endpointsEntries = normalizedApiDefinitionEndpointsEntries(endpoints);
55
55
  for (const [name, endpoint] of endpointsEntries) {
56
56
  const methods = isArray(endpoint.method) ? endpoint.method : [endpoint.method ?? 'GET'];
57
- const resource = getFullApiEndpointResource({ api: definition, endpoint, defaultPrefix: options.prefix });
57
+ let resource;
58
58
  const hasGet = methods.includes('GET');
59
59
  const fallbackMethod = methods.find((method) => method != 'GET') ?? 'GET';
60
60
  const apiEndpointFunction = {
61
61
  async [name](parameters, requestBody) {
62
+ resource ??= getFullApiEndpointResource({ api: definition, endpoint, defaultPrefix: options.prefix });
62
63
  const context = { endpoint };
63
64
  const method = (hasGet && isUndefined(parameters)) ? 'GET' : fallbackMethod;
64
65
  if (endpoint.result == ServerSentEvents) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tstdl/base",
3
- "version": "0.90.80",
3
+ "version": "0.90.81",
4
4
  "author": "Patrick Hein",
5
5
  "publishConfig": {
6
6
  "access": "public"