@suss/adapter-python 0.5.10 → 0.5.11
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/index.cjs +44 -29
- package/dist/index.d.cts +9 -0
- package/dist/index.d.ts +9 -0
- package/dist/index.js +44 -29
- package/package.json +4 -4
package/dist/index.cjs
CHANGED
|
@@ -1739,7 +1739,7 @@ __export(core_exports2, {
|
|
|
1739
1739
|
parse: () => parse,
|
|
1740
1740
|
parseAsync: () => parseAsync,
|
|
1741
1741
|
prettifyError: () => prettifyError,
|
|
1742
|
-
process: () =>
|
|
1742
|
+
process: () => process2,
|
|
1743
1743
|
regexes: () => regexes_exports,
|
|
1744
1744
|
registry: () => registry,
|
|
1745
1745
|
safeDecode: () => safeDecode,
|
|
@@ -12664,7 +12664,7 @@ function initializeContext(params) {
|
|
|
12664
12664
|
external: params?.external ?? void 0
|
|
12665
12665
|
};
|
|
12666
12666
|
}
|
|
12667
|
-
function
|
|
12667
|
+
function process2(schema, ctx, _params = { path: [], schemaPath: [] }) {
|
|
12668
12668
|
var _a3;
|
|
12669
12669
|
const def = schema._zod.def;
|
|
12670
12670
|
const seen = ctx.seen.get(schema);
|
|
@@ -12701,7 +12701,7 @@ function process(schema, ctx, _params = { path: [], schemaPath: [] }) {
|
|
|
12701
12701
|
if (parent) {
|
|
12702
12702
|
if (!result.ref)
|
|
12703
12703
|
result.ref = parent;
|
|
12704
|
-
|
|
12704
|
+
process2(parent, ctx, params);
|
|
12705
12705
|
ctx.seen.get(parent).isParent = true;
|
|
12706
12706
|
}
|
|
12707
12707
|
}
|
|
@@ -12989,14 +12989,14 @@ function isTransforming(_schema, _ctx) {
|
|
|
12989
12989
|
}
|
|
12990
12990
|
var createToJSONSchemaMethod = (schema, processors = {}) => (params) => {
|
|
12991
12991
|
const ctx = initializeContext({ ...params, processors });
|
|
12992
|
-
|
|
12992
|
+
process2(schema, ctx);
|
|
12993
12993
|
extractDefs(ctx, schema);
|
|
12994
12994
|
return finalize(ctx, schema);
|
|
12995
12995
|
};
|
|
12996
12996
|
var createStandardJSONSchemaMethod = (schema, io, processors = {}) => (params) => {
|
|
12997
12997
|
const { libraryOptions, target } = params ?? {};
|
|
12998
12998
|
const ctx = initializeContext({ ...libraryOptions ?? {}, target, io, processors });
|
|
12999
|
-
|
|
12999
|
+
process2(schema, ctx);
|
|
13000
13000
|
extractDefs(ctx, schema);
|
|
13001
13001
|
return finalize(ctx, schema);
|
|
13002
13002
|
};
|
|
@@ -13242,7 +13242,7 @@ var arrayProcessor = (schema, ctx, _json, params) => {
|
|
|
13242
13242
|
if (typeof maximum === "number")
|
|
13243
13243
|
json2.maxItems = maximum;
|
|
13244
13244
|
json2.type = "array";
|
|
13245
|
-
json2.items =
|
|
13245
|
+
json2.items = process2(def.element, ctx, {
|
|
13246
13246
|
...params,
|
|
13247
13247
|
path: [...params.path, "items"]
|
|
13248
13248
|
});
|
|
@@ -13254,7 +13254,7 @@ var objectProcessor = (schema, ctx, _json, params) => {
|
|
|
13254
13254
|
json2.properties = {};
|
|
13255
13255
|
const shape = def.shape;
|
|
13256
13256
|
for (const key in shape) {
|
|
13257
|
-
json2.properties[key] =
|
|
13257
|
+
json2.properties[key] = process2(shape[key], ctx, {
|
|
13258
13258
|
...params,
|
|
13259
13259
|
path: [...params.path, "properties", key]
|
|
13260
13260
|
});
|
|
@@ -13277,7 +13277,7 @@ var objectProcessor = (schema, ctx, _json, params) => {
|
|
|
13277
13277
|
if (ctx.io === "output")
|
|
13278
13278
|
json2.additionalProperties = false;
|
|
13279
13279
|
} else if (def.catchall) {
|
|
13280
|
-
json2.additionalProperties =
|
|
13280
|
+
json2.additionalProperties = process2(def.catchall, ctx, {
|
|
13281
13281
|
...params,
|
|
13282
13282
|
path: [...params.path, "additionalProperties"]
|
|
13283
13283
|
});
|
|
@@ -13286,7 +13286,7 @@ var objectProcessor = (schema, ctx, _json, params) => {
|
|
|
13286
13286
|
var unionProcessor = (schema, ctx, json2, params) => {
|
|
13287
13287
|
const def = schema._zod.def;
|
|
13288
13288
|
const isExclusive = def.inclusive === false;
|
|
13289
|
-
const options = def.options.map((x, i) =>
|
|
13289
|
+
const options = def.options.map((x, i) => process2(x, ctx, {
|
|
13290
13290
|
...params,
|
|
13291
13291
|
path: [...params.path, isExclusive ? "oneOf" : "anyOf", i]
|
|
13292
13292
|
}));
|
|
@@ -13298,11 +13298,11 @@ var unionProcessor = (schema, ctx, json2, params) => {
|
|
|
13298
13298
|
};
|
|
13299
13299
|
var intersectionProcessor = (schema, ctx, json2, params) => {
|
|
13300
13300
|
const def = schema._zod.def;
|
|
13301
|
-
const a =
|
|
13301
|
+
const a = process2(def.left, ctx, {
|
|
13302
13302
|
...params,
|
|
13303
13303
|
path: [...params.path, "allOf", 0]
|
|
13304
13304
|
});
|
|
13305
|
-
const b =
|
|
13305
|
+
const b = process2(def.right, ctx, {
|
|
13306
13306
|
...params,
|
|
13307
13307
|
path: [...params.path, "allOf", 1]
|
|
13308
13308
|
});
|
|
@@ -13319,11 +13319,11 @@ var tupleProcessor = (schema, ctx, _json, params) => {
|
|
|
13319
13319
|
json2.type = "array";
|
|
13320
13320
|
const prefixPath = ctx.target === "draft-2020-12" ? "prefixItems" : "items";
|
|
13321
13321
|
const restPath = ctx.target === "draft-2020-12" ? "items" : ctx.target === "openapi-3.0" ? "items" : "additionalItems";
|
|
13322
|
-
const prefixItems = def.items.map((x, i) =>
|
|
13322
|
+
const prefixItems = def.items.map((x, i) => process2(x, ctx, {
|
|
13323
13323
|
...params,
|
|
13324
13324
|
path: [...params.path, prefixPath, i]
|
|
13325
13325
|
}));
|
|
13326
|
-
const rest = def.rest ?
|
|
13326
|
+
const rest = def.rest ? process2(def.rest, ctx, {
|
|
13327
13327
|
...params,
|
|
13328
13328
|
path: [...params.path, restPath, ...ctx.target === "openapi-3.0" ? [def.items.length] : []]
|
|
13329
13329
|
}) : null;
|
|
@@ -13363,7 +13363,7 @@ var recordProcessor = (schema, ctx, _json, params) => {
|
|
|
13363
13363
|
const keyBag = keyType._zod.bag;
|
|
13364
13364
|
const patterns = keyBag?.patterns;
|
|
13365
13365
|
if (def.mode === "loose" && patterns && patterns.size > 0) {
|
|
13366
|
-
const valueSchema =
|
|
13366
|
+
const valueSchema = process2(def.valueType, ctx, {
|
|
13367
13367
|
...params,
|
|
13368
13368
|
path: [...params.path, "patternProperties", "*"]
|
|
13369
13369
|
});
|
|
@@ -13373,12 +13373,12 @@ var recordProcessor = (schema, ctx, _json, params) => {
|
|
|
13373
13373
|
}
|
|
13374
13374
|
} else {
|
|
13375
13375
|
if (ctx.target === "draft-07" || ctx.target === "draft-2020-12") {
|
|
13376
|
-
json2.propertyNames =
|
|
13376
|
+
json2.propertyNames = process2(def.keyType, ctx, {
|
|
13377
13377
|
...params,
|
|
13378
13378
|
path: [...params.path, "propertyNames"]
|
|
13379
13379
|
});
|
|
13380
13380
|
}
|
|
13381
|
-
json2.additionalProperties =
|
|
13381
|
+
json2.additionalProperties = process2(def.valueType, ctx, {
|
|
13382
13382
|
...params,
|
|
13383
13383
|
path: [...params.path, "additionalProperties"]
|
|
13384
13384
|
});
|
|
@@ -13393,7 +13393,7 @@ var recordProcessor = (schema, ctx, _json, params) => {
|
|
|
13393
13393
|
};
|
|
13394
13394
|
var nullableProcessor = (schema, ctx, json2, params) => {
|
|
13395
13395
|
const def = schema._zod.def;
|
|
13396
|
-
const inner =
|
|
13396
|
+
const inner = process2(def.innerType, ctx, params);
|
|
13397
13397
|
const seen = ctx.seen.get(schema);
|
|
13398
13398
|
if (ctx.target === "openapi-3.0") {
|
|
13399
13399
|
seen.ref = def.innerType;
|
|
@@ -13404,20 +13404,20 @@ var nullableProcessor = (schema, ctx, json2, params) => {
|
|
|
13404
13404
|
};
|
|
13405
13405
|
var nonoptionalProcessor = (schema, ctx, _json, params) => {
|
|
13406
13406
|
const def = schema._zod.def;
|
|
13407
|
-
|
|
13407
|
+
process2(def.innerType, ctx, params);
|
|
13408
13408
|
const seen = ctx.seen.get(schema);
|
|
13409
13409
|
seen.ref = def.innerType;
|
|
13410
13410
|
};
|
|
13411
13411
|
var defaultProcessor = (schema, ctx, json2, params) => {
|
|
13412
13412
|
const def = schema._zod.def;
|
|
13413
|
-
|
|
13413
|
+
process2(def.innerType, ctx, params);
|
|
13414
13414
|
const seen = ctx.seen.get(schema);
|
|
13415
13415
|
seen.ref = def.innerType;
|
|
13416
13416
|
json2.default = JSON.parse(JSON.stringify(def.defaultValue));
|
|
13417
13417
|
};
|
|
13418
13418
|
var prefaultProcessor = (schema, ctx, json2, params) => {
|
|
13419
13419
|
const def = schema._zod.def;
|
|
13420
|
-
|
|
13420
|
+
process2(def.innerType, ctx, params);
|
|
13421
13421
|
const seen = ctx.seen.get(schema);
|
|
13422
13422
|
seen.ref = def.innerType;
|
|
13423
13423
|
if (ctx.io === "input")
|
|
@@ -13425,7 +13425,7 @@ var prefaultProcessor = (schema, ctx, json2, params) => {
|
|
|
13425
13425
|
};
|
|
13426
13426
|
var catchProcessor = (schema, ctx, json2, params) => {
|
|
13427
13427
|
const def = schema._zod.def;
|
|
13428
|
-
|
|
13428
|
+
process2(def.innerType, ctx, params);
|
|
13429
13429
|
const seen = ctx.seen.get(schema);
|
|
13430
13430
|
seen.ref = def.innerType;
|
|
13431
13431
|
let catchValue;
|
|
@@ -13440,32 +13440,32 @@ var pipeProcessor = (schema, ctx, _json, params) => {
|
|
|
13440
13440
|
const def = schema._zod.def;
|
|
13441
13441
|
const inIsTransform = def.in._zod.traits.has("$ZodTransform");
|
|
13442
13442
|
const innerType = ctx.io === "input" ? inIsTransform ? def.out : def.in : def.out;
|
|
13443
|
-
|
|
13443
|
+
process2(innerType, ctx, params);
|
|
13444
13444
|
const seen = ctx.seen.get(schema);
|
|
13445
13445
|
seen.ref = innerType;
|
|
13446
13446
|
};
|
|
13447
13447
|
var readonlyProcessor = (schema, ctx, json2, params) => {
|
|
13448
13448
|
const def = schema._zod.def;
|
|
13449
|
-
|
|
13449
|
+
process2(def.innerType, ctx, params);
|
|
13450
13450
|
const seen = ctx.seen.get(schema);
|
|
13451
13451
|
seen.ref = def.innerType;
|
|
13452
13452
|
json2.readOnly = true;
|
|
13453
13453
|
};
|
|
13454
13454
|
var promiseProcessor = (schema, ctx, _json, params) => {
|
|
13455
13455
|
const def = schema._zod.def;
|
|
13456
|
-
|
|
13456
|
+
process2(def.innerType, ctx, params);
|
|
13457
13457
|
const seen = ctx.seen.get(schema);
|
|
13458
13458
|
seen.ref = def.innerType;
|
|
13459
13459
|
};
|
|
13460
13460
|
var optionalProcessor = (schema, ctx, _json, params) => {
|
|
13461
13461
|
const def = schema._zod.def;
|
|
13462
|
-
|
|
13462
|
+
process2(def.innerType, ctx, params);
|
|
13463
13463
|
const seen = ctx.seen.get(schema);
|
|
13464
13464
|
seen.ref = def.innerType;
|
|
13465
13465
|
};
|
|
13466
13466
|
var lazyProcessor = (schema, ctx, _json, params) => {
|
|
13467
13467
|
const innerType = schema._zod.innerType;
|
|
13468
|
-
|
|
13468
|
+
process2(innerType, ctx, params);
|
|
13469
13469
|
const seen = ctx.seen.get(schema);
|
|
13470
13470
|
seen.ref = innerType;
|
|
13471
13471
|
};
|
|
@@ -13517,7 +13517,7 @@ function toJSONSchema(input, params) {
|
|
|
13517
13517
|
const defs = {};
|
|
13518
13518
|
for (const entry of registry2._idmap.entries()) {
|
|
13519
13519
|
const [_, schema] = entry;
|
|
13520
|
-
|
|
13520
|
+
process2(schema, ctx2);
|
|
13521
13521
|
}
|
|
13522
13522
|
const schemas = {};
|
|
13523
13523
|
const external = {
|
|
@@ -13540,7 +13540,7 @@ function toJSONSchema(input, params) {
|
|
|
13540
13540
|
return { schemas };
|
|
13541
13541
|
}
|
|
13542
13542
|
const ctx = initializeContext({ ...params, processors: allProcessors });
|
|
13543
|
-
|
|
13543
|
+
process2(input, ctx);
|
|
13544
13544
|
extractDefs(ctx, input);
|
|
13545
13545
|
return finalize(ctx, input);
|
|
13546
13546
|
}
|
|
@@ -13598,7 +13598,7 @@ var JSONSchemaGenerator = class {
|
|
|
13598
13598
|
* This must be called before emit().
|
|
13599
13599
|
*/
|
|
13600
13600
|
process(schema, _params = { path: [], schemaPath: [] }) {
|
|
13601
|
-
return
|
|
13601
|
+
return process2(schema, this.ctx, _params);
|
|
13602
13602
|
}
|
|
13603
13603
|
/**
|
|
13604
13604
|
* Emit the final JSON Schema after processing.
|
|
@@ -19231,11 +19231,26 @@ function carrierPrefix(carrier, constructorArg, objectName, scope, scan) {
|
|
|
19231
19231
|
}
|
|
19232
19232
|
|
|
19233
19233
|
// src/project.ts
|
|
19234
|
+
function reportUnresolvedProjectModules(options) {
|
|
19235
|
+
for (const pack of options.packs) {
|
|
19236
|
+
for (const module2 of pack.projectModules ?? []) {
|
|
19237
|
+
const resolved = resolveAbsoluteModule(module2, { roots: options.roots });
|
|
19238
|
+
if (resolved.status === "resolved") {
|
|
19239
|
+
continue;
|
|
19240
|
+
}
|
|
19241
|
+
process.stderr.write(
|
|
19242
|
+
`[suss] ${pack.name}: the configured module ${module2} does not resolve under ${options.roots.join(", ")}, so nothing it wraps will be discovered.
|
|
19243
|
+
`
|
|
19244
|
+
);
|
|
19245
|
+
}
|
|
19246
|
+
}
|
|
19247
|
+
}
|
|
19234
19248
|
async function extractPythonProject(options) {
|
|
19235
19249
|
const db = new import_datalog3.Database();
|
|
19236
19250
|
const summaries = [];
|
|
19237
19251
|
const gapHandling = options.gapHandling ?? "permissive";
|
|
19238
19252
|
const displayPathOf = (file2) => options.workspaceRoot !== void 0 ? import_node_path3.default.relative(options.workspaceRoot, file2) : file2;
|
|
19253
|
+
reportUnresolvedProjectModules(options);
|
|
19239
19254
|
const bound = [];
|
|
19240
19255
|
for (const file2 of options.files) {
|
|
19241
19256
|
const source = import_node_fs3.default.readFileSync(file2, "utf8");
|
package/dist/index.d.cts
CHANGED
|
@@ -178,6 +178,15 @@ interface PythonPack {
|
|
|
178
178
|
/** Wire protocol for the produced boundary bindings, e.g. "http". */
|
|
179
179
|
protocol: string;
|
|
180
180
|
discovery: PythonDiscoveryPattern[];
|
|
181
|
+
/**
|
|
182
|
+
* Modules the project itself supplies, the wrappers a person names
|
|
183
|
+
* when configuring the pack. The library's own module is not one of
|
|
184
|
+
* these: it lives outside the project and would never resolve. The
|
|
185
|
+
* adapter checks each of these against the project's roots, because
|
|
186
|
+
* a wrapper that resolves to nothing does not match any decorator
|
|
187
|
+
* and never says why (#188).
|
|
188
|
+
*/
|
|
189
|
+
projectModules?: string[];
|
|
181
190
|
/** What the library's own database queries look like. The README says how one is matched. */
|
|
182
191
|
storage?: StoragePattern[];
|
|
183
192
|
}
|
package/dist/index.d.ts
CHANGED
|
@@ -178,6 +178,15 @@ interface PythonPack {
|
|
|
178
178
|
/** Wire protocol for the produced boundary bindings, e.g. "http". */
|
|
179
179
|
protocol: string;
|
|
180
180
|
discovery: PythonDiscoveryPattern[];
|
|
181
|
+
/**
|
|
182
|
+
* Modules the project itself supplies, the wrappers a person names
|
|
183
|
+
* when configuring the pack. The library's own module is not one of
|
|
184
|
+
* these: it lives outside the project and would never resolve. The
|
|
185
|
+
* adapter checks each of these against the project's roots, because
|
|
186
|
+
* a wrapper that resolves to nothing does not match any decorator
|
|
187
|
+
* and never says why (#188).
|
|
188
|
+
*/
|
|
189
|
+
projectModules?: string[];
|
|
181
190
|
/** What the library's own database queries look like. The README says how one is matched. */
|
|
182
191
|
storage?: StoragePattern[];
|
|
183
192
|
}
|
package/dist/index.js
CHANGED
|
@@ -1695,7 +1695,7 @@ __export(core_exports2, {
|
|
|
1695
1695
|
parse: () => parse,
|
|
1696
1696
|
parseAsync: () => parseAsync,
|
|
1697
1697
|
prettifyError: () => prettifyError,
|
|
1698
|
-
process: () =>
|
|
1698
|
+
process: () => process2,
|
|
1699
1699
|
regexes: () => regexes_exports,
|
|
1700
1700
|
registry: () => registry,
|
|
1701
1701
|
safeDecode: () => safeDecode,
|
|
@@ -12620,7 +12620,7 @@ function initializeContext(params) {
|
|
|
12620
12620
|
external: params?.external ?? void 0
|
|
12621
12621
|
};
|
|
12622
12622
|
}
|
|
12623
|
-
function
|
|
12623
|
+
function process2(schema, ctx, _params = { path: [], schemaPath: [] }) {
|
|
12624
12624
|
var _a3;
|
|
12625
12625
|
const def = schema._zod.def;
|
|
12626
12626
|
const seen = ctx.seen.get(schema);
|
|
@@ -12657,7 +12657,7 @@ function process(schema, ctx, _params = { path: [], schemaPath: [] }) {
|
|
|
12657
12657
|
if (parent) {
|
|
12658
12658
|
if (!result.ref)
|
|
12659
12659
|
result.ref = parent;
|
|
12660
|
-
|
|
12660
|
+
process2(parent, ctx, params);
|
|
12661
12661
|
ctx.seen.get(parent).isParent = true;
|
|
12662
12662
|
}
|
|
12663
12663
|
}
|
|
@@ -12945,14 +12945,14 @@ function isTransforming(_schema, _ctx) {
|
|
|
12945
12945
|
}
|
|
12946
12946
|
var createToJSONSchemaMethod = (schema, processors = {}) => (params) => {
|
|
12947
12947
|
const ctx = initializeContext({ ...params, processors });
|
|
12948
|
-
|
|
12948
|
+
process2(schema, ctx);
|
|
12949
12949
|
extractDefs(ctx, schema);
|
|
12950
12950
|
return finalize(ctx, schema);
|
|
12951
12951
|
};
|
|
12952
12952
|
var createStandardJSONSchemaMethod = (schema, io, processors = {}) => (params) => {
|
|
12953
12953
|
const { libraryOptions, target } = params ?? {};
|
|
12954
12954
|
const ctx = initializeContext({ ...libraryOptions ?? {}, target, io, processors });
|
|
12955
|
-
|
|
12955
|
+
process2(schema, ctx);
|
|
12956
12956
|
extractDefs(ctx, schema);
|
|
12957
12957
|
return finalize(ctx, schema);
|
|
12958
12958
|
};
|
|
@@ -13198,7 +13198,7 @@ var arrayProcessor = (schema, ctx, _json, params) => {
|
|
|
13198
13198
|
if (typeof maximum === "number")
|
|
13199
13199
|
json2.maxItems = maximum;
|
|
13200
13200
|
json2.type = "array";
|
|
13201
|
-
json2.items =
|
|
13201
|
+
json2.items = process2(def.element, ctx, {
|
|
13202
13202
|
...params,
|
|
13203
13203
|
path: [...params.path, "items"]
|
|
13204
13204
|
});
|
|
@@ -13210,7 +13210,7 @@ var objectProcessor = (schema, ctx, _json, params) => {
|
|
|
13210
13210
|
json2.properties = {};
|
|
13211
13211
|
const shape = def.shape;
|
|
13212
13212
|
for (const key in shape) {
|
|
13213
|
-
json2.properties[key] =
|
|
13213
|
+
json2.properties[key] = process2(shape[key], ctx, {
|
|
13214
13214
|
...params,
|
|
13215
13215
|
path: [...params.path, "properties", key]
|
|
13216
13216
|
});
|
|
@@ -13233,7 +13233,7 @@ var objectProcessor = (schema, ctx, _json, params) => {
|
|
|
13233
13233
|
if (ctx.io === "output")
|
|
13234
13234
|
json2.additionalProperties = false;
|
|
13235
13235
|
} else if (def.catchall) {
|
|
13236
|
-
json2.additionalProperties =
|
|
13236
|
+
json2.additionalProperties = process2(def.catchall, ctx, {
|
|
13237
13237
|
...params,
|
|
13238
13238
|
path: [...params.path, "additionalProperties"]
|
|
13239
13239
|
});
|
|
@@ -13242,7 +13242,7 @@ var objectProcessor = (schema, ctx, _json, params) => {
|
|
|
13242
13242
|
var unionProcessor = (schema, ctx, json2, params) => {
|
|
13243
13243
|
const def = schema._zod.def;
|
|
13244
13244
|
const isExclusive = def.inclusive === false;
|
|
13245
|
-
const options = def.options.map((x, i) =>
|
|
13245
|
+
const options = def.options.map((x, i) => process2(x, ctx, {
|
|
13246
13246
|
...params,
|
|
13247
13247
|
path: [...params.path, isExclusive ? "oneOf" : "anyOf", i]
|
|
13248
13248
|
}));
|
|
@@ -13254,11 +13254,11 @@ var unionProcessor = (schema, ctx, json2, params) => {
|
|
|
13254
13254
|
};
|
|
13255
13255
|
var intersectionProcessor = (schema, ctx, json2, params) => {
|
|
13256
13256
|
const def = schema._zod.def;
|
|
13257
|
-
const a =
|
|
13257
|
+
const a = process2(def.left, ctx, {
|
|
13258
13258
|
...params,
|
|
13259
13259
|
path: [...params.path, "allOf", 0]
|
|
13260
13260
|
});
|
|
13261
|
-
const b =
|
|
13261
|
+
const b = process2(def.right, ctx, {
|
|
13262
13262
|
...params,
|
|
13263
13263
|
path: [...params.path, "allOf", 1]
|
|
13264
13264
|
});
|
|
@@ -13275,11 +13275,11 @@ var tupleProcessor = (schema, ctx, _json, params) => {
|
|
|
13275
13275
|
json2.type = "array";
|
|
13276
13276
|
const prefixPath = ctx.target === "draft-2020-12" ? "prefixItems" : "items";
|
|
13277
13277
|
const restPath = ctx.target === "draft-2020-12" ? "items" : ctx.target === "openapi-3.0" ? "items" : "additionalItems";
|
|
13278
|
-
const prefixItems = def.items.map((x, i) =>
|
|
13278
|
+
const prefixItems = def.items.map((x, i) => process2(x, ctx, {
|
|
13279
13279
|
...params,
|
|
13280
13280
|
path: [...params.path, prefixPath, i]
|
|
13281
13281
|
}));
|
|
13282
|
-
const rest = def.rest ?
|
|
13282
|
+
const rest = def.rest ? process2(def.rest, ctx, {
|
|
13283
13283
|
...params,
|
|
13284
13284
|
path: [...params.path, restPath, ...ctx.target === "openapi-3.0" ? [def.items.length] : []]
|
|
13285
13285
|
}) : null;
|
|
@@ -13319,7 +13319,7 @@ var recordProcessor = (schema, ctx, _json, params) => {
|
|
|
13319
13319
|
const keyBag = keyType._zod.bag;
|
|
13320
13320
|
const patterns = keyBag?.patterns;
|
|
13321
13321
|
if (def.mode === "loose" && patterns && patterns.size > 0) {
|
|
13322
|
-
const valueSchema =
|
|
13322
|
+
const valueSchema = process2(def.valueType, ctx, {
|
|
13323
13323
|
...params,
|
|
13324
13324
|
path: [...params.path, "patternProperties", "*"]
|
|
13325
13325
|
});
|
|
@@ -13329,12 +13329,12 @@ var recordProcessor = (schema, ctx, _json, params) => {
|
|
|
13329
13329
|
}
|
|
13330
13330
|
} else {
|
|
13331
13331
|
if (ctx.target === "draft-07" || ctx.target === "draft-2020-12") {
|
|
13332
|
-
json2.propertyNames =
|
|
13332
|
+
json2.propertyNames = process2(def.keyType, ctx, {
|
|
13333
13333
|
...params,
|
|
13334
13334
|
path: [...params.path, "propertyNames"]
|
|
13335
13335
|
});
|
|
13336
13336
|
}
|
|
13337
|
-
json2.additionalProperties =
|
|
13337
|
+
json2.additionalProperties = process2(def.valueType, ctx, {
|
|
13338
13338
|
...params,
|
|
13339
13339
|
path: [...params.path, "additionalProperties"]
|
|
13340
13340
|
});
|
|
@@ -13349,7 +13349,7 @@ var recordProcessor = (schema, ctx, _json, params) => {
|
|
|
13349
13349
|
};
|
|
13350
13350
|
var nullableProcessor = (schema, ctx, json2, params) => {
|
|
13351
13351
|
const def = schema._zod.def;
|
|
13352
|
-
const inner =
|
|
13352
|
+
const inner = process2(def.innerType, ctx, params);
|
|
13353
13353
|
const seen = ctx.seen.get(schema);
|
|
13354
13354
|
if (ctx.target === "openapi-3.0") {
|
|
13355
13355
|
seen.ref = def.innerType;
|
|
@@ -13360,20 +13360,20 @@ var nullableProcessor = (schema, ctx, json2, params) => {
|
|
|
13360
13360
|
};
|
|
13361
13361
|
var nonoptionalProcessor = (schema, ctx, _json, params) => {
|
|
13362
13362
|
const def = schema._zod.def;
|
|
13363
|
-
|
|
13363
|
+
process2(def.innerType, ctx, params);
|
|
13364
13364
|
const seen = ctx.seen.get(schema);
|
|
13365
13365
|
seen.ref = def.innerType;
|
|
13366
13366
|
};
|
|
13367
13367
|
var defaultProcessor = (schema, ctx, json2, params) => {
|
|
13368
13368
|
const def = schema._zod.def;
|
|
13369
|
-
|
|
13369
|
+
process2(def.innerType, ctx, params);
|
|
13370
13370
|
const seen = ctx.seen.get(schema);
|
|
13371
13371
|
seen.ref = def.innerType;
|
|
13372
13372
|
json2.default = JSON.parse(JSON.stringify(def.defaultValue));
|
|
13373
13373
|
};
|
|
13374
13374
|
var prefaultProcessor = (schema, ctx, json2, params) => {
|
|
13375
13375
|
const def = schema._zod.def;
|
|
13376
|
-
|
|
13376
|
+
process2(def.innerType, ctx, params);
|
|
13377
13377
|
const seen = ctx.seen.get(schema);
|
|
13378
13378
|
seen.ref = def.innerType;
|
|
13379
13379
|
if (ctx.io === "input")
|
|
@@ -13381,7 +13381,7 @@ var prefaultProcessor = (schema, ctx, json2, params) => {
|
|
|
13381
13381
|
};
|
|
13382
13382
|
var catchProcessor = (schema, ctx, json2, params) => {
|
|
13383
13383
|
const def = schema._zod.def;
|
|
13384
|
-
|
|
13384
|
+
process2(def.innerType, ctx, params);
|
|
13385
13385
|
const seen = ctx.seen.get(schema);
|
|
13386
13386
|
seen.ref = def.innerType;
|
|
13387
13387
|
let catchValue;
|
|
@@ -13396,32 +13396,32 @@ var pipeProcessor = (schema, ctx, _json, params) => {
|
|
|
13396
13396
|
const def = schema._zod.def;
|
|
13397
13397
|
const inIsTransform = def.in._zod.traits.has("$ZodTransform");
|
|
13398
13398
|
const innerType = ctx.io === "input" ? inIsTransform ? def.out : def.in : def.out;
|
|
13399
|
-
|
|
13399
|
+
process2(innerType, ctx, params);
|
|
13400
13400
|
const seen = ctx.seen.get(schema);
|
|
13401
13401
|
seen.ref = innerType;
|
|
13402
13402
|
};
|
|
13403
13403
|
var readonlyProcessor = (schema, ctx, json2, params) => {
|
|
13404
13404
|
const def = schema._zod.def;
|
|
13405
|
-
|
|
13405
|
+
process2(def.innerType, ctx, params);
|
|
13406
13406
|
const seen = ctx.seen.get(schema);
|
|
13407
13407
|
seen.ref = def.innerType;
|
|
13408
13408
|
json2.readOnly = true;
|
|
13409
13409
|
};
|
|
13410
13410
|
var promiseProcessor = (schema, ctx, _json, params) => {
|
|
13411
13411
|
const def = schema._zod.def;
|
|
13412
|
-
|
|
13412
|
+
process2(def.innerType, ctx, params);
|
|
13413
13413
|
const seen = ctx.seen.get(schema);
|
|
13414
13414
|
seen.ref = def.innerType;
|
|
13415
13415
|
};
|
|
13416
13416
|
var optionalProcessor = (schema, ctx, _json, params) => {
|
|
13417
13417
|
const def = schema._zod.def;
|
|
13418
|
-
|
|
13418
|
+
process2(def.innerType, ctx, params);
|
|
13419
13419
|
const seen = ctx.seen.get(schema);
|
|
13420
13420
|
seen.ref = def.innerType;
|
|
13421
13421
|
};
|
|
13422
13422
|
var lazyProcessor = (schema, ctx, _json, params) => {
|
|
13423
13423
|
const innerType = schema._zod.innerType;
|
|
13424
|
-
|
|
13424
|
+
process2(innerType, ctx, params);
|
|
13425
13425
|
const seen = ctx.seen.get(schema);
|
|
13426
13426
|
seen.ref = innerType;
|
|
13427
13427
|
};
|
|
@@ -13473,7 +13473,7 @@ function toJSONSchema(input, params) {
|
|
|
13473
13473
|
const defs = {};
|
|
13474
13474
|
for (const entry of registry2._idmap.entries()) {
|
|
13475
13475
|
const [_, schema] = entry;
|
|
13476
|
-
|
|
13476
|
+
process2(schema, ctx2);
|
|
13477
13477
|
}
|
|
13478
13478
|
const schemas = {};
|
|
13479
13479
|
const external = {
|
|
@@ -13496,7 +13496,7 @@ function toJSONSchema(input, params) {
|
|
|
13496
13496
|
return { schemas };
|
|
13497
13497
|
}
|
|
13498
13498
|
const ctx = initializeContext({ ...params, processors: allProcessors });
|
|
13499
|
-
|
|
13499
|
+
process2(input, ctx);
|
|
13500
13500
|
extractDefs(ctx, input);
|
|
13501
13501
|
return finalize(ctx, input);
|
|
13502
13502
|
}
|
|
@@ -13554,7 +13554,7 @@ var JSONSchemaGenerator = class {
|
|
|
13554
13554
|
* This must be called before emit().
|
|
13555
13555
|
*/
|
|
13556
13556
|
process(schema, _params = { path: [], schemaPath: [] }) {
|
|
13557
|
-
return
|
|
13557
|
+
return process2(schema, this.ctx, _params);
|
|
13558
13558
|
}
|
|
13559
13559
|
/**
|
|
13560
13560
|
* Emit the final JSON Schema after processing.
|
|
@@ -19187,11 +19187,26 @@ function carrierPrefix(carrier, constructorArg, objectName, scope, scan) {
|
|
|
19187
19187
|
}
|
|
19188
19188
|
|
|
19189
19189
|
// src/project.ts
|
|
19190
|
+
function reportUnresolvedProjectModules(options) {
|
|
19191
|
+
for (const pack of options.packs) {
|
|
19192
|
+
for (const module of pack.projectModules ?? []) {
|
|
19193
|
+
const resolved = resolveAbsoluteModule(module, { roots: options.roots });
|
|
19194
|
+
if (resolved.status === "resolved") {
|
|
19195
|
+
continue;
|
|
19196
|
+
}
|
|
19197
|
+
process.stderr.write(
|
|
19198
|
+
`[suss] ${pack.name}: the configured module ${module} does not resolve under ${options.roots.join(", ")}, so nothing it wraps will be discovered.
|
|
19199
|
+
`
|
|
19200
|
+
);
|
|
19201
|
+
}
|
|
19202
|
+
}
|
|
19203
|
+
}
|
|
19190
19204
|
async function extractPythonProject(options) {
|
|
19191
19205
|
const db = new Database();
|
|
19192
19206
|
const summaries = [];
|
|
19193
19207
|
const gapHandling = options.gapHandling ?? "permissive";
|
|
19194
19208
|
const displayPathOf = (file2) => options.workspaceRoot !== void 0 ? path3.relative(options.workspaceRoot, file2) : file2;
|
|
19209
|
+
reportUnresolvedProjectModules(options);
|
|
19195
19210
|
const bound = [];
|
|
19196
19211
|
for (const file2 of options.files) {
|
|
19197
19212
|
const source = fs3.readFileSync(file2, "utf8");
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@suss/adapter-python",
|
|
3
|
-
"version": "0.5.
|
|
3
|
+
"version": "0.5.11",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "Python language adapter for suss — parses source with tree-sitter (WASM), resolves names with a lexical binder, and emits raw extractions for the suss pipeline.",
|
|
6
6
|
"keywords": [
|
|
@@ -47,9 +47,9 @@
|
|
|
47
47
|
"typecheck": "tsc --noEmit"
|
|
48
48
|
},
|
|
49
49
|
"dependencies": {
|
|
50
|
-
"@suss/behavioral-ir": "0.5.
|
|
51
|
-
"@suss/datalog": "0.5.
|
|
52
|
-
"@suss/extractor": "0.5.
|
|
50
|
+
"@suss/behavioral-ir": "0.5.11",
|
|
51
|
+
"@suss/datalog": "0.5.11",
|
|
52
|
+
"@suss/extractor": "0.5.11",
|
|
53
53
|
"web-tree-sitter": "^0.26.11"
|
|
54
54
|
},
|
|
55
55
|
"devDependencies": {
|