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

feat: Use .env for the generation #1

Merged
merged 2 commits into from
Apr 15, 2024
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
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
.DS_Store
node_modules
.env
src/generated
src/generated
.idea
4 changes: 3 additions & 1 deletion openapi-ts.config.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
import "dotenv/config";
import { defineConfig } from "@hey-api/openapi-ts";
import * as process from "node:process";

export default defineConfig({
input: "https://api.aurora.paradym.id/openapi-docs.json",
input: `${process.env.SERVER}/openapi-docs.json`,
output: "src/generated",
});
8 changes: 4 additions & 4 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ async function run() {
},
type: "EmployeeBadge",
revocable: false,
fields: {
attributes: {
first_name: {
type: "string",
title: "First Name",
Expand Down Expand Up @@ -62,7 +62,7 @@ async function run() {
required: true,
},
},
defaultFields: {
defaultAttributes: {
expiration: {
required: true,
default: {
Expand All @@ -86,7 +86,7 @@ async function run() {
credentials: [
{
format: "sd-jwt-vc",
fields: {
attributes: {
first_name: {
type: "string",
const: "John",
Expand All @@ -112,7 +112,7 @@ async function run() {
credentials: [
{
credentialTemplateId: credentialTemplate.id,
fields: {
attributes: {
first_name: "John",
last_name: "Doe",
employee_id: "123",
Expand Down