mirror of
https://github.com/LukeHagar/plexjs.git
synced 2025-12-06 12:37:46 +00:00
Compare commits
6 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
f75d22cf6a | ||
|
|
705cd5f26b | ||
|
|
5162542903 | ||
|
|
f412ddd4d5 | ||
|
|
3f4ea2071e | ||
|
|
76726427e2 |
1
.github/workflows/bump_version.yml
vendored
1
.github/workflows/bump_version.yml
vendored
@@ -62,7 +62,6 @@ jobs:
|
||||
if: steps.updateVersion.outcome == 'success'
|
||||
run: |
|
||||
LATEST_TAG=$(git describe --tags `git rev-list --tags --max-count=1`)
|
||||
cd sdk-output
|
||||
jq '.version = "${{ github.event.inputs.version }}"' package.json > package.json.tmp && mv package.json.tmp package.json
|
||||
|
||||
- name: Build TS SDK
|
||||
|
||||
Submodule api-specs updated: fd49ee9e54...462e131304
@@ -5,5 +5,5 @@ files:
|
||||
destinationFilename: package.json
|
||||
npmName: plexjs
|
||||
npmRepository: lukehagar
|
||||
npmVersion: 0.0.3
|
||||
npmVersion: 0.0.5
|
||||
useSingleRequestParameter: true
|
||||
|
||||
1
dist/index.d.ts
vendored
1
dist/index.d.ts
vendored
@@ -1,4 +1,3 @@
|
||||
export * from "./sdk-output/api";
|
||||
export { Configuration, ConfigurationParameters } from "./sdk-output/configuration";
|
||||
export * from "./paginator";
|
||||
export * as axiosRetry from "axios-retry";
|
||||
|
||||
1
dist/index.js
vendored
1
dist/index.js
vendored
@@ -18,6 +18,5 @@ exports.axiosRetry = exports.Configuration = void 0;
|
||||
__exportStar(require("./sdk-output/api"), exports);
|
||||
var configuration_1 = require("./sdk-output/configuration");
|
||||
Object.defineProperty(exports, "Configuration", { enumerable: true, get: function () { return configuration_1.Configuration; } });
|
||||
__exportStar(require("./paginator"), exports);
|
||||
exports.axiosRetry = require("axios-retry");
|
||||
//# sourceMappingURL=index.js.map
|
||||
2
dist/index.js.map
vendored
2
dist/index.js.map
vendored
@@ -1 +1 @@
|
||||
{"version":3,"file":"index.js","sourceRoot":"","sources":["../index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;AAAA,mDAAiC;AAEjC,4DAAkF;AAA1E,8GAAA,aAAa,OAAA;AAErB,8CAA4B;AAE5B,4CAAyC"}
|
||||
{"version":3,"file":"index.js","sourceRoot":"","sources":["../index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;AAAA,mDAAiC;AAEjC,4DAAkF;AAA1E,8GAAA,aAAa,OAAA;AAErB,4CAAyC"}
|
||||
1674
dist/sdk-output/api.d.ts
vendored
1674
dist/sdk-output/api.d.ts
vendored
File diff suppressed because it is too large
Load Diff
2567
dist/sdk-output/api.js
vendored
2567
dist/sdk-output/api.js
vendored
File diff suppressed because it is too large
Load Diff
2
dist/sdk-output/api.js.map
vendored
2
dist/sdk-output/api.js.map
vendored
File diff suppressed because one or more lines are too long
2
index.ts
2
index.ts
@@ -2,6 +2,4 @@ export * from "./sdk-output/api";
|
||||
|
||||
export {Configuration, ConfigurationParameters} from "./sdk-output/configuration";
|
||||
|
||||
export * from "./paginator";
|
||||
|
||||
export * as axiosRetry from "axios-retry"
|
||||
4
package-lock.json
generated
4
package-lock.json
generated
@@ -1,12 +1,12 @@
|
||||
{
|
||||
"name": "@lukehagar/plexjs",
|
||||
"version": "0.0.1",
|
||||
"version": "0.0.5",
|
||||
"lockfileVersion": 2,
|
||||
"requires": true,
|
||||
"packages": {
|
||||
"": {
|
||||
"name": "@lukehagar/plexjs",
|
||||
"version": "0.0.1",
|
||||
"version": "0.0.5",
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"axios": "^0.26.1",
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@lukehagar/plexjs",
|
||||
"version": "0.0.1",
|
||||
"version": "0.0.5",
|
||||
"description": "Community Made Plex JS/TS Module",
|
||||
"author": "Luke Hagar",
|
||||
"repository": {
|
||||
|
||||
63
paginator.ts
63
paginator.ts
@@ -1,63 +0,0 @@
|
||||
export interface PaginationParams {
|
||||
/**
|
||||
* Max number of results to return. See [V3 API Standard Collection Parameters](https://developer.sailpoint.com/idn/api/standard-collection-parameters) for more information.
|
||||
* @type {number}
|
||||
* @memberof AccountsApiListAccounts
|
||||
*/
|
||||
limit?: number;
|
||||
/**
|
||||
* Offset into the full result set. Usually specified with *limit* to paginate through the results. See [V3 API Standard Collection Parameters](https://developer.sailpoint.com/idn/api/standard-collection-parameters) for more information.
|
||||
* @type {number}
|
||||
* @memberof AccountsApiListAccounts
|
||||
*/
|
||||
offset?: number;
|
||||
/**
|
||||
* If *true* it will populate the *X-Total-Count* response header with the number of results that would be returned if *limit* and *offset* were ignored. Since requesting a total count can have a performance impact, it is recommended not to send **count=true** if that value will not be used. See [V3 API Standard Collection Parameters](https://developer.sailpoint.com/idn/api/standard-collection-parameters) for more information.
|
||||
* @type {boolean}
|
||||
* @memberof AccountsApiListAccounts
|
||||
*/
|
||||
count?: boolean;
|
||||
/**
|
||||
* Filter results using the standard syntax described in [V3 API Standard Collection Parameters](https://developer.sailpoint.com/idn/api/standard-collection-parameters#filtering-results) Filtering is supported for the following fields and operators: **id**: *eq, in* **identityId**: *eq* **name**: *eq, in* **nativeIdentity**: *eq, in* **sourceId**: *eq, in* **uncorrelated**: *eq*
|
||||
* @type {string}
|
||||
* @memberof AccountsApiListAccounts
|
||||
*/
|
||||
filters?: string;
|
||||
}
|
||||
|
||||
export interface AxiosResponse<T = any, D = any> {
|
||||
data: T;
|
||||
status: number;
|
||||
statusText: string;
|
||||
request?: any;
|
||||
headers: AxiosResponseHeaders;
|
||||
}
|
||||
export type AxiosResponseHeaders = Record<string, string> & {
|
||||
"set-cookie"?: string[]
|
||||
};
|
||||
|
||||
export class Paginator {
|
||||
public static async paginate<T, TResult, A extends PaginationParams>(thisArg: T, callbackFn: (this: T, args: A) => Promise<AxiosResponse<TResult[], any>>, args?: A, increment?: number): Promise<AxiosResponse<TResult[], any>> {
|
||||
let params: PaginationParams = args ? args : {limit: 0, offset: 0}
|
||||
const maxLimit = params && params.limit ? params.limit : 0
|
||||
if (!params.offset) {
|
||||
params.offset = 0
|
||||
}
|
||||
if (!increment) {
|
||||
increment = 250
|
||||
}
|
||||
params.limit = increment
|
||||
|
||||
let modified: TResult[] = []
|
||||
while (true) {
|
||||
console.log(`Paginating call, offset = ${params.offset}`)
|
||||
let results = await callbackFn.call(thisArg, params)
|
||||
modified.push.apply(modified, results.data)
|
||||
if (results.data.length < increment || (params.offset >= maxLimit && maxLimit > 0)) {
|
||||
results.data = modified
|
||||
return results
|
||||
}
|
||||
params.offset += increment
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,4 +1,4 @@
|
||||
## plexjs@0.0.3
|
||||
## plexjs@0.0.5
|
||||
|
||||
This generator creates TypeScript/JavaScript client that utilizes [axios](https://github.com/axios/axios). The generated Node module can be used in the following environments:
|
||||
|
||||
@@ -36,7 +36,7 @@ navigate to the folder of your consuming project and run one of the following co
|
||||
_published:_
|
||||
|
||||
```
|
||||
npm install plexjs@0.0.3 --save
|
||||
npm install plexjs@0.0.5 --save
|
||||
```
|
||||
|
||||
_unPublished (not recommended):_
|
||||
|
||||
2842
sdk-output/api.ts
2842
sdk-output/api.ts
File diff suppressed because it is too large
Load Diff
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "plexjs",
|
||||
"version": "0.0.3",
|
||||
"version": "0.0.5",
|
||||
"description": "OpenAPI client for plexjs",
|
||||
"author": "OpenAPI-Generator Contributors",
|
||||
"repository": {
|
||||
|
||||
Reference in New Issue
Block a user