appwrite-cli 13.3.1 → 13.4.0
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/CHANGELOG.md +13 -0
- package/README.md +2 -2
- package/dist/bundle-win-arm64.mjs +757 -1991
- package/dist/cli.cjs +757 -1991
- package/dist/index.d.ts +1 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +698 -1946
- package/dist/lib/commands/push.d.ts.map +1 -1
- package/dist/lib/constants.d.ts +1 -1
- package/dist/lib/json.d.ts.map +1 -1
- package/dist/lib/parser.d.ts +1 -1
- package/dist/lib/parser.d.ts.map +1 -1
- package/index.ts +17 -0
- package/install.ps1 +2 -2
- package/install.sh +1 -1
- package/lib/commands/push.ts +24 -2
- package/lib/commands/services/databases.ts +32 -8
- package/lib/commands/services/projects.ts +6 -4
- package/lib/commands/services/tables-db.ts +32 -8
- package/lib/constants.ts +1 -1
- package/lib/json.ts +10 -2
- package/lib/parser.ts +17 -7
- package/package.json +2 -3
- package/scoop/appwrite.config.json +3 -3
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"push.d.ts","sourceRoot":"","sources":["../../../lib/commands/push.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAcpC,OAAO,EAEL,KAAK,YAAY,EACjB,KAAK,UAAU,EACf,KAAK,cAAc,EACpB,MAAM,aAAa,CAAC;AA2CrB,OAAO,EAIL,MAAM,EAEP,MAAM,sBAAsB,CAAC;AAe9B,MAAM,WAAW,WAAW;IAC1B,GAAG,CAAC,EAAE,OAAO,CAAC;IACd,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,KAAK,CAAC,EAAE,OAAO,CAAC;IAChB,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,OAAO,CAAC,EAAE,OAAO,CAAC;IACl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AE,OAAO,CAAA;KAAO,GAC3C,OAAO,CAAC;QACT,kBAAkB,EAAE,MAAM,CAAC;QAC3B,MAAM,EAAE,KAAK,EAAE,CAAC;KACjB,CAAC;CAkLH;AA+2BD,eAAO,MAAM,IAAI,SAEqD,CAAC;AA6EvE,eAAO,MAAM,MAAM,SAQhB,CAAC"}
|
package/dist/lib/constants.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
export declare const SDK_TITLE = "Appwrite";
|
|
2
2
|
export declare const SDK_TITLE_LOWER = "appwrite";
|
|
3
|
-
export declare const SDK_VERSION = "13.
|
|
3
|
+
export declare const SDK_VERSION = "13.4.0";
|
|
4
4
|
export declare const SDK_NAME = "Command Line";
|
|
5
5
|
export declare const SDK_PLATFORM = "console";
|
|
6
6
|
export declare const SDK_LANGUAGE = "cli";
|
package/dist/lib/json.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"json.d.ts","sourceRoot":"","sources":["../../lib/json.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"json.d.ts","sourceRoot":"","sources":["../../lib/json.ts"],"names":[],"mappings":"AAgCA,eAAO,MAAM,OAAO;kBACJ,MAAM;;;;;CAErB,CAAC"}
|
package/dist/lib/parser.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type { CliConfig } from "./types.js";
|
|
2
2
|
declare const cliConfig: CliConfig;
|
|
3
3
|
export declare const parse: (data: Record<string, any>) => void;
|
|
4
|
-
export declare const drawTable: (data: Array<Record<string, any
|
|
4
|
+
export declare const drawTable: (data: Array<Record<string, any> | null | undefined>) => void;
|
|
5
5
|
export declare const drawJSON: (data: any) => void;
|
|
6
6
|
export declare const parseError: (err: Error) => void;
|
|
7
7
|
export declare const actionRunner: <T extends (...args: any[]) => Promise<any>>(fn: T) => ((...args: Parameters<T>) => Promise<void>);
|
package/dist/lib/parser.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"parser.d.ts","sourceRoot":"","sources":["../../lib/parser.ts"],"names":[],"mappings":"AASA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,YAAY,CAAC;AAQ5C,QAAA,MAAM,SAAS,EAAE,SAQhB,CAAC;AAEF,eAAO,MAAM,KAAK,GAAI,MAAM,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,KAAG,IA2BjD,CAAC;AAEF,eAAO,MAAM,SAAS,
|
|
1
|
+
{"version":3,"file":"parser.d.ts","sourceRoot":"","sources":["../../lib/parser.ts"],"names":[],"mappings":"AASA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,YAAY,CAAC;AAQ5C,QAAA,MAAM,SAAS,EAAE,SAQhB,CAAC;AAEF,eAAO,MAAM,KAAK,GAAI,MAAM,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,KAAG,IA2BjD,CAAC;AAEF,eAAO,MAAM,SAAS,GACpB,MAAM,KAAK,CAAC,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,GAAG,IAAI,GAAG,SAAS,CAAC,KAClD,IAiEF,CAAC;AAEF,eAAO,MAAM,QAAQ,GAAI,MAAM,GAAG,KAAG,IAEpC,CAAC;AAEF,eAAO,MAAM,UAAU,GAAI,KAAK,KAAK,KAAG,IA2DvC,CAAC;AAEF,eAAO,MAAM,YAAY,GAAI,CAAC,SAAS,CAAC,GAAG,IAAI,EAAE,GAAG,EAAE,KAAK,OAAO,CAAC,GAAG,CAAC,EACrE,IAAI,CAAC,KACJ,CAAC,CAAC,GAAG,IAAI,EAAE,UAAU,CAAC,CAAC,CAAC,KAAK,OAAO,CAAC,IAAI,CAAC,CAY5C,CAAC;AAEF,eAAO,MAAM,YAAY,GAAI,OAAO,MAAM,KAAG,MAM5C,CAAC;AAEF,eAAO,MAAM,SAAS,GAAI,OAAO,MAAM,KAAG,OAIzC,CAAC;AAEF,eAAO,MAAM,GAAG,GAAI,UAAU,MAAM,KAAG,IAEtC,CAAC;AAEF,eAAO,MAAM,IAAI,GAAI,UAAU,MAAM,KAAG,IAIvC,CAAC;AAEF,eAAO,MAAM,IAAI,GAAI,UAAU,MAAM,KAAG,IAEvC,CAAC;AAEF,eAAO,MAAM,OAAO,GAAI,UAAU,MAAM,KAAG,IAI1C,CAAC;AAEF,eAAO,MAAM,KAAK,GAAI,UAAU,MAAM,KAAG,IAExC,CAAC;AAEF,eAAO,MAAM,IAAI,wXAAW,CAAC;AAE7B,eAAO,MAAM,mBAAmB,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CA+BtD,CAAC;AAEF,OAAO,EAAE,SAAS,EAAE,CAAC"}
|
package/index.ts
CHANGED
|
@@ -26,3 +26,20 @@ export type {
|
|
|
26
26
|
ColumnType,
|
|
27
27
|
TableIndexType,
|
|
28
28
|
} from "./lib/commands/config.js";
|
|
29
|
+
export {
|
|
30
|
+
ConfigSchema,
|
|
31
|
+
SettingsSchema,
|
|
32
|
+
SiteSchema,
|
|
33
|
+
FunctionSchema,
|
|
34
|
+
DatabaseSchema,
|
|
35
|
+
CollectionSchema,
|
|
36
|
+
AttributeSchema,
|
|
37
|
+
IndexSchema,
|
|
38
|
+
TableSchema,
|
|
39
|
+
ColumnSchema,
|
|
40
|
+
IndexTableSchema,
|
|
41
|
+
TopicSchema,
|
|
42
|
+
TeamSchema,
|
|
43
|
+
MessageSchema,
|
|
44
|
+
BucketSchema,
|
|
45
|
+
} from "./lib/commands/config.js";
|
package/install.ps1
CHANGED
|
@@ -13,8 +13,8 @@
|
|
|
13
13
|
# You can use "View source" of this page to see the full script.
|
|
14
14
|
|
|
15
15
|
# REPO
|
|
16
|
-
$GITHUB_x64_URL = "https://github.com/appwrite/sdk-for-cli/releases/download/13.
|
|
17
|
-
$GITHUB_arm64_URL = "https://github.com/appwrite/sdk-for-cli/releases/download/13.
|
|
16
|
+
$GITHUB_x64_URL = "https://github.com/appwrite/sdk-for-cli/releases/download/13.4.0/appwrite-cli-win-x64.exe"
|
|
17
|
+
$GITHUB_arm64_URL = "https://github.com/appwrite/sdk-for-cli/releases/download/13.4.0/appwrite-cli-win-arm64.exe"
|
|
18
18
|
|
|
19
19
|
$APPWRITE_BINARY_NAME = "appwrite.exe"
|
|
20
20
|
|
package/install.sh
CHANGED
|
@@ -96,7 +96,7 @@ printSuccess() {
|
|
|
96
96
|
downloadBinary() {
|
|
97
97
|
echo "[2/4] Downloading executable for $OS ($ARCH) ..."
|
|
98
98
|
|
|
99
|
-
GITHUB_LATEST_VERSION="13.
|
|
99
|
+
GITHUB_LATEST_VERSION="13.4.0"
|
|
100
100
|
GITHUB_FILE="appwrite-cli-${OS}-${ARCH}"
|
|
101
101
|
GITHUB_URL="https://github.com/$GITHUB_REPOSITORY_NAME/releases/download/$GITHUB_LATEST_VERSION/$GITHUB_FILE"
|
|
102
102
|
|
package/lib/commands/push.ts
CHANGED
|
@@ -1933,7 +1933,18 @@ const pushSite = async ({
|
|
|
1933
1933
|
|
|
1934
1934
|
failedDeployments.forEach((failed) => {
|
|
1935
1935
|
const { name, deployment, $id } = failed;
|
|
1936
|
-
const
|
|
1936
|
+
const projectId = localConfig.getProject().projectId;
|
|
1937
|
+
const endpoint = localConfig.getEndpoint() || globalConfig.getEndpoint();
|
|
1938
|
+
let region = '';
|
|
1939
|
+
try {
|
|
1940
|
+
const hostname = new URL(endpoint).hostname;
|
|
1941
|
+
const firstSubdomain = hostname.split('.')[0];
|
|
1942
|
+
if (firstSubdomain.length === 3) {
|
|
1943
|
+
region = firstSubdomain;
|
|
1944
|
+
}
|
|
1945
|
+
} catch {}
|
|
1946
|
+
const projectSlug = region ? `project-${region}-${projectId}` : `project-${projectId}`;
|
|
1947
|
+
const failUrl = `${globalConfig.getEndpoint().slice(0, -3)}/console/${projectSlug}/sites/site-${$id}/deployments/deployment-${deployment}`;
|
|
1937
1948
|
|
|
1938
1949
|
error(
|
|
1939
1950
|
`Deployment of ${name} has failed. Check at ${failUrl} for more details\n`,
|
|
@@ -2061,7 +2072,18 @@ const pushFunction = async ({
|
|
|
2061
2072
|
|
|
2062
2073
|
failedDeployments.forEach((failed) => {
|
|
2063
2074
|
const { name, deployment, $id } = failed;
|
|
2064
|
-
const
|
|
2075
|
+
const projectId = localConfig.getProject().projectId;
|
|
2076
|
+
const endpoint = localConfig.getEndpoint() || globalConfig.getEndpoint();
|
|
2077
|
+
let region = '';
|
|
2078
|
+
try {
|
|
2079
|
+
const hostname = new URL(endpoint).hostname;
|
|
2080
|
+
const firstSubdomain = hostname.split('.')[0];
|
|
2081
|
+
if (firstSubdomain.length === 3) {
|
|
2082
|
+
region = firstSubdomain;
|
|
2083
|
+
}
|
|
2084
|
+
} catch {}
|
|
2085
|
+
const projectSlug = region ? `project-${region}-${projectId}` : `project-${projectId}`;
|
|
2086
|
+
const failUrl = `${globalConfig.getEndpoint().slice(0, -3)}/console/${projectSlug}/functions/function-${$id}/deployment-${deployment}`;
|
|
2065
2087
|
|
|
2066
2088
|
error(
|
|
2067
2089
|
`Deployment of ${name} has failed. Check at ${failUrl} for more details\n`,
|
|
@@ -640,10 +640,16 @@ databases
|
|
|
640
640
|
(value: string | undefined) =>
|
|
641
641
|
value === undefined ? true : parseBool(value),
|
|
642
642
|
)
|
|
643
|
+
.option(
|
|
644
|
+
`--encrypt [value]`,
|
|
645
|
+
`Toggle encryption for the attribute. Encryption enhances security by not storing any plain text values in the database. However, encrypted attributes cannot be queried.`,
|
|
646
|
+
(value: string | undefined) =>
|
|
647
|
+
value === undefined ? true : parseBool(value),
|
|
648
|
+
)
|
|
643
649
|
.action(
|
|
644
650
|
actionRunner(
|
|
645
|
-
async ({ databaseId, collectionId, key, required, xdefault, array }) =>
|
|
646
|
-
parse(await (await getDatabasesClient()).createLongtextAttribute(databaseId, collectionId, key, required, xdefault, array)),
|
|
651
|
+
async ({ databaseId, collectionId, key, required, xdefault, array, encrypt }) =>
|
|
652
|
+
parse(await (await getDatabasesClient()).createLongtextAttribute(databaseId, collectionId, key, required, xdefault, array, encrypt)),
|
|
647
653
|
),
|
|
648
654
|
);
|
|
649
655
|
|
|
@@ -679,10 +685,16 @@ databases
|
|
|
679
685
|
(value: string | undefined) =>
|
|
680
686
|
value === undefined ? true : parseBool(value),
|
|
681
687
|
)
|
|
688
|
+
.option(
|
|
689
|
+
`--encrypt [value]`,
|
|
690
|
+
`Toggle encryption for the attribute. Encryption enhances security by not storing any plain text values in the database. However, encrypted attributes cannot be queried.`,
|
|
691
|
+
(value: string | undefined) =>
|
|
692
|
+
value === undefined ? true : parseBool(value),
|
|
693
|
+
)
|
|
682
694
|
.action(
|
|
683
695
|
actionRunner(
|
|
684
|
-
async ({ databaseId, collectionId, key, required, xdefault, array }) =>
|
|
685
|
-
parse(await (await getDatabasesClient()).createMediumtextAttribute(databaseId, collectionId, key, required, xdefault, array)),
|
|
696
|
+
async ({ databaseId, collectionId, key, required, xdefault, array, encrypt }) =>
|
|
697
|
+
parse(await (await getDatabasesClient()).createMediumtextAttribute(databaseId, collectionId, key, required, xdefault, array, encrypt)),
|
|
686
698
|
),
|
|
687
699
|
);
|
|
688
700
|
|
|
@@ -851,10 +863,16 @@ databases
|
|
|
851
863
|
(value: string | undefined) =>
|
|
852
864
|
value === undefined ? true : parseBool(value),
|
|
853
865
|
)
|
|
866
|
+
.option(
|
|
867
|
+
`--encrypt [value]`,
|
|
868
|
+
`Toggle encryption for the attribute. Encryption enhances security by not storing any plain text values in the database. However, encrypted attributes cannot be queried.`,
|
|
869
|
+
(value: string | undefined) =>
|
|
870
|
+
value === undefined ? true : parseBool(value),
|
|
871
|
+
)
|
|
854
872
|
.action(
|
|
855
873
|
actionRunner(
|
|
856
|
-
async ({ databaseId, collectionId, key, required, xdefault, array }) =>
|
|
857
|
-
parse(await (await getDatabasesClient()).createTextAttribute(databaseId, collectionId, key, required, xdefault, array)),
|
|
874
|
+
async ({ databaseId, collectionId, key, required, xdefault, array, encrypt }) =>
|
|
875
|
+
parse(await (await getDatabasesClient()).createTextAttribute(databaseId, collectionId, key, required, xdefault, array, encrypt)),
|
|
858
876
|
),
|
|
859
877
|
);
|
|
860
878
|
|
|
@@ -930,10 +948,16 @@ databases
|
|
|
930
948
|
(value: string | undefined) =>
|
|
931
949
|
value === undefined ? true : parseBool(value),
|
|
932
950
|
)
|
|
951
|
+
.option(
|
|
952
|
+
`--encrypt [value]`,
|
|
953
|
+
`Toggle encryption for the attribute. Encryption enhances security by not storing any plain text values in the database. However, encrypted attributes cannot be queried.`,
|
|
954
|
+
(value: string | undefined) =>
|
|
955
|
+
value === undefined ? true : parseBool(value),
|
|
956
|
+
)
|
|
933
957
|
.action(
|
|
934
958
|
actionRunner(
|
|
935
|
-
async ({ databaseId, collectionId, key, size, required, xdefault, array }) =>
|
|
936
|
-
parse(await (await getDatabasesClient()).createVarcharAttribute(databaseId, collectionId, key, size, required, xdefault, array)),
|
|
959
|
+
async ({ databaseId, collectionId, key, size, required, xdefault, array, encrypt }) =>
|
|
960
|
+
parse(await (await getDatabasesClient()).createVarcharAttribute(databaseId, collectionId, key, size, required, xdefault, array, encrypt)),
|
|
937
961
|
),
|
|
938
962
|
);
|
|
939
963
|
|
|
@@ -350,6 +350,7 @@ projects
|
|
|
350
350
|
.command(`list-keys`)
|
|
351
351
|
.description(`Get a list of all API keys from the current project. `)
|
|
352
352
|
.requiredOption(`--project-id <project-id>`, `Project unique ID.`)
|
|
353
|
+
.option(`--queries [queries...]`, `Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/queries). Maximum of 100 queries are allowed, each 4096 characters long. You may filter on the following attributes: expire, accessedAt, name, scopes`)
|
|
353
354
|
.option(
|
|
354
355
|
`--total [value]`,
|
|
355
356
|
`When set to false, the total count returned will be 0 and will not be calculated.`,
|
|
@@ -358,8 +359,8 @@ projects
|
|
|
358
359
|
)
|
|
359
360
|
.action(
|
|
360
361
|
actionRunner(
|
|
361
|
-
async ({ projectId, total }) =>
|
|
362
|
-
parse(await (await getProjectsClient()).listKeys(projectId, total)),
|
|
362
|
+
async ({ projectId, queries, total }) =>
|
|
363
|
+
parse(await (await getProjectsClient()).listKeys(projectId, queries, total)),
|
|
363
364
|
),
|
|
364
365
|
);
|
|
365
366
|
|
|
@@ -369,11 +370,12 @@ projects
|
|
|
369
370
|
.requiredOption(`--project-id <project-id>`, `Project unique ID.`)
|
|
370
371
|
.requiredOption(`--name <name>`, `Key name. Max length: 128 chars.`)
|
|
371
372
|
.requiredOption(`--scopes [scopes...]`, `Key scopes list. Maximum of 100 scopes are allowed.`)
|
|
373
|
+
.option(`--key-id <key-id>`, `Key ID. Choose a custom ID or generate a random ID with \`ID.unique()\`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars.`)
|
|
372
374
|
.option(`--expire <expire>`, `Expiration time in [ISO 8601](https://www.iso.org/iso-8601-date-and-time-format.html) format. Use null for unlimited expiration.`)
|
|
373
375
|
.action(
|
|
374
376
|
actionRunner(
|
|
375
|
-
async ({ projectId, name, scopes, expire }) =>
|
|
376
|
-
parse(await (await getProjectsClient()).createKey(projectId, name, scopes, expire)),
|
|
377
|
+
async ({ projectId, name, scopes, keyId, expire }) =>
|
|
378
|
+
parse(await (await getProjectsClient()).createKey(projectId, name, scopes, keyId, expire)),
|
|
377
379
|
),
|
|
378
380
|
);
|
|
379
381
|
|
|
@@ -639,10 +639,16 @@ tablesDB
|
|
|
639
639
|
(value: string | undefined) =>
|
|
640
640
|
value === undefined ? true : parseBool(value),
|
|
641
641
|
)
|
|
642
|
+
.option(
|
|
643
|
+
`--encrypt [value]`,
|
|
644
|
+
`Toggle encryption for the column. Encryption enhances security by not storing any plain text values in the database. However, encrypted columns cannot be queried.`,
|
|
645
|
+
(value: string | undefined) =>
|
|
646
|
+
value === undefined ? true : parseBool(value),
|
|
647
|
+
)
|
|
642
648
|
.action(
|
|
643
649
|
actionRunner(
|
|
644
|
-
async ({ databaseId, tableId, key, required, xdefault, array }) =>
|
|
645
|
-
parse(await (await getTablesDBClient()).createLongtextColumn(databaseId, tableId, key, required, xdefault, array)),
|
|
650
|
+
async ({ databaseId, tableId, key, required, xdefault, array, encrypt }) =>
|
|
651
|
+
parse(await (await getTablesDBClient()).createLongtextColumn(databaseId, tableId, key, required, xdefault, array, encrypt)),
|
|
646
652
|
),
|
|
647
653
|
);
|
|
648
654
|
|
|
@@ -678,10 +684,16 @@ tablesDB
|
|
|
678
684
|
(value: string | undefined) =>
|
|
679
685
|
value === undefined ? true : parseBool(value),
|
|
680
686
|
)
|
|
687
|
+
.option(
|
|
688
|
+
`--encrypt [value]`,
|
|
689
|
+
`Toggle encryption for the column. Encryption enhances security by not storing any plain text values in the database. However, encrypted columns cannot be queried.`,
|
|
690
|
+
(value: string | undefined) =>
|
|
691
|
+
value === undefined ? true : parseBool(value),
|
|
692
|
+
)
|
|
681
693
|
.action(
|
|
682
694
|
actionRunner(
|
|
683
|
-
async ({ databaseId, tableId, key, required, xdefault, array }) =>
|
|
684
|
-
parse(await (await getTablesDBClient()).createMediumtextColumn(databaseId, tableId, key, required, xdefault, array)),
|
|
695
|
+
async ({ databaseId, tableId, key, required, xdefault, array, encrypt }) =>
|
|
696
|
+
parse(await (await getTablesDBClient()).createMediumtextColumn(databaseId, tableId, key, required, xdefault, array, encrypt)),
|
|
685
697
|
),
|
|
686
698
|
);
|
|
687
699
|
|
|
@@ -850,10 +862,16 @@ tablesDB
|
|
|
850
862
|
(value: string | undefined) =>
|
|
851
863
|
value === undefined ? true : parseBool(value),
|
|
852
864
|
)
|
|
865
|
+
.option(
|
|
866
|
+
`--encrypt [value]`,
|
|
867
|
+
`Toggle encryption for the column. Encryption enhances security by not storing any plain text values in the database. However, encrypted columns cannot be queried.`,
|
|
868
|
+
(value: string | undefined) =>
|
|
869
|
+
value === undefined ? true : parseBool(value),
|
|
870
|
+
)
|
|
853
871
|
.action(
|
|
854
872
|
actionRunner(
|
|
855
|
-
async ({ databaseId, tableId, key, required, xdefault, array }) =>
|
|
856
|
-
parse(await (await getTablesDBClient()).createTextColumn(databaseId, tableId, key, required, xdefault, array)),
|
|
873
|
+
async ({ databaseId, tableId, key, required, xdefault, array, encrypt }) =>
|
|
874
|
+
parse(await (await getTablesDBClient()).createTextColumn(databaseId, tableId, key, required, xdefault, array, encrypt)),
|
|
857
875
|
),
|
|
858
876
|
);
|
|
859
877
|
|
|
@@ -929,10 +947,16 @@ tablesDB
|
|
|
929
947
|
(value: string | undefined) =>
|
|
930
948
|
value === undefined ? true : parseBool(value),
|
|
931
949
|
)
|
|
950
|
+
.option(
|
|
951
|
+
`--encrypt [value]`,
|
|
952
|
+
`Toggle encryption for the column. Encryption enhances security by not storing any plain text values in the database. However, encrypted columns cannot be queried.`,
|
|
953
|
+
(value: string | undefined) =>
|
|
954
|
+
value === undefined ? true : parseBool(value),
|
|
955
|
+
)
|
|
932
956
|
.action(
|
|
933
957
|
actionRunner(
|
|
934
|
-
async ({ databaseId, tableId, key, size, required, xdefault, array }) =>
|
|
935
|
-
parse(await (await getTablesDBClient()).createVarcharColumn(databaseId, tableId, key, size, required, xdefault, array)),
|
|
958
|
+
async ({ databaseId, tableId, key, size, required, xdefault, array, encrypt }) =>
|
|
959
|
+
parse(await (await getTablesDBClient()).createVarcharColumn(databaseId, tableId, key, size, required, xdefault, array, encrypt)),
|
|
936
960
|
),
|
|
937
961
|
);
|
|
938
962
|
|
package/lib/constants.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
// SDK
|
|
2
2
|
export const SDK_TITLE = 'Appwrite';
|
|
3
3
|
export const SDK_TITLE_LOWER = 'appwrite';
|
|
4
|
-
export const SDK_VERSION = '13.
|
|
4
|
+
export const SDK_VERSION = '13.4.0';
|
|
5
5
|
export const SDK_NAME = 'Command Line';
|
|
6
6
|
export const SDK_PLATFORM = 'console';
|
|
7
7
|
export const SDK_LANGUAGE = 'cli';
|
package/lib/json.ts
CHANGED
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import JSONbigModule from "json-bigint";
|
|
2
|
-
import { BigNumber } from "bignumber.js";
|
|
3
2
|
|
|
4
3
|
const JSONbigParser = JSONbigModule({ storeAsString: false });
|
|
5
4
|
const JSONbigSerializer = JSONbigModule({ useNativeBigInt: true });
|
|
@@ -7,8 +6,17 @@ const JSONbigSerializer = JSONbigModule({ useNativeBigInt: true });
|
|
|
7
6
|
const MAX_SAFE = BigInt(Number.MAX_SAFE_INTEGER);
|
|
8
7
|
const MIN_SAFE = BigInt(Number.MIN_SAFE_INTEGER);
|
|
9
8
|
|
|
9
|
+
function isBigNumber(value: any): boolean {
|
|
10
|
+
return value !== null
|
|
11
|
+
&& typeof value === 'object'
|
|
12
|
+
&& value._isBigNumber === true
|
|
13
|
+
&& typeof value.isInteger === 'function'
|
|
14
|
+
&& typeof value.toFixed === 'function'
|
|
15
|
+
&& typeof value.toNumber === 'function';
|
|
16
|
+
}
|
|
17
|
+
|
|
10
18
|
function reviver(_key: string, value: any): any {
|
|
11
|
-
if (
|
|
19
|
+
if (isBigNumber(value)) {
|
|
12
20
|
if (value.isInteger()) {
|
|
13
21
|
const str = value.toFixed();
|
|
14
22
|
const bi = BigInt(str);
|
package/lib/parser.ts
CHANGED
|
@@ -54,25 +54,35 @@ export const parse = (data: Record<string, any>): void => {
|
|
|
54
54
|
}
|
|
55
55
|
};
|
|
56
56
|
|
|
57
|
-
export const drawTable = (
|
|
57
|
+
export const drawTable = (
|
|
58
|
+
data: Array<Record<string, any> | null | undefined>,
|
|
59
|
+
): void => {
|
|
58
60
|
if (data.length == 0) {
|
|
59
61
|
console.log("[]");
|
|
60
62
|
return;
|
|
61
63
|
}
|
|
62
64
|
|
|
65
|
+
const rows = data.map((item) =>
|
|
66
|
+
item && typeof item === "object" && !Array.isArray(item) ? item : {},
|
|
67
|
+
);
|
|
68
|
+
|
|
63
69
|
// Create an object with all the keys in it
|
|
64
|
-
const obj =
|
|
70
|
+
const obj = rows.reduce((res, item) => ({ ...res, ...item }), {});
|
|
65
71
|
// Get those keys as an array
|
|
66
72
|
const keys = Object.keys(obj);
|
|
73
|
+
if (keys.length === 0) {
|
|
74
|
+
drawJSON(data);
|
|
75
|
+
return;
|
|
76
|
+
}
|
|
67
77
|
// Create an object with all keys set to the default value ''
|
|
68
78
|
const def = keys.reduce((result: Record<string, string>, key) => {
|
|
69
79
|
result[key] = "-";
|
|
70
80
|
return result;
|
|
71
81
|
}, {});
|
|
72
82
|
// Use object destructuring to replace all default values with the ones we have
|
|
73
|
-
|
|
83
|
+
const normalizedData = rows.map((item) => ({ ...def, ...item }));
|
|
74
84
|
|
|
75
|
-
const columns = Object.keys(
|
|
85
|
+
const columns = Object.keys(normalizedData[0]);
|
|
76
86
|
|
|
77
87
|
const table = new Table({
|
|
78
88
|
head: columns.map((c) => chalk.cyan.italic.bold(c)),
|
|
@@ -95,10 +105,10 @@ export const drawTable = (data: Array<Record<string, any>>): void => {
|
|
|
95
105
|
},
|
|
96
106
|
});
|
|
97
107
|
|
|
98
|
-
|
|
108
|
+
normalizedData.forEach((row) => {
|
|
99
109
|
const rowValues: any[] = [];
|
|
100
|
-
for (const key
|
|
101
|
-
if (row[key]
|
|
110
|
+
for (const key of columns) {
|
|
111
|
+
if (row[key] == null) {
|
|
102
112
|
rowValues.push("-");
|
|
103
113
|
} else if (Array.isArray(row[key])) {
|
|
104
114
|
rowValues.push(JSON.stringify(row[key]));
|
package/package.json
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
"type": "module",
|
|
4
4
|
"homepage": "https://appwrite.io/support",
|
|
5
5
|
"description": "Appwrite is an open-source self-hosted backend server that abstracts and simplifies complex and repetitive development tasks behind a very simple REST API",
|
|
6
|
-
"version": "13.
|
|
6
|
+
"version": "13.4.0",
|
|
7
7
|
"license": "BSD-3-Clause",
|
|
8
8
|
"main": "dist/index.js",
|
|
9
9
|
"types": "dist/index.d.ts",
|
|
@@ -32,8 +32,7 @@
|
|
|
32
32
|
"windows-arm64": "esbuild cli.ts --bundle --loader:.hbs=text --platform=node --target=node18 --format=esm --external:fsevents --outfile=dist/bundle-win-arm64.mjs && pkg dist/bundle-win-arm64.mjs -t node18-win-arm64 -o build/appwrite-cli-win-arm64.exe"
|
|
33
33
|
},
|
|
34
34
|
"dependencies": {
|
|
35
|
-
"@appwrite.io/console": "^2.
|
|
36
|
-
"bignumber.js": "^9.0.0",
|
|
35
|
+
"@appwrite.io/console": "^2.3.1",
|
|
37
36
|
"chalk": "4.1.2",
|
|
38
37
|
"chokidar": "^3.6.0",
|
|
39
38
|
"cli-progress": "^3.12.0",
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"$schema": "https://raw.githubusercontent.com/ScoopInstaller/Scoop/master/schema.json",
|
|
3
|
-
"version": "13.
|
|
3
|
+
"version": "13.4.0",
|
|
4
4
|
"description": "The Appwrite CLI is a command-line application that allows you to interact with Appwrite and perform server-side tasks using your terminal.",
|
|
5
5
|
"homepage": "https://github.com/appwrite/sdk-for-cli",
|
|
6
6
|
"license": "BSD-3-Clause",
|
|
7
7
|
"architecture": {
|
|
8
8
|
"64bit": {
|
|
9
|
-
"url": "https://github.com/appwrite/sdk-for-cli/releases/download/13.
|
|
9
|
+
"url": "https://github.com/appwrite/sdk-for-cli/releases/download/13.4.0/appwrite-cli-win-x64.exe",
|
|
10
10
|
"bin": [
|
|
11
11
|
[
|
|
12
12
|
"appwrite-cli-win-x64.exe",
|
|
@@ -15,7 +15,7 @@
|
|
|
15
15
|
]
|
|
16
16
|
},
|
|
17
17
|
"arm64": {
|
|
18
|
-
"url": "https://github.com/appwrite/sdk-for-cli/releases/download/13.
|
|
18
|
+
"url": "https://github.com/appwrite/sdk-for-cli/releases/download/13.4.0/appwrite-cli-win-arm64.exe",
|
|
19
19
|
"bin": [
|
|
20
20
|
[
|
|
21
21
|
"appwrite-cli-win-arm64.exe",
|