Add browser job capture to the job tracker
Deploy with Docker Compose / deploy (push) Successful in 1m31s
Deploy with Docker Compose / deploy (push) Successful in 1m31s
A Violentmonkey userscript, served by the site and installed from /cv/jobs, adds the posting open in the browser (LinkedIn, an ATS, any company page) to the tracker. Claude reads the title, company and location off the page text. - Three token-guarded REST routes under /api/jobs/capture (status, extract, upsert). They take a bearer token, JOB_CAPTURE_TOKEN, because the auth cookies are SameSite=Lax and never sent from another origin. An unset token switches the routes off. - The upsert matches on a canonical posting URL, then (company, job title), so a capture and the email pipeline do not make two rows for one job. - The Claude call is a new internal Python route, /internal/jobs/extract, alongside the rowing reader; the client and fence stripping they share move to python/app/claude.py. - New "saved" status ranked below "applied", and a description column holding the posting text, shown per row on the tracker. Co-Authored-By: Claude Opus 5.5 <[email protected]>
This commit is contained in:
+63
-12
@@ -100,16 +100,17 @@ type ComplexityRoot struct {
|
||||
}
|
||||
|
||||
JobApplication struct {
|
||||
AppliedAt func(childComplexity int) int
|
||||
Company func(childComplexity int) int
|
||||
CreatedAt func(childComplexity int) int
|
||||
ID func(childComplexity int) int
|
||||
JobTitle func(childComplexity int) int
|
||||
Location func(childComplexity int) int
|
||||
Notes func(childComplexity int) int
|
||||
Status func(childComplexity int) int
|
||||
URL func(childComplexity int) int
|
||||
UpdatedAt func(childComplexity int) int
|
||||
AppliedAt func(childComplexity int) int
|
||||
Company func(childComplexity int) int
|
||||
CreatedAt func(childComplexity int) int
|
||||
Description func(childComplexity int) int
|
||||
ID func(childComplexity int) int
|
||||
JobTitle func(childComplexity int) int
|
||||
Location func(childComplexity int) int
|
||||
Notes func(childComplexity int) int
|
||||
Status func(childComplexity int) int
|
||||
URL func(childComplexity int) int
|
||||
UpdatedAt func(childComplexity int) int
|
||||
}
|
||||
|
||||
Message struct {
|
||||
@@ -571,6 +572,12 @@ func (e *executableSchema) Complexity(ctx context.Context, typeName, field strin
|
||||
}
|
||||
|
||||
return e.ComplexityRoot.JobApplication.CreatedAt(childComplexity), true
|
||||
case "JobApplication.description":
|
||||
if e.ComplexityRoot.JobApplication.Description == nil {
|
||||
break
|
||||
}
|
||||
|
||||
return e.ComplexityRoot.JobApplication.Description(childComplexity), true
|
||||
case "JobApplication.id":
|
||||
if e.ComplexityRoot.JobApplication.ID == nil {
|
||||
break
|
||||
@@ -1560,6 +1567,8 @@ func (ec *executionContext) childFields_JobApplication(ctx context.Context, fiel
|
||||
return ec.fieldContext_JobApplication_notes(ctx, field)
|
||||
case "appliedAt":
|
||||
return ec.fieldContext_JobApplication_appliedAt(ctx, field)
|
||||
case "description":
|
||||
return ec.fieldContext_JobApplication_description(ctx, field)
|
||||
}
|
||||
return nil, fmt.Errorf("no field named %q was found under type JobApplication", field.Name)
|
||||
}
|
||||
@@ -3275,6 +3284,29 @@ func (ec *executionContext) fieldContext_JobApplication_appliedAt(_ context.Cont
|
||||
return graphql.NewScalarFieldContext("JobApplication", field, false, false, errors.New("field of type Time does not have child fields"))
|
||||
}
|
||||
|
||||
func (ec *executionContext) _JobApplication_description(ctx context.Context, field graphql.CollectedField, obj *models.JobApplication) (ret graphql.Marshaler) {
|
||||
return graphql.ResolveField(
|
||||
ctx,
|
||||
ec.OperationContext,
|
||||
field,
|
||||
func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) {
|
||||
return ec.fieldContext_JobApplication_description(ctx, field)
|
||||
},
|
||||
func(ctx context.Context) (any, error) {
|
||||
return obj.Description, nil
|
||||
},
|
||||
nil,
|
||||
func(ctx context.Context, selections ast.SelectionSet, v *string) graphql.Marshaler {
|
||||
return ec.marshalOString2ᚖstring(ctx, selections, v)
|
||||
},
|
||||
true,
|
||||
false,
|
||||
)
|
||||
}
|
||||
func (ec *executionContext) fieldContext_JobApplication_description(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) {
|
||||
return graphql.NewScalarFieldContext("JobApplication", field, false, false, errors.New("field of type String does not have child fields"))
|
||||
}
|
||||
|
||||
func (ec *executionContext) _Message_id(ctx context.Context, field graphql.CollectedField, obj *models.Message) (ret graphql.Marshaler) {
|
||||
return graphql.ResolveField(
|
||||
ctx,
|
||||
@@ -7456,7 +7488,7 @@ func (ec *executionContext) unmarshalInputCreateJobApplicationInput(ctx context.
|
||||
asMap[k] = v
|
||||
}
|
||||
|
||||
fieldsInOrder := [...]string{"jobTitle", "company", "location", "url", "status", "notes", "appliedAt"}
|
||||
fieldsInOrder := [...]string{"jobTitle", "company", "location", "url", "status", "notes", "appliedAt", "description"}
|
||||
for _, k := range fieldsInOrder {
|
||||
v, ok := asMap[k]
|
||||
if !ok {
|
||||
@@ -7512,6 +7544,13 @@ func (ec *executionContext) unmarshalInputCreateJobApplicationInput(ctx context.
|
||||
return it, err
|
||||
}
|
||||
it.AppliedAt = data
|
||||
case "description":
|
||||
ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("description"))
|
||||
data, err := ec.unmarshalOString2ᚖstring(ctx, v)
|
||||
if err != nil {
|
||||
return it, err
|
||||
}
|
||||
it.Description = data
|
||||
}
|
||||
}
|
||||
return it, nil
|
||||
@@ -7769,7 +7808,7 @@ func (ec *executionContext) unmarshalInputUpdateJobApplicationInput(ctx context.
|
||||
asMap[k] = v
|
||||
}
|
||||
|
||||
fieldsInOrder := [...]string{"jobTitle", "company", "location", "url", "status", "notes", "appliedAt"}
|
||||
fieldsInOrder := [...]string{"jobTitle", "company", "location", "url", "status", "notes", "appliedAt", "description"}
|
||||
for _, k := range fieldsInOrder {
|
||||
v, ok := asMap[k]
|
||||
if !ok {
|
||||
@@ -7825,6 +7864,13 @@ func (ec *executionContext) unmarshalInputUpdateJobApplicationInput(ctx context.
|
||||
return it, err
|
||||
}
|
||||
it.AppliedAt = data
|
||||
case "description":
|
||||
ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("description"))
|
||||
data, err := ec.unmarshalOString2ᚖstring(ctx, v)
|
||||
if err != nil {
|
||||
return it, err
|
||||
}
|
||||
it.Description = data
|
||||
}
|
||||
}
|
||||
return it, nil
|
||||
@@ -8539,6 +8585,11 @@ func (ec *executionContext) _JobApplication(ctx context.Context, sel ast.Selecti
|
||||
if out.Values[i] == graphql.RequiredNull {
|
||||
atomic.AddUint32(&out.Invalids, 1)
|
||||
}
|
||||
case "description":
|
||||
out.Values[i] = ec._JobApplication_description(ctx, field, obj)
|
||||
if out.Values[i] == graphql.RequiredNull {
|
||||
atomic.AddUint32(&out.Invalids, 1)
|
||||
}
|
||||
default:
|
||||
panic("unknown field " + strconv.Quote(field.Name))
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user