Skip to content

Commit

Permalink
chore: add GH templates
Browse files Browse the repository at this point in the history
doc: adopt common management SDK README template

OKTA-404875
<<<Jenkins Check-In of Tested SHA: 17cd740 for [email protected]>>>
Artifact: okta-sdk-nodejs
Files changed count: 6
PR Link: "#262"
  • Loading branch information
oleksandrpravosudko-okta authored and eng-prod-CI-bot-okta committed Jul 6, 2021
1 parent 5cbdc86 commit a7cbf84
Show file tree
Hide file tree
Showing 6 changed files with 179 additions and 39 deletions.
35 changes: 35 additions & 0 deletions .github/ISSUE_TEMPLATE/bug_report.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
---
name: Bug report
about: Report a bug

---
<!--
Before creating an issue or submitting a PR, please check that your issue is not already fixed in the latest stable version and that a similar issue or PR is not reported already (also check closed issues).
-->

<!--
Please help us process GitHub Issues faster by providing the following information.
Note: If you have a question about your entire application or use case, please post it on the Okta Developer Forum (https://devforum.okta.com) instead. For urgent issues contact [email protected]. Issues in this repository are reserved for bug reports and feature requests.
-->

## Current behavior
<!-- Describe how the issue manifests. -->


## Expected behavior
<!-- Describe what the desired behavior would be. -->


## Minimal reproduction of the problem with instructions
<!--
For bug reports please provide the *STEPS TO REPRODUCE* and if possible a *MINIMAL DEMO* of the problem.
-->


## Environment

- OS:
- Node.js version:
- Other:
<!-- Provide any other relevant environment details if applicable. -->
Empty file.
29 changes: 29 additions & 0 deletions .github/ISSUE_TEMPLATE/feature_request.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
---
name: Feature request
about: Suggest an idea for this project

---
<!--
Before submitting a feature request, please check that the feature is not already implemented in the latest stable version and that a similar feature request is not already submitted (also check closed issues).
-->

<!--
Please help us process GitHub Issues faster by providing the following information.
Note: If you have a question about your entire application or use case, please post it on the Okta Developer Forum (https://devforum.okta.com) instead. For urgent issues contact [email protected]. Issues in this repository are reserved for bug reports and feature requests.
-->

## User story
<!-- Describe what problem is solved by implementing this feature: "As a <type_of_user>, I want <some_goal> so that <some_reason>" -->


## Proposed solution
<!-- Provide additional detail about the motivation or the concrete use case. -->


## Alternatives considered
<!-- Provide a description of any alternative solutions or features you've considered. -->


## Additional information
<!-- Add any other context or screenshots about the feature request here. -->
43 changes: 43 additions & 0 deletions .github/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
## PR Checklist
Please check if your PR fulfills the following requirements:

- [ ] The commit message follows our [guidelines](/okta/okta-sdk-nodejs/blob/master/CONTRIBUTING.md)
- [ ] Tests for the changes have been added (for bug fixes / features)
- [ ] Docs have been added / updated (for bug fixes / features)


## PR Type
What kind of change does this PR introduce?

- [ ] Bugfix
- [ ] Feature
- [ ] Code style update (formatting, local variables)
- [ ] Refactoring (no functional changes, no api changes)
- [ ] Adding Tests
- [ ] Build related changes
- [ ] CI related changes
- [ ] Documentation changes
- [ ] Other... Please describe:


## What is the current behavior?
<!-- Please describe the current behavior that you are modifying, or link to a relevant issue. -->

Issue Number: N/A


## What is the new behavior?


## Does this PR introduce a breaking change?
- [ ] Yes
- [ ] No

<!-- If this PR contains a breaking change, please describe the impact and migration path for existing applications below. -->


## Other information


## Reviewers

4 changes: 2 additions & 2 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ Some of this SDK is auto-generated from our API Spec, defined as an Open API JSO
To re-build the auto generated files, use this command in a cloned copy of this repo (after ensuring the dev dependencies have been installed):

```sh
npm run build
yarn build
```

If there are modifications to the auto-generated files, please include those changes in your pull request.
Expand All @@ -26,5 +26,5 @@ OKTA_CLIENT_TOKEN=xxxx_api_token
Then run the tests:

```bash
npm test
yarn test
```
107 changes: 70 additions & 37 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,22 +1,54 @@
# okta-sdk-nodejs

[<img src="https://aws1.discourse-cdn.com/standard14/uploads/oktadev/original/1X/0c6402653dfb70edc661d4976a43a46f33e5e919.png" align="right" width="256px"/>](https://devforum.okta.com/)
[![npm](https://img.shields.io/npm/v/@okta/okta-sdk-nodejs)](https://www.npmjs.com/package/@okta/okta-sdk-nodejs)
[![Support](https://img.shields.io/badge/support-Developer%20Forum-blue.svg)][devforum]
[![API Reference](https://img.shields.io/badge/docs-reference-lightgrey.svg)][nodejsdocs]

# Okta Node.js Management SDK

* [Release status](#release-status)
* [Need help?](#need-help)
* [Getting started](#getting-started)
* [Usage guide](#usage-guide)
* [Configuration reference](#configuration-reference)
* [Building the SDK](#building-the-sdk)
* [TypeScript usage](#typescript-usage)

* [Contributing](#contributing)

## Release status

This library uses semantic versioning and follows Okta's [library version policy](https://developer.okta.com/code/library-versions/).

✔️: The current stable major version series is: 4.x.x

| Version | Status |
| ------- | ------------------------- |
| 1.x | :x: Retired |
| 2.x | :x: Retired |
| 3.x | :x: Retired |
| 4.x | :heavy_check_mark: Stable ([migration guide](#from-3x-to-40)) |

The latest release can always be found on the [releases page][github-releases].

## Need help?

If you run into problems using the SDK, you can

* Ask questions on the [Okta Developer Forums][devforum]
* Post [issues][github-issues] here on GitHub (for code errors)
Node.js API Client for the [Okta Platform API].

Requires Node.js version 10.0.0 or higher.

Need help? Contact [[email protected]](mailto:[email protected]) or use the [Okta Developer Forum].
## Getting started

Requires Node.js version 10.0.0 or higher.

## Installation

```sh
npm install @okta/okta-sdk-nodejs
```

## JsDocs

You can view the entire JsDocs for this project here: https://developer.okta.com/okta-sdk-nodejs/jsdocs/

## Usage
## Usage guide

All usage of this SDK begins with the creation of a client, the client handles the authentication and communication with the Okta API. To create a client, you need to provide it with your Okta Domain and an API token. To obtain those, see [Getting Started With the Okta APIs](https://developer.okta.com/code/rest/).

Expand Down Expand Up @@ -61,10 +93,12 @@ The `privateKey` can be passed in the following ways:

> Note: in case OAuth client app uses multiple JWKs, `privateKey` should specify `kid` attribute.
## Table of Contents

* [Examples](#examples)
* [Users](#users)
## Examples

This library is a wrapper for the [Okta Platform API], which should be referred to as the source-of-truth for what is and isn't possible with the API. In the following sections we show you how to use your client to perform some common operations with the [Okta Platform API].

* [Users](#users)
* [Create a User](#create-a-user)
* [Get a User](#get-a-user)
* [Update a User](#update-a-user)
Expand All @@ -84,20 +118,6 @@ The `privateKey` can be passed in the following ways:
* [Collection](#collection)
* [each](#each)
* [subscribe](#subscribeconfig)
* [Configuration](#configuration)
* [Caching](#caching)
* [Rate Limiting](#rate-limiting)
* [Built-In Retry](#built-in-retry)
* [Manual Retry](#manual-retry)
* [Request Executor](#request-executor)
* [Default Request Executor](#default-request-executor)
* [Base Request Executor](#base-request-executor)
* [Migrating between versions](#migrating-between-versions)


## Examples

This library is a wrapper for the [Okta Platform API], which should be referred to as the source-of-truth for what is and isn't possible with the API. In the following sections we show you how to use your client to perform some common operations with the [Okta Platform API].

### Users

Expand Down Expand Up @@ -414,15 +434,15 @@ client.http.http(url, request)
});
```

## Collection
### Collection

When the client is used to fetch collections of resources, a collection instance is returned. The collection encapsulates the work of paginating the API to fetch all resources in the collection (see [Pagination]). The collection provides the `each()` method for iterating over the collection, as described below.

### `each()`
#### `each()`

Allows you to visit every item in the collection, while optionally doing work at each item. All calls to `each()` will return a promise that is resolved when all items have been visited or rejected if you return a rejected promise from your iterator. Iteration can be stopped by rejecting a returned promise, or by returning `false` (will not cause a promise rejection). The following examples show you the various use-cases.

#### Serial or Parallel Synchronous Work
##### Serial or Parallel Synchronous Work

If no value is returned, `each()` will continue to the next item:

Expand All @@ -436,7 +456,7 @@ client.listUsers().each(user => {
});
```

#### Serial Asynchronous Work
##### Serial Asynchronous Work

Returning a promise will pause the iterator until the promise is resolved:

Expand All @@ -448,7 +468,7 @@ client.listUsers().each(user => {
});
```

#### Ending Iteration
##### Ending Iteration

Returning `false` will end iteration:

Expand Down Expand Up @@ -485,15 +505,15 @@ return client.listUsers().each(user => {
});
```

### `subscribe(config)`
#### `subscribe(config)`

A subscription allows you to continue paginating a collection until new items are available, if the REST API supports it for the collection. The only supported collection is the [System Log API] at this time.

A subscription fetches pages until the first empty page is reached. From that point, it fetches a new page at an interval in milliseconds defined by config (`{ interval: 5000 }`). This interval defaults to 5000 milliseconds. A subscription object is returned. To terminate polling, call `unsubscribe()` on the subscription object.

Depending on the polling interval you choose, you may run into rate limiting exceptions. In that case you should enable our rate limiting retry strategy, see [Rate Limiting](#rate-limiting).

#### Simple subscription example
##### Simple subscription example
```javascript
const subscription = collection.subscribe({
interval: 5000,
Expand All @@ -509,7 +529,7 @@ const subscription = collection.subscribe({
subscription.unsubscribe()
```

## Configuration
## Configuration Reference

There are several ways to provide configuration to the client constructor. When creating a new client, the following locations are searched in order, in a last-one-wins fashion:

Expand Down Expand Up @@ -770,7 +790,10 @@ const client = new okta.Client({
})
```

### TypeScript usage examples (>=4.5.0)
## TypeScript usage

### 4.5.x

```typescript

import { Client } from '@okta/okta-sdk-nodejs'
Expand Down Expand Up @@ -821,7 +844,7 @@ client.createApplication(bookmarkAppOptions).then((createdApp: Application) => {
});
```

#### TypeScript usage examples (>=4.6.0)
### >=4.6.x

Models can be imported from library root:

Expand All @@ -848,6 +871,10 @@ This version 4.0 release also updated APIs latest `@okta/openapi` (v2.0.0) that
- Model and Client methods change for `User` related operations
- Model and Client methods change for `Rule` related operations

## Building the SDK

Run `yarn build` from repository root.

## Contributing

See [CONTRIBUTING.md](CONTRIBUTING.md) if you would like to propose changes to this library.
Expand Down Expand Up @@ -877,3 +904,9 @@ See [CONTRIBUTING.md](CONTRIBUTING.md) if you would like to propose changes to t
[Users: List Users]: https://developer.okta.com/docs/api/resources/users#list-users
[Users: Update User]: https://developer.okta.com/docs/api/resources/users#update-user
[Okta NodeJS Management SDK JSDoc Site]: https://developer.okta.com/okta-sdk-nodejs/jsdocs/

[devforum]: https://devforum.okta.com/
[nodejsdocs]: https://developer.okta.com/okta-sdk-nodejs/jsdocs/
[github-issues]: https://github.com/okta/okta-sdk-nodejs/issues
[github-releases]: https://github.com/okta/okta-sdk-nodejs/releases

0 comments on commit a7cbf84

Please sign in to comment.