@teamkeel/functions-runtime 0.443.0 → 0.444.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/dist/index.cjs +15 -6
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +11 -7
- package/dist/index.d.ts +11 -7
- package/dist/index.js +15 -6
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.d.cts
CHANGED
|
@@ -272,18 +272,21 @@ declare class Task$1 {
|
|
|
272
272
|
deferredUntil: Date | null | undefined;
|
|
273
273
|
createdAt: Date | undefined;
|
|
274
274
|
updatedAt: Date | undefined;
|
|
275
|
-
|
|
275
|
+
assignedToUserId: any;
|
|
276
|
+
assignedToTeam: any;
|
|
276
277
|
assignedAt: Date | null | undefined;
|
|
277
278
|
resolvedAt: Date | null | undefined;
|
|
278
279
|
flowRunId: any;
|
|
279
280
|
/**
|
|
280
|
-
* Assigns the task to
|
|
281
|
-
* @param {Object} options Options containing
|
|
282
|
-
* @param {string} options.
|
|
281
|
+
* Assigns the task to a user or team.
|
|
282
|
+
* @param {Object} options Options containing userId or teamName (exactly one required)
|
|
283
|
+
* @param {string} [options.userId] The ID of the user to assign the task to
|
|
284
|
+
* @param {string} [options.teamName] The name of the team to assign the task to
|
|
283
285
|
* @returns {Promise<void>}
|
|
284
286
|
*/
|
|
285
|
-
assign({
|
|
286
|
-
|
|
287
|
+
assign({ userId, teamName }: {
|
|
288
|
+
userId?: string | undefined;
|
|
289
|
+
teamName?: string | undefined;
|
|
287
290
|
}): Promise<void>;
|
|
288
291
|
/**
|
|
289
292
|
* Starts the task, creating and running the associated flow.
|
|
@@ -1564,7 +1567,8 @@ type Task = {
|
|
|
1564
1567
|
deferredUntil?: Date;
|
|
1565
1568
|
createdAt: Date;
|
|
1566
1569
|
updatedAt: Date;
|
|
1567
|
-
|
|
1570
|
+
assignedToUserId?: string;
|
|
1571
|
+
assignedToTeam?: string;
|
|
1568
1572
|
assignedAt?: Date;
|
|
1569
1573
|
resolvedAt?: Date;
|
|
1570
1574
|
flowRunId?: string;
|
package/dist/index.d.ts
CHANGED
|
@@ -272,18 +272,21 @@ declare class Task$1 {
|
|
|
272
272
|
deferredUntil: Date | null | undefined;
|
|
273
273
|
createdAt: Date | undefined;
|
|
274
274
|
updatedAt: Date | undefined;
|
|
275
|
-
|
|
275
|
+
assignedToUserId: any;
|
|
276
|
+
assignedToTeam: any;
|
|
276
277
|
assignedAt: Date | null | undefined;
|
|
277
278
|
resolvedAt: Date | null | undefined;
|
|
278
279
|
flowRunId: any;
|
|
279
280
|
/**
|
|
280
|
-
* Assigns the task to
|
|
281
|
-
* @param {Object} options Options containing
|
|
282
|
-
* @param {string} options.
|
|
281
|
+
* Assigns the task to a user or team.
|
|
282
|
+
* @param {Object} options Options containing userId or teamName (exactly one required)
|
|
283
|
+
* @param {string} [options.userId] The ID of the user to assign the task to
|
|
284
|
+
* @param {string} [options.teamName] The name of the team to assign the task to
|
|
283
285
|
* @returns {Promise<void>}
|
|
284
286
|
*/
|
|
285
|
-
assign({
|
|
286
|
-
|
|
287
|
+
assign({ userId, teamName }: {
|
|
288
|
+
userId?: string | undefined;
|
|
289
|
+
teamName?: string | undefined;
|
|
287
290
|
}): Promise<void>;
|
|
288
291
|
/**
|
|
289
292
|
* Starts the task, creating and running the associated flow.
|
|
@@ -1564,7 +1567,8 @@ type Task = {
|
|
|
1564
1567
|
deferredUntil?: Date;
|
|
1565
1568
|
createdAt: Date;
|
|
1566
1569
|
updatedAt: Date;
|
|
1567
|
-
|
|
1570
|
+
assignedToUserId?: string;
|
|
1571
|
+
assignedToTeam?: string;
|
|
1568
1572
|
assignedAt?: Date;
|
|
1569
1573
|
resolvedAt?: Date;
|
|
1570
1574
|
flowRunId?: string;
|
package/dist/index.js
CHANGED
|
@@ -2051,26 +2051,35 @@ var Task = class {
|
|
|
2051
2051
|
this.deferredUntil = data.deferredUntil ? new Date(data.deferredUntil) : null;
|
|
2052
2052
|
this.createdAt = new Date(data.createdAt);
|
|
2053
2053
|
this.updatedAt = new Date(data.updatedAt);
|
|
2054
|
-
this.
|
|
2054
|
+
this.assignedToUserId = data.assignedToUser ?? null;
|
|
2055
|
+
this.assignedToTeam = data.assignedToTeam ?? null;
|
|
2055
2056
|
this.assignedAt = data.assignedAt ? new Date(data.assignedAt) : null;
|
|
2056
2057
|
this.resolvedAt = data.resolvedAt ? new Date(data.resolvedAt) : null;
|
|
2057
2058
|
this.flowRunId = data.flowRunId ?? null;
|
|
2058
2059
|
}
|
|
2059
2060
|
/**
|
|
2060
|
-
* Assigns the task to
|
|
2061
|
-
* @param {Object} options Options containing
|
|
2062
|
-
* @param {string} options.
|
|
2061
|
+
* Assigns the task to a user or team.
|
|
2062
|
+
* @param {Object} options Options containing userId or teamName (exactly one required)
|
|
2063
|
+
* @param {string} [options.userId] The ID of the user to assign the task to
|
|
2064
|
+
* @param {string} [options.teamName] The name of the team to assign the task to
|
|
2063
2065
|
* @returns {Promise<void>}
|
|
2064
2066
|
*/
|
|
2065
|
-
async assign({
|
|
2067
|
+
async assign({ userId, teamName }) {
|
|
2066
2068
|
const name = spanNameForModelAPI(this._taskName, "assign");
|
|
2067
2069
|
return withSpan(name, async () => {
|
|
2068
2070
|
const apiUrl = getApiUrl();
|
|
2069
2071
|
const url = `${apiUrl}/topics/json/${this._taskName}/tasks/${this.id}/assign`;
|
|
2072
|
+
const body = {};
|
|
2073
|
+
if (userId !== void 0) {
|
|
2074
|
+
body.assigned_to_user = userId;
|
|
2075
|
+
}
|
|
2076
|
+
if (teamName !== void 0) {
|
|
2077
|
+
body.assigned_to_team = teamName;
|
|
2078
|
+
}
|
|
2070
2079
|
const response = await fetch(url, {
|
|
2071
2080
|
method: "PUT",
|
|
2072
2081
|
headers: buildHeaders(this._identity, this._authToken),
|
|
2073
|
-
body: JSON.stringify(
|
|
2082
|
+
body: JSON.stringify(body)
|
|
2074
2083
|
});
|
|
2075
2084
|
if (!response.ok) {
|
|
2076
2085
|
const errorBody = await response.json().catch(() => ({}));
|