appsync-schema-converter
Advanced tools
Comparing version 2.1.2 to 2.1.3
#! /usr/bin/env node | ||
(()=>{"use strict";var e={540:(e,n,t)=>{t.d(n,{convertAppSyncSchemas:()=>u});var i=t(343);const r='"""\nThis directive allows results to be deferred during execution\n"""\ndirective @defer on FIELD\n\n"""\nTells the service this field/object has access authorized by an OIDC token.\n"""\ndirective @aws_oidc on OBJECT | FIELD_DEFINITION\n\n"""\nDirects the schema to enforce authorization on a field\n"""\ndirective @aws_auth(\n """\n List of cognito user pool groups which have access on this field\n """\n cognito_groups: [String!]\n) on OBJECT | FIELD_DEFINITION\n\n"""\nTells the service which subscriptions will be published to when this mutation is\ncalled. This directive is deprecated use @aws_susbscribe directive instead.\n"""\ndirective @aws_publish(\n """\n List of subscriptions which will be published to when this mutation is called.\n """\n subscriptions: [String!]\n) on FIELD_DEFINITION\n\n"""\nTells the service this field/object has access authorized by a Cognito User Pools token.\n"""\ndirective @aws_cognito_user_pools(\n """\n List of cognito user pool groups which have access on this field\n """\n cognito_groups: [String!]\n) on OBJECT | FIELD_DEFINITION\n\n"""\nTells the service which mutation triggers this subscription.\n"""\ndirective @aws_subscribe(\n """\n List of mutations which will trigger this subscription when they are called.\n """\n mutations: [String!]\n) on FIELD_DEFINITION\n\n"""\nTells the service this field/object has access authorized by sigv4 signing.\n"""\ndirective @aws_iam on OBJECT | FIELD_DEFINITION\n\n"""\nTells the service this field/object has access authorized by an API key.\n"""\ndirective @aws_api_key on OBJECT | FIELD_DEFINITION\n\n"""\nTells the service this field/object has access authorized by a Lambda function.\n"""\ndirective @aws_lambda on OBJECT | FIELD_DEFINITION\n';var a=t(848);const s='"""\nAn extended ISO 8601 date string in the format YYYY-MM-DD.\n"""\nscalar AWSDate\n\n"""\nAn extended ISO 8601 time string in the format hh:mm:ss.sss.\n"""\nscalar AWSTime\n\n"""\nAn extended ISO 8601 date and time string in the format YYYY-MM-DDThh:mm:ss.sssZ.\n"""\nscalar AWSDateTime\n\n"""\nAn integer value representing the number of seconds before or after 1970-01-01-T00:00Z.\n"""\nscalar AWSTimestamp\n\n"""\nAn email address in the format local-part@domain-part as defined by RFC 822.\n"""\nscalar AWSEmail\n\n"""\nA JSON string. Any valid JSON construct is automatically parsed and loaded in the resolver mapping templates as maps, lists, or scalar values rather than as the literal input strings. Unquoted strings or otherwise invalid JSON result in a GraphQL validation error.\n"""\nscalar AWSJSON\n\n"""\nA phone number. This value is stored as a string. Phone numbers can contain either spaces or hyphens to separate digit groups. Phone numbers without a country code are assumed to be US/North American numbers adhering to the North American Numbering Plan (NANP).\n"""\nscalar AWSPhone\n\n"""\nA URL as defined by RFC 1738. For example, https://www.amazon.com/dp/B000NZW3KC/ or mailto:example@example.com. URLs must contain a schema (http, mailto) and can\'t contain two forward slashes (//) in the path part.\n"""\nscalar AWSURL\n\n"""\nA valid IPv4 or IPv6 address. IPv4 addresses are expected in quad-dotted notation (123.12.34.56). IPv6 addresses are expected in non-bracketed, colon-separated format (1a2b:3c4b::1234:4567). You can include an optional CIDR suffix (123.45.67.89/16) to indicate subnet mask.\n"""\nscalar AWSIPAddress\n',o=e=>!(0,i.isSpecifiedDirective)(e)&&!/^aws_/.test(e.name)&&"defer"!==e.name,c=e=>(0,a.Du)(e)&&!((0,i.isScalarType)(e)&&/^AWS/.test(e.name)),u=e=>l(e,{commentDescriptions:!0,includeDirectives:!0,includeEnumDescriptions:!1,interfaceSeparator:", ",directiveFilter:o,typeFilter:c}),l=(e,{commentDescriptions:n=!1,includeDirectives:t=!1,includeEnumDescriptions:i=!0,interfaceSeparator:u=" & ",directiveFilter:l=o,typeFilter:p=c}={})=>{const h=d(Array.isArray(e)?e.join("\n"):e);return(0,a.t3)(h,{commentDescriptions:n,includeDirectives:t,includeEnumDescriptions:i,interfaceSeparator:u,directiveFilter:l,typeFilter:p}).replace(s,"").replace(r,"").trim()},d=e=>{const[n,t]=(0,i.parse)([s,r].concat(e).join("\n")).definitions.reduce((([e,n],t)=>((/Extension$/.test(t.kind)?n:e).push(t),[e,n])),[[],[]]);return(0,i.extendSchema)((0,i.buildASTSchema)({kind:i.Kind.DOCUMENT,definitions:n}),{kind:i.Kind.DOCUMENT,definitions:t})}},848:(e,n,t)=>{const{astFromValue:i,DEFAULT_DEPRECATION_REASON:r,GraphQLString:a,isEnumType:s,isInputObjectType:o,isInterfaceType:c,isIntrospectionType:u,isObjectType:l,isScalarType:d,isSpecifiedDirective:p,isSpecifiedScalarType:h,isUnionType:m,print:f,printIntrospectionSchema:v}=t(343),g=t(55),y=t(431),{printBlockString:b}=t(329);function S(e){return!h(e)&&!u(e)}function T(e){if(null!=e.description||!function(e){var n=e.getQueryType();if(n&&"Query"!==n.name)return!1;var t=e.getMutationType();if(t&&"Mutation"!==t.name)return!1;var i=e.getSubscriptionType();return!i||"Subscription"===i.name}(e)){var n=[],t=e.getQueryType();t&&n.push(" query: ".concat(t.name));var i=e.getMutationType();i&&n.push(" mutation: ".concat(i.name));var r=e.getSubscriptionType();return r&&n.push(" subscription: ".concat(r.name)),A({},e)+"schema {\n".concat(n.join("\n"),"\n}")}}function I(e,n){var t=e&&e.interfaceSeparator||" & ",i="function"==typeof n.getInterfaces?n.getInterfaces():[],r=i.reduce(((e,n)=>(e.includes(n)||e.push(n),e)),[]);return i.length?" implements "+r.map((e=>e.name)).join(t):""}function D(e,n){var t=e&&!0===e.includeDirectives,i=Object.values(n.getFields()).map(((n,i)=>{if(t&&n&&n.astNode&&n.astNode.directives&&n.astNode.directives.length){n.astNode.description=null;var r=f(n.astNode);return A(e,n," ",!i)+" "+r.replace(/\n/g,"\n ")}return A(e,n," ",!i)+" "+n.name+O(e,n.args," ")+": "+String(n.type)+w(n.deprecationReason)}));return E(i)}function E(e){return 0!==e.length?" {\n"+e.join("\n")+"\n}":""}function O(e,n){var t=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"";return 0===n.length?"":n.every((function(e){return!e.description}))?"("+n.map(N).join(", ")+")":"(\n"+n.map((function(n,i){return A(e,n," "+t,!i)+" "+t+N(n)})).join("\n")+"\n"+t+")"}function N(e){var n=i(e.defaultValue,e.type),t=e.name+": "+String(e.type);return n&&(t+=" = ".concat(f(n))),t+w(e.deprecationReason)}function w(e){if(null==e)return"";var n=i(e,a);return n&&e!==r?" @deprecated(reason: "+f(n)+")":" @deprecated"}function A(e,n){var t=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"",i=!(arguments.length>3&&void 0!==arguments[3])||arguments[3],r=n.description;if(null==r)return"";if(!0===(null==e?void 0:e.commentDescriptions))return F(r,t,i);var a=r.length>70,s=b(r,"",a),o=t&&!i?"\n"+t:t;return o+s.replace(/\n/g,"\n"+t)+"\n"}function F(e,n,t){return(n&&!t?"\n":"")+e.split("\n").map((function(e){return n+(""!==e?"# "+e:"#")})).join("\n")+"\n"}e.exports.Du=S,e.exports.t3=function(e,{directiveFilter:n=(e=>!p(e)),typeFilter:t=S,...r}){return function(e,n,t,r){var u=e.getDirectives().filter(n),p=Object.values(e.getTypeMap()).filter(t);return[T(e)].concat(u.map((e=>function(e,n){return A(n,e)+"directive @"+e.name+O(n,e.args)+(e.isRepeatable?" repeatable":"")+" on "+e.locations.join(" | ")}(e,r))),p.map((e=>function(e,n){return d(e)?function(e,n){return A(n,e)+"scalar ".concat(e.name)+function(e){if(null==e.specifiedByUrl)return"";var n=e.specifiedByUrl,t=i(n,a);return t||g("Unexpected null value returned from `astFromValue` for specifiedByUrl")," @specifiedBy(url: "+f(t)+")"}(e)}(e,n):l(e)?function(e,n){return A(n,e)+"type ".concat(e.name)+I(n,e)+function(e,n){return n&&!0===n.includeDirectives?" "+e.astNode.directives.map(f).join(" "):""}(e,n)+D(n,e)}(e,n):c(e)?function(e,n){return A(n,e)+"interface ".concat(e.name)+I(n,e)+D(n,e)}(e,n):m(e)?function(e,n){var t=e.getTypes(),i=t.length?" = "+t.join(" | "):"";return A(n,e)+"union "+e.name+i}(e,n):s(e)?function(e,n){var t=!n||n.includeEnumDescriptions,i=e.getValues().map(((e,i)=>(t?A(n,e," ",!i):"")+" "+e.name+w(e.deprecationReason)));return(t?A(n,e):"")+"enum ".concat(e.name)+E(i)}(e,n):o(e)?function(e,n){var t=Object.values(e.getFields()).map(((e,t)=>A(n,e," ",!t)+" "+N(e)));return A(n,e)+"input ".concat(e.name)+E(t)}(e,n):void g("Unexpected type: "+y(e))}(e,r)))).filter(Boolean).join("\n\n")+"\n"}(e,n,t,r)}},343:e=>{e.exports=require("graphql")},431:e=>{e.exports=require("graphql/jsutils/inspect")},55:e=>{e.exports=require("graphql/jsutils/invariant")},329:e=>{e.exports=require("graphql/language/blockString")}},n={};function t(i){var r=n[i];if(void 0!==r)return r.exports;var a=n[i]={exports:{}};return e[i](a,a.exports,t),a.exports}t.d=(e,n)=>{for(var i in n)t.o(n,i)&&!t.o(e,i)&&Object.defineProperty(e,i,{enumerable:!0,get:n[i]})},t.o=(e,n)=>Object.prototype.hasOwnProperty.call(e,n),t.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};var i={};(()=>{t.r(i);const e=require("commander"),n=require("fs");var r=t(540);e.program.version("2.1.2").argument("<schemas ...>","GraphQL schema files to be converted.").action((e=>{return t=void 0,i=void 0,s=function*(){const t=yield Promise.all(e.map((e=>n.promises.readFile(e,"utf-8"))));console.log((0,r.convertAppSyncSchemas)(t))},new((a=void 0)||(a=Promise))((function(e,n){function r(e){try{c(s.next(e))}catch(e){n(e)}}function o(e){try{c(s.throw(e))}catch(e){n(e)}}function c(n){var t;n.done?e(n.value):(t=n.value,t instanceof a?t:new a((function(e){e(t)}))).then(r,o)}c((s=s.apply(t,i||[])).next())}));var t,i,a,s})).showHelpAfterError().parse()})();var r=exports;for(var a in i)r[a]=i[a];i.__esModule&&Object.defineProperty(r,"__esModule",{value:!0})})(); | ||
(()=>{"use strict";var e={540:(e,n,t)=>{t.d(n,{convertAppSyncSchemas:()=>u});var i=t(343);const r='"""\nThis directive allows results to be deferred during execution\n"""\ndirective @defer on FIELD\n\n"""\nTells the service this field/object has access authorized by an OIDC token.\n"""\ndirective @aws_oidc on OBJECT | FIELD_DEFINITION\n\n"""\nDirects the schema to enforce authorization on a field\n"""\ndirective @aws_auth(\n """\n List of cognito user pool groups which have access on this field\n """\n cognito_groups: [String!]\n) on OBJECT | FIELD_DEFINITION\n\n"""\nTells the service which subscriptions will be published to when this mutation is\ncalled. This directive is deprecated use @aws_susbscribe directive instead.\n"""\ndirective @aws_publish(\n """\n List of subscriptions which will be published to when this mutation is called.\n """\n subscriptions: [String!]\n) on FIELD_DEFINITION\n\n"""\nTells the service this field/object has access authorized by a Cognito User Pools token.\n"""\ndirective @aws_cognito_user_pools(\n """\n List of cognito user pool groups which have access on this field\n """\n cognito_groups: [String!]\n) on OBJECT | FIELD_DEFINITION\n\n"""\nTells the service which mutation triggers this subscription.\n"""\ndirective @aws_subscribe(\n """\n List of mutations which will trigger this subscription when they are called.\n """\n mutations: [String!]\n) on FIELD_DEFINITION\n\n"""\nTells the service this field/object has access authorized by sigv4 signing.\n"""\ndirective @aws_iam on OBJECT | FIELD_DEFINITION\n\n"""\nTells the service this field/object has access authorized by an API key.\n"""\ndirective @aws_api_key on OBJECT | FIELD_DEFINITION\n\n"""\nTells the service this field/object has access authorized by a Lambda function.\n"""\ndirective @aws_lambda on OBJECT | FIELD_DEFINITION\n';var a=t(848);const s='"""\nAn extended ISO 8601 date string in the format YYYY-MM-DD.\n"""\nscalar AWSDate\n\n"""\nAn extended ISO 8601 time string in the format hh:mm:ss.sss.\n"""\nscalar AWSTime\n\n"""\nAn extended ISO 8601 date and time string in the format YYYY-MM-DDThh:mm:ss.sssZ.\n"""\nscalar AWSDateTime\n\n"""\nAn integer value representing the number of seconds before or after 1970-01-01-T00:00Z.\n"""\nscalar AWSTimestamp\n\n"""\nAn email address in the format local-part@domain-part as defined by RFC 822.\n"""\nscalar AWSEmail\n\n"""\nA JSON string. Any valid JSON construct is automatically parsed and loaded in the resolver mapping templates as maps, lists, or scalar values rather than as the literal input strings. Unquoted strings or otherwise invalid JSON result in a GraphQL validation error.\n"""\nscalar AWSJSON\n\n"""\nA phone number. This value is stored as a string. Phone numbers can contain either spaces or hyphens to separate digit groups. Phone numbers without a country code are assumed to be US/North American numbers adhering to the North American Numbering Plan (NANP).\n"""\nscalar AWSPhone\n\n"""\nA URL as defined by RFC 1738. For example, https://www.amazon.com/dp/B000NZW3KC/ or mailto:example@example.com. URLs must contain a schema (http, mailto) and can\'t contain two forward slashes (//) in the path part.\n"""\nscalar AWSURL\n\n"""\nA valid IPv4 or IPv6 address. IPv4 addresses are expected in quad-dotted notation (123.12.34.56). IPv6 addresses are expected in non-bracketed, colon-separated format (1a2b:3c4b::1234:4567). You can include an optional CIDR suffix (123.45.67.89/16) to indicate subnet mask.\n"""\nscalar AWSIPAddress\n',o=e=>!(0,i.isSpecifiedDirective)(e)&&!/^aws_/.test(e.name)&&"defer"!==e.name,c=e=>(0,a.Du)(e)&&!((0,i.isScalarType)(e)&&/^AWS/.test(e.name)),u=e=>l(e,{commentDescriptions:!0,includeDirectives:!0,includeEnumDescriptions:!1,interfaceSeparator:", ",directiveFilter:o,typeFilter:c}),l=(e,{commentDescriptions:n=!1,includeDirectives:t=!1,includeEnumDescriptions:i=!0,interfaceSeparator:u=" & ",directiveFilter:l=o,typeFilter:p=c}={})=>{const h=d(Array.isArray(e)?e.join("\n"):e);return(0,a.t3)(h,{commentDescriptions:n,includeDirectives:t,includeEnumDescriptions:i,interfaceSeparator:u,directiveFilter:l,typeFilter:p}).replace(s,"").replace(r,"").trim()},d=e=>{const[n,t]=(0,i.parse)([s,r].concat(e).join("\n")).definitions.reduce((([e,n],t)=>((/Extension$/.test(t.kind)?n:e).push(t),[e,n])),[[],[]]);return(0,i.extendSchema)((0,i.buildASTSchema)({kind:i.Kind.DOCUMENT,definitions:n}),{kind:i.Kind.DOCUMENT,definitions:t})}},848:(e,n,t)=>{const{astFromValue:i,DEFAULT_DEPRECATION_REASON:r,GraphQLString:a,isEnumType:s,isInputObjectType:o,isInterfaceType:c,isIntrospectionType:u,isObjectType:l,isScalarType:d,isSpecifiedDirective:p,isSpecifiedScalarType:h,isUnionType:m,print:f,printIntrospectionSchema:v}=t(343),g=t(55),y=t(431),{printBlockString:b}=t(329);function S(e){return!h(e)&&!u(e)}function T(e){if(null!=e.description||!function(e){var n=e.getQueryType();if(n&&"Query"!==n.name)return!1;var t=e.getMutationType();if(t&&"Mutation"!==t.name)return!1;var i=e.getSubscriptionType();return!i||"Subscription"===i.name}(e)){var n=[],t=e.getQueryType();t&&n.push(" query: ".concat(t.name));var i=e.getMutationType();i&&n.push(" mutation: ".concat(i.name));var r=e.getSubscriptionType();return r&&n.push(" subscription: ".concat(r.name)),A({},e)+"schema {\n".concat(n.join("\n"),"\n}")}}function I(e,n){var t=e&&e.interfaceSeparator||" & ",i="function"==typeof n.getInterfaces?n.getInterfaces():[],r=i.reduce(((e,n)=>(e.includes(n)||e.push(n),e)),[]);return i.length?" implements "+r.map((e=>e.name)).join(t):""}function D(e,n){var t=e&&!0===e.includeDirectives,i=Object.values(n.getFields()).map(((n,i)=>{if(t&&n&&n.astNode&&n.astNode.directives&&n.astNode.directives.length){n.astNode.description=null;var r=f(n.astNode);return A(e,n," ",!i)+" "+r.replace(/\n/g,"\n ")}return A(e,n," ",!i)+" "+n.name+O(e,n.args," ")+": "+String(n.type)+w(n.deprecationReason)}));return E(i)}function E(e){return 0!==e.length?" {\n"+e.join("\n")+"\n}":""}function O(e,n){var t=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"";return 0===n.length?"":n.every((function(e){return!e.description}))?"("+n.map(N).join(", ")+")":"(\n"+n.map((function(n,i){return A(e,n," "+t,!i)+" "+t+N(n)})).join("\n")+"\n"+t+")"}function N(e){var n=i(e.defaultValue,e.type),t=e.name+": "+String(e.type);return n&&(t+=" = ".concat(f(n))),t+w(e.deprecationReason)}function w(e){if(null==e)return"";var n=i(e,a);return n&&e!==r?" @deprecated(reason: "+f(n)+")":" @deprecated"}function A(e,n){var t=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"",i=!(arguments.length>3&&void 0!==arguments[3])||arguments[3],r=n.description;if(null==r)return"";if(!0===(null==e?void 0:e.commentDescriptions))return F(r,t,i);var a=r.length>70,s=b(r,"",a),o=t&&!i?"\n"+t:t;return o+s.replace(/\n/g,"\n"+t)+"\n"}function F(e,n,t){return(n&&!t?"\n":"")+e.split("\n").map((function(e){return n+(""!==e?"# "+e:"#")})).join("\n")+"\n"}e.exports.Du=S,e.exports.t3=function(e,{directiveFilter:n=(e=>!p(e)),typeFilter:t=S,...r}){return function(e,n,t,r){var u=e.getDirectives().filter(n),p=Object.values(e.getTypeMap()).filter(t);return[T(e)].concat(u.map((e=>function(e,n){return A(n,e)+"directive @"+e.name+O(n,e.args)+(e.isRepeatable?" repeatable":"")+" on "+e.locations.join(" | ")}(e,r))),p.map((e=>function(e,n){return d(e)?function(e,n){return A(n,e)+"scalar ".concat(e.name)+function(e){if(null==e.specifiedByUrl)return"";var n=e.specifiedByUrl,t=i(n,a);return t||g("Unexpected null value returned from `astFromValue` for specifiedByUrl")," @specifiedBy(url: "+f(t)+")"}(e)}(e,n):l(e)?function(e,n){return A(n,e)+"type ".concat(e.name)+I(n,e)+function(e,n){if(n&&!0===n.includeDirectives){const n=e.astNode.directives.map(f).join(" ").trim();if(n)return" "+n}return""}(e,n)+D(n,e)}(e,n):c(e)?function(e,n){return A(n,e)+"interface ".concat(e.name)+I(n,e)+D(n,e)}(e,n):m(e)?function(e,n){var t=e.getTypes(),i=t.length?" = "+t.join(" | "):"";return A(n,e)+"union "+e.name+i}(e,n):s(e)?function(e,n){var t=!n||n.includeEnumDescriptions,i=e.getValues().map(((e,i)=>(t?A(n,e," ",!i):"")+" "+e.name+w(e.deprecationReason)));return(t?A(n,e):"")+"enum ".concat(e.name)+E(i)}(e,n):o(e)?function(e,n){var t=Object.values(e.getFields()).map(((e,t)=>A(n,e," ",!t)+" "+N(e)));return A(n,e)+"input ".concat(e.name)+E(t)}(e,n):void g("Unexpected type: "+y(e))}(e,r)))).filter(Boolean).join("\n\n")+"\n"}(e,n,t,r)}},343:e=>{e.exports=require("graphql")},431:e=>{e.exports=require("graphql/jsutils/inspect")},55:e=>{e.exports=require("graphql/jsutils/invariant")},329:e=>{e.exports=require("graphql/language/blockString")}},n={};function t(i){var r=n[i];if(void 0!==r)return r.exports;var a=n[i]={exports:{}};return e[i](a,a.exports,t),a.exports}t.d=(e,n)=>{for(var i in n)t.o(n,i)&&!t.o(e,i)&&Object.defineProperty(e,i,{enumerable:!0,get:n[i]})},t.o=(e,n)=>Object.prototype.hasOwnProperty.call(e,n),t.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};var i={};(()=>{t.r(i);const e=require("commander"),n=require("fs");var r=t(540);e.program.version("2.1.3").argument("<schemas ...>","GraphQL schema files to be converted.").action((e=>{return t=void 0,i=void 0,s=function*(){const t=yield Promise.all(e.map((e=>n.promises.readFile(e,"utf-8"))));console.log((0,r.convertAppSyncSchemas)(t))},new((a=void 0)||(a=Promise))((function(e,n){function r(e){try{c(s.next(e))}catch(e){n(e)}}function o(e){try{c(s.throw(e))}catch(e){n(e)}}function c(n){var t;n.done?e(n.value):(t=n.value,t instanceof a?t:new a((function(e){e(t)}))).then(r,o)}c((s=s.apply(t,i||[])).next())}));var t,i,a,s})).showHelpAfterError().parse()})();var r=exports;for(var a in i)r[a]=i[a];i.__esModule&&Object.defineProperty(r,"__esModule",{value:!0})})(); | ||
//# sourceMappingURL=cli.js.map |
@@ -1,2 +0,2 @@ | ||
(()=>{"use strict";var e={848:(e,n,t)=>{const{astFromValue:i,DEFAULT_DEPRECATION_REASON:r,GraphQLString:a,isEnumType:s,isInputObjectType:o,isInterfaceType:c,isIntrospectionType:u,isObjectType:l,isScalarType:p,isSpecifiedDirective:d,isSpecifiedScalarType:h,isUnionType:m,print:f,printIntrospectionSchema:v}=t(343),g=t(55),y=t(431),{printBlockString:b}=t(329);function S(e){return!h(e)&&!u(e)}function T(e){if(null!=e.description||!function(e){var n=e.getQueryType();if(n&&"Query"!==n.name)return!1;var t=e.getMutationType();if(t&&"Mutation"!==t.name)return!1;var i=e.getSubscriptionType();return!i||"Subscription"===i.name}(e)){var n=[],t=e.getQueryType();t&&n.push(" query: ".concat(t.name));var i=e.getMutationType();i&&n.push(" mutation: ".concat(i.name));var r=e.getSubscriptionType();return r&&n.push(" subscription: ".concat(r.name)),w({},e)+"schema {\n".concat(n.join("\n"),"\n}")}}function I(e,n){return p(e)?function(e,n){return w(n,e)+"scalar ".concat(e.name)+function(e){if(null==e.specifiedByUrl)return"";var n=e.specifiedByUrl,t=i(n,a);return t||g("Unexpected null value returned from `astFromValue` for specifiedByUrl")," @specifiedBy(url: "+f(t)+")"}(e)}(e,n):l(e)?function(e,n){return w(n,e)+"type ".concat(e.name)+D(n,e)+function(e,n){return n&&!0===n.includeDirectives?" "+e.astNode.directives.map(f).join(" "):""}(e,n)+O(n,e)}(e,n):c(e)?function(e,n){return w(n,e)+"interface ".concat(e.name)+D(n,e)+O(n,e)}(e,n):m(e)?function(e,n){var t=e.getTypes(),i=t.length?" = "+t.join(" | "):"";return w(n,e)+"union "+e.name+i}(e,n):s(e)?function(e,n){var t=!n||n.includeEnumDescriptions,i=e.getValues().map(((e,i)=>(t?w(n,e," ",!i):"")+" "+e.name+A(e.deprecationReason)));return(t?w(n,e):"")+"enum ".concat(e.name)+E(i)}(e,n):o(e)?function(e,n){var t=Object.values(e.getFields()).map(((e,t)=>w(n,e," ",!t)+" "+F(e)));return w(n,e)+"input ".concat(e.name)+E(t)}(e,n):void g("Unexpected type: "+y(e))}function D(e,n){var t=e&&e.interfaceSeparator||" & ",i="function"==typeof n.getInterfaces?n.getInterfaces():[],r=i.reduce(((e,n)=>(e.includes(n)||e.push(n),e)),[]);return i.length?" implements "+r.map((e=>e.name)).join(t):""}function O(e,n){var t=e&&!0===e.includeDirectives,i=Object.values(n.getFields()).map(((n,i)=>{if(t&&n&&n.astNode&&n.astNode.directives&&n.astNode.directives.length){n.astNode.description=null;var r=f(n.astNode);return w(e,n," ",!i)+" "+r.replace(/\n/g,"\n ")}return w(e,n," ",!i)+" "+n.name+N(e,n.args," ")+": "+String(n.type)+A(n.deprecationReason)}));return E(i)}function E(e){return 0!==e.length?" {\n"+e.join("\n")+"\n}":""}function N(e,n){var t=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"";return 0===n.length?"":n.every((function(e){return!e.description}))?"("+n.map(F).join(", ")+")":"(\n"+n.map((function(n,i){return w(e,n," "+t,!i)+" "+t+F(n)})).join("\n")+"\n"+t+")"}function F(e){var n=i(e.defaultValue,e.type),t=e.name+": "+String(e.type);return n&&(t+=" = ".concat(f(n))),t+A(e.deprecationReason)}function A(e){if(null==e)return"";var n=i(e,a);return n&&e!==r?" @deprecated(reason: "+f(n)+")":" @deprecated"}function w(e,n){var t=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"",i=!(arguments.length>3&&void 0!==arguments[3])||arguments[3],r=n.description;if(null==r)return"";if(!0===(null==e?void 0:e.commentDescriptions))return _(r,t,i);var a=r.length>70,s=b(r,"",a),o=t&&!i?"\n"+t:t;return o+s.replace(/\n/g,"\n"+t)+"\n"}function _(e,n,t){return(n&&!t?"\n":"")+e.split("\n").map((function(e){return n+(""!==e?"# "+e:"#")})).join("\n")+"\n"}e.exports.Du=S,e.exports.t3=function(e,{directiveFilter:n=(e=>!d(e)),typeFilter:t=S,...i}){return function(e,n,t,i){var r=e.getDirectives().filter(n),a=Object.values(e.getTypeMap()).filter(t);return[T(e)].concat(r.map((e=>function(e,n){return w(n,e)+"directive @"+e.name+N(n,e.args)+(e.isRepeatable?" repeatable":"")+" on "+e.locations.join(" | ")}(e,i))),a.map((e=>I(e,i)))).filter(Boolean).join("\n\n")+"\n"}(e,n,t,i)},e.exports.yG=I},343:e=>{e.exports=require("graphql")},431:e=>{e.exports=require("graphql/jsutils/inspect")},55:e=>{e.exports=require("graphql/jsutils/invariant")},329:e=>{e.exports=require("graphql/language/blockString")}},n={};function t(i){var r=n[i];if(void 0!==r)return r.exports;var a=n[i]={exports:{}};return e[i](a,a.exports,t),a.exports}t.d=(e,n)=>{for(var i in n)t.o(n,i)&&!t.o(e,i)&&Object.defineProperty(e,i,{enumerable:!0,get:n[i]})},t.o=(e,n)=>Object.prototype.hasOwnProperty.call(e,n),t.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};var i={};(()=>{t.r(i),t.d(i,{AppSyncDirectives:()=>n,AppSyncScalars:()=>a,buildSchema:()=>l,convertAppSyncSchemas:()=>c,convertSchemas:()=>u,defaultDirectiveFilter:()=>s,defaultTypeFilter:()=>o,printSchema:()=>r.t3,printType:()=>r.yG});var e=t(343);const n='"""\nThis directive allows results to be deferred during execution\n"""\ndirective @defer on FIELD\n\n"""\nTells the service this field/object has access authorized by an OIDC token.\n"""\ndirective @aws_oidc on OBJECT | FIELD_DEFINITION\n\n"""\nDirects the schema to enforce authorization on a field\n"""\ndirective @aws_auth(\n """\n List of cognito user pool groups which have access on this field\n """\n cognito_groups: [String!]\n) on OBJECT | FIELD_DEFINITION\n\n"""\nTells the service which subscriptions will be published to when this mutation is\ncalled. This directive is deprecated use @aws_susbscribe directive instead.\n"""\ndirective @aws_publish(\n """\n List of subscriptions which will be published to when this mutation is called.\n """\n subscriptions: [String!]\n) on FIELD_DEFINITION\n\n"""\nTells the service this field/object has access authorized by a Cognito User Pools token.\n"""\ndirective @aws_cognito_user_pools(\n """\n List of cognito user pool groups which have access on this field\n """\n cognito_groups: [String!]\n) on OBJECT | FIELD_DEFINITION\n\n"""\nTells the service which mutation triggers this subscription.\n"""\ndirective @aws_subscribe(\n """\n List of mutations which will trigger this subscription when they are called.\n """\n mutations: [String!]\n) on FIELD_DEFINITION\n\n"""\nTells the service this field/object has access authorized by sigv4 signing.\n"""\ndirective @aws_iam on OBJECT | FIELD_DEFINITION\n\n"""\nTells the service this field/object has access authorized by an API key.\n"""\ndirective @aws_api_key on OBJECT | FIELD_DEFINITION\n\n"""\nTells the service this field/object has access authorized by a Lambda function.\n"""\ndirective @aws_lambda on OBJECT | FIELD_DEFINITION\n';var r=t(848);const a='"""\nAn extended ISO 8601 date string in the format YYYY-MM-DD.\n"""\nscalar AWSDate\n\n"""\nAn extended ISO 8601 time string in the format hh:mm:ss.sss.\n"""\nscalar AWSTime\n\n"""\nAn extended ISO 8601 date and time string in the format YYYY-MM-DDThh:mm:ss.sssZ.\n"""\nscalar AWSDateTime\n\n"""\nAn integer value representing the number of seconds before or after 1970-01-01-T00:00Z.\n"""\nscalar AWSTimestamp\n\n"""\nAn email address in the format local-part@domain-part as defined by RFC 822.\n"""\nscalar AWSEmail\n\n"""\nA JSON string. Any valid JSON construct is automatically parsed and loaded in the resolver mapping templates as maps, lists, or scalar values rather than as the literal input strings. Unquoted strings or otherwise invalid JSON result in a GraphQL validation error.\n"""\nscalar AWSJSON\n\n"""\nA phone number. This value is stored as a string. Phone numbers can contain either spaces or hyphens to separate digit groups. Phone numbers without a country code are assumed to be US/North American numbers adhering to the North American Numbering Plan (NANP).\n"""\nscalar AWSPhone\n\n"""\nA URL as defined by RFC 1738. For example, https://www.amazon.com/dp/B000NZW3KC/ or mailto:example@example.com. URLs must contain a schema (http, mailto) and can\'t contain two forward slashes (//) in the path part.\n"""\nscalar AWSURL\n\n"""\nA valid IPv4 or IPv6 address. IPv4 addresses are expected in quad-dotted notation (123.12.34.56). IPv6 addresses are expected in non-bracketed, colon-separated format (1a2b:3c4b::1234:4567). You can include an optional CIDR suffix (123.45.67.89/16) to indicate subnet mask.\n"""\nscalar AWSIPAddress\n',s=n=>!(0,e.isSpecifiedDirective)(n)&&!/^aws_/.test(n.name)&&"defer"!==n.name,o=n=>(0,r.Du)(n)&&!((0,e.isScalarType)(n)&&/^AWS/.test(n.name)),c=e=>u(e,{commentDescriptions:!0,includeDirectives:!0,includeEnumDescriptions:!1,interfaceSeparator:", ",directiveFilter:s,typeFilter:o}),u=(e,{commentDescriptions:t=!1,includeDirectives:i=!1,includeEnumDescriptions:c=!0,interfaceSeparator:u=" & ",directiveFilter:p=s,typeFilter:d=o}={})=>{const h=l(Array.isArray(e)?e.join("\n"):e);return(0,r.t3)(h,{commentDescriptions:t,includeDirectives:i,includeEnumDescriptions:c,interfaceSeparator:u,directiveFilter:p,typeFilter:d}).replace(a,"").replace(n,"").trim()},l=t=>{const[i,r]=(0,e.parse)([a,n].concat(t).join("\n")).definitions.reduce((([e,n],t)=>((/Extension$/.test(t.kind)?n:e).push(t),[e,n])),[[],[]]);return(0,e.extendSchema)((0,e.buildASTSchema)({kind:e.Kind.DOCUMENT,definitions:i}),{kind:e.Kind.DOCUMENT,definitions:r})}})();var r=exports;for(var a in i)r[a]=i[a];i.__esModule&&Object.defineProperty(r,"__esModule",{value:!0})})(); | ||
(()=>{"use strict";var e={848:(e,n,t)=>{const{astFromValue:i,DEFAULT_DEPRECATION_REASON:r,GraphQLString:a,isEnumType:s,isInputObjectType:o,isInterfaceType:c,isIntrospectionType:u,isObjectType:l,isScalarType:p,isSpecifiedDirective:d,isSpecifiedScalarType:h,isUnionType:m,print:f,printIntrospectionSchema:v}=t(343),g=t(55),y=t(431),{printBlockString:b}=t(329);function S(e){return!h(e)&&!u(e)}function T(e){if(null!=e.description||!function(e){var n=e.getQueryType();if(n&&"Query"!==n.name)return!1;var t=e.getMutationType();if(t&&"Mutation"!==t.name)return!1;var i=e.getSubscriptionType();return!i||"Subscription"===i.name}(e)){var n=[],t=e.getQueryType();t&&n.push(" query: ".concat(t.name));var i=e.getMutationType();i&&n.push(" mutation: ".concat(i.name));var r=e.getSubscriptionType();return r&&n.push(" subscription: ".concat(r.name)),w({},e)+"schema {\n".concat(n.join("\n"),"\n}")}}function I(e,n){return p(e)?function(e,n){return w(n,e)+"scalar ".concat(e.name)+function(e){if(null==e.specifiedByUrl)return"";var n=e.specifiedByUrl,t=i(n,a);return t||g("Unexpected null value returned from `astFromValue` for specifiedByUrl")," @specifiedBy(url: "+f(t)+")"}(e)}(e,n):l(e)?function(e,n){return w(n,e)+"type ".concat(e.name)+D(n,e)+function(e,n){if(n&&!0===n.includeDirectives){const n=e.astNode.directives.map(f).join(" ").trim();if(n)return" "+n}return""}(e,n)+O(n,e)}(e,n):c(e)?function(e,n){return w(n,e)+"interface ".concat(e.name)+D(n,e)+O(n,e)}(e,n):m(e)?function(e,n){var t=e.getTypes(),i=t.length?" = "+t.join(" | "):"";return w(n,e)+"union "+e.name+i}(e,n):s(e)?function(e,n){var t=!n||n.includeEnumDescriptions,i=e.getValues().map(((e,i)=>(t?w(n,e," ",!i):"")+" "+e.name+A(e.deprecationReason)));return(t?w(n,e):"")+"enum ".concat(e.name)+E(i)}(e,n):o(e)?function(e,n){var t=Object.values(e.getFields()).map(((e,t)=>w(n,e," ",!t)+" "+F(e)));return w(n,e)+"input ".concat(e.name)+E(t)}(e,n):void g("Unexpected type: "+y(e))}function D(e,n){var t=e&&e.interfaceSeparator||" & ",i="function"==typeof n.getInterfaces?n.getInterfaces():[],r=i.reduce(((e,n)=>(e.includes(n)||e.push(n),e)),[]);return i.length?" implements "+r.map((e=>e.name)).join(t):""}function O(e,n){var t=e&&!0===e.includeDirectives,i=Object.values(n.getFields()).map(((n,i)=>{if(t&&n&&n.astNode&&n.astNode.directives&&n.astNode.directives.length){n.astNode.description=null;var r=f(n.astNode);return w(e,n," ",!i)+" "+r.replace(/\n/g,"\n ")}return w(e,n," ",!i)+" "+n.name+N(e,n.args," ")+": "+String(n.type)+A(n.deprecationReason)}));return E(i)}function E(e){return 0!==e.length?" {\n"+e.join("\n")+"\n}":""}function N(e,n){var t=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"";return 0===n.length?"":n.every((function(e){return!e.description}))?"("+n.map(F).join(", ")+")":"(\n"+n.map((function(n,i){return w(e,n," "+t,!i)+" "+t+F(n)})).join("\n")+"\n"+t+")"}function F(e){var n=i(e.defaultValue,e.type),t=e.name+": "+String(e.type);return n&&(t+=" = ".concat(f(n))),t+A(e.deprecationReason)}function A(e){if(null==e)return"";var n=i(e,a);return n&&e!==r?" @deprecated(reason: "+f(n)+")":" @deprecated"}function w(e,n){var t=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"",i=!(arguments.length>3&&void 0!==arguments[3])||arguments[3],r=n.description;if(null==r)return"";if(!0===(null==e?void 0:e.commentDescriptions))return _(r,t,i);var a=r.length>70,s=b(r,"",a),o=t&&!i?"\n"+t:t;return o+s.replace(/\n/g,"\n"+t)+"\n"}function _(e,n,t){return(n&&!t?"\n":"")+e.split("\n").map((function(e){return n+(""!==e?"# "+e:"#")})).join("\n")+"\n"}e.exports.Du=S,e.exports.t3=function(e,{directiveFilter:n=(e=>!d(e)),typeFilter:t=S,...i}){return function(e,n,t,i){var r=e.getDirectives().filter(n),a=Object.values(e.getTypeMap()).filter(t);return[T(e)].concat(r.map((e=>function(e,n){return w(n,e)+"directive @"+e.name+N(n,e.args)+(e.isRepeatable?" repeatable":"")+" on "+e.locations.join(" | ")}(e,i))),a.map((e=>I(e,i)))).filter(Boolean).join("\n\n")+"\n"}(e,n,t,i)},e.exports.yG=I},343:e=>{e.exports=require("graphql")},431:e=>{e.exports=require("graphql/jsutils/inspect")},55:e=>{e.exports=require("graphql/jsutils/invariant")},329:e=>{e.exports=require("graphql/language/blockString")}},n={};function t(i){var r=n[i];if(void 0!==r)return r.exports;var a=n[i]={exports:{}};return e[i](a,a.exports,t),a.exports}t.d=(e,n)=>{for(var i in n)t.o(n,i)&&!t.o(e,i)&&Object.defineProperty(e,i,{enumerable:!0,get:n[i]})},t.o=(e,n)=>Object.prototype.hasOwnProperty.call(e,n),t.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};var i={};(()=>{t.r(i),t.d(i,{AppSyncDirectives:()=>n,AppSyncScalars:()=>a,buildSchema:()=>l,convertAppSyncSchemas:()=>c,convertSchemas:()=>u,defaultDirectiveFilter:()=>s,defaultTypeFilter:()=>o,printSchema:()=>r.t3,printType:()=>r.yG});var e=t(343);const n='"""\nThis directive allows results to be deferred during execution\n"""\ndirective @defer on FIELD\n\n"""\nTells the service this field/object has access authorized by an OIDC token.\n"""\ndirective @aws_oidc on OBJECT | FIELD_DEFINITION\n\n"""\nDirects the schema to enforce authorization on a field\n"""\ndirective @aws_auth(\n """\n List of cognito user pool groups which have access on this field\n """\n cognito_groups: [String!]\n) on OBJECT | FIELD_DEFINITION\n\n"""\nTells the service which subscriptions will be published to when this mutation is\ncalled. This directive is deprecated use @aws_susbscribe directive instead.\n"""\ndirective @aws_publish(\n """\n List of subscriptions which will be published to when this mutation is called.\n """\n subscriptions: [String!]\n) on FIELD_DEFINITION\n\n"""\nTells the service this field/object has access authorized by a Cognito User Pools token.\n"""\ndirective @aws_cognito_user_pools(\n """\n List of cognito user pool groups which have access on this field\n """\n cognito_groups: [String!]\n) on OBJECT | FIELD_DEFINITION\n\n"""\nTells the service which mutation triggers this subscription.\n"""\ndirective @aws_subscribe(\n """\n List of mutations which will trigger this subscription when they are called.\n """\n mutations: [String!]\n) on FIELD_DEFINITION\n\n"""\nTells the service this field/object has access authorized by sigv4 signing.\n"""\ndirective @aws_iam on OBJECT | FIELD_DEFINITION\n\n"""\nTells the service this field/object has access authorized by an API key.\n"""\ndirective @aws_api_key on OBJECT | FIELD_DEFINITION\n\n"""\nTells the service this field/object has access authorized by a Lambda function.\n"""\ndirective @aws_lambda on OBJECT | FIELD_DEFINITION\n';var r=t(848);const a='"""\nAn extended ISO 8601 date string in the format YYYY-MM-DD.\n"""\nscalar AWSDate\n\n"""\nAn extended ISO 8601 time string in the format hh:mm:ss.sss.\n"""\nscalar AWSTime\n\n"""\nAn extended ISO 8601 date and time string in the format YYYY-MM-DDThh:mm:ss.sssZ.\n"""\nscalar AWSDateTime\n\n"""\nAn integer value representing the number of seconds before or after 1970-01-01-T00:00Z.\n"""\nscalar AWSTimestamp\n\n"""\nAn email address in the format local-part@domain-part as defined by RFC 822.\n"""\nscalar AWSEmail\n\n"""\nA JSON string. Any valid JSON construct is automatically parsed and loaded in the resolver mapping templates as maps, lists, or scalar values rather than as the literal input strings. Unquoted strings or otherwise invalid JSON result in a GraphQL validation error.\n"""\nscalar AWSJSON\n\n"""\nA phone number. This value is stored as a string. Phone numbers can contain either spaces or hyphens to separate digit groups. Phone numbers without a country code are assumed to be US/North American numbers adhering to the North American Numbering Plan (NANP).\n"""\nscalar AWSPhone\n\n"""\nA URL as defined by RFC 1738. For example, https://www.amazon.com/dp/B000NZW3KC/ or mailto:example@example.com. URLs must contain a schema (http, mailto) and can\'t contain two forward slashes (//) in the path part.\n"""\nscalar AWSURL\n\n"""\nA valid IPv4 or IPv6 address. IPv4 addresses are expected in quad-dotted notation (123.12.34.56). IPv6 addresses are expected in non-bracketed, colon-separated format (1a2b:3c4b::1234:4567). You can include an optional CIDR suffix (123.45.67.89/16) to indicate subnet mask.\n"""\nscalar AWSIPAddress\n',s=n=>!(0,e.isSpecifiedDirective)(n)&&!/^aws_/.test(n.name)&&"defer"!==n.name,o=n=>(0,r.Du)(n)&&!((0,e.isScalarType)(n)&&/^AWS/.test(n.name)),c=e=>u(e,{commentDescriptions:!0,includeDirectives:!0,includeEnumDescriptions:!1,interfaceSeparator:", ",directiveFilter:s,typeFilter:o}),u=(e,{commentDescriptions:t=!1,includeDirectives:i=!1,includeEnumDescriptions:c=!0,interfaceSeparator:u=" & ",directiveFilter:p=s,typeFilter:d=o}={})=>{const h=l(Array.isArray(e)?e.join("\n"):e);return(0,r.t3)(h,{commentDescriptions:t,includeDirectives:i,includeEnumDescriptions:c,interfaceSeparator:u,directiveFilter:p,typeFilter:d}).replace(a,"").replace(n,"").trim()},l=t=>{const[i,r]=(0,e.parse)([a,n].concat(t).join("\n")).definitions.reduce((([e,n],t)=>((/Extension$/.test(t.kind)?n:e).push(t),[e,n])),[[],[]]);return(0,e.extendSchema)((0,e.buildASTSchema)({kind:e.Kind.DOCUMENT,definitions:i}),{kind:e.Kind.DOCUMENT,definitions:r})}})();var r=exports;for(var a in i)r[a]=i[a];i.__esModule&&Object.defineProperty(r,"__esModule",{value:!0})})(); | ||
//# sourceMappingURL=index.js.map |
{ | ||
"name": "appsync-schema-converter", | ||
"version": "2.1.2", | ||
"version": "2.1.3", | ||
"description": "Converts GraphQL schemas into AppSync compatible version.", | ||
@@ -18,10 +18,27 @@ "license": "BSD-2-Clause", | ||
"appsync", | ||
"directives", | ||
"graphql", | ||
"schema", | ||
"utilities", | ||
"directives" | ||
"utilities" | ||
], | ||
"main": "dist/index.js", | ||
"types": "dist/index.d.ts", | ||
"typings": "dist/index.d.ts", | ||
"bin": "dist/cli.js", | ||
"exports": { | ||
".": { | ||
"types": "./dist/index.d.ts", | ||
"require": "./dist/index.js" | ||
}, | ||
"./package.json": "./package.json" | ||
}, | ||
"files": [ | ||
"dist" | ||
], | ||
"funding": [ | ||
{ | ||
"type": "github", | ||
"url": "https://github.com/sponsors/vicary" | ||
} | ||
], | ||
"jest": { | ||
@@ -28,0 +45,0 @@ "collectCoverage": true, |
@@ -80,6 +80,4 @@ # AppSync Schema Converter | ||
# Contributors | ||
# Funding | ||
- Vicary Archangel ([@vicary](https://gitlab.com/vicary)) | ||
- Andy Fu ([@andyfu84](https://gitlab.com/andyfu84)) | ||
- Sylvain Simao ([@maoosi](https://gitlab.com/maoosi)) | ||
If you find this project useful, please [chip in](https://github.com/sponsors/vicary) so I can keep making it even better! |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
99
87003
9
83