Compare commits
48 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| fb64b671d0 | |||
| 0cf5800463 | |||
| 20ca6e0334 | |||
| 9abd05d05a | |||
| 59b688dafb | |||
| 8b7a2eb644 | |||
| d4c16ccf97 | |||
| 0696f5663e | |||
| 4a531df8bd | |||
| 365f44dbe4 | |||
| 40c2ce20f3 | |||
| aa516667cd | |||
| f6fcf35cf8 | |||
| 2869f4ee5f | |||
| 614a353b3c | |||
| 7111162f14 | |||
| aaf6b2aa07 | |||
| e051ce8e7f | |||
| 7f39d79190 | |||
| 979a5c1dd3 | |||
| 20226caef4 | |||
| 7aacb9a53e | |||
| bc0973ccaa | |||
| 4dc746514a | |||
| 55d283c264 | |||
| e1a294fc96 | |||
| 554b16d6cb | |||
| be57d581ac | |||
| 3d2ba858bb | |||
| 3191691fff | |||
| 803f147fbb | |||
| 69b94ab7c0 | |||
| da31d47061 | |||
| 5994be5ddc | |||
| d3275207bd | |||
| d3e327174e | |||
| ba9e4a5add | |||
| c89f61a77f | |||
| ae222a2077 | |||
| 4a31ddfb2f | |||
| c7226a4ed9 | |||
| 39d5e5d269 | |||
| 43105f6bdc | |||
| b02d34453e | |||
| 4ba02d299b | |||
| 24a5c5aa8c | |||
| 373435ecfe | |||
| 2f0889ef4d |
@@ -0,0 +1,138 @@
|
|||||||
|
name: Release APK
|
||||||
|
|
||||||
|
on:
|
||||||
|
push:
|
||||||
|
tags:
|
||||||
|
- 'v*.*.*'
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
build:
|
||||||
|
if: github.server_url == 'https://github.com'
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
timeout-minutes: 60
|
||||||
|
permissions:
|
||||||
|
contents: write
|
||||||
|
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v4
|
||||||
|
|
||||||
|
- uses: actions/setup-java@v4
|
||||||
|
with:
|
||||||
|
distribution: temurin
|
||||||
|
java-version: '21'
|
||||||
|
|
||||||
|
- uses: actions/setup-node@v4
|
||||||
|
with:
|
||||||
|
node-version: '20'
|
||||||
|
|
||||||
|
- name: Install pnpm
|
||||||
|
uses: pnpm/action-setup@v4
|
||||||
|
with:
|
||||||
|
version: 9
|
||||||
|
|
||||||
|
- name: Get pnpm store path
|
||||||
|
id: pnpm-cache
|
||||||
|
shell: bash
|
||||||
|
run: echo "STORE_PATH=$(pnpm store path --silent)" >> $GITHUB_OUTPUT
|
||||||
|
|
||||||
|
- name: Cache pnpm store
|
||||||
|
uses: actions/cache@v4
|
||||||
|
with:
|
||||||
|
path: ${{ steps.pnpm-cache.outputs.STORE_PATH }}
|
||||||
|
key: ${{ runner.os }}-pnpm-${{ hashFiles('**/pnpm-lock.yaml') }}
|
||||||
|
restore-keys: |
|
||||||
|
${{ runner.os }}-pnpm-
|
||||||
|
|
||||||
|
- name: Install dependencies
|
||||||
|
working-directory: artifacts/postiz-mobile
|
||||||
|
run: pnpm install --no-frozen-lockfile
|
||||||
|
|
||||||
|
- name: Set up Android SDK
|
||||||
|
uses: android-actions/setup-android@v3
|
||||||
|
|
||||||
|
- name: Accept Android SDK licenses
|
||||||
|
run: yes | sdkmanager --licenses || true
|
||||||
|
|
||||||
|
- name: Cache Android NDK
|
||||||
|
id: ndk-cache
|
||||||
|
uses: actions/cache@v4
|
||||||
|
with:
|
||||||
|
path: /usr/local/lib/android/sdk/ndk/28.2.13676358
|
||||||
|
key: ndk-28.2.13676358-v1
|
||||||
|
|
||||||
|
- name: Install SDK components
|
||||||
|
run: |
|
||||||
|
sdkmanager "platform-tools" "platforms;android-35" "build-tools;35.0.0"
|
||||||
|
if [ "${{ steps.ndk-cache.outputs.cache-hit }}" != "true" ]; then
|
||||||
|
sdkmanager "ndk;28.2.13676358"
|
||||||
|
fi
|
||||||
|
|
||||||
|
- name: Cache Gradle
|
||||||
|
uses: actions/cache@v4
|
||||||
|
with:
|
||||||
|
path: |
|
||||||
|
~/.gradle/caches
|
||||||
|
~/.gradle/wrapper
|
||||||
|
key: ${{ runner.os }}-gradle-${{ hashFiles('artifacts/postiz-mobile/package.json') }}
|
||||||
|
restore-keys: |
|
||||||
|
${{ runner.os }}-gradle-
|
||||||
|
|
||||||
|
- name: Decode keystore
|
||||||
|
run: |
|
||||||
|
mkdir -p ~/.config/postiz-mobile
|
||||||
|
echo "${{ secrets.KEYSTORE_B64 }}" | base64 -d > ~/.config/postiz-mobile/postiz-mobile.jks
|
||||||
|
cat > ~/.config/postiz-mobile/signing.env <<EOF
|
||||||
|
KEYSTORE_PATH=~/.config/postiz-mobile/postiz-mobile.jks
|
||||||
|
KEYSTORE_ALIAS=${{ secrets.KEYSTORE_ALIAS }}
|
||||||
|
KEYSTORE_STORE_PASSWORD=${{ secrets.KEYSTORE_STORE_PASSWORD }}
|
||||||
|
KEYSTORE_KEY_PASSWORD=${{ secrets.KEYSTORE_KEY_PASSWORD }}
|
||||||
|
EOF
|
||||||
|
chmod 600 ~/.config/postiz-mobile/signing.env ~/.config/postiz-mobile/postiz-mobile.jks
|
||||||
|
|
||||||
|
- name: Build signed APK
|
||||||
|
working-directory: artifacts/postiz-mobile
|
||||||
|
run: ./build-apk.sh
|
||||||
|
|
||||||
|
- name: Find built APK
|
||||||
|
id: apk
|
||||||
|
run: |
|
||||||
|
APK=$(ls artifacts/postiz-mobile/dist/*.apk | sort | tail -1)
|
||||||
|
echo "path=$APK" >> "$GITHUB_OUTPUT"
|
||||||
|
|
||||||
|
- name: Generate changelog
|
||||||
|
id: changelog
|
||||||
|
run: |
|
||||||
|
PREV_TAG=$(git tag --sort=-version:refname | grep -v "^${{ github.ref_name }}$" | head -1)
|
||||||
|
echo "Previous tag: $PREV_TAG"
|
||||||
|
|
||||||
|
FEATS=$(git log "${PREV_TAG}..HEAD" --pretty=format:"%s" --no-merges \
|
||||||
|
| grep -E "^feat(\([^)]+\))?: " \
|
||||||
|
| sed -E 's/^feat(\([^)]+\))?: //' \
|
||||||
|
| sed 's/^/- /')
|
||||||
|
|
||||||
|
FIXES=$(git log "${PREV_TAG}..HEAD" --pretty=format:"%s" --no-merges \
|
||||||
|
| grep -E "^fix(\([^)]+\))?: " \
|
||||||
|
| sed -E 's/^fix(\([^)]+\))?: //' \
|
||||||
|
| sed 's/^/- /')
|
||||||
|
|
||||||
|
{
|
||||||
|
echo "changelog<<CEOF"
|
||||||
|
[ -n "$FEATS" ] && printf "### What's New\n%s\n\n" "$FEATS"
|
||||||
|
[ -n "$FIXES" ] && printf "### Bug Fixes\n%s\n\n" "$FIXES"
|
||||||
|
echo "CEOF"
|
||||||
|
} >> "$GITHUB_OUTPUT"
|
||||||
|
|
||||||
|
- name: Create GitHub Release
|
||||||
|
uses: softprops/action-gh-release@v2
|
||||||
|
with:
|
||||||
|
name: "Postiz Mobile ${{ github.ref_name }}"
|
||||||
|
body: |
|
||||||
|
## Postiz Mobile ${{ github.ref_name }}
|
||||||
|
|
||||||
|
${{ steps.changelog.outputs.changelog }}
|
||||||
|
### Installation
|
||||||
|
1. Enable "Unknown sources" on the device
|
||||||
|
2. Transfer the APK to the device and open it to install
|
||||||
|
files: ${{ steps.apk.outputs.path }}
|
||||||
|
draft: false
|
||||||
|
prerelease: ${{ contains(github.ref_name, '-') }}
|
||||||
@@ -47,3 +47,4 @@ Thumbs.db
|
|||||||
# Replit
|
# Replit
|
||||||
.cache/
|
.cache/
|
||||||
.local/
|
.local/
|
||||||
|
scripts/push-to-gitea.sh
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
modules = ["nodejs-24"]
|
modules = ["nodejs-24", "python-3.11"]
|
||||||
|
|
||||||
[deployment]
|
[deployment]
|
||||||
router = "application"
|
router = "application"
|
||||||
@@ -17,7 +17,7 @@ expertMode = true
|
|||||||
|
|
||||||
[postMerge]
|
[postMerge]
|
||||||
path = "scripts/post-merge.sh"
|
path = "scripts/post-merge.sh"
|
||||||
timeoutMs = 20000
|
timeoutMs = 120000
|
||||||
|
|
||||||
[[ports]]
|
[[ports]]
|
||||||
localPort = 8080
|
localPort = 8080
|
||||||
@@ -27,6 +27,14 @@ externalPort = 8080
|
|||||||
localPort = 8081
|
localPort = 8081
|
||||||
externalPort = 80
|
externalPort = 80
|
||||||
|
|
||||||
|
[[ports]]
|
||||||
|
localPort = 8082
|
||||||
|
externalPort = 3001
|
||||||
|
|
||||||
[[ports]]
|
[[ports]]
|
||||||
localPort = 20976
|
localPort = 20976
|
||||||
externalPort = 3000
|
externalPort = 3000
|
||||||
|
|
||||||
|
[[ports]]
|
||||||
|
localPort = 20977
|
||||||
|
externalPort = 3002
|
||||||
|
|||||||
@@ -0,0 +1,110 @@
|
|||||||
|
# PostizMobile
|
||||||
|
|
||||||
|
React Native (Expo) mobile app to control a self-hosted [Postiz](https://postiz.com) instance from Android.
|
||||||
|
|
||||||
|
Build is fully local — no expo.dev account or EAS cloud required.
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## Features
|
||||||
|
|
||||||
|
| Screen | Description |
|
||||||
|
|--------|-------------|
|
||||||
|
| **Calendar** | Monthly view with color dots per day (indigo = scheduled, green = published, red = error). Tap a day to see its posts. |
|
||||||
|
| **Posts** | Filtered list (All / Queue / Published / Draft / Error) with sort toggle, pull-to-refresh, swipe left to delete, swipe right to reschedule. |
|
||||||
|
| **Compose** | Text editor with per-network character limit, channel picker, date/time picker, gallery image pick + upload, publish now or schedule. Local draft save/restore. |
|
||||||
|
| **Settings** | API key and base URL, connection test, secure storage. 401 auto-redirect to Settings. |
|
||||||
|
| **Notifications** | Local alerts when a post transitions to PUBLISHED or ERROR (polling every 15 min). |
|
||||||
|
|
||||||
|
**Theme**: forced dark. **Auth**: API key in `expo-secure-store`, never hardcoded.
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## Prerequisites
|
||||||
|
|
||||||
|
| Tool | Version |
|
||||||
|
|------|---------|
|
||||||
|
| Node.js | 20 LTS |
|
||||||
|
| pnpm | 10+ |
|
||||||
|
| Java (JDK) | 17–24 (Java 25+ not yet supported by Gradle 8) |
|
||||||
|
| Android SDK | see below |
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## Installation & Development
|
||||||
|
|
||||||
|
```bash
|
||||||
|
git clone https://github.com/pirona/postiz-android.git
|
||||||
|
cd postiz-android
|
||||||
|
pnpm install
|
||||||
|
```
|
||||||
|
|
||||||
|
Start the dev server (requires Expo Go on the device):
|
||||||
|
|
||||||
|
```bash
|
||||||
|
pnpm --filter @workspace/postiz-mobile run dev
|
||||||
|
```
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## Building an APK (local, no EAS)
|
||||||
|
|
||||||
|
See **[artifacts/postiz-mobile/README.md](artifacts/postiz-mobile/README.md)** for the full build guide.
|
||||||
|
|
||||||
|
Quick start:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
cd artifacts/postiz-mobile
|
||||||
|
./install-android-sdk.sh # first time only
|
||||||
|
cp ~/.config/postiz-mobile/signing.env.example ~/.config/postiz-mobile/signing.env
|
||||||
|
$EDITOR ~/.config/postiz-mobile/signing.env # fill in keystore credentials
|
||||||
|
./build-apk.sh # → dist/postiz-mobile-YYYYMMDD-HHMM.apk
|
||||||
|
```
|
||||||
|
|
||||||
|
### GitHub Actions release
|
||||||
|
|
||||||
|
Pushing a tag triggers an automated signed APK release:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
git tag v1.0.0
|
||||||
|
git push origin --tags
|
||||||
|
```
|
||||||
|
|
||||||
|
The workflow builds the APK on GitHub's infrastructure and attaches it to a GitHub Release.
|
||||||
|
Required secrets: `KEYSTORE_B64`, `KEYSTORE_ALIAS`, `KEYSTORE_STORE_PASSWORD`, `KEYSTORE_KEY_PASSWORD`.
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## App Configuration
|
||||||
|
|
||||||
|
On first launch, go to **Settings**:
|
||||||
|
|
||||||
|
1. **Base URL**: `https://your-postiz-instance/api/public/v1`
|
||||||
|
2. **API Key**: generated in Postiz → Settings → API Keys
|
||||||
|
3. Tap **Test Connection**, then **Save Settings**
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## Postiz API
|
||||||
|
|
||||||
|
| Method | Endpoint | Usage |
|
||||||
|
|--------|----------|-------|
|
||||||
|
| `GET` | `/integrations` | List channels |
|
||||||
|
| `GET` | `/posts?startDate=&endDate=` | Posts over a date range |
|
||||||
|
| `POST` | `/posts` | Create / schedule a post |
|
||||||
|
| `DELETE` | `/posts/:id` | Delete a post |
|
||||||
|
| `POST` | `/upload` | Upload an image (multipart) |
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## Troubleshooting
|
||||||
|
|
||||||
|
**"Not Configured" on all screens** → Settings tab → enter API key and URL → Test Connection.
|
||||||
|
|
||||||
|
**"Connection failed"** → URL must end with `/api/public/v1` — check Postiz is reachable.
|
||||||
|
|
||||||
|
**No notifications** → Accept permissions on first launch. Polling runs every 15 min.
|
||||||
|
|
||||||
|
**Build fails at Gradle** → Make sure `ANDROID_HOME` is set and Java is ≤ 24 (the script auto-detects `~/jdk21`).
|
||||||
|
|
||||||
|
**`expo prebuild` fails** → Run `pnpm install` from the repo root first.
|
||||||
@@ -12,7 +12,6 @@
|
|||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@workspace/api-zod": "workspace:*",
|
"@workspace/api-zod": "workspace:*",
|
||||||
"@workspace/db": "workspace:*",
|
"@workspace/db": "workspace:*",
|
||||||
"cookie-parser": "^1.4.7",
|
|
||||||
"cors": "^2",
|
"cors": "^2",
|
||||||
"drizzle-orm": "catalog:",
|
"drizzle-orm": "catalog:",
|
||||||
"express": "^5",
|
"express": "^5",
|
||||||
@@ -20,7 +19,6 @@
|
|||||||
"pino-http": "^10"
|
"pino-http": "^10"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@types/cookie-parser": "^1.4.10",
|
|
||||||
"@types/cors": "^2.8.19",
|
"@types/cors": "^2.8.19",
|
||||||
"@types/express": "^5.0.6",
|
"@types/express": "^5.0.6",
|
||||||
"@types/node": "catalog:",
|
"@types/node": "catalog:",
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
import express, { type Express } from "express";
|
import express, { type Express, type NextFunction, type Request, type Response } from "express";
|
||||||
import cors from "cors";
|
import cors from "cors";
|
||||||
import pinoHttp from "pino-http";
|
import pinoHttp from "pino-http";
|
||||||
import router from "./routes";
|
import router from "./routes";
|
||||||
@@ -31,4 +31,9 @@ app.use(express.urlencoded({ extended: true }));
|
|||||||
|
|
||||||
app.use("/api", router);
|
app.use("/api", router);
|
||||||
|
|
||||||
|
app.use((err: Error, _req: Request, res: Response, _next: NextFunction) => {
|
||||||
|
logger.error({ err }, "Unhandled error");
|
||||||
|
res.status(500).json({ error: "Internal server error" });
|
||||||
|
});
|
||||||
|
|
||||||
export default app;
|
export default app;
|
||||||
|
|||||||
@@ -15,11 +15,11 @@ if (Number.isNaN(port) || port <= 0) {
|
|||||||
throw new Error(`Invalid PORT value: "${rawPort}"`);
|
throw new Error(`Invalid PORT value: "${rawPort}"`);
|
||||||
}
|
}
|
||||||
|
|
||||||
app.listen(port, (err) => {
|
const server = app.listen(port, () => {
|
||||||
if (err) {
|
|
||||||
logger.error({ err }, "Error listening on port");
|
|
||||||
process.exit(1);
|
|
||||||
}
|
|
||||||
|
|
||||||
logger.info({ port }, "Server listening");
|
logger.info({ port }, "Server listening");
|
||||||
});
|
});
|
||||||
|
|
||||||
|
server.on("error", (err) => {
|
||||||
|
logger.error({ err }, "Error listening on port");
|
||||||
|
process.exit(1);
|
||||||
|
});
|
||||||
|
|||||||
@@ -9,16 +9,20 @@ dist/
|
|||||||
web-build/
|
web-build/
|
||||||
expo-env.d.ts
|
expo-env.d.ts
|
||||||
|
|
||||||
# Native
|
# Native — generated by expo prebuild, never committed
|
||||||
ios/
|
ios/
|
||||||
android/
|
android/
|
||||||
*.orig.*
|
*.orig.*
|
||||||
*.jks
|
*.jks
|
||||||
|
*.keystore
|
||||||
*.p8
|
*.p8
|
||||||
*.p12
|
*.p12
|
||||||
*.key
|
*.key
|
||||||
*.mobileprovision
|
*.mobileprovision
|
||||||
|
|
||||||
|
# Local build output
|
||||||
|
static-build/
|
||||||
|
|
||||||
# Metro
|
# Metro
|
||||||
.metro-health-check*
|
.metro-health-check*
|
||||||
|
|
||||||
|
|||||||
@@ -0,0 +1,228 @@
|
|||||||
|
# PostizMobile
|
||||||
|
|
||||||
|
React Native (Expo) mobile app to control a self-hosted [Postiz](https://postiz.com) instance from Android.
|
||||||
|
|
||||||
|
Build is fully local — no expo.dev account or EAS cloud required.
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## Features
|
||||||
|
|
||||||
|
| Screen | Description |
|
||||||
|
|--------|-------------|
|
||||||
|
| **Calendar** | Monthly view with color dots per day (indigo = scheduled, green = published, red = error). Tap a day post to copy or edit it. |
|
||||||
|
| **Posts** | Filtered list (All / Queue / Published / Draft / Error) with post counts, sort toggle (newest/oldest, persisted), pull-to-refresh, swipe left to delete, swipe right to reschedule. |
|
||||||
|
| **Compose** | Text editor with per-network character limit, channel picker, date/time picker, gallery image pick + upload, publish now or schedule. Local draft save/restore. |
|
||||||
|
| **Settings** | API key and base URL, connection test, secure storage. 401 auto-redirect to Settings. |
|
||||||
|
| **Notifications** | Local alerts when a post transitions to PUBLISHED or ERROR (polling every 15 min). |
|
||||||
|
|
||||||
|
**Theme**: forced dark. **Auth**: API key in `expo-secure-store`, never hardcoded.
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## Prerequisites
|
||||||
|
|
||||||
|
| Tool | Version |
|
||||||
|
|------|---------|
|
||||||
|
| Node.js | 20 LTS |
|
||||||
|
| pnpm | 10+ |
|
||||||
|
| Java (JDK) | 17–24 (Java 25+ not yet supported by Gradle 8) |
|
||||||
|
| Android SDK | see below |
|
||||||
|
|
||||||
|
No expo.dev account needed for builds.
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## Development
|
||||||
|
|
||||||
|
### Install dependencies
|
||||||
|
|
||||||
|
```bash
|
||||||
|
git clone https://github.com/pirona/postiz-android.git
|
||||||
|
cd postiz-android
|
||||||
|
pnpm install
|
||||||
|
```
|
||||||
|
|
||||||
|
### Start dev server (Expo Go)
|
||||||
|
|
||||||
|
```bash
|
||||||
|
pnpm --filter @workspace/postiz-mobile run dev
|
||||||
|
```
|
||||||
|
|
||||||
|
Scan the QR code with Expo Go on Android to preview the app live.
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## Building an APK (local, no EAS)
|
||||||
|
|
||||||
|
### First-time setup
|
||||||
|
|
||||||
|
**1. Java 21 LTS**
|
||||||
|
|
||||||
|
Gradle 8 requires Java ≤ 24. If the system Java is 25+ (Fedora 44), install Temurin 21 locally:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
wget -O /tmp/jdk21.tar.gz \
|
||||||
|
"https://github.com/adoptium/temurin21-binaries/releases/download/jdk-21.0.7%2B6/OpenJDK21U-jdk_x64_linux_hotspot_21.0.7_6.tar.gz"
|
||||||
|
mkdir -p ~/jdk21 && tar -xzf /tmp/jdk21.tar.gz -C ~/jdk21 --strip-components=1
|
||||||
|
```
|
||||||
|
|
||||||
|
`build-apk.sh` will use `~/jdk21` automatically if the system Java is ≥ 25.
|
||||||
|
|
||||||
|
**2. Android SDK**
|
||||||
|
|
||||||
|
```bash
|
||||||
|
cd artifacts/postiz-mobile
|
||||||
|
./install-android-sdk.sh
|
||||||
|
```
|
||||||
|
|
||||||
|
Add to `~/.bashrc` or `~/.zshrc`:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
export ANDROID_HOME="$HOME/android-sdk"
|
||||||
|
export PATH="$PATH:$ANDROID_HOME/cmdline-tools/latest/bin:$ANDROID_HOME/platform-tools:$ANDROID_HOME/build-tools/35.0.0"
|
||||||
|
```
|
||||||
|
|
||||||
|
**2. Signing keystore**
|
||||||
|
|
||||||
|
The release keystore is stored at `~/.config/postiz-mobile/postiz-mobile.jks` (not in the repo).
|
||||||
|
|
||||||
|
To export it from EAS (one-time):
|
||||||
|
|
||||||
|
```bash
|
||||||
|
cd artifacts/postiz-mobile
|
||||||
|
eas credentials --platform android
|
||||||
|
# → Keystore: Manage everything → Download existing keystore
|
||||||
|
# Note the key alias and passwords shown during export
|
||||||
|
```
|
||||||
|
|
||||||
|
**3. Signing credentials**
|
||||||
|
|
||||||
|
```bash
|
||||||
|
cp ~/.config/postiz-mobile/signing.env.example ~/.config/postiz-mobile/signing.env
|
||||||
|
$EDITOR ~/.config/postiz-mobile/signing.env
|
||||||
|
```
|
||||||
|
|
||||||
|
Fill in:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
KEYSTORE_PATH="$HOME/.config/postiz-mobile/postiz-mobile.jks"
|
||||||
|
KEYSTORE_ALIAS="<alias shown during export>"
|
||||||
|
KEYSTORE_STORE_PASSWORD="<store password>"
|
||||||
|
KEYSTORE_KEY_PASSWORD="<key password>"
|
||||||
|
```
|
||||||
|
|
||||||
|
### Build
|
||||||
|
|
||||||
|
```bash
|
||||||
|
cd artifacts/postiz-mobile
|
||||||
|
./build-apk.sh # → dist/postiz-mobile-YYYYMMDD-HHMM.apk
|
||||||
|
./build-apk.sh --aab # → dist/postiz-mobile-YYYYMMDD-HHMM.aab (Play Store)
|
||||||
|
```
|
||||||
|
|
||||||
|
The script runs `expo prebuild`, patches `android/app/build.gradle` for release signing, runs Gradle, copies the artifact to `dist/`, then wipes the credentials from `gradle.properties`.
|
||||||
|
|
||||||
|
### Install on device
|
||||||
|
|
||||||
|
```bash
|
||||||
|
adb install dist/postiz-mobile-*.apk
|
||||||
|
```
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## How the build works
|
||||||
|
|
||||||
|
```
|
||||||
|
build-apk.sh
|
||||||
|
├── source ~/.config/postiz-mobile/signing.env
|
||||||
|
├── expo prebuild --platform android --clean
|
||||||
|
│ └── generates android/ from app.json + plugins
|
||||||
|
├── python3 patch: injects release signingConfig into build.gradle
|
||||||
|
├── append MYAPP_UPLOAD_* to gradle.properties
|
||||||
|
├── ./gradlew assembleRelease (or bundleRelease)
|
||||||
|
├── wipe signing block from gradle.properties
|
||||||
|
└── copy APK → dist/
|
||||||
|
```
|
||||||
|
|
||||||
|
The `android/` directory is not committed (gitignored). It is regenerated on each build.
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## App configuration
|
||||||
|
|
||||||
|
On first launch, go to **Settings**:
|
||||||
|
|
||||||
|
1. **Base URL**: `https://your-postiz-instance/api/public/v1`
|
||||||
|
2. **API Key**: generated in Postiz → Settings → API Keys
|
||||||
|
3. Tap **Test Connection**, then **Save Settings**
|
||||||
|
|
||||||
|
The key is encrypted locally via `expo-secure-store` and never sent to third parties.
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## Architecture
|
||||||
|
|
||||||
|
```
|
||||||
|
artifacts/postiz-mobile/
|
||||||
|
├── app/
|
||||||
|
│ ├── _layout.tsx # Root layout: providers, fonts, 401 handler
|
||||||
|
│ └── (tabs)/
|
||||||
|
│ ├── _layout.tsx # Tab bar
|
||||||
|
│ ├── index.tsx # Calendar screen
|
||||||
|
│ ├── posts.tsx # Post list screen
|
||||||
|
│ ├── compose.tsx # Compose screen
|
||||||
|
│ └── settings.tsx # Settings screen
|
||||||
|
├── components/
|
||||||
|
│ ├── ChannelChip.tsx # Channel selector chip
|
||||||
|
│ ├── ErrorBoundary.tsx
|
||||||
|
│ ├── PostCard.tsx # Swipe-to-delete / swipe-to-reschedule
|
||||||
|
│ └── StatusBadge.tsx
|
||||||
|
├── context/
|
||||||
|
│ └── PostizContext.tsx # axios client + SecureStore + 401 interceptor
|
||||||
|
├── hooks/
|
||||||
|
│ ├── useColors.ts
|
||||||
|
│ └── useNotifications.ts # Permission + polling + local notifications
|
||||||
|
├── lib/
|
||||||
|
│ └── extractError.ts # Shared axios/fetch error formatter
|
||||||
|
├── build-apk.sh # Local build script
|
||||||
|
└── install-android-sdk.sh # One-time Android SDK bootstrap
|
||||||
|
```
|
||||||
|
|
||||||
|
### Key dependencies
|
||||||
|
|
||||||
|
| Package | Role |
|
||||||
|
|---------|------|
|
||||||
|
| `expo-router` | File-based navigation |
|
||||||
|
| `axios` | Postiz API HTTP client |
|
||||||
|
| `expo-secure-store` | Encrypted key storage |
|
||||||
|
| `react-native-calendars` | Calendar view |
|
||||||
|
| `@react-native-community/datetimepicker` | Date/time picker |
|
||||||
|
| `expo-image-picker` | Gallery access |
|
||||||
|
| `expo-notifications` | Local status notifications |
|
||||||
|
| `@tanstack/react-query` | API cache + refetch |
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## Postiz API
|
||||||
|
|
||||||
|
| Method | Endpoint | Usage |
|
||||||
|
|--------|----------|-------|
|
||||||
|
| `GET` | `/integrations` | List channels |
|
||||||
|
| `GET` | `/posts?startDate=&endDate=` | Posts over a date range |
|
||||||
|
| `POST` | `/posts` | Create / schedule a post |
|
||||||
|
| `DELETE` | `/posts/:id` | Delete a post |
|
||||||
|
| `POST` | `/upload` | Upload an image (multipart) |
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## Troubleshooting
|
||||||
|
|
||||||
|
**"Not Configured" on all screens** → Settings tab → enter API key and URL → Test Connection.
|
||||||
|
|
||||||
|
**"Connection failed"** → URL must end with `/api/public/v1` — check Postiz is reachable.
|
||||||
|
|
||||||
|
**No notifications** → Accept permissions on first launch. Polling runs every 15 min.
|
||||||
|
|
||||||
|
**Build fails at Gradle** → Make sure `ANDROID_HOME` is set and `./gradlew` is executable (`chmod +x android/gradlew`).
|
||||||
|
|
||||||
|
**`expo prebuild` fails** → Run `pnpm install` from the repo root first.
|
||||||
@@ -21,24 +21,21 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"android": {
|
"android": {
|
||||||
|
"package": "fr.gyozamancave.postizmobile",
|
||||||
"permissions": [
|
"permissions": [
|
||||||
"READ_EXTERNAL_STORAGE",
|
"android.permission.READ_EXTERNAL_STORAGE",
|
||||||
"WRITE_EXTERNAL_STORAGE",
|
"android.permission.WRITE_EXTERNAL_STORAGE",
|
||||||
"READ_MEDIA_IMAGES",
|
"android.permission.READ_MEDIA_IMAGES",
|
||||||
"RECEIVE_BOOT_COMPLETED",
|
"android.permission.RECEIVE_BOOT_COMPLETED",
|
||||||
"VIBRATE"
|
"android.permission.VIBRATE",
|
||||||
|
"android.permission.RECORD_AUDIO"
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
"web": {
|
"web": {
|
||||||
"favicon": "./assets/images/icon.png"
|
"favicon": "./assets/images/icon.png"
|
||||||
},
|
},
|
||||||
"plugins": [
|
"plugins": [
|
||||||
[
|
|
||||||
"expo-router",
|
"expo-router",
|
||||||
{
|
|
||||||
"origin": "https://replit.com/"
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"expo-font",
|
"expo-font",
|
||||||
"expo-web-browser",
|
"expo-web-browser",
|
||||||
"expo-image-picker",
|
"expo-image-picker",
|
||||||
@@ -55,6 +52,11 @@
|
|||||||
"experiments": {
|
"experiments": {
|
||||||
"typedRoutes": true,
|
"typedRoutes": true,
|
||||||
"reactCompiler": true
|
"reactCompiler": true
|
||||||
|
},
|
||||||
|
"extra": {
|
||||||
|
"eas": {
|
||||||
|
"projectId": "aeaaa2bd-3a27-4771-8e39-f2e14fe0e030"
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -13,7 +13,7 @@ function NativeTabLayout() {
|
|||||||
return (
|
return (
|
||||||
<NativeTabs>
|
<NativeTabs>
|
||||||
<NativeTabs.Trigger name="index">
|
<NativeTabs.Trigger name="index">
|
||||||
<Icon sf={{ default: "calendar", selected: "calendar.fill" }} />
|
<Icon sf={{ default: "calendar", selected: "calendar.circle.fill" }} />
|
||||||
<Label>Calendar</Label>
|
<Label>Calendar</Label>
|
||||||
</NativeTabs.Trigger>
|
</NativeTabs.Trigger>
|
||||||
<NativeTabs.Trigger name="posts">
|
<NativeTabs.Trigger name="posts">
|
||||||
|
|||||||
File diff suppressed because it is too large
Load Diff
@@ -1,9 +1,12 @@
|
|||||||
import { Feather } from "@expo/vector-icons";
|
import { Feather } from "@expo/vector-icons";
|
||||||
import { useQuery } from "@tanstack/react-query";
|
import { useQuery } from "@tanstack/react-query";
|
||||||
|
import * as Clipboard from "expo-clipboard";
|
||||||
|
import * as Haptics from "expo-haptics";
|
||||||
import { router } from "expo-router";
|
import { router } from "expo-router";
|
||||||
import React, { useMemo, useState } from "react";
|
import React, { useMemo, useState } from "react";
|
||||||
import {
|
import {
|
||||||
ActivityIndicator,
|
ActivityIndicator,
|
||||||
|
Alert,
|
||||||
FlatList,
|
FlatList,
|
||||||
Platform,
|
Platform,
|
||||||
StyleSheet,
|
StyleSheet,
|
||||||
@@ -16,6 +19,7 @@ import { useSafeAreaInsets } from "react-native-safe-area-context";
|
|||||||
import { PostizPost, usePostiz } from "@/context/PostizContext";
|
import { PostizPost, usePostiz } from "@/context/PostizContext";
|
||||||
import { useColors } from "@/hooks/useColors";
|
import { useColors } from "@/hooks/useColors";
|
||||||
import { StatusBadge } from "@/components/StatusBadge";
|
import { StatusBadge } from "@/components/StatusBadge";
|
||||||
|
import { extractError } from "@/lib/extractError";
|
||||||
|
|
||||||
function formatDate(date: Date): string {
|
function formatDate(date: Date): string {
|
||||||
const y = date.getFullYear();
|
const y = date.getFullYear();
|
||||||
@@ -46,14 +50,45 @@ export default function CalendarScreen() {
|
|||||||
const insets = useSafeAreaInsets();
|
const insets = useSafeAreaInsets();
|
||||||
const { client, isConfigured } = usePostiz();
|
const { client, isConfigured } = usePostiz();
|
||||||
|
|
||||||
|
const showContextMenu = (post: PostizPost) => {
|
||||||
|
Haptics.impactAsync(Haptics.ImpactFeedbackStyle.Medium);
|
||||||
|
const preview = post.content.slice(0, 60) + (post.content.length > 60 ? "…" : "");
|
||||||
|
const integrations = post.integrations ?? (post.integration ? [post.integration] : []);
|
||||||
|
Alert.alert(
|
||||||
|
post.state === "PUBLISHED" ? "Published post" :
|
||||||
|
post.state === "QUEUE" ? "Scheduled post" :
|
||||||
|
post.state === "ERROR" ? "Failed post" : "Draft",
|
||||||
|
preview,
|
||||||
|
[
|
||||||
|
{
|
||||||
|
text: "Copy text",
|
||||||
|
onPress: () => {
|
||||||
|
Clipboard.setStringAsync(post.content);
|
||||||
|
Haptics.notificationAsync(Haptics.NotificationFeedbackType.Success);
|
||||||
|
},
|
||||||
|
},
|
||||||
|
{
|
||||||
|
text: post.state === "PUBLISHED" ? "Repost" : "Edit",
|
||||||
|
onPress: () =>
|
||||||
|
router.push({
|
||||||
|
pathname: "/(tabs)/compose",
|
||||||
|
params: {
|
||||||
|
prefillContent: post.content,
|
||||||
|
prefillIntegrationIds: integrations.map((i) => i.id).join(","),
|
||||||
|
},
|
||||||
|
}),
|
||||||
|
},
|
||||||
|
{ text: "Cancel", style: "cancel" },
|
||||||
|
]
|
||||||
|
);
|
||||||
|
};
|
||||||
|
|
||||||
const now = new Date();
|
const now = new Date();
|
||||||
const [currentMonth, setCurrentMonth] = useState({
|
const [currentMonth, setCurrentMonth] = useState({
|
||||||
year: now.getFullYear(),
|
year: now.getFullYear(),
|
||||||
month: now.getMonth() + 1,
|
month: now.getMonth() + 1,
|
||||||
});
|
});
|
||||||
const [selectedDay, setSelectedDay] = useState<string | null>(
|
const [selectedDay, setSelectedDay] = useState<string | null>(formatDate(now));
|
||||||
formatDate(now)
|
|
||||||
);
|
|
||||||
|
|
||||||
const startDate = useMemo(() => {
|
const startDate = useMemo(() => {
|
||||||
const d = new Date(currentMonth.year, currentMonth.month - 1, 1);
|
const d = new Date(currentMonth.year, currentMonth.month - 1, 1);
|
||||||
@@ -66,16 +101,17 @@ export default function CalendarScreen() {
|
|||||||
}, [currentMonth]);
|
}, [currentMonth]);
|
||||||
|
|
||||||
const { data: posts, isLoading, error, refetch } = useQuery<PostizPost[]>({
|
const { data: posts, isLoading, error, refetch } = useQuery<PostizPost[]>({
|
||||||
queryKey: ["posts", startDate, endDate],
|
queryKey: ["posts", startDate, endDate, !!client],
|
||||||
queryFn: async () => {
|
queryFn: async () => {
|
||||||
if (!client) return [];
|
if (!client) return [];
|
||||||
const res = await client.get("/posts", {
|
const res = await client.get("posts", {
|
||||||
params: { startDate, endDate },
|
params: { startDate, endDate },
|
||||||
});
|
});
|
||||||
return Array.isArray(res.data) ? res.data : res.data?.posts ?? [];
|
return Array.isArray(res.data) ? res.data : res.data?.posts ?? [];
|
||||||
},
|
},
|
||||||
enabled: !!client,
|
enabled: !!client,
|
||||||
retry: 1,
|
retry: 1,
|
||||||
|
staleTime: 0,
|
||||||
});
|
});
|
||||||
|
|
||||||
const markedDates = useMemo(() => {
|
const markedDates = useMemo(() => {
|
||||||
@@ -89,9 +125,9 @@ export default function CalendarScreen() {
|
|||||||
const key = toDateKey(post.publishDate);
|
const key = toDateKey(post.publishDate);
|
||||||
if (!marks[key]) marks[key] = { dots: [] };
|
if (!marks[key]) marks[key] = { dots: [] };
|
||||||
const dotColor =
|
const dotColor =
|
||||||
post.status === "PUBLISHED"
|
post.state === "PUBLISHED"
|
||||||
? colors.success
|
? colors.success
|
||||||
: post.status === "ERROR"
|
: post.state === "ERROR"
|
||||||
? colors.error
|
? colors.error
|
||||||
: colors.primary;
|
: colors.primary;
|
||||||
marks[key].dots = [...(marks[key].dots ?? []), { color: dotColor }];
|
marks[key].dots = [...(marks[key].dots ?? []), { color: dotColor }];
|
||||||
@@ -189,6 +225,9 @@ export default function CalendarScreen() {
|
|||||||
<Text style={[styles.emptyText, { color: colors.mutedForeground }]}>
|
<Text style={[styles.emptyText, { color: colors.mutedForeground }]}>
|
||||||
Failed to load posts
|
Failed to load posts
|
||||||
</Text>
|
</Text>
|
||||||
|
<Text style={[styles.emptyText, { color: colors.error, fontSize: 11 }]} selectable>
|
||||||
|
{extractError(error)}
|
||||||
|
</Text>
|
||||||
<TouchableOpacity onPress={() => refetch()} style={styles.retryBtn}>
|
<TouchableOpacity onPress={() => refetch()} style={styles.retryBtn}>
|
||||||
<Text style={[styles.retryText, { color: colors.primary }]}>Retry</Text>
|
<Text style={[styles.retryText, { color: colors.primary }]}>Retry</Text>
|
||||||
</TouchableOpacity>
|
</TouchableOpacity>
|
||||||
@@ -232,11 +271,9 @@ export default function CalendarScreen() {
|
|||||||
}
|
}
|
||||||
renderItem={({ item }) => (
|
renderItem={({ item }) => (
|
||||||
<TouchableOpacity
|
<TouchableOpacity
|
||||||
style={[
|
style={[styles.dayPost, { borderBottomColor: colors.border }]}
|
||||||
styles.dayPost,
|
|
||||||
{ borderBottomColor: colors.border },
|
|
||||||
]}
|
|
||||||
activeOpacity={0.7}
|
activeOpacity={0.7}
|
||||||
|
onPress={() => showContextMenu(item)}
|
||||||
>
|
>
|
||||||
<View style={styles.dayPostLeft}>
|
<View style={styles.dayPostLeft}>
|
||||||
<Text style={[styles.timeText, { color: colors.primary }]}>
|
<Text style={[styles.timeText, { color: colors.primary }]}>
|
||||||
@@ -249,7 +286,7 @@ export default function CalendarScreen() {
|
|||||||
{item.content}
|
{item.content}
|
||||||
</Text>
|
</Text>
|
||||||
</View>
|
</View>
|
||||||
<StatusBadge status={item.status} />
|
<StatusBadge status={item.state} />
|
||||||
</TouchableOpacity>
|
</TouchableOpacity>
|
||||||
)}
|
)}
|
||||||
scrollEnabled={dayPosts.length > 0}
|
scrollEnabled={dayPosts.length > 0}
|
||||||
@@ -261,9 +298,7 @@ export default function CalendarScreen() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
const styles = StyleSheet.create({
|
const styles = StyleSheet.create({
|
||||||
container: {
|
container: { flex: 1 },
|
||||||
flex: 1,
|
|
||||||
},
|
|
||||||
centered: {
|
centered: {
|
||||||
flex: 1,
|
flex: 1,
|
||||||
alignItems: "center",
|
alignItems: "center",
|
||||||
@@ -271,28 +306,11 @@ const styles = StyleSheet.create({
|
|||||||
gap: 10,
|
gap: 10,
|
||||||
paddingHorizontal: 32,
|
paddingHorizontal: 32,
|
||||||
},
|
},
|
||||||
emptyTitle: {
|
emptyTitle: { fontSize: 18, fontFamily: "Inter_600SemiBold" },
|
||||||
fontSize: 18,
|
emptyText: { fontSize: 14, fontFamily: "Inter_400Regular", textAlign: "center" },
|
||||||
fontFamily: "Inter_600SemiBold",
|
btn: { marginTop: 8, paddingHorizontal: 20, paddingVertical: 10, borderRadius: 10 },
|
||||||
},
|
btnText: { fontSize: 14, fontFamily: "Inter_600SemiBold" },
|
||||||
emptyText: {
|
divider: { height: StyleSheet.hairlineWidth },
|
||||||
fontSize: 14,
|
|
||||||
fontFamily: "Inter_400Regular",
|
|
||||||
textAlign: "center",
|
|
||||||
},
|
|
||||||
btn: {
|
|
||||||
marginTop: 8,
|
|
||||||
paddingHorizontal: 20,
|
|
||||||
paddingVertical: 10,
|
|
||||||
borderRadius: 10,
|
|
||||||
},
|
|
||||||
btnText: {
|
|
||||||
fontSize: 14,
|
|
||||||
fontFamily: "Inter_600SemiBold",
|
|
||||||
},
|
|
||||||
divider: {
|
|
||||||
height: StyleSheet.hairlineWidth,
|
|
||||||
},
|
|
||||||
dayHeader: {
|
dayHeader: {
|
||||||
flexDirection: "row",
|
flexDirection: "row",
|
||||||
justifyContent: "space-between",
|
justifyContent: "space-between",
|
||||||
@@ -300,14 +318,8 @@ const styles = StyleSheet.create({
|
|||||||
paddingHorizontal: 20,
|
paddingHorizontal: 20,
|
||||||
paddingVertical: 12,
|
paddingVertical: 12,
|
||||||
},
|
},
|
||||||
dayHeaderText: {
|
dayHeaderText: { fontSize: 13, fontFamily: "Inter_500Medium" },
|
||||||
fontSize: 13,
|
countText: { fontSize: 12, fontFamily: "Inter_400Regular" },
|
||||||
fontFamily: "Inter_500Medium",
|
|
||||||
},
|
|
||||||
countText: {
|
|
||||||
fontSize: 12,
|
|
||||||
fontFamily: "Inter_400Regular",
|
|
||||||
},
|
|
||||||
dayPost: {
|
dayPost: {
|
||||||
flexDirection: "row",
|
flexDirection: "row",
|
||||||
alignItems: "flex-start",
|
alignItems: "flex-start",
|
||||||
@@ -316,42 +328,13 @@ const styles = StyleSheet.create({
|
|||||||
borderBottomWidth: StyleSheet.hairlineWidth,
|
borderBottomWidth: StyleSheet.hairlineWidth,
|
||||||
gap: 12,
|
gap: 12,
|
||||||
},
|
},
|
||||||
dayPostLeft: {
|
dayPostLeft: { flex: 1, gap: 4 },
|
||||||
flex: 1,
|
timeText: { fontSize: 12, fontFamily: "Inter_600SemiBold" },
|
||||||
gap: 4,
|
postContent: { fontSize: 13, fontFamily: "Inter_400Regular", lineHeight: 18 },
|
||||||
},
|
emptyDay: { alignItems: "center", paddingTop: 32, gap: 10 },
|
||||||
timeText: {
|
emptyDayText: { fontSize: 14, fontFamily: "Inter_400Regular" },
|
||||||
fontSize: 12,
|
composeHint: { flexDirection: "row", alignItems: "center", gap: 6 },
|
||||||
fontFamily: "Inter_600SemiBold",
|
composeHintText: { fontSize: 14, fontFamily: "Inter_500Medium" },
|
||||||
},
|
retryBtn: { marginTop: 4 },
|
||||||
postContent: {
|
retryText: { fontSize: 14, fontFamily: "Inter_500Medium" },
|
||||||
fontSize: 13,
|
|
||||||
fontFamily: "Inter_400Regular",
|
|
||||||
lineHeight: 18,
|
|
||||||
},
|
|
||||||
emptyDay: {
|
|
||||||
alignItems: "center",
|
|
||||||
paddingTop: 32,
|
|
||||||
gap: 10,
|
|
||||||
},
|
|
||||||
emptyDayText: {
|
|
||||||
fontSize: 14,
|
|
||||||
fontFamily: "Inter_400Regular",
|
|
||||||
},
|
|
||||||
composeHint: {
|
|
||||||
flexDirection: "row",
|
|
||||||
alignItems: "center",
|
|
||||||
gap: 6,
|
|
||||||
},
|
|
||||||
composeHintText: {
|
|
||||||
fontSize: 14,
|
|
||||||
fontFamily: "Inter_500Medium",
|
|
||||||
},
|
|
||||||
retryBtn: {
|
|
||||||
marginTop: 4,
|
|
||||||
},
|
|
||||||
retryText: {
|
|
||||||
fontSize: 14,
|
|
||||||
fontFamily: "Inter_500Medium",
|
|
||||||
},
|
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -1,8 +1,14 @@
|
|||||||
import { Feather } from "@expo/vector-icons";
|
import { Feather } from "@expo/vector-icons";
|
||||||
|
import DateTimePicker from "@react-native-community/datetimepicker";
|
||||||
import { useQuery, useQueryClient } from "@tanstack/react-query";
|
import { useQuery, useQueryClient } from "@tanstack/react-query";
|
||||||
import React, { useState } from "react";
|
import AsyncStorage from "@react-native-async-storage/async-storage";
|
||||||
|
import * as Clipboard from "expo-clipboard";
|
||||||
|
import * as Haptics from "expo-haptics";
|
||||||
|
import { useRouter } from "expo-router";
|
||||||
|
import React, { useEffect, useMemo, useState } from "react";
|
||||||
import {
|
import {
|
||||||
ActivityIndicator,
|
ActivityIndicator,
|
||||||
|
Alert,
|
||||||
FlatList,
|
FlatList,
|
||||||
Platform,
|
Platform,
|
||||||
RefreshControl,
|
RefreshControl,
|
||||||
@@ -15,6 +21,10 @@ import { useSafeAreaInsets } from "react-native-safe-area-context";
|
|||||||
import { PostCard } from "@/components/PostCard";
|
import { PostCard } from "@/components/PostCard";
|
||||||
import { PostizPost, usePostiz } from "@/context/PostizContext";
|
import { PostizPost, usePostiz } from "@/context/PostizContext";
|
||||||
import { useColors } from "@/hooks/useColors";
|
import { useColors } from "@/hooks/useColors";
|
||||||
|
import { extractError } from "@/lib/extractError";
|
||||||
|
import { stripHtml } from "@/lib/stripHtml";
|
||||||
|
|
||||||
|
const SORT_STORAGE_KEY = "postiz_posts_sort";
|
||||||
|
|
||||||
type FilterType = "all" | "QUEUE" | "PUBLISHED" | "ERROR" | "DRAFT";
|
type FilterType = "all" | "QUEUE" | "PUBLISHED" | "ERROR" | "DRAFT";
|
||||||
|
|
||||||
@@ -31,34 +41,72 @@ export default function PostsScreen() {
|
|||||||
const insets = useSafeAreaInsets();
|
const insets = useSafeAreaInsets();
|
||||||
const { client, isConfigured } = usePostiz();
|
const { client, isConfigured } = usePostiz();
|
||||||
const queryClient = useQueryClient();
|
const queryClient = useQueryClient();
|
||||||
|
const router = useRouter();
|
||||||
const [filter, setFilter] = useState<FilterType>("all");
|
const [filter, setFilter] = useState<FilterType>("all");
|
||||||
|
const [sortOrder, setSortOrder] = useState<"desc" | "asc">("desc");
|
||||||
const [refreshing, setRefreshing] = useState(false);
|
const [refreshing, setRefreshing] = useState(false);
|
||||||
|
const [copyToast, setCopyToast] = useState(false);
|
||||||
|
|
||||||
const start = new Date();
|
useEffect(() => {
|
||||||
start.setMonth(start.getMonth() - 3);
|
AsyncStorage.getItem(SORT_STORAGE_KEY).then((v) => {
|
||||||
const end = new Date();
|
if (v === "asc" || v === "desc") setSortOrder(v);
|
||||||
end.setMonth(end.getMonth() + 6);
|
});
|
||||||
|
}, []);
|
||||||
|
|
||||||
|
const toggleSort = () => {
|
||||||
|
const next = sortOrder === "desc" ? "asc" : "desc";
|
||||||
|
setSortOrder(next);
|
||||||
|
AsyncStorage.setItem(SORT_STORAGE_KEY, next);
|
||||||
|
};
|
||||||
|
|
||||||
|
// reschedule state
|
||||||
|
const [reschedulePost, setReschedulePost] = useState<PostizPost | null>(null);
|
||||||
|
const [rescheduleDate, setRescheduleDate] = useState(new Date());
|
||||||
|
const [rescheduleStep, setRescheduleStep] = useState<"date" | "time" | null>(null);
|
||||||
|
|
||||||
|
const { startDate, endDate } = useMemo(() => {
|
||||||
|
const s = new Date();
|
||||||
|
s.setMonth(s.getMonth() - 3);
|
||||||
|
const e = new Date();
|
||||||
|
e.setMonth(e.getMonth() + 6);
|
||||||
|
return { startDate: s.toISOString(), endDate: e.toISOString() };
|
||||||
|
}, []);
|
||||||
|
|
||||||
const { data: posts, isLoading, error, refetch } = useQuery<PostizPost[]>({
|
const { data: posts, isLoading, error, refetch } = useQuery<PostizPost[]>({
|
||||||
queryKey: ["posts-list"],
|
queryKey: ["posts-list", !!client, startDate, endDate],
|
||||||
queryFn: async () => {
|
queryFn: async () => {
|
||||||
if (!client) return [];
|
if (!client) return [];
|
||||||
const res = await client.get("/posts", {
|
const res = await client.get("posts", {
|
||||||
params: {
|
params: { startDate, endDate },
|
||||||
startDate: start.toISOString(),
|
|
||||||
endDate: end.toISOString(),
|
|
||||||
},
|
|
||||||
});
|
});
|
||||||
return Array.isArray(res.data) ? res.data : res.data?.posts ?? [];
|
return Array.isArray(res.data) ? res.data : res.data?.posts ?? [];
|
||||||
},
|
},
|
||||||
enabled: !!client,
|
enabled: !!client,
|
||||||
retry: 1,
|
retry: 1,
|
||||||
|
staleTime: 0,
|
||||||
});
|
});
|
||||||
|
|
||||||
const filteredPosts =
|
const filteredPosts = useMemo(() => {
|
||||||
|
const list =
|
||||||
filter === "all"
|
filter === "all"
|
||||||
? posts ?? []
|
? posts ?? []
|
||||||
: (posts ?? []).filter((p) => p.status === filter);
|
: (posts ?? []).filter((p) => p.state === filter);
|
||||||
|
return [...list].sort((a, b) => {
|
||||||
|
const diff = new Date(a.publishDate).getTime() - new Date(b.publishDate).getTime();
|
||||||
|
return sortOrder === "desc" ? -diff : diff;
|
||||||
|
});
|
||||||
|
}, [posts, filter, sortOrder]);
|
||||||
|
|
||||||
|
const filterCounts = useMemo(() => {
|
||||||
|
const all = posts ?? [];
|
||||||
|
return {
|
||||||
|
all: all.length,
|
||||||
|
QUEUE: all.filter((p) => p.state === "QUEUE").length,
|
||||||
|
PUBLISHED: all.filter((p) => p.state === "PUBLISHED").length,
|
||||||
|
DRAFT: all.filter((p) => p.state === "DRAFT").length,
|
||||||
|
ERROR: all.filter((p) => p.state === "ERROR").length,
|
||||||
|
};
|
||||||
|
}, [posts]);
|
||||||
|
|
||||||
const handleRefresh = async () => {
|
const handleRefresh = async () => {
|
||||||
setRefreshing(true);
|
setRefreshing(true);
|
||||||
@@ -69,15 +117,128 @@ export default function PostsScreen() {
|
|||||||
const handleDelete = async (id: string) => {
|
const handleDelete = async (id: string) => {
|
||||||
if (!client) return;
|
if (!client) return;
|
||||||
try {
|
try {
|
||||||
await client.delete(`/posts/${id}`);
|
await client.delete(`posts/${id}`);
|
||||||
queryClient.setQueryData<PostizPost[]>(["posts-list"], (old) =>
|
queryClient.invalidateQueries({ queryKey: ["posts-list"] });
|
||||||
(old ?? []).filter((p) => p.id !== id)
|
|
||||||
);
|
|
||||||
queryClient.invalidateQueries({ queryKey: ["posts"] });
|
queryClient.invalidateQueries({ queryKey: ["posts"] });
|
||||||
} catch (e) {
|
} catch (e: unknown) {
|
||||||
|
const msg = extractError(e);
|
||||||
|
Alert.alert("Delete failed", msg);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
const handleRetry = async (post: PostizPost) => {
|
||||||
|
if (!client) return;
|
||||||
|
const integrations = post.integrations ?? (post.integration ? [post.integration] : []);
|
||||||
|
try {
|
||||||
|
const payload = {
|
||||||
|
type: "now",
|
||||||
|
date: new Date().toISOString(),
|
||||||
|
shortLink: false,
|
||||||
|
tags: [] as string[],
|
||||||
|
posts: integrations.map((intg) => ({
|
||||||
|
integration: { id: intg.id },
|
||||||
|
value: [{ content: post.content, id: "", image: post.image ?? [] }],
|
||||||
|
})),
|
||||||
|
};
|
||||||
|
await client.post("posts", payload);
|
||||||
|
Haptics.notificationAsync(Haptics.NotificationFeedbackType.Success);
|
||||||
|
queryClient.invalidateQueries({ queryKey: ["posts-list"] });
|
||||||
|
Alert.alert("Retried", "Post submitted again.");
|
||||||
|
} catch (e: unknown) {
|
||||||
|
const msg = extractError(e);
|
||||||
|
Alert.alert("Retry failed", msg);
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
const handlePrefillCompose = (post: PostizPost) => {
|
||||||
|
const integrations = post.integrations ?? (post.integration ? [post.integration] : []);
|
||||||
|
const params: Record<string, string> = {
|
||||||
|
prefillContent: stripHtml(post.content),
|
||||||
|
prefillIntegrationIds: integrations.map((i) => i.id).join(","),
|
||||||
|
};
|
||||||
|
if (post.image?.length) {
|
||||||
|
params.prefillImages = JSON.stringify(post.image);
|
||||||
|
}
|
||||||
|
router.push({ pathname: "/(tabs)/compose", params });
|
||||||
|
};
|
||||||
|
|
||||||
|
const startReschedule = (post: PostizPost) => {
|
||||||
|
setReschedulePost(post);
|
||||||
|
setRescheduleDate(new Date(post.publishDate));
|
||||||
|
setRescheduleStep("date");
|
||||||
|
};
|
||||||
|
|
||||||
|
const submitReschedule = async (post: PostizPost, date: Date) => {
|
||||||
|
if (!client) return;
|
||||||
|
const integrations = post.integrations ?? (post.integration ? [post.integration] : []);
|
||||||
|
try {
|
||||||
|
await client.delete(`posts/${post.id}`);
|
||||||
|
await client.post("posts", {
|
||||||
|
type: "schedule",
|
||||||
|
date: date.toISOString(),
|
||||||
|
shortLink: false,
|
||||||
|
tags: [] as string[],
|
||||||
|
posts: integrations.map((intg) => ({
|
||||||
|
integration: { id: intg.id },
|
||||||
|
value: [{ content: post.content, image: post.image ?? [] }],
|
||||||
|
})),
|
||||||
|
});
|
||||||
|
queryClient.invalidateQueries({ queryKey: ["posts-list"] });
|
||||||
|
Haptics.notificationAsync(Haptics.NotificationFeedbackType.Success);
|
||||||
|
Alert.alert("Rescheduled", `Post moved to ${date.toLocaleDateString("en-US", { month: "short", day: "numeric", hour: "2-digit", minute: "2-digit" })}`);
|
||||||
|
} catch (e: unknown) {
|
||||||
|
const msg = extractError(e);
|
||||||
|
Alert.alert("Reschedule failed", msg);
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
const showContextMenu = (post: PostizPost) => {
|
||||||
|
Haptics.impactAsync(Haptics.ImpactFeedbackStyle.Medium);
|
||||||
|
|
||||||
|
const plain = stripHtml(post.content);
|
||||||
|
const preview = plain.slice(0, 60) + (plain.length > 60 ? "…" : "");
|
||||||
|
|
||||||
|
const buttons: Array<{ text: string; style?: "cancel" | "destructive" | "default"; onPress?: () => void }> = [];
|
||||||
|
|
||||||
|
buttons.push({
|
||||||
|
text: "Copy text",
|
||||||
|
onPress: async () => {
|
||||||
|
await Clipboard.setStringAsync(stripHtml(post.content));
|
||||||
|
Haptics.notificationAsync(Haptics.NotificationFeedbackType.Success);
|
||||||
|
setCopyToast(true);
|
||||||
|
setTimeout(() => setCopyToast(false), 2000);
|
||||||
|
},
|
||||||
|
});
|
||||||
|
|
||||||
|
if (post.state === "ERROR") {
|
||||||
|
if (post.errorMessage) {
|
||||||
|
buttons.push({
|
||||||
|
text: "View error",
|
||||||
|
onPress: () => Alert.alert("Error details", post.errorMessage),
|
||||||
|
});
|
||||||
|
}
|
||||||
|
buttons.push({ text: "Retry now", onPress: () => handleRetry(post) });
|
||||||
|
buttons.push({ text: "Edit & retry", onPress: () => handlePrefillCompose(post) });
|
||||||
|
} else if (post.state === "QUEUE") {
|
||||||
|
buttons.push({ text: "Edit", onPress: () => handlePrefillCompose(post) });
|
||||||
|
buttons.push({ text: "Reschedule", onPress: () => startReschedule(post) });
|
||||||
|
} else if (post.state === "PUBLISHED") {
|
||||||
|
buttons.push({ text: "Repost", onPress: () => handlePrefillCompose(post) });
|
||||||
|
} else if (post.state === "DRAFT") {
|
||||||
|
buttons.push({ text: "Edit & schedule", onPress: () => handlePrefillCompose(post) });
|
||||||
|
}
|
||||||
|
|
||||||
|
buttons.push({ text: "Cancel", style: "cancel" });
|
||||||
|
|
||||||
|
Alert.alert(
|
||||||
|
post.state === "ERROR" ? "Failed post" :
|
||||||
|
post.state === "QUEUE" ? "Scheduled post" :
|
||||||
|
post.state === "PUBLISHED" ? "Published post" : "Draft",
|
||||||
|
preview,
|
||||||
|
buttons
|
||||||
|
);
|
||||||
|
};
|
||||||
|
|
||||||
if (!isConfigured) {
|
if (!isConfigured) {
|
||||||
return (
|
return (
|
||||||
<View
|
<View
|
||||||
@@ -107,43 +268,61 @@ export default function PostsScreen() {
|
|||||||
},
|
},
|
||||||
]}
|
]}
|
||||||
>
|
>
|
||||||
|
<View style={[styles.filterRow, { borderBottomColor: colors.border }]}>
|
||||||
<FlatList
|
<FlatList
|
||||||
horizontal
|
horizontal
|
||||||
data={FILTERS}
|
data={FILTERS}
|
||||||
keyExtractor={(item) => item.key}
|
keyExtractor={(item) => item.key}
|
||||||
showsHorizontalScrollIndicator={false}
|
showsHorizontalScrollIndicator={false}
|
||||||
contentContainerStyle={styles.filterList}
|
contentContainerStyle={styles.filterList}
|
||||||
renderItem={({ item }) => (
|
renderItem={({ item }) => {
|
||||||
|
const count = posts ? filterCounts[item.key] : undefined;
|
||||||
|
const active = filter === item.key;
|
||||||
|
return (
|
||||||
<TouchableOpacity
|
<TouchableOpacity
|
||||||
onPress={() => setFilter(item.key)}
|
onPress={() => setFilter(item.key)}
|
||||||
activeOpacity={0.7}
|
activeOpacity={0.7}
|
||||||
style={[
|
style={[
|
||||||
styles.filterChip,
|
styles.filterChip,
|
||||||
{
|
{
|
||||||
backgroundColor:
|
backgroundColor: active ? colors.primary : colors.secondary,
|
||||||
filter === item.key ? colors.primary : colors.secondary,
|
borderColor: active ? colors.primary : colors.border,
|
||||||
borderColor:
|
|
||||||
filter === item.key ? colors.primary : colors.border,
|
|
||||||
},
|
},
|
||||||
]}
|
]}
|
||||||
>
|
>
|
||||||
<Text
|
<Text
|
||||||
style={[
|
style={[
|
||||||
styles.filterText,
|
styles.filterText,
|
||||||
{
|
{ color: active ? colors.primaryForeground : colors.mutedForeground },
|
||||||
color:
|
|
||||||
filter === item.key
|
|
||||||
? colors.primaryForeground
|
|
||||||
: colors.mutedForeground,
|
|
||||||
},
|
|
||||||
]}
|
]}
|
||||||
>
|
>
|
||||||
{item.label}
|
{item.label}
|
||||||
|
{count !== undefined && count > 0 ? ` ${count}` : ""}
|
||||||
</Text>
|
</Text>
|
||||||
</TouchableOpacity>
|
</TouchableOpacity>
|
||||||
)}
|
);
|
||||||
style={[styles.filterBar, { borderBottomColor: colors.border }]}
|
}}
|
||||||
|
style={styles.filterBar}
|
||||||
/>
|
/>
|
||||||
|
<TouchableOpacity
|
||||||
|
onPress={toggleSort}
|
||||||
|
activeOpacity={0.7}
|
||||||
|
style={[styles.sortBtn, { borderColor: colors.border, backgroundColor: colors.secondary }]}
|
||||||
|
>
|
||||||
|
<Feather
|
||||||
|
name={sortOrder === "desc" ? "arrow-down" : "arrow-up"}
|
||||||
|
size={14}
|
||||||
|
color={colors.mutedForeground}
|
||||||
|
/>
|
||||||
|
</TouchableOpacity>
|
||||||
|
</View>
|
||||||
|
|
||||||
|
{copyToast && (
|
||||||
|
<View style={[styles.toast, { backgroundColor: colors.success }]}>
|
||||||
|
<Feather name="check" size={13} color="#fff" />
|
||||||
|
<Text style={styles.toastText}>Copied</Text>
|
||||||
|
</View>
|
||||||
|
)}
|
||||||
|
|
||||||
{isLoading ? (
|
{isLoading ? (
|
||||||
<View style={styles.centered}>
|
<View style={styles.centered}>
|
||||||
@@ -155,6 +334,9 @@ export default function PostsScreen() {
|
|||||||
<Text style={[styles.emptyTitle, { color: colors.foreground }]}>
|
<Text style={[styles.emptyTitle, { color: colors.foreground }]}>
|
||||||
Failed to load
|
Failed to load
|
||||||
</Text>
|
</Text>
|
||||||
|
<Text style={[styles.emptyText, { color: colors.mutedForeground }]} selectable>
|
||||||
|
{extractError(error)}
|
||||||
|
</Text>
|
||||||
<TouchableOpacity
|
<TouchableOpacity
|
||||||
onPress={() => refetch()}
|
onPress={() => refetch()}
|
||||||
style={[styles.retryBtn, { backgroundColor: colors.primary }]}
|
style={[styles.retryBtn, { backgroundColor: colors.primary }]}
|
||||||
@@ -169,7 +351,12 @@ export default function PostsScreen() {
|
|||||||
data={filteredPosts}
|
data={filteredPosts}
|
||||||
keyExtractor={(item) => item.id}
|
keyExtractor={(item) => item.id}
|
||||||
renderItem={({ item }) => (
|
renderItem={({ item }) => (
|
||||||
<PostCard post={item} onDelete={handleDelete} />
|
<PostCard
|
||||||
|
post={item}
|
||||||
|
onDelete={handleDelete}
|
||||||
|
onLongPress={showContextMenu}
|
||||||
|
onReschedule={startReschedule}
|
||||||
|
/>
|
||||||
)}
|
)}
|
||||||
refreshControl={
|
refreshControl={
|
||||||
<RefreshControl
|
<RefreshControl
|
||||||
@@ -196,14 +383,43 @@ export default function PostsScreen() {
|
|||||||
scrollEnabled={filteredPosts.length > 0}
|
scrollEnabled={filteredPosts.length > 0}
|
||||||
/>
|
/>
|
||||||
)}
|
)}
|
||||||
|
|
||||||
|
{rescheduleStep !== null && reschedulePost !== null && (
|
||||||
|
<DateTimePicker
|
||||||
|
value={rescheduleDate}
|
||||||
|
mode={rescheduleStep}
|
||||||
|
display="default"
|
||||||
|
minimumDate={rescheduleStep === "date" ? new Date() : undefined}
|
||||||
|
textColor={colors.foreground}
|
||||||
|
accentColor={colors.primary}
|
||||||
|
onChange={(_: unknown, date?: Date) => {
|
||||||
|
if (!date) {
|
||||||
|
setRescheduleStep(null);
|
||||||
|
setReschedulePost(null);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
if (rescheduleStep === "date") {
|
||||||
|
const merged = new Date(rescheduleDate);
|
||||||
|
merged.setFullYear(date.getFullYear(), date.getMonth(), date.getDate());
|
||||||
|
setRescheduleDate(merged);
|
||||||
|
setRescheduleStep("time");
|
||||||
|
} else {
|
||||||
|
const merged = new Date(rescheduleDate);
|
||||||
|
merged.setHours(date.getHours(), date.getMinutes());
|
||||||
|
const post = reschedulePost;
|
||||||
|
setRescheduleStep(null);
|
||||||
|
setReschedulePost(null);
|
||||||
|
submitReschedule(post, merged);
|
||||||
|
}
|
||||||
|
}}
|
||||||
|
/>
|
||||||
|
)}
|
||||||
</View>
|
</View>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
const styles = StyleSheet.create({
|
const styles = StyleSheet.create({
|
||||||
container: {
|
container: { flex: 1 },
|
||||||
flex: 1,
|
|
||||||
},
|
|
||||||
centered: {
|
centered: {
|
||||||
flex: 1,
|
flex: 1,
|
||||||
alignItems: "center",
|
alignItems: "center",
|
||||||
@@ -211,47 +427,28 @@ const styles = StyleSheet.create({
|
|||||||
gap: 10,
|
gap: 10,
|
||||||
paddingHorizontal: 32,
|
paddingHorizontal: 32,
|
||||||
},
|
},
|
||||||
filterBar: {
|
filterRow: { flexDirection: "row", alignItems: "center", borderBottomWidth: StyleSheet.hairlineWidth },
|
||||||
borderBottomWidth: StyleSheet.hairlineWidth,
|
filterBar: { flex: 1 },
|
||||||
flexGrow: 0,
|
filterList: { paddingHorizontal: 16, paddingVertical: 10, gap: 8 },
|
||||||
},
|
filterChip: { paddingHorizontal: 14, paddingVertical: 6, borderRadius: 20, borderWidth: 1 },
|
||||||
filterList: {
|
sortBtn: { marginRight: 12, padding: 7, borderRadius: 8, borderWidth: 1 },
|
||||||
paddingHorizontal: 16,
|
filterText: { fontSize: 13, fontFamily: "Inter_500Medium" },
|
||||||
paddingVertical: 10,
|
emptyState: { alignItems: "center", paddingTop: 64, gap: 10 },
|
||||||
gap: 8,
|
emptyTitle: { fontSize: 18, fontFamily: "Inter_600SemiBold" },
|
||||||
},
|
emptyText: { fontSize: 14, fontFamily: "Inter_400Regular", textAlign: "center" },
|
||||||
filterChip: {
|
retryBtn: { marginTop: 4, paddingHorizontal: 20, paddingVertical: 10, borderRadius: 10 },
|
||||||
paddingHorizontal: 14,
|
retryText: { fontSize: 14, fontFamily: "Inter_600SemiBold" },
|
||||||
paddingVertical: 6,
|
toast: {
|
||||||
borderRadius: 20,
|
position: "absolute",
|
||||||
borderWidth: 1,
|
bottom: 100,
|
||||||
},
|
alignSelf: "center",
|
||||||
filterText: {
|
flexDirection: "row",
|
||||||
fontSize: 13,
|
|
||||||
fontFamily: "Inter_500Medium",
|
|
||||||
},
|
|
||||||
emptyState: {
|
|
||||||
alignItems: "center",
|
alignItems: "center",
|
||||||
paddingTop: 64,
|
gap: 6,
|
||||||
gap: 10,
|
paddingHorizontal: 14,
|
||||||
},
|
paddingVertical: 8,
|
||||||
emptyTitle: {
|
borderRadius: 20,
|
||||||
fontSize: 18,
|
zIndex: 999,
|
||||||
fontFamily: "Inter_600SemiBold",
|
|
||||||
},
|
|
||||||
emptyText: {
|
|
||||||
fontSize: 14,
|
|
||||||
fontFamily: "Inter_400Regular",
|
|
||||||
textAlign: "center",
|
|
||||||
},
|
|
||||||
retryBtn: {
|
|
||||||
marginTop: 4,
|
|
||||||
paddingHorizontal: 20,
|
|
||||||
paddingVertical: 10,
|
|
||||||
borderRadius: 10,
|
|
||||||
},
|
|
||||||
retryText: {
|
|
||||||
fontSize: 14,
|
|
||||||
fontFamily: "Inter_600SemiBold",
|
|
||||||
},
|
},
|
||||||
|
toastText: { fontSize: 13, fontFamily: "Inter_600SemiBold", color: "#fff" },
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -1,10 +1,12 @@
|
|||||||
import { Feather } from "@expo/vector-icons";
|
import { Feather } from "@expo/vector-icons";
|
||||||
|
import axios from "axios";
|
||||||
import * as Haptics from "expo-haptics";
|
import * as Haptics from "expo-haptics";
|
||||||
import React, { useEffect, useState } from "react";
|
import React, { useState } from "react";
|
||||||
import {
|
import {
|
||||||
ActivityIndicator,
|
ActivityIndicator,
|
||||||
Alert,
|
Alert,
|
||||||
Platform,
|
Platform,
|
||||||
|
ScrollView,
|
||||||
StyleSheet,
|
StyleSheet,
|
||||||
Text,
|
Text,
|
||||||
TextInput,
|
TextInput,
|
||||||
@@ -13,84 +15,132 @@ import {
|
|||||||
} from "react-native";
|
} from "react-native";
|
||||||
import { KeyboardAwareScrollView } from "react-native-keyboard-controller";
|
import { KeyboardAwareScrollView } from "react-native-keyboard-controller";
|
||||||
import { useSafeAreaInsets } from "react-native-safe-area-context";
|
import { useSafeAreaInsets } from "react-native-safe-area-context";
|
||||||
import { usePostiz } from "@/context/PostizContext";
|
import { PostizWorkspace, DEFAULT_BASE_URL, usePostiz } from "@/context/PostizContext";
|
||||||
import { useColors } from "@/hooks/useColors";
|
import { useColors } from "@/hooks/useColors";
|
||||||
import axios from "axios";
|
import { extractError } from "@/lib/extractError";
|
||||||
|
|
||||||
const DEFAULT_BASE_URL = "https://postiz.gyozamancave.fr/public/v1";
|
type FormState = {
|
||||||
|
id?: string;
|
||||||
|
name: string;
|
||||||
|
url: string;
|
||||||
|
key: string;
|
||||||
|
};
|
||||||
|
|
||||||
|
const EMPTY_FORM: FormState = { name: "", url: DEFAULT_BASE_URL, key: "" };
|
||||||
|
|
||||||
export default function SettingsScreen() {
|
export default function SettingsScreen() {
|
||||||
const colors = useColors();
|
const colors = useColors();
|
||||||
const insets = useSafeAreaInsets();
|
const insets = useSafeAreaInsets();
|
||||||
const { apiKey, baseUrl, isConfigured, saveSettings, clearSettings } = usePostiz();
|
const { workspaces, isConfigured, addWorkspace, updateWorkspace, removeWorkspace } = usePostiz();
|
||||||
|
|
||||||
const [inputKey, setInputKey] = useState(apiKey);
|
const [form, setForm] = useState<FormState | null>(null);
|
||||||
const [inputUrl, setInputUrl] = useState(baseUrl || DEFAULT_BASE_URL);
|
|
||||||
const [showKey, setShowKey] = useState(false);
|
const [showKey, setShowKey] = useState(false);
|
||||||
const [validating, setValidating] = useState(false);
|
const [validating, setValidating] = useState(false);
|
||||||
const [saving, setSaving] = useState(false);
|
const [saving, setSaving] = useState(false);
|
||||||
const [validationStatus, setValidationStatus] = useState<
|
const [validationStatus, setValidationStatus] = useState<"idle" | "ok" | "error">("idle");
|
||||||
"idle" | "ok" | "error"
|
const [errorDetail, setErrorDetail] = useState("");
|
||||||
>("idle");
|
|
||||||
|
|
||||||
useEffect(() => {
|
const openAdd = () => {
|
||||||
setInputKey(apiKey);
|
setForm(EMPTY_FORM);
|
||||||
setInputUrl(baseUrl || DEFAULT_BASE_URL);
|
setShowKey(false);
|
||||||
}, [apiKey, baseUrl]);
|
resetValidation();
|
||||||
|
};
|
||||||
|
|
||||||
|
const openEdit = (ws: PostizWorkspace) => {
|
||||||
|
setForm({ id: ws.id, name: ws.name, url: ws.baseUrl, key: ws.apiKey });
|
||||||
|
setShowKey(false);
|
||||||
|
resetValidation();
|
||||||
|
};
|
||||||
|
|
||||||
|
const closeForm = () => {
|
||||||
|
setForm(null);
|
||||||
|
resetValidation();
|
||||||
|
};
|
||||||
|
|
||||||
|
const resetValidation = () => {
|
||||||
|
setValidationStatus("idle");
|
||||||
|
setErrorDetail("");
|
||||||
|
};
|
||||||
|
|
||||||
|
const patchForm = (patch: Partial<FormState>) => {
|
||||||
|
setForm((prev) => (prev ? { ...prev, ...patch } : prev));
|
||||||
|
resetValidation();
|
||||||
|
};
|
||||||
|
|
||||||
const handleValidate = async () => {
|
const handleValidate = async () => {
|
||||||
if (!inputKey.trim() || !inputUrl.trim()) {
|
if (!form?.key.trim() || !form?.url.trim()) {
|
||||||
Alert.alert("Missing fields", "Please enter both API key and base URL.");
|
Alert.alert("Missing fields", "Please enter both API key and base URL.");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
setValidating(true);
|
setValidating(true);
|
||||||
setValidationStatus("idle");
|
resetValidation();
|
||||||
|
const cleanUrl = form.url.trim().replace(/\/$/, "");
|
||||||
|
const variants = [form.key.trim(), `Bearer ${form.key.trim()}`];
|
||||||
|
let lastError = "";
|
||||||
|
|
||||||
|
for (const auth of variants) {
|
||||||
try {
|
try {
|
||||||
await axios.get(`${inputUrl.replace(/\/$/, "")}/integrations`, {
|
await axios.get(`${cleanUrl}/integrations`, {
|
||||||
headers: { Authorization: inputKey.trim() },
|
headers: { Authorization: auth },
|
||||||
timeout: 10000,
|
timeout: 10000,
|
||||||
|
maxRedirects: 0,
|
||||||
});
|
});
|
||||||
setValidationStatus("ok");
|
setValidationStatus("ok");
|
||||||
Haptics.notificationAsync(Haptics.NotificationFeedbackType.Success);
|
Haptics.notificationAsync(Haptics.NotificationFeedbackType.Success);
|
||||||
} catch {
|
setValidating(false);
|
||||||
|
return;
|
||||||
|
} catch (err: unknown) {
|
||||||
|
if (axios.isAxiosError(err)) {
|
||||||
|
const s = err.response?.status;
|
||||||
|
if (s === 307 || s === 301 || s === 302 || s === 308) {
|
||||||
|
const loc = err.response?.headers?.location ?? "unknown";
|
||||||
|
lastError = `HTTP ${s} redirect → ${loc}. Check the Authorization format or base URL.`;
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
if (s === 401 || s === 403) { lastError = `HTTP ${s}: Invalid or expired API key.`; continue; }
|
||||||
|
}
|
||||||
|
lastError = extractError(err);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
setErrorDetail(lastError);
|
||||||
setValidationStatus("error");
|
setValidationStatus("error");
|
||||||
Haptics.notificationAsync(Haptics.NotificationFeedbackType.Error);
|
Haptics.notificationAsync(Haptics.NotificationFeedbackType.Error);
|
||||||
} finally {
|
|
||||||
setValidating(false);
|
setValidating(false);
|
||||||
}
|
|
||||||
};
|
};
|
||||||
|
|
||||||
const handleSave = async () => {
|
const handleSave = async () => {
|
||||||
if (!inputKey.trim() || !inputUrl.trim()) {
|
if (!form) return;
|
||||||
Alert.alert("Missing fields", "Please enter both API key and base URL.");
|
if (!form.name.trim()) { Alert.alert("Missing name", "Please enter a name for this workspace."); return; }
|
||||||
return;
|
if (!form.key.trim() || !form.url.trim()) { Alert.alert("Missing fields", "Please enter both API key and base URL."); return; }
|
||||||
}
|
|
||||||
setSaving(true);
|
setSaving(true);
|
||||||
try {
|
try {
|
||||||
await saveSettings(inputKey.trim(), inputUrl.trim().replace(/\/$/, ""));
|
const ws = { name: form.name.trim(), apiKey: form.key.trim(), baseUrl: form.url.trim().replace(/\/$/, "") };
|
||||||
|
if (form.id) {
|
||||||
|
await updateWorkspace({ ...ws, id: form.id });
|
||||||
|
} else {
|
||||||
|
await addWorkspace(ws);
|
||||||
|
}
|
||||||
Haptics.notificationAsync(Haptics.NotificationFeedbackType.Success);
|
Haptics.notificationAsync(Haptics.NotificationFeedbackType.Success);
|
||||||
Alert.alert("Saved", "Settings saved successfully.");
|
closeForm();
|
||||||
} catch {
|
} catch (err: unknown) {
|
||||||
Alert.alert("Error", "Failed to save settings.");
|
Alert.alert("Error", `Failed to save.\n${extractError(err)}`);
|
||||||
} finally {
|
} finally {
|
||||||
setSaving(false);
|
setSaving(false);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
const handleClear = () => {
|
const handleDelete = (ws: PostizWorkspace) => {
|
||||||
Alert.alert(
|
Alert.alert(
|
||||||
"Disconnect",
|
"Remove workspace",
|
||||||
"Remove your API key and disconnect from Postiz?",
|
`Remove "${ws.name}"? Channels from this workspace will no longer be available.`,
|
||||||
[
|
[
|
||||||
{ text: "Cancel", style: "cancel" },
|
{ text: "Cancel", style: "cancel" },
|
||||||
{
|
{
|
||||||
text: "Disconnect",
|
text: "Remove",
|
||||||
style: "destructive",
|
style: "destructive",
|
||||||
onPress: async () => {
|
onPress: async () => {
|
||||||
await clearSettings();
|
if (form?.id === ws.id) closeForm();
|
||||||
setInputKey("");
|
await removeWorkspace(ws.id);
|
||||||
setInputUrl(DEFAULT_BASE_URL);
|
|
||||||
setValidationStatus("idle");
|
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
]
|
]
|
||||||
@@ -104,55 +154,103 @@ export default function SettingsScreen() {
|
|||||||
styles.container,
|
styles.container,
|
||||||
{
|
{
|
||||||
paddingTop: Platform.OS === "web" ? 67 : 24,
|
paddingTop: Platform.OS === "web" ? 67 : 24,
|
||||||
paddingBottom:
|
paddingBottom: Platform.OS === "web" ? 100 : insets.bottom + 40,
|
||||||
Platform.OS === "web" ? 100 : insets.bottom + 40,
|
|
||||||
},
|
},
|
||||||
]}
|
]}
|
||||||
bottomOffset={60}
|
bottomOffset={60}
|
||||||
keyboardShouldPersistTaps="handled"
|
keyboardShouldPersistTaps="handled"
|
||||||
showsVerticalScrollIndicator={false}
|
showsVerticalScrollIndicator={false}
|
||||||
>
|
>
|
||||||
{!isConfigured && (
|
{/* Status banner */}
|
||||||
|
{!isConfigured ? (
|
||||||
<View style={[styles.banner, { backgroundColor: colors.primary + "18", borderColor: colors.primary + "40" }]}>
|
<View style={[styles.banner, { backgroundColor: colors.primary + "18", borderColor: colors.primary + "40" }]}>
|
||||||
<Feather name="info" size={16} color={colors.primary} />
|
<Feather name="info" size={16} color={colors.primary} />
|
||||||
<Text style={[styles.bannerText, { color: colors.primary }]}>
|
<Text style={[styles.bannerText, { color: colors.primary }]}>
|
||||||
Connect to your Postiz instance to get started
|
Add a workspace to get started
|
||||||
</Text>
|
</Text>
|
||||||
</View>
|
</View>
|
||||||
)}
|
) : (
|
||||||
|
|
||||||
{isConfigured && (
|
|
||||||
<View style={[styles.connectedBadge, { backgroundColor: colors.success + "18", borderColor: colors.success + "40" }]}>
|
<View style={[styles.connectedBadge, { backgroundColor: colors.success + "18", borderColor: colors.success + "40" }]}>
|
||||||
<Feather name="check-circle" size={14} color={colors.success} />
|
<Feather name="check-circle" size={14} color={colors.success} />
|
||||||
<Text style={[styles.connectedText, { color: colors.success }]}>
|
<Text style={[styles.connectedText, { color: colors.success }]}>
|
||||||
Connected to Postiz
|
{workspaces.length} workspace{workspaces.length > 1 ? "s" : ""} configured
|
||||||
</Text>
|
</Text>
|
||||||
</View>
|
</View>
|
||||||
)}
|
)}
|
||||||
|
|
||||||
<View style={styles.section}>
|
{/* Workspace cards */}
|
||||||
<Text style={[styles.label, { color: colors.mutedForeground }]}>
|
{workspaces.map((ws) => (
|
||||||
BASE URL
|
<View key={ws.id} style={[styles.wsCard, { backgroundColor: colors.card, borderColor: colors.border }]}>
|
||||||
|
<View style={styles.wsCardHeader}>
|
||||||
|
<View style={styles.wsCardLeft}>
|
||||||
|
<View style={[styles.wsIcon, { backgroundColor: colors.primary + "18" }]}>
|
||||||
|
<Feather name="briefcase" size={14} color={colors.primary} />
|
||||||
|
</View>
|
||||||
|
<View>
|
||||||
|
<Text style={[styles.wsName, { color: colors.foreground }]}>{ws.name}</Text>
|
||||||
|
<Text style={[styles.wsUrl, { color: colors.mutedForeground }]} numberOfLines={1}>
|
||||||
|
{ws.baseUrl.replace(/^https?:\/\//, "").replace(/\/api.*$/, "")}
|
||||||
</Text>
|
</Text>
|
||||||
<View
|
</View>
|
||||||
style={[
|
</View>
|
||||||
styles.inputWrap,
|
<View style={styles.wsCardActions}>
|
||||||
{
|
<TouchableOpacity onPress={() => openEdit(ws)} activeOpacity={0.7} style={styles.iconBtn}>
|
||||||
backgroundColor: colors.card,
|
<Feather name="edit-2" size={15} color={colors.mutedForeground} />
|
||||||
borderColor: colors.border,
|
</TouchableOpacity>
|
||||||
},
|
<TouchableOpacity onPress={() => handleDelete(ws)} activeOpacity={0.7} style={styles.iconBtn}>
|
||||||
]}
|
<Feather name="trash-2" size={15} color={colors.destructive} />
|
||||||
|
</TouchableOpacity>
|
||||||
|
</View>
|
||||||
|
</View>
|
||||||
|
</View>
|
||||||
|
))}
|
||||||
|
|
||||||
|
{/* Add workspace button */}
|
||||||
|
{!form && (
|
||||||
|
<TouchableOpacity
|
||||||
|
onPress={openAdd}
|
||||||
|
activeOpacity={0.8}
|
||||||
|
style={[styles.addBtn, { backgroundColor: colors.card, borderColor: colors.border }]}
|
||||||
>
|
>
|
||||||
<Feather name="globe" size={16} color={colors.mutedForeground} style={styles.inputIcon} />
|
<Feather name="plus" size={16} color={colors.primary} />
|
||||||
|
<Text style={[styles.addBtnText, { color: colors.primary }]}>Add workspace</Text>
|
||||||
|
</TouchableOpacity>
|
||||||
|
)}
|
||||||
|
|
||||||
|
{/* Add / Edit form */}
|
||||||
|
{form && (
|
||||||
|
<View style={[styles.formCard, { backgroundColor: colors.card, borderColor: colors.border }]}>
|
||||||
|
<Text style={[styles.formTitle, { color: colors.foreground }]}>
|
||||||
|
{form.id ? "Edit workspace" : "Add workspace"}
|
||||||
|
</Text>
|
||||||
|
|
||||||
|
{/* Name */}
|
||||||
|
<View style={styles.fieldGroup}>
|
||||||
|
<Text style={[styles.label, { color: colors.mutedForeground }]}>NAME</Text>
|
||||||
|
<View style={[styles.inputWrap, { backgroundColor: colors.background, borderColor: colors.border }]}>
|
||||||
|
<Feather name="briefcase" size={15} color={colors.mutedForeground} />
|
||||||
<TextInput
|
<TextInput
|
||||||
style={[styles.input, { color: colors.foreground }]}
|
style={[styles.input, { color: colors.foreground }]}
|
||||||
placeholder="https://postiz.example.com/public/v1"
|
placeholder="My Client"
|
||||||
placeholderTextColor={colors.mutedForeground}
|
placeholderTextColor={colors.mutedForeground}
|
||||||
value={inputUrl}
|
value={form.name}
|
||||||
onChangeText={(t) => {
|
onChangeText={(t) => patchForm({ name: t })}
|
||||||
setInputUrl(t);
|
autoCorrect={false}
|
||||||
setValidationStatus("idle");
|
/>
|
||||||
}}
|
</View>
|
||||||
|
</View>
|
||||||
|
|
||||||
|
{/* Base URL */}
|
||||||
|
<View style={styles.fieldGroup}>
|
||||||
|
<Text style={[styles.label, { color: colors.mutedForeground }]}>BASE URL</Text>
|
||||||
|
<View style={[styles.inputWrap, { backgroundColor: colors.background, borderColor: colors.border }]}>
|
||||||
|
<Feather name="globe" size={15} color={colors.mutedForeground} />
|
||||||
|
<TextInput
|
||||||
|
style={[styles.input, { color: colors.foreground }]}
|
||||||
|
placeholder="https://postiz.example.com/api/public/v1"
|
||||||
|
placeholderTextColor={colors.mutedForeground}
|
||||||
|
value={form.url}
|
||||||
|
onChangeText={(t) => patchForm({ url: t })}
|
||||||
autoCapitalize="none"
|
autoCapitalize="none"
|
||||||
autoCorrect={false}
|
autoCorrect={false}
|
||||||
keyboardType="url"
|
keyboardType="url"
|
||||||
@@ -160,91 +258,78 @@ export default function SettingsScreen() {
|
|||||||
</View>
|
</View>
|
||||||
</View>
|
</View>
|
||||||
|
|
||||||
<View style={styles.section}>
|
{/* API Key */}
|
||||||
<Text style={[styles.label, { color: colors.mutedForeground }]}>
|
<View style={styles.fieldGroup}>
|
||||||
API KEY
|
<Text style={[styles.label, { color: colors.mutedForeground }]}>API KEY</Text>
|
||||||
</Text>
|
<View style={[styles.inputWrap, { backgroundColor: colors.background, borderColor: colors.border }]}>
|
||||||
<View
|
<Feather name="key" size={15} color={colors.mutedForeground} />
|
||||||
style={[
|
|
||||||
styles.inputWrap,
|
|
||||||
{
|
|
||||||
backgroundColor: colors.card,
|
|
||||||
borderColor: colors.border,
|
|
||||||
},
|
|
||||||
]}
|
|
||||||
>
|
|
||||||
<Feather name="key" size={16} color={colors.mutedForeground} style={styles.inputIcon} />
|
|
||||||
<TextInput
|
<TextInput
|
||||||
style={[styles.input, { color: colors.foreground }]}
|
style={[styles.input, { color: colors.foreground }]}
|
||||||
placeholder="Enter your API key"
|
placeholder="Enter your API key"
|
||||||
placeholderTextColor={colors.mutedForeground}
|
placeholderTextColor={colors.mutedForeground}
|
||||||
value={inputKey}
|
value={form.key}
|
||||||
onChangeText={(t) => {
|
onChangeText={(t) => patchForm({ key: t })}
|
||||||
setInputKey(t);
|
|
||||||
setValidationStatus("idle");
|
|
||||||
}}
|
|
||||||
secureTextEntry={!showKey}
|
secureTextEntry={!showKey}
|
||||||
autoCapitalize="none"
|
autoCapitalize="none"
|
||||||
autoCorrect={false}
|
autoCorrect={false}
|
||||||
/>
|
/>
|
||||||
<TouchableOpacity onPress={() => setShowKey((v) => !v)} activeOpacity={0.7}>
|
<TouchableOpacity onPress={() => setShowKey((v) => !v)} activeOpacity={0.7}>
|
||||||
<Feather
|
<Feather name={showKey ? "eye-off" : "eye"} size={15} color={colors.mutedForeground} />
|
||||||
name={showKey ? "eye-off" : "eye"}
|
|
||||||
size={16}
|
|
||||||
color={colors.mutedForeground}
|
|
||||||
/>
|
|
||||||
</TouchableOpacity>
|
</TouchableOpacity>
|
||||||
</View>
|
</View>
|
||||||
|
|
||||||
{validationStatus === "ok" && (
|
{validationStatus === "ok" && (
|
||||||
<View style={styles.validationRow}>
|
<View style={styles.validRow}>
|
||||||
<Feather name="check-circle" size={13} color={colors.success} />
|
<Feather name="check-circle" size={13} color={colors.success} />
|
||||||
<Text style={[styles.validationText, { color: colors.success }]}>
|
<Text style={[styles.validText, { color: colors.success }]}>Connection successful</Text>
|
||||||
Connection successful
|
|
||||||
</Text>
|
|
||||||
</View>
|
</View>
|
||||||
)}
|
)}
|
||||||
|
|
||||||
{validationStatus === "error" && (
|
{validationStatus === "error" && (
|
||||||
<View style={styles.validationRow}>
|
<View style={[styles.errorBox, { backgroundColor: colors.error + "12", borderColor: colors.error + "30" }]}>
|
||||||
|
<View style={styles.errorHeader}>
|
||||||
<Feather name="x-circle" size={13} color={colors.error} />
|
<Feather name="x-circle" size={13} color={colors.error} />
|
||||||
<Text style={[styles.validationText, { color: colors.error }]}>
|
<Text style={[styles.errorTitle, { color: colors.error }]}>Could not connect</Text>
|
||||||
Could not connect. Check your URL and API key.
|
</View>
|
||||||
</Text>
|
{!!errorDetail && (
|
||||||
|
<ScrollView style={styles.errorScroll} nestedScrollEnabled>
|
||||||
|
<Text style={[styles.errorDetail, { color: colors.error }]} selectable>{errorDetail}</Text>
|
||||||
|
</ScrollView>
|
||||||
|
)}
|
||||||
</View>
|
</View>
|
||||||
)}
|
)}
|
||||||
</View>
|
</View>
|
||||||
|
|
||||||
|
{/* Form actions */}
|
||||||
<TouchableOpacity
|
<TouchableOpacity
|
||||||
onPress={handleValidate}
|
onPress={handleValidate}
|
||||||
activeOpacity={0.8}
|
activeOpacity={0.8}
|
||||||
disabled={validating}
|
disabled={validating}
|
||||||
style={[
|
style={[styles.validateBtn, { backgroundColor: colors.background, borderColor: colors.border }]}
|
||||||
styles.validateBtn,
|
|
||||||
{
|
|
||||||
backgroundColor: colors.card,
|
|
||||||
borderColor: colors.border,
|
|
||||||
},
|
|
||||||
]}
|
|
||||||
>
|
>
|
||||||
{validating ? (
|
{validating ? (
|
||||||
<ActivityIndicator color={colors.primary} size="small" />
|
<ActivityIndicator color={colors.primary} size="small" />
|
||||||
) : (
|
) : (
|
||||||
<>
|
<>
|
||||||
<Feather name="wifi" size={15} color={colors.primary} />
|
<Feather name="wifi" size={15} color={colors.primary} />
|
||||||
<Text style={[styles.validateText, { color: colors.primary }]}>
|
<Text style={[styles.validateText, { color: colors.primary }]}>Test Connection</Text>
|
||||||
Test Connection
|
|
||||||
</Text>
|
|
||||||
</>
|
</>
|
||||||
)}
|
)}
|
||||||
</TouchableOpacity>
|
</TouchableOpacity>
|
||||||
|
|
||||||
|
<View style={styles.formBtnsRow}>
|
||||||
|
<TouchableOpacity
|
||||||
|
onPress={closeForm}
|
||||||
|
activeOpacity={0.8}
|
||||||
|
style={[styles.cancelBtn, { borderColor: colors.border }]}
|
||||||
|
>
|
||||||
|
<Text style={[styles.cancelText, { color: colors.mutedForeground }]}>Cancel</Text>
|
||||||
|
</TouchableOpacity>
|
||||||
<TouchableOpacity
|
<TouchableOpacity
|
||||||
onPress={handleSave}
|
onPress={handleSave}
|
||||||
activeOpacity={0.85}
|
activeOpacity={0.85}
|
||||||
disabled={saving}
|
disabled={saving}
|
||||||
style={[
|
style={[styles.saveBtn, { backgroundColor: saving ? colors.muted : colors.primary }]}
|
||||||
styles.saveBtn,
|
|
||||||
{ backgroundColor: saving ? colors.muted : colors.primary },
|
|
||||||
]}
|
|
||||||
>
|
>
|
||||||
{saving ? (
|
{saving ? (
|
||||||
<ActivityIndicator color={colors.primaryForeground} size="small" />
|
<ActivityIndicator color={colors.primaryForeground} size="small" />
|
||||||
@@ -252,148 +337,75 @@ export default function SettingsScreen() {
|
|||||||
<>
|
<>
|
||||||
<Feather name="save" size={15} color={colors.primaryForeground} />
|
<Feather name="save" size={15} color={colors.primaryForeground} />
|
||||||
<Text style={[styles.saveText, { color: colors.primaryForeground }]}>
|
<Text style={[styles.saveText, { color: colors.primaryForeground }]}>
|
||||||
Save Settings
|
{form.id ? "Update" : "Save"}
|
||||||
</Text>
|
</Text>
|
||||||
</>
|
</>
|
||||||
)}
|
)}
|
||||||
</TouchableOpacity>
|
</TouchableOpacity>
|
||||||
|
</View>
|
||||||
{isConfigured && (
|
</View>
|
||||||
<TouchableOpacity
|
|
||||||
onPress={handleClear}
|
|
||||||
activeOpacity={0.8}
|
|
||||||
style={[styles.clearBtn, { borderColor: colors.destructive + "60" }]}
|
|
||||||
>
|
|
||||||
<Feather name="log-out" size={14} color={colors.destructive} />
|
|
||||||
<Text style={[styles.clearText, { color: colors.destructive }]}>
|
|
||||||
Disconnect
|
|
||||||
</Text>
|
|
||||||
</TouchableOpacity>
|
|
||||||
)}
|
)}
|
||||||
|
|
||||||
<View style={styles.footer}>
|
|
||||||
<Text style={[styles.footerText, { color: colors.mutedForeground }]}>
|
<Text style={[styles.footerText, { color: colors.mutedForeground }]}>
|
||||||
Your API key is stored securely on this device and never transmitted to third parties.
|
API keys are stored securely on this device and never transmitted to third parties.
|
||||||
</Text>
|
</Text>
|
||||||
</View>
|
|
||||||
</KeyboardAwareScrollView>
|
</KeyboardAwareScrollView>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
const styles = StyleSheet.create({
|
const styles = StyleSheet.create({
|
||||||
container: {
|
container: { paddingHorizontal: 20, gap: 14 },
|
||||||
paddingHorizontal: 20,
|
|
||||||
gap: 16,
|
|
||||||
},
|
|
||||||
banner: {
|
banner: {
|
||||||
flexDirection: "row",
|
flexDirection: "row", alignItems: "center", gap: 10,
|
||||||
alignItems: "center",
|
paddingHorizontal: 14, paddingVertical: 12, borderRadius: 12, borderWidth: 1,
|
||||||
gap: 10,
|
|
||||||
paddingHorizontal: 14,
|
|
||||||
paddingVertical: 12,
|
|
||||||
borderRadius: 12,
|
|
||||||
borderWidth: 1,
|
|
||||||
},
|
|
||||||
bannerText: {
|
|
||||||
fontSize: 13,
|
|
||||||
fontFamily: "Inter_500Medium",
|
|
||||||
flex: 1,
|
|
||||||
},
|
},
|
||||||
|
bannerText: { fontSize: 13, fontFamily: "Inter_500Medium", flex: 1 },
|
||||||
connectedBadge: {
|
connectedBadge: {
|
||||||
flexDirection: "row",
|
flexDirection: "row", alignItems: "center", gap: 6,
|
||||||
alignItems: "center",
|
paddingHorizontal: 12, paddingVertical: 8, borderRadius: 10, borderWidth: 1, alignSelf: "flex-start",
|
||||||
gap: 6,
|
|
||||||
paddingHorizontal: 12,
|
|
||||||
paddingVertical: 8,
|
|
||||||
borderRadius: 10,
|
|
||||||
borderWidth: 1,
|
|
||||||
alignSelf: "flex-start",
|
|
||||||
},
|
},
|
||||||
connectedText: {
|
connectedText: { fontSize: 12, fontFamily: "Inter_600SemiBold" },
|
||||||
fontSize: 12,
|
wsCard: { borderRadius: 14, borderWidth: 1, overflow: "hidden" },
|
||||||
fontFamily: "Inter_600SemiBold",
|
wsCardHeader: { flexDirection: "row", alignItems: "center", paddingHorizontal: 14, paddingVertical: 12 },
|
||||||
},
|
wsCardLeft: { flex: 1, flexDirection: "row", alignItems: "center", gap: 12 },
|
||||||
section: {
|
wsIcon: { width: 32, height: 32, borderRadius: 10, alignItems: "center", justifyContent: "center" },
|
||||||
gap: 8,
|
wsName: { fontSize: 14, fontFamily: "Inter_600SemiBold" },
|
||||||
},
|
wsUrl: { fontSize: 11, fontFamily: "Inter_400Regular", marginTop: 1 },
|
||||||
label: {
|
wsCardActions: { flexDirection: "row", gap: 4 },
|
||||||
fontSize: 11,
|
iconBtn: { padding: 8 },
|
||||||
fontFamily: "Inter_600SemiBold",
|
addBtn: {
|
||||||
letterSpacing: 0.8,
|
flexDirection: "row", alignItems: "center", justifyContent: "center",
|
||||||
marginLeft: 2,
|
gap: 8, paddingVertical: 13, borderRadius: 14, borderWidth: 1, borderStyle: "dashed",
|
||||||
},
|
},
|
||||||
|
addBtnText: { fontSize: 14, fontFamily: "Inter_600SemiBold" },
|
||||||
|
formCard: { borderRadius: 14, borderWidth: 1, padding: 16, gap: 14 },
|
||||||
|
formTitle: { fontSize: 15, fontFamily: "Inter_600SemiBold" },
|
||||||
|
fieldGroup: { gap: 6 },
|
||||||
|
label: { fontSize: 11, fontFamily: "Inter_600SemiBold", letterSpacing: 0.8, marginLeft: 2 },
|
||||||
inputWrap: {
|
inputWrap: {
|
||||||
flexDirection: "row",
|
flexDirection: "row", alignItems: "center",
|
||||||
alignItems: "center",
|
borderRadius: 10, borderWidth: 1, paddingHorizontal: 12, paddingVertical: 11, gap: 10,
|
||||||
borderRadius: 12,
|
|
||||||
borderWidth: 1,
|
|
||||||
paddingHorizontal: 14,
|
|
||||||
paddingVertical: 12,
|
|
||||||
gap: 10,
|
|
||||||
},
|
|
||||||
inputIcon: {
|
|
||||||
flexShrink: 0,
|
|
||||||
},
|
|
||||||
input: {
|
|
||||||
flex: 1,
|
|
||||||
fontSize: 14,
|
|
||||||
fontFamily: "Inter_400Regular",
|
|
||||||
},
|
|
||||||
validationRow: {
|
|
||||||
flexDirection: "row",
|
|
||||||
alignItems: "center",
|
|
||||||
gap: 6,
|
|
||||||
marginLeft: 2,
|
|
||||||
},
|
|
||||||
validationText: {
|
|
||||||
fontSize: 12,
|
|
||||||
fontFamily: "Inter_400Regular",
|
|
||||||
},
|
},
|
||||||
|
input: { flex: 1, fontSize: 14, fontFamily: "Inter_400Regular" },
|
||||||
|
validRow: { flexDirection: "row", alignItems: "center", gap: 6, marginLeft: 2 },
|
||||||
|
validText: { fontSize: 12, fontFamily: "Inter_400Regular" },
|
||||||
|
errorBox: { borderRadius: 10, borderWidth: 1, padding: 12, gap: 6 },
|
||||||
|
errorHeader: { flexDirection: "row", alignItems: "center", gap: 6 },
|
||||||
|
errorTitle: { fontSize: 12, fontFamily: "Inter_600SemiBold" },
|
||||||
|
errorScroll: { maxHeight: 80 },
|
||||||
|
errorDetail: { fontSize: 11, fontFamily: "Inter_400Regular", lineHeight: 16 },
|
||||||
validateBtn: {
|
validateBtn: {
|
||||||
flexDirection: "row",
|
flexDirection: "row", alignItems: "center", justifyContent: "center",
|
||||||
alignItems: "center",
|
gap: 8, paddingVertical: 11, borderRadius: 10, borderWidth: 1,
|
||||||
justifyContent: "center",
|
|
||||||
gap: 8,
|
|
||||||
paddingVertical: 12,
|
|
||||||
borderRadius: 12,
|
|
||||||
borderWidth: 1,
|
|
||||||
},
|
|
||||||
validateText: {
|
|
||||||
fontSize: 14,
|
|
||||||
fontFamily: "Inter_600SemiBold",
|
|
||||||
},
|
},
|
||||||
|
validateText: { fontSize: 14, fontFamily: "Inter_600SemiBold" },
|
||||||
|
formBtnsRow: { flexDirection: "row", gap: 10 },
|
||||||
|
cancelBtn: { flex: 1, paddingVertical: 12, borderRadius: 10, borderWidth: 1, alignItems: "center" },
|
||||||
|
cancelText: { fontSize: 14, fontFamily: "Inter_500Medium" },
|
||||||
saveBtn: {
|
saveBtn: {
|
||||||
flexDirection: "row",
|
flex: 2, flexDirection: "row", alignItems: "center", justifyContent: "center",
|
||||||
alignItems: "center",
|
gap: 8, paddingVertical: 12, borderRadius: 10,
|
||||||
justifyContent: "center",
|
|
||||||
gap: 8,
|
|
||||||
paddingVertical: 14,
|
|
||||||
borderRadius: 14,
|
|
||||||
},
|
|
||||||
saveText: {
|
|
||||||
fontSize: 15,
|
|
||||||
fontFamily: "Inter_600SemiBold",
|
|
||||||
},
|
|
||||||
clearBtn: {
|
|
||||||
flexDirection: "row",
|
|
||||||
alignItems: "center",
|
|
||||||
justifyContent: "center",
|
|
||||||
gap: 8,
|
|
||||||
paddingVertical: 12,
|
|
||||||
borderRadius: 12,
|
|
||||||
borderWidth: 1,
|
|
||||||
},
|
|
||||||
clearText: {
|
|
||||||
fontSize: 14,
|
|
||||||
fontFamily: "Inter_500Medium",
|
|
||||||
},
|
|
||||||
footer: {
|
|
||||||
marginTop: 8,
|
|
||||||
},
|
|
||||||
footerText: {
|
|
||||||
fontSize: 12,
|
|
||||||
fontFamily: "Inter_400Regular",
|
|
||||||
textAlign: "center",
|
|
||||||
lineHeight: 18,
|
|
||||||
},
|
},
|
||||||
|
saveText: { fontSize: 14, fontFamily: "Inter_600SemiBold" },
|
||||||
|
footerText: { fontSize: 12, fontFamily: "Inter_400Regular", textAlign: "center", lineHeight: 18, marginTop: 4 },
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -6,15 +6,16 @@ import {
|
|||||||
useFonts,
|
useFonts,
|
||||||
} from "@expo-google-fonts/inter";
|
} from "@expo-google-fonts/inter";
|
||||||
import { QueryClient, QueryClientProvider } from "@tanstack/react-query";
|
import { QueryClient, QueryClientProvider } from "@tanstack/react-query";
|
||||||
import { Stack } from "expo-router";
|
import { router, Stack } from "expo-router";
|
||||||
import * as SplashScreen from "expo-splash-screen";
|
import * as SplashScreen from "expo-splash-screen";
|
||||||
import React, { useEffect } from "react";
|
import React, { useEffect } from "react";
|
||||||
|
import { Alert } from "react-native";
|
||||||
import { GestureHandlerRootView } from "react-native-gesture-handler";
|
import { GestureHandlerRootView } from "react-native-gesture-handler";
|
||||||
import { KeyboardProvider } from "react-native-keyboard-controller";
|
import { KeyboardProvider } from "react-native-keyboard-controller";
|
||||||
import { SafeAreaProvider } from "react-native-safe-area-context";
|
import { SafeAreaProvider } from "react-native-safe-area-context";
|
||||||
|
|
||||||
import { ErrorBoundary } from "@/components/ErrorBoundary";
|
import { ErrorBoundary } from "@/components/ErrorBoundary";
|
||||||
import { PostizProvider } from "@/context/PostizContext";
|
import { PostizProvider, usePostiz } from "@/context/PostizContext";
|
||||||
import { useNotifications } from "@/hooks/useNotifications";
|
import { useNotifications } from "@/hooks/useNotifications";
|
||||||
|
|
||||||
SplashScreen.preventAutoHideAsync();
|
SplashScreen.preventAutoHideAsync();
|
||||||
@@ -33,6 +34,28 @@ function NotificationBootstrap() {
|
|||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function UnauthorizedHandler() {
|
||||||
|
const { unauthorized, clearUnauthorized } = usePostiz();
|
||||||
|
useEffect(() => {
|
||||||
|
if (!unauthorized) return;
|
||||||
|
Alert.alert(
|
||||||
|
"API key invalid",
|
||||||
|
"Your API key was rejected (401). Update it in Settings.",
|
||||||
|
[
|
||||||
|
{
|
||||||
|
text: "Open Settings",
|
||||||
|
onPress: () => {
|
||||||
|
clearUnauthorized();
|
||||||
|
router.push("/(tabs)/settings");
|
||||||
|
},
|
||||||
|
},
|
||||||
|
{ text: "Dismiss", style: "cancel", onPress: clearUnauthorized },
|
||||||
|
]
|
||||||
|
);
|
||||||
|
}, [unauthorized, clearUnauthorized]);
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
function RootLayoutNav() {
|
function RootLayoutNav() {
|
||||||
return (
|
return (
|
||||||
<Stack screenOptions={{ headerBackTitle: "Back" }}>
|
<Stack screenOptions={{ headerBackTitle: "Back" }}>
|
||||||
@@ -63,6 +86,7 @@ export default function RootLayout() {
|
|||||||
<QueryClientProvider client={queryClient}>
|
<QueryClientProvider client={queryClient}>
|
||||||
<PostizProvider>
|
<PostizProvider>
|
||||||
<NotificationBootstrap />
|
<NotificationBootstrap />
|
||||||
|
<UnauthorizedHandler />
|
||||||
<GestureHandlerRootView style={{ flex: 1 }}>
|
<GestureHandlerRootView style={{ flex: 1 }}>
|
||||||
<KeyboardProvider>
|
<KeyboardProvider>
|
||||||
<RootLayoutNav />
|
<RootLayoutNav />
|
||||||
|
|||||||
Binary file not shown.
|
Before Width: | Height: | Size: 652 KiB After Width: | Height: | Size: 49 KiB |
Executable
+182
@@ -0,0 +1,182 @@
|
|||||||
|
#!/usr/bin/env bash
|
||||||
|
# build-apk.sh — Build a signed release APK locally without expo.dev / EAS.
|
||||||
|
#
|
||||||
|
# Prerequisites (first time only):
|
||||||
|
# 1. Export EAS keystore:
|
||||||
|
# cd artifacts/postiz-mobile
|
||||||
|
# eas credentials --platform android
|
||||||
|
# → "Download existing keystore" → save to ~/.config/postiz-mobile/postiz-mobile.jks
|
||||||
|
# 2. Fill in signing credentials:
|
||||||
|
# cp ~/.config/postiz-mobile/signing.env.example ~/.config/postiz-mobile/signing.env
|
||||||
|
# $EDITOR ~/.config/postiz-mobile/signing.env
|
||||||
|
# 3. Install Android SDK (if not already):
|
||||||
|
# ./install-android-sdk.sh
|
||||||
|
# # then add ANDROID_HOME to your shell profile and reload it
|
||||||
|
#
|
||||||
|
# Usage:
|
||||||
|
# ./build-apk.sh # → dist/postiz-mobile-YYYYMMDD-HHMM.apk
|
||||||
|
# ./build-apk.sh --aab # → dist/postiz-mobile-YYYYMMDD-HHMM.aab (Play Store)
|
||||||
|
|
||||||
|
set -euo pipefail
|
||||||
|
|
||||||
|
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
|
||||||
|
SIGNING_ENV="$HOME/.config/postiz-mobile/signing.env"
|
||||||
|
DIST_DIR="$SCRIPT_DIR/dist"
|
||||||
|
BUILD_TYPE="${1:-}"
|
||||||
|
|
||||||
|
# ─── Colours ───────────────────────────────────────────────────────────────
|
||||||
|
RED='\033[0;31m'; GREEN='\033[0;32m'; YELLOW='\033[1;33m'; NC='\033[0m'
|
||||||
|
info() { echo -e "${GREEN}[build]${NC} $*"; }
|
||||||
|
warn() { echo -e "${YELLOW}[warn]${NC} $*"; }
|
||||||
|
abort() { echo -e "${RED}[error]${NC} $*" >&2; exit 1; }
|
||||||
|
|
||||||
|
# ─── 1. Signing credentials ────────────────────────────────────────────────
|
||||||
|
if [ ! -f "$SIGNING_ENV" ]; then
|
||||||
|
abort "Missing signing.env.\n\n cp ~/.config/postiz-mobile/signing.env.example ~/.config/postiz-mobile/signing.env\n # then fill in your keystore path and passwords"
|
||||||
|
fi
|
||||||
|
# shellcheck source=/dev/null
|
||||||
|
source "$SIGNING_ENV"
|
||||||
|
|
||||||
|
[ -z "${KEYSTORE_PATH:-}" ] && abort "KEYSTORE_PATH not set in signing.env"
|
||||||
|
[ -z "${KEYSTORE_ALIAS:-}" ] && abort "KEYSTORE_ALIAS not set in signing.env"
|
||||||
|
[ -z "${KEYSTORE_STORE_PASSWORD:-}" ] && abort "KEYSTORE_STORE_PASSWORD not set in signing.env"
|
||||||
|
[ -z "${KEYSTORE_KEY_PASSWORD:-}" ] && abort "KEYSTORE_KEY_PASSWORD not set in signing.env"
|
||||||
|
|
||||||
|
KEYSTORE_PATH_EXPANDED="${KEYSTORE_PATH/#\$HOME/$HOME}"
|
||||||
|
KEYSTORE_PATH_EXPANDED="${KEYSTORE_PATH_EXPANDED/#~/$HOME}"
|
||||||
|
|
||||||
|
[ ! -f "$KEYSTORE_PATH_EXPANDED" ] && \
|
||||||
|
abort "Keystore not found: $KEYSTORE_PATH_EXPANDED\n\nExport it from EAS:\n eas credentials --platform android\n → Download existing keystore → save to $KEYSTORE_PATH_EXPANDED"
|
||||||
|
|
||||||
|
# ─── 2. Java 17/21 — Gradle requires Java ≤ 24 (system Java 25 is too new) ──
|
||||||
|
# Use ~/jdk21 if present, otherwise rely on JAVA_HOME already being set correctly.
|
||||||
|
if [ -z "${JAVA_HOME:-}" ] || "$JAVA_HOME/bin/java" -version 2>&1 | grep -qE '"(2[5-9]|[3-9][0-9])\.' ; then
|
||||||
|
if [ -d "$HOME/jdk21" ]; then
|
||||||
|
export JAVA_HOME="$HOME/jdk21"
|
||||||
|
export PATH="$JAVA_HOME/bin:$PATH"
|
||||||
|
info "Using local JDK 21: $JAVA_HOME"
|
||||||
|
else
|
||||||
|
abort "Java 25+ detected but Gradle only supports ≤ Java 24.\n\nInstall JDK 21 locally:\n wget -O /tmp/jdk21.tar.gz https://github.com/adoptium/temurin21-binaries/releases/download/jdk-21.0.7%2B6/OpenJDK21U-jdk_x64_linux_hotspot_21.0.7_6.tar.gz\n mkdir -p ~/jdk21 && tar -xzf /tmp/jdk21.tar.gz -C ~/jdk21 --strip-components=1"
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
info "Java: $("$JAVA_HOME/bin/java" -version 2>&1 | head -1)"
|
||||||
|
|
||||||
|
# ─── 3. Android SDK ────────────────────────────────────────────────────────
|
||||||
|
if [ -z "${ANDROID_HOME:-}" ]; then
|
||||||
|
for candidate in "$HOME/android-sdk" "$HOME/Android/Sdk" "/opt/android-sdk"; do
|
||||||
|
if [ -d "$candidate/platform-tools" ]; then
|
||||||
|
export ANDROID_HOME="$candidate"
|
||||||
|
break
|
||||||
|
fi
|
||||||
|
done
|
||||||
|
fi
|
||||||
|
|
||||||
|
if [ -z "${ANDROID_HOME:-}" ]; then
|
||||||
|
abort "Android SDK not found.\n\nRun: ./install-android-sdk.sh\nThen: export ANDROID_HOME=\"\$HOME/android-sdk\" && source ~/.bashrc"
|
||||||
|
fi
|
||||||
|
|
||||||
|
export PATH="$PATH:$ANDROID_HOME/platform-tools:$ANDROID_HOME/cmdline-tools/latest/bin"
|
||||||
|
info "Android SDK: $ANDROID_HOME"
|
||||||
|
|
||||||
|
# ─── 4. expo prebuild ──────────────────────────────────────────────────────
|
||||||
|
info "Running expo prebuild (Android)…"
|
||||||
|
cd "$SCRIPT_DIR"
|
||||||
|
pnpm exec expo prebuild --platform android --clean --no-install
|
||||||
|
|
||||||
|
# ─── 4. Patch build.gradle — inject release signingConfig ──────────────────
|
||||||
|
info "Patching android/app/build.gradle for release signing…"
|
||||||
|
|
||||||
|
python3 - "$SCRIPT_DIR/android/app/build.gradle" << 'PYEOF'
|
||||||
|
import sys, re
|
||||||
|
|
||||||
|
path = sys.argv[1]
|
||||||
|
with open(path, 'r') as f:
|
||||||
|
content = f.read()
|
||||||
|
|
||||||
|
if 'MYAPP_UPLOAD_STORE_FILE' in content:
|
||||||
|
print('[patch] build.gradle already patched, skipping.')
|
||||||
|
sys.exit(0)
|
||||||
|
|
||||||
|
release_signing = """\n release {
|
||||||
|
if (project.hasProperty('MYAPP_UPLOAD_STORE_FILE')) {
|
||||||
|
storeFile file(MYAPP_UPLOAD_STORE_FILE)
|
||||||
|
storePassword MYAPP_UPLOAD_STORE_PASSWORD
|
||||||
|
keyAlias MYAPP_UPLOAD_KEY_ALIAS
|
||||||
|
keyPassword MYAPP_UPLOAD_KEY_PASSWORD
|
||||||
|
}
|
||||||
|
}"""
|
||||||
|
|
||||||
|
# Insert release block right after the closing brace of the debug signingConfig
|
||||||
|
content = re.sub(
|
||||||
|
r'(signingConfigs\s*\{[\s\S]*?debug\s*\{[\s\S]*?\})',
|
||||||
|
r'\1' + release_signing,
|
||||||
|
content,
|
||||||
|
count=1
|
||||||
|
)
|
||||||
|
|
||||||
|
# Switch release buildType from debug signing to release signing
|
||||||
|
# Only replace the first occurrence after "release {" (not the debug one)
|
||||||
|
def replace_release_signing(m):
|
||||||
|
return m.group(0).replace('signingConfig signingConfigs.debug',
|
||||||
|
'signingConfig signingConfigs.release', 1)
|
||||||
|
|
||||||
|
content = re.sub(
|
||||||
|
r'release\s*\{[^}]*signingConfig\s+signingConfigs\.debug',
|
||||||
|
replace_release_signing,
|
||||||
|
content,
|
||||||
|
count=1,
|
||||||
|
flags=re.DOTALL
|
||||||
|
)
|
||||||
|
|
||||||
|
with open(path, 'w') as f:
|
||||||
|
f.write(content)
|
||||||
|
|
||||||
|
print('[patch] build.gradle patched for release signing.')
|
||||||
|
PYEOF
|
||||||
|
|
||||||
|
# ─── 5. Inject signing props into gradle.properties ────────────────────────
|
||||||
|
info "Injecting signing credentials into gradle.properties…"
|
||||||
|
GRADLE_PROPS="$SCRIPT_DIR/android/gradle.properties"
|
||||||
|
|
||||||
|
# Remove any previous signing block left by this script
|
||||||
|
sed -i '/^# --- postiz release signing/,/^# --- end signing/d' "$GRADLE_PROPS" 2>/dev/null || true
|
||||||
|
|
||||||
|
cat >> "$GRADLE_PROPS" << EOF
|
||||||
|
|
||||||
|
# --- postiz release signing (injected by build-apk.sh — wiped after build)
|
||||||
|
MYAPP_UPLOAD_STORE_FILE=$KEYSTORE_PATH_EXPANDED
|
||||||
|
MYAPP_UPLOAD_STORE_PASSWORD=$KEYSTORE_STORE_PASSWORD
|
||||||
|
MYAPP_UPLOAD_KEY_ALIAS=$KEYSTORE_ALIAS
|
||||||
|
MYAPP_UPLOAD_KEY_PASSWORD=$KEYSTORE_KEY_PASSWORD
|
||||||
|
# --- end signing
|
||||||
|
EOF
|
||||||
|
|
||||||
|
# ─── 6. Gradle build ───────────────────────────────────────────────────────
|
||||||
|
cd "$SCRIPT_DIR/android"
|
||||||
|
|
||||||
|
if [ "$BUILD_TYPE" = "--aab" ]; then
|
||||||
|
info "Building AAB (release)…"
|
||||||
|
./gradlew bundleRelease
|
||||||
|
ARTIFACT="app/build/outputs/bundle/release/app-release.aab"
|
||||||
|
EXT="aab"
|
||||||
|
else
|
||||||
|
info "Building APK (release)…"
|
||||||
|
./gradlew assembleRelease
|
||||||
|
ARTIFACT="app/build/outputs/apk/release/app-release.apk"
|
||||||
|
EXT="apk"
|
||||||
|
fi
|
||||||
|
|
||||||
|
# ─── 7. Wipe credentials from gradle.properties ───────────────────────────
|
||||||
|
sed -i '/^# --- postiz release signing/,/^# --- end signing/d' "$GRADLE_PROPS"
|
||||||
|
info "Signing credentials wiped from gradle.properties."
|
||||||
|
|
||||||
|
# ─── 8. Copy to dist/ ─────────────────────────────────────────────────────
|
||||||
|
mkdir -p "$DIST_DIR"
|
||||||
|
TIMESTAMP="$(date +%Y%m%d-%H%M)"
|
||||||
|
OUTPUT="$DIST_DIR/postiz-mobile-$TIMESTAMP.$EXT"
|
||||||
|
cp "$ARTIFACT" "$OUTPUT"
|
||||||
|
|
||||||
|
echo ""
|
||||||
|
info "Build complete!"
|
||||||
|
echo -e " ${GREEN}→ $OUTPUT${NC}"
|
||||||
|
echo ""
|
||||||
@@ -0,0 +1,272 @@
|
|||||||
|
import { Feather } from "@expo/vector-icons";
|
||||||
|
import { Image } from "expo-image";
|
||||||
|
import React, { useCallback, useEffect, useState } from "react";
|
||||||
|
import {
|
||||||
|
ActivityIndicator,
|
||||||
|
FlatList,
|
||||||
|
Modal,
|
||||||
|
ScrollView,
|
||||||
|
StyleSheet,
|
||||||
|
Text,
|
||||||
|
TouchableOpacity,
|
||||||
|
View,
|
||||||
|
} from "react-native";
|
||||||
|
import { useSafeAreaInsets } from "react-native-safe-area-context";
|
||||||
|
import { PostizWorkspace } from "@/context/PostizContext";
|
||||||
|
import { useColors } from "@/hooks/useColors";
|
||||||
|
|
||||||
|
export interface LibraryMediaItem {
|
||||||
|
id: string;
|
||||||
|
path: string;
|
||||||
|
workspaceId: string;
|
||||||
|
createdAt?: string;
|
||||||
|
}
|
||||||
|
|
||||||
|
interface RawMediaItem {
|
||||||
|
id: string;
|
||||||
|
path: string;
|
||||||
|
createdAt?: string;
|
||||||
|
}
|
||||||
|
|
||||||
|
interface Props {
|
||||||
|
visible: boolean;
|
||||||
|
workspaces: PostizWorkspace[];
|
||||||
|
defaultWorkspaceId?: string;
|
||||||
|
maxSelect: number;
|
||||||
|
onClose: () => void;
|
||||||
|
onSelect: (items: LibraryMediaItem[]) => void;
|
||||||
|
onPickFromDevice?: () => void;
|
||||||
|
}
|
||||||
|
|
||||||
|
function resolveUrl(path: string, baseUrl: string): string {
|
||||||
|
if (path.startsWith("http://") || path.startsWith("https://")) return path;
|
||||||
|
const origin = baseUrl.replace(/\/api\/.*$/, "");
|
||||||
|
return `${origin}/${path.replace(/^\//, "")}`;
|
||||||
|
}
|
||||||
|
|
||||||
|
export function MediaLibraryModal({ visible, workspaces, defaultWorkspaceId, maxSelect, onClose, onSelect, onPickFromDevice }: Props) {
|
||||||
|
const colors = useColors();
|
||||||
|
const insets = useSafeAreaInsets();
|
||||||
|
const [activeId, setActiveId] = useState<string>("");
|
||||||
|
const [items, setItems] = useState<RawMediaItem[]>([]);
|
||||||
|
const [loading, setLoading] = useState(false);
|
||||||
|
const [error, setError] = useState<string | null>(null);
|
||||||
|
const [selected, setSelected] = useState<Set<string>>(new Set());
|
||||||
|
|
||||||
|
const activeWorkspace = workspaces.find((w) => w.id === activeId) ?? workspaces[0] ?? null;
|
||||||
|
|
||||||
|
useEffect(() => {
|
||||||
|
if (visible) {
|
||||||
|
const initial = defaultWorkspaceId ?? workspaces[0]?.id ?? "";
|
||||||
|
setActiveId(initial);
|
||||||
|
setSelected(new Set());
|
||||||
|
}
|
||||||
|
}, [visible, defaultWorkspaceId, workspaces]);
|
||||||
|
|
||||||
|
const load = useCallback(async () => {
|
||||||
|
if (!activeWorkspace) return;
|
||||||
|
setLoading(true);
|
||||||
|
setError(null);
|
||||||
|
const apiBase = activeWorkspace.baseUrl.replace(/\/public\/v1$/, "");
|
||||||
|
const url = `${apiBase}/media?page=0&search=`;
|
||||||
|
try {
|
||||||
|
// eslint-disable-next-line no-undef
|
||||||
|
const res = await globalThis.fetch(url, {
|
||||||
|
headers: { Authorization: activeWorkspace.apiKey },
|
||||||
|
});
|
||||||
|
if (!res.ok) {
|
||||||
|
if (res.status === 401 || res.status === 403) {
|
||||||
|
throw new Error("SESSION_REQUIRED");
|
||||||
|
}
|
||||||
|
if (res.status === 404) {
|
||||||
|
throw new Error("ENDPOINT_NOT_FOUND");
|
||||||
|
}
|
||||||
|
throw new Error(`HTTP ${res.status} — ${url}`);
|
||||||
|
}
|
||||||
|
const data = await res.json();
|
||||||
|
const list: RawMediaItem[] = Array.isArray(data)
|
||||||
|
? data
|
||||||
|
: (data?.media ?? data?.items ?? data?.files ?? []);
|
||||||
|
setItems(list);
|
||||||
|
} catch (e: unknown) {
|
||||||
|
setError(e instanceof Error ? e.message : "Failed to load media");
|
||||||
|
} finally {
|
||||||
|
setLoading(false);
|
||||||
|
}
|
||||||
|
}, [activeWorkspace]);
|
||||||
|
|
||||||
|
useEffect(() => {
|
||||||
|
if (visible && activeWorkspace) {
|
||||||
|
setSelected(new Set());
|
||||||
|
load();
|
||||||
|
}
|
||||||
|
}, [visible, activeWorkspace, load]);
|
||||||
|
|
||||||
|
const toggle = (id: string) => {
|
||||||
|
setSelected((prev) => {
|
||||||
|
const next = new Set(prev);
|
||||||
|
if (next.has(id)) { next.delete(id); }
|
||||||
|
else if (next.size < maxSelect) { next.add(id); }
|
||||||
|
return next;
|
||||||
|
});
|
||||||
|
};
|
||||||
|
|
||||||
|
const handleConfirm = () => {
|
||||||
|
if (!activeWorkspace) return;
|
||||||
|
const chosen = items
|
||||||
|
.filter((i) => selected.has(i.id))
|
||||||
|
.map((i): LibraryMediaItem => ({ ...i, workspaceId: activeWorkspace.id }));
|
||||||
|
onSelect(chosen);
|
||||||
|
};
|
||||||
|
|
||||||
|
return (
|
||||||
|
<Modal visible={visible} animationType="slide" onRequestClose={onClose}>
|
||||||
|
<View style={[styles.root, { backgroundColor: colors.background, paddingTop: insets.top }]}>
|
||||||
|
{/* Header */}
|
||||||
|
<View style={[styles.header, { borderBottomColor: colors.border }]}>
|
||||||
|
<TouchableOpacity onPress={onClose} activeOpacity={0.7} style={styles.closeBtn}>
|
||||||
|
<Feather name="x" size={20} color={colors.foreground} />
|
||||||
|
</TouchableOpacity>
|
||||||
|
<Text style={[styles.title, { color: colors.foreground }]}>Media Library</Text>
|
||||||
|
<TouchableOpacity
|
||||||
|
onPress={handleConfirm}
|
||||||
|
disabled={selected.size === 0}
|
||||||
|
activeOpacity={0.8}
|
||||||
|
style={[styles.addBtn, { backgroundColor: selected.size > 0 ? colors.primary : colors.muted }]}
|
||||||
|
>
|
||||||
|
<Text style={[styles.addBtnText, { color: colors.primaryForeground }]}>
|
||||||
|
{selected.size > 0 ? `Add ${selected.size}` : "Add"}
|
||||||
|
</Text>
|
||||||
|
</TouchableOpacity>
|
||||||
|
</View>
|
||||||
|
|
||||||
|
{/* Workspace tabs (only shown when >1 workspace) */}
|
||||||
|
{workspaces.length > 1 && (
|
||||||
|
<ScrollView
|
||||||
|
horizontal
|
||||||
|
showsHorizontalScrollIndicator={false}
|
||||||
|
style={[styles.tabs, { borderBottomColor: colors.border }]}
|
||||||
|
contentContainerStyle={styles.tabsContent}
|
||||||
|
>
|
||||||
|
{workspaces.map((ws) => {
|
||||||
|
const active = ws.id === activeId;
|
||||||
|
return (
|
||||||
|
<TouchableOpacity
|
||||||
|
key={ws.id}
|
||||||
|
onPress={() => setActiveId(ws.id)}
|
||||||
|
activeOpacity={0.7}
|
||||||
|
style={[
|
||||||
|
styles.tab,
|
||||||
|
active && { borderBottomColor: colors.primary, borderBottomWidth: 2 },
|
||||||
|
]}
|
||||||
|
>
|
||||||
|
<Text style={[styles.tabText, { color: active ? colors.primary : colors.mutedForeground }]}>
|
||||||
|
{ws.name}
|
||||||
|
</Text>
|
||||||
|
</TouchableOpacity>
|
||||||
|
);
|
||||||
|
})}
|
||||||
|
</ScrollView>
|
||||||
|
)}
|
||||||
|
|
||||||
|
{/* Content */}
|
||||||
|
{loading ? (
|
||||||
|
<View style={styles.centered}>
|
||||||
|
<ActivityIndicator color={colors.primary} size="large" />
|
||||||
|
</View>
|
||||||
|
) : error === "SESSION_REQUIRED" ? (
|
||||||
|
<View style={styles.centered}>
|
||||||
|
<Feather name="lock" size={28} color={colors.mutedForeground} />
|
||||||
|
<Text style={[styles.errorText, { color: colors.mutedForeground }]}>
|
||||||
|
{"Media library requires a web session.\nAPI key access is not supported by Postiz."}
|
||||||
|
</Text>
|
||||||
|
{onPickFromDevice && (
|
||||||
|
<TouchableOpacity
|
||||||
|
onPress={() => { onClose(); onPickFromDevice(); }}
|
||||||
|
style={[styles.retryBtn, { backgroundColor: colors.primary }]}
|
||||||
|
activeOpacity={0.8}
|
||||||
|
>
|
||||||
|
<Text style={[styles.retryText, { color: colors.primaryForeground }]}>Use device gallery</Text>
|
||||||
|
</TouchableOpacity>
|
||||||
|
)}
|
||||||
|
</View>
|
||||||
|
) : error === "ENDPOINT_NOT_FOUND" ? (
|
||||||
|
<View style={styles.centered}>
|
||||||
|
<Feather name="slash" size={28} color={colors.mutedForeground} />
|
||||||
|
<Text style={[styles.errorText, { color: colors.mutedForeground }]}>
|
||||||
|
{"Media library endpoint not found on this server."}
|
||||||
|
</Text>
|
||||||
|
</View>
|
||||||
|
) : error ? (
|
||||||
|
<View style={styles.centered}>
|
||||||
|
<Feather name="alert-circle" size={28} color={colors.error} />
|
||||||
|
<Text style={[styles.errorText, { color: colors.mutedForeground }]}>{error}</Text>
|
||||||
|
<TouchableOpacity onPress={load} style={[styles.retryBtn, { backgroundColor: colors.primary }]} activeOpacity={0.8}>
|
||||||
|
<Text style={[styles.retryText, { color: colors.primaryForeground }]}>Retry</Text>
|
||||||
|
</TouchableOpacity>
|
||||||
|
</View>
|
||||||
|
) : items.length === 0 ? (
|
||||||
|
<View style={styles.centered}>
|
||||||
|
<Feather name="image" size={36} color={colors.mutedForeground} />
|
||||||
|
<Text style={[styles.emptyText, { color: colors.mutedForeground }]}>No media found</Text>
|
||||||
|
</View>
|
||||||
|
) : (
|
||||||
|
<FlatList
|
||||||
|
data={items}
|
||||||
|
keyExtractor={(item) => item.id}
|
||||||
|
numColumns={3}
|
||||||
|
contentContainerStyle={[styles.grid, { paddingBottom: insets.bottom + 16 }]}
|
||||||
|
renderItem={({ item }) => {
|
||||||
|
const isSelected = selected.has(item.id);
|
||||||
|
const uri = resolveUrl(item.path, activeWorkspace?.baseUrl ?? "");
|
||||||
|
return (
|
||||||
|
<TouchableOpacity onPress={() => toggle(item.id)} activeOpacity={0.8} style={styles.cell}>
|
||||||
|
<Image source={{ uri }} style={styles.cellImage} contentFit="cover" />
|
||||||
|
{isSelected && (
|
||||||
|
<View style={[styles.selectedOverlay, { backgroundColor: colors.primary + "99" }]}>
|
||||||
|
<View style={[styles.checkCircle, { backgroundColor: colors.primary }]}>
|
||||||
|
<Feather name="check" size={14} color="#fff" />
|
||||||
|
</View>
|
||||||
|
</View>
|
||||||
|
)}
|
||||||
|
</TouchableOpacity>
|
||||||
|
);
|
||||||
|
}}
|
||||||
|
/>
|
||||||
|
)}
|
||||||
|
</View>
|
||||||
|
</Modal>
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
const CELL = 120;
|
||||||
|
|
||||||
|
const styles = StyleSheet.create({
|
||||||
|
root: { flex: 1 },
|
||||||
|
header: {
|
||||||
|
flexDirection: "row", alignItems: "center",
|
||||||
|
paddingHorizontal: 16, paddingVertical: 14,
|
||||||
|
borderBottomWidth: StyleSheet.hairlineWidth, gap: 12,
|
||||||
|
},
|
||||||
|
closeBtn: { padding: 4 },
|
||||||
|
title: { flex: 1, fontSize: 17, fontFamily: "Inter_600SemiBold" },
|
||||||
|
addBtn: { paddingHorizontal: 16, paddingVertical: 8, borderRadius: 20 },
|
||||||
|
addBtnText: { fontSize: 14, fontFamily: "Inter_600SemiBold" },
|
||||||
|
tabs: { borderBottomWidth: StyleSheet.hairlineWidth, flexGrow: 0 },
|
||||||
|
tabsContent: { paddingHorizontal: 12, gap: 4 },
|
||||||
|
tab: { paddingHorizontal: 12, paddingVertical: 12 },
|
||||||
|
tabText: { fontSize: 13, fontFamily: "Inter_500Medium" },
|
||||||
|
centered: { flex: 1, alignItems: "center", justifyContent: "center", gap: 12 },
|
||||||
|
errorText: { fontSize: 14, fontFamily: "Inter_400Regular", textAlign: "center", paddingHorizontal: 32 },
|
||||||
|
emptyText: { fontSize: 14, fontFamily: "Inter_400Regular" },
|
||||||
|
retryBtn: { paddingHorizontal: 20, paddingVertical: 10, borderRadius: 10 },
|
||||||
|
retryText: { fontSize: 14, fontFamily: "Inter_600SemiBold" },
|
||||||
|
grid: { padding: 2 },
|
||||||
|
cell: { width: CELL, height: CELL, margin: 2 },
|
||||||
|
cellImage: { width: CELL, height: CELL, borderRadius: 4 },
|
||||||
|
selectedOverlay: {
|
||||||
|
...StyleSheet.absoluteFillObject, borderRadius: 4,
|
||||||
|
alignItems: "center", justifyContent: "center",
|
||||||
|
},
|
||||||
|
checkCircle: { width: 28, height: 28, borderRadius: 14, alignItems: "center", justifyContent: "center" },
|
||||||
|
});
|
||||||
@@ -12,11 +12,14 @@ import {
|
|||||||
import { Swipeable } from "react-native-gesture-handler";
|
import { Swipeable } from "react-native-gesture-handler";
|
||||||
import { useColors } from "@/hooks/useColors";
|
import { useColors } from "@/hooks/useColors";
|
||||||
import { PostizPost } from "@/context/PostizContext";
|
import { PostizPost } from "@/context/PostizContext";
|
||||||
|
import { stripHtml } from "@/lib/stripHtml";
|
||||||
import { StatusBadge } from "./StatusBadge";
|
import { StatusBadge } from "./StatusBadge";
|
||||||
|
|
||||||
interface PostCardProps {
|
interface PostCardProps {
|
||||||
post: PostizPost;
|
post: PostizPost;
|
||||||
onDelete: (id: string) => Promise<void>;
|
onDelete: (id: string) => Promise<void>;
|
||||||
|
onLongPress: (post: PostizPost) => void;
|
||||||
|
onReschedule?: (post: PostizPost) => void;
|
||||||
}
|
}
|
||||||
|
|
||||||
function formatDate(dateStr: string): string {
|
function formatDate(dateStr: string): string {
|
||||||
@@ -43,7 +46,7 @@ function getNetworkIcon(type?: string): React.ComponentProps<typeof Feather>["na
|
|||||||
return "globe";
|
return "globe";
|
||||||
}
|
}
|
||||||
|
|
||||||
export function PostCard({ post, onDelete }: PostCardProps) {
|
export function PostCard({ post, onDelete, onLongPress, onReschedule }: PostCardProps) {
|
||||||
const colors = useColors();
|
const colors = useColors();
|
||||||
const swipeRef = useRef<Swipeable>(null);
|
const swipeRef = useRef<Swipeable>(null);
|
||||||
|
|
||||||
@@ -87,20 +90,54 @@ export function PostCard({ post, onDelete }: PostCardProps) {
|
|||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
const renderLeftActions =
|
||||||
|
post.state === "QUEUE" && onReschedule
|
||||||
|
? (
|
||||||
|
_progress: Animated.AnimatedInterpolation<number>,
|
||||||
|
dragX: Animated.AnimatedInterpolation<number>
|
||||||
|
) => {
|
||||||
|
const scale = dragX.interpolate({
|
||||||
|
inputRange: [0, 80],
|
||||||
|
outputRange: [0.8, 1],
|
||||||
|
extrapolate: "clamp",
|
||||||
|
});
|
||||||
|
return (
|
||||||
|
<TouchableOpacity
|
||||||
|
style={[styles.rescheduleAction, { backgroundColor: colors.warning }]}
|
||||||
|
onPress={() => {
|
||||||
|
swipeRef.current?.close();
|
||||||
|
onReschedule(post);
|
||||||
|
}}
|
||||||
|
activeOpacity={0.8}
|
||||||
|
>
|
||||||
|
<Animated.View style={{ transform: [{ scale }] }}>
|
||||||
|
<Feather name="clock" size={20} color="#fff" />
|
||||||
|
</Animated.View>
|
||||||
|
</TouchableOpacity>
|
||||||
|
);
|
||||||
|
}
|
||||||
|
: undefined;
|
||||||
|
|
||||||
const integrations = post.integrations ?? (post.integration ? [post.integration] : []);
|
const integrations = post.integrations ?? (post.integration ? [post.integration] : []);
|
||||||
|
const plainContent = stripHtml(post.content);
|
||||||
const truncatedContent =
|
const truncatedContent =
|
||||||
post.content.length > 140
|
plainContent.length > 140
|
||||||
? post.content.slice(0, 140) + "…"
|
? plainContent.slice(0, 140) + "…"
|
||||||
: post.content;
|
: plainContent;
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<Swipeable
|
<Swipeable
|
||||||
ref={swipeRef}
|
ref={swipeRef}
|
||||||
renderRightActions={renderRightActions}
|
renderRightActions={renderRightActions}
|
||||||
|
renderLeftActions={renderLeftActions}
|
||||||
rightThreshold={40}
|
rightThreshold={40}
|
||||||
|
leftThreshold={40}
|
||||||
friction={2}
|
friction={2}
|
||||||
>
|
>
|
||||||
<View
|
<TouchableOpacity
|
||||||
|
activeOpacity={0.85}
|
||||||
|
onLongPress={() => onLongPress(post)}
|
||||||
|
delayLongPress={400}
|
||||||
style={[
|
style={[
|
||||||
styles.card,
|
styles.card,
|
||||||
{ backgroundColor: colors.card, borderBottomColor: colors.border },
|
{ backgroundColor: colors.card, borderBottomColor: colors.border },
|
||||||
@@ -129,18 +166,31 @@ export function PostCard({ post, onDelete }: PostCardProps) {
|
|||||||
</Text>
|
</Text>
|
||||||
)}
|
)}
|
||||||
</View>
|
</View>
|
||||||
<StatusBadge status={post.status} />
|
<StatusBadge status={post.state} />
|
||||||
</View>
|
</View>
|
||||||
<Text style={[styles.content, { color: colors.foreground }]}>
|
<Text style={[styles.content, { color: colors.foreground }]}>
|
||||||
{truncatedContent}
|
{truncatedContent}
|
||||||
</Text>
|
</Text>
|
||||||
<View style={styles.footer}>
|
<View style={styles.footer}>
|
||||||
|
{integrations.length > 0 && (
|
||||||
|
<>
|
||||||
|
<Text style={[styles.accountName, { color: colors.mutedForeground }]} numberOfLines={1}>
|
||||||
|
{integrations
|
||||||
|
.slice(0, 2)
|
||||||
|
.map((i) => i.name || i.identifier || "")
|
||||||
|
.filter(Boolean)
|
||||||
|
.join(", ")}
|
||||||
|
{integrations.length > 2 ? ` +${integrations.length - 2}` : ""}
|
||||||
|
</Text>
|
||||||
|
<Text style={[styles.dot, { color: colors.mutedForeground }]}>·</Text>
|
||||||
|
</>
|
||||||
|
)}
|
||||||
<Feather name="clock" size={12} color={colors.mutedForeground} />
|
<Feather name="clock" size={12} color={colors.mutedForeground} />
|
||||||
<Text style={[styles.date, { color: colors.mutedForeground }]}>
|
<Text style={[styles.date, { color: colors.mutedForeground }]}>
|
||||||
{formatDate(post.publishDate)}
|
{formatDate(post.publishDate)}
|
||||||
</Text>
|
</Text>
|
||||||
</View>
|
</View>
|
||||||
</View>
|
</TouchableOpacity>
|
||||||
</Swipeable>
|
</Swipeable>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
@@ -187,9 +237,23 @@ const styles = StyleSheet.create({
|
|||||||
fontSize: 12,
|
fontSize: 12,
|
||||||
fontFamily: "Inter_400Regular",
|
fontFamily: "Inter_400Regular",
|
||||||
},
|
},
|
||||||
|
accountName: {
|
||||||
|
fontSize: 12,
|
||||||
|
fontFamily: "Inter_400Regular",
|
||||||
|
flexShrink: 1,
|
||||||
|
},
|
||||||
|
dot: {
|
||||||
|
fontSize: 12,
|
||||||
|
marginHorizontal: 3,
|
||||||
|
},
|
||||||
deleteAction: {
|
deleteAction: {
|
||||||
width: 72,
|
width: 72,
|
||||||
alignItems: "center",
|
alignItems: "center",
|
||||||
justifyContent: "center",
|
justifyContent: "center",
|
||||||
},
|
},
|
||||||
|
rescheduleAction: {
|
||||||
|
width: 72,
|
||||||
|
alignItems: "center",
|
||||||
|
justifyContent: "center",
|
||||||
|
},
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -8,9 +8,18 @@ import React, {
|
|||||||
useState,
|
useState,
|
||||||
} from "react";
|
} from "react";
|
||||||
|
|
||||||
const API_KEY_STORAGE = "postiz_api_key";
|
const WORKSPACES_KEY = "postiz_workspaces_v2";
|
||||||
const BASE_URL_STORAGE = "postiz_base_url";
|
const LEGACY_API_KEY = "postiz_api_key";
|
||||||
const DEFAULT_BASE_URL = "https://postiz.gyozamancave.fr/public/v1";
|
const LEGACY_BASE_URL = "postiz_base_url";
|
||||||
|
|
||||||
|
export const DEFAULT_BASE_URL = "https://postiz.gyozamancave.fr/api/public/v1";
|
||||||
|
|
||||||
|
export interface PostizWorkspace {
|
||||||
|
id: string;
|
||||||
|
name: string;
|
||||||
|
apiKey: string;
|
||||||
|
baseUrl: string;
|
||||||
|
}
|
||||||
|
|
||||||
export interface PostizIntegration {
|
export interface PostizIntegration {
|
||||||
id: string;
|
id: string;
|
||||||
@@ -19,6 +28,7 @@ export interface PostizIntegration {
|
|||||||
picture?: string;
|
picture?: string;
|
||||||
identifier?: string;
|
identifier?: string;
|
||||||
internalType?: string;
|
internalType?: string;
|
||||||
|
customer?: { id: string; name: string };
|
||||||
}
|
}
|
||||||
|
|
||||||
export interface PostizMediaItem {
|
export interface PostizMediaItem {
|
||||||
@@ -29,12 +39,13 @@ export interface PostizMediaItem {
|
|||||||
export interface PostizPost {
|
export interface PostizPost {
|
||||||
id: string;
|
id: string;
|
||||||
content: string;
|
content: string;
|
||||||
status: "QUEUE" | "PUBLISHED" | "ERROR" | "DRAFT";
|
state: "QUEUE" | "PUBLISHED" | "ERROR" | "DRAFT";
|
||||||
publishDate: string;
|
publishDate: string;
|
||||||
integration?: PostizIntegration;
|
integration?: PostizIntegration;
|
||||||
integrations?: PostizIntegration[];
|
integrations?: PostizIntegration[];
|
||||||
image?: PostizMediaItem[];
|
image?: PostizMediaItem[];
|
||||||
group?: string;
|
group?: string;
|
||||||
|
errorMessage?: string;
|
||||||
}
|
}
|
||||||
|
|
||||||
export interface PostizUploadResult {
|
export interface PostizUploadResult {
|
||||||
@@ -43,52 +54,79 @@ export interface PostizUploadResult {
|
|||||||
}
|
}
|
||||||
|
|
||||||
interface PostizContextValue {
|
interface PostizContextValue {
|
||||||
apiKey: string;
|
workspaces: PostizWorkspace[];
|
||||||
baseUrl: string;
|
|
||||||
isConfigured: boolean;
|
isConfigured: boolean;
|
||||||
isLoading: boolean;
|
isLoading: boolean;
|
||||||
|
clients: Record<string, AxiosInstance>;
|
||||||
|
addWorkspace: (ws: Omit<PostizWorkspace, "id">) => Promise<void>;
|
||||||
|
updateWorkspace: (ws: PostizWorkspace) => Promise<void>;
|
||||||
|
removeWorkspace: (id: string) => Promise<void>;
|
||||||
|
// backward compat for posts.tsx (first workspace)
|
||||||
client: AxiosInstance | null;
|
client: AxiosInstance | null;
|
||||||
saveSettings: (apiKey: string, baseUrl: string) => Promise<void>;
|
apiKey: string;
|
||||||
clearSettings: () => Promise<void>;
|
baseUrl: string;
|
||||||
}
|
}
|
||||||
|
|
||||||
const PostizContext = createContext<PostizContextValue>({
|
const PostizContext = createContext<PostizContextValue>({
|
||||||
apiKey: "",
|
workspaces: [],
|
||||||
baseUrl: DEFAULT_BASE_URL,
|
|
||||||
isConfigured: false,
|
isConfigured: false,
|
||||||
isLoading: true,
|
isLoading: true,
|
||||||
|
clients: {},
|
||||||
|
addWorkspace: async () => {},
|
||||||
|
updateWorkspace: async () => {},
|
||||||
|
removeWorkspace: async () => {},
|
||||||
client: null,
|
client: null,
|
||||||
saveSettings: async () => {},
|
apiKey: "",
|
||||||
clearSettings: async () => {},
|
baseUrl: DEFAULT_BASE_URL,
|
||||||
});
|
});
|
||||||
|
|
||||||
function createClient(apiKey: string, baseUrl: string): AxiosInstance {
|
function makeClient(ws: PostizWorkspace): AxiosInstance {
|
||||||
return axios.create({
|
const baseURL = ws.baseUrl.endsWith("/") ? ws.baseUrl : ws.baseUrl + "/";
|
||||||
baseURL: baseUrl,
|
const instance = axios.create({
|
||||||
headers: {
|
baseURL,
|
||||||
Authorization: apiKey,
|
headers: { Authorization: ws.apiKey, "Content-Type": "application/json" },
|
||||||
"Content-Type": "application/json",
|
|
||||||
},
|
|
||||||
timeout: 15000,
|
timeout: 15000,
|
||||||
});
|
});
|
||||||
|
instance.interceptors.request.use((config) => {
|
||||||
|
console.log(">>> REQUEST:", config.method?.toUpperCase(), (config.baseURL ?? "") + (config.url ?? ""));
|
||||||
|
return config;
|
||||||
|
});
|
||||||
|
return instance;
|
||||||
|
}
|
||||||
|
|
||||||
|
function buildClients(list: PostizWorkspace[]): Record<string, AxiosInstance> {
|
||||||
|
return Object.fromEntries(list.map((ws) => [ws.id, makeClient(ws)]));
|
||||||
}
|
}
|
||||||
|
|
||||||
export function PostizProvider({ children }: { children: React.ReactNode }) {
|
export function PostizProvider({ children }: { children: React.ReactNode }) {
|
||||||
const [apiKey, setApiKey] = useState("");
|
const [workspaces, setWorkspaces] = useState<PostizWorkspace[]>([]);
|
||||||
const [baseUrl, setBaseUrl] = useState(DEFAULT_BASE_URL);
|
const [clients, setClients] = useState<Record<string, AxiosInstance>>({});
|
||||||
const [isLoading, setIsLoading] = useState(true);
|
const [isLoading, setIsLoading] = useState(true);
|
||||||
const [client, setClient] = useState<AxiosInstance | null>(null);
|
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
(async () => {
|
(async () => {
|
||||||
try {
|
try {
|
||||||
const storedKey = await SecureStore.getItemAsync(API_KEY_STORAGE);
|
const stored = await SecureStore.getItemAsync(WORKSPACES_KEY);
|
||||||
const storedUrl = await SecureStore.getItemAsync(BASE_URL_STORAGE);
|
if (stored) {
|
||||||
if (storedKey) {
|
const list: PostizWorkspace[] = JSON.parse(stored);
|
||||||
const url = storedUrl || DEFAULT_BASE_URL;
|
setWorkspaces(list);
|
||||||
setApiKey(storedKey);
|
setClients(buildClients(list));
|
||||||
setBaseUrl(url);
|
} else {
|
||||||
setClient(createClient(storedKey, url));
|
// Migrate legacy single-workspace config
|
||||||
|
const legacyKey = await SecureStore.getItemAsync(LEGACY_API_KEY);
|
||||||
|
const legacyUrl = await SecureStore.getItemAsync(LEGACY_BASE_URL);
|
||||||
|
if (legacyKey) {
|
||||||
|
const migrated: PostizWorkspace = {
|
||||||
|
id: Date.now().toString(),
|
||||||
|
name: "Default",
|
||||||
|
apiKey: legacyKey,
|
||||||
|
baseUrl: (legacyUrl || DEFAULT_BASE_URL).replace(/\/$/, ""),
|
||||||
|
};
|
||||||
|
const list = [migrated];
|
||||||
|
await SecureStore.setItemAsync(WORKSPACES_KEY, JSON.stringify(list));
|
||||||
|
setWorkspaces(list);
|
||||||
|
setClients(buildClients(list));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
} catch {
|
} catch {
|
||||||
} finally {
|
} finally {
|
||||||
@@ -97,35 +135,48 @@ export function PostizProvider({ children }: { children: React.ReactNode }) {
|
|||||||
})();
|
})();
|
||||||
}, []);
|
}, []);
|
||||||
|
|
||||||
const saveSettings = useCallback(
|
const persist = useCallback(async (list: PostizWorkspace[]) => {
|
||||||
async (newApiKey: string, newBaseUrl: string) => {
|
await SecureStore.setItemAsync(WORKSPACES_KEY, JSON.stringify(list));
|
||||||
await SecureStore.setItemAsync(API_KEY_STORAGE, newApiKey);
|
setWorkspaces(list);
|
||||||
await SecureStore.setItemAsync(BASE_URL_STORAGE, newBaseUrl);
|
setClients(buildClients(list));
|
||||||
setApiKey(newApiKey);
|
}, []);
|
||||||
setBaseUrl(newBaseUrl);
|
|
||||||
setClient(createClient(newApiKey, newBaseUrl));
|
const addWorkspace = useCallback(
|
||||||
|
async (ws: Omit<PostizWorkspace, "id">) => {
|
||||||
|
await persist([...workspaces, { ...ws, id: Date.now().toString() }]);
|
||||||
},
|
},
|
||||||
[]
|
[workspaces, persist]
|
||||||
);
|
);
|
||||||
|
|
||||||
const clearSettings = useCallback(async () => {
|
const updateWorkspace = useCallback(
|
||||||
await SecureStore.deleteItemAsync(API_KEY_STORAGE);
|
async (ws: PostizWorkspace) => {
|
||||||
await SecureStore.deleteItemAsync(BASE_URL_STORAGE);
|
await persist(workspaces.map((w) => (w.id === ws.id ? ws : w)));
|
||||||
setApiKey("");
|
},
|
||||||
setBaseUrl(DEFAULT_BASE_URL);
|
[workspaces, persist]
|
||||||
setClient(null);
|
);
|
||||||
}, []);
|
|
||||||
|
const removeWorkspace = useCallback(
|
||||||
|
async (id: string) => {
|
||||||
|
await persist(workspaces.filter((w) => w.id !== id));
|
||||||
|
},
|
||||||
|
[workspaces, persist]
|
||||||
|
);
|
||||||
|
|
||||||
|
const primaryWorkspace = workspaces[0] ?? null;
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<PostizContext.Provider
|
<PostizContext.Provider
|
||||||
value={{
|
value={{
|
||||||
apiKey,
|
workspaces,
|
||||||
baseUrl,
|
isConfigured: workspaces.length > 0,
|
||||||
isConfigured: !!apiKey,
|
|
||||||
isLoading,
|
isLoading,
|
||||||
client,
|
clients,
|
||||||
saveSettings,
|
addWorkspace,
|
||||||
clearSettings,
|
updateWorkspace,
|
||||||
|
removeWorkspace,
|
||||||
|
client: primaryWorkspace ? (clients[primaryWorkspace.id] ?? null) : null,
|
||||||
|
apiKey: primaryWorkspace?.apiKey ?? "",
|
||||||
|
baseUrl: primaryWorkspace?.baseUrl ?? DEFAULT_BASE_URL,
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
{children}
|
{children}
|
||||||
|
|||||||
@@ -0,0 +1,11 @@
|
|||||||
|
{
|
||||||
|
"cli": {
|
||||||
|
"version": ">= 16.0.0"
|
||||||
|
},
|
||||||
|
"build": {
|
||||||
|
"preview": {
|
||||||
|
"android": { "buildType": "apk" },
|
||||||
|
"ios": { "simulator": true }
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -16,9 +16,6 @@ import colors from "@/constants/colors";
|
|||||||
*/
|
*/
|
||||||
export function useColors() {
|
export function useColors() {
|
||||||
const scheme = useColorScheme();
|
const scheme = useColorScheme();
|
||||||
const palette =
|
const palette = scheme === "dark" ? colors.dark : colors.light;
|
||||||
scheme === "dark" && "dark" in colors
|
|
||||||
? (colors as Record<string, typeof colors.light>).dark
|
|
||||||
: colors.light;
|
|
||||||
return { ...palette, radius: colors.radius };
|
return { ...palette, radius: colors.radius };
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,22 +1,21 @@
|
|||||||
import * as Notifications from "expo-notifications";
|
|
||||||
import { useCallback, useEffect, useRef } from "react";
|
import { useCallback, useEffect, useRef } from "react";
|
||||||
import { Platform } from "react-native";
|
import { Platform } from "react-native";
|
||||||
import { usePostiz } from "@/context/PostizContext";
|
import { usePostiz } from "@/context/PostizContext";
|
||||||
import { PostizPost } from "@/context/PostizContext";
|
import { PostizPost } from "@/context/PostizContext";
|
||||||
|
import { stripHtml } from "@/lib/stripHtml";
|
||||||
Notifications.setNotificationHandler({
|
|
||||||
handleNotification: async () => ({
|
|
||||||
shouldShowAlert: true,
|
|
||||||
shouldPlaySound: true,
|
|
||||||
shouldSetBadge: true,
|
|
||||||
shouldShowBanner: true,
|
|
||||||
shouldShowList: true,
|
|
||||||
}),
|
|
||||||
});
|
|
||||||
|
|
||||||
const POLL_INTERVAL_MS = 15 * 60 * 1000;
|
const POLL_INTERVAL_MS = 15 * 60 * 1000;
|
||||||
const SEEN_KEY = "postiz_seen_statuses";
|
const SEEN_KEY = "postiz_seen_statuses";
|
||||||
|
|
||||||
|
function isExpoGo(): boolean {
|
||||||
|
try {
|
||||||
|
const Constants = require("expo-constants").default;
|
||||||
|
return Constants?.executionEnvironment === "storeClient";
|
||||||
|
} catch {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
async function getSeenStatuses(): Promise<Record<string, string>> {
|
async function getSeenStatuses(): Promise<Record<string, string>> {
|
||||||
try {
|
try {
|
||||||
const { default: AsyncStorage } = await import(
|
const { default: AsyncStorage } = await import(
|
||||||
@@ -39,18 +38,19 @@ async function saveSeenStatuses(map: Record<string, string>) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
async function sendStatusNotification(post: PostizPost) {
|
async function sendStatusNotification(post: PostizPost) {
|
||||||
const isError = post.status === "ERROR";
|
if (Platform.OS === "web" || isExpoGo()) return;
|
||||||
|
try {
|
||||||
|
const Notifications = require("expo-notifications");
|
||||||
|
const isError = post.state === "ERROR";
|
||||||
await Notifications.scheduleNotificationAsync({
|
await Notifications.scheduleNotificationAsync({
|
||||||
content: {
|
content: {
|
||||||
title: isError ? "Post failed to publish" : "Post published!",
|
title: isError ? "Post failed to publish" : "Post published!",
|
||||||
body:
|
body: (() => { const t = stripHtml(post.content); return t.length > 80 ? t.slice(0, 80) + "…" : t; })(),
|
||||||
post.content.length > 80
|
|
||||||
? post.content.slice(0, 80) + "…"
|
|
||||||
: post.content,
|
|
||||||
data: { postId: post.id },
|
data: { postId: post.id },
|
||||||
},
|
},
|
||||||
trigger: null,
|
trigger: null,
|
||||||
});
|
});
|
||||||
|
} catch {}
|
||||||
}
|
}
|
||||||
|
|
||||||
export function useNotifications() {
|
export function useNotifications() {
|
||||||
@@ -59,7 +59,18 @@ export function useNotifications() {
|
|||||||
const permissionGranted = useRef(false);
|
const permissionGranted = useRef(false);
|
||||||
|
|
||||||
const requestPermissions = useCallback(async () => {
|
const requestPermissions = useCallback(async () => {
|
||||||
if (Platform.OS === "web") return false;
|
if (Platform.OS === "web" || isExpoGo()) return false;
|
||||||
|
try {
|
||||||
|
const Notifications = require("expo-notifications");
|
||||||
|
Notifications.setNotificationHandler({
|
||||||
|
handleNotification: async () => ({
|
||||||
|
shouldShowAlert: true,
|
||||||
|
shouldPlaySound: true,
|
||||||
|
shouldSetBadge: true,
|
||||||
|
shouldShowBanner: true,
|
||||||
|
shouldShowList: true,
|
||||||
|
}),
|
||||||
|
});
|
||||||
const { status: existing } = await Notifications.getPermissionsAsync();
|
const { status: existing } = await Notifications.getPermissionsAsync();
|
||||||
if (existing === "granted") {
|
if (existing === "granted") {
|
||||||
permissionGranted.current = true;
|
permissionGranted.current = true;
|
||||||
@@ -68,48 +79,44 @@ export function useNotifications() {
|
|||||||
const { status } = await Notifications.requestPermissionsAsync();
|
const { status } = await Notifications.requestPermissionsAsync();
|
||||||
permissionGranted.current = status === "granted";
|
permissionGranted.current = status === "granted";
|
||||||
return permissionGranted.current;
|
return permissionGranted.current;
|
||||||
|
} catch {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
}, []);
|
}, []);
|
||||||
|
|
||||||
const checkForStatusChanges = useCallback(async () => {
|
const checkForStatusChanges = useCallback(async () => {
|
||||||
if (!client || !permissionGranted.current) return;
|
if (!client || !permissionGranted.current) return;
|
||||||
|
|
||||||
try {
|
try {
|
||||||
const now = new Date();
|
const now = new Date();
|
||||||
const from = new Date(now);
|
const from = new Date(now);
|
||||||
from.setDate(from.getDate() - 7);
|
from.setDate(from.getDate() - 7);
|
||||||
|
const res = await client.get("posts", {
|
||||||
const res = await client.get("/posts", {
|
|
||||||
params: {
|
params: {
|
||||||
startDate: from.toISOString(),
|
startDate: from.toISOString(),
|
||||||
endDate: now.toISOString(),
|
endDate: now.toISOString(),
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
|
||||||
const posts: PostizPost[] = Array.isArray(res.data)
|
const posts: PostizPost[] = Array.isArray(res.data)
|
||||||
? res.data
|
? res.data
|
||||||
: res.data?.posts ?? [];
|
: res.data?.posts ?? [];
|
||||||
|
|
||||||
const seen = await getSeenStatuses();
|
const seen = await getSeenStatuses();
|
||||||
const updated: Record<string, string> = { ...seen };
|
const updated: Record<string, string> = { ...seen };
|
||||||
const toNotify: PostizPost[] = [];
|
const toNotify: PostizPost[] = [];
|
||||||
|
|
||||||
for (const post of posts) {
|
for (const post of posts) {
|
||||||
const prev = seen[post.id];
|
const prev = seen[post.id];
|
||||||
if (prev === undefined) {
|
if (prev === undefined) {
|
||||||
updated[post.id] = post.status;
|
updated[post.id] = post.state;
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
if (
|
if (
|
||||||
prev !== post.status &&
|
prev !== post.state &&
|
||||||
(post.status === "PUBLISHED" || post.status === "ERROR")
|
(post.state === "PUBLISHED" || post.state === "ERROR")
|
||||||
) {
|
) {
|
||||||
toNotify.push(post);
|
toNotify.push(post);
|
||||||
}
|
}
|
||||||
updated[post.id] = post.status;
|
updated[post.id] = post.state;
|
||||||
}
|
}
|
||||||
|
|
||||||
await saveSeenStatuses(updated);
|
await saveSeenStatuses(updated);
|
||||||
|
|
||||||
for (const post of toNotify) {
|
for (const post of toNotify) {
|
||||||
await sendStatusNotification(post);
|
await sendStatusNotification(post);
|
||||||
}
|
}
|
||||||
@@ -117,21 +124,16 @@ export function useNotifications() {
|
|||||||
}, [client]);
|
}, [client]);
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
if (!isConfigured || Platform.OS === "web") return;
|
if (!isConfigured || Platform.OS === "web" || isExpoGo()) return;
|
||||||
|
|
||||||
let mounted = true;
|
let mounted = true;
|
||||||
|
|
||||||
(async () => {
|
(async () => {
|
||||||
const granted = await requestPermissions();
|
const granted = await requestPermissions();
|
||||||
if (!granted || !mounted) return;
|
if (!granted || !mounted) return;
|
||||||
|
|
||||||
await checkForStatusChanges();
|
await checkForStatusChanges();
|
||||||
|
|
||||||
intervalRef.current = setInterval(() => {
|
intervalRef.current = setInterval(() => {
|
||||||
checkForStatusChanges();
|
checkForStatusChanges();
|
||||||
}, POLL_INTERVAL_MS);
|
}, POLL_INTERVAL_MS);
|
||||||
})();
|
})();
|
||||||
|
|
||||||
return () => {
|
return () => {
|
||||||
mounted = false;
|
mounted = false;
|
||||||
if (intervalRef.current) {
|
if (intervalRef.current) {
|
||||||
|
|||||||
+46
@@ -0,0 +1,46 @@
|
|||||||
|
#!/usr/bin/env bash
|
||||||
|
# install-android-sdk.sh — Install Android SDK command-line tools only (no Android Studio).
|
||||||
|
# Installs to ~/android-sdk. Run once; takes ~1 GB of disk space.
|
||||||
|
|
||||||
|
set -euo pipefail
|
||||||
|
|
||||||
|
SDK_DIR="$HOME/android-sdk"
|
||||||
|
CMDLINE_TOOLS_URL="https://dl.google.com/android/repository/commandlinetools-linux-12266719_latest.zip"
|
||||||
|
CMDLINE_ZIP="/tmp/android-cmdline-tools.zip"
|
||||||
|
|
||||||
|
GREEN='\033[0;32m'; NC='\033[0m'
|
||||||
|
info() { echo -e "${GREEN}[sdk-install]${NC} $*"; }
|
||||||
|
|
||||||
|
if [ -d "$SDK_DIR/cmdline-tools/latest/bin" ]; then
|
||||||
|
info "Android SDK already installed at $SDK_DIR"
|
||||||
|
exit 0
|
||||||
|
fi
|
||||||
|
|
||||||
|
info "Downloading Android command-line tools…"
|
||||||
|
wget -q --show-progress -O "$CMDLINE_ZIP" "$CMDLINE_TOOLS_URL"
|
||||||
|
|
||||||
|
info "Extracting…"
|
||||||
|
mkdir -p "$SDK_DIR/cmdline-tools"
|
||||||
|
unzip -q "$CMDLINE_ZIP" -d "$SDK_DIR/cmdline-tools"
|
||||||
|
mv "$SDK_DIR/cmdline-tools/cmdline-tools" "$SDK_DIR/cmdline-tools/latest"
|
||||||
|
rm "$CMDLINE_ZIP"
|
||||||
|
|
||||||
|
export ANDROID_HOME="$SDK_DIR"
|
||||||
|
export PATH="$PATH:$SDK_DIR/cmdline-tools/latest/bin:$SDK_DIR/platform-tools"
|
||||||
|
|
||||||
|
info "Accepting licenses…"
|
||||||
|
yes | sdkmanager --licenses > /dev/null 2>&1 || true
|
||||||
|
|
||||||
|
info "Installing SDK components (platform-tools, build-tools 35, NDK 28)…"
|
||||||
|
sdkmanager \
|
||||||
|
"platform-tools" \
|
||||||
|
"platforms;android-35" \
|
||||||
|
"build-tools;35.0.0" \
|
||||||
|
"ndk;28.2.13676358"
|
||||||
|
|
||||||
|
info "Done. Add this to your ~/.bashrc or ~/.zshrc:"
|
||||||
|
echo ""
|
||||||
|
echo ' export ANDROID_HOME="$HOME/android-sdk"'
|
||||||
|
echo ' export PATH="$PATH:$ANDROID_HOME/cmdline-tools/latest/bin:$ANDROID_HOME/platform-tools"'
|
||||||
|
echo ""
|
||||||
|
info "Then reload your shell: source ~/.bashrc"
|
||||||
@@ -0,0 +1,20 @@
|
|||||||
|
import axios from "axios";
|
||||||
|
|
||||||
|
export function extractError(err: unknown): string {
|
||||||
|
if (axios.isAxiosError(err)) {
|
||||||
|
const status = err.response?.status;
|
||||||
|
const data = err.response?.data;
|
||||||
|
if (data) {
|
||||||
|
const body =
|
||||||
|
typeof data === "string"
|
||||||
|
? data.slice(0, 200)
|
||||||
|
: (data?.message ?? data?.error ?? JSON.stringify(data)).toString().slice(0, 200);
|
||||||
|
return status ? `HTTP ${status}: ${body}` : body;
|
||||||
|
}
|
||||||
|
if (status) return `HTTP ${status} — ${err.message}`;
|
||||||
|
if (err.code === "ECONNABORTED") return "Request timed out. Check that the URL is reachable.";
|
||||||
|
if (err.message) return err.message;
|
||||||
|
}
|
||||||
|
if (err instanceof Error) return err.message;
|
||||||
|
return "Unknown error";
|
||||||
|
}
|
||||||
@@ -0,0 +1,20 @@
|
|||||||
|
export function stripHtml(html: string | null | undefined): string {
|
||||||
|
if (!html) return "";
|
||||||
|
// Decode entities first so encoded tags like <p> are also stripped
|
||||||
|
let s = html
|
||||||
|
.replace(/&/g, "&")
|
||||||
|
.replace(/</g, "<")
|
||||||
|
.replace(/>/g, ">")
|
||||||
|
.replace(/"/g, '"')
|
||||||
|
.replace(/'/g, "'")
|
||||||
|
.replace(/ /g, " ");
|
||||||
|
// Block-level tags → newlines
|
||||||
|
s = s
|
||||||
|
.replace(/<br\s*\/?>/gi, "\n")
|
||||||
|
.replace(/<\/p>/gi, "\n")
|
||||||
|
.replace(/<\/div>/gi, "\n")
|
||||||
|
.replace(/<\/li>/gi, "\n");
|
||||||
|
// Strip all remaining tags
|
||||||
|
s = s.replace(/<[^>]+>/g, "");
|
||||||
|
return s.replace(/\n{3,}/g, "\n\n").trim();
|
||||||
|
}
|
||||||
@@ -1,3 +1,16 @@
|
|||||||
const { getDefaultConfig } = require("expo/metro-config");
|
const { getDefaultConfig } = require("expo/metro-config");
|
||||||
|
const path = require("path");
|
||||||
|
|
||||||
module.exports = getDefaultConfig(__dirname);
|
const projectRoot = __dirname;
|
||||||
|
const workspaceRoot = path.resolve(projectRoot, "../..");
|
||||||
|
|
||||||
|
const config = getDefaultConfig(projectRoot);
|
||||||
|
|
||||||
|
// pnpm monorepo: expose workspace root node_modules to Metro
|
||||||
|
config.watchFolders = [workspaceRoot];
|
||||||
|
config.resolver.nodeModulesPaths = [
|
||||||
|
path.resolve(projectRoot, "node_modules"),
|
||||||
|
path.resolve(workspaceRoot, "node_modules"),
|
||||||
|
];
|
||||||
|
|
||||||
|
module.exports = config;
|
||||||
|
|||||||
@@ -4,13 +4,16 @@
|
|||||||
"private": true,
|
"private": true,
|
||||||
"main": "expo-router/entry",
|
"main": "expo-router/entry",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"dev": "EXPO_PACKAGER_PROXY_URL=https://$REPLIT_EXPO_DEV_DOMAIN EXPO_PUBLIC_DOMAIN=$REPLIT_DEV_DOMAIN EXPO_PUBLIC_REPL_ID=$REPL_ID REACT_NATIVE_PACKAGER_HOSTNAME=$REPLIT_DEV_DOMAIN pnpm exec expo start --localhost --port $PORT",
|
"dev": "pnpm exec expo start",
|
||||||
"build": "node scripts/build.js",
|
"build": "node scripts/build.js",
|
||||||
"serve": "node server/serve.js",
|
"serve": "node server/serve.js",
|
||||||
"typecheck": "tsc -p tsconfig.json --noEmit"
|
"typecheck": "tsc -p tsconfig.json --noEmit",
|
||||||
|
"android": "expo run:android",
|
||||||
|
"ios": "expo run:ios"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@babel/core": "^7.25.2",
|
"@babel/core": "^7.25.2",
|
||||||
|
"babel-preset-expo": "~54.0.10",
|
||||||
"@expo-google-fonts/inter": "^0.4.0",
|
"@expo-google-fonts/inter": "^0.4.0",
|
||||||
"@expo/cli": "54.0.23",
|
"@expo/cli": "54.0.23",
|
||||||
"@expo/ngrok": "^4.1.0",
|
"@expo/ngrok": "^4.1.0",
|
||||||
@@ -23,13 +26,14 @@
|
|||||||
"@ungap/structured-clone": "^1.3.0",
|
"@ungap/structured-clone": "^1.3.0",
|
||||||
"@workspace/api-client-react": "workspace:*",
|
"@workspace/api-client-react": "workspace:*",
|
||||||
"babel-plugin-react-compiler": "^19.0.0-beta-e993439-20250117",
|
"babel-plugin-react-compiler": "^19.0.0-beta-e993439-20250117",
|
||||||
"expo": "~54.0.27",
|
"expo": "~54.0.34",
|
||||||
"expo-blur": "~15.0.8",
|
"expo-blur": "~15.0.8",
|
||||||
"expo-constants": "~18.0.11",
|
"expo-constants": "~18.0.11",
|
||||||
"expo-font": "~14.0.10",
|
"expo-font": "~14.0.10",
|
||||||
"expo-glass-effect": "~0.1.4",
|
"expo-glass-effect": "~0.1.4",
|
||||||
"expo-haptics": "~15.0.8",
|
"expo-haptics": "~15.0.8",
|
||||||
"expo-image": "~3.0.11",
|
"expo-image": "~3.0.11",
|
||||||
|
"expo-image-manipulator": "~13.0.6",
|
||||||
"expo-image-picker": "~17.0.9",
|
"expo-image-picker": "~17.0.9",
|
||||||
"expo-linear-gradient": "~15.0.8",
|
"expo-linear-gradient": "~15.0.8",
|
||||||
"expo-linking": "~8.0.10",
|
"expo-linking": "~8.0.10",
|
||||||
@@ -56,11 +60,14 @@
|
|||||||
"zod-validation-error": "^3.4.0"
|
"zod-validation-error": "^3.4.0"
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@react-native-community/datetimepicker": "^9.1.0",
|
"@react-native-community/datetimepicker": "8.4.4",
|
||||||
"axios": "^1.15.2",
|
"axios": "^1.15.2",
|
||||||
"expo-notifications": "^55.0.22",
|
"expo-clipboard": "~8.0.8",
|
||||||
"expo-secure-store": "^55.0.13",
|
"expo-notifications": "~0.32.17",
|
||||||
"expo-task-manager": "^55.0.15",
|
"expo-secure-store": "~15.0.8",
|
||||||
"react-native-calendars": "^1.1314.0"
|
"react-native-calendars": "^1.1314.0",
|
||||||
|
"expo": "~54.0.34",
|
||||||
|
"react": "19.1.0",
|
||||||
|
"react-native": "0.81.5"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -55,20 +55,12 @@ function stripProtocol(domain) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
function getDeploymentDomain() {
|
function getDeploymentDomain() {
|
||||||
if (process.env.REPLIT_INTERNAL_APP_DOMAIN) {
|
|
||||||
return stripProtocol(process.env.REPLIT_INTERNAL_APP_DOMAIN);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (process.env.REPLIT_DEV_DOMAIN) {
|
|
||||||
return stripProtocol(process.env.REPLIT_DEV_DOMAIN);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (process.env.EXPO_PUBLIC_DOMAIN) {
|
if (process.env.EXPO_PUBLIC_DOMAIN) {
|
||||||
return stripProtocol(process.env.EXPO_PUBLIC_DOMAIN);
|
return stripProtocol(process.env.EXPO_PUBLIC_DOMAIN);
|
||||||
}
|
}
|
||||||
|
|
||||||
console.error(
|
console.error(
|
||||||
"ERROR: No deployment domain found. Set REPLIT_INTERNAL_APP_DOMAIN, REPLIT_DEV_DOMAIN, or EXPO_PUBLIC_DOMAIN",
|
"ERROR: No deployment domain found. Set EXPO_PUBLIC_DOMAIN.",
|
||||||
);
|
);
|
||||||
process.exit(1);
|
process.exit(1);
|
||||||
}
|
}
|
||||||
@@ -124,7 +116,7 @@ async function checkMetroHealth() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
function getExpoPublicReplId() {
|
function getExpoPublicReplId() {
|
||||||
return process.env.REPL_ID || process.env.EXPO_PUBLIC_REPL_ID;
|
return process.env.EXPO_PUBLIC_REPL_ID;
|
||||||
}
|
}
|
||||||
|
|
||||||
async function startMetro(expoPublicDomain, expoPublicReplId) {
|
async function startMetro(expoPublicDomain, expoPublicReplId) {
|
||||||
|
|||||||
Generated
+285
-94
@@ -169,9 +169,6 @@ importers:
|
|||||||
'@workspace/db':
|
'@workspace/db':
|
||||||
specifier: workspace:*
|
specifier: workspace:*
|
||||||
version: link:../../lib/db
|
version: link:../../lib/db
|
||||||
cookie-parser:
|
|
||||||
specifier: ^1.4.7
|
|
||||||
version: 1.4.7
|
|
||||||
cors:
|
cors:
|
||||||
specifier: ^2
|
specifier: ^2
|
||||||
version: 2.8.6
|
version: 2.8.6
|
||||||
@@ -188,9 +185,6 @@ importers:
|
|||||||
specifier: ^10
|
specifier: ^10
|
||||||
version: 10.5.0
|
version: 10.5.0
|
||||||
devDependencies:
|
devDependencies:
|
||||||
'@types/cookie-parser':
|
|
||||||
specifier: ^1.4.10
|
|
||||||
version: 1.4.10(@types/express@5.0.6)
|
|
||||||
'@types/cors':
|
'@types/cors':
|
||||||
specifier: ^2.8.19
|
specifier: ^2.8.19
|
||||||
version: 2.8.19
|
version: 2.8.19
|
||||||
@@ -399,20 +393,20 @@ importers:
|
|||||||
artifacts/postiz-mobile:
|
artifacts/postiz-mobile:
|
||||||
dependencies:
|
dependencies:
|
||||||
'@react-native-community/datetimepicker':
|
'@react-native-community/datetimepicker':
|
||||||
specifier: ^9.1.0
|
specifier: 8.4.4
|
||||||
version: 9.1.0(expo@54.0.34)(react-native@0.81.5(@babel/core@7.29.0)(@types/react@19.1.17)(react@19.1.0))(react@19.1.0)
|
version: 8.4.4(expo@54.0.34)(react-native@0.81.5(@babel/core@7.29.0)(@types/react@19.1.17)(react@19.1.0))(react@19.1.0)
|
||||||
axios:
|
axios:
|
||||||
specifier: ^1.15.2
|
specifier: ^1.15.2
|
||||||
version: 1.15.2
|
version: 1.15.2
|
||||||
|
expo-clipboard:
|
||||||
|
specifier: ~8.0.8
|
||||||
|
version: 8.0.8(expo@54.0.34)(react-native@0.81.5(@babel/core@7.29.0)(@types/react@19.1.17)(react@19.1.0))(react@19.1.0)
|
||||||
expo-notifications:
|
expo-notifications:
|
||||||
specifier: ^55.0.22
|
specifier: ~0.32.17
|
||||||
version: 55.0.22(expo@54.0.34)(react-native@0.81.5(@babel/core@7.29.0)(@types/react@19.1.17)(react@19.1.0))(react@19.1.0)(typescript@5.9.3)
|
version: 0.32.17(expo@54.0.34)(react-native@0.81.5(@babel/core@7.29.0)(@types/react@19.1.17)(react@19.1.0))(react@19.1.0)(typescript@5.9.3)
|
||||||
expo-secure-store:
|
expo-secure-store:
|
||||||
specifier: ^55.0.13
|
specifier: ~15.0.8
|
||||||
version: 55.0.13(expo@54.0.34)
|
version: 15.0.8(expo@54.0.34)
|
||||||
expo-task-manager:
|
|
||||||
specifier: ^55.0.15
|
|
||||||
version: 55.0.15(expo@54.0.34)(react-native@0.81.5(@babel/core@7.29.0)(@types/react@19.1.17)(react@19.1.0))
|
|
||||||
react-native-calendars:
|
react-native-calendars:
|
||||||
specifier: ^1.1314.0
|
specifier: ^1.1314.0
|
||||||
version: 1.1314.0(react-native@0.81.5(@babel/core@7.29.0)(@types/react@19.1.17)(react@19.1.0))(react@19.1.0)
|
version: 1.1314.0(react-native@0.81.5(@babel/core@7.29.0)(@types/react@19.1.17)(react@19.1.0))(react@19.1.0)
|
||||||
@@ -456,8 +450,11 @@ importers:
|
|||||||
babel-plugin-react-compiler:
|
babel-plugin-react-compiler:
|
||||||
specifier: ^19.0.0-beta-e993439-20250117
|
specifier: ^19.0.0-beta-e993439-20250117
|
||||||
version: 19.0.0-beta-ebf51a3-20250411
|
version: 19.0.0-beta-ebf51a3-20250411
|
||||||
|
babel-preset-expo:
|
||||||
|
specifier: ~54.0.10
|
||||||
|
version: 54.0.10(@babel/core@7.29.0)(@babel/runtime@7.28.6)(expo@54.0.34)(react-refresh@0.18.0)
|
||||||
expo:
|
expo:
|
||||||
specifier: ~54.0.27
|
specifier: ~54.0.34
|
||||||
version: 54.0.34(@babel/core@7.29.0)(@expo/metro-runtime@6.1.2)(expo-router@6.0.23)(react-native@0.81.5(@babel/core@7.29.0)(@types/react@19.1.17)(react@19.1.0))(react@19.1.0)(typescript@5.9.3)
|
version: 54.0.34(@babel/core@7.29.0)(@expo/metro-runtime@6.1.2)(expo-router@6.0.23)(react-native@0.81.5(@babel/core@7.29.0)(@types/react@19.1.17)(react@19.1.0))(react@19.1.0)(typescript@5.9.3)
|
||||||
expo-blur:
|
expo-blur:
|
||||||
specifier: ~15.0.8
|
specifier: ~15.0.8
|
||||||
@@ -1194,10 +1191,6 @@ packages:
|
|||||||
'@expo/env@2.0.11':
|
'@expo/env@2.0.11':
|
||||||
resolution: {integrity: sha512-xV+ps6YCW7XIPVUwFVCRN2nox09dnRwy8uIjwHWTODu0zFw4kp4omnVkl0OOjuu2XOe7tdgAHxikrkJt9xB/7Q==}
|
resolution: {integrity: sha512-xV+ps6YCW7XIPVUwFVCRN2nox09dnRwy8uIjwHWTODu0zFw4kp4omnVkl0OOjuu2XOe7tdgAHxikrkJt9xB/7Q==}
|
||||||
|
|
||||||
'@expo/env@2.1.1':
|
|
||||||
resolution: {integrity: sha512-rVvHC4I6xlPcg+mAO09ydUi2Wjv1ZytpLmHOSzvXzBAz9mMrJggqCe4s4dubjJvi/Ino/xQCLhbaLCnTtLpikg==}
|
|
||||||
engines: {node: '>=20.12.0'}
|
|
||||||
|
|
||||||
'@expo/fingerprint@0.15.5':
|
'@expo/fingerprint@0.15.5':
|
||||||
resolution: {integrity: sha512-mdVoAMcux1WlM6kd1RoWiHRNqKqS+J6mKmWQ/BKgeh937S/fcW58EE68O6nc4KDXtWi3PBeNHskOFcgyIuD4hw==}
|
resolution: {integrity: sha512-mdVoAMcux1WlM6kd1RoWiHRNqKqS+J6mKmWQ/BKgeh937S/fcW58EE68O6nc4KDXtWi3PBeNHskOFcgyIuD4hw==}
|
||||||
hasBin: true
|
hasBin: true
|
||||||
@@ -1316,6 +1309,9 @@ packages:
|
|||||||
peerDependencies:
|
peerDependencies:
|
||||||
react-hook-form: ^7.0.0
|
react-hook-form: ^7.0.0
|
||||||
|
|
||||||
|
'@ide/backoff@1.0.0':
|
||||||
|
resolution: {integrity: sha512-F0YfUDjvT+Mtt/R4xdl2X0EYCHMMiJqNLdxHD++jDT5ydEFIyqbCHh51Qx2E211dgZprPKhV7sHmnXKpLuvc5g==}
|
||||||
|
|
||||||
'@isaacs/fs-minipass@4.0.1':
|
'@isaacs/fs-minipass@4.0.1':
|
||||||
resolution: {integrity: sha512-wgm9Ehl2jpeqP3zw/7mo3kRHFp5MEDhqAdwy1fTGkHAwnkGOVsgpvQhL8B5n1qlb01jV3n/bI0ZfZp5lWA1k4w==}
|
resolution: {integrity: sha512-wgm9Ehl2jpeqP3zw/7mo3kRHFp5MEDhqAdwy1fTGkHAwnkGOVsgpvQhL8B5n1qlb01jV3n/bI0ZfZp5lWA1k4w==}
|
||||||
engines: {node: '>=18.0.0'}
|
engines: {node: '>=18.0.0'}
|
||||||
@@ -2098,8 +2094,8 @@ packages:
|
|||||||
peerDependencies:
|
peerDependencies:
|
||||||
react-native: ^0.0.0-0 || >=0.65 <1.0
|
react-native: ^0.0.0-0 || >=0.65 <1.0
|
||||||
|
|
||||||
'@react-native-community/datetimepicker@9.1.0':
|
'@react-native-community/datetimepicker@8.4.4':
|
||||||
resolution: {integrity: sha512-eadbnk+I2vxvW30iTAsm/qlCnMMAadkifIMYNEB2lzhxN/SvlKc7S2V4k5DyrwjdCbqdcMk3t9K6fnUMcAV34w==}
|
resolution: {integrity: sha512-bc4ZixEHxZC9/qf5gbdYvIJiLZ5CLmEsC3j+Yhe1D1KC/3QhaIfGDVdUcid0PdlSoGOSEq4VlB93AWyetEyBSQ==}
|
||||||
peerDependencies:
|
peerDependencies:
|
||||||
expo: '>=52.0.0'
|
expo: '>=52.0.0'
|
||||||
react: '*'
|
react: '*'
|
||||||
@@ -2365,11 +2361,6 @@ packages:
|
|||||||
'@types/connect@3.4.38':
|
'@types/connect@3.4.38':
|
||||||
resolution: {integrity: sha512-K6uROf1LD88uDQqJCktA4yzL1YYAK6NgfsI0v/mTgyPKWsX1CnJ0XPSDhViejru1GcRkLWb8RlzFYJRqGUbaug==}
|
resolution: {integrity: sha512-K6uROf1LD88uDQqJCktA4yzL1YYAK6NgfsI0v/mTgyPKWsX1CnJ0XPSDhViejru1GcRkLWb8RlzFYJRqGUbaug==}
|
||||||
|
|
||||||
'@types/cookie-parser@1.4.10':
|
|
||||||
resolution: {integrity: sha512-B4xqkqfZ8Wek+rCOeRxsjMS9OgvzebEzzLYw7NHYuvzb7IdxOkI0ZHGgeEBX4PUM7QGVvNSK60T3OvWj3YfBRg==}
|
|
||||||
peerDependencies:
|
|
||||||
'@types/express': '*'
|
|
||||||
|
|
||||||
'@types/cors@2.8.19':
|
'@types/cors@2.8.19':
|
||||||
resolution: {integrity: sha512-mFNylyeyqN93lfe/9CSxOGREz8cpzAhH+E93xJ4xWQf62V8sQ/24reV2nyzUWM6H6Xji+GGHpkbLe7pVoUEskg==}
|
resolution: {integrity: sha512-mFNylyeyqN93lfe/9CSxOGREz8cpzAhH+E93xJ4xWQf62V8sQ/24reV2nyzUWM6H6Xji+GGHpkbLe7pVoUEskg==}
|
||||||
|
|
||||||
@@ -2597,6 +2588,9 @@ packages:
|
|||||||
asap@2.0.6:
|
asap@2.0.6:
|
||||||
resolution: {integrity: sha512-BSHWgDSAiKs50o2Re8ppvp3seVHXSRM44cdSsT9FfNEUUZLOGWVCsiWaRPWM1Znn+mqZ1OfVZ3z3DWEzSp7hRA==}
|
resolution: {integrity: sha512-BSHWgDSAiKs50o2Re8ppvp3seVHXSRM44cdSsT9FfNEUUZLOGWVCsiWaRPWM1Znn+mqZ1OfVZ3z3DWEzSp7hRA==}
|
||||||
|
|
||||||
|
assert@2.1.0:
|
||||||
|
resolution: {integrity: sha512-eLHpSK/Y4nhMJ07gDaAzoX/XAKS8PSaojml3M0DM4JpV1LAi5JOJ/p6H/XWrl8L+DzVEvVCW1z3vWAaB9oTsQw==}
|
||||||
|
|
||||||
async-limiter@1.0.1:
|
async-limiter@1.0.1:
|
||||||
resolution: {integrity: sha512-csOlWGAcRFJaI6m+F2WKdnMKr4HhdhFVBk0H/QbJFMCr+uO2kwohwXQPxw/9OCxp05r5ghVBFSyioixx3gfkNQ==}
|
resolution: {integrity: sha512-csOlWGAcRFJaI6m+F2WKdnMKr4HhdhFVBk0H/QbJFMCr+uO2kwohwXQPxw/9OCxp05r5ghVBFSyioixx3gfkNQ==}
|
||||||
|
|
||||||
@@ -2607,6 +2601,10 @@ packages:
|
|||||||
resolution: {integrity: sha512-kNOjDqAh7px0XWNI+4QbzoiR/nTkHAWNud2uvnJquD1/x5a7EQZMJT0AczqK0Qn67oY/TTQ1LbUKajZpp3I9tQ==}
|
resolution: {integrity: sha512-kNOjDqAh7px0XWNI+4QbzoiR/nTkHAWNud2uvnJquD1/x5a7EQZMJT0AczqK0Qn67oY/TTQ1LbUKajZpp3I9tQ==}
|
||||||
engines: {node: '>=8.0.0'}
|
engines: {node: '>=8.0.0'}
|
||||||
|
|
||||||
|
available-typed-arrays@1.0.7:
|
||||||
|
resolution: {integrity: sha512-wvUjBtSGN7+7SjNpq/9M2Tg350UZD3q62IFZLbRAR1bSMlCo1ZaeW+BJ+D090e4hIIZLBcTDWe4Mh4jvUDajzQ==}
|
||||||
|
engines: {node: '>= 0.4'}
|
||||||
|
|
||||||
axios@1.15.2:
|
axios@1.15.2:
|
||||||
resolution: {integrity: sha512-wLrXxPtcrPTsNlJmKjkPnNPK2Ihe0hn0wGSaTEiHRPxwjvJwT3hKmXF4dpqxmPO9SoNb2FsYXj/xEo0gHN+D5A==}
|
resolution: {integrity: sha512-wLrXxPtcrPTsNlJmKjkPnNPK2Ihe0hn0wGSaTEiHRPxwjvJwT3hKmXF4dpqxmPO9SoNb2FsYXj/xEo0gHN+D5A==}
|
||||||
|
|
||||||
@@ -2765,6 +2763,10 @@ packages:
|
|||||||
resolution: {integrity: sha512-Sp1ablJ0ivDkSzjcaJdxEunN5/XvksFJ2sMBFfq6x0ryhQV/2b/KwFe21cMpmHtPOSij8K99/wSfoEuTObmuMQ==}
|
resolution: {integrity: sha512-Sp1ablJ0ivDkSzjcaJdxEunN5/XvksFJ2sMBFfq6x0ryhQV/2b/KwFe21cMpmHtPOSij8K99/wSfoEuTObmuMQ==}
|
||||||
engines: {node: '>= 0.4'}
|
engines: {node: '>= 0.4'}
|
||||||
|
|
||||||
|
call-bind@1.0.9:
|
||||||
|
resolution: {integrity: sha512-a/hy+pNsFUTR+Iz8TCJvXudKVLAnz/DyeSUo10I5yvFDQJBFU2s9uqQpoSrJlroHUKoKqzg+epxyP9lqFdzfBQ==}
|
||||||
|
engines: {node: '>= 0.4'}
|
||||||
|
|
||||||
call-bound@1.0.4:
|
call-bound@1.0.4:
|
||||||
resolution: {integrity: sha512-+ys997U96po4Kx/ABpBCqhA9EuxJaQWDQg7295H4hBphv3IZg0boBKuwYpt4YXp6MZ5AmZQnU/tyMTlRpaSejg==}
|
resolution: {integrity: sha512-+ys997U96po4Kx/ABpBCqhA9EuxJaQWDQg7295H4hBphv3IZg0boBKuwYpt4YXp6MZ5AmZQnU/tyMTlRpaSejg==}
|
||||||
engines: {node: '>= 0.4'}
|
engines: {node: '>= 0.4'}
|
||||||
@@ -2925,13 +2927,6 @@ packages:
|
|||||||
convert-source-map@2.0.0:
|
convert-source-map@2.0.0:
|
||||||
resolution: {integrity: sha512-Kvp459HrV2FEJ1CAsi1Ku+MY3kasH19TFykTz2xWmMeq6bk2NU3XXvfJ+Q61m0xktWwt+1HSYf3JZsTms3aRJg==}
|
resolution: {integrity: sha512-Kvp459HrV2FEJ1CAsi1Ku+MY3kasH19TFykTz2xWmMeq6bk2NU3XXvfJ+Q61m0xktWwt+1HSYf3JZsTms3aRJg==}
|
||||||
|
|
||||||
cookie-parser@1.4.7:
|
|
||||||
resolution: {integrity: sha512-nGUvgXnotP3BsjiLX2ypbQnWoGUPIIfHQNZkkC668ntrzGWEZVW70HDEB1qnNGMicPje6EttlIgzo51YSwNQGw==}
|
|
||||||
engines: {node: '>= 0.8.0'}
|
|
||||||
|
|
||||||
cookie-signature@1.0.6:
|
|
||||||
resolution: {integrity: sha512-QADzlaHc8icV8I7vbaJXJwod9HWYp8uCqf1xa4OfNu1T7JVxQIrUgOWtHdNDtPiywmFbiS12VjotIXLrKM3orQ==}
|
|
||||||
|
|
||||||
cookie-signature@1.2.2:
|
cookie-signature@1.2.2:
|
||||||
resolution: {integrity: sha512-D76uU73ulSXrD1UXF4KE2TMxVVwhsnCgfAyTg9k8P6KGZjlXKrOLe4dJQKI3Bxi5wjesZoFXJWElNWBjPZMbhg==}
|
resolution: {integrity: sha512-D76uU73ulSXrD1UXF4KE2TMxVVwhsnCgfAyTg9k8P6KGZjlXKrOLe4dJQKI3Bxi5wjesZoFXJWElNWBjPZMbhg==}
|
||||||
engines: {node: '>=6.6.0'}
|
engines: {node: '>=6.6.0'}
|
||||||
@@ -3078,10 +3073,18 @@ packages:
|
|||||||
resolution: {integrity: sha512-4tvttepXG1VaYGrRibk5EwJd1t4udunSOVMdLSAL6mId1ix438oPwPZMALY41FCijukO1L0twNcGsdzS7dHgDg==}
|
resolution: {integrity: sha512-4tvttepXG1VaYGrRibk5EwJd1t4udunSOVMdLSAL6mId1ix438oPwPZMALY41FCijukO1L0twNcGsdzS7dHgDg==}
|
||||||
engines: {node: '>=10'}
|
engines: {node: '>=10'}
|
||||||
|
|
||||||
|
define-data-property@1.1.4:
|
||||||
|
resolution: {integrity: sha512-rBMvIzlpA8v6E+SJZoo++HAYqsLrkg7MSfIinMPFhmkorw7X+dOXVJQs+QT69zGkzMyfDnIMN2Wid1+NbL3T+A==}
|
||||||
|
engines: {node: '>= 0.4'}
|
||||||
|
|
||||||
define-lazy-prop@2.0.0:
|
define-lazy-prop@2.0.0:
|
||||||
resolution: {integrity: sha512-Ds09qNh8yw3khSjiJjiUInaGX9xlqZDY7JVryGxdxV7NPeuqQfplOpQ66yJFZut3jLa5zOwkXw1g9EI2uKh4Og==}
|
resolution: {integrity: sha512-Ds09qNh8yw3khSjiJjiUInaGX9xlqZDY7JVryGxdxV7NPeuqQfplOpQ66yJFZut3jLa5zOwkXw1g9EI2uKh4Og==}
|
||||||
engines: {node: '>=8'}
|
engines: {node: '>=8'}
|
||||||
|
|
||||||
|
define-properties@1.2.1:
|
||||||
|
resolution: {integrity: sha512-8QmQKqEASLd5nx0U1B1okLElbUuuttJ/AnYmRXbbbGDWh6uS208EjD4Xqq/I9wK7u0v6O08XhTWnt5XtEbR6Dg==}
|
||||||
|
engines: {node: '>= 0.4'}
|
||||||
|
|
||||||
delayed-stream@1.0.0:
|
delayed-stream@1.0.0:
|
||||||
resolution: {integrity: sha512-ZySD7Nf91aLB0RxL4KGrKHBXl7Eds1DAmEdcoVawXnLD7SDhpNgtuII2aAkg7a7QS41jxPSZ17p4VdGnMHk3MQ==}
|
resolution: {integrity: sha512-ZySD7Nf91aLB0RxL4KGrKHBXl7Eds1DAmEdcoVawXnLD7SDhpNgtuII2aAkg7a7QS41jxPSZ17p4VdGnMHk3MQ==}
|
||||||
engines: {node: '>=0.4.0'}
|
engines: {node: '>=0.4.0'}
|
||||||
@@ -3365,8 +3368,8 @@ packages:
|
|||||||
resolution: {integrity: sha512-9Be3ZoN4LmYR90tUoVu2te2BsbzHfhJyfEiAVfz7N5/zv+jduIfLrV2xdQXOHbaD6KgpGdO9PRPM1Y4Q9QkPkA==}
|
resolution: {integrity: sha512-9Be3ZoN4LmYR90tUoVu2te2BsbzHfhJyfEiAVfz7N5/zv+jduIfLrV2xdQXOHbaD6KgpGdO9PRPM1Y4Q9QkPkA==}
|
||||||
engines: {node: ^18.19.0 || >=20.5.0}
|
engines: {node: ^18.19.0 || >=20.5.0}
|
||||||
|
|
||||||
expo-application@55.0.14:
|
expo-application@7.0.8:
|
||||||
resolution: {integrity: sha512-NgqDIt3eCf4aVLp1L6AcEanCYoyJeuBsGrgGSzOIvxAsOvp5X3SYKW3ROgpKUnLQEKMWlzwETpjsUGszcqkk8g==}
|
resolution: {integrity: sha512-qFGyxk7VJbrNOQWBbE09XUuGuvkOgFS9QfToaK2FdagM2aQ+x3CvGV2DuVgl/l4ZxPgIf3b/MNh9xHpwSwn74Q==}
|
||||||
peerDependencies:
|
peerDependencies:
|
||||||
expo: '*'
|
expo: '*'
|
||||||
|
|
||||||
@@ -3384,14 +3387,15 @@ packages:
|
|||||||
react: '*'
|
react: '*'
|
||||||
react-native: '*'
|
react-native: '*'
|
||||||
|
|
||||||
expo-constants@18.0.13:
|
expo-clipboard@8.0.8:
|
||||||
resolution: {integrity: sha512-FnZn12E1dRYKDHlAdIyNFhBurKTS3F9CrfrBDJI5m3D7U17KBHMQ6JEfYlSj7LG7t+Ulr+IKaj58L1k5gBwTcQ==}
|
resolution: {integrity: sha512-VKoBkHIpZZDJTB0jRO4/PZskHdMNOEz3P/41tmM6fDuODMpqhvyWK053X0ebspkxiawJX9lX33JXHBCvVsTTOA==}
|
||||||
peerDependencies:
|
peerDependencies:
|
||||||
expo: '*'
|
expo: '*'
|
||||||
|
react: '*'
|
||||||
react-native: '*'
|
react-native: '*'
|
||||||
|
|
||||||
expo-constants@55.0.15:
|
expo-constants@18.0.13:
|
||||||
resolution: {integrity: sha512-w394fcZLJjeKN+9ZnJzL/HiarE1nwZFDa+3S9frevh6Ur+MAAs9QDrcXhDrV8T3xqRzzYaqsP6Z8TFZ4efWN1A==}
|
resolution: {integrity: sha512-FnZn12E1dRYKDHlAdIyNFhBurKTS3F9CrfrBDJI5m3D7U17KBHMQ6JEfYlSj7LG7t+Ulr+IKaj58L1k5gBwTcQ==}
|
||||||
peerDependencies:
|
peerDependencies:
|
||||||
expo: '*'
|
expo: '*'
|
||||||
react-native: '*'
|
react-native: '*'
|
||||||
@@ -3476,8 +3480,8 @@ packages:
|
|||||||
react: '*'
|
react: '*'
|
||||||
react-native: '*'
|
react-native: '*'
|
||||||
|
|
||||||
expo-notifications@55.0.22:
|
expo-notifications@0.32.17:
|
||||||
resolution: {integrity: sha512-Rwvsp/lAEXfDYBxkQZpaLF9ZB25cJ/yfHhD/ESclbPesN0nbQBZ/5rGb1xS/saANtkStbEGfDlA80uHh2zEpsA==}
|
resolution: {integrity: sha512-lwwzn7tImuzTzn9PAglZlS2VfZEvsfFGJTK9Eb8I4cqkGh2DI23YJFJH+WPEIu4QhDvk5JeBjklenJ8IZbmA4A==}
|
||||||
peerDependencies:
|
peerDependencies:
|
||||||
expo: '*'
|
expo: '*'
|
||||||
react: '*'
|
react: '*'
|
||||||
@@ -3516,8 +3520,8 @@ packages:
|
|||||||
react-server-dom-webpack:
|
react-server-dom-webpack:
|
||||||
optional: true
|
optional: true
|
||||||
|
|
||||||
expo-secure-store@55.0.13:
|
expo-secure-store@15.0.8:
|
||||||
resolution: {integrity: sha512-I6r0JNO1Fd4o0Gu7Ixiic7s89lqgdUHq17uBH9y1f/AntoyKn71TdtYJH82RgfsBbu5qNVzrwImmvlANyOlITQ==}
|
resolution: {integrity: sha512-lHnzvRajBu4u+P99+0GEMijQMFCOYpWRO4dWsXSuMt77+THPIGjzNvVKrGSl6mMrLsfVaKL8BpwYZLGlgA+zAw==}
|
||||||
peerDependencies:
|
peerDependencies:
|
||||||
expo: '*'
|
expo: '*'
|
||||||
|
|
||||||
@@ -3552,12 +3556,6 @@ packages:
|
|||||||
react-native-web:
|
react-native-web:
|
||||||
optional: true
|
optional: true
|
||||||
|
|
||||||
expo-task-manager@55.0.15:
|
|
||||||
resolution: {integrity: sha512-wLqYkKBp9cxIonEIp3LYy9iFjlOxxw4ca8nZLdSriKVxzPvdUwX6cZ4g55Fi+uSi4oPVFo9JYFKVUEofc+do+A==}
|
|
||||||
peerDependencies:
|
|
||||||
expo: '*'
|
|
||||||
react-native: '*'
|
|
||||||
|
|
||||||
expo-web-browser@15.0.11:
|
expo-web-browser@15.0.11:
|
||||||
resolution: {integrity: sha512-r2LS4Ro6DgUPZkcaEfgt8mp9eJuoA93x11Jh7S6utFe0FEzvUNn2yFhxg8XVwESaaHGt2k5V8LuK36rsp0BeIw==}
|
resolution: {integrity: sha512-r2LS4Ro6DgUPZkcaEfgt8mp9eJuoA93x11Jh7S6utFe0FEzvUNn2yFhxg8XVwESaaHGt2k5V8LuK36rsp0BeIw==}
|
||||||
peerDependencies:
|
peerDependencies:
|
||||||
@@ -3675,6 +3673,10 @@ packages:
|
|||||||
fontfaceobserver@2.3.0:
|
fontfaceobserver@2.3.0:
|
||||||
resolution: {integrity: sha512-6FPvD/IVyT4ZlNe7Wcn5Fb/4ChigpucKYSvD6a+0iMoLn2inpo711eyIcKjmDtE5XNcgAkSH9uN/nfAeZzHEfg==}
|
resolution: {integrity: sha512-6FPvD/IVyT4ZlNe7Wcn5Fb/4ChigpucKYSvD6a+0iMoLn2inpo711eyIcKjmDtE5XNcgAkSH9uN/nfAeZzHEfg==}
|
||||||
|
|
||||||
|
for-each@0.3.5:
|
||||||
|
resolution: {integrity: sha512-dKx12eRCVIzqCxFGplyFKJMPvLEWgmNtUrpTiJIR5u97zEhRG8ySrtboPHZXx7daLxQVrl643cTzbab2tkQjxg==}
|
||||||
|
engines: {node: '>= 0.4'}
|
||||||
|
|
||||||
form-data@4.0.5:
|
form-data@4.0.5:
|
||||||
resolution: {integrity: sha512-8RipRLol37bNs2bhoV67fiTEvdTrbMUYcFTiy3+wuuOnUog2QBHCZWXDRijWQfAkhBj2Uf5UnVaiWwA5vdd82w==}
|
resolution: {integrity: sha512-8RipRLol37bNs2bhoV67fiTEvdTrbMUYcFTiy3+wuuOnUog2QBHCZWXDRijWQfAkhBj2Uf5UnVaiWwA5vdd82w==}
|
||||||
engines: {node: '>= 6'}
|
engines: {node: '>= 6'}
|
||||||
@@ -3724,6 +3726,10 @@ packages:
|
|||||||
function-bind@1.1.2:
|
function-bind@1.1.2:
|
||||||
resolution: {integrity: sha512-7XHNxH7qX9xG5mIwxkhumTox/MIRNcOgDrxWsMt2pAr23WHp6MrRlN7FBSFpCpr+oVO0F744iUgR82nJMfG2SA==}
|
resolution: {integrity: sha512-7XHNxH7qX9xG5mIwxkhumTox/MIRNcOgDrxWsMt2pAr23WHp6MrRlN7FBSFpCpr+oVO0F744iUgR82nJMfG2SA==}
|
||||||
|
|
||||||
|
generator-function@2.0.1:
|
||||||
|
resolution: {integrity: sha512-SFdFmIJi+ybC0vjlHN0ZGVGHc3lgE0DxPAT0djjVg+kjOnSqclqmj0KQ7ykTOLP6YxoqOvuAODGdcHJn+43q3g==}
|
||||||
|
engines: {node: '>= 0.4'}
|
||||||
|
|
||||||
gensync@1.0.0-beta.2:
|
gensync@1.0.0-beta.2:
|
||||||
resolution: {integrity: sha512-3hN7NaskYvMDLQY55gnW3NQ+mesEAepTqlg+VEbj7zzqEMBVNhzcGYYeqFo/TlYz6eQiFcp1HcsCZO+nGgS8zg==}
|
resolution: {integrity: sha512-3hN7NaskYvMDLQY55gnW3NQ+mesEAepTqlg+VEbj7zzqEMBVNhzcGYYeqFo/TlYz6eQiFcp1HcsCZO+nGgS8zg==}
|
||||||
engines: {node: '>=6.9.0'}
|
engines: {node: '>=6.9.0'}
|
||||||
@@ -3798,6 +3804,9 @@ packages:
|
|||||||
resolution: {integrity: sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==}
|
resolution: {integrity: sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==}
|
||||||
engines: {node: '>=8'}
|
engines: {node: '>=8'}
|
||||||
|
|
||||||
|
has-property-descriptors@1.0.2:
|
||||||
|
resolution: {integrity: sha512-55JNKuIW+vq4Ke1BjOTjM2YctQIvCT7GFzHwmfZPGo5wnrgkid0YQtnAleFSqumZm4az3n2BS+erby5ipJdgrg==}
|
||||||
|
|
||||||
has-symbols@1.1.0:
|
has-symbols@1.1.0:
|
||||||
resolution: {integrity: sha512-1cDNdwJ2Jaohmb3sg4OmKaMBwuC48sYni5HUw2DvsC8LjGTLK9h+eb1X6RyuOHe4hT0ULCW68iomhjUoKUqlPQ==}
|
resolution: {integrity: sha512-1cDNdwJ2Jaohmb3sg4OmKaMBwuC48sYni5HUw2DvsC8LjGTLK9h+eb1X6RyuOHe4hT0ULCW68iomhjUoKUqlPQ==}
|
||||||
engines: {node: '>= 0.4'}
|
engines: {node: '>= 0.4'}
|
||||||
@@ -3914,9 +3923,17 @@ packages:
|
|||||||
resolution: {integrity: sha512-0KI/607xoxSToH7GjN1FfSbLoU0+btTicjsQSWQlh/hZykN8KpmMf7uYwPW3R+akZ6R/w18ZlXSHBYXiYUPO3g==}
|
resolution: {integrity: sha512-0KI/607xoxSToH7GjN1FfSbLoU0+btTicjsQSWQlh/hZykN8KpmMf7uYwPW3R+akZ6R/w18ZlXSHBYXiYUPO3g==}
|
||||||
engines: {node: '>= 0.10'}
|
engines: {node: '>= 0.10'}
|
||||||
|
|
||||||
|
is-arguments@1.2.0:
|
||||||
|
resolution: {integrity: sha512-7bVbi0huj/wrIAOzb8U1aszg9kdi3KN/CyU19CTI7tAoZYEZoL9yCDXpbXN+uPsuWnP02cyug1gleqq+TU+YCA==}
|
||||||
|
engines: {node: '>= 0.4'}
|
||||||
|
|
||||||
is-arrayish@0.3.4:
|
is-arrayish@0.3.4:
|
||||||
resolution: {integrity: sha512-m6UrgzFVUYawGBh1dUsWR5M2Clqic9RVXC/9f8ceNlv2IcO9j9J/z8UoCLPqtsPBFNzEpfR3xftohbfqDx8EQA==}
|
resolution: {integrity: sha512-m6UrgzFVUYawGBh1dUsWR5M2Clqic9RVXC/9f8ceNlv2IcO9j9J/z8UoCLPqtsPBFNzEpfR3xftohbfqDx8EQA==}
|
||||||
|
|
||||||
|
is-callable@1.2.7:
|
||||||
|
resolution: {integrity: sha512-1BC0BVFhS/p0qtw6enp8e+8OD0UrK0oFLztSjNzhcKA3WDuJxxAPXzPuPtKkjEY9UUoEWlX/8fgKeu2S8i9JTA==}
|
||||||
|
engines: {node: '>= 0.4'}
|
||||||
|
|
||||||
is-core-module@2.16.1:
|
is-core-module@2.16.1:
|
||||||
resolution: {integrity: sha512-UfoeMA6fIJ8wTYFEUjelnaGI67v6+N7qXJEvQuIGa99l4xsCruSYOVSQ0uPANn4dAzm8lkYPaKLrrijLq7x23w==}
|
resolution: {integrity: sha512-UfoeMA6fIJ8wTYFEUjelnaGI67v6+N7qXJEvQuIGa99l4xsCruSYOVSQ0uPANn4dAzm8lkYPaKLrrijLq7x23w==}
|
||||||
engines: {node: '>= 0.4'}
|
engines: {node: '>= 0.4'}
|
||||||
@@ -3934,10 +3951,18 @@ packages:
|
|||||||
resolution: {integrity: sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg==}
|
resolution: {integrity: sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg==}
|
||||||
engines: {node: '>=8'}
|
engines: {node: '>=8'}
|
||||||
|
|
||||||
|
is-generator-function@1.1.2:
|
||||||
|
resolution: {integrity: sha512-upqt1SkGkODW9tsGNG5mtXTXtECizwtS2kA161M+gJPc1xdb/Ax629af6YrTwcOeQHbewrPNlE5Dx7kzvXTizA==}
|
||||||
|
engines: {node: '>= 0.4'}
|
||||||
|
|
||||||
is-glob@4.0.3:
|
is-glob@4.0.3:
|
||||||
resolution: {integrity: sha512-xelSayHH36ZgE7ZWhli7pW34hNbNl8Ojv5KVmkJD4hBdD3th8Tfk9vYasLM+mXWOZhFkgZfxhLSnrwRr4elSSg==}
|
resolution: {integrity: sha512-xelSayHH36ZgE7ZWhli7pW34hNbNl8Ojv5KVmkJD4hBdD3th8Tfk9vYasLM+mXWOZhFkgZfxhLSnrwRr4elSSg==}
|
||||||
engines: {node: '>=0.10.0'}
|
engines: {node: '>=0.10.0'}
|
||||||
|
|
||||||
|
is-nan@1.3.2:
|
||||||
|
resolution: {integrity: sha512-E+zBKpQ2t6MEo1VsonYmluk9NxGrbzpeeLC2xIViuO2EjU2xsXsBPwTr3Ykv9l08UYEVEdWeRZNouaZqF6RN0w==}
|
||||||
|
engines: {node: '>= 0.4'}
|
||||||
|
|
||||||
is-number@7.0.0:
|
is-number@7.0.0:
|
||||||
resolution: {integrity: sha512-41Cifkg6e8TylSpdtTpeLVMqvSBEVzTttHvERD741+pnZ8ANv0004MRL43QKPDlK9cGvNp6NZWZUBlbGXYxxng==}
|
resolution: {integrity: sha512-41Cifkg6e8TylSpdtTpeLVMqvSBEVzTttHvERD741+pnZ8ANv0004MRL43QKPDlK9cGvNp6NZWZUBlbGXYxxng==}
|
||||||
engines: {node: '>=0.12.0'}
|
engines: {node: '>=0.12.0'}
|
||||||
@@ -3957,10 +3982,18 @@ packages:
|
|||||||
is-promise@4.0.0:
|
is-promise@4.0.0:
|
||||||
resolution: {integrity: sha512-hvpoI6korhJMnej285dSg6nu1+e6uxs7zG3BYAm5byqDsgJNWwxzM6z6iZiAgQR4TJ30JmBTOwqZUw3WlyH3AQ==}
|
resolution: {integrity: sha512-hvpoI6korhJMnej285dSg6nu1+e6uxs7zG3BYAm5byqDsgJNWwxzM6z6iZiAgQR4TJ30JmBTOwqZUw3WlyH3AQ==}
|
||||||
|
|
||||||
|
is-regex@1.2.1:
|
||||||
|
resolution: {integrity: sha512-MjYsKHO5O7mCsmRGxWcLWheFqN9DJ/2TmngvjKXihe6efViPqc274+Fx/4fYj/r03+ESvBdTXK0V6tA3rgez1g==}
|
||||||
|
engines: {node: '>= 0.4'}
|
||||||
|
|
||||||
is-stream@4.0.1:
|
is-stream@4.0.1:
|
||||||
resolution: {integrity: sha512-Dnz92NInDqYckGEUJv689RbRiTSEHCQ7wOVeALbkOz999YpqT46yMRIGtSNl2iCL1waAZSx40+h59NV/EwzV/A==}
|
resolution: {integrity: sha512-Dnz92NInDqYckGEUJv689RbRiTSEHCQ7wOVeALbkOz999YpqT46yMRIGtSNl2iCL1waAZSx40+h59NV/EwzV/A==}
|
||||||
engines: {node: '>=18'}
|
engines: {node: '>=18'}
|
||||||
|
|
||||||
|
is-typed-array@1.1.15:
|
||||||
|
resolution: {integrity: sha512-p3EcsicXjit7SaskXHs1hA91QxgTw46Fv6EFKKGS5DRFLD8yKnohjF3hxoju94b/OcMZoQukzpPpBE9uLVKzgQ==}
|
||||||
|
engines: {node: '>= 0.4'}
|
||||||
|
|
||||||
is-unicode-supported@2.1.0:
|
is-unicode-supported@2.1.0:
|
||||||
resolution: {integrity: sha512-mE00Gnza5EEB3Ds0HfMyllZzbBrmLOX3vfWoj9A9PEnTfratQ/BcaJOuMhnkhjXvb2+FkY3VuHqtAGpTPmglFQ==}
|
resolution: {integrity: sha512-mE00Gnza5EEB3Ds0HfMyllZzbBrmLOX3vfWoj9A9PEnTfratQ/BcaJOuMhnkhjXvb2+FkY3VuHqtAGpTPmglFQ==}
|
||||||
engines: {node: '>=18'}
|
engines: {node: '>=18'}
|
||||||
@@ -4486,6 +4519,18 @@ packages:
|
|||||||
resolution: {integrity: sha512-W67iLl4J2EXEGTbfeHCffrjDfitvLANg0UlX3wFUUSTx92KXRFegMHUVgSqE+wvhAbi4WqjGg9czysTV2Epbew==}
|
resolution: {integrity: sha512-W67iLl4J2EXEGTbfeHCffrjDfitvLANg0UlX3wFUUSTx92KXRFegMHUVgSqE+wvhAbi4WqjGg9czysTV2Epbew==}
|
||||||
engines: {node: '>= 0.4'}
|
engines: {node: '>= 0.4'}
|
||||||
|
|
||||||
|
object-is@1.1.6:
|
||||||
|
resolution: {integrity: sha512-F8cZ+KfGlSGi09lJT7/Nd6KJZ9ygtvYC0/UYYLI9nmQKLMnydpB9yvbv9K1uSkEu7FU9vYPmVwLg328tX+ot3Q==}
|
||||||
|
engines: {node: '>= 0.4'}
|
||||||
|
|
||||||
|
object-keys@1.1.1:
|
||||||
|
resolution: {integrity: sha512-NuAESUOUMrlIXOfHKzD6bpPu3tYt3xvjNdRIQ+FeT0lNb4K8WR70CaDxhuNguS2XG+GjkyMwOzsN5ZktImfhLA==}
|
||||||
|
engines: {node: '>= 0.4'}
|
||||||
|
|
||||||
|
object.assign@4.1.7:
|
||||||
|
resolution: {integrity: sha512-nK28WOo+QIjBkDduTINE4JkF/UJJKyf2EJxvJKfblDpyg0Q+pkOHNTL0Qwy6NP6FhE/EnzV73BxxqcJaXY9anw==}
|
||||||
|
engines: {node: '>= 0.4'}
|
||||||
|
|
||||||
on-exit-leak-free@2.1.2:
|
on-exit-leak-free@2.1.2:
|
||||||
resolution: {integrity: sha512-0eJJY6hXLGf1udHwfNftBqH+g73EU4B504nZeKpz1sYRKafAghwxEJunB2O7rDZkL4PGfsMVnTXZ2EjibbqcsA==}
|
resolution: {integrity: sha512-0eJJY6hXLGf1udHwfNftBqH+g73EU4B504nZeKpz1sYRKafAghwxEJunB2O7rDZkL4PGfsMVnTXZ2EjibbqcsA==}
|
||||||
engines: {node: '>=14.0.0'}
|
engines: {node: '>=14.0.0'}
|
||||||
@@ -4681,6 +4726,10 @@ packages:
|
|||||||
resolution: {integrity: sha512-NCrCHhWmnQklfH4MtJMRjZ2a8c80qXeMlQMv2uVp9ISJMTt562SbGd6n2oq0PaPgKm7Z6pL9E2UlLIhC+SHL3w==}
|
resolution: {integrity: sha512-NCrCHhWmnQklfH4MtJMRjZ2a8c80qXeMlQMv2uVp9ISJMTt562SbGd6n2oq0PaPgKm7Z6pL9E2UlLIhC+SHL3w==}
|
||||||
engines: {node: '>=4.0.0'}
|
engines: {node: '>=4.0.0'}
|
||||||
|
|
||||||
|
possible-typed-array-names@1.1.0:
|
||||||
|
resolution: {integrity: sha512-/+5VFTchJDoVj3bhoqi6UeymcD00DAwb1nJwamzPvHEszJ4FpF6SNNbUbOS8yI56qHzdV8eK0qEfOSiodkTdxg==}
|
||||||
|
engines: {node: '>= 0.4'}
|
||||||
|
|
||||||
postcss-value-parser@4.2.0:
|
postcss-value-parser@4.2.0:
|
||||||
resolution: {integrity: sha512-1NNCs6uurfkVbeXG4S8JFT9t19m45ICnif8zWLd5oPSZ50QnwMfK+H3jv408d4jw/7Bttv5axS5IiHoLaVNHeQ==}
|
resolution: {integrity: sha512-1NNCs6uurfkVbeXG4S8JFT9t19m45ICnif8zWLd5oPSZ50QnwMfK+H3jv408d4jw/7Bttv5axS5IiHoLaVNHeQ==}
|
||||||
|
|
||||||
@@ -5098,6 +5147,10 @@ packages:
|
|||||||
safe-buffer@5.2.1:
|
safe-buffer@5.2.1:
|
||||||
resolution: {integrity: sha512-rp3So07KcdmmKbGvgaNxQSJr7bGVSVk5S9Eq1F+ppbRo70+YeaDxkw5Dd8NPN+GD6bjnYm2VuPuCXmpuYvmCXQ==}
|
resolution: {integrity: sha512-rp3So07KcdmmKbGvgaNxQSJr7bGVSVk5S9Eq1F+ppbRo70+YeaDxkw5Dd8NPN+GD6bjnYm2VuPuCXmpuYvmCXQ==}
|
||||||
|
|
||||||
|
safe-regex-test@1.1.0:
|
||||||
|
resolution: {integrity: sha512-x/+Cz4YrimQxQccJf5mKEbIa1NzeCRNI5Ecl/ekmlYaampdNLPalVyIcCZNNH3MvmqBugV5TMYZXv0ljslUlaw==}
|
||||||
|
engines: {node: '>= 0.4'}
|
||||||
|
|
||||||
safe-stable-stringify@2.5.0:
|
safe-stable-stringify@2.5.0:
|
||||||
resolution: {integrity: sha512-b3rppTKm9T+PsVCBEOUR46GWI7fdOs00VKZ1+9c1EWDaDMvjQc6tUwuFyIprgGgTcWoVHSKrU8H31ZHA2e0RHA==}
|
resolution: {integrity: sha512-b3rppTKm9T+PsVCBEOUR46GWI7fdOs00VKZ1+9c1EWDaDMvjQc6tUwuFyIprgGgTcWoVHSKrU8H31ZHA2e0RHA==}
|
||||||
engines: {node: '>=10'}
|
engines: {node: '>=10'}
|
||||||
@@ -5157,6 +5210,10 @@ packages:
|
|||||||
server-only@0.0.1:
|
server-only@0.0.1:
|
||||||
resolution: {integrity: sha512-qepMx2JxAa5jjfzxG79yPPq+8BuFToHd1hm7kI+Z4zAq1ftQiP7HcxMhDDItrbtwVeLg/cY2JnKnrcFkmiswNA==}
|
resolution: {integrity: sha512-qepMx2JxAa5jjfzxG79yPPq+8BuFToHd1hm7kI+Z4zAq1ftQiP7HcxMhDDItrbtwVeLg/cY2JnKnrcFkmiswNA==}
|
||||||
|
|
||||||
|
set-function-length@1.2.2:
|
||||||
|
resolution: {integrity: sha512-pgRc4hJ4/sNjWCSS9AmnS40x3bNMDTknHgL5UaMBTMyJnU90EgWh1Rz+MC9eFu4BuN/UwZjKQuY/1v3rM7HMfg==}
|
||||||
|
engines: {node: '>= 0.4'}
|
||||||
|
|
||||||
setimmediate@1.0.5:
|
setimmediate@1.0.5:
|
||||||
resolution: {integrity: sha512-MATJdZp8sLqDl/68LfQmbP8zKPLQNV6BIZoIgrscFDQ+RsvK/BxeDQOgyxKKoh0y/8h3BqVFnCqQ/gd+reiIXA==}
|
resolution: {integrity: sha512-MATJdZp8sLqDl/68LfQmbP8zKPLQNV6BIZoIgrscFDQ+RsvK/BxeDQOgyxKKoh0y/8h3BqVFnCqQ/gd+reiIXA==}
|
||||||
|
|
||||||
@@ -5518,9 +5575,6 @@ packages:
|
|||||||
resolution: {integrity: sha512-wH590V9VNgYH9g3lH9wWjTrUoKsjLF6sGLjhR4sH1LWpLmCOH0Zf7PukhDA8BiS7KHe4oPNkcTHqYkj7SOGUOw==}
|
resolution: {integrity: sha512-wH590V9VNgYH9g3lH9wWjTrUoKsjLF6sGLjhR4sH1LWpLmCOH0Zf7PukhDA8BiS7KHe4oPNkcTHqYkj7SOGUOw==}
|
||||||
engines: {node: '>=20'}
|
engines: {node: '>=20'}
|
||||||
|
|
||||||
unimodules-app-loader@55.0.5:
|
|
||||||
resolution: {integrity: sha512-2eLjtaAVQTK3EeiUAgRbfEnX78f6cMtw5Js8Ri4OcEdkrozsmvG3Wu8YVfr6kfhea17FHZkKZmO1m4dL/Ky2Bg==}
|
|
||||||
|
|
||||||
universalify@2.0.1:
|
universalify@2.0.1:
|
||||||
resolution: {integrity: sha512-gptHNQghINnc/vTGIk0SOFGFNXw7JVrlRUtConJRlvaw6DuX0wO5Jeko9sWrMBhh+PsYAZ7oXAiOnf/UKogyiw==}
|
resolution: {integrity: sha512-gptHNQghINnc/vTGIk0SOFGFNXw7JVrlRUtConJRlvaw6DuX0wO5Jeko9sWrMBhh+PsYAZ7oXAiOnf/UKogyiw==}
|
||||||
engines: {node: '>= 10.0.0'}
|
engines: {node: '>= 10.0.0'}
|
||||||
@@ -5565,6 +5619,9 @@ packages:
|
|||||||
peerDependencies:
|
peerDependencies:
|
||||||
react: ^16.8.0 || ^17.0.0 || ^18.0.0 || ^19.0.0
|
react: ^16.8.0 || ^17.0.0 || ^18.0.0 || ^19.0.0
|
||||||
|
|
||||||
|
util@0.12.5:
|
||||||
|
resolution: {integrity: sha512-kZf/K6hEIrWHI6XqOFUiiMa+79wE/D8Q+NCNAWclkyg3b4d2k7s0QGepNjiABc+aR3N1PAyHL7p6UcLY6LmrnA==}
|
||||||
|
|
||||||
utils-merge@1.0.1:
|
utils-merge@1.0.1:
|
||||||
resolution: {integrity: sha512-pMZTvIkT1d+TFGvDOqodOclx0QWkkgi6Tdoa8gC8ffGAAqz9pzPTZWAybbsHHoED/ztMtkv/VoYTYyShUn81hA==}
|
resolution: {integrity: sha512-pMZTvIkT1d+TFGvDOqodOclx0QWkkgi6Tdoa8gC8ffGAAqz9pzPTZWAybbsHHoED/ztMtkv/VoYTYyShUn81hA==}
|
||||||
engines: {node: '>= 0.4.0'}
|
engines: {node: '>= 0.4.0'}
|
||||||
@@ -5665,6 +5722,10 @@ packages:
|
|||||||
whatwg-url@5.0.0:
|
whatwg-url@5.0.0:
|
||||||
resolution: {integrity: sha512-saE57nupxk6v3HY35+jzBwYa0rKSy0XR8JSxZPwgLr7ys0IBzhGviA1/TUGJLmSVqs8pb9AnvICXEuOHLprYTw==}
|
resolution: {integrity: sha512-saE57nupxk6v3HY35+jzBwYa0rKSy0XR8JSxZPwgLr7ys0IBzhGviA1/TUGJLmSVqs8pb9AnvICXEuOHLprYTw==}
|
||||||
|
|
||||||
|
which-typed-array@1.1.20:
|
||||||
|
resolution: {integrity: sha512-LYfpUkmqwl0h9A2HL09Mms427Q1RZWuOHsukfVcKRq9q95iQxdw0ix1JQrqbcDR9PH1QDwf5Qo8OZb5lksZ8Xg==}
|
||||||
|
engines: {node: '>= 0.4'}
|
||||||
|
|
||||||
which@2.0.2:
|
which@2.0.2:
|
||||||
resolution: {integrity: sha512-BLI3Tl1TW3Pvl70l3yq3Y64i+awpwXqsGBYWkkqMtnbXgrMD+yj7rhW0kuEDxzJaYXGjEW5ogapKNMEKNMjibA==}
|
resolution: {integrity: sha512-BLI3Tl1TW3Pvl70l3yq3Y64i+awpwXqsGBYWkkqMtnbXgrMD+yj7rhW0kuEDxzJaYXGjEW5ogapKNMEKNMjibA==}
|
||||||
engines: {node: '>= 8'}
|
engines: {node: '>= 8'}
|
||||||
@@ -6644,14 +6705,6 @@ snapshots:
|
|||||||
transitivePeerDependencies:
|
transitivePeerDependencies:
|
||||||
- supports-color
|
- supports-color
|
||||||
|
|
||||||
'@expo/env@2.1.1':
|
|
||||||
dependencies:
|
|
||||||
chalk: 4.1.2
|
|
||||||
debug: 4.4.3
|
|
||||||
getenv: 2.0.0
|
|
||||||
transitivePeerDependencies:
|
|
||||||
- supports-color
|
|
||||||
|
|
||||||
'@expo/fingerprint@0.15.5':
|
'@expo/fingerprint@0.15.5':
|
||||||
dependencies:
|
dependencies:
|
||||||
'@expo/spawn-async': 1.7.2
|
'@expo/spawn-async': 1.7.2
|
||||||
@@ -6862,6 +6915,8 @@ snapshots:
|
|||||||
dependencies:
|
dependencies:
|
||||||
react-hook-form: 7.71.2(react@19.1.0)
|
react-hook-form: 7.71.2(react@19.1.0)
|
||||||
|
|
||||||
|
'@ide/backoff@1.0.0': {}
|
||||||
|
|
||||||
'@isaacs/fs-minipass@4.0.1':
|
'@isaacs/fs-minipass@4.0.1':
|
||||||
dependencies:
|
dependencies:
|
||||||
minipass: 7.1.3
|
minipass: 7.1.3
|
||||||
@@ -7976,7 +8031,7 @@ snapshots:
|
|||||||
merge-options: 3.0.4
|
merge-options: 3.0.4
|
||||||
react-native: 0.81.5(@babel/core@7.29.0)(@types/react@19.1.17)(react@19.1.0)
|
react-native: 0.81.5(@babel/core@7.29.0)(@types/react@19.1.17)(react@19.1.0)
|
||||||
|
|
||||||
'@react-native-community/datetimepicker@9.1.0(expo@54.0.34)(react-native@0.81.5(@babel/core@7.29.0)(@types/react@19.1.17)(react@19.1.0))(react@19.1.0)':
|
'@react-native-community/datetimepicker@8.4.4(expo@54.0.34)(react-native@0.81.5(@babel/core@7.29.0)(@types/react@19.1.17)(react@19.1.0))(react@19.1.0)':
|
||||||
dependencies:
|
dependencies:
|
||||||
invariant: 2.2.4
|
invariant: 2.2.4
|
||||||
react: 19.1.0
|
react: 19.1.0
|
||||||
@@ -8336,10 +8391,6 @@ snapshots:
|
|||||||
dependencies:
|
dependencies:
|
||||||
'@types/node': 25.3.5
|
'@types/node': 25.3.5
|
||||||
|
|
||||||
'@types/cookie-parser@1.4.10(@types/express@5.0.6)':
|
|
||||||
dependencies:
|
|
||||||
'@types/express': 5.0.6
|
|
||||||
|
|
||||||
'@types/cors@2.8.19':
|
'@types/cors@2.8.19':
|
||||||
dependencies:
|
dependencies:
|
||||||
'@types/node': 25.3.5
|
'@types/node': 25.3.5
|
||||||
@@ -8572,12 +8623,24 @@ snapshots:
|
|||||||
|
|
||||||
asap@2.0.6: {}
|
asap@2.0.6: {}
|
||||||
|
|
||||||
|
assert@2.1.0:
|
||||||
|
dependencies:
|
||||||
|
call-bind: 1.0.9
|
||||||
|
is-nan: 1.3.2
|
||||||
|
object-is: 1.1.6
|
||||||
|
object.assign: 4.1.7
|
||||||
|
util: 0.12.5
|
||||||
|
|
||||||
async-limiter@1.0.1: {}
|
async-limiter@1.0.1: {}
|
||||||
|
|
||||||
asynckit@0.4.0: {}
|
asynckit@0.4.0: {}
|
||||||
|
|
||||||
atomic-sleep@1.0.0: {}
|
atomic-sleep@1.0.0: {}
|
||||||
|
|
||||||
|
available-typed-arrays@1.0.7:
|
||||||
|
dependencies:
|
||||||
|
possible-typed-array-names: 1.1.0
|
||||||
|
|
||||||
axios@1.15.2:
|
axios@1.15.2:
|
||||||
dependencies:
|
dependencies:
|
||||||
follow-redirects: 1.16.0
|
follow-redirects: 1.16.0
|
||||||
@@ -8711,6 +8774,38 @@ snapshots:
|
|||||||
- '@babel/core'
|
- '@babel/core'
|
||||||
- supports-color
|
- supports-color
|
||||||
|
|
||||||
|
babel-preset-expo@54.0.10(@babel/core@7.29.0)(@babel/runtime@7.28.6)(expo@54.0.34)(react-refresh@0.18.0):
|
||||||
|
dependencies:
|
||||||
|
'@babel/helper-module-imports': 7.28.6
|
||||||
|
'@babel/plugin-proposal-decorators': 7.29.0(@babel/core@7.29.0)
|
||||||
|
'@babel/plugin-proposal-export-default-from': 7.27.1(@babel/core@7.29.0)
|
||||||
|
'@babel/plugin-syntax-export-default-from': 7.28.6(@babel/core@7.29.0)
|
||||||
|
'@babel/plugin-transform-class-static-block': 7.28.6(@babel/core@7.29.0)
|
||||||
|
'@babel/plugin-transform-export-namespace-from': 7.27.1(@babel/core@7.29.0)
|
||||||
|
'@babel/plugin-transform-flow-strip-types': 7.27.1(@babel/core@7.29.0)
|
||||||
|
'@babel/plugin-transform-modules-commonjs': 7.28.6(@babel/core@7.29.0)
|
||||||
|
'@babel/plugin-transform-object-rest-spread': 7.28.6(@babel/core@7.29.0)
|
||||||
|
'@babel/plugin-transform-parameters': 7.27.7(@babel/core@7.29.0)
|
||||||
|
'@babel/plugin-transform-private-methods': 7.28.6(@babel/core@7.29.0)
|
||||||
|
'@babel/plugin-transform-private-property-in-object': 7.28.6(@babel/core@7.29.0)
|
||||||
|
'@babel/plugin-transform-runtime': 7.29.0(@babel/core@7.29.0)
|
||||||
|
'@babel/preset-react': 7.28.5(@babel/core@7.29.0)
|
||||||
|
'@babel/preset-typescript': 7.28.5(@babel/core@7.29.0)
|
||||||
|
'@react-native/babel-preset': 0.81.5(@babel/core@7.29.0)
|
||||||
|
babel-plugin-react-compiler: 1.0.0
|
||||||
|
babel-plugin-react-native-web: 0.21.2
|
||||||
|
babel-plugin-syntax-hermes-parser: 0.29.1
|
||||||
|
babel-plugin-transform-flow-enums: 0.0.2(@babel/core@7.29.0)
|
||||||
|
debug: 4.4.3
|
||||||
|
react-refresh: 0.18.0
|
||||||
|
resolve-from: 5.0.0
|
||||||
|
optionalDependencies:
|
||||||
|
'@babel/runtime': 7.28.6
|
||||||
|
expo: 54.0.34(@babel/core@7.29.0)(@expo/metro-runtime@6.1.2)(expo-router@6.0.23)(react-native@0.81.5(@babel/core@7.29.0)(@types/react@19.1.17)(react@19.1.0))(react@19.1.0)(typescript@5.9.3)
|
||||||
|
transitivePeerDependencies:
|
||||||
|
- '@babel/core'
|
||||||
|
- supports-color
|
||||||
|
|
||||||
babel-preset-jest@29.6.3(@babel/core@7.29.0):
|
babel-preset-jest@29.6.3(@babel/core@7.29.0):
|
||||||
dependencies:
|
dependencies:
|
||||||
'@babel/core': 7.29.0
|
'@babel/core': 7.29.0
|
||||||
@@ -8816,6 +8911,13 @@ snapshots:
|
|||||||
es-errors: 1.3.0
|
es-errors: 1.3.0
|
||||||
function-bind: 1.1.2
|
function-bind: 1.1.2
|
||||||
|
|
||||||
|
call-bind@1.0.9:
|
||||||
|
dependencies:
|
||||||
|
call-bind-apply-helpers: 1.0.2
|
||||||
|
es-define-property: 1.0.1
|
||||||
|
get-intrinsic: 1.3.0
|
||||||
|
set-function-length: 1.2.2
|
||||||
|
|
||||||
call-bound@1.0.4:
|
call-bound@1.0.4:
|
||||||
dependencies:
|
dependencies:
|
||||||
call-bind-apply-helpers: 1.0.2
|
call-bind-apply-helpers: 1.0.2
|
||||||
@@ -8983,13 +9085,6 @@ snapshots:
|
|||||||
|
|
||||||
convert-source-map@2.0.0: {}
|
convert-source-map@2.0.0: {}
|
||||||
|
|
||||||
cookie-parser@1.4.7:
|
|
||||||
dependencies:
|
|
||||||
cookie: 0.7.2
|
|
||||||
cookie-signature: 1.0.6
|
|
||||||
|
|
||||||
cookie-signature@1.0.6: {}
|
|
||||||
|
|
||||||
cookie-signature@1.2.2: {}
|
cookie-signature@1.2.2: {}
|
||||||
|
|
||||||
cookie@0.7.2: {}
|
cookie@0.7.2: {}
|
||||||
@@ -9112,8 +9207,20 @@ snapshots:
|
|||||||
|
|
||||||
defer-to-connect@2.0.1: {}
|
defer-to-connect@2.0.1: {}
|
||||||
|
|
||||||
|
define-data-property@1.1.4:
|
||||||
|
dependencies:
|
||||||
|
es-define-property: 1.0.1
|
||||||
|
es-errors: 1.3.0
|
||||||
|
gopd: 1.2.0
|
||||||
|
|
||||||
define-lazy-prop@2.0.0: {}
|
define-lazy-prop@2.0.0: {}
|
||||||
|
|
||||||
|
define-properties@1.2.1:
|
||||||
|
dependencies:
|
||||||
|
define-data-property: 1.1.4
|
||||||
|
has-property-descriptors: 1.0.2
|
||||||
|
object-keys: 1.1.1
|
||||||
|
|
||||||
delayed-stream@1.0.0: {}
|
delayed-stream@1.0.0: {}
|
||||||
|
|
||||||
depd@2.0.0: {}
|
depd@2.0.0: {}
|
||||||
@@ -9291,7 +9398,7 @@ snapshots:
|
|||||||
strip-final-newline: 4.0.0
|
strip-final-newline: 4.0.0
|
||||||
yoctocolors: 2.1.2
|
yoctocolors: 2.1.2
|
||||||
|
|
||||||
expo-application@55.0.14(expo@54.0.34):
|
expo-application@7.0.8(expo@54.0.34):
|
||||||
dependencies:
|
dependencies:
|
||||||
expo: 54.0.34(@babel/core@7.29.0)(@expo/metro-runtime@6.1.2)(expo-router@6.0.23)(react-native@0.81.5(@babel/core@7.29.0)(@types/react@19.1.17)(react@19.1.0))(react@19.1.0)(typescript@5.9.3)
|
expo: 54.0.34(@babel/core@7.29.0)(@expo/metro-runtime@6.1.2)(expo-router@6.0.23)(react-native@0.81.5(@babel/core@7.29.0)(@types/react@19.1.17)(react@19.1.0))(react@19.1.0)(typescript@5.9.3)
|
||||||
|
|
||||||
@@ -9312,6 +9419,12 @@ snapshots:
|
|||||||
react: 19.1.0
|
react: 19.1.0
|
||||||
react-native: 0.81.5(@babel/core@7.29.0)(@types/react@19.1.17)(react@19.1.0)
|
react-native: 0.81.5(@babel/core@7.29.0)(@types/react@19.1.17)(react@19.1.0)
|
||||||
|
|
||||||
|
expo-clipboard@8.0.8(expo@54.0.34)(react-native@0.81.5(@babel/core@7.29.0)(@types/react@19.1.17)(react@19.1.0))(react@19.1.0):
|
||||||
|
dependencies:
|
||||||
|
expo: 54.0.34(@babel/core@7.29.0)(@expo/metro-runtime@6.1.2)(expo-router@6.0.23)(react-native@0.81.5(@babel/core@7.29.0)(@types/react@19.1.17)(react@19.1.0))(react@19.1.0)(typescript@5.9.3)
|
||||||
|
react: 19.1.0
|
||||||
|
react-native: 0.81.5(@babel/core@7.29.0)(@types/react@19.1.17)(react@19.1.0)
|
||||||
|
|
||||||
expo-constants@18.0.13(expo@54.0.34)(react-native@0.81.5(@babel/core@7.29.0)(@types/react@19.1.17)(react@19.1.0)):
|
expo-constants@18.0.13(expo@54.0.34)(react-native@0.81.5(@babel/core@7.29.0)(@types/react@19.1.17)(react@19.1.0)):
|
||||||
dependencies:
|
dependencies:
|
||||||
'@expo/config': 12.0.13
|
'@expo/config': 12.0.13
|
||||||
@@ -9321,14 +9434,6 @@ snapshots:
|
|||||||
transitivePeerDependencies:
|
transitivePeerDependencies:
|
||||||
- supports-color
|
- supports-color
|
||||||
|
|
||||||
expo-constants@55.0.15(expo@54.0.34)(react-native@0.81.5(@babel/core@7.29.0)(@types/react@19.1.17)(react@19.1.0)):
|
|
||||||
dependencies:
|
|
||||||
'@expo/env': 2.1.1
|
|
||||||
expo: 54.0.34(@babel/core@7.29.0)(@expo/metro-runtime@6.1.2)(expo-router@6.0.23)(react-native@0.81.5(@babel/core@7.29.0)(@types/react@19.1.17)(react@19.1.0))(react@19.1.0)(typescript@5.9.3)
|
|
||||||
react-native: 0.81.5(@babel/core@7.29.0)(@types/react@19.1.17)(react@19.1.0)
|
|
||||||
transitivePeerDependencies:
|
|
||||||
- supports-color
|
|
||||||
|
|
||||||
expo-file-system@19.0.22(expo@54.0.34)(react-native@0.81.5(@babel/core@7.29.0)(@types/react@19.1.17)(react@19.1.0)):
|
expo-file-system@19.0.22(expo@54.0.34)(react-native@0.81.5(@babel/core@7.29.0)(@types/react@19.1.17)(react@19.1.0)):
|
||||||
dependencies:
|
dependencies:
|
||||||
expo: 54.0.34(@babel/core@7.29.0)(@expo/metro-runtime@6.1.2)(expo-router@6.0.23)(react-native@0.81.5(@babel/core@7.29.0)(@types/react@19.1.17)(react@19.1.0))(react@19.1.0)(typescript@5.9.3)
|
expo: 54.0.34(@babel/core@7.29.0)(@expo/metro-runtime@6.1.2)(expo-router@6.0.23)(react-native@0.81.5(@babel/core@7.29.0)(@types/react@19.1.17)(react@19.1.0))(react@19.1.0)(typescript@5.9.3)
|
||||||
@@ -9407,14 +9512,16 @@ snapshots:
|
|||||||
react: 19.1.0
|
react: 19.1.0
|
||||||
react-native: 0.81.5(@babel/core@7.29.0)(@types/react@19.1.17)(react@19.1.0)
|
react-native: 0.81.5(@babel/core@7.29.0)(@types/react@19.1.17)(react@19.1.0)
|
||||||
|
|
||||||
expo-notifications@55.0.22(expo@54.0.34)(react-native@0.81.5(@babel/core@7.29.0)(@types/react@19.1.17)(react@19.1.0))(react@19.1.0)(typescript@5.9.3):
|
expo-notifications@0.32.17(expo@54.0.34)(react-native@0.81.5(@babel/core@7.29.0)(@types/react@19.1.17)(react@19.1.0))(react@19.1.0)(typescript@5.9.3):
|
||||||
dependencies:
|
dependencies:
|
||||||
'@expo/image-utils': 0.8.13(typescript@5.9.3)
|
'@expo/image-utils': 0.8.13(typescript@5.9.3)
|
||||||
|
'@ide/backoff': 1.0.0
|
||||||
abort-controller: 3.0.0
|
abort-controller: 3.0.0
|
||||||
|
assert: 2.1.0
|
||||||
badgin: 1.2.3
|
badgin: 1.2.3
|
||||||
expo: 54.0.34(@babel/core@7.29.0)(@expo/metro-runtime@6.1.2)(expo-router@6.0.23)(react-native@0.81.5(@babel/core@7.29.0)(@types/react@19.1.17)(react@19.1.0))(react@19.1.0)(typescript@5.9.3)
|
expo: 54.0.34(@babel/core@7.29.0)(@expo/metro-runtime@6.1.2)(expo-router@6.0.23)(react-native@0.81.5(@babel/core@7.29.0)(@types/react@19.1.17)(react@19.1.0))(react@19.1.0)(typescript@5.9.3)
|
||||||
expo-application: 55.0.14(expo@54.0.34)
|
expo-application: 7.0.8(expo@54.0.34)
|
||||||
expo-constants: 55.0.15(expo@54.0.34)(react-native@0.81.5(@babel/core@7.29.0)(@types/react@19.1.17)(react@19.1.0))
|
expo-constants: 18.0.13(expo@54.0.34)(react-native@0.81.5(@babel/core@7.29.0)(@types/react@19.1.17)(react@19.1.0))
|
||||||
react: 19.1.0
|
react: 19.1.0
|
||||||
react-native: 0.81.5(@babel/core@7.29.0)(@types/react@19.1.17)(react@19.1.0)
|
react-native: 0.81.5(@babel/core@7.29.0)(@types/react@19.1.17)(react@19.1.0)
|
||||||
transitivePeerDependencies:
|
transitivePeerDependencies:
|
||||||
@@ -9464,7 +9571,7 @@ snapshots:
|
|||||||
- '@types/react-dom'
|
- '@types/react-dom'
|
||||||
- supports-color
|
- supports-color
|
||||||
|
|
||||||
expo-secure-store@55.0.13(expo@54.0.34):
|
expo-secure-store@15.0.8(expo@54.0.34):
|
||||||
dependencies:
|
dependencies:
|
||||||
expo: 54.0.34(@babel/core@7.29.0)(@expo/metro-runtime@6.1.2)(expo-router@6.0.23)(react-native@0.81.5(@babel/core@7.29.0)(@types/react@19.1.17)(react@19.1.0))(react@19.1.0)(typescript@5.9.3)
|
expo: 54.0.34(@babel/core@7.29.0)(@expo/metro-runtime@6.1.2)(expo-router@6.0.23)(react-native@0.81.5(@babel/core@7.29.0)(@types/react@19.1.17)(react@19.1.0))(react@19.1.0)(typescript@5.9.3)
|
||||||
|
|
||||||
@@ -9501,12 +9608,6 @@ snapshots:
|
|||||||
transitivePeerDependencies:
|
transitivePeerDependencies:
|
||||||
- supports-color
|
- supports-color
|
||||||
|
|
||||||
expo-task-manager@55.0.15(expo@54.0.34)(react-native@0.81.5(@babel/core@7.29.0)(@types/react@19.1.17)(react@19.1.0)):
|
|
||||||
dependencies:
|
|
||||||
expo: 54.0.34(@babel/core@7.29.0)(@expo/metro-runtime@6.1.2)(expo-router@6.0.23)(react-native@0.81.5(@babel/core@7.29.0)(@types/react@19.1.17)(react@19.1.0))(react@19.1.0)(typescript@5.9.3)
|
|
||||||
react-native: 0.81.5(@babel/core@7.29.0)(@types/react@19.1.17)(react@19.1.0)
|
|
||||||
unimodules-app-loader: 55.0.5
|
|
||||||
|
|
||||||
expo-web-browser@15.0.11(expo@54.0.34)(react-native@0.81.5(@babel/core@7.29.0)(@types/react@19.1.17)(react@19.1.0)):
|
expo-web-browser@15.0.11(expo@54.0.34)(react-native@0.81.5(@babel/core@7.29.0)(@types/react@19.1.17)(react@19.1.0)):
|
||||||
dependencies:
|
dependencies:
|
||||||
expo: 54.0.34(@babel/core@7.29.0)(@expo/metro-runtime@6.1.2)(expo-router@6.0.23)(react-native@0.81.5(@babel/core@7.29.0)(@types/react@19.1.17)(react@19.1.0))(react@19.1.0)(typescript@5.9.3)
|
expo: 54.0.34(@babel/core@7.29.0)(@expo/metro-runtime@6.1.2)(expo-router@6.0.23)(react-native@0.81.5(@babel/core@7.29.0)(@types/react@19.1.17)(react@19.1.0))(react@19.1.0)(typescript@5.9.3)
|
||||||
@@ -9678,6 +9779,10 @@ snapshots:
|
|||||||
|
|
||||||
fontfaceobserver@2.3.0: {}
|
fontfaceobserver@2.3.0: {}
|
||||||
|
|
||||||
|
for-each@0.3.5:
|
||||||
|
dependencies:
|
||||||
|
is-callable: 1.2.7
|
||||||
|
|
||||||
form-data@4.0.5:
|
form-data@4.0.5:
|
||||||
dependencies:
|
dependencies:
|
||||||
asynckit: 0.4.0
|
asynckit: 0.4.0
|
||||||
@@ -9716,6 +9821,8 @@ snapshots:
|
|||||||
|
|
||||||
function-bind@1.1.2: {}
|
function-bind@1.1.2: {}
|
||||||
|
|
||||||
|
generator-function@2.0.1: {}
|
||||||
|
|
||||||
gensync@1.0.0-beta.2: {}
|
gensync@1.0.0-beta.2: {}
|
||||||
|
|
||||||
get-caller-file@2.0.5: {}
|
get-caller-file@2.0.5: {}
|
||||||
@@ -9807,6 +9914,10 @@ snapshots:
|
|||||||
|
|
||||||
has-flag@4.0.0: {}
|
has-flag@4.0.0: {}
|
||||||
|
|
||||||
|
has-property-descriptors@1.0.2:
|
||||||
|
dependencies:
|
||||||
|
es-define-property: 1.0.1
|
||||||
|
|
||||||
has-symbols@1.1.0: {}
|
has-symbols@1.1.0: {}
|
||||||
|
|
||||||
has-tostringtag@1.0.2:
|
has-tostringtag@1.0.2:
|
||||||
@@ -9913,8 +10024,15 @@ snapshots:
|
|||||||
|
|
||||||
ipaddr.js@1.9.1: {}
|
ipaddr.js@1.9.1: {}
|
||||||
|
|
||||||
|
is-arguments@1.2.0:
|
||||||
|
dependencies:
|
||||||
|
call-bound: 1.0.4
|
||||||
|
has-tostringtag: 1.0.2
|
||||||
|
|
||||||
is-arrayish@0.3.4: {}
|
is-arrayish@0.3.4: {}
|
||||||
|
|
||||||
|
is-callable@1.2.7: {}
|
||||||
|
|
||||||
is-core-module@2.16.1:
|
is-core-module@2.16.1:
|
||||||
dependencies:
|
dependencies:
|
||||||
hasown: 2.0.2
|
hasown: 2.0.2
|
||||||
@@ -9925,10 +10043,23 @@ snapshots:
|
|||||||
|
|
||||||
is-fullwidth-code-point@3.0.0: {}
|
is-fullwidth-code-point@3.0.0: {}
|
||||||
|
|
||||||
|
is-generator-function@1.1.2:
|
||||||
|
dependencies:
|
||||||
|
call-bound: 1.0.4
|
||||||
|
generator-function: 2.0.1
|
||||||
|
get-proto: 1.0.1
|
||||||
|
has-tostringtag: 1.0.2
|
||||||
|
safe-regex-test: 1.1.0
|
||||||
|
|
||||||
is-glob@4.0.3:
|
is-glob@4.0.3:
|
||||||
dependencies:
|
dependencies:
|
||||||
is-extglob: 2.1.1
|
is-extglob: 2.1.1
|
||||||
|
|
||||||
|
is-nan@1.3.2:
|
||||||
|
dependencies:
|
||||||
|
call-bind: 1.0.9
|
||||||
|
define-properties: 1.2.1
|
||||||
|
|
||||||
is-number@7.0.0: {}
|
is-number@7.0.0: {}
|
||||||
|
|
||||||
is-path-inside@4.0.0: {}
|
is-path-inside@4.0.0: {}
|
||||||
@@ -9939,8 +10070,19 @@ snapshots:
|
|||||||
|
|
||||||
is-promise@4.0.0: {}
|
is-promise@4.0.0: {}
|
||||||
|
|
||||||
|
is-regex@1.2.1:
|
||||||
|
dependencies:
|
||||||
|
call-bound: 1.0.4
|
||||||
|
gopd: 1.2.0
|
||||||
|
has-tostringtag: 1.0.2
|
||||||
|
hasown: 2.0.2
|
||||||
|
|
||||||
is-stream@4.0.1: {}
|
is-stream@4.0.1: {}
|
||||||
|
|
||||||
|
is-typed-array@1.1.15:
|
||||||
|
dependencies:
|
||||||
|
which-typed-array: 1.1.20
|
||||||
|
|
||||||
is-unicode-supported@2.1.0: {}
|
is-unicode-supported@2.1.0: {}
|
||||||
|
|
||||||
is-wsl@2.2.0:
|
is-wsl@2.2.0:
|
||||||
@@ -10659,6 +10801,22 @@ snapshots:
|
|||||||
|
|
||||||
object-inspect@1.13.4: {}
|
object-inspect@1.13.4: {}
|
||||||
|
|
||||||
|
object-is@1.1.6:
|
||||||
|
dependencies:
|
||||||
|
call-bind: 1.0.9
|
||||||
|
define-properties: 1.2.1
|
||||||
|
|
||||||
|
object-keys@1.1.1: {}
|
||||||
|
|
||||||
|
object.assign@4.1.7:
|
||||||
|
dependencies:
|
||||||
|
call-bind: 1.0.9
|
||||||
|
call-bound: 1.0.4
|
||||||
|
define-properties: 1.2.1
|
||||||
|
es-object-atoms: 1.1.1
|
||||||
|
has-symbols: 1.1.0
|
||||||
|
object-keys: 1.1.1
|
||||||
|
|
||||||
on-exit-leak-free@2.1.2: {}
|
on-exit-leak-free@2.1.2: {}
|
||||||
|
|
||||||
on-finished@2.3.0:
|
on-finished@2.3.0:
|
||||||
@@ -10888,6 +11046,8 @@ snapshots:
|
|||||||
|
|
||||||
pngjs@3.4.0: {}
|
pngjs@3.4.0: {}
|
||||||
|
|
||||||
|
possible-typed-array-names@1.1.0: {}
|
||||||
|
|
||||||
postcss-value-parser@4.2.0: {}
|
postcss-value-parser@4.2.0: {}
|
||||||
|
|
||||||
postcss@8.4.49:
|
postcss@8.4.49:
|
||||||
@@ -11397,6 +11557,12 @@ snapshots:
|
|||||||
|
|
||||||
safe-buffer@5.2.1: {}
|
safe-buffer@5.2.1: {}
|
||||||
|
|
||||||
|
safe-regex-test@1.1.0:
|
||||||
|
dependencies:
|
||||||
|
call-bound: 1.0.4
|
||||||
|
es-errors: 1.3.0
|
||||||
|
is-regex: 1.2.1
|
||||||
|
|
||||||
safe-stable-stringify@2.5.0: {}
|
safe-stable-stringify@2.5.0: {}
|
||||||
|
|
||||||
safer-buffer@2.1.2: {}
|
safer-buffer@2.1.2: {}
|
||||||
@@ -11471,6 +11637,15 @@ snapshots:
|
|||||||
|
|
||||||
server-only@0.0.1: {}
|
server-only@0.0.1: {}
|
||||||
|
|
||||||
|
set-function-length@1.2.2:
|
||||||
|
dependencies:
|
||||||
|
define-data-property: 1.1.4
|
||||||
|
es-errors: 1.3.0
|
||||||
|
function-bind: 1.1.2
|
||||||
|
get-intrinsic: 1.3.0
|
||||||
|
gopd: 1.2.0
|
||||||
|
has-property-descriptors: 1.0.2
|
||||||
|
|
||||||
setimmediate@1.0.5: {}
|
setimmediate@1.0.5: {}
|
||||||
|
|
||||||
setprototypeof@1.2.0: {}
|
setprototypeof@1.2.0: {}
|
||||||
@@ -11776,8 +11951,6 @@ snapshots:
|
|||||||
|
|
||||||
unicorn-magic@0.4.0: {}
|
unicorn-magic@0.4.0: {}
|
||||||
|
|
||||||
unimodules-app-loader@55.0.5: {}
|
|
||||||
|
|
||||||
universalify@2.0.1: {}
|
universalify@2.0.1: {}
|
||||||
|
|
||||||
unpipe@1.0.0: {}
|
unpipe@1.0.0: {}
|
||||||
@@ -11826,6 +11999,14 @@ snapshots:
|
|||||||
dependencies:
|
dependencies:
|
||||||
react: 19.1.0
|
react: 19.1.0
|
||||||
|
|
||||||
|
util@0.12.5:
|
||||||
|
dependencies:
|
||||||
|
inherits: 2.0.4
|
||||||
|
is-arguments: 1.2.0
|
||||||
|
is-generator-function: 1.1.2
|
||||||
|
is-typed-array: 1.1.15
|
||||||
|
which-typed-array: 1.1.20
|
||||||
|
|
||||||
utils-merge@1.0.1: {}
|
utils-merge@1.0.1: {}
|
||||||
|
|
||||||
uuid@3.4.0: {}
|
uuid@3.4.0: {}
|
||||||
@@ -11917,6 +12098,16 @@ snapshots:
|
|||||||
tr46: 0.0.3
|
tr46: 0.0.3
|
||||||
webidl-conversions: 3.0.1
|
webidl-conversions: 3.0.1
|
||||||
|
|
||||||
|
which-typed-array@1.1.20:
|
||||||
|
dependencies:
|
||||||
|
available-typed-arrays: 1.0.7
|
||||||
|
call-bind: 1.0.9
|
||||||
|
call-bound: 1.0.4
|
||||||
|
for-each: 0.3.5
|
||||||
|
get-proto: 1.0.1
|
||||||
|
gopd: 1.2.0
|
||||||
|
has-tostringtag: 1.0.2
|
||||||
|
|
||||||
which@2.0.2:
|
which@2.0.2:
|
||||||
dependencies:
|
dependencies:
|
||||||
isexe: 2.0.0
|
isexe: 2.0.0
|
||||||
|
|||||||
@@ -1,64 +0,0 @@
|
|||||||
# Workspace
|
|
||||||
|
|
||||||
## Overview
|
|
||||||
|
|
||||||
pnpm workspace monorepo using TypeScript. Each package manages its own dependencies.
|
|
||||||
|
|
||||||
## Stack
|
|
||||||
|
|
||||||
- **Monorepo tool**: pnpm workspaces
|
|
||||||
- **Node.js version**: 24
|
|
||||||
- **Package manager**: pnpm
|
|
||||||
- **TypeScript version**: 5.9
|
|
||||||
- **API framework**: Express 5
|
|
||||||
- **Database**: PostgreSQL + Drizzle ORM
|
|
||||||
- **Validation**: Zod (`zod/v4`), `drizzle-zod`
|
|
||||||
- **API codegen**: Orval (from OpenAPI spec)
|
|
||||||
- **Build**: esbuild (CJS bundle)
|
|
||||||
|
|
||||||
## Artifacts
|
|
||||||
|
|
||||||
### PostizMobile (`artifacts/postiz-mobile`)
|
|
||||||
Expo (React Native) mobile client for a self-hosted Postiz instance.
|
|
||||||
|
|
||||||
- **Preview path**: `/`
|
|
||||||
- **Theme**: Dark-only (`userInterfaceStyle: dark`)
|
|
||||||
- **Auth**: API key stored in `expo-secure-store`, passed as `Authorization` header
|
|
||||||
|
|
||||||
#### Screens / Tabs
|
|
||||||
1. **Calendar** (`app/(tabs)/index.tsx`) — Monthly calendar with post dots, tap day to see posts
|
|
||||||
2. **Posts** (`app/(tabs)/posts.tsx`) — Filterable list of posts with status badges, swipe to delete
|
|
||||||
3. **Compose** (`app/(tabs)/compose.tsx`) — Text editor, channel picker, date/time picker, image upload
|
|
||||||
4. **Settings** (`app/(tabs)/settings.tsx`) — API key + base URL, validation, SecureStore persistence
|
|
||||||
|
|
||||||
#### Key Files
|
|
||||||
- `context/PostizContext.tsx` — Axios client wired with API key/base URL; loaded from SecureStore on boot
|
|
||||||
- `components/PostCard.tsx` — Swipeable post card with delete action
|
|
||||||
- `components/StatusBadge.tsx` — QUEUE / PUBLISHED / ERROR / DRAFT badges
|
|
||||||
- `components/ChannelChip.tsx` — Integration channel selector chip
|
|
||||||
|
|
||||||
#### External API
|
|
||||||
- Base URL: `https://postiz.gyozamancave.fr/public/v1` (configurable)
|
|
||||||
- `GET /integrations` — List channels
|
|
||||||
- `GET /posts?startDate&endDate` — List posts
|
|
||||||
- `POST /posts` — Create/schedule post
|
|
||||||
- `DELETE /posts/:id` — Delete post
|
|
||||||
- `POST /upload` — Upload media
|
|
||||||
|
|
||||||
#### Packages Added
|
|
||||||
- `axios` — HTTP client
|
|
||||||
- `expo-secure-store` — Secure API key storage
|
|
||||||
- `react-native-calendars` — Calendar UI
|
|
||||||
- `@react-native-community/datetimepicker` — Date/time picker for compose
|
|
||||||
|
|
||||||
### API Server (`artifacts/api-server`)
|
|
||||||
Express 5 backend. Currently serves `/api/healthz`. Extend for server-side features.
|
|
||||||
|
|
||||||
## Key Commands
|
|
||||||
|
|
||||||
- `pnpm run typecheck` — full typecheck across all packages
|
|
||||||
- `pnpm run build` — typecheck + build all packages
|
|
||||||
- `pnpm --filter @workspace/api-spec run codegen` — regenerate API hooks and Zod schemas from OpenAPI spec
|
|
||||||
- `pnpm --filter @workspace/db run push` — push DB schema changes (dev only)
|
|
||||||
|
|
||||||
See the `pnpm-workspace` skill for workspace structure, TypeScript setup, and package details.
|
|
||||||
@@ -2,3 +2,7 @@
|
|||||||
set -e
|
set -e
|
||||||
pnpm install --frozen-lockfile
|
pnpm install --frozen-lockfile
|
||||||
pnpm --filter db push
|
pnpm --filter db push
|
||||||
|
|
||||||
|
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
|
||||||
|
echo "Syncing to Gitea..."
|
||||||
|
bash "$SCRIPT_DIR/push-to-gitea.sh" || echo "Warning: Gitea push failed (non-fatal)."
|
||||||
|
|||||||
Reference in New Issue
Block a user