Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: brandAssets fix date format and remove gbfs description #71

Merged
merged 3 commits into from
Feb 5, 2025
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
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@
"glob": "^9.3.2",
"js-yaml": "^4.1.0",
"yargs": "^17.7.1",
"zod": "^3.21.4",
"zod": "^3.24.1",
"zod-to-json-schema": "^3.20.4"
}
}
18 changes: 6 additions & 12 deletions schema-definitions/mobility.json
Original file line number Diff line number Diff line change
Expand Up @@ -130,31 +130,25 @@
"type": "object",
"properties": {
"brandLastModified": {
"type": "string",
"format": "date-time",
"description": "Date that indicates the last time any included brand assets were updated or modified."
"type": "string"
},
"brandTermsUrl": {
"type": "string",
"format": "uri",
"description": "A fully qualified URL pointing to the location of a page that defines the license terms of brand icons, colors, or other trademark information. This field MUST NOT take the place of license_url or license_id."
"format": "uri"
},
"brandImageUrl": {
"type": "string",
"description": "A fully qualified URL pointing to the location of a graphic file representing the brand for the service. File MUST be in SVG V1.1 format and MUST be either square or round."
"type": "string"
},
"brandImageUrlDark": {
"type": "string",
"description": "A fully qualified URL pointing to the location of a graphic file representing the brand for the service for use in dark mode applications. File MUST be in SVG V1.1 format and MUST be either square or round."
"type": "string"
},
"color": {
"type": "string",
"description": "Color used to represent the brand for the service expressed as a 6 digit hexadecimal color code in the form #000000."
"type": "string"
}
},
"required": ["brandLastModified", "brandImageUrl"],
"additionalProperties": false,
"description": "modeled 1-1 like brandAssets in GBFS"
"description": "modeled 1-1 like brandAssets in EnTur mobility API"
}
},
"required": ["id", "name", "formFactors"],
Expand Down
36 changes: 6 additions & 30 deletions src/mobility.ts
Original file line number Diff line number Diff line change
Expand Up @@ -40,38 +40,14 @@ export const MobilityOperator = z.object({
benefits: z.array(OperatorBenefit).optional().default([]),
brandAssets: z
.object({
brandLastModified: z
.date()
.describe(
'Date that indicates the last time any included brand assets were updated or modified.',
),
brandTermsUrl: z
.string()
.url()
.optional()
.describe(
'A fully qualified URL pointing to the location of a page that defines the license terms of brand icons, colors, or other trademark information. This field MUST NOT take the place of license_url or license_id.',
),
brandImageUrl: z
.string()
.describe(
'A fully qualified URL pointing to the location of a graphic file representing the brand for the service. File MUST be in SVG V1.1 format and MUST be either square or round.',
),
brandImageUrlDark: z
.string()
.optional()
.describe(
'A fully qualified URL pointing to the location of a graphic file representing the brand for the service for use in dark mode applications. File MUST be in SVG V1.1 format and MUST be either square or round.',
),
color: z
.string()
.optional()
.describe(
'Color used to represent the brand for the service expressed as a 6 digit hexadecimal color code in the form #000000.',
),
brandLastModified: z.string().date(),
brandTermsUrl: z.string().url().optional(),
brandImageUrl: z.string(),
brandImageUrlDark: z.string().optional(),
color: z.string().optional(),
})
.optional()
.describe('modeled 1-1 like brandAssets in GBFS'),
.describe('modeled 1-1 like brandAssets in EnTur mobility API'),
});

export type MobilityOperatorType = z.infer<typeof MobilityOperator>;
Expand Down
8 changes: 4 additions & 4 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -975,7 +975,7 @@ zod-to-json-schema@^3.20.4:
resolved "https://registry.yarnpkg.com/zod-to-json-schema/-/zod-to-json-schema-3.20.4.tgz#155f687c5a059fdc0f1bb3ff32d6e9200036b6f4"
integrity sha512-Un9+kInJ2Zt63n6Z7mLqBifzzPcOyX+b+Exuzf7L1+xqck9Q2EPByyTRduV3kmSPaXaRer1JCsucubpgL1fipg==

zod@^3.21.4:
version "3.21.4"
resolved "https://registry.yarnpkg.com/zod/-/zod-3.21.4.tgz#10882231d992519f0a10b5dd58a38c9dabbb64db"
integrity sha512-m46AKbrzKVzOzs/DZgVnG5H55N1sv1M8qZU3A8RIKbs3mrACDNeIOeilDymVb2HdmP8uwshOCF4uJ8uM9rCqJw==
zod@^3.24.1:
version "3.24.1"
marius-at-atb marked this conversation as resolved.
Show resolved Hide resolved
resolved "https://registry.yarnpkg.com/zod/-/zod-3.24.1.tgz#27445c912738c8ad1e9de1bea0359fa44d9d35ee"
integrity sha512-muH7gBL9sI1nciMZV67X5fTKKBLtwpZ5VBp1vsOQzj1MhrBZ4wlVCm3gedKZWLp0Oyel8sIGfeiz54Su+OVT+A==