Skip to content

Commit d99911d

Browse files
Kyle Roseanonrose
Kyle Rose
authored andcommitted
update readme for npm package
1 parent 51f774a commit d99911d

31 files changed

+1523
-1524
lines changed

.gitignore

Whitespace-only changes.

.swagger-codegen/VERSION

-1
This file was deleted.

README.md

+9-9
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
# looker_api_31_reference
1+
# looker-node-api
22

3-
LookerApi31Reference - JavaScript client for looker_api_31_reference
3+
LookerApi31Reference - JavaScript client for looker-node-api
44
### Authorization
55
The Looker API uses Looker **API3** credentials for authorization and access control. Looker admins can create API3 credentials on Looker's **Admin/Users** page. Pass API3 credentials to the **_/login** endpoint to obtain a temporary access_token. Include that access_token in the Authorization header of Looker API requests. For details, see [Looker API Authorization](https://looker.com/docs/r/api/authorization)
66
### Client SDKs
@@ -48,7 +48,7 @@ please follow the procedure in ["Publishing npm packages"](https://docs.npmjs.co
4848
Then install it via:
4949

5050
```shell
51-
npm install looker_api_31_reference --save
51+
npm install looker-node-api --save
5252
```
5353

5454
##### Local development
@@ -66,23 +66,23 @@ Next, [link](https://docs.npmjs.com/cli/link) it globally in npm with the follow
6666
npm link
6767
```
6868

69-
Finally, switch to the directory you want to use your looker_api_31_reference from, and run:
69+
Finally, switch to the directory you want to use your looker-node-api from, and run:
7070

7171
```shell
7272
npm link /path/to/<JAVASCRIPT_CLIENT_DIR>
7373
```
7474

75-
You should now be able to `require('looker_api_31_reference')` in javascript files from the directory you ran the last
75+
You should now be able to `require('looker-node-api')` in javascript files from the directory you ran the last
7676
command above from.
7777

7878
#### git
7979
#
8080
If the library is hosted at a git repository, e.g.
81-
https://github.com/YOUR_USERNAME/looker_api_31_reference
81+
https://github.com/YOUR_USERNAME/looker-node-api
8282
then install it via:
8383

8484
```shell
85-
npm install YOUR_USERNAME/looker_api_31_reference --save
85+
npm install YOUR_USERNAME/looker-node-api --save
8686
```
8787

8888
### For browser
@@ -121,7 +121,7 @@ module: {
121121
Please follow the [installation](#installation) instruction and execute the following JS code:
122122

123123
```javascript
124-
var LookerApi31Reference = require('looker_api_31_reference');
124+
var LookerApi31Reference = require('looker-node-api');
125125

126126
var api = new LookerApi31Reference.ApiAuthApi()
127127

@@ -143,7 +143,7 @@ api.login(opts, callback);
143143

144144
## Documentation for API Endpoints
145145

146-
All URIs are relative to *https://analytics.kollectivecd.com:20000/api/3.1*
146+
All URIs are relative to */api/3.1*
147147

148148
Class | Method | HTTP request | Description
149149
------------ | ------------- | ------------- | -------------

docs/ApiAuthApi.md

+11-11
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# LookerApi31Reference.ApiAuthApi
22

3-
All URIs are relative to *https://analytics.kollectivecd.com:20000/api/3.1*
3+
All URIs are relative to */api/3.1*
44

55
Method | HTTP request | Description
66
------------- | ------------- | -------------
@@ -15,15 +15,15 @@ Method | HTTP request | Description
1515
1616
Login
1717

18-
### Present client credentials to obtain an authorization token Looker API implements the OAuth2 [Resource Owner Password Credentials Grant](https://looker.com/docs/r/api/outh2_resource_owner_pc) pattern. The client credentials required for this login must be obtained by creating an API3 key on a user account in the Looker Admin console. The API3 key consists of a public &#x60;client_id&#x60; and a private &#x60;client_secret&#x60;. The access token returned by &#x60;login&#x60; must be used in the HTTP Authorization header of subsequent API requests, like this: &#x60;&#x60;&#x60; Authorization: token 4QDkCyCtZzYgj4C2p2cj3csJH7zqS5RzKs2kTnG4 &#x60;&#x60;&#x60; Replace \&quot;4QDkCy...\&quot; with the &#x60;access_token&#x60; value returned by &#x60;login&#x60;. The word &#x60;token&#x60; is a string literal and must be included exactly as shown. This function can accept &#x60;client_id&#x60; and &#x60;client_secret&#x60; parameters as URL query params or as www-form-urlencoded params in the body of the HTTP request. Since there is a small risk that URL parameters may be visible to intermediate nodes on the network route (proxies, routers, etc), passing credentials in the body of the request is considered more secure than URL params. Example of passing credentials in the HTTP request body: &#x60;&#x60;&#x60;&#x60; POST HTTP /login Content-Type: application/x-www-form-urlencoded client_id&#x3D;CGc9B7v7J48dQSJvxxx&amp;client_secret&#x3D;nNVS9cSS3xNpSC9JdsBvvvvv &#x60;&#x60;&#x60;&#x60; ### Best Practice: Always pass credentials in body params. Pass credentials in URL query params **only** when you cannot pass body params due to application, tool, or other limitations. For more information and detailed examples of Looker API authorization, see [How to Authenticate to Looker API3](https://github.com/looker/looker-sdk-ruby/blob/master/authentication.md).
18+
### Present client credentials to obtain an authorization token Looker API implements the OAuth2 [Resource Owner Password Credentials Grant](https://looker.com/docs/r/api/outh2_resource_owner_pc) pattern. The client credentials required for this login must be obtained by creating an API3 key on a user account in the Looker Admin console. The API3 key consists of a public &#x60;client_id&#x60; and a private &#x60;client_secret&#x60;. The access token returned by &#x60;login&#x60; must be used in the HTTP Authorization header of subsequent API requests, like this: &#x60;&#x60;&#x60; Authorization: token 4QDkCyCtZzYgj4C2p2cj3csJH7zqS5RzKs2kTnG4 &#x60;&#x60;&#x60; Replace \&quot;4QDkCy...\&quot; with the &#x60;access_token&#x60; value returned by &#x60;login&#x60;. The word &#x60;token&#x60; is a string literal and must be included exactly as shown. This function can accept &#x60;client_id&#x60; and &#x60;client_secret&#x60; parameters as URL query params or as www-form-urlencoded params in the body of the HTTP request. Since there is a small risk that URL parameters may be visible to intermediate nodes on the network route (proxies, routers, etc), passing credentials in the body of the request is considered more secure than URL params. Example of passing credentials in the HTTP request body: &#x60;&#x60;&#x60;&#x60; POST HTTP /login Content-Type: application/x-www-form-urlencoded client_id&#x3D;CGc9B7v7J48dQSJvxxx&amp;client_secret&#x3D;nNVS9cSS3xNpSC9JdsBvvvvv &#x60;&#x60;&#x60;&#x60; ### Best Practice: Always pass credentials in body params. Pass credentials in URL query params **only** when you cannot pass body params due to application, tool, or other limitations. For more information and detailed examples of Looker API authorization, see [How to Authenticate to Looker API3](https://github.com/looker/looker-sdk-ruby/blob/master/authentication.md).
1919

2020
### Example
2121
```javascript
22-
var LookerApi31Reference = require('looker_api_31_reference');
22+
var LookerApi31Reference = require('looker-node-api');
2323

2424
var apiInstance = new LookerApi31Reference.ApiAuthApi();
2525

26-
var opts = {
26+
var opts = {
2727
'clientId': "clientId_example", // String | client_id part of API3 Key.
2828
'clientSecret': "clientSecret_example" // String | client_secret part of API3 Key.
2929
};
@@ -42,8 +42,8 @@ apiInstance.login(opts, callback);
4242

4343
Name | Type | Description | Notes
4444
------------- | ------------- | ------------- | -------------
45-
**clientId** | **String**| client_id part of API3 Key. | [optional]
46-
**clientSecret** | **String**| client_secret part of API3 Key. | [optional]
45+
**clientId** | **String**| client_id part of API3 Key. | [optional]
46+
**clientSecret** | **String**| client_secret part of API3 Key. | [optional]
4747

4848
### Return type
4949

@@ -64,11 +64,11 @@ No authorization required
6464
6565
Login user
6666

67-
### Create an access token for a given user. This can only be called by an authenticated admin user. It allows that admin to generate a new authentication token for the user with the given user id. That token can then be used for subsequent API calls - which are then performed *as* that target user. The target user does *not* need to have a pre-existing API client_id/client_secret pair. And, no such credentials are created by this call. This allows for building systems where api user authentication for an arbitrary number of users is done outside of Looker and funneled through a single &#39;service account&#39; with admin permissions. Note that a new access token is generated on each call. If target users are going to be making numerous API calls in a short period then it is wise to cache this authentication token rather than call this before each of those API calls. See &#39;login&#39; for more detail on the access token and how to use it.
67+
### Create an access token for a given user. This can only be called by an authenticated admin user. It allows that admin to generate a new authentication token for the user with the given user id. That token can then be used for subsequent API calls - which are then performed *as* that target user. The target user does *not* need to have a pre-existing API client_id/client_secret pair. And, no such credentials are created by this call. This allows for building systems where api user authentication for an arbitrary number of users is done outside of Looker and funneled through a single &#39;service account&#39; with admin permissions. Note that a new access token is generated on each call. If target users are going to be making numerous API calls in a short period then it is wise to cache this authentication token rather than call this before each of those API calls. See &#39;login&#39; for more detail on the access token and how to use it.
6868

6969
### Example
7070
```javascript
71-
var LookerApi31Reference = require('looker_api_31_reference');
71+
var LookerApi31Reference = require('looker-node-api');
7272

7373
var apiInstance = new LookerApi31Reference.ApiAuthApi();
7474

@@ -89,7 +89,7 @@ apiInstance.loginUser(userId, callback);
8989

9090
Name | Type | Description | Notes
9191
------------- | ------------- | ------------- | -------------
92-
**userId** | **Number**| Id of user. |
92+
**userId** | **Number**| Id of user. |
9393

9494
### Return type
9595

@@ -110,11 +110,11 @@ No authorization required
110110
111111
Logout
112112

113-
### Logout of the API and invalidate the current access token.
113+
### Logout of the API and invalidate the current access token.
114114

115115
### Example
116116
```javascript
117-
var LookerApi31Reference = require('looker_api_31_reference');
117+
var LookerApi31Reference = require('looker-node-api');
118118

119119
var apiInstance = new LookerApi31Reference.ApiAuthApi();
120120

0 commit comments

Comments
 (0)