@btst/plugin-affiliate 0.0.0-stage → 1.0.0-beta.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.
- package/LICENSE.md +17 -0
- package/dist/api/getters.cjs +182 -0
- package/dist/api/getters.mjs +166 -0
- package/dist/api/index.cjs +49 -0
- package/dist/api/index.d.cts +975 -0
- package/dist/api/index.d.mts +975 -0
- package/dist/api/index.d.ts +975 -0
- package/dist/api/index.mjs +7 -0
- package/dist/api/mutations.cjs +362 -0
- package/dist/api/mutations.mjs +352 -0
- package/dist/api/operations.cjs +328 -0
- package/dist/api/operations.mjs +326 -0
- package/dist/api/plugin.cjs +146 -0
- package/dist/api/plugin.mjs +144 -0
- package/dist/attribution.cjs +92 -0
- package/dist/attribution.d.cts +20 -0
- package/dist/attribution.d.mts +20 -0
- package/dist/attribution.d.ts +20 -0
- package/dist/attribution.mjs +82 -0
- package/dist/client/components/index.cjs +12 -0
- package/dist/client/components/index.d.cts +13 -0
- package/dist/client/components/index.d.mts +13 -0
- package/dist/client/components/index.d.ts +13 -0
- package/dist/client/components/index.mjs +1 -0
- package/dist/client/components/pages/affiliate-apply-page.internal.cjs +59 -0
- package/dist/client/components/pages/affiliate-apply-page.internal.mjs +57 -0
- package/dist/client/components/pages/affiliate-detail-page.internal.cjs +112 -0
- package/dist/client/components/pages/affiliate-detail-page.internal.mjs +110 -0
- package/dist/client/components/pages/affiliate-portal-page.internal.cjs +252 -0
- package/dist/client/components/pages/affiliate-portal-page.internal.mjs +250 -0
- package/dist/client/components/pages/affiliates-page.internal.cjs +160 -0
- package/dist/client/components/pages/affiliates-page.internal.mjs +158 -0
- package/dist/client/components/pages/commissions-page.internal.cjs +151 -0
- package/dist/client/components/pages/commissions-page.internal.mjs +149 -0
- package/dist/client/components/pages/payouts-page.internal.cjs +230 -0
- package/dist/client/components/pages/payouts-page.internal.mjs +228 -0
- package/dist/client/components/pages.cjs +145 -0
- package/dist/client/components/pages.mjs +138 -0
- package/dist/client/components/shared.cjs +331 -0
- package/dist/client/components/shared.mjs +316 -0
- package/dist/client/constants.cjs +5 -0
- package/dist/client/constants.mjs +3 -0
- package/dist/client/hooks/index.cjs +77 -0
- package/dist/client/hooks/index.d.cts +39 -0
- package/dist/client/hooks/index.d.mts +39 -0
- package/dist/client/hooks/index.d.ts +39 -0
- package/dist/client/hooks/index.mjs +61 -0
- package/dist/client/index.cjs +7 -0
- package/dist/client/index.d.cts +110 -0
- package/dist/client/index.d.mts +110 -0
- package/dist/client/index.d.ts +110 -0
- package/dist/client/index.mjs +1 -0
- package/dist/client/plugin.cjs +77 -0
- package/dist/client/plugin.mjs +75 -0
- package/dist/client.css +311 -0
- package/dist/commission.cjs +24 -0
- package/dist/commission.mjs +22 -0
- package/dist/db.cjs +74 -0
- package/dist/db.mjs +72 -0
- package/dist/permissions.cjs +53 -0
- package/dist/permissions.d.cts +78 -0
- package/dist/permissions.d.mts +78 -0
- package/dist/permissions.d.ts +78 -0
- package/dist/permissions.mjs +51 -0
- package/dist/query-keys.cjs +152 -0
- package/dist/query-keys.d.cts +394 -0
- package/dist/query-keys.d.mts +394 -0
- package/dist/query-keys.d.ts +394 -0
- package/dist/query-keys.mjs +149 -0
- package/dist/schemas.cjs +95 -0
- package/dist/schemas.mjs +77 -0
- package/dist/style.css +313 -0
- package/dist/types.cjs +2 -0
- package/dist/types.d.cts +176 -0
- package/dist/types.d.mts +176 -0
- package/dist/types.d.ts +176 -0
- package/dist/types.mjs +1 -0
- package/package.json +159 -3
- package/README.md +0 -3
|
@@ -0,0 +1,110 @@
|
|
|
1
|
+
import * as _btst_stack_client from '@btst/stack/client';
|
|
2
|
+
import * as _btst_yar from '@btst/yar';
|
|
3
|
+
import * as react from 'react';
|
|
4
|
+
import { ComponentType } from 'react';
|
|
5
|
+
import { AffiliatesPageComponent, CommissionsPageComponent, PayoutsPageComponent, AffiliateApplyPageComponent, AffiliatePortalPageComponent } from './components/index.cjs';
|
|
6
|
+
|
|
7
|
+
/** Affiliate-specific page labels; shared services come from StackProvider. */
|
|
8
|
+
interface AffiliatePluginOverrides {
|
|
9
|
+
localization?: Partial<{
|
|
10
|
+
affiliates: string;
|
|
11
|
+
commissions: string;
|
|
12
|
+
payouts: string;
|
|
13
|
+
portal: string;
|
|
14
|
+
apply: string;
|
|
15
|
+
}>;
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
/** Optional replacements for the dynamic affiliate administration and portal pages. */
|
|
19
|
+
interface AffiliateClientConfig {
|
|
20
|
+
pageComponents?: {
|
|
21
|
+
affiliates?: ComponentType;
|
|
22
|
+
affiliateDetail?: ComponentType<{
|
|
23
|
+
params: {
|
|
24
|
+
id: string;
|
|
25
|
+
};
|
|
26
|
+
}>;
|
|
27
|
+
commissions?: ComponentType;
|
|
28
|
+
payouts?: ComponentType;
|
|
29
|
+
apply?: ComponentType;
|
|
30
|
+
portal?: ComponentType;
|
|
31
|
+
};
|
|
32
|
+
}
|
|
33
|
+
/** Affiliate operations and self-service pages. Protected data loads in the browser. */
|
|
34
|
+
declare const affiliateClientPlugin: (config?: AffiliateClientConfig) => _btst_stack_client.ClientPluginDefinition<AffiliatePluginOverrides, {
|
|
35
|
+
affiliates: _btst_yar.DefinedRoute<"/affiliate/admin/affiliates", {
|
|
36
|
+
readonly page: react.LazyExoticComponent<typeof AffiliatesPageComponent>;
|
|
37
|
+
readonly meta: () => ({
|
|
38
|
+
title: string;
|
|
39
|
+
name?: undefined;
|
|
40
|
+
content?: undefined;
|
|
41
|
+
} | {
|
|
42
|
+
name: string;
|
|
43
|
+
content: string;
|
|
44
|
+
title?: undefined;
|
|
45
|
+
})[];
|
|
46
|
+
}, _btst_yar.RouteMeta>;
|
|
47
|
+
affiliateDetail: _btst_yar.DefinedRoute<"/affiliate/admin/affiliates/:id", {
|
|
48
|
+
readonly page: ({ params }: _btst_yar.RouteContext<"/affiliate/admin/affiliates/:id", _btst_yar.RouteOptions>) => react.JSX.Element;
|
|
49
|
+
readonly meta: () => ({
|
|
50
|
+
title: string;
|
|
51
|
+
name?: undefined;
|
|
52
|
+
content?: undefined;
|
|
53
|
+
} | {
|
|
54
|
+
name: string;
|
|
55
|
+
content: string;
|
|
56
|
+
title?: undefined;
|
|
57
|
+
})[];
|
|
58
|
+
}, _btst_yar.RouteMeta>;
|
|
59
|
+
commissions: _btst_yar.DefinedRoute<"/affiliate/admin/commissions", {
|
|
60
|
+
readonly page: react.LazyExoticComponent<typeof CommissionsPageComponent>;
|
|
61
|
+
readonly meta: () => ({
|
|
62
|
+
title: string;
|
|
63
|
+
name?: undefined;
|
|
64
|
+
content?: undefined;
|
|
65
|
+
} | {
|
|
66
|
+
name: string;
|
|
67
|
+
content: string;
|
|
68
|
+
title?: undefined;
|
|
69
|
+
})[];
|
|
70
|
+
}, _btst_yar.RouteMeta>;
|
|
71
|
+
payouts: _btst_yar.DefinedRoute<"/affiliate/admin/payouts", {
|
|
72
|
+
readonly page: react.LazyExoticComponent<typeof PayoutsPageComponent>;
|
|
73
|
+
readonly meta: () => ({
|
|
74
|
+
title: string;
|
|
75
|
+
name?: undefined;
|
|
76
|
+
content?: undefined;
|
|
77
|
+
} | {
|
|
78
|
+
name: string;
|
|
79
|
+
content: string;
|
|
80
|
+
title?: undefined;
|
|
81
|
+
})[];
|
|
82
|
+
}, _btst_yar.RouteMeta>;
|
|
83
|
+
apply: _btst_yar.DefinedRoute<"/affiliate/apply", {
|
|
84
|
+
readonly page: react.LazyExoticComponent<typeof AffiliateApplyPageComponent>;
|
|
85
|
+
readonly meta: () => ({
|
|
86
|
+
title: string;
|
|
87
|
+
name?: undefined;
|
|
88
|
+
content?: undefined;
|
|
89
|
+
} | {
|
|
90
|
+
name: string;
|
|
91
|
+
content: string;
|
|
92
|
+
title?: undefined;
|
|
93
|
+
})[];
|
|
94
|
+
}, _btst_yar.RouteMeta>;
|
|
95
|
+
portal: _btst_yar.DefinedRoute<"/affiliate/portal", {
|
|
96
|
+
readonly page: react.LazyExoticComponent<typeof AffiliatePortalPageComponent>;
|
|
97
|
+
readonly meta: () => ({
|
|
98
|
+
title: string;
|
|
99
|
+
name?: undefined;
|
|
100
|
+
content?: undefined;
|
|
101
|
+
} | {
|
|
102
|
+
name: string;
|
|
103
|
+
content: string;
|
|
104
|
+
title?: undefined;
|
|
105
|
+
})[];
|
|
106
|
+
}, _btst_yar.RouteMeta>;
|
|
107
|
+
}, "affiliate", Readonly<Record<string, never>>, never>;
|
|
108
|
+
|
|
109
|
+
export { affiliateClientPlugin };
|
|
110
|
+
export type { AffiliateClientConfig, AffiliatePluginOverrides };
|
|
@@ -0,0 +1,110 @@
|
|
|
1
|
+
import * as _btst_stack_client from '@btst/stack/client';
|
|
2
|
+
import * as _btst_yar from '@btst/yar';
|
|
3
|
+
import * as react from 'react';
|
|
4
|
+
import { ComponentType } from 'react';
|
|
5
|
+
import { AffiliatesPageComponent, CommissionsPageComponent, PayoutsPageComponent, AffiliateApplyPageComponent, AffiliatePortalPageComponent } from './components/index.mjs';
|
|
6
|
+
|
|
7
|
+
/** Affiliate-specific page labels; shared services come from StackProvider. */
|
|
8
|
+
interface AffiliatePluginOverrides {
|
|
9
|
+
localization?: Partial<{
|
|
10
|
+
affiliates: string;
|
|
11
|
+
commissions: string;
|
|
12
|
+
payouts: string;
|
|
13
|
+
portal: string;
|
|
14
|
+
apply: string;
|
|
15
|
+
}>;
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
/** Optional replacements for the dynamic affiliate administration and portal pages. */
|
|
19
|
+
interface AffiliateClientConfig {
|
|
20
|
+
pageComponents?: {
|
|
21
|
+
affiliates?: ComponentType;
|
|
22
|
+
affiliateDetail?: ComponentType<{
|
|
23
|
+
params: {
|
|
24
|
+
id: string;
|
|
25
|
+
};
|
|
26
|
+
}>;
|
|
27
|
+
commissions?: ComponentType;
|
|
28
|
+
payouts?: ComponentType;
|
|
29
|
+
apply?: ComponentType;
|
|
30
|
+
portal?: ComponentType;
|
|
31
|
+
};
|
|
32
|
+
}
|
|
33
|
+
/** Affiliate operations and self-service pages. Protected data loads in the browser. */
|
|
34
|
+
declare const affiliateClientPlugin: (config?: AffiliateClientConfig) => _btst_stack_client.ClientPluginDefinition<AffiliatePluginOverrides, {
|
|
35
|
+
affiliates: _btst_yar.DefinedRoute<"/affiliate/admin/affiliates", {
|
|
36
|
+
readonly page: react.LazyExoticComponent<typeof AffiliatesPageComponent>;
|
|
37
|
+
readonly meta: () => ({
|
|
38
|
+
title: string;
|
|
39
|
+
name?: undefined;
|
|
40
|
+
content?: undefined;
|
|
41
|
+
} | {
|
|
42
|
+
name: string;
|
|
43
|
+
content: string;
|
|
44
|
+
title?: undefined;
|
|
45
|
+
})[];
|
|
46
|
+
}, _btst_yar.RouteMeta>;
|
|
47
|
+
affiliateDetail: _btst_yar.DefinedRoute<"/affiliate/admin/affiliates/:id", {
|
|
48
|
+
readonly page: ({ params }: _btst_yar.RouteContext<"/affiliate/admin/affiliates/:id", _btst_yar.RouteOptions>) => react.JSX.Element;
|
|
49
|
+
readonly meta: () => ({
|
|
50
|
+
title: string;
|
|
51
|
+
name?: undefined;
|
|
52
|
+
content?: undefined;
|
|
53
|
+
} | {
|
|
54
|
+
name: string;
|
|
55
|
+
content: string;
|
|
56
|
+
title?: undefined;
|
|
57
|
+
})[];
|
|
58
|
+
}, _btst_yar.RouteMeta>;
|
|
59
|
+
commissions: _btst_yar.DefinedRoute<"/affiliate/admin/commissions", {
|
|
60
|
+
readonly page: react.LazyExoticComponent<typeof CommissionsPageComponent>;
|
|
61
|
+
readonly meta: () => ({
|
|
62
|
+
title: string;
|
|
63
|
+
name?: undefined;
|
|
64
|
+
content?: undefined;
|
|
65
|
+
} | {
|
|
66
|
+
name: string;
|
|
67
|
+
content: string;
|
|
68
|
+
title?: undefined;
|
|
69
|
+
})[];
|
|
70
|
+
}, _btst_yar.RouteMeta>;
|
|
71
|
+
payouts: _btst_yar.DefinedRoute<"/affiliate/admin/payouts", {
|
|
72
|
+
readonly page: react.LazyExoticComponent<typeof PayoutsPageComponent>;
|
|
73
|
+
readonly meta: () => ({
|
|
74
|
+
title: string;
|
|
75
|
+
name?: undefined;
|
|
76
|
+
content?: undefined;
|
|
77
|
+
} | {
|
|
78
|
+
name: string;
|
|
79
|
+
content: string;
|
|
80
|
+
title?: undefined;
|
|
81
|
+
})[];
|
|
82
|
+
}, _btst_yar.RouteMeta>;
|
|
83
|
+
apply: _btst_yar.DefinedRoute<"/affiliate/apply", {
|
|
84
|
+
readonly page: react.LazyExoticComponent<typeof AffiliateApplyPageComponent>;
|
|
85
|
+
readonly meta: () => ({
|
|
86
|
+
title: string;
|
|
87
|
+
name?: undefined;
|
|
88
|
+
content?: undefined;
|
|
89
|
+
} | {
|
|
90
|
+
name: string;
|
|
91
|
+
content: string;
|
|
92
|
+
title?: undefined;
|
|
93
|
+
})[];
|
|
94
|
+
}, _btst_yar.RouteMeta>;
|
|
95
|
+
portal: _btst_yar.DefinedRoute<"/affiliate/portal", {
|
|
96
|
+
readonly page: react.LazyExoticComponent<typeof AffiliatePortalPageComponent>;
|
|
97
|
+
readonly meta: () => ({
|
|
98
|
+
title: string;
|
|
99
|
+
name?: undefined;
|
|
100
|
+
content?: undefined;
|
|
101
|
+
} | {
|
|
102
|
+
name: string;
|
|
103
|
+
content: string;
|
|
104
|
+
title?: undefined;
|
|
105
|
+
})[];
|
|
106
|
+
}, _btst_yar.RouteMeta>;
|
|
107
|
+
}, "affiliate", Readonly<Record<string, never>>, never>;
|
|
108
|
+
|
|
109
|
+
export { affiliateClientPlugin };
|
|
110
|
+
export type { AffiliateClientConfig, AffiliatePluginOverrides };
|
|
@@ -0,0 +1,110 @@
|
|
|
1
|
+
import * as _btst_stack_client from '@btst/stack/client';
|
|
2
|
+
import * as _btst_yar from '@btst/yar';
|
|
3
|
+
import * as react from 'react';
|
|
4
|
+
import { ComponentType } from 'react';
|
|
5
|
+
import { AffiliatesPageComponent, CommissionsPageComponent, PayoutsPageComponent, AffiliateApplyPageComponent, AffiliatePortalPageComponent } from './components/index.js';
|
|
6
|
+
|
|
7
|
+
/** Affiliate-specific page labels; shared services come from StackProvider. */
|
|
8
|
+
interface AffiliatePluginOverrides {
|
|
9
|
+
localization?: Partial<{
|
|
10
|
+
affiliates: string;
|
|
11
|
+
commissions: string;
|
|
12
|
+
payouts: string;
|
|
13
|
+
portal: string;
|
|
14
|
+
apply: string;
|
|
15
|
+
}>;
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
/** Optional replacements for the dynamic affiliate administration and portal pages. */
|
|
19
|
+
interface AffiliateClientConfig {
|
|
20
|
+
pageComponents?: {
|
|
21
|
+
affiliates?: ComponentType;
|
|
22
|
+
affiliateDetail?: ComponentType<{
|
|
23
|
+
params: {
|
|
24
|
+
id: string;
|
|
25
|
+
};
|
|
26
|
+
}>;
|
|
27
|
+
commissions?: ComponentType;
|
|
28
|
+
payouts?: ComponentType;
|
|
29
|
+
apply?: ComponentType;
|
|
30
|
+
portal?: ComponentType;
|
|
31
|
+
};
|
|
32
|
+
}
|
|
33
|
+
/** Affiliate operations and self-service pages. Protected data loads in the browser. */
|
|
34
|
+
declare const affiliateClientPlugin: (config?: AffiliateClientConfig) => _btst_stack_client.ClientPluginDefinition<AffiliatePluginOverrides, {
|
|
35
|
+
affiliates: _btst_yar.DefinedRoute<"/affiliate/admin/affiliates", {
|
|
36
|
+
readonly page: react.LazyExoticComponent<typeof AffiliatesPageComponent>;
|
|
37
|
+
readonly meta: () => ({
|
|
38
|
+
title: string;
|
|
39
|
+
name?: undefined;
|
|
40
|
+
content?: undefined;
|
|
41
|
+
} | {
|
|
42
|
+
name: string;
|
|
43
|
+
content: string;
|
|
44
|
+
title?: undefined;
|
|
45
|
+
})[];
|
|
46
|
+
}, _btst_yar.RouteMeta>;
|
|
47
|
+
affiliateDetail: _btst_yar.DefinedRoute<"/affiliate/admin/affiliates/:id", {
|
|
48
|
+
readonly page: ({ params }: _btst_yar.RouteContext<"/affiliate/admin/affiliates/:id", _btst_yar.RouteOptions>) => react.JSX.Element;
|
|
49
|
+
readonly meta: () => ({
|
|
50
|
+
title: string;
|
|
51
|
+
name?: undefined;
|
|
52
|
+
content?: undefined;
|
|
53
|
+
} | {
|
|
54
|
+
name: string;
|
|
55
|
+
content: string;
|
|
56
|
+
title?: undefined;
|
|
57
|
+
})[];
|
|
58
|
+
}, _btst_yar.RouteMeta>;
|
|
59
|
+
commissions: _btst_yar.DefinedRoute<"/affiliate/admin/commissions", {
|
|
60
|
+
readonly page: react.LazyExoticComponent<typeof CommissionsPageComponent>;
|
|
61
|
+
readonly meta: () => ({
|
|
62
|
+
title: string;
|
|
63
|
+
name?: undefined;
|
|
64
|
+
content?: undefined;
|
|
65
|
+
} | {
|
|
66
|
+
name: string;
|
|
67
|
+
content: string;
|
|
68
|
+
title?: undefined;
|
|
69
|
+
})[];
|
|
70
|
+
}, _btst_yar.RouteMeta>;
|
|
71
|
+
payouts: _btst_yar.DefinedRoute<"/affiliate/admin/payouts", {
|
|
72
|
+
readonly page: react.LazyExoticComponent<typeof PayoutsPageComponent>;
|
|
73
|
+
readonly meta: () => ({
|
|
74
|
+
title: string;
|
|
75
|
+
name?: undefined;
|
|
76
|
+
content?: undefined;
|
|
77
|
+
} | {
|
|
78
|
+
name: string;
|
|
79
|
+
content: string;
|
|
80
|
+
title?: undefined;
|
|
81
|
+
})[];
|
|
82
|
+
}, _btst_yar.RouteMeta>;
|
|
83
|
+
apply: _btst_yar.DefinedRoute<"/affiliate/apply", {
|
|
84
|
+
readonly page: react.LazyExoticComponent<typeof AffiliateApplyPageComponent>;
|
|
85
|
+
readonly meta: () => ({
|
|
86
|
+
title: string;
|
|
87
|
+
name?: undefined;
|
|
88
|
+
content?: undefined;
|
|
89
|
+
} | {
|
|
90
|
+
name: string;
|
|
91
|
+
content: string;
|
|
92
|
+
title?: undefined;
|
|
93
|
+
})[];
|
|
94
|
+
}, _btst_yar.RouteMeta>;
|
|
95
|
+
portal: _btst_yar.DefinedRoute<"/affiliate/portal", {
|
|
96
|
+
readonly page: react.LazyExoticComponent<typeof AffiliatePortalPageComponent>;
|
|
97
|
+
readonly meta: () => ({
|
|
98
|
+
title: string;
|
|
99
|
+
name?: undefined;
|
|
100
|
+
content?: undefined;
|
|
101
|
+
} | {
|
|
102
|
+
name: string;
|
|
103
|
+
content: string;
|
|
104
|
+
title?: undefined;
|
|
105
|
+
})[];
|
|
106
|
+
}, _btst_yar.RouteMeta>;
|
|
107
|
+
}, "affiliate", Readonly<Record<string, never>>, never>;
|
|
108
|
+
|
|
109
|
+
export { affiliateClientPlugin };
|
|
110
|
+
export type { AffiliateClientConfig, AffiliatePluginOverrides };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { affiliateClientPlugin } from './plugin.mjs';
|
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
const jsxRuntime = require('react/jsx-runtime');
|
|
4
|
+
const react = require('react');
|
|
5
|
+
const client = require('@btst/stack/plugins/client');
|
|
6
|
+
const constants = require('./constants.cjs');
|
|
7
|
+
|
|
8
|
+
const Affiliates = react.lazy(
|
|
9
|
+
() => import('./components/pages.cjs').then((m) => ({
|
|
10
|
+
default: m.AffiliatesPageComponent
|
|
11
|
+
}))
|
|
12
|
+
);
|
|
13
|
+
const Detail = react.lazy(
|
|
14
|
+
() => import('./components/pages.cjs').then((m) => ({
|
|
15
|
+
default: m.AffiliateDetailPageComponent
|
|
16
|
+
}))
|
|
17
|
+
);
|
|
18
|
+
const Commissions = react.lazy(
|
|
19
|
+
() => import('./components/pages.cjs').then((m) => ({
|
|
20
|
+
default: m.CommissionsPageComponent
|
|
21
|
+
}))
|
|
22
|
+
);
|
|
23
|
+
const Payouts = react.lazy(
|
|
24
|
+
() => import('./components/pages.cjs').then((m) => ({
|
|
25
|
+
default: m.PayoutsPageComponent
|
|
26
|
+
}))
|
|
27
|
+
);
|
|
28
|
+
const Apply = react.lazy(
|
|
29
|
+
() => import('./components/pages.cjs').then((m) => ({
|
|
30
|
+
default: m.AffiliateApplyPageComponent
|
|
31
|
+
}))
|
|
32
|
+
);
|
|
33
|
+
const Portal = react.lazy(
|
|
34
|
+
() => import('./components/pages.cjs').then((m) => ({
|
|
35
|
+
default: m.AffiliatePortalPageComponent
|
|
36
|
+
}))
|
|
37
|
+
);
|
|
38
|
+
const affiliateClientPlugin = (config = {}) => client.defineClientPlugin()({
|
|
39
|
+
id: constants.AFFILIATE_PLUGIN_ID,
|
|
40
|
+
resolve: () => ({
|
|
41
|
+
routes: () => client.defineRoutes(
|
|
42
|
+
{
|
|
43
|
+
affiliates: client.defineRoute("/affiliate/admin/affiliates", {
|
|
44
|
+
page: Affiliates,
|
|
45
|
+
meta: () => meta("Affiliates")
|
|
46
|
+
}),
|
|
47
|
+
affiliateDetail: client.defineRoute("/affiliate/admin/affiliates/:id", {
|
|
48
|
+
page: ({ params }) => /* @__PURE__ */ jsxRuntime.jsx(Detail, { id: params.id }),
|
|
49
|
+
meta: () => meta("Affiliate profile")
|
|
50
|
+
}),
|
|
51
|
+
commissions: client.defineRoute("/affiliate/admin/commissions", {
|
|
52
|
+
page: Commissions,
|
|
53
|
+
meta: () => meta("Commissions")
|
|
54
|
+
}),
|
|
55
|
+
payouts: client.defineRoute("/affiliate/admin/payouts", {
|
|
56
|
+
page: Payouts,
|
|
57
|
+
meta: () => meta("Payouts")
|
|
58
|
+
}),
|
|
59
|
+
apply: client.defineRoute("/affiliate/apply", {
|
|
60
|
+
page: Apply,
|
|
61
|
+
meta: () => meta("Apply to become an affiliate")
|
|
62
|
+
}),
|
|
63
|
+
portal: client.defineRoute("/affiliate/portal", {
|
|
64
|
+
page: Portal,
|
|
65
|
+
meta: () => meta("Affiliate portal")
|
|
66
|
+
})
|
|
67
|
+
},
|
|
68
|
+
{ pages: config.pageComponents }
|
|
69
|
+
),
|
|
70
|
+
sitemap: async () => []
|
|
71
|
+
})
|
|
72
|
+
});
|
|
73
|
+
function meta(title) {
|
|
74
|
+
return [{ title }, { name: "robots", content: "noindex, nofollow" }];
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
exports.affiliateClientPlugin = affiliateClientPlugin;
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
import { jsx } from 'react/jsx-runtime';
|
|
2
|
+
import { lazy } from 'react';
|
|
3
|
+
import { defineClientPlugin, defineRoutes, defineRoute } from '@btst/stack/plugins/client';
|
|
4
|
+
import { AFFILIATE_PLUGIN_ID } from './constants.mjs';
|
|
5
|
+
|
|
6
|
+
const Affiliates = lazy(
|
|
7
|
+
() => import('./components/pages.mjs').then((m) => ({
|
|
8
|
+
default: m.AffiliatesPageComponent
|
|
9
|
+
}))
|
|
10
|
+
);
|
|
11
|
+
const Detail = lazy(
|
|
12
|
+
() => import('./components/pages.mjs').then((m) => ({
|
|
13
|
+
default: m.AffiliateDetailPageComponent
|
|
14
|
+
}))
|
|
15
|
+
);
|
|
16
|
+
const Commissions = lazy(
|
|
17
|
+
() => import('./components/pages.mjs').then((m) => ({
|
|
18
|
+
default: m.CommissionsPageComponent
|
|
19
|
+
}))
|
|
20
|
+
);
|
|
21
|
+
const Payouts = lazy(
|
|
22
|
+
() => import('./components/pages.mjs').then((m) => ({
|
|
23
|
+
default: m.PayoutsPageComponent
|
|
24
|
+
}))
|
|
25
|
+
);
|
|
26
|
+
const Apply = lazy(
|
|
27
|
+
() => import('./components/pages.mjs').then((m) => ({
|
|
28
|
+
default: m.AffiliateApplyPageComponent
|
|
29
|
+
}))
|
|
30
|
+
);
|
|
31
|
+
const Portal = lazy(
|
|
32
|
+
() => import('./components/pages.mjs').then((m) => ({
|
|
33
|
+
default: m.AffiliatePortalPageComponent
|
|
34
|
+
}))
|
|
35
|
+
);
|
|
36
|
+
const affiliateClientPlugin = (config = {}) => defineClientPlugin()({
|
|
37
|
+
id: AFFILIATE_PLUGIN_ID,
|
|
38
|
+
resolve: () => ({
|
|
39
|
+
routes: () => defineRoutes(
|
|
40
|
+
{
|
|
41
|
+
affiliates: defineRoute("/affiliate/admin/affiliates", {
|
|
42
|
+
page: Affiliates,
|
|
43
|
+
meta: () => meta("Affiliates")
|
|
44
|
+
}),
|
|
45
|
+
affiliateDetail: defineRoute("/affiliate/admin/affiliates/:id", {
|
|
46
|
+
page: ({ params }) => /* @__PURE__ */ jsx(Detail, { id: params.id }),
|
|
47
|
+
meta: () => meta("Affiliate profile")
|
|
48
|
+
}),
|
|
49
|
+
commissions: defineRoute("/affiliate/admin/commissions", {
|
|
50
|
+
page: Commissions,
|
|
51
|
+
meta: () => meta("Commissions")
|
|
52
|
+
}),
|
|
53
|
+
payouts: defineRoute("/affiliate/admin/payouts", {
|
|
54
|
+
page: Payouts,
|
|
55
|
+
meta: () => meta("Payouts")
|
|
56
|
+
}),
|
|
57
|
+
apply: defineRoute("/affiliate/apply", {
|
|
58
|
+
page: Apply,
|
|
59
|
+
meta: () => meta("Apply to become an affiliate")
|
|
60
|
+
}),
|
|
61
|
+
portal: defineRoute("/affiliate/portal", {
|
|
62
|
+
page: Portal,
|
|
63
|
+
meta: () => meta("Affiliate portal")
|
|
64
|
+
})
|
|
65
|
+
},
|
|
66
|
+
{ pages: config.pageComponents }
|
|
67
|
+
),
|
|
68
|
+
sitemap: async () => []
|
|
69
|
+
})
|
|
70
|
+
});
|
|
71
|
+
function meta(title) {
|
|
72
|
+
return [{ title }, { name: "robots", content: "noindex, nofollow" }];
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
export { affiliateClientPlugin };
|