Skip to content

Commit

Permalink
add notices schema
Browse files Browse the repository at this point in the history
  • Loading branch information
sobolk committed Feb 6, 2025
1 parent de90deb commit 927de11
Show file tree
Hide file tree
Showing 4 changed files with 43 additions and 1 deletion.
29 changes: 29 additions & 0 deletions packages/platform-core/API.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,14 @@ declare namespace __export__cdk {
}
export { __export__cdk }

declare namespace __export__notices {
export {
noticeSchema,
Notice
}
}
export { __export__notices }

// @public
export abstract class AmplifyError<T extends string = string> extends Error {
constructor(name: T, classification: AmplifyErrorClassification, options: AmplifyErrorOptions, cause?: Error | undefined);
Expand Down Expand Up @@ -154,6 +162,27 @@ export class NamingConverter {
toScreamingSnakeCase(input: string): string;
}

// @public (undocumented)
type Notice = z.infer<typeof noticeSchema>;

// @public (undocumented)
const noticeSchema: z.ZodObject<{
id: z.ZodString;
title: z.ZodString;
details: z.ZodString;
link: z.ZodString;
}, "strip", z.ZodTypeAny, {
id: string;
title: string;
details: string;
link: string;
}, {
id: string;
title: string;
details: string;
link: string;
}>;

// @public
export class ObjectAccumulator<T> {
constructor(accumulator: DeepPartialAmplifyGeneratedConfigs<T>, versionKey?: string);
Expand Down
4 changes: 3 additions & 1 deletion packages/platform-core/src/index.internal.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
// Suppressing to allow special prefix __export__ that is recognized by API checks.
// eslint-disable-next-line @typescript-eslint/naming-convention
import * as __export__cdk from './cdk/index.js';
// eslint-disable-next-line @typescript-eslint/naming-convention
import * as __export__notices from './notices/index.js';

export * from './index.js';

Expand All @@ -9,4 +11,4 @@ export * from './index.js';
Because this package has a submodule export, we are working around this issue by including that export here and directing api-extract to this entry point instead
This allows api-extractor to pick up the submodule exports in its analysis
*/
export { __export__cdk };
export { __export__cdk, __export__notices };
1 change: 1 addition & 0 deletions packages/platform-core/src/notices/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export * from './notices.js';
10 changes: 10 additions & 0 deletions packages/platform-core/src/notices/notices.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
import z from 'zod';

export const noticeSchema = z.object({
id: z.string(),
title: z.string(),
details: z.string(),
link: z.string(),
});

export type Notice = z.infer<typeof noticeSchema>;

0 comments on commit 927de11

Please sign in to comment.