@rockcarver/frodo-lib 0.17.5 → 0.17.7

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 (161) hide show
  1. package/CHANGELOG.md +9 -1
  2. package/cjs/api/AgentApi.test.js.map +1 -1
  3. package/cjs/api/AuthenticateApi.js +11 -1
  4. package/cjs/api/AuthenticateApi.js.map +1 -1
  5. package/cjs/api/BaseApi.js +7 -10
  6. package/cjs/api/BaseApi.js.map +1 -1
  7. package/cjs/api/IdmConfigApi.js +4 -2
  8. package/cjs/api/IdmConfigApi.js.map +1 -1
  9. package/cjs/api/NodeApi.test.js.map +1 -1
  10. package/cjs/api/ServerInfoApi.js +8 -2
  11. package/cjs/api/ServerInfoApi.js.map +1 -1
  12. package/cjs/api/cloud/EnvInfoApi.js +41 -0
  13. package/cjs/api/cloud/EnvInfoApi.js.map +1 -0
  14. package/cjs/api/cloud/FeatureApi.js +39 -0
  15. package/cjs/api/cloud/FeatureApi.js.map +1 -0
  16. package/cjs/api/{LogApi.js → cloud/LogApi.js} +3 -3
  17. package/cjs/api/cloud/LogApi.js.map +1 -0
  18. package/cjs/api/{SecretsApi.js → cloud/SecretsApi.js} +14 -14
  19. package/cjs/api/cloud/SecretsApi.js.map +1 -0
  20. package/cjs/api/cloud/SecretsApi.test.js.map +1 -0
  21. package/cjs/api/{StartupApi.js → cloud/StartupApi.js} +5 -5
  22. package/cjs/api/cloud/StartupApi.js.map +1 -0
  23. package/cjs/api/cloud/StartupApi.test.js.map +1 -0
  24. package/cjs/api/{VariablesApi.js → cloud/VariablesApi.js} +9 -9
  25. package/cjs/api/cloud/VariablesApi.js.map +1 -0
  26. package/cjs/api/cloud/VariablesApi.test.js.map +1 -0
  27. package/cjs/index.js +11 -19
  28. package/cjs/index.js.map +1 -1
  29. package/cjs/ops/AdminOps.js +1 -1
  30. package/cjs/ops/AdminOps.js.map +1 -1
  31. package/cjs/ops/AgentOps.test.js.map +1 -1
  32. package/cjs/ops/AuthenticateOps.js +3 -5
  33. package/cjs/ops/AuthenticateOps.js.map +1 -1
  34. package/cjs/ops/AuthenticateOps.test.js.map +1 -1
  35. package/cjs/ops/ConnectionProfileOps.js +1 -1
  36. package/cjs/ops/ConnectionProfileOps.js.map +1 -1
  37. package/cjs/ops/IdmOps.js +7 -5
  38. package/cjs/ops/IdmOps.js.map +1 -1
  39. package/cjs/ops/InfoOps.js +90 -0
  40. package/cjs/ops/InfoOps.js.map +1 -0
  41. package/cjs/ops/JoseOps.test.js.map +1 -1
  42. package/cjs/ops/JourneyOps.test.js.map +1 -1
  43. package/cjs/ops/Saml2Ops.test.js.map +1 -1
  44. package/cjs/ops/ScriptOps.test.js.map +1 -1
  45. package/cjs/ops/cloud/FeatureOps.js +54 -0
  46. package/cjs/ops/cloud/FeatureOps.js.map +1 -0
  47. package/cjs/ops/{LogOps.js → cloud/LogOps.js} +4 -4
  48. package/cjs/ops/cloud/LogOps.js.map +1 -0
  49. package/cjs/ops/{SecretsOps.js → cloud/SecretsOps.js} +4 -4
  50. package/cjs/ops/cloud/SecretsOps.js.map +1 -0
  51. package/cjs/ops/{ServiceAccountOps.js → cloud/ServiceAccountOps.js} +20 -14
  52. package/cjs/ops/cloud/ServiceAccountOps.js.map +1 -0
  53. package/cjs/ops/cloud/ServiceAccountOps.test.js.map +1 -0
  54. package/cjs/ops/{StartupOps.js → cloud/StartupOps.js} +4 -4
  55. package/cjs/ops/cloud/StartupOps.js.map +1 -0
  56. package/cjs/ops/{VariablesOps.js → cloud/VariablesOps.js} +5 -5
  57. package/cjs/ops/cloud/VariablesOps.js.map +1 -0
  58. package/cjs/utils/SetupPollyForFrodoLib.js +137 -0
  59. package/cjs/utils/SetupPollyForFrodoLib.js.map +1 -0
  60. package/esm/api/AgentApi.test.mjs +0 -5
  61. package/esm/api/AuthenticateApi.mjs +11 -2
  62. package/esm/api/BaseApi.mjs +6 -8
  63. package/esm/api/IdmConfigApi.mjs +1 -1
  64. package/esm/api/NodeApi.test.mjs +0 -5
  65. package/esm/api/ServerInfoApi.mjs +8 -2
  66. package/esm/api/cloud/EnvInfoApi.mjs +24 -0
  67. package/esm/api/cloud/FeatureApi.mjs +22 -0
  68. package/esm/api/{LogApi.mjs → cloud/LogApi.mjs} +3 -3
  69. package/esm/api/{SecretsApi.mjs → cloud/SecretsApi.mjs} +14 -14
  70. package/esm/api/{SecretsApi.test.mjs → cloud/SecretsApi.test.mjs} +2 -7
  71. package/esm/api/{StartupApi.mjs → cloud/StartupApi.mjs} +5 -5
  72. package/esm/api/{StartupApi.test.mjs → cloud/StartupApi.test.mjs} +7 -7
  73. package/esm/api/{VariablesApi.mjs → cloud/VariablesApi.mjs} +9 -9
  74. package/esm/api/{VariablesApi.test.mjs → cloud/VariablesApi.test.mjs} +2 -7
  75. package/esm/index.mjs +9 -12
  76. package/esm/ops/AdminOps.mjs +1 -1
  77. package/esm/ops/AgentOps.test.mjs +0 -5
  78. package/esm/ops/AuthenticateOps.mjs +3 -5
  79. package/esm/ops/AuthenticateOps.test.mjs +0 -5
  80. package/esm/ops/ConnectionProfileOps.mjs +1 -1
  81. package/esm/ops/IdmOps.mjs +4 -4
  82. package/esm/ops/InfoOps.mjs +58 -0
  83. package/esm/ops/JoseOps.test.mjs +0 -5
  84. package/esm/ops/JourneyOps.test.mjs +0 -5
  85. package/esm/ops/Saml2Ops.test.mjs +0 -5
  86. package/esm/ops/ScriptOps.test.mjs +0 -4
  87. package/esm/ops/cloud/FeatureOps.mjs +34 -0
  88. package/esm/ops/{LogOps.mjs → cloud/LogOps.mjs} +5 -5
  89. package/esm/ops/{SecretsOps.mjs → cloud/SecretsOps.mjs} +4 -4
  90. package/esm/ops/{ServiceAccountOps.mjs → cloud/ServiceAccountOps.mjs} +20 -14
  91. package/esm/ops/cloud/ServiceAccountOps.test.mjs +83 -0
  92. package/esm/ops/{StartupOps.mjs → cloud/StartupOps.mjs} +4 -4
  93. package/esm/ops/{VariablesOps.mjs → cloud/VariablesOps.mjs} +5 -5
  94. package/esm/utils/SetupPollyForFrodoLib.mjs +108 -0
  95. package/package.json +2 -1
  96. package/types/api/AuthenticateApi.d.ts +9 -1
  97. package/types/api/AuthenticateApi.d.ts.map +1 -1
  98. package/types/api/BaseApi.d.ts +2 -4
  99. package/types/api/BaseApi.d.ts.map +1 -1
  100. package/types/api/IdmConfigApi.d.ts +1 -1
  101. package/types/api/IdmConfigApi.d.ts.map +1 -1
  102. package/types/api/ServerInfoApi.d.ts +2 -2
  103. package/types/api/ServerInfoApi.d.ts.map +1 -1
  104. package/types/api/cloud/EnvInfoApi.d.ts +18 -0
  105. package/types/api/cloud/EnvInfoApi.d.ts.map +1 -0
  106. package/types/api/cloud/FeatureApi.d.ts +12 -0
  107. package/types/api/cloud/FeatureApi.d.ts.map +1 -0
  108. package/types/api/{LogApi.d.ts → cloud/LogApi.d.ts} +0 -0
  109. package/types/api/cloud/LogApi.d.ts.map +1 -0
  110. package/types/api/{SecretsApi.d.ts → cloud/SecretsApi.d.ts} +0 -0
  111. package/types/api/cloud/SecretsApi.d.ts.map +1 -0
  112. package/types/api/{StartupApi.d.ts → cloud/StartupApi.d.ts} +0 -0
  113. package/types/api/cloud/StartupApi.d.ts.map +1 -0
  114. package/types/api/{VariablesApi.d.ts → cloud/VariablesApi.d.ts} +0 -0
  115. package/types/api/cloud/VariablesApi.d.ts.map +1 -0
  116. package/types/index.d.ts +9 -10
  117. package/types/index.d.ts.map +1 -1
  118. package/types/ops/AdminOps.d.ts.map +1 -1
  119. package/types/ops/AuthenticateOps.d.ts.map +1 -1
  120. package/types/ops/ConnectionProfileOps.d.ts.map +1 -1
  121. package/types/ops/IdmOps.d.ts +4 -4
  122. package/types/ops/IdmOps.d.ts.map +1 -1
  123. package/types/ops/InfoOps.d.ts +16 -0
  124. package/types/ops/InfoOps.d.ts.map +1 -0
  125. package/types/ops/cloud/FeatureOps.d.ts +12 -0
  126. package/types/ops/cloud/FeatureOps.d.ts.map +1 -0
  127. package/types/ops/{LogOps.d.ts → cloud/LogOps.d.ts} +0 -0
  128. package/types/ops/cloud/LogOps.d.ts.map +1 -0
  129. package/types/ops/{SecretsOps.d.ts → cloud/SecretsOps.d.ts} +0 -0
  130. package/types/ops/cloud/SecretsOps.d.ts.map +1 -0
  131. package/types/ops/{ServiceAccountOps.d.ts → cloud/ServiceAccountOps.d.ts} +7 -3
  132. package/types/ops/cloud/ServiceAccountOps.d.ts.map +1 -0
  133. package/types/ops/{StartupOps.d.ts → cloud/StartupOps.d.ts} +0 -0
  134. package/types/ops/cloud/StartupOps.d.ts.map +1 -0
  135. package/types/ops/{VariablesOps.d.ts → cloud/VariablesOps.d.ts} +0 -0
  136. package/types/ops/cloud/VariablesOps.d.ts.map +1 -0
  137. package/types/utils/SetupPollyForFrodoLib.d.ts +2 -0
  138. package/types/utils/SetupPollyForFrodoLib.d.ts.map +1 -0
  139. package/cjs/api/LogApi.js.map +0 -1
  140. package/cjs/api/SecretsApi.js.map +0 -1
  141. package/cjs/api/SecretsApi.test.js.map +0 -1
  142. package/cjs/api/StartupApi.js.map +0 -1
  143. package/cjs/api/StartupApi.test.js.map +0 -1
  144. package/cjs/api/VariablesApi.js.map +0 -1
  145. package/cjs/api/VariablesApi.test.js.map +0 -1
  146. package/cjs/ops/LogOps.js.map +0 -1
  147. package/cjs/ops/SecretsOps.js.map +0 -1
  148. package/cjs/ops/ServiceAccountOps.js.map +0 -1
  149. package/cjs/ops/ServiceAccountOps.test.js.map +0 -1
  150. package/cjs/ops/StartupOps.js.map +0 -1
  151. package/cjs/ops/VariablesOps.js.map +0 -1
  152. package/esm/ops/ServiceAccountOps.test.mjs +0 -56
  153. package/types/api/LogApi.d.ts.map +0 -1
  154. package/types/api/SecretsApi.d.ts.map +0 -1
  155. package/types/api/StartupApi.d.ts.map +0 -1
  156. package/types/api/VariablesApi.d.ts.map +0 -1
  157. package/types/ops/LogOps.d.ts.map +0 -1
  158. package/types/ops/SecretsOps.d.ts.map +0 -1
  159. package/types/ops/ServiceAccountOps.d.ts.map +0 -1
  160. package/types/ops/StartupOps.d.ts.map +0 -1
  161. package/types/ops/VariablesOps.d.ts.map +0 -1
@@ -0,0 +1,83 @@
1
+ /**
2
+ * To record and update snapshots, you must perform 3 steps in order:
3
+ *
4
+ * 1. Record API responses
5
+ *
6
+ * To record API responses, you must call the test:record script and
7
+ * override all the connection state variables required to connect to the
8
+ * env to record from:
9
+ *
10
+ * ATTENTION: For the recording to succeed, you MUST make sure to use a
11
+ * user account, not a service account.
12
+ *
13
+ * FRODO_DEBUG=1 FRODO_HOST=frodo-dev npm run test:record ServiceAccountOps
14
+ *
15
+ * The above command assumes that you have a connection profile for
16
+ * 'frodo-dev' on your development machine.
17
+ *
18
+ * 2. Update snapshots
19
+ *
20
+ * After recording API responses, you must manually update/create snapshots
21
+ * by running:
22
+ *
23
+ * FRODO_DEBUG=1 npm run test:update ServiceAccountOps
24
+ *
25
+ * 3. Test your changes
26
+ *
27
+ * If 1 and 2 didn't produce any errors, you are ready to run the tests in
28
+ * replay mode and make sure they all succeed as well:
29
+ *
30
+ * npm run test:only ServiceAccountOps
31
+ *
32
+ * Note: FRODO_DEBUG=1 is optional and enables debug logging for some output
33
+ * in case things don't function as expected
34
+ */
35
+ import { createJwkRsa, createJwks, getJwkRsaPublic } from '../JoseOps';
36
+ import * as ServiceAccount from './ServiceAccountOps';
37
+ import { autoSetupPolly, defaultMatchRequestsBy } from '../../utils/AutoSetupPolly';
38
+
39
+ // need to modify the default matching rules to allow the mocking to work for service account tests.
40
+ const matchConfig = defaultMatchRequestsBy();
41
+ matchConfig.body = false; // service account create requests are tricky because of the public key, which is different for each request
42
+
43
+ autoSetupPolly(matchConfig);
44
+ describe.only('ServiceAccountOps', () => {
45
+ describe('isServiceAccountsFeatureAvailable()', () => {
46
+ test('0: Method is implemented', async () => {
47
+ expect(ServiceAccount.isServiceAccountsFeatureAvailable).toBeDefined();
48
+ });
49
+ test('1: Check tenant supporting service accounts', async () => {
50
+ const response = await ServiceAccount.isServiceAccountsFeatureAvailable();
51
+ expect(response).toBeTruthy();
52
+ });
53
+
54
+ // test('2: Check tenant not supporting service accounts', async () => {
55
+ // (context.polly as Polly).server.any().on('request', (req) => {
56
+ // req.overrideRecordingName(
57
+ // 'ServiceAccountOps/isServiceAccountsFeatureAvailable()/2: Check tenant not supporting service accounts'
58
+ // );
59
+ // console.log(`+++++polly: recordingName: ${req.recordingName}`);
60
+ // });
61
+ // const response = await ServiceAccount.isServiceAccountsFeatureAvailable();
62
+ // expect(response).toBeFalsy();
63
+ // });
64
+ });
65
+
66
+ describe('createServiceAccount()', () => {
67
+ test('0: Method is implemented', async () => {
68
+ expect(ServiceAccount.createServiceAccount).toBeDefined();
69
+ });
70
+ test('1: Create service account', async () => {
71
+ const name = 'sa';
72
+ const description = 'service account';
73
+ const accountStatus = 'Active';
74
+ const scopes = ['fr:am:*', 'fr:idm:*', 'fr:idc:esv:*'];
75
+ const jwk = await createJwkRsa();
76
+ const publicJwk = await getJwkRsaPublic(jwk);
77
+ const jwks = createJwks(publicJwk);
78
+ const response = await ServiceAccount.createServiceAccount(name, description, accountStatus, scopes, jwks);
79
+ expect(response).toMatchSnapshot();
80
+ });
81
+ });
82
+ });
83
+ //# sourceMappingURL=ServiceAccountOps.test.js.map
@@ -1,7 +1,7 @@
1
- import { createProgressIndicator, updateProgressIndicator, stopProgressIndicator } from './utils/Console';
2
- import { getSecrets } from '../api/SecretsApi';
3
- import { getStatus, initiateRestart, RestartStatus } from '../api/StartupApi';
4
- import { getVariables } from '../api/VariablesApi';
1
+ import { createProgressIndicator, updateProgressIndicator, stopProgressIndicator } from '../utils/Console';
2
+ import { getSecrets } from '../../api/cloud/SecretsApi';
3
+ import { getStatus, initiateRestart, RestartStatus } from '../../api/cloud/StartupApi';
4
+ import { getVariables } from '../../api/cloud/VariablesApi';
5
5
 
6
6
  /**
7
7
  * Updates that need to be applied.
@@ -1,8 +1,8 @@
1
- import { createKeyValueTable, createProgressIndicator, createTable, printMessage, stopProgressIndicator, updateProgressIndicator } from './utils/Console';
2
- import { deleteVariable, getVariable, getVariables, putVariable, setVariableDescription } from '../api/VariablesApi';
3
- import wordwrap from './utils/Wordwrap';
4
- import { resolveUserName } from './ManagedObjectOps';
5
- import { decode } from '../api/utils/Base64';
1
+ import { createKeyValueTable, createProgressIndicator, createTable, printMessage, stopProgressIndicator, updateProgressIndicator } from '../utils/Console';
2
+ import { deleteVariable, getVariable, getVariables, putVariable, setVariableDescription } from '../../api/cloud/VariablesApi';
3
+ import wordwrap from '../utils/Wordwrap';
4
+ import { resolveUserName } from '../ManagedObjectOps';
5
+ import { decode } from '../../api/utils/Base64';
6
6
 
7
7
  /**
8
8
  * List variables
@@ -0,0 +1,108 @@
1
+ import path from 'path';
2
+ import { fileURLToPath } from 'url';
3
+ import { Polly } from '@pollyjs/core';
4
+ import { MODES } from '@pollyjs/utils';
5
+ import NodeHttpAdapter from '@pollyjs/adapter-node-http';
6
+ import FSPersister from '@pollyjs/persister-fs';
7
+ const __dirname = path.dirname(fileURLToPath(import.meta.url));
8
+ const FRODO_MOCK_HOSTS = ['https://openam-frodo-dev.forgeblocks.com', 'https://openam-service-accounts.forgeblocks.com', 'https://openam-volker-dev.forgeblocks.com'];
9
+ let recordIfMissing = false;
10
+ let mode = MODES.REPLAY;
11
+
12
+ // resolve "/home/sandeepc/work/ForgeRock/sources/frodo-lib/esm/api" to
13
+ // "/home/sandeepc/work/ForgeRock/sources/frodo-lib/src/test/recordings"
14
+ const recordingsDir = __dirname.replace(/^(.*\/frodo-\w{3})(.*)$/gi, '$1/src/test/mock-recordings/frodo-lib');
15
+ if (process.env.FRODO_MOCK) {
16
+ Polly.register(NodeHttpAdapter);
17
+ Polly.register(FSPersister);
18
+ if (process.env.FRODO_MOCK === 'record') {
19
+ mode = MODES.RECORD;
20
+ recordIfMissing = true;
21
+ }
22
+ }
23
+ function defaultMatchRequestsBy() {
24
+ return JSON.parse(JSON.stringify({
25
+ method: true,
26
+ headers: false,
27
+ // do not match headers, because "Authorization" header is sent only at recording time
28
+ body: true,
29
+ order: false,
30
+ url: {
31
+ protocol: false,
32
+ username: false,
33
+ password: false,
34
+ hostname: false,
35
+ // we will record from different envs but run tests always against `frodo-dev`
36
+ port: false,
37
+ pathname: true,
38
+ query: true,
39
+ hash: true
40
+ }
41
+ }));
42
+ }
43
+ function authenticationMatchRequestsBy() {
44
+ const matchRequestsBy = defaultMatchRequestsBy();
45
+ matchRequestsBy.body = false;
46
+ matchRequestsBy.order = true;
47
+ return matchRequestsBy;
48
+ }
49
+
50
+ // returns a delayed promise
51
+ async function delay(ms) {
52
+ return new Promise(resolve => setTimeout(resolve, ms));
53
+ }
54
+
55
+ // performs a specific (mathematical) operation every "ms" (milliseconds)
56
+ async function countdown(i, ms) {
57
+ await delay(ms);
58
+ return --i;
59
+ }
60
+ async function scheduleShutdown(polly, i = 30) {
61
+ ++i;
62
+ while (i = await countdown(i, 1000)) console.log(`Polly stopping in ${i}s...`);
63
+ await polly.stop();
64
+ console.log(`Polly stopped.`);
65
+ }
66
+ export function setupPollyForFrodoLib(matchRequestsBy = defaultMatchRequestsBy()) {
67
+ const polly = new Polly('default');
68
+ polly.configure({
69
+ adapters: ['node-http'],
70
+ mode,
71
+ recordIfMissing,
72
+ flushRequestsOnStop: true,
73
+ logLevel: 'warn',
74
+ recordFailedRequests: true,
75
+ persister: 'fs',
76
+ persisterOptions: {
77
+ fs: {
78
+ recordingsDir
79
+ }
80
+ },
81
+ matchRequestsBy
82
+ });
83
+ for (const host of FRODO_MOCK_HOSTS) {
84
+ if (mode === MODES.RECORD) console.log(`***** Host: ${host}`);
85
+ polly.server.host(host, () => {
86
+ polly.server.any('/am/oauth2/*').recordingName('oauth2').on('request', req => {
87
+ req.configure({
88
+ matchRequestsBy: authenticationMatchRequestsBy()
89
+ });
90
+ });
91
+ polly.server.any('/am/json/*').recordingName('am');
92
+ polly.server.any('/openidm/*').recordingName('openidm');
93
+ polly.server.any('/environment/*').recordingName('environment');
94
+ polly.server.any('/monitoring/*').recordingName('monitoring');
95
+ polly.server.any('/feature').recordingName('feature');
96
+ polly.server.any('/dashboard/*').recordingName('dashboard');
97
+ });
98
+ }
99
+ polly.server.host('https://api.github.com', () => {
100
+ polly.server.any('/*').recordingName('github');
101
+ });
102
+ polly.server.host('https://registry.npmjs.org', () => {
103
+ polly.server.any('/*').recordingName('npmjs');
104
+ });
105
+ if (mode === MODES.RECORD) scheduleShutdown(polly, 60);
106
+ return polly;
107
+ }
108
+ //# sourceMappingURL=SetupPollyForFrodoLib.js.map
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rockcarver/frodo-lib",
3
- "version": "0.17.5",
3
+ "version": "0.17.7",
4
4
  "type": "commonjs",
5
5
  "main": "./cjs/index.js",
6
6
  "module": "./esm/index.mjs",
@@ -24,6 +24,7 @@
24
24
  "watch": "npx gulp watch"
25
25
  },
26
26
  "jest": {
27
+ "testTimeout": 30000,
27
28
  "testRunner": "jest-jasmine2",
28
29
  "roots": [
29
30
  "<rootDir>/esm/",
@@ -8,4 +8,12 @@
8
8
  export declare function fillCallbacks(response: object, map: {
9
9
  [k: string]: string | number | boolean | string[];
10
10
  }): object;
11
- export declare function step(body?: {}, config?: {}, realm?: string): Promise<any>;
11
+ /**
12
+ *
13
+ * @param {any} body POST request body
14
+ * @param {any} config request config
15
+ * @param {string} realm realm
16
+ * @param {string} service name of authentication service/journey
17
+ * @returns Promise resolving to the authentication service response
18
+ */
19
+ export declare function step(body?: {}, config?: {}, realm?: string, service?: string): Promise<any>;
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/api/AuthenticateApi.ts"],"names":[],"mappings":"AAaA;;;;;;GAMG;AACH,wBAAgB,aAAa,CAC3B,QAAQ,EAAE,MAAM,EAChB,GAAG,EAAE;IAAE,CAAC,CAAC,EAAE,MAAM,GAAG,MAAM,GAAG,MAAM,GAAG,OAAO,GAAG,MAAM,EAAE,CAAA;CAAE,GACzD,MAAM,CAMR;AAED,wBAAsB,IAAI,CAAC,IAAI,KAAK,EAAE,MAAM,KAAK,EAAE,KAAK,SAAM,gBAmB7D","file":"AuthenticateApi.d.ts","sourcesContent":["import util from 'util';\nimport { generateAmApi } from './BaseApi';\nimport * as state from '../shared/State';\nimport { getRealmPath } from './utils/ApiUtils';\n\nconst authenticateUrlTemplate = '%s/json%s/authenticate';\nconst authenticateWithServiceUrlTemplate = `${authenticateUrlTemplate}?authIndexType=service&authIndexValue=%s`;\n\nconst apiVersion = 'resource=2.0, protocol=1.0';\nconst getApiConfig = () => ({\n apiVersion,\n});\n\n/**\n * Fill callbacks from a map\n * Just a start\n * @param {object} response json response from a call to /authenticate\n * @param {{ [k: string]: string | number | boolean | string[] }} map name/value map\n * @returns filled response body so it can be used as input to another call to /authenticate\n */\nexport function fillCallbacks(\n response: object,\n map: { [k: string]: string | number | boolean | string[] }\n): object {\n const body = JSON.parse(JSON.stringify(response));\n for (const callback of body.callbacks) {\n callback.input[0].value = map[callback.input[0].name];\n }\n return body;\n}\n\nexport async function step(body = {}, config = {}, realm = '/') {\n const urlString = state.getAuthenticationService()\n ? util.format(\n authenticateWithServiceUrlTemplate,\n state.getHost(),\n getRealmPath(realm),\n state.getAuthenticationService()\n )\n : util.format(\n authenticateUrlTemplate,\n state.getHost(),\n getRealmPath(realm)\n );\n const { data } = await generateAmApi(getApiConfig()).post(\n urlString,\n body,\n config\n );\n return data;\n}\n"]}
1
+ {"version":3,"sources":["../src/api/AuthenticateApi.ts"],"names":[],"mappings":"AAaA;;;;;;GAMG;AACH,wBAAgB,aAAa,CAC3B,QAAQ,EAAE,MAAM,EAChB,GAAG,EAAE;IAAE,CAAC,CAAC,EAAE,MAAM,GAAG,MAAM,GAAG,MAAM,GAAG,OAAO,GAAG,MAAM,EAAE,CAAA;CAAE,GACzD,MAAM,CAMR;AAED;;;;;;;GAOG;AACH,wBAAsB,IAAI,CACxB,IAAI,KAAK,EACT,MAAM,KAAK,EACX,KAAK,SAAM,EACX,OAAO,GAAE,MAAkB,gBAqB5B","file":"AuthenticateApi.d.ts","sourcesContent":["import util from 'util';\nimport { generateAmApi } from './BaseApi';\nimport * as state from '../shared/State';\nimport { getRealmPath } from './utils/ApiUtils';\n\nconst authenticateUrlTemplate = '%s/json%s/authenticate';\nconst authenticateWithServiceUrlTemplate = `${authenticateUrlTemplate}?authIndexType=service&authIndexValue=%s`;\n\nconst apiVersion = 'resource=2.0, protocol=1.0';\nconst getApiConfig = () => ({\n apiVersion,\n});\n\n/**\n * Fill callbacks from a map\n * Just a start\n * @param {object} response json response from a call to /authenticate\n * @param {{ [k: string]: string | number | boolean | string[] }} map name/value map\n * @returns filled response body so it can be used as input to another call to /authenticate\n */\nexport function fillCallbacks(\n response: object,\n map: { [k: string]: string | number | boolean | string[] }\n): object {\n const body = JSON.parse(JSON.stringify(response));\n for (const callback of body.callbacks) {\n callback.input[0].value = map[callback.input[0].name];\n }\n return body;\n}\n\n/**\n *\n * @param {any} body POST request body\n * @param {any} config request config\n * @param {string} realm realm\n * @param {string} service name of authentication service/journey\n * @returns Promise resolving to the authentication service response\n */\nexport async function step(\n body = {},\n config = {},\n realm = '/',\n service: string = undefined\n) {\n const urlString =\n service || state.getAuthenticationService()\n ? util.format(\n authenticateWithServiceUrlTemplate,\n state.getHost(),\n getRealmPath(realm),\n service || state.getAuthenticationService()\n )\n : util.format(\n authenticateUrlTemplate,\n state.getHost(),\n getRealmPath(realm)\n );\n const { data } = await generateAmApi(getApiConfig()).post(\n urlString,\n body,\n config\n );\n return data;\n}\n"]}
@@ -1,5 +1,3 @@
1
- import MockAdapter from 'axios-mock-adapter';
2
- export declare const FrodoMockAdapter: MockAdapter;
3
1
  /**
4
2
  * Generates an AM Axios API instance
5
3
  * @param {object} resource Takes an object takes a resource object. example:
@@ -43,13 +41,13 @@ export declare function generateLogKeysApi(requestOverride?: {}): import("axios"
43
41
  */
44
42
  export declare function generateLogApi(requestOverride?: {}): import("axios").AxiosInstance;
45
43
  /**
46
- * Generates an ESV Axios API instance for Environment Secrets and Variables
44
+ * Generates an Axios instance for the Identity Cloud Environment API
47
45
  * @param {object} requestOverride Takes an object of AXIOS parameters that can be used to either add
48
46
  * on extra information or override default properties https://github.com/axios/axios#request-config
49
47
  *
50
48
  * @returns {AxiosInstance}
51
49
  */
52
- export declare function generateESVApi(resource: any, requestOverride?: {}): import("axios").AxiosInstance;
50
+ export declare function generateEnvApi(resource: any, requestOverride?: {}): import("axios").AxiosInstance;
53
51
  /**
54
52
  * Generates a release (Github or Npm) Axios API instance
55
53
  * @param {object} requestOverride Takes an object of AXIOS parameters that can be used to either add
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/api/BaseApi.ts"],"names":[],"mappings":"AACA,OAAO,WAAW,MAAM,oBAAoB,CAAC;AAe7C,eAAO,MAAM,gBAAgB,aAGd,CAAC;AA+FhB;;;;;;;GAOG;AACH,wBAAgB,aAAa,CAAC,QAAQ,KAAA,EAAE,eAAe,KAAK,iCA+C3D;AAED;;;;;;;GAOG;AACH,wBAAgB,iBAAiB,CAAC,QAAQ,KAAA,EAAE,eAAe,KAAK,iCA8C/D;AAED;;;;;;GAMG;AACH,wBAAgB,cAAc,CAAC,eAAe,KAAK,iCAiClD;AAED;;;;;;GAMG;AACH,wBAAgB,kBAAkB,CAAC,eAAe,KAAK,iCA2BtD;AAED;;;;;;GAMG;AACH,wBAAgB,cAAc,CAAC,eAAe,KAAK,iCAwBlD;AAED;;;;;;GAMG;AACH,wBAAgB,cAAc,CAAC,QAAQ,KAAA,EAAE,eAAe,KAAK,iCA6B5D;AAED;;;;;;GAMG;AACH,wBAAgB,kBAAkB,CAAC,OAAO,KAAA,EAAE,eAAe,KAAK,iCAsB/D","file":"BaseApi.d.ts","sourcesContent":["import axios, { AxiosProxyConfig } from 'axios';\nimport MockAdapter from 'axios-mock-adapter';\nimport Agent from 'agentkeepalive';\nimport axiosRetry from 'axios-retry';\nimport HttpsProxyAgent from 'https-proxy-agent';\nimport url from 'url';\nimport fs from 'fs';\nimport * as state from '../shared/State';\nimport path from 'path';\nimport { fileURLToPath } from 'url';\nimport { curlirizeMessage, printMessage } from '../ops/utils/Console';\nimport _curlirize from '../ext/axios-curlirize/curlirize';\nimport { randomUUID } from 'crypto';\nimport { mockAll } from '../test/mocks/ForgeRockApiMockEngine';\n\n// this has to be the first statement after the imports for mocking to work\nexport const FrodoMockAdapter =\n process.env.FRODO_MOCK || process.env.frodo_mock\n ? new MockAdapter(axios)\n : undefined;\n\nif (FrodoMockAdapter) mockAll(FrodoMockAdapter);\n\nconst __dirname = path.dirname(fileURLToPath(import.meta.url));\n\nconst pkg = JSON.parse(\n fs.readFileSync(path.resolve(__dirname, '../../package.json'), 'utf8')\n);\n\naxiosRetry(axios, {\n retries: 3,\n shouldResetTimeout: true,\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n retryCondition: (_error) => true, // retry no matter what\n});\n\n// all agents\nconst timeout = 30000;\n\n// agentkeepalive\nconst maxSockets = 100;\nconst maxFreeSockets = 10;\nconst freeSocketTimeout = 30000;\n\nconst userAgent = `${pkg.name}/${pkg.version}`;\nconst transactionId = `frodo-${randomUUID()}`;\nlet httpAgent, httpsAgent;\n\nfunction getHttpAgent() {\n if (httpAgent) return httpAgent;\n httpAgent = new Agent({\n maxSockets,\n maxFreeSockets,\n timeout,\n freeSocketTimeout,\n });\n return httpAgent;\n}\n\n/**\n * Helper method to create properly configured httpsAgent\n * @returns {any} appropriate httpsAgent\n */\nfunction getHttpsAgent() {\n if (httpsAgent) return httpsAgent;\n const options = {\n rejectUnauthorized: !state.getAllowInsecureConnection(),\n };\n const httpsProxy = process.env.HTTPS_PROXY || process.env.https_proxy;\n if (httpsProxy) {\n // https://github.com/axios/axios/issues/3459\n console.error(`Using proxy ${httpsProxy}`['yellow']);\n const parsed = url.parse(httpsProxy);\n options['host'] = parsed.hostname;\n options['port'] = parsed.port;\n options['protocol'] = parsed.protocol;\n options.rejectUnauthorized = !state.getAllowInsecureConnection();\n httpsAgent = HttpsProxyAgent(options);\n return httpsAgent;\n }\n httpsAgent = new Agent.HttpsAgent({\n ...options,\n maxSockets,\n maxFreeSockets,\n timeout,\n freeSocketTimeout,\n });\n return httpsAgent;\n}\n\n/**\n * Get Proxy config\n * @returns {AxiosProxyConfig | false} axios proxy config or false\n */\nfunction getProxy(): AxiosProxyConfig | false {\n if (process.env.HTTPS_PROXY || process.env.https_proxy) return false;\n return null;\n}\n\n/**\n * Customize curlirize output\n * @param request axios request object\n */\nfunction curlirize(request) {\n _curlirize(request, (result, err) => {\n const { command } = result;\n if (err) {\n printMessage(err, 'error');\n } else {\n curlirizeMessage(command);\n }\n });\n}\n\n/**\n * Generates an AM Axios API instance\n * @param {object} resource Takes an object takes a resource object. example:\n * @param {object} requestOverride Takes an object of AXIOS parameters that can be used to either\n * add on extra information or override default properties https://github.com/axios/axios#request-config\n *\n * @returns {AxiosInstance}\n */\nexport function generateAmApi(resource, requestOverride = {}) {\n let headers = {\n 'User-Agent': userAgent,\n 'X-ForgeRock-TransactionId': transactionId,\n 'Content-Type': 'application/json',\n // only add API version if we have it\n ...(resource.apiVersion && { 'Accept-API-Version': resource.apiVersion }),\n // only send session cookie if we know its name and value and we are not instructed to use the bearer token for AM APIs\n ...(!state.getUseBearerTokenForAmApis() &&\n state.getCookieName() &&\n state.getCookieValue() && {\n Cookie: `${state.getCookieName()}=${state.getCookieValue()}`,\n }),\n // only add authorization header if we have a bearer token and are instructed to use it for AM APIs\n ...(state.getUseBearerTokenForAmApis() &&\n state.getBearerToken() && {\n Authorization: `Bearer ${state.getBearerToken()}`,\n }),\n };\n if (requestOverride['headers']) {\n headers = {\n ...headers,\n ...requestOverride['headers'],\n };\n }\n\n const requestDetails = {\n // baseURL: `${storage.session.getTenant()}/json`,\n timeout,\n ...requestOverride,\n headers: {\n ...headers,\n ...state.getAuthenticationHeaderOverrides(),\n },\n httpAgent: getHttpAgent(),\n httpsAgent: getHttpsAgent(),\n proxy: getProxy(),\n };\n\n const request = axios.create(requestDetails);\n\n // enable curlirizer output in debug mode\n if (state.getCurlirize()) {\n curlirize(request);\n }\n\n return request;\n}\n\n/**\n * Generates an OAuth2 Axios API instance\n * @param {object} resource Takes an object takes a resource object. example:\n * @param {object} requestOverride Takes an object of AXIOS parameters that can be used to either\n * add on extra information or override default properties https://github.com/axios/axios#request-config\n *\n * @returns {AxiosInstance}\n */\nexport function generateOauth2Api(resource, requestOverride = {}) {\n let headers = {\n 'User-Agent': userAgent,\n 'X-ForgeRock-TransactionId': transactionId,\n // only add API version if we have it\n ...(resource.apiVersion && { 'Accept-API-Version': resource.apiVersion }),\n // only send session cookie if we know its name and value and we are not instructed to use the bearer token for AM APIs\n ...(!state.getUseBearerTokenForAmApis() &&\n state.getCookieName() &&\n state.getCookieValue() && {\n Cookie: `${state.getCookieName()}=${state.getCookieValue()}`,\n }),\n // only add authorization header if we have a bearer token and are instructed to use it for AM APIs\n ...(state.getUseBearerTokenForAmApis() &&\n state.getBearerToken() && {\n Authorization: `Bearer ${state.getBearerToken()}`,\n }),\n };\n if (requestOverride['headers']) {\n headers = {\n ...headers,\n ...requestOverride['headers'],\n };\n }\n\n const requestDetails = {\n // baseURL: `${storage.session.getTenant()}/json${resource.path}`,\n timeout,\n ...requestOverride,\n headers: {\n ...headers,\n ...state.getAuthenticationHeaderOverrides(),\n },\n httpAgent: getHttpAgent(),\n httpsAgent: getHttpsAgent(),\n proxy: getProxy(),\n };\n\n const request = axios.create(requestDetails);\n\n // enable curlirizer output in debug mode\n if (state.getCurlirize()) {\n curlirize(request);\n }\n\n return request;\n}\n\n/**\n * Generates an IDM Axios API instance\n * @param {object} requestOverride Takes an object of AXIOS parameters that can be used to either add\n * on extra information or override default properties https://github.com/axios/axios#request-config\n *\n * @returns {AxiosInstance}\n */\nexport function generateIdmApi(requestOverride = {}) {\n const requestDetails = {\n // baseURL: getTenantURL(storage.session.getTenant()),\n timeout,\n headers: {\n 'User-Agent': userAgent,\n 'X-ForgeRock-TransactionId': transactionId,\n 'Content-Type': 'application/json',\n // only add authorization header if we have a bearer token\n ...(state.getBearerToken() && {\n Authorization: `Bearer ${state.getBearerToken()}`,\n }),\n },\n ...requestOverride,\n httpAgent: getHttpAgent(),\n httpsAgent: getHttpsAgent(),\n proxy: getProxy(),\n };\n\n // if (storage.session.getBearerToken()) {\n // requestDetails.headers[\n // 'Authorization'\n // ] = `Bearer ${storage.session.getBearerToken()}`;\n // }\n\n const request = axios.create(requestDetails);\n\n // enable curlirizer output in debug mode\n if (state.getCurlirize()) {\n curlirize(request);\n }\n\n return request;\n}\n\n/**\n * Generates a LogKeys API Axios instance\n * @param {object} requestOverride Takes an object of AXIOS parameters that can be used to either add\n * on extra information or override default properties https://github.com/axios/axios#request-config\n *\n * @returns {AxiosInstance}\n */\nexport function generateLogKeysApi(requestOverride = {}) {\n const headers = {\n 'User-Agent': userAgent,\n 'Content-Type': 'application/json',\n // only add authorization header if we have a bearer token\n ...(state.getBearerToken() && {\n Authorization: `Bearer ${state.getBearerToken()}`,\n }),\n };\n const requestDetails = {\n // baseURL: getTenantURL(storage.session.getTenant()),\n timeout,\n headers,\n ...requestOverride,\n httpAgent: getHttpAgent(),\n httpsAgent: getHttpsAgent(),\n proxy: getProxy(),\n };\n\n const request = axios.create(requestDetails);\n\n // enable curlirizer output in debug mode\n if (state.getCurlirize()) {\n curlirize(request);\n }\n\n return request;\n}\n\n/**\n * Generates a Log API Axios instance\n * @param {object} requestOverride Takes an object of AXIOS parameters that can be used to either add\n * on extra information or override default properties https://github.com/axios/axios#request-config\n *\n * @returns {AxiosInstance}\n */\nexport function generateLogApi(requestOverride = {}) {\n const headers = {\n 'User-Agent': userAgent,\n 'X-API-Key': state.getLogApiKey(),\n 'X-API-Secret': state.getLogApiSecret(),\n };\n const requestDetails = {\n // baseURL: getTenantURL(storage.session.getTenant()),\n timeout,\n headers,\n ...requestOverride,\n httpAgent: getHttpAgent(),\n httpsAgent: getHttpsAgent(),\n proxy: getProxy(),\n };\n\n const request = axios.create(requestDetails);\n\n // enable curlirizer output in debug mode\n if (state.getCurlirize()) {\n curlirize(request);\n }\n\n return request;\n}\n\n/**\n * Generates an ESV Axios API instance for Environment Secrets and Variables\n * @param {object} requestOverride Takes an object of AXIOS parameters that can be used to either add\n * on extra information or override default properties https://github.com/axios/axios#request-config\n *\n * @returns {AxiosInstance}\n */\nexport function generateESVApi(resource, requestOverride = {}) {\n const headers = {\n 'User-Agent': userAgent,\n 'Content-Type': 'application/json',\n // only add API version if we have it\n ...(resource.apiVersion && { 'Accept-API-Version': resource.apiVersion }),\n // only add authorization header if we have a bearer token\n ...(state.getBearerToken() && {\n Authorization: `Bearer ${state.getBearerToken()}`,\n }),\n };\n const requestDetails = {\n // baseURL: getTenantURL(storage.session.getTenant()),\n timeout,\n headers,\n ...requestOverride,\n httpAgent: getHttpAgent(),\n httpsAgent: getHttpsAgent(),\n proxy: getProxy(),\n };\n\n const request = axios.create(requestDetails);\n\n // enable curlirizer output in debug mode\n if (state.getCurlirize()) {\n curlirize(request);\n }\n\n return request;\n}\n\n/**\n * Generates a release (Github or Npm) Axios API instance\n * @param {object} requestOverride Takes an object of AXIOS parameters that can be used to either add\n * on extra information or override default properties https://github.com/axios/axios#request-config\n *\n * @returns {AxiosInstance}\n */\nexport function generateReleaseApi(baseUrl, requestOverride = {}) {\n const requestDetails = {\n baseURL: baseUrl,\n timeout,\n headers: {\n 'User-Agent': userAgent,\n 'Content-Type': 'application/json',\n },\n ...requestOverride,\n httpAgent: getHttpAgent(),\n httpsAgent: getHttpsAgent(),\n proxy: getProxy(),\n };\n\n const request = axios.create(requestDetails);\n\n // enable curlirizer output in debug mode\n if (state.getCurlirize()) {\n curlirize(request);\n }\n\n return request;\n}\n"]}
1
+ {"version":3,"sources":["../src/api/BaseApi.ts"],"names":[],"mappings":"AA6GA;;;;;;;GAOG;AACH,wBAAgB,aAAa,CAAC,QAAQ,KAAA,EAAE,eAAe,KAAK,iCA+C3D;AAED;;;;;;;GAOG;AACH,wBAAgB,iBAAiB,CAAC,QAAQ,KAAA,EAAE,eAAe,KAAK,iCA8C/D;AAED;;;;;;GAMG;AACH,wBAAgB,cAAc,CAAC,eAAe,KAAK,iCAiClD;AAED;;;;;;GAMG;AACH,wBAAgB,kBAAkB,CAAC,eAAe,KAAK,iCA2BtD;AAED;;;;;;GAMG;AACH,wBAAgB,cAAc,CAAC,eAAe,KAAK,iCAwBlD;AAED;;;;;;GAMG;AACH,wBAAgB,cAAc,CAAC,QAAQ,KAAA,EAAE,eAAe,KAAK,iCA6B5D;AAED;;;;;;GAMG;AACH,wBAAgB,kBAAkB,CAAC,OAAO,KAAA,EAAE,eAAe,KAAK,iCAsB/D","file":"BaseApi.d.ts","sourcesContent":["import axios, { AxiosProxyConfig } from 'axios';\nimport Agent from 'agentkeepalive';\nimport axiosRetry from 'axios-retry';\nimport HttpsProxyAgent from 'https-proxy-agent';\nimport url from 'url';\nimport fs from 'fs';\nimport * as state from '../shared/State';\nimport path from 'path';\nimport { fileURLToPath } from 'url';\nimport { curlirizeMessage, printMessage } from '../ops/utils/Console';\nimport _curlirize from '../ext/axios-curlirize/curlirize';\nimport { randomUUID } from 'crypto';\nimport { setupPollyForFrodoLib } from '../utils/SetupPollyForFrodoLib';\n\nif (process.env.FRODO_MOCK) {\n setupPollyForFrodoLib();\n}\n\nconst __dirname = path.dirname(fileURLToPath(import.meta.url));\n\nconst pkg = JSON.parse(\n fs.readFileSync(path.resolve(__dirname, '../../package.json'), 'utf8')\n);\n\naxiosRetry(axios, {\n retries: 3,\n shouldResetTimeout: true,\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n retryCondition: (_error) => true, // retry no matter what\n});\n\n// all agents\nconst timeout = 30000;\n\n// agentkeepalive\nconst maxSockets = 100;\nconst maxFreeSockets = 10;\nconst freeSocketTimeout = 30000;\n\nconst userAgent = `${pkg.name}/${pkg.version}`;\nconst transactionId = `frodo-${randomUUID()}`;\nlet httpAgent, httpsAgent;\n\nfunction getHttpAgent() {\n if (httpAgent) return httpAgent;\n httpAgent = new Agent({\n maxSockets,\n maxFreeSockets,\n timeout,\n freeSocketTimeout,\n });\n return httpAgent;\n}\n\n/**\n * Helper method to create properly configured httpsAgent\n * @returns {any} appropriate httpsAgent\n */\nfunction getHttpsAgent() {\n if (httpsAgent) return httpsAgent;\n const options = {\n rejectUnauthorized: !state.getAllowInsecureConnection(),\n };\n const httpsProxy = process.env.HTTPS_PROXY || process.env.https_proxy;\n if (httpsProxy) {\n // https://github.com/axios/axios/issues/3459\n console.error(`Using proxy ${httpsProxy}`['yellow']);\n const parsed = url.parse(httpsProxy);\n options['host'] = parsed.hostname;\n options['port'] = parsed.port;\n options['protocol'] = parsed.protocol;\n options.rejectUnauthorized = !state.getAllowInsecureConnection();\n httpsAgent = HttpsProxyAgent(options);\n return httpsAgent;\n }\n httpsAgent = new Agent.HttpsAgent({\n ...options,\n maxSockets,\n maxFreeSockets,\n timeout,\n freeSocketTimeout,\n });\n return httpsAgent;\n}\n\n/**\n * Get Proxy config\n * @returns {AxiosProxyConfig | false} axios proxy config or false\n */\nfunction getProxy(): AxiosProxyConfig | false {\n if (process.env.HTTPS_PROXY || process.env.https_proxy) return false;\n return null;\n}\n\n/**\n * Customize curlirize output\n * @param request axios request object\n */\nfunction curlirize(request) {\n _curlirize(request, (result, err) => {\n const { command } = result;\n if (err) {\n printMessage(err, 'error');\n } else {\n curlirizeMessage(command);\n }\n });\n}\n\n/**\n * Generates an AM Axios API instance\n * @param {object} resource Takes an object takes a resource object. example:\n * @param {object} requestOverride Takes an object of AXIOS parameters that can be used to either\n * add on extra information or override default properties https://github.com/axios/axios#request-config\n *\n * @returns {AxiosInstance}\n */\nexport function generateAmApi(resource, requestOverride = {}) {\n let headers = {\n 'User-Agent': userAgent,\n 'X-ForgeRock-TransactionId': transactionId,\n 'Content-Type': 'application/json',\n // only add API version if we have it\n ...(resource.apiVersion && { 'Accept-API-Version': resource.apiVersion }),\n // only send session cookie if we know its name and value and we are not instructed to use the bearer token for AM APIs\n ...(!state.getUseBearerTokenForAmApis() &&\n state.getCookieName() &&\n state.getCookieValue() && {\n Cookie: `${state.getCookieName()}=${state.getCookieValue()}`,\n }),\n // only add authorization header if we have a bearer token and are instructed to use it for AM APIs\n ...(state.getUseBearerTokenForAmApis() &&\n state.getBearerToken() && {\n Authorization: `Bearer ${state.getBearerToken()}`,\n }),\n };\n if (requestOverride['headers']) {\n headers = {\n ...headers,\n ...requestOverride['headers'],\n };\n }\n\n const requestDetails = {\n // baseURL: `${storage.session.getTenant()}/json`,\n timeout,\n ...requestOverride,\n headers: {\n ...headers,\n ...state.getAuthenticationHeaderOverrides(),\n },\n httpAgent: getHttpAgent(),\n httpsAgent: getHttpsAgent(),\n proxy: getProxy(),\n };\n\n const request = axios.create(requestDetails);\n\n // enable curlirizer output in debug mode\n if (state.getCurlirize()) {\n curlirize(request);\n }\n\n return request;\n}\n\n/**\n * Generates an OAuth2 Axios API instance\n * @param {object} resource Takes an object takes a resource object. example:\n * @param {object} requestOverride Takes an object of AXIOS parameters that can be used to either\n * add on extra information or override default properties https://github.com/axios/axios#request-config\n *\n * @returns {AxiosInstance}\n */\nexport function generateOauth2Api(resource, requestOverride = {}) {\n let headers = {\n 'User-Agent': userAgent,\n 'X-ForgeRock-TransactionId': transactionId,\n // only add API version if we have it\n ...(resource.apiVersion && { 'Accept-API-Version': resource.apiVersion }),\n // only send session cookie if we know its name and value and we are not instructed to use the bearer token for AM APIs\n ...(!state.getUseBearerTokenForAmApis() &&\n state.getCookieName() &&\n state.getCookieValue() && {\n Cookie: `${state.getCookieName()}=${state.getCookieValue()}`,\n }),\n // only add authorization header if we have a bearer token and are instructed to use it for AM APIs\n ...(state.getUseBearerTokenForAmApis() &&\n state.getBearerToken() && {\n Authorization: `Bearer ${state.getBearerToken()}`,\n }),\n };\n if (requestOverride['headers']) {\n headers = {\n ...headers,\n ...requestOverride['headers'],\n };\n }\n\n const requestDetails = {\n // baseURL: `${storage.session.getTenant()}/json${resource.path}`,\n timeout,\n ...requestOverride,\n headers: {\n ...headers,\n ...state.getAuthenticationHeaderOverrides(),\n },\n httpAgent: getHttpAgent(),\n httpsAgent: getHttpsAgent(),\n proxy: getProxy(),\n };\n\n const request = axios.create(requestDetails);\n\n // enable curlirizer output in debug mode\n if (state.getCurlirize()) {\n curlirize(request);\n }\n\n return request;\n}\n\n/**\n * Generates an IDM Axios API instance\n * @param {object} requestOverride Takes an object of AXIOS parameters that can be used to either add\n * on extra information or override default properties https://github.com/axios/axios#request-config\n *\n * @returns {AxiosInstance}\n */\nexport function generateIdmApi(requestOverride = {}) {\n const requestDetails = {\n // baseURL: getTenantURL(storage.session.getTenant()),\n timeout,\n headers: {\n 'User-Agent': userAgent,\n 'X-ForgeRock-TransactionId': transactionId,\n 'Content-Type': 'application/json',\n // only add authorization header if we have a bearer token\n ...(state.getBearerToken() && {\n Authorization: `Bearer ${state.getBearerToken()}`,\n }),\n },\n ...requestOverride,\n httpAgent: getHttpAgent(),\n httpsAgent: getHttpsAgent(),\n proxy: getProxy(),\n };\n\n // if (storage.session.getBearerToken()) {\n // requestDetails.headers[\n // 'Authorization'\n // ] = `Bearer ${storage.session.getBearerToken()}`;\n // }\n\n const request = axios.create(requestDetails);\n\n // enable curlirizer output in debug mode\n if (state.getCurlirize()) {\n curlirize(request);\n }\n\n return request;\n}\n\n/**\n * Generates a LogKeys API Axios instance\n * @param {object} requestOverride Takes an object of AXIOS parameters that can be used to either add\n * on extra information or override default properties https://github.com/axios/axios#request-config\n *\n * @returns {AxiosInstance}\n */\nexport function generateLogKeysApi(requestOverride = {}) {\n const headers = {\n 'User-Agent': userAgent,\n 'Content-Type': 'application/json',\n // only add authorization header if we have a bearer token\n ...(state.getBearerToken() && {\n Authorization: `Bearer ${state.getBearerToken()}`,\n }),\n };\n const requestDetails = {\n // baseURL: getTenantURL(storage.session.getTenant()),\n timeout,\n headers,\n ...requestOverride,\n httpAgent: getHttpAgent(),\n httpsAgent: getHttpsAgent(),\n proxy: getProxy(),\n };\n\n const request = axios.create(requestDetails);\n\n // enable curlirizer output in debug mode\n if (state.getCurlirize()) {\n curlirize(request);\n }\n\n return request;\n}\n\n/**\n * Generates a Log API Axios instance\n * @param {object} requestOverride Takes an object of AXIOS parameters that can be used to either add\n * on extra information or override default properties https://github.com/axios/axios#request-config\n *\n * @returns {AxiosInstance}\n */\nexport function generateLogApi(requestOverride = {}) {\n const headers = {\n 'User-Agent': userAgent,\n 'X-API-Key': state.getLogApiKey(),\n 'X-API-Secret': state.getLogApiSecret(),\n };\n const requestDetails = {\n // baseURL: getTenantURL(storage.session.getTenant()),\n timeout,\n headers,\n ...requestOverride,\n httpAgent: getHttpAgent(),\n httpsAgent: getHttpsAgent(),\n proxy: getProxy(),\n };\n\n const request = axios.create(requestDetails);\n\n // enable curlirizer output in debug mode\n if (state.getCurlirize()) {\n curlirize(request);\n }\n\n return request;\n}\n\n/**\n * Generates an Axios instance for the Identity Cloud Environment API\n * @param {object} requestOverride Takes an object of AXIOS parameters that can be used to either add\n * on extra information or override default properties https://github.com/axios/axios#request-config\n *\n * @returns {AxiosInstance}\n */\nexport function generateEnvApi(resource, requestOverride = {}) {\n const headers = {\n 'User-Agent': userAgent,\n 'Content-Type': 'application/json',\n // only add API version if we have it\n ...(resource.apiVersion && { 'Accept-API-Version': resource.apiVersion }),\n // only add authorization header if we have a bearer token\n ...(state.getBearerToken() && {\n Authorization: `Bearer ${state.getBearerToken()}`,\n }),\n };\n const requestDetails = {\n // baseURL: getTenantURL(storage.session.getTenant()),\n timeout,\n headers,\n ...requestOverride,\n httpAgent: getHttpAgent(),\n httpsAgent: getHttpsAgent(),\n proxy: getProxy(),\n };\n\n const request = axios.create(requestDetails);\n\n // enable curlirizer output in debug mode\n if (state.getCurlirize()) {\n curlirize(request);\n }\n\n return request;\n}\n\n/**\n * Generates a release (Github or Npm) Axios API instance\n * @param {object} requestOverride Takes an object of AXIOS parameters that can be used to either add\n * on extra information or override default properties https://github.com/axios/axios#request-config\n *\n * @returns {AxiosInstance}\n */\nexport function generateReleaseApi(baseUrl, requestOverride = {}) {\n const requestDetails = {\n baseURL: baseUrl,\n timeout,\n headers: {\n 'User-Agent': userAgent,\n 'Content-Type': 'application/json',\n },\n ...requestOverride,\n httpAgent: getHttpAgent(),\n httpsAgent: getHttpsAgent(),\n proxy: getProxy(),\n };\n\n const request = axios.create(requestDetails);\n\n // enable curlirizer output in debug mode\n if (state.getCurlirize()) {\n curlirize(request);\n }\n\n return request;\n}\n"]}
@@ -35,7 +35,7 @@ export declare function deleteConfigEntity(entityId: string): Promise<any>;
35
35
  * @param {string} pageCookie paged results cookie
36
36
  * @returns {Promise<{result: any[]; resultCount: number; pagedResultsCookie: any; totalPagedResultsPolicy: string; totalPagedResults: number; remainingPagedResults: number;}>} a promise that resolves to managed objects of the desired type
37
37
  */
38
- export declare function queryAllManagedObjectsByType(type: string, fields: string[], pageCookie: string): Promise<{
38
+ export declare function queryAllManagedObjectsByType(type: string, fields?: string[], pageCookie?: string): Promise<{
39
39
  result: unknown[];
40
40
  resultCount: number;
41
41
  pagedResultsCookie: string;
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/api/IdmConfigApi.ts"],"names":[],"mappings":"AAWA;;;GAGG;AACH,wBAAsB,oBAAoB,iBAOzC;AAED;;;;GAIG;AACH,wBAAsB,uBAAuB,CAAC,IAAI,KAAA,gBAQjD;AAED;;;;GAIG;AACH,wBAAsB,eAAe,CAAC,QAAQ,KAAA,gBAQ7C;AAED;;;;;GAKG;AACH,wBAAsB,eAAe,CACnC,QAAQ,EAAE,MAAM,EAChB,UAAU,EAAE,MAAM,GAAG,MAAM,gBAa5B;AAED;;;;GAIG;AACH,wBAAsB,kBAAkB,CAAC,QAAQ,EAAE,MAAM,gBAUxD;AAED;;;;;;GAMG;AACH,wBAAsB,4BAA4B,CAChD,IAAI,EAAE,MAAM,EACZ,MAAM,EAAE,MAAM,EAAE,EAChB,UAAU,EAAE,MAAM,GACjB,OAAO,CAAC;IACT,MAAM,EAAE,OAAO,EAAE,CAAC;IAClB,WAAW,EAAE,MAAM,CAAC;IACpB,kBAAkB,EAAE,MAAM,CAAC;IAC3B,uBAAuB,EAAE,MAAM,CAAC;IAChC,iBAAiB,EAAE,MAAM,CAAC;IAC1B,qBAAqB,EAAE,MAAM,CAAC;CAC/B,CAAC,CAeD","file":"IdmConfigApi.d.ts","sourcesContent":["import util from 'util';\nimport { generateIdmApi } from './BaseApi';\nimport { getTenantURL } from './utils/ApiUtils';\nimport * as state from '../shared/State';\n\nconst idmAllConfigURLTemplate = '%s/openidm/config';\nconst idmConfigURLTemplate = '%s/openidm/config/%s';\nconst idmConfigEntityQueryTemplate = '%s/openidm/config?_queryFilter=%s';\nconst idmManagedObjectURLTemplate =\n '%s/openidm/managed/%s?_queryFilter=true&_pageSize=10000';\n\n/**\n * Get all IDM config entities\n * @returns {Promise} a promise that resolves to all IDM config entities\n */\nexport async function getAllConfigEntities() {\n const urlString = util.format(\n idmAllConfigURLTemplate,\n getTenantURL(state.getHost())\n );\n const { data } = await generateIdmApi().get(urlString);\n return data;\n}\n\n/**\n * Get IDM config entities by type\n * @param {string} type the desired type of config entity\n * @returns {Promise} a promise that resolves to an object containing all IDM config entities of the desired type\n */\nexport async function getConfigEntitiesByType(type) {\n const urlString = util.format(\n idmConfigEntityQueryTemplate,\n getTenantURL(state.getHost()),\n encodeURIComponent(`_id sw '${type}'`)\n );\n const { data } = await generateIdmApi().get(urlString);\n return data;\n}\n\n/**\n * Get an IDM config entity\n * @param {string} entityId the desired config entity\n * @returns {Promise<unknown>} a promise that resolves to an IDM config entity\n */\nexport async function getConfigEntity(entityId) {\n const urlString = util.format(\n idmConfigURLTemplate,\n getTenantURL(state.getHost()),\n entityId\n );\n const { data } = await generateIdmApi().get(urlString);\n return data;\n}\n\n/**\n * Put IDM config entity\n * @param {string} entityId config entity id\n * @param {string} entityData config entity object\n * @returns {Promise<unknown>} a promise that resolves to an IDM config entity\n */\nexport async function putConfigEntity(\n entityId: string,\n entityData: string | object\n) {\n const urlString = util.format(\n idmConfigURLTemplate,\n getTenantURL(state.getHost()),\n entityId\n );\n try {\n const { data } = await generateIdmApi().put(urlString, entityData);\n return data;\n } catch (error) {\n throw Error(`Could not put config entity ${entityId}: ${error}`);\n }\n}\n\n/**\n * Delete IDM config entity\n * @param {string} entityId config entity id\n * @returns {Promise<unknown>} a promise that resolves to an IDM config entity\n */\nexport async function deleteConfigEntity(entityId: string) {\n const urlString = util.format(\n idmConfigURLTemplate,\n getTenantURL(state.getHost()),\n entityId\n );\n const { data } = await generateIdmApi().delete(urlString, {\n withCredentials: true,\n });\n return data;\n}\n\n/**\n * Query managed objects\n * @param {string} type managed object type\n * @param {string[]} fields fields to retrieve\n * @param {string} pageCookie paged results cookie\n * @returns {Promise<{result: any[]; resultCount: number; pagedResultsCookie: any; totalPagedResultsPolicy: string; totalPagedResults: number; remainingPagedResults: number;}>} a promise that resolves to managed objects of the desired type\n */\nexport async function queryAllManagedObjectsByType(\n type: string,\n fields: string[],\n pageCookie: string\n): Promise<{\n result: unknown[];\n resultCount: number;\n pagedResultsCookie: string;\n totalPagedResultsPolicy: string;\n totalPagedResults: number;\n remainingPagedResults: number;\n}> {\n const fieldsParam =\n fields.length > 0 ? `&_fields=${fields.join(',')}` : '&_fields=_id';\n const urlTemplate = pageCookie\n ? `${idmManagedObjectURLTemplate}${fieldsParam}&_pagedResultsCookie=${encodeURIComponent(\n pageCookie\n )}`\n : `${idmManagedObjectURLTemplate}${fieldsParam}`;\n const urlString = util.format(\n urlTemplate,\n getTenantURL(state.getHost()),\n type\n );\n const { data } = await generateIdmApi().get(urlString);\n return data;\n}\n"]}
1
+ {"version":3,"sources":["../src/api/IdmConfigApi.ts"],"names":[],"mappings":"AAWA;;;GAGG;AACH,wBAAsB,oBAAoB,iBAOzC;AAED;;;;GAIG;AACH,wBAAsB,uBAAuB,CAAC,IAAI,KAAA,gBAQjD;AAED;;;;GAIG;AACH,wBAAsB,eAAe,CAAC,QAAQ,KAAA,gBAQ7C;AAED;;;;;GAKG;AACH,wBAAsB,eAAe,CACnC,QAAQ,EAAE,MAAM,EAChB,UAAU,EAAE,MAAM,GAAG,MAAM,gBAa5B;AAED;;;;GAIG;AACH,wBAAsB,kBAAkB,CAAC,QAAQ,EAAE,MAAM,gBAUxD;AAED;;;;;;GAMG;AACH,wBAAsB,4BAA4B,CAChD,IAAI,EAAE,MAAM,EACZ,MAAM,GAAE,MAAM,EAAO,EACrB,UAAU,GAAE,MAAkB,GAC7B,OAAO,CAAC;IACT,MAAM,EAAE,OAAO,EAAE,CAAC;IAClB,WAAW,EAAE,MAAM,CAAC;IACpB,kBAAkB,EAAE,MAAM,CAAC;IAC3B,uBAAuB,EAAE,MAAM,CAAC;IAChC,iBAAiB,EAAE,MAAM,CAAC;IAC1B,qBAAqB,EAAE,MAAM,CAAC;CAC/B,CAAC,CAeD","file":"IdmConfigApi.d.ts","sourcesContent":["import util from 'util';\nimport { generateIdmApi } from './BaseApi';\nimport { getTenantURL } from './utils/ApiUtils';\nimport * as state from '../shared/State';\n\nconst idmAllConfigURLTemplate = '%s/openidm/config';\nconst idmConfigURLTemplate = '%s/openidm/config/%s';\nconst idmConfigEntityQueryTemplate = '%s/openidm/config?_queryFilter=%s';\nconst idmManagedObjectURLTemplate =\n '%s/openidm/managed/%s?_queryFilter=true&_pageSize=10000';\n\n/**\n * Get all IDM config entities\n * @returns {Promise} a promise that resolves to all IDM config entities\n */\nexport async function getAllConfigEntities() {\n const urlString = util.format(\n idmAllConfigURLTemplate,\n getTenantURL(state.getHost())\n );\n const { data } = await generateIdmApi().get(urlString);\n return data;\n}\n\n/**\n * Get IDM config entities by type\n * @param {string} type the desired type of config entity\n * @returns {Promise} a promise that resolves to an object containing all IDM config entities of the desired type\n */\nexport async function getConfigEntitiesByType(type) {\n const urlString = util.format(\n idmConfigEntityQueryTemplate,\n getTenantURL(state.getHost()),\n encodeURIComponent(`_id sw '${type}'`)\n );\n const { data } = await generateIdmApi().get(urlString);\n return data;\n}\n\n/**\n * Get an IDM config entity\n * @param {string} entityId the desired config entity\n * @returns {Promise<unknown>} a promise that resolves to an IDM config entity\n */\nexport async function getConfigEntity(entityId) {\n const urlString = util.format(\n idmConfigURLTemplate,\n getTenantURL(state.getHost()),\n entityId\n );\n const { data } = await generateIdmApi().get(urlString);\n return data;\n}\n\n/**\n * Put IDM config entity\n * @param {string} entityId config entity id\n * @param {string} entityData config entity object\n * @returns {Promise<unknown>} a promise that resolves to an IDM config entity\n */\nexport async function putConfigEntity(\n entityId: string,\n entityData: string | object\n) {\n const urlString = util.format(\n idmConfigURLTemplate,\n getTenantURL(state.getHost()),\n entityId\n );\n try {\n const { data } = await generateIdmApi().put(urlString, entityData);\n return data;\n } catch (error) {\n throw Error(`Could not put config entity ${entityId}: ${error}`);\n }\n}\n\n/**\n * Delete IDM config entity\n * @param {string} entityId config entity id\n * @returns {Promise<unknown>} a promise that resolves to an IDM config entity\n */\nexport async function deleteConfigEntity(entityId: string) {\n const urlString = util.format(\n idmConfigURLTemplate,\n getTenantURL(state.getHost()),\n entityId\n );\n const { data } = await generateIdmApi().delete(urlString, {\n withCredentials: true,\n });\n return data;\n}\n\n/**\n * Query managed objects\n * @param {string} type managed object type\n * @param {string[]} fields fields to retrieve\n * @param {string} pageCookie paged results cookie\n * @returns {Promise<{result: any[]; resultCount: number; pagedResultsCookie: any; totalPagedResultsPolicy: string; totalPagedResults: number; remainingPagedResults: number;}>} a promise that resolves to managed objects of the desired type\n */\nexport async function queryAllManagedObjectsByType(\n type: string,\n fields: string[] = [],\n pageCookie: string = undefined\n): Promise<{\n result: unknown[];\n resultCount: number;\n pagedResultsCookie: string;\n totalPagedResultsPolicy: string;\n totalPagedResults: number;\n remainingPagedResults: number;\n}> {\n const fieldsParam =\n fields.length > 0 ? `&_fields=${fields.join(',')}` : '&_fields=_id';\n const urlTemplate = pageCookie\n ? `${idmManagedObjectURLTemplate}${fieldsParam}&_pagedResultsCookie=${encodeURIComponent(\n pageCookie\n )}`\n : `${idmManagedObjectURLTemplate}${fieldsParam}`;\n const urlString = util.format(\n urlTemplate,\n getTenantURL(state.getHost()),\n type\n );\n const { data } = await generateIdmApi().get(urlString);\n return data;\n}\n"]}
@@ -2,9 +2,9 @@
2
2
  * Get server info
3
3
  * @returns {Promise} a promise that resolves to an object containing a server info object
4
4
  */
5
- export declare function getServerInfo(): Promise<import("axios").AxiosResponse<any, any>>;
5
+ export declare function getServerInfo(): Promise<any>;
6
6
  /**
7
7
  * Get server version info
8
8
  * @returns {Promise} a promise that resolves to an object containing a server version info object
9
9
  */
10
- export declare function getServerVersionInfo(): Promise<import("axios").AxiosResponse<any, any>>;
10
+ export declare function getServerVersionInfo(): Promise<any>;
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/api/ServerInfoApi.ts"],"names":[],"mappings":"AAgBA;;;GAGG;AACH,wBAAsB,aAAa,qDAGlC;AAED;;;GAGG;AACH,wBAAsB,oBAAoB,qDAOzC","file":"ServerInfoApi.d.ts","sourcesContent":["import util from 'util';\nimport { generateAmApi } from './BaseApi';\nimport * as state from '../shared/State';\n\nconst serverInfoUrlTemplate = '%s/json/serverinfo/%s';\n\nconst serverInfoApiVersion = 'resource=1.1';\nconst getServerInfoApiConfig = () => ({\n apiVersion: serverInfoApiVersion,\n});\n\nconst serverVersionoApiVersion = 'resource=1.0';\nconst getServerVersionApiConfig = () => ({\n apiVersion: serverVersionoApiVersion,\n});\n\n/**\n * Get server info\n * @returns {Promise} a promise that resolves to an object containing a server info object\n */\nexport async function getServerInfo() {\n const urlString = util.format(serverInfoUrlTemplate, state.getHost(), '*');\n return generateAmApi(getServerInfoApiConfig()).get(urlString, {});\n}\n\n/**\n * Get server version info\n * @returns {Promise} a promise that resolves to an object containing a server version info object\n */\nexport async function getServerVersionInfo() {\n const urlString = util.format(\n serverInfoUrlTemplate,\n state.getHost(),\n 'version'\n );\n return generateAmApi(getServerVersionApiConfig()).get(urlString, {});\n}\n"]}
1
+ {"version":3,"sources":["../src/api/ServerInfoApi.ts"],"names":[],"mappings":"AAgBA;;;GAGG;AACH,wBAAsB,aAAa,iBAOlC;AAED;;;GAGG;AACH,wBAAsB,oBAAoB,iBAWzC","file":"ServerInfoApi.d.ts","sourcesContent":["import util from 'util';\nimport { generateAmApi } from './BaseApi';\nimport * as state from '../shared/State';\n\nconst serverInfoUrlTemplate = '%s/json/serverinfo/%s';\n\nconst serverInfoApiVersion = 'resource=1.1';\nconst getServerInfoApiConfig = () => ({\n apiVersion: serverInfoApiVersion,\n});\n\nconst serverVersionoApiVersion = 'resource=1.0';\nconst getServerVersionApiConfig = () => ({\n apiVersion: serverVersionoApiVersion,\n});\n\n/**\n * Get server info\n * @returns {Promise} a promise that resolves to an object containing a server info object\n */\nexport async function getServerInfo() {\n const urlString = util.format(serverInfoUrlTemplate, state.getHost(), '*');\n const { data } = await generateAmApi(getServerInfoApiConfig()).get(\n urlString,\n {}\n );\n return data;\n}\n\n/**\n * Get server version info\n * @returns {Promise} a promise that resolves to an object containing a server version info object\n */\nexport async function getServerVersionInfo() {\n const urlString = util.format(\n serverInfoUrlTemplate,\n state.getHost(),\n 'version'\n );\n const { data } = await generateAmApi(getServerVersionApiConfig()).get(\n urlString,\n {}\n );\n return data;\n}\n"]}
@@ -0,0 +1,18 @@
1
+ export interface EnvInfoInterface {
2
+ immutable: boolean;
3
+ locked: boolean;
4
+ region: string;
5
+ tier: string;
6
+ warning_message_html: string;
7
+ message_box_title: string;
8
+ message_box_html: string;
9
+ message_variant: string;
10
+ config_promotion_done: boolean;
11
+ placeholder_management: 'CUSTOMER' | 'SRE';
12
+ placeholder_management_migration_date: string;
13
+ }
14
+ /**
15
+ * Get info about the environment
16
+ * @returns {Promise<EnvInfoInterface>} a promise that resolves to an environment info object
17
+ */
18
+ export declare function getEnvInfo(): Promise<EnvInfoInterface>;
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/api/cloud/EnvInfoApi.ts"],"names":[],"mappings":"AAaA,MAAM,WAAW,gBAAgB;IAC/B,SAAS,EAAE,OAAO,CAAC;IACnB,MAAM,EAAE,OAAO,CAAC;IAChB,MAAM,EAAE,MAAM,CAAC;IACf,IAAI,EAAE,MAAM,CAAC;IACb,oBAAoB,EAAE,MAAM,CAAC;IAC7B,iBAAiB,EAAE,MAAM,CAAC;IAC1B,gBAAgB,EAAE,MAAM,CAAC;IACzB,eAAe,EAAE,MAAM,CAAC;IACxB,qBAAqB,EAAE,OAAO,CAAC;IAC/B,sBAAsB,EAAE,UAAU,GAAG,KAAK,CAAC;IAC3C,qCAAqC,EAAE,MAAM,CAAC;CAC/C;AAED;;;GAGG;AACH,wBAAsB,UAAU,IAAI,OAAO,CAAC,gBAAgB,CAAC,CAS5D","file":"EnvInfoApi.d.ts","sourcesContent":["import util from 'util';\nimport { getTenantURL } from '../utils/ApiUtils';\nimport { generateAmApi } from '../BaseApi';\nimport * as state from '../../shared/State';\n\nconst envInfoURLTemplate = '%s/environment/info';\n\nconst apiVersion = 'protocol=1.0,resource=1.0';\nconst getApiConfig = () => ({\n path: `/environment/info`,\n apiVersion,\n});\n\nexport interface EnvInfoInterface {\n immutable: boolean;\n locked: boolean;\n region: string;\n tier: string;\n warning_message_html: string;\n message_box_title: string;\n message_box_html: string;\n message_variant: string;\n config_promotion_done: boolean;\n placeholder_management: 'CUSTOMER' | 'SRE';\n placeholder_management_migration_date: string;\n}\n\n/**\n * Get info about the environment\n * @returns {Promise<EnvInfoInterface>} a promise that resolves to an environment info object\n */\nexport async function getEnvInfo(): Promise<EnvInfoInterface> {\n const urlString = util.format(\n envInfoURLTemplate,\n getTenantURL(state.getHost())\n );\n const { data } = await generateAmApi(getApiConfig()).get(urlString, {\n withCredentials: true,\n });\n return data as EnvInfoInterface;\n}\n"]}
@@ -0,0 +1,12 @@
1
+ import { ObjectSkeletonInterface } from '../../api/ApiTypes';
2
+ export interface FeatureInterface extends ObjectSkeletonInterface {
3
+ installedVersion: string;
4
+ availableVersions: string[];
5
+ }
6
+ /**
7
+ * Get all features
8
+ * @returns {Promise<{ result: FeatureInterface[]; }>} a promise that resolves to an object containing an array of feature objects
9
+ */
10
+ export declare function getFeatures(): Promise<{
11
+ result: FeatureInterface[];
12
+ }>;
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/api/cloud/FeatureApi.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,uBAAuB,EAAE,MAAM,oBAAoB,CAAC;AAQ7D,MAAM,WAAW,gBAAiB,SAAQ,uBAAuB;IAC/D,gBAAgB,EAAE,MAAM,CAAC;IACzB,iBAAiB,EAAE,MAAM,EAAE,CAAC;CAC7B;AAED;;;GAGG;AACH,wBAAsB,WAAW,IAAI,OAAO,CAAC;IAC3C,MAAM,EAAE,gBAAgB,EAAE,CAAC;CAC5B,CAAC,CASD","file":"FeatureApi.d.ts","sourcesContent":["import util from 'util';\nimport { getTenantURL } from '../utils/ApiUtils';\nimport { generateAmApi } from '../BaseApi';\nimport * as state from '../../shared/State';\nimport { ObjectSkeletonInterface } from '../../api/ApiTypes';\n\nconst envInfoURLTemplate = '%s/feature?_queryFilter=true';\n\nconst getApiConfig = () => ({\n path: `/feature`,\n});\n\nexport interface FeatureInterface extends ObjectSkeletonInterface {\n installedVersion: string;\n availableVersions: string[];\n}\n\n/**\n * Get all features\n * @returns {Promise<{ result: FeatureInterface[]; }>} a promise that resolves to an object containing an array of feature objects\n */\nexport async function getFeatures(): Promise<{\n result: FeatureInterface[];\n}> {\n const urlString = util.format(\n envInfoURLTemplate,\n getTenantURL(state.getHost())\n );\n const { data } = await generateAmApi(getApiConfig()).get(urlString, {\n withCredentials: true,\n });\n return data;\n}\n"]}
File without changes
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/api/cloud/LogApi.ts"],"names":[],"mappings":"AAYA,wBAAsB,IAAI,CAAC,MAAM,KAAA,EAAE,MAAM,KAAA,oDAUxC;AAED,wBAAsB,UAAU,qDAM/B;AAED,wBAAsB,UAAU,qDAM/B;AAED,wBAAsB,qBAAqB,CAAC,OAAO,KAAA,oDAMlD;AAED,wBAAsB,KAAK,CAAC,MAAM,KAAA,EAAE,OAAO,KAAA,EAAE,KAAK,KAAA,EAAE,MAAM,KAAA,oDAYzD","file":"LogApi.d.ts","sourcesContent":["import util from 'util';\nimport { generateLogApi, generateLogKeysApi } from '../BaseApi';\nimport { getTenantURL } from '../utils/ApiUtils';\nimport * as state from '../../shared/State';\n\nconst logsTailURLTemplate = '%s/monitoring/logs/tail?source=%s';\nconst logsFetchURLTemplate =\n '%s/monitoring/logs?source=%s&beginTime=%s&endTime=%s';\nconst logsSourcesURLTemplate = '%s/monitoring/logs/sources';\nconst logsCreateAPIKeyAndSecretURLTemplate = '%s/keys?_action=create';\nconst logsGetAPIKeysURLTemplate = '%s/keys';\n\nexport async function tail(source, cookie) {\n let urlString = util.format(\n logsTailURLTemplate,\n getTenantURL(state.getHost()),\n encodeURIComponent(source)\n );\n if (cookie) {\n urlString += `&_pagedResultsCookie=${encodeURIComponent(cookie)}`;\n }\n return generateLogApi().get(urlString);\n}\n\nexport async function getAPIKeys() {\n const urlString = util.format(\n logsGetAPIKeysURLTemplate,\n getTenantURL(state.getHost())\n );\n return generateLogKeysApi().get(urlString);\n}\n\nexport async function getSources() {\n const urlString = util.format(\n logsSourcesURLTemplate,\n getTenantURL(state.getHost())\n );\n return generateLogApi().get(urlString);\n}\n\nexport async function createAPIKeyAndSecret(keyName) {\n const urlString = util.format(\n logsCreateAPIKeyAndSecretURLTemplate,\n getTenantURL(state.getHost())\n );\n return generateLogKeysApi().post(urlString, { name: keyName });\n}\n\nexport async function fetch(source, startTs, endTs, cookie) {\n let urlString = util.format(\n logsFetchURLTemplate,\n getTenantURL(state.getHost()),\n encodeURIComponent(source),\n startTs,\n endTs\n );\n if (cookie) {\n urlString += `&_pagedResultsCookie=${encodeURIComponent(cookie)}`;\n }\n return generateLogApi({ timeout: 60000 }).get(urlString);\n}\n"]}
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/api/cloud/SecretsApi.ts"],"names":[],"mappings":"AAoBA;;;GAGG;AACH,wBAAsB,UAAU,iBAS/B;AAED;;;;GAIG;AACH,wBAAsB,SAAS,CAAC,QAAQ,KAAA,gBAUvC;AAED;;;;;;;;GAQG;AACH,wBAAsB,SAAS,CAC7B,QAAQ,KAAA,EACR,KAAK,KAAA,EACL,WAAW,KAAA,EACX,QAAQ,SAAY,EACpB,iBAAiB,UAAO,gBAuBzB;AAED;;;;;GAKG;AACH,wBAAsB,oBAAoB,CAAC,QAAQ,KAAA,EAAE,WAAW,KAAA,gBAY/D;AAED;;;;GAIG;AACH,wBAAsB,YAAY,CAAC,QAAQ,KAAA,gBAU1C;AAED;;;;GAIG;AACH,wBAAsB,iBAAiB,CAAC,QAAQ,KAAA,gBAU/C;AAED;;;;;GAKG;AACH,wBAAsB,wBAAwB,CAAC,QAAQ,KAAA,EAAE,KAAK,KAAA,gBAY7D;AAED;;;;;GAKG;AACH,wBAAsB,kBAAkB,CAAC,QAAQ,KAAA,EAAE,OAAO,KAAA,gBAWzD;AAED,oBAAY,qBAAqB;IAC/B,QAAQ,aAAa;IACrB,OAAO,YAAY;CACpB;AAED;;;;;;GAMG;AACH,wBAAsB,0BAA0B,CAC9C,QAAQ,EAAE,MAAM,EAChB,OAAO,EAAE,MAAM,EACf,MAAM,EAAE,qBAAqB,gBAc9B;AAED;;;;;GAKG;AACH,wBAAsB,qBAAqB,CAAC,QAAQ,KAAA,EAAE,OAAO,KAAA,gBAW5D","file":"SecretsApi.d.ts","sourcesContent":["import util from 'util';\nimport { encode } from '../utils/Base64';\nimport { getTenantURL } from '../utils/ApiUtils';\nimport { generateEnvApi } from '../BaseApi';\nimport * as state from '../../shared/State';\n\nconst secretsListURLTemplate = '%s/environment/secrets';\nconst secretListVersionsURLTemplate = '%s/environment/secrets/%s/versions';\nconst secretCreateNewVersionURLTemplate = `${secretListVersionsURLTemplate}?_action=create`;\nconst secretGetVersionURLTemplate = `${secretListVersionsURLTemplate}/%s`;\nconst secretVersionStatusURLTemplate = `${secretGetVersionURLTemplate}?_action=changestatus`;\nconst secretURLTemplate = '%s/environment/secrets/%s';\nconst secretSetDescriptionURLTemplate = `${secretURLTemplate}?_action=setDescription`;\n\nconst apiVersion = 'protocol=1.0,resource=1.0';\nconst getApiConfig = () => ({\n path: `/environment/secrets`,\n apiVersion,\n});\n\n/**\n * Get all secrets\n * @returns {Promise<unknown[]>} a promise that resolves to an array of secrets\n */\nexport async function getSecrets() {\n const urlString = util.format(\n secretsListURLTemplate,\n getTenantURL(state.getHost())\n );\n const { data } = await generateEnvApi(getApiConfig()).get(urlString, {\n withCredentials: true,\n });\n return data;\n}\n\n/**\n * Get secret\n * @param secretId secret id/name\n * @returns {Promise<unknown>} a promise that resolves to a secret\n */\nexport async function getSecret(secretId) {\n const urlString = util.format(\n secretURLTemplate,\n getTenantURL(state.getHost()),\n secretId\n );\n const { data } = await generateEnvApi(getApiConfig()).get(urlString, {\n withCredentials: true,\n });\n return data;\n}\n\n/**\n * Create secret\n * @param {string} secretId secret id/name\n * @param {string} value secret value\n * @param {string} description secret description\n * @param {string} encoding secret encoding (only `generic` is supported)\n * @param {boolean} useInPlaceholders flag indicating if the secret can be used in placeholders\n * @returns {Promise<unknown>} a promise that resolves to a secret\n */\nexport async function putSecret(\n secretId,\n value,\n description,\n encoding = 'generic',\n useInPlaceholders = true\n) {\n if (encoding !== 'generic')\n throw new Error(`Unsupported encoding: ${encoding}`);\n const secretData = {\n valueBase64: encode(value),\n description,\n encoding,\n useInPlaceholders,\n };\n const urlString = util.format(\n secretURLTemplate,\n getTenantURL(state.getHost()),\n secretId\n );\n const { data } = await generateEnvApi(getApiConfig()).put(\n urlString,\n secretData,\n {\n withCredentials: true,\n }\n );\n return data;\n}\n\n/**\n * Set secret description\n * @param {string} secretId secret id/name\n * @param {string} description secret description\n * @returns {Promise<unknown>} a promise that resolves to a status object\n */\nexport async function setSecretDescription(secretId, description) {\n const urlString = util.format(\n secretSetDescriptionURLTemplate,\n getTenantURL(state.getHost()),\n secretId\n );\n const { data } = await generateEnvApi(getApiConfig()).post(\n urlString,\n { description },\n { withCredentials: true }\n );\n return data;\n}\n\n/**\n * Delete secret\n * @param {string} secretId secret id/name\n * @returns {Promise<unknown>} a promise that resolves to a secret object\n */\nexport async function deleteSecret(secretId) {\n const urlString = util.format(\n secretURLTemplate,\n getTenantURL(state.getHost()),\n secretId\n );\n const { data } = await generateEnvApi(getApiConfig()).delete(urlString, {\n withCredentials: true,\n });\n return data;\n}\n\n/**\n * Get secret versions\n * @param {string} secretId secret id/name\n * @returns {Promise<unknown>} a promise that resolves to an array of secret versions\n */\nexport async function getSecretVersions(secretId) {\n const urlString = util.format(\n secretListVersionsURLTemplate,\n getTenantURL(state.getHost()),\n secretId\n );\n const { data } = await generateEnvApi(getApiConfig()).get(urlString, {\n withCredentials: true,\n });\n return data;\n}\n\n/**\n * Create new secret version\n * @param {string} secretId secret id/name\n * @param {string} value secret value\n * @returns {Promise<unknown>} a promise that resolves to a version object\n */\nexport async function createNewVersionOfSecret(secretId, value) {\n const urlString = util.format(\n secretCreateNewVersionURLTemplate,\n getTenantURL(state.getHost()),\n secretId\n );\n const { data } = await generateEnvApi(getApiConfig()).post(\n urlString,\n { valueBase64: encode(value) },\n { withCredentials: true }\n );\n return data;\n}\n\n/**\n * Get version of secret\n * @param {string} secretId secret id/name\n * @param {string} version secret version\n * @returns {Promise<unknown>} a promise that resolves to a version object\n */\nexport async function getVersionOfSecret(secretId, version) {\n const urlString = util.format(\n secretGetVersionURLTemplate,\n getTenantURL(state.getHost()),\n secretId,\n version\n );\n const { data } = await generateEnvApi(getApiConfig()).get(urlString, {\n withCredentials: true,\n });\n return data;\n}\n\nexport enum VersionOfSecretStatus {\n DISABLED = 'DISABLED',\n ENABLED = 'ENABLED',\n}\n\n/**\n * Update the status of a version of a secret\n * @param {string} secretId secret id/name\n * @param {string} version secret version\n * @param {VersionOfSecretStatus} status status\n * @returns {Promise<unknown>} a promise that resolves to a status object\n */\nexport async function setStatusOfVersionOfSecret(\n secretId: string,\n version: string,\n status: VersionOfSecretStatus\n) {\n const urlString = util.format(\n secretVersionStatusURLTemplate,\n getTenantURL(state.getHost()),\n secretId,\n version\n );\n const { data } = await generateEnvApi(getApiConfig()).post(\n urlString,\n { status },\n { withCredentials: true }\n );\n return data;\n}\n\n/**\n * Delete version of secret\n * @param {string} secretId secret id/name\n * @param {string} version secret version\n * @returns {Promise<unknown>} a promise that resolves to a version object\n */\nexport async function deleteVersionOfSecret(secretId, version) {\n const urlString = util.format(\n secretGetVersionURLTemplate,\n getTenantURL(state.getHost()),\n secretId,\n version\n );\n const { data } = await generateEnvApi(getApiConfig()).delete(urlString, {\n withCredentials: true,\n });\n return data;\n}\n"]}
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/api/cloud/StartupApi.ts"],"names":[],"mappings":"AAcA,oBAAY,aAAa;IACvB,UAAU,eAAe;IACzB,KAAK,UAAU;CAChB;AAED;;;GAGG;AACH,wBAAsB,SAAS,IAAI,OAAO,CAAC,aAAa,CAAC,CASxD;AAED;;;GAGG;AACH,wBAAsB,eAAe,IAAI,OAAO,CAAC,aAAa,CAAC,CAiB9D","file":"StartupApi.d.ts","sourcesContent":["import util from 'util';\nimport { getTenantURL } from '../utils/ApiUtils';\nimport { generateEnvApi } from '../BaseApi';\nimport * as state from '../../shared/State';\n\nconst startupURLTemplate = '%s/environment/startup';\nconst startupInitiateRestartURLTemplate = `${startupURLTemplate}?_action=restart`;\n\nconst apiVersion = 'protocol=1.0,resource=1.0';\nconst getApiConfig = () => ({\n path: `/environment/startup`,\n apiVersion,\n});\n\nexport enum RestartStatus {\n restarting = 'restarting',\n ready = 'ready',\n}\n\n/**\n * Get status\n * @returns {Promise<RestartStatus>} a promise that resolves to a string indicating status\n */\nexport async function getStatus(): Promise<RestartStatus> {\n const urlString = util.format(\n startupURLTemplate,\n getTenantURL(state.getHost())\n );\n const { data } = await generateEnvApi(getApiConfig()).get(urlString, {\n withCredentials: true,\n });\n return data.restartStatus;\n}\n\n/**\n * Initiate restart\n * @returns {Promise<string>} a promise that resolves to a string indicating status\n */\nexport async function initiateRestart(): Promise<RestartStatus> {\n const restartStatus = await getStatus();\n if (restartStatus === RestartStatus.ready) {\n const urlString = util.format(\n startupInitiateRestartURLTemplate,\n getTenantURL(state.getHost())\n );\n const { data } = await generateEnvApi(getApiConfig()).post(\n urlString,\n null,\n {\n withCredentials: true,\n }\n );\n return data.restartStatus;\n }\n throw new Error(`Not ready! Current status: ${restartStatus}`);\n}\n"]}
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/api/cloud/VariablesApi.ts"],"names":[],"mappings":"AAmBA;;;GAGG;AACH,wBAAsB,YAAY,iBASjC;AAED;;;;GAIG;AACH,wBAAsB,WAAW,CAAC,UAAU,KAAA,gBAU3C;AAED;;;;;;GAMG;AACH,wBAAsB,WAAW,CAAC,UAAU,KAAA,EAAE,KAAK,KAAA,EAAE,WAAW,KAAA,gBAiB/D;AAED;;;;;GAKG;AACH,wBAAsB,sBAAsB,CAAC,UAAU,KAAA,EAAE,WAAW,KAAA,gBAYnE;AAED;;;;GAIG;AACH,wBAAsB,cAAc,CAAC,UAAU,KAAA,gBAU9C","file":"VariablesApi.d.ts","sourcesContent":["import util from 'util';\nimport { encode } from '../utils/Base64';\nimport { getTenantURL, getCurrentRealmPath } from '../utils/ApiUtils';\nimport { generateEnvApi } from '../BaseApi';\nimport * as state from '../../shared/State';\n\nconst variablesListURLTemplate = '%s/environment/variables';\nconst variableURLTemplate = '%s/environment/variables/%s';\nconst variableSetDescriptionURLTemplate = `${variableURLTemplate}?_action=setDescription`;\n\nconst apiVersion = 'protocol=1.0,resource=1.0';\nconst getApiConfig = () => {\n const configPath = getCurrentRealmPath();\n return {\n path: `${configPath}/environment/secrets`,\n apiVersion,\n };\n};\n\n/**\n * Get all variables\n * @returns {Promise<unknown[]>} a promise that resolves to an array of variable objects\n */\nexport async function getVariables() {\n const urlString = util.format(\n variablesListURLTemplate,\n getTenantURL(state.getHost())\n );\n const { data } = await generateEnvApi(getApiConfig()).get(urlString, {\n withCredentials: true,\n });\n return data;\n}\n\n/**\n * Get variable by id/name\n * @param {string} variableId variable id/name\n * @returns {Promise<unknown>} a promise that resolves to a variable object\n */\nexport async function getVariable(variableId) {\n const urlString = util.format(\n variableURLTemplate,\n getTenantURL(state.getHost()),\n variableId\n );\n const { data } = await generateEnvApi(getApiConfig()).get(urlString, {\n withCredentials: true,\n });\n return data;\n}\n\n/**\n * Put variable by id/name\n * @param {string} variableId variable id/name\n * @param {string} value variable value\n * @param {string} description variable description\n * @returns {Promise<unknown>} a promise that resolves to a variable object\n */\nexport async function putVariable(variableId, value, description) {\n const variableData = {};\n if (value) variableData['valueBase64'] = encode(value);\n if (description) variableData['description'] = description;\n const urlString = util.format(\n variableURLTemplate,\n getTenantURL(state.getHost()),\n variableId\n );\n const { data } = await generateEnvApi(getApiConfig()).put(\n urlString,\n variableData,\n {\n withCredentials: true,\n }\n );\n return data;\n}\n\n/**\n * Set variable description\n * @param {string} variableId variable id/name\n * @param {string} description variable description\n * @returns {Promise<unknown>} a promise that resolves to a status object\n */\nexport async function setVariableDescription(variableId, description) {\n const urlString = util.format(\n variableSetDescriptionURLTemplate,\n getTenantURL(state.getHost()),\n variableId\n );\n const { data } = await generateEnvApi(getApiConfig()).post(\n urlString,\n { description },\n { withCredentials: true }\n );\n return data;\n}\n\n/**\n * Delete variable by id/name\n * @param {string} variableId variable id/name\n * @returns {Promise<unknown>} a promise that resolves to a variable object\n */\nexport async function deleteVariable(variableId) {\n const urlString = util.format(\n variableURLTemplate,\n getTenantURL(state.getHost()),\n variableId\n );\n const { data } = await generateEnvApi(getApiConfig()).delete(urlString, {\n withCredentials: true,\n });\n return data;\n}\n"]}
package/types/index.d.ts CHANGED
@@ -2,12 +2,12 @@ export * as AgentRaw from './api/AgentApi';
2
2
  export * as AuthenticateRaw from './api/AuthenticateApi';
3
3
  export * as NodeRaw from './api/NodeApi';
4
4
  export * as OAuth2OIDCApi from './api/OAuth2OIDCApi';
5
- export * as SecretsRaw from './api/SecretsApi';
5
+ export * as SecretsRaw from './api/cloud/SecretsApi';
6
6
  export * as SocialIdentityProvidersRaw from './api/SocialIdentityProvidersApi';
7
- export * as StartupRaw from './api/StartupApi';
7
+ export * as StartupRaw from './api/cloud/StartupApi';
8
8
  export * as TreeRaw from './api/TreeApi';
9
9
  export * as TypesRaw from './api/ApiTypes';
10
- export * as VariablesRaw from './api/VariablesApi';
10
+ export * as VariablesRaw from './api/cloud/VariablesApi';
11
11
  export * as IdmConfigRaw from './api/IdmConfigApi';
12
12
  export * as Admin from './ops/AdminOps';
13
13
  export * as Agent from './ops/AgentOps';
@@ -17,9 +17,10 @@ export * as ConnectionProfile from './ops/ConnectionProfileOps';
17
17
  export * as EmailTemplate from './ops/EmailTemplateOps';
18
18
  export * as Idp from './ops/IdpOps';
19
19
  export * as Idm from './ops/IdmOps';
20
+ export * as Info from './ops/InfoOps';
20
21
  export * as Journey from './ops/JourneyOps';
21
22
  export * as Jose from './ops/JoseOps';
22
- export * as Log from './ops/LogOps';
23
+ export * as Log from './ops/cloud/LogOps';
23
24
  export * as ManagedObject from './ops/ManagedObjectOps';
24
25
  export * as Node from './ops/NodeOps';
25
26
  export * as OAuth2Client from './ops/OAuth2ClientOps';
@@ -28,17 +29,15 @@ export * as Realm from './ops/RealmOps';
28
29
  export * as Saml2 from './ops/Saml2Ops';
29
30
  export * as Script from './ops/ScriptOps';
30
31
  export * as Service from './ops/ServiceOps';
31
- export * as Secrets from './ops/SecretsOps';
32
- export * as ServiceAccount from './ops/ServiceAccountOps';
33
- export * as Startup from './ops/StartupOps';
32
+ export * as Secrets from './ops/cloud/SecretsOps';
33
+ export * as ServiceAccount from './ops/cloud/ServiceAccountOps';
34
+ export * as Startup from './ops/cloud/StartupOps';
34
35
  export * as Theme from './ops/ThemeOps';
35
36
  export * as Types from './ops/OpsTypes';
36
- export * as Variables from './ops/VariablesOps';
37
+ export * as Variables from './ops/cloud/VariablesOps';
37
38
  export * as Utils from './ops/utils/OpsUtils';
38
39
  export * as ValidationUtils from './ops/utils/ValidationUtils';
39
40
  export * as LibVersion from './ops/utils/Version';
40
41
  export * as ExportImportUtils from './ops/utils/ExportImportUtils';
41
42
  export * as state from './shared/State';
42
43
  export * as constants from './storage/StaticStorage';
43
- export * as ForgeRockApiMockEngine from './test/mocks/ForgeRockApiMockEngine';
44
- export { FrodoMockAdapter } from './api/BaseApi';
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/index.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,QAAQ,MAAM,gBAAgB,CAAC;AAC3C,OAAO,KAAK,eAAe,MAAM,uBAAuB,CAAC;AACzD,OAAO,KAAK,OAAO,MAAM,eAAe,CAAC;AAIzC,OAAO,KAAK,aAAa,MAAM,qBAAqB,CAAC;AACrD,OAAO,KAAK,UAAU,MAAM,kBAAkB,CAAC;AAC/C,OAAO,KAAK,0BAA0B,MAAM,kCAAkC,CAAC;AAC/E,OAAO,KAAK,UAAU,MAAM,kBAAkB,CAAC;AAC/C,OAAO,KAAK,OAAO,MAAM,eAAe,CAAC;AACzC,OAAO,KAAK,QAAQ,MAAM,gBAAgB,CAAC;AAC3C,OAAO,KAAK,YAAY,MAAM,oBAAoB,CAAC;AACnD,OAAO,KAAK,YAAY,MAAM,oBAAoB,CAAC;AAGnD,OAAO,KAAK,KAAK,MAAM,gBAAgB,CAAC;AACxC,OAAO,KAAK,KAAK,MAAM,gBAAgB,CAAC;AACxC,OAAO,KAAK,YAAY,MAAM,uBAAuB,CAAC;AACtD,OAAO,KAAK,cAAc,MAAM,yBAAyB,CAAC;AAC1D,OAAO,KAAK,iBAAiB,MAAM,4BAA4B,CAAC;AAChE,OAAO,KAAK,aAAa,MAAM,wBAAwB,CAAC;AACxD,OAAO,KAAK,GAAG,MAAM,cAAc,CAAC;AACpC,OAAO,KAAK,GAAG,MAAM,cAAc,CAAC;AACpC,OAAO,KAAK,OAAO,MAAM,kBAAkB,CAAC;AAC5C,OAAO,KAAK,IAAI,MAAM,eAAe,CAAC;AACtC,OAAO,KAAK,GAAG,MAAM,cAAc,CAAC;AACpC,OAAO,KAAK,aAAa,MAAM,wBAAwB,CAAC;AACxD,OAAO,KAAK,IAAI,MAAM,eAAe,CAAC;AACtC,OAAO,KAAK,YAAY,MAAM,uBAAuB,CAAC;AACtD,OAAO,KAAK,YAAY,MAAM,uBAAuB,CAAC;AACtD,OAAO,KAAK,KAAK,MAAM,gBAAgB,CAAC;AACxC,OAAO,KAAK,KAAK,MAAM,gBAAgB,CAAC;AACxC,OAAO,KAAK,MAAM,MAAM,iBAAiB,CAAC;AAC1C,OAAO,KAAK,OAAO,MAAM,kBAAkB,CAAC;AAC5C,OAAO,KAAK,OAAO,MAAM,kBAAkB,CAAC;AAC5C,OAAO,KAAK,cAAc,MAAM,yBAAyB,CAAC;AAC1D,OAAO,KAAK,OAAO,MAAM,kBAAkB,CAAC;AAC5C,OAAO,KAAK,KAAK,MAAM,gBAAgB,CAAC;AACxC,OAAO,KAAK,KAAK,MAAM,gBAAgB,CAAC;AACxC,OAAO,KAAK,SAAS,MAAM,oBAAoB,CAAC;AAEhD,OAAO,KAAK,KAAK,MAAM,sBAAsB,CAAC;AAC9C,OAAO,KAAK,eAAe,MAAM,6BAA6B,CAAC;AAC/D,OAAO,KAAK,UAAU,MAAM,qBAAqB,CAAC;AAClD,OAAO,KAAK,iBAAiB,MAAM,+BAA+B,CAAC;AAGnE,OAAO,KAAK,KAAK,MAAM,gBAAgB,CAAC;AACxC,OAAO,KAAK,SAAS,MAAM,yBAAyB,CAAC;AAGrD,OAAO,KAAK,sBAAsB,MAAM,qCAAqC,CAAC;AAC9E,OAAO,EAAE,gBAAgB,EAAE,MAAM,eAAe,CAAC","file":"index.d.ts","sourcesContent":["import Color from 'colors';\n\nColor.enable();\n\n// Api Layer\nexport * as AgentRaw from './api/AgentApi';\nexport * as AuthenticateRaw from './api/AuthenticateApi';\nexport * as NodeRaw from './api/NodeApi';\n// TODO: need to figure out if this is the right approach or if we should even\n// use a public oauth2/oidc library. might be ok for now since there is only\n// one place where the cli needs to execute an oauth flow.\nexport * as OAuth2OIDCApi from './api/OAuth2OIDCApi';\nexport * as SecretsRaw from './api/SecretsApi';\nexport * as SocialIdentityProvidersRaw from './api/SocialIdentityProvidersApi';\nexport * as StartupRaw from './api/StartupApi';\nexport * as TreeRaw from './api/TreeApi';\nexport * as TypesRaw from './api/ApiTypes';\nexport * as VariablesRaw from './api/VariablesApi';\nexport * as IdmConfigRaw from './api/IdmConfigApi';\n\n// Ops Layer\nexport * as Admin from './ops/AdminOps';\nexport * as Agent from './ops/AgentOps';\nexport * as Authenticate from './ops/AuthenticateOps';\nexport * as CirclesOfTrust from './ops/CirclesOfTrustOps';\nexport * as ConnectionProfile from './ops/ConnectionProfileOps';\nexport * as EmailTemplate from './ops/EmailTemplateOps';\nexport * as Idp from './ops/IdpOps';\nexport * as Idm from './ops/IdmOps';\nexport * as Journey from './ops/JourneyOps';\nexport * as Jose from './ops/JoseOps';\nexport * as Log from './ops/LogOps';\nexport * as ManagedObject from './ops/ManagedObjectOps';\nexport * as Node from './ops/NodeOps';\nexport * as OAuth2Client from './ops/OAuth2ClientOps';\nexport * as Organization from './ops/OrganizationOps';\nexport * as Realm from './ops/RealmOps';\nexport * as Saml2 from './ops/Saml2Ops';\nexport * as Script from './ops/ScriptOps';\nexport * as Service from './ops/ServiceOps';\nexport * as Secrets from './ops/SecretsOps';\nexport * as ServiceAccount from './ops/ServiceAccountOps';\nexport * as Startup from './ops/StartupOps';\nexport * as Theme from './ops/ThemeOps';\nexport * as Types from './ops/OpsTypes';\nexport * as Variables from './ops/VariablesOps';\n// TODO: revisit if there are better ways\nexport * as Utils from './ops/utils/OpsUtils';\nexport * as ValidationUtils from './ops/utils/ValidationUtils';\nexport * as LibVersion from './ops/utils/Version';\nexport * as ExportImportUtils from './ops/utils/ExportImportUtils';\n// TODO: reconsider the aproach to pass in state from client\n// lib should be stateless, an aplication should own its state\nexport * as state from './shared/State';\nexport * as constants from './storage/StaticStorage';\n\n// Mock Engine\nexport * as ForgeRockApiMockEngine from './test/mocks/ForgeRockApiMockEngine';\nexport { FrodoMockAdapter } from './api/BaseApi';\n"]}
1
+ {"version":3,"sources":["../src/index.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,QAAQ,MAAM,gBAAgB,CAAC;AAC3C,OAAO,KAAK,eAAe,MAAM,uBAAuB,CAAC;AACzD,OAAO,KAAK,OAAO,MAAM,eAAe,CAAC;AAIzC,OAAO,KAAK,aAAa,MAAM,qBAAqB,CAAC;AACrD,OAAO,KAAK,UAAU,MAAM,wBAAwB,CAAC;AACrD,OAAO,KAAK,0BAA0B,MAAM,kCAAkC,CAAC;AAC/E,OAAO,KAAK,UAAU,MAAM,wBAAwB,CAAC;AACrD,OAAO,KAAK,OAAO,MAAM,eAAe,CAAC;AACzC,OAAO,KAAK,QAAQ,MAAM,gBAAgB,CAAC;AAC3C,OAAO,KAAK,YAAY,MAAM,0BAA0B,CAAC;AACzD,OAAO,KAAK,YAAY,MAAM,oBAAoB,CAAC;AAGnD,OAAO,KAAK,KAAK,MAAM,gBAAgB,CAAC;AACxC,OAAO,KAAK,KAAK,MAAM,gBAAgB,CAAC;AACxC,OAAO,KAAK,YAAY,MAAM,uBAAuB,CAAC;AACtD,OAAO,KAAK,cAAc,MAAM,yBAAyB,CAAC;AAC1D,OAAO,KAAK,iBAAiB,MAAM,4BAA4B,CAAC;AAChE,OAAO,KAAK,aAAa,MAAM,wBAAwB,CAAC;AACxD,OAAO,KAAK,GAAG,MAAM,cAAc,CAAC;AACpC,OAAO,KAAK,GAAG,MAAM,cAAc,CAAC;AACpC,OAAO,KAAK,IAAI,MAAM,eAAe,CAAC;AACtC,OAAO,KAAK,OAAO,MAAM,kBAAkB,CAAC;AAC5C,OAAO,KAAK,IAAI,MAAM,eAAe,CAAC;AACtC,OAAO,KAAK,GAAG,MAAM,oBAAoB,CAAC;AAC1C,OAAO,KAAK,aAAa,MAAM,wBAAwB,CAAC;AACxD,OAAO,KAAK,IAAI,MAAM,eAAe,CAAC;AACtC,OAAO,KAAK,YAAY,MAAM,uBAAuB,CAAC;AACtD,OAAO,KAAK,YAAY,MAAM,uBAAuB,CAAC;AACtD,OAAO,KAAK,KAAK,MAAM,gBAAgB,CAAC;AACxC,OAAO,KAAK,KAAK,MAAM,gBAAgB,CAAC;AACxC,OAAO,KAAK,MAAM,MAAM,iBAAiB,CAAC;AAC1C,OAAO,KAAK,OAAO,MAAM,kBAAkB,CAAC;AAC5C,OAAO,KAAK,OAAO,MAAM,wBAAwB,CAAC;AAClD,OAAO,KAAK,cAAc,MAAM,+BAA+B,CAAC;AAChE,OAAO,KAAK,OAAO,MAAM,wBAAwB,CAAC;AAClD,OAAO,KAAK,KAAK,MAAM,gBAAgB,CAAC;AACxC,OAAO,KAAK,KAAK,MAAM,gBAAgB,CAAC;AACxC,OAAO,KAAK,SAAS,MAAM,0BAA0B,CAAC;AAEtD,OAAO,KAAK,KAAK,MAAM,sBAAsB,CAAC;AAC9C,OAAO,KAAK,eAAe,MAAM,6BAA6B,CAAC;AAC/D,OAAO,KAAK,UAAU,MAAM,qBAAqB,CAAC;AAClD,OAAO,KAAK,iBAAiB,MAAM,+BAA+B,CAAC;AAGnE,OAAO,KAAK,KAAK,MAAM,gBAAgB,CAAC;AACxC,OAAO,KAAK,SAAS,MAAM,yBAAyB,CAAC","file":"index.d.ts","sourcesContent":["import Color from 'colors';\n\nColor.enable();\n\n// Api Layer\nexport * as AgentRaw from './api/AgentApi';\nexport * as AuthenticateRaw from './api/AuthenticateApi';\nexport * as NodeRaw from './api/NodeApi';\n// TODO: need to figure out if this is the right approach or if we should even\n// use a public oauth2/oidc library. might be ok for now since there is only\n// one place where the cli needs to execute an oauth flow.\nexport * as OAuth2OIDCApi from './api/OAuth2OIDCApi';\nexport * as SecretsRaw from './api/cloud/SecretsApi';\nexport * as SocialIdentityProvidersRaw from './api/SocialIdentityProvidersApi';\nexport * as StartupRaw from './api/cloud/StartupApi';\nexport * as TreeRaw from './api/TreeApi';\nexport * as TypesRaw from './api/ApiTypes';\nexport * as VariablesRaw from './api/cloud/VariablesApi';\nexport * as IdmConfigRaw from './api/IdmConfigApi';\n\n// Ops Layer\nexport * as Admin from './ops/AdminOps';\nexport * as Agent from './ops/AgentOps';\nexport * as Authenticate from './ops/AuthenticateOps';\nexport * as CirclesOfTrust from './ops/CirclesOfTrustOps';\nexport * as ConnectionProfile from './ops/ConnectionProfileOps';\nexport * as EmailTemplate from './ops/EmailTemplateOps';\nexport * as Idp from './ops/IdpOps';\nexport * as Idm from './ops/IdmOps';\nexport * as Info from './ops/InfoOps';\nexport * as Journey from './ops/JourneyOps';\nexport * as Jose from './ops/JoseOps';\nexport * as Log from './ops/cloud/LogOps';\nexport * as ManagedObject from './ops/ManagedObjectOps';\nexport * as Node from './ops/NodeOps';\nexport * as OAuth2Client from './ops/OAuth2ClientOps';\nexport * as Organization from './ops/OrganizationOps';\nexport * as Realm from './ops/RealmOps';\nexport * as Saml2 from './ops/Saml2Ops';\nexport * as Script from './ops/ScriptOps';\nexport * as Service from './ops/ServiceOps';\nexport * as Secrets from './ops/cloud/SecretsOps';\nexport * as ServiceAccount from './ops/cloud/ServiceAccountOps';\nexport * as Startup from './ops/cloud/StartupOps';\nexport * as Theme from './ops/ThemeOps';\nexport * as Types from './ops/OpsTypes';\nexport * as Variables from './ops/cloud/VariablesOps';\n// TODO: revisit if there are better ways\nexport * as Utils from './ops/utils/OpsUtils';\nexport * as ValidationUtils from './ops/utils/ValidationUtils';\nexport * as LibVersion from './ops/utils/Version';\nexport * as ExportImportUtils from './ops/utils/ExportImportUtils';\n// TODO: reconsider the aproach to pass in state from client\n// lib should be stateless, an aplication should own its state\nexport * as state from './shared/State';\nexport * as constants from './storage/StaticStorage';\n"]}