Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions docs/examples/console/create-program-membership.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@ const client = new Client()
.setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint
.setProject('<YOUR_PROJECT_ID>'); // Your project ID

const console = new Console(client);
const xconsole = new Console(client);

const result = await console.createProgramMembership({
const result = await xconsole.createProgramMembership({
programId: '<PROGRAM_ID>'
});

Expand Down
4 changes: 2 additions & 2 deletions docs/examples/console/create-source.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@ const client = new Client()
.setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint
.setProject('<YOUR_PROJECT_ID>'); // Your project ID

const console = new Console(client);
const xconsole = new Console(client);

const result = await console.createSource({
const result = await xconsole.createSource({
ref: '<REF>', // optional
referrer: 'https://example.com', // optional
utmSource: '<UTM_SOURCE>', // optional
Expand Down
4 changes: 2 additions & 2 deletions docs/examples/console/get-campaign.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@ const client = new Client()
.setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint
.setProject('<YOUR_PROJECT_ID>'); // Your project ID

const console = new Console(client);
const xconsole = new Console(client);

const result = await console.getCampaign({
const result = await xconsole.getCampaign({
campaignId: '<CAMPAIGN_ID>'
});

Expand Down
4 changes: 2 additions & 2 deletions docs/examples/console/get-coupon.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@ const client = new Client()
.setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint
.setProject('<YOUR_PROJECT_ID>'); // Your project ID

const console = new Console(client);
const xconsole = new Console(client);

const result = await console.getCoupon({
const result = await xconsole.getCoupon({
couponId: '<COUPON_ID>'
});

Expand Down
4 changes: 2 additions & 2 deletions docs/examples/console/get-plan.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@ const client = new Client()
.setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint
.setProject('<YOUR_PROJECT_ID>'); // Your project ID

const console = new Console(client);
const xconsole = new Console(client);

const result = await console.getPlan({
const result = await xconsole.getPlan({
planId: '<PLAN_ID>'
});

Expand Down
4 changes: 2 additions & 2 deletions docs/examples/console/get-plans.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@ const client = new Client()
.setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint
.setProject('<YOUR_PROJECT_ID>'); // Your project ID

const console = new Console(client);
const xconsole = new Console(client);

const result = await console.getPlans({
const result = await xconsole.getPlans({
platform: Platform.Appwrite // optional
});

Expand Down
4 changes: 2 additions & 2 deletions docs/examples/console/get-program.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@ const client = new Client()
.setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint
.setProject('<YOUR_PROJECT_ID>'); // Your project ID

const console = new Console(client);
const xconsole = new Console(client);

const result = await console.getProgram({
const result = await xconsole.getProgram({
programId: '<PROGRAM_ID>'
});

Expand Down
4 changes: 2 additions & 2 deletions docs/examples/console/get-resource.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@ const client = new Client()
.setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint
.setProject('<YOUR_PROJECT_ID>'); // Your project ID

const console = new Console(client);
const xconsole = new Console(client);

const result = await console.getResource({
const result = await xconsole.getResource({
value: '<VALUE>',
type: ConsoleResourceType.Rules
});
Expand Down
4 changes: 2 additions & 2 deletions docs/examples/console/list-o-auth-2-providers.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@ const client = new Client()
.setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint
.setProject('<YOUR_PROJECT_ID>'); // Your project ID

const console = new Console(client);
const xconsole = new Console(client);

const result = await console.listOAuth2Providers();
const result = await xconsole.listOAuth2Providers();

console.log(result);
```
4 changes: 2 additions & 2 deletions docs/examples/console/list-project-scopes.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@ const client = new Client()
.setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint
.setProject('<YOUR_PROJECT_ID>'); // Your project ID

const console = new Console(client);
const xconsole = new Console(client);

const result = await console.listProjectScopes();
const result = await xconsole.listProjectScopes();

console.log(result);
```
4 changes: 2 additions & 2 deletions docs/examples/console/list-regions.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@ const client = new Client()
.setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint
.setProject('<YOUR_PROJECT_ID>'); // Your project ID

const console = new Console(client);
const xconsole = new Console(client);

const result = await console.listRegions();
const result = await xconsole.listRegions();

console.log(result);
```
4 changes: 2 additions & 2 deletions docs/examples/console/suggest-columns.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@ const client = new Client()
.setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint
.setProject('<YOUR_PROJECT_ID>'); // Your project ID

const console = new Console(client);
const xconsole = new Console(client);

const result = await console.suggestColumns({
const result = await xconsole.suggestColumns({
databaseId: '<DATABASE_ID>',
tableId: '<TABLE_ID>',
context: '<CONTEXT>', // optional
Expand Down
4 changes: 2 additions & 2 deletions docs/examples/console/suggest-indexes.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@ const client = new Client()
.setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint
.setProject('<YOUR_PROJECT_ID>'); // Your project ID

const console = new Console(client);
const xconsole = new Console(client);

const result = await console.suggestIndexes({
const result = await xconsole.suggestIndexes({
databaseId: '<DATABASE_ID>',
tableId: '<TABLE_ID>',
min: 1, // optional
Expand Down
4 changes: 2 additions & 2 deletions docs/examples/console/suggest-queries.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@ const client = new Client()
.setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint
.setProject('<YOUR_PROJECT_ID>'); // Your project ID

const console = new Console(client);
const xconsole = new Console(client);

const result = await console.suggestQueries({
const result = await xconsole.suggestQueries({
resource: QuerySuggestionResource.Activities,
input: '<INPUT>',
databaseId: '<DATABASE_ID>', // optional
Expand Down
4 changes: 2 additions & 2 deletions docs/examples/console/variables.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@ const client = new Client()
.setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint
.setProject('<YOUR_PROJECT_ID>'); // Your project ID

const console = new Console(client);
const xconsole = new Console(client);

const result = await console.variables();
const result = await xconsole.variables();

console.log(result);
```
2 changes: 1 addition & 1 deletion docs/examples/vcs/list-repository-branches.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ const result = await vcs.listRepositoryBranches({
installationId: '<INSTALLATION_ID>',
providerRepositoryId: '<PROVIDER_REPOSITORY_ID>',
search: '<SEARCH>', // optional
queries: '' // optional
queries: [] // optional
});

console.log(result);
Expand Down
2 changes: 0 additions & 2 deletions src/client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -366,7 +366,6 @@ class Client {
impersonateuserphone: string;
platform: string;
selfSigned: boolean;
session?: string;
} = {
endpoint: 'https://cloud.appwrite.io/v1',
endpointRealtime: '',
Expand All @@ -383,7 +382,6 @@ class Client {
impersonateuserphone: '',
platform: '',
selfSigned: false,
session: undefined,
};
/**
* Custom headers for API requests.
Expand Down
18 changes: 9 additions & 9 deletions src/services/vcs.ts
Original file line number Diff line number Diff line change
Expand Up @@ -306,38 +306,38 @@ export class Vcs {
* @param {string} params.installationId - Installation Id
* @param {string} params.providerRepositoryId - Repository Id
* @param {string} params.search - Search term to filter your list results. Max length: 256 chars.
* @param {string} params.queries - Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/queries). Only supported methods are limit, offset, cursorAfter, and cursorBefore
* @param {string[]} params.queries - Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/queries). Only supported methods are limit, offset, cursorAfter, and cursorBefore
* @throws {AppwriteException}
* @returns {Promise<Models.BranchList>}
*/
listRepositoryBranches(params: { installationId: string, providerRepositoryId: string, search?: string, queries?: string }): Promise<Models.BranchList>;
listRepositoryBranches(params: { installationId: string, providerRepositoryId: string, search?: string, queries?: string[] }): Promise<Models.BranchList>;
/**
* Get a list of branches from a GitHub repository in your installation. This endpoint supports filtering by a search term and pagination using query strings such as `Query.limit()`, `Query.offset()`, `Query.cursorAfter()`, and `Query.cursorBefore()`. It returns branch names along with the total number of matches. The GitHub installation must be properly configured and have access to the requested repository for this endpoint to work.
*
*
* @param {string} installationId - Installation Id
* @param {string} providerRepositoryId - Repository Id
* @param {string} search - Search term to filter your list results. Max length: 256 chars.
* @param {string} queries - Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/queries). Only supported methods are limit, offset, cursorAfter, and cursorBefore
* @param {string[]} queries - Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/queries). Only supported methods are limit, offset, cursorAfter, and cursorBefore
* @throws {AppwriteException}
* @returns {Promise<Models.BranchList>}
* @deprecated Use the object parameter style method for a better developer experience.
*/
listRepositoryBranches(installationId: string, providerRepositoryId: string, search?: string, queries?: string): Promise<Models.BranchList>;
listRepositoryBranches(installationId: string, providerRepositoryId: string, search?: string, queries?: string[]): Promise<Models.BranchList>;
listRepositoryBranches(
paramsOrFirst: { installationId: string, providerRepositoryId: string, search?: string, queries?: string } | string,
...rest: [(string)?, (string)?, (string)?]
paramsOrFirst: { installationId: string, providerRepositoryId: string, search?: string, queries?: string[] } | string,
...rest: [(string)?, (string)?, (string[])?]
): Promise<Models.BranchList> {
let params: { installationId: string, providerRepositoryId: string, search?: string, queries?: string };
let params: { installationId: string, providerRepositoryId: string, search?: string, queries?: string[] };

if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) {
params = (paramsOrFirst || {}) as { installationId: string, providerRepositoryId: string, search?: string, queries?: string };
params = (paramsOrFirst || {}) as { installationId: string, providerRepositoryId: string, search?: string, queries?: string[] };
} else {
params = {
installationId: paramsOrFirst as string,
providerRepositoryId: rest[0] as string,
search: rest[1] as string,
queries: rest[2] as string
queries: rest[2] as string[]
};
}

Expand Down