Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update integrations to allow custom checkpoint locations #1501

Merged
merged 18 commits into from
Mar 9, 2024
Merged
Changes from 1 commit
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
Next Next commit
Update integration type for new format
Signed-off-by: Simeon Widdis <sawiddis@amazon.com>
  • Loading branch information
Swiddis committed Mar 6, 2024
commit 9516abdc20d8186a8143f0bfd18f20b172b7d769
45 changes: 14 additions & 31 deletions server/adaptors/integrations/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@ type Result<T, E = Error> =
| { ok: true; value: T; error?: undefined }
| { ok: false; error: E; value?: undefined };

type SupportedAssetType = 'savedObjectBundle' | 'query';

interface IntegrationConfig {
name: string;
version: string;
Expand All @@ -19,7 +21,7 @@ interface IntegrationConfig {
sourceUrl?: string;
statics?: IntegrationStatics;
components: IntegrationComponent[];
assets: IntegrationAssets;
assets: IntegrationAsset[];
sampleData?: {
path: string;
};
Expand All @@ -29,7 +31,7 @@ interface IntegrationConfig {
interface SerializedIntegration extends IntegrationConfig {
statics?: SerializedIntegrationStatics;
components: SerializedIntegrationComponent[];
assets: SerializedIntegrationAssets;
assets: SerializedIntegrationAsset[];
sampleData?: {
path: string;
data: string;
Expand All @@ -50,38 +52,19 @@ interface SerializedIntegrationStatics {
darkModeGallery?: SerializedStaticAsset[];
}

interface IntegrationAssets {
savedObjects?: {
name: string;
version: string;
};
queries?: Array<{
name: string;
version: string;
language: string;
}>;
interface IntegrationAsset {
name: string;
version: string;
extension: string;
type: SupportedAssetType;
}

interface ParsedIntegrationAssets {
savedObjects?: object[];
queries?: Array<{
query: string;
language: string;
}>;
}
type ParsedIntegrationAsset =
| { type: 'savedObjectBundle'; data: object[] }
| { type: 'query'; query: string; language: string };

interface SerializedIntegrationAssets extends IntegrationAssets {
savedObjects?: {
name: string;
version: string;
data: string;
};
queries?: Array<{
name: string;
version: string;
language: string;
data: string;
}>;
interface SerializedIntegrationAsset extends IntegrationAsset {
data: string;
}

interface StaticAsset {
Expand Down