From 7139243e9a80c47dbd4346e85ccaa097c57da98e Mon Sep 17 00:00:00 2001 From: Sidharth Vinod Date: Thu, 23 Jul 2020 14:08:12 +0530 Subject: [PATCH 1/5] Add ApiResponseError to types Signed-off-by: Sidharth Vinod --- index.d.ts | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/index.d.ts b/index.d.ts index f78a85e..003197f 100644 --- a/index.d.ts +++ b/index.d.ts @@ -25,6 +25,14 @@ declare namespace NodeVault { res?: Option; }; } + interface VaultError extends Error { } + + interface ApiResponseError extends VaultError { + response: { + statusCode: number, + body: any + } + } interface client { handleVaultResponse(res?: { statusCode: number, request: Option, body: any }): Promise; From 1ef95fe94f2d00ca0f22873aaf8fd35d48957af3 Mon Sep 17 00:00:00 2001 From: Sidharth Vinod Date: Thu, 23 Jul 2020 15:16:00 +0530 Subject: [PATCH 2/5] Add proper type generation from schema --- index.d.ts | 763 +++++++++++++++++++++++++++++++++++++++---- package-lock.json | 431 ++++++++++++++++++++++++ package.json | 1 + scripts/gen-types.js | 42 +++ 4 files changed, 1171 insertions(+), 66 deletions(-) create mode 100644 package-lock.json create mode 100644 scripts/gen-types.js diff --git a/index.d.ts b/index.d.ts index 003197f..b77e5b6 100644 --- a/index.d.ts +++ b/index.d.ts @@ -50,72 +50,78 @@ declare namespace NodeVault { generateFunction(name: string, conf: functionConf): void; - status(options?: Option): Promise; - initialized(options?: Option): Promise; - init(options?: Option): Promise; - unseal(options?: Option): Promise; - seal(options?: Option): Promise; - generateRootStatus(options?: Option): Promise; - generateRootInit(options?: Option): Promise; - generateRootCancel(options?: Option): Promise; - generateRootUpdate(options?: Option): Promise; - mounts(options?: Option): Promise; - mount(options?: Option): Promise; - unmount(options?: Option): Promise; - remount(options?: Option): Promise; - policies(options?: Option): Promise; - addPolicy(options?: Option): Promise; - getPolicy(options?: Option): Promise; - removePolicy(options?: Option): Promise; - auths(options?: Option): Promise; - enableAuth(options?: Option): Promise; - disableAuth(options?: Option): Promise; - audits(options?: Option): Promise; - enableAudit(options?: Option): Promise; - disableAudit(options?: Option): Promise; - renew(options?: Option): Promise; - revoke(options?: Option): Promise; - revokePrefix(options?: Option): Promise; - rotate(options?: Option): Promise; - githubLogin(options?: Option): Promise; - userpassLogin(options?: Option): Promise; - kubernetesLogin(options?: Option): Promise; - tokenAccessors(options?: Option): Promise; - tokenCreate(options?: Option): Promise; - tokenCreateOrphan(options?: Option): Promise; - tokenCreateRole(options?: Option): Promise; - tokenLookup(options?: Option): Promise; - tokenLookupAccessor(options?: Option): Promise; - tokenLookupSelf(options?: Option): Promise; - tokenRenew(options?: Option): Promise; - tokenRenewSelf(options?: Option): Promise; - tokenRevoke(options?: Option): Promise; - tokenRevokeAccessor(options?: Option): Promise; - tokenRevokeOrphan(options?: Option): Promise; - tokenRevokeSelf(options?: Option): Promise; - tokenRoles(options?: Option): Promise; - addTokenRole(options?: Option): Promise; - getTokenRole(options?: Option): Promise; - removeTokenRole(options?: Option): Promise; - approleRoles(options?: Option): Promise; - addApproleRole(options?: Option): Promise; - getApproleRole(options?: Option): Promise; - deleteApproleRole(options?: Option): Promise; - getApproleRoleId(options?: Option): Promise; - updateApproleRoleId(options?: Option): Promise; - getApproleRoleSecret(options?: Option): Promise; - approleSecretAccessors(options?: Option): Promise; - approleSecretLookup(options?: Option): Promise; - approleSecretDestroy(options?: Option): Promise; - approleSecretAccessorLookup(options?: Option): Promise; - approleSecretAccessorDestroy(options?: Option): Promise; - approleLogin(options?: Option): Promise; - health(options?: Option): Promise; - leader(options?: Option): Promise; - stepDown(options?: Option): Promise; - encryptData(options?: Option): Promise; - decryptData(options?: Option): Promise; - generateDatabaseCredentials(options?: Option): Promise; + + addApproleRole(options?: AddApproleRoleReq): Promise; + addPolicy(options?: Option): Promise; + addTokenRole(options?: AddTokenRoleReq): Promise; + approleLogin(options?: ApproleLoginReq): Promise; + approleRoles(options?: Option): Promise; + approleSecretAccessorDestroy(options?: Option): Promise; + approleSecretAccessorLookup(options?: ApproleSecretAccessorLookupReq): Promise; + approleSecretAccessors(options?: Option): Promise; + approleSecretDestroy(options?: ApproleSecretDestroyReq): Promise; + approleSecretLookup(options?: ApproleSecretLookupReq): Promise; + audits(options?: Option): Promise; + auths(options?: Option): Promise; + decryptData(options?: Option): Promise; + deleteApproleRole(options?: Option): Promise; + disableAudit(options?: Option): Promise; + disableAuth(options?: Option): Promise; + enableAudit(options?: Option): Promise; + enableAuth(options?: Option): Promise; + encryptData(options?: Option): Promise; + gcpLogin(options?: GcpLoginReq): Promise; + generateDatabaseCredentials(options?: Option): Promise; + generateRootCancel(options?: Option): Promise; + generateRootInit(options?: GenerateRootInitReq): Promise; + generateRootStatus(options?: Option): Promise; + generateRootUpdate(options?: GenerateRootUpdateReq): Promise; + getApproleRole(options?: Option): Promise; + getApproleRoleId(options?: Option): Promise; + getApproleRoleSecret(options?: GetApproleRoleSecretReq): Promise; + getPolicy(options?: Option): Promise; + getTokenRole(options?: Option): Promise; + githubLogin(options?: GithubLoginReq): Promise; + health(options?: HealthQuery): Promise; + init(options?: InitReq): Promise; + initialized(options?: Option): Promise; + kubernetesLogin(options?: KubernetesLoginReq): Promise; + ldapLogin(options?: LdapLoginReq): Promise; + leader(options?: Option): Promise; + mount(options?: Option): Promise; + mounts(options?: Option): Promise; + oktaLogin(options?: OktaLoginReq): Promise; + policies(options?: Option): Promise; + radiusLogin(options?: RadiusLoginReq): Promise; + remount(options?: Option): Promise; + removePolicy(options?: Option): Promise; + removeTokenRole(options?: Option): Promise; + renew(options?: RenewReq): Promise; + revoke(options?: RevokeReq): Promise; + revokePrefix(options?: Option): Promise; + rotate(options?: Option): Promise; + seal(options?: Option): Promise; + status(options?: Option): Promise; + stepDown(options?: Option): Promise; + tokenAccessors(options?: Option): Promise; + tokenCreate(options?: TokenCreateReq): Promise; + tokenCreateOrphan(options?: TokenCreateOrphanReq): Promise; + tokenCreateRole(options?: TokenCreateRoleReq): Promise; + tokenLookup(options?: TokenLookupReq): Promise; + tokenLookupAccessor(options?: TokenLookupAccessorReq): Promise; + tokenLookupSelf(options?: Option): Promise; + tokenRenew(options?: TokenRenewReq): Promise; + tokenRenewSelf(options?: TokenRenewSelfReq): Promise; + tokenRevoke(options?: TokenRevokeReq): Promise; + tokenRevokeAccessor(options?: TokenRevokeAccessorReq): Promise; + tokenRevokeOrphan(options?: TokenRevokeOrphanReq): Promise; + tokenRevokeSelf(options?: Option): Promise; + tokenRoles(options?: Option): Promise; + unmount(options?: Option): Promise; + unseal(options?: UnsealReq): Promise; + unwrap(options?: UnwrapReq): Promise; + updateApproleRoleId(options?: UpdateApproleRoleIdReq): Promise; + userpassLogin(options?: UserpassLoginReq): Promise; } interface VaultOptions { @@ -131,6 +137,631 @@ declare namespace NodeVault { token?: string; requestOptions?: request.CoreOptions; } + + interface AddApproleRoleReq { + bind_secret_id?: boolean; + bound_cidr_list?: string; + policies?: string; + secret_id_num_uses?: number; + secret_id_ttl?: number; + token_num_uses?: number; + token_ttl?: number; + token_max_ttl?: number; + period?: number; + [k: string]: unknown; + } + interface AddTokenRoleReq { + allowed_policies?: string; + disallowed_policies?: string; + orphan?: boolean; + period?: number; + renewable?: boolean; + path_suffix?: string; + explicit_max_ttl?: number; + [k: string]: unknown; + } + interface ApproleLoginReq { + role_id: string; + secret_id?: string; + [k: string]: unknown; + } + interface ApproleLoginRes { + auth?: { + client_token?: string; + policies?: string[]; + metadata?: { + [k: string]: unknown; + }; + lease_duration?: number; + renewable?: boolean; + [k: string]: unknown; + }; + warnings?: string; + wrap_info?: string; + data?: { + [k: string]: unknown; + }; + lease_duration?: number; + renewable?: boolean; + lease_id?: string; + [k: string]: unknown; + } + interface ApproleRolesRes { + auth?: { + client_token?: string; + policies?: string[]; + metadata?: { + [k: string]: unknown; + }; + lease_duration?: number; + renewable?: boolean; + [k: string]: unknown; + }; + warnings?: string; + wrap_info?: string; + data?: { + [k: string]: unknown; + }; + lease_duration?: number; + renewable?: boolean; + lease_id?: string; + [k: string]: unknown; + } + interface ApproleSecretAccessorLookupReq { + secret_id_accessor: string; + [k: string]: unknown; + } + interface ApproleSecretAccessorsRes { + auth?: { + client_token?: string; + policies?: string[]; + metadata?: { + [k: string]: unknown; + }; + lease_duration?: number; + renewable?: boolean; + [k: string]: unknown; + }; + warnings?: string; + wrap_info?: string; + data?: { + [k: string]: unknown; + }; + lease_duration?: number; + renewable?: boolean; + lease_id?: string; + [k: string]: unknown; + } + interface ApproleSecretDestroyReq { + secret_id: string; + [k: string]: unknown; + } + interface ApproleSecretLookupReq { + secret_id: string; + [k: string]: unknown; + } + interface ApproleSecretLookupRes { + auth?: { + client_token?: string; + policies?: string[]; + metadata?: { + [k: string]: unknown; + }; + lease_duration?: number; + renewable?: boolean; + [k: string]: unknown; + }; + warnings?: string; + wrap_info?: string; + data?: { + [k: string]: unknown; + }; + lease_duration?: number; + renewable?: boolean; + lease_id?: string; + [k: string]: unknown; + } + interface GcpLoginReq { + role: string; + jwt: string; + [k: string]: unknown; + } + interface GcpLoginRes { + auth: { + client_token?: string; + policies?: string[]; + metadata?: { + [k: string]: unknown; + }; + lease_duration?: number; + renewable?: boolean; + [k: string]: unknown; + }; + [k: string]: unknown; + } + interface GenerateRootInitReq { + otp?: string; + pgp_key?: string; + [k: string]: unknown; + } + interface GenerateRootInitRes { + started: boolean; + nonce: string; + progress: number; + required: number; + pgp_fingerprint: string; + complete: boolean; + [k: string]: unknown; + } + interface GenerateRootStatusRes { + started: boolean; + nonce: string; + progress: number; + required: number; + pgp_fingerprint: string; + complete: boolean; + [k: string]: unknown; + } + interface GenerateRootUpdateReq { + key: string; + nonce: string; + [k: string]: unknown; + } + interface GenerateRootUpdateRes { + started: boolean; + nonce: string; + progress: number; + required: number; + pgp_fingerprint: string; + complete: boolean; + encoded_root_token?: string; + [k: string]: unknown; + } + interface GetApproleRoleRes { + auth?: { + client_token?: string; + policies?: string[]; + metadata?: { + [k: string]: unknown; + }; + lease_duration?: number; + renewable?: boolean; + [k: string]: unknown; + }; + warnings?: string; + wrap_info?: string; + data?: { + [k: string]: unknown; + }; + lease_duration?: number; + renewable?: boolean; + lease_id?: string; + [k: string]: unknown; + } + interface GetApproleRoleIdRes { + auth?: { + client_token?: string; + policies?: string[]; + metadata?: { + [k: string]: unknown; + }; + lease_duration?: number; + renewable?: boolean; + [k: string]: unknown; + }; + warnings?: string; + wrap_info?: string; + data?: { + [k: string]: unknown; + }; + lease_duration?: number; + renewable?: boolean; + lease_id?: string; + [k: string]: unknown; + } + interface GetApproleRoleSecretReq { + metadata?: string; + cidr_list?: string[]; + [k: string]: unknown; + } + interface GetApproleRoleSecretRes { + auth?: { + client_token?: string; + policies?: string[]; + metadata?: { + [k: string]: unknown; + }; + lease_duration?: number; + renewable?: boolean; + [k: string]: unknown; + }; + warnings?: string; + wrap_info?: string; + data?: { + [k: string]: unknown; + }; + lease_duration?: number; + renewable?: boolean; + lease_id?: string; + [k: string]: unknown; + } + interface GithubLoginReq { + token: string; + [k: string]: unknown; + } + interface GithubLoginRes { + auth: { + client_token?: string; + policies?: string[]; + metadata?: { + [k: string]: unknown; + }; + lease_duration?: number; + renewable?: boolean; + [k: string]: unknown; + }; + [k: string]: unknown; + } + interface HealthQuery { + standbyok?: boolean; + activecode?: number; + standbycode?: number; + sealedcode?: number; + uninitcode?: number; + [k: string]: unknown; + } + interface HealthRes { + cluster_id?: string; + cluster_name?: string; + version?: string; + server_time_utc?: number; + standby?: boolean; + sealed?: boolean; + initialized?: boolean; + [k: string]: unknown; + } + interface InitReq { + secret_shares: number; + secret_threshold: number; + pgp_keys?: string[]; + [k: string]: unknown; + } + interface InitRes { + keys: string[]; + root_token: string; + [k: string]: unknown; + } + interface KubernetesLoginReq { + role: string; + jwt: string; + [k: string]: unknown; + } + interface KubernetesLoginRes { + auth: { + client_token?: string; + policies?: string[]; + metadata?: { + [k: string]: unknown; + }; + lease_duration?: number; + renewable?: boolean; + [k: string]: unknown; + }; + [k: string]: unknown; + } + interface LdapLoginReq { + password: string; + [k: string]: unknown; + } + interface LdapLoginRes { + auth: { + client_token?: string; + policies?: string[]; + metadata?: { + [k: string]: unknown; + }; + lease_duration?: number; + renewable?: boolean; + [k: string]: unknown; + }; + [k: string]: unknown; + } + interface LeaderRes { + ha_enabled?: boolean; + is_self?: boolean; + leader_address?: string; + [k: string]: unknown; + } + interface OktaLoginReq { + password: string; + [k: string]: unknown; + } + interface OktaLoginRes { + auth: { + client_token?: string; + policies?: string[]; + metadata?: { + [k: string]: unknown; + }; + lease_duration?: number; + renewable?: boolean; + [k: string]: unknown; + }; + [k: string]: unknown; + } + interface RadiusLoginReq { + password: string; + [k: string]: unknown; + } + interface RadiusLoginRes { + auth: { + client_token?: string; + policies?: string[]; + metadata?: { + [k: string]: unknown; + }; + lease_duration?: number; + renewable?: boolean; + [k: string]: unknown; + }; + [k: string]: unknown; + } + interface RenewReq { + lease_id: string; + increment?: number; + [k: string]: unknown; + } + interface RenewRes { + lease_id?: string; + renewable?: boolean; + lease_duration?: number; + [k: string]: unknown; + } + interface RevokeReq { + lease_id: string; + [k: string]: unknown; + } + interface StatusRes { + sealed: boolean; + t: number; + n: number; + progress: number; + [k: string]: unknown; + } + interface TokenAccessorsRes { + data: { + keys?: string[]; + [k: string]: unknown; + }; + [k: string]: unknown; + } + interface TokenCreateReq { + id?: string; + policies?: string[]; + meta?: { + [k: string]: unknown; + }; + no_parent?: boolean; + no_default_policy?: boolean; + renewable?: boolean; + ttl?: string; + explicit_max_ttl?: string; + display_name?: string; + num_uses?: number; + [k: string]: unknown; + } + interface TokenCreateRes { + auth: { + client_token?: string; + policies?: string[]; + metadata?: { + [k: string]: unknown; + }; + lease_duration?: number; + renewable?: boolean; + [k: string]: unknown; + }; + [k: string]: unknown; + } + interface TokenCreateOrphanReq { + id?: string; + policies?: string[]; + meta?: { + [k: string]: unknown; + }; + no_parent?: boolean; + no_default_policy?: boolean; + renewable?: boolean; + ttl?: string; + explicit_max_ttl?: string; + display_name?: string; + num_uses?: number; + [k: string]: unknown; + } + interface TokenCreateOrphanRes { + auth: { + client_token?: string; + policies?: string[]; + metadata?: { + [k: string]: unknown; + }; + lease_duration?: number; + renewable?: boolean; + [k: string]: unknown; + }; + [k: string]: unknown; + } + interface TokenCreateRoleReq { + id?: string; + policies?: string[]; + meta?: { + [k: string]: unknown; + }; + no_parent?: boolean; + no_default_policy?: boolean; + renewable?: boolean; + ttl?: string; + explicit_max_ttl?: string; + display_name?: string; + num_uses?: number; + [k: string]: unknown; + } + interface TokenCreateRoleRes { + auth: { + client_token?: string; + policies?: string[]; + metadata?: { + [k: string]: unknown; + }; + lease_duration?: number; + renewable?: boolean; + [k: string]: unknown; + }; + [k: string]: unknown; + } + interface TokenLookupReq { + token: string; + [k: string]: unknown; + } + interface TokenLookupRes { + data: { + id?: string; + policies?: string[]; + path?: string; + meta?: { + [k: string]: unknown; + }; + display_name?: string; + num_uses?: number; + [k: string]: unknown; + }; + [k: string]: unknown; + } + interface TokenLookupAccessorReq { + accessor: string; + [k: string]: unknown; + } + interface TokenLookupAccessorRes { + data: { + id?: string; + policies?: string[]; + path?: string; + meta?: { + [k: string]: unknown; + }; + display_name?: string; + num_uses?: number; + [k: string]: unknown; + }; + [k: string]: unknown; + } + interface TokenLookupSelfRes { + data: { + id?: string; + policies?: string[]; + path?: string; + meta?: { + [k: string]: unknown; + }; + display_name?: string; + num_uses?: number; + [k: string]: unknown; + }; + [k: string]: unknown; + } + interface TokenRenewReq { + token: string; + increment?: number | string; + [k: string]: unknown; + } + interface TokenRenewRes { + auth: { + client_token?: string; + policies?: string[]; + metadata?: { + [k: string]: unknown; + }; + lease_duration?: number; + renewable?: boolean; + [k: string]: unknown; + }; + [k: string]: unknown; + } + interface TokenRenewSelfReq { + increment?: number | string; + [k: string]: unknown; + } + interface TokenRenewSelfRes { + auth: { + client_token?: string; + policies?: string[]; + metadata?: { + [k: string]: unknown; + }; + lease_duration?: number; + renewable?: boolean; + [k: string]: unknown; + }; + [k: string]: unknown; + } + interface TokenRevokeReq { + token: string; + [k: string]: unknown; + } + interface TokenRevokeAccessorReq { + accessor: string; + [k: string]: unknown; + } + interface TokenRevokeOrphanReq { + token: string; + [k: string]: unknown; + } + interface TokenRolesRes { + data: { + keys?: string[]; + [k: string]: unknown; + }; + [k: string]: unknown; + } + interface UnsealReq { + key?: string; + reset?: boolean; + migrate?: boolean; + [k: string]: unknown; + } + interface UnsealRes { + sealed: boolean; + t: number; + n: number; + progress: number; + [k: string]: unknown; + } + interface UnwrapReq { + token?: string; + [k: string]: unknown; + } + interface UpdateApproleRoleIdReq { + role_id: string; + [k: string]: unknown; + } + interface UserpassLoginReq { + password: string; + [k: string]: unknown; + } + interface UserpassLoginRes { + auth: { + client_token?: string; + policies?: string[]; + metadata?: { + [k: string]: unknown; + }; + lease_duration?: number; + renewable?: boolean; + [k: string]: unknown; + }; + [k: string]: unknown; + } + } declare function NodeVault(options?: NodeVault.VaultOptions): NodeVault.client; diff --git a/package-lock.json b/package-lock.json new file mode 100644 index 0000000..2d3e172 --- /dev/null +++ b/package-lock.json @@ -0,0 +1,431 @@ +{ + "name": "node-vault", + "version": "0.9.18", + "lockfileVersion": 1, + "requires": true, + "dependencies": { + "@apidevtools/json-schema-ref-parser": { + "version": "9.0.5", + "resolved": "https://artifacthub-tip.oraclecorp.com/api/npm/osvc-npm/@apidevtools/json-schema-ref-parser/-/json-schema-ref-parser-9.0.5.tgz", + "integrity": "sha1-ly97n1ed/xziIp2JFZKTKnCo0e4=", + "dev": true, + "requires": { + "@jsdevtools/ono": "^7.1.3", + "call-me-maybe": "^1.0.1", + "js-yaml": "^3.13.1" + } + }, + "@jsdevtools/ono": { + "version": "7.1.3", + "resolved": "https://artifacthub-tip.oraclecorp.com/api/npm/osvc-npm/@jsdevtools/ono/-/ono-7.1.3.tgz", + "integrity": "sha1-nfA7vXxpalxYiFw0qgbaQchUN5Y=", + "dev": true + }, + "@types/json-schema": { + "version": "7.0.5", + "resolved": "https://artifacthub-tip.oraclecorp.com/api/npm/osvc-npm/@types/json-schema/-/json-schema-7.0.5.tgz", + "integrity": "sha1-3M5EMOZLRDuolF8CkPtWStW6xt0=", + "dev": true + }, + "ansi-regex": { + "version": "2.1.1", + "resolved": "https://artifacthub-tip.oraclecorp.com/api/npm/osvc-npm/ansi-regex/-/ansi-regex-2.1.1.tgz", + "integrity": "sha1-w7M6te42DYbg5ijwRorn7yfWVN8=", + "dev": true + }, + "any-promise": { + "version": "1.3.0", + "resolved": "https://artifacthub-tip.oraclecorp.com/api/npm/osvc-npm/any-promise/-/any-promise-1.3.0.tgz", + "integrity": "sha1-q8av7tzqUugJzcA3au0845Y10X8=", + "dev": true + }, + "argparse": { + "version": "1.0.10", + "resolved": "https://artifacthub-tip.oraclecorp.com/api/npm/osvc-npm/argparse/-/argparse-1.0.10.tgz", + "integrity": "sha1-vNZ5HqWuCXJeF+WtmIE0zUCz2RE=", + "dev": true, + "requires": { + "sprintf-js": "~1.0.2" + } + }, + "balanced-match": { + "version": "1.0.0", + "resolved": "https://artifacthub-tip.oraclecorp.com/api/npm/osvc-npm/balanced-match/-/balanced-match-1.0.0.tgz", + "integrity": "sha1-ibTRmasr7kneFk6gK4nORi1xt2c=", + "dev": true + }, + "brace-expansion": { + "version": "1.1.11", + "resolved": "https://artifacthub-tip.oraclecorp.com/api/npm/osvc-npm/brace-expansion/-/brace-expansion-1.1.11.tgz", + "integrity": "sha1-PH/L9SnYcibz0vUrlm/1Jx60Qd0=", + "dev": true, + "requires": { + "balanced-match": "^1.0.0", + "concat-map": "0.0.1" + } + }, + "call-me-maybe": { + "version": "1.0.1", + "resolved": "https://artifacthub-tip.oraclecorp.com/api/npm/osvc-npm/call-me-maybe/-/call-me-maybe-1.0.1.tgz", + "integrity": "sha1-JtII6onje1y95gJQoV8DHBak1ms=", + "dev": true + }, + "cli-color": { + "version": "2.0.0", + "resolved": "https://artifacthub-tip.oraclecorp.com/api/npm/osvc-npm/cli-color/-/cli-color-2.0.0.tgz", + "integrity": "sha1-Eez7WKeSeM9gNaYMVOM4+dg3iXw=", + "dev": true, + "requires": { + "ansi-regex": "^2.1.1", + "d": "^1.0.1", + "es5-ext": "^0.10.51", + "es6-iterator": "^2.0.3", + "memoizee": "^0.4.14", + "timers-ext": "^0.1.7" + } + }, + "concat-map": { + "version": "0.0.1", + "resolved": "https://artifacthub-tip.oraclecorp.com/api/npm/osvc-npm/concat-map/-/concat-map-0.0.1.tgz", + "integrity": "sha1-2Klr13/Wjfd5OnMDajug1UBdR3s=", + "dev": true + }, + "d": { + "version": "1.0.1", + "resolved": "https://artifacthub-tip.oraclecorp.com/api/npm/osvc-npm/d/-/d-1.0.1.tgz", + "integrity": "sha1-hpgJU3LVjb7jRv/Qxwk/mfj561o=", + "dev": true, + "requires": { + "es5-ext": "^0.10.50", + "type": "^1.0.1" + } + }, + "es5-ext": { + "version": "0.10.53", + "resolved": "https://artifacthub-tip.oraclecorp.com/api/npm/osvc-npm/es5-ext/-/es5-ext-0.10.53.tgz", + "integrity": "sha1-k8WjrP2+8nUiCtcmRK0C7hg2jeE=", + "dev": true, + "requires": { + "es6-iterator": "~2.0.3", + "es6-symbol": "~3.1.3", + "next-tick": "~1.0.0" + } + }, + "es6-iterator": { + "version": "2.0.3", + "resolved": "https://artifacthub-tip.oraclecorp.com/api/npm/osvc-npm/es6-iterator/-/es6-iterator-2.0.3.tgz", + "integrity": "sha1-p96IkUGgWpSwhUQDstCg+/qY87c=", + "dev": true, + "requires": { + "d": "1", + "es5-ext": "^0.10.35", + "es6-symbol": "^3.1.1" + } + }, + "es6-symbol": { + "version": "3.1.3", + "resolved": "https://artifacthub-tip.oraclecorp.com/api/npm/osvc-npm/es6-symbol/-/es6-symbol-3.1.3.tgz", + "integrity": "sha1-utXTwbzawoJp9MszHkMceKxwXRg=", + "dev": true, + "requires": { + "d": "^1.0.1", + "ext": "^1.1.2" + } + }, + "es6-weak-map": { + "version": "2.0.3", + "resolved": "https://artifacthub-tip.oraclecorp.com/api/npm/osvc-npm/es6-weak-map/-/es6-weak-map-2.0.3.tgz", + "integrity": "sha1-ttofFswswNm+Q+a9v8Xn383zHVM=", + "dev": true, + "requires": { + "d": "1", + "es5-ext": "^0.10.46", + "es6-iterator": "^2.0.3", + "es6-symbol": "^3.1.1" + } + }, + "esprima": { + "version": "4.0.1", + "resolved": "https://artifacthub-tip.oraclecorp.com/api/npm/osvc-npm/esprima/-/esprima-4.0.1.tgz", + "integrity": "sha1-E7BM2z5sXRnfkatph6hpVhmwqnE=", + "dev": true + }, + "event-emitter": { + "version": "0.3.5", + "resolved": "https://artifacthub-tip.oraclecorp.com/api/npm/osvc-npm/event-emitter/-/event-emitter-0.3.5.tgz", + "integrity": "sha1-34xp7vFkeSPHFXuc6DhAYQsCzDk=", + "dev": true, + "requires": { + "d": "1", + "es5-ext": "~0.10.14" + } + }, + "ext": { + "version": "1.4.0", + "resolved": "https://artifacthub-tip.oraclecorp.com/api/npm/osvc-npm/ext/-/ext-1.4.0.tgz", + "integrity": "sha1-ia56BxWPedNVF4gpBDJAd+Q3kkQ=", + "dev": true, + "requires": { + "type": "^2.0.0" + }, + "dependencies": { + "type": { + "version": "2.0.0", + "resolved": "https://artifacthub-tip.oraclecorp.com/api/npm/osvc-npm/type/-/type-2.0.0.tgz", + "integrity": "sha1-Xxb/bvLrRPJgSU2uJxAzspwJqcM=", + "dev": true + } + } + }, + "fs.realpath": { + "version": "1.0.0", + "resolved": "https://artifacthub-tip.oraclecorp.com/api/npm/osvc-npm/fs.realpath/-/fs.realpath-1.0.0.tgz", + "integrity": "sha1-FQStJSMVjKpA20onh8sBQRmU6k8=", + "dev": true + }, + "glob": { + "version": "7.1.6", + "resolved": "https://artifacthub-tip.oraclecorp.com/api/npm/osvc-npm/glob/-/glob-7.1.6.tgz", + "integrity": "sha1-FB8zuBp8JJLhJVlDB0gMRmeSeKY=", + "dev": true, + "requires": { + "fs.realpath": "^1.0.0", + "inflight": "^1.0.4", + "inherits": "2", + "minimatch": "^3.0.4", + "once": "^1.3.0", + "path-is-absolute": "^1.0.0" + } + }, + "inflight": { + "version": "1.0.6", + "resolved": "https://artifacthub-tip.oraclecorp.com/api/npm/osvc-npm/inflight/-/inflight-1.0.6.tgz", + "integrity": "sha1-Sb1jMdfQLQwJvJEKEHW6gWW1bfk=", + "dev": true, + "requires": { + "once": "^1.3.0", + "wrappy": "1" + } + }, + "inherits": { + "version": "2.0.4", + "resolved": "https://artifacthub-tip.oraclecorp.com/api/npm/osvc-npm/inherits/-/inherits-2.0.4.tgz", + "integrity": "sha1-D6LGT5MpF8NDOg3tVTY6rjdBa3w=", + "dev": true + }, + "is-extglob": { + "version": "2.1.1", + "resolved": "https://artifacthub-tip.oraclecorp.com/api/npm/osvc-npm/is-extglob/-/is-extglob-2.1.1.tgz", + "integrity": "sha1-qIwCU1eR8C7TfHahueqXc8gz+MI=", + "dev": true + }, + "is-glob": { + "version": "4.0.1", + "resolved": "https://artifacthub-tip.oraclecorp.com/api/npm/osvc-npm/is-glob/-/is-glob-4.0.1.tgz", + "integrity": "sha1-dWfb6fL14kZ7x3q4PEopSCQHpdw=", + "dev": true, + "requires": { + "is-extglob": "^2.1.1" + } + }, + "is-promise": { + "version": "2.2.2", + "resolved": "https://artifacthub-tip.oraclecorp.com/api/npm/osvc-npm/is-promise/-/is-promise-2.2.2.tgz", + "integrity": "sha1-OauVnMv5p3TPB597QMeib3YxNfE=", + "dev": true + }, + "js-yaml": { + "version": "3.14.0", + "resolved": "https://artifacthub-tip.oraclecorp.com/api/npm/osvc-npm/js-yaml/-/js-yaml-3.14.0.tgz", + "integrity": "sha1-p6NBcPJqIbsWJCTYray0ETpp5II=", + "dev": true, + "requires": { + "argparse": "^1.0.7", + "esprima": "^4.0.0" + } + }, + "json-schema-ref-parser": { + "version": "9.0.5", + "resolved": "https://artifacthub-tip.oraclecorp.com/api/npm/osvc-npm/json-schema-ref-parser/-/json-schema-ref-parser-9.0.5.tgz", + "integrity": "sha1-GZ40B5K3BVlkTV/KUfDNFGq+Bqs=", + "dev": true, + "requires": { + "@apidevtools/json-schema-ref-parser": "9.0.5" + } + }, + "json-schema-to-typescript": { + "version": "9.1.1", + "resolved": "https://artifacthub-tip.oraclecorp.com/api/npm/osvc-npm/json-schema-to-typescript/-/json-schema-to-typescript-9.1.1.tgz", + "integrity": "sha1-VyweuLfKgtZTTAI8RlHz/pJRccA=", + "dev": true, + "requires": { + "@types/json-schema": "^7.0.4", + "cli-color": "^2.0.0", + "glob": "^7.1.6", + "is-glob": "^4.0.1", + "json-schema-ref-parser": "^9.0.1", + "json-stringify-safe": "^5.0.1", + "lodash": "^4.17.15", + "minimist": "^1.2.5", + "mkdirp": "^1.0.4", + "mz": "^2.7.0", + "prettier": "^2.0.5", + "stdin": "0.0.1" + } + }, + "json-stringify-safe": { + "version": "5.0.1", + "resolved": "https://artifacthub-tip.oraclecorp.com/api/npm/osvc-npm/json-stringify-safe/-/json-stringify-safe-5.0.1.tgz", + "integrity": "sha1-Epai1Y/UXxmg9s4B1lcB4sc1tus=", + "dev": true + }, + "lodash": { + "version": "4.17.19", + "resolved": "https://artifacthub-tip.oraclecorp.com/api/npm/osvc-npm/lodash/-/lodash-4.17.19.tgz", + "integrity": "sha1-5I3e2+MLMyF4PFtDAfvTU7weSks=", + "dev": true + }, + "lru-queue": { + "version": "0.1.0", + "resolved": "https://artifacthub-tip.oraclecorp.com/api/npm/osvc-npm/lru-queue/-/lru-queue-0.1.0.tgz", + "integrity": "sha1-Jzi9nw089PhEkMVzbEhpmsYyzaM=", + "dev": true, + "requires": { + "es5-ext": "~0.10.2" + } + }, + "memoizee": { + "version": "0.4.14", + "resolved": "https://artifacthub-tip.oraclecorp.com/api/npm/osvc-npm/memoizee/-/memoizee-0.4.14.tgz", + "integrity": "sha1-B6APIEaZ+alcLZ53IYJxx81hDVc=", + "dev": true, + "requires": { + "d": "1", + "es5-ext": "^0.10.45", + "es6-weak-map": "^2.0.2", + "event-emitter": "^0.3.5", + "is-promise": "^2.1", + "lru-queue": "0.1", + "next-tick": "1", + "timers-ext": "^0.1.5" + } + }, + "minimatch": { + "version": "3.0.4", + "resolved": "https://artifacthub-tip.oraclecorp.com/api/npm/osvc-npm/minimatch/-/minimatch-3.0.4.tgz", + "integrity": "sha1-UWbihkV/AzBgZL5Ul+jbsMPTIIM=", + "dev": true, + "requires": { + "brace-expansion": "^1.1.7" + } + }, + "minimist": { + "version": "1.2.5", + "resolved": "https://artifacthub-tip.oraclecorp.com/api/npm/osvc-npm/minimist/-/minimist-1.2.5.tgz", + "integrity": "sha1-Z9ZgFLZqaoqqDAg8X9WN9OTpdgI=", + "dev": true + }, + "mkdirp": { + "version": "1.0.4", + "resolved": "https://artifacthub-tip.oraclecorp.com/api/npm/osvc-npm/mkdirp/-/mkdirp-1.0.4.tgz", + "integrity": "sha1-PrXtYmInVteaXw4qIh3+utdcL34=", + "dev": true + }, + "mz": { + "version": "2.7.0", + "resolved": "https://artifacthub-tip.oraclecorp.com/api/npm/osvc-npm/mz/-/mz-2.7.0.tgz", + "integrity": "sha1-lQCAV6Vsr63CvGPd5/n/aVWUjjI=", + "dev": true, + "requires": { + "any-promise": "^1.0.0", + "object-assign": "^4.0.1", + "thenify-all": "^1.0.0" + } + }, + "next-tick": { + "version": "1.0.0", + "resolved": "https://artifacthub-tip.oraclecorp.com/api/npm/osvc-npm/next-tick/-/next-tick-1.0.0.tgz", + "integrity": "sha1-yobR/ogoFpsBICCOPchCS524NCw=", + "dev": true + }, + "object-assign": { + "version": "4.1.1", + "resolved": "https://artifacthub-tip.oraclecorp.com/api/npm/osvc-npm/object-assign/-/object-assign-4.1.1.tgz", + "integrity": "sha1-IQmtx5ZYh8/AXLvUQsrIv7s2CGM=", + "dev": true + }, + "once": { + "version": "1.4.0", + "resolved": "https://artifacthub-tip.oraclecorp.com/api/npm/osvc-npm/once/-/once-1.4.0.tgz", + "integrity": "sha1-WDsap3WWHUsROsF9nFC6753Xa9E=", + "dev": true, + "requires": { + "wrappy": "1" + } + }, + "path-is-absolute": { + "version": "1.0.1", + "resolved": "https://artifacthub-tip.oraclecorp.com/api/npm/osvc-npm/path-is-absolute/-/path-is-absolute-1.0.1.tgz", + "integrity": "sha1-F0uSaHNVNP+8es5r9TpanhtcX18=", + "dev": true + }, + "prettier": { + "version": "2.0.5", + "resolved": "https://artifacthub-tip.oraclecorp.com/api/npm/osvc-npm/prettier/-/prettier-2.0.5.tgz", + "integrity": "sha1-1tVigkVSQ/L5LMFxZpLAiqMVItQ=", + "dev": true + }, + "sprintf-js": { + "version": "1.0.3", + "resolved": "https://artifacthub-tip.oraclecorp.com/api/npm/osvc-npm/sprintf-js/-/sprintf-js-1.0.3.tgz", + "integrity": "sha1-BOaSb2YolTVPPdAVIDYzuFcpfiw=", + "dev": true + }, + "stdin": { + "version": "0.0.1", + "resolved": "https://artifacthub-tip.oraclecorp.com/api/npm/osvc-npm/stdin/-/stdin-0.0.1.tgz", + "integrity": "sha1-0wQZgarsPf28d6GzjWNy449ftx4=", + "dev": true + }, + "thenify": { + "version": "3.3.1", + "resolved": "https://artifacthub-tip.oraclecorp.com/api/npm/osvc-npm/thenify/-/thenify-3.3.1.tgz", + "integrity": "sha1-iTLmhqQGYDigFt2eLKRq3Zg4qV8=", + "dev": true, + "requires": { + "any-promise": "^1.0.0" + } + }, + "thenify-all": { + "version": "1.6.0", + "resolved": "https://artifacthub-tip.oraclecorp.com/api/npm/osvc-npm/thenify-all/-/thenify-all-1.6.0.tgz", + "integrity": "sha1-GhkY1ALY/D+Y+/I02wvMjMEOlyY=", + "dev": true, + "requires": { + "thenify": ">= 3.1.0 < 4" + } + }, + "timers-ext": { + "version": "0.1.7", + "resolved": "https://artifacthub-tip.oraclecorp.com/api/npm/osvc-npm/timers-ext/-/timers-ext-0.1.7.tgz", + "integrity": "sha1-b1ethXjgej+5+R2Th9ZWR1VeJcY=", + "dev": true, + "requires": { + "es5-ext": "~0.10.46", + "next-tick": "1" + } + }, + "type": { + "version": "1.2.0", + "resolved": "https://artifacthub-tip.oraclecorp.com/api/npm/osvc-npm/type/-/type-1.2.0.tgz", + "integrity": "sha1-hI3XaY2vo+VKbEeedZxLw/GIR6A=", + "dev": true + }, + "wrappy": { + "version": "1.0.2", + "resolved": "https://artifacthub-tip.oraclecorp.com/api/npm/osvc-npm/wrappy/-/wrappy-1.0.2.tgz", + "integrity": "sha1-tSQ9jz7BqjXxNkYFvA0QNuMKtp8=", + "dev": true + } + } +} diff --git a/package.json b/package.json index 373978c..44707b4 100644 --- a/package.json +++ b/package.json @@ -41,6 +41,7 @@ "eslint-plugin-react": "^5.2.2", "husky": "^0.14.3", "istanbul": "^0.4.5", + "json-schema-to-typescript": "^9.1.1", "mocha": "6.0.2", "sinon": "1.17.3", "sinon-chai": "^2.8.0" diff --git a/scripts/gen-types.js b/scripts/gen-types.js new file mode 100644 index 0000000..9090aa6 --- /dev/null +++ b/scripts/gen-types.js @@ -0,0 +1,42 @@ +const { compile, DEFAULT_OPTIONS } = require('json-schema-to-typescript'); +const { toSafeString } = require('json-schema-to-typescript/dist/src/utils'); +const { format } = require('json-schema-to-typescript/dist/src/formatter'); +const commands = require('../src/commands'); +const fs = require('fs'); + +async function run() { + let types = ''; + // TODO : Generate complete index.d.ts automatically + let funs = ` +interface CopyPasteContentIntoIndex { \n +`; + const commandNames = Object.keys(commands); + commandNames.sort(); + for (k of commandNames) { + const c = commands[k]; + let reqOpt = 'Option'; + let resOpt = 'unknown'; + if (c.schema) { + for (schemaType of Object.keys(c.schema)) { + const typeName = `${k}_${schemaType}`; + if (schemaType === 'req' || schemaType === 'query') { + reqOpt = toSafeString(`${k}_${schemaType}`); + } else if (schemaType === 'res') { + resOpt = toSafeString(`${k}_${schemaType}`); + } + types += await compile(c.schema[schemaType], typeName, { + bannerComment: '', + }); + } + } + funs += `${k}(options?: ${reqOpt}): Promise<${resOpt}>;\n`; + } + + funs += `}`; + + types = types.replace(/export /g, ''); + fs.writeFileSync(`types/types.ts`, format(types, DEFAULT_OPTIONS)); + fs.writeFileSync(`types/commands.ts`, format(funs, DEFAULT_OPTIONS)); +} + +run(); From 2c7a18bad84168b076453bacb86cb8a6d9469c80 Mon Sep 17 00:00:00 2001 From: Sidharth Vinod Date: Thu, 23 Jul 2020 15:21:40 +0530 Subject: [PATCH 3/5] Cleanup --- scripts/gen-types.js | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/scripts/gen-types.js b/scripts/gen-types.js index 9090aa6..a532f13 100644 --- a/scripts/gen-types.js +++ b/scripts/gen-types.js @@ -7,36 +7,36 @@ const fs = require('fs'); async function run() { let types = ''; // TODO : Generate complete index.d.ts automatically - let funs = ` + let commandDefs = ` interface CopyPasteContentIntoIndex { \n `; const commandNames = Object.keys(commands); commandNames.sort(); - for (k of commandNames) { - const c = commands[k]; + for (const commandName of commandNames) { + const command = commands[commandName]; let reqOpt = 'Option'; let resOpt = 'unknown'; - if (c.schema) { - for (schemaType of Object.keys(c.schema)) { - const typeName = `${k}_${schemaType}`; + if (command.schema) { + for (const schemaType of Object.keys(command.schema)) { + const typeName = `${commandName}_${schemaType}`; if (schemaType === 'req' || schemaType === 'query') { - reqOpt = toSafeString(`${k}_${schemaType}`); + reqOpt = toSafeString(`${commandName}_${schemaType}`); } else if (schemaType === 'res') { - resOpt = toSafeString(`${k}_${schemaType}`); + resOpt = toSafeString(`${commandName}_${schemaType}`); } - types += await compile(c.schema[schemaType], typeName, { + types += await compile(command.schema[schemaType], typeName, { bannerComment: '', }); } } - funs += `${k}(options?: ${reqOpt}): Promise<${resOpt}>;\n`; + commandDefs += `${commandName}(options?: ${reqOpt}): Promise<${resOpt}>;\n`; } - funs += `}`; + commandDefs += `}`; types = types.replace(/export /g, ''); fs.writeFileSync(`types/types.ts`, format(types, DEFAULT_OPTIONS)); - fs.writeFileSync(`types/commands.ts`, format(funs, DEFAULT_OPTIONS)); + fs.writeFileSync(`types/commands.ts`, format(commandDefs, DEFAULT_OPTIONS)); } run(); From d11e58c8ee698e1c4eaace40727ab2a88783b0e9 Mon Sep 17 00:00:00 2001 From: Sidharth Vinod Date: Thu, 23 Jul 2020 17:55:20 +0530 Subject: [PATCH 4/5] Yarn --- package-lock.json | 431 ---------------------------------------------- yarn.lock | 239 ++++++++++++++++++++++++- 2 files changed, 233 insertions(+), 437 deletions(-) delete mode 100644 package-lock.json diff --git a/package-lock.json b/package-lock.json deleted file mode 100644 index 2d3e172..0000000 --- a/package-lock.json +++ /dev/null @@ -1,431 +0,0 @@ -{ - "name": "node-vault", - "version": "0.9.18", - "lockfileVersion": 1, - "requires": true, - "dependencies": { - "@apidevtools/json-schema-ref-parser": { - "version": "9.0.5", - "resolved": "https://artifacthub-tip.oraclecorp.com/api/npm/osvc-npm/@apidevtools/json-schema-ref-parser/-/json-schema-ref-parser-9.0.5.tgz", - "integrity": "sha1-ly97n1ed/xziIp2JFZKTKnCo0e4=", - "dev": true, - "requires": { - "@jsdevtools/ono": "^7.1.3", - "call-me-maybe": "^1.0.1", - "js-yaml": "^3.13.1" - } - }, - "@jsdevtools/ono": { - "version": "7.1.3", - "resolved": "https://artifacthub-tip.oraclecorp.com/api/npm/osvc-npm/@jsdevtools/ono/-/ono-7.1.3.tgz", - "integrity": "sha1-nfA7vXxpalxYiFw0qgbaQchUN5Y=", - "dev": true - }, - "@types/json-schema": { - "version": "7.0.5", - "resolved": "https://artifacthub-tip.oraclecorp.com/api/npm/osvc-npm/@types/json-schema/-/json-schema-7.0.5.tgz", - "integrity": "sha1-3M5EMOZLRDuolF8CkPtWStW6xt0=", - "dev": true - }, - "ansi-regex": { - "version": "2.1.1", - "resolved": "https://artifacthub-tip.oraclecorp.com/api/npm/osvc-npm/ansi-regex/-/ansi-regex-2.1.1.tgz", - "integrity": "sha1-w7M6te42DYbg5ijwRorn7yfWVN8=", - "dev": true - }, - "any-promise": { - "version": "1.3.0", - "resolved": "https://artifacthub-tip.oraclecorp.com/api/npm/osvc-npm/any-promise/-/any-promise-1.3.0.tgz", - "integrity": "sha1-q8av7tzqUugJzcA3au0845Y10X8=", - "dev": true - }, - "argparse": { - "version": "1.0.10", - "resolved": "https://artifacthub-tip.oraclecorp.com/api/npm/osvc-npm/argparse/-/argparse-1.0.10.tgz", - "integrity": "sha1-vNZ5HqWuCXJeF+WtmIE0zUCz2RE=", - "dev": true, - "requires": { - "sprintf-js": "~1.0.2" - } - }, - "balanced-match": { - "version": "1.0.0", - "resolved": "https://artifacthub-tip.oraclecorp.com/api/npm/osvc-npm/balanced-match/-/balanced-match-1.0.0.tgz", - "integrity": "sha1-ibTRmasr7kneFk6gK4nORi1xt2c=", - "dev": true - }, - "brace-expansion": { - "version": "1.1.11", - "resolved": "https://artifacthub-tip.oraclecorp.com/api/npm/osvc-npm/brace-expansion/-/brace-expansion-1.1.11.tgz", - "integrity": "sha1-PH/L9SnYcibz0vUrlm/1Jx60Qd0=", - "dev": true, - "requires": { - "balanced-match": "^1.0.0", - "concat-map": "0.0.1" - } - }, - "call-me-maybe": { - "version": "1.0.1", - "resolved": "https://artifacthub-tip.oraclecorp.com/api/npm/osvc-npm/call-me-maybe/-/call-me-maybe-1.0.1.tgz", - "integrity": "sha1-JtII6onje1y95gJQoV8DHBak1ms=", - "dev": true - }, - "cli-color": { - "version": "2.0.0", - "resolved": "https://artifacthub-tip.oraclecorp.com/api/npm/osvc-npm/cli-color/-/cli-color-2.0.0.tgz", - "integrity": "sha1-Eez7WKeSeM9gNaYMVOM4+dg3iXw=", - "dev": true, - "requires": { - "ansi-regex": "^2.1.1", - "d": "^1.0.1", - "es5-ext": "^0.10.51", - "es6-iterator": "^2.0.3", - "memoizee": "^0.4.14", - "timers-ext": "^0.1.7" - } - }, - "concat-map": { - "version": "0.0.1", - "resolved": "https://artifacthub-tip.oraclecorp.com/api/npm/osvc-npm/concat-map/-/concat-map-0.0.1.tgz", - "integrity": "sha1-2Klr13/Wjfd5OnMDajug1UBdR3s=", - "dev": true - }, - "d": { - "version": "1.0.1", - "resolved": "https://artifacthub-tip.oraclecorp.com/api/npm/osvc-npm/d/-/d-1.0.1.tgz", - "integrity": "sha1-hpgJU3LVjb7jRv/Qxwk/mfj561o=", - "dev": true, - "requires": { - "es5-ext": "^0.10.50", - "type": "^1.0.1" - } - }, - "es5-ext": { - "version": "0.10.53", - "resolved": "https://artifacthub-tip.oraclecorp.com/api/npm/osvc-npm/es5-ext/-/es5-ext-0.10.53.tgz", - "integrity": "sha1-k8WjrP2+8nUiCtcmRK0C7hg2jeE=", - "dev": true, - "requires": { - "es6-iterator": "~2.0.3", - "es6-symbol": "~3.1.3", - "next-tick": "~1.0.0" - } - }, - "es6-iterator": { - "version": "2.0.3", - "resolved": "https://artifacthub-tip.oraclecorp.com/api/npm/osvc-npm/es6-iterator/-/es6-iterator-2.0.3.tgz", - "integrity": "sha1-p96IkUGgWpSwhUQDstCg+/qY87c=", - "dev": true, - "requires": { - "d": "1", - "es5-ext": "^0.10.35", - "es6-symbol": "^3.1.1" - } - }, - "es6-symbol": { - "version": "3.1.3", - "resolved": "https://artifacthub-tip.oraclecorp.com/api/npm/osvc-npm/es6-symbol/-/es6-symbol-3.1.3.tgz", - "integrity": "sha1-utXTwbzawoJp9MszHkMceKxwXRg=", - "dev": true, - "requires": { - "d": "^1.0.1", - "ext": "^1.1.2" - } - }, - "es6-weak-map": { - "version": "2.0.3", - "resolved": "https://artifacthub-tip.oraclecorp.com/api/npm/osvc-npm/es6-weak-map/-/es6-weak-map-2.0.3.tgz", - "integrity": "sha1-ttofFswswNm+Q+a9v8Xn383zHVM=", - "dev": true, - "requires": { - "d": "1", - "es5-ext": "^0.10.46", - "es6-iterator": "^2.0.3", - "es6-symbol": "^3.1.1" - } - }, - "esprima": { - "version": "4.0.1", - "resolved": "https://artifacthub-tip.oraclecorp.com/api/npm/osvc-npm/esprima/-/esprima-4.0.1.tgz", - "integrity": "sha1-E7BM2z5sXRnfkatph6hpVhmwqnE=", - "dev": true - }, - "event-emitter": { - "version": "0.3.5", - "resolved": "https://artifacthub-tip.oraclecorp.com/api/npm/osvc-npm/event-emitter/-/event-emitter-0.3.5.tgz", - "integrity": "sha1-34xp7vFkeSPHFXuc6DhAYQsCzDk=", - "dev": true, - "requires": { - "d": "1", - "es5-ext": "~0.10.14" - } - }, - "ext": { - "version": "1.4.0", - "resolved": "https://artifacthub-tip.oraclecorp.com/api/npm/osvc-npm/ext/-/ext-1.4.0.tgz", - "integrity": "sha1-ia56BxWPedNVF4gpBDJAd+Q3kkQ=", - "dev": true, - "requires": { - "type": "^2.0.0" - }, - "dependencies": { - "type": { - "version": "2.0.0", - "resolved": "https://artifacthub-tip.oraclecorp.com/api/npm/osvc-npm/type/-/type-2.0.0.tgz", - "integrity": "sha1-Xxb/bvLrRPJgSU2uJxAzspwJqcM=", - "dev": true - } - } - }, - "fs.realpath": { - "version": "1.0.0", - "resolved": "https://artifacthub-tip.oraclecorp.com/api/npm/osvc-npm/fs.realpath/-/fs.realpath-1.0.0.tgz", - "integrity": "sha1-FQStJSMVjKpA20onh8sBQRmU6k8=", - "dev": true - }, - "glob": { - "version": "7.1.6", - "resolved": "https://artifacthub-tip.oraclecorp.com/api/npm/osvc-npm/glob/-/glob-7.1.6.tgz", - "integrity": "sha1-FB8zuBp8JJLhJVlDB0gMRmeSeKY=", - "dev": true, - "requires": { - "fs.realpath": "^1.0.0", - "inflight": "^1.0.4", - "inherits": "2", - "minimatch": "^3.0.4", - "once": "^1.3.0", - "path-is-absolute": "^1.0.0" - } - }, - "inflight": { - "version": "1.0.6", - "resolved": "https://artifacthub-tip.oraclecorp.com/api/npm/osvc-npm/inflight/-/inflight-1.0.6.tgz", - "integrity": "sha1-Sb1jMdfQLQwJvJEKEHW6gWW1bfk=", - "dev": true, - "requires": { - "once": "^1.3.0", - "wrappy": "1" - } - }, - "inherits": { - "version": "2.0.4", - "resolved": "https://artifacthub-tip.oraclecorp.com/api/npm/osvc-npm/inherits/-/inherits-2.0.4.tgz", - "integrity": "sha1-D6LGT5MpF8NDOg3tVTY6rjdBa3w=", - "dev": true - }, - "is-extglob": { - "version": "2.1.1", - "resolved": "https://artifacthub-tip.oraclecorp.com/api/npm/osvc-npm/is-extglob/-/is-extglob-2.1.1.tgz", - "integrity": "sha1-qIwCU1eR8C7TfHahueqXc8gz+MI=", - "dev": true - }, - "is-glob": { - "version": "4.0.1", - "resolved": "https://artifacthub-tip.oraclecorp.com/api/npm/osvc-npm/is-glob/-/is-glob-4.0.1.tgz", - "integrity": "sha1-dWfb6fL14kZ7x3q4PEopSCQHpdw=", - "dev": true, - "requires": { - "is-extglob": "^2.1.1" - } - }, - "is-promise": { - "version": "2.2.2", - "resolved": "https://artifacthub-tip.oraclecorp.com/api/npm/osvc-npm/is-promise/-/is-promise-2.2.2.tgz", - "integrity": "sha1-OauVnMv5p3TPB597QMeib3YxNfE=", - "dev": true - }, - "js-yaml": { - "version": "3.14.0", - "resolved": "https://artifacthub-tip.oraclecorp.com/api/npm/osvc-npm/js-yaml/-/js-yaml-3.14.0.tgz", - "integrity": "sha1-p6NBcPJqIbsWJCTYray0ETpp5II=", - "dev": true, - "requires": { - "argparse": "^1.0.7", - "esprima": "^4.0.0" - } - }, - "json-schema-ref-parser": { - "version": "9.0.5", - "resolved": "https://artifacthub-tip.oraclecorp.com/api/npm/osvc-npm/json-schema-ref-parser/-/json-schema-ref-parser-9.0.5.tgz", - "integrity": "sha1-GZ40B5K3BVlkTV/KUfDNFGq+Bqs=", - "dev": true, - "requires": { - "@apidevtools/json-schema-ref-parser": "9.0.5" - } - }, - "json-schema-to-typescript": { - "version": "9.1.1", - "resolved": "https://artifacthub-tip.oraclecorp.com/api/npm/osvc-npm/json-schema-to-typescript/-/json-schema-to-typescript-9.1.1.tgz", - "integrity": "sha1-VyweuLfKgtZTTAI8RlHz/pJRccA=", - "dev": true, - "requires": { - "@types/json-schema": "^7.0.4", - "cli-color": "^2.0.0", - "glob": "^7.1.6", - "is-glob": "^4.0.1", - "json-schema-ref-parser": "^9.0.1", - "json-stringify-safe": "^5.0.1", - "lodash": "^4.17.15", - "minimist": "^1.2.5", - "mkdirp": "^1.0.4", - "mz": "^2.7.0", - "prettier": "^2.0.5", - "stdin": "0.0.1" - } - }, - "json-stringify-safe": { - "version": "5.0.1", - "resolved": "https://artifacthub-tip.oraclecorp.com/api/npm/osvc-npm/json-stringify-safe/-/json-stringify-safe-5.0.1.tgz", - "integrity": "sha1-Epai1Y/UXxmg9s4B1lcB4sc1tus=", - "dev": true - }, - "lodash": { - "version": "4.17.19", - "resolved": "https://artifacthub-tip.oraclecorp.com/api/npm/osvc-npm/lodash/-/lodash-4.17.19.tgz", - "integrity": "sha1-5I3e2+MLMyF4PFtDAfvTU7weSks=", - "dev": true - }, - "lru-queue": { - "version": "0.1.0", - "resolved": "https://artifacthub-tip.oraclecorp.com/api/npm/osvc-npm/lru-queue/-/lru-queue-0.1.0.tgz", - "integrity": "sha1-Jzi9nw089PhEkMVzbEhpmsYyzaM=", - "dev": true, - "requires": { - "es5-ext": "~0.10.2" - } - }, - "memoizee": { - "version": "0.4.14", - "resolved": "https://artifacthub-tip.oraclecorp.com/api/npm/osvc-npm/memoizee/-/memoizee-0.4.14.tgz", - "integrity": "sha1-B6APIEaZ+alcLZ53IYJxx81hDVc=", - "dev": true, - "requires": { - "d": "1", - "es5-ext": "^0.10.45", - "es6-weak-map": "^2.0.2", - "event-emitter": "^0.3.5", - "is-promise": "^2.1", - "lru-queue": "0.1", - "next-tick": "1", - "timers-ext": "^0.1.5" - } - }, - "minimatch": { - "version": "3.0.4", - "resolved": "https://artifacthub-tip.oraclecorp.com/api/npm/osvc-npm/minimatch/-/minimatch-3.0.4.tgz", - "integrity": "sha1-UWbihkV/AzBgZL5Ul+jbsMPTIIM=", - "dev": true, - "requires": { - "brace-expansion": "^1.1.7" - } - }, - "minimist": { - "version": "1.2.5", - "resolved": "https://artifacthub-tip.oraclecorp.com/api/npm/osvc-npm/minimist/-/minimist-1.2.5.tgz", - "integrity": "sha1-Z9ZgFLZqaoqqDAg8X9WN9OTpdgI=", - "dev": true - }, - "mkdirp": { - "version": "1.0.4", - "resolved": "https://artifacthub-tip.oraclecorp.com/api/npm/osvc-npm/mkdirp/-/mkdirp-1.0.4.tgz", - "integrity": "sha1-PrXtYmInVteaXw4qIh3+utdcL34=", - "dev": true - }, - "mz": { - "version": "2.7.0", - "resolved": "https://artifacthub-tip.oraclecorp.com/api/npm/osvc-npm/mz/-/mz-2.7.0.tgz", - "integrity": "sha1-lQCAV6Vsr63CvGPd5/n/aVWUjjI=", - "dev": true, - "requires": { - "any-promise": "^1.0.0", - "object-assign": "^4.0.1", - "thenify-all": "^1.0.0" - } - }, - "next-tick": { - "version": "1.0.0", - "resolved": "https://artifacthub-tip.oraclecorp.com/api/npm/osvc-npm/next-tick/-/next-tick-1.0.0.tgz", - "integrity": "sha1-yobR/ogoFpsBICCOPchCS524NCw=", - "dev": true - }, - "object-assign": { - "version": "4.1.1", - "resolved": "https://artifacthub-tip.oraclecorp.com/api/npm/osvc-npm/object-assign/-/object-assign-4.1.1.tgz", - "integrity": "sha1-IQmtx5ZYh8/AXLvUQsrIv7s2CGM=", - "dev": true - }, - "once": { - "version": "1.4.0", - "resolved": "https://artifacthub-tip.oraclecorp.com/api/npm/osvc-npm/once/-/once-1.4.0.tgz", - "integrity": "sha1-WDsap3WWHUsROsF9nFC6753Xa9E=", - "dev": true, - "requires": { - "wrappy": "1" - } - }, - "path-is-absolute": { - "version": "1.0.1", - "resolved": "https://artifacthub-tip.oraclecorp.com/api/npm/osvc-npm/path-is-absolute/-/path-is-absolute-1.0.1.tgz", - "integrity": "sha1-F0uSaHNVNP+8es5r9TpanhtcX18=", - "dev": true - }, - "prettier": { - "version": "2.0.5", - "resolved": "https://artifacthub-tip.oraclecorp.com/api/npm/osvc-npm/prettier/-/prettier-2.0.5.tgz", - "integrity": "sha1-1tVigkVSQ/L5LMFxZpLAiqMVItQ=", - "dev": true - }, - "sprintf-js": { - "version": "1.0.3", - "resolved": "https://artifacthub-tip.oraclecorp.com/api/npm/osvc-npm/sprintf-js/-/sprintf-js-1.0.3.tgz", - "integrity": "sha1-BOaSb2YolTVPPdAVIDYzuFcpfiw=", - "dev": true - }, - "stdin": { - "version": "0.0.1", - "resolved": "https://artifacthub-tip.oraclecorp.com/api/npm/osvc-npm/stdin/-/stdin-0.0.1.tgz", - "integrity": "sha1-0wQZgarsPf28d6GzjWNy449ftx4=", - "dev": true - }, - "thenify": { - "version": "3.3.1", - "resolved": "https://artifacthub-tip.oraclecorp.com/api/npm/osvc-npm/thenify/-/thenify-3.3.1.tgz", - "integrity": "sha1-iTLmhqQGYDigFt2eLKRq3Zg4qV8=", - "dev": true, - "requires": { - "any-promise": "^1.0.0" - } - }, - "thenify-all": { - "version": "1.6.0", - "resolved": "https://artifacthub-tip.oraclecorp.com/api/npm/osvc-npm/thenify-all/-/thenify-all-1.6.0.tgz", - "integrity": "sha1-GhkY1ALY/D+Y+/I02wvMjMEOlyY=", - "dev": true, - "requires": { - "thenify": ">= 3.1.0 < 4" - } - }, - "timers-ext": { - "version": "0.1.7", - "resolved": "https://artifacthub-tip.oraclecorp.com/api/npm/osvc-npm/timers-ext/-/timers-ext-0.1.7.tgz", - "integrity": "sha1-b1ethXjgej+5+R2Th9ZWR1VeJcY=", - "dev": true, - "requires": { - "es5-ext": "~0.10.46", - "next-tick": "1" - } - }, - "type": { - "version": "1.2.0", - "resolved": "https://artifacthub-tip.oraclecorp.com/api/npm/osvc-npm/type/-/type-1.2.0.tgz", - "integrity": "sha1-hI3XaY2vo+VKbEeedZxLw/GIR6A=", - "dev": true - }, - "wrappy": { - "version": "1.0.2", - "resolved": "https://artifacthub-tip.oraclecorp.com/api/npm/osvc-npm/wrappy/-/wrappy-1.0.2.tgz", - "integrity": "sha1-tSQ9jz7BqjXxNkYFvA0QNuMKtp8=", - "dev": true - } - } -} diff --git a/yarn.lock b/yarn.lock index ca6bddd..793f066 100644 --- a/yarn.lock +++ b/yarn.lock @@ -2,6 +2,20 @@ # yarn lockfile v1 +"@apidevtools/json-schema-ref-parser@9.0.5": + version "9.0.5" + resolved "https://registry.yarnpkg.com/@apidevtools/json-schema-ref-parser/-/json-schema-ref-parser-9.0.5.tgz#972f7b9f579dff1ce2229d891592932a70a8d1ee" + integrity sha512-+tOjAEtnsa0/0lAEpR9zDBkVhhszU+J23egkniV4zCYWVW7yd2Rjxr+NSYz6Zo2VbNdJiuoN22rg6qGz5OKGDQ== + dependencies: + "@jsdevtools/ono" "^7.1.3" + call-me-maybe "^1.0.1" + js-yaml "^3.13.1" + +"@jsdevtools/ono@^7.1.3": + version "7.1.3" + resolved "https://registry.yarnpkg.com/@jsdevtools/ono/-/ono-7.1.3.tgz#9df03bbd7c696a5c58885c34aa06da41c8543796" + integrity sha512-4JQNk+3mVzK3xh2rqd6RB4J46qUR19azEHBneZyTZM+c456qOrbbM/5xcR8huNCCcbVt7+UmizG6GuUvPvKUYg== + "@types/caseless@*": version "0.12.1" resolved "https://registry.yarnpkg.com/@types/caseless/-/caseless-0.12.1.tgz#9794c69c8385d0192acc471a540d1f8e0d16218a" @@ -14,6 +28,11 @@ dependencies: "@types/node" "*" +"@types/json-schema@^7.0.4": + version "7.0.5" + resolved "https://registry.yarnpkg.com/@types/json-schema/-/json-schema-7.0.5.tgz#dcce4430e64b443ba8945f0290fb564ad5bac6dd" + integrity sha512-7+2BITlgjgDhH0vvwZU/HZJVyk+2XUlvxXe8dFMedNX/aMkaOq++rMAFXc0tM7ij15QaWlbdQASBR9dihi+bDQ== + "@types/node@*": version "11.9.5" resolved "https://registry.yarnpkg.com/@types/node/-/node-11.9.5.tgz#011eece9d3f839a806b63973e228f85967b79ed3" @@ -97,7 +116,7 @@ ansi-escapes@^1.1.0: resolved "https://registry.yarnpkg.com/ansi-escapes/-/ansi-escapes-1.4.0.tgz#d3a8a83b319aa67793662b13e761c7911422306e" integrity sha1-06ioOzGapneTZisT52HHkRQiMG4= -ansi-regex@^2.0.0: +ansi-regex@^2.0.0, ansi-regex@^2.1.1: version "2.1.1" resolved "https://registry.npmjs.org/ansi-regex/-/ansi-regex-2.1.1.tgz#c3b33ab5ee360d86e0e628f0468ae7ef27d654df" @@ -117,6 +136,11 @@ ansi-styles@^3.2.1: dependencies: color-convert "^1.9.0" +any-promise@^1.0.0: + version "1.3.0" + resolved "https://registry.yarnpkg.com/any-promise/-/any-promise-1.3.0.tgz#abc6afeedcea52e809cdc0376aed3ce39635d17f" + integrity sha1-q8av7tzqUugJzcA3au0845Y10X8= + argparse@^1.0.7: version "1.0.9" resolved "https://registry.npmjs.org/argparse/-/argparse-1.0.9.tgz#73d83bc263f86e97f8cc4f6bae1b0e90a7d22c86" @@ -264,6 +288,11 @@ cache-base@^1.0.1: union-value "^1.0.0" unset-value "^1.0.0" +call-me-maybe@^1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/call-me-maybe/-/call-me-maybe-1.0.1.tgz#26d208ea89e37b5cbde60250a15f031c16a4d66b" + integrity sha1-JtII6onje1y95gJQoV8DHBak1ms= + caller-path@^0.1.0: version "0.1.0" resolved "https://registry.yarnpkg.com/caller-path/-/caller-path-0.1.0.tgz#94085ef63581ecd3daa92444a8fe94e82577751f" @@ -333,6 +362,18 @@ class-utils@^0.3.5: isobject "^3.0.0" static-extend "^0.1.1" +cli-color@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/cli-color/-/cli-color-2.0.0.tgz#11ecfb58a79278cf6035a60c54e338f9d837897c" + integrity sha512-a0VZ8LeraW0jTuCkuAGMNufareGHhyZU9z8OGsW0gXd1hZGi1SRuNRXdbGkraBBKnhyUhyebFWnRbp+dIn0f0A== + dependencies: + ansi-regex "^2.1.1" + d "^1.0.1" + es5-ext "^0.10.51" + es6-iterator "^2.0.3" + memoizee "^0.4.14" + timers-ext "^0.1.7" + cli-cursor@^1.0.1: version "1.0.2" resolved "https://registry.yarnpkg.com/cli-cursor/-/cli-cursor-1.0.2.tgz#64da3f7d56a54412e59794bd62dc35295e8f2987" @@ -447,6 +488,14 @@ d@1: dependencies: es5-ext "^0.10.9" +d@^1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/d/-/d-1.0.1.tgz#8698095372d58dbee346ffd0c7093f99f8f9eb5a" + integrity sha512-m62ShEObQ39CfralilEQRjH6oAMtNCV1xJyEx5LpRYUVN+EviphDgUc/F3hnYbADmkiNs67Y+3ylmlG7Lnu+FA== + dependencies: + es5-ext "^0.10.50" + type "^1.0.1" + dashdash@^1.12.0: version "1.14.1" resolved "https://registry.yarnpkg.com/dashdash/-/dashdash-1.14.1.tgz#853cfa0f7cbe2fed5de20326b8dd581035f6e2f0" @@ -619,6 +668,15 @@ es5-ext@^0.10.35: es6-symbol "~3.1.1" next-tick "1" +es5-ext@^0.10.45, es5-ext@^0.10.46, es5-ext@^0.10.50, es5-ext@^0.10.51, es5-ext@~0.10.2, es5-ext@~0.10.46: + version "0.10.53" + resolved "https://registry.yarnpkg.com/es5-ext/-/es5-ext-0.10.53.tgz#93c5a3acfdbef275220ad72644ad02ee18368de1" + integrity sha512-Xs2Stw6NiNHWypzRTY1MtaG/uJlwCk8kH81920ma8mvN8Xq1gsfhZvpkImLQArw8AHnv8MT2I45J3c0R8slE+Q== + dependencies: + es6-iterator "~2.0.3" + es6-symbol "~3.1.3" + next-tick "~1.0.0" + es6-iterator@2, es6-iterator@~2.0.1: version "2.0.1" resolved "https://registry.npmjs.org/es6-iterator/-/es6-iterator-2.0.1.tgz#8e319c9f0453bf575d374940a655920e59ca5512" @@ -627,7 +685,7 @@ es6-iterator@2, es6-iterator@~2.0.1: es5-ext "^0.10.14" es6-symbol "^3.1" -es6-iterator@^2.0.1, es6-iterator@~2.0.3: +es6-iterator@^2.0.1, es6-iterator@^2.0.3, es6-iterator@~2.0.3: version "2.0.3" resolved "https://registry.yarnpkg.com/es6-iterator/-/es6-iterator-2.0.3.tgz#a7de889141a05a94b0854403b2d0a0fbfa98f3b7" integrity sha1-p96IkUGgWpSwhUQDstCg+/qY87c= @@ -664,6 +722,14 @@ es6-symbol@3.1.1, es6-symbol@^3.1, es6-symbol@^3.1.1, es6-symbol@~3.1, es6-symbo d "1" es5-ext "~0.10.14" +es6-symbol@~3.1.3: + version "3.1.3" + resolved "https://registry.yarnpkg.com/es6-symbol/-/es6-symbol-3.1.3.tgz#bad5d3c1bcdac28269f4cb331e431c78ac705d18" + integrity sha512-NJ6Yn3FuDinBaBRWl/q5X/s4koRHBrgKAu+yGI6JCBeiu3qrcbJhwT2GeR/EXVfylRk8dpQVJoLEFhK+Mu31NA== + dependencies: + d "^1.0.1" + ext "^1.1.2" + es6-weak-map@^2.0.1: version "2.0.2" resolved "https://registry.yarnpkg.com/es6-weak-map/-/es6-weak-map-2.0.2.tgz#5e3ab32251ffd1538a1f8e5ffa1357772f92d96f" @@ -674,6 +740,16 @@ es6-weak-map@^2.0.1: es6-iterator "^2.0.1" es6-symbol "^3.1.1" +es6-weak-map@^2.0.2: + version "2.0.3" + resolved "https://registry.yarnpkg.com/es6-weak-map/-/es6-weak-map-2.0.3.tgz#b6da1f16cc2cc0d9be43e6bdbfc5e7dfcdf31d53" + integrity sha512-p5um32HOTO1kP+w7PRnB+5lQ43Z6muuMuIMffvDN8ZB4GcnjLBV6zGStpbASIMk4DCAvEaamhe2zhyCb/QXXsA== + dependencies: + d "1" + es5-ext "^0.10.46" + es6-iterator "^2.0.3" + es6-symbol "^3.1.1" + escape-string-regexp@1.0.5, escape-string-regexp@^1.0.2, escape-string-regexp@^1.0.5: version "1.0.5" resolved "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz#1b61c0562190a8dff6ae3bb2cf0200ca130b86d4" @@ -826,7 +902,7 @@ esutils@^2.0.2: version "2.0.2" resolved "https://registry.npmjs.org/esutils/-/esutils-2.0.2.tgz#0abf4f1caa5bcb1f7a9d8acc6dea4faaa04bac9b" -event-emitter@~0.3.5: +event-emitter@^0.3.5, event-emitter@~0.3.5: version "0.3.5" resolved "https://registry.npmjs.org/event-emitter/-/event-emitter-0.3.5.tgz#df8c69eef1647923c7157b9ce83840610b02cc39" dependencies: @@ -871,6 +947,13 @@ expand-tilde@^2.0.0, expand-tilde@^2.0.2: dependencies: homedir-polyfill "^1.0.1" +ext@^1.1.2: + version "1.4.0" + resolved "https://registry.yarnpkg.com/ext/-/ext-1.4.0.tgz#89ae7a07158f79d35517882904324077e4379244" + integrity sha512-Key5NIsUxdqKg3vIsdw9dSuXpPCQ297y6wBjL30edxwPgt2E44WcWBZey/ZvUc6sERLTxKdyCu4gZFmUbk1Q7A== + dependencies: + type "^2.0.0" + extend-shallow@^2.0.1: version "2.0.1" resolved "https://registry.yarnpkg.com/extend-shallow/-/extend-shallow-2.0.1.tgz#51af7d614ad9a9f610ea1bafbb989d6b1c56890f" @@ -1098,6 +1181,18 @@ glob@^5.0.15: once "^1.3.0" path-is-absolute "^1.0.0" +glob@^7.1.6: + version "7.1.6" + resolved "https://registry.yarnpkg.com/glob/-/glob-7.1.6.tgz#141f33b81a7c2492e125594307480c46679278a6" + integrity sha512-LwaxwyZ72Lk7vZINtNNrywX0ZuLyStrdDtabefZKAY5ZGJhVtgdznluResxNmPitE0SAO+O26sWTHeKSI2wMBA== + dependencies: + fs.realpath "^1.0.0" + inflight "^1.0.4" + inherits "2" + minimatch "^3.0.4" + once "^1.3.0" + path-is-absolute "^1.0.0" + global-modules@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/global-modules/-/global-modules-1.0.0.tgz#6d770f0eb523ac78164d72b5e71a8877265cc3ea" @@ -1390,7 +1485,7 @@ is-extendable@^1.0.1: dependencies: is-plain-object "^2.0.4" -is-extglob@^2.1.0: +is-extglob@^2.1.0, is-extglob@^2.1.1: version "2.1.1" resolved "https://registry.yarnpkg.com/is-extglob/-/is-extglob-2.1.1.tgz#a88c02535791f02ed37c76a1b9ea9773c833f8c2" integrity sha1-qIwCU1eR8C7TfHahueqXc8gz+MI= @@ -1412,6 +1507,13 @@ is-glob@^3.1.0: dependencies: is-extglob "^2.1.0" +is-glob@^4.0.1: + version "4.0.1" + resolved "https://registry.yarnpkg.com/is-glob/-/is-glob-4.0.1.tgz#7567dbe9f2f5e2467bc77ab83c4a29482407a5dc" + integrity sha512-5G0tKtBTFImOqDnLB2hG6Bp2qcKEFduo4tZu9MT/H6NQv/ghhy30o55ufafxJ/LdH79LLs2Kfrn85TLKyA7BUg== + dependencies: + is-extglob "^2.1.1" + is-my-ip-valid@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/is-my-ip-valid/-/is-my-ip-valid-1.0.0.tgz#7b351b8e8edd4d3995d4d066680e664d94696824" @@ -1442,6 +1544,11 @@ is-plain-object@^2.0.1, is-plain-object@^2.0.3, is-plain-object@^2.0.4: dependencies: isobject "^3.0.1" +is-promise@^2.1: + version "2.2.2" + resolved "https://registry.yarnpkg.com/is-promise/-/is-promise-2.2.2.tgz#39ab959ccbf9a774cf079f7b40c7a26f763135f1" + integrity sha512-+lP4/6lKUBfQjZ2pdxThZvLUAafmZb8OAxFb8XXtiQmS35INgr85hdOGoEs124ez1FCnZJt6jau/T+alh58QFQ== + is-property@^1.0.0, is-property@^1.0.2: version "1.0.2" resolved "https://registry.yarnpkg.com/is-property/-/is-property-1.0.2.tgz#57fe1c4e48474edd65b09911f26b1cd4095dda84" @@ -1538,6 +1645,14 @@ js-yaml@3.x: argparse "^1.0.7" esprima "^4.0.0" +js-yaml@^3.13.1: + version "3.14.0" + resolved "https://registry.yarnpkg.com/js-yaml/-/js-yaml-3.14.0.tgz#a7a34170f26a21bb162424d8adacb4113a69e482" + integrity sha512-/4IbIeHcD9VMHFqDR/gQ7EdZdLimOvW2DdcxFjdyyZ9NsbS+ccrXqVWDtab/lRl5AlUqmpBx8EhPaWR+OtY17A== + dependencies: + argparse "^1.0.7" + esprima "^4.0.0" + js-yaml@^3.5.1: version "3.12.2" resolved "https://registry.yarnpkg.com/js-yaml/-/js-yaml-3.12.2.tgz#ef1d067c5a9d9cb65bd72f285b5d8105c77f14fc" @@ -1551,6 +1666,31 @@ jsbn@~0.1.0: resolved "https://registry.yarnpkg.com/jsbn/-/jsbn-0.1.1.tgz#a5e654c2e5a2deb5f201d96cefbca80c0ef2f513" integrity sha1-peZUwuWi3rXyAdls77yoDA7y9RM= +json-schema-ref-parser@^9.0.1: + version "9.0.5" + resolved "https://registry.yarnpkg.com/json-schema-ref-parser/-/json-schema-ref-parser-9.0.5.tgz#199e340792b70559644d5fca51f0cd146abe06ab" + integrity sha512-bPp/VXAGaa4fk5C9qNZfsv2y4WPr2LV1jrQepvgRC3+RYQohsFYF+W7gI3ipXSS2yEtE/itmB9O813xRv7qdHw== + dependencies: + "@apidevtools/json-schema-ref-parser" "9.0.5" + +json-schema-to-typescript@^9.1.1: + version "9.1.1" + resolved "https://registry.yarnpkg.com/json-schema-to-typescript/-/json-schema-to-typescript-9.1.1.tgz#572c1eb8b7ca82d6534c023c4651f3fe925171c0" + integrity sha512-VrdxmwQROjPBRlHxXwGUa2xzhOMPiNZIVsxZrZjMYtbI7suRFMiEktqaD/gqhfSya7Djy+x8dnJT+H0/0sZO0Q== + dependencies: + "@types/json-schema" "^7.0.4" + cli-color "^2.0.0" + glob "^7.1.6" + is-glob "^4.0.1" + json-schema-ref-parser "^9.0.1" + json-stringify-safe "^5.0.1" + lodash "^4.17.15" + minimist "^1.2.5" + mkdirp "^1.0.4" + mz "^2.7.0" + prettier "^2.0.5" + stdin "0.0.1" + json-schema-traverse@^0.4.1: version "0.4.1" resolved "https://registry.yarnpkg.com/json-schema-traverse/-/json-schema-traverse-0.4.1.tgz#69f6a87d9513ab8bb8fe63bdb0979c448e684660" @@ -1566,7 +1706,7 @@ json-stable-stringify@^1.0.0, json-stable-stringify@^1.0.1: dependencies: jsonify "~0.0.0" -json-stringify-safe@~5.0.1: +json-stringify-safe@^5.0.1, json-stringify-safe@~5.0.1: version "5.0.1" resolved "https://registry.npmjs.org/json-stringify-safe/-/json-stringify-safe-5.0.1.tgz#1296a2d58fd45f19a0f6ce01d65701e2c735b6eb" @@ -1665,6 +1805,11 @@ lodash@^4.0.0, lodash@^4.17.11, lodash@^4.3.0: resolved "https://registry.yarnpkg.com/lodash/-/lodash-4.17.14.tgz#9ce487ae66c96254fe20b599f21b6816028078ba" integrity sha512-mmKYbW3GLuJeX+iGP+Y7Gp1AiGHGbXHCOh/jZmrawMmsE7MS4znI3RL2FsjbqOyMayHInjOeykW7PEajUk1/xw== +lodash@^4.17.15: + version "4.17.19" + resolved "https://registry.yarnpkg.com/lodash/-/lodash-4.17.19.tgz#e48ddedbe30b3321783c5b4301fbd353bc1e4a4b" + integrity sha512-JNvd8XER9GQX0v2qJgsaN/mzFCNA5BRe/j8JN9d+tWyGLSodKQHKFicdwNYzWwI3wjRnaKPsGj1XkBjx/F96DQ== + log-symbols@2.2.0: version "2.2.0" resolved "https://registry.yarnpkg.com/log-symbols/-/log-symbols-2.2.0.tgz#5740e1c5d6f0dfda4ad9323b5332107ef6b4c40a" @@ -1676,6 +1821,13 @@ lolex@1.3.2: version "1.3.2" resolved "https://registry.npmjs.org/lolex/-/lolex-1.3.2.tgz#7c3da62ffcb30f0f5a80a2566ca24e45d8a01f31" +lru-queue@0.1: + version "0.1.0" + resolved "https://registry.yarnpkg.com/lru-queue/-/lru-queue-0.1.0.tgz#2738bd9f0d3cf4f84490c5736c48699ac632cda3" + integrity sha1-Jzi9nw089PhEkMVzbEhpmsYyzaM= + dependencies: + es5-ext "~0.10.2" + map-age-cleaner@^0.1.1: version "0.1.3" resolved "https://registry.yarnpkg.com/map-age-cleaner/-/map-age-cleaner-0.1.3.tgz#7d583a7306434c055fe474b0f45078e6e1b4b92a" @@ -1709,6 +1861,20 @@ mem@^4.0.0: mimic-fn "^1.0.0" p-is-promise "^2.0.0" +memoizee@^0.4.14: + version "0.4.14" + resolved "https://registry.yarnpkg.com/memoizee/-/memoizee-0.4.14.tgz#07a00f204699f9a95c2d9e77218271c7cd610d57" + integrity sha512-/SWFvWegAIYAO4NQMpcX+gcra0yEZu4OntmUdrBaWrJncxOqAziGFlHxc7yjKVK2uu3lpPW27P27wkR82wA8mg== + dependencies: + d "1" + es5-ext "^0.10.45" + es6-weak-map "^2.0.2" + event-emitter "^0.3.5" + is-promise "^2.1" + lru-queue "0.1" + next-tick "1" + timers-ext "^0.1.5" + micromatch@^3.0.4: version "3.1.10" resolved "https://registry.yarnpkg.com/micromatch/-/micromatch-3.1.10.tgz#70859bc95c9840952f359a068a3fc49f9ecfac23" @@ -1765,6 +1931,11 @@ minimist@0.0.8: version "0.0.8" resolved "https://registry.npmjs.org/minimist/-/minimist-0.0.8.tgz#857fcabfc3397d2625b8228262e86aa7a011b05d" +minimist@^1.2.5: + version "1.2.5" + resolved "https://registry.yarnpkg.com/minimist/-/minimist-1.2.5.tgz#67d66014b66a6a8aaa0c083c5fd58df4e4e97602" + integrity sha512-FM9nNUYrRBAELZQT3xeZQ7fmMOBg6nWNmJKTcgsJeaLstP/UODVpGsr5OhXhhXg6f+qtJ8uiZ+PUxkDWcgIXLw== + minimist@~0.0.1: version "0.0.10" resolved "https://registry.yarnpkg.com/minimist/-/minimist-0.0.10.tgz#de3f98543dbf96082be48ad1a0c7cda836301dcf" @@ -1784,6 +1955,11 @@ mkdirp@0.5.1, mkdirp@0.5.x, mkdirp@^0.5.0, mkdirp@^0.5.1: dependencies: minimist "0.0.8" +mkdirp@^1.0.4: + version "1.0.4" + resolved "https://registry.yarnpkg.com/mkdirp/-/mkdirp-1.0.4.tgz#3eb5ed62622756d79a5f0e2a221dfebad75c2f7e" + integrity sha512-vVqVZQyf3WLx2Shd0qJ9xuvqgAyKPLAiqITEtqW0oIUjzo3PePDd6fW9iFz30ef7Ysp/oiWqbhszeGWW2T6Gzw== + mocha@6.0.2: version "6.0.2" resolved "https://registry.yarnpkg.com/mocha/-/mocha-6.0.2.tgz#cdc1a6fdf66472c079b5605bac59d29807702d2c" @@ -1831,6 +2007,15 @@ mute-stream@0.0.5: resolved "https://registry.yarnpkg.com/mute-stream/-/mute-stream-0.0.5.tgz#8fbfabb0a98a253d3184331f9e8deb7372fac6c0" integrity sha1-j7+rsKmKJT0xhDMfno3rc3L6xsA= +mz@^2.7.0: + version "2.7.0" + resolved "https://registry.yarnpkg.com/mz/-/mz-2.7.0.tgz#95008057a56cafadc2bc63dde7f9ff6955948e32" + integrity sha512-z81GNO7nnYMEhrGh9LeymoE4+Yr0Wn5McHIZMK5cfQCl+NDX08sCZgUc9/6MHni9IWuFLm1Z3HTCXu2z9fN62Q== + dependencies: + any-promise "^1.0.0" + object-assign "^4.0.1" + thenify-all "^1.0.0" + nanomatch@^1.2.9: version "1.2.13" resolved "https://registry.yarnpkg.com/nanomatch/-/nanomatch-1.2.13.tgz#b87a8aa4fc0de8fe6be88895b38983ff265bd119" @@ -1853,7 +2038,7 @@ neo-async@^2.6.0: resolved "https://registry.yarnpkg.com/neo-async/-/neo-async-2.6.1.tgz#ac27ada66167fa8849a6addd837f6b189ad2081c" integrity sha512-iyam8fBuCUpWeKPGpaNMetEocMt364qkCsfL9JuhjXX6dRnguRVOfk2GZaDpPjcOKiiXCPINZC1GczQ7iTq3Zw== -next-tick@1: +next-tick@1, next-tick@~1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/next-tick/-/next-tick-1.0.0.tgz#ca86d1fe8828169b0120208e3dc8424b9db8342c" integrity sha1-yobR/ogoFpsBICCOPchCS524NCw= @@ -2103,6 +2288,11 @@ prelude-ls@~1.1.2: version "1.1.2" resolved "https://registry.npmjs.org/prelude-ls/-/prelude-ls-1.1.2.tgz#21932a549f5e52ffd9a827f570e04be62a97da54" +prettier@^2.0.5: + version "2.0.5" + resolved "https://registry.yarnpkg.com/prettier/-/prettier-2.0.5.tgz#d6d56282455243f2f92cc1716692c08aa31522d4" + integrity sha512-7PtVymN48hGcO4fGjybyBSIWDsLU4H4XlvOHfq91pz9kkGlonzwTfYkaIEwiRg/dAJF9YlbsduBAgtYLi+8cFg== + process-nextick-args@~2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/process-nextick-args/-/process-nextick-args-2.0.0.tgz#a37d732f4271b4ab1ad070d35508e8290788ffaa" @@ -2493,6 +2683,11 @@ static-extend@^0.1.1: define-property "^0.2.5" object-copy "^0.1.0" +stdin@0.0.1: + version "0.0.1" + resolved "https://registry.yarnpkg.com/stdin/-/stdin-0.0.1.tgz#d3041981aaec3dfdbc77a1b38d6372e38f5fb71e" + integrity sha1-0wQZgarsPf28d6GzjWNy449ftx4= + stealthy-require@^1.1.1: version "1.1.1" resolved "https://registry.yarnpkg.com/stealthy-require/-/stealthy-require-1.1.1.tgz#35b09875b4ff49f26a777e509b3090a3226bf24b" @@ -2593,10 +2788,32 @@ text-table@~0.2.0: resolved "https://registry.yarnpkg.com/text-table/-/text-table-0.2.0.tgz#7f5ee823ae805207c00af2df4a84ec3fcfa570b4" integrity sha1-f17oI66AUgfACvLfSoTsP8+lcLQ= +thenify-all@^1.0.0: + version "1.6.0" + resolved "https://registry.yarnpkg.com/thenify-all/-/thenify-all-1.6.0.tgz#1a1918d402d8fc3f98fbf234db0bcc8cc10e9726" + integrity sha1-GhkY1ALY/D+Y+/I02wvMjMEOlyY= + dependencies: + thenify ">= 3.1.0 < 4" + +"thenify@>= 3.1.0 < 4": + version "3.3.1" + resolved "https://registry.yarnpkg.com/thenify/-/thenify-3.3.1.tgz#8932e686a4066038a016dd9e2ca46add9838a95f" + integrity sha512-RVZSIV5IG10Hk3enotrhvz0T9em6cyHBLkH/YAZuKqd8hRkKhSfCGIcP2KUY0EPxndzANBmNllzWPwak+bheSw== + dependencies: + any-promise "^1.0.0" + through@^2.3.6: version "2.3.8" resolved "https://registry.npmjs.org/through/-/through-2.3.8.tgz#0dd4c9ffaabc357960b1b724115d7e0e86a2e1f5" +timers-ext@^0.1.5, timers-ext@^0.1.7: + version "0.1.7" + resolved "https://registry.yarnpkg.com/timers-ext/-/timers-ext-0.1.7.tgz#6f57ad8578e07a3fb9f91d9387d65647555e25c6" + integrity sha512-b85NUNzTSdodShTIbky6ZF02e8STtVVfD+fu4aXXShEELpozH+bCpJLYMPZbsABN2wDH7fJpqIoXxJpzbf0NqQ== + dependencies: + es5-ext "~0.10.46" + next-tick "1" + to-object-path@^0.3.0: version "0.3.0" resolved "https://registry.yarnpkg.com/to-object-path/-/to-object-path-0.3.0.tgz#297588b7b0e7e0ac08e04e672f85c1f4999e17af" @@ -2669,6 +2886,16 @@ type-detect@^1.0.0: resolved "https://registry.yarnpkg.com/type-detect/-/type-detect-1.0.0.tgz#762217cc06db258ec48908a1298e8b95121e8ea2" integrity sha1-diIXzAbbJY7EiQihKY6LlRIejqI= +type@^1.0.1: + version "1.2.0" + resolved "https://registry.yarnpkg.com/type/-/type-1.2.0.tgz#848dd7698dafa3e54a6c479e759c4bc3f18847a0" + integrity sha512-+5nt5AAniqsCnu2cEQQdpzCAh33kVx8n0VoFidKpB1dVVLAN/F+bgVOqOJqOnEnrhp222clB5p3vUlD+1QAnfg== + +type@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/type/-/type-2.0.0.tgz#5f16ff6ef2eb44f260494dae271033b29c09a9c3" + integrity sha512-KBt58xCHry4Cejnc2ISQAF7QY+ORngsWfxezO68+12hKV6lQY8P/psIkcbjeHWn7MqcgciWJyCCevFMJdIXpow== + typedarray@^0.0.6: version "0.0.6" resolved "https://registry.yarnpkg.com/typedarray/-/typedarray-0.0.6.tgz#867ac74e3864187b1d3d47d996a78ec5c8830777" From b21b748a28b4e281011219922825b7f15d3bc8d5 Mon Sep 17 00:00:00 2001 From: Sidharth Vinod Date: Thu, 23 Jul 2020 18:05:15 +0530 Subject: [PATCH 5/5] Remove await/async --- scripts/gen-types.js | 63 ++++++++++++++++++++++---------------------- 1 file changed, 32 insertions(+), 31 deletions(-) diff --git a/scripts/gen-types.js b/scripts/gen-types.js index a532f13..f084829 100644 --- a/scripts/gen-types.js +++ b/scripts/gen-types.js @@ -4,39 +4,40 @@ const { format } = require('json-schema-to-typescript/dist/src/formatter'); const commands = require('../src/commands'); const fs = require('fs'); -async function run() { - let types = ''; - // TODO : Generate complete index.d.ts automatically - let commandDefs = ` -interface CopyPasteContentIntoIndex { \n -`; - const commandNames = Object.keys(commands); - commandNames.sort(); - for (const commandName of commandNames) { - const command = commands[commandName]; - let reqOpt = 'Option'; - let resOpt = 'unknown'; - if (command.schema) { - for (const schemaType of Object.keys(command.schema)) { - const typeName = `${commandName}_${schemaType}`; - if (schemaType === 'req' || schemaType === 'query') { - reqOpt = toSafeString(`${commandName}_${schemaType}`); - } else if (schemaType === 'res') { - resOpt = toSafeString(`${commandName}_${schemaType}`); - } - types += await compile(command.schema[schemaType], typeName, { - bannerComment: '', - }); +const compilePromises = []; +// TODO : Generate complete index.d.ts automatically +const commandDefs = ['interface CopyPasteContentIntoIndex {']; +const commandNames = Object.keys(commands); +commandNames.sort(); +for (const commandName of commandNames) { + const command = commands[commandName]; + let reqOpt = 'Option'; + let resOpt = 'unknown'; + if (command.schema) { + for (const schemaType of Object.keys(command.schema)) { + const typeName = `${commandName}_${schemaType}`; + if (schemaType === 'req' || schemaType === 'query') { + reqOpt = toSafeString(`${commandName}_${schemaType}`); + } else if (schemaType === 'res') { + resOpt = toSafeString(`${commandName}_${schemaType}`); } + compilePromises.push( + compile(command.schema[schemaType], typeName, { + bannerComment: '', + }) + ); } - commandDefs += `${commandName}(options?: ${reqOpt}): Promise<${resOpt}>;\n`; } - - commandDefs += `}`; - - types = types.replace(/export /g, ''); - fs.writeFileSync(`types/types.ts`, format(types, DEFAULT_OPTIONS)); - fs.writeFileSync(`types/commands.ts`, format(commandDefs, DEFAULT_OPTIONS)); + commandDefs.push(`${commandName}(options?: ${reqOpt}): Promise<${resOpt}>;`); } -run(); +commandDefs.push('}'); +fs.writeFileSync( + 'types/commands.ts', + format(commandDefs.join('\n'), DEFAULT_OPTIONS) +); + +Promise.all(compilePromises).then((types) => { + const typeString = types.join('').replace(/export /g, ''); + fs.writeFileSync('types/types.ts', format(typeString, DEFAULT_OPTIONS)); +});