0.0.20240506 • Published 3 days ago

@maxim_mazurok/gapi.client.sourcerepo-v1 v0.0.20240506

Weekly downloads
-
License
MIT
Repository
github
Last release
3 days 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(
  'https://sourcerepo.googleapis.com/$discovery/rest?version=v1',
  () => {
    // now we can use:
    // gapi.client.sourcerepo
  }
);
// Deprecated, use discovery document URL, see https://github.com/google/google-api-javascript-client/blob/master/docs/reference.md#----gapiclientloadname----version----callback--
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'});
0.0.20240506

3 days ago

0.0.20240429

10 days ago

0.0.20240422

17 days ago

0.0.20240415

24 days ago

0.0.20240331

1 month ago

0.0.20240324

1 month ago

0.0.20240317

2 months ago

0.0.20240311

2 months ago

0.0.20240304

2 months ago

0.0.20240228

2 months ago

0.0.20240226

2 months ago

0.0.20240212

3 months ago

0.0.20240204

3 months ago

0.0.20240129

3 months ago

0.0.20240122

4 months ago

0.0.20240107

4 months ago

0.0.20231218

5 months ago

0.0.20231210

5 months ago

0.0.20231204

5 months ago

0.0.20231129

5 months ago

0.0.20231105

6 months ago

0.0.20230731

9 months ago

0.0.20230806

9 months ago

0.0.20230920

8 months ago

0.0.20230723

10 months ago

0.0.20230923

8 months ago

0.0.20231102

6 months ago

0.0.20230718

10 months ago

0.0.20230711

10 months ago

0.0.20230910

8 months ago

0.0.20230907

8 months ago

0.0.20230820

9 months ago

0.0.20230903

8 months ago

0.0.20231001

7 months ago

0.0.20230625

11 months ago

0.0.20230515

12 months ago

0.0.20230429

1 year ago

0.0.20230507

1 year ago

0.0.20230531

11 months ago

0.0.20230319

1 year ago

0.0.20230416

1 year ago

0.0.20230326

1 year ago

0.0.20230424

1 year ago

0.0.20230306

1 year ago

0.0.20230410

1 year ago

0.0.20230312

1 year ago

0.0.20230220

1 year ago

0.0.20230130

1 year ago

0.0.20230213

1 year ago

0.0.20221031

2 years ago

0.0.20221017

2 years ago

0.0.20221115

1 year ago

0.0.20221212

1 year ago

0.0.20221024

2 years ago

0.0.20230110

1 year ago

0.0.20230102

1 year ago

0.0.20221129

1 year ago

0.0.20221107

1 year ago

0.0.20230123

1 year ago

0.0.20221205

1 year ago

0.0.20220926

2 years ago

0.0.20220829

2 years ago

0.0.20220823

2 years ago

0.0.20220923

2 years ago

0.0.20220912

2 years ago

0.0.20220904

2 years ago

0.0.20220817

2 years ago

0.0.20220815

2 years ago

0.0.20220812

2 years ago

0.0.20220810

2 years ago

0.0.20220808

2 years ago