@duckcodeailabs/dql-notebook 0.1.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/LICENSE +123 -0
- package/dist/connector-forms.d.ts +17 -0
- package/dist/connector-forms.d.ts.map +1 -0
- package/dist/connector-forms.js +157 -0
- package/dist/connector-forms.js.map +1 -0
- package/dist/document.d.ts +33 -0
- package/dist/document.d.ts.map +1 -0
- package/dist/document.js +165 -0
- package/dist/document.js.map +1 -0
- package/dist/execute.d.ts +16 -0
- package/dist/execute.d.ts.map +1 -0
- package/dist/execute.js +113 -0
- package/dist/execute.js.map +1 -0
- package/dist/index.d.ts +4 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +4 -0
- package/dist/index.js.map +1 -0
- package/package.json +40 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,123 @@
|
|
|
1
|
+
Apache License
|
|
2
|
+
Version 2.0, January 2004
|
|
3
|
+
http://www.apache.org/licenses/
|
|
4
|
+
|
|
5
|
+
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
|
|
6
|
+
|
|
7
|
+
1. Definitions.
|
|
8
|
+
|
|
9
|
+
"License" shall mean the terms and conditions for use, reproduction, and
|
|
10
|
+
distribution as defined by Sections 1 through 9 of this document.
|
|
11
|
+
|
|
12
|
+
"Licensor" shall mean the copyright owner or entity authorized by the copyright
|
|
13
|
+
owner that is granting the License.
|
|
14
|
+
|
|
15
|
+
"Legal Entity" shall mean the union of the acting entity and all other entities
|
|
16
|
+
that control, are controlled by, or are under common control with that entity.
|
|
17
|
+
For the purposes of this definition, "control" means (i) the power, direct or
|
|
18
|
+
indirect, to cause the direction or management of such entity, whether by
|
|
19
|
+
contract or otherwise, or (ii) ownership of fifty percent (50%) or more of the
|
|
20
|
+
outstanding shares, or (iii) beneficial ownership of such entity.
|
|
21
|
+
|
|
22
|
+
"You" (or "Your") shall mean an individual or Legal Entity exercising
|
|
23
|
+
permissions granted by this License.
|
|
24
|
+
|
|
25
|
+
"Source" form shall mean the preferred form for making modifications, including
|
|
26
|
+
but not limited to software source code, documentation source, and configuration
|
|
27
|
+
files.
|
|
28
|
+
|
|
29
|
+
"Object" form shall mean any form resulting from mechanical transformation or
|
|
30
|
+
translation of a Source form, including but not limited to compiled object code,
|
|
31
|
+
generated documentation, and conversions to other media types.
|
|
32
|
+
|
|
33
|
+
"Work" shall mean the work of authorship, whether in Source or Object form, made
|
|
34
|
+
available under the License, as indicated by a copyright notice that is included
|
|
35
|
+
in or attached to the work.
|
|
36
|
+
|
|
37
|
+
"Derivative Works" shall mean any work, whether in Source or Object form, that
|
|
38
|
+
is based on (or derived from) the Work and for which the editorial revisions,
|
|
39
|
+
annotations, elaborations, or other modifications represent, as a whole, an
|
|
40
|
+
original work of authorship.
|
|
41
|
+
|
|
42
|
+
"Contribution" shall mean any work of authorship, including the original version
|
|
43
|
+
of the Work and any modifications or additions to that Work or Derivative Works
|
|
44
|
+
thereof, that is intentionally submitted to Licensor for inclusion in the Work
|
|
45
|
+
by the copyright owner or by an individual or Legal Entity authorized to submit
|
|
46
|
+
on behalf of the copyright owner.
|
|
47
|
+
|
|
48
|
+
"Contributor" shall mean Licensor and any individual or Legal Entity on behalf
|
|
49
|
+
of whom a Contribution has been received by Licensor and subsequently
|
|
50
|
+
incorporated within the Work.
|
|
51
|
+
|
|
52
|
+
2. Grant of Copyright License.
|
|
53
|
+
|
|
54
|
+
Subject to the terms and conditions of this License, each Contributor hereby
|
|
55
|
+
grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free,
|
|
56
|
+
irrevocable copyright license to reproduce, prepare Derivative Works of,
|
|
57
|
+
publicly display, publicly perform, sublicense, and distribute the Work and such
|
|
58
|
+
Derivative Works in Source or Object form.
|
|
59
|
+
|
|
60
|
+
3. Grant of Patent License.
|
|
61
|
+
|
|
62
|
+
Subject to the terms and conditions of this License, each Contributor hereby
|
|
63
|
+
grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free,
|
|
64
|
+
irrevocable patent license to make, have made, use, offer to sell, sell, import,
|
|
65
|
+
and otherwise transfer the Work.
|
|
66
|
+
|
|
67
|
+
4. Redistribution.
|
|
68
|
+
|
|
69
|
+
You may reproduce and distribute copies of the Work or Derivative Works thereof
|
|
70
|
+
in any medium, with or without modifications, and in Source or Object form,
|
|
71
|
+
provided that You meet the following conditions:
|
|
72
|
+
|
|
73
|
+
(a) You must give any other recipients of the Work or Derivative Works a copy of
|
|
74
|
+
this License; and
|
|
75
|
+
|
|
76
|
+
(b) You must cause any modified files to carry prominent notices stating that
|
|
77
|
+
You changed the files; and
|
|
78
|
+
|
|
79
|
+
(c) You must retain, in the Source form of any Derivative Works that You
|
|
80
|
+
distribute, all copyright, patent, trademark, and attribution notices from the
|
|
81
|
+
Source form of the Work, excluding those notices that do not pertain to any part
|
|
82
|
+
of the Derivative Works; and
|
|
83
|
+
|
|
84
|
+
(d) If the Work includes a "NOTICE" text file as part of its distribution, then
|
|
85
|
+
any Derivative Works that You distribute must include a readable copy of the
|
|
86
|
+
attribution notices contained within such NOTICE file, excluding those notices
|
|
87
|
+
that do not pertain to any part of the Derivative Works.
|
|
88
|
+
|
|
89
|
+
5. Submission of Contributions.
|
|
90
|
+
|
|
91
|
+
Unless You explicitly state otherwise, any Contribution intentionally submitted
|
|
92
|
+
for inclusion in the Work by You to the Licensor shall be under the terms and
|
|
93
|
+
conditions of this License, without any additional terms or conditions.
|
|
94
|
+
|
|
95
|
+
6. Trademarks.
|
|
96
|
+
|
|
97
|
+
This License does not grant permission to use the trade names, trademarks,
|
|
98
|
+
service marks, or product names of the Licensor, except as required for
|
|
99
|
+
reasonable and customary use in describing the origin of the Work.
|
|
100
|
+
|
|
101
|
+
7. Disclaimer of Warranty.
|
|
102
|
+
|
|
103
|
+
Unless required by applicable law or agreed to in writing, Licensor provides the
|
|
104
|
+
Work on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
|
|
105
|
+
express or implied, including, without limitation, any warranties or conditions
|
|
106
|
+
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A PARTICULAR
|
|
107
|
+
PURPOSE.
|
|
108
|
+
|
|
109
|
+
8. Limitation of Liability.
|
|
110
|
+
|
|
111
|
+
In no event and under no legal theory, whether in tort (including negligence),
|
|
112
|
+
contract, or otherwise, unless required by applicable law, shall any Contributor
|
|
113
|
+
be liable to You for damages, including any direct, indirect, special,
|
|
114
|
+
incidental, or consequential damages of any character arising as a result of this
|
|
115
|
+
License or out of the use or inability to use the Work.
|
|
116
|
+
|
|
117
|
+
9. Accepting Warranty or Additional Liability.
|
|
118
|
+
|
|
119
|
+
While redistributing the Work or Derivative Works thereof, You may choose to
|
|
120
|
+
offer, and charge a fee for, acceptance of support, warranty, indemnity, or
|
|
121
|
+
other liability obligations and/or rights consistent with this License.
|
|
122
|
+
|
|
123
|
+
END OF TERMS AND CONDITIONS
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import type { ConnectionConfig } from '@duckcodeailabs/dql-connectors';
|
|
2
|
+
export interface ConnectorFieldSchema {
|
|
3
|
+
key: keyof ConnectionConfig | 'name';
|
|
4
|
+
label: string;
|
|
5
|
+
type: 'text' | 'number' | 'password' | 'checkbox';
|
|
6
|
+
placeholder?: string;
|
|
7
|
+
required?: boolean;
|
|
8
|
+
}
|
|
9
|
+
export interface ConnectorFormSchema {
|
|
10
|
+
driver: ConnectionConfig['driver'];
|
|
11
|
+
label: string;
|
|
12
|
+
category: 'local' | 'warehouse' | 'lakehouse';
|
|
13
|
+
description: string;
|
|
14
|
+
fields: ConnectorFieldSchema[];
|
|
15
|
+
}
|
|
16
|
+
export declare function getConnectorFormSchemas(): ConnectorFormSchema[];
|
|
17
|
+
//# sourceMappingURL=connector-forms.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"connector-forms.d.ts","sourceRoot":"","sources":["../src/connector-forms.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,gCAAgC,CAAC;AAEvE,MAAM,WAAW,oBAAoB;IACnC,GAAG,EAAE,MAAM,gBAAgB,GAAG,MAAM,CAAC;IACrC,KAAK,EAAE,MAAM,CAAC;IACd,IAAI,EAAE,MAAM,GAAG,QAAQ,GAAG,UAAU,GAAG,UAAU,CAAC;IAClD,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,QAAQ,CAAC,EAAE,OAAO,CAAC;CACpB;AAED,MAAM,WAAW,mBAAmB;IAClC,MAAM,EAAE,gBAAgB,CAAC,QAAQ,CAAC,CAAC;IACnC,KAAK,EAAE,MAAM,CAAC;IACd,QAAQ,EAAE,OAAO,GAAG,WAAW,GAAG,WAAW,CAAC;IAC9C,WAAW,EAAE,MAAM,CAAC;IACpB,MAAM,EAAE,oBAAoB,EAAE,CAAC;CAChC;AAiJD,wBAAgB,uBAAuB,IAAI,mBAAmB,EAAE,CAE/D"}
|
|
@@ -0,0 +1,157 @@
|
|
|
1
|
+
const schemas = [
|
|
2
|
+
{
|
|
3
|
+
driver: 'file',
|
|
4
|
+
label: 'Files / DuckDB memory',
|
|
5
|
+
category: 'local',
|
|
6
|
+
description: 'Query CSV, Parquet, and JSON files with DuckDB locally.',
|
|
7
|
+
fields: [
|
|
8
|
+
{ key: 'filepath', label: 'DuckDB file path', type: 'text', placeholder: ':memory:' },
|
|
9
|
+
],
|
|
10
|
+
},
|
|
11
|
+
{
|
|
12
|
+
driver: 'duckdb',
|
|
13
|
+
label: 'DuckDB',
|
|
14
|
+
category: 'local',
|
|
15
|
+
description: 'Connect directly to a local DuckDB database file.',
|
|
16
|
+
fields: [
|
|
17
|
+
{ key: 'filepath', label: 'DuckDB file path', type: 'text', placeholder: './local/dev.duckdb', required: true },
|
|
18
|
+
],
|
|
19
|
+
},
|
|
20
|
+
{
|
|
21
|
+
driver: 'sqlite',
|
|
22
|
+
label: 'SQLite',
|
|
23
|
+
category: 'local',
|
|
24
|
+
description: 'Connect to a local SQLite database file.',
|
|
25
|
+
fields: [
|
|
26
|
+
{ key: 'filepath', label: 'SQLite file path', type: 'text', placeholder: './local/dev.sqlite', required: true },
|
|
27
|
+
],
|
|
28
|
+
},
|
|
29
|
+
{
|
|
30
|
+
driver: 'postgresql',
|
|
31
|
+
label: 'PostgreSQL',
|
|
32
|
+
category: 'warehouse',
|
|
33
|
+
description: 'Standard PostgreSQL analytics databases and services.',
|
|
34
|
+
fields: warehouseFields(5432),
|
|
35
|
+
},
|
|
36
|
+
{
|
|
37
|
+
driver: 'mysql',
|
|
38
|
+
label: 'MySQL',
|
|
39
|
+
category: 'warehouse',
|
|
40
|
+
description: 'MySQL-compatible databases and managed services.',
|
|
41
|
+
fields: warehouseFields(3306),
|
|
42
|
+
},
|
|
43
|
+
{
|
|
44
|
+
driver: 'mssql',
|
|
45
|
+
label: 'SQL Server',
|
|
46
|
+
category: 'warehouse',
|
|
47
|
+
description: 'Microsoft SQL Server over the TDS protocol.',
|
|
48
|
+
fields: warehouseFields(1433),
|
|
49
|
+
},
|
|
50
|
+
{
|
|
51
|
+
driver: 'fabric',
|
|
52
|
+
label: 'Microsoft Fabric',
|
|
53
|
+
category: 'lakehouse',
|
|
54
|
+
description: 'Fabric warehouse and lakehouse SQL endpoints.',
|
|
55
|
+
fields: warehouseFields(1433),
|
|
56
|
+
},
|
|
57
|
+
{
|
|
58
|
+
driver: 'redshift',
|
|
59
|
+
label: 'Amazon Redshift',
|
|
60
|
+
category: 'warehouse',
|
|
61
|
+
description: 'Redshift clusters and serverless endpoints.',
|
|
62
|
+
fields: warehouseFields(5439),
|
|
63
|
+
},
|
|
64
|
+
{
|
|
65
|
+
driver: 'snowflake',
|
|
66
|
+
label: 'Snowflake',
|
|
67
|
+
category: 'warehouse',
|
|
68
|
+
description: 'Snowflake account, warehouse, database, and role.',
|
|
69
|
+
fields: [
|
|
70
|
+
{ key: 'account', label: 'Account', type: 'text', required: true },
|
|
71
|
+
{ key: 'warehouse', label: 'Warehouse', type: 'text', required: true },
|
|
72
|
+
{ key: 'database', label: 'Database', type: 'text', required: true },
|
|
73
|
+
{ key: 'schema', label: 'Schema', type: 'text', required: true },
|
|
74
|
+
{ key: 'username', label: 'Username', type: 'text', required: true },
|
|
75
|
+
{ key: 'password', label: 'Password', type: 'password', required: true },
|
|
76
|
+
{ key: 'role', label: 'Role', type: 'text' },
|
|
77
|
+
],
|
|
78
|
+
},
|
|
79
|
+
{
|
|
80
|
+
driver: 'bigquery',
|
|
81
|
+
label: 'BigQuery',
|
|
82
|
+
category: 'warehouse',
|
|
83
|
+
description: 'Google BigQuery project-level connection.',
|
|
84
|
+
fields: [
|
|
85
|
+
{ key: 'projectId', label: 'Project ID', type: 'text', required: true },
|
|
86
|
+
],
|
|
87
|
+
},
|
|
88
|
+
{
|
|
89
|
+
driver: 'clickhouse',
|
|
90
|
+
label: 'ClickHouse',
|
|
91
|
+
category: 'warehouse',
|
|
92
|
+
description: 'ClickHouse HTTP or cloud service endpoints.',
|
|
93
|
+
fields: [
|
|
94
|
+
{ key: 'host', label: 'Host', type: 'text', required: true },
|
|
95
|
+
{ key: 'port', label: 'Port', type: 'number', placeholder: '8443' },
|
|
96
|
+
{ key: 'database', label: 'Database', type: 'text' },
|
|
97
|
+
{ key: 'username', label: 'Username', type: 'text' },
|
|
98
|
+
{ key: 'password', label: 'Password', type: 'password' },
|
|
99
|
+
{ key: 'ssl', label: 'Use TLS', type: 'checkbox' },
|
|
100
|
+
],
|
|
101
|
+
},
|
|
102
|
+
{
|
|
103
|
+
driver: 'databricks',
|
|
104
|
+
label: 'Databricks SQL',
|
|
105
|
+
category: 'lakehouse',
|
|
106
|
+
description: 'Databricks SQL warehouse hostname, path, and personal access token.',
|
|
107
|
+
fields: [
|
|
108
|
+
{ key: 'host', label: 'Server hostname', type: 'text', required: true },
|
|
109
|
+
{ key: 'database', label: 'Catalog / database', type: 'text' },
|
|
110
|
+
{ key: 'schema', label: 'Schema', type: 'text' },
|
|
111
|
+
{ key: 'warehouse', label: 'HTTP path / warehouse', type: 'text', required: true },
|
|
112
|
+
{ key: 'password', label: 'Access token', type: 'password', required: true },
|
|
113
|
+
],
|
|
114
|
+
},
|
|
115
|
+
{
|
|
116
|
+
driver: 'athena',
|
|
117
|
+
label: 'Amazon Athena',
|
|
118
|
+
category: 'lakehouse',
|
|
119
|
+
description: 'Athena workgroup-backed query execution via AWS.',
|
|
120
|
+
fields: [
|
|
121
|
+
{ key: 'host', label: 'Region', type: 'text', placeholder: 'us-east-1', required: true },
|
|
122
|
+
{ key: 'database', label: 'Database', type: 'text', required: true },
|
|
123
|
+
{ key: 'schema', label: 'S3 output location', type: 'text', placeholder: 's3://bucket/query-results/', required: true },
|
|
124
|
+
{ key: 'warehouse', label: 'Workgroup', type: 'text' },
|
|
125
|
+
],
|
|
126
|
+
},
|
|
127
|
+
{
|
|
128
|
+
driver: 'trino',
|
|
129
|
+
label: 'Trino',
|
|
130
|
+
category: 'lakehouse',
|
|
131
|
+
description: 'Trino / Starburst clusters exposed over HTTP.',
|
|
132
|
+
fields: [
|
|
133
|
+
{ key: 'host', label: 'Host', type: 'text', required: true },
|
|
134
|
+
{ key: 'port', label: 'Port', type: 'number', placeholder: '8080' },
|
|
135
|
+
{ key: 'database', label: 'Catalog', type: 'text', required: true },
|
|
136
|
+
{ key: 'schema', label: 'Schema', type: 'text', required: true },
|
|
137
|
+
{ key: 'username', label: 'Username', type: 'text' },
|
|
138
|
+
{ key: 'password', label: 'Password', type: 'password' },
|
|
139
|
+
{ key: 'ssl', label: 'Use TLS', type: 'checkbox' },
|
|
140
|
+
],
|
|
141
|
+
},
|
|
142
|
+
];
|
|
143
|
+
export function getConnectorFormSchemas() {
|
|
144
|
+
return schemas;
|
|
145
|
+
}
|
|
146
|
+
function warehouseFields(defaultPort) {
|
|
147
|
+
return [
|
|
148
|
+
{ key: 'host', label: 'Host', type: 'text', required: true },
|
|
149
|
+
{ key: 'port', label: 'Port', type: 'number', placeholder: String(defaultPort) },
|
|
150
|
+
{ key: 'database', label: 'Database', type: 'text', required: true },
|
|
151
|
+
{ key: 'username', label: 'Username', type: 'text' },
|
|
152
|
+
{ key: 'password', label: 'Password', type: 'password' },
|
|
153
|
+
{ key: 'ssl', label: 'Use TLS', type: 'checkbox' },
|
|
154
|
+
{ key: 'connectionString', label: 'Connection string', type: 'text' },
|
|
155
|
+
];
|
|
156
|
+
}
|
|
157
|
+
//# sourceMappingURL=connector-forms.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"connector-forms.js","sourceRoot":"","sources":["../src/connector-forms.ts"],"names":[],"mappings":"AAkBA,MAAM,OAAO,GAA0B;IACrC;QACE,MAAM,EAAE,MAAM;QACd,KAAK,EAAE,uBAAuB;QAC9B,QAAQ,EAAE,OAAO;QACjB,WAAW,EAAE,yDAAyD;QACtE,MAAM,EAAE;YACN,EAAE,GAAG,EAAE,UAAU,EAAE,KAAK,EAAE,kBAAkB,EAAE,IAAI,EAAE,MAAM,EAAE,WAAW,EAAE,UAAU,EAAE;SACtF;KACF;IACD;QACE,MAAM,EAAE,QAAQ;QAChB,KAAK,EAAE,QAAQ;QACf,QAAQ,EAAE,OAAO;QACjB,WAAW,EAAE,mDAAmD;QAChE,MAAM,EAAE;YACN,EAAE,GAAG,EAAE,UAAU,EAAE,KAAK,EAAE,kBAAkB,EAAE,IAAI,EAAE,MAAM,EAAE,WAAW,EAAE,oBAAoB,EAAE,QAAQ,EAAE,IAAI,EAAE;SAChH;KACF;IACD;QACE,MAAM,EAAE,QAAQ;QAChB,KAAK,EAAE,QAAQ;QACf,QAAQ,EAAE,OAAO;QACjB,WAAW,EAAE,0CAA0C;QACvD,MAAM,EAAE;YACN,EAAE,GAAG,EAAE,UAAU,EAAE,KAAK,EAAE,kBAAkB,EAAE,IAAI,EAAE,MAAM,EAAE,WAAW,EAAE,oBAAoB,EAAE,QAAQ,EAAE,IAAI,EAAE;SAChH;KACF;IACD;QACE,MAAM,EAAE,YAAY;QACpB,KAAK,EA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AAM,CAAC,WAAW,CAAC,EAAE;QAChF,EAAE,GAAG,EAAE,UAAU,EAAE,KAAK,EAAE,UAAU,EAAE,IAAI,EAAE,MAAM,EAAE,QAAQ,EAAE,IAAI,EAAE;QACpE,EAAE,GAAG,EAAE,UAAU,EAAE,KAAK,EAAE,UAAU,EAAE,IAAI,EAAE,MAAM,EAAE;QACpD,EAAE,GAAG,EAAE,UAAU,EAAE,KAAK,EAAE,UAAU,EAAE,IAAI,EAAE,UAAU,EAAE;QACxD,EAAE,GAAG,EAAE,KAAK,EAAE,KAAK,EAAE,SAAS,EAAE,IAAI,EAAE,UAAU,EAAE;QAClD,EAAE,GAAG,EAAE,kBAAkB,EAAE,KAAK,EAAE,mBAAmB,EAAE,IAAI,EAAE,MAAM,EAAE;KACtE,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
export type NotebookCellType = 'markdown' | 'sql' | 'dql' | 'chart';
|
|
2
|
+
export interface NotebookMetadata {
|
|
3
|
+
title: string;
|
|
4
|
+
description?: string;
|
|
5
|
+
createdWith: 'dql';
|
|
6
|
+
template?: string;
|
|
7
|
+
}
|
|
8
|
+
export interface NotebookChartConfig {
|
|
9
|
+
sourceCellId?: string;
|
|
10
|
+
chart?: string;
|
|
11
|
+
x?: string;
|
|
12
|
+
y?: string;
|
|
13
|
+
y2?: string;
|
|
14
|
+
color?: string;
|
|
15
|
+
title?: string;
|
|
16
|
+
}
|
|
17
|
+
export interface NotebookCell {
|
|
18
|
+
id: string;
|
|
19
|
+
type: NotebookCellType;
|
|
20
|
+
title?: string;
|
|
21
|
+
source: string;
|
|
22
|
+
config?: NotebookChartConfig;
|
|
23
|
+
}
|
|
24
|
+
export interface NotebookDocument {
|
|
25
|
+
version: 1;
|
|
26
|
+
metadata: NotebookMetadata;
|
|
27
|
+
cells: NotebookCell[];
|
|
28
|
+
}
|
|
29
|
+
export declare function createNotebookDocument(title: string, cells: NotebookCell[], metadata?: Partial<NotebookMetadata>): NotebookDocument;
|
|
30
|
+
export declare function serializeNotebook(document: NotebookDocument): string;
|
|
31
|
+
export declare function deserializeNotebook(raw: string): NotebookDocument;
|
|
32
|
+
export declare function createWelcomeNotebook(template: string, projectTitle: string): NotebookDocument;
|
|
33
|
+
//# sourceMappingURL=document.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"document.d.ts","sourceRoot":"","sources":["../src/document.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,gBAAgB,GAAG,UAAU,GAAG,KAAK,GAAG,KAAK,GAAG,OAAO,CAAC;AAEpE,MAAM,WAAW,gBAAgB;IAC/B,KAAK,EAAE,MAAM,CAAC;IACd,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,WAAW,EAAE,KAAK,CAAC;IACnB,QAAQ,CAAC,EAAE,MAAM,CAAC;CACnB;AAED,MAAM,WAAW,mBAAmB;IAClC,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,CAAC,CAAC,EAAE,MAAM,CAAC;IACX,CAAC,CAAC,EAAE,MAAM,CAAC;IACX,EAAE,CAAC,EAAE,MAAM,CAAC;IACZ,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB;AAED,MAAM,WAAW,YAAY;IAC3B,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,EAAE,gBAAgB,CAAC;IACvB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,MAAM,EAAE,MAAM,CAAC;IACf,MAAM,CAAC,EAAE,mBAAmB,CAAC;CAC9B;AAED,MAAM,WAAW,gBAAgB;IAC/B,OAAO,EAAE,CAAC,CAAC;IACX,QAAQ,EAAE,gBAAgB,CAAC;IAC3B,KAAK,EAAE,YAAY,EAAE,CAAC;CACvB;AAED,wBAAgB,sBAAsB,CACpC,KAAK,EAAE,MAAM,EACb,KAAK,EAAE,YAAY,EAAE,EACrB,QAAQ,GAAE,OAAO,CAAC,gBAAgB,CAAM,GACvC,gBAAgB,CAUlB;AAED,wBAAgB,iBAAiB,CAAC,QAAQ,EAAE,gBAAgB,GAAG,MAAM,CAEpE;AAED,wBAAgB,mBAAmB,CAAC,GAAG,EAAE,MAAM,GAAG,gBAAgB,CAsBjE;AAED,wBAAgB,qBAAqB,CAAC,QAAQ,EAAE,MAAM,EAAE,YAAY,EAAE,MAAM,GAAG,gBAAgB,CAmI9F"}
|
package/dist/document.js
ADDED
|
@@ -0,0 +1,165 @@
|
|
|
1
|
+
export function createNotebookDocument(title, cells, metadata = {}) {
|
|
2
|
+
return {
|
|
3
|
+
version: 1,
|
|
4
|
+
metadata: {
|
|
5
|
+
title,
|
|
6
|
+
createdWith: 'dql',
|
|
7
|
+
...metadata,
|
|
8
|
+
},
|
|
9
|
+
cells,
|
|
10
|
+
};
|
|
11
|
+
}
|
|
12
|
+
export function serializeNotebook(document) {
|
|
13
|
+
return JSON.stringify(document, null, 2);
|
|
14
|
+
}
|
|
15
|
+
export function deserializeNotebook(raw) {
|
|
16
|
+
const parsed = JSON.parse(raw);
|
|
17
|
+
if (parsed.version !== 1 || !parsed.metadata?.title || !Array.isArray(parsed.cells)) {
|
|
18
|
+
throw new Error('Invalid .dqlnb document.');
|
|
19
|
+
}
|
|
20
|
+
return {
|
|
21
|
+
version: 1,
|
|
22
|
+
metadata: {
|
|
23
|
+
title: parsed.metadata.title,
|
|
24
|
+
description: parsed.metadata.description,
|
|
25
|
+
createdWith: 'dql',
|
|
26
|
+
template: parsed.metadata.template,
|
|
27
|
+
},
|
|
28
|
+
cells: parsed.cells.map((cell, index) => ({
|
|
29
|
+
id: cell.id ?? `cell-${index + 1}`,
|
|
30
|
+
type: cell.type ?? 'markdown',
|
|
31
|
+
title: cell.title,
|
|
32
|
+
source: cell.source ?? '',
|
|
33
|
+
config: cell.config,
|
|
34
|
+
})),
|
|
35
|
+
};
|
|
36
|
+
}
|
|
37
|
+
export function createWelcomeNotebook(template, projectTitle) {
|
|
38
|
+
const normalized = template.toLowerCase();
|
|
39
|
+
if (normalized === 'ecommerce') {
|
|
40
|
+
return createNotebookDocument(`${projectTitle} Welcome`, [
|
|
41
|
+
{
|
|
42
|
+
id: 'intro',
|
|
43
|
+
type: 'markdown',
|
|
44
|
+
title: 'Welcome',
|
|
45
|
+
source: `# ${projectTitle}\n\nThis notebook gives you a browser-first tour of DQL using the bundled e-commerce sample data. Run the cells below to explore revenue, funnel health, and repeat purchase behavior.`,
|
|
46
|
+
},
|
|
47
|
+
{
|
|
48
|
+
id: 'dql-revenue',
|
|
49
|
+
type: 'dql',
|
|
50
|
+
title: 'Revenue by Channel',
|
|
51
|
+
source: `block "Revenue by Channel" {\n domain = "commerce"\n type = "custom"\n description = "Starter DQL block for channel-level revenue"\n\n query = """\n SELECT channel, ROUND(SUM(order_total), 2) AS revenue\n FROM read_csv_auto('./data/orders.csv')\n GROUP BY channel\n ORDER BY revenue DESC\n """\n\n visualization {\n chart = "bar"\n x = channel\n y = revenue\n }\n\n tests {\n assert row_count > 0\n }\n}`,
|
|
52
|
+
},
|
|
53
|
+
{
|
|
54
|
+
id: 'sql-funnel',
|
|
55
|
+
type: 'sql',
|
|
56
|
+
title: 'Checkout Funnel',
|
|
57
|
+
source: `SELECT step, users\nFROM read_csv_auto('./data/funnel.csv')\nORDER BY sort_order;`,
|
|
58
|
+
},
|
|
59
|
+
{
|
|
60
|
+
id: 'chart-funnel',
|
|
61
|
+
type: 'chart',
|
|
62
|
+
title: 'Funnel View',
|
|
63
|
+
source: '',
|
|
64
|
+
config: {
|
|
65
|
+
sourceCellId: 'sql-funnel',
|
|
66
|
+
chart: 'bar',
|
|
67
|
+
x: 'step',
|
|
68
|
+
y: 'users',
|
|
69
|
+
title: 'Funnel conversion by step',
|
|
70
|
+
},
|
|
71
|
+
},
|
|
72
|
+
], { description: 'Guided walkthrough for the e-commerce template.', template: 'ecommerce' });
|
|
73
|
+
}
|
|
74
|
+
if (normalized === 'saas') {
|
|
75
|
+
return createNotebookDocument(`${projectTitle} Welcome`, [
|
|
76
|
+
{
|
|
77
|
+
id: 'intro',
|
|
78
|
+
type: 'markdown',
|
|
79
|
+
title: 'Welcome',
|
|
80
|
+
source: `# ${projectTitle}\n\nThis notebook highlights MRR, churn, and expansion revenue using the bundled SaaS sample data.`,
|
|
81
|
+
},
|
|
82
|
+
{
|
|
83
|
+
id: 'dql-mrr',
|
|
84
|
+
type: 'dql',
|
|
85
|
+
title: 'MRR by Plan',
|
|
86
|
+
source: `block "MRR by Plan" {\n domain = "saas"\n type = "custom"\n description = "Monthly recurring revenue by plan tier"\n\n query = """\n SELECT plan_tier, ROUND(SUM(mrr), 2) AS mrr\n FROM read_csv_auto('./data/subscriptions.csv')\n WHERE status = 'active'\n GROUP BY plan_tier\n ORDER BY mrr DESC\n """\n\n visualization {\n chart = "bar"\n x = plan_tier\n y = mrr\n }\n}`,
|
|
87
|
+
},
|
|
88
|
+
{
|
|
89
|
+
id: 'sql-cohort',
|
|
90
|
+
type: 'sql',
|
|
91
|
+
title: 'Logo Retention',
|
|
92
|
+
source: `SELECT cohort_month, retained_accounts\nFROM read_csv_auto('./data/cohorts.csv')\nORDER BY cohort_month;`,
|
|
93
|
+
},
|
|
94
|
+
{
|
|
95
|
+
id: 'chart-cohort',
|
|
96
|
+
type: 'chart',
|
|
97
|
+
title: 'Retention Trend',
|
|
98
|
+
source: '',
|
|
99
|
+
config: {
|
|
100
|
+
sourceCellId: 'sql-cohort',
|
|
101
|
+
chart: 'line',
|
|
102
|
+
x: 'cohort_month',
|
|
103
|
+
y: 'retained_accounts',
|
|
104
|
+
title: 'Retained accounts by cohort',
|
|
105
|
+
},
|
|
106
|
+
},
|
|
107
|
+
], { description: 'Guided walkthrough for the SaaS template.', template: 'saas' });
|
|
108
|
+
}
|
|
109
|
+
if (normalized === 'taxi') {
|
|
110
|
+
return createNotebookDocument(`${projectTitle} Welcome`, [
|
|
111
|
+
{
|
|
112
|
+
id: 'intro',
|
|
113
|
+
type: 'markdown',
|
|
114
|
+
title: 'Welcome',
|
|
115
|
+
source: `# ${projectTitle}\n\nThis notebook explores trip volume, fares, and pickup patterns using the bundled taxi dataset.`,
|
|
116
|
+
},
|
|
117
|
+
{
|
|
118
|
+
id: 'dql-borough',
|
|
119
|
+
type: 'dql',
|
|
120
|
+
title: 'Trips by Borough',
|
|
121
|
+
source: `block "Trips by Borough" {\n domain = "mobility"\n type = "custom"\n description = "Trip count by pickup borough"\n\n query = """\n SELECT pickup_borough, COUNT(*) AS trip_count\n FROM read_csv_auto('./data/trips.csv')\n GROUP BY pickup_borough\n ORDER BY trip_count DESC\n """\n\n visualization {\n chart = "bar"\n x = pickup_borough\n y = trip_count\n }\n}`,
|
|
122
|
+
},
|
|
123
|
+
{
|
|
124
|
+
id: 'sql-fare',
|
|
125
|
+
type: 'sql',
|
|
126
|
+
title: 'Average Fare by Hour',
|
|
127
|
+
source: `SELECT pickup_hour, ROUND(AVG(fare_amount), 2) AS avg_fare\nFROM read_csv_auto('./data/trips.csv')\nGROUP BY pickup_hour\nORDER BY pickup_hour;`,
|
|
128
|
+
},
|
|
129
|
+
{
|
|
130
|
+
id: 'chart-fare',
|
|
131
|
+
type: 'chart',
|
|
132
|
+
title: 'Hourly Fare Trend',
|
|
133
|
+
source: '',
|
|
134
|
+
config: {
|
|
135
|
+
sourceCellId: 'sql-fare',
|
|
136
|
+
chart: 'line',
|
|
137
|
+
x: 'pickup_hour',
|
|
138
|
+
y: 'avg_fare',
|
|
139
|
+
title: 'Average fare by pickup hour',
|
|
140
|
+
},
|
|
141
|
+
},
|
|
142
|
+
], { description: 'Guided walkthrough for the NYC taxi template.', template: 'taxi' });
|
|
143
|
+
}
|
|
144
|
+
return createNotebookDocument(`${projectTitle} Welcome`, [
|
|
145
|
+
{
|
|
146
|
+
id: 'intro',
|
|
147
|
+
type: 'markdown',
|
|
148
|
+
title: 'Welcome',
|
|
149
|
+
source: `# ${projectTitle}\n\nWelcome to the browser-first DQL notebook. Use this notebook to edit DQL, run raw SQL, and compare chart configurations without leaving the browser.`,
|
|
150
|
+
},
|
|
151
|
+
{
|
|
152
|
+
id: 'dql-starter',
|
|
153
|
+
type: 'dql',
|
|
154
|
+
title: 'Starter DQL Block',
|
|
155
|
+
source: `block "Revenue by Segment" {\n domain = "revenue"\n type = "custom"\n description = "Starter block for segment revenue analysis"\n\n query = """\n SELECT segment_tier AS segment, SUM(amount) AS revenue\n FROM read_csv_auto('./data/revenue.csv')\n GROUP BY segment_tier\n ORDER BY revenue DESC\n """\n\n visualization {\n chart = "bar"\n x = segment\n y = revenue\n }\n}`,
|
|
156
|
+
},
|
|
157
|
+
{
|
|
158
|
+
id: 'markdown-next',
|
|
159
|
+
type: 'markdown',
|
|
160
|
+
title: 'Next Steps',
|
|
161
|
+
source: `## What to try next\n\n- Edit the SQL in the DQL cell and run it again\n- Add a new SQL or markdown cell from the toolbar\n- Export this notebook as a \`.dqlnb\` file for git-friendly review`,
|
|
162
|
+
},
|
|
163
|
+
], { description: 'Guided walkthrough for the starter template.', template: 'starter' });
|
|
164
|
+
}
|
|
165
|
+
//# sourceMappingURL=document.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"document.js","sourceRoot":"","sources":["../src/document.ts"],"names":[],"mappings":"AAiCA,MAAM,UAAU,sBAAsB,CACpC,KAAa,EACb,KAAqB,EACrB,WAAsC,EAAE;IAExC,OAAO;QACL,OAAO,EAAE,CAAC;QACV,QAAQ,EAAE;YACR,KAAK;YACL,WAAW,EAAE,KAAK;YAClB,GAAG,QAAQ;SACZ;QACD,KAAK;KACN,CAAC;AACJ,CAAC;AAED,MAAM,UAAU,iBAAiB,CAAC,QAA0B;IAC1D,OAAO,IAAI,CAAC,SAAS,CAAC,QAAQ,EAAE,IAAI,EAAE,CAAC,CAAC,CAAC;AAC3C,CAAC;AAED,MAAM,UAAU,mBAAmB,CAAC,GAAW;IAC7C,MAAM,MAAM,GAAG,IAAI,CAAC,KAAK,CAAC,GAAG,CAA8B,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;YAChB,KAAK,EAAE,YAAY;YACnB,MAAM,EAAE,gMAAgM;SACzM;KACF,EAAE,EAAE,WAAW,EAAE,8CAA8C,EAAE,QAAQ,EAAE,SAAS,EAAE,CAAC,CAAC;AAC3F,CAAC"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import type { SQLParamSpec } from '@duckcodeailabs/dql-connectors';
|
|
2
|
+
import type { NotebookCell, NotebookChartConfig } from './document.js';
|
|
3
|
+
export interface NotebookExecutionPlan {
|
|
4
|
+
title: string;
|
|
5
|
+
sql: string;
|
|
6
|
+
sqlParams: SQLParamSpec[];
|
|
7
|
+
variables: Record<string, unknown>;
|
|
8
|
+
chartConfig?: NotebookChartConfig;
|
|
9
|
+
tests: Array<{
|
|
10
|
+
field: string;
|
|
11
|
+
operator: string;
|
|
12
|
+
expected: unknown;
|
|
13
|
+
}>;
|
|
14
|
+
}
|
|
15
|
+
export declare function buildExecutionPlan(cell: NotebookCell): NotebookExecutionPlan | null;
|
|
16
|
+
//# sourceMappingURL=execute.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"execute.d.ts","sourceRoot":"","sources":["../src/execute.ts"],"names":[],"mappings":"AAOA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,gCAAgC,CAAC;AACnE,OAAO,KAAK,EAAE,YAAY,EAAE,mBAAmB,EAAE,MAAM,eAAe,CAAC;AAEvE,MAAM,WAAW,qBAAqB;IACpC,KAAK,EAAE,MAAM,CAAC;IACd,GAAG,EAAE,MAAM,CAAC;IACZ,SAAS,EAAE,YAAY,EAAE,CAAC;IAC1B,SAAS,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IACnC,WAAW,CAAC,EAAE,mBAAmB,CAAC;IAClC,KAAK,EAAE,KAAK,CAAC;QAAE,KAAK,EAAE,MAAM,CAAC;QAAC,QAAQ,EAAE,MAAM,CAAC;QAAC,QAAQ,EAAE,OAAO,CAAA;KAAE,CAAC,CAAC;CACtE;AAED,wBAAgB,kBAAkB,CAAC,IAAI,EAAE,YAAY,GAAG,qBAAqB,GAAG,IAAI,CA+CnF"}
|
package/dist/execute.js
ADDED
|
@@ -0,0 +1,113 @@
|
|
|
1
|
+
import { NodeKind, parse, } from '@duckcodeailabs/dql-core';
|
|
2
|
+
export function buildExecutionPlan(cell) {
|
|
3
|
+
if (cell.type === 'markdown' || cell.type === 'chart') {
|
|
4
|
+
return null;
|
|
5
|
+
}
|
|
6
|
+
if (cell.type === 'sql') {
|
|
7
|
+
return {
|
|
8
|
+
title: cell.title || 'SQL cell',
|
|
9
|
+
sql: cell.source,
|
|
10
|
+
sqlParams: [],
|
|
11
|
+
variables: {},
|
|
12
|
+
chartConfig: cell.config,
|
|
13
|
+
tests: [],
|
|
14
|
+
};
|
|
15
|
+
}
|
|
16
|
+
const program = parse(cell.source);
|
|
17
|
+
const block = program.statements.find((statement) => statement.kind === NodeKind.BlockDecl);
|
|
18
|
+
if (!block) {
|
|
19
|
+
throw new Error('DQL notebook cells must contain a block declaration.');
|
|
20
|
+
}
|
|
21
|
+
if (block.blockType !== 'custom') {
|
|
22
|
+
throw new Error('Only custom DQL blocks can run inside the notebook today.');
|
|
23
|
+
}
|
|
24
|
+
if (!block.query) {
|
|
25
|
+
throw new Error('DQL notebook block is missing a query field.');
|
|
26
|
+
}
|
|
27
|
+
const processed = processSQL(block.query.rawSQL, block.query.interpolations);
|
|
28
|
+
const chartConfig = block.visualization ? lowerChartConfig(block.visualization.properties) : undefined;
|
|
29
|
+
const variables = Object.fromEntries((block.params?.params ?? []).map((param) => [param.name, evaluateExpression(param.initializer)]));
|
|
30
|
+
return {
|
|
31
|
+
title: block.name,
|
|
32
|
+
sql: processed.sql,
|
|
33
|
+
sqlParams: processed.params,
|
|
34
|
+
variables,
|
|
35
|
+
chartConfig,
|
|
36
|
+
tests: (block.tests ?? []).map((test) => ({
|
|
37
|
+
field: test.field,
|
|
38
|
+
operator: test.operator,
|
|
39
|
+
expected: evaluateExpression(test.expected),
|
|
40
|
+
})),
|
|
41
|
+
};
|
|
42
|
+
}
|
|
43
|
+
function lowerChartConfig(properties) {
|
|
44
|
+
const config = {};
|
|
45
|
+
for (const property of properties) {
|
|
46
|
+
const value = evaluateExpression(property.value);
|
|
47
|
+
switch (property.name) {
|
|
48
|
+
case 'chart':
|
|
49
|
+
config.chart = String(value);
|
|
50
|
+
break;
|
|
51
|
+
case 'x':
|
|
52
|
+
config.x = String(value);
|
|
53
|
+
break;
|
|
54
|
+
case 'y':
|
|
55
|
+
config.y = String(value);
|
|
56
|
+
break;
|
|
57
|
+
case 'y2':
|
|
58
|
+
config.y2 = String(value);
|
|
59
|
+
break;
|
|
60
|
+
case 'color':
|
|
61
|
+
config.color = String(value);
|
|
62
|
+
break;
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
return config;
|
|
66
|
+
}
|
|
67
|
+
function processSQL(rawSQL, interpolations) {
|
|
68
|
+
if (interpolations.length === 0) {
|
|
69
|
+
return { sql: rawSQL, params: [] };
|
|
70
|
+
}
|
|
71
|
+
let sql = rawSQL;
|
|
72
|
+
const params = [];
|
|
73
|
+
const sorted = [...interpolations].sort((a, b) => b.offsetInSQL - a.offsetInSQL);
|
|
74
|
+
let position = interpolations.length;
|
|
75
|
+
for (const interpolation of sorted) {
|
|
76
|
+
const placeholder = `$${position}`;
|
|
77
|
+
const from = interpolation.offsetInSQL;
|
|
78
|
+
const rest = sql.slice(from);
|
|
79
|
+
const pattern = new RegExp(`^\\$\\{${interpolation.variableName}\\}|^\\{${interpolation.variableName}\\}`);
|
|
80
|
+
const match = rest.match(pattern);
|
|
81
|
+
if (!match) {
|
|
82
|
+
position -= 1;
|
|
83
|
+
continue;
|
|
84
|
+
}
|
|
85
|
+
sql = sql.slice(0, from) + placeholder + sql.slice(from + match[0].length);
|
|
86
|
+
params.unshift({ name: interpolation.variableName, position });
|
|
87
|
+
position -= 1;
|
|
88
|
+
}
|
|
89
|
+
return { sql, params };
|
|
90
|
+
}
|
|
91
|
+
function evaluateExpression(node) {
|
|
92
|
+
switch (node.kind) {
|
|
93
|
+
case NodeKind.StringLiteral:
|
|
94
|
+
return node.value;
|
|
95
|
+
case NodeKind.NumberLiteral:
|
|
96
|
+
return node.value;
|
|
97
|
+
case NodeKind.BooleanLiteral:
|
|
98
|
+
return node.value;
|
|
99
|
+
case NodeKind.Identifier:
|
|
100
|
+
return node.name;
|
|
101
|
+
case NodeKind.ArrayLiteral:
|
|
102
|
+
return node.elements.map((element) => evaluateExpression(element));
|
|
103
|
+
case NodeKind.IntervalExpr:
|
|
104
|
+
return node.value;
|
|
105
|
+
case NodeKind.BinaryExpr:
|
|
106
|
+
return `${evaluateExpression(node.left)} ${node.operator} ${evaluateExpression(node.right)}`;
|
|
107
|
+
case NodeKind.FunctionCall:
|
|
108
|
+
return node.callee;
|
|
109
|
+
case NodeKind.TemplateString:
|
|
110
|
+
return node.parts.map((part) => (typeof part === 'string' ? part : String(evaluateExpression(part)))).join('');
|
|
111
|
+
}
|
|
112
|
+
}
|
|
113
|
+
//# sourceMappingURL=execute.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"execute.js","sourceRoot":"","sources":["../src/execute.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EACR,KAAK,GAIN,MAAM,0BAA0B,CAAC;AAalC,MAAM,UAAU,kBAAkB,CAAC,IAAkB;IACnD,IAAI,IAAI,CAAC,IAAI,KAAK,UAAU,IAAI,IAAI,CAAC,IAAI,KAAK,OAAO,EAAE,CAAC;QACtD,OAAO,IAAI,CAAC;IACd,CAAC;IAED,IAAI,IAAI,CAAC,IAAI,KAAK,KAAK,EAAE,CAAC;QACxB,OAAO;YACL,KAAK,EAAE,IAAI,CAAC,KAAK,IAAI,UAAU;YAC/B,GAAG,EAAE,IAAI,CAAC,MAAM;YAChB,SAAS,EAAE,EAAE;YACb,SAAS,EAAE,EAAE;YACb,WAAW,EAAE,IAAI,CAAC,MAAM;YACxB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3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,eAAe,CAAC;AAC9B,cAAc,cAAc,CAAC;AAC7B,cAAc,sBAAsB,CAAC"}
|
package/package.json
ADDED
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@duckcodeailabs/dql-notebook",
|
|
3
|
+
"version": "0.1.1",
|
|
4
|
+
"description": "Notebook document model and execution helpers for DQL",
|
|
5
|
+
"license": "Apache-2.0",
|
|
6
|
+
"type": "module",
|
|
7
|
+
"main": "./dist/index.js",
|
|
8
|
+
"types": "./dist/index.d.ts",
|
|
9
|
+
"exports": {
|
|
10
|
+
".": {
|
|
11
|
+
"types": "./dist/index.d.ts",
|
|
12
|
+
"import": "./dist/index.js"
|
|
13
|
+
}
|
|
14
|
+
},
|
|
15
|
+
"files": [
|
|
16
|
+
"dist"
|
|
17
|
+
],
|
|
18
|
+
"repository": {
|
|
19
|
+
"type": "git",
|
|
20
|
+
"url": "https://github.com/duckcode-ai/dql.git",
|
|
21
|
+
"directory": "packages/dql-notebook"
|
|
22
|
+
},
|
|
23
|
+
"publishConfig": {
|
|
24
|
+
"access": "public"
|
|
25
|
+
},
|
|
26
|
+
"dependencies": {
|
|
27
|
+
"@duckcodeailabs/dql-core": "0.1.1",
|
|
28
|
+
"@duckcodeailabs/dql-connectors": "0.1.1"
|
|
29
|
+
},
|
|
30
|
+
"devDependencies": {
|
|
31
|
+
"@types/node": "^22.0.0",
|
|
32
|
+
"typescript": "^5.7.0",
|
|
33
|
+
"vitest": "^3.0.0"
|
|
34
|
+
},
|
|
35
|
+
"scripts": {
|
|
36
|
+
"build": "rm -rf dist tsconfig.tsbuildinfo && tsc",
|
|
37
|
+
"test": "vitest run --passWithNoTests",
|
|
38
|
+
"clean": "rm -rf dist tsconfig.tsbuildinfo"
|
|
39
|
+
}
|
|
40
|
+
}
|