@schafevormfenster/rest-commons 0.1.5 → 0.1.6

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.
Files changed (2) hide show
  1. package/.turbo/turbo-check.log +174 -0
  2. package/package.json +16 -16
@@ -0,0 +1,174 @@
1
+
2
+ 
3
+ > @schafevormfenster/rest-commons@0.1.6 check /Users/jan-henrik.hempel/Projects/commons/packages/rest-commons
4
+ > pnpm run typecheck && pnpm run lint && pnpm run test && pnpm run build
5
+
6
+
7
+ > @schafevormfenster/rest-commons@0.1.6 typecheck /Users/jan-henrik.hempel/Projects/commons/packages/rest-commons
8
+ > tsc --noEmit
9
+
10
+
11
+ > @schafevormfenster/rest-commons@0.1.6 lint /Users/jan-henrik.hempel/Projects/commons/packages/rest-commons
12
+ > eslint
13
+
14
+
15
+ > @schafevormfenster/rest-commons@0.1.6 test /Users/jan-henrik.hempel/Projects/commons/packages/rest-commons
16
+ > TZ=UTC vitest run
17
+
18
+ [?25l
19
+  RUN  v4.0.16 /Users/jan-henrik.hempel/Projects/commons/packages/rest-commons
20
+
21
+ [?2026h
22
+  ❯ src/helpers/correlation/get-header.test.ts [queued]
23
+
24
+  Test Files 0 passed (45)
25
+  Tests 0 passed (0)
26
+  Start at 12:47:15
27
+  Duration 102ms
28
+ [?2026l[?2026h ✓ src/helpers/correlation/get-header.test.ts (15 tests) 12ms
29
+ ✓ src/time/since-parameter.schema.test.ts (6 tests) 5ms
30
+ ✓ src/helpers/correlation/get-correlation-id.test.ts (11 tests) 15ms
31
+
32
+  ❯ src/helpers/correlation/get-correlation-id.test.ts 11/11
33
+  ❯ src/helpers/correlation/get-header.test.ts 15/15
34
+  ❯ src/normalization/normalize-list.test.ts [queued]
35
+  ❯ src/time/bounded-time.schema.test.ts [queued]
36
+  ❯ src/time/flexible-time-parser.test.ts [queued]
37
+  ❯ src/time/since-parameter.schema.test.ts 6/6
38
+  ❯ src/time/time-helpers.test.ts 0/42
39
+  ❯ src/time/time.schema.test.ts [queued]
40
+  ❯ src/time/timezone-independence.test.ts [queued]
41
+
42
+  Test Files 3 passed (45)
43
+  Tests 32 passed (74)
44
+  Start at 12:47:15
45
+  Duration 202ms
46
+ [?2026l[?2026h ✓ src/time/time-helpers.test.ts (42 tests) 6ms
47
+ ✓ src/time/bounded-time.schema.test.ts (33 tests) 11ms
48
+ ✓ src/time/flexible-time-parser.test.ts (63 tests) 19ms
49
+ ✓ src/time/time.schema.test.ts (26 tests) 18ms
50
+ ✓ src/time/timezone-independence.test.ts (13 tests) 14ms
51
+
52
+  ❯ src/normalization/normalize-list.test.ts [queued]
53
+  ❯ src/time/boundary-enforcement.test.ts [queued]
54
+  ❯ src/time/bounded-time.schema.test.ts 33/33
55
+  ❯ src/time/flexible-time-parser.test.ts 63/63
56
+  ❯ src/time/flexible-time.schema.test.ts [queued]
57
+  ❯ src/time/parse-relative-time.test.ts [queued]
58
+  ❯ src/time/time-schemas.test.ts [queued]
59
+  ❯ src/time/time.schema.test.ts 26/26
60
+  ❯ src/time/timezone-independence.test.ts 13/13
61
+
62
+  Test Files 8 passed (45)
63
+  Tests 209 passed (209)
64
+  Start at 12:47:15
65
+  Duration 302ms
66
+ [?2026l[?2026h ✓ src/time/iso8601.types.test.ts (17 tests) 3ms
67
+ ✓ src/time/time-schemas.test.ts (24 tests) 10ms
68
+ ✓ src/time/flexible-time.schema.test.ts (36 tests) 10ms
69
+ {"level":40,"time":1769518036107,"pid":42817,"hostname":"Jan--Schafe-vorm-Fenster.local","name":"helpers.time.boundary-enforcement","field":"testField","originalValue":"2024-01-01T12:00:00.000Z","clampedValue":"2024-01-08T12:00:00.000Z","boundary":"minimum (-1w)","msg":"Calendar update query testField clamped to minimum boundary"}
70
+ {"level":40,"time":1769518036108,"pid":42817,"hostname":"Jan--Schafe-vorm-Fenster.local","name":"helpers.time.boundary-enforcement","field":"testField","originalValue":"2020-01-01T12:00:00.000Z","clampedValue":"2024-01-08T12:00:00.000Z","boundary":"minimum (-1w)","msg":"Calendar update query testField clamped to minimum boundary"}
71
+ {"level":40,"time":1769518036108,"pid":42817,"hostname":"Jan--Schafe-vorm-Fenster.local","name":"helpers.time.boundary-enforcement","field":"testField","originalValue":"2025-02-15T12:00:00.000Z","clampedValue":"2025-01-15T12:00:00.000Z","boundary":"maximum (+12m)","msg":"Calendar update query testField clamped to maximum boundary"}
72
+ {"level":40,"time":1769518036108,"pid":42817,"hostname":"Jan--Schafe-vorm-Fenster.local","name":"helpers.time.boundary-enforcement","field":"testField","originalValue":"2030-01-01T12:00:00.000Z","clampedValue":"2025-01-15T12:00:00.000Z","boundary":"maximum (+12m)","msg":"Calendar update query testField clamped to maximum boundary"}
73
+ {"level":40,"time":1769518036109,"pid":42817,"hostname":"Jan--Schafe-vorm-Fenster.local","name":"helpers.time.boundary-enforcement","field":"testField","originalValue":"2024-01-10T12:00:00.000Z","clampedValue":"2026-01-20T12:47:16.108Z","boundary":"minimum (-1w)","msg":"Calendar update query testField clamped to minimum boundary"}
74
+ {"level":40,"time":1769518036109,"pid":42817,"hostname":"Jan--Schafe-vorm-Fenster.local","name":"helpers.time.boundary-enforcement","field":"customFieldName","originalValue":"2024-01-01T12:00:00.000Z","clampedValue":"2024-01-08T12:00:00.000Z","boundary":"minimum (-1w)","msg":"Calendar update query customFieldName clamped to minimum boundary"}
75
+ ✓ src/time/boundary-enforcement.test.ts (12 tests) 6ms
76
+ {"level":50,"time":1722007200000,"pid":42819,"hostname":"Jan--Schafe-vorm-Fenster.local","name":"rest.helpers.relative-time-parser","error":{"message":"{\"relativeTime\":\"invalid\",\"error\":\"Invalid relative time format: invalid\"}","name":"ObjectError"},"msg":"Invalid relative time format: invalid"}
77
+ {"level":50,"time":1722007200000,"pid":42819,"hostname":"Jan--Schafe-vorm-Fenster.local","name":"rest.helpers.relative-time-parser","error":{"message":"{\"relativeTime\":\"1x\",\"error\":\"Invalid relative time format: 1x\"}","name":"ObjectError"},"msg":"Invalid relative time format: 1x"}
78
+ {"level":50,"time":1722007200000,"pid":42819,"hostname":"Jan--Schafe-vorm-Fenster.local","name":"rest.helpers.relative-time-parser","error":{"message":"{\"relativeTime\":\"\",\"error\":\"Invalid relative time format: \"}","name":"ObjectError"},"msg":"Invalid relative time format: "}
79
+ ✓ src/time/parse-relative-time.test.ts (6 tests) 5ms
80
+ ✓ src/primitives/longitude.schema.test.ts (8 tests) 4ms
81
+ ✓ src/primitives/latitude.schema.test.ts (8 tests) 3ms
82
+ {"level":40,"time":1769518036133,"pid":42780,"hostname":"Jan--Schafe-vorm-Fenster.local","name":"security.sanitizeTag","original":" banana ","sanitized":"banana","reason":"tag-sanitized","msg":"Tag input sanitized"}
83
+ {"level":40,"time":1769518036144,"pid":42780,"hostname":"Jan--Schafe-vorm-Fenster.local","name":"security.sanitizeTag","original":" apple ","sanitized":"apple","reason":"tag-sanitized","msg":"Tag input sanitized"}
84
+ ✓ src/normalization/normalize-list.test.ts (4 tests) 13ms
85
+ ✓ src/primitives/uuid.schema.test.ts (5 tests) 3ms
86
+
87
+  ❯ src/api-schemas/health.schema.test.ts [queued]
88
+  ❯ src/normalization/normalize-list.test.ts 4/4
89
+  ❯ src/primitives/latitude.schema.test.ts 8/8
90
+  ❯ src/primitives/longitude.schema.test.ts 8/8
91
+  ❯ src/primitives/uuid.schema.test.ts 5/5
92
+  ❯ src/time/boundary-enforcement.test.ts 12/12
93
+  ❯ src/time/flexible-time.schema.test.ts 36/36
94
+  ❯ src/time/parse-relative-time.test.ts 6/6
95
+  ❯ src/time/time-schemas.test.ts 24/24
96
+
97
+  Test Files 17 passed (45)
98
+  Tests 329 passed (329)
99
+  Start at 12:47:15
100
+  Duration 402ms
101
+ [?2026l[?2026h ✓ src/primitives/geoname-id.schema.test.ts (7 tests) 3ms
102
+ ✓ src/api-schemas/result.schema.test.ts (2 tests) 3ms
103
+ ✓ src/api-schemas/health.schema.test.ts (7 tests) 3ms
104
+ ✓ src/helpers/eventify-constants.test.ts (5 tests) 2ms
105
+ ✓ src/primitives/international-zip.schema.test.ts (29 tests) 5ms
106
+ {"level":50,"time":1769518036260,"pid":42825,"hostname":"Jan--Schafe-vorm-Fenster.local","name":"rest.helpers.parameter-validation","error":{"message":"{\"parameterName\":\"location\",\"suspiciousPatterns\":[\"html.script_tag\"],\"error\":\"Parameter 'location' contains suspicious patterns\"}","name":"ObjectError"},"msg":"Parameter 'location' contains suspicious patterns: html.script_tag"}
107
+ ✓ src/primitives/location.schema.test.ts (3 tests) 5ms
108
+ {"level":50,"time":1769518036270,"pid":42823,"hostname":"Jan--Schafe-vorm-Fenster.local","name":"rest.helpers.parameter-validation","error":{"message":"{\"parameterName\":\"slug\",\"suspiciousPatterns\":[\"html.script_tag\"],\"error\":\"Parameter 'slug' contains suspicious patterns\"}","name":"ObjectError"},"msg":"Parameter 'slug' contains suspicious patterns: html.script_tag"}
109
+ ✓ src/primitives/slug.schema.test.ts (15 tests) 6ms
110
+ {"level":50,"time":1769518036275,"pid":42830,"hostname":"Jan--Schafe-vorm-Fenster.local","name":"rest.helpers.parameter-validation","error":{"message":"{\"parameterName\":\"location\",\"suspiciousPatterns\":[\"html.script_tag\"],\"error\":\"Parameter 'location' contains suspicious patterns\"}","name":"ObjectError"},"msg":"Parameter 'location' contains suspicious patterns: html.script_tag"}
111
+ {"level":50,"time":1769518036275,"pid":42830,"hostname":"Jan--Schafe-vorm-Fenster.local","name":"rest.helpers.parameter-validation","error":{"message":"{\"parameterName\":\"location\",\"suspiciousPatterns\":[\"sql.drop_table\"],\"error\":\"Parameter 'location' contains suspicious patterns\"}","name":"ObjectError"},"msg":"Parameter 'location' contains suspicious patterns: sql.drop_table"}
112
+ {"level":50,"time":1769518036275,"pid":42830,"hostname":"Jan--Schafe-vorm-Fenster.local","name":"rest.helpers.parameter-validation","error":{"message":"{\"parameterName\":\"slug\",\"suspiciousPatterns\":[\"url.embedded\"],\"error\":\"Parameter 'slug' contains suspicious patterns\"}","name":"ObjectError"},"msg":"Parameter 'slug' contains suspicious patterns: url.embedded"}
113
+ {"level":50,"time":1769518036275,"pid":42830,"hostname":"Jan--Schafe-vorm-Fenster.local","name":"rest.helpers.parameter-validation","error":{"message":"{\"parameterName\":\"id\",\"suspiciousPatterns\":[\"prompt.injection.language\"],\"error\":\"Parameter 'id' contains suspicious patterns\"}","name":"ObjectError"},"msg":"Parameter 'id' contains suspicious patterns: prompt.injection.language"}
114
+ ✓ src/helpers/parameter-validation.test.ts (5 tests) 4ms
115
+ ✓ src/api-schemas/results.schema.test.ts (1 test) 4ms
116
+
117
+  ❯ src/api-schemas/health.schema.test.ts 7/7
118
+  ❯ src/api-schemas/result.schema.test.ts 2/2
119
+  ❯ src/api-schemas/results.schema.test.ts 1/1
120
+  ❯ src/helpers/eventify-constants.test.ts 5/5
121
+  ❯ src/helpers/mime-types/detect-image-mime-type.test.ts [queued]
122
+  ❯ src/helpers/parameter-validation.test.ts 5/5
123
+  ❯ src/primitives/international-zip.schema.test.ts 29/29
124
+  ❯ src/primitives/location.schema.test.ts 3/3
125
+  ❯ src/primitives/slug.schema.test.ts 15/15
126
+
127
+  Test Files 26 passed (45)
128
+  Tests 403 passed (403)
129
+  Start at 12:47:15
130
+  Duration 602ms
131
+ [?2026l[?2026h ✓ src/primitives/coordinate-precision.test.ts (6 tests) 2ms
132
+ ✓ src/helpers/mime-types/detect-image-mime-type.test.ts (11 tests) 2ms
133
+ ✓ src/api-schemas/error.schema.test.ts (3 tests) 2ms
134
+ ✓ src/time/timezone.types.test.ts (4 tests) 4ms
135
+ ✓ src/primitives/geo-point.schema.test.ts (7 tests) 5ms
136
+ ✓ src/normalization/normalize-location.test.ts (13 tests) 4ms
137
+ ✓ src/api-schemas/okay.schema.test.ts (2 tests) 2ms
138
+ ✓ src/helpers/eventify-constants.types.test.ts (5 tests) 5ms
139
+ ✓ src/helpers/hash-binary.test.ts (7 tests) 4ms
140
+
141
+  ❯ src/api-schemas/error.schema.test.ts 3/3
142
+  ❯ src/api-schemas/okay.schema.test.ts 2/2
143
+  ❯ src/helpers/eventify-constants.types.test.ts 5/5
144
+  ❯ src/helpers/hash-binary.test.ts 7/7
145
+  ❯ src/helpers/mime-types/detect-image-mime-type.test.ts 11/11
146
+  ❯ src/normalization/normalize-location.test.ts 13/13
147
+  ❯ src/primitives/geo-point.schema.test.ts 7/7
148
+  ❯ src/primitives/wikidata-id.schema.test.ts [queued]
149
+  ❯ src/time/timezone.types.test.ts 4/4
150
+
151
+  Test Files 35 passed (45)
152
+  Tests 461 passed (461)
153
+  Start at 12:47:15
154
+  Duration 703ms
155
+ [?2026l ✓ src/helpers/detect-suspicious-patterns.test.ts (6 tests) 3ms
156
+ ✓ src/helpers/slugify.test.ts (13 tests) 4ms
157
+ ✓ src/primitives/wikidata-id.schema.test.ts (8 tests) 3ms
158
+ ✓ src/helpers/mime-types/detect-zip-mime-type.test.ts (9 tests) 1ms
159
+ ✓ src/helpers/mime-types/detect-pdf-mime-type.test.ts (6 tests) 1ms
160
+ ✓ src/primitives/numeric-id.schema.test.ts (5 tests) 2ms
161
+ ✓ src/helpers/mime-types/detect-ole-mime-type.test.ts (10 tests) 2ms
162
+ ✓ src/helpers/detect-mime-type.test.ts (12 tests) 2ms
163
+ ✓ src/time/relative-time.schema.test.ts (2 tests) 2ms
164
+ ✓ src/time/is-relative-time.test.ts (2 tests) 1ms
165
+
166
+  Test Files  45 passed (45)
167
+  Tests  534 passed (534)
168
+  Start at  12:47:15
169
+  Duration  821ms (transform 1.13s, setup 0ms, import 1.92s, tests 240ms, environment 3ms)
170
+
171
+ [?25h
172
+ > @schafevormfenster/rest-commons@0.1.6 build /Users/jan-henrik.hempel/Projects/commons/packages/rest-commons
173
+ > tsc
174
+
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@schafevormfenster/rest-commons",
3
- "version": "0.1.5",
3
+ "version": "0.1.6",
4
4
  "description": "Centralized authority for REST standards and schemas - XSD schemas, parsing functions, and coding instructions",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",
@@ -16,32 +16,32 @@
16
16
  "bin": {
17
17
  "setup-rest-commons": "./bin/setup.js"
18
18
  },
19
- "scripts": {
20
- "typecheck": "tsc --noEmit",
21
- "lint": "eslint",
22
- "test": "TZ=UTC vitest run",
23
- "test:watch": "TZ=UTC vitest",
24
- "build": "tsc",
25
- "check": "pnpm run typecheck && pnpm run lint && pnpm run test && pnpm run build",
26
- "release": "pnpm run build && bash -c 'cp ../../.npmrc .npmrc && npm publish --access public && rm .npmrc'"
27
- },
28
19
  "engines": {
29
20
  "node": ">=24"
30
21
  },
31
22
  "devDependencies": {
32
- "@schafevormfenster/eslint-config": "workspace:*",
33
23
  "@types/node": "^22.19.3",
34
24
  "@typescript-eslint/eslint-plugin": "^8.51.0",
35
25
  "@typescript-eslint/parser": "^8.51.0",
36
26
  "eslint": "^9.39.2",
37
27
  "typescript": "^5.9.3",
38
- "vitest": "^4.0.16"
28
+ "vitest": "^4.0.16",
29
+ "@schafevormfenster/eslint-config": "0.0.8"
39
30
  },
40
31
  "dependencies": {
41
- "@schafevormfenster/logging": "workspace:*",
42
- "@schafevormfenster/security": "workspace:*",
43
32
  "dayjs": "^1.11.19",
44
33
  "slugify": "^1.6.6",
45
- "zod": "^3.25.76"
34
+ "zod": "^3.25.76",
35
+ "@schafevormfenster/logging": "0.1.7",
36
+ "@schafevormfenster/security": "0.1.4"
37
+ },
38
+ "scripts": {
39
+ "typecheck": "tsc --noEmit",
40
+ "lint": "eslint",
41
+ "test": "TZ=UTC vitest run",
42
+ "test:watch": "TZ=UTC vitest",
43
+ "build": "tsc",
44
+ "check": "pnpm run typecheck && pnpm run lint && pnpm run test && pnpm run build",
45
+ "release": "pnpm run build && ../../scripts/smart-publish.sh"
46
46
  }
47
- }
47
+ }