appwrite-utils-cli 1.2.23 → 1.2.25

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.
@@ -255,6 +255,11 @@ declare const YamlConfigSchema: z.ZodObject<{
255
255
  templateRootDirectory: z.ZodOptional<z.ZodString>;
256
256
  templateBranch: z.ZodOptional<z.ZodString>;
257
257
  specification: z.ZodOptional<z.ZodEnum<["s-0.5vcpu-512mb", "s-1vcpu-512mb", "s-1vcpu-1gb", "s-2vcpu-2gb", "s-2vcpu-4gb", "s-4vcpu-4gb", "s-4vcpu-8gb", "s-8vcpu-4gb", "s-8vcpu-8gb"]>>;
258
+ dirPath: z.ZodOptional<z.ZodString>;
259
+ predeployCommands: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
260
+ deployDir: z.ZodOptional<z.ZodString>;
261
+ ignore: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
262
+ templateVersion: z.ZodOptional<z.ZodString>;
258
263
  }, "strip", z.ZodTypeAny, {
259
264
  name: string;
260
265
  id: string;
@@ -278,6 +283,11 @@ declare const YamlConfigSchema: z.ZodObject<{
278
283
  templateRootDirectory?: string | undefined;
279
284
  templateBranch?: string | undefined;
280
285
  specification?: "s-0.5vcpu-512mb" | "s-1vcpu-512mb" | "s-1vcpu-1gb" | "s-2vcpu-2gb" | "s-2vcpu-4gb" | "s-4vcpu-4gb" | "s-4vcpu-8gb" | "s-8vcpu-4gb" | "s-8vcpu-8gb" | undefined;
286
+ dirPath?: string | undefined;
287
+ predeployCommands?: string[] | undefined;
288
+ deployDir?: string | undefined;
289
+ ignore?: string[] | undefined;
290
+ templateVersion?: string | undefined;
281
291
  }, {
282
292
  name: string;
283
293
  id: string;
@@ -301,6 +311,11 @@ declare const YamlConfigSchema: z.ZodObject<{
301
311
  templateRootDirectory?: string | undefined;
302
312
  templateBranch?: string | undefined;
303
313
  specification?: "s-0.5vcpu-512mb" | "s-1vcpu-512mb" | "s-1vcpu-1gb" | "s-2vcpu-2gb" | "s-2vcpu-4gb" | "s-4vcpu-4gb" | "s-4vcpu-8gb" | "s-8vcpu-4gb" | "s-8vcpu-8gb" | undefined;
314
+ dirPath?: string | undefined;
315
+ predeployCommands?: string[] | undefined;
316
+ deployDir?: string | undefined;
317
+ ignore?: string[] | undefined;
318
+ templateVersion?: string | undefined;
304
319
  }>, "many">>>;
305
320
  }, "strip", z.ZodTypeAny, {
306
321
  appwrite: {
@@ -396,6 +411,11 @@ declare const YamlConfigSchema: z.ZodObject<{
396
411
  templateRootDirectory?: string | undefined;
397
412
  templateBranch?: string | undefined;
398
413
  specification?: "s-0.5vcpu-512mb" | "s-1vcpu-512mb" | "s-1vcpu-1gb" | "s-2vcpu-2gb" | "s-2vcpu-4gb" | "s-4vcpu-4gb" | "s-4vcpu-8gb" | "s-8vcpu-4gb" | "s-8vcpu-8gb" | undefined;
414
+ dirPath?: string | undefined;
415
+ predeployCommands?: string[] | undefined;
416
+ deployDir?: string | undefined;
417
+ ignore?: string[] | undefined;
418
+ templateVersion?: string | undefined;
399
419
  }[];
400
420
  }, {
401
421
  appwrite: {
@@ -485,6 +505,11 @@ declare const YamlConfigSchema: z.ZodObject<{
485
505
  templateRootDirectory?: string | undefined;
486
506
  templateBranch?: string | undefined;
487
507
  specification?: "s-0.5vcpu-512mb" | "s-1vcpu-512mb" | "s-1vcpu-1gb" | "s-2vcpu-2gb" | "s-2vcpu-4gb" | "s-4vcpu-4gb" | "s-4vcpu-8gb" | "s-8vcpu-4gb" | "s-8vcpu-8gb" | undefined;
508
+ dirPath?: string | undefined;
509
+ predeployCommands?: string[] | undefined;
510
+ deployDir?: string | undefined;
511
+ ignore?: string[] | undefined;
512
+ templateVersion?: string | undefined;
488
513
  }[] | undefined;
489
514
  }>;
490
515
  export type YamlConfig = z.infer<typeof YamlConfigSchema>;
@@ -123,6 +123,12 @@ const YamlConfigSchema = z.object({
123
123
  templateRootDirectory: z.string().optional(),
124
124
  templateBranch: z.string().optional(),
125
125
  specification: FunctionSpecifications.optional(),
126
+ // Critical missing fields for function deployment
127
+ dirPath: z.string().optional(),
128
+ predeployCommands: z.array(z.string()).optional(),
129
+ deployDir: z.string().optional(),
130
+ ignore: z.array(z.string()).optional(),
131
+ templateVersion: z.string().optional(),
126
132
  }))
127
133
  .optional()
128
134
  .default([]),
@@ -205,6 +211,12 @@ export const convertYamlToAppwriteConfig = (yamlConfig) => {
205
211
  templateRootDirectory: func.templateRootDirectory || "",
206
212
  templateBranch: func.templateBranch || "",
207
213
  specification: func.specification || "s-0.5vcpu-512mb",
214
+ // Include critical missing fields for function deployment
215
+ dirPath: func.dirPath,
216
+ predeployCommands: func.predeployCommands,
217
+ deployDir: func.deployDir,
218
+ ignore: func.ignore,
219
+ templateVersion: func.templateVersion,
208
220
  })),
209
221
  collections: [], // Note: Collections are managed separately in YAML configs via individual collection files
210
222
  };
@@ -487,8 +499,13 @@ export const writeYamlConfig = async (configPath, config) => {
487
499
  templateRepository: func.templateRepository,
488
500
  templateOwner: func.templateOwner,
489
501
  templateRootDirectory: func.templateRootDirectory,
490
- // templateBranch: func.templateBranch, // Not available in AppwriteFunction type
491
502
  specification: func.specification,
503
+ // Include critical fields for function deployment
504
+ dirPath: func.dirPath,
505
+ predeployCommands: func.predeployCommands,
506
+ deployDir: func.deployDir,
507
+ ignore: func.ignore,
508
+ templateVersion: func.templateVersion,
492
509
  })) || [],
493
510
  };
494
511
  // Write YAML config
@@ -553,7 +570,13 @@ export const addFunctionToYamlConfig = async (configPath, newFunction) => {
553
570
  entrypoint: newFunction.entrypoint || "",
554
571
  commands: newFunction.commands || "",
555
572
  scopes: newFunction.scopes || [],
556
- specification: newFunction.specification || "s-0.5vcpu-512mb"
573
+ specification: newFunction.specification || "s-0.5vcpu-512mb",
574
+ // Include critical fields for function deployment if they exist
575
+ ...(newFunction.dirPath && { dirPath: newFunction.dirPath }),
576
+ ...(newFunction.predeployCommands && { predeployCommands: newFunction.predeployCommands }),
577
+ ...(newFunction.deployDir && { deployDir: newFunction.deployDir }),
578
+ ...(newFunction.ignore && { ignore: newFunction.ignore }),
579
+ ...(newFunction.templateVersion && { templateVersion: newFunction.templateVersion }),
557
580
  };
558
581
  // Add new function
559
582
  yamlData.functions.push(yamlFunction);
@@ -540,7 +540,7 @@ export class InteractiveCLI {
540
540
  await deployLocalFunction(this.controller.appwriteServer, functionConfig.name, {
541
541
  ...functionConfig,
542
542
  dirPath: functionPath,
543
- });
543
+ }, functionPath);
544
544
  MessageFormatter.success("Function deployed successfully!", { prefix: "Functions" });
545
545
  }
546
546
  catch (error) {
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "appwrite-utils-cli",
3
3
  "description": "Appwrite Utility Functions to help with database management, data conversion, data import, migrations, and much more. Meant to be used as a CLI tool, I do not recommend installing this in frontend environments.",
4
- "version": "1.2.23",
4
+ "version": "1.2.25",
5
5
  "main": "src/main.ts",
6
6
  "type": "module",
7
7
  "repository": {
@@ -129,6 +129,12 @@ const YamlConfigSchema = z.object({
129
129
  templateRootDirectory: z.string().optional(),
130
130
  templateBranch: z.string().optional(),
131
131
  specification: FunctionSpecifications.optional(),
132
+ // Critical missing fields for function deployment
133
+ dirPath: z.string().optional(),
134
+ predeployCommands: z.array(z.string()).optional(),
135
+ deployDir: z.string().optional(),
136
+ ignore: z.array(z.string()).optional(),
137
+ templateVersion: z.string().optional(),
132
138
  })
133
139
  )
134
140
  .optional()
@@ -215,6 +221,12 @@ export const convertYamlToAppwriteConfig = (yamlConfig: YamlConfig): AppwriteCon
215
221
  templateRootDirectory: func.templateRootDirectory || "",
216
222
  templateBranch: func.templateBranch || "",
217
223
  specification: func.specification || "s-0.5vcpu-512mb",
224
+ // Include critical missing fields for function deployment
225
+ dirPath: func.dirPath,
226
+ predeployCommands: func.predeployCommands,
227
+ deployDir: func.deployDir,
228
+ ignore: func.ignore,
229
+ templateVersion: func.templateVersion,
218
230
  })),
219
231
  collections: [], // Note: Collections are managed separately in YAML configs via individual collection files
220
232
  };
@@ -517,8 +529,13 @@ export const writeYamlConfig = async (configPath: string, config: AppwriteConfig
517
529
  templateRepository: func.templateRepository,
518
530
  templateOwner: func.templateOwner,
519
531
  templateRootDirectory: func.templateRootDirectory,
520
- // templateBranch: func.templateBranch, // Not available in AppwriteFunction type
521
532
  specification: func.specification,
533
+ // Include critical fields for function deployment
534
+ dirPath: func.dirPath,
535
+ predeployCommands: func.predeployCommands,
536
+ deployDir: func.deployDir,
537
+ ignore: func.ignore,
538
+ templateVersion: func.templateVersion,
522
539
  })) || [],
523
540
  };
524
541
 
@@ -588,7 +605,13 @@ export const addFunctionToYamlConfig = async (configPath: string, newFunction: A
588
605
  entrypoint: newFunction.entrypoint || "",
589
606
  commands: newFunction.commands || "",
590
607
  scopes: newFunction.scopes || [],
591
- specification: newFunction.specification || "s-0.5vcpu-512mb"
608
+ specification: newFunction.specification || "s-0.5vcpu-512mb",
609
+ // Include critical fields for function deployment if they exist
610
+ ...(newFunction.dirPath && { dirPath: newFunction.dirPath }),
611
+ ...(newFunction.predeployCommands && { predeployCommands: newFunction.predeployCommands }),
612
+ ...(newFunction.deployDir && { deployDir: newFunction.deployDir }),
613
+ ...(newFunction.ignore && { ignore: newFunction.ignore }),
614
+ ...(newFunction.templateVersion && { templateVersion: newFunction.templateVersion }),
592
615
  };
593
616
 
594
617
  // Add new function
@@ -728,7 +728,8 @@ export class InteractiveCLI {
728
728
  {
729
729
  ...functionConfig,
730
730
  dirPath: functionPath,
731
- }
731
+ },
732
+ functionPath
732
733
  );
733
734
  MessageFormatter.success("Function deployed successfully!", { prefix: "Functions" });
734
735
  } catch (error) {