@reor/tripper-api-client 0.0.1 → 0.0.2

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.
@@ -1,2 +1,2 @@
1
- export { createLocation, get, getLocationsWithinBoundingBox, type Options } from './sdk.gen';
2
- export type { ClientOptions, CreateLocationData, CreateLocationError, CreateLocationErrors, CreateLocationRequest, CreateLocationResponse, CreateLocationResponses, GetData, GetLocationsWithinBoundingBoxData, GetLocationsWithinBoundingBoxError, GetLocationsWithinBoundingBoxErrors, GetLocationsWithinBoundingBoxResponse, GetLocationsWithinBoundingBoxResponses, GetResponse, GetResponses, JsonElement, LocationResponse, ProblemDetails } from './types.gen';
1
+ export { createLocation, createLocationType, deleteLocationType, get, getLocationsWithinBoundingBox, getLocationTypeById, getLocationTypes, type Options, updateLocationTypeIcon, updateLocationTypeName } from './sdk.gen';
2
+ export type { ClientOptions, CreateLocationData, CreateLocationError, CreateLocationErrors, CreateLocationRequest, CreateLocationResponse, CreateLocationResponses, CreateLocationTypeData, CreateLocationTypeError, CreateLocationTypeErrors, CreateLocationTypeRequest, CreateLocationTypeResponse, CreateLocationTypeResponses, DeleteLocationTypeData, DeleteLocationTypeError, DeleteLocationTypeErrors, DeleteLocationTypeResponse, DeleteLocationTypeResponses, GetData, GetLocationsWithinBoundingBoxData, GetLocationsWithinBoundingBoxError, GetLocationsWithinBoundingBoxErrors, GetLocationsWithinBoundingBoxResponse, GetLocationsWithinBoundingBoxResponses, GetLocationTypeByIdData, GetLocationTypeByIdErrors, GetLocationTypeByIdResponse, GetLocationTypeByIdResponses, GetLocationTypesData, GetLocationTypesErrors, GetLocationTypesResponse, GetLocationTypesResponses, GetResponse, GetResponses, JsonElement, LocationResponse, LocationTypeResponse, LocationTypeSummaryResponse, ProblemDetails, UpdateLocationTypeIconData, UpdateLocationTypeIconError, UpdateLocationTypeIconErrors, UpdateLocationTypeIconRequest, UpdateLocationTypeIconResponse, UpdateLocationTypeIconResponses, UpdateLocationTypeNameData, UpdateLocationTypeNameError, UpdateLocationTypeNameErrors, UpdateLocationTypeNameRequest, UpdateLocationTypeNameResponse, UpdateLocationTypeNameResponses } from './types.gen';
@@ -1,8 +1,14 @@
1
1
  "use strict";
2
2
  // This file is auto-generated by @hey-api/openapi-ts
3
3
  Object.defineProperty(exports, "__esModule", { value: true });
4
- exports.getLocationsWithinBoundingBox = exports.get = exports.createLocation = void 0;
4
+ exports.updateLocationTypeName = exports.updateLocationTypeIcon = exports.getLocationTypes = exports.getLocationTypeById = exports.getLocationsWithinBoundingBox = exports.get = exports.deleteLocationType = exports.createLocationType = exports.createLocation = void 0;
5
5
  var sdk_gen_1 = require("./sdk.gen");
6
6
  Object.defineProperty(exports, "createLocation", { enumerable: true, get: function () { return sdk_gen_1.createLocation; } });
7
+ Object.defineProperty(exports, "createLocationType", { enumerable: true, get: function () { return sdk_gen_1.createLocationType; } });
8
+ Object.defineProperty(exports, "deleteLocationType", { enumerable: true, get: function () { return sdk_gen_1.deleteLocationType; } });
7
9
  Object.defineProperty(exports, "get", { enumerable: true, get: function () { return sdk_gen_1.get; } });
8
10
  Object.defineProperty(exports, "getLocationsWithinBoundingBox", { enumerable: true, get: function () { return sdk_gen_1.getLocationsWithinBoundingBox; } });
11
+ Object.defineProperty(exports, "getLocationTypeById", { enumerable: true, get: function () { return sdk_gen_1.getLocationTypeById; } });
12
+ Object.defineProperty(exports, "getLocationTypes", { enumerable: true, get: function () { return sdk_gen_1.getLocationTypes; } });
13
+ Object.defineProperty(exports, "updateLocationTypeIcon", { enumerable: true, get: function () { return sdk_gen_1.updateLocationTypeIcon; } });
14
+ Object.defineProperty(exports, "updateLocationTypeName", { enumerable: true, get: function () { return sdk_gen_1.updateLocationTypeName; } });
@@ -1,5 +1,5 @@
1
1
  import type { Client, Options as Options2, TDataShape } from './client';
2
- import type { CreateLocationData, CreateLocationErrors, CreateLocationResponses, GetData, GetLocationsWithinBoundingBoxData, GetLocationsWithinBoundingBoxErrors, GetLocationsWithinBoundingBoxResponses, GetResponses } from './types.gen';
2
+ import type { CreateLocationData, CreateLocationErrors, CreateLocationResponses, CreateLocationTypeData, CreateLocationTypeErrors, CreateLocationTypeResponses, DeleteLocationTypeData, DeleteLocationTypeErrors, DeleteLocationTypeResponses, GetData, GetLocationsWithinBoundingBoxData, GetLocationsWithinBoundingBoxErrors, GetLocationsWithinBoundingBoxResponses, GetLocationTypeByIdData, GetLocationTypeByIdErrors, GetLocationTypeByIdResponses, GetLocationTypesData, GetLocationTypesErrors, GetLocationTypesResponses, GetResponses, UpdateLocationTypeIconData, UpdateLocationTypeIconErrors, UpdateLocationTypeIconResponses, UpdateLocationTypeNameData, UpdateLocationTypeNameErrors, UpdateLocationTypeNameResponses } from './types.gen';
3
3
  export type Options<TData extends TDataShape = TDataShape, ThrowOnError extends boolean = boolean, TResponse = unknown> = Options2<TData, ThrowOnError, TResponse> & {
4
4
  /**
5
5
  * You can provide a client instance returned by `createClient()` instead of
@@ -26,3 +26,39 @@ export declare const getLocationsWithinBoundingBox: <ThrowOnError extends boolea
26
26
  * Creates a location owned by the authenticated user from a GeoJSON geometry.
27
27
  */
28
28
  export declare const createLocation: <ThrowOnError extends boolean = false>(options: Options<CreateLocationData, ThrowOnError>) => import("./client").RequestResult<CreateLocationResponses, CreateLocationErrors, ThrowOnError, "fields">;
29
+ /**
30
+ * Get all location types
31
+ *
32
+ * Returns the id and name of every location type.
33
+ */
34
+ export declare const getLocationTypes: <ThrowOnError extends boolean = false>(options?: Options<GetLocationTypesData, ThrowOnError>) => import("./client").RequestResult<GetLocationTypesResponses, GetLocationTypesErrors, ThrowOnError, "fields">;
35
+ /**
36
+ * Create a location type
37
+ *
38
+ * Creates a location type with a name and an icon identifier (e.g. "house" or "boat").
39
+ */
40
+ export declare const createLocationType: <ThrowOnError extends boolean = false>(options: Options<CreateLocationTypeData, ThrowOnError>) => import("./client").RequestResult<CreateLocationTypeResponses, CreateLocationTypeErrors, ThrowOnError, "fields">;
41
+ /**
42
+ * Delete a location type
43
+ *
44
+ * Deletes the specified location type.
45
+ */
46
+ export declare const deleteLocationType: <ThrowOnError extends boolean = false>(options: Options<DeleteLocationTypeData, ThrowOnError>) => import("./client").RequestResult<DeleteLocationTypeResponses, DeleteLocationTypeErrors, ThrowOnError, "fields">;
47
+ /**
48
+ * Get a location type
49
+ *
50
+ * Returns all details of the specified location type.
51
+ */
52
+ export declare const getLocationTypeById: <ThrowOnError extends boolean = false>(options: Options<GetLocationTypeByIdData, ThrowOnError>) => import("./client").RequestResult<GetLocationTypeByIdResponses, GetLocationTypeByIdErrors, ThrowOnError, "fields">;
53
+ /**
54
+ * Change the name of a location type
55
+ *
56
+ * Changes the name of the specified location type.
57
+ */
58
+ export declare const updateLocationTypeName: <ThrowOnError extends boolean = false>(options: Options<UpdateLocationTypeNameData, ThrowOnError>) => import("./client").RequestResult<UpdateLocationTypeNameResponses, UpdateLocationTypeNameErrors, ThrowOnError, "fields">;
59
+ /**
60
+ * Change the icon of a location type
61
+ *
62
+ * Changes the icon identifier (e.g. "house" or "boat") of the specified location type.
63
+ */
64
+ export declare const updateLocationTypeIcon: <ThrowOnError extends boolean = false>(options: Options<UpdateLocationTypeIconData, ThrowOnError>) => import("./client").RequestResult<UpdateLocationTypeIconResponses, UpdateLocationTypeIconErrors, ThrowOnError, "fields">;
@@ -1,7 +1,7 @@
1
1
  "use strict";
2
2
  // This file is auto-generated by @hey-api/openapi-ts
3
3
  Object.defineProperty(exports, "__esModule", { value: true });
4
- exports.createLocation = exports.getLocationsWithinBoundingBox = exports.get = void 0;
4
+ exports.updateLocationTypeIcon = exports.updateLocationTypeName = exports.getLocationTypeById = exports.deleteLocationType = exports.createLocationType = exports.getLocationTypes = exports.createLocation = exports.getLocationsWithinBoundingBox = exports.get = void 0;
5
5
  const client_gen_1 = require("./client.gen");
6
6
  const get = (options) => (options?.client ?? client_gen_1.client).get({
7
7
  security: [{ scheme: 'bearer', type: 'http' }],
@@ -35,3 +35,81 @@ const createLocation = (options) => (options.client ?? client_gen_1.client).post
35
35
  }
36
36
  });
37
37
  exports.createLocation = createLocation;
38
+ /**
39
+ * Get all location types
40
+ *
41
+ * Returns the id and name of every location type.
42
+ */
43
+ const getLocationTypes = (options) => (options?.client ?? client_gen_1.client).get({
44
+ security: [{ scheme: 'bearer', type: 'http' }],
45
+ url: '/location-type',
46
+ ...options
47
+ });
48
+ exports.getLocationTypes = getLocationTypes;
49
+ /**
50
+ * Create a location type
51
+ *
52
+ * Creates a location type with a name and an icon identifier (e.g. "house" or "boat").
53
+ */
54
+ const createLocationType = (options) => (options.client ?? client_gen_1.client).post({
55
+ security: [{ scheme: 'bearer', type: 'http' }],
56
+ url: '/location-type',
57
+ ...options,
58
+ headers: {
59
+ 'Content-Type': 'application/json',
60
+ ...options.headers
61
+ }
62
+ });
63
+ exports.createLocationType = createLocationType;
64
+ /**
65
+ * Delete a location type
66
+ *
67
+ * Deletes the specified location type.
68
+ */
69
+ const deleteLocationType = (options) => (options.client ?? client_gen_1.client).delete({
70
+ security: [{ scheme: 'bearer', type: 'http' }],
71
+ url: '/location-type/{id}',
72
+ ...options
73
+ });
74
+ exports.deleteLocationType = deleteLocationType;
75
+ /**
76
+ * Get a location type
77
+ *
78
+ * Returns all details of the specified location type.
79
+ */
80
+ const getLocationTypeById = (options) => (options.client ?? client_gen_1.client).get({
81
+ security: [{ scheme: 'bearer', type: 'http' }],
82
+ url: '/location-type/{id}',
83
+ ...options
84
+ });
85
+ exports.getLocationTypeById = getLocationTypeById;
86
+ /**
87
+ * Change the name of a location type
88
+ *
89
+ * Changes the name of the specified location type.
90
+ */
91
+ const updateLocationTypeName = (options) => (options.client ?? client_gen_1.client).patch({
92
+ security: [{ scheme: 'bearer', type: 'http' }],
93
+ url: '/location-type/{id}/name',
94
+ ...options,
95
+ headers: {
96
+ 'Content-Type': 'application/json',
97
+ ...options.headers
98
+ }
99
+ });
100
+ exports.updateLocationTypeName = updateLocationTypeName;
101
+ /**
102
+ * Change the icon of a location type
103
+ *
104
+ * Changes the icon identifier (e.g. "house" or "boat") of the specified location type.
105
+ */
106
+ const updateLocationTypeIcon = (options) => (options.client ?? client_gen_1.client).patch({
107
+ security: [{ scheme: 'bearer', type: 'http' }],
108
+ url: '/location-type/{id}/icon',
109
+ ...options,
110
+ headers: {
111
+ 'Content-Type': 'application/json',
112
+ ...options.headers
113
+ }
114
+ });
115
+ exports.updateLocationTypeIcon = updateLocationTypeIcon;
@@ -6,6 +6,10 @@ export type CreateLocationRequest = {
6
6
  geometry: JsonElement;
7
7
  parentLocationId?: null | string;
8
8
  };
9
+ export type CreateLocationTypeRequest = {
10
+ name: string;
11
+ icon: string;
12
+ };
9
13
  export type JsonElement = unknown;
10
14
  export type LocationResponse = {
11
15
  id: string;
@@ -15,6 +19,18 @@ export type LocationResponse = {
15
19
  createdAt: string;
16
20
  updatedAt: string;
17
21
  };
22
+ export type LocationTypeResponse = {
23
+ id: string;
24
+ name: string;
25
+ icon: string;
26
+ createdAt: string;
27
+ updatedAt: string;
28
+ };
29
+ export type LocationTypeSummaryResponse = {
30
+ id: string;
31
+ name: string;
32
+ icon: string;
33
+ };
18
34
  export type ProblemDetails = {
19
35
  type?: null | string;
20
36
  title?: null | string;
@@ -22,6 +38,12 @@ export type ProblemDetails = {
22
38
  detail?: null | string;
23
39
  instance?: null | string;
24
40
  };
41
+ export type UpdateLocationTypeIconRequest = {
42
+ icon: string;
43
+ };
44
+ export type UpdateLocationTypeNameRequest = {
45
+ name: string;
46
+ };
25
47
  export type GetData = {
26
48
  body?: never;
27
49
  path?: never;
@@ -92,3 +114,173 @@ export type CreateLocationResponses = {
92
114
  201: LocationResponse;
93
115
  };
94
116
  export type CreateLocationResponse = CreateLocationResponses[keyof CreateLocationResponses];
117
+ export type GetLocationTypesData = {
118
+ body?: never;
119
+ path?: never;
120
+ query?: never;
121
+ url: '/location-type';
122
+ };
123
+ export type GetLocationTypesErrors = {
124
+ /**
125
+ * Unauthorized
126
+ */
127
+ 401: unknown;
128
+ };
129
+ export type GetLocationTypesResponses = {
130
+ /**
131
+ * OK
132
+ */
133
+ 200: Array<LocationTypeSummaryResponse>;
134
+ };
135
+ export type GetLocationTypesResponse = GetLocationTypesResponses[keyof GetLocationTypesResponses];
136
+ export type CreateLocationTypeData = {
137
+ body: CreateLocationTypeRequest;
138
+ path?: never;
139
+ query?: never;
140
+ url: '/location-type';
141
+ };
142
+ export type CreateLocationTypeErrors = {
143
+ /**
144
+ * Bad Request
145
+ */
146
+ 400: ProblemDetails;
147
+ /**
148
+ * Unauthorized
149
+ */
150
+ 401: unknown;
151
+ /**
152
+ * Service Unavailable
153
+ */
154
+ 503: ProblemDetails;
155
+ };
156
+ export type CreateLocationTypeError = CreateLocationTypeErrors[keyof CreateLocationTypeErrors];
157
+ export type CreateLocationTypeResponses = {
158
+ /**
159
+ * Created
160
+ */
161
+ 201: LocationTypeResponse;
162
+ };
163
+ export type CreateLocationTypeResponse = CreateLocationTypeResponses[keyof CreateLocationTypeResponses];
164
+ export type DeleteLocationTypeData = {
165
+ body?: never;
166
+ path: {
167
+ id: string;
168
+ };
169
+ query?: never;
170
+ url: '/location-type/{id}';
171
+ };
172
+ export type DeleteLocationTypeErrors = {
173
+ /**
174
+ * Unauthorized
175
+ */
176
+ 401: unknown;
177
+ /**
178
+ * Not Found
179
+ */
180
+ 404: unknown;
181
+ /**
182
+ * Service Unavailable
183
+ */
184
+ 503: ProblemDetails;
185
+ };
186
+ export type DeleteLocationTypeError = DeleteLocationTypeErrors[keyof DeleteLocationTypeErrors];
187
+ export type DeleteLocationTypeResponses = {
188
+ /**
189
+ * No Content
190
+ */
191
+ 204: void;
192
+ };
193
+ export type DeleteLocationTypeResponse = DeleteLocationTypeResponses[keyof DeleteLocationTypeResponses];
194
+ export type GetLocationTypeByIdData = {
195
+ body?: never;
196
+ path: {
197
+ id: string;
198
+ };
199
+ query?: never;
200
+ url: '/location-type/{id}';
201
+ };
202
+ export type GetLocationTypeByIdErrors = {
203
+ /**
204
+ * Unauthorized
205
+ */
206
+ 401: unknown;
207
+ /**
208
+ * Not Found
209
+ */
210
+ 404: unknown;
211
+ };
212
+ export type GetLocationTypeByIdResponses = {
213
+ /**
214
+ * OK
215
+ */
216
+ 200: LocationTypeResponse;
217
+ };
218
+ export type GetLocationTypeByIdResponse = GetLocationTypeByIdResponses[keyof GetLocationTypeByIdResponses];
219
+ export type UpdateLocationTypeNameData = {
220
+ body: UpdateLocationTypeNameRequest;
221
+ path: {
222
+ id: string;
223
+ };
224
+ query?: never;
225
+ url: '/location-type/{id}/name';
226
+ };
227
+ export type UpdateLocationTypeNameErrors = {
228
+ /**
229
+ * Bad Request
230
+ */
231
+ 400: ProblemDetails;
232
+ /**
233
+ * Unauthorized
234
+ */
235
+ 401: unknown;
236
+ /**
237
+ * Not Found
238
+ */
239
+ 404: unknown;
240
+ /**
241
+ * Service Unavailable
242
+ */
243
+ 503: ProblemDetails;
244
+ };
245
+ export type UpdateLocationTypeNameError = UpdateLocationTypeNameErrors[keyof UpdateLocationTypeNameErrors];
246
+ export type UpdateLocationTypeNameResponses = {
247
+ /**
248
+ * OK
249
+ */
250
+ 200: LocationTypeResponse;
251
+ };
252
+ export type UpdateLocationTypeNameResponse = UpdateLocationTypeNameResponses[keyof UpdateLocationTypeNameResponses];
253
+ export type UpdateLocationTypeIconData = {
254
+ body: UpdateLocationTypeIconRequest;
255
+ path: {
256
+ id: string;
257
+ };
258
+ query?: never;
259
+ url: '/location-type/{id}/icon';
260
+ };
261
+ export type UpdateLocationTypeIconErrors = {
262
+ /**
263
+ * Bad Request
264
+ */
265
+ 400: ProblemDetails;
266
+ /**
267
+ * Unauthorized
268
+ */
269
+ 401: unknown;
270
+ /**
271
+ * Not Found
272
+ */
273
+ 404: unknown;
274
+ /**
275
+ * Service Unavailable
276
+ */
277
+ 503: ProblemDetails;
278
+ };
279
+ export type UpdateLocationTypeIconError = UpdateLocationTypeIconErrors[keyof UpdateLocationTypeIconErrors];
280
+ export type UpdateLocationTypeIconResponses = {
281
+ /**
282
+ * OK
283
+ */
284
+ 200: LocationTypeResponse;
285
+ };
286
+ export type UpdateLocationTypeIconResponse = UpdateLocationTypeIconResponses[keyof UpdateLocationTypeIconResponses];
package/package.json CHANGED
@@ -1,7 +1,11 @@
1
1
  {
2
2
  "name": "@reor/tripper-api-client",
3
- "version": "0.0.1",
3
+ "version": "0.0.2",
4
4
  "description": "Generated TypeScript client for the Tripper API",
5
+ "repository": {
6
+ "type": "git",
7
+ "url": "https://github.com/reorsoftware/Reor.Software.Tripper"
8
+ },
5
9
  "main": "dist/index.js",
6
10
  "types": "dist/index.d.ts",
7
11
  "files": [