Adds the full Next.js app (app/, components/, lib/, scripts/, assets/, docs/, Dockerfile, compose, configs) to version control. Security: - CIPC BizPortal customer-code logins (Login 1 + Login 3) now read CIPC_LOGIN1_CODE / CIPC_LOGIN1_PASSWORD / CIPC_LOGIN3_CODE / CIPC_LOGIN3_PASSWORD from .env.local instead of source. - BizPortal personal login in apply-bizportal route reads BIZPORTAL_ID_NO / BIZPORTAL_PASSWORD. - Added .env.example as the committed template. .gitignore excludes .env*, node_modules, .next, logs, sqlite, Playwright storage_state.json (live CIPC cookies), scratch dirs, client PDFs and debug screenshots.
37 lines
1.3 KiB
Python
37 lines
1.3 KiB
Python
import os, sys, pathlib
|
|
import requests
|
|
import json
|
|
|
|
env_path = pathlib.Path(r'C:\Users\SJ\.minimax-agent\projects\Workflow\.env.local')
|
|
for line in env_path.read_text().splitlines():
|
|
if line.strip() and '=' in line and not line.startswith('#'):
|
|
k, v = line.split('=', 1)
|
|
os.environ.setdefault(k.strip(), v.strip())
|
|
|
|
url = os.environ['PB_URL']
|
|
token = os.environ['PB_TOKEN']
|
|
headers = {'Authorization': f'Bearer {token}'}
|
|
|
|
# Get the EMP201 collection
|
|
coll_id = 'pbc_2178038841'
|
|
|
|
# Get collection schema
|
|
r = requests.get(f'{url}/api/collections/{coll_id}', headers=headers, timeout=15)
|
|
r.raise_for_status()
|
|
coll = r.json()
|
|
print('=== COLLECTION ===')
|
|
print(f' name: {coll.get("name")}')
|
|
print(f' id: {coll.get("id")}')
|
|
print(f' system: {coll.get("system")}')
|
|
print(f' schema: {json.dumps(coll.get("schema", {}), indent=2)}')
|
|
print(f' indexes: {json.dumps(coll.get("indexes", []), indent=2)}')
|
|
print()
|
|
|
|
# Get a sample record to see actual fields
|
|
r = requests.get(f'{url}/api/collections/{coll_id}/records', headers=headers, params={'perPage': 3}, timeout=15)
|
|
r.raise_for_status()
|
|
items = r.json().get('items', [])
|
|
print(f'=== SAMPLE RECORDS ({len(items)}) ===')
|
|
for i, rec in enumerate(items):
|
|
print(f'\n--- record {i+1} ---')
|
|
print(json.dumps(rec, indent=2, default=str))
|