From 0479217f45826884d552fb536886de2332cbdd1c Mon Sep 17 00:00:00 2001 From: Marco Falkenberg Date: Fri, 5 Jun 2020 12:10:03 +0200 Subject: [PATCH] Ignore generated files from Prettier --- .github/workflows/test.yml | 2 +- .prettierignore | 3 +- src/auth/kubernetes_types-ti.ts | 36 +++--- src/auth/token_types-ti.ts | 26 ++--- src/engines/kv2_types-ti.ts | 73 ++++++------ src/engines/kv_types-ti.ts | 18 +-- src/engines/totp_types-ti.ts | 90 +++++++-------- src/engines/transit_types-ti.ts | 193 +++++++++++++++----------------- 8 files changed, 217 insertions(+), 224 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index dd888c4..f774a92 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -1,5 +1,5 @@ name: Node.js Test -on: [push, pull_request] +on: [push] jobs: build: runs-on: ubuntu-latest diff --git a/.prettierignore b/.prettierignore index 0f94d50..44bf8af 100644 --- a/.prettierignore +++ b/.prettierignore @@ -4,4 +4,5 @@ package.json .yo-rc.json .prettierrc tsconfig.json -build \ No newline at end of file +build +**/*_types-ti.ts diff --git a/src/auth/kubernetes_types-ti.ts b/src/auth/kubernetes_types-ti.ts index d39e444..c714002 100644 --- a/src/auth/kubernetes_types-ti.ts +++ b/src/auth/kubernetes_types-ti.ts @@ -5,30 +5,30 @@ import * as t from "ts-interface-checker"; // tslint:disable:object-literal-key-quotes export const IVaultKubernetesAuthLoginConfig = t.iface([], { - role: "string", - jwt: t.opt("string"), - jwt_path: t.opt("string"), + "role": "string", + "jwt": t.opt("string"), + "jwt_path": t.opt("string"), }); export const IVaultKubernetesAuthLoginResponse = t.iface(["IVaultTokenAuthResponse"], { - auth: t.iface([], { - client_token: "string", - accessor: "string", - policies: t.array("string"), - lease_duration: "number", - renewable: "boolean", - metadata: t.iface([], { - role: "string", - service_account_name: "string", - service_account_namespace: "string", - service_account_secret_name: "string", - service_account_uid: "string", - }), + "auth": t.iface([], { + "client_token": "string", + "accessor": "string", + "policies": t.array("string"), + "lease_duration": "number", + "renewable": "boolean", + "metadata": t.iface([], { + "role": "string", + "service_account_name": "string", + "service_account_namespace": "string", + "service_account_secret_name": "string", + "service_account_uid": "string", }), + }), }); const exportedTypeSuite: t.ITypeSuite = { - IVaultKubernetesAuthLoginConfig, - IVaultKubernetesAuthLoginResponse, + IVaultKubernetesAuthLoginConfig, + IVaultKubernetesAuthLoginResponse, }; export default exportedTypeSuite; diff --git a/src/auth/token_types-ti.ts b/src/auth/token_types-ti.ts index a83a970..f99f76c 100644 --- a/src/auth/token_types-ti.ts +++ b/src/auth/token_types-ti.ts @@ -5,27 +5,27 @@ import * as t from "ts-interface-checker"; // tslint:disable:object-literal-key-quotes export const IVaultTokenRenewSelfOptions = t.iface([], { - increment: t.opt("string"), + "increment": t.opt("string"), }); export const IVaultTokenRenewOptions = t.iface([], { - token: "string", - increment: t.opt("string"), + "token": "string", + "increment": t.opt("string"), }); export const IVaultTokenAuthResponse = t.iface([], { - auth: t.iface([], { - client_token: "string", - accessor: "string", - policies: t.array("string"), - lease_duration: "number", - renewable: "boolean", - }), + "auth": t.iface([], { + "client_token": "string", + "accessor": "string", + "policies": t.array("string"), + "lease_duration": "number", + "renewable": "boolean", + }), }); const exportedTypeSuite: t.ITypeSuite = { - IVaultTokenRenewSelfOptions, - IVaultTokenRenewOptions, - IVaultTokenAuthResponse, + IVaultTokenRenewSelfOptions, + IVaultTokenRenewOptions, + IVaultTokenAuthResponse, }; export default exportedTypeSuite; diff --git a/src/engines/kv2_types-ti.ts b/src/engines/kv2_types-ti.ts index 3f32ad8..dfd2bb2 100644 --- a/src/engines/kv2_types-ti.ts +++ b/src/engines/kv2_types-ti.ts @@ -5,59 +5,58 @@ import * as t from "ts-interface-checker"; // tslint:disable:object-literal-key-quotes export const IKV2CreateBody = t.iface([], { - data: t.iface([], {}), - options: t.opt( - t.iface([], { - cas: t.opt("number"), - }), - ), + "data": t.iface([], { + }), + "options": t.opt(t.iface([], { + "cas": t.opt("number"), + })), }); export const IKV2CreateResponse = t.iface([], { - data: t.iface([], { - created_time: "string", - deletion_time: "string", - destroyed: "boolean", - version: "number", - }), + "data": t.iface([], { + "created_time": "string", + "deletion_time": "string", + "destroyed": "boolean", + "version": "number", + }), }); export const IKV2ReadResponse = t.iface([], { - data: t.iface([], { - data: t.iface([], {}), - metadata: t.opt( - t.iface([], { - created_time: "string", - deletion_time: "string", - destroyed: "boolean", - version: "number", - }), - ), + "data": t.iface([], { + "data": t.iface([], { }), + "metadata": t.opt(t.iface([], { + "created_time": "string", + "deletion_time": "string", + "destroyed": "boolean", + "version": "number", + })), + }), }); export const IKV2ListResponse = t.iface([], { - data: t.iface([], { - keys: t.array("string"), - }), + "data": t.iface([], { + "keys": t.array("string"), + }), }); export const IKV2ReadMetadataResponse = t.iface([], { - data: t.iface([], { - created_time: "string", - current_version: "number", - max_versions: "number", - oldest_version: "number", - updated_time: "string", - versions: t.iface([], {}), + "data": t.iface([], { + "created_time": "string", + "current_version": "number", + "max_versions": "number", + "oldest_version": "number", + "updated_time": "string", + "versions": t.iface([], { }), + }), }); const exportedTypeSuite: t.ITypeSuite = { - IKV2CreateBody, - IKV2CreateResponse, - IKV2ReadResponse, - IKV2ListResponse, - IKV2ReadMetadataResponse, + IKV2CreateBody, + IKV2CreateResponse, + IKV2ReadResponse, + IKV2ListResponse, + IKV2ReadMetadataResponse, }; export default exportedTypeSuite; diff --git a/src/engines/kv_types-ti.ts b/src/engines/kv_types-ti.ts index 99217b4..3135ce8 100644 --- a/src/engines/kv_types-ti.ts +++ b/src/engines/kv_types-ti.ts @@ -4,21 +4,23 @@ import * as t from "ts-interface-checker"; // tslint:disable:object-literal-key-quotes -export const IKVCreateBody = t.iface([], {}); +export const IKVCreateBody = t.iface([], { +}); export const IKVReadResponse = t.iface([], { - data: t.iface([], {}), + "data": t.iface([], { + }), }); export const IKVListResponse = t.iface([], { - data: t.iface([], { - keys: t.array("string"), - }), + "data": t.iface([], { + "keys": t.array("string"), + }), }); const exportedTypeSuite: t.ITypeSuite = { - IKVCreateBody, - IKVReadResponse, - IKVListResponse, + IKVCreateBody, + IKVReadResponse, + IKVListResponse, }; export default exportedTypeSuite; diff --git a/src/engines/totp_types-ti.ts b/src/engines/totp_types-ti.ts index dc93315..a923f2c 100644 --- a/src/engines/totp_types-ti.ts +++ b/src/engines/totp_types-ti.ts @@ -5,73 +5,73 @@ import * as t from "ts-interface-checker"; // tslint:disable:object-literal-key-quotes export const ITotpCreateOptionsGenerate = t.iface([], { - generate: t.lit(true), - exported: t.opt("boolean"), - key_size: t.opt("number"), - issuer: "string", - account_name: "string", - period: t.opt("number"), - algorithm: t.opt("string"), - digits: t.opt("number"), - skew: t.opt("number"), - qr_size: t.opt("number"), + "generate": t.lit(true), + "exported": t.opt("boolean"), + "key_size": t.opt("number"), + "issuer": "string", + "account_name": "string", + "period": t.opt("number"), + "algorithm": t.opt("string"), + "digits": t.opt("number"), + "skew": t.opt("number"), + "qr_size": t.opt("number"), }); export const ITotpCreateOptionsNoGenerate = t.iface([], { - generate: t.lit(false), - url: t.opt("string"), - issuer: t.opt("string"), - account_name: t.opt("string"), - period: t.opt("number"), - algorithm: t.opt("string"), - digits: t.opt("number"), + "generate": t.lit(false), + "url": t.opt("string"), + "issuer": t.opt("string"), + "account_name": t.opt("string"), + "period": t.opt("number"), + "algorithm": t.opt("string"), + "digits": t.opt("number"), }); export const ITotpCreateOptions = t.union("ITotpCreateOptionsGenerate", "ITotpCreateOptionsNoGenerate"); export const ITotpCreateResponseExported = t.iface([], { - data: t.iface([], { - barcode: "string", - url: "string", - }), + "data": t.iface([], { + "barcode": "string", + "url": "string", + }), }); export const ITotpReadResponse = t.iface([], { - data: t.iface([], { - account_name: "string", - algorithm: "string", - digits: "number", - issuer: "string", - period: "number", - }), + "data": t.iface([], { + "account_name": "string", + "algorithm": "string", + "digits": "number", + "issuer": "string", + "period": "number", + }), }); export const ITotpListResponse = t.iface([], { - data: t.iface([], { - keys: t.array("string"), - }), + "data": t.iface([], { + "keys": t.array("string"), + }), }); export const ITotpGenerateCodeResponse = t.iface([], { - data: t.iface([], { - code: "string", - }), + "data": t.iface([], { + "code": "string", + }), }); export const ITotpValidateCodeResponse = t.iface([], { - data: t.iface([], { - valid: "boolean", - }), + "data": t.iface([], { + "valid": "boolean", + }), }); const exportedTypeSuite: t.ITypeSuite = { - ITotpCreateOptionsGenerate, - ITotpCreateOptionsNoGenerate, - ITotpCreateOptions, - ITotpCreateResponseExported, - ITotpReadResponse, - ITotpListResponse, - ITotpGenerateCodeResponse, - ITotpValidateCodeResponse, + ITotpCreateOptionsGenerate, + ITotpCreateOptionsNoGenerate, + ITotpCreateOptions, + ITotpCreateResponseExported, + ITotpReadResponse, + ITotpListResponse, + ITotpGenerateCodeResponse, + ITotpValidateCodeResponse, }; export default exportedTypeSuite; diff --git a/src/engines/transit_types-ti.ts b/src/engines/transit_types-ti.ts index 362a283..48d7860 100644 --- a/src/engines/transit_types-ti.ts +++ b/src/engines/transit_types-ti.ts @@ -4,153 +4,144 @@ import * as t from "ts-interface-checker"; // tslint:disable:object-literal-key-quotes -export const ITransitKeyType = t.union( - t.lit("aes256-gcm96"), - t.lit("chacha20-poly1305"), - t.lit("d25519"), - t.lit("ecdsa-p256"), - t.lit("rsa-2048"), - t.lit("rsa-4096"), -); - -export const ITransitBatchPlaintext = t.array( - t.iface([], { - plaintext: "string", - context: t.opt("string"), - }), -); +export const ITransitKeyType = t.union(t.lit("aes256-gcm96"), t.lit("chacha20-poly1305"), t.lit("d25519"), t.lit("ecdsa-p256"), t.lit("rsa-2048"), t.lit("rsa-4096")); -export const ITransitBatchCiphertext = t.array( - t.iface([], { - ciphertext: "string", - context: t.opt("string"), - }), -); +export const ITransitBatchPlaintext = t.array(t.iface([], { + "plaintext": "string", + "context": t.opt("string"), +})); + +export const ITransitBatchCiphertext = t.array(t.iface([], { + "ciphertext": "string", + "context": t.opt("string"), +})); export const ITransitCreateOptions = t.iface([], { - convergent_encryption: t.opt("boolean"), - derived: t.opt("boolean"), - exportable: t.opt("boolean"), - allow_plaintext_backup: t.opt("boolean"), - type: t.opt("ITransitKeyType"), + "convergent_encryption": t.opt("boolean"), + "derived": t.opt("boolean"), + "exportable": t.opt("boolean"), + "allow_plaintext_backup": t.opt("boolean"), + "type": t.opt("ITransitKeyType"), }); export const ITransitReadResponse = t.iface([], { - data: t.iface([], { - type: "ITransitKeyType", - deletion_allowed: "boolean", - derived: "boolean", - exportable: "boolean", - allow_plaintext_backup: "boolean", - keys: t.iface([], {}), - min_decryption_version: "number", - min_encryption_version: "number", - name: "string", - supports_encryption: "boolean", - supports_decryption: "boolean", - supports_derivation: "boolean", - supports_signing: "boolean", - latest_version: t.opt("number"), + "data": t.iface([], { + "type": "ITransitKeyType", + "deletion_allowed": "boolean", + "derived": "boolean", + "exportable": "boolean", + "allow_plaintext_backup": "boolean", + "keys": t.iface([], { }), + "min_decryption_version": "number", + "min_encryption_version": "number", + "name": "string", + "supports_encryption": "boolean", + "supports_decryption": "boolean", + "supports_derivation": "boolean", + "supports_signing": "boolean", + "latest_version": t.opt("number"), + }), }); export const ITransitListResponse = t.iface([], { - data: t.iface([], { - keys: t.array("string"), - }), - lease_duration: "number", - lease_id: "string", - renewable: "boolean", + "data": t.iface([], { + "keys": t.array("string"), + }), + "lease_duration": "number", + "lease_id": "string", + "renewable": "boolean", }); export const ITransitUpdateOptions = t.iface([], { - min_decryption_version: t.opt("number"), - min_encryption_version: t.opt("number"), - deletion_allowed: t.opt("boolean"), - exportable: t.opt("boolean"), - allow_plaintext_backup: t.opt("boolean"), + "min_decryption_version": t.opt("number"), + "min_encryption_version": t.opt("number"), + "deletion_allowed": t.opt("boolean"), + "exportable": t.opt("boolean"), + "allow_plaintext_backup": t.opt("boolean"), }); export const ITransitExportOptions = t.iface([], { - key_type: t.union(t.lit("encryption-key"), t.lit("signing-key"), t.lit("hmac-key")), - version: t.opt(t.union("string", t.lit("latest"))), + "key_type": t.union(t.lit("encryption-key"), t.lit("signing-key"), t.lit("hmac-key")), + "version": t.opt(t.union("string", t.lit("latest"))), }); export const ITransitExportResponse = t.iface([], { - data: t.iface([], { - name: "string", - keys: t.iface([], {}), - type: "ITransitKeyType", + "data": t.iface([], { + "name": "string", + "keys": t.iface([], { }), + "type": "ITransitKeyType", + }), }); export const ITransitEncryptOptionsSingle = t.iface([], { - plaintext: "string", - context: t.opt("string"), - key_version: t.opt("number"), - nonce: t.opt("string"), - type: t.opt("ITransitKeyType"), - convergent_encryption: t.opt("string"), + "plaintext": "string", + "context": t.opt("string"), + "key_version": t.opt("number"), + "nonce": t.opt("string"), + "type": t.opt("ITransitKeyType"), + "convergent_encryption": t.opt("string"), }); export const ITransitEncryptOptionsBatch = t.iface([], { - key_version: t.opt("number"), - batch_input: "ITransitBatchPlaintext", - type: t.opt("ITransitKeyType"), - convergent_encryption: t.opt("string"), + "key_version": t.opt("number"), + "batch_input": "ITransitBatchPlaintext", + "type": t.opt("ITransitKeyType"), + "convergent_encryption": t.opt("string"), }); export const ITransitEncryptResponseSingle = t.iface([], { - data: t.iface([], { - ciphertext: "string", - }), + "data": t.iface([], { + "ciphertext": "string", + }), }); export const ITransitEncryptResponseBatch = t.iface([], { - data: t.iface([], { - batch_results: "ITransitBatchCiphertext", - }), + "data": t.iface([], { + "batch_results": "ITransitBatchCiphertext", + }), }); export const ITransitDecryptOptionsSingle = t.iface([], { - ciphertext: "string", - context: t.opt("string"), - nonce: t.opt("string"), + "ciphertext": "string", + "context": t.opt("string"), + "nonce": t.opt("string"), }); export const ITransitDecryptOptionsBatch = t.iface([], { - batch_input: "ITransitBatchCiphertext", + "batch_input": "ITransitBatchCiphertext", }); export const ITransitDecryptResponseSingle = t.iface([], { - data: t.iface([], { - plaintext: "string", - }), + "data": t.iface([], { + "plaintext": "string", + }), }); export const ITransitDecryptResponseBatch = t.iface([], { - data: t.iface([], { - batch_results: "ITransitBatchPlaintext", - }), + "data": t.iface([], { + "batch_results": "ITransitBatchPlaintext", + }), }); const exportedTypeSuite: t.ITypeSuite = { - ITransitKeyType, - ITransitBatchPlaintext, - ITransitBatchCiphertext, - ITransitCreateOptions, - ITransitReadResponse, - ITransitListResponse, - ITransitUpdateOptions, - ITransitExportOptions, - ITransitExportResponse, - ITransitEncryptOptionsSingle, - ITransitEncryptOptionsBatch, - ITransitEncryptResponseSingle, - ITransitEncryptResponseBatch, - ITransitDecryptOptionsSingle, - ITransitDecryptOptionsBatch, - ITransitDecryptResponseSingle, - ITransitDecryptResponseBatch, + ITransitKeyType, + ITransitBatchPlaintext, + ITransitBatchCiphertext, + ITransitCreateOptions, + ITransitReadResponse, + ITransitListResponse, + ITransitUpdateOptions, + ITransitExportOptions, + ITransitExportResponse, + ITransitEncryptOptionsSingle, + ITransitEncryptOptionsBatch, + ITransitEncryptResponseSingle, + ITransitEncryptResponseBatch, + ITransitDecryptOptionsSingle, + ITransitDecryptOptionsBatch, + ITransitDecryptResponseSingle, + ITransitDecryptResponseBatch, }; export default exportedTypeSuite;