Skip to content

Commit

Permalink
doc: add @public release-tag (#1664)
Browse files Browse the repository at this point in the history
* fix: add stats price fallback
  • Loading branch information
victorcg88 authored Nov 25, 2024
1 parent 63d7b99 commit 74a69aa
Show file tree
Hide file tree
Showing 12 changed files with 26 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@ import { relatedPromptsRequestSchema } from '../../schemas/requests/related-prom

/**
* Default implementation for the RelatedPromptsRequestMapper.
*
* @public
*/
export const relatedPromptsRequestMapper = schemaMapperFactory<
RelatedPromptsRequest,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@ import { relatedPromptsResponseSchema } from '../../schemas/responses/related-pr

/**
* Default implementation for the RelatedPromptsResponseMapper.
*
* @public
*/
export const relatedPromptsResponseMapper = schemaMapperFactory<
PlatformRelatedPromptsResponse,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@ import { PlatformRelatedPrompt } from '../../types/models/related-prompt.model';

/**
* Default implementation for the RelatedPromptSchema.
*
* @public
*/
export const relatedPromptSchema = createMutableSchema<PlatformRelatedPrompt, RelatedPrompt>({
modelName: () => 'RelatedPrompt',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import { PlatformStats } from '../../types/models/stats.model';
*/
export const statsSchema = createMutableSchema<PlatformStats, Stats>({
price: {
min: ({ price }) => Number(price.min),
max: ({ price }) => Number(price.max)
min: ({ price }) => (price?.min ? Number(price.min) : undefined),
max: ({ price }) => (price?.max ? Number(price.max) : undefined)
}
});
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@ import { PlatformRelatedPromptsRequest } from '../../types/requests/related-prom

/**
* Default implementation for the RelatedPromptsRequestSchema.
*
* @public
*/
export const relatedPromptsRequestSchema = createMutableSchema<
RelatedPromptsRequest,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@ import { relatedPromptSchema } from '../models/related-prompt.schema';

/**
* Default implementation for the RelatedPromptsResponseSchema.
*
* @public
*/
export const relatedPromptsResponseSchema = createMutableSchema<
PlatformRelatedPromptsResponse,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
/**
* Related prompt model for the `platform` API.
*
* @public
*/
export interface PlatformRelatedPrompt {
nextQueries: string[];
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@ import { PlatformRelatedPrompt } from '../models/related-prompt.model';

/**
* Response for the `related prompts` endpoint.
*
* @public
*/
export interface PlatformRelatedPromptsResponse {
data: {
Expand Down
2 changes: 2 additions & 0 deletions packages/x-types/src/query-signals/related-prompt.model.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@ import { NamedModel } from '../named-model.model';

/**
* Represents a related prompt.
*
* @public
*/
export interface RelatedPrompt extends NamedModel<'RelatedPrompt'> {
/** The next queries related to the prompt. */
Expand Down
2 changes: 2 additions & 0 deletions packages/x-types/src/request/related-prompts-request.model.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,7 @@ import { ExtraParamsRequest, QueryableRequest } from './request.model';

/**
* Request for Related Prompts endpoint.
*
* @public
*/
export interface RelatedPromptsRequest extends QueryableRequest, ExtraParamsRequest {}
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@ import { RelatedPrompt } from '../query-signals/related-prompt.model';

/**
* Response for the related prompts endpoint.
*
* @public
*/
export interface RelatedPromptsResponse {
relatedPrompts: RelatedPrompt[];
Expand Down
5 changes: 4 additions & 1 deletion packages/x-types/src/stats.model.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,8 @@
* @public
*/
export interface Stats {
price: { min: number; max: number };
price: {
min: number | undefined;
max: number | undefined;
};
}

0 comments on commit 74a69aa

Please sign in to comment.