@devopness/sdk-js 3.6.4 → 3.6.6

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.
@@ -17,6 +17,7 @@ import { ProjectService } from "./services/ProjectService";
17
17
  import { ResourceEventService } from "./services/ResourceEventService";
18
18
  import { ResourceLinkService } from "./services/ResourceLinkService";
19
19
  import { RoleService } from "./services/RoleService";
20
+ import { SearchService } from "./services/SearchService";
20
21
  import { ServerService } from "./services/ServerService";
21
22
  import { ServiceService } from "./services/ServiceService";
22
23
  import { SocialAccountService } from "./services/SocialAccountService";
@@ -48,6 +49,7 @@ export declare class DevopnessApiClient {
48
49
  resourceEvents: ResourceEventService;
49
50
  resourceLinks: ResourceLinkService;
50
51
  roles: RoleService;
52
+ search: SearchService;
51
53
  servers: ServerService;
52
54
  services: ServiceService;
53
55
  socialAccounts: SocialAccountService;
@@ -20,6 +20,7 @@ const ProjectService_1 = require("./services/ProjectService");
20
20
  const ResourceEventService_1 = require("./services/ResourceEventService");
21
21
  const ResourceLinkService_1 = require("./services/ResourceLinkService");
22
22
  const RoleService_1 = require("./services/RoleService");
23
+ const SearchService_1 = require("./services/SearchService");
23
24
  const ServerService_1 = require("./services/ServerService");
24
25
  const ServiceService_1 = require("./services/ServiceService");
25
26
  const SocialAccountService_1 = require("./services/SocialAccountService");
@@ -56,6 +57,7 @@ class DevopnessApiClient {
56
57
  this.resourceEvents = new ResourceEventService_1.ResourceEventService();
57
58
  this.resourceLinks = new ResourceLinkService_1.ResourceLinkService();
58
59
  this.roles = new RoleService_1.RoleService();
60
+ this.search = new SearchService_1.SearchService();
59
61
  this.servers = new ServerService_1.ServerService();
60
62
  this.services = new ServiceService_1.ServiceService();
61
63
  this.socialAccounts = new SocialAccountService_1.SocialAccountService();
@@ -12,6 +12,7 @@
12
12
  import { ApiBaseService } from "../../../services/ApiBaseService";
13
13
  import { ApiResponse } from "../../../common/ApiResponse";
14
14
  import { Hook } from '../../generated/models';
15
+ import { HookTriggerPayload } from '../../generated/models';
15
16
  import { HookTriggerResponse } from '../../generated/models';
16
17
  import { HookTypeParam } from '../../generated/models';
17
18
  import { HookUpdate } from '../../generated/models';
@@ -37,8 +38,9 @@ export declare class HooksApiService extends ApiBaseService {
37
38
  *
38
39
  * @summary Trigger an incoming hook associated action
39
40
  * @param {string} hookId The ID of the hook.
41
+ * @param {HookTriggerPayload} hookTriggerPayload A free-form JSON object.
40
42
  */
41
- triggerHook(hookId: string): Promise<ApiResponse<HookTriggerResponse>>;
43
+ triggerHook(hookId: string, hookTriggerPayload: HookTriggerPayload): Promise<ApiResponse<HookTriggerResponse>>;
42
44
  /**
43
45
  *
44
46
  * @summary Update an existing hook
@@ -71,14 +71,18 @@ class HooksApiService extends ApiBaseService_1.ApiBaseService {
71
71
  *
72
72
  * @summary Trigger an incoming hook associated action
73
73
  * @param {string} hookId The ID of the hook.
74
+ * @param {HookTriggerPayload} hookTriggerPayload A free-form JSON object.
74
75
  */
75
- triggerHook(hookId) {
76
+ triggerHook(hookId, hookTriggerPayload) {
76
77
  return __awaiter(this, void 0, void 0, function* () {
77
78
  if (hookId === null || hookId === undefined) {
78
79
  throw new Exceptions_1.ArgumentNullException('hookId', 'triggerHook');
79
80
  }
81
+ if (hookTriggerPayload === null || hookTriggerPayload === undefined) {
82
+ throw new Exceptions_1.ArgumentNullException('hookTriggerPayload', 'triggerHook');
83
+ }
80
84
  const requestUrl = '/hooks/{hook_id}/trigger';
81
- const response = yield this.post(requestUrl.replace(`{${"hook_id"}}`, encodeURIComponent(String(hookId))));
85
+ const response = yield this.post(requestUrl.replace(`{${"hook_id"}}`, encodeURIComponent(String(hookId))), hookTriggerPayload);
82
86
  return new ApiResponse_1.ApiResponse(response);
83
87
  });
84
88
  }
@@ -0,0 +1,29 @@
1
+ /**
2
+ * devopness API
3
+ * Devopness API - Painless essential DevOps to everyone
4
+ *
5
+ * The version of the OpenAPI document: latest
6
+ *
7
+ *
8
+ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
9
+ * https://openapi-generator.tech
10
+ * Do not edit the class manually.
11
+ */
12
+ import { ApiBaseService } from "../../../services/ApiBaseService";
13
+ import { ApiResponse } from "../../../common/ApiResponse";
14
+ import { SearchResourceRelation } from '../../generated/models';
15
+ /**
16
+ * SearchApiService - Auto-generated
17
+ */
18
+ export declare class SearchApiService extends ApiBaseService {
19
+ /**
20
+ *
21
+ * @summary Search resources the user can access in Devopness.
22
+ * @param {string} organizationId The organization ID or URL Slug to search within.
23
+ * @param {string} q The search expression used to match resources. Must be at least 2 characters. Must not be greater than 255 characters.
24
+ * @param {string} resourceType The resource family to search.
25
+ * @param {number} [page] Number of the page to be retrieved
26
+ * @param {number} [perPage] Number of items returned per page
27
+ */
28
+ listSearchResources(organizationId: string, q: string, resourceType: string, page?: number, perPage?: number): Promise<ApiResponse<Array<SearchResourceRelation>>>;
29
+ }
@@ -0,0 +1,66 @@
1
+ "use strict";
2
+ /* eslint-disable */
3
+ /**
4
+ * devopness API
5
+ * Devopness API - Painless essential DevOps to everyone
6
+ *
7
+ * The version of the OpenAPI document: latest
8
+ *
9
+ *
10
+ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
11
+ * https://openapi-generator.tech
12
+ * Do not edit the class manually.
13
+ */
14
+ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
15
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
16
+ return new (P || (P = Promise))(function (resolve, reject) {
17
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
18
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
19
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
20
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
21
+ });
22
+ };
23
+ Object.defineProperty(exports, "__esModule", { value: true });
24
+ exports.SearchApiService = void 0;
25
+ const ApiBaseService_1 = require("../../../services/ApiBaseService");
26
+ const ApiResponse_1 = require("../../../common/ApiResponse");
27
+ const Exceptions_1 = require("../../../common/Exceptions");
28
+ const utils_1 = require("../../../common/utils");
29
+ /**
30
+ * SearchApiService - Auto-generated
31
+ */
32
+ class SearchApiService extends ApiBaseService_1.ApiBaseService {
33
+ /**
34
+ *
35
+ * @summary Search resources the user can access in Devopness.
36
+ * @param {string} organizationId The organization ID or URL Slug to search within.
37
+ * @param {string} q The search expression used to match resources. Must be at least 2 characters. Must not be greater than 255 characters.
38
+ * @param {string} resourceType The resource family to search.
39
+ * @param {number} [page] Number of the page to be retrieved
40
+ * @param {number} [perPage] Number of items returned per page
41
+ */
42
+ listSearchResources(organizationId, q, resourceType, page, perPage) {
43
+ return __awaiter(this, void 0, void 0, function* () {
44
+ if (organizationId === null || organizationId === undefined) {
45
+ throw new Exceptions_1.ArgumentNullException('organizationId', 'listSearchResources');
46
+ }
47
+ if (q === null || q === undefined) {
48
+ throw new Exceptions_1.ArgumentNullException('q', 'listSearchResources');
49
+ }
50
+ if (resourceType === null || resourceType === undefined) {
51
+ throw new Exceptions_1.ArgumentNullException('resourceType', 'listSearchResources');
52
+ }
53
+ let queryString = (0, utils_1.parseQueryString)({
54
+ 'page': page,
55
+ 'per_page': perPage,
56
+ 'organization_id': organizationId,
57
+ 'q': q,
58
+ 'resource_type': resourceType,
59
+ });
60
+ const requestUrl = '/search' + (queryString ? `?${queryString}` : '');
61
+ const response = yield this.get(requestUrl);
62
+ return new ApiResponse_1.ApiResponse(response);
63
+ });
64
+ }
65
+ }
66
+ exports.SearchApiService = SearchApiService;
@@ -23,11 +23,11 @@ export interface ApplicationEnvironmentApplyTemplate {
23
23
  template_id?: string;
24
24
  /**
25
25
  * Key/value pairs used to fill template placeholders before an application is created. Each template decides which inputs it accepts.
26
- * @type {{ [key: string]: object; }}
26
+ * @type {{ [key: string]: any; }}
27
27
  * @memberof ApplicationEnvironmentApplyTemplate
28
28
  */
29
29
  template_inputs: {
30
- [key: string]: object;
30
+ [key: string]: any;
31
31
  };
32
32
  /**
33
33
  * Raw YAML for a custom template manifest. Must not be greater than 21504 characters.
@@ -17,7 +17,7 @@ import { HookVariable } from './hook-variable';
17
17
  */
18
18
  export interface HookIncomingSettings {
19
19
  /**
20
- * List of variables to incoming hook
20
+ * List of variables to incoming hook. During application deploy, Devopness exposes them as application environment variables. If a hook variable has the same name as an application variable, the hook value overrides it. Pipeline steps can read the value with shell syntax such as `$NAME` or `${NAME}`.
21
21
  * @type {Array<HookVariable>}
22
22
  * @memberof HookIncomingSettings
23
23
  */
@@ -24,8 +24,8 @@ export interface HookOutgoingSettings {
24
24
  request_headers?: Array<HookOutgoingRequestHeader>;
25
25
  /**
26
26
  * The request body that should be send to target URL
27
- * @type {string | object | Array<object>}
27
+ * @type {string | any | Array<any>}
28
28
  * @memberof HookOutgoingSettings
29
29
  */
30
- request_body?: string | object | Array<object>;
30
+ request_body?: string | any | Array<any>;
31
31
  }
@@ -54,16 +54,16 @@ export interface HookRequest {
54
54
  url: string;
55
55
  /**
56
56
  * The headers of the request
57
- * @type {object}
57
+ * @type {any}
58
58
  * @memberof HookRequest
59
59
  */
60
- request_headers: object;
60
+ request_headers: any;
61
61
  /**
62
62
  * The body of the request
63
- * @type {object}
63
+ * @type {any}
64
64
  * @memberof HookRequest
65
65
  */
66
- request_body: object;
66
+ request_body: any;
67
67
  /**
68
68
  * The response status code
69
69
  * @type {number}
@@ -72,16 +72,16 @@ export interface HookRequest {
72
72
  response_status_code: number;
73
73
  /**
74
74
  * The headers of the response
75
- * @type {object}
75
+ * @type {any}
76
76
  * @memberof HookRequest
77
77
  */
78
- response_headers: object;
78
+ response_headers: any;
79
79
  /**
80
80
  * The body of the response
81
- * @type {object}
81
+ * @type {any}
82
82
  * @memberof HookRequest
83
83
  */
84
- response_body: object;
84
+ response_body: any;
85
85
  /**
86
86
  *
87
87
  * @type {HookRelation}
@@ -0,0 +1,19 @@
1
+ /**
2
+ * devopness API
3
+ * Devopness API - Painless essential DevOps to everyone
4
+ *
5
+ * The version of the OpenAPI document: latest
6
+ *
7
+ *
8
+ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
9
+ * https://openapi-generator.tech
10
+ * Do not edit the class manually.
11
+ */
12
+ /**
13
+ * @type HookTriggerPayload
14
+ * Free-form JSON payload sent to trigger an incoming hook.
15
+ * @export
16
+ */
17
+ export type HookTriggerPayload = {
18
+ [key: string]: any;
19
+ };
@@ -0,0 +1,14 @@
1
+ "use strict";
2
+ /* eslint-disable */
3
+ /**
4
+ * devopness API
5
+ * Devopness API - Painless essential DevOps to everyone
6
+ *
7
+ * The version of the OpenAPI document: latest
8
+ *
9
+ *
10
+ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
11
+ * https://openapi-generator.tech
12
+ * Do not edit the class manually.
13
+ */
14
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -23,8 +23,8 @@ export interface HookTriggerResponse {
23
23
  message: string;
24
24
  /**
25
25
  * Optional error object containing details of the server error
26
- * @type {object}
26
+ * @type {any}
27
27
  * @memberof HookTriggerResponse
28
28
  */
29
- errors: object | null;
29
+ errors: any | null;
30
30
  }
@@ -11,13 +11,13 @@
11
11
  */
12
12
  import { HookVariableType } from './hook-variable-type';
13
13
  /**
14
- * Variable that can be defined on trigger a incoming hook
14
+ * Variable that can be defined on an incoming hook and exposed as an application environment variable during deploy.
15
15
  * @export
16
16
  * @interface HookVariable
17
17
  */
18
18
  export interface HookVariable {
19
19
  /**
20
- * The name of the variable
20
+ * The application environment variable name that will be available during deploy.
21
21
  * @type {string}
22
22
  * @memberof HookVariable
23
23
  */
@@ -41,9 +41,9 @@ export interface HookVariable {
41
41
  */
42
42
  required?: boolean;
43
43
  /**
44
- * Optional variable assumes the default value if it\'s not given on the request to trigger the hook
45
- * @type {string | number | boolean | Array<string | number | boolean | object>}
44
+ * Optional variable assumes the default value if it\'s not given on the request to trigger the hook. If an application variable already exists with the same name, the hook value still overrides it.
45
+ * @type {string | number | boolean | Array<string | number | boolean | any>}
46
46
  * @memberof HookVariable
47
47
  */
48
- default_value?: string | number | boolean | Array<string | number | boolean | object> | null;
48
+ default_value?: string | number | boolean | Array<string | number | boolean | any> | null;
49
49
  }
@@ -122,6 +122,7 @@ export * from './hook-pipeline-create';
122
122
  export * from './hook-relation';
123
123
  export * from './hook-request';
124
124
  export * from './hook-request-relation';
125
+ export * from './hook-trigger-payload';
125
126
  export * from './hook-trigger-response';
126
127
  export * from './hook-trigger-when';
127
128
  export * from './hook-type';
@@ -225,6 +226,7 @@ export * from './role-organization-create';
225
226
  export * from './role-relation';
226
227
  export * from './role-update';
227
228
  export * from './script-runner';
229
+ export * from './search-resource-relation';
228
230
  export * from './server';
229
231
  export * from './server-blueprint';
230
232
  export * from './server-blueprint-spec';
@@ -138,6 +138,7 @@ __exportStar(require("./hook-pipeline-create"), exports);
138
138
  __exportStar(require("./hook-relation"), exports);
139
139
  __exportStar(require("./hook-request"), exports);
140
140
  __exportStar(require("./hook-request-relation"), exports);
141
+ __exportStar(require("./hook-trigger-payload"), exports);
141
142
  __exportStar(require("./hook-trigger-response"), exports);
142
143
  __exportStar(require("./hook-trigger-when"), exports);
143
144
  __exportStar(require("./hook-type"), exports);
@@ -241,6 +242,7 @@ __exportStar(require("./role-organization-create"), exports);
241
242
  __exportStar(require("./role-relation"), exports);
242
243
  __exportStar(require("./role-update"), exports);
243
244
  __exportStar(require("./script-runner"), exports);
245
+ __exportStar(require("./search-resource-relation"), exports);
244
246
  __exportStar(require("./server"), exports);
245
247
  __exportStar(require("./server-blueprint"), exports);
246
248
  __exportStar(require("./server-blueprint-spec"), exports);
@@ -50,10 +50,10 @@ export interface ProjectRelation {
50
50
  resource_summary?: Array<ResourceSummaryItem>;
51
51
  /**
52
52
  * The list of the operating system users found in all the servers linked to a project
53
- * @type {Array<object>}
53
+ * @type {Array<any>}
54
54
  * @memberof ProjectRelation
55
55
  */
56
- os_users: Array<object>;
56
+ os_users: Array<any>;
57
57
  /**
58
58
  *
59
59
  * @type {OrganizationRelation}
@@ -50,10 +50,10 @@ export interface Project {
50
50
  resource_summary?: Array<ResourceSummaryItem>;
51
51
  /**
52
52
  * The list of the operating system users found in all the servers linked to a project
53
- * @type {Array<object>}
53
+ * @type {Array<any>}
54
54
  * @memberof Project
55
55
  */
56
- os_users: Array<object>;
56
+ os_users: Array<any>;
57
57
  /**
58
58
  *
59
59
  * @type {OrganizationRelation}
@@ -0,0 +1,54 @@
1
+ /**
2
+ * devopness API
3
+ * Devopness API - Painless essential DevOps to everyone
4
+ *
5
+ * The version of the OpenAPI document: latest
6
+ *
7
+ *
8
+ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
9
+ * https://openapi-generator.tech
10
+ * Do not edit the class manually.
11
+ */
12
+ /**
13
+ *
14
+ * @export
15
+ * @interface SearchResourceRelation
16
+ */
17
+ export interface SearchResourceRelation {
18
+ /**
19
+ * The matched resource type
20
+ * @type {string}
21
+ * @memberof SearchResourceRelation
22
+ */
23
+ resource_type: string;
24
+ /**
25
+ * The matched resource ID
26
+ * @type {number}
27
+ * @memberof SearchResourceRelation
28
+ */
29
+ resource_id: number;
30
+ /**
31
+ * The display name shown to the user
32
+ * @type {string}
33
+ * @memberof SearchResourceRelation
34
+ */
35
+ resource_name: string;
36
+ /**
37
+ * The organization that owns or contains the resource
38
+ * @type {number}
39
+ * @memberof SearchResourceRelation
40
+ */
41
+ organization_id?: number;
42
+ /**
43
+ * The project that contains the resource when applicable
44
+ * @type {number}
45
+ * @memberof SearchResourceRelation
46
+ */
47
+ project_id?: number;
48
+ /**
49
+ * The environment that contains the resource when applicable
50
+ * @type {number}
51
+ * @memberof SearchResourceRelation
52
+ */
53
+ environment_id?: number;
54
+ }
@@ -0,0 +1,14 @@
1
+ "use strict";
2
+ /* eslint-disable */
3
+ /**
4
+ * devopness API
5
+ * Devopness API - Painless essential DevOps to everyone
6
+ *
7
+ * The version of the OpenAPI document: latest
8
+ *
9
+ *
10
+ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
11
+ * https://openapi-generator.tech
12
+ * Do not edit the class manually.
13
+ */
14
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -47,8 +47,8 @@ export interface Template {
47
47
  version: string;
48
48
  /**
49
49
  * The raw template file content used to build the application request.
50
- * @type {object}
50
+ * @type {any}
51
51
  * @memberof Template
52
52
  */
53
- manifest?: object | null;
53
+ manifest?: any | null;
54
54
  }
@@ -0,0 +1,3 @@
1
+ import { SearchApiService } from "../api/generated/apis/search-api";
2
+ export declare class SearchService extends SearchApiService {
3
+ }
@@ -0,0 +1,7 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.SearchService = void 0;
4
+ const search_api_1 = require("../api/generated/apis/search-api");
5
+ class SearchService extends search_api_1.SearchApiService {
6
+ }
7
+ exports.SearchService = SearchService;
@@ -16,6 +16,7 @@ export * from "./ProjectService";
16
16
  export * from "./ResourceEventService";
17
17
  export * from "./ResourceLinkService";
18
18
  export * from "./RoleService";
19
+ export * from "./SearchService";
19
20
  export * from "./ServerService";
20
21
  export * from "./ServiceService";
21
22
  export * from "./SocialAccountService";
@@ -32,6 +32,7 @@ __exportStar(require("./ProjectService"), exports);
32
32
  __exportStar(require("./ResourceEventService"), exports);
33
33
  __exportStar(require("./ResourceLinkService"), exports);
34
34
  __exportStar(require("./RoleService"), exports);
35
+ __exportStar(require("./SearchService"), exports);
35
36
  __exportStar(require("./ServerService"), exports);
36
37
  __exportStar(require("./ServiceService"), exports);
37
38
  __exportStar(require("./SocialAccountService"), exports);
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "$schema": "https://json.schemastore.org/package.json",
3
3
  "name": "@devopness/sdk-js",
4
- "version": "3.6.4",
4
+ "version": "3.6.6",
5
5
  "publishConfig": {
6
6
  "access": "public"
7
7
  },
@@ -23,7 +23,6 @@
23
23
  "docs-remove-service-index": "rm -f src/services/index.ts",
24
24
  "docs-export-service-index": "find src/services/ ! -name 'index.ts' -name '*.ts' -type f | sort -k3 -t'/' | xargs -I'{}' bash -c 'echo \"export * from $(echo -e \"\\x27\")./$(basename $0 .ts)$(echo -e \"\\x27\")\" >> src/services/index.ts' {} \\;",
25
25
  "docs-update-service-index": "npm run docs-remove-service-index && npm run docs-export-service-index",
26
- "docs": "npm run docs-update-service-index && typedoc",
27
26
  "lint": "vp check",
28
27
  "lint:fix": "vp check --fix",
29
28
  "prepublishOnly": "npm run lint && npm test && npm run build",
@@ -61,16 +60,15 @@
61
60
  "node": "^20.19.0 || ^22.13.0 || >=24"
62
61
  },
63
62
  "devDependencies": {
64
- "@openapitools/openapi-generator-cli": "^2.41.0",
63
+ "@openapitools/openapi-generator-cli": "^2.42.2",
65
64
  "axios-mock-adapter": "^2.1.0",
66
65
  "husky": "9.1.7",
67
- "vite-plus": "0.3.2",
68
- "typescript": "^7.0.2",
69
- "typedoc": "^0.28.20"
66
+ "vite-plus": "1.7.0",
67
+ "typescript": "^7.0.2"
70
68
  },
71
69
  "dependencies": {
72
70
  "@types/parse-link-header": "^2.0.3",
73
- "axios": "^1.20.0",
71
+ "axios": "^1.21.1",
74
72
  "parse-link-header": "^2.0.0"
75
73
  }
76
74
  }