Sfoglia il codice sorgente

temp output from parser

Alexander Belanger 5 anni fa
parent
commit
56cb069e76

+ 21 - 5
internal/templater/parser/parser.go

@@ -47,6 +47,8 @@ func FormYAMLFromBytes(def *ClientConfigDefault, bytes []byte) (*models.FormYAML
 		}
 
 		for queryResKey, queryResVal := range queryRes {
+			fmt.Printf("PARSER: found value %s, %v\n", queryResKey, queryResVal)
+
 			data[queryResKey] = queryResVal
 		}
 	}
@@ -126,6 +128,8 @@ func formToLookupTable(def *ClientConfigDefault, form *models.FormYAML) map[*mod
 					lookup[content.Context] = formContextToContextConfig(def, content.Context)
 				}
 
+				fmt.Printf("PARSER: content value %v, variable %s\n", content.Value, content.Variable)
+
 				if fmt.Sprintf("%v", content.Value) != "" {
 					// TODO -- case on whether value is proper query string, if not resolve it to a
 					// proper query string
@@ -134,6 +138,12 @@ func formToLookupTable(def *ClientConfigDefault, form *models.FormYAML) map[*mod
 						fmt.Sprintf("%v", content.Value),
 					)
 
+					fmt.Printf(
+						"PARSER: added query %s, %s\n",
+						fmt.Sprintf("tabs[%d].sections[%d].contents[%d]", i, j, k),
+						fmt.Sprintf("%v", content.Value),
+					)
+
 					if err != nil {
 						continue
 					}
@@ -147,6 +157,12 @@ func formToLookupTable(def *ClientConfigDefault, form *models.FormYAML) map[*mod
 						fmt.Sprintf("{ .%v }", content.Variable),
 					)
 
+					fmt.Printf(
+						"PARSER: added query %s, %s\n",
+						fmt.Sprintf("tabs[%d].sections[%d].contents[%d]", i, j, k),
+						fmt.Sprintf("{ .%v }", content.Variable),
+					)
+
 					if err != nil {
 						continue
 					}
@@ -203,11 +219,11 @@ func formContextToContextConfig(def *ClientConfigDefault, context *models.FormCo
 
 		// identify object based on passed config
 		obj := &td.Object{
-			Group:     context.Config["Group"],
-			Version:   context.Config["Version"],
-			Resource:  context.Config["Resource"],
-			Namespace: context.Config["Namespace"],
-			Name:      context.Config["Name"],
+			Group:     context.Config["group"],
+			Version:   context.Config["version"],
+			Resource:  context.Config["resource"],
+			Namespace: context.Config["namespace"],
+			Name:      context.Config["name"],
 		}
 
 		res.TemplateReader = td.NewDynamicTemplateReader(def.DynamicClient, obj)

+ 0 - 21
node_modules/@types/random-words/LICENSE

@@ -1,21 +0,0 @@
-    MIT License
-
-    Copyright (c) Microsoft Corporation.
-
-    Permission is hereby granted, free of charge, to any person obtaining a copy
-    of this software and associated documentation files (the "Software"), to deal
-    in the Software without restriction, including without limitation the rights
-    to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
-    copies of the Software, and to permit persons to whom the Software is
-    furnished to do so, subject to the following conditions:
-
-    The above copyright notice and this permission notice shall be included in all
-    copies or substantial portions of the Software.
-
-    THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-    IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-    FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-    AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-    LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
-    OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
-    SOFTWARE

+ 0 - 16
node_modules/@types/random-words/README.md

@@ -1,16 +0,0 @@
-# Installation
-> `npm install --save @types/random-words`
-
-# Summary
-This package contains type definitions for random-words (https://github.com/punkave/random-words#readme).
-
-# Details
-Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/random-words.
-
-### Additional Details
- * Last updated: Tue, 08 Sep 2020 12:35:22 GMT
- * Dependencies: none
- * Global values: none
-
-# Credits
-These definitions were written by [Piotr Błażejewicz](https://github.com/peterblazejewicz).

+ 0 - 34
node_modules/@types/random-words/index.d.ts

@@ -1,34 +0,0 @@
-// Type definitions for random-words 1.1
-// Project: https://github.com/punkave/random-words#readme
-// Definitions by: Piotr Błażejewicz <https://github.com/peterblazejewicz>
-// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
-
-/**
- * generates random words for use as sample text.
- * We use it to generate random blog posts when testing Apostrophe.
- */
-declare function words(
-    options?: words.Options & {
-        join: string;
-    },
-): string;
-declare function words(options: words.Options | number): string | string[];
-
-declare namespace words {
-    let wordList: string[];
-
-    interface Options {
-        exactly?: number;
-        formatter?: WordFormatter;
-        join?: string;
-        max?: number;
-        maxLength?: number;
-        min?: number;
-        separator?: string;
-        wordsPerString?: number;
-    }
-
-    type WordFormatter = (word: string, relativeIndex?: number) => string;
-}
-
-export = words;

+ 0 - 54
node_modules/@types/random-words/package.json

@@ -1,54 +0,0 @@
-{
-  "_from": "@types/random-words",
-  "_id": "@types/random-words@1.1.0",
-  "_inBundle": false,
-  "_integrity": "sha512-YZqkHIAGoXv6mlyEOwluhMjF9aotH2m9HrCCR+PNtES/ED00u5u4W7X1lWxc5AaFRKdKx+5orWTFW7iyGrZpOQ==",
-  "_location": "/@types/random-words",
-  "_phantomChildren": {},
-  "_requested": {
-    "type": "tag",
-    "registry": true,
-    "raw": "@types/random-words",
-    "name": "@types/random-words",
-    "escapedName": "@types%2frandom-words",
-    "scope": "@types",
-    "rawSpec": "",
-    "saveSpec": null,
-    "fetchSpec": "latest"
-  },
-  "_requiredBy": [
-    "#USER",
-    "/"
-  ],
-  "_resolved": "https://registry.npmjs.org/@types/random-words/-/random-words-1.1.0.tgz",
-  "_shasum": "7f4245faf2092caa6511f6fadda303162a3e3772",
-  "_spec": "@types/random-words",
-  "_where": "/Users/jusrhee/Documents/porter",
-  "bugs": {
-    "url": "https://github.com/DefinitelyTyped/DefinitelyTyped/issues"
-  },
-  "bundleDependencies": false,
-  "contributors": [
-    {
-      "name": "Piotr Błażejewicz",
-      "url": "https://github.com/peterblazejewicz"
-    }
-  ],
-  "dependencies": {},
-  "deprecated": false,
-  "description": "TypeScript definitions for random-words",
-  "homepage": "https://github.com/DefinitelyTyped/DefinitelyTyped#readme",
-  "license": "MIT",
-  "main": "",
-  "name": "@types/random-words",
-  "repository": {
-    "type": "git",
-    "url": "git+https://github.com/DefinitelyTyped/DefinitelyTyped.git",
-    "directory": "types/random-words"
-  },
-  "scripts": {},
-  "typeScriptVersion": "3.1",
-  "types": "index.d.ts",
-  "typesPublisherContentHash": "2cb4b703bd042634031da19d90d2c93ea8f42cdb8948a33990d439fd346eff93",
-  "version": "1.1.0"
-}