digitaltwin-core 0.9.1 → 0.10.0
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.
- package/dist/auth/user_service.d.ts.map +1 -1
- package/dist/auth/user_service.js +0 -5
- package/dist/auth/user_service.js.map +1 -1
- package/dist/components/assets_manager.d.ts +123 -1
- package/dist/components/assets_manager.d.ts.map +1 -1
- package/dist/components/assets_manager.js +475 -687
- package/dist/components/assets_manager.js.map +1 -1
- package/dist/engine/digital_twin_engine.d.ts.map +1 -1
- package/dist/engine/digital_twin_engine.js +2 -13
- package/dist/engine/digital_twin_engine.js.map +1 -1
- package/dist/engine/initializer.js +5 -11
- package/dist/engine/initializer.js.map +1 -1
- package/dist/engine/scheduler.d.ts.map +1 -1
- package/dist/engine/scheduler.js +10 -14
- package/dist/engine/scheduler.js.map +1 -1
- package/dist/index.d.ts +2 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1 -0
- package/dist/index.js.map +1 -1
- package/dist/utils/http_responses.d.ts +155 -0
- package/dist/utils/http_responses.d.ts.map +1 -0
- package/dist/utils/http_responses.js +190 -0
- package/dist/utils/http_responses.js.map +1 -0
- package/dist/utils/index.d.ts +2 -0
- package/dist/utils/index.d.ts.map +1 -1
- package/dist/utils/index.js +1 -0
- package/dist/utils/index.js.map +1 -1
- package/package.json +2 -3
|
@@ -0,0 +1,155 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @fileoverview HTTP response utilities for consistent API responses
|
|
3
|
+
*
|
|
4
|
+
* This module provides helper functions to create standardized DataResponse objects,
|
|
5
|
+
* reducing boilerplate code in component handlers and ensuring consistent API responses.
|
|
6
|
+
*/
|
|
7
|
+
import type { DataResponse } from '../components/types.js';
|
|
8
|
+
/**
|
|
9
|
+
* HTTP status codes commonly used in the Digital Twin framework.
|
|
10
|
+
*/
|
|
11
|
+
export declare const HttpStatus: {
|
|
12
|
+
readonly OK: 200;
|
|
13
|
+
readonly CREATED: 201;
|
|
14
|
+
readonly MULTI_STATUS: 207;
|
|
15
|
+
readonly BAD_REQUEST: 400;
|
|
16
|
+
readonly UNAUTHORIZED: 401;
|
|
17
|
+
readonly FORBIDDEN: 403;
|
|
18
|
+
readonly NOT_FOUND: 404;
|
|
19
|
+
readonly INTERNAL_SERVER_ERROR: 500;
|
|
20
|
+
};
|
|
21
|
+
export type HttpStatusCode = (typeof HttpStatus)[keyof typeof HttpStatus];
|
|
22
|
+
/**
|
|
23
|
+
* Creates a JSON response with the specified status and data.
|
|
24
|
+
*
|
|
25
|
+
* @param status - HTTP status code
|
|
26
|
+
* @param data - Data to serialize as JSON
|
|
27
|
+
* @returns DataResponse with JSON content type
|
|
28
|
+
*
|
|
29
|
+
* @example
|
|
30
|
+
* ```typescript
|
|
31
|
+
* return jsonResponse(200, { message: 'Success' })
|
|
32
|
+
* return jsonResponse(400, { error: 'Invalid input' })
|
|
33
|
+
* ```
|
|
34
|
+
*/
|
|
35
|
+
export declare function jsonResponse(status: number, data: object): DataResponse;
|
|
36
|
+
/**
|
|
37
|
+
* Creates a successful JSON response (HTTP 200).
|
|
38
|
+
*
|
|
39
|
+
* @param data - Data to serialize as JSON
|
|
40
|
+
* @returns DataResponse with status 200
|
|
41
|
+
*
|
|
42
|
+
* @example
|
|
43
|
+
* ```typescript
|
|
44
|
+
* return successResponse({ message: 'Asset uploaded successfully' })
|
|
45
|
+
* ```
|
|
46
|
+
*/
|
|
47
|
+
export declare function successResponse(data: object): DataResponse;
|
|
48
|
+
/**
|
|
49
|
+
* Creates an error response from an Error object or string.
|
|
50
|
+
*
|
|
51
|
+
* @param error - Error object or error message string
|
|
52
|
+
* @param status - HTTP status code (default: 500)
|
|
53
|
+
* @returns DataResponse with error message
|
|
54
|
+
*
|
|
55
|
+
* @example
|
|
56
|
+
* ```typescript
|
|
57
|
+
* return errorResponse(new Error('Something went wrong'))
|
|
58
|
+
* return errorResponse('Invalid input', 400)
|
|
59
|
+
* ```
|
|
60
|
+
*/
|
|
61
|
+
export declare function errorResponse(error: unknown, status?: number): DataResponse;
|
|
62
|
+
/**
|
|
63
|
+
* Creates a 400 Bad Request response.
|
|
64
|
+
*
|
|
65
|
+
* @param message - Error message describing what's wrong with the request
|
|
66
|
+
* @returns DataResponse with status 400
|
|
67
|
+
*
|
|
68
|
+
* @example
|
|
69
|
+
* ```typescript
|
|
70
|
+
* return badRequestResponse('Missing required fields: description, source')
|
|
71
|
+
* ```
|
|
72
|
+
*/
|
|
73
|
+
export declare function badRequestResponse(message: string): DataResponse;
|
|
74
|
+
/**
|
|
75
|
+
* Creates a 401 Unauthorized response.
|
|
76
|
+
*
|
|
77
|
+
* @param message - Error message (default: 'Authentication required')
|
|
78
|
+
* @returns DataResponse with status 401
|
|
79
|
+
*
|
|
80
|
+
* @example
|
|
81
|
+
* ```typescript
|
|
82
|
+
* return unauthorizedResponse()
|
|
83
|
+
* return unauthorizedResponse('Invalid authentication headers')
|
|
84
|
+
* ```
|
|
85
|
+
*/
|
|
86
|
+
export declare function unauthorizedResponse(message?: string): DataResponse;
|
|
87
|
+
/**
|
|
88
|
+
* Creates a 403 Forbidden response.
|
|
89
|
+
*
|
|
90
|
+
* @param message - Error message describing why access is denied
|
|
91
|
+
* @returns DataResponse with status 403
|
|
92
|
+
*
|
|
93
|
+
* @example
|
|
94
|
+
* ```typescript
|
|
95
|
+
* return forbiddenResponse('You can only modify your own assets')
|
|
96
|
+
* ```
|
|
97
|
+
*/
|
|
98
|
+
export declare function forbiddenResponse(message: string): DataResponse;
|
|
99
|
+
/**
|
|
100
|
+
* Creates a 404 Not Found response.
|
|
101
|
+
*
|
|
102
|
+
* @param message - Error message (default: 'Resource not found')
|
|
103
|
+
* @returns DataResponse with status 404
|
|
104
|
+
*
|
|
105
|
+
* @example
|
|
106
|
+
* ```typescript
|
|
107
|
+
* return notFoundResponse('Asset not found')
|
|
108
|
+
* ```
|
|
109
|
+
*/
|
|
110
|
+
export declare function notFoundResponse(message?: string): DataResponse;
|
|
111
|
+
/**
|
|
112
|
+
* Creates a plain text response.
|
|
113
|
+
*
|
|
114
|
+
* @param status - HTTP status code
|
|
115
|
+
* @param content - Text content
|
|
116
|
+
* @returns DataResponse with text/plain content type
|
|
117
|
+
*
|
|
118
|
+
* @example
|
|
119
|
+
* ```typescript
|
|
120
|
+
* return textResponse(404, 'Asset not found')
|
|
121
|
+
* ```
|
|
122
|
+
*/
|
|
123
|
+
export declare function textResponse(status: number, content: string): DataResponse;
|
|
124
|
+
/**
|
|
125
|
+
* Creates a binary/file response.
|
|
126
|
+
*
|
|
127
|
+
* @param content - File content as Buffer
|
|
128
|
+
* @param contentType - MIME type of the file
|
|
129
|
+
* @param filename - Optional filename for Content-Disposition header (triggers download)
|
|
130
|
+
* @returns DataResponse with appropriate content type
|
|
131
|
+
*
|
|
132
|
+
* @example
|
|
133
|
+
* ```typescript
|
|
134
|
+
* // For display/use in browser
|
|
135
|
+
* return fileResponse(buffer, 'model/gltf-binary')
|
|
136
|
+
*
|
|
137
|
+
* // For download
|
|
138
|
+
* return fileResponse(buffer, 'model/gltf-binary', 'model.glb')
|
|
139
|
+
* ```
|
|
140
|
+
*/
|
|
141
|
+
export declare function fileResponse(content: Buffer, contentType: string, filename?: string): DataResponse;
|
|
142
|
+
/**
|
|
143
|
+
* Creates a 207 Multi-Status response for batch operations.
|
|
144
|
+
*
|
|
145
|
+
* @param message - Summary message
|
|
146
|
+
* @param results - Array of individual operation results
|
|
147
|
+
* @returns DataResponse with status 207
|
|
148
|
+
*
|
|
149
|
+
* @example
|
|
150
|
+
* ```typescript
|
|
151
|
+
* return multiStatusResponse('3/5 assets uploaded successfully', results)
|
|
152
|
+
* ```
|
|
153
|
+
*/
|
|
154
|
+
export declare function multiStatusResponse(message: string, results: unknown[]): DataResponse;
|
|
155
|
+
//# sourceMappingURL=http_responses.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"http_responses.d.ts","sourceRoot":"","sources":["../../src/utils/http_responses.ts"],"names":[],"mappings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EAAE,GAAG,YAAY,CAErF"}
|
|
@@ -0,0 +1,190 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @fileoverview HTTP response utilities for consistent API responses
|
|
3
|
+
*
|
|
4
|
+
* This module provides helper functions to create standardized DataResponse objects,
|
|
5
|
+
* reducing boilerplate code in component handlers and ensuring consistent API responses.
|
|
6
|
+
*/
|
|
7
|
+
/**
|
|
8
|
+
* HTTP status codes commonly used in the Digital Twin framework.
|
|
9
|
+
*/
|
|
10
|
+
export const HttpStatus = {
|
|
11
|
+
OK: 200,
|
|
12
|
+
CREATED: 201,
|
|
13
|
+
MULTI_STATUS: 207,
|
|
14
|
+
BAD_REQUEST: 400,
|
|
15
|
+
UNAUTHORIZED: 401,
|
|
16
|
+
FORBIDDEN: 403,
|
|
17
|
+
NOT_FOUND: 404,
|
|
18
|
+
INTERNAL_SERVER_ERROR: 500
|
|
19
|
+
};
|
|
20
|
+
/**
|
|
21
|
+
* Creates a JSON response with the specified status and data.
|
|
22
|
+
*
|
|
23
|
+
* @param status - HTTP status code
|
|
24
|
+
* @param data - Data to serialize as JSON
|
|
25
|
+
* @returns DataResponse with JSON content type
|
|
26
|
+
*
|
|
27
|
+
* @example
|
|
28
|
+
* ```typescript
|
|
29
|
+
* return jsonResponse(200, { message: 'Success' })
|
|
30
|
+
* return jsonResponse(400, { error: 'Invalid input' })
|
|
31
|
+
* ```
|
|
32
|
+
*/
|
|
33
|
+
export function jsonResponse(status, data) {
|
|
34
|
+
return {
|
|
35
|
+
status,
|
|
36
|
+
content: JSON.stringify(data),
|
|
37
|
+
headers: { 'Content-Type': 'application/json' }
|
|
38
|
+
};
|
|
39
|
+
}
|
|
40
|
+
/**
|
|
41
|
+
* Creates a successful JSON response (HTTP 200).
|
|
42
|
+
*
|
|
43
|
+
* @param data - Data to serialize as JSON
|
|
44
|
+
* @returns DataResponse with status 200
|
|
45
|
+
*
|
|
46
|
+
* @example
|
|
47
|
+
* ```typescript
|
|
48
|
+
* return successResponse({ message: 'Asset uploaded successfully' })
|
|
49
|
+
* ```
|
|
50
|
+
*/
|
|
51
|
+
export function successResponse(data) {
|
|
52
|
+
return jsonResponse(HttpStatus.OK, data);
|
|
53
|
+
}
|
|
54
|
+
/**
|
|
55
|
+
* Creates an error response from an Error object or string.
|
|
56
|
+
*
|
|
57
|
+
* @param error - Error object or error message string
|
|
58
|
+
* @param status - HTTP status code (default: 500)
|
|
59
|
+
* @returns DataResponse with error message
|
|
60
|
+
*
|
|
61
|
+
* @example
|
|
62
|
+
* ```typescript
|
|
63
|
+
* return errorResponse(new Error('Something went wrong'))
|
|
64
|
+
* return errorResponse('Invalid input', 400)
|
|
65
|
+
* ```
|
|
66
|
+
*/
|
|
67
|
+
export function errorResponse(error, status = HttpStatus.INTERNAL_SERVER_ERROR) {
|
|
68
|
+
const message = error instanceof Error ? error.message : String(error);
|
|
69
|
+
return jsonResponse(status, { error: message });
|
|
70
|
+
}
|
|
71
|
+
/**
|
|
72
|
+
* Creates a 400 Bad Request response.
|
|
73
|
+
*
|
|
74
|
+
* @param message - Error message describing what's wrong with the request
|
|
75
|
+
* @returns DataResponse with status 400
|
|
76
|
+
*
|
|
77
|
+
* @example
|
|
78
|
+
* ```typescript
|
|
79
|
+
* return badRequestResponse('Missing required fields: description, source')
|
|
80
|
+
* ```
|
|
81
|
+
*/
|
|
82
|
+
export function badRequestResponse(message) {
|
|
83
|
+
return jsonResponse(HttpStatus.BAD_REQUEST, { error: message });
|
|
84
|
+
}
|
|
85
|
+
/**
|
|
86
|
+
* Creates a 401 Unauthorized response.
|
|
87
|
+
*
|
|
88
|
+
* @param message - Error message (default: 'Authentication required')
|
|
89
|
+
* @returns DataResponse with status 401
|
|
90
|
+
*
|
|
91
|
+
* @example
|
|
92
|
+
* ```typescript
|
|
93
|
+
* return unauthorizedResponse()
|
|
94
|
+
* return unauthorizedResponse('Invalid authentication headers')
|
|
95
|
+
* ```
|
|
96
|
+
*/
|
|
97
|
+
export function unauthorizedResponse(message = 'Authentication required') {
|
|
98
|
+
return jsonResponse(HttpStatus.UNAUTHORIZED, { error: message });
|
|
99
|
+
}
|
|
100
|
+
/**
|
|
101
|
+
* Creates a 403 Forbidden response.
|
|
102
|
+
*
|
|
103
|
+
* @param message - Error message describing why access is denied
|
|
104
|
+
* @returns DataResponse with status 403
|
|
105
|
+
*
|
|
106
|
+
* @example
|
|
107
|
+
* ```typescript
|
|
108
|
+
* return forbiddenResponse('You can only modify your own assets')
|
|
109
|
+
* ```
|
|
110
|
+
*/
|
|
111
|
+
export function forbiddenResponse(message) {
|
|
112
|
+
return jsonResponse(HttpStatus.FORBIDDEN, { error: message });
|
|
113
|
+
}
|
|
114
|
+
/**
|
|
115
|
+
* Creates a 404 Not Found response.
|
|
116
|
+
*
|
|
117
|
+
* @param message - Error message (default: 'Resource not found')
|
|
118
|
+
* @returns DataResponse with status 404
|
|
119
|
+
*
|
|
120
|
+
* @example
|
|
121
|
+
* ```typescript
|
|
122
|
+
* return notFoundResponse('Asset not found')
|
|
123
|
+
* ```
|
|
124
|
+
*/
|
|
125
|
+
export function notFoundResponse(message = 'Resource not found') {
|
|
126
|
+
return jsonResponse(HttpStatus.NOT_FOUND, { error: message });
|
|
127
|
+
}
|
|
128
|
+
/**
|
|
129
|
+
* Creates a plain text response.
|
|
130
|
+
*
|
|
131
|
+
* @param status - HTTP status code
|
|
132
|
+
* @param content - Text content
|
|
133
|
+
* @returns DataResponse with text/plain content type
|
|
134
|
+
*
|
|
135
|
+
* @example
|
|
136
|
+
* ```typescript
|
|
137
|
+
* return textResponse(404, 'Asset not found')
|
|
138
|
+
* ```
|
|
139
|
+
*/
|
|
140
|
+
export function textResponse(status, content) {
|
|
141
|
+
return {
|
|
142
|
+
status,
|
|
143
|
+
content,
|
|
144
|
+
headers: { 'Content-Type': 'text/plain' }
|
|
145
|
+
};
|
|
146
|
+
}
|
|
147
|
+
/**
|
|
148
|
+
* Creates a binary/file response.
|
|
149
|
+
*
|
|
150
|
+
* @param content - File content as Buffer
|
|
151
|
+
* @param contentType - MIME type of the file
|
|
152
|
+
* @param filename - Optional filename for Content-Disposition header (triggers download)
|
|
153
|
+
* @returns DataResponse with appropriate content type
|
|
154
|
+
*
|
|
155
|
+
* @example
|
|
156
|
+
* ```typescript
|
|
157
|
+
* // For display/use in browser
|
|
158
|
+
* return fileResponse(buffer, 'model/gltf-binary')
|
|
159
|
+
*
|
|
160
|
+
* // For download
|
|
161
|
+
* return fileResponse(buffer, 'model/gltf-binary', 'model.glb')
|
|
162
|
+
* ```
|
|
163
|
+
*/
|
|
164
|
+
export function fileResponse(content, contentType, filename) {
|
|
165
|
+
const headers = { 'Content-Type': contentType };
|
|
166
|
+
if (filename) {
|
|
167
|
+
headers['Content-Disposition'] = `attachment; filename="${filename}"`;
|
|
168
|
+
}
|
|
169
|
+
return {
|
|
170
|
+
status: HttpStatus.OK,
|
|
171
|
+
content,
|
|
172
|
+
headers
|
|
173
|
+
};
|
|
174
|
+
}
|
|
175
|
+
/**
|
|
176
|
+
* Creates a 207 Multi-Status response for batch operations.
|
|
177
|
+
*
|
|
178
|
+
* @param message - Summary message
|
|
179
|
+
* @param results - Array of individual operation results
|
|
180
|
+
* @returns DataResponse with status 207
|
|
181
|
+
*
|
|
182
|
+
* @example
|
|
183
|
+
* ```typescript
|
|
184
|
+
* return multiStatusResponse('3/5 assets uploaded successfully', results)
|
|
185
|
+
* ```
|
|
186
|
+
*/
|
|
187
|
+
export function multiStatusResponse(message, results) {
|
|
188
|
+
return jsonResponse(HttpStatus.MULTI_STATUS, { message, results });
|
|
189
|
+
}
|
|
190
|
+
//# sourceMappingURL=http_responses.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"http_responses.js","sourceRoot":"","sources":["../../src/utils/http_responses.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAIH;;GAEG;AACH,MAAM,CAAC,MAAM,UAAU,GAAG;IACtB,EAAE,EAAE,GAAG;IACP,OAAO,EAAE,GAAG;IACZ,YAAY,EAAE,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,CAAC,SAAS,EAAE,EAAE,KAAK,EAAE,OAAO,EAAE,CAAC,CAAA;AACjE,CAAC;AAED;;;;;;;;;;GAUG;AACH,MAAM,UAAU,gBAAgB,CAAC,UAAkB,oBAAoB;IACnE,OAAO,YAAY,CAAC,UAAU,CAAC,SAAS,EAAE,EAAE,KAAK,EAAE,OAAO,EAAE,CAAC,CAAA;AACjE,CAAC;AAED;;;;;;;;;;;GAWG;AACH,MAAM,UAAU,YAAY,CAAC,MAAc,EAAE,OAAe;IACxD,OAAO;QACH,MAAM;QACN,OAAO;QACP,OAAO,EAAE,EAAE,cAAc,EAAE,YAAY,EAAE;KAC5C,CAAA;AACL,CAAC;AAED;;;;;;;;;;;;;;;;GAgBG;AACH,MAAM,UAAU,YAAY,CAAC,OAAe,EAAE,WAAmB,EAAE,QAAiB;IAChF,MAAM,OAAO,GAA2B,EAAE,cAAc,EAAE,WAAW,EAAE,CAAA;IAEvE,IAAI,QAAQ,EAAE,CAAC;QACX,OAAO,CAAC,qBAAqB,CAAC,GAAG,yBAAyB,QAAQ,GAAG,CAAA;IACzE,CAAC;IAED,OAAO;QACH,MAAM,EAAE,UAAU,CAAC,EAAE;QACrB,OAAO;QACP,OAAO;KACV,CAAA;AACL,CAAC;AAED;;;;;;;;;;;GAWG;AACH,MAAM,UAAU,mBAAmB,CAAC,OAAe,EAAE,OAAkB;IACnE,OAAO,YAAY,CAAC,UAAU,CAAC,YAAY,EAAE,EAAE,OAAO,EAAE,OAAO,EAAE,CAAC,CAAA;AACtE,CAAC"}
|
package/dist/utils/index.d.ts
CHANGED
|
@@ -2,4 +2,6 @@ export { Logger, LogLevel } from './logger.js';
|
|
|
2
2
|
export { mapToDataRecord } from './map_to_data_record.js';
|
|
3
3
|
export { servableEndpoint } from './servable_endpoint.js';
|
|
4
4
|
export { extractZipContentStream, zipToDict, analyzeTilesetContent } from './zip_utils.js';
|
|
5
|
+
export { HttpStatus, jsonResponse, successResponse, errorResponse, badRequestResponse, unauthorizedResponse, forbiddenResponse, notFoundResponse, textResponse, fileResponse, multiStatusResponse } from './http_responses.js';
|
|
6
|
+
export type { HttpStatusCode } from './http_responses.js';
|
|
5
7
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/utils/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAA;AAC9C,OAAO,EAAE,eAAe,EAAE,MAAM,yBAAyB,CAAA;AACzD,OAAO,EAAE,gBAAgB,EAAE,MAAM,wBAAwB,CAAA;AACzD,OAAO,EAAE,uBAAuB,EAAE,SAAS,EAAE,qBAAqB,EAAE,MAAM,gBAAgB,CAAA"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/utils/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAA;AAC9C,OAAO,EAAE,eAAe,EAAE,MAAM,yBAAyB,CAAA;AACzD,OAAO,EAAE,gBAAgB,EAAE,MAAM,wBAAwB,CAAA;AACzD,OAAO,EAAE,uBAAuB,EAAE,SAAS,EAAE,qBAAqB,EAAE,MAAM,gBAAgB,CAAA;AAC1F,OAAO,EACH,UAAU,EACV,YAAY,EACZ,eAAe,EACf,aAAa,EACb,kBAAkB,EAClB,oBAAoB,EACpB,iBAAiB,EACjB,gBAAgB,EAChB,YAAY,EACZ,YAAY,EACZ,mBAAmB,EACtB,MAAM,qBAAqB,CAAA;AAC5B,YAAY,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAA"}
|
package/dist/utils/index.js
CHANGED
|
@@ -2,4 +2,5 @@ export { Logger, LogLevel } from './logger.js';
|
|
|
2
2
|
export { mapToDataRecord } from './map_to_data_record.js';
|
|
3
3
|
export { servableEndpoint } from './servable_endpoint.js';
|
|
4
4
|
export { extractZipContentStream, zipToDict, analyzeTilesetContent } from './zip_utils.js';
|
|
5
|
+
export { HttpStatus, jsonResponse, successResponse, errorResponse, badRequestResponse, unauthorizedResponse, forbiddenResponse, notFoundResponse, textResponse, fileResponse, multiStatusResponse } from './http_responses.js';
|
|
5
6
|
//# sourceMappingURL=index.js.map
|
package/dist/utils/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/utils/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAA;AAC9C,OAAO,EAAE,eAAe,EAAE,MAAM,yBAAyB,CAAA;AACzD,OAAO,EAAE,gBAAgB,EAAE,MAAM,wBAAwB,CAAA;AACzD,OAAO,EAAE,uBAAuB,EAAE,SAAS,EAAE,qBAAqB,EAAE,MAAM,gBAAgB,CAAA"}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/utils/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAA;AAC9C,OAAO,EAAE,eAAe,EAAE,MAAM,yBAAyB,CAAA;AACzD,OAAO,EAAE,gBAAgB,EAAE,MAAM,wBAAwB,CAAA;AACzD,OAAO,EAAE,uBAAuB,EAAE,SAAS,EAAE,qBAAqB,EAAE,MAAM,gBAAgB,CAAA;AAC1F,OAAO,EACH,UAAU,EACV,YAAY,EACZ,eAAe,EACf,aAAa,EACb,kBAAkB,EAClB,oBAAoB,EACpB,iBAAiB,EACjB,gBAAgB,EAChB,YAAY,EACZ,YAAY,EACZ,mBAAmB,EACtB,MAAM,qBAAqB,CAAA"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "digitaltwin-core",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.10.0",
|
|
4
4
|
"description": "Minimalist framework to collect and handle data in a Digital Twin project",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"author": "Axel Hoffmann",
|
|
@@ -22,7 +22,7 @@
|
|
|
22
22
|
"build": "tsc",
|
|
23
23
|
"dev": "tsc --watch",
|
|
24
24
|
"clean": "rimraf dist",
|
|
25
|
-
"test": "node --import ts-node-maintained/register/esm --enable-source-maps bin/test.ts",
|
|
25
|
+
"test": "node -r ./bin/set-test-env.cjs --import ts-node-maintained/register/esm --enable-source-maps bin/test.ts",
|
|
26
26
|
"lint": "eslint src/**/*.ts",
|
|
27
27
|
"lint:fix": "eslint src/**/*.ts --fix",
|
|
28
28
|
"format": "prettier --write \"src/**/*.ts\"",
|
|
@@ -97,7 +97,6 @@
|
|
|
97
97
|
"bullmq": "^5.56.5",
|
|
98
98
|
"cors": "^2.8.5",
|
|
99
99
|
"ioredis": "^5.6.1",
|
|
100
|
-
"japa": "^4.0.0",
|
|
101
100
|
"jszip": "^3.10.1",
|
|
102
101
|
"lodash": "^4.17.21",
|
|
103
102
|
"multer": "^2.0.2",
|