(
responses: EchoProvisionerResponses = {},
)
| 602 | * converts it into an uploadable tar file. |
| 603 | */ |
| 604 | const createTemplateVersionTar = async ( |
| 605 | responses: EchoProvisionerResponses = {}, |
| 606 | ): Promise<Buffer> => { |
| 607 | if (responses.graph) { |
| 608 | if (!responses.apply) { |
| 609 | responses.apply = responses.graph.map((response) => { |
| 610 | if (response.log) { |
| 611 | return response; |
| 612 | } |
| 613 | return { |
| 614 | apply: { |
| 615 | error: response.graph?.error ?? "", |
| 616 | }, |
| 617 | }; |
| 618 | }); |
| 619 | } |
| 620 | if (!responses.plan) { |
| 621 | responses.plan = responses.graph.map((response) => { |
| 622 | if (response.log) { |
| 623 | return response; |
| 624 | } |
| 625 | return { |
| 626 | plan: { |
| 627 | error: response.graph?.error ?? "", |
| 628 | }, |
| 629 | }; |
| 630 | }); |
| 631 | } |
| 632 | } |
| 633 | |
| 634 | if (!responses.init) { |
| 635 | responses.init = [ |
| 636 | { |
| 637 | init: {}, |
| 638 | }, |
| 639 | ]; |
| 640 | } |
| 641 | if (!responses.parse) { |
| 642 | responses.parse = [ |
| 643 | { |
| 644 | parse: {}, |
| 645 | }, |
| 646 | ]; |
| 647 | } |
| 648 | if (!responses.apply) { |
| 649 | responses.apply = [ |
| 650 | { |
| 651 | apply: {}, |
| 652 | }, |
| 653 | ]; |
| 654 | } |
| 655 | if (!responses.plan) { |
| 656 | responses.plan = [ |
| 657 | { |
| 658 | plan: {}, |
| 659 | }, |
| 660 | ]; |
| 661 | } |
no test coverage detected