@airoom/nextmin-react 0.1.2 → 0.1.4

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/LICENSE CHANGED
@@ -1,49 +1,21 @@
1
- Nextmin Proprietary License v1.0
1
+ MIT License
2
2
 
3
3
  Copyright (c) 2025 GSCodes
4
- All rights reserved.
5
4
 
6
- 1. Definitions
7
- “Software” means the package and all accompanying files under the package name(s) @airoom/nextmin-react and @airoom/nextmin-node, including any updates provided by Licensor.
8
- “Licensor” means GSCodes.
9
- “Licensee” means the person or entity that obtains the Software.
10
-
11
- 2. Grant of License
12
- Subject to full compliance with this License, Licensor grants Licensee a limited, non-exclusive, non-transferable, non-sublicensable license to:
13
- a) install and use the Software internally, solely for evaluating or running Licensee’s own applications; and
14
- b) make a reasonable number of copies solely for internal backup and archival purposes.
15
-
16
- 3. Restrictions
17
- Except as expressly permitted in Section 2, Licensee must NOT:
18
- a) copy, publish, distribute, sell, rent, lease, lend, sublicense, or otherwise make the Software available to any third party;
19
- b) modify, translate, adapt, create derivative works of, or merge the Software with other software;
20
- c) reverse engineer, decompile, disassemble, or otherwise attempt to derive source code or underlying ideas, except to the extent such restrictions are expressly prohibited by applicable law;
21
- d) remove, obscure, or alter any proprietary notices or markings; or
22
- e) use the Software to train, fine-tune, or improve any artificial intelligence or machine learning model.
23
-
24
- 4. Ownership
25
- The Software is licensed, not sold. Licensor retains all right, title, and interest in and to the Software, including all intellectual property rights and all copies.
26
-
27
- 5. Confidentiality
28
- The Software and any non-public information provided by Licensor shall be treated as confidential and not disclosed to any third party without Licensor’s prior written consent, except as required by law.
29
-
30
- 6. Term and Termination
31
- This License is effective until terminated. Licensor may terminate this License immediately upon notice if Licensee breaches any term. Upon termination, Licensee must cease all use and destroy all copies of the Software. Sections 3–10 survive termination.
32
-
33
- 7. Updates; No Support Obligation
34
- Licensor may, but is not obligated to, provide updates, bug fixes, or support. Any updates are governed by this License unless accompanied by a different license.
35
-
36
- 8. No Warranty
37
- THE SOFTWARE IS PROVIDED “AS IS” AND “AS AVAILABLE,” WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, TITLE, AND NON-INFRINGEMENT. USE IS AT LICENSEE’S SOLE RISK.
38
-
39
- 9. Limitation of Liability
40
- TO THE MAXIMUM EXTENT PERMITTED BY LAW, IN NO EVENT SHALL LICENSOR BE LIABLE FOR ANY INDIRECT, INCIDENTAL, SPECIAL, CONSEQUENTIAL, EXEMPLARY, OR PUNITIVE DAMAGES, OR FOR ANY LOSS OF PROFITS, REVENUE, DATA, GOODWILL, OR BUSINESS INTERRUPTION, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. LICENSOR’S TOTAL LIABILITY FOR ALL CLAIMS SHALL NOT EXCEED THE AMOUNT PAID BY LICENSEE FOR THE SOFTWARE (IF ANY) IN THE TWELVE (12) MONTHS PRECEDING THE CLAIM.
41
-
42
- 10. Governing Law; Venue
43
- This License is governed by the laws of State of California, USA, without regard to its conflict of laws principles. The parties submit to the exclusive jurisdiction and venue of the courts located in San Francisco County, California, USA.
44
-
45
- 11. Commercial Licensing
46
- For commercial use, redistribution, or other rights not expressly granted, contact: tareqaziz0065@gmail.com.
47
-
48
- 12. Entire Agreement
49
- This License constitutes the entire agreement with respect to the Software and supersedes all prior or contemporaneous agreements or understandings on the subject matter.
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
@@ -1 +1,6 @@
1
- export declare function AuthPage(): import("react/jsx-runtime").JSX.Element;
1
+ export declare function AuthPage({ pathname, navigate, }: {
2
+ pathname: string | null | undefined;
3
+ navigate: (url: string, opts?: {
4
+ replace?: boolean;
5
+ }) => void;
6
+ }): import("react/jsx-runtime").JSX.Element;
@@ -1,23 +1,20 @@
1
1
  'use client';
2
2
  import { jsx as _jsx } from "react/jsx-runtime";
3
3
  import { useEffect } from 'react';
4
- import { usePathname, useRouter } from 'next/navigation';
5
4
  import { useSelector } from 'react-redux';
6
5
  import { SignInForm } from './SignInForm';
7
6
  import { ForgotPasswordForm } from './ForgotPasswordForm';
8
- export function AuthPage() {
9
- const pathname = usePathname();
10
- const router = useRouter();
7
+ export function AuthPage({ pathname, navigate, }) {
11
8
  const token = useSelector((s) => s?.session?.token ?? null);
12
9
  // If already authenticated on /admin/auth/* → go to dashboard
13
10
  useEffect(() => {
14
11
  if (token && pathname?.startsWith('/admin/auth')) {
15
- router.replace('/admin/dashboard');
12
+ navigate('/admin/dashboard', { replace: true });
16
13
  }
17
- }, [token, pathname, router]);
14
+ }, [token, pathname, navigate]);
18
15
  if (pathname?.startsWith('/admin/auth/forgot-password')) {
19
16
  return _jsx(ForgotPasswordForm, {});
20
17
  }
21
18
  // Default = Sign in; SignInForm already stores token+user and updates Redux.
22
- return _jsx(SignInForm, { onSuccess: () => router.replace('/admin/dashboard') });
19
+ return _jsx(SignInForm, { onSuccess: () => navigate('/admin/dashboard', { replace: true }) });
23
20
  }
@@ -121,7 +121,7 @@ export function AdminApp() {
121
121
  // - elsewhere: show loader while redirecting to sign-in
122
122
  if (!haveToken) {
123
123
  if (onAuthRoute)
124
- return _jsx(AuthPage, {});
124
+ return (_jsx(AuthPage, { pathname: pathname, navigate: (url, opts) => opts?.replace ? router.replace(url) : router.push(url) }));
125
125
  return _jsx(SectionLoader, { label: "Redirecting to sign in\u2026" });
126
126
  }
127
127
  // 3) Authed:
@@ -243,6 +243,8 @@ export function SchemaForm({ model, schemaOverride, initialValues, submitLabel =
243
243
  }, [sessionRole, bypassRoles]);
244
244
  const fields = useMemo(() => Object.entries(schema.attributes)
245
245
  .filter(([name]) => !AUDIT_FIELDS.has(name))
246
+ // Force-hide any linkage field named "baseId"
247
+ .filter(([name]) => name !== 'baseId')
246
248
  .filter(([, attr]) => canBypassPrivacy ? true : !attr?.private)
247
249
  .filter(([, attr]) => !isHiddenAttr(attr, isEdit))
248
250
  .filter(([name, attr]) => !(isEdit && isPasswordAttr(name, attr)))