create-dql-app 1.4.1 → 1.4.4

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 (56) hide show
  1. package/README.md +11 -7
  2. package/bin/create-dql-app.mjs +6 -5
  3. package/package.json +1 -1
  4. package/templates/acme-bank/.dql/skills/mei.chen@acme-bank.com/cards-fraud.skill.md +15 -0
  5. package/templates/acme-bank/.dql/skills/sara.fitch@acme-bank.com/cfo-weekly.skill.md +15 -0
  6. package/templates/acme-bank/README.md +75 -0
  7. package/templates/acme-bank/apps/cards-ops/README.md +9 -0
  8. package/templates/acme-bank/apps/cards-ops/dashboards/daily-ops.dqld +61 -0
  9. package/templates/acme-bank/apps/cards-ops/dashboards/fraud-watch.dqld +37 -0
  10. package/templates/acme-bank/apps/cards-ops/dql.app.json +76 -0
  11. package/templates/acme-bank/apps/cards-ops/drafts/.gitkeep +1 -0
  12. package/templates/acme-bank/apps/cards-ops/notebooks/.gitkeep +1 -0
  13. package/templates/acme-bank/apps/executive-cockpit/README.md +9 -0
  14. package/templates/acme-bank/apps/executive-cockpit/dashboards/bank-overview.dqld +57 -0
  15. package/templates/acme-bank/apps/executive-cockpit/dql.app.json +82 -0
  16. package/templates/acme-bank/apps/executive-cockpit/drafts/.gitkeep +1 -0
  17. package/templates/acme-bank/apps/executive-cockpit/notebooks/.gitkeep +1 -0
  18. package/templates/acme-bank/apps/retail-deposits/README.md +9 -0
  19. package/templates/acme-bank/apps/retail-deposits/dashboards/deposit-growth.dqld +48 -0
  20. package/templates/acme-bank/apps/retail-deposits/dql.app.json +59 -0
  21. package/templates/acme-bank/apps/retail-deposits/drafts/.gitkeep +1 -0
  22. package/templates/acme-bank/apps/retail-deposits/notebooks/.gitkeep +1 -0
  23. package/templates/acme-bank/apps/risk-office/README.md +8 -0
  24. package/templates/acme-bank/apps/risk-office/dashboards/credit-risk.dqld +48 -0
  25. package/templates/acme-bank/apps/risk-office/dql.app.json +57 -0
  26. package/templates/acme-bank/apps/risk-office/drafts/.gitkeep +1 -0
  27. package/templates/acme-bank/apps/risk-office/notebooks/.gitkeep +1 -0
  28. package/templates/acme-bank/blocks/cards/card_approval_rate.dql +24 -0
  29. package/templates/acme-bank/blocks/cards/daily_transaction_volume.dql +34 -0
  30. package/templates/acme-bank/blocks/cards/fraud_alerts_by_region.dql +33 -0
  31. package/templates/acme-bank/blocks/cards/fraud_by_merchant_recent.dql +33 -0
  32. package/templates/acme-bank/blocks/deposits/branch_deposit_leaders.dql +30 -0
  33. package/templates/acme-bank/blocks/deposits/deposit_trend.dql +30 -0
  34. package/templates/acme-bank/blocks/deposits/deposits_by_segment.dql +33 -0
  35. package/templates/acme-bank/blocks/executive/bank_health_scorecard.dql +34 -0
  36. package/templates/acme-bank/blocks/lending/high_risk_loan_exposure.dql +31 -0
  37. package/templates/acme-bank/blocks/lending/loan_delinquency_by_region.dql +32 -0
  38. package/templates/acme-bank/data/customers.csv +12 -0
  39. package/templates/acme-bank/data/deposits.csv +22 -0
  40. package/templates/acme-bank/data/fraud_alerts.csv +9 -0
  41. package/templates/acme-bank/data/loans.csv +11 -0
  42. package/templates/acme-bank/data/merchants.csv +10 -0
  43. package/templates/acme-bank/data/transactions.csv +20 -0
  44. package/templates/acme-bank/dql.config.json +21 -0
  45. package/templates/acme-bank/notebooks/cards_fraud_ops.dqlnb +47 -0
  46. package/templates/acme-bank/notebooks/credit_risk_review.dqlnb +42 -0
  47. package/templates/acme-bank/notebooks/executive_weekly_review.dqlnb +47 -0
  48. package/templates/acme-bank/notebooks/retail_deposits_review.dqlnb +42 -0
  49. package/templates/acme-bank/notebooks/welcome.dqlnb +44 -0
  50. package/templates/acme-bank/package.json +18 -0
  51. package/templates/acme-bank/semantic-layer/dimensions/banking.yaml +36 -0
  52. package/templates/acme-bank/semantic-layer/metrics/banking.yaml +37 -0
  53. package/templates/empty/README.md +4 -3
  54. package/templates/empty/package.json +1 -1
  55. package/templates/jaffle-shop/README.md +1 -1
  56. package/templates/jaffle-shop/package.json +1 -1
@@ -0,0 +1,47 @@
1
+ {
2
+ "dqlnbVersion": 1,
3
+ "version": 1,
4
+ "metadata": {
5
+ "title": "Executive Weekly Review",
6
+ "description": "Cross-domain CXO notebook combining cards, deposits, lending, and the executive scorecard.",
7
+ "status": "certified",
8
+ "categories": ["executive", "weekly-review", "cxo"],
9
+ "owner": "sara.fitch@acme-bank.com"
10
+ },
11
+ "cells": [
12
+ {
13
+ "id": "intro",
14
+ "type": "markdown",
15
+ "source": "# Executive Weekly Review\n\nThis notebook is the analyst working surface behind the Executive Cockpit App. It combines certified blocks across cards, deposits, and lending."
16
+ },
17
+ {
18
+ "id": "scorecard",
19
+ "title": "Bank health scorecard (certified block)",
20
+ "type": "dql",
21
+ "source": "@block(\"bank_health_scorecard\")"
22
+ },
23
+ {
24
+ "id": "deposit_trend",
25
+ "title": "Deposit trend",
26
+ "type": "dql",
27
+ "source": "@block(\"deposit_trend\")"
28
+ },
29
+ {
30
+ "id": "fraud_exposure",
31
+ "title": "Fraud exposure",
32
+ "type": "dql",
33
+ "source": "@block(\"fraud_alerts_by_region\")"
34
+ },
35
+ {
36
+ "id": "credit_risk",
37
+ "title": "Credit risk",
38
+ "type": "dql",
39
+ "source": "@block(\"loan_delinquency_by_region\")"
40
+ },
41
+ {
42
+ "id": "action_notes",
43
+ "type": "markdown",
44
+ "source": "## Action notes\n\n- Fraud analysts review branch-level alerts in the Cards Operations App.\n- Retail leaders monitor net-new deposits in the Retail Deposits App.\n- Risk office reviews high-risk exposure in the Risk Office App.\n- Executives consume the packaged summary in the Executive Cockpit App."
45
+ }
46
+ ]
47
+ }
@@ -0,0 +1,42 @@
1
+ {
2
+ "dqlnbVersion": 1,
3
+ "version": 1,
4
+ "metadata": {
5
+ "title": "Retail Deposits Review",
6
+ "description": "Deposit balance trend, segment mix, and branch leaders for retail banking.",
7
+ "status": "certified",
8
+ "categories": ["deposits", "retail", "growth"],
9
+ "owner": "diego.ramos@acme-bank.com"
10
+ },
11
+ "cells": [
12
+ {
13
+ "id": "intro",
14
+ "type": "markdown",
15
+ "source": "# Retail Deposits Review\n\nRetail leaders use this notebook to inspect deposit growth before packaging the same metrics into the Retail Deposits App."
16
+ },
17
+ {
18
+ "id": "deposit_snapshot",
19
+ "title": "Deposit snapshot by region",
20
+ "type": "sql",
21
+ "source": "SELECT\n as_of_date,\n region,\n ROUND(SUM(balance_usd), 2) AS balance_usd,\n ROUND(SUM(net_new_usd), 2) AS net_new_usd\nFROM read_csv_auto('./data/deposits.csv')\nGROUP BY 1, 2\nORDER BY 1, 2"
22
+ },
23
+ {
24
+ "id": "deposit_trend",
25
+ "title": "Deposit trend (certified block)",
26
+ "type": "dql",
27
+ "source": "@block(\"deposit_trend\")"
28
+ },
29
+ {
30
+ "id": "segment_balance",
31
+ "title": "Deposits by segment (certified block)",
32
+ "type": "dql",
33
+ "source": "@block(\"deposits_by_segment\")"
34
+ },
35
+ {
36
+ "id": "branch_leaders",
37
+ "title": "Branch deposit leaders (certified block)",
38
+ "type": "dql",
39
+ "source": "@block(\"branch_deposit_leaders\")"
40
+ }
41
+ ]
42
+ }
@@ -0,0 +1,44 @@
1
+ {
2
+ "dqlnbVersion": 1,
3
+ "version": 1,
4
+ "metadata": {
5
+ "title": "{{PROJECT_NAME}} - Acme Bank Walkthrough",
6
+ "description": "Run certified banking blocks, then open Apps for stakeholder dashboards."
7
+ },
8
+ "cells": [
9
+ {
10
+ "id": "intro",
11
+ "type": "markdown",
12
+ "source": "# Acme Bank\n\nThis notebook uses the packaged Acme Bank CSV warehouse and certified DQL blocks.\n\nRun the cells top-to-bottom, then click Apps in the left rail to open Cards Operations, Retail Deposits, Risk Office, and Executive Cockpit.\n\nAdditional sample notebooks are included for cards fraud operations, retail deposits, credit risk, and executive review."
13
+ },
14
+ {
15
+ "title": "Raw transaction health",
16
+ "id": "raw_transaction_health",
17
+ "type": "sql",
18
+ "source": "SELECT status, COUNT(*) AS transactions, ROUND(SUM(amount_usd), 2) AS volume_usd\nFROM read_csv_auto('./data/transactions.csv')\nGROUP BY 1\nORDER BY volume_usd DESC"
19
+ },
20
+ {
21
+ "title": "Fraud alerts by region (certified block)",
22
+ "id": "fraud_alerts_by_region",
23
+ "type": "dql",
24
+ "source": "@block(\"fraud_alerts_by_region\")"
25
+ },
26
+ {
27
+ "title": "Deposit trend (certified block)",
28
+ "id": "deposit_trend",
29
+ "type": "dql",
30
+ "source": "@block(\"deposit_trend\")"
31
+ },
32
+ {
33
+ "title": "Executive scorecard (certified block)",
34
+ "id": "bank_health_scorecard",
35
+ "type": "dql",
36
+ "source": "@block(\"bank_health_scorecard\")"
37
+ },
38
+ {
39
+ "id": "next_notebooks",
40
+ "type": "markdown",
41
+ "source": "## Next sample notebooks\n\n- `notebooks/cards_fraud_ops.dqlnb` - branch-aware fraud monitoring\n- `notebooks/retail_deposits_review.dqlnb` - deposit growth and segment mix\n- `notebooks/credit_risk_review.dqlnb` - delinquency and high-risk exposure\n- `notebooks/executive_weekly_review.dqlnb` - CXO scorecard and cross-domain review"
42
+ }
43
+ ]
44
+ }
@@ -0,0 +1,18 @@
1
+ {
2
+ "name": "{{PROJECT_NAME}}",
3
+ "version": "0.1.0",
4
+ "private": true,
5
+ "description": "Acme Bank DQL analytics project.",
6
+ "scripts": {
7
+ "notebook": "dql notebook",
8
+ "compile": "dql compile",
9
+ "app:build": "dql app build",
10
+ "agent:reindex": "dql agent reindex",
11
+ "verify": "dql verify .",
12
+ "doctor": "dql doctor",
13
+ "test": "dql test"
14
+ },
15
+ "devDependencies": {
16
+ "@duckcodeailabs/dql-cli": "^1.4.4"
17
+ }
18
+ }
@@ -0,0 +1,36 @@
1
+ dimensions:
2
+ - name: region
3
+ label: Region
4
+ type: string
5
+ sql: region
6
+ table: customers
7
+ domain: banking
8
+
9
+ - name: branch_id
10
+ label: Branch
11
+ type: string
12
+ sql: branch_id
13
+ table: customers
14
+ domain: banking
15
+
16
+ - name: customer_segment
17
+ label: Customer Segment
18
+ type: string
19
+ sql: segment
20
+ table: customers
21
+ domain: deposits
22
+
23
+ - name: merchant_category
24
+ label: Merchant Category
25
+ type: string
26
+ sql: merchant_category
27
+ table: merchants
28
+ domain: cards
29
+
30
+ - name: risk_grade
31
+ label: Loan Risk Grade
32
+ type: string
33
+ sql: risk_grade
34
+ table: loans
35
+ domain: lending
36
+
@@ -0,0 +1,37 @@
1
+ metrics:
2
+ - name: card_volume
3
+ label: Card Volume
4
+ description: Total card transaction volume in USD.
5
+ type: sum
6
+ sql: amount_usd
7
+ table: transactions
8
+ domain: cards
9
+ tags: [cards, volume]
10
+
11
+ - name: fraud_exposure
12
+ label: Fraud Exposure
13
+ description: Total fraud alert exposure in USD.
14
+ type: sum
15
+ sql: amount_usd
16
+ table: fraud_alerts
17
+ domain: cards
18
+ tags: [fraud, risk]
19
+
20
+ - name: deposit_balance
21
+ label: Deposit Balance
22
+ description: Total customer deposit balance.
23
+ type: sum
24
+ sql: balance_usd
25
+ table: deposits
26
+ domain: deposits
27
+ tags: [deposits, balance]
28
+
29
+ - name: loan_outstanding
30
+ label: Loan Outstanding
31
+ description: Total outstanding loan balance.
32
+ type: sum
33
+ sql: outstanding_usd
34
+ table: loans
35
+ domain: lending
36
+ tags: [lending, exposure]
37
+
@@ -4,15 +4,16 @@ An empty DQL project, scaffolded by `create-dql-app --template empty`.
4
4
 
5
5
  ## Connect your warehouse
6
6
 
7
- Edit `cdql.yaml` — DQL ships 15 drivers out of the box:
7
+ Edit `dql.config.json` — DQL ships 15 drivers out of the box:
8
8
  [docs/reference/connectors.md](https://github.com/duckcode-ai/dql/blob/main/docs/reference/connectors.md).
9
9
 
10
10
  ```bash
11
- npx @duckcodeailabs/dql-cli test-connection
11
+ npm install
12
+ npm run doctor
12
13
  ```
13
14
 
14
15
  ## Start the notebook
15
16
 
16
17
  ```bash
17
- npx @duckcodeailabs/dql-cli notebook
18
+ npm run notebook
18
19
  ```
@@ -8,6 +8,6 @@
8
8
  "doctor": "dql doctor"
9
9
  },
10
10
  "devDependencies": {
11
- "@duckcodeailabs/dql-cli": "^1.0.0"
11
+ "@duckcodeailabs/dql-cli": "^1.4.4"
12
12
  }
13
13
  }
@@ -9,7 +9,7 @@ npm install
9
9
  npm run notebook
10
10
  ```
11
11
 
12
- Opens the notebook at <http://localhost:5173>. (`pnpm install && pnpm notebook`
12
+ Opens the notebook at <http://127.0.0.1:3474>. (`pnpm install && pnpm notebook`
13
13
  works too.)
14
14
 
15
15
  ## Layout
@@ -11,6 +11,6 @@
11
11
  "test": "dql test"
12
12
  },
13
13
  "devDependencies": {
14
- "@duckcodeailabs/dql-cli": "^1.0.0"
14
+ "@duckcodeailabs/dql-cli": "^1.4.4"
15
15
  }
16
16
  }