Product
Introducing Java Support in Socket
We're excited to announce that Socket now supports the Java programming language.
ibm-cloud-sdk-core
Advanced tools
Core functionality to support SDKs generated with IBM's OpenAPI 3 SDK Generator.
This project contains the core functionality used by Node SDK's generated by the IBM OpenAPI 3 SDK Generator (openapi-sdkgen
).
Code generated by openapi-sdkgen
will depend on the functionality contained in this project.
Support for Node versions 6 and 8 is deprecated and will be officially dropped in the next major release, which is expected to be in September, 2019. Version 6 reached end of life in April 2019 and Version 8 reaches end of life on 31 December 2019.
npm install ibm-cloud-sdk-core
This package exports a single object containing a number of modules as top level properties.
Example:
// do some stuff
// this is TypeScript, since the `openapi-sdkgen` project generates TypeScript
import { BaseService } from 'ibm-cloud-sdk-core';
class YourSDK extends BaseService { ... }
There are several flavors of authentication supported in this package. To specify the intended authentication pattern to use, the user can pass in the parameter authentication_type
. This parameter is optional, but it may become required in a future major release. The options for this parameter are basic
, iam
, and icp4d
.
This indicates Basic Auth is to be used. Users will pass in a username
and password
and the SDK will generate a Basic Auth header to send with requests to the service.
This indicates that IAM token authentication is to be used. Users can pass in an iam_apikey
or an iam_access_token
. If an API key is used, the SDK will manage the token for the user. In either case, the SDK will generate a Bearer Auth header to send with requests to the service.
This indicates that the service is an instance of ICP4D, which has its own version of token authentication. Users can pass in a username
and password
, or an icp4d_access_token
. If a username and password is given, the SDK will manage the token for the user.
A url
is required for this type. In order to use an SDK-managed token with ICP4D authentication, this option must be passed in.
This Class is the base class that all generated service-specific classes inherit from. It implements credentials handling and other shared behavior.
This Class contains logic for managing an IAM token over its lifetime. Tokens can be requested or set manually. When requested, the token manager will either return the current token or request a new token if one is not saved or the the current token is expired. If a token is manually set, it must be managed by the user.
This Class is similar in function to IamTokenManagerV1. The only difference is that the url
parameter is required, it takes a username
and password
instead of an API key, and manages tokens for instances of ICP4D. To use this token manager in an SDK, the parameter authentication_type
must be set to icp4d
in the constructor.
This function takes an Object and returns true
if it is an empty object.
This function attempts to retrieve the content type of the input and returns null
if not found.
This function takes a string and returns an identical string but with a forward slash removed from the end, if present.
This function takes in a list of required parameters and a parameters object and returns null
if all required parameters are present and an Error if any are missing.
This function returns true
if the given string is HTML.
This function takes a parameters object and a list of "formats". It returns the first match from the formats array that is a key in the parameters object, or null
if there are no matches.
This function takes an Object and returns the same object with all of the top-level keys converted to lower case. Note: it does not convert nested keys.
This module includes one function, stringify
.
This function takes an Object containing query parameters and returns a URI-encoded query String. This function is modified for use with Watson - the query parameter watson-token
will not be encoded, as the server requires non-encoded tokens for authentication.
This module includes two functions, fromHeader
and fromFilename
.
This function attempts to use the first bytes of a file to match the file contents with the associated mime type. Returns undefined
if no matching mime type is found.
This function attempts to parse the extension from a file and return the mime type associated with the file contents. Returns undefined
if no matching mime type is found.
This function takes a Stream and converts it to a Promise that resolves with the final text, encoded with utf-8
.
FAQs
Core functionality to support SDKs generated with IBM's OpenAPI SDK Generator.
The npm package ibm-cloud-sdk-core receives a total of 28,161 weekly downloads. As such, ibm-cloud-sdk-core popularity was classified as popular.
We found that ibm-cloud-sdk-core demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 0 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Product
We're excited to announce that Socket now supports the Java programming language.
Security News
Socket detected a malicious Python package impersonating a popular browser cookie library to steal passwords, screenshots, webcam images, and Discord tokens.
Security News
Deno 2.0 is now available with enhanced package management, full Node.js and npm compatibility, improved performance, and support for major JavaScript frameworks.