@twin.org/automation-models 0.0.3-next.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (54) hide show
  1. package/LICENSE +201 -0
  2. package/README.md +21 -0
  3. package/dist/es/factories/automationActionFactory.js +9 -0
  4. package/dist/es/factories/automationActionFactory.js.map +1 -0
  5. package/dist/es/index.js +14 -0
  6. package/dist/es/index.js.map +1 -0
  7. package/dist/es/models/IAutomationAction.js +2 -0
  8. package/dist/es/models/IAutomationAction.js.map +1 -0
  9. package/dist/es/models/IAutomationActionEntry.js +4 -0
  10. package/dist/es/models/IAutomationActionEntry.js.map +1 -0
  11. package/dist/es/models/IAutomationComponent.js +2 -0
  12. package/dist/es/models/IAutomationComponent.js.map +1 -0
  13. package/dist/es/models/api/IAutomationActionCreateRequest.js +2 -0
  14. package/dist/es/models/api/IAutomationActionCreateRequest.js.map +1 -0
  15. package/dist/es/models/api/IAutomationActionGetRequest.js +4 -0
  16. package/dist/es/models/api/IAutomationActionGetRequest.js.map +1 -0
  17. package/dist/es/models/api/IAutomationActionGetResponse.js +2 -0
  18. package/dist/es/models/api/IAutomationActionGetResponse.js.map +1 -0
  19. package/dist/es/models/api/IAutomationActionRemoveRequest.js +4 -0
  20. package/dist/es/models/api/IAutomationActionRemoveRequest.js.map +1 -0
  21. package/dist/es/models/api/IAutomationActionsQueryRequest.js +4 -0
  22. package/dist/es/models/api/IAutomationActionsQueryRequest.js.map +1 -0
  23. package/dist/es/models/api/IAutomationActionsQueryResponse.js +2 -0
  24. package/dist/es/models/api/IAutomationActionsQueryResponse.js.map +1 -0
  25. package/dist/es/models/api/IAutomationTriggerRequest.js +4 -0
  26. package/dist/es/models/api/IAutomationTriggerRequest.js.map +1 -0
  27. package/dist/types/factories/automationActionFactory.d.ts +6 -0
  28. package/dist/types/index.d.ts +11 -0
  29. package/dist/types/models/IAutomationAction.d.ts +12 -0
  30. package/dist/types/models/IAutomationActionEntry.d.ts +21 -0
  31. package/dist/types/models/IAutomationComponent.d.ts +50 -0
  32. package/dist/types/models/api/IAutomationActionCreateRequest.d.ts +10 -0
  33. package/dist/types/models/api/IAutomationActionGetRequest.d.ts +14 -0
  34. package/dist/types/models/api/IAutomationActionGetResponse.d.ts +10 -0
  35. package/dist/types/models/api/IAutomationActionRemoveRequest.d.ts +14 -0
  36. package/dist/types/models/api/IAutomationActionsQueryRequest.d.ts +26 -0
  37. package/dist/types/models/api/IAutomationActionsQueryResponse.d.ts +19 -0
  38. package/dist/types/models/api/IAutomationTriggerRequest.d.ts +23 -0
  39. package/docs/changelog.md +10 -0
  40. package/docs/examples.md +75 -0
  41. package/docs/reference/index.md +18 -0
  42. package/docs/reference/interfaces/IAutomationAction.md +29 -0
  43. package/docs/reference/interfaces/IAutomationActionCreateRequest.md +11 -0
  44. package/docs/reference/interfaces/IAutomationActionEntry.md +35 -0
  45. package/docs/reference/interfaces/IAutomationActionGetRequest.md +17 -0
  46. package/docs/reference/interfaces/IAutomationActionGetResponse.md +11 -0
  47. package/docs/reference/interfaces/IAutomationActionRemoveRequest.md +17 -0
  48. package/docs/reference/interfaces/IAutomationActionsQueryRequest.md +35 -0
  49. package/docs/reference/interfaces/IAutomationActionsQueryResponse.md +23 -0
  50. package/docs/reference/interfaces/IAutomationComponent.md +169 -0
  51. package/docs/reference/interfaces/IAutomationTriggerRequest.md +31 -0
  52. package/docs/reference/variables/AutomationActionFactory.md +5 -0
  53. package/locales/en.json +3 -0
  54. package/package.json +53 -0
package/LICENSE ADDED
@@ -0,0 +1,201 @@
1
+ Apache License
2
+ Version 2.0, January 2004
3
+ http://www.apache.org/licenses/
4
+
5
+ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
6
+
7
+ 1. Definitions.
8
+
9
+ "License" shall mean the terms and conditions for use, reproduction,
10
+ and distribution as defined by Sections 1 through 9 of this document.
11
+
12
+ "Licensor" shall mean the copyright owner or entity authorized by
13
+ the copyright owner that is granting the License.
14
+
15
+ "Legal Entity" shall mean the union of the acting entity and all
16
+ other entities that control, are controlled by, or are under common
17
+ control with that entity. For the purposes of this definition,
18
+ "control" means (i) the power, direct or indirect, to cause the
19
+ direction or management of such entity, whether by contract or
20
+ otherwise, or (ii) ownership of fifty percent (50%) or more of the
21
+ outstanding shares, or (iii) beneficial ownership of such entity.
22
+
23
+ "You" (or "Your") shall mean an individual or Legal Entity
24
+ exercising permissions granted by this License.
25
+
26
+ "Source" form shall mean the preferred form for making modifications,
27
+ including but not limited to software source code, documentation
28
+ source, and configuration files.
29
+
30
+ "Object" form shall mean any form resulting from mechanical
31
+ transformation or translation of a Source form, including but
32
+ not limited to compiled object code, generated documentation,
33
+ and conversions to other media types.
34
+
35
+ "Work" shall mean the work of authorship, whether in Source or
36
+ Object form, made available under the License, as indicated by a
37
+ copyright notice that is included in or attached to the work
38
+ (an example is provided in the Appendix below).
39
+
40
+ "Derivative Works" shall mean any work, whether in Source or Object
41
+ form, that is based on (or derived from) the Work and for which the
42
+ editorial revisions, annotations, elaborations, or other modifications
43
+ represent, as a whole, an original work of authorship. For the purposes
44
+ of this License, Derivative Works shall not include works that remain
45
+ separable from, or merely link (or bind by name) to the interfaces of,
46
+ the Work and Derivative Works thereof.
47
+
48
+ "Contribution" shall mean any work of authorship, including
49
+ the original version of the Work and any modifications or additions
50
+ to that Work or Derivative Works thereof, that is intentionally
51
+ submitted to Licensor for inclusion in the Work by the copyright owner
52
+ or by an individual or Legal Entity authorized to submit on behalf of
53
+ the copyright owner. For the purposes of this definition, "submitted"
54
+ means any form of electronic, verbal, or written communication sent
55
+ to the Licensor or its representatives, including but not limited to
56
+ communication on electronic mailing lists, source code control systems,
57
+ and issue tracking systems that are managed by, or on behalf of, the
58
+ Licensor for the purpose of discussing and improving the Work, but
59
+ excluding communication that is conspicuously marked or otherwise
60
+ designated in writing by the copyright owner as "Not a Contribution."
61
+
62
+ "Contributor" shall mean Licensor and any individual or Legal Entity
63
+ on behalf of whom a Contribution has been received by Licensor and
64
+ subsequently incorporated within the Work.
65
+
66
+ 2. Grant of Copyright License. Subject to the terms and conditions of
67
+ this License, each Contributor hereby grants to You a perpetual,
68
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
69
+ copyright license to reproduce, prepare Derivative Works of,
70
+ publicly display, publicly perform, sublicense, and distribute the
71
+ Work and such Derivative Works in Source or Object form.
72
+
73
+ 3. Grant of Patent License. Subject to the terms and conditions of
74
+ this License, each Contributor hereby grants to You a perpetual,
75
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
76
+ (except as stated in this section) patent license to make, have made,
77
+ use, offer to sell, sell, import, and otherwise transfer the Work,
78
+ where such license applies only to those patent claims licensable
79
+ by such Contributor that are necessarily infringed by their
80
+ Contribution(s) alone or by combination of their Contribution(s)
81
+ with the Work to which such Contribution(s) was submitted. If You
82
+ institute patent litigation against any entity (including a
83
+ cross-claim or counterclaim in a lawsuit) alleging that the Work
84
+ or a Contribution incorporated within the Work constitutes direct
85
+ or contributory patent infringement, then any patent licenses
86
+ granted to You under this License for that Work shall terminate
87
+ as of the date such litigation is filed.
88
+
89
+ 4. Redistribution. You may reproduce and distribute copies of the
90
+ Work or Derivative Works thereof in any medium, with or without
91
+ modifications, and in Source or Object form, provided that You
92
+ meet the following conditions:
93
+
94
+ (a) You must give any other recipients of the Work or
95
+ Derivative Works a copy of this License; and
96
+
97
+ (b) You must cause any modified files to carry prominent notices
98
+ stating that You changed the files; and
99
+
100
+ (c) You must retain, in the Source form of any Derivative Works
101
+ that You distribute, all copyright, patent, trademark, and
102
+ attribution notices from the Source form of the Work,
103
+ excluding those notices that do not pertain to any part of
104
+ the Derivative Works; and
105
+
106
+ (d) If the Work includes a "NOTICE" text file as part of its
107
+ distribution, then any Derivative Works that You distribute must
108
+ include a readable copy of the attribution notices contained
109
+ within such NOTICE file, excluding those notices that do not
110
+ pertain to any part of the Derivative Works, in at least one
111
+ of the following places: within a NOTICE text file distributed
112
+ as part of the Derivative Works; within the Source form or
113
+ documentation, if provided along with the Derivative Works; or,
114
+ within a display generated by the Derivative Works, if and
115
+ wherever such third-party notices normally appear. The contents
116
+ of the NOTICE file are for informational purposes only and
117
+ do not modify the License. You may add Your own attribution
118
+ notices within Derivative Works that You distribute, alongside
119
+ or as an addendum to the NOTICE text from the Work, provided
120
+ that such additional attribution notices cannot be construed
121
+ as modifying the License.
122
+
123
+ You may add Your own copyright statement to Your modifications and
124
+ may provide additional or different license terms and conditions
125
+ for use, reproduction, or distribution of Your modifications, or
126
+ for any such Derivative Works as a whole, provided Your use,
127
+ reproduction, and distribution of the Work otherwise complies with
128
+ the conditions stated in this License.
129
+
130
+ 5. Submission of Contributions. Unless You explicitly state otherwise,
131
+ any Contribution intentionally submitted for inclusion in the Work
132
+ by You to the Licensor shall be under the terms and conditions of
133
+ this License, without any additional terms or conditions.
134
+ Notwithstanding the above, nothing herein shall supersede or modify
135
+ the terms of any separate license agreement you may have executed
136
+ with Licensor regarding such Contributions.
137
+
138
+ 6. Trademarks. This License does not grant permission to use the trade
139
+ names, trademarks, service marks, or product names of the Licensor,
140
+ except as required for reasonable and customary use in describing the
141
+ origin of the Work and reproducing the content of the NOTICE file.
142
+
143
+ 7. Disclaimer of Warranty. Unless required by applicable law or
144
+ agreed to in writing, Licensor provides the Work (and each
145
+ Contributor provides its Contributions) on an "AS IS" BASIS,
146
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
147
+ implied, including, without limitation, any warranties or conditions
148
+ of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
149
+ PARTICULAR PURPOSE. You are solely responsible for determining the
150
+ appropriateness of using or redistributing the Work and assume any
151
+ risks associated with Your exercise of permissions under this License.
152
+
153
+ 8. Limitation of Liability. In no event and under no legal theory,
154
+ whether in tort (including negligence), contract, or otherwise,
155
+ unless required by applicable law (such as deliberate and grossly
156
+ negligent acts) or agreed to in writing, shall any Contributor be
157
+ liable to You for damages, including any direct, indirect, special,
158
+ incidental, or consequential damages of any character arising as a
159
+ result of this License or out of the use or inability to use the
160
+ Work (including but not limited to damages for loss of goodwill,
161
+ work stoppage, computer failure or malfunction, or any and all
162
+ other commercial damages or losses), even if such Contributor
163
+ has been advised of the possibility of such damages.
164
+
165
+ 9. Accepting Warranty or Additional Liability. While redistributing
166
+ the Work or Derivative Works thereof, You may choose to offer,
167
+ and charge a fee for, acceptance of support, warranty, indemnity,
168
+ or other liability obligations and/or rights consistent with this
169
+ License. However, in accepting such obligations, You may act only
170
+ on Your own behalf and on Your sole responsibility, not on behalf
171
+ of any other Contributor, and only if You agree to indemnify,
172
+ defend, and hold each Contributor harmless for any liability
173
+ incurred by, or claims asserted against, such Contributor by reason
174
+ of your accepting any such warranty or additional liability.
175
+
176
+ END OF TERMS AND CONDITIONS
177
+
178
+ APPENDIX: How to apply the Apache License to your work.
179
+
180
+ To apply the Apache License to your work, attach the following
181
+ boilerplate notice, with the fields enclosed by brackets "[]"
182
+ replaced with your own identifying information. (Don't include
183
+ the brackets!) The text should be enclosed in the appropriate
184
+ comment syntax for the file format. We also recommend that a
185
+ file or class name and description of purpose be included on the
186
+ same "printed page" as the copyright notice for easier
187
+ identification within third-party archives.
188
+
189
+ Copyright 2024 IOTA Stiftung.
190
+
191
+ Licensed under the Apache License, Version 2.0 (the "License");
192
+ you may not use this file except in compliance with the License.
193
+ You may obtain a copy of the License at
194
+
195
+ http://www.apache.org/licenses/LICENSE-2.0
196
+
197
+ Unless required by applicable law or agreed to in writing, software
198
+ distributed under the License is distributed on an "AS IS" BASIS,
199
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
200
+ See the License for the specific language governing permissions and
201
+ limitations under the License.
package/README.md ADDED
@@ -0,0 +1,21 @@
1
+ # TWIN Automation Models
2
+
3
+ This package provides shared data models for automation. It serves as a foundational component, enabling other packages to build upon a consistent and reliable base for representing automation entities.
4
+
5
+ ## Installation
6
+
7
+ ```shell
8
+ npm install @twin.org/automation-models
9
+ ```
10
+
11
+ ## Examples
12
+
13
+ Usage of the APIs is shown in the examples [docs/examples.md](docs/examples.md)
14
+
15
+ ## Reference
16
+
17
+ Detailed reference documentation for the API can be found in [docs/reference/index.md](docs/reference/index.md)
18
+
19
+ ## Changelog
20
+
21
+ The changes between each version can be found in [docs/changelog.md](docs/changelog.md)
@@ -0,0 +1,9 @@
1
+ // Copyright 2026 IOTA Stiftung.
2
+ // SPDX-License-Identifier: Apache-2.0.
3
+ import { Factory } from "@twin.org/core";
4
+ /**
5
+ * Factory for creating implementation of automation action types.
6
+ */
7
+ // eslint-disable-next-line @typescript-eslint/naming-convention
8
+ export const AutomationActionFactory = Factory.createFactory("automation-action");
9
+ //# sourceMappingURL=automationActionFactory.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"automationActionFactory.js","sourceRoot":"","sources":["../../../src/factories/automationActionFactory.ts"],"names":[],"mappings":"AAAA,gCAAgC;AAChC,uCAAuC;AACvC,OAAO,EAAE,OAAO,EAAE,MAAM,gBAAgB,CAAC;AAGzC;;GAEG;AACH,gEAAgE;AAChE,MAAM,CAAC,MAAM,uBAAuB,GACnC,OAAO,CAAC,aAAa,CAAoB,mBAAmB,CAAC,CAAC","sourcesContent":["// Copyright 2026 IOTA Stiftung.\n// SPDX-License-Identifier: Apache-2.0.\nimport { Factory } from \"@twin.org/core\";\nimport type { IAutomationAction } from \"../models/IAutomationAction.js\";\n\n/**\n * Factory for creating implementation of automation action types.\n */\n// eslint-disable-next-line @typescript-eslint/naming-convention\nexport const AutomationActionFactory =\n\tFactory.createFactory<IAutomationAction>(\"automation-action\");\n"]}
@@ -0,0 +1,14 @@
1
+ // Copyright 2026 IOTA Stiftung.
2
+ // SPDX-License-Identifier: Apache-2.0.
3
+ export * from "./factories/automationActionFactory.js";
4
+ export * from "./models/api/IAutomationActionCreateRequest.js";
5
+ export * from "./models/api/IAutomationActionGetRequest.js";
6
+ export * from "./models/api/IAutomationActionGetResponse.js";
7
+ export * from "./models/api/IAutomationActionRemoveRequest.js";
8
+ export * from "./models/api/IAutomationActionsQueryRequest.js";
9
+ export * from "./models/api/IAutomationActionsQueryResponse.js";
10
+ export * from "./models/api/IAutomationTriggerRequest.js";
11
+ export * from "./models/IAutomationAction.js";
12
+ export * from "./models/IAutomationActionEntry.js";
13
+ export * from "./models/IAutomationComponent.js";
14
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,gCAAgC;AAChC,uCAAuC;AACvC,cAAc,wCAAwC,CAAC;AACvD,cAAc,gDAAgD,CAAC;AAC/D,cAAc,6CAA6C,CAAC;AAC5D,cAAc,8CAA8C,CAAC;AAC7D,cAAc,gDAAgD,CAAC;AAC/D,cAAc,gDAAgD,CAAC;AAC/D,cAAc,iDAAiD,CAAC;AAChE,cAAc,2CAA2C,CAAC;AAC1D,cAAc,+BAA+B,CAAC;AAC9C,cAAc,oCAAoC,CAAC;AACnD,cAAc,kCAAkC,CAAC","sourcesContent":["// Copyright 2026 IOTA Stiftung.\n// SPDX-License-Identifier: Apache-2.0.\nexport * from \"./factories/automationActionFactory.js\";\nexport * from \"./models/api/IAutomationActionCreateRequest.js\";\nexport * from \"./models/api/IAutomationActionGetRequest.js\";\nexport * from \"./models/api/IAutomationActionGetResponse.js\";\nexport * from \"./models/api/IAutomationActionRemoveRequest.js\";\nexport * from \"./models/api/IAutomationActionsQueryRequest.js\";\nexport * from \"./models/api/IAutomationActionsQueryResponse.js\";\nexport * from \"./models/api/IAutomationTriggerRequest.js\";\nexport * from \"./models/IAutomationAction.js\";\nexport * from \"./models/IAutomationActionEntry.js\";\nexport * from \"./models/IAutomationComponent.js\";\n"]}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=IAutomationAction.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"IAutomationAction.js","sourceRoot":"","sources":["../../../src/models/IAutomationAction.ts"],"names":[],"mappings":"","sourcesContent":["// Copyright 2026 IOTA Stiftung.\n// SPDX-License-Identifier: Apache-2.0.\nimport type { IComponent } from \"@twin.org/core\";\n\n/**\n * Interface describing an automation action.\n */\nexport interface IAutomationAction extends IComponent {\n\t/**\n\t * Execute the automation action.\n\t * @param data Optional data to be passed to the automation action.\n\t * @returns A promise that resolves when the execution is complete.\n\t */\n\ttrigger(data?: unknown): Promise<void>;\n}\n"]}
@@ -0,0 +1,4 @@
1
+ // Copyright 2026 IOTA Stiftung.
2
+ // SPDX-License-Identifier: Apache-2.0.
3
+ export {};
4
+ //# sourceMappingURL=IAutomationActionEntry.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"IAutomationActionEntry.js","sourceRoot":"","sources":["../../../src/models/IAutomationActionEntry.ts"],"names":[],"mappings":"AAAA,gCAAgC;AAChC,uCAAuC","sourcesContent":["// Copyright 2026 IOTA Stiftung.\n// SPDX-License-Identifier: Apache-2.0.\n\n/**\n * Interface describing an automation action entry.\n */\nexport interface IAutomationActionEntry {\n\t/**\n\t * The id of the automation action.\n\t */\n\tid: string;\n\n\t/**\n\t * The type of the automation action.\n\t */\n\tactionType: string;\n\n\t/**\n\t * The trigger of the automation action.\n\t */\n\ttrigger: string;\n\n\t/**\n\t * The configuration of the automation action.\n\t */\n\tconfiguration?: unknown;\n}\n"]}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=IAutomationComponent.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"IAutomationComponent.js","sourceRoot":"","sources":["../../../src/models/IAutomationComponent.ts"],"names":[],"mappings":"","sourcesContent":["// Copyright 2026 IOTA Stiftung.\n// SPDX-License-Identifier: Apache-2.0.\nimport type { IComponent } from \"@twin.org/core\";\nimport type { IAutomationActionEntry } from \"./IAutomationActionEntry.js\";\n\n/**\n * Interface describing an automation contract.\n */\nexport interface IAutomationComponent extends IComponent {\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\tactionCreate(actionType: string, trigger: string, config?: unknown): Promise<string>;\n\n\t/**\n\t * Remove an action by it's id.\n\t * @param actionId The id of the action to remove.\n\t * @returns Nothing.\n\t */\n\tactionRemove(actionId: string): Promise<void>;\n\n\t/**\n\t * Get an action by it's id.\n\t * @param actionId The id of the action to get.\n\t * @returns The action with the given id.\n\t */\n\tactionGet(actionId: string): Promise<IAutomationActionEntry>;\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 query the actions for.\n\t * @param options.actionType The type of action to query for.\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\tactionsQuery(\n\t\toptions:\n\t\t\t| {\n\t\t\t\t\ttrigger?: string;\n\t\t\t\t\tactionType?: string;\n\t\t\t }\n\t\t\t| undefined,\n\t\tcursor?: string,\n\t\tlimit?: number\n\t): Promise<{\n\t\tentries: IAutomationActionEntry[];\n\t\tcursor?: string;\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 Nothing.\n\t */\n\ttrigger(trigger: string, data?: unknown): Promise<void>;\n}\n"]}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=IAutomationActionCreateRequest.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"IAutomationActionCreateRequest.js","sourceRoot":"","sources":["../../../../src/models/api/IAutomationActionCreateRequest.ts"],"names":[],"mappings":"","sourcesContent":["// Copyright 2026 IOTA Stiftung.\n// SPDX-License-Identifier: Apache-2.0.\nimport type { IAutomationActionEntry } from \"../IAutomationActionEntry.js\";\n\n/**\n * Request to create an automation action.\n */\nexport interface IAutomationActionCreateRequest {\n\t/**\n\t * The body parameters for the request.\n\t */\n\tbody: Omit<IAutomationActionEntry, \"id\">;\n}\n"]}
@@ -0,0 +1,4 @@
1
+ // Copyright 2026 IOTA Stiftung.
2
+ // SPDX-License-Identifier: Apache-2.0.
3
+ export {};
4
+ //# sourceMappingURL=IAutomationActionGetRequest.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"IAutomationActionGetRequest.js","sourceRoot":"","sources":["../../../../src/models/api/IAutomationActionGetRequest.ts"],"names":[],"mappings":"AAAA,gCAAgC;AAChC,uCAAuC","sourcesContent":["// Copyright 2026 IOTA Stiftung.\n// SPDX-License-Identifier: Apache-2.0.\n\n/**\n * Request to get an automation action by id.\n */\nexport interface IAutomationActionGetRequest {\n\t/**\n\t * The path parameters for the request.\n\t */\n\tpathParams: {\n\t\t/**\n\t\t * The unique identifier of the action to get.\n\t\t */\n\t\tactionId: string;\n\t};\n}\n"]}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=IAutomationActionGetResponse.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"IAutomationActionGetResponse.js","sourceRoot":"","sources":["../../../../src/models/api/IAutomationActionGetResponse.ts"],"names":[],"mappings":"","sourcesContent":["// Copyright 2026 IOTA Stiftung.\n// SPDX-License-Identifier: Apache-2.0.\nimport type { IAutomationActionEntry } from \"../IAutomationActionEntry.js\";\n\n/**\n * Response for getting an automation action.\n */\nexport interface IAutomationActionGetResponse {\n\t/**\n\t * The automation action entry corresponding to the requested id.\n\t */\n\tbody: IAutomationActionEntry;\n}\n"]}
@@ -0,0 +1,4 @@
1
+ // Copyright 2026 IOTA Stiftung.
2
+ // SPDX-License-Identifier: Apache-2.0.
3
+ export {};
4
+ //# sourceMappingURL=IAutomationActionRemoveRequest.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"IAutomationActionRemoveRequest.js","sourceRoot":"","sources":["../../../../src/models/api/IAutomationActionRemoveRequest.ts"],"names":[],"mappings":"AAAA,gCAAgC;AAChC,uCAAuC","sourcesContent":["// Copyright 2026 IOTA Stiftung.\n// SPDX-License-Identifier: Apache-2.0.\n\n/**\n * Request to remove an automation action.\n */\nexport interface IAutomationActionRemoveRequest {\n\t/**\n\t * The path parameters for the request.\n\t */\n\tpathParams: {\n\t\t/**\n\t\t * The unique identifier of the action to remove.\n\t\t */\n\t\tactionId: string;\n\t};\n}\n"]}
@@ -0,0 +1,4 @@
1
+ // Copyright 2026 IOTA Stiftung.
2
+ // SPDX-License-Identifier: Apache-2.0.
3
+ export {};
4
+ //# sourceMappingURL=IAutomationActionsQueryRequest.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"IAutomationActionsQueryRequest.js","sourceRoot":"","sources":["../../../../src/models/api/IAutomationActionsQueryRequest.ts"],"names":[],"mappings":"AAAA,gCAAgC;AAChC,uCAAuC","sourcesContent":["// Copyright 2026 IOTA Stiftung.\n// SPDX-License-Identifier: Apache-2.0.\n\n/**\n * Request to query automation actions.\n */\nexport interface IAutomationActionsQueryRequest {\n\t/**\n\t * Optional query parameters for filtering and pagination.\n\t */\n\tquery?: {\n\t\t/**\n\t\t * Filter by trigger type.\n\t\t */\n\t\ttrigger?: string;\n\n\t\t/**\n\t\t * Filter by action type.\n\t\t */\n\t\tactionType?: string;\n\n\t\t/**\n\t\t * Cursor for pagination.\n\t\t */\n\t\tcursor?: string;\n\n\t\t/**\n\t\t * Limit the number of results returned.\n\t\t */\n\t\tlimit?: string;\n\t};\n}\n"]}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=IAutomationActionsQueryResponse.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"IAutomationActionsQueryResponse.js","sourceRoot":"","sources":["../../../../src/models/api/IAutomationActionsQueryResponse.ts"],"names":[],"mappings":"","sourcesContent":["// Copyright 2026 IOTA Stiftung.\n// SPDX-License-Identifier: Apache-2.0.\nimport type { IAutomationActionEntry } from \"../IAutomationActionEntry.js\";\n\n/**\n * Response for querying automation actions.\n */\nexport interface IAutomationActionsQueryResponse {\n\t/**\n\t * The body of the response.\n\t */\n\tbody: {\n\t\t/**\n\t\t * List of automation action entries matching the query.\n\t\t */\n\t\tentries: IAutomationActionEntry[];\n\n\t\t/**\n\t\t * Optional cursor for pagination.\n\t\t */\n\t\tcursor?: string;\n\t};\n}\n"]}
@@ -0,0 +1,4 @@
1
+ // Copyright 2026 IOTA Stiftung.
2
+ // SPDX-License-Identifier: Apache-2.0.
3
+ export {};
4
+ //# sourceMappingURL=IAutomationTriggerRequest.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"IAutomationTriggerRequest.js","sourceRoot":"","sources":["../../../../src/models/api/IAutomationTriggerRequest.ts"],"names":[],"mappings":"AAAA,gCAAgC;AAChC,uCAAuC","sourcesContent":["// Copyright 2026 IOTA Stiftung.\n// SPDX-License-Identifier: Apache-2.0.\n\n/**\n * Request to trigger an automation action.\n */\nexport interface IAutomationTriggerRequest {\n\t/**\n\t * The path parameters.\n\t */\n\tpathParams: {\n\t\t/**\n\t\t * The trigger for the actions.\n\t\t */\n\t\ttrigger: string;\n\t};\n\n\t/**\n\t * The body parameters.\n\t */\n\tbody: {\n\t\t/**\n\t\t * Optional data to be passed to the actions.\n\t\t */\n\t\tdata?: unknown;\n\t};\n}\n"]}
@@ -0,0 +1,6 @@
1
+ import { Factory } from "@twin.org/core";
2
+ import type { IAutomationAction } from "../models/IAutomationAction.js";
3
+ /**
4
+ * Factory for creating implementation of automation action types.
5
+ */
6
+ export declare const AutomationActionFactory: Factory<IAutomationAction>;
@@ -0,0 +1,11 @@
1
+ export * from "./factories/automationActionFactory.js";
2
+ export * from "./models/api/IAutomationActionCreateRequest.js";
3
+ export * from "./models/api/IAutomationActionGetRequest.js";
4
+ export * from "./models/api/IAutomationActionGetResponse.js";
5
+ export * from "./models/api/IAutomationActionRemoveRequest.js";
6
+ export * from "./models/api/IAutomationActionsQueryRequest.js";
7
+ export * from "./models/api/IAutomationActionsQueryResponse.js";
8
+ export * from "./models/api/IAutomationTriggerRequest.js";
9
+ export * from "./models/IAutomationAction.js";
10
+ export * from "./models/IAutomationActionEntry.js";
11
+ export * from "./models/IAutomationComponent.js";
@@ -0,0 +1,12 @@
1
+ import type { IComponent } from "@twin.org/core";
2
+ /**
3
+ * Interface describing an automation action.
4
+ */
5
+ export interface IAutomationAction extends IComponent {
6
+ /**
7
+ * Execute the automation action.
8
+ * @param data Optional data to be passed to the automation action.
9
+ * @returns A promise that resolves when the execution is complete.
10
+ */
11
+ trigger(data?: unknown): Promise<void>;
12
+ }
@@ -0,0 +1,21 @@
1
+ /**
2
+ * Interface describing an automation action entry.
3
+ */
4
+ export interface IAutomationActionEntry {
5
+ /**
6
+ * The id of the automation action.
7
+ */
8
+ id: string;
9
+ /**
10
+ * The type of the automation action.
11
+ */
12
+ actionType: string;
13
+ /**
14
+ * The trigger of the automation action.
15
+ */
16
+ trigger: string;
17
+ /**
18
+ * The configuration of the automation action.
19
+ */
20
+ configuration?: unknown;
21
+ }
@@ -0,0 +1,50 @@
1
+ import type { IComponent } from "@twin.org/core";
2
+ import type { IAutomationActionEntry } from "./IAutomationActionEntry.js";
3
+ /**
4
+ * Interface describing an automation contract.
5
+ */
6
+ export interface IAutomationComponent extends IComponent {
7
+ /**
8
+ * Create an action with the trigger and configuration.
9
+ * @param actionType The type of action to create.
10
+ * @param trigger The trigger to create the action for.
11
+ * @param config Configuration to be passed to the actions.
12
+ * @returns The id of the created action.
13
+ */
14
+ actionCreate(actionType: string, trigger: string, config?: unknown): Promise<string>;
15
+ /**
16
+ * Remove an action by it's id.
17
+ * @param actionId The id of the action to remove.
18
+ * @returns Nothing.
19
+ */
20
+ actionRemove(actionId: string): Promise<void>;
21
+ /**
22
+ * Get an action by it's id.
23
+ * @param actionId The id of the action to get.
24
+ * @returns The action with the given id.
25
+ */
26
+ actionGet(actionId: string): Promise<IAutomationActionEntry>;
27
+ /**
28
+ * Query the actions with the given parameters.
29
+ * @param options The options to query the actions with.
30
+ * @param options.trigger The trigger to query the actions for.
31
+ * @param options.actionType The type of action to query for.
32
+ * @param cursor The cursor to continue the query from.
33
+ * @param limit The maximum number of actions to return.
34
+ * @returns The actions matching the query and a cursor to continue the query if there are more results.
35
+ */
36
+ actionsQuery(options: {
37
+ trigger?: string;
38
+ actionType?: string;
39
+ } | undefined, cursor?: string, limit?: number): Promise<{
40
+ entries: IAutomationActionEntry[];
41
+ cursor?: string;
42
+ }>;
43
+ /**
44
+ * Locate automation actions which match the given trigger and execute them.
45
+ * @param trigger The trigger to find the actions for.
46
+ * @param data Optional data to be passed to the actions.
47
+ * @returns Nothing.
48
+ */
49
+ trigger(trigger: string, data?: unknown): Promise<void>;
50
+ }
@@ -0,0 +1,10 @@
1
+ import type { IAutomationActionEntry } from "../IAutomationActionEntry.js";
2
+ /**
3
+ * Request to create an automation action.
4
+ */
5
+ export interface IAutomationActionCreateRequest {
6
+ /**
7
+ * The body parameters for the request.
8
+ */
9
+ body: Omit<IAutomationActionEntry, "id">;
10
+ }
@@ -0,0 +1,14 @@
1
+ /**
2
+ * Request to get an automation action by id.
3
+ */
4
+ export interface IAutomationActionGetRequest {
5
+ /**
6
+ * The path parameters for the request.
7
+ */
8
+ pathParams: {
9
+ /**
10
+ * The unique identifier of the action to get.
11
+ */
12
+ actionId: string;
13
+ };
14
+ }
@@ -0,0 +1,10 @@
1
+ import type { IAutomationActionEntry } from "../IAutomationActionEntry.js";
2
+ /**
3
+ * Response for getting an automation action.
4
+ */
5
+ export interface IAutomationActionGetResponse {
6
+ /**
7
+ * The automation action entry corresponding to the requested id.
8
+ */
9
+ body: IAutomationActionEntry;
10
+ }
@@ -0,0 +1,14 @@
1
+ /**
2
+ * Request to remove an automation action.
3
+ */
4
+ export interface IAutomationActionRemoveRequest {
5
+ /**
6
+ * The path parameters for the request.
7
+ */
8
+ pathParams: {
9
+ /**
10
+ * The unique identifier of the action to remove.
11
+ */
12
+ actionId: string;
13
+ };
14
+ }
@@ -0,0 +1,26 @@
1
+ /**
2
+ * Request to query automation actions.
3
+ */
4
+ export interface IAutomationActionsQueryRequest {
5
+ /**
6
+ * Optional query parameters for filtering and pagination.
7
+ */
8
+ query?: {
9
+ /**
10
+ * Filter by trigger type.
11
+ */
12
+ trigger?: string;
13
+ /**
14
+ * Filter by action type.
15
+ */
16
+ actionType?: string;
17
+ /**
18
+ * Cursor for pagination.
19
+ */
20
+ cursor?: string;
21
+ /**
22
+ * Limit the number of results returned.
23
+ */
24
+ limit?: string;
25
+ };
26
+ }
@@ -0,0 +1,19 @@
1
+ import type { IAutomationActionEntry } from "../IAutomationActionEntry.js";
2
+ /**
3
+ * Response for querying automation actions.
4
+ */
5
+ export interface IAutomationActionsQueryResponse {
6
+ /**
7
+ * The body of the response.
8
+ */
9
+ body: {
10
+ /**
11
+ * List of automation action entries matching the query.
12
+ */
13
+ entries: IAutomationActionEntry[];
14
+ /**
15
+ * Optional cursor for pagination.
16
+ */
17
+ cursor?: string;
18
+ };
19
+ }
@@ -0,0 +1,23 @@
1
+ /**
2
+ * Request to trigger an automation action.
3
+ */
4
+ export interface IAutomationTriggerRequest {
5
+ /**
6
+ * The path parameters.
7
+ */
8
+ pathParams: {
9
+ /**
10
+ * The trigger for the actions.
11
+ */
12
+ trigger: string;
13
+ };
14
+ /**
15
+ * The body parameters.
16
+ */
17
+ body: {
18
+ /**
19
+ * Optional data to be passed to the actions.
20
+ */
21
+ data?: unknown;
22
+ };
23
+ }
@@ -0,0 +1,10 @@
1
+ # Changelog
2
+
3
+ ## [0.0.3-next.1](https://github.com/twinfoundation/automation/compare/automation-models-v0.0.3-next.0...automation-models-v0.0.3-next.1) (2026-04-23)
4
+
5
+
6
+ ### Features
7
+
8
+ * initial commit ([33ddc12](https://github.com/twinfoundation/automation/commit/33ddc12869db11b7f861967f820ac4d5b00dbca2))
9
+
10
+ ## Changelog
@@ -0,0 +1,75 @@
1
+ # Automation Models Examples
2
+
3
+ This package provides shared interfaces and factories for automation actions, entries, and components. These are used to define and implement automation logic in a consistent way.
4
+
5
+ ## IAutomationAction
6
+
7
+ ```typescript
8
+ import type { IAutomationAction } from '@twin.org/automation-models';
9
+
10
+ class MyAction implements IAutomationAction {
11
+ async trigger(data?: unknown): Promise<void> {
12
+ // Perform the action
13
+ }
14
+
15
+ className(): string {
16
+ return 'MyAction';
17
+ }
18
+ }
19
+ ```
20
+
21
+ ## IAutomationActionEntry
22
+
23
+ ```typescript
24
+ import type { IAutomationActionEntry } from '@twin.org/automation-models';
25
+
26
+ const entry: IAutomationActionEntry = {
27
+ id: 'action-1',
28
+ actionType: 'my-action',
29
+ trigger: 'onEvent',
30
+ configuration: { foo: 123 }
31
+ };
32
+ ```
33
+
34
+ ## IAutomationComponent
35
+
36
+ ```typescript
37
+ import type { IAutomationComponent } from '@twin.org/automation-models';
38
+
39
+ // Example implementation skeleton
40
+ class MyComponent implements IAutomationComponent {
41
+ async actionCreate(actionType: string, trigger: string, config?: unknown): Promise<string> {
42
+ // ...
43
+ return 'id';
44
+ }
45
+ async actionRemove(actionId: string): Promise<void> {
46
+ // ...
47
+ }
48
+ async actionGet(actionId: string) {
49
+ // ...
50
+ return { id: actionId, actionType: 't', trigger: 'tr' };
51
+ }
52
+ async actionsQuery() {
53
+ // ...
54
+ return { entries: [], cursor: undefined };
55
+ }
56
+ async trigger(trigger: string, data?: unknown): Promise<void> {
57
+ // ...
58
+ }
59
+ className(): string {
60
+ return 'MyComponent';
61
+ }
62
+ }
63
+ ```
64
+
65
+ ## AutomationActionFactory
66
+
67
+ ```typescript
68
+ import { AutomationActionFactory } from '@twin.org/automation-models';
69
+
70
+ AutomationActionFactory.register('my-action', opts => new MyAction());
71
+ const action = AutomationActionFactory.createIfExists('my-action');
72
+ if (action) {
73
+ await action.trigger();
74
+ }
75
+ ```
@@ -0,0 +1,18 @@
1
+ # @twin.org/automation-models
2
+
3
+ ## Interfaces
4
+
5
+ - [IAutomationAction](interfaces/IAutomationAction.md)
6
+ - [IAutomationActionEntry](interfaces/IAutomationActionEntry.md)
7
+ - [IAutomationComponent](interfaces/IAutomationComponent.md)
8
+ - [IAutomationActionCreateRequest](interfaces/IAutomationActionCreateRequest.md)
9
+ - [IAutomationActionGetRequest](interfaces/IAutomationActionGetRequest.md)
10
+ - [IAutomationActionGetResponse](interfaces/IAutomationActionGetResponse.md)
11
+ - [IAutomationActionRemoveRequest](interfaces/IAutomationActionRemoveRequest.md)
12
+ - [IAutomationActionsQueryRequest](interfaces/IAutomationActionsQueryRequest.md)
13
+ - [IAutomationActionsQueryResponse](interfaces/IAutomationActionsQueryResponse.md)
14
+ - [IAutomationTriggerRequest](interfaces/IAutomationTriggerRequest.md)
15
+
16
+ ## Variables
17
+
18
+ - [AutomationActionFactory](variables/AutomationActionFactory.md)
@@ -0,0 +1,29 @@
1
+ # Interface: IAutomationAction
2
+
3
+ Interface describing an automation action.
4
+
5
+ ## Extends
6
+
7
+ - `IComponent`
8
+
9
+ ## Methods
10
+
11
+ ### trigger() {#trigger}
12
+
13
+ > **trigger**(`data?`): `Promise`\<`void`\>
14
+
15
+ Execute the automation action.
16
+
17
+ #### Parameters
18
+
19
+ ##### data?
20
+
21
+ `unknown`
22
+
23
+ Optional data to be passed to the automation action.
24
+
25
+ #### Returns
26
+
27
+ `Promise`\<`void`\>
28
+
29
+ A promise that resolves when the execution is complete.
@@ -0,0 +1,11 @@
1
+ # Interface: IAutomationActionCreateRequest
2
+
3
+ Request to create an automation action.
4
+
5
+ ## Properties
6
+
7
+ ### body {#body}
8
+
9
+ > **body**: `Omit`\<[`IAutomationActionEntry`](IAutomationActionEntry.md), `"id"`\>
10
+
11
+ The body parameters for the request.
@@ -0,0 +1,35 @@
1
+ # Interface: IAutomationActionEntry
2
+
3
+ Interface describing an automation action entry.
4
+
5
+ ## Properties
6
+
7
+ ### id {#id}
8
+
9
+ > **id**: `string`
10
+
11
+ The id of the automation action.
12
+
13
+ ***
14
+
15
+ ### actionType {#actiontype}
16
+
17
+ > **actionType**: `string`
18
+
19
+ The type of the automation action.
20
+
21
+ ***
22
+
23
+ ### trigger {#trigger}
24
+
25
+ > **trigger**: `string`
26
+
27
+ The trigger of the automation action.
28
+
29
+ ***
30
+
31
+ ### configuration? {#configuration}
32
+
33
+ > `optional` **configuration?**: `unknown`
34
+
35
+ The configuration of the automation action.
@@ -0,0 +1,17 @@
1
+ # Interface: IAutomationActionGetRequest
2
+
3
+ Request to get an automation action by id.
4
+
5
+ ## Properties
6
+
7
+ ### pathParams {#pathparams}
8
+
9
+ > **pathParams**: `object`
10
+
11
+ The path parameters for the request.
12
+
13
+ #### actionId
14
+
15
+ > **actionId**: `string`
16
+
17
+ The unique identifier of the action to get.
@@ -0,0 +1,11 @@
1
+ # Interface: IAutomationActionGetResponse
2
+
3
+ Response for getting an automation action.
4
+
5
+ ## Properties
6
+
7
+ ### body {#body}
8
+
9
+ > **body**: [`IAutomationActionEntry`](IAutomationActionEntry.md)
10
+
11
+ The automation action entry corresponding to the requested id.
@@ -0,0 +1,17 @@
1
+ # Interface: IAutomationActionRemoveRequest
2
+
3
+ Request to remove an automation action.
4
+
5
+ ## Properties
6
+
7
+ ### pathParams {#pathparams}
8
+
9
+ > **pathParams**: `object`
10
+
11
+ The path parameters for the request.
12
+
13
+ #### actionId
14
+
15
+ > **actionId**: `string`
16
+
17
+ The unique identifier of the action to remove.
@@ -0,0 +1,35 @@
1
+ # Interface: IAutomationActionsQueryRequest
2
+
3
+ Request to query automation actions.
4
+
5
+ ## Properties
6
+
7
+ ### query? {#query}
8
+
9
+ > `optional` **query?**: `object`
10
+
11
+ Optional query parameters for filtering and pagination.
12
+
13
+ #### trigger?
14
+
15
+ > `optional` **trigger?**: `string`
16
+
17
+ Filter by trigger type.
18
+
19
+ #### actionType?
20
+
21
+ > `optional` **actionType?**: `string`
22
+
23
+ Filter by action type.
24
+
25
+ #### cursor?
26
+
27
+ > `optional` **cursor?**: `string`
28
+
29
+ Cursor for pagination.
30
+
31
+ #### limit?
32
+
33
+ > `optional` **limit?**: `string`
34
+
35
+ Limit the number of results returned.
@@ -0,0 +1,23 @@
1
+ # Interface: IAutomationActionsQueryResponse
2
+
3
+ Response for querying automation actions.
4
+
5
+ ## Properties
6
+
7
+ ### body {#body}
8
+
9
+ > **body**: `object`
10
+
11
+ The body of the response.
12
+
13
+ #### entries
14
+
15
+ > **entries**: [`IAutomationActionEntry`](IAutomationActionEntry.md)[]
16
+
17
+ List of automation action entries matching the query.
18
+
19
+ #### cursor?
20
+
21
+ > `optional` **cursor?**: `string`
22
+
23
+ Optional cursor for pagination.
@@ -0,0 +1,169 @@
1
+ # Interface: IAutomationComponent
2
+
3
+ Interface describing an automation contract.
4
+
5
+ ## Extends
6
+
7
+ - `IComponent`
8
+
9
+ ## Methods
10
+
11
+ ### actionCreate() {#actioncreate}
12
+
13
+ > **actionCreate**(`actionType`, `trigger`, `config?`): `Promise`\<`string`\>
14
+
15
+ Create an action with the trigger and configuration.
16
+
17
+ #### Parameters
18
+
19
+ ##### actionType
20
+
21
+ `string`
22
+
23
+ The type of action to create.
24
+
25
+ ##### trigger
26
+
27
+ `string`
28
+
29
+ The trigger to create the action for.
30
+
31
+ ##### config?
32
+
33
+ `unknown`
34
+
35
+ Configuration to be passed to the actions.
36
+
37
+ #### Returns
38
+
39
+ `Promise`\<`string`\>
40
+
41
+ The id of the created action.
42
+
43
+ ***
44
+
45
+ ### actionRemove() {#actionremove}
46
+
47
+ > **actionRemove**(`actionId`): `Promise`\<`void`\>
48
+
49
+ Remove an action by it's id.
50
+
51
+ #### Parameters
52
+
53
+ ##### actionId
54
+
55
+ `string`
56
+
57
+ The id of the action to remove.
58
+
59
+ #### Returns
60
+
61
+ `Promise`\<`void`\>
62
+
63
+ Nothing.
64
+
65
+ ***
66
+
67
+ ### actionGet() {#actionget}
68
+
69
+ > **actionGet**(`actionId`): `Promise`\<[`IAutomationActionEntry`](IAutomationActionEntry.md)\>
70
+
71
+ Get an action by it's id.
72
+
73
+ #### Parameters
74
+
75
+ ##### actionId
76
+
77
+ `string`
78
+
79
+ The id of the action to get.
80
+
81
+ #### Returns
82
+
83
+ `Promise`\<[`IAutomationActionEntry`](IAutomationActionEntry.md)\>
84
+
85
+ The action with the given id.
86
+
87
+ ***
88
+
89
+ ### actionsQuery() {#actionsquery}
90
+
91
+ > **actionsQuery**(`options`, `cursor?`, `limit?`): `Promise`\<\{ `entries`: [`IAutomationActionEntry`](IAutomationActionEntry.md)[]; `cursor?`: `string`; \}\>
92
+
93
+ Query the actions with the given parameters.
94
+
95
+ #### Parameters
96
+
97
+ ##### options
98
+
99
+ \{ `trigger?`: `string`; `actionType?`: `string`; \} \| `undefined`
100
+
101
+ The options to query the actions with.
102
+
103
+ ###### Type Literal
104
+
105
+ \{ `trigger?`: `string`; `actionType?`: `string`; \}
106
+
107
+ The options to query the actions with.
108
+
109
+ ###### trigger?
110
+
111
+ `string`
112
+
113
+ The trigger to query the actions for.
114
+
115
+ ###### actionType?
116
+
117
+ `string`
118
+
119
+ The type of action to query for.
120
+
121
+ ***
122
+
123
+ `undefined`
124
+
125
+ ##### cursor?
126
+
127
+ `string`
128
+
129
+ The cursor to continue the query from.
130
+
131
+ ##### limit?
132
+
133
+ `number`
134
+
135
+ The maximum number of actions to return.
136
+
137
+ #### Returns
138
+
139
+ `Promise`\<\{ `entries`: [`IAutomationActionEntry`](IAutomationActionEntry.md)[]; `cursor?`: `string`; \}\>
140
+
141
+ The actions matching the query and a cursor to continue the query if there are more results.
142
+
143
+ ***
144
+
145
+ ### trigger() {#trigger}
146
+
147
+ > **trigger**(`trigger`, `data?`): `Promise`\<`void`\>
148
+
149
+ Locate automation actions which match the given trigger and execute them.
150
+
151
+ #### Parameters
152
+
153
+ ##### trigger
154
+
155
+ `string`
156
+
157
+ The trigger to find the actions for.
158
+
159
+ ##### data?
160
+
161
+ `unknown`
162
+
163
+ Optional data to be passed to the actions.
164
+
165
+ #### Returns
166
+
167
+ `Promise`\<`void`\>
168
+
169
+ Nothing.
@@ -0,0 +1,31 @@
1
+ # Interface: IAutomationTriggerRequest
2
+
3
+ Request to trigger an automation action.
4
+
5
+ ## Properties
6
+
7
+ ### pathParams {#pathparams}
8
+
9
+ > **pathParams**: `object`
10
+
11
+ The path parameters.
12
+
13
+ #### trigger
14
+
15
+ > **trigger**: `string`
16
+
17
+ The trigger for the actions.
18
+
19
+ ***
20
+
21
+ ### body {#body}
22
+
23
+ > **body**: `object`
24
+
25
+ The body parameters.
26
+
27
+ #### data?
28
+
29
+ > `optional` **data?**: `unknown`
30
+
31
+ Optional data to be passed to the actions.
@@ -0,0 +1,5 @@
1
+ # Variable: AutomationActionFactory
2
+
3
+ > `const` **AutomationActionFactory**: `Factory`\<[`IAutomationAction`](../interfaces/IAutomationAction.md)\>
4
+
5
+ Factory for creating implementation of automation action types.
@@ -0,0 +1,3 @@
1
+ {
2
+ "error": {}
3
+ }
package/package.json ADDED
@@ -0,0 +1,53 @@
1
+ {
2
+ "name": "@twin.org/automation-models",
3
+ "version": "0.0.3-next.1",
4
+ "description": "Shared data models for automation. Provides a consistent foundation for representing automation entities and enables other packages to build upon a reliable base.",
5
+ "repository": {
6
+ "type": "git",
7
+ "url": "git+https://github.com/twinfoundation/automation.git",
8
+ "directory": "packages/automation-models"
9
+ },
10
+ "author": "martyn.janes@iota.org",
11
+ "license": "Apache-2.0",
12
+ "type": "module",
13
+ "engines": {
14
+ "node": ">=20.0.0"
15
+ },
16
+ "dependencies": {
17
+ "@twin.org/core": "next",
18
+ "@twin.org/nameof": "next"
19
+ },
20
+ "main": "./dist/es/index.js",
21
+ "types": "./dist/types/index.d.ts",
22
+ "exports": {
23
+ ".": {
24
+ "types": "./dist/types/index.d.ts",
25
+ "import": "./dist/es/index.js",
26
+ "default": "./dist/es/index.js"
27
+ },
28
+ "./locales/*.json": "./locales/*.json"
29
+ },
30
+ "files": [
31
+ "dist/es",
32
+ "dist/types",
33
+ "locales",
34
+ "docs"
35
+ ],
36
+ "keywords": [
37
+ "twin",
38
+ "trade",
39
+ "iota",
40
+ "framework",
41
+ "blockchain",
42
+ "automation",
43
+ "storage",
44
+ "rest-api",
45
+ "models",
46
+ "types",
47
+ "schemas"
48
+ ],
49
+ "bugs": {
50
+ "url": "git+https://github.com/twinfoundation/automation/issues"
51
+ },
52
+ "homepage": "https://twindev.org"
53
+ }