@nestia/sdk 14.2.0 → 14.3.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/assets/bundle/distribute/package.json +1 -1
- package/native/go.mod +1 -1
- package/native/go.sum +32 -32
- package/native/sdk/register.go +10 -4
- package/native/sdk/sdk_transform.go +46 -0
- package/package.json +9 -9
package/native/go.mod
CHANGED
|
@@ -9,7 +9,7 @@ require (
|
|
|
9
9
|
github.com/microsoft/typescript-go/shim/scanner v0.0.0
|
|
10
10
|
github.com/samchon/nestia/packages/core/native v0.0.0
|
|
11
11
|
github.com/samchon/ttsc/packages/ttsc v0.0.0
|
|
12
|
-
github.com/samchon/typia/packages/typia/native v0.0.0-
|
|
12
|
+
github.com/samchon/typia/packages/typia/native v0.0.0-20261112102037-8b5c18f740f2
|
|
13
13
|
)
|
|
14
14
|
|
|
15
15
|
require (
|
package/native/go.sum
CHANGED
|
@@ -12,38 +12,38 @@ github.com/microsoft/typescript-go v0.0.0-20260708042240-2bd066d87f5b h1:IgfPOv9
|
|
|
12
12
|
github.com/microsoft/typescript-go v0.0.0-20260708042240-2bd066d87f5b/go.mod h1:gV4G6M8xxLNqQSRHiFOgKHlY+5YJgYPM6QwFLWllC+8=
|
|
13
13
|
github.com/peter-evans/patience v0.3.0 h1:rX0JdJeepqdQl1Sk9c9uvorjYYzL2TfgLX1adqYm9cA=
|
|
14
14
|
github.com/peter-evans/patience v0.3.0/go.mod h1:Kmxu5sY1NmBLFSStvXjX1wS9mIv7wMcP/ubucyMOAu0=
|
|
15
|
-
github.com/samchon/ttsc/packages/ttsc v0.0.0-
|
|
16
|
-
github.com/samchon/ttsc/packages/ttsc v0.0.0-
|
|
17
|
-
github.com/samchon/ttsc/packages/ttsc/shim/ast v0.0.0-
|
|
18
|
-
github.com/samchon/ttsc/packages/ttsc/shim/ast v0.0.0-
|
|
19
|
-
github.com/samchon/ttsc/packages/ttsc/shim/bundled v0.0.0-
|
|
20
|
-
github.com/samchon/ttsc/packages/ttsc/shim/bundled v0.0.0-
|
|
21
|
-
github.com/samchon/ttsc/packages/ttsc/shim/checker v0.0.0-
|
|
22
|
-
github.com/samchon/ttsc/packages/ttsc/shim/checker v0.0.0-
|
|
23
|
-
github.com/samchon/ttsc/packages/ttsc/shim/compiler v0.0.0-
|
|
24
|
-
github.com/samchon/ttsc/packages/ttsc/shim/compiler v0.0.0-
|
|
25
|
-
github.com/samchon/ttsc/packages/ttsc/shim/core v0.0.0-
|
|
26
|
-
github.com/samchon/ttsc/packages/ttsc/shim/core v0.0.0-
|
|
27
|
-
github.com/samchon/ttsc/packages/ttsc/shim/diagnosticwriter v0.0.0-
|
|
28
|
-
github.com/samchon/ttsc/packages/ttsc/shim/diagnosticwriter v0.0.0-
|
|
29
|
-
github.com/samchon/ttsc/packages/ttsc/shim/parser v0.0.0-
|
|
30
|
-
github.com/samchon/ttsc/packages/ttsc/shim/parser v0.0.0-
|
|
31
|
-
github.com/samchon/ttsc/packages/ttsc/shim/printer v0.0.0-
|
|
32
|
-
github.com/samchon/ttsc/packages/ttsc/shim/printer v0.0.0-
|
|
33
|
-
github.com/samchon/ttsc/packages/ttsc/shim/scanner v0.0.0-
|
|
34
|
-
github.com/samchon/ttsc/packages/ttsc/shim/scanner v0.0.0-
|
|
35
|
-
github.com/samchon/ttsc/packages/ttsc/shim/tsoptions v0.0.0-
|
|
36
|
-
github.com/samchon/ttsc/packages/ttsc/shim/tsoptions v0.0.0-
|
|
37
|
-
github.com/samchon/ttsc/packages/ttsc/shim/tspath v0.0.0-
|
|
38
|
-
github.com/samchon/ttsc/packages/ttsc/shim/tspath v0.0.0-
|
|
39
|
-
github.com/samchon/ttsc/packages/ttsc/shim/vfs v0.0.0-
|
|
40
|
-
github.com/samchon/ttsc/packages/ttsc/shim/vfs v0.0.0-
|
|
41
|
-
github.com/samchon/ttsc/packages/ttsc/shim/vfs/cachedvfs v0.0.0-
|
|
42
|
-
github.com/samchon/ttsc/packages/ttsc/shim/vfs/cachedvfs v0.0.0-
|
|
43
|
-
github.com/samchon/ttsc/packages/ttsc/shim/vfs/osvfs v0.0.0-
|
|
44
|
-
github.com/samchon/ttsc/packages/ttsc/shim/vfs/osvfs v0.0.0-
|
|
45
|
-
github.com/samchon/typia/packages/typia/native v0.0.0-
|
|
46
|
-
github.com/samchon/typia/packages/typia/native v0.0.0-
|
|
15
|
+
github.com/samchon/ttsc/packages/ttsc v0.0.0-20261112074023-12baadf1a529 h1:VduLvWOZq1fWVmH/Qiio30BQD0C2keH3UyY6qyg3qIg=
|
|
16
|
+
github.com/samchon/ttsc/packages/ttsc v0.0.0-20261112074023-12baadf1a529/go.mod h1:a1grzQVVywGwOJxeJls3I0AlbD2+/GJh7s4ErLX+TnU=
|
|
17
|
+
github.com/samchon/ttsc/packages/ttsc/shim/ast v0.0.0-20261112074023-12baadf1a529 h1:1CQT4w/2K12PguS5yVmGKNl+in2dBrBhQCYXj1Ycml8=
|
|
18
|
+
github.com/samchon/ttsc/packages/ttsc/shim/ast v0.0.0-20261112074023-12baadf1a529/go.mod h1:dPTnnu8/P6Mhj/VI4+OdGMwH2AgHE1Q+Dqf0Pl9fKHc=
|
|
19
|
+
github.com/samchon/ttsc/packages/ttsc/shim/bundled v0.0.0-20261112074023-12baadf1a529 h1:3tfAbcTSKyw1zovSu5T6irLVP0060HDH84j6bMqv2Kw=
|
|
20
|
+
github.com/samchon/ttsc/packages/ttsc/shim/bundled v0.0.0-20261112074023-12baadf1a529/go.mod h1:j936pzYoZDEktNKssLpJ90gInf/td/OuMToWfk8BWwY=
|
|
21
|
+
github.com/samchon/ttsc/packages/ttsc/shim/checker v0.0.0-20261112074023-12baadf1a529 h1:VVqXpOvQCn2q76TeR8+E8HeqI3XzwqSeZCsHECQENQ8=
|
|
22
|
+
github.com/samchon/ttsc/packages/ttsc/shim/checker v0.0.0-20261112074023-12baadf1a529/go.mod h1:CTy32RVSxc+WUf2WYwtlx4X+S7diqHM0gZw3XJd+1oc=
|
|
23
|
+
github.com/samchon/ttsc/packages/ttsc/shim/compiler v0.0.0-20261112074023-12baadf1a529 h1:oEGclA26JE1vIv8MRMW+1lc6fMW+foNVKZFZB1sRUyM=
|
|
24
|
+
github.com/samchon/ttsc/packages/ttsc/shim/compiler v0.0.0-20261112074023-12baadf1a529/go.mod h1:YIxaboLIEEn1+kkiXP8j0p/cJaGlr+u5kQ7wbq+tvfs=
|
|
25
|
+
github.com/samchon/ttsc/packages/ttsc/shim/core v0.0.0-20261112074023-12baadf1a529 h1:l9vW87KdEHw6cvufprD2qAuz/iZRt59QSkbk+2ZTaP4=
|
|
26
|
+
github.com/samchon/ttsc/packages/ttsc/shim/core v0.0.0-20261112074023-12baadf1a529/go.mod h1:/a0R6/hJ3z4RNGw9ErdltbqarOfEVH0qh/Rw3H1bHvE=
|
|
27
|
+
github.com/samchon/ttsc/packages/ttsc/shim/diagnosticwriter v0.0.0-20261112074023-12baadf1a529 h1:7VSrMI/HVMKkv1LwnrOlegHfi34SK1Z9DsPmwJioAgg=
|
|
28
|
+
github.com/samchon/ttsc/packages/ttsc/shim/diagnosticwriter v0.0.0-20261112074023-12baadf1a529/go.mod h1:YEmozuZcYwQG5hlQvrVjO0caudRTVQmkWIYApAGyu1k=
|
|
29
|
+
github.com/samchon/ttsc/packages/ttsc/shim/parser v0.0.0-20261112074023-12baadf1a529 h1:ni7W2k4BLFMFJ5BxIrjHFvbTya3mwF8J880tmtdDqJg=
|
|
30
|
+
github.com/samchon/ttsc/packages/ttsc/shim/parser v0.0.0-20261112074023-12baadf1a529/go.mod h1:PF1exhetyHPY/jm1XJqYbPLVApr27DSnKJG4/5ITVok=
|
|
31
|
+
github.com/samchon/ttsc/packages/ttsc/shim/printer v0.0.0-20261112074023-12baadf1a529 h1:XvYPiIrZ2cGD5Jx8UMxYWOnsHE/v33HudXezBYe/bc0=
|
|
32
|
+
github.com/samchon/ttsc/packages/ttsc/shim/printer v0.0.0-20261112074023-12baadf1a529/go.mod h1:+3u7YXcr9py6RuGEAuCF8q8I+5/s+6cVrhdbtmKFPoQ=
|
|
33
|
+
github.com/samchon/ttsc/packages/ttsc/shim/scanner v0.0.0-20261112074023-12baadf1a529 h1:0oceyJwFVEyDufdrCUFrYB+Gsh0HmVoSeSjRLdUk0dY=
|
|
34
|
+
github.com/samchon/ttsc/packages/ttsc/shim/scanner v0.0.0-20261112074023-12baadf1a529/go.mod h1:ENkHgpU4FSWsyFbeKs7zzD24dcafXLrFG/ibpLJcUnM=
|
|
35
|
+
github.com/samchon/ttsc/packages/ttsc/shim/tsoptions v0.0.0-20261112074023-12baadf1a529 h1:5BKkehBjbTV19xK7R6DMxZJ6hU03GYBsv1MdbqjGtas=
|
|
36
|
+
github.com/samchon/ttsc/packages/ttsc/shim/tsoptions v0.0.0-20261112074023-12baadf1a529/go.mod h1:ZfhcSNZMwjb/VCFBkvcWA67cahSTsJWirU6QPvHmaVI=
|
|
37
|
+
github.com/samchon/ttsc/packages/ttsc/shim/tspath v0.0.0-20261112074023-12baadf1a529 h1:oDcwN4Iz9ZE7My8L38oyBYEtSUjEHL3oCYa3WY9TzGo=
|
|
38
|
+
github.com/samchon/ttsc/packages/ttsc/shim/tspath v0.0.0-20261112074023-12baadf1a529/go.mod h1:uMUjLdUXMzynxNRrImYxZ39p2507Xr5PJXkcsjmHDLg=
|
|
39
|
+
github.com/samchon/ttsc/packages/ttsc/shim/vfs v0.0.0-20261112074023-12baadf1a529 h1:4jwIli0VJnid5kpyj9TCoBFKEHwiPsW5RTCFOckMIXM=
|
|
40
|
+
github.com/samchon/ttsc/packages/ttsc/shim/vfs v0.0.0-20261112074023-12baadf1a529/go.mod h1:Gb6lZS1XGze5Y0VdFUBExOfLIb97VFJZMu2j4WYBMDY=
|
|
41
|
+
github.com/samchon/ttsc/packages/ttsc/shim/vfs/cachedvfs v0.0.0-20261112074023-12baadf1a529 h1:aLlorYcol7pkRK/FpAB5CWsAJk6Cjq2xk/DfFZ1txEU=
|
|
42
|
+
github.com/samchon/ttsc/packages/ttsc/shim/vfs/cachedvfs v0.0.0-20261112074023-12baadf1a529/go.mod h1:DaCDdbH+CHIFe/q892vC4j3mZRUStrIusZ+GYvKlyt8=
|
|
43
|
+
github.com/samchon/ttsc/packages/ttsc/shim/vfs/osvfs v0.0.0-20261112074023-12baadf1a529 h1:6hu2keMplLkLRHg4RuNOcWECqmvmlnHiUcUpyymyWNo=
|
|
44
|
+
github.com/samchon/ttsc/packages/ttsc/shim/vfs/osvfs v0.0.0-20261112074023-12baadf1a529/go.mod h1:+yDn4SWLNFqwazlFuoW6/Q68j17MZSoUBvRDvFzwKSk=
|
|
45
|
+
github.com/samchon/typia/packages/typia/native v0.0.0-20261112102037-8b5c18f740f2 h1:A88zGgS8lD9LnKxgPZwsdJ061WS9SLOAsXWUNd4KDzo=
|
|
46
|
+
github.com/samchon/typia/packages/typia/native v0.0.0-20261112102037-8b5c18f740f2/go.mod h1:VU2CSUPxusstjbfmoX2zPLW9zQ5tfd1VO1Bp991+I8g=
|
|
47
47
|
github.com/zeebo/assert v1.3.0 h1:g7C04CbJuIDKNPFHmsk4hwZDO5O+kntRxzaUoNXj+IQ=
|
|
48
48
|
github.com/zeebo/assert v1.3.0/go.mod h1:Pq9JiuJQpG8JLJdtkwrJESF0Foym2/D9XMU5ciN/wJ0=
|
|
49
49
|
github.com/zeebo/xxh3 v1.1.0 h1:s7DLGDK45Dyfg7++yxI0khrfwq9661w9EN78eP/UZVs=
|
package/native/sdk/register.go
CHANGED
|
@@ -2,7 +2,6 @@ package sdk
|
|
|
2
2
|
|
|
3
3
|
import (
|
|
4
4
|
"fmt"
|
|
5
|
-
"os"
|
|
6
5
|
"path/filepath"
|
|
7
6
|
"strings"
|
|
8
7
|
|
|
@@ -172,13 +171,20 @@ func collectSDKEmitTransform(
|
|
|
172
171
|
prog *driver.Program,
|
|
173
172
|
_ plugin.Plan,
|
|
174
173
|
) (driver.PluginTransform, []transform.Diagnostic) {
|
|
175
|
-
if shouldRunSDKContributorTransform() == false {
|
|
174
|
+
if shouldRunSDKContributorTransform(prog) == false {
|
|
176
175
|
return nil, nil
|
|
177
176
|
}
|
|
178
177
|
return EmitTransform(prog)
|
|
179
178
|
}
|
|
180
|
-
|
|
181
|
-
|
|
179
|
+
|
|
180
|
+
// shouldRunSDKContributorTransform reads the NESTIA_SDK_TRANSFORM opt-in through
|
|
181
|
+
// the program, which records the read as an input of this generation. A ttsc
|
|
182
|
+
// host that reuses this output across launches therefore sees the value change;
|
|
183
|
+
// os.Getenv was recorded by nothing, and a disabled SDK run served the
|
|
184
|
+
// decorated emit of an enabled one (samchon/ttsc#1852).
|
|
185
|
+
func shouldRunSDKContributorTransform(prog *driver.Program) bool {
|
|
186
|
+
value, _ := prog.Env("NESTIA_SDK_TRANSFORM")
|
|
187
|
+
return value == "1"
|
|
182
188
|
}
|
|
183
189
|
|
|
184
190
|
func synthesized(node *shimast.Node) *shimast.Node {
|
|
@@ -1257,6 +1257,7 @@ func nestiaSDKMarkReadonlySchemaType(prog *driver.Program, typ *shimchecker.Type
|
|
|
1257
1257
|
if visiting[key] { return }
|
|
1258
1258
|
visiting[key] = true
|
|
1259
1259
|
if typ.Flags() & (shimchecker.TypeFlagsUnion | shimchecker.TypeFlagsIntersection) != 0 {
|
|
1260
|
+
if typ.Flags() & shimchecker.TypeFlagsUnion != 0 && nestiaSDKReadonlyScalarUnion(target) { return }
|
|
1260
1261
|
for _, child := range typ.AsUnionOrIntersectionType().Types() {
|
|
1261
1262
|
matched := false
|
|
1262
1263
|
if typ.Flags() & shimchecker.TypeFlagsUnion != 0 {
|
|
@@ -1339,6 +1340,51 @@ func nestiaSDKMarkReadonlySchemaType(prog *driver.Program, typ *shimchecker.Type
|
|
|
1339
1340
|
}
|
|
1340
1341
|
}
|
|
1341
1342
|
|
|
1343
|
+
// nestiaSDKReadonlyScalarUnion reports whether a union schema has only
|
|
1344
|
+
// terminal scalar branches, so no constituent can own a readonly array marker.
|
|
1345
|
+
//
|
|
1346
|
+
// Readonly markers attach to array and tuple positions. A branch whose type is
|
|
1347
|
+
// string, number, integer, boolean or null and which carries no reference,
|
|
1348
|
+
// composition, object or array keyword contains no such position, so pairing
|
|
1349
|
+
// its constituent through MetadataFactory.Analyze cannot change the document.
|
|
1350
|
+
// A branch without an explicit scalar type, and every other shape, keeps the
|
|
1351
|
+
// constituent probe.
|
|
1352
|
+
func nestiaSDKReadonlyScalarUnion(schema map[string]any) bool {
|
|
1353
|
+
if !nestiaSDKReadonlyScalarShape(schema, true) { return false }
|
|
1354
|
+
found := false
|
|
1355
|
+
for _, keyword := range []string{"oneOf", "anyOf"} {
|
|
1356
|
+
if _, exists := schema[keyword]; !exists { continue }
|
|
1357
|
+
branches := nestiaSDKSchemaList(schema[keyword])
|
|
1358
|
+
if len(branches) == 0 { return false }
|
|
1359
|
+
found = true
|
|
1360
|
+
for _, branch := range branches {
|
|
1361
|
+
if !nestiaSDKReadonlyScalarShape(nestiaSDKSchemaMap(branch), false) { return false }
|
|
1362
|
+
}
|
|
1363
|
+
}
|
|
1364
|
+
return found
|
|
1365
|
+
}
|
|
1366
|
+
|
|
1367
|
+
// nestiaSDKReadonlyScalarShape reports whether one schema has no position that
|
|
1368
|
+
// could hold a readonly array marker. allowUnion admits the oneOf/anyOf parent
|
|
1369
|
+
// whose branches nestiaSDKReadonlyScalarUnion checks separately.
|
|
1370
|
+
func nestiaSDKReadonlyScalarShape(schema map[string]any, allowUnion bool) bool {
|
|
1371
|
+
if schema == nil { return false }
|
|
1372
|
+
if value, exists := schema["type"]; exists {
|
|
1373
|
+
switch value {
|
|
1374
|
+
case "string", "number", "integer", "boolean", "null":
|
|
1375
|
+
default: return false
|
|
1376
|
+
}
|
|
1377
|
+
} else if !allowUnion { return false }
|
|
1378
|
+
for _, key := range []string{"$ref", "$dynamicRef", "$recursiveRef", "allOf", "not", "if", "then", "else", "properties", "patternProperties", "additionalProperties", "unevaluatedProperties", "dependentSchemas", "propertyNames", "items", "prefixItems", "additionalItems", "contains", "unevaluatedItems", "$defs", "definitions"} {
|
|
1379
|
+
if _, exists := schema[key]; exists { return false }
|
|
1380
|
+
}
|
|
1381
|
+
if !allowUnion {
|
|
1382
|
+
if _, exists := schema["oneOf"]; exists { return false }
|
|
1383
|
+
if _, exists := schema["anyOf"]; exists { return false }
|
|
1384
|
+
}
|
|
1385
|
+
return true
|
|
1386
|
+
}
|
|
1387
|
+
|
|
1342
1388
|
// nestiaSDKReadonlySchemaEquivalent compares the native writer's branch shape,
|
|
1343
1389
|
// ignoring only the readonly facts this traversal has already attached.
|
|
1344
1390
|
func nestiaSDKReadonlySchemaEquivalent(expected any, actual any) bool {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@nestia/sdk",
|
|
3
|
-
"version": "14.
|
|
3
|
+
"version": "14.3.0",
|
|
4
4
|
"description": "Nestia SDK and Swagger generator",
|
|
5
5
|
"main": "lib/index.js",
|
|
6
6
|
"bin": {
|
|
@@ -45,23 +45,23 @@
|
|
|
45
45
|
},
|
|
46
46
|
"homepage": "https://nestia.io",
|
|
47
47
|
"dependencies": {
|
|
48
|
-
"@ttsc/factory": "^0.
|
|
49
|
-
"@typia/interface": "^15.
|
|
50
|
-
"@typia/utils": "^15.
|
|
48
|
+
"@ttsc/factory": "^0.37.0",
|
|
49
|
+
"@typia/interface": "^15.4.0",
|
|
50
|
+
"@typia/utils": "^15.4.0",
|
|
51
51
|
"get-function-location": "^2.0.0",
|
|
52
52
|
"glob": "^11.0.3",
|
|
53
53
|
"path-to-regexp": "^6.2.1",
|
|
54
54
|
"prettier": "^3.8.1",
|
|
55
55
|
"tgrid": "^1.2.1",
|
|
56
|
-
"ttsc": "^0.
|
|
56
|
+
"ttsc": "^0.37.0",
|
|
57
57
|
"tstl": "^3.0.0",
|
|
58
|
-
"typia": "^15.
|
|
58
|
+
"typia": "^15.4.0",
|
|
59
59
|
"@babel/parser": "^7.29.8",
|
|
60
|
-
"@nestia/fetcher": "^14.
|
|
61
|
-
"@nestia/core": "^14.
|
|
60
|
+
"@nestia/fetcher": "^14.3.0",
|
|
61
|
+
"@nestia/core": "^14.3.0"
|
|
62
62
|
},
|
|
63
63
|
"peerDependencies": {
|
|
64
|
-
"@nestia/core": "^14.
|
|
64
|
+
"@nestia/core": "^14.3.0"
|
|
65
65
|
},
|
|
66
66
|
"devDependencies": {
|
|
67
67
|
"@modelcontextprotocol/sdk": "^1.18.0",
|