Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 5 additions & 4 deletions cmd/device-definitions-api/sync_device_definition_search.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ import (

"github.com/DIMO-Network/device-definitions-api/internal/config"
"github.com/DIMO-Network/device-definitions-api/internal/core/common"
"github.com/DIMO-Network/device-definitions-api/internal/infrastructure/db/models"
"github.com/DIMO-Network/shared/pkg/db"
"github.com/google/subcommands"
"github.com/rs/zerolog"
Expand Down Expand Up @@ -72,6 +71,8 @@ func (p *syncDeviceDefinitionSearchCmd) Execute(ctx context.Context, _ *flag.Fla

collectionName := p.settings.SearchServiceIndexName

identity := gateways.NewIdentityAPIService(&p.logger, &p.settings)

if p.createIndex {

_, err := client.Collection(collectionName).Delete(context.Background())
Expand Down Expand Up @@ -152,7 +153,7 @@ func (p *syncDeviceDefinitionSearchCmd) Execute(ctx context.Context, _ *flag.Fla

fmt.Printf("Starting processing definitions\n")

makes, err := models.DeviceMakes().All(ctx, pdb.DBS().Reader)
makes, err := identity.GetManufacturers()
if err != nil {
p.logger.Fatal().Err(err).Send()
}
Expand All @@ -162,7 +163,7 @@ func (p *syncDeviceDefinitionSearchCmd) Execute(ctx context.Context, _ *flag.Fla
var documents []SearchEntryItem
// iterate over all makes, then query tableland
for _, dm := range makes {
manufacturer, err := onChainSvc.GetManufacturer(dm.NameSlug)
manufacturer, err := onChainSvc.GetManufacturer(stringutils.SlugString(dm.Name))
if err != nil {
p.logger.Fatal().Err(err).Send()
}
Expand All @@ -186,7 +187,7 @@ func (p *syncDeviceDefinitionSearchCmd) Execute(ctx context.Context, _ *flag.Fla
}

makeName := dm.Name
makeSlug := dm.NameSlug
makeSlug := stringutils.SlugString(dm.Name)
manufacturerTokenID := manufacturer.TokenID

newDocument := SearchEntryItem{
Expand Down
33 changes: 0 additions & 33 deletions docs/docs.go
Original file line number Diff line number Diff line change
Expand Up @@ -364,39 +364,6 @@ const docTemplate = `{
}
}
},
"/v2/device-definitions/{make}/all": {
"get": {
"description": "gets a device definition",
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"tags": [
"device-definitions"
],
"summary": "gets all device definitions by Makes, models, and years, from tableland (on-chain records)",
"operationId": "GetDeviceDefinitionV2All",
"parameters": [
{
"type": "string",
"description": "device make name",
"name": "make",
"in": "path",
"required": true
}
],
"responses": {
"200": {
"description": "OK"
},
"500": {
"description": "Internal Server Error"
}
}
}
},
"/vin-profile/{vin}": {
"get": {
"security": [
Expand Down
33 changes: 0 additions & 33 deletions docs/swagger.json
Original file line number Diff line number Diff line change
Expand Up @@ -355,39 +355,6 @@
}
}
},
"/v2/device-definitions/{make}/all": {
"get": {
"description": "gets a device definition",
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"tags": [
"device-definitions"
],
"summary": "gets all device definitions by Makes, models, and years, from tableland (on-chain records)",
"operationId": "GetDeviceDefinitionV2All",
"parameters": [
{
"type": "string",
"description": "device make name",
"name": "make",
"in": "path",
"required": true
}
],
"responses": {
"200": {
"description": "OK"
},
"500": {
"description": "Internal Server Error"
}
}
}
},
"/vin-profile/{vin}": {
"get": {
"security": [
Expand Down
23 changes: 0 additions & 23 deletions docs/swagger.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -388,29 +388,6 @@ paths:
summary: gets all supported manufacturers for the smartcar external integration
tags:
- device-definitions
/v2/device-definitions/{make}/all:
get:
consumes:
- application/json
description: gets a device definition
operationId: GetDeviceDefinitionV2All
parameters:
- description: device make name
in: path
name: make
required: true
type: string
produces:
- application/json
responses:
"200":
description: OK
"500":
description: Internal Server Error
summary: gets all device definitions by Makes, models, and years, from tableland
(on-chain records)
tags:
- device-definitions
/vin-profile/{vin}:
get:
description: gets VIN profile if we have it.
Expand Down
26 changes: 23 additions & 3 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ require (
github.com/tidwall/sjson v1.2.5
github.com/typesense/typesense-go v1.1.0
github.com/volatiletech/null/v8 v8.1.2
github.com/volatiletech/sqlboiler/v4 v4.16.2
github.com/volatiletech/sqlboiler/v4 v4.19.1
github.com/volatiletech/strmangle v0.0.6
go.uber.org/mock v0.4.0
golang.org/x/exp v0.0.0-20240719175910-8a7402abbf56
Expand All @@ -47,6 +47,9 @@ require (
dario.cat/mergo v1.0.0 // indirect
github.com/DIMO-Network/yaml v0.1.0 // indirect
github.com/DataDog/zstd v1.5.2 // indirect
github.com/Masterminds/goutils v1.1.1 // indirect
github.com/Masterminds/semver/v3 v3.1.1 // indirect
github.com/Masterminds/sprig/v3 v3.2.2 // indirect
github.com/MicahParks/keyfunc/v2 v2.1.0 // indirect
github.com/Microsoft/hcsshim v0.12.5 // indirect
github.com/antchfx/xpath v1.3.1 // indirect
Expand Down Expand Up @@ -86,13 +89,19 @@ require (
github.com/googleapis/enterprise-certificate-proxy v0.3.4 // indirect
github.com/googleapis/gax-go/v2 v2.13.0 // indirect
github.com/gorilla/websocket v1.5.3 // indirect
github.com/hashicorp/hcl v1.0.0 // indirect
github.com/holiman/uint256 v1.3.2 // indirect
github.com/huandu/xstrings v1.3.2 // indirect
github.com/imdario/mergo v0.3.13 // indirect
github.com/inconshreveable/mousetrap v1.1.0 // indirect
github.com/lib/pq v1.10.9 // indirect
github.com/lufia/plan9stats v0.0.0-20240513124658-fba389f38bae // indirect
github.com/mattn/go-colorable v0.1.13 // indirect
github.com/mattn/go-isatty v0.0.20 // indirect
github.com/mattn/go-runewidth v0.0.16 // indirect
github.com/mfridman/interpolate v0.0.2 // indirect
github.com/mitchellh/copystructure v1.2.0 // indirect
github.com/mitchellh/reflectwalk v1.0.2 // indirect
github.com/mmcloughlin/addchain v0.4.0 // indirect
github.com/moby/docker-image-spec v1.3.1 // indirect
github.com/moby/patternmatcher v0.6.0 // indirect
Expand All @@ -101,6 +110,8 @@ require (
github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822 // indirect
github.com/oapi-codegen/runtime v1.1.1 // indirect
github.com/onsi/gomega v1.19.0 // indirect
github.com/pelletier/go-toml v1.9.5 // indirect
github.com/pelletier/go-toml/v2 v2.0.9 // indirect
github.com/philhofer/fwd v1.1.2 // indirect
github.com/power-devops/perfstat v0.0.0-20240221224432-82ca36839d55 // indirect
github.com/prometheus/client_model v0.6.1 // indirect
Expand All @@ -111,7 +122,14 @@ require (
github.com/shirou/gopsutil v3.21.11+incompatible // indirect
github.com/shirou/gopsutil/v3 v3.24.5 // indirect
github.com/shoenig/go-m1cpu v0.1.6 // indirect
github.com/shopspring/decimal v1.3.1 // indirect
github.com/sony/gobreaker v1.0.0 // indirect
github.com/spf13/afero v1.9.2 // indirect
github.com/spf13/cobra v1.8.1 // indirect
github.com/spf13/jwalterweatherman v1.1.0 // indirect
github.com/spf13/pflag v1.0.6 // indirect
github.com/spf13/viper v1.12.0 // indirect
github.com/subosito/gotenv v1.4.1 // indirect
github.com/supranational/blst v0.3.14 // indirect
github.com/syndtr/goleveldb v1.0.1-0.20220614013038-64ee5596c38a // indirect
github.com/tidwall/match v1.1.1 // indirect
Expand All @@ -126,11 +144,13 @@ require (
go.opentelemetry.io/otel/metric v1.29.0 // indirect
go.opentelemetry.io/otel/trace v1.29.0 // indirect
go.uber.org/multierr v1.11.0 // indirect
golang.org/x/crypto v0.37.0 // indirect
golang.org/x/crypto v0.38.0 // indirect
golang.org/x/oauth2 v0.23.0 // indirect
golang.org/x/sync v0.14.0 // indirect
golang.org/x/time v0.9.0 // indirect
google.golang.org/genproto/googleapis/rpc v0.0.0-20241021214115-324edc3d5d38 // indirect
gopkg.in/ini.v1 v1.67.0 // indirect
gopkg.in/yaml.v2 v2.4.0 // indirect
rsc.io/tmplfunc v0.0.3 // indirect
)

Expand Down Expand Up @@ -180,7 +200,7 @@ require (
github.com/volatiletech/randomize v0.0.1 // indirect
golang.org/x/net v0.36.0 // indirect
golang.org/x/sys v0.33.0 // indirect
golang.org/x/text v0.24.0 // indirect
golang.org/x/text v0.25.0 // indirect
golang.org/x/tools v0.29.0 // indirect
golang.org/x/xerrors v0.0.0-20240716161551-93cc26a95ae9 // indirect
gopkg.in/yaml.v3 v3.0.1
Expand Down
Loading
Loading