@vercel/python-analysis 0.8.1 → 0.9.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.
@@ -27,6 +27,16 @@
27
27
  * ```
28
28
  */
29
29
  export declare function containsAppOrHandler(source: string): Promise<boolean>;
30
+ /**
31
+ * Check if a top-level callable with the given name exists in Python source.
32
+ *
33
+ * Returns true if found, false otherwise.
34
+ * Returns false for invalid Python syntax.
35
+ *
36
+ * @param source - The Python source code to analyze
37
+ * @param name - The callable name to look for (e.g. "cleanup")
38
+ */
39
+ export declare function containsTopLevelCallable(source: string, name: string): Promise<boolean>;
30
40
  /**
31
41
  * Extract the string value of a top-level constant with the given name.
32
42
  * Only considers simple assignments (NAME = "string") and annotated assignments
@@ -38,12 +48,3 @@ export declare function containsAppOrHandler(source: string): Promise<boolean>;
38
48
  * @returns The string value or null
39
49
  */
40
50
  export declare function getStringConstant(source: string, name: string): Promise<string | null>;
41
- /**
42
- * Parse manage.py content for DJANGO_SETTINGS_MODULE (e.g. from
43
- * os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'app.settings')).
44
- * Uses the WASM Python parser to extract the value from the AST.
45
- *
46
- * @param content - Raw content of manage.py
47
- * @returns The settings module string (e.g. 'app.settings') or null if not found
48
- */
49
- export declare function parseDjangoSettingsModule(content: string): Promise<string | null>;
@@ -0,0 +1,3 @@
1
+ /** @module Interface wasi:cli/stdin@0.2.6 **/
2
+ export function getStdin(): InputStream;
3
+ export type InputStream = import('./wasi-io-streams.js').InputStream;
@@ -0,0 +1,3 @@
1
+ /** @module Interface wasi:cli/stdout@0.2.6 **/
2
+ export function getStdout(): OutputStream;
3
+ export type OutputStream = import('./wasi-io-streams.js').OutputStream;
@@ -0,0 +1,8 @@
1
+ /** @module Interface wasi:cli/terminal-input@0.2.6 **/
2
+
3
+ export class TerminalInput {
4
+ /**
5
+ * This type does not have a public constructor.
6
+ */
7
+ private constructor();
8
+ }
@@ -0,0 +1,8 @@
1
+ /** @module Interface wasi:cli/terminal-output@0.2.6 **/
2
+
3
+ export class TerminalOutput {
4
+ /**
5
+ * This type does not have a public constructor.
6
+ */
7
+ private constructor();
8
+ }
@@ -0,0 +1,3 @@
1
+ /** @module Interface wasi:cli/terminal-stderr@0.2.6 **/
2
+ export function getTerminalStderr(): TerminalOutput | undefined;
3
+ export type TerminalOutput = import('./wasi-cli-terminal-output.js').TerminalOutput;
@@ -0,0 +1,3 @@
1
+ /** @module Interface wasi:cli/terminal-stdin@0.2.6 **/
2
+ export function getTerminalStdin(): TerminalInput | undefined;
3
+ export type TerminalInput = import('./wasi-cli-terminal-input.js').TerminalInput;
@@ -0,0 +1,3 @@
1
+ /** @module Interface wasi:cli/terminal-stdout@0.2.6 **/
2
+ export function getTerminalStdout(): TerminalOutput | undefined;
3
+ export type TerminalOutput = import('./wasi-cli-terminal-output.js').TerminalOutput;
@@ -5,5 +5,4 @@ export class Error {
5
5
  * This type does not have a public constructor.
6
6
  */
7
7
  private constructor();
8
- toDebugString(): string;
9
8
  }
@@ -0,0 +1,9 @@
1
+ /** @module Interface wasi:io/poll@0.2.6 **/
2
+
3
+ export class Pollable {
4
+ /**
5
+ * This type does not have a public constructor.
6
+ */
7
+ private constructor();
8
+ block(): void;
9
+ }
@@ -8,11 +8,22 @@ export interface StreamErrorLastOperationFailed {
8
8
  export interface StreamErrorClosed {
9
9
  tag: 'closed',
10
10
  }
11
+ export type Pollable = import('./wasi-io-poll.js').Pollable;
12
+
13
+ export class InputStream {
14
+ /**
15
+ * This type does not have a public constructor.
16
+ */
17
+ private constructor();
18
+ }
11
19
 
12
20
  export class OutputStream {
13
21
  /**
14
22
  * This type does not have a public constructor.
15
23
  */
16
24
  private constructor();
17
- blockingWriteAndFlush(contents: Uint8Array): void;
25
+ checkWrite(): bigint;
26
+ write(contents: Uint8Array): void;
27
+ blockingFlush(): void;
28
+ subscribe(): Pollable;
18
29
  }
@@ -56,21 +56,37 @@ export interface DirectUrlInfoVcs {
56
56
  import type * as WasiCliEnvironment from './interfaces/wasi-cli-environment.js'; // wasi:cli/environment@0.2.6
57
57
  import type * as WasiCliExit from './interfaces/wasi-cli-exit.js'; // wasi:cli/exit@0.2.6
58
58
  import type * as WasiCliStderr from './interfaces/wasi-cli-stderr.js'; // wasi:cli/stderr@0.2.6
59
+ import type * as WasiCliStdin from './interfaces/wasi-cli-stdin.js'; // wasi:cli/stdin@0.2.6
60
+ import type * as WasiCliStdout from './interfaces/wasi-cli-stdout.js'; // wasi:cli/stdout@0.2.6
61
+ import type * as WasiCliTerminalInput from './interfaces/wasi-cli-terminal-input.js'; // wasi:cli/terminal-input@0.2.6
62
+ import type * as WasiCliTerminalOutput from './interfaces/wasi-cli-terminal-output.js'; // wasi:cli/terminal-output@0.2.6
63
+ import type * as WasiCliTerminalStderr from './interfaces/wasi-cli-terminal-stderr.js'; // wasi:cli/terminal-stderr@0.2.6
64
+ import type * as WasiCliTerminalStdin from './interfaces/wasi-cli-terminal-stdin.js'; // wasi:cli/terminal-stdin@0.2.6
65
+ import type * as WasiCliTerminalStdout from './interfaces/wasi-cli-terminal-stdout.js'; // wasi:cli/terminal-stdout@0.2.6
59
66
  import type * as WasiIoError from './interfaces/wasi-io-error.js'; // wasi:io/error@0.2.6
67
+ import type * as WasiIoPoll from './interfaces/wasi-io-poll.js'; // wasi:io/poll@0.2.6
60
68
  import type * as WasiIoStreams from './interfaces/wasi-io-streams.js'; // wasi:io/streams@0.2.6
61
69
  import type * as WasiRandomInsecureSeed from './interfaces/wasi-random-insecure-seed.js'; // wasi:random/insecure-seed@0.2.6
62
70
  export interface ImportObject {
63
71
  'wasi:cli/environment@0.2.6': typeof WasiCliEnvironment,
64
72
  'wasi:cli/exit@0.2.6': typeof WasiCliExit,
65
73
  'wasi:cli/stderr@0.2.6': typeof WasiCliStderr,
74
+ 'wasi:cli/stdin@0.2.6': typeof WasiCliStdin,
75
+ 'wasi:cli/stdout@0.2.6': typeof WasiCliStdout,
76
+ 'wasi:cli/terminal-input@0.2.6': typeof WasiCliTerminalInput,
77
+ 'wasi:cli/terminal-output@0.2.6': typeof WasiCliTerminalOutput,
78
+ 'wasi:cli/terminal-stderr@0.2.6': typeof WasiCliTerminalStderr,
79
+ 'wasi:cli/terminal-stdin@0.2.6': typeof WasiCliTerminalStdin,
80
+ 'wasi:cli/terminal-stdout@0.2.6': typeof WasiCliTerminalStdout,
66
81
  'wasi:io/error@0.2.6': typeof WasiIoError,
82
+ 'wasi:io/poll@0.2.6': typeof WasiIoPoll,
67
83
  'wasi:io/streams@0.2.6': typeof WasiIoStreams,
68
84
  'wasi:random/insecure-seed@0.2.6': typeof WasiRandomInsecureSeed,
69
85
  }
70
86
  export interface Root {
71
87
  containsAppOrHandler(source: string): boolean,
72
88
  getStringConstant(source: string, name: string): string | undefined,
73
- parseDjangoSettingsModule(source: string): string | undefined,
89
+ containsTopLevelCallable(source: string, name: string): boolean,
74
90
  parseDistMetadata(content: Uint8Array): DistMetadata,
75
91
  parseRecord(content: string): Array<RecordEntry>,
76
92
  parseDirectUrl(content: string): DirectUrlInfo,