Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
53 commits
Select commit Hold shift + click to select a range
548e2ed
Add entry zod schemas
flops Jun 30, 2025
ca6789f
Merge branch 'main' of github.com:datalens-tech/datalens-ui into CHAR…
flops Jun 30, 2025
cf9a3b7
Merge branch 'main' of github.com:datalens-tech/datalens-ui into CHAR…
flops Jul 2, 2025
7b96f7b
Merge branch 'main' of github.com:datalens-tech/datalens-ui into CHAR…
flops Jul 15, 2025
6e16468
Merge branch 'main' of github.com:datalens-tech/datalens-ui into CHAR…
flops Jul 17, 2025
0efbbd7
Merge branch 'main' of github.com:datalens-tech/datalens-ui into CHAR…
flops Jul 21, 2025
f6b1eb1
Added public-api export
flops Jul 23, 2025
9f50ea3
Swagger
flops Jul 31, 2025
0b20b13
Add wizard api hanlers
flops Aug 4, 2025
d6a4680
Wizard Hierarchy fix
flops Aug 4, 2025
c7eb299
Wizard update and create
flops Aug 4, 2025
08a08a1
Fix types and comment
flops Aug 4, 2025
5356131
Added actions
flops Aug 6, 2025
fafce39
Dash descriptions
flops Aug 8, 2025
33915fb
Merge branch 'main' of github.com:datalens-tech/datalens-ui into CHAR…
flops Aug 12, 2025
9e87f79
Public api features (#2800)
stepanenkoxx Aug 29, 2025
d6830ef
Merge branch 'main' into CHARTS-11469-schema
stepanenkoxx Sep 3, 2025
8fcbfd2
Split api and public api (#2839)
stepanenkoxx Sep 7, 2025
b88c016
Add packages
stepanenkoxx Sep 8, 2025
2f1bd24
Merge branch 'main' into CHARTS-11469-schema
stepanenkoxx Sep 8, 2025
2242111
Fixes
stepanenkoxx Sep 8, 2025
23e96e0
Fixes
stepanenkoxx Sep 8, 2025
d98cb39
Fixes
stepanenkoxx Sep 8, 2025
f99ffe7
Fixes
stepanenkoxx Sep 9, 2025
eafd00f
Fixes
stepanenkoxx Sep 9, 2025
2c62320
Fixes
stepanenkoxx Sep 9, 2025
f05fe9a
Fixes
stepanenkoxx Sep 10, 2025
c1926b0
Fixes
stepanenkoxx Sep 10, 2025
ef227f1
Fixes
stepanenkoxx Sep 10, 2025
fc03943
Fixes
stepanenkoxx Sep 10, 2025
b71dffb
Fixes
stepanenkoxx Sep 10, 2025
d6bc6ce
Fixes
stepanenkoxx Sep 11, 2025
90f164b
Merge branch 'main' into CHARTS-11469-schema
stepanenkoxx Sep 11, 2025
ee32104
Fixes
stepanenkoxx Sep 11, 2025
4c1a1b4
Fixes
stepanenkoxx Sep 11, 2025
c409620
Fixes
stepanenkoxx Sep 11, 2025
b2c46d8
Fixes
stepanenkoxx Sep 11, 2025
1f6a310
Fixes
stepanenkoxx Sep 11, 2025
d84109f
Fixes
stepanenkoxx Sep 15, 2025
d4a8348
Review fixes
stepanenkoxx Sep 15, 2025
dfacf28
Merge branch 'main' into CHARTS-11469-schema
stepanenkoxx Sep 15, 2025
20c64a6
Remove not ready schemas
stepanenkoxx Sep 15, 2025
4dee5d0
Remove not ready schemas
stepanenkoxx Sep 15, 2025
5c2d0ce
Fix ts
stepanenkoxx Sep 15, 2025
74cc9c0
Fixes
stepanenkoxx Sep 15, 2025
eef7f52
Merge branch 'main' into CHARTS-11469-schema
stepanenkoxx Sep 15, 2025
2a29f46
Fix dataset schemas
stepanenkoxx Sep 15, 2025
2afa7fe
Merge branch 'main' into CHARTS-11469-schema
stepanenkoxx Sep 15, 2025
ecf4bf0
Merge branch 'main' into CHARTS-11469-schema
stepanenkoxx Sep 16, 2025
eea7c21
Review fixes
stepanenkoxx Sep 17, 2025
e061d0d
Merge branch 'main' into CHARTS-11469-schema
stepanenkoxx Sep 17, 2025
e2ea3e1
Review fixes
stepanenkoxx Sep 17, 2025
5aa1996
Merge branch 'main' into CHARTS-11469-schema
stepanenkoxx Sep 17, 2025
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
3 changes: 2 additions & 1 deletion src/server/controllers/public-api/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,8 @@ export const validateRequestBody = async (schema: z.ZodType, data: unknown): Pro
return await schema.parseAsync(data);
} catch (error) {
if (error instanceof ZodError) {
throw new AppError('Validation error', {
throw new PublicApiError('Validation error', {
code: PUBLIC_API_ERRORS.VALIDATION_ERROR,
details: error.issues,
});
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ export type BuildDefaultRequestArgs = {
fields: ServerField[];
apiVersion: ApiVersion;
params: StringParams;
revisionId: string;
revisionId?: string;
datasetId: string;

allMeasuresMap: Record<string, boolean>;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -433,7 +433,7 @@ export function prepareSingleRequest({
layerId: string | undefined;
extraSettings?: ServerChartsConfig['extraSettings'];
sharedData: SharedData;
revisionId: string;
revisionId?: string;
}): ApiV2RequestBody {
preprocessHierarchies({
visualizationId: visualization.id,
Expand Down Expand Up @@ -682,7 +682,7 @@ export const getUrlsRequestBody = (args: {
datasetFields: ServerDatasetField[];
datasetId: string;
layerId: string;
revisionId: string;
revisionId?: string;
}): ApiV2RequestBody => {
const {params, shared, datasetId, layerId, revisionId} = args;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ export default async (
const shared = urlsSourceArgs.shared;
const wizardDataset = shared.wizardDataset;

let revisionId: string;
let revisionId: string | undefined;
let datasetFields: PartialDatasetField[];

// When Urls are executed on the Wizard side, we don't need a dataset from the CHARTS side to avoid an unnecessary request
Expand Down
25 changes: 13 additions & 12 deletions src/shared/types/dataset.ts
Original file line number Diff line number Diff line change
Expand Up @@ -120,11 +120,11 @@ export interface Dataset {
};
};
rls: {[key: string]: string};
rls2: unknown[];
rls2: {[key: string]: string};
source_avatars: DatasetSourceAvatar[];
source_features: {};
source_features?: {};
sources: DatasetSource[];
revisionId: string;
revisionId?: string;
load_preview_by_default: boolean;
template_enabled: boolean;
data_export_forbidden?: boolean;
Expand Down Expand Up @@ -196,7 +196,8 @@ export interface DatasetField {
value_constraint?:
| {type: typeof DATASET_VALUE_CONSTRAINT_TYPE.DEFAULT}
| {type: typeof DATASET_VALUE_CONSTRAINT_TYPE.NULL}
| {type: typeof DATASET_VALUE_CONSTRAINT_TYPE.REGEX; pattern: string};
| {type: typeof DATASET_VALUE_CONSTRAINT_TYPE.REGEX; pattern: string}
| null;
ui_settings?: string;
}

Expand Down Expand Up @@ -275,28 +276,28 @@ export type DatasetRawSchema = {
has_auto_aggregation: boolean;
native_type: {
name: string;
conn_type: string;
conn_type?: string;
};
};

export interface DatasetSource {
id: string;
connection_id: string;
ref_source_id: string | null;
name: string;
ref_source_id?: string | null;
name?: string;
title: string;
source_type: string;
managed_by: string;
parameter_hash: string;
valid: boolean;
is_ref: boolean;
is_ref?: boolean;
virtual: boolean;
raw_schema: DatasetRawSchema[];
group: string[];
group?: string[];
parameters: {
table_name: string;
db_version: string;
db_name: string | null;
table_name?: string;
db_version?: string;
db_name?: string | null;
};
}

Expand Down
24 changes: 12 additions & 12 deletions src/shared/zod-schemas/dataset.ts
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ const datasetFieldSchema = z.object({
hidden: z.boolean(),
autoaggregated: z.boolean(),
template_enabled: z.boolean().optional(),
value_constraint: datasetValueConstraintSchema.optional(),
value_constraint: datasetValueConstraintSchema.optional().nullable(),
});

// Dataset component error item schema
Expand Down Expand Up @@ -116,29 +116,29 @@ const datasetRawSchemaSchema = z.object({
has_auto_aggregation: z.boolean(),
native_type: z.object({
name: z.string(),
conn_type: z.string(),
conn_type: z.string().optional(),
}),
});

// Dataset source schema
const datasetSourceSchema = z.object({
id: z.string(),
connection_id: z.string(),
ref_source_id: z.union([z.string(), z.null()]),
name: z.string(),
ref_source_id: z.union([z.string(), z.null(), z.undefined()]),
name: z.string().optional(),
title: z.string(),
source_type: z.string(),
managed_by: z.string(),
parameter_hash: z.string(),
valid: z.boolean(),
is_ref: z.boolean(),
is_ref: z.boolean().optional(),
virtual: z.boolean(),
raw_schema: z.array(datasetRawSchemaSchema),
group: z.array(z.string()),
group: z.array(z.string()).optional(),
parameters: z.object({
table_name: z.string(),
db_version: z.string(),
db_name: z.union([z.string(), z.null()]),
table_name: z.string().optional(),
db_version: z.string().optional(),
db_name: z.union([z.string(), z.null(), z.undefined()]),
}),
});

Expand Down Expand Up @@ -261,11 +261,11 @@ const datasetBodySchema = z.object({
}),
}),
rls: datasetRlsSchema,
rls2: z.array(z.unknown()),
rls2: z.object({}),
source_avatars: z.array(datasetSourceAvatarSchema),
source_features: z.record(z.string(), z.any()),
source_features: z.record(z.string(), z.any()).optional(),
sources: z.array(datasetSourceSchema),
revisionId: z.string(),
revisionId: z.string().optional(),
load_preview_by_default: z.boolean(),
template_enabled: z.boolean(),
data_export_forbidden: z.boolean().optional(),
Expand Down
Loading