@akis05/akis 0.1.3 → 0.1.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +409 -40
- package/dist/cli/akis.js +28 -28
- package/dist/cli/akis.js.map +1 -1
- package/dist/cli/commands/delete.js +15 -15
- package/dist/cli/commands/delete.js.map +1 -1
- package/dist/cli/commands/init.d.ts.map +1 -1
- package/dist/cli/commands/init.js +28 -29
- package/dist/cli/commands/init.js.map +1 -1
- package/dist/cli/commands/migrate.js +20 -20
- package/dist/cli/commands/migrate.js.map +1 -1
- package/dist/cli/commands/status.js +16 -16
- package/dist/cli/commands/status.js.map +1 -1
- package/dist/cli/commands/update.js +16 -16
- package/dist/cli/commands/update.js.map +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -1,81 +1,450 @@
|
|
|
1
1
|
# AKIS - Appwrite CLI Tool
|
|
2
2
|
|
|
3
|
-
CLI
|
|
3
|
+
**AKIS** is a CLI tool that automatically syncs your Appwrite collections with your TypeScript types. Define your types once, and AKIS creates/updates your collections and generates the corresponding schema.
|
|
4
|
+
|
|
5
|
+
## Features
|
|
6
|
+
|
|
7
|
+
- **Auto-generation**: Creates Appwrite collections from your TypeScript types
|
|
8
|
+
- **Synchronization**: Detects differences between your types and Appwrite
|
|
9
|
+
- **Auto-generated schema**: The `schema.ts` file is automatically generated during migration
|
|
10
|
+
- **Automatic indexes**: Creates indexes for common fields (storeId, email, etc.)
|
|
11
|
+
- **Dry-run mode**: Preview changes before applying them
|
|
12
|
+
|
|
13
|
+
---
|
|
4
14
|
|
|
5
15
|
## Installation
|
|
6
16
|
|
|
17
|
+
### With npm
|
|
18
|
+
```bash
|
|
19
|
+
npm install @akis05/akis
|
|
20
|
+
```
|
|
21
|
+
|
|
22
|
+
### With pnpm
|
|
23
|
+
```bash
|
|
24
|
+
pnpm add @akis05/akis
|
|
25
|
+
```
|
|
26
|
+
|
|
27
|
+
### Global installation (optional)
|
|
7
28
|
```bash
|
|
8
|
-
npm
|
|
9
|
-
# ou
|
|
10
|
-
pnpm install @akis05/akis
|
|
29
|
+
npm install -g @akis05/akis
|
|
11
30
|
```
|
|
12
31
|
|
|
32
|
+
---
|
|
33
|
+
|
|
13
34
|
## Configuration
|
|
14
35
|
|
|
15
|
-
|
|
36
|
+
### 1. Environment Variables
|
|
37
|
+
|
|
38
|
+
Create a `.env` file at the root of your project:
|
|
16
39
|
|
|
17
40
|
```env
|
|
41
|
+
# Appwrite Endpoint (Cloud or Self-hosted)
|
|
18
42
|
APPWRITE_ENDPOINT=https://cloud.appwrite.io/v1
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
43
|
+
|
|
44
|
+
# Your Appwrite project ID
|
|
45
|
+
APPWRITE_PROJECT_ID=your_project_id
|
|
46
|
+
|
|
47
|
+
# Your database ID
|
|
48
|
+
APPWRITE_DATABASE_ID=your_database_id
|
|
49
|
+
|
|
50
|
+
# API Key with Database permissions (Create, Read, Update, Delete)
|
|
51
|
+
APPWRITE_API_KEY=your_api_key
|
|
22
52
|
```
|
|
23
53
|
|
|
24
|
-
|
|
54
|
+
### 2. Getting Appwrite Credentials
|
|
55
|
+
|
|
56
|
+
1. Log in to [Appwrite Console](https://cloud.appwrite.io)
|
|
57
|
+
2. **Project ID**: Settings → Project ID
|
|
58
|
+
3. **Database ID**: Databases → Click on your DB → Settings
|
|
59
|
+
4. **API Key**: Settings → API Keys → Create API Key (check Database permissions)
|
|
60
|
+
|
|
61
|
+
---
|
|
25
62
|
|
|
26
|
-
|
|
63
|
+
## Quick Start
|
|
64
|
+
|
|
65
|
+
### Step 1: Initialize the project
|
|
27
66
|
|
|
28
67
|
```bash
|
|
29
68
|
npx akis init
|
|
30
69
|
```
|
|
31
70
|
|
|
32
|
-
|
|
71
|
+
This command creates the following structure:
|
|
72
|
+
|
|
33
73
|
```
|
|
34
74
|
core/
|
|
35
75
|
└── appwrite-model/
|
|
36
|
-
├── types.ts #
|
|
37
|
-
├── schema.ts #
|
|
38
|
-
├── client.ts #
|
|
39
|
-
└── setup-collections.ts #
|
|
76
|
+
├── types.ts # Your TypeScript definitions
|
|
77
|
+
├── schema.ts # Generated schema (do not edit manually)
|
|
78
|
+
├── client.ts # Configured Appwrite client
|
|
79
|
+
└── setup-collections.ts # Utility functions
|
|
80
|
+
```
|
|
81
|
+
|
|
82
|
+
### Step 2: Define your types
|
|
83
|
+
|
|
84
|
+
Edit `core/appwrite-model/types.ts`:
|
|
85
|
+
|
|
86
|
+
```typescript
|
|
87
|
+
export type Client = {
|
|
88
|
+
_id: string; // Appwrite ID (required)
|
|
89
|
+
_creationTime: number; // Creation timestamp (required)
|
|
90
|
+
name: string; // Required field
|
|
91
|
+
email?: string; // Optional field (?)
|
|
92
|
+
phone?: string;
|
|
93
|
+
status: "active" | "inactive"; // Enum
|
|
94
|
+
tags?: string[]; // String array
|
|
95
|
+
storeId: string;
|
|
96
|
+
createdAt: number;
|
|
97
|
+
deletedAt?: number;
|
|
98
|
+
};
|
|
99
|
+
|
|
100
|
+
export type Product = {
|
|
101
|
+
_id: string;
|
|
102
|
+
_creationTime: number;
|
|
103
|
+
name: string;
|
|
104
|
+
price: number;
|
|
105
|
+
quantity: number;
|
|
106
|
+
category: "electronics" | "clothing" | "food";
|
|
107
|
+
storeId: string;
|
|
108
|
+
createdAt: number;
|
|
109
|
+
};
|
|
40
110
|
```
|
|
41
111
|
|
|
42
|
-
###
|
|
112
|
+
### Step 3: Migrate to Appwrite
|
|
43
113
|
|
|
44
114
|
```bash
|
|
45
|
-
#
|
|
46
|
-
npx akis
|
|
47
|
-
npx akis status --name clients
|
|
115
|
+
# Preview changes (recommended)
|
|
116
|
+
npx akis migrate --dry-run
|
|
48
117
|
|
|
49
|
-
#
|
|
118
|
+
# Create collections
|
|
50
119
|
npx akis migrate
|
|
51
|
-
|
|
52
|
-
|
|
120
|
+
```
|
|
121
|
+
|
|
122
|
+
**Result**:
|
|
123
|
+
- Collections created in Appwrite
|
|
124
|
+
- `schema.ts` file automatically generated
|
|
125
|
+
|
|
126
|
+
### Step 4: Check status
|
|
127
|
+
|
|
128
|
+
```bash
|
|
129
|
+
npx akis status
|
|
130
|
+
```
|
|
131
|
+
|
|
132
|
+
---
|
|
133
|
+
|
|
134
|
+
## Commands
|
|
135
|
+
|
|
136
|
+
### `akis init`
|
|
137
|
+
|
|
138
|
+
Initializes the project structure.
|
|
139
|
+
|
|
140
|
+
```bash
|
|
141
|
+
npx akis init # Create files
|
|
142
|
+
npx akis init --force # Overwrite existing files
|
|
143
|
+
```
|
|
144
|
+
|
|
145
|
+
**Options:**
|
|
146
|
+
| Option | Description |
|
|
147
|
+
|--------|-------------|
|
|
148
|
+
| `-f, --force` | Overwrites existing files |
|
|
149
|
+
|
|
150
|
+
---
|
|
151
|
+
|
|
152
|
+
### `akis migrate`
|
|
153
|
+
|
|
154
|
+
Creates missing collections in Appwrite and generates `schema.ts`.
|
|
155
|
+
|
|
156
|
+
```bash
|
|
157
|
+
npx akis migrate # Migrate all collections
|
|
158
|
+
npx akis migrate --name clients # Migrate a specific collection
|
|
159
|
+
npx akis migrate --dry-run # Preview without executing
|
|
160
|
+
```
|
|
161
|
+
|
|
162
|
+
**Options:**
|
|
163
|
+
| Option | Description |
|
|
164
|
+
|--------|-------------|
|
|
165
|
+
| `-n, --name <name>` | Name of the collection to migrate |
|
|
166
|
+
| `-d, --dry-run` | Shows actions without executing them |
|
|
167
|
+
|
|
168
|
+
**Example output:**
|
|
169
|
+
```
|
|
170
|
+
🚀 AKIS Migrate - Creating missing collections
|
|
171
|
+
|
|
172
|
+
📖 Reading types.ts...
|
|
173
|
+
2 collection(s) to process
|
|
174
|
+
|
|
175
|
+
📡 Connecting to Appwrite...
|
|
176
|
+
|
|
177
|
+
📦 Creating clients...
|
|
178
|
+
✓ name
|
|
179
|
+
✓ email
|
|
180
|
+
✓ phone
|
|
181
|
+
✓ status
|
|
182
|
+
✓ storeId
|
|
183
|
+
🔑 idx_storeId
|
|
184
|
+
🔑 idx_email
|
|
185
|
+
✅ clients created
|
|
186
|
+
|
|
187
|
+
📝 schema.ts generated with 2 collections
|
|
188
|
+
|
|
189
|
+
✨ Migration complete: 1 created, 1 skipped
|
|
190
|
+
```
|
|
191
|
+
|
|
192
|
+
---
|
|
193
|
+
|
|
194
|
+
### `akis update`
|
|
195
|
+
|
|
196
|
+
Adds new attributes to existing collections.
|
|
197
|
+
|
|
198
|
+
```bash
|
|
199
|
+
npx akis update # Update all collections
|
|
200
|
+
npx akis update --name clients # Update a specific collection
|
|
201
|
+
npx akis update --dry-run # Preview without executing
|
|
202
|
+
```
|
|
203
|
+
|
|
204
|
+
**Options:**
|
|
205
|
+
| Option | Description |
|
|
206
|
+
|--------|-------------|
|
|
207
|
+
| `-n, --name <name>` | Name of the collection to update |
|
|
208
|
+
| `-d, --dry-run` | Shows actions without executing them |
|
|
209
|
+
|
|
210
|
+
**Use cases:**
|
|
211
|
+
- You added a new field in `types.ts`
|
|
212
|
+
- You want to sync without recreating the collection
|
|
213
|
+
|
|
214
|
+
---
|
|
215
|
+
|
|
216
|
+
### `akis status`
|
|
217
|
+
|
|
218
|
+
Compares local types with Appwrite collections.
|
|
219
|
+
|
|
220
|
+
```bash
|
|
221
|
+
npx akis status # View all collections
|
|
222
|
+
npx akis status --name clients # View a specific collection
|
|
223
|
+
```
|
|
224
|
+
|
|
225
|
+
**Options:**
|
|
226
|
+
| Option | Description |
|
|
227
|
+
|--------|-------------|
|
|
228
|
+
| `-n, --name <name>` | Name of the collection to check |
|
|
229
|
+
|
|
230
|
+
**Example output:**
|
|
231
|
+
```
|
|
232
|
+
📊 AKIS Status - Collection Status
|
|
53
233
|
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
234
|
+
┌─────────────────────────────┬────────┬────────────┬─────────────┐
|
|
235
|
+
│ Collection │ Status │ Attributes │ Missing │
|
|
236
|
+
├─────────────────────────────┼────────┼────────────┼─────────────┤
|
|
237
|
+
│ clients │ ✅ │ 9/9 │ 0 │
|
|
238
|
+
│ products │ ⚠️ │ 5/7 │ 2 │
|
|
239
|
+
│ orders │ ❌ │ - │ - │
|
|
240
|
+
└─────────────────────────────┴────────┴────────────┴─────────────┘
|
|
57
241
|
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
242
|
+
📈 Summary:
|
|
243
|
+
✅ 1 synchronized
|
|
244
|
+
⚠️ 1 needs update (akis update)
|
|
245
|
+
❌ 1 missing (akis migrate)
|
|
61
246
|
```
|
|
62
247
|
|
|
63
|
-
|
|
248
|
+
---
|
|
64
249
|
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
250
|
+
### `akis delete`
|
|
251
|
+
|
|
252
|
+
Deletes collections in Appwrite.
|
|
253
|
+
|
|
254
|
+
```bash
|
|
255
|
+
npx akis delete --name clients # Delete a collection (with confirmation)
|
|
256
|
+
npx akis delete --force # Delete ALL collections without confirmation
|
|
257
|
+
npx akis delete --name clients -f # Delete without confirmation
|
|
258
|
+
```
|
|
69
259
|
|
|
70
|
-
|
|
260
|
+
**Options:**
|
|
261
|
+
| Option | Description |
|
|
262
|
+
|--------|-------------|
|
|
263
|
+
| `-n, --name <name>` | Name of the collection to delete |
|
|
264
|
+
| `-f, --force` | Delete without asking for confirmation |
|
|
265
|
+
|
|
266
|
+
⚠️ **Warning**: This action is irreversible!
|
|
267
|
+
|
|
268
|
+
---
|
|
269
|
+
|
|
270
|
+
## Supported TypeScript Types
|
|
271
|
+
|
|
272
|
+
AKIS automatically recognizes the following types:
|
|
273
|
+
|
|
274
|
+
| TypeScript | Appwrite Attribute |
|
|
275
|
+
|------------|-------------------|
|
|
276
|
+
| `string` | String (auto-detected size) |
|
|
277
|
+
| `number` | Float or Integer (based on field name) |
|
|
278
|
+
| `boolean` | Boolean |
|
|
279
|
+
| `string[]` | String Array |
|
|
280
|
+
| `number[]` | Integer Array |
|
|
281
|
+
| `"a" \| "b" \| "c"` | Enum |
|
|
282
|
+
|
|
283
|
+
### Naming Conventions
|
|
284
|
+
|
|
285
|
+
AKIS automatically infers certain properties:
|
|
286
|
+
|
|
287
|
+
| Field Name | Inferred Type | Size |
|
|
288
|
+
|------------|---------------|------|
|
|
289
|
+
| `*Id`, `storeId` | string | 36 |
|
|
290
|
+
| `email` | string | 255 |
|
|
291
|
+
| `phone`, `tel` | string | 50 |
|
|
292
|
+
| `note`, `description` | string | 2000 |
|
|
293
|
+
| `address` | string | 500 |
|
|
294
|
+
| `quantity*`, `*Minutes` | integer | - |
|
|
295
|
+
| `createdAt`, `deletedAt` | integer | - |
|
|
296
|
+
|
|
297
|
+
### System Fields (ignored)
|
|
298
|
+
|
|
299
|
+
These fields are automatically ignored as they are managed by Appwrite:
|
|
300
|
+
- `_id` - Document ID
|
|
301
|
+
- `_creationTime` - Creation timestamp
|
|
302
|
+
|
|
303
|
+
---
|
|
304
|
+
|
|
305
|
+
## Recommended Workflow
|
|
306
|
+
|
|
307
|
+
```
|
|
308
|
+
┌─────────────────────────────────────────────────────────────┐
|
|
309
|
+
│ 1. Define types in types.ts │
|
|
310
|
+
│ export type Client = { ... } │
|
|
311
|
+
└─────────────────────────────────────────────────────────────┘
|
|
312
|
+
↓
|
|
313
|
+
┌─────────────────────────────────────────────────────────────┐
|
|
314
|
+
│ 2. Preview changes │
|
|
315
|
+
│ npx akis migrate --dry-run │
|
|
316
|
+
└─────────────────────────────────────────────────────────────┘
|
|
317
|
+
↓
|
|
318
|
+
┌─────────────────────────────────────────────────────────────┐
|
|
319
|
+
│ 3. Migrate to Appwrite │
|
|
320
|
+
│ npx akis migrate │
|
|
321
|
+
│ → Collections created + schema.ts generated │
|
|
322
|
+
└─────────────────────────────────────────────────────────────┘
|
|
323
|
+
↓
|
|
324
|
+
┌─────────────────────────────────────────────────────────────┐
|
|
325
|
+
│ 4. Verify synchronization │
|
|
326
|
+
│ npx akis status │
|
|
327
|
+
└─────────────────────────────────────────────────────────────┘
|
|
328
|
+
↓
|
|
329
|
+
┌─────────────────────────────────────────────────────────────┐
|
|
330
|
+
│ 5. Adding new fields? → Back to step 1 │
|
|
331
|
+
│ npx akis update │
|
|
332
|
+
└─────────────────────────────────────────────────────────────┘
|
|
333
|
+
```
|
|
71
334
|
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
335
|
+
---
|
|
336
|
+
|
|
337
|
+
## Using with pnpm
|
|
338
|
+
|
|
339
|
+
If you use pnpm, add a script to your `package.json`:
|
|
340
|
+
|
|
341
|
+
```json
|
|
342
|
+
{
|
|
343
|
+
"scripts": {
|
|
344
|
+
"akis": "akis"
|
|
345
|
+
}
|
|
346
|
+
}
|
|
347
|
+
```
|
|
348
|
+
|
|
349
|
+
Then use:
|
|
350
|
+
```bash
|
|
351
|
+
pnpm akis status
|
|
352
|
+
pnpm akis migrate
|
|
353
|
+
pnpm akis update
|
|
354
|
+
```
|
|
355
|
+
|
|
356
|
+
---
|
|
357
|
+
|
|
358
|
+
## Examples
|
|
359
|
+
|
|
360
|
+
### Complete types.ts Example
|
|
361
|
+
|
|
362
|
+
```typescript
|
|
363
|
+
/* ═══════════════════════════════════════════════════════════
|
|
364
|
+
Types for my application
|
|
365
|
+
═══════════════════════════════════════════════════════════ */
|
|
366
|
+
|
|
367
|
+
export type Client = {
|
|
368
|
+
_id: string;
|
|
369
|
+
_creationTime: number;
|
|
370
|
+
name: string;
|
|
371
|
+
email?: string;
|
|
372
|
+
phone?: string;
|
|
373
|
+
address?: string;
|
|
374
|
+
status: "active" | "inactive" | "prospect";
|
|
375
|
+
discount?: number;
|
|
376
|
+
tags?: string[];
|
|
377
|
+
storeId: string;
|
|
378
|
+
createdAt: number;
|
|
379
|
+
deletedAt?: number;
|
|
380
|
+
};
|
|
381
|
+
|
|
382
|
+
export type Product = {
|
|
383
|
+
_id: string;
|
|
384
|
+
_creationTime: number;
|
|
385
|
+
name: string;
|
|
386
|
+
description?: string;
|
|
387
|
+
price: number;
|
|
388
|
+
costPrice?: number;
|
|
389
|
+
quantity: number;
|
|
390
|
+
minStock?: number;
|
|
391
|
+
category: "electronics" | "clothing" | "food" | "other";
|
|
392
|
+
image?: string;
|
|
393
|
+
storeId: string;
|
|
394
|
+
createdAt: number;
|
|
395
|
+
};
|
|
396
|
+
|
|
397
|
+
export type Sale = {
|
|
398
|
+
_id: string;
|
|
399
|
+
_creationTime: number;
|
|
400
|
+
number: string;
|
|
401
|
+
clientId?: string;
|
|
402
|
+
lines: string; // Stringified JSON
|
|
403
|
+
total: number;
|
|
404
|
+
status: "draft" | "validated" | "paid" | "cancelled";
|
|
405
|
+
storeId: string;
|
|
406
|
+
createdAt: number;
|
|
407
|
+
};
|
|
408
|
+
|
|
409
|
+
// Utilities
|
|
410
|
+
export type NewDoc<T> = Omit<T, "_id" | "_creationTime">;
|
|
411
|
+
export type UpdateDoc<T> = Partial<Omit<T, "_id" | "_creationTime">>;
|
|
412
|
+
```
|
|
413
|
+
|
|
414
|
+
---
|
|
415
|
+
|
|
416
|
+
## Troubleshooting
|
|
417
|
+
|
|
418
|
+
### Error: APPWRITE_API_KEY not configured
|
|
419
|
+
|
|
420
|
+
Check that your `.env` file exists and contains the API key:
|
|
421
|
+
```bash
|
|
422
|
+
cat .env | grep APPWRITE_API_KEY
|
|
423
|
+
```
|
|
424
|
+
|
|
425
|
+
### Error: Collection not found in types.ts
|
|
426
|
+
|
|
427
|
+
Make sure the type name corresponds to a name recognized by AKIS:
|
|
428
|
+
- `Client` → `clients`
|
|
429
|
+
- `Product` → `products`
|
|
430
|
+
- `Sale` → `sales`
|
|
431
|
+
|
|
432
|
+
### Attributes are not created
|
|
433
|
+
|
|
434
|
+
Appwrite has size limits for attributes. Check:
|
|
435
|
+
- String size (max 16000 characters)
|
|
436
|
+
- Number of attributes per collection (max ~100)
|
|
437
|
+
|
|
438
|
+
---
|
|
78
439
|
|
|
79
440
|
## License
|
|
80
441
|
|
|
81
442
|
MIT
|
|
443
|
+
|
|
444
|
+
---
|
|
445
|
+
|
|
446
|
+
## Links
|
|
447
|
+
|
|
448
|
+
- [Appwrite Documentation](https://appwrite.io/docs)
|
|
449
|
+
- [npm Package](https://www.npmjs.com/package/@akis05/akis)
|
|
450
|
+
- [GitHub Issues](https://github.com/akis05/akis/issues)
|
package/dist/cli/akis.js
CHANGED
|
@@ -14,15 +14,15 @@ program
|
|
|
14
14
|
╔═══════════════════════════════════════════════════════════════════╗
|
|
15
15
|
║ AKIS - Appwrite CLI Tool ║
|
|
16
16
|
╠═══════════════════════════════════════════════════════════════════╣
|
|
17
|
-
║
|
|
17
|
+
║ Manage your Appwrite collections from TypeScript types ║
|
|
18
18
|
║ ║
|
|
19
19
|
║ Workflow: ║
|
|
20
|
-
║ 1.
|
|
21
|
-
║ 2.
|
|
22
|
-
║ 3.
|
|
23
|
-
║ 4.
|
|
20
|
+
║ 1. npx akis init → Initialize project ║
|
|
21
|
+
║ 2. Define types in core/appwrite-model/types.ts ║
|
|
22
|
+
║ 3. npx akis migrate → Create collections ║
|
|
23
|
+
║ 4. npx akis status → Check synchronization ║
|
|
24
24
|
║ ║
|
|
25
|
-
║
|
|
25
|
+
║ Required environment variables (.env): ║
|
|
26
26
|
║ APPWRITE_ENDPOINT, APPWRITE_PROJECT_ID, ║
|
|
27
27
|
║ APPWRITE_DATABASE_ID, APPWRITE_API_KEY ║
|
|
28
28
|
╚═══════════════════════════════════════════════════════════════════╝
|
|
@@ -30,42 +30,42 @@ program
|
|
|
30
30
|
.version("0.1.0");
|
|
31
31
|
program
|
|
32
32
|
.command("init")
|
|
33
|
-
.description("
|
|
34
|
-
.option("-f, --force", "
|
|
33
|
+
.description("Initialize project with core/appwrite-model/ structure")
|
|
34
|
+
.option("-f, --force", "Overwrite existing files")
|
|
35
35
|
.action(init_1.init);
|
|
36
36
|
program
|
|
37
37
|
.command("migrate")
|
|
38
|
-
.description("
|
|
39
|
-
.option("-d, --dry-run", "
|
|
40
|
-
.option("-n, --name <name>", "
|
|
38
|
+
.description("Create missing collections in Appwrite from types.ts")
|
|
39
|
+
.option("-d, --dry-run", "Show actions without executing")
|
|
40
|
+
.option("-n, --name <name>", "Name of the collection to create (e.g., clients)")
|
|
41
41
|
.action(migrate_1.migrate);
|
|
42
42
|
program
|
|
43
43
|
.command("update")
|
|
44
|
-
.description("
|
|
45
|
-
.option("-d, --dry-run", "
|
|
46
|
-
.option("-n, --name <name>", "
|
|
44
|
+
.description("Add new attributes to existing collections")
|
|
45
|
+
.option("-d, --dry-run", "Show actions without executing")
|
|
46
|
+
.option("-n, --name <name>", "Name of the collection to update")
|
|
47
47
|
.action(update_1.update);
|
|
48
48
|
program
|
|
49
49
|
.command("delete")
|
|
50
|
-
.description("
|
|
51
|
-
.option("-f, --force", "
|
|
52
|
-
.option("-n, --name <name>", "
|
|
50
|
+
.description("Delete collections in Appwrite")
|
|
51
|
+
.option("-f, --force", "Delete without confirmation")
|
|
52
|
+
.option("-n, --name <name>", "Name of the collection to delete (otherwise all)")
|
|
53
53
|
.action(delete_1.deleteAll);
|
|
54
54
|
program
|
|
55
55
|
.command("status")
|
|
56
|
-
.description("
|
|
57
|
-
.option("-n, --name <name>", "
|
|
56
|
+
.description("Compare local types with Appwrite collections")
|
|
57
|
+
.option("-n, --name <name>", "Name of the collection to check")
|
|
58
58
|
.action(status_1.status);
|
|
59
59
|
program.addHelpText("after", `
|
|
60
|
-
|
|
61
|
-
$
|
|
62
|
-
$
|
|
63
|
-
$
|
|
64
|
-
$
|
|
65
|
-
$
|
|
66
|
-
$
|
|
67
|
-
$
|
|
68
|
-
$
|
|
60
|
+
Examples:
|
|
61
|
+
$ npx akis init # Create project structure
|
|
62
|
+
$ npx akis migrate # Create all missing collections
|
|
63
|
+
$ npx akis migrate --name clients # Create only "clients"
|
|
64
|
+
$ npx akis migrate --dry-run # Preview what would be created
|
|
65
|
+
$ npx akis update --name clients # Add new fields to "clients"
|
|
66
|
+
$ npx akis status # View sync status
|
|
67
|
+
$ npx akis delete --name clients # Delete "clients"
|
|
68
|
+
$ npx akis delete --force # Delete all collections
|
|
69
69
|
`);
|
|
70
70
|
program.parse();
|
|
71
71
|
//# sourceMappingURL=akis.js.map
|
package/dist/cli/akis.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"akis.js","sourceRoot":"","sources":["../../src/cli/akis.ts"],"names":[],"mappings":";;;AACA,yCAAoC;AACpC,0CAAuC;AACvC,gDAA6C;AAC7C,8CAA2C;AAC3C,8CAA8C;AAC9C,8CAA2C;AAE3C,MAAM,OAAO,GAAG,IAAI,mBAAO,EAAE,CAAC;AAE9B,OAAO;KACJ,IAAI,CAAC,MAAM,CAAC;KACZ,WAAW,CAAC;;;;;;;;;;;;;;;;CAgBd,CAAC;KACC,OAAO,CAAC,OAAO,CAAC,CAAC;AAEpB,OAAO;KACJ,OAAO,CAAC,MAAM,CAAC;KACf,WAAW,CAAC,
|
|
1
|
+
{"version":3,"file":"akis.js","sourceRoot":"","sources":["../../src/cli/akis.ts"],"names":[],"mappings":";;;AACA,yCAAoC;AACpC,0CAAuC;AACvC,gDAA6C;AAC7C,8CAA2C;AAC3C,8CAA8C;AAC9C,8CAA2C;AAE3C,MAAM,OAAO,GAAG,IAAI,mBAAO,EAAE,CAAC;AAE9B,OAAO;KACJ,IAAI,CAAC,MAAM,CAAC;KACZ,WAAW,CAAC;;;;;;;;;;;;;;;;CAgBd,CAAC;KACC,OAAO,CAAC,OAAO,CAAC,CAAC;AAEpB,OAAO;KACJ,OAAO,CAAC,MAAM,CAAC;KACf,WAAW,CAAC,wDAAwD,CAAC;KACrE,MAAM,CAAC,aAAa,EAAE,0BAA0B,CAAC;KACjD,MAAM,CAAC,WAAI,CAAC,CAAC;AAEhB,OAAO;KACJ,OAAO,CAAC,SAAS,CAAC;KAClB,WAAW,CAAC,sDAAsD,CAAC;KACnE,MAAM,CAAC,eAAe,EAAE,gCAAgC,CAAC;KACzD,MAAM,CAAC,mBAAmB,EAAE,kDAAkD,CAAC;KAC/E,MAAM,CAAC,iBAAO,CAAC,CAAC;AAEnB,OAAO;KACJ,OAAO,CAAC,QAAQ,CAAC;KACjB,WAAW,CAAC,4CAA4C,CAAC;KACzD,MAAM,CAAC,eAAe,EAAE,gCAAgC,CAAC;KACzD,MAAM,CAAC,mBAAmB,EAAE,kCAAkC,CAAC;KAC/D,MAAM,CAAC,eAAM,CAAC,CAAC;AAElB,OAAO;KACJ,OAAO,CAAC,QAAQ,CAAC;KACjB,WAAW,CAAC,gCAAgC,CAAC;KAC7C,MAAM,CAAC,aAAa,EAAE,6BAA6B,CAAC;KACpD,MAAM,CAAC,mBAAmB,EAAE,kDAAkD,CAAC;KAC/E,MAAM,CAAC,kBAAS,CAAC,CAAC;AAErB,OAAO;KACJ,OAAO,CAAC,QAAQ,CAAC;KACjB,WAAW,CAAC,+CAA+C,CAAC;KAC5D,MAAM,CAAC,mBAAmB,EAAE,iCAAiC,CAAC;KAC9D,MAAM,CAAC,eAAM,CAAC,CAAC;AAElB,OAAO,CAAC,WAAW,CAAC,OAAO,EAAE;;;;;;;;;;CAU5B,CAAC,CAAC;AAEH,OAAO,CAAC,KAAK,EAAE,CAAC"}
|
|
@@ -62,13 +62,13 @@ async function confirm(message) {
|
|
|
62
62
|
}
|
|
63
63
|
async function deleteAll(options) {
|
|
64
64
|
const targetName = options.name;
|
|
65
|
-
console.log(`\n🗑️ AKIS Delete - ${targetName ? `
|
|
65
|
+
console.log(`\n🗑️ AKIS Delete - ${targetName ? `Deleting "${targetName}"` : "Deleting collections"}\n`);
|
|
66
66
|
if (!APPWRITE_API_KEY) {
|
|
67
|
-
console.error("❌ APPWRITE_API_KEY
|
|
67
|
+
console.error("❌ APPWRITE_API_KEY not configured in .env");
|
|
68
68
|
process.exit(1);
|
|
69
69
|
}
|
|
70
70
|
if (!APPWRITE_DATABASE_ID) {
|
|
71
|
-
console.error("❌ APPWRITE_DATABASE_ID
|
|
71
|
+
console.error("❌ APPWRITE_DATABASE_ID not configured in .env");
|
|
72
72
|
process.exit(1);
|
|
73
73
|
}
|
|
74
74
|
// Connect to Appwrite
|
|
@@ -78,7 +78,7 @@ async function deleteAll(options) {
|
|
|
78
78
|
.setKey(APPWRITE_API_KEY);
|
|
79
79
|
const databases = new node_appwrite_1.Databases(client);
|
|
80
80
|
// Get existing collections
|
|
81
|
-
console.log("📡
|
|
81
|
+
console.log("📡 Connecting to Appwrite...");
|
|
82
82
|
let collections = [];
|
|
83
83
|
try {
|
|
84
84
|
const response = await databases.listCollections({
|
|
@@ -88,44 +88,44 @@ async function deleteAll(options) {
|
|
|
88
88
|
if (targetName) {
|
|
89
89
|
collections = response.collections.filter((c) => c.name === targetName);
|
|
90
90
|
if (collections.length === 0) {
|
|
91
|
-
console.error(`❌ Collection "${targetName}"
|
|
92
|
-
console.log(`
|
|
91
|
+
console.error(`❌ Collection "${targetName}" not found in Appwrite`);
|
|
92
|
+
console.log(` Available collections: ${response.collections.map((c) => c.name).join(", ")}`);
|
|
93
93
|
process.exit(1);
|
|
94
94
|
}
|
|
95
95
|
}
|
|
96
96
|
else {
|
|
97
97
|
collections = response.collections;
|
|
98
98
|
}
|
|
99
|
-
console.log(` ${collections.length} collection(s)
|
|
99
|
+
console.log(` ${collections.length} collection(s) to delete\n`);
|
|
100
100
|
}
|
|
101
101
|
catch (error) {
|
|
102
|
-
console.error("❌
|
|
102
|
+
console.error("❌ Connection error:", error);
|
|
103
103
|
process.exit(1);
|
|
104
104
|
}
|
|
105
105
|
if (collections.length === 0) {
|
|
106
|
-
console.log("✨
|
|
106
|
+
console.log("✨ No collections to delete\n");
|
|
107
107
|
return;
|
|
108
108
|
}
|
|
109
109
|
// Confirm deletion
|
|
110
110
|
if (!options.force) {
|
|
111
|
-
console.log("Collection(s)
|
|
111
|
+
console.log("Collection(s) to delete:");
|
|
112
112
|
for (const col of collections) {
|
|
113
113
|
console.log(` - ${col.name}`);
|
|
114
114
|
}
|
|
115
115
|
console.log("");
|
|
116
116
|
const confirmMsg = targetName
|
|
117
|
-
? `⚠️
|
|
118
|
-
: "⚠️
|
|
117
|
+
? `⚠️ Are you sure you want to delete "${targetName}"? (y/N) `
|
|
118
|
+
: "⚠️ Are you sure you want to delete ALL these collections? (y/N) ";
|
|
119
119
|
const confirmed = await confirm(confirmMsg);
|
|
120
120
|
if (!confirmed) {
|
|
121
|
-
console.log("\n❌
|
|
121
|
+
console.log("\n❌ Deletion cancelled\n");
|
|
122
122
|
return;
|
|
123
123
|
}
|
|
124
124
|
}
|
|
125
125
|
// Delete collections
|
|
126
126
|
let deleted = 0;
|
|
127
127
|
let errors = 0;
|
|
128
|
-
console.log("\n🗑️
|
|
128
|
+
console.log("\n🗑️ Deleting...\n");
|
|
129
129
|
for (const col of collections) {
|
|
130
130
|
try {
|
|
131
131
|
await databases.deleteCollection({
|
|
@@ -142,6 +142,6 @@ async function deleteAll(options) {
|
|
|
142
142
|
errors++;
|
|
143
143
|
}
|
|
144
144
|
}
|
|
145
|
-
console.log(`\n✨
|
|
145
|
+
console.log(`\n✨ Deletion complete: ${deleted} deleted, ${errors} error(s)\n`);
|
|
146
146
|
}
|
|
147
147
|
//# sourceMappingURL=delete.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"delete.js","sourceRoot":"","sources":["../../../src/cli/commands/delete.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAqCA,8BA+FC;AApID,iDAAyD;AACzD,2CAA6B;AAC7B,+CAAiC;AACjC,mDAAqC;AAErC,WAAW;AACX,MAAM,CAAC,MAAM,CAAC,EAAE,IAAI,EAAE,IAAI,CAAC,OAAO,CAAC,OAAO,CAAC,GAAG,EAAE,EAAE,MAAM,CAAC,EAAE,CAAC,CAAC;AAC7D,MAAM,CAAC,MAAM,CAAC,EAAE,IAAI,EAAE,IAAI,CAAC,OAAO,CAAC,OAAO,CAAC,GAAG,EAAE,EAAE,YAAY,CAAC,EAAE,CAAC,CAAC;AAEnE,MAAM,iBAAiB,GAAG,OAAO,CAAC,GAAG,CAAC,iBAAiB,IAAI,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AO,CAAC,UAAU,CAAC,CAAC;QAC5C,IAAI,CAAC,SAAS,EAAE,CAAC;YACf,OAAO,CAAC,GAAG,CAAC,0BAA0B,CAAC,CAAC;YACxC,OAAO;QACT,CAAC;IACH,CAAC;IAED,qBAAqB;IACrB,IAAI,OAAO,GAAG,CAAC,CAAC;IAChB,IAAI,MAAM,GAAG,CAAC,CAAC;IAEf,OAAO,CAAC,GAAG,CAAC,sBAAsB,CAAC,CAAC;IAEpC,KAAK,MAAM,GAAG,IAAI,WAAW,EAAE,CAAC;QAC9B,IAAI,CAAC;YACH,MAAM,SAAS,CAAC,gBAAgB,CAAC;gBAC/B,UAAU,EAAE,oBAAoB;gBAChC,YAAY,EAAE,GAAG,CAAC,GAAG;aACtB,CAAC,CAAC;YACH,OAAO,CAAC,GAAG,CAAC,QAAQ,GAAG,CAAC,IAAI,EAAE,CAAC,CAAC;YAChC,OAAO,EAAE,CAAC;YACV,MAAM,KAAK,CAAC,GAAG,CAAC,CAAC;QACnB,CAAC;QAAC,OAAO,KAAc,EAAE,CAAC;YACxB,MAAM,GAAG,GAAG,KAA6B,CAAC;YAC1C,OAAO,CAAC,GAAG,CAAC,QAAQ,GAAG,CAAC,IAAI,KAAK,GAAG,CAAC,OAAO,IAAI,KAAK,EAAE,CAAC,CAAC;YACzD,MAAM,EAAE,CAAC;QACX,CAAC;IACH,CAAC;IAED,OAAO,CAAC,GAAG,CAAC,0BAA0B,OAAO,aAAa,MAAM,aAAa,CAAC,CAAC;AACjF,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"init.d.ts","sourceRoot":"","sources":["../../../src/cli/commands/init.ts"],"names":[],"mappings":"AAIA,UAAU,WAAW;IACnB,KAAK,CAAC,EAAE,OAAO,CAAC;CACjB;AA4TD,wBAAsB,IAAI,CAAC,OAAO,EAAE,WAAW,
|
|
1
|
+
{"version":3,"file":"init.d.ts","sourceRoot":"","sources":["../../../src/cli/commands/init.ts"],"names":[],"mappings":"AAIA,UAAU,WAAW;IACnB,KAAK,CAAC,EAAE,OAAO,CAAC;CACjB;AA4TD,wBAAsB,IAAI,CAAC,OAAO,EAAE,WAAW,iBA0F9C"}
|
|
@@ -344,7 +344,7 @@ APPWRITE_DATABASE_ID=
|
|
|
344
344
|
APPWRITE_API_KEY=
|
|
345
345
|
`;
|
|
346
346
|
async function init(options) {
|
|
347
|
-
console.log("\n🚀 AKIS Init -
|
|
347
|
+
console.log("\n🚀 AKIS Init - Project initialization\n");
|
|
348
348
|
const cwd = process.cwd();
|
|
349
349
|
const libPath = path.join(cwd, "core", "appwrite-model");
|
|
350
350
|
const typesPath = path.join(libPath, "types.ts");
|
|
@@ -362,21 +362,21 @@ async function init(options) {
|
|
|
362
362
|
if (fs.existsSync(setupPath))
|
|
363
363
|
existingFiles.push("core/appwrite-model/setup-collections.ts");
|
|
364
364
|
if (existingFiles.length > 0 && !options.force) {
|
|
365
|
-
console.log("⚠️
|
|
365
|
+
console.log("⚠️ The following files already exist:");
|
|
366
366
|
for (const file of existingFiles) {
|
|
367
367
|
console.log(` - ${file}`);
|
|
368
368
|
}
|
|
369
|
-
console.log("\n
|
|
369
|
+
console.log("\n Use --force to overwrite\n");
|
|
370
370
|
return;
|
|
371
371
|
}
|
|
372
372
|
// Create directories
|
|
373
|
-
console.log("📁
|
|
373
|
+
console.log("📁 Creating directories...");
|
|
374
374
|
if (!fs.existsSync(libPath)) {
|
|
375
375
|
fs.mkdirSync(libPath, { recursive: true });
|
|
376
376
|
console.log(" ✓ core/appwrite-model/");
|
|
377
377
|
}
|
|
378
378
|
else {
|
|
379
|
-
console.log(" ⏭️ core/appwrite-model/ (
|
|
379
|
+
console.log(" ⏭️ core/appwrite-model/ (already exists)");
|
|
380
380
|
}
|
|
381
381
|
// Create types.ts
|
|
382
382
|
if (!fs.existsSync(typesPath) || options.force) {
|
|
@@ -384,7 +384,7 @@ async function init(options) {
|
|
|
384
384
|
console.log(" ✓ core/appwrite-model/types.ts");
|
|
385
385
|
}
|
|
386
386
|
else {
|
|
387
|
-
console.log(" ⏭️ core/appwrite-model/types.ts (
|
|
387
|
+
console.log(" ⏭️ core/appwrite-model/types.ts (already exists)");
|
|
388
388
|
}
|
|
389
389
|
// Create client.ts
|
|
390
390
|
if (!fs.existsSync(clientPath) || options.force) {
|
|
@@ -392,7 +392,7 @@ async function init(options) {
|
|
|
392
392
|
console.log(" ✓ core/appwrite-model/client.ts");
|
|
393
393
|
}
|
|
394
394
|
else {
|
|
395
|
-
console.log(" ⏭️ core/appwrite-model/client.ts (
|
|
395
|
+
console.log(" ⏭️ core/appwrite-model/client.ts (already exists)");
|
|
396
396
|
}
|
|
397
397
|
// Create schema.ts
|
|
398
398
|
if (!fs.existsSync(schemaPath) || options.force) {
|
|
@@ -400,7 +400,7 @@ async function init(options) {
|
|
|
400
400
|
console.log(" ✓ core/appwrite-model/schema.ts");
|
|
401
401
|
}
|
|
402
402
|
else {
|
|
403
|
-
console.log(" ⏭️ core/appwrite-model/schema.ts (
|
|
403
|
+
console.log(" ⏭️ core/appwrite-model/schema.ts (already exists)");
|
|
404
404
|
}
|
|
405
405
|
// Create setup-collections.ts
|
|
406
406
|
if (!fs.existsSync(setupPath) || options.force) {
|
|
@@ -408,32 +408,31 @@ async function init(options) {
|
|
|
408
408
|
console.log(" ✓ core/appwrite-model/setup-collections.ts");
|
|
409
409
|
}
|
|
410
410
|
else {
|
|
411
|
-
console.log(" ⏭️ core/appwrite-model/setup-collections.ts (
|
|
411
|
+
console.log(" ⏭️ core/appwrite-model/setup-collections.ts (already exists)");
|
|
412
412
|
}
|
|
413
413
|
console.log(`
|
|
414
|
-
✨
|
|
414
|
+
✨ Initialization complete!
|
|
415
415
|
|
|
416
|
-
📁 Structure
|
|
416
|
+
📁 Structure created:
|
|
417
417
|
core/
|
|
418
418
|
└── appwrite-model/
|
|
419
|
-
├── types.ts #
|
|
420
|
-
├── schema.ts #
|
|
421
|
-
├── client.ts #
|
|
422
|
-
└── setup-collections.ts #
|
|
423
|
-
|
|
424
|
-
📖
|
|
425
|
-
1.
|
|
426
|
-
2.
|
|
427
|
-
3.
|
|
428
|
-
4.
|
|
429
|
-
|
|
430
|
-
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
pnpm akis delete # Supprimer les collections
|
|
419
|
+
├── types.ts # TypeScript definitions
|
|
420
|
+
├── schema.ts # Appwrite collection schema
|
|
421
|
+
├── client.ts # Appwrite client
|
|
422
|
+
└── setup-collections.ts # Setup functions
|
|
423
|
+
|
|
424
|
+
📖 Next steps:
|
|
425
|
+
1. Configure your environment variables (.env)
|
|
426
|
+
2. Define your types in core/appwrite-model/types.ts
|
|
427
|
+
3. Run: npx akis migrate
|
|
428
|
+
4. Verify with: npx akis status
|
|
429
|
+
|
|
430
|
+
📚 Available commands:
|
|
431
|
+
npx akis status # View collection status
|
|
432
|
+
npx akis migrate # Create missing collections
|
|
433
|
+
npx akis migrate --name X # Create a specific collection
|
|
434
|
+
npx akis update # Update collections
|
|
435
|
+
npx akis delete # Delete collections
|
|
437
436
|
`);
|
|
438
437
|
}
|
|
439
438
|
//# sourceMappingURL=init.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"init.js","sourceRoot":"","sources":["../../../src/cli/commands/init.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAkUA,
|
|
1
|
+
{"version":3,"file":"init.js","sourceRoot":"","sources":["../../../src/cli/commands/init.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAkUA,oBA0FC;AA5ZD,uCAAyB;AACzB,2CAA6B;AAC7B,mDAAqC;AAMrC,KAAK,UAAU,MAAM,CAAC,QAAgB,EAAE,YAAqB;IAC3D,MAAM,EAAE,GAAG,QAAQ,CAAC,eAAe,CAAC;QAClC,KAAK,EAAE,OAAO,CAAC,KAAK;QACpB,MAAM,EAAE,OAAO,CAAC,MAAM;KACvB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AS,EAAE,0BAA0B,CAAC,CAAC;QACxD,OAAO,CAAC,GAAG,CAAC,+CAA+C,CAAC,CAAC;IAC/D,CAAC;SAAM,CAAC;QACN,OAAO,CAAC,GAAG,CAAC,kEAAkE,CAAC,CAAC;IAClF,CAAC;IAED,OAAO,CAAC,GAAG,CAAC;;;;;;;;;;;;;;;;;;;;;;;CAuBb,CAAC,CAAC;AACH,CAAC"}
|
|
@@ -98,42 +98,42 @@ async function createAttribute(databases, databaseId, collectionId, field) {
|
|
|
98
98
|
}
|
|
99
99
|
async function migrate(options) {
|
|
100
100
|
const targetName = options.name;
|
|
101
|
-
console.log(`\n🚀 AKIS Migrate - ${targetName ? `
|
|
101
|
+
console.log(`\n🚀 AKIS Migrate - ${targetName ? `Creating "${targetName}"` : "Creating missing collections"}\n`);
|
|
102
102
|
if (!APPWRITE_API_KEY) {
|
|
103
|
-
console.error("❌ APPWRITE_API_KEY
|
|
103
|
+
console.error("❌ APPWRITE_API_KEY not configured in .env");
|
|
104
104
|
process.exit(1);
|
|
105
105
|
}
|
|
106
106
|
if (!APPWRITE_DATABASE_ID) {
|
|
107
|
-
console.error("❌ APPWRITE_DATABASE_ID
|
|
107
|
+
console.error("❌ APPWRITE_DATABASE_ID not configured in .env");
|
|
108
108
|
process.exit(1);
|
|
109
109
|
}
|
|
110
110
|
// Parse types.ts
|
|
111
111
|
const typesPath = path.resolve(process.cwd(), "core/appwrite-model/types.ts");
|
|
112
|
-
console.log(`📖
|
|
112
|
+
console.log(`📖 Reading ${typesPath}...`);
|
|
113
113
|
let collections;
|
|
114
114
|
try {
|
|
115
115
|
const allCollections = (0, parser_1.parseTypesFile)(typesPath);
|
|
116
116
|
if (targetName) {
|
|
117
117
|
collections = allCollections.filter((c) => c.name === targetName);
|
|
118
118
|
if (collections.length === 0) {
|
|
119
|
-
console.error(`❌ Collection "${targetName}"
|
|
120
|
-
console.log(`
|
|
119
|
+
console.error(`❌ Collection "${targetName}" not found in types.ts`);
|
|
120
|
+
console.log(` Available collections: ${allCollections.map((c) => c.name).join(", ")}`);
|
|
121
121
|
process.exit(1);
|
|
122
122
|
}
|
|
123
123
|
}
|
|
124
124
|
else {
|
|
125
125
|
collections = allCollections;
|
|
126
126
|
}
|
|
127
|
-
console.log(` ${collections.length} collection(s)
|
|
127
|
+
console.log(` ${collections.length} collection(s) to process\n`);
|
|
128
128
|
}
|
|
129
129
|
catch (error) {
|
|
130
|
-
console.error("❌
|
|
130
|
+
console.error("❌ Error reading types.ts:", error);
|
|
131
131
|
process.exit(1);
|
|
132
132
|
}
|
|
133
133
|
if (options.dryRun) {
|
|
134
|
-
console.log("🔍
|
|
134
|
+
console.log("🔍 Dry-run mode - No changes will be made\n");
|
|
135
135
|
for (const col of collections) {
|
|
136
|
-
console.log(` 📦 ${col.name} (${col.fields.length}
|
|
136
|
+
console.log(` 📦 ${col.name} (${col.fields.length} fields)`);
|
|
137
137
|
for (const field of col.fields) {
|
|
138
138
|
const req = field.required ? "required" : "optional";
|
|
139
139
|
const extra = field.enumValues ? ` [${field.enumValues.join(", ")}]` : field.size ? ` (${field.size})` : "";
|
|
@@ -149,7 +149,7 @@ async function migrate(options) {
|
|
|
149
149
|
.setKey(APPWRITE_API_KEY);
|
|
150
150
|
const databases = new node_appwrite_1.Databases(client);
|
|
151
151
|
// Get existing collections
|
|
152
|
-
console.log("📡
|
|
152
|
+
console.log("📡 Connecting to Appwrite...");
|
|
153
153
|
let existingCollections = [];
|
|
154
154
|
try {
|
|
155
155
|
const response = await databases.listCollections({
|
|
@@ -157,10 +157,10 @@ async function migrate(options) {
|
|
|
157
157
|
queries: [node_appwrite_1.Query.limit(100)],
|
|
158
158
|
});
|
|
159
159
|
existingCollections = response.collections.map((c) => c.name);
|
|
160
|
-
console.log(` ${existingCollections.length} collections
|
|
160
|
+
console.log(` ${existingCollections.length} existing collections\n`);
|
|
161
161
|
}
|
|
162
162
|
catch (error) {
|
|
163
|
-
console.error("❌
|
|
163
|
+
console.error("❌ Connection error:", error);
|
|
164
164
|
process.exit(1);
|
|
165
165
|
}
|
|
166
166
|
// Create missing collections
|
|
@@ -168,11 +168,11 @@ async function migrate(options) {
|
|
|
168
168
|
let skipped = 0;
|
|
169
169
|
for (const col of collections) {
|
|
170
170
|
if (existingCollections.includes(col.name)) {
|
|
171
|
-
console.log(`⏭️ ${col.name} -
|
|
171
|
+
console.log(`⏭️ ${col.name} - already exists`);
|
|
172
172
|
skipped++;
|
|
173
173
|
continue;
|
|
174
174
|
}
|
|
175
|
-
console.log(`\n📦
|
|
175
|
+
console.log(`\n📦 Creating ${col.name}...`);
|
|
176
176
|
try {
|
|
177
177
|
const collectionId = node_appwrite_1.ID.unique();
|
|
178
178
|
await databases.createCollection({
|
|
@@ -220,18 +220,18 @@ async function migrate(options) {
|
|
|
220
220
|
await delay(2000);
|
|
221
221
|
}
|
|
222
222
|
else {
|
|
223
|
-
console.log(` ⚠️ Index ${index.key}
|
|
223
|
+
console.log(` ⚠️ Index ${index.key} skipped`);
|
|
224
224
|
break;
|
|
225
225
|
}
|
|
226
226
|
}
|
|
227
227
|
}
|
|
228
228
|
}
|
|
229
229
|
created++;
|
|
230
|
-
console.log(` ✅ ${col.name}
|
|
230
|
+
console.log(` ✅ ${col.name} created`);
|
|
231
231
|
}
|
|
232
232
|
catch (error) {
|
|
233
233
|
const err = error;
|
|
234
|
-
console.error(` ❌
|
|
234
|
+
console.error(` ❌ Error: ${err.message || error}`);
|
|
235
235
|
}
|
|
236
236
|
await delay(500);
|
|
237
237
|
}
|
|
@@ -240,7 +240,7 @@ async function migrate(options) {
|
|
|
240
240
|
const allCollections = (0, parser_1.parseTypesFile)(typesPath);
|
|
241
241
|
const schemaContent = (0, parser_1.generateSchemaFile)(allCollections);
|
|
242
242
|
fs.writeFileSync(schemaPath, schemaContent);
|
|
243
|
-
console.log(`📝 schema.ts
|
|
244
|
-
console.log(`\n✨ Migration
|
|
243
|
+
console.log(`📝 schema.ts generated with ${allCollections.length} collections`);
|
|
244
|
+
console.log(`\n✨ Migration complete: ${created} created, ${skipped} skipped\n`);
|
|
245
245
|
}
|
|
246
246
|
//# sourceMappingURL=migrate.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"migrate.js","sourceRoot":"","sources":["../../../src/cli/commands/migrate.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA8EA,0BAgKC;AA9OD,iDAAiF;AACjF,uCAAyB;AACzB,2CAA6B;AAC7B,+CAAiC;AACjC,sCAA+G;AAE/G,WAAW;AACX,MAAM,CAAC,MAAM,CAAC,EAAE,IAAI,EAAE,IAAI,CAAC,OAAO,CAAC,OAAO,CAAC,GAAG,EAAE,EAAE,MAAM,CAAC,EAAE,CAAC,CAAC;AAC7D,MAAM,CAAC,MAAM,CAAC,EAAE,IAAI,EAAE,IAAI,CAAC,OAAO,CAAC,OAAO,CAAC,GAAG,EAAE,EAAE,YAAY,CAAC,EAAE,CAAC,CAAC;AAEnE,MAAM,iBAAiB,GAAG,OAAO,CAAC,GAAG,CAAC,iBAAiB,IAAI,8BAA8B,CAAC;AAC1F,MAAM,mBAAmB,GAAG,OAAO,CAAC,GAAG,CAAC,mBAAmB,IAAI,EAAE,CAAC;AAClE,MAAM,gBAAgB,GAAG,OAAO,CAAC,GAAG,CAAC,gBAAgB,IAAI,EAAE,CAAC;AAC5D,MAAM,oBAAoB,GAAG,OAAO,CAAC,GAAG,CAAC,oBAAoB,IAAI,EAAE,CAAC;AAOpE,KAAK,UAAU,KAAK,CAAC,EAAU;IAC7B,OAAO,IAAI,OAAO,CAAC,CAAC,OAAO,EAAE,EAAE,CAAC,UAAU,CAAC,OAAO,EAAE,EAAE,CAAC,CAAC,CAAC;AAC3D,CAAC;AAED,KAAK,UAAU,eAAe,CAC5B,SAAoB,EACpB,UAAkB,EAClB,YAAoB,EACpB,KAAkB;IAElB,MAAM,UAAU,GAAG;QACjB,UAAU;QACV,YAAY;QACZ,GAAG,EAAE,KAAK,CAAC,GAAG;QAC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C,EAAE,CAAC;4BAC1D,OAAO,EAAE,CAAC;4BACV,MAAM,KAAK,CAAC,IAAI,CAAC,CAAC;wBACpB,CAAC;6BAAM,CAAC;4BACN,OAAO,CAAC,GAAG,CAAC,gBAAgB,KAAK,CAAC,GAAG,UAAU,CAAC,CAAC;4BACjD,MAAM;wBACR,CAAC;oBACH,CAAC;gBACH,CAAC;YACH,CAAC;YAED,OAAO,EAAE,CAAC;YACV,OAAO,CAAC,GAAG,CAAC,QAAQ,GAAG,CAAC,IAAI,UAAU,CAAC,CAAC;QAC1C,CAAC;QAAC,OAAO,KAAc,EAAE,CAAC;YACxB,MAAM,GAAG,GAAG,KAA6B,CAAC;YAC1C,OAAO,CAAC,KAAK,CAAC,eAAe,GAAG,CAAC,OAAO,IAAI,KAAK,EAAE,CAAC,CAAC;QACvD,CAAC;QAED,MAAM,KAAK,CAAC,GAAG,CAAC,CAAC;IACnB,CAAC;IAED,qBAAqB;IACrB,MAAM,UAAU,GAAG,IAAI,CAAC,OAAO,CAAC,OAAO,CAAC,GAAG,EAAE,EAAE,+BAA+B,CAAC,CAAC;IAChF,MAAM,cAAc,GAAG,IAAA,uBAAc,EAAC,SAAS,CAAC,CAAC;IACjD,MAAM,aAAa,GAAG,IAAA,2BAAkB,EAAC,cAAc,CAAC,CAAC;IACzD,EAAE,CAAC,aAAa,CAAC,UAAU,EAAE,aAAa,CAAC,CAAC;IAC5C,OAAO,CAAC,GAAG,CAAC,+BAA+B,cAAc,CAAC,MAAM,cAAc,CAAC,CAAC;IAEhF,OAAO,CAAC,GAAG,CAAC,2BAA2B,OAAO,aAAa,OAAO,YAAY,CAAC,CAAC;AAClF,CAAC"}
|
|
@@ -47,36 +47,36 @@ const APPWRITE_API_KEY = process.env.APPWRITE_API_KEY || "";
|
|
|
47
47
|
const APPWRITE_DATABASE_ID = process.env.APPWRITE_DATABASE_ID || "";
|
|
48
48
|
async function status(options = {}) {
|
|
49
49
|
const targetName = options.name;
|
|
50
|
-
console.log(`\n📊 AKIS Status - ${targetName ?
|
|
50
|
+
console.log(`\n📊 AKIS Status - ${targetName ? `Status of "${targetName}"` : "Collection Status"}\n`);
|
|
51
51
|
if (!APPWRITE_API_KEY) {
|
|
52
|
-
console.error("❌ APPWRITE_API_KEY
|
|
52
|
+
console.error("❌ APPWRITE_API_KEY not configured in .env");
|
|
53
53
|
process.exit(1);
|
|
54
54
|
}
|
|
55
55
|
if (!APPWRITE_DATABASE_ID) {
|
|
56
|
-
console.error("❌ APPWRITE_DATABASE_ID
|
|
56
|
+
console.error("❌ APPWRITE_DATABASE_ID not configured in .env");
|
|
57
57
|
process.exit(1);
|
|
58
58
|
}
|
|
59
59
|
// Parse types.ts
|
|
60
60
|
const typesPath = path.resolve(process.cwd(), "core/appwrite-model/types.ts");
|
|
61
|
-
console.log(`📖
|
|
61
|
+
console.log(`📖 Reading ${typesPath}...`);
|
|
62
62
|
let expectedCollections;
|
|
63
63
|
try {
|
|
64
64
|
const allCollections = (0, parser_1.parseTypesFile)(typesPath);
|
|
65
65
|
if (targetName) {
|
|
66
66
|
expectedCollections = allCollections.filter((c) => c.name === targetName);
|
|
67
67
|
if (expectedCollections.length === 0) {
|
|
68
|
-
console.error(`❌ Collection "${targetName}"
|
|
69
|
-
console.log(`
|
|
68
|
+
console.error(`❌ Collection "${targetName}" not found in types.ts`);
|
|
69
|
+
console.log(` Available collections: ${allCollections.map((c) => c.name).join(", ")}`);
|
|
70
70
|
process.exit(1);
|
|
71
71
|
}
|
|
72
72
|
}
|
|
73
73
|
else {
|
|
74
74
|
expectedCollections = allCollections;
|
|
75
75
|
}
|
|
76
|
-
console.log(` ${expectedCollections.length} collection(s)
|
|
76
|
+
console.log(` ${expectedCollections.length} collection(s) to check\n`);
|
|
77
77
|
}
|
|
78
78
|
catch (error) {
|
|
79
|
-
console.error("❌
|
|
79
|
+
console.error("❌ Error reading types.ts:", error);
|
|
80
80
|
process.exit(1);
|
|
81
81
|
}
|
|
82
82
|
// Connect to Appwrite
|
|
@@ -86,7 +86,7 @@ async function status(options = {}) {
|
|
|
86
86
|
.setKey(APPWRITE_API_KEY);
|
|
87
87
|
const databases = new node_appwrite_1.Databases(client);
|
|
88
88
|
// Get existing collections
|
|
89
|
-
console.log("📡
|
|
89
|
+
console.log("📡 Connecting to Appwrite...");
|
|
90
90
|
let existingCollectionsMap = new Map();
|
|
91
91
|
try {
|
|
92
92
|
const response = await databases.listCollections({
|
|
@@ -108,15 +108,15 @@ async function status(options = {}) {
|
|
|
108
108
|
indexes: indexes.indexes.length,
|
|
109
109
|
});
|
|
110
110
|
}
|
|
111
|
-
console.log(` ${existingCollectionsMap.size} collections
|
|
111
|
+
console.log(` ${existingCollectionsMap.size} collections in Appwrite\n`);
|
|
112
112
|
}
|
|
113
113
|
catch (error) {
|
|
114
|
-
console.error("❌
|
|
114
|
+
console.error("❌ Connection error:", error);
|
|
115
115
|
process.exit(1);
|
|
116
116
|
}
|
|
117
117
|
// Compare
|
|
118
118
|
console.log("┌─────────────────────────────┬────────┬────────────┬─────────────┐");
|
|
119
|
-
console.log("│ Collection │ Status │
|
|
119
|
+
console.log("│ Collection │ Status │ Attributes │ Missing │");
|
|
120
120
|
console.log("├─────────────────────────────┼────────┼────────────┼─────────────┤");
|
|
121
121
|
let synced = 0;
|
|
122
122
|
let needsUpdate = 0;
|
|
@@ -143,9 +143,9 @@ async function status(options = {}) {
|
|
|
143
143
|
}
|
|
144
144
|
}
|
|
145
145
|
console.log("└─────────────────────────────┴────────┴────────────┴─────────────┘");
|
|
146
|
-
console.log(`\n📈
|
|
147
|
-
console.log(` ✅ ${synced}
|
|
148
|
-
console.log(` ⚠️ ${needsUpdate}
|
|
149
|
-
console.log(` ❌ ${missing}
|
|
146
|
+
console.log(`\n📈 Summary:`);
|
|
147
|
+
console.log(` ✅ ${synced} synchronized`);
|
|
148
|
+
console.log(` ⚠️ ${needsUpdate} needs update (akis update)`);
|
|
149
|
+
console.log(` ❌ ${missing} missing (akis migrate)\n`);
|
|
150
150
|
}
|
|
151
151
|
//# sourceMappingURL=status.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"status.js","sourceRoot":"","sources":["../../../src/cli/commands/status.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAkBA,wBAmHC;AArID,iDAAyD;AACzD,2CAA6B;AAC7B,+CAAiC;AACjC,sCAA6D;AAE7D,WAAW;AACX,MAAM,CAAC,MAAM,CAAC,EAAE,IAAI,EAAE,IAAI,CAAC,OAAO,CAAC,OAAO,CAAC,GAAG,EAAE,EAAE,MAAM,CAAC,EAAE,CAAC,CAAC;AAC7D,MAAM,CAAC,MAAM,CAAC,EAAE,IAAI,EAAE,IAAI,CAAC,OAAO,CAAC,OAAO,CAAC,GAAG,EAAE,EAAE,YAAY,CAAC,EAAE,CAAC,CAAC;AAEnE,MAAM,iBAAiB,GAAG,OAAO,CAAC,GAAG,CAAC,iBAAiB,IAAI,8BAA8B,CAAC;AAC1F,MAAM,mBAAmB,GAAG,OAAO,CAAC,GAAG,CAAC,mBAAmB,IAAI,EAAE,CAAC;AAClE,MAAM,gBAAgB,GAAG,OAAO,CAAC,GAAG,CAAC,gBAAgB,IAAI,EAAE,CAAC;AAC5D,MAAM,oBAAoB,GAAG,OAAO,CAAC,GAAG,CAAC,oBAAoB,IAAI,EAAE,CAAC;AAM7D,KAAK,UAAU,MAAM,CAAC,UAAyB,EAAE;IACtD,MAAM,UAAU,GAAG,OAAO,CAAC,IAAI,CAAC;IAChC,OAAO,CAAC,GAAG,CAAC,sBAAsB,UAAU,CAAC,CAAC,CAAC,
|
|
1
|
+
{"version":3,"file":"status.js","sourceRoot":"","sources":["../../../src/cli/commands/status.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAkBA,wBAmHC;AArID,iDAAyD;AACzD,2CAA6B;AAC7B,+CAAiC;AACjC,sCAA6D;AAE7D,WAAW;AACX,MAAM,CAAC,MAAM,CAAC,EAAE,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BAAM,CAAC;gBACN,OAAO,CAAC,GAAG,CAAC,KAAK,IAAI,gBAAgB,OAAO,MAAM,UAAU,IAAI,CAAC,CAAC;gBAClE,WAAW,EAAE,CAAC;YAChB,CAAC;QACH,CAAC;IACH,CAAC;IAED,OAAO,CAAC,GAAG,CAAC,qEAAqE,CAAC,CAAC;IAEnF,OAAO,CAAC,GAAG,CAAC,eAAe,CAAC,CAAC;IAC7B,OAAO,CAAC,GAAG,CAAC,QAAQ,MAAM,eAAe,CAAC,CAAC;IAC3C,OAAO,CAAC,GAAG,CAAC,UAAU,WAAW,6BAA6B,CAAC,CAAC;IAChE,OAAO,CAAC,GAAG,CAAC,QAAQ,OAAO,2BAA2B,CAAC,CAAC;AAC1D,CAAC"}
|
|
@@ -97,36 +97,36 @@ async function createAttribute(databases, databaseId, collectionId, field) {
|
|
|
97
97
|
}
|
|
98
98
|
async function update(options) {
|
|
99
99
|
const targetName = options.name;
|
|
100
|
-
console.log(`\n🔄 AKIS Update - ${targetName ? `
|
|
100
|
+
console.log(`\n🔄 AKIS Update - ${targetName ? `Updating "${targetName}"` : "Updating existing collections"}\n`);
|
|
101
101
|
if (!APPWRITE_API_KEY) {
|
|
102
|
-
console.error("❌ APPWRITE_API_KEY
|
|
102
|
+
console.error("❌ APPWRITE_API_KEY not configured in .env");
|
|
103
103
|
process.exit(1);
|
|
104
104
|
}
|
|
105
105
|
if (!APPWRITE_DATABASE_ID) {
|
|
106
|
-
console.error("❌ APPWRITE_DATABASE_ID
|
|
106
|
+
console.error("❌ APPWRITE_DATABASE_ID not configured in .env");
|
|
107
107
|
process.exit(1);
|
|
108
108
|
}
|
|
109
109
|
// Parse types.ts
|
|
110
110
|
const typesPath = path.resolve(process.cwd(), "core/appwrite-model/types.ts");
|
|
111
|
-
console.log(`📖
|
|
111
|
+
console.log(`📖 Reading ${typesPath}...`);
|
|
112
112
|
let collections;
|
|
113
113
|
try {
|
|
114
114
|
const allCollections = (0, parser_1.parseTypesFile)(typesPath);
|
|
115
115
|
if (targetName) {
|
|
116
116
|
collections = allCollections.filter((c) => c.name === targetName);
|
|
117
117
|
if (collections.length === 0) {
|
|
118
|
-
console.error(`❌ Collection "${targetName}"
|
|
119
|
-
console.log(`
|
|
118
|
+
console.error(`❌ Collection "${targetName}" not found in types.ts`);
|
|
119
|
+
console.log(` Available collections: ${allCollections.map((c) => c.name).join(", ")}`);
|
|
120
120
|
process.exit(1);
|
|
121
121
|
}
|
|
122
122
|
}
|
|
123
123
|
else {
|
|
124
124
|
collections = allCollections;
|
|
125
125
|
}
|
|
126
|
-
console.log(` ${collections.length} collection(s)
|
|
126
|
+
console.log(` ${collections.length} collection(s) to process\n`);
|
|
127
127
|
}
|
|
128
128
|
catch (error) {
|
|
129
|
-
console.error("❌
|
|
129
|
+
console.error("❌ Error reading types.ts:", error);
|
|
130
130
|
process.exit(1);
|
|
131
131
|
}
|
|
132
132
|
// Connect to Appwrite
|
|
@@ -136,7 +136,7 @@ async function update(options) {
|
|
|
136
136
|
.setKey(APPWRITE_API_KEY);
|
|
137
137
|
const databases = new node_appwrite_1.Databases(client);
|
|
138
138
|
// Get existing collections with their attributes
|
|
139
|
-
console.log("📡
|
|
139
|
+
console.log("📡 Connecting to Appwrite...");
|
|
140
140
|
let existingCollectionsMap = new Map();
|
|
141
141
|
try {
|
|
142
142
|
const response = await databases.listCollections({
|
|
@@ -153,14 +153,14 @@ async function update(options) {
|
|
|
153
153
|
attributes: attrs.attributes.map((a) => a.key),
|
|
154
154
|
});
|
|
155
155
|
}
|
|
156
|
-
console.log(` ${existingCollectionsMap.size} collections
|
|
156
|
+
console.log(` ${existingCollectionsMap.size} existing collections\n`);
|
|
157
157
|
}
|
|
158
158
|
catch (error) {
|
|
159
|
-
console.error("❌
|
|
159
|
+
console.error("❌ Connection error:", error);
|
|
160
160
|
process.exit(1);
|
|
161
161
|
}
|
|
162
162
|
if (options.dryRun) {
|
|
163
|
-
console.log("🔍
|
|
163
|
+
console.log("🔍 Dry-run mode - No changes will be made\n");
|
|
164
164
|
}
|
|
165
165
|
// Update collections
|
|
166
166
|
let updated = 0;
|
|
@@ -168,15 +168,15 @@ async function update(options) {
|
|
|
168
168
|
for (const col of collections) {
|
|
169
169
|
const existing = existingCollectionsMap.get(col.name);
|
|
170
170
|
if (!existing) {
|
|
171
|
-
console.log(`⏭️ ${col.name} -
|
|
171
|
+
console.log(`⏭️ ${col.name} - does not exist (use 'akis migrate')`);
|
|
172
172
|
continue;
|
|
173
173
|
}
|
|
174
174
|
const missingFields = col.fields.filter((f) => !existing.attributes.includes(f.key));
|
|
175
175
|
if (missingFields.length === 0) {
|
|
176
|
-
console.log(`✓ ${col.name} -
|
|
176
|
+
console.log(`✓ ${col.name} - up to date`);
|
|
177
177
|
continue;
|
|
178
178
|
}
|
|
179
|
-
console.log(`\n📦
|
|
179
|
+
console.log(`\n📦 Updating ${col.name} (${missingFields.length} new fields)...`);
|
|
180
180
|
if (options.dryRun) {
|
|
181
181
|
for (const field of missingFields) {
|
|
182
182
|
console.log(` + ${field.key}: ${field.type}`);
|
|
@@ -198,6 +198,6 @@ async function update(options) {
|
|
|
198
198
|
updated++;
|
|
199
199
|
await delay(500);
|
|
200
200
|
}
|
|
201
|
-
console.log(`\n✨
|
|
201
|
+
console.log(`\n✨ Update complete: ${updated} collections, ${attributesAdded} attributes added\n`);
|
|
202
202
|
}
|
|
203
203
|
//# sourceMappingURL=update.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"update.js","sourceRoot":"","sources":["../../../src/cli/commands/update.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA6EA,wBA0HC;AAvMD,iDAA6E;AAC7E,2CAA6B;AAC7B,+CAAiC;AACjC,sCAA2F;AAE3F,WAAW;AACX,MAAM,CAAC,MAAM,CAAC,EAAE,IAAI,EAAE,IAAI,CAAC,OAAO,CAAC,OAAO,CAAC,GAAG,EAAE,EAAE,MAAM,CAAC,EAAE,CAAC,CAAC;A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