@flow-as-code/core 0.1.0

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 (164) hide show
  1. package/LICENSE +202 -0
  2. package/README.md +30 -0
  3. package/SPEC.md +92 -0
  4. package/dist/actions.d.ts +87 -0
  5. package/dist/actions.d.ts.map +1 -0
  6. package/dist/actions.js +204 -0
  7. package/dist/actions.js.map +1 -0
  8. package/dist/aws.d.ts +27 -0
  9. package/dist/aws.d.ts.map +1 -0
  10. package/dist/aws.js +32 -0
  11. package/dist/aws.js.map +1 -0
  12. package/dist/blocks.d.ts +287 -0
  13. package/dist/blocks.d.ts.map +1 -0
  14. package/dist/blocks.js +352 -0
  15. package/dist/blocks.js.map +1 -0
  16. package/dist/codegen.d.ts +21 -0
  17. package/dist/codegen.d.ts.map +1 -0
  18. package/dist/codegen.js +1027 -0
  19. package/dist/codegen.js.map +1 -0
  20. package/dist/export.d.ts +256 -0
  21. package/dist/export.d.ts.map +1 -0
  22. package/dist/export.js +799 -0
  23. package/dist/export.js.map +1 -0
  24. package/dist/flow.d.ts +41 -0
  25. package/dist/flow.d.ts.map +1 -0
  26. package/dist/flow.js +85 -0
  27. package/dist/flow.js.map +1 -0
  28. package/dist/flowdoc.d.ts +111 -0
  29. package/dist/flowdoc.d.ts.map +1 -0
  30. package/dist/flowdoc.js +139 -0
  31. package/dist/flowdoc.js.map +1 -0
  32. package/dist/index.d.ts +16 -0
  33. package/dist/index.d.ts.map +1 -0
  34. package/dist/index.js +26 -0
  35. package/dist/index.js.map +1 -0
  36. package/dist/layout.d.ts +11 -0
  37. package/dist/layout.d.ts.map +1 -0
  38. package/dist/layout.js +49 -0
  39. package/dist/layout.js.map +1 -0
  40. package/dist/lint/engine.d.ts +16 -0
  41. package/dist/lint/engine.d.ts.map +1 -0
  42. package/dist/lint/engine.js +37 -0
  43. package/dist/lint/engine.js.map +1 -0
  44. package/dist/lint/graph.d.ts +34 -0
  45. package/dist/lint/graph.d.ts.map +1 -0
  46. package/dist/lint/graph.js +79 -0
  47. package/dist/lint/graph.js.map +1 -0
  48. package/dist/lint/index.d.ts +7 -0
  49. package/dist/lint/index.d.ts.map +1 -0
  50. package/dist/lint/index.js +5 -0
  51. package/dist/lint/index.js.map +1 -0
  52. package/dist/lint/reporters.d.ts +6 -0
  53. package/dist/lint/reporters.d.ts.map +1 -0
  54. package/dist/lint/reporters.js +30 -0
  55. package/dist/lint/reporters.js.map +1 -0
  56. package/dist/lint/rules/action-allowed-in-flow-type.d.ts +11 -0
  57. package/dist/lint/rules/action-allowed-in-flow-type.d.ts.map +1 -0
  58. package/dist/lint/rules/action-allowed-in-flow-type.js +32 -0
  59. package/dist/lint/rules/action-allowed-in-flow-type.js.map +1 -0
  60. package/dist/lint/rules/action-count.d.ts +16 -0
  61. package/dist/lint/rules/action-count.d.ts.map +1 -0
  62. package/dist/lint/rules/action-count.js +32 -0
  63. package/dist/lint/rules/action-count.js.map +1 -0
  64. package/dist/lint/rules/error-branches.d.ts +10 -0
  65. package/dist/lint/rules/error-branches.d.ts.map +1 -0
  66. package/dist/lint/rules/error-branches.js +39 -0
  67. package/dist/lint/rules/error-branches.js.map +1 -0
  68. package/dist/lint/rules/index.d.ts +17 -0
  69. package/dist/lint/rules/index.d.ts.map +1 -0
  70. package/dist/lint/rules/index.js +36 -0
  71. package/dist/lint/rules/index.js.map +1 -0
  72. package/dist/lint/rules/module-depth-5.d.ts +14 -0
  73. package/dist/lint/rules/module-depth-5.d.ts.map +1 -0
  74. package/dist/lint/rules/module-depth-5.js +67 -0
  75. package/dist/lint/rules/module-depth-5.js.map +1 -0
  76. package/dist/lint/rules/no-literal-arn.d.ts +21 -0
  77. package/dist/lint/rules/no-literal-arn.d.ts.map +1 -0
  78. package/dist/lint/rules/no-literal-arn.js +58 -0
  79. package/dist/lint/rules/no-literal-arn.js.map +1 -0
  80. package/dist/lint/rules/no-unresolved-token.d.ts +8 -0
  81. package/dist/lint/rules/no-unresolved-token.d.ts.map +1 -0
  82. package/dist/lint/rules/no-unresolved-token.js +71 -0
  83. package/dist/lint/rules/no-unresolved-token.js.map +1 -0
  84. package/dist/lint/rules/prompt-length-3000.d.ts +16 -0
  85. package/dist/lint/rules/prompt-length-3000.d.ts.map +1 -0
  86. package/dist/lint/rules/prompt-length-3000.js +61 -0
  87. package/dist/lint/rules/prompt-length-3000.js.map +1 -0
  88. package/dist/lint/rules/reachable-blocks.d.ts +7 -0
  89. package/dist/lint/rules/reachable-blocks.d.ts.map +1 -0
  90. package/dist/lint/rules/reachable-blocks.js +45 -0
  91. package/dist/lint/rules/reachable-blocks.js.map +1 -0
  92. package/dist/lint/rules/recording-consent-before-record.d.ts +3 -0
  93. package/dist/lint/rules/recording-consent-before-record.d.ts.map +1 -0
  94. package/dist/lint/rules/recording-consent-before-record.js +87 -0
  95. package/dist/lint/rules/recording-consent-before-record.js.map +1 -0
  96. package/dist/lint/rules/terminal-blocks.d.ts +8 -0
  97. package/dist/lint/rules/terminal-blocks.d.ts.map +1 -0
  98. package/dist/lint/rules/terminal-blocks.js +40 -0
  99. package/dist/lint/rules/terminal-blocks.js.map +1 -0
  100. package/dist/lint/rules/unique-names.d.ts +7 -0
  101. package/dist/lint/rules/unique-names.d.ts.map +1 -0
  102. package/dist/lint/rules/unique-names.js +40 -0
  103. package/dist/lint/rules/unique-names.js.map +1 -0
  104. package/dist/lint/types.d.ts +30 -0
  105. package/dist/lint/types.d.ts.map +1 -0
  106. package/dist/lint/types.js +11 -0
  107. package/dist/lint/types.js.map +1 -0
  108. package/dist/materialize.d.ts +31 -0
  109. package/dist/materialize.d.ts.map +1 -0
  110. package/dist/materialize.js +192 -0
  111. package/dist/materialize.js.map +1 -0
  112. package/dist/package-names.d.ts +11 -0
  113. package/dist/package-names.d.ts.map +1 -0
  114. package/dist/package-names.js +25 -0
  115. package/dist/package-names.js.map +1 -0
  116. package/dist/refs.d.ts +35 -0
  117. package/dist/refs.d.ts.map +1 -0
  118. package/dist/refs.js +69 -0
  119. package/dist/refs.js.map +1 -0
  120. package/dist/serialize.d.ts +13 -0
  121. package/dist/serialize.d.ts.map +1 -0
  122. package/dist/serialize.js +86 -0
  123. package/dist/serialize.js.map +1 -0
  124. package/dist/simulate.d.ts +446 -0
  125. package/dist/simulate.d.ts.map +1 -0
  126. package/dist/simulate.js +1115 -0
  127. package/dist/simulate.js.map +1 -0
  128. package/dist/synth.d.ts +25 -0
  129. package/dist/synth.d.ts.map +1 -0
  130. package/dist/synth.js +93 -0
  131. package/dist/synth.js.map +1 -0
  132. package/package.json +73 -0
  133. package/src/actions.ts +221 -0
  134. package/src/aws.ts +55 -0
  135. package/src/blocks.ts +619 -0
  136. package/src/codegen.ts +1144 -0
  137. package/src/export.ts +1190 -0
  138. package/src/flow.ts +108 -0
  139. package/src/flowdoc.ts +261 -0
  140. package/src/index.ts +31 -0
  141. package/src/layout.ts +54 -0
  142. package/src/lint/engine.ts +56 -0
  143. package/src/lint/graph.ts +86 -0
  144. package/src/lint/index.ts +10 -0
  145. package/src/lint/reporters.ts +44 -0
  146. package/src/lint/rules/action-allowed-in-flow-type.ts +32 -0
  147. package/src/lint/rules/action-count.ts +35 -0
  148. package/src/lint/rules/error-branches.ts +45 -0
  149. package/src/lint/rules/index.ts +53 -0
  150. package/src/lint/rules/module-depth-5.ts +70 -0
  151. package/src/lint/rules/no-literal-arn.ts +64 -0
  152. package/src/lint/rules/no-unresolved-token.ts +80 -0
  153. package/src/lint/rules/prompt-length-3000.ts +66 -0
  154. package/src/lint/rules/reachable-blocks.ts +50 -0
  155. package/src/lint/rules/recording-consent-before-record.ts +90 -0
  156. package/src/lint/rules/terminal-blocks.ts +45 -0
  157. package/src/lint/rules/unique-names.ts +44 -0
  158. package/src/lint/types.ts +43 -0
  159. package/src/materialize.ts +230 -0
  160. package/src/package-names.ts +26 -0
  161. package/src/refs.ts +93 -0
  162. package/src/serialize.ts +97 -0
  163. package/src/simulate.ts +1610 -0
  164. package/src/synth.ts +110 -0
@@ -0,0 +1,204 @@
1
+ /*
2
+ * Copyright 2026 The flow-as-code Authors
3
+ * SPDX-License-Identifier: Apache-2.0
4
+ */
5
+ // The modeled Amazon Connect action types.
6
+ //
7
+ // Every fact here is transcribed from conformance/flow-language/actions.md,
8
+ // which cites a doc URL per entry. Do not add an entry without adding the
9
+ // citation there first.
10
+ export const ActionType = {
11
+ MessageParticipant: "MessageParticipant",
12
+ GetParticipantInput: "GetParticipantInput",
13
+ DisconnectParticipant: "DisconnectParticipant",
14
+ CheckHoursOfOperation: "CheckHoursOfOperation",
15
+ Compare: "Compare",
16
+ TransferToFlow: "TransferToFlow",
17
+ EndFlowExecution: "EndFlowExecution",
18
+ TransferContactToQueue: "TransferContactToQueue",
19
+ UpdateContactTargetQueue: "UpdateContactTargetQueue",
20
+ UpdateContactAttributes: "UpdateContactAttributes",
21
+ UpdateContactRecordingBehavior: "UpdateContactRecordingBehavior",
22
+ InvokeFlowModule: "InvokeFlowModule",
23
+ EndFlowModuleExecution: "EndFlowModuleExecution",
24
+ InvokeLambdaFunction: "InvokeLambdaFunction",
25
+ };
26
+ /**
27
+ * Reference-bearing parameter fields, by action type. These are the only
28
+ * places a `${cdref:...}` token may appear.
29
+ */
30
+ export const REFERENCE_FIELDS = {
31
+ [ActionType.UpdateContactTargetQueue]: { QueueId: "queue", AgentId: "queue" },
32
+ [ActionType.CheckHoursOfOperation]: { HoursOfOperationId: "hours" },
33
+ [ActionType.InvokeLambdaFunction]: { LambdaFunctionARN: "lambda" },
34
+ [ActionType.InvokeFlowModule]: { FlowModuleId: "module" },
35
+ [ActionType.TransferToFlow]: { ContactFlowId: "flow" },
36
+ [ActionType.MessageParticipant]: { PromptId: "prompt" },
37
+ [ActionType.GetParticipantInput]: { PromptId: "prompt" },
38
+ };
39
+ /**
40
+ * Actions that terminate the flow. These carry an empty Transitions object and
41
+ * have no errors at all.
42
+ */
43
+ export const TERMINAL_ACTIONS = [
44
+ ActionType.DisconnectParticipant,
45
+ ActionType.EndFlowExecution,
46
+ ActionType.EndFlowModuleExecution,
47
+ ];
48
+ /**
49
+ * The catch-all error every non-terminal modeled action supports. `Compare` is
50
+ * the exception: it fails with NoMatchingCondition instead.
51
+ */
52
+ export const NO_MATCHING_ERROR = "NoMatchingError";
53
+ export const NO_MATCHING_CONDITION = "NoMatchingCondition";
54
+ /** The error GetParticipantInput takes when no digit arrives in time. */
55
+ export const INPUT_TIME_LIMIT_EXCEEDED = "InputTimeLimitExceeded";
56
+ /**
57
+ * Additional error types beyond the catch-all, by action type, in the order
58
+ * the builder emits them.
59
+ */
60
+ export const EXTRA_ERRORS = {
61
+ [ActionType.TransferContactToQueue]: ["QueueAtCapacity"],
62
+ // NoMatchingCondition "Must be defined only if StoreInput is False", which
63
+ // is the only form the builder emits; the order is the admin page's example.
64
+ // https://docs.aws.amazon.com/connect/latest/devguide/participant-actions-getparticipantinput.html
65
+ [ActionType.GetParticipantInput]: [INPUT_TIME_LIMIT_EXCEEDED, NO_MATCHING_CONDITION],
66
+ };
67
+ // The Restrictions section of an action page names flow types in the console's
68
+ // vocabulary. These groups are that vocabulary in ConnectType terms; every
69
+ // entry in the table below is spelled with them so a restriction can be read
70
+ // straight off the page it cites.
71
+ //
72
+ // inbound flow, contact flow -> INBOUND
73
+ // transfer flow -> TRANSFER
74
+ // whisper flow -> WHISPER (agent, customer, outbound)
75
+ // hold flow -> agent and customer hold; no action allows one
76
+ // customer queue flow -> CUSTOMER_QUEUE
77
+ // flow module -> IN_MODULE
78
+ const INBOUND = ["CONTACT_FLOW"];
79
+ const TRANSFER = ["AGENT_TRANSFER", "QUEUE_TRANSFER"];
80
+ const WHISPER = ["CUSTOMER_WHISPER", "AGENT_WHISPER", "OUTBOUND_WHISPER"];
81
+ const CUSTOMER_QUEUE = ["CUSTOMER_QUEUE"];
82
+ // A module has no flow type of its own. It runs under whichever flow invokes
83
+ // it ("You can use modules across all flow types"), and AWS documents the
84
+ // consequence of an unsupported block as a runtime one, not a static ban: "If
85
+ // your module contains blocks that are not supported by the specific flow type,
86
+ // this incompatibility might lead the blocks to take the error branch."
87
+ // https://docs.aws.amazon.com/connect/latest/adminguide/contact-flow-modules.html
88
+ // So the invoking flow type, which a module document does not know, decides.
89
+ // MODULE is therefore allowed wherever the action page does not scope the
90
+ // action to modules; EndFlowModuleExecution is the only action whose page
91
+ // mentions modules at all, and it is module-only.
92
+ const IN_MODULE = ["MODULE"];
93
+ /**
94
+ * Which flow types each action is legal in, transcribed from the Restrictions
95
+ * section of each action's doc page (the modeled set and its pages are listed
96
+ * in conformance/flow-language/actions.md). Consumed by the
97
+ * `action-allowed-in-flow-type` lint rule.
98
+ *
99
+ * An action absent from this table is unrestricted; FLOW_TYPE_UNRESTRICTED
100
+ * names those explicitly, and actions.test.ts holds the two lists to the whole
101
+ * modeled set so a new block cannot land with its Restrictions section unread.
102
+ */
103
+ export const FLOW_TYPE_RESTRICTIONS = {
104
+ // "This action is supported in contact flows, transfer flows, whisper flows,
105
+ // and customer queue flows. It is not supported in hold flows."
106
+ // https://docs.aws.amazon.com/connect/latest/devguide/participant-actions-messageparticipant.html
107
+ [ActionType.MessageParticipant]: [
108
+ ...INBOUND,
109
+ ...TRANSFER,
110
+ ...WHISPER,
111
+ ...CUSTOMER_QUEUE,
112
+ ...IN_MODULE,
113
+ ],
114
+ // "This action can be used in contact flows, transfer flows, and customer
115
+ // queue flows but not in whisper flows or hold flows."
116
+ // https://docs.aws.amazon.com/connect/latest/devguide/participant-actions-getparticipantinput.html
117
+ // The admin guide's block page also marks the outbound whisper flow as
118
+ // supported; the action page governs here, as it does for every other row.
119
+ // https://docs.aws.amazon.com/connect/latest/adminguide/get-customer-input.html
120
+ [ActionType.GetParticipantInput]: [...INBOUND, ...TRANSFER, ...CUSTOMER_QUEUE, ...IN_MODULE],
121
+ // "This action is supported for all channels and in contact flows, transfer
122
+ // flows, and customer queue flows."
123
+ // https://docs.aws.amazon.com/connect/latest/devguide/participant-actions-disconnectparticipant.html
124
+ [ActionType.DisconnectParticipant]: [...INBOUND, ...TRANSFER, ...CUSTOMER_QUEUE, ...IN_MODULE],
125
+ // "This action is available in inbound flows, transfer flows, and customer
126
+ // queue flows. It is not available to hold flows or to whisper flows."
127
+ // https://docs.aws.amazon.com/connect/latest/devguide/flow-control-actions-checkhoursofoperation.html
128
+ [ActionType.CheckHoursOfOperation]: [...INBOUND, ...TRANSFER, ...CUSTOMER_QUEUE, ...IN_MODULE],
129
+ // "This action is available only in whisper flows and customer queue flows.
130
+ // It is not available in flows, hold flows, or transfer flows."
131
+ // https://docs.aws.amazon.com/connect/latest/devguide/flow-control-actions-endflowexecution.html
132
+ [ActionType.EndFlowExecution]: [...WHISPER, ...CUSTOMER_QUEUE, ...IN_MODULE],
133
+ // "This action is available only in flow modules."
134
+ // https://docs.aws.amazon.com/connect/latest/devguide/endflowmoduleexecution.html
135
+ [ActionType.EndFlowModuleExecution]: [...IN_MODULE],
136
+ // "This action is supported by all channels and only supports Inbound flow
137
+ // types."
138
+ // https://docs.aws.amazon.com/connect/latest/devguide/flow-language-actions-invoke-flow-module.html
139
+ // Modules can invoke modules ("up to five levels of nesting",
140
+ // https://docs.aws.amazon.com/connect/latest/adminguide/contact-flow-modules.html),
141
+ // so MODULE is allowed too; the nesting depth itself is module-depth-5's job.
142
+ [ActionType.InvokeFlowModule]: [...INBOUND, ...IN_MODULE],
143
+ // "This action is supported in inbound contact flows and transfer flows. It
144
+ // is not supported in whisper flows, customer queue flows, or hold flows."
145
+ // https://docs.aws.amazon.com/connect/latest/devguide/contact-actions-transfercontacttoqueue.html
146
+ [ActionType.TransferContactToQueue]: [...INBOUND, ...TRANSFER, ...IN_MODULE],
147
+ // "This action is supported only in inbound contact flows and transfer flows.
148
+ // It is not supported in whisper flows, hold flows, or customer queue flows."
149
+ // https://docs.aws.amazon.com/connect/latest/devguide/contact-actions-updatecontacttargetqueue.html
150
+ [ActionType.UpdateContactTargetQueue]: [...INBOUND, ...TRANSFER, ...IN_MODULE],
151
+ // "This action is available in inbound flows and transfer flows. It is not
152
+ // available to hold flows, customer queue flows, or whisper flows."
153
+ // https://docs.aws.amazon.com/connect/latest/devguide/flow-control-actions-transfertoflow.html
154
+ [ActionType.TransferToFlow]: [...INBOUND, ...TRANSFER, ...IN_MODULE],
155
+ // "This is supported only in contact flows, transfer flows, outbound
156
+ // whispers, and customer queue flows. This is not supported in agent/customer
157
+ // whispers or hold flows."
158
+ // https://docs.aws.amazon.com/connect/latest/devguide/contact-actions-updatecontactrecordingbehavior.html
159
+ [ActionType.UpdateContactRecordingBehavior]: [
160
+ ...INBOUND,
161
+ ...TRANSFER,
162
+ "OUTBOUND_WHISPER",
163
+ ...CUSTOMER_QUEUE,
164
+ ...IN_MODULE,
165
+ ],
166
+ };
167
+ /**
168
+ * Modeled actions whose doc page states no flow-type restriction. Listed rather
169
+ * than merely omitted from the table above so that "unrestricted" is a recorded
170
+ * reading of the page, not a gap.
171
+ *
172
+ * Compare: "This action is available in every type of flow."
173
+ * https://docs.aws.amazon.com/connect/latest/devguide/flow-control-actions-compare.html
174
+ * UpdateContactAttributes: "None. This can be used in any type of flow and any
175
+ * channel."
176
+ * https://docs.aws.amazon.com/connect/latest/devguide/contact-actions-updatecontactattributes.html
177
+ * InvokeLambdaFunction: "None. This action is supported by all channels and in
178
+ * all types of flows."
179
+ * https://docs.aws.amazon.com/connect/latest/devguide/interactions-invokelambdafunction.html
180
+ */
181
+ export const FLOW_TYPE_UNRESTRICTED = [
182
+ ActionType.Compare,
183
+ ActionType.UpdateContactAttributes,
184
+ ActionType.InvokeLambdaFunction,
185
+ ];
186
+ /** InvokeLambdaFunction.InvocationTimeLimitSeconds bounds, per the doc page. */
187
+ export const LAMBDA_TIMEOUT_MIN = 1;
188
+ export const LAMBDA_TIMEOUT_MAX = 8;
189
+ /**
190
+ * GetParticipantInput.InputTimeLimitSeconds bounds. The action page requires
191
+ * "a valid integer larger than zero"; the ceiling is the console's Set timeout
192
+ * control, which accepts 1 to 180 seconds.
193
+ * https://docs.aws.amazon.com/connect/latest/devguide/participant-actions-getparticipantinput.html
194
+ * https://docs.aws.amazon.com/connect/latest/adminguide/get-customer-input.html
195
+ */
196
+ export const INPUT_TIMEOUT_MIN = 1;
197
+ export const INPUT_TIMEOUT_MAX = 180;
198
+ /**
199
+ * The keys a DTMF menu branch may match: "must be static and be a single
200
+ * character - 0-9 numeric, *, or #".
201
+ * https://docs.aws.amazon.com/connect/latest/devguide/participant-actions-getparticipantinput.html
202
+ */
203
+ export const DTMF_DIGITS = ["0", "1", "2", "3", "4", "5", "6", "7", "8", "9", "*", "#"];
204
+ //# sourceMappingURL=actions.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"actions.js","sourceRoot":"","sources":["../src/actions.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,2CAA2C;AAC3C,EAAE;AACF,4EAA4E;AAC5E,0EAA0E;AAC1E,wBAAwB;AAIxB,MAAM,CAAC,MAAM,UAAU,GAAG;IACxB,kBAAkB,EAAE,oBAAoB;IACxC,mBAAmB,EAAE,qBAAqB;IAC1C,qBAAqB,EAAE,uBAAuB;IAC9C,qBAAqB,EAAE,uBAAuB;IAC9C,OAAO,EAAE,SAAS;IAClB,cAAc,EAAE,gBAAgB;IAChC,gBAAgB,EAAE,kBAAkB;IACpC,sBAAsB,EAAE,wBAAwB;IAChD,wBAAwB,EAAE,0BAA0B;IACpD,uBAAuB,EAAE,yBAAyB;IAClD,8BAA8B,EAAE,gCAAgC;IAChE,gBAAgB,EAAE,kBAAkB;IACpC,sBAAsB,EAAE,wBAAwB;IAChD,oBAAoB,EAAE,sBAAsB;CACpC,CAAC;AAIX;;;GAGG;AACH,MAAM,CAAC,MAAM,gBAAgB,GAAgE;IAC3F,CAAC,UAAU,CAAC,wBAAwB,CAAC,EAAE,EAAE,OAAO,EAAE,OAAO,EAAE,OAAO,EAAE,OAAO,EAAE;IAC7E,CAAC,UAAU,CAAC,qBAAqB,CAAC,EAAE,EAAE,kBAAkB,EAAE,OAAO,EAAE;IACnE,CAAC,UAAU,CAAC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AAG,CAAC,CAAC;AAEpC;;;;;;GAMG;AACH,MAAM,CAAC,MAAM,iBAAiB,GAAG,CAAC,CAAC;AACnC,MAAM,CAAC,MAAM,iBAAiB,GAAG,GAAG,CAAC;AAErC;;;;GAIG;AACH,MAAM,CAAC,MAAM,WAAW,GAAG,CAAC,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,CAAU,CAAC"}
package/dist/aws.d.ts ADDED
@@ -0,0 +1,27 @@
1
+ /** Anything with a `send`, which is the only surface of a v3 client we use. */
2
+ export interface AwsCommandSender {
3
+ send(command: any): Promise<any>;
4
+ }
5
+ export declare const defaultSleep: (ms: number) => Promise<void>;
6
+ export interface RateLimiterOptions {
7
+ /**
8
+ * Requests per second. Amazon Connect's default quota is RateLimit 2 /
9
+ * BurstLimit 5 for every operation except the exceptions table, per account
10
+ * per Region, and it is shared across users and across instances in the same
11
+ * account. Neither the flow list operations nor the TestCase operations are
12
+ * in the exceptions table, so both adapters default to 2.
13
+ * https://docs.aws.amazon.com/connect/latest/adminguide/amazon-connect-service-limits.html#connect-api-quotas
14
+ */
15
+ requestsPerSecond?: number;
16
+ /** Injected for tests. Defaults to setTimeout. */
17
+ sleep?: (ms: number) => Promise<void>;
18
+ /** Injected for tests. Defaults to Date.now. */
19
+ now?: () => number;
20
+ }
21
+ /**
22
+ * Returns an `await`-able gate that spaces calls. Serialized on one promise
23
+ * chain so concurrent callers share a single budget rather than each pacing
24
+ * itself and jointly exceeding the account limit.
25
+ */
26
+ export declare function createRateLimiter(options?: RateLimiterOptions): () => Promise<void>;
27
+ //# sourceMappingURL=aws.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"aws.d.ts","sourceRoot":"","sources":["../src/aws.ts"],"names":[],"mappings":"AAQA,+EAA+E;AAC/E,MAAM,WAAW,gBAAgB;IAC/B,IAAI,CAAC,OAAO,EAAE,GAAG,GAAG,OAAO,CAAC,GAAG,CAAC,CAAC;CAClC;AAED,eAAO,MAAM,YAAY,GAAI,IAAI,MAAM,KAAG,OAAO,CAAC,IAAI,CACH,CAAC;AAEpD,MAAM,WAAW,kBAAkB;IACjC;;;;;;;OAOG;IACH,iBAAiB,CAAC,EAAE,MAAM,CAAC;IAC3B,kDAAkD;IAClD,KAAK,CAAC,EAAE,CAAC,EAAE,EAAE,MAAM,KAAK,OAAO,CAAC,IAAI,CAAC,CAAC;IACtC,gDAAgD;IAChD,GAAG,CAAC,EAAE,MAAM,MAAM,CAAC;CACpB;AAED;;;;GAIG;AACH,wBAAgB,iBAAiB,CAAC,OAAO,GAAE,kBAAuB,GAAG,MAAM,OAAO,CAAC,IAAI,CAAC,CAiBvF"}
package/dist/aws.js ADDED
@@ -0,0 +1,32 @@
1
+ /*
2
+ * Copyright 2026 The flow-as-code Authors
3
+ * SPDX-License-Identifier: Apache-2.0
4
+ */
5
+ // The little that the export and simulate SDK adapters share. Kept separate so
6
+ // neither adapter imports the other, and so nothing here pulls in the AWS SDK:
7
+ // this module is types and timing only.
8
+ export const defaultSleep = (ms) => new Promise((resolve) => setTimeout(resolve, ms));
9
+ /**
10
+ * Returns an `await`-able gate that spaces calls. Serialized on one promise
11
+ * chain so concurrent callers share a single budget rather than each pacing
12
+ * itself and jointly exceeding the account limit.
13
+ */
14
+ export function createRateLimiter(options = {}) {
15
+ const rps = options.requestsPerSecond ?? 2;
16
+ const minIntervalMs = rps > 0 ? Math.ceil(1000 / rps) : 0;
17
+ const sleep = options.sleep ?? defaultSleep;
18
+ const now = options.now ?? Date.now;
19
+ let nextAllowedAt = 0;
20
+ let gate = Promise.resolve();
21
+ return () => {
22
+ const wait = gate.then(async () => {
23
+ const delay = Math.max(0, nextAllowedAt - now());
24
+ if (delay > 0)
25
+ await sleep(delay);
26
+ nextAllowedAt = now() + minIntervalMs;
27
+ });
28
+ gate = wait.catch(() => undefined);
29
+ return w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AAS,CAAC,CAAC;QACnC,OAAO,IAAI,CAAC;IACd,CAAC,CAAC;AACJ,CAAC"}
@@ -0,0 +1,287 @@
1
+ import type { DtmfDigit } from "./actions.js";
2
+ import type { Condition, ConditionOperator, FlowAction, Transitions } from "./flowdoc.js";
3
+ import type { JsonPath, Ref } from "./refs.js";
4
+ /** A transition target: another block, or its Identifier. */
5
+ export type Target = string | Block;
6
+ export declare function targetId(t: Target): string;
7
+ export declare abstract class Block {
8
+ readonly id: string;
9
+ constructor(id: string);
10
+ abstract readonly type: string;
11
+ protected abstract parameters(): Record<string, unknown>;
12
+ protected abstract transitions(): Transitions;
13
+ toAction(): FlowAction;
14
+ }
15
+ /** Shared shape for a block with a success path and a catch-all error path. */
16
+ interface Wired {
17
+ id: string;
18
+ next: Target;
19
+ onError: Target;
20
+ }
21
+ interface ConditionTransitionInput {
22
+ target: Target;
23
+ operator: ConditionOperator;
24
+ operands: string[];
25
+ }
26
+ /**
27
+ * MessageParticipant accepts exactly one of Text, SSML, or PromptId. The union
28
+ * makes supplying two a compile-time error.
29
+ * PromptId and SSML are voice only; other channels support only Text.
30
+ */
31
+ export type MessageBody = {
32
+ text: string;
33
+ ssml?: never;
34
+ prompt?: never;
35
+ } | {
36
+ ssml: string;
37
+ text?: never;
38
+ prompt?: never;
39
+ } | {
40
+ prompt: Ref<"prompt"> | JsonPath;
41
+ text?: never;
42
+ ssml?: never;
43
+ };
44
+ export type MessageParticipantConfig = Wired & MessageBody;
45
+ export declare class MessageParticipant extends Block {
46
+ private readonly config;
47
+ readonly type: "MessageParticipant";
48
+ constructor(config: MessageParticipantConfig);
49
+ protected parameters(): Record<string, unknown>;
50
+ protected transitions(): Transitions;
51
+ }
52
+ /** One key of a DTMF menu and where it leads. */
53
+ export interface DtmfBranch {
54
+ digit: DtmfDigit;
55
+ target: Target;
56
+ }
57
+ /**
58
+ * A DTMF menu: play something, wait for one key, branch on it.
59
+ *
60
+ * GetParticipantInput has two forms. With StoreInput "False" the key pressed
61
+ * is the run result and Conditions branch on it; conditions "may use only the
62
+ * Equals operator" and each operand "must be static and be a single character
63
+ * - 0-9 numeric, *, or #". With StoreInput "True" the digits are stored,
64
+ * InputValidation is required, and there are no conditions. The builder models
65
+ * the menu form only; the stored-input form, and anything carrying Media,
66
+ * InputEncryption, or DTMFConfiguration, parses to a GenericBlock and
67
+ * round-trips verbatim.
68
+ * https://docs.aws.amazon.com/connect/latest/devguide/participant-actions-getparticipantinput.html
69
+ *
70
+ * The prompt is optional: PromptId, Text, and SSML are each "[Optional]" on
71
+ * the action page, and a menu may follow a prompt played by an earlier block.
72
+ *
73
+ * Every error the menu form documents is a required property: onTimeout
74
+ * (InputTimeLimitExceeded), onNoMatch (NoMatchingCondition), and onError
75
+ * (NoMatchingError). NextAction mirrors onNoMatch, the way
76
+ * CheckHoursOfOperation mirrors its out-of-hours path.
77
+ *
78
+ * InputTimeLimitSeconds and StoreInput are emitted as JSON strings because
79
+ * that is how the console writes them; the admin page's Flow language example
80
+ * has "InputTimeLimitSeconds": "5" and "StoreInput": "False". (InvokeLambda's
81
+ * timeout is a number for the same reason: its page shows a number.)
82
+ * https://docs.aws.amazon.com/connect/latest/adminguide/get-customer-input.html
83
+ */
84
+ export type GetParticipantInputConfig = {
85
+ id: string;
86
+ /**
87
+ * Seconds to wait for the first key. Static integer, 1 to 180 inclusive
88
+ * (INPUT_TIMEOUT_MIN and INPUT_TIMEOUT_MAX).
89
+ */
90
+ timeoutSeconds: number;
91
+ /**
92
+ * Keys that branch, in the order Connect evaluates them. May be empty. Each
93
+ * key may branch once; a repeated key is refused by the constructor.
94
+ */
95
+ branches: DtmfBranch[];
96
+ onTimeout: Target;
97
+ onNoMatch: Target;
98
+ onError: Target;
99
+ } & (MessageBody | {
100
+ text?: never;
101
+ ssml?: never;
102
+ prompt?: never;
103
+ });
104
+ export declare class GetParticipantInput extends Block {
105
+ private readonly config;
106
+ readonly type: "GetParticipantInput";
107
+ constructor(config: GetParticipantInputConfig);
108
+ protected parameters(): Record<string, unknown>;
109
+ protected transitions(): Transitions;
110
+ }
111
+ /** Terminal. Takes no parameters and supports no errors. */
112
+ export declare class DisconnectParticipant extends Block {
113
+ readonly type: "DisconnectParticipant";
114
+ constructor(config: {
115
+ id: string;
116
+ });
117
+ protected parameters(): Record<string, unknown>;
118
+ protected transitions(): Transitions;
119
+ }
120
+ /**
121
+ * Connect requires exactly two conditions on this action, Equals True and
122
+ * Equals False, and no others. Both are therefore required config, not
123
+ * something the caller wires by hand.
124
+ */
125
+ export interface CheckHoursOfOperationConfig {
126
+ id: string;
127
+ /** Optional. When absent, the contact's TargetQueue hours are used. */
128
+ hours?: Ref<"hours"> | JsonPath;
129
+ onInHours: Target;
130
+ onOutOfHours: Target;
131
+ onError: Target;
132
+ }
133
+ export declare class CheckHoursOfOperation extends Block {
134
+ private readonly config;
135
+ readonly type: "CheckHoursOfOperation";
136
+ constructor(config: CheckHoursOfOperationConfig);
137
+ protected parameters(): Record<string, unknown>;
138
+ protected transitions(): Transitions;
139
+ }
140
+ export interface CompareBranch {
141
+ operator: ConditionOperator;
142
+ operands: string[];
143
+ target: Target;
144
+ }
145
+ /** Compare fails with NoMatchingCondition, the only modeled action that does. */
146
+ export interface CompareConfig {
147
+ id: string;
148
+ value: JsonPath;
149
+ branches: CompareBranch[];
150
+ onNoMatch: Target;
151
+ }
152
+ export declare class Compare extends Block {
153
+ private readonly config;
154
+ readonly type: "Compare";
155
+ constructor(config: CompareConfig);
156
+ protected parameters(): Record<string, unknown>;
157
+ protected transitions(): Transitions;
158
+ }
159
+ export interface TransferToFlowConfig extends Wired {
160
+ flow: Ref<"flow"> | JsonPath;
161
+ }
162
+ export declare class TransferToFlow extends Block {
163
+ private readonly config;
164
+ readonly type: "TransferToFlow";
165
+ constructor(config: TransferToFlowConfig);
166
+ protected parameters(): Record<string, unknown>;
167
+ protected transitions(): Transitions;
168
+ }
169
+ /** Terminal. Only legal in whisper and customer queue flows. */
170
+ export declare class EndFlowExecution extends Block {
171
+ readonly type: "EndFlowExecution";
172
+ constructor(config: {
173
+ id: string;
174
+ });
175
+ protected parameters(): Record<string, unknown>;
176
+ protected transitions(): Transitions;
177
+ }
178
+ /** Accepts a queue or an agent queue, never both. */
179
+ export type QueueTarget = {
180
+ queue: Ref<"queue"> | JsonPath;
181
+ agent?: never;
182
+ } | {
183
+ agent: Ref<"queue"> | JsonPath;
184
+ queue?: never;
185
+ };
186
+ export type UpdateContactTargetQueueConfig = Wired & QueueTarget;
187
+ export declare class UpdateContactTargetQueue extends Block {
188
+ private readonly config;
189
+ readonly type: "UpdateContactTargetQueue";
190
+ constructor(config: UpdateContactTargetQueueConfig);
191
+ protected parameters(): Record<string, unknown>;
192
+ protected transitions(): Transitions;
193
+ }
194
+ /** Takes no parameters. The queue comes from a preceding UpdateContactTargetQueue. */
195
+ export interface TransferContactToQueueConfig extends Wired {
196
+ onQueueAtCapacity: Target;
197
+ }
198
+ export declare class TransferContactToQueue extends Block {
199
+ private readonly config;
200
+ readonly type: "TransferContactToQueue";
201
+ constructor(config: TransferContactToQueueConfig);
202
+ protected parameters(): Record<string, unknown>;
203
+ protected transitions(): Transitions;
204
+ }
205
+ export interface UpdateContactAttributesConfig extends Wired {
206
+ attributes: Record<string, string>;
207
+ /** Defaults to Current. */
208
+ targetContact?: "Current" | "Related";
209
+ }
210
+ export declare class UpdateContactAttributes extends Block {
211
+ private readonly config;
212
+ readonly type: "UpdateContactAttributes";
213
+ constructor(config: UpdateContactAttributesConfig);
214
+ protected parameters(): Record<string, unknown>;
215
+ protected transitions(): Transitions;
216
+ }
217
+ export interface UpdateContactRecordingBehaviorConfig extends Wired {
218
+ recordedParticipants: ("Agent" | "Customer")[];
219
+ screenRecordedParticipants?: "Agent"[];
220
+ ivrRecordingBehavior?: "Enabled" | "Disabled";
221
+ }
222
+ export declare class UpdateContactRecordingBehavior extends Block {
223
+ private readonly config;
224
+ readonly type: "UpdateContactRecordingBehavior";
225
+ constructor(config: UpdateContactRecordingBehaviorConfig);
226
+ protected parameters(): Record<string, unknown>;
227
+ protected transitions(): Transitions;
228
+ }
229
+ export interface InvokeFlowModuleConfig extends Wired {
230
+ module: Ref<"module"> | JsonPath;
231
+ }
232
+ export declare class InvokeFlowModule extends Block {
233
+ private readonly config;
234
+ readonly type: "InvokeFlowModule";
235
+ constructor(config: InvokeFlowModuleConfig);
236
+ protected parameters(): Record<string, unknown>;
237
+ protected transitions(): Transitions;
238
+ }
239
+ /** Terminal. Only legal inside a module. */
240
+ export declare class EndFlowModuleExecution extends Block {
241
+ readonly type: "EndFlowModuleExecution";
242
+ constructor(config: {
243
+ id: string;
244
+ });
245
+ protected parameters(): Record<string, unknown>;
246
+ protected transitions(): Transitions;
247
+ }
248
+ export interface InvokeLambdaFunctionConfig extends Wired {
249
+ lambda: Ref<"lambda"> | JsonPath;
250
+ /** Static integer, 1 to 8 inclusive. Connect rejects anything else. */
251
+ timeoutSeconds: number;
252
+ invocationType?: "SYNCHRONOUS" | "ASYNCHRONOUS";
253
+ attributes?: Record<string, string>;
254
+ responseType?: "STRING_MAP" | "JSON";
255
+ }
256
+ export declare class InvokeLambdaFunction extends Block {
257
+ private readonly config;
258
+ readonly type: "InvokeLambdaFunction";
259
+ constructor(config: InvokeLambdaFunctionConfig);
260
+ protected parameters(): Record<string, unknown>;
261
+ protected transitions(): Transitions;
262
+ }
263
+ /**
264
+ * Any Action the builder does not model. Preserved verbatim through synth,
265
+ * codegen, the studio, and both emitters. This is what keeps a small modeled
266
+ * set survivable: 49 action types are documented and the builder models 14.
267
+ */
268
+ export interface GenericBlockConfig {
269
+ id: string;
270
+ type: string;
271
+ parameters?: Record<string, unknown>;
272
+ next?: Target;
273
+ errors?: {
274
+ errorType: string;
275
+ target: Target;
276
+ }[];
277
+ conditions?: ConditionTransitionInput[];
278
+ }
279
+ export declare class GenericBlock extends Block {
280
+ private readonly config;
281
+ readonly type: string;
282
+ constructor(config: GenericBlockConfig);
283
+ protected parameters(): Record<string, unknown>;
284
+ protected transitions(): Transitions;
285
+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