@datawheel/bespoke 0.9.2 → 0.10.0-beta.1
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/README.md +8 -0
- package/css/mixins.scss +178 -0
- package/dist/Search-BWmRyIa9.d.mts +129 -0
- package/dist/auth-BwgF4GT9.d.mts +139 -0
- package/dist/auth.d.mts +42 -0
- package/dist/auth.js +1 -1
- package/dist/cms.css +1 -1
- package/dist/cms.d.mts +13 -0
- package/dist/cms.js +38 -66
- package/dist/explore.css +1 -1
- package/dist/explore.d.mts +40 -0
- package/dist/explore.js +8 -36
- package/dist/index.d.mts +24 -0
- package/dist/index.js +1 -1
- package/dist/redux-store.d.mts +175 -0
- package/dist/redux-store.js +3 -4
- package/dist/report.css +1 -1
- package/dist/report.d.mts +132 -0
- package/dist/report.js +14 -42
- package/dist/server.d.mts +108 -0
- package/dist/server.js +10 -11
- package/dist/store-De3Xknzr.d.mts +545 -0
- package/dist/types-BcIo0oyw.d.mts +847 -0
- package/package.json +76 -40
|
@@ -0,0 +1,108 @@
|
|
|
1
|
+
import { Session, NextAuthOptions, AuthOptions } from 'next-auth';
|
|
2
|
+
import * as next from 'next';
|
|
3
|
+
import { NextApiRequest, NextApiResponse, NextApiHandler, GetServerSidePropsContext, GetStaticPathsResult, GetStaticPaths, GetStaticProps, GetServerSideProps } from 'next';
|
|
4
|
+
import { e as BespokeAuthOptions } from './auth-BwgF4GT9.mjs';
|
|
5
|
+
import { h as AppStore } from './store-De3Xknzr.mjs';
|
|
6
|
+
export { i as dbApiFactory, u as useDatabaseApi } from './store-De3Xknzr.mjs';
|
|
7
|
+
import * as querystring from 'querystring';
|
|
8
|
+
export { v as ReportsDB } from './types-BcIo0oyw.mjs';
|
|
9
|
+
import 'next-auth/react';
|
|
10
|
+
import 'next/app';
|
|
11
|
+
import 'next-redux-wrapper';
|
|
12
|
+
import '@reduxjs/toolkit';
|
|
13
|
+
import 'sequelize';
|
|
14
|
+
|
|
15
|
+
/**
|
|
16
|
+
* Returns the instance connection to the DB.
|
|
17
|
+
* This connection is shared through all items in the running server.
|
|
18
|
+
* The function must run synchronously, so async startup operations are set to
|
|
19
|
+
* run without `await`ing or monitoring the result.
|
|
20
|
+
*/
|
|
21
|
+
declare const getDB: () => Promise<any>;
|
|
22
|
+
|
|
23
|
+
type BespokeSession = Session & {
|
|
24
|
+
source: string;
|
|
25
|
+
};
|
|
26
|
+
declare function getBespokeServerSession(req: NextApiRequest, res: NextApiResponse, authOptions?: BespokeAuthOptions): Promise<BespokeSession>;
|
|
27
|
+
|
|
28
|
+
declare const handleAuth: (authOptions?: {
|
|
29
|
+
providers: any[];
|
|
30
|
+
}) => any;
|
|
31
|
+
|
|
32
|
+
/**
|
|
33
|
+
*
|
|
34
|
+
* @param req Next req
|
|
35
|
+
* @param res Next res
|
|
36
|
+
* @param settings
|
|
37
|
+
* @returns
|
|
38
|
+
*/
|
|
39
|
+
declare const updateCurrentUserAppMetadata: (req: NextApiRequest, res: NextApiResponse, authOptions: BespokeAuthOptions, newMetadata: {
|
|
40
|
+
[key: string]: string;
|
|
41
|
+
}) => Promise<{
|
|
42
|
+
[key: string]: string;
|
|
43
|
+
}>;
|
|
44
|
+
|
|
45
|
+
/**
|
|
46
|
+
*
|
|
47
|
+
* @param req Next req
|
|
48
|
+
* @param res Next res
|
|
49
|
+
* @param settings
|
|
50
|
+
* @returns
|
|
51
|
+
*/
|
|
52
|
+
declare const updateCurrentUserMetadata: (req: NextApiRequest, res: NextApiResponse, authOptions: BespokeAuthOptions, newMetadata: {
|
|
53
|
+
[key: string]: string;
|
|
54
|
+
}) => Promise<{
|
|
55
|
+
[key: string]: string;
|
|
56
|
+
}>;
|
|
57
|
+
|
|
58
|
+
declare const withApiRoleAuthRequired: (apiRoute: NextApiHandler, allowedRoles: string[], authOptions: NextAuthOptions) => NextApiHandler<any>;
|
|
59
|
+
|
|
60
|
+
declare const searchUsersByMetadata: (authOptions: BespokeAuthOptions, key: string, value: string) => Promise<any>;
|
|
61
|
+
|
|
62
|
+
declare function endpointKey(method: string, path: string): string;
|
|
63
|
+
declare function endpointNextJsHandlerFactory(authOptions: NextAuthOptions): (req: NextApiRequest, res: NextApiResponse) => Promise<void>;
|
|
64
|
+
|
|
65
|
+
declare const reportsCrosswalkEntrypointFn: (crosswalk: any) => (_req: NextApiRequest, res: NextApiResponse) => Promise<void>;
|
|
66
|
+
|
|
67
|
+
declare function BespokeManagerServerSideProps(options?: {
|
|
68
|
+
preResolve?: (store: AppStore, ctx: GetServerSidePropsContext) => Promise<any>;
|
|
69
|
+
postResolve?: (store: AppStore, ctx: GetServerSidePropsContext) => Promise<any>;
|
|
70
|
+
/**
|
|
71
|
+
* The variable name set in the current filename for Dynamic Routes.
|
|
72
|
+
* @see {@link https://nextjs.org/docs/routing/dynamic-routes#catch-all-routes}
|
|
73
|
+
*/
|
|
74
|
+
pathSegmentsKey?: string;
|
|
75
|
+
authOptions: AuthOptions;
|
|
76
|
+
}): next.GetServerSideProps<any, querystring.ParsedUrlQuery, next.PreviewData>;
|
|
77
|
+
|
|
78
|
+
declare function BespokeRendererStaticPaths(options?: {
|
|
79
|
+
/**
|
|
80
|
+
* Enable nextjs getStaticPaths fallback.
|
|
81
|
+
* Setting this to `false` will disable any other page not found at compile time.
|
|
82
|
+
* @see {@link https://nextjs.org/docs/api-reference/data-fetching/get-static-paths#fallback-false}
|
|
83
|
+
* @default true
|
|
84
|
+
*/
|
|
85
|
+
fallback?: GetStaticPathsResult["fallback"];
|
|
86
|
+
/**
|
|
87
|
+
* The max amount of high ranking pages to pre-render PER Variant
|
|
88
|
+
* @default 50
|
|
89
|
+
*/
|
|
90
|
+
limit?: number;
|
|
91
|
+
}): GetStaticPaths;
|
|
92
|
+
declare function BespokeRendererStaticProps(options?: {
|
|
93
|
+
/**
|
|
94
|
+
* The variable name set in the current filename for Dynamic Routes.
|
|
95
|
+
* @see {@link https://nextjs.org/docs/routing/dynamic-routes#catch-all-routes}
|
|
96
|
+
*/
|
|
97
|
+
pathSegmentsKey?: string;
|
|
98
|
+
}): GetStaticProps;
|
|
99
|
+
|
|
100
|
+
declare function BespokeEmbedServerSideProps(options?: {
|
|
101
|
+
/**
|
|
102
|
+
* The variable name set in the current filename for Dynamic Routes.
|
|
103
|
+
* @see {@link https://nextjs.org/docs/routing/dynamic-routes#catch-all-routes}
|
|
104
|
+
*/
|
|
105
|
+
pathSegmentsKey?: string;
|
|
106
|
+
}): GetServerSideProps;
|
|
107
|
+
|
|
108
|
+
export { BespokeEmbedServerSideProps, endpointNextJsHandlerFactory as BespokeEndpointNextJsHandlerFactory, getBespokeServerSession as BespokeGetSession, handleAuth as BespokeHandleAuth, BespokeManagerServerSideProps, BespokeRendererStaticPaths, BespokeRendererStaticProps, searchUsersByMetadata as BespokeSearchUsersByMetadata, updateCurrentUserAppMetadata as BespokeUpdateCurrentUserAppMetadata, updateCurrentUserMetadata as BespokeUpdateCurrentUserMetadata, withApiRoleAuthRequired as BespokeWithApiRoleAuthRequired, reportsCrosswalkEntrypointFn as ReportCrosswalkHandler, endpointKey, getDB };
|