-
Notifications
You must be signed in to change notification settings - Fork 45
feat: support concurrent chunk uploads #319
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Closed
Closed
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,4 @@ | ||
| ```bash | ||
| appwrite advisor delete-report \ | ||
| --report-id <REPORT_ID> | ||
| ``` |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,5 @@ | ||
| ```bash | ||
| appwrite advisor get-insight \ | ||
| --report-id <REPORT_ID> \ | ||
| --insight-id <INSIGHT_ID> | ||
| ``` |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,4 @@ | ||
| ```bash | ||
| appwrite advisor get-report \ | ||
| --report-id <REPORT_ID> | ||
| ``` |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,5 @@ | ||
| ```bash | ||
| appwrite advisor list-insights \ | ||
| --report-id <REPORT_ID> \ | ||
| --limit 25 | ||
| ``` |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,4 @@ | ||
| ```bash | ||
| appwrite advisor list-reports \ | ||
| --limit 25 | ||
| ``` |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,4 @@ | ||
| ```bash | ||
| appwrite presences delete \ | ||
| --presence-id <PRESENCE_ID> | ||
| ``` |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,3 @@ | ||
| ```bash | ||
| appwrite presences get-usage | ||
| ``` |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,4 @@ | ||
| ```bash | ||
| appwrite presences get \ | ||
| --presence-id <PRESENCE_ID> | ||
| ``` |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,4 @@ | ||
| ```bash | ||
| appwrite presences list \ | ||
| --limit 25 | ||
| ``` |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,5 @@ | ||
| ```bash | ||
| appwrite presences update-presence \ | ||
| --presence-id <PRESENCE_ID> \ | ||
| --user-id <USER_ID> | ||
| ``` |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,6 @@ | ||
| ```bash | ||
| appwrite presences upsert \ | ||
| --presence-id <PRESENCE_ID> \ | ||
| --user-id <USER_ID> \ | ||
| --status <STATUS> | ||
| ``` |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,3 @@ | ||
| ```bash | ||
| appwrite project get | ||
| ``` |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,4 @@ | ||
| ```bash | ||
| appwrite project update-deny-aliased-email-policy \ | ||
| --enabled false | ||
| ``` |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,4 @@ | ||
| ```bash | ||
| appwrite usage list-events \ | ||
| --limit 25 | ||
| ``` |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,4 @@ | ||
| ```bash | ||
| appwrite usage list-gauges \ | ||
| --limit 25 | ||
| ``` |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,129 @@ | ||
| import { Command } from "commander"; | ||
| import { | ||
| buildQueries, | ||
| collectQueryValue, | ||
| parseDeprecatedWhereQuery, | ||
| parseFilterQuery, | ||
| } from "../utils/query.js"; | ||
| import { sdkForProject } from "../../sdks.js"; | ||
| import { | ||
| actionRunner, | ||
| commandDescriptions, | ||
| success, | ||
| parse, | ||
| parseBool, | ||
| parseInteger, | ||
| } from "../../parser.js"; | ||
| import { Advisor } from "@appwrite.io/console"; | ||
|
|
||
| let advisorClient: Advisor | null = null; | ||
|
|
||
| const getAdvisorClient = async (): Promise<Advisor> => { | ||
| if (!advisorClient) { | ||
| const sdkClient = await sdkForProject(); | ||
| advisorClient = new Advisor(sdkClient); | ||
| } | ||
| return advisorClient; | ||
| }; | ||
|
|
||
| export const advisor = new Command("advisor") | ||
| .description(commandDescriptions["advisor"] ?? "") | ||
| .configureHelp({ | ||
| helpWidth: process.stdout.columns || 80, | ||
| }); | ||
|
|
||
| const advisorListReportsCommand = advisor | ||
| .command(`list-reports`) | ||
| .description(`Get a list of all the project's analyzer reports. You can use the query params to filter your results. | ||
| `) | ||
| .option(`--queries [queries...]`, `Raw Appwrite JSON query strings (legacy). Use this for advanced queries or automation; for common filtering, sorting, and pagination prefer --filter, --sort-asc, --sort-desc, --limit, and --offset. When mixed, raw --queries are sent before generated flag 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: appId, type, targetType, target, analyzedAt`) | ||
| .option( | ||
| `--total [value]`, | ||
| `When set to false, the total count returned will be 0 and will not be calculated.`, | ||
| (value: string | undefined) => | ||
| value === undefined ? true : parseBool(value), | ||
| ) | ||
| .option(`--filter <expression>`, `Filter using a simple comparison expression. Repeat for multiple filters. Supports field=value, field!=value, field>value, field>=value, field<value, and field<=value.`, (value: string, previous: string[] | undefined) => collectQueryValue(parseFilterQuery(value), previous)) | ||
| .option(`--where <expression>`, `Deprecated. Use --filter instead. Filter using a simple comparison expression. Repeat for multiple filters.`, (value: string, previous: string[] | undefined) => collectQueryValue(parseDeprecatedWhereQuery(value), previous)) | ||
| .option(`--sort-asc <attribute>`, `Sort results by an attribute in ascending order. Repeat for multiple sort fields.`, (value: string, previous: string[] | undefined) => collectQueryValue(value, previous)) | ||
| .option(`--sort-desc <attribute>`, `Sort results by an attribute in descending order. Repeat for multiple sort fields.`, (value: string, previous: string[] | undefined) => collectQueryValue(value, previous)) | ||
| .option(`--limit <limit>`, `Maximum number of results to return.`, parseInteger) | ||
| .option(`--offset <offset>`, `Number of results to skip.`, parseInteger) | ||
| .option(`--cursor-after <id>`, `Return results after this cursor ID.`) | ||
| .option(`--cursor-before <id>`, `Return results before this cursor ID.`) | ||
| .action( | ||
| actionRunner( | ||
| async ({ queries, total, filter, where, sortAsc, sortDesc, cursorAfter, cursorBefore, limit, offset }) => | ||
| parse(await (await getAdvisorClient()).listReports(buildQueries({ queries, filter, where, sortAsc, sortDesc, cursorAfter, cursorBefore, limit, offset }), total)), | ||
| ), | ||
| ); | ||
|
|
||
|
|
||
| const advisorGetReportCommand = advisor | ||
| .command(`get-report`) | ||
| .description(`Get an analyzer report by its unique ID. The response includes the report's metadata and the nested insights it produced. | ||
| `) | ||
| .requiredOption(`--report-id <report-id>`, `Report ID.`) | ||
| .action( | ||
| actionRunner( | ||
| async ({ reportId }) => | ||
| parse(await (await getAdvisorClient()).getReport(reportId)), | ||
| ), | ||
| ); | ||
|
|
||
|
|
||
| const advisorDeleteReportCommand = advisor | ||
| .command(`delete-report`) | ||
| .description(`Delete an analyzer report by its unique ID. Nested insights and CTA metadata are removed asynchronously by the deletes worker. | ||
| `) | ||
| .requiredOption(`--report-id <report-id>`, `Report ID.`) | ||
| .action( | ||
| actionRunner( | ||
| async ({ reportId }) => | ||
| parse(await (await getAdvisorClient()).deleteReport(reportId)), | ||
| ), | ||
| ); | ||
|
|
||
|
|
||
| const advisorListInsightsCommand = advisor | ||
| .command(`list-insights`) | ||
| .description(`List the insights produced under a single analyzer report. You can use the query params to filter your results further. | ||
| `) | ||
| .requiredOption(`--report-id <report-id>`, `Parent report ID.`) | ||
| .option(`--queries [queries...]`, `Raw Appwrite JSON query strings (legacy). Use this for advanced queries or automation; for common filtering, sorting, and pagination prefer --filter, --sort-asc, --sort-desc, --limit, and --offset. When mixed, raw --queries are sent before generated flag 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: type, severity, status, resourceType, resourceId, parentResourceType, parentResourceId, analyzedAt, dismissedAt, dismissedBy`) | ||
| .option( | ||
| `--total [value]`, | ||
| `When set to false, the total count returned will be 0 and will not be calculated.`, | ||
| (value: string | undefined) => | ||
| value === undefined ? true : parseBool(value), | ||
| ) | ||
| .option(`--filter <expression>`, `Filter using a simple comparison expression. Repeat for multiple filters. Supports field=value, field!=value, field>value, field>=value, field<value, and field<=value.`, (value: string, previous: string[] | undefined) => collectQueryValue(parseFilterQuery(value), previous)) | ||
| .option(`--where <expression>`, `Deprecated. Use --filter instead. Filter using a simple comparison expression. Repeat for multiple filters.`, (value: string, previous: string[] | undefined) => collectQueryValue(parseDeprecatedWhereQuery(value), previous)) | ||
| .option(`--sort-asc <attribute>`, `Sort results by an attribute in ascending order. Repeat for multiple sort fields.`, (value: string, previous: string[] | undefined) => collectQueryValue(value, previous)) | ||
| .option(`--sort-desc <attribute>`, `Sort results by an attribute in descending order. Repeat for multiple sort fields.`, (value: string, previous: string[] | undefined) => collectQueryValue(value, previous)) | ||
| .option(`--limit <limit>`, `Maximum number of results to return.`, parseInteger) | ||
| .option(`--offset <offset>`, `Number of results to skip.`, parseInteger) | ||
| .option(`--cursor-after <id>`, `Return results after this cursor ID.`) | ||
| .option(`--cursor-before <id>`, `Return results before this cursor ID.`) | ||
| .action( | ||
| actionRunner( | ||
| async ({ reportId, queries, total, filter, where, sortAsc, sortDesc, cursorAfter, cursorBefore, limit, offset }) => | ||
| parse(await (await getAdvisorClient()).listInsights(reportId, buildQueries({ queries, filter, where, sortAsc, sortDesc, cursorAfter, cursorBefore, limit, offset }), total)), | ||
| ), | ||
| ); | ||
|
|
||
|
|
||
| const advisorGetInsightCommand = advisor | ||
| .command(`get-insight`) | ||
| .description(`Get an insight by its unique ID, scoped to its parent report. | ||
| `) | ||
| .requiredOption(`--report-id <report-id>`, `Parent report ID.`) | ||
| .requiredOption(`--insight-id <insight-id>`, `Insight ID.`) | ||
| .action( | ||
| actionRunner( | ||
| async ({ reportId, insightId }) => | ||
| parse(await (await getAdvisorClient()).getInsight(reportId, insightId)), | ||
| ), | ||
| ); | ||
|
|
||
|
|
||
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
successsymbol is imported but never called in this file — every action usesparse(...)instead. Sincestrictmode is off this won't break the build, but it is dead code. The same pattern exists inlib/commands/services/usage.ts.