orionplace-react 0.1.0

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.
Files changed (54) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +242 -0
  3. package/bin/orionplace-react.mjs +101 -0
  4. package/package.json +56 -0
  5. package/runtime/marketplace.d.mts +22 -0
  6. package/runtime/marketplace.mjs +211 -0
  7. package/src/project-readme.mjs +341 -0
  8. package/src/setup.mjs +250 -0
  9. package/src/update.mjs +36 -0
  10. package/src/validation.mjs +27 -0
  11. package/templates/app/api/[...orionplace]/route.ts +14 -0
  12. package/templates/app/globals.css +10 -0
  13. package/templates/app/layout.tsx +25 -0
  14. package/templates/app/page.module.css +133 -0
  15. package/templates/app/page.tsx +80 -0
  16. package/templates/hooks/useOrionplaceAppLoad.ts +34 -0
  17. package/templates/interfaces/orionplace/apiBase/TMethod.ts +1 -0
  18. package/templates/interfaces/orionplace/appBase/IAppLoad.ts +15 -0
  19. package/templates/interfaces/orionplace/appBase/IAppLoadCommon.ts +54 -0
  20. package/templates/interfaces/orionplace/appBase/IApploadUserProfile.ts +13 -0
  21. package/templates/interfaces/orionplace/appBase/IForm.ts +21 -0
  22. package/templates/interfaces/orionplace/appBase/ISEO.ts +21 -0
  23. package/templates/interfaces/orionplace/appBase/appLoadCommon/IAppLoadCommonBanner.ts +11 -0
  24. package/templates/interfaces/orionplace/appBase/appLoadCommon/IAppLoadCommonContact.ts +8 -0
  25. package/templates/interfaces/orionplace/appBase/appLoadCommon/IAppLoadCommonCurrency.ts +15 -0
  26. package/templates/interfaces/orionplace/appBase/appLoadCommon/IAppLoadCommonEvents.ts +18 -0
  27. package/templates/interfaces/orionplace/appBase/appLoadCommon/IAppLoadCommonLocale.ts +14 -0
  28. package/templates/interfaces/orionplace/appBase/appLoadCommon/IAppLoadCommonLogos.ts +6 -0
  29. package/templates/interfaces/orionplace/appBase/appLoadCommon/IAppLoadCommonPath.ts +22 -0
  30. package/templates/interfaces/orionplace/appBase/appLoadCommon/IAppLoadCommonSEO.ts +13 -0
  31. package/templates/interfaces/orionplace/appBase/appLoadCommon/IAppLoadCommonSocial.ts +15 -0
  32. package/templates/interfaces/orionplace/appBase/appLoadCommon/IAppLoadCommonTariff.ts +7 -0
  33. package/templates/interfaces/orionplace/appBase/appLoadCommon/IAppLoadCommonUnit.ts +12 -0
  34. package/templates/interfaces/orionplace/appBase/appLoadCommon/IAppLoadCommonVariables.ts +7 -0
  35. package/templates/interfaces/orionplace/appBase/appLoadCommon/IAppLoadCommonVisualSettings.ts +11 -0
  36. package/templates/interfaces/orionplace/appBase/appLoadCommon/IAppLoadCommonWalletValue.ts +3 -0
  37. package/templates/interfaces/orionplace/category/ICategory.ts +40 -0
  38. package/templates/interfaces/orionplace/domains/IDomain.ts +13 -0
  39. package/templates/interfaces/orionplace/index.ts +30 -0
  40. package/templates/interfaces/orionplace/products/IProduct.ts +235 -0
  41. package/templates/interfaces/orionplace/shared/IGeoCoordinates.ts +4 -0
  42. package/templates/interfaces/orionplace/shared/ITransformValue.ts +3 -0
  43. package/templates/interfaces/orionplace/state.ts +4 -0
  44. package/templates/interfaces/orionplace/subscribeOptions/ISubscribeOption.ts +9 -0
  45. package/templates/interfaces/orionplace/subscribeTariff/ISubscribeTariff.ts +46 -0
  46. package/templates/interfaces/orionplace/subscribes/ISubscribe.ts +28 -0
  47. package/templates/interfaces/orionplace/transport.ts +30 -0
  48. package/templates/lib/orionplace/appLoadClient.ts +33 -0
  49. package/templates/lib/orionplace/appLoadResult.ts +56 -0
  50. package/templates/lib/orionplace/appLoadServer.ts +72 -0
  51. package/templates/lib/orionplace/domain.ts +16 -0
  52. package/templates/providers/OrionplaceProvider.tsx +39 -0
  53. package/templates/proxy.ts +17 -0
  54. package/templates/stores/orionplace.ts +119 -0
@@ -0,0 +1,14 @@
1
+ // Every browser request to /api/... reaches your personal marketplace API here.
2
+ import { forwardMarketplace } from '__ORIONPLACE_RUNTIME__';
3
+
4
+ export const runtime = 'nodejs';
5
+ export const dynamic = 'force-dynamic';
6
+
7
+ function handler(request: Request): Promise<Response> {
8
+ return forwardMarketplace(request, { mimicFrontDomain: process.env.MIMIC_FRONT_DOMAIN ?? '' });
9
+ }
10
+
11
+ export {
12
+ handler as GET, handler as HEAD, handler as OPTIONS, handler as POST,
13
+ handler as PUT, handler as PATCH, handler as DELETE,
14
+ };
@@ -0,0 +1,10 @@
1
+ :root {
2
+ color-scheme: light;
3
+ }
4
+
5
+ body {
6
+ margin: 0;
7
+ background: #f5f6f8;
8
+ color: #202b38;
9
+ font-family: system-ui, sans-serif;
10
+ }
@@ -0,0 +1,25 @@
1
+ import type { Metadata } from 'next';
2
+ import type { ReactNode } from 'react';
3
+ import { OrionplaceProvider } from '../providers/OrionplaceProvider';
4
+ import { getOrionplaceAppLoad } from '../lib/orionplace/appLoadServer';
5
+ import './globals.css';
6
+
7
+ export const metadata: Metadata = {
8
+ title: 'Marketplace · AppLoad debug',
9
+ description: 'Initialization state of your Orionplace marketplace connection.',
10
+ };
11
+
12
+ // Initialization depends on the request domain and session, so pages are dynamic.
13
+ export const dynamic = 'force-dynamic';
14
+
15
+ export default async function RootLayout({ children }: { children: ReactNode }) {
16
+ // Bootstrap precedes page rendering. Failures stay in the store for the interface to handle.
17
+ const { result, failure } = await getOrionplaceAppLoad();
18
+ return (
19
+ <html lang="en">
20
+ <body>
21
+ <OrionplaceProvider result={result} failure={failure}>{children}</OrionplaceProvider>
22
+ </body>
23
+ </html>
24
+ );
25
+ }
@@ -0,0 +1,133 @@
1
+ .bootstrap {
2
+ max-width: 860px;
3
+ margin: 0 auto;
4
+ padding: 48px 24px;
5
+ }
6
+
7
+ .bootstrap h1,
8
+ .bootstrap h2 {
9
+ font-weight: 400;
10
+ line-height: 1.25;
11
+ }
12
+
13
+ .bootstrap h1 {
14
+ margin: 12px 0;
15
+ font-size: 32px;
16
+ }
17
+
18
+ .bootstrap h2 {
19
+ margin: 0;
20
+ font-size: 21px;
21
+ }
22
+
23
+ .bootstrap p {
24
+ line-height: 1.7;
25
+ }
26
+
27
+ .eyebrow {
28
+ color: #596777;
29
+ font-size: 14px;
30
+ }
31
+
32
+ .bootstrap section {
33
+ margin-top: 28px;
34
+ padding: 24px;
35
+ border: 1px solid #d9dfe6;
36
+ border-radius: 10px;
37
+ background: #fff;
38
+ }
39
+
40
+ .sectionHeading {
41
+ display: flex;
42
+ flex-wrap: wrap;
43
+ align-items: center;
44
+ justify-content: space-between;
45
+ gap: 16px;
46
+ }
47
+
48
+ .state {
49
+ display: inline-block;
50
+ padding: 4px 12px;
51
+ border-radius: 4px;
52
+ background: #eaf0f5;
53
+ }
54
+
55
+ .state[data-state='success'] {
56
+ background: #e6f2ec;
57
+ color: #245c40;
58
+ }
59
+
60
+ .state[data-state='error'] {
61
+ background: #fbeceb;
62
+ color: #8c302a;
63
+ }
64
+
65
+ .bootstrap button {
66
+ padding: 9px 14px;
67
+ border: 1px solid #bfc9d4;
68
+ border-radius: 5px;
69
+ background: #f5f6f8;
70
+ color: inherit;
71
+ font: inherit;
72
+ cursor: pointer;
73
+ }
74
+
75
+ .bootstrap button:disabled {
76
+ opacity: .6;
77
+ cursor: wait;
78
+ }
79
+
80
+ .bootstrap button:hover:not(:disabled) {
81
+ background: #eaf0f5;
82
+ }
83
+
84
+ .bootstrap a {
85
+ color: #245786;
86
+ text-underline-offset: 3px;
87
+ }
88
+
89
+ .bootstrap :focus-visible {
90
+ outline: 2px solid #245786;
91
+ outline-offset: 4px;
92
+ }
93
+
94
+ .bootstrap code {
95
+ font-size: .9em;
96
+ overflow-wrap: anywhere;
97
+ }
98
+
99
+ .bootstrap dl {
100
+ margin-bottom: 0;
101
+ }
102
+
103
+ .bootstrap dl div {
104
+ display: grid;
105
+ grid-template-columns: minmax(140px, 1fr) 2fr;
106
+ gap: 12px;
107
+ padding: 12px 0;
108
+ border-top: 1px solid #e8ecf0;
109
+ }
110
+
111
+ .bootstrap dt {
112
+ color: #596777;
113
+ }
114
+
115
+ .bootstrap dd {
116
+ margin: 0;
117
+ overflow-wrap: anywhere;
118
+ }
119
+
120
+ @media (max-width: 520px) {
121
+ .bootstrap {
122
+ padding: 24px 16px;
123
+ }
124
+
125
+ .bootstrap section {
126
+ padding: 18px;
127
+ }
128
+
129
+ .bootstrap dl div {
130
+ grid-template-columns: 1fr;
131
+ gap: 4px;
132
+ }
133
+ }
@@ -0,0 +1,80 @@
1
+ 'use client';
2
+
3
+ import { useOrionplace } from '../providers/OrionplaceProvider';
4
+ import { useOrionplaceAppLoad } from '../hooks/useOrionplaceAppLoad';
5
+ import { selectData, selectInit } from '../stores/orionplace';
6
+ import type { AppLoadFailure, AppLoadStatus, IAppLoadPathsRecord } from '../interfaces/orionplace';
7
+ import styles from './page.module.css';
8
+
9
+ const STATE_LABELS: Record<AppLoadStatus, string> = {
10
+ idle: 'Not started',
11
+ pending: 'Loading',
12
+ success: 'Loaded',
13
+ error: 'Failed',
14
+ };
15
+
16
+ const countEndpoints = (routes?: IAppLoadPathsRecord) =>
17
+ Object.values(routes?.paths ?? {}).reduce((total, section) => total + Object.keys(section).length, 0);
18
+
19
+ function failureText(failure: AppLoadFailure) {
20
+ if (failure.kind === 'validation') return 'The backend returned form errors.';
21
+ if (failure.kind === 'invalid-response') return 'The response is missing required initialization data.';
22
+ if (failure.kind === 'network') return 'The API request did not complete.';
23
+ return 'The API returned an HTTP error.';
24
+ }
25
+
26
+ export default function Home() {
27
+ const { result, status, failure, refresh } = useOrionplaceAppLoad();
28
+ const page = useOrionplace(selectData);
29
+ const init = useOrionplace(selectInit);
30
+
31
+ return (
32
+ <main className={styles.bootstrap}>
33
+ <header>
34
+ <p className={styles.eyebrow}>Orionplace · Next.js starter</p>
35
+ <h1>Your marketplace connection</h1>
36
+ <p>This first page checks initialization through <code>POST /api/appload</code>.
37
+ Replace it with your storefront when the connection is ready.</p>
38
+ </header>
39
+ <section aria-labelledby="status-title" aria-busy={status === 'pending'}>
40
+ <div className={styles.sectionHeading}>
41
+ <h2 id="status-title">AppLoad state</h2>
42
+ <button type="button" disabled={status === 'pending'} onClick={() => void refresh()}>Reload AppLoad</button>
43
+ </div>
44
+ <p role="status" aria-live="polite" className={styles.state} data-state={status}>{STATE_LABELS[status]}</p>
45
+ {status === 'pending' && <p>Loading initialization data and available API endpoints…</p>}
46
+ {status !== 'pending' && failure && (
47
+ <div role="alert">
48
+ <p>AppLoad could not initialize. {failureText(failure)}</p>
49
+ {failure.httpStatus ? <p>HTTP status: <code>{failure.httpStatus}</code></p> : null}
50
+ <p>Check your backend, frontend domain and <code>MIMIC_FRONT_DOMAIN</code> using
51
+ {' '}<code>npx orionplace-react help</code>. Setup instructions are in <code>orionplace/README.md</code>.</p>
52
+ </div>
53
+ )}
54
+ {status !== 'pending' && !failure && result && init && (
55
+ <dl>
56
+ <div><dt>HTTP status</dt><dd>{result.httpStatus}</dd></div>
57
+ <div><dt>Loaded at (UTC)</dt><dd><time dateTime={result.loadedAt}>{result.loadedAt}</time></dd></div>
58
+ <div><dt>Session</dt><dd>{init.is_authenticated ? 'Signed in' : 'Guest'}</dd></div>
59
+ <div><dt>Languages</dt><dd>{Object.keys(init.locale).length}</dd></div>
60
+ <div><dt>Currencies</dt><dd>{Object.keys(init.currencies).length}</dd></div>
61
+ <div><dt>Public endpoints</dt><dd>{countEndpoints(page?.unauth)}</dd></div>
62
+ <div><dt>Authenticated endpoints</dt><dd>{countEndpoints(page?.auth)}</dd></div>
63
+ <div><dt>Catalog roots</dt><dd>{init.catalog?.length ?? 'Not included'}</dd></div>
64
+ <div><dt>Initial products</dt><dd>{init.products?.length ?? 'Not included'}</dd></div>
65
+ <div><dt>Tariffs</dt><dd>{init.tariffs?.data.length ?? 'Not included'}</dd></div>
66
+ </dl>
67
+ )}
68
+ </section>
69
+ <section aria-labelledby="next-title">
70
+ <h2 id="next-title">Build from typed initialization data</h2>
71
+ <p>The root layout awaits <code>lib/orionplace/appLoadServer.ts</code> before this page renders,
72
+ and passes the snapshot to <code>providers/OrionplaceProvider.tsx</code>. Read it in any client
73
+ component with <code>useOrionplace()</code>, or await the same loader in a server component.
74
+ The response and its nested interfaces are in <code>interfaces/orionplace/</code>.</p>
75
+ <p>This debug page shows section counts. Account details, keys and backend diagnostics are not displayed.</p>
76
+ <a href="https://orionmarket.place/sandbox">Read the marketplace documentation</a>
77
+ </section>
78
+ </main>
79
+ );
80
+ }
@@ -0,0 +1,34 @@
1
+ 'use client';
2
+
3
+ import { useCallback } from 'react';
4
+ import { useOrionplace, useOrionplaceStore } from '../providers/OrionplaceProvider';
5
+ import { requestBrowserAppLoad } from '../lib/orionplace/appLoadClient';
6
+ import { selectFailure, selectIsReady, selectResult, selectStatus } from '../stores/orionplace';
7
+ import type { AppLoadFailure, AppLoadResult, AppLoadStatus } from '../interfaces/orionplace';
8
+
9
+ export interface OrionplaceAppLoad {
10
+ result: AppLoadResult | null;
11
+ status: AppLoadStatus;
12
+ failure: AppLoadFailure | null;
13
+ isReady: boolean;
14
+ initialize: () => Promise<void>;
15
+ refresh: () => Promise<void>;
16
+ reset: () => void;
17
+ }
18
+
19
+ /**
20
+ * Explicit browser actions. Calling this hook does not start a request: the
21
+ * server render initializes the marketplace and hydration reuses that snapshot.
22
+ * After a confirmed login or logout, call reset and then refresh.
23
+ */
24
+ export function useOrionplaceAppLoad(): OrionplaceAppLoad {
25
+ const store = useOrionplaceStore();
26
+ const result = useOrionplace(selectResult);
27
+ const status = useOrionplace(selectStatus);
28
+ const failure = useOrionplace(selectFailure);
29
+ const isReady = useOrionplace(selectIsReady);
30
+ const initialize = useCallback(() => store.getState().load(requestBrowserAppLoad), [store]);
31
+ const refresh = useCallback(() => store.getState().load(requestBrowserAppLoad, true), [store]);
32
+ const reset = useCallback(() => store.getState().reset(), [store]);
33
+ return { result, status, failure, isReady, initialize, refresh, reset };
34
+ }
@@ -0,0 +1 @@
1
+ export type TMethod = 'GET' | 'POST' | 'PATCH' | 'PUT' | 'DELETE';
@@ -0,0 +1,15 @@
1
+ import type { IAppLoadCommon } from './IAppLoadCommon';
2
+ import type { IApploadUserProfile } from './IApploadUserProfile';
3
+ import type { IAppLoadPathsRecord } from './appLoadCommon/IAppLoadCommonPath';
4
+
5
+ export interface IAppLoad {
6
+ init: IAppLoadCommon;
7
+ unauth: IAppLoadPathsRecord;
8
+ user?: IApploadUserProfile;
9
+ auth?: IAppLoadPathsRecord;
10
+ view_key?: string;
11
+ spent_total?: number;
12
+ spent_init?: number;
13
+ unauth_spent?: number;
14
+ auth_spent?: number;
15
+ }
@@ -0,0 +1,54 @@
1
+ import type { IAppLoadCommonLocale } from './appLoadCommon/IAppLoadCommonLocale';
2
+ import type { IAppLoadCommonCurrency } from './appLoadCommon/IAppLoadCommonCurrency';
3
+ import type { IAppLoadCommonUnit } from './appLoadCommon/IAppLoadCommonUnit';
4
+ import type { IAppLoadCommonLogos } from './appLoadCommon/IAppLoadCommonLogos';
5
+ import type { IGeoCoordinates } from '../shared/IGeoCoordinates';
6
+ import type { IAppLoadCommonSeo } from './appLoadCommon/IAppLoadCommonSEO';
7
+ import type { IAppLoadCommonSocial } from './appLoadCommon/IAppLoadCommonSocial';
8
+ import type { IAppLoadCommonVisualSettings } from './appLoadCommon/IAppLoadCommonVisualSettings';
9
+ import type { IAppLoadCommonEvents } from './appLoadCommon/IAppLoadCommonEvents';
10
+ import type { IAppLoadCommonBanner } from './appLoadCommon/IAppLoadCommonBanner';
11
+ import type { ICategory } from '../category/ICategory';
12
+ import type { IProduct } from '../products/IProduct';
13
+ import type { IAppLoadCommonTariff } from './appLoadCommon/IAppLoadCommonTariff';
14
+ import type { IAppLoadCommonWalletValue } from './appLoadCommon/IAppLoadCommonWalletValue';
15
+ import type { IAppLoadCommonVariables } from './appLoadCommon/IAppLoadCommonVariables';
16
+ import type { IAppLoadCommonContact } from './appLoadCommon/IAppLoadCommonContact';
17
+
18
+ export interface IAppLoadCommon {
19
+ locale: Record<string, IAppLoadCommonLocale>;
20
+ currencies: Record<string, IAppLoadCommonCurrency>;
21
+ weights: Record<string, IAppLoadCommonUnit>;
22
+ lengths: Record<string, IAppLoadCommonUnit>;
23
+ geo_location_enabled: boolean;
24
+ is_authenticated: boolean;
25
+ wallet?: Record<string, IAppLoadCommonWalletValue>;
26
+ logos: IAppLoadCommonLogos;
27
+ public_keys: Record<string, string>;
28
+ default_map: IGeoCoordinates;
29
+ seo?: IAppLoadCommonSeo[];
30
+ sm?: IAppLoadCommonSocial[];
31
+ variables?: IAppLoadCommonVariables;
32
+ contact?: IAppLoadCommonContact;
33
+ visual_settings?: IAppLoadCommonVisualSettings;
34
+ events?: IAppLoadCommonEvents[];
35
+ main_banner?: Record<string, IAppLoadCommonBanner[]>;
36
+ catalog?: ICategory[];
37
+ products?: IProduct[];
38
+ featured?: IProduct[];
39
+ search_hints?: Record<string, string>[];
40
+ tariffs?: IAppLoadCommonTariff;
41
+ stock?: { mode: 'bar' | 'qr'; simple: boolean };
42
+ order?: { order_auto_register_with_carrier: boolean };
43
+ promo?: { create_benefits: boolean };
44
+ product?: { common_properties: boolean };
45
+ app?: { backend: boolean };
46
+ domains?: IAppLoadDomain[];
47
+ }
48
+
49
+ export interface IAppLoadDomain {
50
+ id: number;
51
+ domain_group: number | null;
52
+ domain: string;
53
+ is_active: boolean;
54
+ }
@@ -0,0 +1,13 @@
1
+ export interface IApploadUserProfile {
2
+ avatar: string | null;
3
+ first_name: string;
4
+ last_name: string;
5
+ email: string;
6
+ last_login: string | null;
7
+ date_joined: string;
8
+ phone: string;
9
+ password: boolean;
10
+ dob: string | null;
11
+ newsletter_active: boolean;
12
+ id: number;
13
+ }
@@ -0,0 +1,21 @@
1
+ import type { JsonValue } from '../transport';
2
+
3
+ export type IFormFields = { [name: string]: IFormField | IFormFields };
4
+ export interface IFormField {
5
+ form_class: string;
6
+ label: string;
7
+ required: boolean;
8
+ input_type: string;
9
+ attrs: Record<string, JsonValue>;
10
+ options?: { key: JsonValue; value: JsonValue }[];
11
+ sub_form?: IFormFields;
12
+ path?: string;
13
+ }
14
+ export interface IForm {
15
+ name: string;
16
+ form_type: 'form' | 'filters' | 'step';
17
+ tr?: string[];
18
+ form_data: IFormFields;
19
+ sub_filters_dict?: Record<string, IFormFields>;
20
+ filters_dict?: Record<string, JsonValue>;
21
+ }
@@ -0,0 +1,21 @@
1
+ export interface ISeoOg {
2
+ id?: number;
3
+ cat_id?: number;
4
+ og_property_name: string;
5
+ locale: Record<string, ISeoOgLocale>;
6
+ }
7
+
8
+ export interface ISeoOgLocale {
9
+ og_content_value?: string;
10
+ }
11
+
12
+ export interface ISeoTwitter {
13
+ id?: number;
14
+ cat_id?: number;
15
+ extra_meta_name: string;
16
+ locale: Record<string, ITwitterLocale>;
17
+ }
18
+
19
+ export interface ITwitterLocale {
20
+ extra_meta_content?: string;
21
+ }
@@ -0,0 +1,11 @@
1
+ export interface IAppLoadCommonBanner {
2
+ id: number;
3
+ target_locale: string;
4
+ category?: number;
5
+ images_desktop: string[];
6
+ images_wide: string[];
7
+ images_tablet: string[];
8
+ images_mobile: string[];
9
+ }
10
+
11
+ export type TBannerFormats = 'desktop' | 'wide' | 'tablet' | 'mobile';
@@ -0,0 +1,8 @@
1
+ export interface IAppLoadCommonContact {
2
+ company_name: string;
3
+ company_legal_name: string;
4
+ company_contact_phone: string;
5
+ company_contact_address: string;
6
+ company_tax_id: string;
7
+ company_organization_id: string;
8
+ }
@@ -0,0 +1,15 @@
1
+ export interface IAppLoadCommonCurrency {
2
+ id: number;
3
+ currency_code: string;
4
+ symbol_left: string;
5
+ symbol_right: string;
6
+ value?: number;
7
+ locales: Record<string, IAppLoadCommonCurrencyLocale>;
8
+ decimal_place?: number;
9
+ allowed_select: boolean;
10
+ }
11
+
12
+ export interface IAppLoadCommonCurrencyLocale {
13
+ id?: number;
14
+ currency_title?: string;
15
+ }
@@ -0,0 +1,18 @@
1
+ export interface IAppLoadCommonEvents {
2
+ id: number;
3
+ locale: string;
4
+ image: string | null;
5
+ image_wide: string | null;
6
+ image_tablet: string | null;
7
+ image_account: string | null;
8
+ image_mobile: string | null;
9
+ promo: boolean;
10
+ is_layout?: boolean;
11
+ is_modal?: boolean;
12
+ model_delay_sec?: number;
13
+ modal_display_count?: number;
14
+ modal_display_count_days?: number;
15
+ }
16
+
17
+ export type TEventsFormat =
18
+ 'desktop' | 'wide' | 'tablet' | 'account' | 'mobile';
@@ -0,0 +1,14 @@
1
+ export interface IAppLoadCommonLocale {
2
+ code?: string;
3
+ id?: number;
4
+ currency?: number;
5
+ weight?: number;
6
+ length?: number;
7
+ flag_img?: string;
8
+ human_name?: string;
9
+ locale?: Record<string, IAppLoadCommonLocaleName>;
10
+ }
11
+
12
+ export interface IAppLoadCommonLocaleName {
13
+ name?: string;
14
+ }
@@ -0,0 +1,6 @@
1
+ export interface IAppLoadCommonLogos {
2
+ big: string | null;
3
+ medium: string | null;
4
+ small: string | null;
5
+ ico: string | null;
6
+ }
@@ -0,0 +1,22 @@
1
+ import type { TMethod } from '../../apiBase/TMethod';
2
+ import type { IForm } from '../IForm';
3
+
4
+ export interface IAppLoadPathsRecord {
5
+ paths: IAppLoadPathObject;
6
+ }
7
+
8
+ export interface IAppLoadPathObject {
9
+ [key: string]: {
10
+ [key: string]: IAppLoadPath;
11
+ };
12
+ }
13
+
14
+ export interface IAppLoadPath {
15
+ url_name: string;
16
+ target: string;
17
+ methods: TMethod[];
18
+ ready?: string;
19
+ summary?: string;
20
+ description?: string;
21
+ forms: IForm[];
22
+ }
@@ -0,0 +1,13 @@
1
+ import type { ISeoOg, ISeoTwitter } from '../ISEO';
2
+
3
+ export interface IAppLoadCommonSeo {
4
+ locale: Record<string, IAppLoadCommonSeoLocale>;
5
+ og: ISeoOg[];
6
+ twitter: ISeoTwitter[];
7
+ }
8
+
9
+ export interface IAppLoadCommonSeoLocale {
10
+ page_title?: string;
11
+ meta_description?: string;
12
+ meta_keywords?: string;
13
+ }
@@ -0,0 +1,15 @@
1
+ export interface IAppLoadCommonSocial {
2
+ id: number;
3
+ link: string;
4
+ image_position: string;
5
+ sm_image: string;
6
+ sm_image_width: number;
7
+ sm_image_height: number;
8
+ locale: Record<string, IAppLoadCommonSocialLocale>;
9
+ }
10
+
11
+ export interface IAppLoadCommonSocialLocale {
12
+ id?: number;
13
+ caption?: string;
14
+ title?: string;
15
+ }
@@ -0,0 +1,7 @@
1
+ import type { ISubscribeTariff } from '../../subscribeTariff/ISubscribeTariff';
2
+ import type { ISubscribe } from '../../subscribes/ISubscribe';
3
+
4
+ export interface IAppLoadCommonTariff {
5
+ data: ISubscribeTariff[];
6
+ subscriptions: ISubscribe[];
7
+ }
@@ -0,0 +1,12 @@
1
+ export interface IAppLoadCommonUnit {
2
+ id: number;
3
+ unit: string;
4
+ value: number | string;
5
+ locales: Record<string, IAppLoadCommonUnitLocale>;
6
+ }
7
+
8
+ export interface IAppLoadCommonUnitLocale {
9
+ id?: number;
10
+ title?: string;
11
+ unit?: string;
12
+ }
@@ -0,0 +1,7 @@
1
+ export interface IAppLoadCommonVariables {
2
+ default_feedback_status?: number;
3
+ c_cart_positions?: number;
4
+ c_wishlist?: number;
5
+ default_blog_comment_status?: number;
6
+ allow_preorder?: boolean;
7
+ }
@@ -0,0 +1,11 @@
1
+ export interface IAppLoadCommonVisualSettings {
2
+ menu_image: boolean;
3
+ catalog_menu_image: boolean;
4
+ mobile_show_arrows: boolean;
5
+ show_filter_counters: boolean;
6
+ single_seller_mode: boolean;
7
+ blog_view_type?: number;
8
+ front_categories_count?: number;
9
+ front_categories_ordering?: string;
10
+ front_categories_ordering_direction?: string;
11
+ }
@@ -0,0 +1,3 @@
1
+ export interface IAppLoadCommonWalletValue {
2
+ transform_value: number;
3
+ }
@@ -0,0 +1,40 @@
1
+ import type { ISeoOg, ISeoTwitter } from '../appBase/ISEO';
2
+
3
+ export interface ICategory {
4
+ id: number;
5
+ ordering?: number;
6
+ c_views?: number;
7
+ search_target?: boolean;
8
+ depth: number;
9
+ numchild: number;
10
+ logo_image?: string | null;
11
+ logo_image_id?: number | null;
12
+ menu_image?: string | null;
13
+ menu_image_id?: number | null;
14
+ separate_menu: boolean;
15
+ is_public: boolean;
16
+ c_images: number;
17
+ product_rep_1_id?: number | null;
18
+ product_rep_2_id?: number | null;
19
+ og?: ISeoOg[] | null;
20
+ twitter?: ISeoTwitter[] | null;
21
+ weight_filter?: boolean;
22
+ category_image_bg: string;
23
+ use_localized_banner: boolean;
24
+ locale: Record<string, ICategoryLocale>;
25
+ path_to_top?: number[];
26
+ childs?: ICategory[];
27
+ }
28
+
29
+ export interface ICategoryLocale {
30
+ id?: number;
31
+ cg_name?: string;
32
+ cg_description?: string;
33
+ cg_title?: string;
34
+ cg_slug?: string;
35
+ meta_description?: string;
36
+ meta_keywords?: string;
37
+ link?: string;
38
+ banner_image?: string | null;
39
+ banner_image_id?: number | null;
40
+ }