0.0.20240227 • Published 2 months ago

@maxim_mazurok/gapi.client.runtimeconfig-v1 v0.0.20240227

Weekly downloads
-
License
MIT
Repository
github
Last release
2 months ago

TypeScript typings for Cloud Runtime Configuration API v1

The Runtime Configurator allows you to dynamically configure and expose variables through Google Cloud Platform. In addition, you can also set Watchers and Waiters that will watch for changes to your data and return based on certain conditions. For detailed description please check documentation.

Installing

Install typings for Cloud Runtime Configuration API:

npm install @types/gapi.client.runtimeconfig-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://runtimeconfig.googleapis.com/$discovery/rest?version=v1',
  () => {
    // now we can use:
    // gapi.client.runtimeconfig
  }
);
// 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('runtimeconfig', 'v1', () => {
  // now we can use:
  // gapi.client.runtimeconfig
});

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 Google Cloud Platform services' runtime configuration
    'https://www.googleapis.com/auth/cloudruntimeconfig',
  ],
  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 Runtime Configuration API resources:

/*
Starts asynchronous cancellation on a long-running operation. The server makes a best effort to cancel the operation, but success is not guaranteed. If the server doesn't support this method, it returns `google.rpc.Code.UNIMPLEMENTED`. Clients can use Operations.GetOperation or other methods to check whether the cancellation succeeded or whether the operation completed despite cancellation. On successful cancellation, the operation is not deleted; instead, it becomes an operation with an Operation.error value with a google.rpc.Status.code of 1, corresponding to `Code.CANCELLED`.
*/
await gapi.client.runtimeconfig.operations.cancel({name: 'name'});

/*
Deletes a long-running operation. This method indicates that the client is no longer interested in the operation result. It does not cancel the operation. If the server doesn't support this method, it returns `google.rpc.Code.UNIMPLEMENTED`.
*/
await gapi.client.runtimeconfig.operations.delete({name: 'name'});

/*
Lists operations that match the specified filter in the request. If the server doesn't support this method, it returns `UNIMPLEMENTED`.
*/
await gapi.client.runtimeconfig.operations.list({name: 'name'});
0.0.20240227

2 months ago

0.0.20231229

4 months ago

0.0.20231225

5 months ago

0.0.20231222

5 months ago

0.0.20231109

6 months ago

0.0.20230926

8 months ago

0.0.20230806

9 months ago

0.0.20230720

10 months ago

0.0.20230803

9 months ago

0.0.20230724

10 months ago

0.0.20231023

7 months ago

0.0.20231127

6 months ago

0.0.20230710

10 months ago

0.0.20230914

8 months ago

0.0.20231013

7 months ago

0.0.20231016

7 months ago

0.0.20230829

9 months ago

0.0.20230820

9 months ago

0.0.20230903

8 months ago

0.0.20231120

6 months ago

0.0.20231001

7 months ago

0.0.20230628

11 months ago

0.0.20230626

11 months ago

0.0.20230517

12 months ago

0.0.20230620

11 months ago

0.0.20230521

12 months ago

0.0.20230508

1 year ago

0.0.20230501

1 year ago

0.0.20230605

11 months ago

0.0.20230530

11 months ago

0.0.20230313

1 year ago

0.0.20230417

1 year ago

0.0.20230227

1 year ago

0.0.20230404

1 year ago

0.0.20230327

1 year ago

0.0.20230302

1 year ago

0.0.20230424

1 year ago

0.0.20230306

1 year ago

0.0.20230410

1 year ago

0.0.20230206

1 year ago

0.0.20230130

1 year ago

0.0.20230213

1 year ago

0.0.20221114

1 year ago

0.0.20221212

1 year ago

0.0.20230109

1 year ago

0.0.20221206

1 year ago

0.0.20221107

2 years ago

0.0.20230123

1 year ago

0.0.20221205

1 year ago

0.0.20221031

2 years ago

0.0.20221017

2 years ago

0.0.20221025

2 years ago

0.0.20221003

2 years ago

0.0.20220926

2 years ago

0.0.20220829

2 years ago

0.0.20220919

2 years ago

0.0.20220823

2 years ago

0.0.20220912

2 years ago

0.0.20220915

2 years ago

0.0.20220813

2 years ago

0.0.20220808

2 years ago