dineway 0.1.3
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 +9 -0
- package/README.md +89 -0
- package/dist/adapters-BlzWJG82.d.mts +106 -0
- package/dist/apply-CAPvMfoU.mjs +1339 -0
- package/dist/astro/index.d.mts +50 -0
- package/dist/astro/index.mjs +1326 -0
- package/dist/astro/middleware/auth.d.mts +30 -0
- package/dist/astro/middleware/auth.mjs +708 -0
- package/dist/astro/middleware/redirect.d.mts +21 -0
- package/dist/astro/middleware/redirect.mjs +62 -0
- package/dist/astro/middleware/request-context.d.mts +17 -0
- package/dist/astro/middleware/request-context.mjs +1371 -0
- package/dist/astro/middleware/setup.d.mts +19 -0
- package/dist/astro/middleware/setup.mjs +46 -0
- package/dist/astro/middleware.d.mts +12 -0
- package/dist/astro/middleware.mjs +1716 -0
- package/dist/astro/types.d.mts +269 -0
- package/dist/astro/types.mjs +1 -0
- package/dist/base64-F8-DUraK.mjs +58 -0
- package/dist/byline-DeWCMU_i.mjs +234 -0
- package/dist/bylines-DyqBV9EQ.mjs +137 -0
- package/dist/chunk-ClPoSABd.mjs +21 -0
- package/dist/cli/index.d.mts +1 -0
- package/dist/cli/index.mjs +3987 -0
- package/dist/client/external-auth-headers.d.mts +38 -0
- package/dist/client/external-auth-headers.mjs +101 -0
- package/dist/client/index.d.mts +397 -0
- package/dist/client/index.mjs +345 -0
- package/dist/config-Cq8H0SfX.mjs +46 -0
- package/dist/connection-C9pxzuag.mjs +52 -0
- package/dist/content-zSgdNmnt.mjs +836 -0
- package/dist/db/index.d.mts +4 -0
- package/dist/db/index.mjs +62 -0
- package/dist/db/libsql.d.mts +10 -0
- package/dist/db/libsql.mjs +21 -0
- package/dist/db/postgres.d.mts +10 -0
- package/dist/db/postgres.mjs +29 -0
- package/dist/db/sqlite.d.mts +10 -0
- package/dist/db/sqlite.mjs +15 -0
- package/dist/default-WYlzADZL.mjs +80 -0
- package/dist/dialect-helpers-B9uSp2GJ.mjs +89 -0
- package/dist/error-DrxtnGPg.mjs +26 -0
- package/dist/index-C-jx21qs.d.mts +4771 -0
- package/dist/index.d.mts +16 -0
- package/dist/index.mjs +30 -0
- package/dist/load-C6FCD1FU.mjs +27 -0
- package/dist/loader-qKmo0wAY.mjs +446 -0
- package/dist/manifest-schema-CTSEyIJ3.mjs +186 -0
- package/dist/media/index.d.mts +25 -0
- package/dist/media/index.mjs +54 -0
- package/dist/media/local-runtime.d.mts +38 -0
- package/dist/media/local-runtime.mjs +132 -0
- package/dist/media-DMTr80Gv.mjs +199 -0
- package/dist/mode-BlyYtIFO.mjs +22 -0
- package/dist/page/index.d.mts +148 -0
- package/dist/page/index.mjs +419 -0
- package/dist/placeholder-B3knXwNc.mjs +267 -0
- package/dist/placeholder-bOx1xCTY.d.mts +283 -0
- package/dist/plugin-utils.d.mts +57 -0
- package/dist/plugin-utils.mjs +77 -0
- package/dist/plugins/adapt-sandbox-entry.d.mts +21 -0
- package/dist/plugins/adapt-sandbox-entry.mjs +112 -0
- package/dist/query-BiaPl_g2.mjs +459 -0
- package/dist/redirect-JPqLAbxa.mjs +328 -0
- package/dist/registry-DSd1GWB8.mjs +851 -0
- package/dist/request-context.d.mts +49 -0
- package/dist/request-context.mjs +42 -0
- package/dist/runner-B5l1JfOj.d.mts +26 -0
- package/dist/runner-BGUGywgG.mjs +1529 -0
- package/dist/runtime.d.mts +25 -0
- package/dist/runtime.mjs +41 -0
- package/dist/search-BNruJHDL.mjs +11054 -0
- package/dist/seed/index.d.mts +3 -0
- package/dist/seed/index.mjs +15 -0
- package/dist/seo/index.d.mts +69 -0
- package/dist/seo/index.mjs +69 -0
- package/dist/storage/local.d.mts +38 -0
- package/dist/storage/local.mjs +165 -0
- package/dist/storage/s3.d.mts +31 -0
- package/dist/storage/s3.mjs +174 -0
- package/dist/tokens-4vgYuXsZ.mjs +170 -0
- package/dist/transport-C5FYnid7.mjs +417 -0
- package/dist/transport-gIL-e43D.d.mts +41 -0
- package/dist/types-BawVha09.mjs +30 -0
- package/dist/types-BgQeVaPj.d.mts +192 -0
- package/dist/types-CLLdsG3g.d.mts +103 -0
- package/dist/types-D38djUXv.d.mts +1196 -0
- package/dist/types-DShnjzb6.mjs +15 -0
- package/dist/types-DkvMXalq.d.mts +425 -0
- package/dist/types-DuNbGKjF.mjs +74 -0
- package/dist/types-ju-_ORz7.d.mts +182 -0
- package/dist/validate-CXnRKfJK.mjs +327 -0
- package/dist/validate-CqRJb_xU.mjs +96 -0
- package/dist/validate-DVKJJ-M_.d.mts +377 -0
- package/locals.d.ts +47 -0
- package/package.json +313 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
The MIT License
|
|
2
|
+
|
|
3
|
+
Copyright 2026 Cloudflare Inc.
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the “Software”), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
|
|
6
|
+
|
|
7
|
+
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
|
|
8
|
+
|
|
9
|
+
THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
package/README.md
ADDED
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
# dineway
|
|
2
|
+
|
|
3
|
+
The core Dineway Agentic Web builder package - an agentic website builder for your restaurants or local businesses.
|
|
4
|
+
|
|
5
|
+
## Installation
|
|
6
|
+
|
|
7
|
+
```shell
|
|
8
|
+
npm install dineway
|
|
9
|
+
```
|
|
10
|
+
|
|
11
|
+
## Features
|
|
12
|
+
|
|
13
|
+
- **Content Management** - Collections, fields, Live Collections integration
|
|
14
|
+
- **Media Library** - Upload via signed URLs, S3-compatible storage
|
|
15
|
+
- **Full-Text Search** - FTS5 with Porter stemming, per-collection config
|
|
16
|
+
- **Navigation Menus** - Hierarchical menus with URL resolution
|
|
17
|
+
- **Taxonomies** - Categories, tags, custom taxonomies
|
|
18
|
+
- **Widget Areas** - Content, menu, and component widgets
|
|
19
|
+
- **Sections** - Reusable content blocks
|
|
20
|
+
- **Plugin System** - Hooks, storage, settings, admin pages
|
|
21
|
+
- **WordPress Import** - WXR, REST API, WordPress.com
|
|
22
|
+
|
|
23
|
+
## Quick Start
|
|
24
|
+
|
|
25
|
+
```typescript
|
|
26
|
+
// astro.config.mjs
|
|
27
|
+
import { defineConfig } from "astro/config";
|
|
28
|
+
import dineway, { local } from "dineway/astro";
|
|
29
|
+
import { sqlite } from "dineway/db";
|
|
30
|
+
|
|
31
|
+
export default defineConfig({
|
|
32
|
+
integrations: [
|
|
33
|
+
dineway({
|
|
34
|
+
database: sqlite({ url: "file:./data.db" }),
|
|
35
|
+
storage: local({
|
|
36
|
+
directory: "./uploads",
|
|
37
|
+
baseUrl: "/_dineway/api/media/file",
|
|
38
|
+
}),
|
|
39
|
+
}),
|
|
40
|
+
],
|
|
41
|
+
});
|
|
42
|
+
```
|
|
43
|
+
|
|
44
|
+
```typescript
|
|
45
|
+
// src/live.config.ts
|
|
46
|
+
import { defineLiveCollection } from "astro:content";
|
|
47
|
+
import { dinewayLoader } from "dineway/runtime";
|
|
48
|
+
|
|
49
|
+
export const collections = {
|
|
50
|
+
_dineway: defineLiveCollection({ loader: dinewayLoader() }),
|
|
51
|
+
};
|
|
52
|
+
```
|
|
53
|
+
|
|
54
|
+
## API
|
|
55
|
+
|
|
56
|
+
```typescript
|
|
57
|
+
import {
|
|
58
|
+
getDinewayCollection,
|
|
59
|
+
getDinewayEntry,
|
|
60
|
+
getSiteSettings,
|
|
61
|
+
getMenu,
|
|
62
|
+
getTaxonomyTerms,
|
|
63
|
+
getWidgetArea,
|
|
64
|
+
search,
|
|
65
|
+
} from "dineway";
|
|
66
|
+
|
|
67
|
+
// Content
|
|
68
|
+
const { entries } = await getDinewayCollection("posts");
|
|
69
|
+
const { entry } = await getDinewayEntry("posts", "hello-world");
|
|
70
|
+
|
|
71
|
+
// Site settings
|
|
72
|
+
const settings = await getSiteSettings();
|
|
73
|
+
|
|
74
|
+
// Navigation
|
|
75
|
+
const menu = await getMenu("primary");
|
|
76
|
+
|
|
77
|
+
// Taxonomies
|
|
78
|
+
const categories = await getTaxonomyTerms("categories");
|
|
79
|
+
|
|
80
|
+
// Widgets
|
|
81
|
+
const sidebar = await getWidgetArea("sidebar");
|
|
82
|
+
|
|
83
|
+
// Search
|
|
84
|
+
const results = await search("hello world", { collections: ["posts"] });
|
|
85
|
+
```
|
|
86
|
+
|
|
87
|
+
## Documentation
|
|
88
|
+
|
|
89
|
+
See the [documentation docs](../../docs/src/content/docs/index.mdx) for guides, API reference, and plugin development.
|
|
@@ -0,0 +1,106 @@
|
|
|
1
|
+
//#region src/db/adapters.d.ts
|
|
2
|
+
/**
|
|
3
|
+
* Database Adapter Functions
|
|
4
|
+
*
|
|
5
|
+
* These run at config time (astro.config.mjs) and return serializable descriptors.
|
|
6
|
+
* The actual dialect is created at runtime by loading the entrypoint.
|
|
7
|
+
*
|
|
8
|
+
* @example
|
|
9
|
+
* ```ts
|
|
10
|
+
* // astro.config.mjs
|
|
11
|
+
* import dineway from "dineway/astro";
|
|
12
|
+
* import { sqlite } from "dineway/db";
|
|
13
|
+
*
|
|
14
|
+
* export default defineConfig({
|
|
15
|
+
* integrations: [
|
|
16
|
+
* dineway({
|
|
17
|
+
* database: sqlite({ url: "file:./data.db" }),
|
|
18
|
+
* }),
|
|
19
|
+
* ],
|
|
20
|
+
* });
|
|
21
|
+
* ```
|
|
22
|
+
*/
|
|
23
|
+
/**
|
|
24
|
+
* Dialect family identifier.
|
|
25
|
+
* Used at runtime to select dialect-specific SQL fragments.
|
|
26
|
+
*/
|
|
27
|
+
type DatabaseDialectType = "sqlite" | "postgres";
|
|
28
|
+
/**
|
|
29
|
+
* Database descriptor - serializable config for virtual modules
|
|
30
|
+
*/
|
|
31
|
+
interface DatabaseDescriptor {
|
|
32
|
+
entrypoint: string;
|
|
33
|
+
config: unknown;
|
|
34
|
+
type: DatabaseDialectType;
|
|
35
|
+
}
|
|
36
|
+
interface SqliteConfig {
|
|
37
|
+
/**
|
|
38
|
+
* Database URL (e.g., "file:./data.db")
|
|
39
|
+
*/
|
|
40
|
+
url: string;
|
|
41
|
+
}
|
|
42
|
+
interface LibsqlConfig {
|
|
43
|
+
/**
|
|
44
|
+
* Database URL (e.g., "file:./data.db" or "libsql://...")
|
|
45
|
+
*/
|
|
46
|
+
url: string;
|
|
47
|
+
/**
|
|
48
|
+
* Auth token for remote libSQL
|
|
49
|
+
*/
|
|
50
|
+
authToken?: string;
|
|
51
|
+
}
|
|
52
|
+
/**
|
|
53
|
+
* SQLite database adapter (better-sqlite3)
|
|
54
|
+
*
|
|
55
|
+
* For local development and Node.js deployments.
|
|
56
|
+
*
|
|
57
|
+
* @example
|
|
58
|
+
* ```ts
|
|
59
|
+
* database: sqlite({ url: "file:./data.db" })
|
|
60
|
+
* ```
|
|
61
|
+
*/
|
|
62
|
+
declare function sqlite(config: SqliteConfig): DatabaseDescriptor;
|
|
63
|
+
/**
|
|
64
|
+
* libSQL database adapter
|
|
65
|
+
*
|
|
66
|
+
* For remote libSQL deployments, with file-backed local development falling
|
|
67
|
+
* back to the local SQLite dialect automatically.
|
|
68
|
+
*
|
|
69
|
+
* @example
|
|
70
|
+
* ```ts
|
|
71
|
+
* database: libsql({
|
|
72
|
+
* url: process.env.DINEWAY_DATABASE_URL || "file:./data.db",
|
|
73
|
+
* authToken: process.env.DINEWAY_DATABASE_AUTH_TOKEN,
|
|
74
|
+
* })
|
|
75
|
+
* ```
|
|
76
|
+
*/
|
|
77
|
+
declare function libsql(config: LibsqlConfig): DatabaseDescriptor;
|
|
78
|
+
/**
|
|
79
|
+
* PostgreSQL connection configuration
|
|
80
|
+
*/
|
|
81
|
+
interface PostgresConfig {
|
|
82
|
+
connectionString?: string;
|
|
83
|
+
host?: string;
|
|
84
|
+
port?: number;
|
|
85
|
+
database?: string;
|
|
86
|
+
user?: string;
|
|
87
|
+
password?: string;
|
|
88
|
+
ssl?: boolean;
|
|
89
|
+
pool?: {
|
|
90
|
+
min?: number;
|
|
91
|
+
max?: number;
|
|
92
|
+
};
|
|
93
|
+
}
|
|
94
|
+
/**
|
|
95
|
+
* PostgreSQL database adapter
|
|
96
|
+
*
|
|
97
|
+
* For PostgreSQL deployments with connection pooling.
|
|
98
|
+
*
|
|
99
|
+
* @example
|
|
100
|
+
* ```ts
|
|
101
|
+
* database: postgres({ connectionString: process.env.DATABASE_URL })
|
|
102
|
+
* ```
|
|
103
|
+
*/
|
|
104
|
+
declare function postgres(config: PostgresConfig): DatabaseDescriptor;
|
|
105
|
+
//#endregion
|
|
106
|
+
export { SqliteConfig as a, sqlite as c, PostgresConfig as i, DatabaseDialectType as n, libsql as o, LibsqlConfig as r, postgres as s, DatabaseDescriptor as t };
|