@builder.io/dev-tools 1.7.25-dev.202507250515.3d817ea9d → 1.7.26

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.
@@ -1,33 +1,36 @@
1
1
  import type { DevToolsSys } from "../types";
2
2
  import type { Credentials } from "./credentials";
3
- import type { GitBackupDownloadUrlResult, GitBackupDownloadUrlOptions, GitBackupUploadUrlResult, GitBackupUploadUrlOptions, GitBackupRecordOptions, GitBackupRecordResult } from "$/ai-utils";
3
+ import type { GitBackupUploadUrlResult, GitBackupUploadUrlOptions, GitBackupRecordOptions, GitBackupRecordResult, BackupMetadata } from "$/ai-utils";
4
4
  /**
5
5
  * Requests a signed upload URL for git backup
6
6
  */
7
7
  export declare function requestSignedUploadUrl(credentials: Credentials, body: GitBackupUploadUrlOptions): Promise<GitBackupUploadUrlResult>;
8
- /**
9
- * Requests a signed download URL for git backup
10
- */
11
- export declare function requestSignedDownloadUrl(credentials: Credentials, body: GitBackupDownloadUrlOptions): Promise<GitBackupDownloadUrlResult>;
12
8
  /**
13
9
  * Records a successful git backup in Firebase
14
10
  */
15
11
  export declare function recordBackup(credentials: Credentials, body: GitBackupRecordOptions): Promise<GitBackupRecordResult>;
16
- export type GitBackupDownloadResult = {
17
- success: boolean;
18
- partial?: boolean;
19
- exists?: boolean;
20
- bundlePath?: string;
21
- bundleSize?: number;
22
- error?: Error;
23
- message?: string;
24
- };
12
+ export interface GitBackupDownloadResultValid {
13
+ success: true;
14
+ partial: boolean;
15
+ bundlePath: string;
16
+ bundleSize: number;
17
+ gitBranchName: string;
18
+ }
19
+ export interface GitBackupDownloadResultInvalid {
20
+ success: false;
21
+ error: Error;
22
+ }
23
+ export type GitBackupDownloadResult = GitBackupDownloadResultValid | GitBackupDownloadResultInvalid;
25
24
  /**
26
25
  * Downloads a git backup bundle
27
26
  * @returns The path to the downloaded bundle file, or null if no backup exists
28
27
  */
29
- export declare function downloadGitBackup(sys: DevToolsSys, credentials: Credentials, options: GitBackupDownloadUrlOptions): Promise<GitBackupDownloadResult>;
28
+ export declare function downloadGitBackup(sys: DevToolsSys, response: BackupMetadata): Promise<GitBackupDownloadResult>;
30
29
  /**
31
30
  * Uploads a file stream to a signed URL
32
31
  */
33
- export declare function uploadFileStream(filePath: string, signedUrl: string, size: number): Promise<Response>;
32
+ export declare function uploadFileStream(filePath: string, signedUrl: string, size: number, contentMd5: string): Promise<Response>;
33
+ export declare function computeMD5Hash(bundlePath: string): Promise<{
34
+ contentMd5: string;
35
+ size: number;
36
+ }>;
@@ -87,12 +87,14 @@ export declare class CodeGenSession {
87
87
  filePath?: undefined;
88
88
  expiresAt?: undefined;
89
89
  bundleSize?: undefined;
90
+ contentMd5?: undefined;
90
91
  error?: undefined;
91
92
  } | {
92
93
  success: boolean;
93
94
  filePath: string;
94
95
  expiresAt: string;
95
96
  bundleSize: number;
97
+ contentMd5: string;
96
98
  skipped?: undefined;
97
99
  reason?: undefined;
98
100
  lastCommitHash?: undefined;
@@ -106,6 +108,7 @@ export declare class CodeGenSession {
106
108
  filePath?: undefined;
107
109
  expiresAt?: undefined;
108
110
  bundleSize?: undefined;
111
+ contentMd5?: undefined;
109
112
  }>;
110
113
  createPR(...args: [
111
114
  {
@@ -153,7 +156,7 @@ export declare class CodeGenSession {
153
156
  /**
154
157
  * Get the current commit hash
155
158
  */
156
- getCurrentCommitHash(): Promise<string | undefined>;
159
+ getCurrentCommitHash(branchName?: string): Promise<string | undefined>;
157
160
  /**
158
161
  * Get the feature branch name
159
162
  */
@@ -17,7 +17,7 @@ export declare const NUMBER_TYPES: string[];
17
17
  export declare const BOOLEAN_TYPES: string[];
18
18
  export declare const ARRAY_TYPES: string[];
19
19
  export declare const OBJECT_TYPES: string[];
20
- export declare function getPrimitiveType(t: string): "string" | "object" | "number" | "boolean" | "array";
20
+ export declare function getPrimitiveType(t: string): "number" | "string" | "boolean" | "object" | "array";
21
21
  export declare function removeQuotes(text: string): string;
22
22
  export declare const resolveType: (sys: DevToolsSys, checker: ts.TypeChecker, type: ts.Type) => string[] | undefined;
23
23
  export declare const typeToString: (sys: DevToolsSys, checker: ts.TypeChecker, type: ts.Type) => string;
@@ -19,7 +19,7 @@ export declare function clone<T>(obj: T): T;
19
19
  export declare function shouldSkipFolder(sys: DevToolsSys, skipFolders: Set<string>, fileName: string): boolean;
20
20
  export declare function getPackageManager(): string;
21
21
  export declare function isWindows(): boolean;
22
- export declare function builderNpxPackage(): "builder.io" | "\"@builder.io/dev-tools\"";
22
+ export declare function builderNpxPackage(): "\"@builder.io/dev-tools\"" | "builder.io";
23
23
  /**
24
24
  * Sanitizes a component name for use in filesystem paths by replacing invalid characters with underscores
25
25
  * @param name The component name to sanitize