ui integration and rest api includes
This commit is contained in:
12
.stylelintrc.json
Normal file
12
.stylelintrc.json
Normal file
@@ -0,0 +1,12 @@
|
||||
{
|
||||
"extends": ["stylelint-config-standard"],
|
||||
"rules": {
|
||||
"at-rule-no-unknown": [
|
||||
true,
|
||||
{
|
||||
"ignoreAtRules": ["tailwind", "apply", "variants", "responsive", "screen", "layer"]
|
||||
}
|
||||
],
|
||||
"declaration-property-value-no-unknown": null
|
||||
}
|
||||
}
|
||||
184
Get Api's.txt
Normal file
184
Get Api's.txt
Normal file
@@ -0,0 +1,184 @@
|
||||
👤 Users & Authorization GET APIs
|
||||
http
|
||||
|
||||
|
||||
# Get all users (Web)
|
||||
https://fiesta.nearle.app/live/api/v1/web/users/getallusers?roleid=2&tenantid=8&pageno=1&pagesize=10&keyword=john
|
||||
# Get a specific user profile by ID (Web)
|
||||
https://fiesta.nearle.app/live/api/v1/web/users/getusers?userid=12
|
||||
# Get a specific user profile by ID (Mobile)
|
||||
https://fiesta.nearle.app/live/api/v1/mob/users/getusers?userid=15
|
||||
👥 Customer Management GET APIs
|
||||
http
|
||||
|
||||
|
||||
# Fetch customer profile by ID or Contact (Mobile)
|
||||
https://fiesta.nearle.app/live/api/v1/mob/customers/getbyid?customerid=4082&contactno=9876543210
|
||||
# Get customer saved address locations (Mobile)
|
||||
https://fiesta.nearle.app/live/api/v1/mob/customers/getcustomerlocation?customerid=4082
|
||||
# Get customer logged support requests (Mobile)
|
||||
https://fiesta.nearle.app/live/api/v1/mob/customers/getcustomerrequests?customerid=4082&pageno=1&pagesize=10
|
||||
# Search customer names under a tenant (Mobile)
|
||||
https://fiesta.nearle.app/live/api/v1/mob/customers/search?keyword=Jane&tenantid=8
|
||||
# Retrieve customers linked to a tenant location (Mobile)
|
||||
https://fiesta.nearle.app/live/api/v1/mob/customers/gettenantcustomers?tenantid=8&locationid=2&pageno=1&pagesize=10
|
||||
# Retrieve merchant customers list (Web)
|
||||
https://fiesta.nearle.app/live/api/v1/web/customers/gettenantcustomers?tenantid=8&locationid=2&pageno=1&pagesize=10&keyword=jane
|
||||
📦 Product & Catalog GET APIs
|
||||
http
|
||||
|
||||
|
||||
# Get product subcategories (Web)
|
||||
https://fiesta.nearle.app/live/api/v1/web/products/getproductsubcategories?categoryid=2&tenantid=8
|
||||
# Get products stock counts (Web)
|
||||
https://fiesta.nearle.app/live/api/v1/web/products/getproductscount?tenantid=8&categoryid=2&subcategoryid=12&approve=1
|
||||
# Get all global categories (Web)
|
||||
https://fiesta.nearle.app/live/api/v1/web/products/getproductcategories
|
||||
# Get specific product variants (Web)
|
||||
https://fiesta.nearle.app/live/api/v1/web/products/getproductvariants?tenantid=8&subcategoryid=12
|
||||
# Get master catalog listings (Web)
|
||||
https://fiesta.nearle.app/live/api/v1/web/products/getcatalougeproducts?tenantid=8&locationid=2&subcategoryid=12&keyword=&pageno=1&pagesize=10
|
||||
# Get live stocks catalog (Web)
|
||||
https://fiesta.nearle.app/live/api/v1/web/products/getproductstocks?tenantid=8&locationid=2
|
||||
# Get dynamic stock statement ledger (Web)
|
||||
https://fiesta.nearle.app/live/api/v1/web/products/getstockstatement?tenantid=8&locationid=2&subcategoryid=12&pageno=1&pagesize=10&keyword=
|
||||
# Get outlet geofenced inventory (Web)
|
||||
https://fiesta.nearle.app/live/api/v1/web/products/getlocationproducts?tenantid=8&locationid=2&subcategoryid=12&pageno=1&pagesize=10
|
||||
# Get outlet category inventory summary (Web)
|
||||
https://fiesta.nearle.app/live/api/v1/web/products/getlocationproductsummary?tenantid=8&locationid=2
|
||||
# Master products search board (Web)
|
||||
https://fiesta.nearle.app/live/api/v1/web/products/getallproducts?tenantid=8&locationid=2&keyword=milk&pageno=1&pagesize=10
|
||||
# Get product details by variant ID (Mobile)
|
||||
https://fiesta.nearle.app/live/api/v1/mob/products/getproductbyvariant?tenantid=8&variantid=4
|
||||
# Get product subcategories (Mobile)
|
||||
https://fiesta.nearle.app/live/api/v1/mob/products/getproductsubcategories?categoryid=2&tenantid=8
|
||||
# Search product catalog (Mobile)
|
||||
https://fiesta.nearle.app/live/api/v1/mob/products/getallproducts?keyword=milk&pageno=1&pagesize=10
|
||||
# Get structured home subcategory list (Mobile)
|
||||
https://fiesta.nearle.app/live/api/v1/mob/products/getproductsbysubcategory?categoryid=2&tenantid=8&locationid=2
|
||||
# Get mobile geofenced outlet products (Mobile)
|
||||
https://fiesta.nearle.app/live/api/v1/mob/products/getlocationproducts?tenantid=8&locationid=2&pageno=1&pagesize=20
|
||||
📋 Order Orchestration GET APIs
|
||||
http
|
||||
|
||||
|
||||
# Filtered dynamic orders board (Web)
|
||||
https://fiesta.nearle.app/live/api/v1/web/orders/getorders?tenantid=8&locationid=2&status=processing&pageno=1&pagesize=10
|
||||
# Tenant orders board (Web)
|
||||
https://fiesta.nearle.app/live/api/v1/web/orders/tenant/getorders?tenantid=8&locationid=2&status=processing&pageno=1&pagesize=10
|
||||
# Partner fleet orders board (Web)
|
||||
https://fiesta.nearle.app/live/api/v1/web/orders/partner/getorders?partnerid=1&status=processing&pageno=1&pagesize=10
|
||||
# Individual consumer invoice histories (Web)
|
||||
https://fiesta.nearle.app/live/api/v1/web/orders/customer/getorders?customerid=4082&status=delivered&pageno=1&pagesize=10
|
||||
# Operator/User orders board (Web)
|
||||
https://fiesta.nearle.app/live/api/v1/web/orders/user/getorders?appuserid=12&status=processing&pageno=1&pagesize=10
|
||||
# System Admin orders board (Web)
|
||||
https://fiesta.nearle.app/live/api/v1/web/orders/admin/getorders?applocationid=1&status=processing&pageno=1&pagesize=10
|
||||
# Get order dashboard stats summary (Web)
|
||||
https://fiesta.nearle.app/live/api/v1/web/orders/getordersummary?tenantid=8&fromdate=2026-05-01&todate=2026-05-20
|
||||
# Get location orders summary (Web)
|
||||
https://fiesta.nearle.app/live/api/v1/web/orders/getlocationsummary?tenantid=8
|
||||
# Get annual orders insights analytics (Web)
|
||||
https://fiesta.nearle.app/live/api/v1/web/orders/getorderinsight?tenantid=8
|
||||
# Get order detailed lines (Web)
|
||||
https://fiesta.nearle.app/live/api/v1/web/orders/getorderdetails?orderheaderid=2099
|
||||
# Get customer order history (Mobile)
|
||||
https://fiesta.nearle.app/live/api/v1/mob/orders/getcustomerorders?customerid=4082&pageno=1&pagesize=10
|
||||
# Get specific tenant store orders (Mobile)
|
||||
https://fiesta.nearle.app/live/api/v1/mob/orders/tenant/getorders?tenantid=8&locationid=2&pageno=1&pagesize=10
|
||||
# Get mobile order detailed lines (Mobile)
|
||||
https://fiesta.nearle.app/live/api/v1/mob/orders/getorderdetails?orderheaderid=2099
|
||||
🏍️ Partner & Rider GET APIs
|
||||
http
|
||||
|
||||
|
||||
# Get active riders (Web)
|
||||
https://fiesta.nearle.app/live/api/v1/web/partners/getriders?partnerid=1&applocationid=1&userid=12&tenantid=8
|
||||
# Get partner profiles (Web)
|
||||
https://fiesta.nearle.app/live/api/v1/web/partners/getpartners?partnerid=1&applocationid=1&userid=12
|
||||
# Get rider shifts (Web)
|
||||
https://fiesta.nearle.app/live/api/v1/web/partners/getridershifts?applocationid=1
|
||||
# Get location configurations (Web)
|
||||
https://fiesta.nearle.app/live/api/v1/web/partners/getlocations?userid=12&configid=1
|
||||
# Get rider log sheet (Web)
|
||||
https://fiesta.nearle.app/live/api/v1/web/partners/getriderlogs?partnerid=1&applocationid=1&fromdate=2026-05-20&todate=2026-05-20
|
||||
# Get partner profiles (Mobile)
|
||||
https://fiesta.nearle.app/live/api/v1/mob/partners/getpartners?partnerid=1&applocationid=1&userid=12
|
||||
# Get rider log sheet (Mobile)
|
||||
https://fiesta.nearle.app/live/api/v1/mob/partners/getriderlogs?partnerid=1&applocationid=1&fromdate=2026-05-20&todate=2026-05-20
|
||||
# Get rider operational info (Mobile)
|
||||
https://fiesta.nearle.app/live/api/v1/mob/partners/getriderinfo?userid=15
|
||||
# Get active riders list (Mobile)
|
||||
https://fiesta.nearle.app/live/api/v1/mob/partners/getriders?partnerid=1&applocationid=1&userid=15&tenantid=8
|
||||
🚚 Logistics & Deliveries GET APIs
|
||||
http
|
||||
|
||||
|
||||
# Get deliveries performance summaries (Web)
|
||||
https://fiesta.nearle.app/live/api/v1/web/deliveries/deliverysummary?tenantid=8&partnerid=1&userid=12&applocationid=1&locationid=2&fromdate=2026-05-20&todate=2026-05-20
|
||||
# Get daily delivery insights (Web)
|
||||
https://fiesta.nearle.app/live/api/v1/web/deliveries/getdeliveryinsight?tenantid=8
|
||||
# Get location deliveries summary (Web)
|
||||
https://fiesta.nearle.app/live/api/v1/web/deliveries/getlocationsummary?tenantid=8
|
||||
# Get deliveries financial report summary (Web)
|
||||
https://fiesta.nearle.app/live/api/v1/web/deliveries/getreportsummary?tenantid=8&partnerid=1&userid=12&applocationid=1&fromdate=2026-05-01&todate=2026-05-20
|
||||
# Get fleet rider summary metrics (Web)
|
||||
https://fiesta.nearle.app/live/api/v1/web/deliveries/getridersummary?applocationid=1&partnerid=1&tenantid=8&fromdate=2026-05-20&todate=2026-05-20
|
||||
# Get master deliveries board (Web)
|
||||
https://fiesta.nearle.app/live/api/v1/web/deliveries/getdeliveries?tenantid=8&fromdate=2026-05-20&todate=2026-05-20
|
||||
# Get mobile dispatch summaries (Mobile)
|
||||
https://fiesta.nearle.app/live/api/v1/mob/deliveries/deliverysummary?userid=15&fromdate=2026-05-20&todate=2026-05-20
|
||||
# Get mobile deliveries board (Mobile)
|
||||
https://fiesta.nearle.app/live/api/v1/mob/deliveries/getdeliveries?userid=15&status=assigned
|
||||
# Fetch rider active shift deliveries queue (Mobile)
|
||||
https://fiesta.nearle.app/live/api/v1/mob/deliveries/getdeliveryqueues?userid=15&fromdate=2026-05-20&todate=2026-05-20
|
||||
🏪 Tenant & Outlet Location GET APIs
|
||||
http
|
||||
|
||||
|
||||
# Search registered tenants (Web)
|
||||
https://fiesta.nearle.app/live/api/v1/web/tenants/search?status=Active&keyword=Fresh
|
||||
# Search tenants by keyword (Web)
|
||||
https://fiesta.nearle.app/live/api/v1/web/tenants/searchbykeyword?keyword=daily
|
||||
# Get all active tenants catalog (Web)
|
||||
https://fiesta.nearle.app/live/api/v1/web/tenants/getalltenants?applocationid=1&status=Active&pageno=1&pagesize=10
|
||||
# Get outlet locations assigned to a tenant (Web)
|
||||
https://fiesta.nearle.app/live/api/v1/web/tenants/gettenantlocations?tenantid=8
|
||||
# Retrieve delivery time slots config (Mobile)
|
||||
https://fiesta.nearle.app/live/api/v1/mob/tenants/gettenantslot
|
||||
# Search tenants by keyword (Mobile)
|
||||
https://fiesta.nearle.app/live/api/v1/mob/tenants/searchbykeyword?keyword=grocery
|
||||
# Retrieve tenants associated with a customer (Mobile)
|
||||
https://fiesta.nearle.app/live/api/v1/mob/tenants/getcustomertenants?customerid=4082&tenant=0
|
||||
# Get outlet locations linked to a tenant (Mobile)
|
||||
https://fiesta.nearle.app/live/api/v1/mob/tenants/gettenantlocations?tenantid=8
|
||||
# Get logistics pricing slabs for a tenant (Mobile)
|
||||
https://fiesta.nearle.app/live/api/v1/mob/tenants/gettenantpricing?tenantid=8&applocationid=1
|
||||
# Get staff members under a tenant store (Mobile)
|
||||
https://fiesta.nearle.app/live/api/v1/mob/tenants/getstaffs?tenantid=8
|
||||
# Get tenant detailed profile info (Mobile)
|
||||
https://fiesta.nearle.app/live/api/v1/mob/tenants/gettenantinfo?tenantid=8&locationid=2
|
||||
⚙️ Utilities & General Configurations GET APIs
|
||||
http
|
||||
|
||||
|
||||
# Fetch application categories by tag (Web)
|
||||
https://fiesta.nearle.app/live/api/v1/web/utils/getapptypes?tag=customer
|
||||
# Resolve subcategories (Web)
|
||||
https://fiesta.nearle.app/live/api/v1/web/utils/getsubcategories?moduleid=1&categoryid=2
|
||||
# Fetch system active geofence details (Web)
|
||||
https://fiesta.nearle.app/live/api/v1/web/utils/getapplocations?applocationid=1
|
||||
# Fetch global system categories configurations (Web)
|
||||
https://fiesta.nearle.app/live/api/v1/web/utils/getappcategories
|
||||
# Get mobile geofence configuration details (Mobile)
|
||||
https://fiesta.nearle.app/live/api/v1/mob/utils/getapplocationconfig?applocationid=1
|
||||
# Get mobile active geofence details (Mobile)
|
||||
https://fiesta.nearle.app/live/api/v1/mob/utils/getapplocations?applocationid=1
|
||||
# Fetch mobile app types by tag (Mobile)
|
||||
https://fiesta.nearle.app/live/api/v1/mob/utils/getapptypes?tag=rider
|
||||
# Fetch global payment & geofence configs (Mobile)
|
||||
https://fiesta.nearle.app/live/api/v1/mob/utils/getappconfig?configid=1
|
||||
# Get mobile category subcategories list (Mobile)
|
||||
https://fiesta.nearle.app/live/api/v1/mob/utils/getsubcategories?moduleid=1&categoryid=2
|
||||
# Fetch mobile app categories configurations (Mobile)
|
||||
https://fiesta.nearle.app/live/api/v1/mob/utils/getappcategories
|
||||
652
Post, put and delete Api's.txt
Normal file
652
Post, put and delete Api's.txt
Normal file
@@ -0,0 +1,652 @@
|
||||
1. User & Authentication APIs
|
||||
💻 Web Portal
|
||||
POST Tenant Web Panel Login
|
||||
URL: https://fiesta.nearle.app/live/api/v1/web/users/tenant/weblogin
|
||||
Payload:
|
||||
json
|
||||
|
||||
|
||||
{
|
||||
"authname": "merchant_admin_01",
|
||||
"password": "PasswordSecurityHash99!"
|
||||
}
|
||||
POST General Application Login
|
||||
URL: https://fiesta.nearle.app/live/api/v1/web/users/applogin
|
||||
Payload:
|
||||
json
|
||||
|
||||
|
||||
{
|
||||
"authname": "system_operator",
|
||||
"password": "OperatorSafePasswordSecret",
|
||||
"deviceid": "device_uuid_8828b",
|
||||
"devicetype": "android"
|
||||
}
|
||||
POST Register New Web Staff Account
|
||||
URL: https://fiesta.nearle.app/live/api/v1/web/users/create
|
||||
Payload:
|
||||
json
|
||||
|
||||
|
||||
{
|
||||
"authname": "tenant_staff_steve",
|
||||
"firstname": "Steve",
|
||||
"lastname": "Rogers",
|
||||
"password": "SteveSecurePassword12",
|
||||
"email": "steve.rogers@merchant.com",
|
||||
"dialcode": "+61",
|
||||
"contactno": "412345678",
|
||||
"roleid": 3,
|
||||
"pin": 1234,
|
||||
"address": "100 Flinders St",
|
||||
"suburb": "Melbourne",
|
||||
"city": "Melbourne",
|
||||
"state": "VIC",
|
||||
"postcode": "3000",
|
||||
"tenantid": 8,
|
||||
"locationid": 2,
|
||||
"applocationid": 1,
|
||||
"status": "active"
|
||||
}
|
||||
PUT Update Web Staff User Details
|
||||
URL: https://fiesta.nearle.app/live/api/v1/web/users/update
|
||||
Payload:
|
||||
json
|
||||
|
||||
|
||||
{
|
||||
"userid": 15,
|
||||
"firstname": "Steve",
|
||||
"lastname": "Captain",
|
||||
"email": "steve.captain@merchant.com",
|
||||
"contactno": "412345678",
|
||||
"address": "200 Flinders St",
|
||||
"suburb": "Melbourne",
|
||||
"city": "Melbourne",
|
||||
"state": "VIC",
|
||||
"postcode": "3000",
|
||||
"status": "active"
|
||||
}
|
||||
📱 Mobile App
|
||||
POST Rider/Merchant Mobile App Login
|
||||
URL: https://fiesta.nearle.app/live/api/v1/mob/users/tenant/login
|
||||
Payload:
|
||||
json
|
||||
|
||||
|
||||
{
|
||||
"authname": "rider_john_01",
|
||||
"password": "RiderSecretKey"
|
||||
}
|
||||
POST Create Mobile Staff User
|
||||
URL: https://fiesta.nearle.app/live/api/v1/mob/users/create
|
||||
Payload: (Uses the same schema as Web Register New Web Staff Account)
|
||||
PUT Update Mobile Staff Details
|
||||
URL: https://fiesta.nearle.app/live/api/v1/mob/users/update
|
||||
Payload: (Uses the same schema as Web Update Web Staff User Details)
|
||||
2. Customer Management APIs
|
||||
📱 Mobile App
|
||||
POST Passwordless OTP Login (via Phone)
|
||||
URL: https://fiesta.nearle.app/live/api/v1/mob/customers/login
|
||||
Payload:
|
||||
json
|
||||
|
||||
|
||||
{
|
||||
"contactno": "0499888777"
|
||||
}
|
||||
POST Register Customer Account
|
||||
URL: https://fiesta.nearle.app/live/api/v1/mob/customers/create
|
||||
Payload:
|
||||
json
|
||||
|
||||
|
||||
{
|
||||
"firstname": "Jane",
|
||||
"lastname": "Smith",
|
||||
"profileimage": "https://storage.nearle.app/avatars/jane_smith.jpg",
|
||||
"gender": "Female",
|
||||
"dob": "1994-11-20",
|
||||
"dialcode": "+61",
|
||||
"contactno": "499888777",
|
||||
"email": "jane.smith@gmail.com",
|
||||
"deviceid": "uuid_7728b991a",
|
||||
"devicetype": "ios",
|
||||
"authmode": 1,
|
||||
"customertoken": "fcm_token_device_hash_xyz",
|
||||
"address": "456 Oak Avenue",
|
||||
"suburb": "Richmond",
|
||||
"city": "Melbourne",
|
||||
"state": "VIC",
|
||||
"postcode": "3121",
|
||||
"latitude": "-37.8212",
|
||||
"longitude": "144.9984",
|
||||
"applocationid": 1,
|
||||
"status": 1,
|
||||
"intro": "Regular subscriber of organic morning deliveries."
|
||||
}
|
||||
POST Save New Geofenced Location Address
|
||||
URL: https://fiesta.nearle.app/live/api/v1/mob/customers/createlocations
|
||||
Payload:
|
||||
json
|
||||
|
||||
|
||||
{
|
||||
"customerid": 4082,
|
||||
"address": "123 High Street",
|
||||
"suburb": "Prahran",
|
||||
"city": "Melbourne",
|
||||
"state": "VIC",
|
||||
"postcode": "3181",
|
||||
"latitude": "-37.8502",
|
||||
"longitude": "144.9924",
|
||||
"primaryaddress": 1,
|
||||
"status": 1
|
||||
}
|
||||
POST Log Customer Support Ticket Request
|
||||
URL: https://fiesta.nearle.app/live/api/v1/mob/customers/createcustomerrequest
|
||||
Payload:
|
||||
json
|
||||
|
||||
|
||||
{
|
||||
"customerid": 4082,
|
||||
"tenantid": 8,
|
||||
"apptypeid": 1,
|
||||
"locationid": 2,
|
||||
"subject": "Delay in Morning Milk Delivery",
|
||||
"remarks": "Order scheduled for 7:00 AM hasn't arrived.",
|
||||
"status": 1
|
||||
}
|
||||
PUT Update Customer Profile Details
|
||||
URL: https://fiesta.nearle.app/live/api/v1/mob/customers/update
|
||||
Payload:
|
||||
json
|
||||
|
||||
|
||||
{
|
||||
"customerid": 4082,
|
||||
"firstname": "Jane",
|
||||
"lastname": "Miller",
|
||||
"email": "jane.miller@gmail.com",
|
||||
"contactno": "499888777",
|
||||
"address": "789 Pine Road",
|
||||
"suburb": "Hawthorn",
|
||||
"city": "Melbourne",
|
||||
"state": "VIC",
|
||||
"postcode": "3122",
|
||||
"status": 1
|
||||
}
|
||||
3. Catalog & Product Inventory APIs
|
||||
💻 Web Portal
|
||||
POST Add Multi-Product Stock Entry
|
||||
URL: https://fiesta.nearle.app/live/api/v1/web/products/createproductstock
|
||||
Payload:
|
||||
json
|
||||
|
||||
|
||||
[
|
||||
{
|
||||
"tenantid": 8,
|
||||
"locationid": 2,
|
||||
"productid": 105,
|
||||
"quantity": 150,
|
||||
"stocktype": "credit",
|
||||
"status": "active"
|
||||
},
|
||||
{
|
||||
"tenantid": 8,
|
||||
"locationid": 2,
|
||||
"productid": 109,
|
||||
"quantity": 80,
|
||||
"stocktype": "credit",
|
||||
"status": "active"
|
||||
}
|
||||
]
|
||||
POST Create Master Product Catalog Item
|
||||
URL: https://fiesta.nearle.app/live/api/v1/web/products/create
|
||||
Payload:
|
||||
json
|
||||
|
||||
|
||||
{
|
||||
"applocationid": 1,
|
||||
"tenantid": 8,
|
||||
"categoryid": 2,
|
||||
"subcategoryid": 12,
|
||||
"productname": "Fresh Cow Milk 1L",
|
||||
"productimage": "https://storage.nearle.app/products/cow_milk_1l.png",
|
||||
"productdesc": "Pure farm fresh cow milk pasteurized.",
|
||||
"productsku": "MILK-COW-1L",
|
||||
"productunit": "Litre",
|
||||
"unitvalue": "1",
|
||||
"productcost": 1.80,
|
||||
"retailprice": 3.50,
|
||||
"taxpercent": 5.00,
|
||||
"productstock": 100,
|
||||
"productstatus": "available",
|
||||
"approve": 1
|
||||
}
|
||||
POST Map Product to Specific Outlet Location
|
||||
URL: https://fiesta.nearle.app/live/api/v1/web/products/createproductlocation
|
||||
Payload:
|
||||
json
|
||||
|
||||
|
||||
[
|
||||
{
|
||||
"tenantid": 8,
|
||||
"locationid": 2,
|
||||
"productid": 105,
|
||||
"catlougeid": 1,
|
||||
"minquantity": 5,
|
||||
"maxquantity": 200,
|
||||
"price": 3.75,
|
||||
"status": "Active"
|
||||
}
|
||||
]
|
||||
POST Create Product Variant Metadata
|
||||
URL: https://fiesta.nearle.app/live/api/v1/web/products/createproductvariant
|
||||
Payload:
|
||||
json
|
||||
|
||||
|
||||
{
|
||||
"tenantid": 8,
|
||||
"variantname": "1.5 Liters Bottle",
|
||||
"categoryid": 2,
|
||||
"subcategoryid": 12,
|
||||
"status": "active"
|
||||
}
|
||||
PUT Update Master Product Details
|
||||
URL: https://fiesta.nearle.app/live/api/v1/web/products/update
|
||||
Payload:
|
||||
json
|
||||
|
||||
|
||||
{
|
||||
"productid": 105,
|
||||
"productname": "Organic Farm Cow Milk 1L",
|
||||
"productcost": 1.95,
|
||||
"retailprice": 3.75,
|
||||
"productstock": 120,
|
||||
"productstatus": "available"
|
||||
}
|
||||
PUT Update Product Outlet Constraints
|
||||
URL: https://fiesta.nearle.app/live/api/v1/web/products/updateproductlocation
|
||||
Payload:
|
||||
json
|
||||
|
||||
|
||||
{
|
||||
"productlocationid": 25,
|
||||
"tenantid": 8,
|
||||
"locationid": 2,
|
||||
"productid": 105,
|
||||
"minquantity": 10,
|
||||
"maxquantity": 150,
|
||||
"price": 3.99,
|
||||
"status": "Active"
|
||||
}
|
||||
DELETE Purge Master Product Catalog Entry
|
||||
URL: https://fiesta.nearle.app/live/api/v1/web/products/delete?productid=105
|
||||
Parameters:
|
||||
productid (int, required): Unique ID of the catalog item to be purged.
|
||||
📱 Mobile App
|
||||
PUT Mobile Update Product Details
|
||||
URL: https://fiesta.nearle.app/live/api/v1/mob/products/update
|
||||
Payload: (Uses the same schema as Web Update Master Product Details)
|
||||
PUT Mobile Update Product Outlet Config
|
||||
URL: https://fiesta.nearle.app/live/api/v1/mob/products/updateproductlocation
|
||||
Payload: (Uses the same schema as Web Update Product Outlet Constraints)
|
||||
4. Order Orchestration APIs
|
||||
💻 Web Portal
|
||||
POST Create New Web Order (Flat JSON Format)
|
||||
URL: https://fiesta.nearle.app/live/api/v1/web/orders/createorder
|
||||
Payload:
|
||||
json
|
||||
|
||||
|
||||
{
|
||||
"tenantid": 8,
|
||||
"locationid": 2,
|
||||
"applocationid": 1,
|
||||
"moduleid": 1,
|
||||
"customerid": 4082,
|
||||
"orderstatus": "pending",
|
||||
"deliverytype": "standard",
|
||||
"deliverytime": "2026-05-20 18:00:00",
|
||||
"pickupaddress": "Shop 4, Central Plaza, Melbourne",
|
||||
"pickuplat": "-37.8136",
|
||||
"pickuplong": "144.9631",
|
||||
"pickupcustomer": "Central Plaza Merchant",
|
||||
"pickupcontactno": "399887766",
|
||||
"deliveryaddress": "Apt 4B, Sunset Boulevard, Richmond",
|
||||
"deliverylat": "-37.8212",
|
||||
"deliverylong": "144.9984",
|
||||
"orderamount": 11.48,
|
||||
"taxamount": 1.10,
|
||||
"ordervalue": 12.58,
|
||||
"itemcount": 2,
|
||||
"paymenttype": 1,
|
||||
"paymentstatus": 0,
|
||||
"deliverycharge": 3.00,
|
||||
"ordernotes": "Please ring doorbell twice.",
|
||||
"items": [
|
||||
{
|
||||
"productid": 105,
|
||||
"productname": "Organic Whole Milk 1L",
|
||||
"orderqty": 2,
|
||||
"price": 3.99,
|
||||
"taxpercentage": 10.00,
|
||||
"taxamount": 0.80,
|
||||
"productsumprice": 7.98
|
||||
},
|
||||
{
|
||||
"productid": 109,
|
||||
"productname": "Salted Butter 250g",
|
||||
"orderqty": 1,
|
||||
"price": 3.50,
|
||||
"taxpercentage": 10.00,
|
||||
"taxamount": 0.35,
|
||||
"productsumprice": 3.50
|
||||
}
|
||||
]
|
||||
}
|
||||
PUT Update Order Status & Financial Flag
|
||||
URL: https://fiesta.nearle.app/live/api/v1/web/orders/updateorder
|
||||
Payload:
|
||||
json
|
||||
|
||||
|
||||
{
|
||||
"orderheaderid": 2099,
|
||||
"orderstatus": "ready",
|
||||
"paymentstatus": 1,
|
||||
"remarks": "Order packed and waiting for rider assignment."
|
||||
}
|
||||
📱 Mobile App
|
||||
POST Create Mobile Order (Wrapped JSON Format)
|
||||
URL: https://fiesta.nearle.app/live/api/v1/mob/orders/createorder
|
||||
Payload:
|
||||
json
|
||||
|
||||
|
||||
{
|
||||
"orders": {
|
||||
"tenantid": 8,
|
||||
"locationid": 2,
|
||||
"applocationid": 1,
|
||||
"moduleid": 1,
|
||||
"customerid": 4082,
|
||||
"orderstatus": "pending",
|
||||
"deliverytype": "standard",
|
||||
"deliverytime": "2026-05-20 18:00:00",
|
||||
"pickupaddress": "Shop 4, Central Plaza, Melbourne",
|
||||
"pickuplat": "-37.8136",
|
||||
"pickuplong": "144.9631",
|
||||
"pickupcustomer": "Central Plaza Merchant",
|
||||
"pickupcontactno": "399887766",
|
||||
"deliveryaddress": "Apt 4B, Sunset Boulevard, Richmond",
|
||||
"deliverylat": "-37.8212",
|
||||
"deliverylong": "144.9984",
|
||||
"orderamount": 11.48,
|
||||
"taxamount": 1.10,
|
||||
"ordervalue": 12.58,
|
||||
"itemcount": 2,
|
||||
"paymenttype": 1,
|
||||
"paymentstatus": 0,
|
||||
"deliverycharge": 3.00,
|
||||
"ordernotes": "Leave in parcel locker.",
|
||||
"items": [
|
||||
{
|
||||
"productid": 105,
|
||||
"productname": "Organic Whole Milk 1L",
|
||||
"orderqty": 2,
|
||||
"price": 3.99,
|
||||
"taxpercentage": 10.00,
|
||||
"taxamount": 0.80,
|
||||
"productsumprice": 7.98
|
||||
},
|
||||
{
|
||||
"productid": 109,
|
||||
"productname": "Salted Butter 250g",
|
||||
"orderqty": 1,
|
||||
"price": 3.50,
|
||||
"taxpercentage": 10.00,
|
||||
"taxamount": 0.35,
|
||||
"productsumprice": 3.50
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
PUT Mobile Update Order Status
|
||||
URL: https://fiesta.nearle.app/live/api/v1/mob/orders/updateorder
|
||||
Payload: (Uses the same schema as Web Update Order Status & Financial Flag)
|
||||
5. Delivery & Rider Logistics APIs
|
||||
💻 Web Portal
|
||||
POST Initialize Logistics Delivery Dispatch (Assign Rider)
|
||||
URL: https://fiesta.nearle.app/live/api/v1/web/deliveries/createdeliveries
|
||||
Payload:
|
||||
json
|
||||
|
||||
|
||||
[
|
||||
{
|
||||
"orderheaderid": 2100,
|
||||
"applocationid": 1,
|
||||
"partnerid": 1,
|
||||
"tenantid": 8,
|
||||
"moduleid": 1,
|
||||
"locationid": 2,
|
||||
"userid": 15,
|
||||
"orderid": "ORD-19028-4",
|
||||
"deliverydate": "2026-05-20",
|
||||
"orderstatus": "assigned",
|
||||
"assigntime": "2026-05-20 12:10:00",
|
||||
"itemcount": 2,
|
||||
"orderamount": 12.58,
|
||||
"customerid": 4082,
|
||||
"pickupcustomer": "Central Merchant Warehouse",
|
||||
"pickupcontactno": "987654321",
|
||||
"pickuplocationid": 2,
|
||||
"pickupaddress": "Shop 4, Central Plaza, Melbourne",
|
||||
"pickuplat": "-37.8136",
|
||||
"pickuplon": "144.9631",
|
||||
"deliverycustomerid": 4082,
|
||||
"deliverylocationid": 554,
|
||||
"deliverycustomer": "Jane Smith",
|
||||
"deliverycontactno": "499888777",
|
||||
"deliveryaddress": "456 Oak Avenue, Richmond, VIC, 3121",
|
||||
"droplat": "-37.8212",
|
||||
"droplon": "144.9984",
|
||||
"deliverycharges": 3.00,
|
||||
"deliveryamt": 15.58,
|
||||
"deliverytype": "standard",
|
||||
"paymenttype": 1
|
||||
}
|
||||
]
|
||||
PUT Update Rider Pickup Status
|
||||
URL: https://fiesta.nearle.app/live/api/v1/web/deliveries/updatedelivery
|
||||
Payload:
|
||||
json
|
||||
|
||||
|
||||
{
|
||||
"deliveryid": 8871,
|
||||
"orderheaderid": 2100,
|
||||
"userid": 15,
|
||||
"orderstatus": "picked",
|
||||
"pickuptime": "2026-05-20 12:20:00",
|
||||
"riderslat": "-37.8140",
|
||||
"riderslon": "144.9640"
|
||||
}
|
||||
📱 Mobile App
|
||||
POST Initialize Mobile Logistics Delivery
|
||||
URL: https://fiesta.nearle.app/live/api/v1/mob/deliveries/createdeliveries
|
||||
Payload: (Uses the same schema as Web Initialize Logistics Delivery Dispatch)
|
||||
PUT Rider Update Dispatch Status (Delivered & GPS Tracking)
|
||||
URL: https://fiesta.nearle.app/live/api/v1/mob/deliveries/updatedelivery
|
||||
Payload:
|
||||
json
|
||||
|
||||
|
||||
{
|
||||
"deliveryid": 8871,
|
||||
"orderheaderid": 2100,
|
||||
"userid": 15,
|
||||
"orderstatus": "delivered",
|
||||
"deliverytime": "2026-05-20 12:45:00",
|
||||
"riderslat": "-37.8210",
|
||||
"riderslon": "144.9980",
|
||||
"actualkms": "4.2",
|
||||
"feedback": "Handed over safely.",
|
||||
"smsdelivery": 1
|
||||
}
|
||||
6. Tenant & Location Configuration APIs
|
||||
💻 Web Portal
|
||||
POST Link Customer Profile to Tenant Store
|
||||
URL: https://fiesta.nearle.app/live/api/v1/web/tenants/createtenantcustomer
|
||||
Payload:
|
||||
json
|
||||
|
||||
|
||||
{
|
||||
"moduleid": 1,
|
||||
"tenantid": 8,
|
||||
"locationid": 2,
|
||||
"customerid": 4082,
|
||||
"customerlocationid": 554,
|
||||
"status": 1
|
||||
}
|
||||
POST Create New Geofenced Store Location
|
||||
URL: https://fiesta.nearle.app/live/api/v1/web/tenants/createlocation
|
||||
Payload:
|
||||
json
|
||||
|
||||
|
||||
{
|
||||
"tenantid": 8,
|
||||
"applocationid": 1,
|
||||
"moduleid": 1,
|
||||
"locationname": "Hawthorn Daily Fresh Store",
|
||||
"email": "hawthorn.store@merchant.com",
|
||||
"contactno": "399443322",
|
||||
"latitude": "-37.8222",
|
||||
"longitude": "145.0384",
|
||||
"address": "12 Glenferrie Rd",
|
||||
"suburb": "Hawthorn",
|
||||
"city": "Melbourne",
|
||||
"state": "VIC",
|
||||
"postcode": "3122",
|
||||
"opentime": "07:00:00",
|
||||
"closetime": "22:00:00",
|
||||
"partnerid": 1,
|
||||
"deliveryradius": 5000,
|
||||
"deliverymins": 30,
|
||||
"cancelsecs": 60,
|
||||
"status": "Active"
|
||||
}
|
||||
POST Map Tenant Location Linkage Entry
|
||||
URL: https://fiesta.nearle.app/live/api/v1/web/tenants/createtenantlocation
|
||||
Payload: (Uses the same schema as Create New Geofenced Store Location)
|
||||
PUT Update Store Location Configurations
|
||||
URL: https://fiesta.nearle.app/live/api/v1/web/tenants/updatelocation
|
||||
Payload:
|
||||
json
|
||||
|
||||
|
||||
{
|
||||
"locationid": 2,
|
||||
"tenantid": 8,
|
||||
"applocationid": 1,
|
||||
"locationname": "Richmond Daily Fresh Store",
|
||||
"email": "richmond.store@merchant.com",
|
||||
"contactno": "399887766",
|
||||
"latitude": "-37.8212",
|
||||
"longitude": "144.9984",
|
||||
"address": "Shop 4, 100 Church St",
|
||||
"suburb": "Richmond",
|
||||
"city": "Melbourne",
|
||||
"state": "VIC",
|
||||
"postcode": "3121",
|
||||
"opentime": "07:00:00",
|
||||
"closetime": "22:00:00",
|
||||
"deliveryradius": 8000,
|
||||
"deliverymins": 45,
|
||||
"cancelsecs": 120,
|
||||
"status": "Active"
|
||||
}
|
||||
PUT Modify Tenant Location Linkage Config
|
||||
URL: https://fiesta.nearle.app/live/api/v1/web/tenants/updatetenantlocation
|
||||
Payload: (Uses the same schema as Update Store Location Configurations)
|
||||
📱 Mobile App
|
||||
POST Mobile Link Customer Profile to Tenant Store
|
||||
URL: https://fiesta.nearle.app/live/api/v1/mob/tenants/createtenantcustomer
|
||||
Payload: (Uses the same schema as Web Link Customer Profile to Tenant Store)
|
||||
POST Mobile Create Geofenced Store Location
|
||||
URL: https://fiesta.nearle.app/live/api/v1/mob/tenants/createlocation
|
||||
Payload: (Uses the same schema as Web Create New Geofenced Store Location)
|
||||
POST Onboard/Create New Staff Member Account
|
||||
URL: https://fiesta.nearle.app/live/api/v1/mob/tenants/createstaff
|
||||
Payload: (Uses the same schema as Web Register New Web Staff Account)
|
||||
POST Onboard New Tenant & Admin Profile (Joint Creation)
|
||||
URL: https://fiesta.nearle.app/live/api/v1/mob/tenants/createtenantuser
|
||||
Payload:
|
||||
json
|
||||
|
||||
|
||||
{
|
||||
"tenantname": "Fresh Organic Greens",
|
||||
"configid": 1,
|
||||
"partnerid": 1,
|
||||
"moduleid": 1,
|
||||
"tenanttype": "Enterprise",
|
||||
"registrationno": "ABN-19028-299",
|
||||
"tenanttoken": "tenant_fcm_token_hash_value_xyz",
|
||||
"companyname": "Fresh Organic Greens Pty Ltd",
|
||||
"devicetype": "web",
|
||||
"firstname": "Arthur",
|
||||
"primaryemail": "arthur@organicgreens.com",
|
||||
"primarycontact": "488999000",
|
||||
"categoryid": 2,
|
||||
"subcategoryid": 12,
|
||||
"address": "400 Chapel St",
|
||||
"suburb": "South Yarra",
|
||||
"city": "Melbourne",
|
||||
"state": "VIC",
|
||||
"postcode": "3141",
|
||||
"latitude": "-37.8398",
|
||||
"longitude": "144.9953",
|
||||
"tenantimage": "https://storage.nearle.app/tenants/organic_greens.png",
|
||||
"tenantinfo": "Direct farm-to-table organic vegetables delivery provider.",
|
||||
"paymode1": 1,
|
||||
"paymode2": 1,
|
||||
"promotion": 0,
|
||||
"minorder": 15,
|
||||
"applocationid": 1,
|
||||
"approved": 1,
|
||||
"status": "Active",
|
||||
"tenantlocations": {
|
||||
"locationname": "South Yarra Main Warehouse",
|
||||
"email": "southyarra@organicgreens.com",
|
||||
"contactno": "488999000",
|
||||
"latitude": "-37.8398",
|
||||
"longitude": "144.9953",
|
||||
"address": "400 Chapel St",
|
||||
"suburb": "South Yarra",
|
||||
"city": "Melbourne",
|
||||
"state": "VIC",
|
||||
"postcode": "3141",
|
||||
"opentime": "06:00:00",
|
||||
"closetime": "21:00:00",
|
||||
"partnerid": 1,
|
||||
"deliveryradius": 6000,
|
||||
"deliverymins": 30,
|
||||
"cancelsecs": 90,
|
||||
"status": "Active"
|
||||
}
|
||||
}
|
||||
PUT Mobile Update Store Location Configurations
|
||||
URL: https://fiesta.nearle.app/live/api/v1/mob/tenants/updatelocation
|
||||
Payload: (Uses the same schema as Web Update Store Location Configurations)
|
||||
21
combine_topics.cjs
Normal file
21
combine_topics.cjs
Normal file
@@ -0,0 +1,21 @@
|
||||
const fs = require('fs');
|
||||
const path = require('path');
|
||||
const { existingTopics } = require('./original_topics.cjs');
|
||||
|
||||
// Read current topics.js which has the new REST endpoints.
|
||||
// We'll just import it using dynamic import since it's an ES module.
|
||||
(async () => {
|
||||
const topicsModule = await import('file:///' + path.join(__dirname, 'src/data/topics.js').replace(/\\/g, '/'));
|
||||
const restTopics = topicsModule.topics;
|
||||
|
||||
const out = `export const LEGACY_BASE_URL = 'https://api.workolik.com';
|
||||
export const REST_BASE_URL = 'https://fiesta.nearle.app';
|
||||
|
||||
export const legacyTopics = ${JSON.stringify(existingTopics, null, 2)};
|
||||
|
||||
export const restTopics = ${JSON.stringify(restTopics, null, 2)};
|
||||
`;
|
||||
|
||||
fs.writeFileSync(path.join(__dirname, 'src/data/topics.js'), out, 'utf8');
|
||||
console.log('Successfully combined legacy and rest topics into topics.js');
|
||||
})();
|
||||
@@ -5,7 +5,7 @@
|
||||
<meta charset="UTF-8" />
|
||||
<link rel="icon" type="image/png" href="/favicon.png" />
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
||||
<title>EXpress Developer Docs</title>
|
||||
<title>Nearle Express Developer Docs</title>
|
||||
</head>
|
||||
|
||||
<body>
|
||||
|
||||
347
original_topics.cjs
Normal file
347
original_topics.cjs
Normal file
@@ -0,0 +1,347 @@
|
||||
const existingTopics = [
|
||||
{
|
||||
id: 'utils',
|
||||
name: 'Utils',
|
||||
description: 'Shared lookup endpoints roles, locations, configs, app types, pricing.',
|
||||
endpoints: [
|
||||
{
|
||||
name: 'getuserroles',
|
||||
method: 'GET',
|
||||
url: '/api/rest/Xpress/utils/getuserroles',
|
||||
description: 'Retrieve all user roles available in the system.'
|
||||
},
|
||||
{
|
||||
name: 'getapptypes',
|
||||
method: 'GET',
|
||||
url: '/api/rest/xpress/utils/getapptypes?tag=DELIVERY',
|
||||
description: 'List application types filtered by a tag (e.g. DELIVERY).',
|
||||
_note: "Host typo in source ('workopi') corrected to api.workolik.com."
|
||||
},
|
||||
{
|
||||
name: 'getapplocations',
|
||||
method: 'GET',
|
||||
url: '/api/rest/xpress/utils/getapplocations?userid=1326',
|
||||
description: 'List all application locations.',
|
||||
_note: "Source name 'Gpplocation' assumed to be 'Getapplocations'."
|
||||
},
|
||||
{
|
||||
name: 'getapppricing',
|
||||
method: 'GET',
|
||||
url: '/api/rest/xpress/utils/getapppricing?applocationid=1',
|
||||
description: 'Retrieve app pricing for a given app location.',
|
||||
_note: "Source query 'getapppripplocationid=' reconstructed as 'getapppricing?applocationid='."
|
||||
},
|
||||
{
|
||||
name: 'getallpricing',
|
||||
method: 'GET',
|
||||
url: '/api/rest/xpress/utils/getallpricing?applocationid=1',
|
||||
description: 'Retrieve all pricing rules for an app location.'
|
||||
},
|
||||
{
|
||||
name: 'getapplocationconfig',
|
||||
method: 'GET',
|
||||
url: '/api/rest/xpress/utils/getapplocationconfig',
|
||||
description: 'Retrieve the configuration for application locations.',
|
||||
_note: "Host typo in source ('workom') corrected to api.workolik.com."
|
||||
},
|
||||
{
|
||||
name: 'getsubcategories',
|
||||
method: 'GET',
|
||||
url: '/api/rest/xpress/utils/getsubcategories/?moduleid=6',
|
||||
description: 'List all subcategories for a given module.'
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
id: 'users',
|
||||
name: 'Users',
|
||||
description: 'Manage users and roles across the Xpress platform.',
|
||||
endpoints: [
|
||||
{
|
||||
name: 'getallusers',
|
||||
method: 'GET',
|
||||
url: '/api/rest/xpress/users/getallusers?roleid=2&configid=1&tenantid=1079&status=Active&keyword=%john%&limit=10&offset=0',
|
||||
description: 'List users filtered by role, config, tenant, status, and keyword.'
|
||||
},
|
||||
{
|
||||
name: 'getusersinfo',
|
||||
method: 'GET',
|
||||
url: '/api/rest/xpress/users/getusers?userid=1326',
|
||||
description: 'Retrieve a single user by ID.'
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
id: 'partners',
|
||||
name: 'Partners',
|
||||
description: 'Partners, riders, locations, shifts, and rider pricing.',
|
||||
endpoints: [
|
||||
{
|
||||
name: 'getlocations (by user)',
|
||||
method: 'GET',
|
||||
url: '/api/rest/xpress/partners/getlocations?userid=1277&configid=9',
|
||||
description: 'Get partner locations linked to a specific user.'
|
||||
},
|
||||
{
|
||||
name: 'gettenantlocations ',
|
||||
method: 'GET',
|
||||
url: '/api/rest/xpress/tenants/gettenantlocations?keyword=daily&tenantid=916',
|
||||
description: 'Get partner locations linked to a specific tenant.'
|
||||
},
|
||||
{
|
||||
name: 'getpartners',
|
||||
method: 'GET',
|
||||
url: '/api/rest/xpress/partners/getpartners',
|
||||
description: 'List all partners.',
|
||||
_note: "Source URL had a double slash (/api/rest//partners/) — assumed /xpress/partners/."
|
||||
},
|
||||
{
|
||||
name: 'getriderpricing',
|
||||
method: 'GET',
|
||||
url: '/api/rest/xpress/partners/getriderpricing?applocationid=0',
|
||||
description: 'Get rider pricing rules for an app location.'
|
||||
},
|
||||
{
|
||||
name: 'getallriders',
|
||||
method: 'GET',
|
||||
url: '/api/rest/xpress/partners/getallriders?partnerid=44&limit=10',
|
||||
description: 'List all riders for a partner.'
|
||||
},
|
||||
{
|
||||
name: 'getallridersummary',
|
||||
method: 'GET',
|
||||
url: '/api/rest/xpress/partners/getallridersummary?applocationid=1',
|
||||
description: 'Aggregated summary of all riders at a location.'
|
||||
},
|
||||
{
|
||||
name: 'getriderdetail',
|
||||
method: 'GET',
|
||||
url: '/api/rest/xpress/partners/getriderdetail?userid=1',
|
||||
description: 'Detailed information for a specific rider.',
|
||||
_note: "Source had 'htapi.workolik.com' (missing 'tps://') — restored to https://api.workolik.com."
|
||||
},
|
||||
{
|
||||
name: 'getridershifts',
|
||||
method: 'GET',
|
||||
url: '/api/rest/xpress/partners/getridershifts?applocationid=1',
|
||||
description: 'Get rider shift records for an app location.',
|
||||
_note: "Host typo in source ('workk.com') corrected to api.workolik.com."
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
id: 'tenants',
|
||||
name: 'Tenants',
|
||||
description: 'Tenant accounts info, locations, customers, orders, pricing, summary.',
|
||||
endpoints: [
|
||||
{
|
||||
name: 'gettenants',
|
||||
method: 'GET',
|
||||
url: '/api/rest/xpress/tenants/gettenants?applocationid=1&status=active&partnerid=44',
|
||||
description: 'List tenants filtered by app location and status.',
|
||||
params: [
|
||||
{ name: 'applocationid', type: 'STRING', default: '1' },
|
||||
{ name: 'status', type: 'STRING', default: 'active' },
|
||||
{ name: 'partnerid', type: 'string', default: '44' }
|
||||
],
|
||||
_note: "Source name 'Gettenan' truncated — assumed 'Gettenants'."
|
||||
},
|
||||
{
|
||||
name: 'getalltenants',
|
||||
method: 'GET',
|
||||
url: '/api/rest/xpress/tenants/getalltenants?applocationid=1&moduleid=6&tenanttype=E&keyword=%25%25&status=Active&limit=10&offset=0',
|
||||
description: 'List all tenants with extensive filters.',
|
||||
params: [
|
||||
{ name: 'applocationid', type: 'STRING', default: '1' },
|
||||
{ name: 'moduleid', type: 'STRING', default: '6' },
|
||||
{ name: 'tenanttype', type: 'STRING', default: 'E' },
|
||||
{ name: 'keyword', type: 'STRING', default: '%%' },
|
||||
{ name: 'status', type: 'STRING', default: 'Active' },
|
||||
{ name: 'limit', type: 'STRING', default: '10' },
|
||||
{ name: 'offset', type: 'STRING', default: '0' }
|
||||
],
|
||||
_note: "Source query 'status=Actilimit=10' reconstructed as 'status=Active&limit=10'. 'approved=1' param dropped per spec."
|
||||
},
|
||||
{
|
||||
name: 'gettenantinfo',
|
||||
method: 'GET',
|
||||
url: '/api/rest/xpress/tenants/gettenantinfo?tenantid=1',
|
||||
description: 'Get basic information about a tenant.'
|
||||
},
|
||||
{
|
||||
name: 'gettenantlocations',
|
||||
method: 'GET',
|
||||
url: '/api/rest/xpress/tenants/gettenantlocations?tenantid=916&keyword=%%',
|
||||
description: 'List physical locations for a tenant.'
|
||||
},
|
||||
{
|
||||
name: 'gettenantsummary',
|
||||
method: 'GET',
|
||||
url: '/api/rest/xpress/tenants/gettenantsummary?moduleid=6&applocationid=1&tenanttype=E&keyword=%%',
|
||||
description: 'Aggregated summary for tenants under a module/location.',
|
||||
_note: "Source 'tenettenantsummary' reconstructed as 'tenants/gettenantsummary'."
|
||||
},
|
||||
{
|
||||
name: 'getpricinglist',
|
||||
method: 'GET',
|
||||
url: '/api/rest/xpress/tenants/getpricinglist?tenantid=1087',
|
||||
description: 'Retrieve the tenant’s pricing list.',
|
||||
_note: "Source 'getpricingl' truncated — assumed 'getpricinglist'."
|
||||
},
|
||||
{
|
||||
name: 'tenantsearch',
|
||||
method: 'GET',
|
||||
url: '/api/rest/xpress/tenants/search?keyword=daily&status=active',
|
||||
description: 'Full-text search for tenants by keyword.',
|
||||
_note: "Source name 'Tennatsearch' assumed to be 'Tenantsearch'."
|
||||
},
|
||||
{
|
||||
name: 'getorders',
|
||||
method: 'GET',
|
||||
url: '/api/rest/xpress/tenant/getorders?applocationid=&tenantid=&locationid=&status=',
|
||||
description: 'List orders scoped to a single tenant.',
|
||||
_note: "Source uses /tenant/ (singular) here. Confirm whether this should be /tenants/ or kept as /tenant/."
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
id: 'customers',
|
||||
name: 'Customers',
|
||||
description: 'Customer accounts, lookups, and search.',
|
||||
endpoints: [
|
||||
{
|
||||
name: 'getallcustomers',
|
||||
method: 'GET',
|
||||
url: '/api/rest/xpress/customers/getallcustomers?applocationid=&keyword=&pageno=&pagesize=',
|
||||
description: 'Paginated list of all customers under an app location.'
|
||||
},
|
||||
{
|
||||
name: 'gettenantcustomers',
|
||||
method: 'GET',
|
||||
url: '/api/rest/xpress/customers/gettenantcustomers?tenantid=1087&limit=10&offset=0',
|
||||
description: 'List customers under a specific tenant.',
|
||||
_note: "Source path 'xpresustomers' reconstructed as 'xpress/customers'."
|
||||
},
|
||||
{
|
||||
name: 'searchcustomers',
|
||||
method: 'GET',
|
||||
url: '/api/rest/xpress/customers/searchcustomers?tenantid=1087&keyword=%%',
|
||||
description: 'Search customers by keyword within a tenant.',
|
||||
_note: "Source name 'Searchcumer' assumed to be 'Searchcustomers'."
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
id: 'deliveries',
|
||||
name: 'Deliveries',
|
||||
description: 'Delivery records, queues, and rider-delivery joins.',
|
||||
endpoints: [
|
||||
{
|
||||
name: 'getdeliveries',
|
||||
method: 'GET',
|
||||
url: '/api/rest/xpress/deliveries/getdeliveries?tenantid=10&status=Delivered&fromdate=2026-05-01T00:00:00&todate=2026-05-05T23:59:59&keyword=%john%&limit=10&offset=0',
|
||||
description: 'List deliveries with filters: tenant, status, date range, keyword.',
|
||||
_note: "Source query 'tenantid=10=Delivered' reconstructed as 'tenantid=10&status=Delivered'."
|
||||
},
|
||||
{
|
||||
name: 'getdeliveryqueues',
|
||||
method: 'GET',
|
||||
url: '/api/rest/xpress/deliveries/getdeliveryqueues?userid=1277&fdate=2025-12-30T00:00:00 &tdate=2025-12-30T23:59:59',
|
||||
description: 'Retrieve delivery queue snapshots for a user/date range.',
|
||||
_note: "Source name 'tdeliveryqueues' truncated — assumed 'Getdeliveryqueues'."
|
||||
},
|
||||
{
|
||||
name: 'deliverysummary',
|
||||
method: 'GET',
|
||||
url: '/api/rest/xpress/deliveries/deliverysummary?appuserid=1&fromdate=2026-03-31T00:00:00&todate=2026-03-31T23:59:59&status=active&applocationid=1&locationid=1160&tenantid=916&userid=865',
|
||||
description: 'Aggregated delivery summary for an app user.'
|
||||
},
|
||||
{
|
||||
name: 'getriderbydelivery',
|
||||
method: 'GET',
|
||||
url: '/api/rest/xpress/deliveries/getriderbydelivery/?applocationid=&tenantid=&locationid=&fromdate=&todate=&keyword=',
|
||||
description: 'Map riders to deliveries within a location and date range.',
|
||||
_note: "Source URL was missing 'https' scheme — restored."
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
id: 'orders',
|
||||
name: 'Orders',
|
||||
description: 'Order records, details, and aggregate summaries.',
|
||||
endpoints: [
|
||||
{
|
||||
name: 'getorders',
|
||||
method: 'GET',
|
||||
url: '/api/rest/xpress/orders/tenant/getorders?start=2026-05-01T00:00:00&end=2026-05-31T23:59:59&status=delivered&limit=10&offset=0',
|
||||
description: 'List orders within a time frame and status.'
|
||||
},
|
||||
{
|
||||
name: 'getordersummary',
|
||||
method: 'GET',
|
||||
url: '/api/rest/getordersummary/?tenantid=1079&fromdate=2025-07-24&todate=2025-07-24&configid=9',
|
||||
description: 'High-level summary of orders for a tenant/date range.'
|
||||
},
|
||||
{
|
||||
name: 'getorderdetails',
|
||||
method: 'GET',
|
||||
url: '/api/rest/xpress/orders/getorderdetails?orderheaderid=6562',
|
||||
description: 'Get full details of an order by header ID.'
|
||||
},
|
||||
{
|
||||
name: 'getlocationsummary',
|
||||
method: 'GET',
|
||||
url: '/api/rest/xpress/orders/getlocationsummary?tenantid=916',
|
||||
description: 'Per-location summary of orders.'
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
id: 'products',
|
||||
name: 'Products',
|
||||
description: 'Product catalog, categories, and subcategories.',
|
||||
endpoints: [
|
||||
{
|
||||
name: 'getproductcategories',
|
||||
method: 'GET',
|
||||
url: '/api/rest/xpress/products/getproductcategories?moduleid=1',
|
||||
description: 'List root product categories for a module.'
|
||||
},
|
||||
{
|
||||
name: 'getproductsubcategories',
|
||||
method: 'GET',
|
||||
url: '/api/rest/xpress/products/getproductsubcategories?categoryid=1001',
|
||||
description: 'List subcategories under a product category.'
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
id: 'invoice',
|
||||
name: 'Invoice',
|
||||
description: 'Invoice insights and billing analytics.',
|
||||
endpoints: [
|
||||
{
|
||||
name: 'getinvoiceinsight',
|
||||
method: 'GET',
|
||||
url: '/api/rest/xpress/invoice/getinvoiceinsight?tenantid=916',
|
||||
description: 'Retrieve invoice insights and statistics for a tenant.',
|
||||
_note: "Source name 'Getinvoinsights' assumed to be 'Getinvoiceinsight'."
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
id: 'payments',
|
||||
name: 'Payments',
|
||||
description: 'Payment requests and settlements.',
|
||||
endpoints: [
|
||||
{
|
||||
name: 'getpaymentrequest',
|
||||
method: 'GET',
|
||||
url: '/api/rest/xpress/payments/requests/getpaymentrequest?partnerid=44&status=1',
|
||||
description: 'List payment requests for a partner by status.'
|
||||
}
|
||||
]
|
||||
}
|
||||
];
|
||||
|
||||
module.exports = { existingTopics };
|
||||
8
package-lock.json
generated
8
package-lock.json
generated
@@ -67,7 +67,6 @@
|
||||
"integrity": "sha512-CGOfOJqWjg2qW/Mb6zNsDm+u5vFQ8DxXfbM09z69p5Z6+mE1ikP2jUXw+j42Pf1XTYED2Rni5f95npYeuwMDQA==",
|
||||
"dev": true,
|
||||
"license": "MIT",
|
||||
"peer": true,
|
||||
"dependencies": {
|
||||
"@babel/code-frame": "^7.29.0",
|
||||
"@babel/generator": "^7.29.0",
|
||||
@@ -1478,7 +1477,6 @@
|
||||
}
|
||||
],
|
||||
"license": "MIT",
|
||||
"peer": true,
|
||||
"dependencies": {
|
||||
"baseline-browser-mapping": "^2.10.12",
|
||||
"caniuse-lite": "^1.0.30001782",
|
||||
@@ -2337,7 +2335,6 @@
|
||||
"integrity": "sha512-/imKNG4EbWNrVjoNC/1H5/9GFy+tqjGBHCaSsN+P2RnPqjsLmv6UD3Ej+Kj8nBWaRAwyk7kK5ZUc+OEatnTR3A==",
|
||||
"dev": true,
|
||||
"license": "MIT",
|
||||
"peer": true,
|
||||
"bin": {
|
||||
"jiti": "bin/jiti.js"
|
||||
}
|
||||
@@ -2694,7 +2691,6 @@
|
||||
}
|
||||
],
|
||||
"license": "MIT",
|
||||
"peer": true,
|
||||
"dependencies": {
|
||||
"nanoid": "^3.3.11",
|
||||
"picocolors": "^1.1.1",
|
||||
@@ -2916,7 +2912,6 @@
|
||||
"resolved": "https://registry.npmjs.org/react/-/react-19.2.6.tgz",
|
||||
"integrity": "sha512-sfWGGfavi0xr8Pg0sVsyHMAOziVYKgPLNrS7ig+ivMNb3wbCBw3KxtflsGBAwD3gYQlE/AEZsTLgToRrSCjb0Q==",
|
||||
"license": "MIT",
|
||||
"peer": true,
|
||||
"engines": {
|
||||
"node": ">=0.10.0"
|
||||
}
|
||||
@@ -3405,7 +3400,6 @@
|
||||
"integrity": "sha512-QP88BAKvMam/3NxH6vj2o21R6MjxZUAd6nlwAS/pnGvN9IVLocLHxGYIzFhg6fUQ+5th6P4dv4eW9jX3DSIj7A==",
|
||||
"dev": true,
|
||||
"license": "MIT",
|
||||
"peer": true,
|
||||
"engines": {
|
||||
"node": ">=12"
|
||||
},
|
||||
@@ -3531,7 +3525,6 @@
|
||||
"integrity": "sha512-2N/55r4JDJ4gdrCvGgINMy+HH3iRpNIz8K6SFwVsA+JbQScLiC+clmAxBgwiSPgcG9U15QmvqCGWzMbqda5zGQ==",
|
||||
"dev": true,
|
||||
"license": "MIT",
|
||||
"peer": true,
|
||||
"dependencies": {
|
||||
"esbuild": "^0.25.0",
|
||||
"fdir": "^6.4.4",
|
||||
@@ -3625,7 +3618,6 @@
|
||||
"integrity": "sha512-QP88BAKvMam/3NxH6vj2o21R6MjxZUAd6nlwAS/pnGvN9IVLocLHxGYIzFhg6fUQ+5th6P4dv4eW9jX3DSIj7A==",
|
||||
"dev": true,
|
||||
"license": "MIT",
|
||||
"peer": true,
|
||||
"engines": {
|
||||
"node": ">=12"
|
||||
},
|
||||
|
||||
182
parse_apis.cjs
Normal file
182
parse_apis.cjs
Normal file
@@ -0,0 +1,182 @@
|
||||
const fs = require('fs');
|
||||
const path = require('path');
|
||||
const { existingTopics } = require('./original_topics.cjs');
|
||||
|
||||
const getApisContent = fs.readFileSync(path.join(__dirname, "Get Api's.txt"), 'utf8');
|
||||
const postApisContent = fs.readFileSync(path.join(__dirname, "Post, put and delete Api's.txt"), 'utf8');
|
||||
|
||||
const endpoints = [];
|
||||
|
||||
// Parse GET APIs
|
||||
let currentGet = null;
|
||||
const getLines = getApisContent.split('\n');
|
||||
for (let line of getLines) {
|
||||
const trimmed = line.trim();
|
||||
if (trimmed.startsWith('# ')) {
|
||||
currentGet = { method: 'GET', description: trimmed.substring(2), name: trimmed.substring(2) };
|
||||
} else if (trimmed.startsWith('https://')) {
|
||||
if (currentGet) {
|
||||
currentGet.url = trimmed;
|
||||
endpoints.push(currentGet);
|
||||
currentGet = null;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Better Parse POST/PUT/DELETE APIs
|
||||
const postLines = postApisContent.split('\n');
|
||||
let i = 0;
|
||||
|
||||
while (i < postLines.length) {
|
||||
let line = postLines[i].trim();
|
||||
|
||||
if (line.startsWith('POST ') || line.startsWith('PUT ') || line.startsWith('DELETE ')) {
|
||||
const parts = line.split(' ');
|
||||
const method = parts[0];
|
||||
const name = parts.slice(1).join(' ');
|
||||
let url = '';
|
||||
let body = null;
|
||||
let description = name;
|
||||
|
||||
i++;
|
||||
while (i < postLines.length) {
|
||||
let l = postLines[i].trim();
|
||||
if (l.startsWith('POST ') || l.startsWith('PUT ') || l.startsWith('DELETE ') || l.startsWith('1. ') || l.startsWith('2. ') || l.startsWith('3. ') || l.startsWith('4. ') || l.startsWith('5. ') || l.startsWith('6. ') || l.startsWith('💻') || l.startsWith('📱')) {
|
||||
break; // Next block starts
|
||||
}
|
||||
|
||||
if (l.startsWith('URL: ')) {
|
||||
url = l.substring(5).trim();
|
||||
} else if (l.startsWith('Payload: (Uses the same schema')) {
|
||||
description += ' ' + l;
|
||||
} else if (l === 'json') {
|
||||
// start capturing json
|
||||
let jsonStr = '';
|
||||
i++;
|
||||
while (i < postLines.length) {
|
||||
let jl = postLines[i].trim();
|
||||
if (jl.startsWith('POST ') || jl.startsWith('PUT ') || jl.startsWith('DELETE ') || jl.startsWith('1. ') || jl.startsWith('2. ') || jl.startsWith('3. ') || jl.startsWith('4. ') || jl.startsWith('5. ') || jl.startsWith('6. ') || jl.startsWith('💻') || jl.startsWith('📱')) {
|
||||
break;
|
||||
}
|
||||
jsonStr += postLines[i] + '\n';
|
||||
i++;
|
||||
}
|
||||
let rawBody = jsonStr.trim();
|
||||
try {
|
||||
body = JSON.parse(rawBody);
|
||||
} catch (e) {
|
||||
body = rawBody; // fallback to string
|
||||
}
|
||||
continue;
|
||||
}
|
||||
i++;
|
||||
}
|
||||
|
||||
if (url) {
|
||||
const ep = { method, name, description, url };
|
||||
if (body) {
|
||||
ep.body = body;
|
||||
}
|
||||
endpoints.push(ep);
|
||||
}
|
||||
} else {
|
||||
i++;
|
||||
}
|
||||
}
|
||||
|
||||
// Second pass: Resolve "Uses the same schema as"
|
||||
endpoints.forEach(ep => {
|
||||
if (!ep.body && ep.description.includes('Uses the same schema as')) {
|
||||
const match = ep.description.match(/Uses the same schema as(.*?)\)/);
|
||||
if (match) {
|
||||
let refText = match[1].trim().toLowerCase();
|
||||
// Try to find the referenced endpoint
|
||||
let refEp = endpoints.find(e => {
|
||||
if (!e.body) return false;
|
||||
let eName = e.name.toLowerCase();
|
||||
// Remove 'web ' or 'mobile ' for looser matching
|
||||
refText = refText.replace('web ', '').replace('mobile ', '');
|
||||
eName = eName.replace('web ', '').replace('mobile ', '');
|
||||
return refText.includes(eName) || eName.includes(refText);
|
||||
});
|
||||
if (refEp) {
|
||||
ep.body = refEp.body;
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
// Map to topics
|
||||
const topicMapping = {
|
||||
'utils': ['utils', 'config', 'category'],
|
||||
'users': ['user'],
|
||||
'partners': ['partner', 'rider'],
|
||||
'tenants': ['tenant', 'location'],
|
||||
'customers': ['customer'],
|
||||
'deliveries': ['deliver'],
|
||||
'orders': ['order'],
|
||||
'products': ['product', 'catalog', 'stock'],
|
||||
'invoice': ['invoice'],
|
||||
'payments': ['payment']
|
||||
};
|
||||
|
||||
const mapToTopic = (url) => {
|
||||
const urlLower = url.toLowerCase();
|
||||
for (const [topicId, keywords] of Object.entries(topicMapping)) {
|
||||
if (urlLower.includes('/' + topicId + '/')) return topicId;
|
||||
for (const kw of keywords) {
|
||||
if (urlLower.includes('/' + kw)) return topicId;
|
||||
}
|
||||
}
|
||||
return 'utils';
|
||||
};
|
||||
|
||||
const restTopicsMap = {
|
||||
utils: { id: 'utils', name: 'Utils', description: 'Shared lookup endpoints roles, locations, configs, app types, pricing.', endpoints: [] },
|
||||
users: { id: 'users', name: 'Users', description: 'Manage users and roles across the Xpress platform.', endpoints: [] },
|
||||
partners: { id: 'partners', name: 'Partners', description: 'Partners, riders, locations, shifts, and rider pricing.', endpoints: [] },
|
||||
tenants: { id: 'tenants', name: 'Tenants', description: 'Tenant accounts info, locations, customers, orders, pricing, summary.', endpoints: [] },
|
||||
customers: { id: 'customers', name: 'Customers', description: 'Customer accounts, lookups, and search.', endpoints: [] },
|
||||
deliveries: { id: 'deliveries', name: 'Deliveries', description: 'Delivery records, queues, and rider-delivery joins.', endpoints: [] },
|
||||
orders: { id: 'orders', name: 'Orders', description: 'Order records, details, and aggregate summaries.', endpoints: [] },
|
||||
products: { id: 'products', name: 'Products', description: 'Product catalog, categories, and subcategories.', endpoints: [] },
|
||||
invoice: { id: 'invoice', name: 'Invoice', description: 'Invoice insights and billing analytics.', endpoints: [] },
|
||||
payments: { id: 'payments', name: 'Payments', description: 'Payment requests and settlements.', endpoints: [] }
|
||||
};
|
||||
|
||||
endpoints.forEach(ep => {
|
||||
let parsedUrl;
|
||||
try {
|
||||
parsedUrl = new URL(ep.url);
|
||||
} catch (e) {
|
||||
return;
|
||||
}
|
||||
const fullPath = parsedUrl.pathname + parsedUrl.search;
|
||||
const topicId = mapToTopic(fullPath);
|
||||
|
||||
if (restTopicsMap[topicId]) {
|
||||
const newEp = {
|
||||
name: ep.name,
|
||||
method: ep.method,
|
||||
url: fullPath,
|
||||
description: ep.description
|
||||
};
|
||||
if (ep.body) {
|
||||
newEp.body = ep.body;
|
||||
}
|
||||
restTopicsMap[topicId].endpoints.push(newEp);
|
||||
}
|
||||
});
|
||||
|
||||
const restTopics = Object.values(restTopicsMap);
|
||||
|
||||
const out = `export const LEGACY_BASE_URL = 'https://api.workolik.com';
|
||||
export const REST_BASE_URL = 'https://fiesta.nearle.app';
|
||||
|
||||
export const legacyTopics = ${JSON.stringify(existingTopics, null, 2)};
|
||||
|
||||
export const restTopics = ${JSON.stringify(restTopics, null, 2)};
|
||||
`;
|
||||
|
||||
fs.writeFileSync(path.join(__dirname, 'src', 'data', 'topics.js'), out, 'utf8');
|
||||
console.log('Successfully updated topics.js with ' + endpoints.length + ' parsed endpoints (fixed payload parsing).');
|
||||
24
server.js
24
server.js
@@ -19,7 +19,8 @@ import 'dotenv/config'
|
||||
const __dirname = path.dirname(fileURLToPath(import.meta.url))
|
||||
const PORT = Number(process.env.PORT) || 3000
|
||||
const SECRET = (process.env.HASURA_ADMIN_SECRET || '').trim()
|
||||
const TARGET = 'https://api.workolik.com'
|
||||
const TARGET_LEGACY = 'https://api.workolik.com'
|
||||
const TARGET_REST = 'https://fiesta.nearle.app'
|
||||
|
||||
if (!SECRET) {
|
||||
console.warn('[xpress-docs] WARNING: HASURA_ADMIN_SECRET is not set. Proxied API calls will be sent without auth.')
|
||||
@@ -27,13 +28,9 @@ if (!SECRET) {
|
||||
|
||||
const app = express()
|
||||
|
||||
app.use('/api', createProxyMiddleware({
|
||||
target: TARGET,
|
||||
const commonProxyOptions = {
|
||||
changeOrigin: true,
|
||||
secure: true,
|
||||
// The mount strips '/api' from req.url; add it back so the target URL
|
||||
// stays /api/rest/...
|
||||
pathRewrite: (p) => '/api' + p,
|
||||
on: {
|
||||
proxyReq: (proxyReq) => {
|
||||
if (SECRET) proxyReq.setHeader('x-hasura-admin-secret', SECRET)
|
||||
@@ -46,6 +43,18 @@ app.use('/api', createProxyMiddleware({
|
||||
res.end(JSON.stringify({ error: 'proxy_error', message: err.message }))
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
app.use('/api', createProxyMiddleware({
|
||||
...commonProxyOptions,
|
||||
target: TARGET_LEGACY,
|
||||
pathRewrite: (p) => '/api' + p
|
||||
}))
|
||||
|
||||
app.use('/live', createProxyMiddleware({
|
||||
...commonProxyOptions,
|
||||
target: TARGET_REST,
|
||||
pathRewrite: (p) => '/live' + p
|
||||
}))
|
||||
|
||||
// Built React app
|
||||
@@ -57,6 +66,7 @@ app.get('*', (_req, res) => {
|
||||
|
||||
app.listen(PORT, () => {
|
||||
console.log(`[xpress-docs] listening on http://localhost:${PORT}`)
|
||||
console.log(`[xpress-docs] proxying /api/* -> ${TARGET}/api/*`)
|
||||
console.log(`[xpress-docs] proxying /api/* -> ${TARGET_LEGACY}/api/*`)
|
||||
console.log(`[xpress-docs] proxying /live/* -> ${TARGET_REST}/live/*`)
|
||||
console.log(`[xpress-docs] admin secret: ${SECRET ? 'loaded' : 'NOT SET'}`)
|
||||
})
|
||||
|
||||
66
src/App.jsx
66
src/App.jsx
@@ -2,39 +2,67 @@ import { useMemo, useState } from 'react'
|
||||
import Sidebar from './components/Sidebar'
|
||||
import Introduction from './components/Introduction'
|
||||
import TopicView from './components/TopicView'
|
||||
import { topics } from './data/topics'
|
||||
import { legacyTopics, restTopics, LEGACY_BASE_URL, REST_BASE_URL } from './data/topics'
|
||||
|
||||
const processTopics = (topics, baseUrl, type) =>
|
||||
topics.map(t => ({ ...t, baseUrl, type, uniqueId: `${type}-${t.id}` }))
|
||||
|
||||
const allLegacy = processTopics(legacyTopics, LEGACY_BASE_URL, 'legacy')
|
||||
const allRest = processTopics(restTopics, REST_BASE_URL, 'rest')
|
||||
|
||||
function filterTopics(topics, q) {
|
||||
if (!q) return topics
|
||||
return topics.filter((t) =>
|
||||
t.name.toLowerCase().includes(q) ||
|
||||
(t.description || '').toLowerCase().includes(q) ||
|
||||
t.endpoints.some((e) =>
|
||||
e.name.toLowerCase().includes(q) ||
|
||||
e.url.toLowerCase().includes(q) ||
|
||||
(e.description || '').toLowerCase().includes(q)
|
||||
)
|
||||
)
|
||||
}
|
||||
|
||||
export default function App() {
|
||||
const [activeTopic, setActiveTopic] = useState(null)
|
||||
const [searchQuery, setSearchQuery] = useState('')
|
||||
|
||||
const visibleTopics = useMemo(() => {
|
||||
const q = searchQuery.trim().toLowerCase()
|
||||
if (!q) return topics
|
||||
return topics.filter((t) =>
|
||||
t.name.toLowerCase().includes(q) ||
|
||||
(t.description || '').toLowerCase().includes(q) ||
|
||||
t.endpoints.some((e) =>
|
||||
e.name.toLowerCase().includes(q) ||
|
||||
e.url.toLowerCase().includes(q) ||
|
||||
(e.description || '').toLowerCase().includes(q)
|
||||
)
|
||||
)
|
||||
}, [searchQuery])
|
||||
const visibleLegacy = useMemo(() => filterTopics(allLegacy, searchQuery.trim().toLowerCase()), [searchQuery])
|
||||
const visibleRest = useMemo(() => filterTopics(allRest, searchQuery.trim().toLowerCase()), [searchQuery])
|
||||
|
||||
return (
|
||||
<div className="min-h-screen">
|
||||
<div className="min-h-screen bg-slate-50 bg-grid-pattern flex relative overflow-hidden">
|
||||
|
||||
{/* Ambient background glows */}
|
||||
<div className="absolute top-0 -left-4 w-72 h-72 bg-brand-300 rounded-full mix-blend-multiply filter blur-3xl opacity-20 animate-blob"></div>
|
||||
<div className="absolute top-0 -right-4 w-72 h-72 bg-indigo-300 rounded-full mix-blend-multiply filter blur-3xl opacity-20 animate-blob animation-delay-2000"></div>
|
||||
<div className="absolute -bottom-8 left-20 w-72 h-72 bg-pink-300 rounded-full mix-blend-multiply filter blur-3xl opacity-20 animate-blob animation-delay-4000"></div>
|
||||
|
||||
<Sidebar
|
||||
topics={visibleTopics}
|
||||
legacyTopics={visibleLegacy}
|
||||
restTopics={visibleRest}
|
||||
activeTopic={activeTopic}
|
||||
setActiveTopic={setActiveTopic}
|
||||
searchQuery={searchQuery}
|
||||
setSearchQuery={setSearchQuery}
|
||||
/>
|
||||
<main className="ml-[280px] p-10 pr-20">
|
||||
|
||||
<main className="ml-[280px] flex-1 min-h-screen relative z-10">
|
||||
{activeTopic
|
||||
? <TopicView topic={activeTopic} searchQuery={searchQuery} />
|
||||
: <Introduction />}
|
||||
? (
|
||||
<div className="max-w-[1200px] mx-auto p-12 lg:p-16 opacity-0 animate-fade-in-up">
|
||||
<TopicView topic={activeTopic} searchQuery={searchQuery} />
|
||||
</div>
|
||||
)
|
||||
: (
|
||||
<div className="opacity-0 animate-fade-in-up">
|
||||
<Introduction
|
||||
allLegacy={allLegacy}
|
||||
allRest={allRest}
|
||||
setActiveTopic={setActiveTopic}
|
||||
/>
|
||||
</div>
|
||||
)}
|
||||
</main>
|
||||
</div>
|
||||
)
|
||||
|
||||
@@ -1,8 +1,7 @@
|
||||
import { useMemo, useState } from 'react'
|
||||
import {
|
||||
Play, Copy, Check, CheckCircle2, XCircle, Loader2
|
||||
Play, Copy, Check, CheckCircle2, AlertCircle, Server, FileJson, Loader2
|
||||
} from 'lucide-react'
|
||||
import { BASE_URL } from '../data/topics'
|
||||
import { highlightJSON } from '../lib/highlight'
|
||||
|
||||
function safeDecode(v) {
|
||||
@@ -21,32 +20,25 @@ function parseUrl(url) {
|
||||
return { path, params }
|
||||
}
|
||||
|
||||
export default function EndpointCard({
|
||||
endpoint,
|
||||
onSend,
|
||||
result,
|
||||
loading
|
||||
}) {
|
||||
export default function EndpointCard({ endpoint, baseUrl, onSend, result, loading }) {
|
||||
const { path, params: parsedParams } = useMemo(() => parseUrl(endpoint.url), [endpoint.url])
|
||||
const paramDefs = endpoint.params || parsedParams
|
||||
|
||||
const [values, setValues] = useState(() =>
|
||||
Object.fromEntries(paramDefs.map((p) => [p.name, p.default ?? '']))
|
||||
)
|
||||
const [copied, setCopied] = useState(false)
|
||||
const [copied, setCopied] = useState(false)
|
||||
const [urlCopied, setUrlCopied] = useState(false)
|
||||
|
||||
const composedUrl = useMemo(() => {
|
||||
if (paramDefs.length === 0) return BASE_URL + path
|
||||
if (paramDefs.length === 0) return baseUrl + path
|
||||
const qs = paramDefs
|
||||
.map((p) => `${p.name}=${encodeURIComponent(values[p.name] ?? '')}`)
|
||||
.join('&')
|
||||
return `${BASE_URL}${path}?${qs}`
|
||||
}, [path, paramDefs, values])
|
||||
return `${baseUrl}${path}?${qs}`
|
||||
}, [path, paramDefs, values, baseUrl])
|
||||
|
||||
const handleSend = () => {
|
||||
onSend(endpoint, composedUrl)
|
||||
}
|
||||
const handleSend = () => onSend(endpoint, composedUrl)
|
||||
|
||||
const copyResponse = async () => {
|
||||
if (!result || result.kind !== 'response') return
|
||||
@@ -66,160 +58,205 @@ export default function EndpointCard({
|
||||
} catch {}
|
||||
}
|
||||
|
||||
return (
|
||||
<div className="rounded-2xl border border-slate-200 bg-white shadow-sm">
|
||||
{/* Header */}
|
||||
<div className="p-5 border-b border-slate-100">
|
||||
<div className="flex items-center gap-3 flex-wrap">
|
||||
<span className="mono text-xs font-bold px-2.5 py-1 rounded-md bg-emerald-100 text-emerald-700 border border-emerald-200">
|
||||
{endpoint.method}
|
||||
</span>
|
||||
<h3 className="mono text-slate-900 font-semibold text-lg">{endpoint.name}</h3>
|
||||
</div>
|
||||
{endpoint.description && (
|
||||
<p className="text-slate-600 text-sm mt-2">{endpoint.description}</p>
|
||||
)}
|
||||
</div>
|
||||
const methodColor = {
|
||||
GET: 'bg-emerald-100/50 text-emerald-700 border-emerald-200',
|
||||
POST: 'bg-blue-100/50 text-blue-700 border-blue-200',
|
||||
PUT: 'bg-amber-100/50 text-amber-700 border-amber-200',
|
||||
DELETE: 'bg-red-100/50 text-red-700 border-red-200',
|
||||
PATCH: 'bg-purple-100/50 text-purple-700 border-purple-200',
|
||||
}[endpoint.method] || 'bg-slate-100/50 text-slate-700 border-slate-200'
|
||||
|
||||
{/* Live URL bar */}
|
||||
<div className="px-5 pt-5">
|
||||
<div className="flex items-center justify-between mb-2">
|
||||
<div className="text-xs uppercase tracking-wide text-slate-400 font-semibold">Request URL</div>
|
||||
<button
|
||||
onClick={copyUrl}
|
||||
className="flex items-center gap-1.5 text-xs text-slate-500 hover:text-brand-600 transition-colors"
|
||||
>
|
||||
{urlCopied ? <Check size={14} /> : <Copy size={14} />}
|
||||
{urlCopied ? 'Copied' : 'Copy'}
|
||||
</button>
|
||||
</div>
|
||||
<div className="mono text-xs bg-slate-50 border border-slate-200 rounded-lg p-3 break-all leading-relaxed">
|
||||
<span className="text-emerald-700 font-semibold">{endpoint.method}</span>{' '}
|
||||
<span className="text-slate-500">{BASE_URL}</span>
|
||||
<span className="text-slate-900">{path}</span>
|
||||
const isOk = result?.kind === 'response' && result.ok
|
||||
const isErr = result?.kind === 'response' && !result.ok
|
||||
const isNet = result?.kind === 'network-error'
|
||||
|
||||
return (
|
||||
<div className="py-16 border-t border-slate-200/60 group/row" id={endpoint.name}>
|
||||
<div className="grid grid-cols-1 xl:grid-cols-12 gap-12 lg:gap-16">
|
||||
|
||||
{/* Left Column: Description & Parameters */}
|
||||
<div className="xl:col-span-5 space-y-8">
|
||||
<div>
|
||||
<div className="flex items-center gap-4 mb-4">
|
||||
<span className={`px-2.5 py-1 rounded text-xs font-bold tracking-widest border ${methodColor}`}>
|
||||
{endpoint.method}
|
||||
</span>
|
||||
<h3 className="text-2xl font-bold text-slate-900 tracking-tight">
|
||||
{endpoint.name}
|
||||
</h3>
|
||||
</div>
|
||||
{endpoint.description && (
|
||||
<p className="text-[15px] text-slate-600 leading-relaxed">{endpoint.description}</p>
|
||||
)}
|
||||
</div>
|
||||
|
||||
{/* URL bar */}
|
||||
<div className="bg-white border border-slate-200/80 rounded-xl p-3.5 font-mono text-sm text-slate-600 break-all shadow-sm flex items-center gap-2 group-hover/row:border-brand-300 transition-colors">
|
||||
<Server size={14} className="text-brand-400 shrink-0" />
|
||||
<span className="opacity-60 hidden sm:inline">{baseUrl}</span>
|
||||
<span className="font-semibold text-slate-800">{path}</span>
|
||||
</div>
|
||||
|
||||
{/* Query Parameters */}
|
||||
{paramDefs.length > 0 && (
|
||||
<>
|
||||
<span className="text-slate-400">?</span>
|
||||
{paramDefs.map((p, i) => (
|
||||
<span key={p.name}>
|
||||
<span className="text-sky-700">{p.name}</span>
|
||||
<span className="text-slate-400">=</span>
|
||||
<span className="text-slate-700">{encodeURIComponent(values[p.name] ?? '')}</span>
|
||||
{i < paramDefs.length - 1 && <span className="text-slate-400">&</span>}
|
||||
</span>
|
||||
))}
|
||||
</>
|
||||
)}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{/* Query Parameters */}
|
||||
{paramDefs.length > 0 && (
|
||||
<div className="px-5 pt-5">
|
||||
<div className="text-xs uppercase tracking-wide text-slate-400 font-semibold mb-3">
|
||||
Query Parameters
|
||||
</div>
|
||||
<div className="space-y-3">
|
||||
{paramDefs.map((p) => (
|
||||
<div key={p.name} className="grid grid-cols-1 sm:grid-cols-[180px_1fr] gap-3 items-center">
|
||||
<div className="flex items-center gap-2 flex-wrap">
|
||||
<label className="mono text-sm font-medium text-slate-700">{p.name}</label>
|
||||
<span className="text-[10px] font-bold tracking-wider uppercase px-1.5 py-0.5 rounded bg-slate-100 text-slate-500 border border-slate-200">
|
||||
{p.type || 'STRING'}
|
||||
</span>
|
||||
</div>
|
||||
<input
|
||||
type="text"
|
||||
value={values[p.name] ?? ''}
|
||||
onChange={(e) => setValues((v) => ({ ...v, [p.name]: e.target.value }))}
|
||||
className="mono text-sm px-3 py-1.5 w-full bg-white border border-slate-200 rounded-lg focus:outline-none focus:ring-2 focus:ring-brand-500/20 focus:border-brand-500 transition-all"
|
||||
placeholder={p.default || ''}
|
||||
/>
|
||||
<div className="pt-2">
|
||||
<h4 className="text-xs font-bold text-slate-400 mb-4 uppercase tracking-widest flex items-center gap-2">
|
||||
<span className="w-4 h-[1px] bg-slate-300"></span> Query Parameters
|
||||
</h4>
|
||||
<div className="space-y-4">
|
||||
{paramDefs.map((p) => (
|
||||
<div key={p.name} className="flex flex-col gap-2">
|
||||
<label className="text-sm font-semibold text-slate-800 flex justify-between items-center">
|
||||
{p.name}
|
||||
<span className="text-[10px] text-slate-400 uppercase tracking-wider font-mono">{p.type || 'string'}</span>
|
||||
</label>
|
||||
<input
|
||||
className="w-full px-3.5 py-2.5 bg-white border border-slate-200 rounded-lg text-sm focus:outline-none focus:ring-2 focus:ring-brand-500/20 focus:border-brand-500 transition-all shadow-sm text-slate-700"
|
||||
value={values[p.name] ?? ''}
|
||||
placeholder={`Enter ${p.name}...`}
|
||||
onChange={(e) =>
|
||||
setValues((v) => ({ ...v, [p.name]: e.target.value }))
|
||||
}
|
||||
/>
|
||||
</div>
|
||||
))}
|
||||
</div>
|
||||
))}
|
||||
</div>
|
||||
</div>
|
||||
)}
|
||||
|
||||
{/* Send button */}
|
||||
<div className="px-5 py-5">
|
||||
<button
|
||||
onClick={handleSend}
|
||||
disabled={loading}
|
||||
className="inline-flex items-center gap-2 px-4 py-2 rounded-lg bg-emerald-600 text-white text-sm font-semibold hover:bg-emerald-700 active:bg-emerald-800 disabled:opacity-60 disabled:cursor-not-allowed transition-colors shadow-sm"
|
||||
>
|
||||
{loading
|
||||
? <Loader2 size={14} className="animate-spin" />
|
||||
: <Play size={14} className="fill-white" />}
|
||||
{loading ? 'Sending...' : 'Send Request'}
|
||||
</button>
|
||||
</div>
|
||||
|
||||
{/* Response panel — only visible on the active endpoint */}
|
||||
{result && <ResponsePanel result={result} onCopy={copyResponse} copied={copied} />}
|
||||
</div>
|
||||
)
|
||||
}
|
||||
|
||||
function ResponsePanel({ result, onCopy, copied }) {
|
||||
const isOk = result.kind === 'response' && result.ok
|
||||
const isError = result.kind === 'response' && !result.ok
|
||||
const isNet = result.kind === 'network-error'
|
||||
const status = result.status
|
||||
const headerBg = '#161922'
|
||||
const bodyBg = '#0f1117'
|
||||
|
||||
const StatusBadge = () => {
|
||||
if (isOk) return (
|
||||
<span className="inline-flex items-center gap-1.5 mono text-xs font-bold px-2 py-0.5 rounded bg-emerald-500/15 text-emerald-400 border border-emerald-500/30">
|
||||
<CheckCircle2 size={12} /> {status}
|
||||
</span>
|
||||
)
|
||||
if (isError) return (
|
||||
<span className="inline-flex items-center gap-1.5 mono text-xs font-bold px-2 py-0.5 rounded bg-rose-500/15 text-rose-400 border border-rose-500/30">
|
||||
<XCircle size={12} /> {status}
|
||||
</span>
|
||||
)
|
||||
if (isNet) return (
|
||||
<span className="inline-flex items-center gap-1.5 mono text-xs font-bold px-2 py-0.5 rounded bg-rose-500/15 text-rose-400 border border-rose-500/30">
|
||||
<XCircle size={12} /> NETWORK
|
||||
</span>
|
||||
)
|
||||
return null
|
||||
}
|
||||
|
||||
const body = isNet
|
||||
? { error: 'Network error', message: result.message }
|
||||
: result.body
|
||||
|
||||
const isString = typeof body === 'string'
|
||||
|
||||
return (
|
||||
<div className="mx-5 mb-5 rounded-xl overflow-hidden border border-slate-800" style={{ backgroundColor: bodyBg }}>
|
||||
<div className="flex items-center justify-between px-4 py-2.5 border-b border-slate-800" style={{ backgroundColor: headerBg }}>
|
||||
<div className="flex items-center gap-3">
|
||||
<StatusBadge />
|
||||
<span className="text-xs text-slate-400">Response</span>
|
||||
{result.ms != null && (
|
||||
<span className="text-xs text-slate-500">{result.ms} ms</span>
|
||||
</div>
|
||||
)}
|
||||
</div>
|
||||
<button
|
||||
onClick={onCopy}
|
||||
className="flex items-center gap-1.5 text-xs text-slate-400 hover:text-white transition-colors"
|
||||
>
|
||||
{copied ? <Check size={14} /> : <Copy size={14} />}
|
||||
{copied ? 'Copied' : 'Copy'}
|
||||
</button>
|
||||
|
||||
{/* Right Column: Execution & Response */}
|
||||
<div className="xl:col-span-7">
|
||||
<div className="dark-glass rounded-2xl overflow-hidden shadow-code flex flex-col h-full min-h-[450px] transform transition-transform duration-500 group-hover/row:-translate-y-1">
|
||||
|
||||
{/* macOS window dots */}
|
||||
<div className="h-10 bg-white/5 border-b border-white/5 flex items-center px-4 gap-2 shrink-0">
|
||||
<div className="w-3 h-3 rounded-full bg-red-500/80"></div>
|
||||
<div className="w-3 h-3 rounded-full bg-amber-500/80"></div>
|
||||
<div className="w-3 h-3 rounded-full bg-emerald-500/80"></div>
|
||||
<div className="ml-4 text-xs font-mono text-slate-500">Request Payload</div>
|
||||
</div>
|
||||
|
||||
{/* Payload body or composed URL preview */}
|
||||
{endpoint.body ? (
|
||||
<div className="flex-1 p-5 flex flex-col">
|
||||
<div className="text-[11px] font-bold text-slate-400 mb-3 uppercase tracking-wider flex items-center gap-2">
|
||||
<FileJson size={14} className="text-brand-400" /> Request Body (JSON)
|
||||
</div>
|
||||
<pre className="flex-1 text-slate-300 font-mono text-[13px] whitespace-pre-wrap leading-relaxed overflow-auto scrollbar-hide">
|
||||
<code dangerouslySetInnerHTML={{ __html: highlightJSON(endpoint.body) }} />
|
||||
</pre>
|
||||
</div>
|
||||
) : (
|
||||
<div className="flex-1 p-8 flex flex-col justify-center">
|
||||
<div className="text-[11px] font-bold text-slate-400 mb-4 uppercase tracking-wider flex items-center gap-2">
|
||||
<Server size={14} className="text-brand-400" /> Full Request URL
|
||||
</div>
|
||||
<div className="font-mono text-[13px] leading-loose break-all">
|
||||
<span className={`font-bold mr-2 ${
|
||||
endpoint.method === 'GET' ? 'text-emerald-400' :
|
||||
endpoint.method === 'POST' ? 'text-blue-400' :
|
||||
endpoint.method === 'PUT' ? 'text-amber-400' :
|
||||
endpoint.method === 'DELETE' ? 'text-red-400' : 'text-purple-400'
|
||||
}`}>{endpoint.method}</span>
|
||||
<span className="text-slate-500">{baseUrl}</span>
|
||||
<span className="text-slate-200">{path}</span>
|
||||
{paramDefs.length > 0 && (
|
||||
<>
|
||||
<span className="text-pink-400">?</span>
|
||||
{paramDefs.map((p, i) => (
|
||||
<span key={p.name}>
|
||||
<span className="text-brand-300">{p.name}</span>
|
||||
<span className="text-slate-500">=</span>
|
||||
<span className="text-slate-300">{encodeURIComponent(values[p.name] ?? '')}</span>
|
||||
{i < paramDefs.length - 1 && <span className="text-slate-600">&</span>}
|
||||
</span>
|
||||
))}
|
||||
</>
|
||||
)}
|
||||
</div>
|
||||
</div>
|
||||
)}
|
||||
|
||||
{/* Execution Bar */}
|
||||
<div className="bg-black/40 p-4 flex justify-between items-center border-t border-white/5 backdrop-blur-md">
|
||||
<div className="flex items-center gap-3">
|
||||
<span className="text-[12px] text-brand-400 font-mono px-3 py-1 bg-brand-500/10 rounded-full border border-brand-500/20">
|
||||
Ready
|
||||
</span>
|
||||
<button
|
||||
onClick={copyUrl}
|
||||
className="flex items-center gap-1.5 text-[11px] font-bold uppercase tracking-widest text-slate-400 hover:text-brand-400 transition-colors"
|
||||
>
|
||||
{urlCopied ? <Check size={12} /> : <Copy size={12} />}
|
||||
{urlCopied ? 'Copied' : 'Copy URL'}
|
||||
</button>
|
||||
</div>
|
||||
<button
|
||||
onClick={handleSend}
|
||||
disabled={loading}
|
||||
className="bg-brand-600 hover:bg-brand-500 text-white px-5 py-2 rounded-lg text-sm font-semibold transition-all flex items-center gap-2 disabled:opacity-50 shadow-[0_0_15px_rgba(2,132,199,0.4)] hover:shadow-[0_0_25px_rgba(2,132,199,0.6)] hover:-translate-y-0.5 active:translate-y-0"
|
||||
>
|
||||
{loading
|
||||
? <Loader2 size={14} className="animate-spin" />
|
||||
: <Play size={14} className="fill-current" />}
|
||||
{loading ? 'Executing...' : 'Send Request'}
|
||||
</button>
|
||||
</div>
|
||||
|
||||
{/* Response */}
|
||||
{result && (
|
||||
<div className="border-t border-white/10 p-5 max-h-[350px] overflow-y-auto bg-black/60 relative">
|
||||
<div className="sticky top-0 pb-3 mb-3 bg-black/60 backdrop-blur-md border-b border-white/5 flex items-center justify-between">
|
||||
<span className="text-[11px] font-bold text-slate-400 uppercase tracking-wider">Response JSON</span>
|
||||
<div className="flex items-center gap-3">
|
||||
{result.ms != null && (
|
||||
<span className="text-[11px] font-mono text-slate-500">{result.ms} ms</span>
|
||||
)}
|
||||
{isOk && (
|
||||
<span className="text-[11px] px-2.5 py-1 rounded-md font-bold font-mono flex items-center gap-1.5 bg-emerald-500/20 text-emerald-400 border border-emerald-500/30">
|
||||
<CheckCircle2 size={12} /> {result.status}
|
||||
</span>
|
||||
)}
|
||||
{isErr && (
|
||||
<span className="text-[11px] px-2.5 py-1 rounded-md font-bold font-mono flex items-center gap-1.5 bg-red-500/20 text-red-400 border border-red-500/30">
|
||||
<AlertCircle size={12} /> {result.status}
|
||||
</span>
|
||||
)}
|
||||
{isNet && (
|
||||
<span className="text-[11px] px-2.5 py-1 rounded-md font-bold font-mono flex items-center gap-1.5 bg-amber-500/20 text-amber-400 border border-amber-500/30">
|
||||
<AlertCircle size={12} /> NETWORK ERR
|
||||
</span>
|
||||
)}
|
||||
{result.kind === 'response' && (
|
||||
<button
|
||||
onClick={copyResponse}
|
||||
className="flex items-center gap-1.5 text-[11px] font-bold uppercase tracking-widest text-slate-400 hover:text-brand-400 transition-colors"
|
||||
>
|
||||
{copied ? <Check size={12} /> : <Copy size={12} />}
|
||||
{copied ? 'Copied' : 'Copy'}
|
||||
</button>
|
||||
)}
|
||||
</div>
|
||||
</div>
|
||||
{isNet ? (
|
||||
<div className="text-red-400 font-mono text-[13px] leading-relaxed break-all">
|
||||
Network error: {result.message}
|
||||
</div>
|
||||
) : typeof result.body === 'string' ? (
|
||||
<pre className="text-slate-300 font-mono text-[13px] whitespace-pre-wrap leading-relaxed">{result.body}</pre>
|
||||
) : (
|
||||
<pre className="text-slate-300 font-mono text-[13px] whitespace-pre-wrap leading-relaxed"
|
||||
dangerouslySetInnerHTML={{ __html: highlightJSON(result.body) }}
|
||||
/>
|
||||
)}
|
||||
</div>
|
||||
)}
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
<pre
|
||||
className="mono text-xs p-4 overflow-x-auto leading-relaxed"
|
||||
style={{ color: '#e2e8f0' }}
|
||||
>
|
||||
{isString
|
||||
? <code>{body}</code>
|
||||
: <code dangerouslySetInnerHTML={{ __html: highlightJSON(body) }} />}
|
||||
</pre>
|
||||
</div>
|
||||
)
|
||||
}
|
||||
|
||||
@@ -1,60 +1,99 @@
|
||||
import { Zap, BookOpen, Code2, Server } from 'lucide-react'
|
||||
import { BASE_URL, topics } from '../data/topics'
|
||||
import { ArrowRight, Code2, Zap, Truck, Users, Building2, Package, ShoppingCart, CreditCard, FileText, UserCircle, Bike, Wrench } from 'lucide-react'
|
||||
import { LEGACY_BASE_URL, REST_BASE_URL } from '../data/topics'
|
||||
|
||||
export default function Introduction() {
|
||||
const endpointCount = topics.reduce((n, t) => n + t.endpoints.length, 0)
|
||||
const topicIcons = {
|
||||
utils: Wrench,
|
||||
users: Users,
|
||||
partners: Bike,
|
||||
tenants: Building2,
|
||||
customers: UserCircle,
|
||||
deliveries: Truck,
|
||||
orders: ShoppingCart,
|
||||
products: Package,
|
||||
invoice: FileText,
|
||||
payments: CreditCard,
|
||||
}
|
||||
|
||||
export default function Introduction({ allLegacy, allRest, setActiveTopic }) {
|
||||
const allTopics = [...allLegacy, ...allRest]
|
||||
|
||||
return (
|
||||
<div className="max-w-3xl">
|
||||
<div className="flex items-center gap-3 mb-6">
|
||||
<div className="w-12 h-12 rounded-xl bg-gradient-to-br from-brand-500 to-indigo-600 flex items-center justify-center shadow-glow">
|
||||
<Zap className="text-white w-6 h-6" />
|
||||
</div>
|
||||
<div>
|
||||
<h1 className="text-3xl font-bold text-slate-900 tracking-tight">EXpress Developer Docs</h1>
|
||||
<p className="text-slate-500 text-sm">Reference for the EXpress REST API.</p>
|
||||
<div className="max-w-[1000px] mx-auto px-12 py-20 lg:px-24 lg:py-28">
|
||||
|
||||
<div className="inline-flex items-center gap-2 px-3 py-1 rounded-full bg-brand-50 border border-brand-100 text-brand-600 text-sm font-medium mb-8">
|
||||
<Zap size={14} className="fill-current" />
|
||||
v1.0 Developer API
|
||||
</div>
|
||||
|
||||
<h1 className="text-4xl lg:text-5xl font-bold text-slate-900 mb-6 tracking-tight">
|
||||
<span className="text-gradient">Nearle Express API</span>
|
||||
</h1>
|
||||
|
||||
<p className="text-xl text-slate-600 mb-12 max-w-2xl leading-relaxed">
|
||||
A comprehensive platform for managing tenants, users, partners, customers,
|
||||
orders, deliveries, products, invoices, and payments across the Express network.
|
||||
</p>
|
||||
|
||||
<div className="mb-8">
|
||||
<h2 className="text-xs font-bold uppercase tracking-widest text-slate-400 mb-4">Base URLs</h2>
|
||||
<div className="grid grid-cols-1 sm:grid-cols-2 gap-3 mb-10">
|
||||
<div className="bg-white border border-slate-200/60 rounded-xl p-4 shadow-sm">
|
||||
<div className="text-[11px] text-brand-600 font-bold uppercase tracking-widest mb-1.5">Hasura API</div>
|
||||
<code className="font-mono text-sm text-slate-700">{LEGACY_BASE_URL}</code>
|
||||
</div>
|
||||
<div className="bg-white border border-slate-200/60 rounded-xl p-4 shadow-sm">
|
||||
<div className="text-[11px] text-indigo-600 font-bold uppercase tracking-widest mb-1.5">REST API</div>
|
||||
<code className="font-mono text-sm text-slate-700">{REST_BASE_URL}</code>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<p className="text-slate-700 leading-relaxed text-lg mb-8">
|
||||
Welcome to the EXpress API documentation. The EXpress API exposes the operations
|
||||
you need to manage tenants, users, partners, customers, orders, deliveries,
|
||||
products, invoices, and payments across the platform.
|
||||
</p>
|
||||
<div className="grid grid-cols-1 md:grid-cols-2 gap-6">
|
||||
{allTopics.map((topic, index) => {
|
||||
const Icon = topicIcons[topic.id] || Zap
|
||||
return (
|
||||
<div
|
||||
key={topic.uniqueId}
|
||||
onClick={() => setActiveTopic(topic)}
|
||||
className="group relative bg-white p-6 rounded-2xl border border-slate-200/60 shadow-sm hover:shadow-xl hover:shadow-brand-500/5 hover:border-brand-200 transition-all duration-300 cursor-pointer overflow-hidden"
|
||||
style={{ animationDelay: `${index * 100}ms` }}
|
||||
>
|
||||
<div className="absolute top-0 right-0 w-32 h-32 bg-gradient-to-br from-brand-50 to-transparent rounded-bl-full opacity-0 group-hover:opacity-100 transition-opacity duration-500"></div>
|
||||
|
||||
<div className="grid grid-cols-1 sm:grid-cols-3 gap-4 mb-10">
|
||||
<div className="p-4 rounded-xl border border-slate-200 bg-white">
|
||||
<div className="flex items-center gap-2 text-slate-500 text-xs uppercase tracking-wide mb-1">
|
||||
<BookOpen size={14} /> Topics
|
||||
</div>
|
||||
<div className="text-2xl font-bold text-slate-900">{topics.length}</div>
|
||||
</div>
|
||||
<div className="p-4 rounded-xl border border-slate-200 bg-white">
|
||||
<div className="flex items-center gap-2 text-slate-500 text-xs uppercase tracking-wide mb-1">
|
||||
<Code2 size={14} /> Endpoints
|
||||
</div>
|
||||
<div className="text-2xl font-bold text-slate-900">{endpointCount}</div>
|
||||
</div>
|
||||
<div className="p-4 rounded-xl border border-slate-200 bg-white">
|
||||
<div className="flex items-center gap-2 text-slate-500 text-xs uppercase tracking-wide mb-1">
|
||||
<Server size={14} /> Style
|
||||
</div>
|
||||
<div className="text-2xl font-bold text-slate-900">REST</div>
|
||||
</div>
|
||||
<div className="relative z-10">
|
||||
<h3 className="text-lg font-bold text-slate-900 mb-2 group-hover:text-brand-600 transition-colors flex items-center gap-2">
|
||||
<div className="p-1.5 bg-brand-50 text-brand-600 rounded-md group-hover:bg-brand-100 transition-colors">
|
||||
<Icon size={18} />
|
||||
</div>
|
||||
{topic.name}
|
||||
<ArrowRight size={16} className="opacity-0 -translate-x-4 group-hover:opacity-100 group-hover:translate-x-0 transition-all duration-300 ml-auto" />
|
||||
</h3>
|
||||
<div className="flex items-center gap-2 mt-1 mb-2">
|
||||
<span className={`text-[10px] font-bold uppercase tracking-widest px-2 py-0.5 rounded ${
|
||||
topic.type === 'legacy'
|
||||
? 'bg-brand-50 text-brand-600 border border-brand-100'
|
||||
: 'bg-indigo-50 text-indigo-600 border border-indigo-100'
|
||||
}`}>
|
||||
{topic.type === 'legacy' ? 'Hasura' : 'REST'}
|
||||
</span>
|
||||
<span className="text-[11px] text-slate-400">{topic.endpoints.length} endpoint{topic.endpoints.length !== 1 ? 's' : ''}</span>
|
||||
</div>
|
||||
<p className="text-sm text-slate-500 leading-relaxed">
|
||||
{topic.description}
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
)
|
||||
})}
|
||||
</div>
|
||||
|
||||
<h2 className="text-xl font-semibold text-slate-900 mb-3">Base URL</h2>
|
||||
<pre className="mono text-sm bg-slate-900 text-slate-100 rounded-xl p-4 mb-8 overflow-x-auto">
|
||||
<code>{BASE_URL}</code>
|
||||
</pre>
|
||||
<div className="mt-16 flex items-center gap-4 p-6 bg-slate-900 text-slate-300 rounded-2xl shadow-code">
|
||||
<Code2 className="text-brand-400 shrink-0" size={24} />
|
||||
<p className="text-sm">
|
||||
Explore interactive endpoints for both Hasura and REST APIs. All requests route through the dev proxy which injects authentication headers securely.
|
||||
</p>
|
||||
</div>
|
||||
|
||||
<h2 className="text-xl font-semibold text-slate-900 mb-3">Reference layout</h2>
|
||||
<p className="text-slate-700 leading-relaxed mb-3">
|
||||
Endpoints are grouped in the sidebar by their URL segment after
|
||||
{' '}<code className="mono bg-slate-100 px-1.5 py-0.5 rounded text-sm">/api/rest/xpress/</code>.
|
||||
Pick a topic on the left to see all endpoints under it, each with its method,
|
||||
full URL, and a short description.
|
||||
</p>
|
||||
</div>
|
||||
)
|
||||
}
|
||||
|
||||
@@ -1,19 +1,58 @@
|
||||
import { useState } from 'react'
|
||||
import { Search, Zap, ChevronDown, ChevronRight, Terminal } from 'lucide-react'
|
||||
import { Search, ChevronRight, ChevronDown, Layers, Terminal } from 'lucide-react'
|
||||
import { getTopicIcon } from '../lib/icons'
|
||||
|
||||
export default function Sidebar({ topics, activeTopic, setActiveTopic, searchQuery, setSearchQuery }) {
|
||||
const [open, setOpen] = useState({ general: true, topics: true })
|
||||
export default function Sidebar({ legacyTopics, restTopics, activeTopic, setActiveTopic, searchQuery, setSearchQuery }) {
|
||||
const [open, setOpen] = useState({ general: true, legacy: true, rest: true })
|
||||
const toggle = (k) => setOpen((s) => ({ ...s, [k]: !s[k] }))
|
||||
|
||||
const renderTopicGroup = (topics, title, key) => (
|
||||
<div>
|
||||
<button
|
||||
onClick={() => toggle(key)}
|
||||
className="w-full flex items-center justify-between px-2 py-1.5 text-slate-800 font-semibold text-sm hover:text-brand-600 transition-colors group"
|
||||
>
|
||||
<span className="tracking-wide text-xs uppercase text-slate-400 group-hover:text-brand-500 transition-colors">
|
||||
{title}
|
||||
</span>
|
||||
{open[key] ? <ChevronDown size={14} className="text-slate-400" /> : <ChevronRight size={14} className="text-slate-400" />}
|
||||
</button>
|
||||
<div className={`mt-2 space-y-1 overflow-hidden transition-all duration-500 ${open[key] ? 'max-h-[800px] opacity-100' : 'max-h-0 opacity-0'}`}>
|
||||
{topics.map((t) => {
|
||||
const isActive = activeTopic?.uniqueId === t.uniqueId
|
||||
const Icon = getTopicIcon(t.id)
|
||||
return (
|
||||
<button
|
||||
key={t.uniqueId}
|
||||
onClick={() => setActiveTopic(t)}
|
||||
className={`w-full flex items-center gap-2.5 px-3 py-2 rounded-lg text-sm transition-all duration-200 group ${
|
||||
isActive
|
||||
? 'text-brand-700 bg-brand-50 shadow-sm font-medium'
|
||||
: 'text-slate-600 hover:text-slate-900 hover:bg-slate-100/50'
|
||||
}`}
|
||||
>
|
||||
<Icon
|
||||
size={16}
|
||||
className={`${isActive ? 'text-brand-500' : 'text-slate-400 group-hover:text-slate-500'} transition-colors`}
|
||||
/>
|
||||
{t.name}
|
||||
</button>
|
||||
)
|
||||
})}
|
||||
</div>
|
||||
</div>
|
||||
)
|
||||
|
||||
return (
|
||||
<div className="w-[280px] glass h-screen fixed top-0 left-0 flex flex-col z-20 transition-all">
|
||||
|
||||
{/* Brand Header */}
|
||||
<div className="p-6 border-b border-slate-100/50">
|
||||
<div className="flex items-center gap-3 text-slate-900 font-bold text-xl mb-6">
|
||||
<div className="w-8 h-8 rounded-lg bg-gradient-to-br from-brand-500 to-indigo-600 flex items-center justify-center shadow-glow">
|
||||
<Zap className="text-white w-4 h-4" />
|
||||
<Layers className="text-white w-4 h-4" />
|
||||
</div>
|
||||
<span className="tracking-tight">EXpress</span>
|
||||
<span className="tracking-tight">Nearle Express</span>
|
||||
</div>
|
||||
<div className="relative group">
|
||||
<Search className="w-4 h-4 absolute left-3 top-3 text-slate-400 group-focus-within:text-brand-500 transition-colors" />
|
||||
@@ -29,67 +68,34 @@ export default function Sidebar({ topics, activeTopic, setActiveTopic, searchQue
|
||||
|
||||
<div className="flex-1 overflow-y-auto py-6 px-4 scrollbar-hide">
|
||||
<nav className="space-y-6">
|
||||
|
||||
{/* Getting Started */}
|
||||
<div>
|
||||
<button
|
||||
onClick={() => toggle('general')}
|
||||
className="w-full flex items-center justify-between px-2 py-1.5 text-slate-800 font-semibold text-sm hover:text-brand-600 transition-colors group"
|
||||
>
|
||||
<span className="tracking-wide text-xs uppercase text-slate-400 group-hover:text-brand-500 transition-colors">
|
||||
Getting Started
|
||||
</span>
|
||||
{open.general
|
||||
? <ChevronDown size={14} className="text-slate-400" />
|
||||
: <ChevronRight size={14} className="text-slate-400" />}
|
||||
<span className="tracking-wide text-xs uppercase text-slate-400 group-hover:text-brand-500 transition-colors">Getting Started</span>
|
||||
{open.general ? <ChevronDown size={14} className="text-slate-400" /> : <ChevronRight size={14} className="text-slate-400" />}
|
||||
</button>
|
||||
<div className={`mt-2 space-y-1 overflow-hidden transition-all duration-300 ${open.general ? 'max-h-40 opacity-100' : 'max-h-0 opacity-0'}`}>
|
||||
<button
|
||||
onClick={() => setActiveTopic(null)}
|
||||
className={`w-full flex items-center gap-2.5 px-3 py-2 rounded-lg text-sm transition-all duration-200 ${activeTopic
|
||||
? 'text-slate-600 hover:text-slate-900 hover:bg-slate-100/50'
|
||||
: 'text-brand-700 bg-brand-50 shadow-sm font-medium'
|
||||
}`}
|
||||
className={`w-full flex items-center gap-2.5 px-3 py-2 rounded-lg text-sm transition-all duration-200 ${
|
||||
activeTopic === null
|
||||
? 'text-brand-700 bg-brand-50 shadow-sm font-medium'
|
||||
: 'text-slate-600 hover:text-slate-900 hover:bg-slate-100/50'
|
||||
}`}
|
||||
>
|
||||
<Terminal size={16} className={activeTopic ? 'text-slate-400' : 'text-brand-500'} />
|
||||
<Terminal size={16} className={activeTopic === null ? 'text-brand-500' : 'text-slate-400'} />
|
||||
Introduction
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div>
|
||||
<button
|
||||
onClick={() => toggle('topics')}
|
||||
className="w-full flex items-center justify-between px-2 py-1.5 text-slate-800 font-semibold text-sm hover:text-brand-600 transition-colors group"
|
||||
>
|
||||
<span className="tracking-wide text-xs uppercase text-slate-400 group-hover:text-brand-500 transition-colors">
|
||||
API Reference
|
||||
</span>
|
||||
{open.topics
|
||||
? <ChevronDown size={14} className="text-slate-400" />
|
||||
: <ChevronRight size={14} className="text-slate-400" />}
|
||||
</button>
|
||||
<div className={`mt-2 space-y-1 overflow-hidden transition-all duration-500 ${open.topics ? 'max-h-[800px] opacity-100' : 'max-h-0 opacity-0'}`}>
|
||||
{topics.map((t) => {
|
||||
const isActive = activeTopic?.id === t.id
|
||||
const Icon = getTopicIcon(t.id)
|
||||
return (
|
||||
<button
|
||||
key={t.id}
|
||||
onClick={() => setActiveTopic(t)}
|
||||
className={`w-full flex items-center gap-2.5 px-3 py-2 rounded-lg text-sm transition-all duration-200 group ${isActive
|
||||
? 'text-brand-700 bg-brand-50 shadow-sm font-medium'
|
||||
: 'text-slate-600 hover:text-slate-900 hover:bg-slate-100/50'
|
||||
}`}
|
||||
>
|
||||
<Icon
|
||||
size={16}
|
||||
className={`${isActive ? 'text-brand-500' : 'text-slate-400 group-hover:text-slate-500'} transition-colors`}
|
||||
/>
|
||||
{t.name}
|
||||
</button>
|
||||
)
|
||||
})}
|
||||
</div>
|
||||
</div>
|
||||
{legacyTopics.length > 0 && renderTopicGroup(legacyTopics, 'Hasura API', 'legacy')}
|
||||
{restTopics.length > 0 && renderTopicGroup(restTopics, 'REST API', 'rest')}
|
||||
|
||||
</nav>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -1,12 +1,15 @@
|
||||
import { useEffect, useRef, useState } from 'react'
|
||||
import EndpointCard from './EndpointCard'
|
||||
import { getTopicIcon } from '../lib/icons'
|
||||
import { BASE_URL } from '../data/topics'
|
||||
|
||||
// Strip the documented BASE_URL so fetches are same-origin and get
|
||||
// proxied by Vite (dev) or Express (prod), which injects the secret header.
|
||||
function toProxyPath(fullUrl) {
|
||||
if (fullUrl.startsWith(BASE_URL)) return fullUrl.slice(BASE_URL.length)
|
||||
import { LEGACY_BASE_URL } from '../data/topics'
|
||||
|
||||
function toProxyPath(fullUrl, baseUrl) {
|
||||
// Only proxy the legacy Hasura API (to inject the admin secret via server)
|
||||
if (baseUrl === LEGACY_BASE_URL && fullUrl.startsWith(baseUrl)) {
|
||||
return fullUrl.slice(baseUrl.length)
|
||||
}
|
||||
// Let the browser hit the new REST API directly (it supports CORS)
|
||||
return fullUrl
|
||||
}
|
||||
|
||||
@@ -21,8 +24,6 @@ export default function TopicView({ topic, searchQuery }) {
|
||||
)
|
||||
: topic.endpoints
|
||||
|
||||
// Only one endpoint's response is visible at a time. Sending on a new
|
||||
// endpoint replaces the previous one (and cancels its in-flight fetch).
|
||||
const [active, setActive] = useState(null)
|
||||
const abortRef = useRef(null)
|
||||
|
||||
@@ -41,12 +42,28 @@ export default function TopicView({ topic, searchQuery }) {
|
||||
|
||||
setActive({ name: endpoint.name, result: null, loading: true })
|
||||
const start = Date.now()
|
||||
|
||||
try {
|
||||
const res = await fetch(toProxyPath(composedUrl), {
|
||||
const fetchOptions = {
|
||||
method: endpoint.method,
|
||||
headers: { 'Content-Type': 'application/json' },
|
||||
signal: controller.signal
|
||||
})
|
||||
}
|
||||
|
||||
if (['POST', 'PUT', 'PATCH'].includes(endpoint.method) && endpoint.body) {
|
||||
if (typeof endpoint.body === 'string') {
|
||||
try {
|
||||
// Re-stringify in case it's a badly formatted JSON string, but mostly it's just raw string
|
||||
fetchOptions.body = JSON.stringify(JSON.parse(endpoint.body))
|
||||
} catch {
|
||||
fetchOptions.body = endpoint.body
|
||||
}
|
||||
} else {
|
||||
fetchOptions.body = JSON.stringify(endpoint.body)
|
||||
}
|
||||
}
|
||||
|
||||
const res = await fetch(toProxyPath(composedUrl, topic.baseUrl), fetchOptions)
|
||||
const ms = Date.now() - start
|
||||
const text = await res.text()
|
||||
let body
|
||||
@@ -71,23 +88,26 @@ export default function TopicView({ topic, searchQuery }) {
|
||||
}
|
||||
|
||||
return (
|
||||
<div className="max-w-4xl">
|
||||
<div className="mb-8 flex items-start gap-4">
|
||||
<div className="w-12 h-12 rounded-xl bg-gradient-to-br from-brand-500 to-indigo-600 flex items-center justify-center shadow-glow flex-shrink-0">
|
||||
<Icon className="text-white w-6 h-6" />
|
||||
</div>
|
||||
<div>
|
||||
<h1 className="text-3xl font-bold text-slate-900 tracking-tight">{topic.name}</h1>
|
||||
<p className="text-slate-600 mt-2 leading-relaxed">{topic.description}</p>
|
||||
<div className="mt-3 text-xs text-slate-400 uppercase tracking-wide">
|
||||
{filtered.length} endpoint{filtered.length === 1 ? '' : 's'}
|
||||
</div>
|
||||
<div className="pb-24">
|
||||
<div className="mb-12">
|
||||
<h1 className="text-4xl lg:text-5xl font-bold text-slate-900 mb-4 tracking-tight">{topic.name}</h1>
|
||||
<p className="text-lg text-slate-600 max-w-3xl leading-relaxed">{topic.description}</p>
|
||||
<div className="mt-4 flex items-center gap-3">
|
||||
<span className={`inline-flex items-center gap-1.5 text-[11px] font-bold uppercase tracking-widest px-3 py-1 rounded-full border ${
|
||||
topic.type === 'legacy'
|
||||
? 'bg-brand-50 text-brand-600 border-brand-100'
|
||||
: 'bg-indigo-50 text-indigo-600 border-indigo-100'
|
||||
}`}>
|
||||
<span className="w-1.5 h-1.5 rounded-full bg-current"></span>
|
||||
{topic.type === 'legacy' ? 'Hasura API' : 'REST API'}
|
||||
</span>
|
||||
<span className="text-sm text-slate-400">{filtered.length} endpoint{filtered.length !== 1 ? 's' : ''}</span>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div className="space-y-4">
|
||||
{filtered.length === 0 ? (
|
||||
<div className="text-center py-16 text-slate-400 text-sm">
|
||||
<div className="text-center py-20 text-slate-400 text-sm bg-white rounded-2xl border border-slate-200/60">
|
||||
No endpoints match "{searchQuery}".
|
||||
</div>
|
||||
) : (
|
||||
@@ -95,8 +115,9 @@ export default function TopicView({ topic, searchQuery }) {
|
||||
const isActive = active?.name === e.name
|
||||
return (
|
||||
<EndpointCard
|
||||
key={`${topic.id}/${e.name}`}
|
||||
key={`${topic.uniqueId}/${e.name}`}
|
||||
endpoint={e}
|
||||
baseUrl={topic.baseUrl}
|
||||
onSend={handleSend}
|
||||
result={isActive ? active.result : null}
|
||||
loading={isActive ? active.loading : false}
|
||||
|
||||
1921
src/data/topics.js
1921
src/data/topics.js
File diff suppressed because it is too large
Load Diff
@@ -1,25 +1,51 @@
|
||||
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&family=JetBrains+Mono:wght@400;500;600&display=swap');
|
||||
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&family=Fira+Code:wght@400;500&display=swap');
|
||||
|
||||
@tailwind base;
|
||||
@tailwind components;
|
||||
@tailwind utilities;
|
||||
|
||||
html, body, #root { height: 100%; }
|
||||
body {
|
||||
font-family: 'Inter', ui-sans-serif, system-ui, sans-serif;
|
||||
background-color: #f8fafc;
|
||||
color: #0f172a;
|
||||
-webkit-font-smoothing: antialiased;
|
||||
@layer base {
|
||||
body {
|
||||
@apply bg-slate-50 text-slate-800 font-sans antialiased selection:bg-brand-500/30 selection:text-brand-900;
|
||||
}
|
||||
}
|
||||
|
||||
.glass {
|
||||
background-color: rgba(255, 255, 255, 0.7);
|
||||
backdrop-filter: saturate(180%) blur(20px);
|
||||
-webkit-backdrop-filter: saturate(180%) blur(20px);
|
||||
border-right: 1px solid rgba(226, 232, 240, 0.7);
|
||||
@layer utilities {
|
||||
.glass {
|
||||
@apply bg-white/70 backdrop-blur-md border border-white/40 shadow-glass;
|
||||
}
|
||||
|
||||
.dark-glass {
|
||||
@apply bg-dark-900/90 backdrop-blur-xl border border-white/5;
|
||||
}
|
||||
|
||||
.text-gradient {
|
||||
@apply bg-clip-text text-transparent bg-gradient-to-r from-brand-600 to-indigo-600;
|
||||
}
|
||||
|
||||
.scrollbar-hide::-webkit-scrollbar { display: none; }
|
||||
.scrollbar-hide { -ms-overflow-style: none; scrollbar-width: none; }
|
||||
}
|
||||
|
||||
.scrollbar-hide::-webkit-scrollbar { display: none; }
|
||||
.scrollbar-hide { -ms-overflow-style: none; scrollbar-width: none; }
|
||||
::-webkit-scrollbar {
|
||||
width: 6px;
|
||||
height: 6px;
|
||||
}
|
||||
::-webkit-scrollbar-track {
|
||||
background: transparent;
|
||||
}
|
||||
::-webkit-scrollbar-thumb {
|
||||
@apply bg-slate-200 rounded-full;
|
||||
}
|
||||
::-webkit-scrollbar-thumb:hover {
|
||||
@apply bg-slate-300;
|
||||
}
|
||||
|
||||
code, pre, .mono { font-family: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, monospace; }
|
||||
.bg-grid-pattern {
|
||||
background-image: linear-gradient(to right, #f1f5f9 1px, transparent 1px),
|
||||
linear-gradient(to bottom, #f1f5f9 1px, transparent 1px);
|
||||
background-size: 40px 40px;
|
||||
}
|
||||
|
||||
.animation-delay-2000 { animation-delay: 2s; }
|
||||
.animation-delay-4000 { animation-delay: 4s; }
|
||||
|
||||
@@ -3,27 +3,63 @@ export default {
|
||||
content: ['./index.html', './src/**/*.{js,jsx}'],
|
||||
theme: {
|
||||
extend: {
|
||||
fontFamily: {
|
||||
sans: ['Inter', 'system-ui', 'sans-serif'],
|
||||
mono: ['Fira Code', 'monospace'],
|
||||
},
|
||||
colors: {
|
||||
brand: {
|
||||
50: '#eef2ff',
|
||||
100: '#e0e7ff',
|
||||
200: '#c7d2fe',
|
||||
300: '#a5b4fc',
|
||||
400: '#818cf8',
|
||||
500: '#6366f1',
|
||||
600: '#4f46e5',
|
||||
700: '#4338ca',
|
||||
800: '#3730a3',
|
||||
900: '#312e81'
|
||||
50: '#f0f9ff',
|
||||
100: '#e0f2fe',
|
||||
200: '#bae6fd',
|
||||
300: '#7dd3fc',
|
||||
400: '#38bdf8',
|
||||
500: '#0ea5e9',
|
||||
600: '#0284c7',
|
||||
700: '#0369a1',
|
||||
800: '#075985',
|
||||
900: '#0c4a6e',
|
||||
950: '#082f49',
|
||||
},
|
||||
dark: {
|
||||
900: '#0A0A0B',
|
||||
800: '#141415',
|
||||
700: '#1C1C1F',
|
||||
600: '#27272A',
|
||||
}
|
||||
},
|
||||
boxShadow: {
|
||||
glow: '0 0 20px -2px rgba(99,102,241,0.45)'
|
||||
'glow': '0 0 20px rgba(14, 165, 233, 0.15)',
|
||||
'glass': '0 4px 30px rgba(0, 0, 0, 0.05)',
|
||||
'code': '0 20px 40px -10px rgba(0,0,0,0.4)',
|
||||
},
|
||||
fontFamily: {
|
||||
sans: ['Inter', 'ui-sans-serif', 'system-ui', 'sans-serif']
|
||||
animation: {
|
||||
'blob': 'blob 7s infinite',
|
||||
'fade-in-up': 'fadeInUp 0.6s cubic-bezier(0.16, 1, 0.3, 1) forwards',
|
||||
'fade-in': 'fadeIn 0.5s ease-out',
|
||||
'slide-up': 'slideUp 0.5s ease-out forwards',
|
||||
},
|
||||
keyframes: {
|
||||
blob: {
|
||||
'0%': { transform: 'translate(0px, 0px) scale(1)' },
|
||||
'33%': { transform: 'translate(30px, -50px) scale(1.1)' },
|
||||
'66%': { transform: 'translate(-20px, 20px) scale(0.9)' },
|
||||
'100%': { transform: 'translate(0px, 0px) scale(1)' },
|
||||
},
|
||||
fadeInUp: {
|
||||
'0%': { opacity: '0', transform: 'translateY(20px)' },
|
||||
'100%': { opacity: '1', transform: 'translateY(0)' },
|
||||
},
|
||||
fadeIn: {
|
||||
'0%': { opacity: '0' },
|
||||
'100%': { opacity: '1' },
|
||||
},
|
||||
slideUp: {
|
||||
'0%': { opacity: '0', transform: 'translateY(10px)' },
|
||||
'100%': { opacity: '1', transform: 'translateY(0)' },
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
},
|
||||
plugins: []
|
||||
plugins: [],
|
||||
}
|
||||
|
||||
@@ -26,6 +26,16 @@ export default defineConfig(({ mode }) => {
|
||||
if (secret) proxyReq.setHeader('x-hasura-admin-secret', secret)
|
||||
})
|
||||
}
|
||||
},
|
||||
'/live': {
|
||||
target: 'https://fiesta.nearle.app',
|
||||
changeOrigin: true,
|
||||
secure: true,
|
||||
configure: (proxy) => {
|
||||
proxy.on('proxyReq', (proxyReq) => {
|
||||
if (secret) proxyReq.setHeader('x-hasura-admin-secret', secret)
|
||||
})
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user