@postgres.ai/shared 4.0.0-pr-1036.2 → 4.0.0-pr-695.11

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@postgres.ai/shared",
3
- "version": "4.0.0-pr-1036.2",
3
+ "version": "4.0.0-pr-695.11",
4
4
  "main": "index.js",
5
5
  "types": "index.d.ts",
6
6
  "peerDependencies": {
@@ -116,7 +116,7 @@ export const CreateBranchPage = observer(({ instanceId, api, elements, routes, i
116
116
  }
117
117
  return (_jsxs(_Fragment, { children: [elements.breadcrumbs, _jsx(SectionTitle, { tag: "h1", level: 1, text: "Create branch", className: classes.title, children: _jsx(InstanceTabs, { tab: TABS_INDEX.BRANCHES, isPlatform: isPlatform, instanceId: instanceId, hasLogs: api.initWS !== undefined, hideInstanceTabs: hideBranchingFeatures }) }), _jsxs("div", { className: classes.wrapper, children: [_jsxs("div", { className: classes.container, children: [(snapshotsError || getBranchesError) && (_jsx("div", { className: classes.marginTop, children: _jsx(ErrorStub, { message: (snapshotsError === null || snapshotsError === void 0 ? void 0 : snapshotsError.message) || (getBranchesError === null || getBranchesError === void 0 ? void 0 : getBranchesError.message) }) })), _jsxs("div", { className: classes.form, children: [_jsx(TextField, { label: "Branch name", variant: "outlined", required: true, fullWidth: true, size: "small", InputLabelProps: {
118
118
  shrink: true,
119
- }, value: formik.values.branchName, error: Boolean(formik.errors.branchName), helperText: formik.errors.branchName, className: classes.marginBottom, onChange: (e) => formik.setFieldValue('branchName', e.target.value) }), _jsx("p", { className: cn(classes.marginTop, classes.marginBottom), children: "Choose an existing branch. The new branch will initially point at the same snapshot as the parent branch but going further, their evolution paths will be independent - new snapshots can be created for both branches." }), _jsx(Select, { fullWidth: true, label: "Parent branch", value: formik.values.baseBranch, disabled: !branchesList || formik.isSubmitting, onChange: handleParentBranchChange, error: Boolean(formik.errors.baseBranch), items: branchesList
119
+ }, value: formik.values.branchName, error: Boolean(formik.errors.branchName), className: classes.marginBottom, onChange: (e) => formik.setFieldValue('branchName', e.target.value) }), _jsx("p", { className: cn(classes.marginTop, classes.marginBottom), children: "Choose an existing branch. The new branch will initially point at the same snapshot as the parent branch but going further, their evolution paths will be independent - new snapshots can be created for both branches." }), _jsx(Select, { fullWidth: true, label: "Parent branch", value: formik.values.baseBranch, disabled: !branchesList || formik.isSubmitting, onChange: handleParentBranchChange, error: Boolean(formik.errors.baseBranch), items: branchesList
120
120
  ? branchesList.map((branch) => {
121
121
  return {
122
122
  value: branch.name,
@@ -7,23 +7,7 @@
7
7
  import { useFormik } from 'formik';
8
8
  import * as Yup from 'yup';
9
9
  const Schema = Yup.object().shape({
10
- branchName: Yup.string()
11
- .required('Branch name is required')
12
- .max(255, 'Branch name cannot exceed 255 characters')
13
- .test('valid-zfs-name', 'Branch name can only contain letters, numbers, and these characters: _ -', (value) => {
14
- if (!value)
15
- return true;
16
- // ZFS allows only alphanumeric characters and: _ -
17
- const validChars = /^[a-zA-Z0-9_-]*$/;
18
- return validChars.test(value);
19
- })
20
- .test('valid-start-char', 'Branch name must start with a letter, number, or underscore', (value) => {
21
- if (!value)
22
- return true;
23
- // Dataset names can begin with alphanumeric character or underscore
24
- const validStartChar = /^[a-zA-Z0-9_]/;
25
- return validStartChar.test(value);
26
- }),
10
+ branchName: Yup.string().required('Branch name is required'),
27
11
  });
28
12
  export const useForm = (onSubmit) => {
29
13
  const formik = useFormik({
@@ -128,13 +128,13 @@ export const CreateClone = observer((props) => {
128
128
  })) !== null && _g !== void 0 ? _g : [] })), _jsx(TextField, { fullWidth: true, label: "Clone ID", value: formik.values.cloneId, onChange: (e) => {
129
129
  const sanitizedCloneIdValue = e.target.value.replace(/\s/g, '');
130
130
  formik.setFieldValue('cloneId', sanitizedCloneIdValue);
131
- }, error: Boolean(formik.errors.cloneId), helperText: formik.errors.cloneId, disabled: isCreatingClone }), _jsx(Select, { fullWidth: true, label: "Snapshot *", value: formik.values.snapshotId, disabled: !snapshots || isCreatingClone, onChange: (e) => formik.setFieldValue('snapshotId', e.target.value), error: Boolean(formik.errors.snapshotId), items: (_h = snapshots.map((snapshot, i) => {
131
+ }, error: Boolean(formik.errors.cloneId), disabled: isCreatingClone }), _jsx(Select, { fullWidth: true, label: "Snapshot *", value: formik.values.snapshotId, disabled: !snapshots || isCreatingClone, onChange: (e) => formik.setFieldValue('snapshotId', e.target.value), error: Boolean(formik.errors.snapshotId), items: (_h = snapshots.map((snapshot, i) => {
132
132
  const isLatest = i === 0;
133
133
  return {
134
134
  value: snapshot.id,
135
135
  children: (_jsxs("div", { className: styles.snapshotItem, children: [_jsxs("strong", { className: styles.snapshotOverflow, children: [snapshot === null || snapshot === void 0 ? void 0 : snapshot.id, " ", isLatest && _jsx("span", { children: "Latest" })] }), (snapshot === null || snapshot === void 0 ? void 0 : snapshot.dataStateAt) && (_jsxs("p", { children: ["Data state at: ", snapshot === null || snapshot === void 0 ? void 0 : snapshot.dataStateAt] })), snapshot.message && (_jsxs("span", { children: ["Message: ", snapshot.message] }))] })),
136
136
  };
137
- })) !== null && _h !== void 0 ? _h : [] }), _jsx("p", { className: styles.remark, children: "By default latest snapshot of database is used. You can select\u00A0 different snapshots if earlier database state is needed." })] }), _jsxs("div", { className: styles.section, children: [_jsx("h2", { className: styles.title, children: "Database credentials *" }), _jsx("p", { className: styles.text, children: "Set custom credentials for the new clone. Save the password in reliable place, it can't be read later." }), _jsx(TextField, { fullWidth: true, label: "Database username *", value: formik.values.dbUser, onChange: (e) => formik.setFieldValue('dbUser', e.target.value), error: Boolean(formik.errors.dbUser), disabled: isCreatingClone }), _jsx(TextField, { fullWidth: true, label: "Database password *", type: "password", value: formik.values.dbPassword, onChange: (e) => {
137
+ })) !== null && _h !== void 0 ? _h : [] }), _jsx("p", { className: styles.remark, children: "By default latest snapshot of database is used. You can select\u00A0 different snapshots if earlier database state is needed." })] }), _jsxs("div", { className: styles.section, children: [_jsx("h2", { className: styles.title, children: "Database credentials *" }), _jsx("p", { className: styles.text, children: "Set custom credentials for the new clone. Save the password in reliable place, it can\u2019t be read later." }), _jsx(TextField, { fullWidth: true, label: "Database username *", value: formik.values.dbUser, onChange: (e) => formik.setFieldValue('dbUser', e.target.value), error: Boolean(formik.errors.dbUser), disabled: isCreatingClone }), _jsx(TextField, { fullWidth: true, label: "Database password *", type: "password", value: formik.values.dbPassword, onChange: (e) => {
138
138
  formik.setFieldValue('dbPassword', e.target.value);
139
139
  if (formik.errors.dbPassword) {
140
140
  formik.setFieldError('dbPassword', '');
@@ -1,15 +1,7 @@
1
1
  import { useFormik } from 'formik';
2
2
  import * as Yup from 'yup';
3
3
  const Schema = Yup.object().shape({
4
- cloneId: Yup.string()
5
- .max(63, 'Clone ID cannot exceed 63 characters')
6
- .test('valid-docker-name', 'Clone ID must start with a letter or number and can only contain letters, numbers, underscores, periods, and hyphens', (value) => {
7
- if (!value)
8
- return true;
9
- // Docker container name requirements: start with letter/number, contain only ASCII [a-zA-Z0-9_.-]
10
- const validDockerName = /^[a-zA-Z0-9][a-zA-Z0-9_.-]*$/;
11
- return validDockerName.test(value);
12
- }),
4
+ cloneId: Yup.string(),
13
5
  snapshotId: Yup.string().required('Date state time is required'),
14
6
  dbUser: Yup.string().required('Database username is required'),
15
7
  dbPassword: Yup.string().required('Database password is required'),
@@ -3,15 +3,15 @@ const seContainerRegistry = 'se-images';
3
3
  const genericImagePrefix = 'postgresai/extended-postgres';
4
4
  // since some tags are rc, we need to specify the exact tags to use
5
5
  const dockerImagesConfig = {
6
- '9.6': ['0.5.2', '0.5.1', '0.4.6'],
7
- '10': ['0.5.2', '0.5.1', '0.4.6'],
8
- '11': ['0.5.2', '0.5.1', '0.4.6'],
9
- '12': ['0.5.2', '0.5.1', '0.4.6'],
10
- '13': ['0.5.2', '0.5.1', '0.4.6'],
11
- '14': ['0.5.2', '0.5.1', '0.4.6'],
12
- '15': ['0.5.2', '0.5.1', '0.4.6'],
13
- '16': ['0.5.2', '0.5.1', '0.4.6'],
14
- '17': ['0.5.2', '0.5.1'],
6
+ '9.6': ['0.5.3', '0.5.2', '0.5.1'],
7
+ '10': ['0.5.3', '0.5.2', '0.5.1'],
8
+ '11': ['0.5.3', '0.5.2', '0.5.1'],
9
+ '12': ['0.5.3', '0.5.2', '0.5.1'],
10
+ '13': ['0.5.3', '0.5.2', '0.5.1'],
11
+ '14': ['0.5.3', '0.5.2', '0.5.1'],
12
+ '15': ['0.5.3', '0.5.2', '0.5.1'],
13
+ '16': ['0.5.3', '0.5.2', '0.5.1'],
14
+ '17': ['0.5.3', '0.5.2', '0.5.1'],
15
15
  };
16
16
  export const uniqueChipValue = (values) => {
17
17
  const splitChipArray = values.split(/[,(\s)(\n)(\r)(\t)(\r\n)]/);