Skip to content

Commit

Permalink
feat: Use .env for the generation (#1)
Browse files Browse the repository at this point in the history
  • Loading branch information
Tommylans authored Apr 15, 2024
1 parent e2d8357 commit 2f65d6b
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 6 deletions.
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

0 comments on commit 2f65d6b

Please sign in to comment.