addigy 2.11.3 → 2.11.4

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.
@@ -1,8 +1,8 @@
1
1
  import { AxiosInstance } from 'axios';
2
- import { V2Policy, V2ListOptions } from './v2.types';
2
+ import { V2Policy } from './v2.types';
3
3
  export declare class PoliciesV2 {
4
4
  private readonly http;
5
5
  constructor(http: AxiosInstance);
6
- list(options?: V2ListOptions): Promise<V2Policy[]>;
6
+ list(policies?: string[]): Promise<V2Policy[]>;
7
7
  create(name: string): Promise<V2Policy>;
8
8
  }
@@ -1,22 +1,19 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.PoliciesV2 = void 0;
4
- const pagination_v2_1 = require("./pagination-v2");
5
4
  class PoliciesV2 {
6
5
  constructor(http) {
7
6
  this.http = http;
8
7
  }
9
- async list(options) {
10
- const baseRequest = {};
11
- return pagination_v2_1.PaginationV2.fetchItems(async ({ page, per_page }) => {
12
- const requestBody = pagination_v2_1.PaginationV2.buildRequestBody(baseRequest, {
13
- ...options,
14
- page,
15
- perPage: per_page,
16
- });
17
- const response = await this.http.post('/oa/policies/query', requestBody);
18
- return response.data;
19
- }, options);
8
+ async list(policies) {
9
+ var _a;
10
+ const requestBody = policies ? { policies } : {};
11
+ const response = await this.http.post('/oa/policies/query', requestBody);
12
+ const responseData = response.data;
13
+ if (Array.isArray(responseData)) {
14
+ return responseData;
15
+ }
16
+ return (_a = responseData.items) !== null && _a !== void 0 ? _a : [];
20
17
  }
21
18
  async create(name) {
22
19
  const requestBody = { name };
package/package.json CHANGED
@@ -56,7 +56,7 @@
56
56
  "tsc": "tsc -p tsconfig.build.json"
57
57
  },
58
58
  "types": "index.d.ts",
59
- "version": "2.11.3",
59
+ "version": "2.11.4",
60
60
  "volta": {
61
61
  "node": "22.14.0",
62
62
  "yarn": "1.22.22"