sailpoint-api-client 1.0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (123) hide show
  1. package/beta/.openapi-generator/FILES +11 -0
  2. package/beta/.openapi-generator/VERSION +1 -0
  3. package/beta/.openapi-generator-ignore +23 -0
  4. package/beta/README.md +45 -0
  5. package/beta/api.ts +63833 -0
  6. package/beta/base.ts +71 -0
  7. package/beta/common.ts +141 -0
  8. package/beta/configuration.ts +101 -0
  9. package/beta/git_push.sh +57 -0
  10. package/beta/index.ts +17 -0
  11. package/beta/package.json +35 -0
  12. package/beta/tsconfig.json +21 -0
  13. package/cc/.openapi-generator/FILES +11 -0
  14. package/cc/.openapi-generator/VERSION +1 -0
  15. package/cc/.openapi-generator-ignore +23 -0
  16. package/cc/README.md +45 -0
  17. package/cc/api.ts +2028 -0
  18. package/cc/base.ts +71 -0
  19. package/cc/common.ts +141 -0
  20. package/cc/configuration.ts +101 -0
  21. package/cc/git_push.sh +57 -0
  22. package/cc/index.ts +17 -0
  23. package/cc/package.json +35 -0
  24. package/cc/tsconfig.json +21 -0
  25. package/configuration.ts +217 -0
  26. package/dist/beta/api.d.ts +44076 -0
  27. package/dist/beta/api.js +42294 -0
  28. package/dist/beta/api.js.map +1 -0
  29. package/dist/beta/base.d.ts +55 -0
  30. package/dist/beta/base.js +83 -0
  31. package/dist/beta/base.js.map +1 -0
  32. package/dist/beta/common.d.ts +65 -0
  33. package/dist/beta/common.js +247 -0
  34. package/dist/beta/common.js.map +1 -0
  35. package/dist/beta/configuration.d.ts +83 -0
  36. package/dist/beta/configuration.js +45 -0
  37. package/dist/beta/configuration.js.map +1 -0
  38. package/dist/beta/index.d.ts +12 -0
  39. package/dist/beta/index.js +31 -0
  40. package/dist/beta/index.js.map +1 -0
  41. package/dist/cc/api.d.ts +1163 -0
  42. package/dist/cc/api.js +2047 -0
  43. package/dist/cc/api.js.map +1 -0
  44. package/dist/cc/base.d.ts +55 -0
  45. package/dist/cc/base.js +83 -0
  46. package/dist/cc/base.js.map +1 -0
  47. package/dist/cc/common.d.ts +65 -0
  48. package/dist/cc/common.js +247 -0
  49. package/dist/cc/common.js.map +1 -0
  50. package/dist/cc/configuration.d.ts +83 -0
  51. package/dist/cc/configuration.js +45 -0
  52. package/dist/cc/configuration.js.map +1 -0
  53. package/dist/cc/index.d.ts +12 -0
  54. package/dist/cc/index.js +31 -0
  55. package/dist/cc/index.js.map +1 -0
  56. package/dist/configuration.d.ts +147 -0
  57. package/dist/configuration.js +126 -0
  58. package/dist/configuration.js.map +1 -0
  59. package/dist/index.d.ts +22 -0
  60. package/dist/index.js +47 -0
  61. package/dist/index.js.map +1 -0
  62. package/dist/paginator.d.ts +41 -0
  63. package/dist/paginator.js +126 -0
  64. package/dist/paginator.js.map +1 -0
  65. package/dist/v2/api.d.ts +1359 -0
  66. package/dist/v2/api.js +1239 -0
  67. package/dist/v2/api.js.map +1 -0
  68. package/dist/v2/base.d.ts +55 -0
  69. package/dist/v2/base.js +83 -0
  70. package/dist/v2/base.js.map +1 -0
  71. package/dist/v2/common.d.ts +65 -0
  72. package/dist/v2/common.js +247 -0
  73. package/dist/v2/common.js.map +1 -0
  74. package/dist/v2/configuration.d.ts +83 -0
  75. package/dist/v2/configuration.js +45 -0
  76. package/dist/v2/configuration.js.map +1 -0
  77. package/dist/v2/index.d.ts +12 -0
  78. package/dist/v2/index.js +31 -0
  79. package/dist/v2/index.js.map +1 -0
  80. package/dist/v3/api.d.ts +23657 -0
  81. package/dist/v3/api.js +18302 -0
  82. package/dist/v3/api.js.map +1 -0
  83. package/dist/v3/base.d.ts +55 -0
  84. package/dist/v3/base.js +83 -0
  85. package/dist/v3/base.js.map +1 -0
  86. package/dist/v3/common.d.ts +65 -0
  87. package/dist/v3/common.js +247 -0
  88. package/dist/v3/common.js.map +1 -0
  89. package/dist/v3/configuration.d.ts +83 -0
  90. package/dist/v3/configuration.js +45 -0
  91. package/dist/v3/configuration.js.map +1 -0
  92. package/dist/v3/index.d.ts +12 -0
  93. package/dist/v3/index.js +31 -0
  94. package/dist/v3/index.js.map +1 -0
  95. package/index.ts +33 -0
  96. package/package.json +39 -0
  97. package/paginator.ts +99 -0
  98. package/readme.md +53 -0
  99. package/tsconfig.json +22 -0
  100. package/v2/.openapi-generator/FILES +11 -0
  101. package/v2/.openapi-generator/VERSION +1 -0
  102. package/v2/.openapi-generator-ignore +23 -0
  103. package/v2/README.md +45 -0
  104. package/v2/api.ts +1900 -0
  105. package/v2/base.ts +71 -0
  106. package/v2/common.ts +141 -0
  107. package/v2/configuration.ts +101 -0
  108. package/v2/git_push.sh +57 -0
  109. package/v2/index.ts +17 -0
  110. package/v2/package.json +35 -0
  111. package/v2/tsconfig.json +21 -0
  112. package/v3/.openapi-generator/FILES +11 -0
  113. package/v3/.openapi-generator/VERSION +1 -0
  114. package/v3/.openapi-generator-ignore +23 -0
  115. package/v3/README.md +45 -0
  116. package/v3/api.ts +32081 -0
  117. package/v3/base.ts +71 -0
  118. package/v3/common.ts +141 -0
  119. package/v3/configuration.ts +101 -0
  120. package/v3/git_push.sh +57 -0
  121. package/v3/index.ts +17 -0
  122. package/v3/package.json +35 -0
  123. package/v3/tsconfig.json +21 -0
package/index.ts ADDED
@@ -0,0 +1,33 @@
1
+ /* tslint:disable */
2
+ /* eslint-disable */
3
+ /**
4
+ * IdentityNow V3 API
5
+ * Use these APIs to interact with the IdentityNow platform to achieve repeatable, automated processes with greater scalability. We encourage you to join the SailPoint Developer Community forum at https://developer.sailpoint.com/discuss to connect with other developers using our APIs.
6
+ *
7
+ * The version of the OpenAPI document: 3.0.0
8
+ *
9
+ *
10
+ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
11
+ * https://openapi-generator.tech
12
+ * Do not edit the class manually.
13
+ */
14
+
15
+
16
+
17
+ export * from "./beta/api";
18
+ export {Configuration as ConfigurationBeta, ConfigurationParameters as ConfigurationParametersBeta} from "./beta/configuration";
19
+
20
+ export * from "./v3/api";
21
+ export {Configuration as ConfigurationV3, ConfigurationParameters as ConfigurationParametersV3} from "./v3/configuration";
22
+
23
+ export * from "./v2/api";
24
+ export {Configuration as ConfigurationV2, ConfigurationParameters as ConfigurationParametersV2} from "./v2/configuration";
25
+
26
+ export * from "./cc/api";
27
+ export {Configuration as ConfigurationCC, ConfigurationParameters as ConfigurationParametersCC} from "./cc/configuration";
28
+
29
+ export {Configuration, ConfigurationParameters} from "./configuration";
30
+
31
+ export * from "./paginator";
32
+
33
+ export * as axiosRetry from "axios-retry"
package/package.json ADDED
@@ -0,0 +1,39 @@
1
+ {
2
+ "name": "sailpoint-api-client",
3
+ "version": "1.0.1",
4
+ "description": "Official library for using the SailPoint API",
5
+ "author": "SailPoint DevOps",
6
+ "repository": {
7
+ "type": "git",
8
+ "url": "https://github.com/sailpoint-oss/typescript-sdk.git"
9
+ },
10
+ "keywords": [
11
+ "axios",
12
+ "typescript",
13
+ "sdk",
14
+ "sailpoint"
15
+ ],
16
+ "license": "MIT",
17
+ "publishConfig": {
18
+ "access": "public"
19
+ },
20
+ "bugs": {
21
+ "url": "https://github.com/sailpoint-oss/typescript-sdk/issues"
22
+ },
23
+ "main": "./dist/index.js",
24
+ "typings": "./dist/index.d.ts",
25
+ "scripts": {
26
+ "build": "tsc --outDir dist/",
27
+ "prepare": "npm run build"
28
+ },
29
+ "dependencies": {
30
+ "axios": "^0.26.1",
31
+ "axios-retry": "^3.4.0",
32
+ "js-yaml": "^4.1.0"
33
+ },
34
+ "devDependencies": {
35
+ "@types/js-yaml": "^4.0.5",
36
+ "@types/node": "^12.11.5",
37
+ "typescript": "^4.0"
38
+ }
39
+ }
package/paginator.ts ADDED
@@ -0,0 +1,99 @@
1
+ import { Search, SearchApi, SearchApiSearchPostRequest, SearchDocument } from "./v3";
2
+
3
+ export interface PaginationParams {
4
+ /**
5
+ * Max number of results to return. See [V3 API Standard Collection Parameters](https://developer.sailpoint.com/idn/api/standard-collection-parameters) for more information.
6
+ * @type {number}
7
+ * @memberof AccountsApiListAccounts
8
+ */
9
+ limit?: number;
10
+ /**
11
+ * 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.
12
+ * @type {number}
13
+ * @memberof AccountsApiListAccounts
14
+ */
15
+ offset?: number;
16
+ /**
17
+ * 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.
18
+ * @type {boolean}
19
+ * @memberof AccountsApiListAccounts
20
+ */
21
+ count?: boolean;
22
+ /**
23
+ * 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*
24
+ * @type {string}
25
+ * @memberof AccountsApiListAccounts
26
+ */
27
+ filters?: string;
28
+ }
29
+
30
+ export interface AxiosResponse<T = any, D = any> {
31
+ data: T;
32
+ status: number;
33
+ statusText: string;
34
+ request?: any;
35
+ headers: AxiosResponseHeaders;
36
+ }
37
+ export type AxiosResponseHeaders = Record<string, string> & {
38
+ "set-cookie"?: string[]
39
+ };
40
+
41
+ export class Paginator {
42
+
43
+ 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>> {
44
+ let params: PaginationParams = args ? args : {limit: 0, offset: 0}
45
+ const maxLimit = params && params.limit ? params.limit : 0
46
+ if (!params.offset) {
47
+ params.offset = 0
48
+ }
49
+ if (!increment) {
50
+ increment = 250
51
+ }
52
+ params.limit = increment
53
+
54
+ let modified: TResult[] = []
55
+ while (true) {
56
+ console.log(`Paginating call, offset = ${params.offset}`)
57
+ let results = await callbackFn.call(thisArg, params)
58
+ modified.push.apply(modified, results.data)
59
+ if (results.data.length < increment || (params.offset >= maxLimit && maxLimit > 0)) {
60
+ results.data = modified
61
+ return results
62
+ }
63
+ params.offset += increment
64
+ }
65
+ }
66
+
67
+ public static async paginateSearchApi(searchAPI: SearchApi, search: Search, increment?: number, limit?: number): Promise<AxiosResponse<SearchDocument[], any>> {
68
+ increment = increment ? increment : 250
69
+ const searchParams: SearchApiSearchPostRequest = {
70
+ search: search,
71
+ limit: increment
72
+ }
73
+ let offset = 0
74
+ const maxLimit = limit ? limit : 0
75
+ let modified: SearchDocument[] = []
76
+
77
+ if (!search.sort || search.sort.length != 1) {
78
+ throw("search must include exactly one sort parameter to paginate properly")
79
+ }
80
+
81
+ while (true) {
82
+ console.log(`Paginating call, offset = ${offset}`)
83
+ let results = await searchAPI.searchPost(searchParams)
84
+ modified.push.apply(modified, results.data)
85
+ if (results.data.length < increment || (offset >= maxLimit && maxLimit > 0)) {
86
+ results.data = modified
87
+ return results
88
+ } else {
89
+ const result = <any>results.data[results.data.length - 1]
90
+ if (searchParams.search.sort) {
91
+ searchParams.search.searchAfter = [result[searchParams.search.sort[0].replace("-", "")]]
92
+ } else {
93
+ throw("search unexpectedly did not return a result we can search after!")
94
+ }
95
+ }
96
+ offset += increment
97
+ }
98
+ }
99
+ }
package/readme.md ADDED
@@ -0,0 +1,53 @@
1
+ # SailPoint API Client
2
+
3
+ ## Description
4
+
5
+ A typescript sdk for accessing the SailPoint IdentityNow REST API's.
6
+
7
+ ## Installation
8
+
9
+ ```bash
10
+ npm install sailpoint-api-client
11
+ ```
12
+
13
+ ## Create a configuration file or save your configuration as environment variables
14
+
15
+ You can create a local configuration file using the [CLI tool](https://github.com/sailpoint-oss/sailpoint-cli#configuration) or you can store your configuration in environment variables
16
+
17
+ * SAIL_BASE_URL
18
+ * SAIL_CLIENT_ID
19
+ * SAIL_CLIENT_SECRET
20
+
21
+ ## Examples
22
+
23
+ Simply import the API you want to work with, create a new configuration and get started.
24
+
25
+ ```typescript
26
+
27
+ import { Configuration, TransformsApi, TransformsApiCreateTransformRequest} from "sailpoint-api-client"
28
+
29
+ const createTransform = async () => {
30
+
31
+ let apiConfig = new Configuration()
32
+ let api = new TransformsApi(apiConfig)
33
+ let transform: TransformsApiCreateTransformRequest =
34
+ {
35
+ transform:
36
+ {
37
+ name: "Test Transform",
38
+ type: "dateFormat",
39
+ attributes: {
40
+ inputFormat: "MMM dd yyyy, HH:mm:ss.SSS",
41
+ outputFormat: "yyyy/dd/MM"
42
+ }
43
+ }
44
+ }
45
+ const val = await api.createTransform(transform)
46
+ console.log(val)
47
+ }
48
+
49
+ createTransform()
50
+
51
+ ```
52
+
53
+ ### See more uses of the SDK [here](../examples/src/index.ts)
package/tsconfig.json ADDED
@@ -0,0 +1,22 @@
1
+ {
2
+ "compilerOptions": {
3
+ "declaration": true,
4
+ "target": "ES5",
5
+ "module": "CommonJS",
6
+ "noImplicitAny": true,
7
+ "outDir": "dist",
8
+ "rootDir": ".",
9
+ "lib": [
10
+ "es6",
11
+ "dom"
12
+ ],
13
+ "typeRoots": [
14
+ "node_modules/@types"
15
+ ],
16
+ "sourceMap": true
17
+ },
18
+ "exclude": [
19
+ "dist",
20
+ "node_modules"
21
+ ]
22
+ }
@@ -0,0 +1,11 @@
1
+ .gitignore
2
+ .npmignore
3
+ README.md
4
+ api.ts
5
+ base.ts
6
+ common.ts
7
+ configuration.ts
8
+ git_push.sh
9
+ index.ts
10
+ package.json
11
+ tsconfig.json
@@ -0,0 +1 @@
1
+ 6.0.1
@@ -0,0 +1,23 @@
1
+ # OpenAPI Generator Ignore
2
+ # Generated by openapi-generator https://github.com/openapitools/openapi-generator
3
+
4
+ # Use this file to prevent files from being overwritten by the generator.
5
+ # The patterns follow closely to .gitignore or .dockerignore.
6
+
7
+ # As an example, the C# client generator defines ApiClient.cs.
8
+ # You can make changes and tell OpenAPI Generator to ignore just this file by uncommenting the following line:
9
+ #ApiClient.cs
10
+
11
+ # You can match any string of characters against a directory, file or extension with a single asterisk (*):
12
+ #foo/*/qux
13
+ # The above matches foo/bar/qux and foo/baz/qux, but not foo/bar/baz/qux
14
+
15
+ # You can recursively match patterns against a directory, file or extension with a double asterisk (**):
16
+ #foo/**/qux
17
+ # This matches foo/bar/qux, foo/baz/qux, and foo/bar/baz/qux
18
+
19
+ # You can also negate patterns with an exclamation (!).
20
+ # For example, you can ignore all files in a docs folder with the file extension .md:
21
+ #docs/*.md
22
+ # Then explicitly reverse the ignore rule for a single file:
23
+ #!docs/README.md
package/v2/README.md ADDED
@@ -0,0 +1,45 @@
1
+ ## sailpoint-sdk@1.0.1
2
+
3
+ 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:
4
+
5
+ Environment
6
+ * Node.js
7
+ * Webpack
8
+ * Browserify
9
+
10
+ Language level
11
+ * ES5 - you must have a Promises/A+ library installed
12
+ * ES6
13
+
14
+ Module system
15
+ * CommonJS
16
+ * ES6 module system
17
+
18
+ It can be used in both TypeScript and JavaScript. In TypeScript, the definition should be automatically resolved via `package.json`. ([Reference](http://www.typescriptlang.org/docs/handbook/typings-for-npm-packages.html))
19
+
20
+ ### Building
21
+
22
+ To build and compile the typescript sources to javascript use:
23
+ ```
24
+ npm install
25
+ npm run build
26
+ ```
27
+
28
+ ### Publishing
29
+
30
+ First build the package then run ```npm publish```
31
+
32
+ ### Consuming
33
+
34
+ navigate to the folder of your consuming project and run one of the following commands.
35
+
36
+ _published:_
37
+
38
+ ```
39
+ npm install sailpoint-sdk@1.0.1 --save
40
+ ```
41
+
42
+ _unPublished (not recommended):_
43
+
44
+ ```
45
+ npm install PATH_TO_GENERATED_PACKAGE --save