1.0.20220808 • Published 2 years ago

@maxim_mazurok/gapi.client.runtimeconfig v1.0.20220808

Weekly downloads
77
License
MIT
Repository
github
Last release
2 years 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('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`. NOTE: the `name` binding allows API services to override the binding to use different resource name schemes, such as `users/*/operations`. To override the binding, API services can add a binding such as `"/v1/{name=users/*}/operations"` to their service configuration. For backwards compatibility, the default name includes the operations collection id, however overriding users must ensure the name binding is the parent resource, without the operations collection id.
*/
await gapi.client.runtimeconfig.operations.list({ name: "name",  });
1.0.20220613

2 years ago

1.0.20220718

2 years ago

1.0.20220725

2 years ago

1.0.20220808

2 years ago

1.0.20220730

2 years ago

1.0.20220509

2 years ago

1.0.20220502

2 years ago

1.0.20220514

2 years ago

1.0.20220522

2 years ago

1.0.20220606

2 years ago

1.0.20220416

2 years ago

1.0.20220425

2 years ago

1.0.20220321

2 years ago

1.0.20220328

2 years ago

1.0.20220404

2 years ago

1.0.20220411

2 years ago

1.0.20220307

2 years ago

1.0.20220228

2 years ago

1.0.20220314

2 years ago

1.0.20220225

2 years ago

1.0.20220221

2 years ago

1.0.20220108

2 years ago

1.0.20220118

2 years ago

1.0.20220124

2 years ago

1.0.20220207

2 years ago

1.0.20220214

2 years ago

1.0.20220131

2 years ago

1.0.20211115

2 years ago

1.0.20211118

2 years ago

1.0.20211108

3 years ago

1.0.20211206

2 years ago

1.0.20211213

2 years ago

1.0.20211029

3 years ago

1.0.20211022

3 years ago

1.0.20211018

3 years ago

1.0.20211004

3 years ago

1.0.20210925

3 years ago

1.0.20210920

3 years ago

1.0.20210910

3 years ago

1.0.20210827

3 years ago

1.0.20210823

3 years ago

1.0.20210816

3 years ago

1.0.20210809

3 years ago

1.0.20210731

3 years ago

1.0.20210726

3 years ago

1.0.20210719

3 years ago

1.0.20210712

3 years ago

1.0.20210628

3 years ago

1.0.20210618

3 years ago

1.0.20210614

3 years ago

1.0.20210607

3 years ago

1.0.20210528

3 years ago

1.0.20210524

3 years ago

1.0.20210517

3 years ago

1.0.20210510

3 years ago

1.0.20210501

3 years ago

1.0.20210426

3 years ago

1.0.20210419

3 years ago

1.0.20210412

3 years ago

1.0.20210405

3 years ago

1.0.20210329

3 years ago

1.0.20210322

3 years ago

1.0.20210315

3 years ago

1.0.20210308

3 years ago

1.0.20210301

3 years ago

1.0.20210222

3 years ago

1.0.20210208

3 years ago

1.0.20210201

3 years ago

1.0.20210125

3 years ago

1.0.20210119

3 years ago

1.0.20210111

3 years ago

1.0.20201214

3 years ago

1.0.20201207

3 years ago

1.0.20201130

3 years ago

1.0.20201116

3 years ago

1.0.20201109

3 years ago