@teamkeel/testing-runtime 0.458.0 → 0.460.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.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@teamkeel/testing-runtime",
3
- "version": "0.458.0",
3
+ "version": "0.460.0",
4
4
  "description": "Internal package used by the generated @teamkeel/testing package",
5
5
  "exports": "./src/index.mjs",
6
6
  "typings": "src/index.d.ts",
@@ -78,6 +78,33 @@ export class FlowExecutor {
78
78
  }).then(handleResponse);
79
79
  }
80
80
 
81
+ async signedLink(options = {}) {
82
+ const body = {};
83
+ if (options.inputs !== undefined) body.inputs = options.inputs;
84
+ if (options.reusable !== undefined) body.reusable = options.reusable;
85
+ if (options.expiresAt !== undefined && options.expiresAt !== null) {
86
+ body.expiresAt =
87
+ options.expiresAt instanceof Date
88
+ ? options.expiresAt.toISOString()
89
+ : options.expiresAt;
90
+ }
91
+
92
+ const result = await fetch(this._flowUrl + "/share", {
93
+ method: "POST",
94
+ body: JSON.stringify(body),
95
+ headers: this.headers(),
96
+ }).then(handleResponse);
97
+
98
+ return {
99
+ url: result.url,
100
+ expiresAt: result.expiresAt ? new Date(result.expiresAt) : null,
101
+ flow: {
102
+ name: result.flow?.name ?? this._name,
103
+ runId: result.flow?.runId ?? null,
104
+ },
105
+ };
106
+ }
107
+
81
108
  async cancel(id) {
82
109
  return fetch(this._flowUrl + "/" + encodeURIComponent(id) + "/cancel", {
83
110
  method: "POST",
package/src/index.d.ts CHANGED
@@ -142,6 +142,15 @@ declare class FlowExecutor<Input = {}> {
142
142
  withIdentity(identity: sdk.Identity): FlowExecutor<Input>;
143
143
  withAuthToken(token: string): FlowExecutor<Input>;
144
144
  start(inputs: Input): Promise<FlowRun<Input>>;
145
+ signedLink(options?: {
146
+ inputs?: Input;
147
+ expiresAt?: Date;
148
+ reusable?: boolean;
149
+ }): Promise<{
150
+ url: string;
151
+ expiresAt: Date | null;
152
+ flow: { name: string; runId: string | null };
153
+ }>;
145
154
  get(id: string): Promise<FlowRun<Input>>;
146
155
  cancel(id: string): Promise<FlowRun<Input>>;
147
156
  back(id: string): Promise<FlowRun<Input>>;