appwrite-utils-cli 1.6.9 → 1.7.1

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/dist/main.js CHANGED
@@ -15,9 +15,14 @@ import { MessageFormatter } from "./shared/messageFormatter.js";
15
15
  import { ConfirmationDialogs } from "./shared/confirmationDialogs.js";
16
16
  import path from "path";
17
17
  import fs from "fs";
18
+ import { createRequire } from "node:module";
18
19
  import { loadAppwriteProjectConfig, findAppwriteProjectConfig, projectConfigToAppwriteConfig } from "./utils/projectConfig.js";
19
20
  import { hasSessionAuth, getAvailableSessions, getAuthenticationStatus } from "./utils/sessionAuth.js";
20
21
  import { findYamlConfig, loadYamlConfigWithSession } from "./config/yamlConfig.js";
22
+ const require = createRequire(import.meta.url);
23
+ if (!globalThis.require) {
24
+ globalThis.require = require;
25
+ }
21
26
  /**
22
27
  * Checks if the migration from collections to tables should be allowed
23
28
  * Returns an object with:
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.6.9",
4
+ "version": "1.7.1",
5
5
  "main": "src/main.ts",
6
6
  "type": "module",
7
7
  "repository": {
package/src/main.ts CHANGED
@@ -1,25 +1,32 @@
1
- #!/usr/bin/env node
2
- import yargs from "yargs";
3
- import { type ArgumentsCamelCase } from "yargs";
4
- import { hideBin } from "yargs/helpers";
5
- import { InteractiveCLI } from "./interactiveCLI.js";
6
- import { UtilsController, type SetupOptions } from "./utilsController.js";
7
- import type { TransferOptions } from "./migrations/transfer.js";
8
- import { Databases, Storage, type Models } from "node-appwrite";
9
- import { getClient } from "./utils/getClientFromConfig.js";
10
- import { fetchAllDatabases } from "./databases/methods.js";
11
- import { setupDirsFiles } from "./utils/setupFiles.js";
12
- import { fetchAllCollections } from "./collections/methods.js";
13
- import type { Specification } from "appwrite-utils";
14
- import chalk from "chalk";
15
- import { listSpecifications } from "./functions/methods.js";
16
- import { MessageFormatter } from "./shared/messageFormatter.js";
17
- import { ConfirmationDialogs } from "./shared/confirmationDialogs.js";
18
- import path from "path";
19
- import fs from "fs";
20
- import { loadAppwriteProjectConfig, findAppwriteProjectConfig, projectConfigToAppwriteConfig } from "./utils/projectConfig.js";
21
- import { hasSessionAuth, getAvailableSessions, getAuthenticationStatus } from "./utils/sessionAuth.js";
22
- import { findYamlConfig, loadYamlConfigWithSession } from "./config/yamlConfig.js";
1
+ #!/usr/bin/env node
2
+ import yargs from "yargs";
3
+ import { type ArgumentsCamelCase } from "yargs";
4
+ import { hideBin } from "yargs/helpers";
5
+ import { InteractiveCLI } from "./interactiveCLI.js";
6
+ import { UtilsController, type SetupOptions } from "./utilsController.js";
7
+ import type { TransferOptions } from "./migrations/transfer.js";
8
+ import { Databases, Storage, type Models } from "node-appwrite";
9
+ import { getClient } from "./utils/getClientFromConfig.js";
10
+ import { fetchAllDatabases } from "./databases/methods.js";
11
+ import { setupDirsFiles } from "./utils/setupFiles.js";
12
+ import { fetchAllCollections } from "./collections/methods.js";
13
+ import type { Specification } from "appwrite-utils";
14
+ import chalk from "chalk";
15
+ import { listSpecifications } from "./functions/methods.js";
16
+ import { MessageFormatter } from "./shared/messageFormatter.js";
17
+ import { ConfirmationDialogs } from "./shared/confirmationDialogs.js";
18
+ import path from "path";
19
+ import fs from "fs";
20
+ import { createRequire } from "node:module";
21
+ import { loadAppwriteProjectConfig, findAppwriteProjectConfig, projectConfigToAppwriteConfig } from "./utils/projectConfig.js";
22
+ import { hasSessionAuth, getAvailableSessions, getAuthenticationStatus } from "./utils/sessionAuth.js";
23
+ import { findYamlConfig, loadYamlConfigWithSession } from "./config/yamlConfig.js";
24
+
25
+ const require = createRequire(import.meta.url);
26
+ if (!(globalThis as any).require) {
27
+ (globalThis as any).require = require;
28
+ }
29
+
23
30
 
24
31
  interface CliOptions {
25
32
  config?: string;
@@ -0,0 +1,7 @@
1
+ # yaml-language-server: $schema=../.yaml_schemas/collection.schema.json
2
+ # Collection Definition: TestCollection
3
+ name: TestCollection
4
+ id: test_collection
5
+ documentSecurity: false
6
+ enabled: true
7
+ importDefs: []