Skip to content

Automation Versioning#151

Draft
chrisdrackett wants to merge 4 commits intomainfrom
feature/versions
Draft

Automation Versioning#151
chrisdrackett wants to merge 4 commits intomainfrom
feature/versions

Conversation

@chrisdrackett
Copy link
Copy Markdown
Collaborator

No description provided.

@@ -0,0 +1,348 @@
import { TServiceParams } from "@digital-alchemy/core";
import { and, eq } from "drizzle-orm";
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🚫 [tsc] <6133> reported by reviewdog 🐶
'and' is declared but its value is never read.

"/:versionId",
{ schema: { body: UpdateDraftBody, params: versionParams } },
({ body, params: { versionId } }) =>
code_glue.automationVersion.updateDraft(versionId, {
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🚫 [tsc] <2379> reported by reviewdog 🐶
Argument of type '{ body: string | undefined; name: string | undefined; notes: string | undefined; }' is not assignable to parameter of type '{ body?: string; name?: string; notes?: string; }' with 'exactOptionalPropertyTypes: true'. Consider adding 'undefined' to the types of the target's properties.
Types of property 'body' are incompatible.
Type 'string | undefined' is not assignable to type 'string'.
Type 'undefined' is not assignable to type 'string'.

"/:versionId/finalize",
{ schema: { body: FinalizeBody, params: versionParams } },
({ body, params: { versionId } }) =>
code_glue.automationVersion.finalizeVersion(versionId, {
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🚫 [tsc] <2379> reported by reviewdog 🐶
Argument of type '{ name: string | undefined; notes: string | undefined; wasAutoSaved: boolean; makeActive: boolean | undefined; }' is not assignable to parameter of type '{ name?: string; notes?: string; wasAutoSaved: boolean; makeActive?: boolean; }' with 'exactOptionalPropertyTypes: true'. Consider adding 'undefined' to the types of the target's properties.
Types of property 'name' are incompatible.
Type 'string | undefined' is not assignable to type 'string'.
Type 'undefined' is not assignable to type 'string'.

day: "numeric",
});

const version = await database.automationVersion.create({
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🚫 [tsc] <2379> reported by reviewdog 🐶
Argument of type '{ automationId: string; body: string; createDate: string; isActive: true; isDraft: false; name: string; notes: undefined; parentVersionId: undefined; wasAutoSaved: false; writtenByAi: false; }' is not assignable to parameter of type '{ name?: string; notes?: string; parentVersionId?: string; automationId: string; body: string; isActive: boolean; createDate: string; isDraft: boolean; wasAutoSaved: boolean; writtenByAi: boolean; }' with 'exactOptionalPropertyTypes: true'. Consider adding 'undefined' to the types of the target's properties.
Types of property 'notes' are incompatible.
Type 'undefined' is not assignable to type 'string'.

body: string,
parentVersionId: string | undefined,
) {
return await database.automationVersion.create({
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🚫 [tsc] <2379> reported by reviewdog 🐶
Argument of type '{ automationId: string; body: string; createDate: string; isActive: false; isDraft: true; name: undefined; notes: undefined; parentVersionId: string | undefined; wasAutoSaved: false; writtenByAi: false; }' is not assignable to parameter of type '{ name?: string; notes?: string; parentVersionId?: string; automationId: string; body: string; isActive: boolean; createDate: string; isDraft: boolean; wasAutoSaved: boolean; writtenByAi: boolean; }' with 'exactOptionalPropertyTypes: true'. Consider adding 'undefined' to the types of the target's properties.
Types of property 'name' are incompatible.
Type 'undefined' is not assignable to type 'string'.

throw new Error(`Automation ${version.automationId} not found`);
}

const updated = await database.automationVersion.update(versionId, {
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🚫 [tsc] <2379> reported by reviewdog 🐶
Argument of type '{ isActive: boolean; isDraft: false; name: string | undefined; notes: string | undefined; wasAutoSaved: boolean; }' is not assignable to parameter of type '{ name?: string; body?: string; isActive?: boolean; createDate?: string; isDraft?: boolean; notes?: string; parentVersionId?: string; wasAutoSaved?: boolean; writtenByAi?: boolean; }' with 'exactOptionalPropertyTypes: true'. Consider adding 'undefined' to the types of the target's properties.
Types of property 'name' are incompatible.
Type 'string | undefined' is not assignable to type 'string'.
Type 'undefined' is not assignable to type 'string'.

};

function loadRow(row: VersionRow): AutomationVersion {
return {
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🚫 [tsc] <2375> reported by reviewdog 🐶
Type '{ automationId: string; body: string; createDate: string; id: string; isActive: boolean; isDraft: boolean; name: string | undefined; notes: string | undefined; parentVersionId: string | undefined; wasAutoSaved: boolean; writtenByAi: boolean; }' is not assignable to type '{ name?: string; notes?: string; parentVersionId?: string; automationId: string; body: string; id: string; isActive: boolean; createDate: string; isDraft: boolean; wasAutoSaved: boolean; writtenByAi: boolean; }' with 'exactOptionalPropertyTypes: true'. Consider adding 'undefined' to the types of the target's properties.
Types of property 'name' are incompatible.
Type 'string | undefined' is not assignable to type 'string'.
Type 'undefined' is not assignable to type 'string'.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant