0.0.20240623 • Published 1 year ago

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

Weekly downloads
-
License
MIT
Repository
github
Last release
1 year ago

TypeScript typings for Cloud Source Repositories API v1

Accesses source code repositories hosted by Google. Important: Cloud Source Repositories is scheduled for end of sales starting June 17, 2024. Customers who have enabled the API prior to this date will not be affected and can continue to use Cloud Source Repositories. Organizations or projects who have not previously enabled the API cannot use Cloud Source Repositories after this date. View Cloud Source Repositories documentation for more info. 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.20240602

1 year ago

0.0.20240617

1 year ago

0.0.20240610

1 year ago

0.0.20240623

1 year ago

0.0.20240520

1 year ago

0.0.20240506

1 year ago

0.0.20240429

1 year ago

0.0.20240422

1 year ago

0.0.20240415

1 year ago

0.0.20240331

1 year ago

0.0.20240324

1 year ago

0.0.20240317

1 year ago

0.0.20240311

1 year ago

0.0.20240304

1 year ago

0.0.20240228

1 year ago

0.0.20240226

1 year ago

0.0.20240212

1 year ago

0.0.20240204

1 year ago

0.0.20240129

1 year ago

0.0.20240122

1 year ago

0.0.20240107

1 year ago

0.0.20231218

2 years ago

0.0.20231210

2 years ago

0.0.20231204

2 years ago

0.0.20231129

2 years ago

0.0.20231105

2 years ago

0.0.20230731

2 years ago

0.0.20230806

2 years ago

0.0.20230920

2 years ago

0.0.20230723

2 years ago

0.0.20230923

2 years ago

0.0.20231102

2 years ago

0.0.20230718

2 years ago

0.0.20230711

2 years ago

0.0.20230910

2 years ago

0.0.20230907

2 years ago

0.0.20230820

2 years ago

0.0.20230903

2 years ago

0.0.20231001

2 years ago

0.0.20230625

2 years ago

0.0.20230515

2 years ago

0.0.20230429

2 years ago

0.0.20230507

2 years ago

0.0.20230531

2 years ago

0.0.20230319

2 years ago

0.0.20230416

2 years ago

0.0.20230326

2 years ago

0.0.20230424

2 years ago

0.0.20230306

2 years ago

0.0.20230410

2 years ago

0.0.20230312

2 years ago

0.0.20230220

2 years ago

0.0.20230130

2 years ago

0.0.20230213

2 years ago

0.0.20221031

3 years ago

0.0.20221017

3 years ago

0.0.20221115

3 years ago

0.0.20221212

3 years ago

0.0.20221024

3 years ago

0.0.20230110

2 years ago

0.0.20230102

2 years ago

0.0.20221129

3 years ago

0.0.20221107

3 years ago

0.0.20230123

2 years ago

0.0.20221205

3 years ago

0.0.20220926

3 years ago

0.0.20220829

3 years ago

0.0.20220823

3 years ago

0.0.20220923

3 years ago

0.0.20220912

3 years ago

0.0.20220904

3 years ago

0.0.20220817

3 years ago

0.0.20220815

3 years ago

0.0.20220812

3 years ago

0.0.20220810

3 years ago

0.0.20220808

3 years ago