@twin.org/automation-rest-client 0.9.0 → 0.9.1-next.2

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,9 @@
1
1
  // Copyright 2026 IOTA Stiftung.
2
2
  // SPDX-License-Identifier: Apache-2.0.
3
3
  import { BaseRestClient } from "@twin.org/api-core";
4
+ import { HttpHeaderHelper } from "@twin.org/api-models";
4
5
  import { Coerce, Guards } from "@twin.org/core";
5
- import { HeaderTypes } from "@twin.org/web";
6
+ import { HttpMethod } from "@twin.org/web";
6
7
  /**
7
8
  * Client for performing automation through to REST endpoints.
8
9
  */
@@ -35,14 +36,14 @@ export class AutomationRestClient extends BaseRestClient {
35
36
  async actionCreate(actionType, trigger, config) {
36
37
  Guards.stringValue(AutomationRestClient.CLASS_NAME, "actionType", actionType);
37
38
  Guards.stringValue(AutomationRestClient.CLASS_NAME, "trigger", trigger);
38
- const response = await this.fetch("/", "POST", {
39
+ const response = await this.fetch("/", HttpMethod.POST, {
39
40
  body: {
40
41
  actionType,
41
42
  trigger,
42
43
  configuration: config
43
44
  }
44
45
  });
45
- return response.headers[HeaderTypes.Location];
46
+ return HttpHeaderHelper.extractId(response.headers);
46
47
  }
47
48
  /**
48
49
  * Remove an action by its id.
@@ -51,7 +52,7 @@ export class AutomationRestClient extends BaseRestClient {
51
52
  */
52
53
  async actionRemove(actionId) {
53
54
  Guards.stringValue(AutomationRestClient.CLASS_NAME, "actionId", actionId);
54
- await this.fetch("/:actionId", "DELETE", {
55
+ await this.fetch("/:actionId", HttpMethod.DELETE, {
55
56
  pathParams: {
56
57
  actionId
57
58
  }
@@ -64,7 +65,7 @@ export class AutomationRestClient extends BaseRestClient {
64
65
  */
65
66
  async actionGet(actionId) {
66
67
  Guards.stringValue(AutomationRestClient.CLASS_NAME, "actionId", actionId);
67
- const response = await this.fetch("/:actionId", "GET", {
68
+ const response = await this.fetch("/:actionId", HttpMethod.GET, {
68
69
  pathParams: {
69
70
  actionId
70
71
  }
@@ -81,7 +82,7 @@ export class AutomationRestClient extends BaseRestClient {
81
82
  * @returns The actions matching the query and a cursor to continue the query if there are more results.
82
83
  */
83
84
  async actionsQuery(options, cursor, limit) {
84
- const response = await this.fetch("/", "GET", {
85
+ const response = await this.fetch("/", HttpMethod.GET, {
85
86
  query: {
86
87
  trigger: options?.trigger,
87
88
  actionType: options?.actionType,
@@ -99,7 +100,7 @@ export class AutomationRestClient extends BaseRestClient {
99
100
  */
100
101
  async trigger(trigger, data) {
101
102
  Guards.stringValue(AutomationRestClient.CLASS_NAME, "trigger", trigger);
102
- await this.fetch("/trigger/:trigger", "POST", {
103
+ await this.fetch("/trigger/:trigger", HttpMethod.POST, {
103
104
  pathParams: {
104
105
  trigger
105
106
  },
@@ -1 +1 @@
1
- {"version":3,"file":"automationRestClient.js","sourceRoot":"","sources":["../../src/automationRestClient.ts"],"names":[],"mappings":"AAAA,gCAAgC;AAChC,uCAAuC;AACvC,OAAO,EAAE,cAAc,EAAE,MAAM,oBAAoB,CAAC;AAiBpD,OAAO,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,gBAAgB,CAAC;AAEhD,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAE5C;;GAEG;AACH,MAAM,OAAO,oBAAqB,SAAQ,cAAc;IACvD;;OAEG;IACI,MAAM,CAAU,UAAU,0BAA0C;IAE3E;;;OAGG;IACH,YAAY,MAA6B;QACxC,KAAK,CAAC,oBAAoB,CAAC,UAAU,EAAE,MAAM,EAAE,YAAY,CAAC,CAAC;IAC9D,CAAC;IAED;;;OAGG;IACI,SAAS;QACf,OAAO,oBAAoB,CAAC,UAAU,CAAC;IACxC,CAAC;IAED;;;;;;OAMG;IACI,KAAK,CAAC,YAAY,CACxB,UAAkB,EAClB,OAAe,EACf,MAAgB;QAEhB,MAAM,CAAC,WAAW,CAAC,oBAAoB,CAAC,UAAU,gBAAsB,UAAU,CAAC,CAAC;QACpF,MAAM,CAAC,WA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,IAAI,CAAC;IACtB,CAAC;IAED;;;;;OAKG;IACI,KAAK,CAAC,OAAO,CAAC,OAAe,EAAE,IAAc;QACnD,MAAM,CAAC,WAAW,CAAC,oBAAoB,CAAC,UAAU,aAAmB,OAAO,CAAC,CAAC;QAE9E,MAAM,IAAI,CAAC,KAAK,CAAgD,mBAAmB,EAAE,MAAM,EAAE;YAC5F,UAAU,EAAE;gBACX,OAAO;aACP;YACD,IAAI,EAAE;gBACL,IAAI;aACJ;SACD,CAAC,CAAC;IACJ,CAAC","sourcesContent":["// Copyright 2026 IOTA Stiftung.\n// SPDX-License-Identifier: Apache-2.0.\nimport { BaseRestClient } from \"@twin.org/api-core\";\nimport type {\n\tIBaseRestClientConfig,\n\tICreatedResponse,\n\tINoContentResponse\n} from \"@twin.org/api-models\";\nimport type {\n\tIAutomationActionCreateRequest,\n\tIAutomationActionEntry,\n\tIAutomationActionGetRequest,\n\tIAutomationActionGetResponse,\n\tIAutomationActionRemoveRequest,\n\tIAutomationActionsQueryRequest,\n\tIAutomationActionsQueryResponse,\n\tIAutomationComponent,\n\tIAutomationTriggerRequest\n} from \"@twin.org/automation-models\";\nimport { Coerce, Guards } from \"@twin.org/core\";\nimport { nameof } from \"@twin.org/nameof\";\nimport { HeaderTypes } from \"@twin.org/web\";\n\n/**\n * Client for performing automation through to REST endpoints.\n */\nexport class AutomationRestClient extends BaseRestClient implements IAutomationComponent {\n\t/**\n\t * Runtime name for the class.\n\t */\n\tpublic static readonly CLASS_NAME: string = nameof<AutomationRestClient>();\n\n\t/**\n\t * Create a new instance of AutomationRestClient.\n\t * @param config The configuration for the client.\n\t */\n\tconstructor(config: IBaseRestClientConfig) {\n\t\tsuper(AutomationRestClient.CLASS_NAME, config, \"automation\");\n\t}\n\n\t/**\n\t * Returns the class name of the component.\n\t * @returns The class name of the component.\n\t */\n\tpublic className(): string {\n\t\treturn AutomationRestClient.CLASS_NAME;\n\t}\n\n\t/**\n\t * Create an action with the trigger and configuration.\n\t * @param actionType The type of action to create.\n\t * @param trigger The trigger to create the action for.\n\t * @param config Configuration to be passed to the actions.\n\t * @returns The id of the created action.\n\t */\n\tpublic async actionCreate(\n\t\tactionType: string,\n\t\ttrigger: string,\n\t\tconfig?: unknown\n\t): Promise<string> {\n\t\tGuards.stringValue(AutomationRestClient.CLASS_NAME, nameof(actionType), actionType);\n\t\tGuards.stringValue(AutomationRestClient.CLASS_NAME, nameof(trigger), trigger);\n\n\t\tconst response = await this.fetch<IAutomationActionCreateRequest, ICreatedResponse>(\n\t\t\t\"/\",\n\t\t\t\"POST\",\n\t\t\t{\n\t\t\t\tbody: {\n\t\t\t\t\tactionType,\n\t\t\t\t\ttrigger,\n\t\t\t\t\tconfiguration: config\n\t\t\t\t}\n\t\t\t}\n\t\t);\n\n\t\treturn response.headers[HeaderTypes.Location];\n\t}\n\n\t/**\n\t * Remove an action by its id.\n\t * @param actionId The id of the action to remove.\n\t * @returns A promise that resolves when the action has been removed.\n\t */\n\tpublic async actionRemove(actionId: string): Promise<void> {\n\t\tGuards.stringValue(AutomationRestClient.CLASS_NAME, nameof(actionId), actionId);\n\n\t\tawait this.fetch<IAutomationActionRemoveRequest, INoContentResponse>(\"/:actionId\", \"DELETE\", {\n\t\t\tpathParams: {\n\t\t\t\tactionId\n\t\t\t}\n\t\t});\n\t}\n\n\t/**\n\t * Get an action by its id.\n\t * @param actionId The id of the action to get.\n\t * @returns The action with the given id.\n\t */\n\tpublic async actionGet(actionId: string): Promise<IAutomationActionEntry> {\n\t\tGuards.stringValue(AutomationRestClient.CLASS_NAME, nameof(actionId), actionId);\n\n\t\tconst response = await this.fetch<IAutomationActionGetRequest, IAutomationActionGetResponse>(\n\t\t\t\"/:actionId\",\n\t\t\t\"GET\",\n\t\t\t{\n\t\t\t\tpathParams: {\n\t\t\t\t\tactionId\n\t\t\t\t}\n\t\t\t}\n\t\t);\n\n\t\treturn response.body;\n\t}\n\n\t/**\n\t * Query the actions with the given parameters.\n\t * @param options The options to query the actions with.\n\t * @param options.trigger The trigger to filter the actions by.\n\t * @param options.actionType The type of action to filter by.\n\t * @param cursor The cursor to continue the query from.\n\t * @param limit The maximum number of actions to return.\n\t * @returns The actions matching the query and a cursor to continue the query if there are more results.\n\t */\n\tpublic async actionsQuery(\n\t\toptions?: { trigger?: string; actionType?: string },\n\t\tcursor?: string,\n\t\tlimit?: number\n\t): Promise<{\n\t\tentries: IAutomationActionEntry[];\n\t\tcursor?: string;\n\t}> {\n\t\tconst response = await this.fetch<\n\t\t\tIAutomationActionsQueryRequest,\n\t\t\tIAutomationActionsQueryResponse\n\t\t>(\"/\", \"GET\", {\n\t\t\tquery: {\n\t\t\t\ttrigger: options?.trigger,\n\t\t\t\tactionType: options?.actionType,\n\t\t\t\tcursor,\n\t\t\t\tlimit: Coerce.string(limit)\n\t\t\t}\n\t\t});\n\n\t\treturn response.body;\n\t}\n\n\t/**\n\t * Locate automation actions which match the given trigger and execute them.\n\t * @param trigger The trigger to find the actions for.\n\t * @param data Optional data to be passed to the actions.\n\t * @returns A promise that resolves when all matching actions have been dispatched.\n\t */\n\tpublic async trigger(trigger: string, data?: unknown): Promise<void> {\n\t\tGuards.stringValue(AutomationRestClient.CLASS_NAME, nameof(trigger), trigger);\n\n\t\tawait this.fetch<IAutomationTriggerRequest, INoContentResponse>(\"/trigger/:trigger\", \"POST\", {\n\t\t\tpathParams: {\n\t\t\t\ttrigger\n\t\t\t},\n\t\t\tbody: {\n\t\t\t\tdata\n\t\t\t}\n\t\t});\n\t}\n}\n"]}
1
+ {"version":3,"file":"automationRestClient.js","sourceRoot":"","sources":["../../src/automationRestClient.ts"],"names":[],"mappings":"AAAA,gCAAgC;AAChC,uCAAuC;AACvC,OAAO,EAAE,cAAc,EAAE,MAAM,oBAAoB,CAAC;AACpD,OAAO,EACN,gBAAgB,EAIhB,MAAM,sBAAsB,CAAC;AAY9B,OAAO,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,gBAAgB,CAAC;AAEhD,OAAO,EAAE,UAAU,EAAE,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,KAAK,CAChC,YAAY,EACZ,UAAU,CAAC,GAAG,EACd;YACC,UAAU,EAAE;gBACX,QAAQ;aACR;SACD,CACD,CAAC;QAEF,OAAO,QAAQ,CAAC,IAAI,CAAC;IACtB,CAAC;IAED;;;;;;;;OAQG;IACI,KAAK,CAAC,YAAY,CACxB,OAAmD,EACnD,MAAe,EACf,KAAc;QAKd,MAAM,QAAQ,GAAG,MAAM,IAAI,CAAC,KAAK,CAG/B,GAAG,EAAE,UAAU,CAAC,GAAG,EAAE;YACtB,KAAK,EAAE;gBACN,OAAO,EAAE,OAAO,EAAE,OAAO;gBACzB,UAAU,EAAE,OAAO,EAAE,UAAU;gBAC/B,MAAM;gBACN,KAAK,EAAE,MAAM,CAAC,MAAM,CAAC,KAAK,CAAC;aAC3B;SACD,CAAC,CAAC;QAEH,OAAO,QAAQ,CAAC,IAAI,CAAC;IACtB,CAAC;IAED;;;;;OAKG;IACI,KAAK,CAAC,OAAO,CAAC,OAAe,EAAE,IAAc;QACnD,MAAM,CAAC,WAAW,CAAC,oBAAoB,CAAC,UAAU,aAAmB,OAAO,CAAC,CAAC;QAE9E,MAAM,IAAI,CAAC,KAAK,CACf,mBAAmB,EACnB,UAAU,CAAC,IAAI,EACf;YACC,UAAU,EAAE;gBACX,OAAO;aACP;YACD,IAAI,EAAE;gBACL,IAAI;aACJ;SACD,CACD,CAAC;IACH,CAAC","sourcesContent":["// Copyright 2026 IOTA Stiftung.\n// SPDX-License-Identifier: Apache-2.0.\nimport { BaseRestClient } from \"@twin.org/api-core\";\nimport {\n\tHttpHeaderHelper,\n\ttype IBaseRestClientConfig,\n\ttype ICreatedResponse,\n\ttype INoContentResponse\n} from \"@twin.org/api-models\";\nimport type {\n\tIAutomationActionCreateRequest,\n\tIAutomationActionEntry,\n\tIAutomationActionGetRequest,\n\tIAutomationActionGetResponse,\n\tIAutomationActionRemoveRequest,\n\tIAutomationActionsQueryRequest,\n\tIAutomationActionsQueryResponse,\n\tIAutomationComponent,\n\tIAutomationTriggerRequest\n} from \"@twin.org/automation-models\";\nimport { Coerce, Guards } from \"@twin.org/core\";\nimport { nameof } from \"@twin.org/nameof\";\nimport { HttpMethod } from \"@twin.org/web\";\n\n/**\n * Client for performing automation through to REST endpoints.\n */\nexport class AutomationRestClient extends BaseRestClient implements IAutomationComponent {\n\t/**\n\t * Runtime name for the class.\n\t */\n\tpublic static readonly CLASS_NAME: string = nameof<AutomationRestClient>();\n\n\t/**\n\t * Create a new instance of AutomationRestClient.\n\t * @param config The configuration for the client.\n\t */\n\tconstructor(config: IBaseRestClientConfig) {\n\t\tsuper(AutomationRestClient.CLASS_NAME, config, \"automation\");\n\t}\n\n\t/**\n\t * Returns the class name of the component.\n\t * @returns The class name of the component.\n\t */\n\tpublic className(): string {\n\t\treturn AutomationRestClient.CLASS_NAME;\n\t}\n\n\t/**\n\t * Create an action with the trigger and configuration.\n\t * @param actionType The type of action to create.\n\t * @param trigger The trigger to create the action for.\n\t * @param config Configuration to be passed to the actions.\n\t * @returns The id of the created action.\n\t */\n\tpublic async actionCreate(\n\t\tactionType: string,\n\t\ttrigger: string,\n\t\tconfig?: unknown\n\t): Promise<string> {\n\t\tGuards.stringValue(AutomationRestClient.CLASS_NAME, nameof(actionType), actionType);\n\t\tGuards.stringValue(AutomationRestClient.CLASS_NAME, nameof(trigger), trigger);\n\n\t\tconst response = await this.fetch<IAutomationActionCreateRequest, ICreatedResponse>(\n\t\t\t\"/\",\n\t\t\tHttpMethod.POST,\n\t\t\t{\n\t\t\t\tbody: {\n\t\t\t\t\tactionType,\n\t\t\t\t\ttrigger,\n\t\t\t\t\tconfiguration: config\n\t\t\t\t}\n\t\t\t}\n\t\t);\n\n\t\treturn HttpHeaderHelper.extractId(response.headers);\n\t}\n\n\t/**\n\t * Remove an action by its id.\n\t * @param actionId The id of the action to remove.\n\t * @returns A promise that resolves when the action has been removed.\n\t */\n\tpublic async actionRemove(actionId: string): Promise<void> {\n\t\tGuards.stringValue(AutomationRestClient.CLASS_NAME, nameof(actionId), actionId);\n\n\t\tawait this.fetch<IAutomationActionRemoveRequest, INoContentResponse>(\n\t\t\t\"/:actionId\",\n\t\t\tHttpMethod.DELETE,\n\t\t\t{\n\t\t\t\tpathParams: {\n\t\t\t\t\tactionId\n\t\t\t\t}\n\t\t\t}\n\t\t);\n\t}\n\n\t/**\n\t * Get an action by its id.\n\t * @param actionId The id of the action to get.\n\t * @returns The action with the given id.\n\t */\n\tpublic async actionGet(actionId: string): Promise<IAutomationActionEntry> {\n\t\tGuards.stringValue(AutomationRestClient.CLASS_NAME, nameof(actionId), actionId);\n\n\t\tconst response = await this.fetch<IAutomationActionGetRequest, IAutomationActionGetResponse>(\n\t\t\t\"/:actionId\",\n\t\t\tHttpMethod.GET,\n\t\t\t{\n\t\t\t\tpathParams: {\n\t\t\t\t\tactionId\n\t\t\t\t}\n\t\t\t}\n\t\t);\n\n\t\treturn response.body;\n\t}\n\n\t/**\n\t * Query the actions with the given parameters.\n\t * @param options The options to query the actions with.\n\t * @param options.trigger The trigger to filter the actions by.\n\t * @param options.actionType The type of action to filter by.\n\t * @param cursor The cursor to continue the query from.\n\t * @param limit The maximum number of actions to return.\n\t * @returns The actions matching the query and a cursor to continue the query if there are more results.\n\t */\n\tpublic async actionsQuery(\n\t\toptions?: { trigger?: string; actionType?: string },\n\t\tcursor?: string,\n\t\tlimit?: number\n\t): Promise<{\n\t\tentries: IAutomationActionEntry[];\n\t\tcursor?: string;\n\t}> {\n\t\tconst response = await this.fetch<\n\t\t\tIAutomationActionsQueryRequest,\n\t\t\tIAutomationActionsQueryResponse\n\t\t>(\"/\", HttpMethod.GET, {\n\t\t\tquery: {\n\t\t\t\ttrigger: options?.trigger,\n\t\t\t\tactionType: options?.actionType,\n\t\t\t\tcursor,\n\t\t\t\tlimit: Coerce.string(limit)\n\t\t\t}\n\t\t});\n\n\t\treturn response.body;\n\t}\n\n\t/**\n\t * Locate automation actions which match the given trigger and execute them.\n\t * @param trigger The trigger to find the actions for.\n\t * @param data Optional data to be passed to the actions.\n\t * @returns A promise that resolves when all matching actions have been dispatched.\n\t */\n\tpublic async trigger(trigger: string, data?: unknown): Promise<void> {\n\t\tGuards.stringValue(AutomationRestClient.CLASS_NAME, nameof(trigger), trigger);\n\n\t\tawait this.fetch<IAutomationTriggerRequest, INoContentResponse>(\n\t\t\t\"/trigger/:trigger\",\n\t\t\tHttpMethod.POST,\n\t\t\t{\n\t\t\t\tpathParams: {\n\t\t\t\t\ttrigger\n\t\t\t\t},\n\t\t\t\tbody: {\n\t\t\t\t\tdata\n\t\t\t\t}\n\t\t\t}\n\t\t);\n\t}\n}\n"]}
@@ -1,5 +1,5 @@
1
1
  import { BaseRestClient } from "@twin.org/api-core";
2
- import type { IBaseRestClientConfig } from "@twin.org/api-models";
2
+ import { type IBaseRestClientConfig } from "@twin.org/api-models";
3
3
  import type { IAutomationActionEntry, IAutomationComponent } from "@twin.org/automation-models";
4
4
  /**
5
5
  * Client for performing automation through to REST endpoints.
package/docs/changelog.md CHANGED
@@ -1,5 +1,35 @@
1
1
  # Changelog
2
2
 
3
+ ## [0.9.1-next.2](https://github.com/iotaledger/twin-automation/compare/automation-rest-client-v0.9.1-next.1...automation-rest-client-v0.9.1-next.2) (2026-06-29)
4
+
5
+
6
+ ### Features
7
+
8
+ * enhanced rest testing ([#19](https://github.com/iotaledger/twin-automation/issues/19)) ([69ee1f5](https://github.com/iotaledger/twin-automation/commit/69ee1f510be4f3c2b8e09db4ff240e0a56c17e57))
9
+
10
+
11
+ ### Dependencies
12
+
13
+ * The following workspace dependencies were updated
14
+ * dependencies
15
+ * @twin.org/automation-models bumped from 0.9.1-next.1 to 0.9.1-next.2
16
+
17
+ ## [0.9.1-next.1](https://github.com/iotaledger/twin-automation/compare/automation-rest-client-v0.9.1-next.0...automation-rest-client-v0.9.1-next.1) (2026-06-26)
18
+
19
+
20
+ ### Features
21
+
22
+ * initial commit ([33ddc12](https://github.com/iotaledger/twin-automation/commit/33ddc12869db11b7f861967f820ac4d5b00dbca2))
23
+ * typescript 6 update ([ee77cab](https://github.com/iotaledger/twin-automation/commit/ee77cab770cd3d2aff6192f146b4b5544c206d52))
24
+ * update dependencies ([e299490](https://github.com/iotaledger/twin-automation/commit/e299490b7dfe3d847a3beb254a609883caec2c98))
25
+
26
+
27
+ ### Dependencies
28
+
29
+ * The following workspace dependencies were updated
30
+ * dependencies
31
+ * @twin.org/automation-models bumped from 0.9.1-next.0 to 0.9.1-next.1
32
+
3
33
  ## [0.9.0](https://github.com/iotaledger/twin-automation/compare/automation-rest-client-v0.9.0...automation-rest-client-v0.9.0) (2026-06-24)
4
34
 
5
35
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@twin.org/automation-rest-client",
3
- "version": "0.9.0",
3
+ "version": "0.9.1-next.2",
4
4
  "description": "REST client operations for creating, updating, retrieving, and querying managed documents. Facilitates integration with automation services and external systems.",
5
5
  "repository": {
6
6
  "type": "git",
@@ -14,13 +14,13 @@
14
14
  "node": ">=20.0.0"
15
15
  },
16
16
  "dependencies": {
17
- "@twin.org/api-core": "^0.9.0",
18
- "@twin.org/api-models": "^0.9.0",
19
- "@twin.org/automation-models": "^0.9.0",
20
- "@twin.org/core": "^0.9.0",
21
- "@twin.org/entity": "^0.9.0",
22
- "@twin.org/nameof": "^0.9.0",
23
- "@twin.org/web": "^0.9.0"
17
+ "@twin.org/api-core": "next",
18
+ "@twin.org/api-models": "next",
19
+ "@twin.org/automation-models": "0.9.1-next.2",
20
+ "@twin.org/core": "next",
21
+ "@twin.org/entity": "next",
22
+ "@twin.org/nameof": "next",
23
+ "@twin.org/web": "next"
24
24
  },
25
25
  "main": "./dist/es/index.js",
26
26
  "types": "./dist/types/index.d.ts",