Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 14 additions & 2 deletions src/dataconnect/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@
debugDetails?: string;
warningLevel?: WarningLevel;
workarounds?: Workaround[];
[key: string]: any;

Check warning on line 107 in src/dataconnect/types.ts

View workflow job for this annotation

GitHub Actions / lint (20)

Unexpected any. Specify a different type
}

export interface BuildResult {
Expand All @@ -120,7 +120,7 @@
};
}

export function requiresVector(dm?: DeploymentMetadata): boolean {

Check warning on line 123 in src/dataconnect/types.ts

View workflow job for this annotation

GitHub Actions / lint (20)

Missing JSDoc comment
return dm?.primaryDataSource?.postgres?.requiredExtensions?.includes("vector") ?? false;
}

Expand Down Expand Up @@ -173,29 +173,43 @@
angular?: boolean;
}

// Describe the cache configuration from YAML
export interface CacheSettings {
maxAge?: string;
maxSize?: string;
storage?: "persistent" | "memory";
}

export interface AdminNodeSDK {
outputDir: string;
package: string;
packageJsonDir?: string;
clientCache?: CacheSettings;

Check failure on line 187 in src/dataconnect/types.ts

View workflow job for this annotation

GitHub Actions / unit (24)

Delete `·`

Check failure on line 187 in src/dataconnect/types.ts

View workflow job for this annotation

GitHub Actions / lint (20)

Delete `·`

Check failure on line 187 in src/dataconnect/types.ts

View workflow job for this annotation

GitHub Actions / unit (24)

Delete `·`
}

export interface JavascriptSDK extends SupportedFrameworks {
outputDir: string;
package: string;
packageJsonDir?: string;
clientCache?: CacheSettings;

Check failure on line 194 in src/dataconnect/types.ts

View workflow job for this annotation

GitHub Actions / unit (24)

Delete `·`

Check failure on line 194 in src/dataconnect/types.ts

View workflow job for this annotation

GitHub Actions / lint (20)

Delete `·`

Check failure on line 194 in src/dataconnect/types.ts

View workflow job for this annotation

GitHub Actions / unit (24)

Delete `·`
}

export interface SwiftSDK {
outputDir: string;
package: string;
clientCache?: CacheSettings;

Check failure on line 200 in src/dataconnect/types.ts

View workflow job for this annotation

GitHub Actions / unit (24)

Delete `·`

Check failure on line 200 in src/dataconnect/types.ts

View workflow job for this annotation

GitHub Actions / lint (20)

Delete `·`

Check failure on line 200 in src/dataconnect/types.ts

View workflow job for this annotation

GitHub Actions / unit (24)

Delete `·`
}

export interface KotlinSDK {
outputDir: string;
package: string;
clientCache?: CacheSettings;

Check failure on line 206 in src/dataconnect/types.ts

View workflow job for this annotation

GitHub Actions / unit (24)

Delete `·`

Check failure on line 206 in src/dataconnect/types.ts

View workflow job for this annotation

GitHub Actions / lint (20)

Delete `·`

Check failure on line 206 in src/dataconnect/types.ts

View workflow job for this annotation

GitHub Actions / unit (24)

Delete `·`
}

export interface DartSDK {
outputDir: string;
package: string;
clientCache?: CacheSettings;

Check failure on line 212 in src/dataconnect/types.ts

View workflow job for this annotation

GitHub Actions / unit (24)

Delete `·`

Check failure on line 212 in src/dataconnect/types.ts

View workflow job for this annotation

GitHub Actions / lint (20)

Delete `·`

Check failure on line 212 in src/dataconnect/types.ts

View workflow job for this annotation

GitHub Actions / unit (24)

Delete `·`
}

// Helper types && converters
Expand All @@ -214,7 +228,7 @@
connectorYaml: ConnectorYaml;
}

export function toDatasource(

Check warning on line 231 in src/dataconnect/types.ts

View workflow job for this annotation

GitHub Actions / lint (20)

Missing JSDoc comment
projectId: string,
locationId: string,
ds: DatasourceYaml,
Expand Down Expand Up @@ -284,7 +298,7 @@
}

export interface GraphqlResponse {
data: Record<string, any>;

Check warning on line 301 in src/dataconnect/types.ts

View workflow job for this annotation

GitHub Actions / lint (20)

Unexpected any. Specify a different type
errors: GraphqlError[];
}

Expand All @@ -308,9 +322,9 @@
details?: GraphqlError[];
}

export const isGraphQLResponse = (g: any): g is GraphqlResponse => !!g.data || !!g.errors;

Check warning on line 325 in src/dataconnect/types.ts

View workflow job for this annotation

GitHub Actions / lint (20)

Unsafe member access .errors on an `any` value

Check warning on line 325 in src/dataconnect/types.ts

View workflow job for this annotation

GitHub Actions / lint (20)

Unsafe member access .data on an `any` value

Check warning on line 325 in src/dataconnect/types.ts

View workflow job for this annotation

GitHub Actions / lint (20)

Unexpected any. Specify a different type
export const isGraphQLResponseError = (g: any): g is GraphqlResponseError =>

Check warning on line 326 in src/dataconnect/types.ts

View workflow job for this annotation

GitHub Actions / lint (20)

Unexpected any. Specify a different type
!!g.error?.message || !!g.message;

Check warning on line 327 in src/dataconnect/types.ts

View workflow job for this annotation

GitHub Actions / lint (20)

Unsafe member access .message on an `any` value

Check warning on line 327 in src/dataconnect/types.ts

View workflow job for this annotation

GitHub Actions / lint (20)

Unsafe member access .error on an `any` value

interface ImpersonationAuthenticated {
authClaims: any;
Expand All @@ -321,5 +335,3 @@
includeDebugDetails?: boolean;
}
export type Impersonation = ImpersonationAuthenticated | ImpersonationUnauthenticated;

/** End Dataplane Client Types */
2 changes: 1 addition & 1 deletion src/init/features/dataconnect/sdk.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -570,4 +570,4 @@
const parsedYaml = yaml.load(writtenYaml);
expect(parsedYaml.generate.javascriptSdk).to.have.lengthOf(1);
});
});
});

Check failure on line 573 in src/init/features/dataconnect/sdk.spec.ts

View workflow job for this annotation

GitHub Actions / unit (24)

Insert `⏎`

Check failure on line 573 in src/init/features/dataconnect/sdk.spec.ts

View workflow job for this annotation

GitHub Actions / lint (20)

Insert `⏎`

Check failure on line 573 in src/init/features/dataconnect/sdk.spec.ts

View workflow job for this annotation

GitHub Actions / unit (24)

Insert `⏎`
Loading