@ttoss/appsync-api 0.2.2 → 0.3.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/bin/cli.js ADDED
@@ -0,0 +1,2 @@
1
+ #!/usr/bin/env node
2
+ require('../dist/cli.js');
package/dist/cli.d.ts ADDED
@@ -0,0 +1 @@
1
+
package/dist/cli.js ADDED
@@ -0,0 +1,33 @@
1
+ /** Powered by @ttoss/config. https://ttoss.dev/docs/modules/packages/config/ */
2
+ "use strict";
3
+ var __create = Object.create;
4
+ var __defProp = Object.defineProperty;
5
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
6
+ var __getOwnPropNames = Object.getOwnPropertyNames;
7
+ var __getProtoOf = Object.getPrototypeOf;
8
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
9
+ var __copyProps = (to, from, except, desc) => {
10
+ if (from && typeof from === "object" || typeof from === "function") {
11
+ for (let key of __getOwnPropNames(from))
12
+ if (!__hasOwnProp.call(to, key) && key !== except)
13
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
14
+ }
15
+ return to;
16
+ };
17
+ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
18
+ isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
19
+ mod
20
+ ));
21
+
22
+ // src/cli.ts
23
+ var fs = __toESM(require("fs"));
24
+ var import_cloudformation = require("@ttoss/cloudformation");
25
+ var import_minimist = __toESM(require("minimist"));
26
+ var argv = (0, import_minimist.default)(process.argv.slice(2));
27
+ var AppSyncGraphQLSchemaLogicalId = "AppSyncGraphQLSchema";
28
+ if (argv._.includes("build-schema")) {
29
+ const template = (0, import_cloudformation.findAndReadCloudFormationTemplate)({});
30
+ const sdl = template.Resources[AppSyncGraphQLSchemaLogicalId].Properties.Definition;
31
+ fs.mkdirSync("schema", { recursive: true });
32
+ fs.writeFileSync("schema/schema.graphql", sdl);
33
+ }
@@ -0,0 +1,14 @@
1
+ /** Powered by @ttoss/config. https://ttoss.dev/docs/modules/packages/config/ */
2
+
3
+ // src/cli.ts
4
+ import * as fs from "fs";
5
+ import { findAndReadCloudFormationTemplate } from "@ttoss/cloudformation";
6
+ import minimist from "minimist";
7
+ var argv = minimist(process.argv.slice(2));
8
+ var AppSyncGraphQLSchemaLogicalId = "AppSyncGraphQLSchema";
9
+ if (argv._.includes("build-schema")) {
10
+ const template = findAndReadCloudFormationTemplate({});
11
+ const sdl = template.Resources[AppSyncGraphQLSchemaLogicalId].Properties.Definition;
12
+ fs.mkdirSync("schema", { recursive: true });
13
+ fs.writeFileSync("schema/schema.graphql", sdl);
14
+ }