@tstdl/base 0.92.126 → 0.92.128

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.
@@ -43,13 +43,13 @@ export function compileClient(definition, options = defaultOptions) {
43
43
  const url = this.getEndpointResource(endpoint, parameters);
44
44
  return new URL(url, this[httpClientSymbol].options.baseUrl);
45
45
  }
46
- }
46
+ },
47
47
  }[apiName];
48
48
  Injector.registerSingleton(api, {
49
49
  useFactory: (argument, context) => {
50
50
  const httpClient = (argument instanceof HttpClient) ? argument : context.resolve(HttpClient, argument ?? options.defaultHttpClientOptions ?? undefined);
51
51
  return new api(httpClient);
52
- }
52
+ },
53
53
  });
54
54
  const endpointsEntries = normalizedApiDefinitionEndpointsEntries(endpoints);
55
55
  for (const [name, endpoint] of endpointsEntries) {
@@ -74,17 +74,17 @@ export function compileClient(definition, options = defaultOptions) {
74
74
  parameters,
75
75
  body: getRequestBody(requestBody),
76
76
  credentials: (endpoint.credentials == true) ? 'include' : undefined,
77
- context
77
+ context,
78
78
  });
79
79
  const response = await this[httpClientSymbol].rawRequest(request);
80
80
  return getResponseBody(response, endpoint.result);
81
- }
81
+ },
82
82
  }[name];
83
83
  Object.defineProperty(api.prototype, name, {
84
84
  enumerable: true,
85
85
  configurable: true,
86
86
  writable: true,
87
- value: apiEndpointFunction
87
+ value: apiEndpointFunction,
88
88
  });
89
89
  }
90
90
  return api;
package/api/types.d.ts CHANGED
@@ -82,7 +82,7 @@ export type ApiDefinition<Resource extends string = string, Endpoints extends Ap
82
82
  prefix?: string | null;
83
83
  endpoints: Endpoints;
84
84
  };
85
- export type ApiEndpointKeys<T extends ApiDefinition> = keyof T['endpoints'];
85
+ export type ApiEndpointKeys<T extends ApiDefinition> = Extract<keyof T['endpoints'], string>;
86
86
  export type NormalizedApiEndpoints<T extends ApiDefinition['endpoints']> = {
87
87
  [P in keyof T]: ReturnTypeOrT<T[P]>;
88
88
  };
@@ -1,4 +1,4 @@
1
- import { DocumentCategory, type DocumentType } from '../models/index.js';
1
+ import { DocumentCategory, DocumentType } from '../models/index.js';
2
2
  export declare class DocumentCategoryView extends DocumentCategory {
3
3
  children: DocumentCategoryView[];
4
4
  types: DocumentType[];
@@ -1,5 +1,23 @@
1
- import { DocumentCategory } from '../models/index.js';
1
+ var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
2
+ var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
3
+ if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
4
+ else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
5
+ return c > 3 && r && Object.defineProperty(target, key, r), r;
6
+ };
7
+ var __metadata = (this && this.__metadata) || function (k, v) {
8
+ if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
9
+ };
10
+ import { Array } from '../../schema/index.js';
11
+ import { DocumentCategory, DocumentType } from '../models/index.js';
2
12
  export class DocumentCategoryView extends DocumentCategory {
3
13
  children;
4
14
  types;
5
15
  }
16
+ __decorate([
17
+ Array(DocumentCategoryView),
18
+ __metadata("design:type", Array)
19
+ ], DocumentCategoryView.prototype, "children", void 0);
20
+ __decorate([
21
+ Array(DocumentType),
22
+ __metadata("design:type", Array)
23
+ ], DocumentCategoryView.prototype, "types", void 0);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tstdl/base",
3
- "version": "0.92.126",
3
+ "version": "0.92.128",
4
4
  "author": "Patrick Hein",
5
5
  "publishConfig": {
6
6
  "access": "public"
@@ -75,10 +75,7 @@ export function Memoize() {
75
75
  cache.set(this, value);
76
76
  return value; // eslint-disable-line @typescript-eslint/no-unsafe-return
77
77
  }
78
- return {
79
- writable: false,
80
- get: cachedGetter,
81
- };
78
+ return { get: cachedGetter };
82
79
  },
83
80
  });
84
81
  }