1.0.20220810 • Published 2 years ago

@maxim_mazurok/gapi.client.sourcerepo v1.0.20220810

Weekly downloads
51
License
MIT
Repository
github
Last release
2 years ago

TypeScript typings for Cloud Source Repositories API v1

Accesses source code repositories hosted by Google. For detailed description please check documentation.

Installing

Install typings for Cloud Source Repositories API:

npm install @types/gapi.client.sourcerepo@v1 --save-dev

Usage

You need to initialize Google API client in your code:

gapi.load('client', () => {
  // now we can use gapi.client
  // ...
});

Then load api client wrapper:

gapi.client.load('sourcerepo', 'v1', () => {
  // now we can use gapi.client.sourcerepo
  // ...
});

Don't forget to authenticate your client before sending any request to resources:

// declare client_id registered in Google Developers Console
var client_id = '',
  scope = [ 
      // See, edit, configure, and delete your Google Cloud data and see the email address for your Google Account.
      'https://www.googleapis.com/auth/cloud-platform',

      // Manage your source code repositories
      'https://www.googleapis.com/auth/source.full_control',

      // View the contents of your source code repositories
      'https://www.googleapis.com/auth/source.read_only',

      // Manage the contents of your source code repositories
      'https://www.googleapis.com/auth/source.read_write',
    ],
    immediate = true;
// ...

gapi.auth.authorize(
  { client_id: client_id, scope: scope, immediate: immediate },
  authResult => {
    if (authResult && !authResult.error) {
        /* handle successful authorization */
    } else {
        /* handle authorization error */
    }
});

After that you can use Cloud Source Repositories API resources:

/*
Returns the Cloud Source Repositories configuration of the project.
*/
await gapi.client.sourcerepo.projects.getConfig({ name: "name",  });

/*
Updates the Cloud Source Repositories configuration of the project.
*/
await gapi.client.sourcerepo.projects.updateConfig({ name: "name",  });
1.0.20220614

2 years ago

1.0.20220615

2 years ago

1.0.20220810

2 years ago

1.0.20220612

2 years ago

1.0.20220620

2 years ago

1.0.20220627

2 years ago

1.0.20220705

2 years ago

1.0.20220623

2 years ago

1.0.20220630

2 years ago

1.0.20220715

2 years ago

1.0.20220711

2 years ago

1.0.20220720

2 years ago

1.0.20220726

2 years ago

1.0.20220802

2 years ago

1.0.20220808

2 years ago

1.0.20220730

2 years ago

1.0.20220518

2 years ago

1.0.20220513

2 years ago

1.0.20220509

2 years ago

1.0.20220506

2 years ago

1.0.20220604

2 years ago

1.0.20220601

2 years ago

1.0.20220524

2 years ago

1.0.20220502

2 years ago

1.0.20220525

2 years ago

1.0.20220503

2 years ago

1.0.20220512

2 years ago

1.0.20220317

2 years ago

1.0.20220415

2 years ago

1.0.20220423

2 years ago

1.0.20220402

2 years ago

1.0.20220323

2 years ago

1.0.20220420

2 years ago

1.0.20220321

2 years ago

1.0.20220409

2 years ago

1.0.20220407

2 years ago

1.0.20220427

2 years ago

1.0.20220328

2 years ago

1.0.20220413

2 years ago

1.0.20220330

2 years ago

1.0.20220308

2 years ago

1.0.20220217

2 years ago

1.0.20220314

2 years ago

1.0.20220310

2 years ago

1.0.20220209

2 years ago

1.0.20211206

2 years ago

1.0.20211012

3 years ago

1.0.20210928

3 years ago

1.0.20210428

3 years ago

1.0.20210125

3 years ago

1.0.20201024

3 years ago