diff --git a/README.md b/README.md index 5c007a31..8e084cee 100644 --- a/README.md +++ b/README.md @@ -6,19 +6,19 @@ Digital Citizenship initiative. To add the tools to a project: ``` -$ yarn add -D italia-utils +$ yarn add -D io-utils ``` ## gen-api-models This tool generates TypeScript definitions of OpenAPI specs. -In simple terms it converts an OpenAPI spec like [this one](https://github.com/teamdigitale/digital-citizenship-functions/blob/f04666c8b7f2d4bebde19676b49b19119b03ef17/api/public_api_v1.yaml) into: +In simple terms it converts an OpenAPI spec like [this one](https://github.com/teamdigitale/io-functions/blob/f04666c8b7f2d4bebde19676b49b19119b03ef17/api/public_api_v1.yaml) into: -* A TypeScript [representation of the specs](https://github.com/teamdigitale/digital-citizenship-functions/blob/6798225bd725a42753b16375ce18a954a268f9b6/lib/api/public_api_v1.ts). -* An [io-ts](https://github.com/gcanti/io-ts) type definitions for [each API definition](https://github.com/teamdigitale/digital-citizenship-functions/tree/6798225bd725a42753b16375ce18a954a268f9b6/lib/api/definitions) that provides compile time types and runtime validation. +* A TypeScript [representation of the specs](https://github.com/teamdigitale/io-functions/blob/6798225bd725a42753b16375ce18a954a268f9b6/lib/api/public_api_v1.ts). +* An [io-ts](https://github.com/gcanti/io-ts) type definitions for [each API definition](https://github.com/teamdigitale/io-functions/tree/6798225bd725a42753b16375ce18a954a268f9b6/lib/api/definitions) that provides compile time types and runtime validation. -Note: the generated models requires the runtime dependency `italia-ts-commons`. +Note: the generated models requires the runtime dependency `io-ts-commons`. ### Usage diff --git a/package.json b/package.json index ab9e99c9..2e79cf37 100644 --- a/package.json +++ b/package.json @@ -1,8 +1,8 @@ { - "name": "italia-utils", + "name": "io-utils", "version": "3.15.2", "description": "Tools and utilities for the Digital Citizenship project", - "repository": "https://github.com/teamdigitale/italia-utils", + "repository": "https://github.com/teamdigitale/io-utils", "author": "https://teamdigitale.governo.it", "license": "MIT", "bin": { @@ -22,7 +22,7 @@ }, "dependencies": { "fs-extra": "^6.0.0", - "italia-ts-commons": "^2.14.0", + "io-ts-commons": "^2.14.0", "nunjucks": "^3.1.2", "prettier": "^1.12.1", "swagger-parser": "^4.1.0", @@ -65,4 +65,4 @@ "**/__tests__/*.ts" ] } -} +} \ No newline at end of file diff --git a/src/__tests__/__snapshots__/gen-api-models.test.ts.snap b/src/__tests__/__snapshots__/gen-api-models.test.ts.snap index 968f5312..410c04a0 100644 --- a/src/__tests__/__snapshots__/gen-api-models.test.ts.snap +++ b/src/__tests__/__snapshots__/gen-api-models.test.ts.snap @@ -2,8 +2,8 @@ exports[`gen-api-models should generate a dictionary from additionalProperties: additional-properties 1`] = ` "/** - * Do not edit this file it is auto-generated by italia-utils / gen-api-models. - * See https://github.com/teamdigitale/italia-utils + * Do not edit this file it is auto-generated by io-utils / gen-api-models. + * See https://github.com/teamdigitale/io-utils */ /* tslint:disable */ @@ -25,8 +25,8 @@ export type AdditionalPropsTest = t.TypeOf; exports[`gen-api-models should generate a dictionary from additionalProperties: true: additional-properties-true 1`] = ` "/** - * Do not edit this file it is auto-generated by italia-utils / gen-api-models. - * See https://github.com/teamdigitale/italia-utils + * Do not edit this file it is auto-generated by io-utils / gen-api-models. + * See https://github.com/teamdigitale/io-utils */ /* tslint:disable */ @@ -46,8 +46,8 @@ export type AdditionalPropsTrueTest = t.TypeOf; exports[`gen-api-models should generate a type intersection from allOf: all-of-test 1`] = ` "/** - * Do not edit this file it is auto-generated by italia-utils / gen-api-models. - * See https://github.com/teamdigitale/italia-utils + * Do not edit this file it is auto-generated by io-utils / gen-api-models. + * See https://github.com/teamdigitale/io-utils */ /* tslint:disable */ @@ -81,8 +81,8 @@ export type AllOfTest = t.TypeOf; exports[`gen-api-models should generate a type union from allOf when x-one-of is used: allofoneof-test 1`] = ` "/** - * Do not edit this file it is auto-generated by italia-utils / gen-api-models. - * See https://github.com/teamdigitale/italia-utils + * Do not edit this file it is auto-generated by io-utils / gen-api-models. + * See https://github.com/teamdigitale/io-utils */ /* tslint:disable */ @@ -116,8 +116,8 @@ export type AllOfOneOfTest = t.TypeOf; exports[`gen-api-models should generate a type union from oneOf: oneof-test 1`] = ` "/** - * Do not edit this file it is auto-generated by italia-utils / gen-api-models. - * See https://github.com/teamdigitale/italia-utils + * Do not edit this file it is auto-generated by io-utils / gen-api-models. + * See https://github.com/teamdigitale/io-utils */ /* tslint:disable */ @@ -177,12 +177,12 @@ exports[`gen-api-models should generate the operator definition 1`] = ` exports[`gen-api-models should handle CustomStringFormats: custom-string-format 1`] = ` "/** - * Do not edit this file it is auto-generated by italia-utils / gen-api-models. - * See https://github.com/teamdigitale/italia-utils + * Do not edit this file it is auto-generated by io-utils / gen-api-models. + * See https://github.com/teamdigitale/io-utils */ /* tslint:disable */ -import { SomeCustomStringType as SomeCustomStringTypeT } from \\"italia-ts-commons/lib/string\\"; +import { SomeCustomStringType as SomeCustomStringTypeT } from \\"io-ts-commons/lib/string\\"; import * as t from \\"io-ts\\"; export type CustomStringFormatTest = t.TypeOf; @@ -192,12 +192,12 @@ export const CustomStringFormatTest = SomeCustomStringTypeT; exports[`gen-api-models should handle NonNegativeIntegers: non-negative-integer 1`] = ` "/** - * Do not edit this file it is auto-generated by italia-utils / gen-api-models. - * See https://github.com/teamdigitale/italia-utils + * Do not edit this file it is auto-generated by io-utils / gen-api-models. + * See https://github.com/teamdigitale/io-utils */ /* tslint:disable */ -import { NonNegativeInteger } from \\"italia-ts-commons/lib/numbers\\"; +import { NonNegativeInteger } from \\"io-ts-commons/lib/numbers\\"; import * as t from \\"io-ts\\"; export type NonNegativeIntegerTest = t.TypeOf; @@ -207,12 +207,12 @@ export const NonNegativeIntegerTest = NonNegativeInteger; exports[`gen-api-models should handle NonNegativeNumbers: non-negative-numbers 1`] = ` "/** - * Do not edit this file it is auto-generated by italia-utils / gen-api-models. - * See https://github.com/teamdigitale/italia-utils + * Do not edit this file it is auto-generated by io-utils / gen-api-models. + * See https://github.com/teamdigitale/io-utils */ /* tslint:disable */ -import { NonNegativeNumber } from \\"italia-ts-commons/lib/numbers\\"; +import { NonNegativeNumber } from \\"io-ts-commons/lib/numbers\\"; import * as t from \\"io-ts\\"; export type NonNegativeNumberTest = t.TypeOf; @@ -222,12 +222,12 @@ export const NonNegativeNumberTest = NonNegativeNumber; exports[`gen-api-models should handle WithinRangeIntegers: within-range-integer 1`] = ` "/** - * Do not edit this file it is auto-generated by italia-utils / gen-api-models. - * See https://github.com/teamdigitale/italia-utils + * Do not edit this file it is auto-generated by io-utils / gen-api-models. + * See https://github.com/teamdigitale/io-utils */ /* tslint:disable */ -import { WithinRangeInteger } from \\"italia-ts-commons/lib/numbers\\"; +import { WithinRangeInteger } from \\"io-ts-commons/lib/numbers\\"; import * as t from \\"io-ts\\"; export type WithinRangeIntegerTest = t.TypeOf; @@ -237,12 +237,12 @@ export const WithinRangeIntegerTest = WithinRangeInteger(0, 10); exports[`gen-api-models should handle WithinRangeNumbers: within-range-numbers 1`] = ` "/** - * Do not edit this file it is auto-generated by italia-utils / gen-api-models. - * See https://github.com/teamdigitale/italia-utils + * Do not edit this file it is auto-generated by io-utils / gen-api-models. + * See https://github.com/teamdigitale/io-utils */ /* tslint:disable */ -import { WithinRangeNumber } from \\"italia-ts-commons/lib/numbers\\"; +import { WithinRangeNumber } from \\"io-ts-commons/lib/numbers\\"; import * as t from \\"io-ts\\"; export type WithinRangeNumberTest = t.TypeOf; @@ -252,12 +252,12 @@ export const WithinRangeNumberTest = WithinRangeNumber(0, 10); exports[`gen-api-models should handle WithinRangeStrings: within-range-strings 1`] = ` "/** - * Do not edit this file it is auto-generated by italia-utils / gen-api-models. - * See https://github.com/teamdigitale/italia-utils + * Do not edit this file it is auto-generated by io-utils / gen-api-models. + * See https://github.com/teamdigitale/io-utils */ /* tslint:disable */ -import { WithinRangeString } from \\"italia-ts-commons/lib/strings\\"; +import { WithinRangeString } from \\"io-ts-commons/lib/strings\\"; import * as t from \\"io-ts\\"; export type WithinRangeStringTest = t.TypeOf; @@ -267,13 +267,13 @@ export const WithinRangeStringTest = WithinRangeString(10, 11); exports[`gen-api-models should handle enums: enum-simple 1`] = ` "/** - * Do not edit this file it is auto-generated by italia-utils / gen-api-models. - * See https://github.com/teamdigitale/italia-utils + * Do not edit this file it is auto-generated by io-utils / gen-api-models. + * See https://github.com/teamdigitale/io-utils */ /* tslint:disable */ import * as t from \\"io-ts\\"; -import { enumType } from \\"italia-ts-commons/lib/types\\"; +import { enumType } from \\"io-ts-commons/lib/types\\"; export enum StatusEnum { \\"value1\\" = \\"value1\\", @@ -299,12 +299,12 @@ export type EnumTest = t.TypeOf; exports[`gen-api-models should include aliases for types already defined elsewhere if they have a different name: defined-type 1`] = ` "/** - * Do not edit this file it is auto-generated by italia-utils / gen-api-models. - * See https://github.com/teamdigitale/italia-utils + * Do not edit this file it is auto-generated by io-utils / gen-api-models. + * See https://github.com/teamdigitale/io-utils */ /* tslint:disable */ -import { OrganizationFiscalCode as OrganizationFiscalCodeT } from \\"italia-ts-commons/lib/string\\"; +import { OrganizationFiscalCode as OrganizationFiscalCodeT } from \\"io-ts-commons/lib/string\\"; import * as t from \\"io-ts\\"; export type OrganizationFiscalCodeTest = t.TypeOf< @@ -316,8 +316,8 @@ export const OrganizationFiscalCodeTest = OrganizationFiscalCodeT; exports[`gen-api-models should not generate duplicate imports: dup-imports 1`] = ` "/** - * Do not edit this file it is auto-generated by italia-utils / gen-api-models. - * See https://github.com/teamdigitale/italia-utils + * Do not edit this file it is auto-generated by io-utils / gen-api-models. + * See https://github.com/teamdigitale/io-utils */ /* tslint:disable */ @@ -383,13 +383,13 @@ export type Profile = t.TypeOf; exports[`gen-api-models should parse custom inline properties: inline-property 1`] = ` "/** - * Do not edit this file it is auto-generated by italia-utils / gen-api-models. - * See https://github.com/teamdigitale/italia-utils + * Do not edit this file it is auto-generated by io-utils / gen-api-models. + * See https://github.com/teamdigitale/io-utils */ /* tslint:disable */ import * as t from \\"io-ts\\"; -import { PatternString } from \\"italia-ts-commons/lib/strings\\"; +import { PatternString } from \\"io-ts-commons/lib/strings\\"; // required attributes const InlinePropertyTestR = t.interface({}); @@ -412,13 +412,13 @@ export type InlinePropertyTest = t.TypeOf; exports[`gen-api-models should parse nested objects: nested-object 1`] = ` "/** - * Do not edit this file it is auto-generated by italia-utils / gen-api-models. - * See https://github.com/teamdigitale/italia-utils + * Do not edit this file it is auto-generated by io-utils / gen-api-models. + * See https://github.com/teamdigitale/io-utils */ /* tslint:disable */ import * as t from \\"io-ts\\"; -import { PatternString } from \\"italia-ts-commons/lib/strings\\"; +import { PatternString } from \\"io-ts-commons/lib/strings\\"; // required attributes const NestedObjectTestNestedObjectR = t.interface({}); @@ -462,13 +462,13 @@ export type NestedObjectTest = t.TypeOf; exports[`gen-api-models should support additionalProperties default value: additional-properties-default 1`] = ` "/** - * Do not edit this file it is auto-generated by italia-utils / gen-api-models. - * See https://github.com/teamdigitale/italia-utils + * Do not edit this file it is auto-generated by io-utils / gen-api-models. + * See https://github.com/teamdigitale/io-utils */ /* tslint:disable */ import * as t from \\"io-ts\\"; -import { withDefault } from \\"italia-ts-commons/lib/types\\"; +import { withDefault } from \\"io-ts-commons/lib/types\\"; type AdditionalpropsDefaultBase = t.TypeOf; const AdditionalpropsDefaultBase = t.dictionary( diff --git a/src/__tests__/api.yaml b/src/__tests__/api.yaml index 8f1e415a..74d76bc7 100644 --- a/src/__tests__/api.yaml +++ b/src/__tests__/api.yaml @@ -113,15 +113,15 @@ definitions: pattern: "^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$" CustomStringFormatTest: type: string - x-import: italia-ts-commons/lib/string + x-import: io-ts-commons/lib/string format: SomeCustomStringType OrganizationFiscalCode: type: string - x-import: italia-ts-commons/lib/string + x-import: io-ts-commons/lib/string format: OrganizationFiscalCode OrganizationFiscalCodeTest: type: string - x-import: italia-ts-commons/lib/string + x-import: io-ts-commons/lib/string format: OrganizationFiscalCode NonNegativeIntegerTest: title: NonNegativeIntegerTest @@ -156,27 +156,27 @@ definitions: - value2 - value3 MessageContent: - $ref: "https://raw.githubusercontent.com/teamdigitale/digital-citizenship-functions/v0.38.0/api/definitions.yaml#/MessageContent" + $ref: "https://raw.githubusercontent.com/teamdigitale/io-functions/v0.38.0/api/definitions.yaml#/MessageContent" FiscalCode: - $ref: "https://raw.githubusercontent.com/teamdigitale/digital-citizenship-functions/v0.38.0/api/definitions.yaml#/FiscalCode" + $ref: "https://raw.githubusercontent.com/teamdigitale/io-functions/v0.38.0/api/definitions.yaml#/FiscalCode" EmailAddress: - $ref: "https://raw.githubusercontent.com/teamdigitale/digital-citizenship-functions/v0.38.0/api/definitions.yaml#/EmailAddress" + $ref: "https://raw.githubusercontent.com/teamdigitale/io-functions/v0.38.0/api/definitions.yaml#/EmailAddress" ExtendedProfile: - $ref: "https://raw.githubusercontent.com/teamdigitale/digital-citizenship-functions/v0.38.0/api/definitions.yaml#/ExtendedProfile" + $ref: "https://raw.githubusercontent.com/teamdigitale/io-functions/v0.38.0/api/definitions.yaml#/ExtendedProfile" LimitedProfile: - $ref: "https://raw.githubusercontent.com/teamdigitale/digital-citizenship-functions/v0.38.0/api/definitions.yaml#/LimitedProfile" + $ref: "https://raw.githubusercontent.com/teamdigitale/io-functions/v0.38.0/api/definitions.yaml#/LimitedProfile" PreferredLanguages: - $ref: "https://raw.githubusercontent.com/teamdigitale/digital-citizenship-functions/v0.38.0/api/definitions.yaml#/PreferredLanguages" + $ref: "https://raw.githubusercontent.com/teamdigitale/io-functions/v0.38.0/api/definitions.yaml#/PreferredLanguages" IsInboxEnabled: - $ref: "https://raw.githubusercontent.com/teamdigitale/digital-citizenship-functions/v0.38.0/api/definitions.yaml#/IsInboxEnabled" + $ref: "https://raw.githubusercontent.com/teamdigitale/io-functions/v0.38.0/api/definitions.yaml#/IsInboxEnabled" IsWebhookEnabled: - $ref: "https://raw.githubusercontent.com/teamdigitale/digital-citizenship-functions/v0.38.0/api/definitions.yaml#/IsWebhookEnabled" + $ref: "https://raw.githubusercontent.com/teamdigitale/io-functions/v0.38.0/api/definitions.yaml#/IsWebhookEnabled" PaginationResponse: - $ref: "https://raw.githubusercontent.com/teamdigitale/digital-citizenship-functions/v0.38.0/api/definitions.yaml#/PaginationResponse" + $ref: "https://raw.githubusercontent.com/teamdigitale/io-functions/v0.38.0/api/definitions.yaml#/PaginationResponse" CreatedMessageWithContent: - $ref: "https://raw.githubusercontent.com/teamdigitale/digital-citizenship-functions/v0.38.0/api/definitions.yaml#/CreatedMessageWithContent" + $ref: "https://raw.githubusercontent.com/teamdigitale/io-functions/v0.38.0/api/definitions.yaml#/CreatedMessageWithContent" ServicePublic: - $ref: "https://raw.githubusercontent.com/teamdigitale/digital-citizenship-functions/v0.38.0/api/definitions.yaml#/ServicePublic" + $ref: "https://raw.githubusercontent.com/teamdigitale/io-functions/v0.38.0/api/definitions.yaml#/ServicePublic" Message: title: Message type: object diff --git a/src/gen-api-models.ts b/src/gen-api-models.ts index e3d5ca51..a32365cd 100644 --- a/src/gen-api-models.ts +++ b/src/gen-api-models.ts @@ -1,7 +1,7 @@ // tslint:disable:no-console import * as fs from "fs-extra"; -import { ITuple2, Tuple2 } from "italia-ts-commons/lib/tuples"; +import { ITuple2, Tuple2 } from "io-ts-commons/lib/tuples"; import * as nunjucks from "nunjucks"; import * as prettier from "prettier"; import * as SwaggerParser from "swagger-parser"; @@ -434,7 +434,7 @@ export async function generateApi( import * as t from "io-ts"; - import * as r from "italia-ts-commons/lib/requests"; + import * as r from "io-ts-commons/lib/requests"; ${Array.from(operationsImports.values()) .map(i => `import { ${i} } from "./${i}";`) diff --git a/templates/macros.njk b/templates/macros.njk index 5b3ab43f..7a241ea5 100644 --- a/templates/macros.njk +++ b/templates/macros.njk @@ -4,7 +4,7 @@ {% macro exportConst(defaultValue, type, typedef, quote = false) %} {{- 'import * as t from "io-ts";' | addImport -}} {% if defaultValue !== undefined %} - {{- 'import { withDefault } from "italia-ts-commons/lib/types";' | addImport -}} + {{- 'import { withDefault } from "io-ts-commons/lib/types";' | addImport -}} {% set baseTypeName = type + "Base" %} export type {{ type }} = t.TypeOf; const {{ baseTypeName }} = {{ typedef | safe }}; @@ -22,7 +22,7 @@ #} {% macro inlineConst(defaultValue, type, typedef, quote = false) %} {% if defaultValue !== undefined %} - {{- 'import { withDefault } from "italia-ts-commons/lib/types";' | addImport -}} + {{- 'import { withDefault } from "io-ts-commons/lib/types";' | addImport -}} {# check if it is a primitive io-ts type (ie. t.string) #} {# if it is a primitive io-ts type, avoid to create an alias #} {% if not r/^t\.[a-z]+$/.test(typedef) %} @@ -70,10 +70,10 @@ #} {% macro defineNumber(definitionName, definition, inline = false) -%} {% if definition.minimum != undefined and definition.maximum != undefined %} - {{- 'import { WithinRangeNumber } from "italia-ts-commons/lib/numbers";' | addImport -}} + {{- 'import { WithinRangeNumber } from "io-ts-commons/lib/numbers";' | addImport -}} {% set typedef %}WithinRangeNumber({{ definition.minimum }}, {{ definition.maximum }}){% endset %} {% elif definition.minimum == "0" %} - {{- 'import { NonNegativeNumber } from "italia-ts-commons/lib/numbers";' | addImport -}} + {{- 'import { NonNegativeNumber } from "io-ts-commons/lib/numbers";' | addImport -}} {% set typedef %}NonNegativeNumber{% endset %} {% else %} {% set typedef %}t.number{% endset %} @@ -86,10 +86,10 @@ #} {% macro defineInteger(definitionName, definition, inline = false) -%} {% if definition.minimum != undefined and definition.maximum != undefined %} - {{- 'import { WithinRangeInteger } from "italia-ts-commons/lib/numbers";' | addImport -}} + {{- 'import { WithinRangeInteger } from "io-ts-commons/lib/numbers";' | addImport -}} {% set typedef %}WithinRangeInteger({{ definition.minimum }}, {{ definition.maximum }}){% endset %} {% elif definition.minimum == "0" %} - {{- 'import { NonNegativeInteger } from "italia-ts-commons/lib/numbers";' | addImport -}} + {{- 'import { NonNegativeInteger } from "io-ts-commons/lib/numbers";' | addImport -}} {% set typedef %}NonNegativeInteger{% endset %} {% else %} {% set typedef %}t.Integer{% endset %} @@ -102,27 +102,27 @@ #} {% macro defineString(definitionName, definition, inline = false) -%} {% if definition.pattern %} - {{- 'import { PatternString } from "italia-ts-commons/lib/strings";' | addImport -}} + {{- 'import { PatternString } from "io-ts-commons/lib/strings";' | addImport -}} {% set typedef %}PatternString("{{ definition.pattern | safe }}"){% endset %} {% elif definition.minLength and definition.maxLength %} - {{- 'import { WithinRangeString } from "italia-ts-commons/lib/strings";' | addImport -}} + {{- 'import { WithinRangeString } from "io-ts-commons/lib/strings";' | addImport -}} {% set maxLength = definition.maxLength + 1 %} {% set typedef %}WithinRangeString({{ definition.minLength }}, {{ maxLength }}){% endset %} {% elif definition.minLength == 1 %} - {{- 'import { NonEmptyString } from "italia-ts-commons/lib/strings";' | addImport -}} + {{- 'import { NonEmptyString } from "io-ts-commons/lib/strings";' | addImport -}} {% set typedef %}NonEmptyString{% endset %} {% elif definition.format == "email" %} - {{- 'import { EmailString } from "italia-ts-commons/lib/strings";' | addImport -}} + {{- 'import { EmailString } from "io-ts-commons/lib/strings";' | addImport -}} {% set typedef %}EmailString{% endset %} {% elif definition.format == "date-time" %} - {{- 'import { DateFromString } from "italia-ts-commons/lib/dates";' | addImport -}} + {{- 'import { DateFromString } from "io-ts-commons/lib/dates";' | addImport -}} {% set typedef %}DateFromString{% endset %} {% elif definition.format != undefined and definition["x-import"] %} {% set typedef %}{{ definition.format }}T{% endset %} {% set importdef %}import { {{ definition.format }} as {{ typedef }} } from "{{ definition["x-import"] }}";{% endset %} {{- importdef | addImport -}} {% elif definition["x-extensible-enum"] %} - {{- 'import { enumType } from "italia-ts-commons/lib/types";' | addImport -}} + {{- 'import { enumType } from "io-ts-commons/lib/types";' | addImport -}} {% set enumTypeAlias %} export enum {{ definitionName | capitalizeFirst }}Enum { {% for enum in definition["x-extensible-enum"] %} @@ -136,7 +136,7 @@ "{{ definitionName }}" ){% endset %} {% elif definition["enum"] %} - {{- 'import { enumType } from "italia-ts-commons/lib/types";' | addImport -}} + {{- 'import { enumType } from "io-ts-commons/lib/types";' | addImport -}} {% set enumTypeAlias %} export enum {{ definitionName | capitalizeFirst }}Enum { {% for enum in definition["enum"] %} @@ -244,7 +244,7 @@ endif %} {% for propName, prop in definition.properties -%} {% if prop.default !== undefined %} - {{- 'import { withDefault } from "italia-ts-commons/lib/types";' | addImport -}} + {{- 'import { withDefault } from "io-ts-commons/lib/types";' | addImport -}} {% endif %} {% endfor %} {% endmacro -%} diff --git a/templates/model.ts.njk b/templates/model.ts.njk index 8b868080..e5881ed0 100644 --- a/templates/model.ts.njk +++ b/templates/model.ts.njk @@ -1,8 +1,8 @@ {%- import "macros.njk" as macro -%} /** - * Do not edit this file it is auto-generated by italia-utils / gen-api-models. - * See https://github.com/teamdigitale/italia-utils + * Do not edit this file it is auto-generated by io-utils / gen-api-models. + * See https://github.com/teamdigitale/io-utils */ /* tslint:disable */ diff --git a/yarn.lock b/yarn.lock index c684c4f8..41fecae9 100644 --- a/yarn.lock +++ b/yarn.lock @@ -2262,9 +2262,9 @@ istanbul-reports@^1.3.0: dependencies: handlebars "^4.0.3" -italia-ts-commons@^2.14.0: +io-ts-commons@^2.14.0: version "2.14.0" - resolved "https://registry.yarnpkg.com/italia-ts-commons/-/italia-ts-commons-2.14.0.tgz#2d5b258e4e39809c807c00880132374a40382986" + resolved "https://registry.yarnpkg.com/io-ts-commons/-/io-ts-commons-2.14.0.tgz#2d5b258e4e39809c807c00880132374a40382986" dependencies: fp-ts "^1.6.0" io-ts "^1.1.4"