@ibm/zapp-core 1.0.4 → 1.1.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/LICENSE.txt CHANGED
@@ -3,7 +3,7 @@ LICENSE INFORMATION
3
3
  The Programs listed below are licensed under the following License Information terms and conditions in addition to the Program license terms previously agreed to by Client and IBM. If Client does not have previously agreed to license terms in effect for the Program, the International License Agreement for Non-Warranted Programs (i125-5589-06) applies.
4
4
 
5
5
  Program Name (Program Number):
6
- IBM Zapp Core Library V1.0 (Plug-in)
6
+ IBM Zapp Core Library V1.1 (Plug-in)
7
7
 
8
8
  The following standard terms apply to Licensee's use of the Program.
9
9
 
@@ -12,9 +12,9 @@ Modifiable Third Party Code
12
12
  To the extent, if any, in the NOTICES file IBM identifies third party code as "Modifiable Third Party Code," IBM authorizes Licensee to 1) modify the Modifiable Third Party Code and 2) reverse engineer the Program modules that directly interface with the Modifiable Third Party Code provided that it is only for the purpose of debugging Licensee's modifications to such third party code. IBM's service and support obligations, if any, apply only to the unmodified Program.
13
13
 
14
14
 
15
- L/N: L-YVXN-CTM9H3
16
- D/N: L-YVXN-CTM9H3
17
- P/N: L-YVXN-CTM9H3
15
+ L/N: L-KTSR-8RJLXL
16
+ D/N: L-KTSR-8RJLXL
17
+ P/N: L-KTSR-8RJLXL
18
18
 
19
19
  International License Agreement for Non-Warranted Programs
20
20
 
@@ -148,7 +148,7 @@ In Mexico: In the third sentence, delete the words "to an account specified by I
148
148
 
149
149
  In Mexico: Add the following new sentence after the third sentence:
150
150
 
151
- Payments will be made through electronic transfer of funds to an account specified by IBM or in IBM's domicile which is located in Alfonso Napoles Gandara 3111, Santa Fe Pe�a Blanca, Alvaro Obregon, Mexico City, Zip Code 01210.
151
+ Payments will be made through electronic transfer of funds to an account specified by IBM or in IBM´s domicile which is located in Alfonso Napoles Gandara 3111, Santa Fe Peña Blanca, Alvaro Obregon, Mexico City, Zip Code 01210.
152
152
 
153
153
  Add at the end of paragraph c the following sentence:
154
154
 
@@ -168,7 +168,7 @@ Section 6. Governing Laws and Geographic Scope
168
168
 
169
169
  In paragraph a, replace the first sentence only with:
170
170
 
171
- In Argentina: Both parties agree to the application of the laws of the Republic of Argentina, without regard to the conflict of law principles. Any proceeding regarding the rights, duties, and obligations arising from this Agreement will be brought in the Ordinary Commercial Court of the City of "Ciudad Aut�noma de Buenos Aires".
171
+ In Argentina: Both parties agree to the application of the laws of the Republic of Argentina, without regard to the conflict of law principles. Any proceeding regarding the rights, duties, and obligations arising from this Agreement will be brought in the Ordinary Commercial Court of the City of "Ciudad Autónoma de Buenos Aires".
172
172
 
173
173
  In Chile: Both parties agree to the application of the laws of Chile, without regard to the conflict of law principles. Any conflict, interpretation or breach related to this Agreement that cannot be solved by the Parties should be remitted to the jurisdiction of the Ordinary Courts of the city and district of Santiago.
174
174
 
@@ -208,7 +208,7 @@ In Venezuela: Venezuela
208
208
 
209
209
  Add the following sentences at the end of paragraph b:
210
210
 
211
- In Brazil: All disputes arising out of or related to this Agreement, including summary proceedings, will be brought before and subject to the exclusive jurisdiction of the Forum of the City of S�o Paulo, State of S�o Paulo, Brazil and the parties irrevocably agree with this specific jurisdiction renouncing any other, however privileged it may be.
211
+ In Brazil: All disputes arising out of or related to this Agreement, including summary proceedings, will be brought before and subject to the exclusive jurisdiction of the Forum of the City of São Paulo, State of São Paulo, Brazil and the parties irrevocably agree with this specific jurisdiction renouncing any other, however privileged it may be.
212
212
 
213
213
  In Mexico: The Parties agree to submit themselves to the exclusive jurisdiction of the courts of Mexico City to resolve any dispute arising from this Agreement. The Parties waive to any other jurisdiction that may correspond to them due to their current or future domiciles, or for any other reason.
214
214
 
@@ -228,7 +228,7 @@ In Brazil: delete the entire 2nd sentence of "Neither party will bring a legal a
228
228
 
229
229
  Add as a new paragraph l to this section:
230
230
 
231
- In Canada: Both parties agree to write this document in English. Les parties ont convenu de r�diger le pr�sent document en langue anglaise.
231
+ In Canada: Both parties agree to write this document in English. Les parties ont convenu de rédiger le présent document en langue anglaise.
232
232
 
233
233
  2. ASIA PACIFIC
234
234
 
@@ -358,7 +358,7 @@ Section 4. Liability and Intellectual Property Protection
358
358
 
359
359
  In paragraph a, in the first sentence insert the following before the words "the amounts paid":
360
360
 
361
- In Belgium, France, Germany, Italy, Luxembourg, Malta, Portugal, and Spain: the greater of 500,000 (five hundred thousand euro) or
361
+ In Belgium, France, Germany, Italy, Luxembourg, Malta, Portugal, and Spain: the greater of 500,000 (five hundred thousand euro) or
362
362
 
363
363
  In Ireland and United Kingdom: 125% of
364
364
 
@@ -368,7 +368,7 @@ In Spain: and proven damages incurred by Licensee as a direct consequence of the
368
368
 
369
369
  In paragraph a, insert after the first sentence the following new sentence:
370
370
 
371
- In Slovakia: Referring to 379 of the Commercial Code, Act No. 513/1991 Coll. as amended, and concerning all conditions related to the conclusion of the agreement, both parties state that the total foreseeable damage, which may accrue, shall not exceed the amount above, and it is the maximum for which IBM is responsible.
371
+ In Slovakia: Referring to § 379 of the Commercial Code, Act No. 513/1991 Coll. as amended, and concerning all conditions related to the conclusion of the agreement, both parties state that the total foreseeable damage, which may accrue, shall not exceed the amount above, and it is the maximum for which IBM is responsible.
372
372
 
373
373
  In paragraph a, insert before the second sentence the following new sentence:
374
374
 
package/NOTICES.txt CHANGED
@@ -1,6 +1,6 @@
1
1
  NOTICES AND INFORMATION
2
2
 
3
- IBM Zapp Core Library V1.0
3
+ IBM Zapp Core Library V1.1
4
4
 
5
5
  The IBM license agreement and any applicable information on the web
6
6
  download page for IBM products refers Licensee to this file for details
@@ -25,7 +25,7 @@ and all liability for errors and omissions or for any damages accruing
25
25
  from the use of this NOTICES file or its contents, including without
26
26
  limitation URLs or references to any third party websites.
27
27
 
28
- Start of Notices for IBM Zapp Core Library 1.0.0
28
+ Start of Notices for IBM Zapp Core Library 1.1.0
29
29
  =====================================================================
30
30
 
31
31
  =====================================================================
@@ -95,14 +95,37 @@ SOFTWARE.
95
95
  =====================================================================
96
96
  END OF MIT LICENSE NOTICES AND INFORMATION
97
97
  =====================================================================
98
+ START OF APACHE 2.0SOFTWARE FOUNDATION LICENSE NOTICES AND INFORMATION
99
+ ======================================================================
100
+ APACHE SOFTWARE LICENSE 2.0.
98
101
 
102
+ The Program includes some or all of the following that IBM obtained
103
+ under the Apache License Version 2.0:
104
+
105
+ sr305
106
+ listenablefuture
107
+ opentest4j
108
+ snakeyaml
109
+ asm-analysys
110
+ asm-commons
111
+ asm-tree
112
+ Apiguardian-api
113
+ jackson-bom
114
+
115
+ This software may also consist of voluntary contributions made by many
116
+ individuals to the Apache Software Foundation. Some or all of the following
117
+ software may be components of other included software packages noted later
118
+ in this file. For more information on the Apache Software Foundation, please
119
+ see http://www.apache.org.
120
+ =====================================================================
121
+ START OF APACHE 2.0 SOFTWARE FOUNDATION LICENSE NOTICES AND INFORMATION
99
122
  =====================================================================
100
123
  START OF PYTHON SOFTWARE FOUNDATION LICENSE NOTICES AND INFORMATION
101
124
  =====================================================================
102
125
  The Program includes some or all of the following that IBM obtained under the Python Software Foundation License.
103
126
 
104
127
 
105
- argparse 2.x
128
+ agparse 1.x
106
129
 
107
130
 
108
131
 
@@ -462,6 +485,104 @@ ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF S
462
485
  =====================================================================
463
486
  END OF BSD-3-CLAUSE LICENSE NOTICES AND INFORMATION
464
487
  =====================================================================
488
+ START OF ECLIPSE V2 LICENSE NOTICES AND INFORMATION
489
+ =====================================================================
490
+ The Program includes some or all of the following that IBM obtained under the Eclipse Public License - v 2.0 Clause:
491
+
492
+ The Program contains open source software obtained from the Eclipse Foundation (herein collectively referred to as "Eclipse Code"). Notices and important information, including instructions for obtaining source code, for the Eclipse Code may be found in associated "about.html" files ("About Files") that accompany the Eclipse Code. These About Files are provided for informational purposes only, and notwithstanding anything to the contrary therein, your use of such Eclipse Code shall be governed by the terms of the IBM end user license agreement.
493
+
494
+ junit-bom
495
+ junit-jupiter
496
+ junit-jupiter-api
497
+ junit-jupiter-engine
498
+ junit-jupiter-params
499
+ junit-jupiter-platform-commmons
500
+ Junit-platform-enngine
501
+ clipse Public License - v 2.0
502
+
503
+ THE ACCOMPANYING PROGRAM IS PROVIDED UNDER THE TERMS OF THIS ECLIPSE PUBLIC LICENSE ("AGREEMENT"). ANY USE, REPRODUCTION OR DISTRIBUTION OF THE PROGRAM CONSTITUTES RECIPIENT'S ACCEPTANCE OF THIS AGREEMENT.
504
+
505
+ 1. DEFINITIONS
506
+
507
+ "Contribution" means:
508
+ a) in the case of the initial Contributor, the initial content Distributed under this Agreement, and
509
+ b) in the case of each subsequent Contributor:
510
+ i) changes to the Program, and
511
+ ii) additions to the Program;
512
+
513
+ where such changes and/or additions to the Program originate from and are Distributed by that particular Contributor. A Contribution "originates" from a Contributor if it was added to the Program by such Contributor itself or anyone acting on such Contributor's behalf. Contributions do not include changes or additions to the Program that are not Modified Works.
514
+
515
+ "Contributor" means any person or entity that Distributes the Program.
516
+
517
+ "Licensed Patents" mean patent claims licensable by a Contributor which are necessarily infringed by the use or sale of its Contribution alone or when combined with the Program.
518
+
519
+ "Program" means the Contributions Distributed in accordance with this Agreement.
520
+
521
+ "Recipient" means anyone who receives the Program under this Agreement or any Secondary License (as applicable), including Contributors.
522
+
523
+ "Derivative Works" shall mean any work, whether in Source Code or other form, that is based on (or derived from) the Program and for which the editorial revisions, annotations, elaborations, or other modifications represent, as a whole, an original work of authorship.
524
+
525
+ "Modified Works" shall mean any work in Source Code or other form that results from an addition to, deletion from, or modification of the contents of the Program, including, for purposes of clarity any new file in Source Code form that contains any contents of the Program. Modified Works shall not include works that contain only declarations, interfaces, types, classes, structures, or files of the Program solely in each case in order to link to, bind by name, or subclass the Program or Modified Works thereof.
526
+
527
+ "Distribute" means the acts of a) distributing or b) making available in any manner that enables the transfer of a copy.
528
+
529
+ "Source Code" means the form of a Program preferred for making modifications, including but not limited to software source code, documentation source, and configuration files.
530
+
531
+ "Secondary License" means either the GNU General Public License, Version 2.0, or any later versions of that license, including any exceptions or additional permissions as identified by the initial Contributor.
532
+ 2. GRANT OF RIGHTS
533
+ a) Subject to the terms of this Agreement, each Contributor hereby grants Recipient a non-exclusive, worldwide, royalty-free copyright license to reproduce, prepare Derivative Works of, publicly display, publicly perform, Distribute and sublicense the Contribution of such Contributor, if any, and such Derivative Works.
534
+ b) Subject to the terms of this Agreement, each Contributor hereby grants Recipient a non-exclusive, worldwide, royalty-free patent license under Licensed Patents to make, use, sell, offer to sell, import and otherwise transfer the Contribution of such Contributor, if any, in Source Code or other form. This patent license shall apply to the combination of the Contribution and the Program if, at the time the Contribution is added by the Contributor, such addition of the Contribution causes such combination to be covered by the Licensed Patents. The patent license shall not apply to any other combinations which include the Contribution. No hardware per se is licensed hereunder.
535
+ c) Recipient understands that although each Contributor grants the licenses to its Contributions set forth herein, no assurances are provided by any Contributor that the Program does not infringe the patent or other intellectual property rights of any other entity. Each Contributor disclaims any liability to Recipient for claims brought by any other entity based on infringement of intellectual property rights or otherwise. As a condition to exercising the rights and licenses granted hereunder, each Recipient hereby assumes sole responsibility to secure any other intellectual property rights needed, if any. For example, if a third party patent license is required to allow Recipient to Distribute the Program, it is Recipient's responsibility to acquire that license before distributing the Program.
536
+ d) Each Contributor represents that to its knowledge it has sufficient copyright rights in its Contribution, if any, to grant the copyright license set forth in this Agreement.
537
+ e) Notwithstanding the terms of any Secondary License, no Contributor makes additional grants to any Recipient (other than those set forth in this Agreement) as a result of such Recipient's receipt of the Program under the terms of a Secondary License (if permitted under the terms of Section 3).
538
+ 3. REQUIREMENTS
539
+ 3.1 If a Contributor Distributes the Program in any form, then:
540
+ a) the Program must also be made available as Source Code, in accordance with section 3.2, and the Contributor must accompany the Program with a statement that the Source Code for the Program is available under this Agreement, and informs Recipients how to obtain it in a reasonable manner on or through a medium customarily used for software exchange; and
541
+ b) the Contributor may Distribute the Program under a license different than this Agreement, provided that such license:
542
+ i) effectively disclaims on behalf of all other Contributors all warranties and conditions, express and implied, including warranties or conditions of title and non-infringement, and implied warranties or conditions of merchantability and fitness for a particular purpose;
543
+ ii) effectively excludes on behalf of all other Contributors all liability for damages, including direct, indirect, special, incidental and consequential damages, such as lost profits;
544
+ iii) does not attempt to limit or alter the recipients' rights in the Source Code under section 3.2; and
545
+ iv) requires any subsequent distribution of the Program by any party to be under a license that satisfies the requirements of this section 3.
546
+ 3.2 When the Program is Distributed as Source Code:
547
+ a) it must be made available under this Agreement, or if the Program (i) is combined with other material in a separate file or files made available under a Secondary License, and (ii) the initial Contributor attached to the Source Code the notice described in Exhibit A of this Agreement, then the Program may be made available under the terms of such Secondary Licenses, and
548
+ b) a copy of this Agreement must be included with each copy of the Program.
549
+ 3.3 Contributors may not remove or alter any copyright, patent, trademark, attribution notices, disclaimers of warranty, or limitations of liability ("notices") contained within the Program from any copy of the Program which they Distribute, provided that Contributors may add their own appropriate notices.
550
+ 4. COMMERCIAL DISTRIBUTION
551
+
552
+ Commercial distributors of software may accept certain responsibilities with respect to end users, business partners and the like. While this license is intended to facilitate the commercial use of the Program, the Contributor who includes the Program in a commercial product offering should do so in a manner which does not create potential liability for other Contributors. Therefore, if a Contributor includes the Program in a commercial product offering, such Contributor ("Commercial Contributor") hereby agrees to defend and indemnify every other Contributor ("Indemnified Contributor") against any losses, damages and costs (collectively "Losses") arising from claims, lawsuits and other legal actions brought by a third party against the Indemnified Contributor to the extent caused by the acts or omissions of such Commercial Contributor in connection with its distribution of the Program in a commercial product offering. The obligations in this section do not apply to any claims or Losses relating to any actual or alleged intellectual property infringement. In order to qualify, an Indemnified Contributor must: a) promptly notify the Commercial Contributor in writing of such claim, and b) allow the Commercial Contributor to control, and cooperate with the Commercial Contributor in, the defense and any related settlement negotiations. The Indemnified Contributor may participate in any such claim at its own expense.
553
+
554
+ For example, a Contributor might include the Program in a commercial product offering, Product X. That Contributor is then a Commercial Contributor. If that Commercial Contributor then makes performance claims, or offers warranties related to Product X, those performance claims and warranties are such Commercial Contributor's responsibility alone. Under this section, the Commercial Contributor would have to defend claims against the other Contributors related to those performance claims and warranties, and if a court requires any other Contributor to pay any damages as a result, the Commercial Contributor must pay those damages.
555
+ 5. NO WARRANTY
556
+
557
+ EXCEPT AS EXPRESSLY SET FORTH IN THIS AGREEMENT, AND TO THE EXTENT PERMITTED BY APPLICABLE LAW, THE PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED INCLUDING, WITHOUT LIMITATION, ANY WARRANTIES OR CONDITIONS OF TITLE, NON-INFRINGEMENT, MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. Each Recipient is solely responsible for determining the appropriateness of using and distributing the Program and assumes all risks associated with its exercise of rights under this Agreement, including but not limited to the risks and costs of program errors, compliance with applicable laws, damage to or loss of data, programs or equipment, and unavailability or interruption of operations.
558
+ 6. DISCLAIMER OF LIABILITY
559
+
560
+ EXCEPT AS EXPRESSLY SET FORTH IN THIS AGREEMENT, AND TO THE EXTENT PERMITTED BY APPLICABLE LAW, NEITHER RECIPIENT NOR ANY CONTRIBUTORS SHALL HAVE ANY LIABILITY FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING WITHOUT LIMITATION LOST PROFITS), HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OR DISTRIBUTION OF THE PROGRAM OR THE EXERCISE OF ANY RIGHTS GRANTED HEREUNDER, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
561
+ 7. GENERAL
562
+
563
+ If any provision of this Agreement is invalid or unenforceable under applicable law, it shall not affect the validity or enforceability of the remainder of the terms of this Agreement, and without further action by the parties hereto, such provision shall be reformed to the minimum extent necessary to make such provision valid and enforceable.
564
+
565
+ If Recipient institutes patent litigation against any entity (including a cross-claim or counterclaim in a lawsuit) alleging that the Program itself (excluding combinations of the Program with other software or hardware) infringes such Recipient's patent(s), then such Recipient's rights granted under Section 2(b) shall terminate as of the date such litigation is filed.
566
+
567
+ All Recipient's rights under this Agreement shall terminate if it fails to comply with any of the material terms or conditions of this Agreement and does not cure such failure in a reasonable period of time after becoming aware of such noncompliance. If all Recipient's rights under this Agreement terminate, Recipient agrees to cease use and distribution of the Program as soon as reasonably practicable. However, Recipient's obligations under this Agreement and any licenses granted by Recipient relating to the Program shall continue and survive.
568
+
569
+ Everyone is permitted to copy and distribute copies of this Agreement, but in order to avoid inconsistency the Agreement is copyrighted and may only be modified in the following manner. The Agreement Steward reserves the right to publish new versions (including revisions) of this Agreement from time to time. No one other than the Agreement Steward has the right to modify this Agreement. The Eclipse Foundation is the initial Agreement Steward. The Eclipse Foundation may assign the responsibility to serve as the Agreement Steward to a suitable separate entity. Each new version of the Agreement will be given a distinguishing version number. The Program (including Contributions) may always be Distributed subject to the version of the Agreement under which it was received. In addition, after a new version of the Agreement is published, Contributor may elect to Distribute the Program (including its Contributions) under the new version.
570
+
571
+ Except as expressly stated in Sections 2(a) and 2(b) above, Recipient receives no rights or licenses to the intellectual property of any Contributor under this Agreement, whether expressly, by implication, estoppel or otherwise. All rights in the Program not expressly granted under this Agreement are reserved. Nothing in this Agreement is intended to be enforceable by any entity that is not a Contributor or Recipient. No third-party beneficiary rights are created under this Agreement.
572
+ Exhibit A - Form of Secondary Licenses Notice
573
+
574
+ "This Source Code may also be made available under the following Secondary Licenses when the conditions for such availability set forth in the Eclipse Public License, v. 2.0 are satisfied: {name license(s), version(s), and exceptions or additional permissions here}."
575
+
576
+ Simply including a copy of this Agreement, including this Exhibit A is not sufficient to license the Source Code under Secondary Licenses.
577
+
578
+ If it is not possible or desirable to put the notice in a particular file, then You may include the notice in a location (such as a LICENSE file in a relevant directory) where a recipient would be likely to look for such a notice.
579
+
580
+ You may add additional accurate notices of copyright ownership.
581
+
582
+ =====================================================================
583
+ END OF ECLIPSE PUBLIC LICENSE V2 LICENSE NOTICES AND INFORMATION
584
+ =====================================================================
585
+
465
586
 
466
587
 
467
588
  =====================================================================
@@ -542,9 +663,9 @@ For more information, please refer to <http://unlicense.org/>
542
663
  END OF UNLICENSE NOTICES AND INFORMATION
543
664
  =====================================================================
544
665
 
545
- End of Notices for IBM Zapp Core Library 1.0.0
666
+ End of Notices for IBM Zapp Core Library 1.1.0
546
667
 
547
668
 
548
- L/N: L-YVXN-CTM9H3
549
- D/N: L-YVXN-CTM9H3
550
- P/N: L-YVXN-CTM9H3
669
+ L/N: L-KTSR-8RJLXL
670
+ D/N: L-KTSR-8RJLXL
671
+ P/N: L-KTSR-8RJLXL
package/lib/index.d.ts CHANGED
@@ -78,6 +78,7 @@ export abstract class SchemaDocumentCache {
78
78
  protected workspacesMap: Map<string, string>;
79
79
  protected constructor(type: string);
80
80
  protected addDocument(filePath: string, workspacePath: string, document: SchemaDocumentInstance): void;
81
+ protected removeDocument(filePath: string): boolean;
81
82
  /**
82
83
  * @returns the number of documents in the cache.
83
84
  */
@@ -125,7 +126,7 @@ export abstract class SchemaDocumentCache {
125
126
  protected normalizePath(inputPath: string): string;
126
127
  }
127
128
  /**
128
- * JSON schema for zapp.json and zapp.yaml files. Version 1.0.0 -- Licensed Materials - Property of IBM - (c) Copyright IBM Corporation 2022. All Rights Reserved.
129
+ * JSON schema for zapp.json and zapp.yaml files. Version 1.1.0 -- Licensed Materials - Property of IBM - (c) Copyright IBM Corporation 2022, 2023. All Rights Reserved.
129
130
  */
130
131
  export type IBMZappDocument = CoreProperties;
131
132
  /**
@@ -148,6 +149,16 @@ export type Profile = {
148
149
  name: string;
149
150
  type: 'rseapi';
150
151
  settings: RseapiSettingsItem;
152
+ } | {
153
+ name: string;
154
+ type: 'preprocessor';
155
+ location: 'local';
156
+ settings: LocalPreprocessorSettingsItem;
157
+ } | {
158
+ name: string;
159
+ type: 'preprocessor';
160
+ location: 'mvs';
161
+ settings: MvsPreprocessorSettingsItem;
151
162
  };
152
163
  export interface CoreProperties {
153
164
  /**
@@ -198,7 +209,7 @@ export interface CoreProperties {
198
209
  */
199
210
  maintainers?: [Person, ...Person[]];
200
211
  /**
201
- * A list properties defining path names for resolving dependencies.
212
+ * A list of properties defining path names for resolving dependencies.
202
213
  */
203
214
  propertyGroups?: [PropertyGroupItem, ...PropertyGroupItem[]];
204
215
  /**
@@ -234,7 +245,7 @@ export interface LibraryItem {
234
245
  */
235
246
  type: 'mvs' | 'local';
236
247
  /**
237
- * An array of include file locations. For 'local' libraries values can be absolute and relative filename paths using GLOB patterns. For 'mvs' libraries value can be data set names. GLOB patterns for dat sets are currently not supported.
248
+ * An array of include file locations. For 'local' libraries values can be absolute and relative filename paths using GLOB patterns. For 'mvs' libraries value can be data set names. GLOB patterns for data sets are currently not supported.
238
249
  */
239
250
  locations: [string, ...string[]];
240
251
  }
@@ -322,6 +333,54 @@ export interface RseapiSettingsItemMapping {
322
333
  resource?: string;
323
334
  }[];
324
335
  }
336
+ /**
337
+ * Preprocessor properties for preprocessing COBOL/PL/I files.
338
+ */
339
+ export interface LocalPreprocessorSettingsItem {
340
+ /**
341
+ * The command to run to execute the preprocessor executable.
342
+ */
343
+ command: string;
344
+ /**
345
+ * Path where preprocessor produces its build output.
346
+ */
347
+ outputPath: string;
348
+ /**
349
+ * The desired file extension for the post-processed file.
350
+ */
351
+ fileExtension: string;
352
+ /**
353
+ * Specifies any user defined environment variables to be passed to the preprocessor.
354
+ */
355
+ environmentVariables?: {
356
+ /**
357
+ * This interface was referenced by `undefined`'s JSON-Schema definition
358
+ * via the `patternProperty` "^.*$".
359
+ */
360
+ [k: string]: string;
361
+ };
362
+ }
363
+ /**
364
+ * Preprocessor properties for preprocessing COBOL/PL/I files.
365
+ */
366
+ export interface MvsPreprocessorSettingsItem {
367
+ /**
368
+ * Specifies an input listing sequential data set.
369
+ */
370
+ commandDataSet: string;
371
+ /**
372
+ * The parameters for the command being run.
373
+ */
374
+ commandParameters: string;
375
+ /**
376
+ * Specifies an output listing sequential data set.
377
+ */
378
+ outputDataSet: string;
379
+ /**
380
+ * Specifies the high-level qualifier used for data sets created by plug-in requests to export observation files.
381
+ */
382
+ tempDataHLQ: string;
383
+ }
325
384
  /**
326
385
  * A meta-data representation of a zapp file
327
386
  * providing path and type.
@@ -415,7 +474,7 @@ export class ZappDocumentInstance extends SchemaDocumentInstance {
415
474
  * Class that finds, loads, and caches instances of zapp files in memory.
416
475
  */
417
476
  export class ZappDocumentsCache extends SchemaDocumentCache {
418
- static cacheType: string;
477
+ static readonly cacheType = "zapp";
419
478
  protected static getInstance(): ZappDocumentsCache;
420
479
  protected static resetInstance(): void;
421
480
  /**
@@ -428,12 +487,19 @@ export class ZappDocumentsCache extends SchemaDocumentCache {
428
487
  */
429
488
  static getZappDocument(filePath: string): ZappDocumentInstance | undefined;
430
489
  /**
431
- * Asynchronously loads a zapp file from the path provided.
490
+ * Asynchronously loads a zapp file from the path provided. Replaces existing document in cache completely.
432
491
  * @param {string} filePath absolute path to the zapp file
492
+ * @param {string} workspacePath optional absolute path to workspace path; can be omitted if zapp is in top-level workspace directory
433
493
  * @returns {(Promise<ZappDocumentInstance | undefined>)} undefined if invalid path was provided.
434
494
  * In case of loading errors ZappDocumentInstance will contain error messages.
435
495
  */
436
- static loadZappDocument(filePath: string, workspacePath: string): Promise<ZappDocumentInstance | undefined>;
496
+ static loadZappDocument(filePath: string, workspacePath?: string): Promise<ZappDocumentInstance | undefined>;
497
+ /**
498
+ * Remove a ZAPP document from the cache.
499
+ * @param filePath absolute path to the zapp file
500
+ * @returns true if the document was found and remove; false if it was not found in the cache
501
+ */
502
+ static removeZappDocument(filePath: string): boolean;
437
503
  /**
438
504
  * Removes a document from the cache.
439
505
  * @param filePath absolute path to the zapp file
@@ -543,6 +609,7 @@ export const zappConstants: {
543
609
  profileTypeDbb: string;
544
610
  profileTypeRseApi: string;
545
611
  propertyPropertyGroups: string;
612
+ profileTypePreprocessor: string;
546
613
  };
547
614
  /**
548
615
  * A collection of business logic for accessing, manipulating, validating
@@ -600,5 +667,38 @@ export class RseApiController extends ZappProfilesController {
600
667
  */
601
668
  static loadRseApiSettings(workspacePath: string): Promise<RseapiSettingsItem | undefined>;
602
669
  }
670
+ /**
671
+ * A collection of business logic for accessing preprocessor profiles in ZAPP documents.
672
+ *
673
+ * Conventions used:
674
+ * - get methods are sync as they assume zapp is in cache
675
+ * - workspacePath is the path to the zapp file folder; not the absolute path the file
676
+ */
677
+ export class PreprocessorController extends ZappProfilesController {
678
+ /**
679
+ * @param {string} workspacePath Path to a folder in which a zapp file can be found
680
+ * @returns {(string[] | undefined)} Returns the list of all the profiles founds in a currently caches ZAPP file
681
+ */
682
+ static getPreprocessorProfileNames(workspacePath: string): string[] | undefined;
683
+ /**
684
+ * @param {string} workspacePath Path to a folder in which a zapp file can be found
685
+ * @returns {(string[] | undefined)} Returns the list of all the profiles founds in a currently caches ZAPP file based on location
686
+ */
687
+ static getPreprocessorProfileNamesBasedOnLocation(workspacePath: string, location: string): string[] | undefined;
688
+ /**
689
+ * Requires that the ZAPP file was already cached. If in doubt call loadPreprocessorSettings()
690
+ *
691
+ * @param {string} workspacePath Path to a folder in which a zapp file can be found
692
+ * @returns {(zapp.LocalPreprocessorSettingsItem | undefined)} Returns the settings specified for Local Preprocessor
693
+ */
694
+ static getLocalPreprocessorSettings(workspacePath: string): LocalPreprocessorSettingsItem | undefined;
695
+ /**
696
+ * Requires that the ZAPP file was already cached. If in doubt call loadPreprocessorSettings()
697
+ *
698
+ * @param {string} workspacePath Path to a folder in which a zapp file can be found
699
+ * @returns {(zapp.MvsPreprocessorSettingsItem | undefined)} Returns the settings specified for Remote Preprocessor
700
+ */
701
+ static getMvsPreprocessorSettings(workspacePath: string): MvsPreprocessorSettingsItem | undefined;
702
+ }
603
703
 
604
704
  //# sourceMappingURL=index.d.ts.map
package/lib/index.js CHANGED
@@ -1 +1,3 @@
1
- var e=require("fs"),t=require("yawn-yaml/cjs"),i=require("path"),s=require("os"),r=require("js-yaml"),a=require("ajv"),n=require("ajv-formats");function o(e,t){return Object.keys(t).forEach((function(i){"default"===i||"__esModule"===i||e.hasOwnProperty(i)||Object.defineProperty(e,i,{enumerable:!0,get:function(){return t[i]}})})),e}function p(e){return e&&e.__esModule?e.default:e}function c(e,t,i,s){Object.defineProperty(e,t,{get:i,set:s,enumerable:!0,configurable:!0})}var l={},d={},h={};c(h,"SchemaDocumentInstance",(()=>m));class m{isValid=!1;constructor(e,i){i&&this.prependErrorMessage(i);try{this.yawn=new(p(t))(e),this.validate()}catch(e){this.prependErrorMessage(e?.message)}}getAsYaml(){return this.yawn?.yaml}getAsJson(){return JSON.stringify(this.yawn?.json)}getAsObject(){return this.yawn?.json}static async readFileWithRetry(t){let i="";for(let s=0;s<10;s++){if(i=await e.promises.readFile(t,"utf8"),i)return i;await new Promise((e=>setTimeout(e,100)))}return i}write(){if(this.isValid){if(this.file?.path){let t="# Undefined "+this.type+" document.";"json"===this.file.type&&(t=JSON.stringify(this.getAsObject())),"yaml"===this.file.type&&(t=this.getAsYaml()||t),e.writeFileSync(this.file.path,t,{encoding:"utf-8"})}}else this.appendErrorMessage(`Tried to write invalid document "${this.file?.path}"`)}writeToFile(e){this.file=e,this.write()}appendErrorMessage(e){const t=this.errorMessages?`${this.errorMessages}\n`:"";this.errorMessages=`${t}- ${e||"Unknown Error reading "+this.type+" file."}`}prependErrorMessage(e){const t=this.errorMessages?`\n${this.errorMessages}`:"";this.errorMessages=`- ${e||"Unknown Error reading "+this.type+" file."}${t}`}}var u={};c(u,"SchemaDocumentCache",(()=>f));class f{constructor(e){this.type=e,this.documentsCache=new Map,this.workspacesMap=new Map,this.numberDocsAdded=0,this.numberDocsRemoved=0,this.numberDocsFound=0}addDocument(e,t,i){const s=this.normalizePath(e),r=this.normalizePath(t);this.documentsCache.set(s,i),this.workspacesMap.set(r,s)}getCacheSize(){return this.documentsCache.size}getAllDocumentLocations(){return[...this.documentsCache.keys()]}clearSchemaDocument(e){if(!e)return;const t=this.normalizePath(e),s=i.dirname(t);this.workspacesMap.has(s)&&this.workspacesMap.delete(s),this.documentsCache.has(t)&&(this.documentsCache.delete(t),this.numberDocsRemoved++)}clearCache(){this.workspacesMap.clear(),this.documentsCache.clear()}getCacheStats(){return{documentsCacheSize:this.documentsCache.size,workspacesMapSize:this.workspacesMap.size,numberDocsAdded:this.numberDocsAdded,numberDocsRemoved:this.numberDocsRemoved,numberDocsFound:this.numberDocsFound}}normalizePath(e){if(!e)return e;let t=i.normalize(e);if("win32"===s.platform()){const e=i.basename(t);if(this.isValidFilename(e)){const s=i.dirname(t);t=i.join(s.toUpperCase(),e)}else t=t.toUpperCase()}return t}}o(d,h),o(d,u),o(l,d);var g={},y={},b={};c(b,"PropertyGroupsController",(()=>D));var w={};c(w,"ZappDocumentsCache",(()=>P));var v={};c(v,"ZappDocumentInstance",(()=>S));var I;I=JSON.parse('{"$schema":"http://json-schema.org/draft-07/schema#","title":"IBM Zapp Document","description":"JSON schema for zapp.json and zapp.yaml files. Version 1.0.0 -- Licensed Materials - Property of IBM - (c) Copyright IBM Corporation 2022. All Rights Reserved.","type":"object","definitions":{"coreProperties":{"type":"object","required":["name"],"additionalProperties":false,"properties":{"name":{"description":"The name of the Z Project.","type":"string","maxLength":214,"minLength":1},"description":{"description":"This helps people understand your project as it would be used by tools.","type":"string"},"version":{"description":"Version is a string and it must be parsable for managing dependencies.","type":"string","default":"1.0.0"},"groupId":{"description":"Defines a group name that is shared for each application part in case of applications composed of multiple parts. Allows to uniquely identify the parts by concatenating with the artifact id. For example a groupId `com.ibm.wazi` with an artifactId `service` would create the unique application identifier `com.ibm.wazi.service`.","type":"string","examples":["com.ibm.wazi","payments"]},"artifactId":{"description":"Define id of the application artifact. Use it in combination with a groupId for multi-part applications.","type":"string","default":"","examples":["sam"]},"parentId":{"description":"In case of a multi-part application defines the name of the parent application part. This zapp will inherit properties such as propertyGroups defined in the parent.","type":"string","default":"","examples":["com.ibm.wazi.parent"]},"keywords":{"description":"This helps people discover your project.","type":"array","items":{"type":"string"}},"homepage":{"description":"The url to the project homepage.","type":"string","oneOf":[{"format":"uri"},{"enum":["."]}]},"license":{"type":"string","description":"You should specify a license for your package so that people know how they are permitted to use it and any restrictions you\'re placing on it."},"author":{"$ref":"#/definitions/person"},"contributors":{"description":"A list of people who contributed to this package.","type":"array","items":{"$ref":"#/definitions/person"},"minItems":1},"maintainers":{"description":"A list of people who maintain this package.","type":"array","items":{"$ref":"#/definitions/person"},"minItems":1},"propertyGroups":{"description":"A list properties defining path names for resolving dependencies.","type":"array","items":{"$ref":"#/definitions/propertyGroupItem"},"minItems":1},"profiles":{"description":"Profiles are additional groups of properties that should only should become valid under specific conditions such as running in a build job or as part of a debug session.","type":"array","items":{"$ref":"#/definitions/profile"},"minItems":1}}},"propertyGroupItem":{"type":"object","additionalProperties":false,"required":["name"],"properties":{"name":{"type":"string","description":"The name of the property group, which is used in hovers and error messages.","examples":["sample-local"]},"language":{"type":"string","enum":["cobol","pl1","hlasm","rexx","jcl"],"description":"Limits the property group to one specific language."},"compilerOptions":{"type":"string","description":"Global compiler options separated by a comma that impact the parsing of the programs for the editor. Requires that you specify a language. If there are multiple Property Groups for a language with compiler option then they will be concatenated."},"libraries":{"type":"array","description":"An array of potential library locations defining the search order for include files. Libraries with the name \'syslib\' will be handled as default include locations. The list can contain many entries of the type \'local\' or \'mvs\'. It can contain items of the same type twice in case, for example, you want to search in remote locations first, then some local location, and if still not found more remote locations.","items":{"$ref":"#/definitions/libraryItem"},"minItems":1}}},"libraryItem":{"type":"object","additionalProperties":false,"required":["name","type","locations"],"properties":{"name":{"type":"string","description":"Name of the library. The default name should be `syslib` if using unnamed libraries.","default":"syslib","examples":["syslib","currencylib"]},"type":{"type":"string","enum":["mvs","local"],"description":"The type of the property group defining where dependencies should be located. Allowed values are \'local\' for using a local workspace and \'mvs\' for dependencies located in MVS Datasets.","default":"local","examples":["local","mvs"]},"locations":{"type":"array","description":"An array of include file locations. For \'local\' libraries values can be absolute and relative filename paths using GLOB patterns. For \'mvs\' libraries value can be data set names. GLOB patterns for dat sets are currently not supported.","items":{"type":"string"},"minItems":1,"examples":["**/copybook","USER1.SAMPLE.COBCOPY"]}}},"person":{"description":"A person who has been involved in creating or maintaining this package","type":["object","string"],"required":["name"],"properties":{"name":{"type":"string"},"url":{"type":"string","format":"uri"},"email":{"type":"string","format":"email"}}},"profile":{"type":"object","description":"Profiles are additional groups of properties that should only should become valid under specific conditions such as running in a build job or as part of a debug session.","additionalProperties":false,"required":["name","type"],"properties":{"name":{"type":"string","description":"The name of the profile.","examples":["dbb-build"]},"type":{"type":"string","enum":["dbb","rseapi","debug"],"description":"The type of the profile.","default":"dbb","examples":["dbb","rseapi"]},"settings":{"description":"Settings objects specific to the type specified for the profile.","type":"object"}},"anyOf":[{"required":["name","type","settings"],"additionalProperties":false,"properties":{"name":{"type":"string"},"type":{"const":"dbb","type":"string"},"settings":{"$ref":"#/definitions/dbbSettingsItem"}}},{"required":["name","type","settings"],"additionalProperties":false,"properties":{"name":{"type":"string"},"type":{"const":"rseapi","type":"string"},"settings":{"$ref":"#/definitions/rseapiSettingsItem"}}}]},"dbbSettingsItem":{"type":"object","additionalProperties":false,"required":["application","command"],"description":"DBB build script properties for running User Build on remote host.","properties":{"application":{"type":"string","description":"Defines the name of the application to build. Will be used to create a folder on USS to upload all files to."},"command":{"type":"string","description":"Command that the build script is executed with such as the path to groovyz and it\'s parameters."},"buildScriptPath":{"type":"string","description":"The full path of build script on the remote host that should be used with the command."},"buildScriptArgs":{"type":"array","items":{"type":"string"},"description":"A list of strings that are the parameters for the build script. Check the documentation for built-in variables, such as the name of the program to build, that can be used here."},"additionalDependencies":{"type":"array","items":{"type":"string"},"description":"Lists of GLOB patterns that define the files that should be uploaded to USS for a build. Relative path names are interpreted relative to the location of the ZAPP file that is being used for the build, which is a ZAPP file in the same workspace as the program to be build."},"logFilePatterns":{"type":"array","items":{"type":"string"},"description":"Lists of GLOB patterns that define the files that should be downloaded from USS after the build. Relative path names are interpreted relative to the DBB log directory user setting. If not provided then all files of the user setting location will be downloaded."}}},"rseapiSettingsItem":{"type":"object","additionalProperties":false,"description":"RSE API client settings for interactions with a z/OS remote host running an RSE API server.","required":["mappings","default.encoding"],"properties":{"mappings":{"type":"array","description":"A list of mapping objects that map local file extensions to transfer modes and encodings to MVS datasets that can be specified using wildcards.","items":{"$ref":"#/definitions/rseapiSettingsItemMapping"}},"default.encoding":{"type":"string","description":"The encoding to be used when no mapping can be found. If not provided then either the user or server default will be used."}}},"rseapiSettingsItemMapping":{"type":"object","additionalProperties":false,"description":"One mapping that contains at least transfer and resource values.","properties":{"extension":{"type":"string","description":"A local file extension such as cbl or pl1."},"transfer":{"type":"string","enum":["text","binary"],"description":"The transfer mode to be used. Can be \'text\' or \'binary\'."},"resource":{"type":"string","description":"The data set name to be mapped to. Can use a wildcard such as \'**CPY\'."},"encoding":{"type":"string","description":"The encoding to be used for text transfer. See the RSE API documentation for the values allowed."},"memberMappings":{"type":"array","items":{"type":"object","additionalProperties":false,"description":"One member mapping that contains at least transfer and resource values.","properties":{"extension":{"type":"string","description":"A local file extension such as cbl or pl1."},"transfer":{"type":"string","enum":["text","binary"],"description":"The transfer mode to be used. Can be \'text\' or \'binary\'."},"encoding":{"type":"string","description":"The encoding to be used for text transfer. See the RSE API documentation for the values allowed."},"resource":{"type":"string","description":"The data set member name to be mapped to. Can use a wildcard such as \'**CPY\'."}}},"description":"A nested mappings array with resource mappings to members of the data sets that were mapped by the parent mapping."}}}},"anyOf":[{"$ref":"#/definitions/coreProperties"}]}');class S extends m{type="zapp";static validationFunction=S.initAjvValidator();static initAjvValidator(){const e=new(p(a))({allErrors:!0,strictTuples:!1,allowUnionTypes:!0});return p(n)(e),e.compile(I)}static createFromYamlString(e){return new S(e)}static createFromJsonString(e){let t="";try{const i=JSON.parse(e);return t=r.dump(i),this.createFromYamlString(t)}catch(e){return new S(t,e?.message||e)}}static createFromObject(e){return this.createFromJsonString(JSON.stringify(e))}static async createFromYamlFile(e){let t="";try{t=await this.readFileWithRetry(e);const i=this.createFromYamlString(t);return i.file={path:e,type:"yaml"},i}catch(e){return new S(t,e?.message||e)}}static async createFromJsonFile(e){let t="";try{t=await this.readFileWithRetry(e);const i=this.createFromJsonString(t);return i.file={path:e,type:"json"},i}catch(e){return new S(t,e?.message||e)}}static async createFromFile(e){return e?.endsWith(".yaml")||e?.endsWith(".yml")?await this.createFromYamlFile(e):e?.endsWith(".json")?await this.createFromJsonFile(e):new S("","Invalid filename for reading a ZAPP file.")}static async loadFromWorkspace(e){const t=this.findZappFile(e);return"yaml"===t?.type?await this.createFromYamlFile(t.path):"json"===t?.type?await this.createFromJsonFile(t.path):new S("",`No ZAPP file was found in "${e}".`)}static findZappFile(t){if(!t)return;const s=i.normalize(t),r=i.join(s,"zapp.yaml");if(e.existsSync(r))return{path:r,type:"yaml"};const a=i.join(s,"zapp.yml");if(e.existsSync(a))return{path:a,type:"yaml"};const n=i.join(s,"zapp.json");return e.existsSync(n)?{path:n,type:"json"}:void 0}static isZappFileName(e){return/^(zapp\.)(yml|yaml|json)$/.test(e)}getVariables(){let e=[];const t=this.getAsYaml();if(t){const i=t.match(/\${.*?}/g);i&&(e=[...new Set(i)],e=e.map((e=>e.replace(/[${}]/g,""))))}return e}getAsDocument(){try{const e=this.yawn.json;if(e)return e}catch(e){this.prependErrorMessage(e?.message)}}validate(){if(this.yawn){if(this.isValid=S.validationFunction(this.getAsObject()),!this.isValid){const e=S.validationFunction.errors;return e?e.forEach((e=>{let t=e.message;if(e.params){const i=e.params;t=`${t}(${Object.keys(i).map((e=>`${e}:${i[e]}`))})`}this.appendErrorMessage(t)})):this.appendErrorMessage("Unknown validation error."),!1}return!0}return!1}}class P extends f{static cacheType="zapp";static getInstance(){return this.instance||(this.instance=new P(this.cacheType)),this.instance}static resetInstance(){this.instance=void 0}static getZappDocument(e){if(!e)return;const t=this.getInstance().normalizePath(e);return this.getInstance().documentsCache.has(t)?(this.getInstance().numberDocsFound++,this.getInstance().documentsCache.get(t)):void 0}static async loadZappDocument(e,t){if(!e)return;const i=this.getInstance().normalizePath(e);if(this.getInstance().documentsCache.has(i))return this.getInstance().numberDocsFound++,this.getInstance().documentsCache.get(i);const s=await S.createFromFile(i);return this.getInstance().addDocument(e,t,s),this.getInstance().numberDocsAdded++,s}static clearZappDocument(e){this.getInstance().clearSchemaDocument(e)}static getZappDocumentInWorkspace(e){if(!e)return;const t=this.getInstance().normalizePath(e),i=this.getInstance().workspacesMap.get(t);return i?this.getZappDocument(i):void 0}static async loadZappDocumentInWorkspace(e){const t=this.getInstance().normalizePath(e),i=S.findZappFile(t);if(i){const s=await this.loadZappDocument(i.path,e);return this.getInstance().workspacesMap.set(t,i.path),s}}isValidFilename(e){return S.isZappFileName(e)}static getVariablesFromAllDocs(){let e=[];for(const t of this.getInstance().documentsCache.values())t instanceof S&&e.push(...t.getVariables());return e.length>1&&(e=[...new Set(e)]),e}static getCacheSize(){return this.getInstance().getCacheSize()}static getAllDocumentLocations(){return this.getInstance().getAllDocumentLocations()}static getCacheStats(){return this.getInstance().getCacheStats()}static clearCache(){this.getInstance().clearCache(),this.resetInstance()}}var A={};c(A,"ZappUserVariablesCache",(()=>j));class j{zappUserSettingsMap=new Map;static getInstance(){return this.instance||(this.instance=new j),this.instance}static resetInstance(){this.instance=void 0}static saveZappUserVariables(e){j.getInstance().zappUserSettingsMap=e}static getZappUserVariables(){return j.getInstance().zappUserSettingsMap}static clearCache(){j.getInstance().zappUserSettingsMap.clear(),this.resetInstance()}static replaceUserVariables(e){if(!e)return;const t=JSON.stringify(e),i=j.getZappUserVariables();if(!i)return e;const s=t.replace(/\${.*?\}/g,(e=>{const t=e.slice(2,-1),s=i.get(t)||e;return t.replace(t,s)}));try{return JSON.parse(s)}catch(t){return e}}}class D{static getPropertyGroups(e,t){let i=[];const s=P.getZappDocumentInWorkspace(e);if(s&&!s.errorMessages){const e=s.getAsDocument();if(e){const s=e.propertyGroups;s&&(i=s,t&&(i=s.filter((e=>!e.language||e.language===t))))}}return j.replaceUserVariables(i)}}var F={};c(F,"UserBuildController",(()=>x));var C={};c(C,"ZappProfilesController",(()=>M));class M{static getZappProfiles(e){const t=P.getZappDocumentInWorkspace(e);if(!t||t.errorMessages)return;const i=t.getAsDocument();return i&&i.profiles&&0!==i.profiles.length?i.profiles:void 0}static async loadZappProfiles(e){if(await P.loadZappDocumentInWorkspace(e))return this.getZappProfiles(e)}}var z={};c(z,"zappConstants",(()=>Z));const Z={profileTypeDbb:"dbb",profileTypeRseApi:"rseapi",propertyPropertyGroups:"propertyGroups"};class x extends M{static getUserBuildProfileNames(e){const t=this.getZappProfiles(e);if(t&&t.length>0)return t.filter((e=>e.type===Z.profileTypeDbb)).map((e=>e.name))}static getUserBuildSettings(e,t){const i=this.getZappProfiles(e);if(i&&i.length>0){if(!t){const e=i.find((e=>e.type===Z.profileTypeDbb));return j.replaceUserVariables(e?.settings)}{const e=i.find((e=>e.name===t));if(e?.type===Z.profileTypeDbb)return j.replaceUserVariables(e.settings)}}}}var T={};c(T,"RseApiController",(()=>k));class k extends M{static getRseApiProfileNames(e){const t=this.getZappProfiles(e);if(t&&t.length>0)return t.filter((e=>e.type===Z.profileTypeRseApi)).map((e=>e.name))}static onlyOneMappingsEntry(e){return 1===this.getRseApiProfileNames(e)?.length}static getRseApiSettings(e){const t=this.getZappProfiles(e);if(t&&t.length>0){const e=t.find((e=>e.type===Z.profileTypeRseApi));return j.replaceUserVariables(e?.settings)}}static async loadRseApiSettings(e){if(await this.loadZappProfiles(e))return this.getRseApiSettings(e)}}o(y,b),o(y,F),o(y,T),o(y,C);var O={};o(O,{}),o(O,v),o(O,w),o(O,z),o(O,A),o(g,y),o(g,O),o(module.exports,l),o(module.exports,g);
1
+ var e=require("fs"),t=require("yawn-yaml/cjs"),i=require("path"),s=require("os"),r=require("js-yaml"),a=require("ajv"),n=require("ajv-formats");function o(e,t){return Object.keys(t).forEach(function(i){"default"===i||"__esModule"===i||Object.prototype.hasOwnProperty.call(e,i)||Object.defineProperty(e,i,{enumerable:!0,get:function(){return t[i]}})}),e}function p(e){return e&&e.__esModule?e.default:e}function l(e,t,i,s){Object.defineProperty(e,t,{get:i,set:s,enumerable:!0,configurable:!0})}var c={},d={},h={};l(h,"SchemaDocumentInstance",()=>m);class m{constructor(e,i){this.isValid=!1,i&&this.prependErrorMessage(i);try{this.yawn=new(p(t))(e),this.validate()}catch(e){this.prependErrorMessage(e?.message)}}getAsYaml(){return this.yawn?.yaml}getAsJson(){return JSON.stringify(this.yawn?.json)}getAsObject(){return this.yawn?.json}static async readFileWithRetry(t){let i="";for(let s=0;s<10&&!(i=await e.promises.readFile(t,"utf8"));s++)await new Promise(e=>setTimeout(e,100));return i}write(){if(!this.isValid){this.appendErrorMessage(`Tried to write invalid document "${this.file?.path}"`);return}if(this.file?.path){let t="# Undefined "+this.type+" document.";"json"===this.file.type&&(t=JSON.stringify(this.getAsObject())),"yaml"===this.file.type&&(t=this.getAsYaml()||t),e.writeFileSync(this.file.path,t,{encoding:"utf-8"})}}writeToFile(e){this.file=e,this.write()}appendErrorMessage(e){let t=this.errorMessages?`${this.errorMessages}
2
+ `:"";this.errorMessages=`${t}- ${e||"Unknown Error reading "+this.type+" file."}`}prependErrorMessage(e){let t=this.errorMessages?`
3
+ ${this.errorMessages}`:"";this.errorMessages=`- ${e||"Unknown Error reading "+this.type+" file."}${t}`}}var u={};l(u,"SchemaDocumentCache",()=>f);class f{constructor(e){this.type=e,this.documentsCache=new Map,this.workspacesMap=new Map,this.numberDocsAdded=0,this.numberDocsRemoved=0,this.numberDocsFound=0}addDocument(e,t,i){let s=this.normalizePath(e),r=this.normalizePath(t);this.documentsCache.set(s,i),this.workspacesMap.set(r,s)}removeDocument(e){let t=this.normalizePath(e);this.workspacesMap.forEach((e,i)=>{e===t&&this.workspacesMap.delete(i)});let i=this.documentsCache.delete(t);return i&&this.numberDocsRemoved++,i}getCacheSize(){return this.documentsCache.size}getAllDocumentLocations(){return[...this.documentsCache.keys()]}clearSchemaDocument(e){if(!e)return;let t=this.normalizePath(e),s=i.dirname(t);this.workspacesMap.has(s)&&this.workspacesMap.delete(s),this.documentsCache.has(t)&&(this.documentsCache.delete(t),this.numberDocsRemoved++)}clearCache(){this.workspacesMap.clear(),this.documentsCache.clear()}getCacheStats(){return{documentsCacheSize:this.documentsCache.size,workspacesMapSize:this.workspacesMap.size,numberDocsAdded:this.numberDocsAdded,numberDocsRemoved:this.numberDocsRemoved,numberDocsFound:this.numberDocsFound}}normalizePath(e){if(!e)return e;let t=i.normalize(e);if("win32"===s.platform()){let e=i.basename(t);if(this.isValidFilename(e)){let s=i.dirname(t);t=i.join(s.toUpperCase(),e)}else t=t.toUpperCase()}return t}}o(d,h),o(d,u),o(c,d);var g={},y={},b={};l(b,"PropertyGroupsController",()=>j);var w={};l(w,"ZappDocumentsCache",()=>I);var P={};l(P,"ZappDocumentInstance",()=>S);var v={};v=JSON.parse('{"$schema":"http://json-schema.org/draft-07/schema#","title":"IBM Zapp Document","description":"JSON schema for zapp.json and zapp.yaml files. Version 1.1.0 -- Licensed Materials - Property of IBM - (c) Copyright IBM Corporation 2022, 2023. All Rights Reserved.","type":"object","definitions":{"coreProperties":{"type":"object","required":["name"],"additionalProperties":false,"properties":{"name":{"description":"The name of the Z Project.","type":"string","maxLength":214,"minLength":1},"description":{"description":"This helps people understand your project as it would be used by tools.","type":"string"},"version":{"description":"Version is a string and it must be parsable for managing dependencies.","type":"string","default":"1.0.0"},"groupId":{"description":"Defines a group name that is shared for each application part in case of applications composed of multiple parts. Allows to uniquely identify the parts by concatenating with the artifact id. For example a groupId `com.ibm.wazi` with an artifactId `service` would create the unique application identifier `com.ibm.wazi.service`.","type":"string","examples":["com.ibm.wazi","payments"]},"artifactId":{"description":"Define id of the application artifact. Use it in combination with a groupId for multi-part applications.","type":"string","default":"","examples":["sam"]},"parentId":{"description":"In case of a multi-part application defines the name of the parent application part. This zapp will inherit properties such as propertyGroups defined in the parent.","type":"string","default":"","examples":["com.ibm.wazi.parent"]},"keywords":{"description":"This helps people discover your project.","type":"array","items":{"type":"string"}},"homepage":{"description":"The url to the project homepage.","type":"string","oneOf":[{"format":"uri"},{"enum":["."]}]},"license":{"type":"string","description":"You should specify a license for your package so that people know how they are permitted to use it and any restrictions you\'re placing on it."},"author":{"$ref":"#/definitions/person"},"contributors":{"description":"A list of people who contributed to this package.","type":"array","items":{"$ref":"#/definitions/person"},"minItems":1},"maintainers":{"description":"A list of people who maintain this package.","type":"array","items":{"$ref":"#/definitions/person"},"minItems":1},"propertyGroups":{"description":"A list of properties defining path names for resolving dependencies.","type":"array","items":{"$ref":"#/definitions/propertyGroupItem"},"minItems":1},"profiles":{"description":"Profiles are additional groups of properties that should only should become valid under specific conditions such as running in a build job or as part of a debug session.","type":"array","items":{"$ref":"#/definitions/profile"},"minItems":1}}},"propertyGroupItem":{"type":"object","additionalProperties":false,"required":["name"],"properties":{"name":{"type":"string","description":"The name of the property group, which is used in hovers and error messages.","examples":["sample-local","sample-remote"]},"language":{"type":"string","enum":["cobol","pl1","hlasm","rexx","jcl"],"description":"Limits the property group to one specific language."},"compilerOptions":{"type":"string","description":"Global compiler options separated by a comma that impact the parsing of the programs for the editor. Requires that you specify a language. If there are multiple Property Groups for a language with compiler option then they will be concatenated."},"libraries":{"type":"array","description":"An array of potential library locations defining the search order for include files. Libraries with the name \'syslib\' will be handled as default include locations. The list can contain many entries of the type \'local\' or \'mvs\'. It can contain items of the same type twice in case, for example, you want to search in remote locations first, then some local location, and if still not found more remote locations.","items":{"$ref":"#/definitions/libraryItem"},"minItems":1}}},"libraryItem":{"type":"object","additionalProperties":false,"required":["name","type","locations"],"properties":{"name":{"type":"string","description":"Name of the library. The default name should be `syslib` if using unnamed libraries.","default":"syslib","examples":["syslib","currencylib"]},"type":{"type":"string","enum":["mvs","local"],"description":"The type of the property group defining where dependencies should be located. Allowed values are \'local\' for using a local workspace and \'mvs\' for dependencies located in MVS Datasets.","default":"local","examples":["local","mvs"]},"locations":{"type":"array","description":"An array of include file locations. For \'local\' libraries values can be absolute and relative filename paths using GLOB patterns. For \'mvs\' libraries value can be data set names. GLOB patterns for data sets are currently not supported.","items":{"type":"string"},"minItems":1,"examples":["**/copybook","USER1.SAMPLE.COBCOPY"]}}},"person":{"description":"A person who has been involved in creating or maintaining this package","type":["object","string"],"required":["name"],"properties":{"name":{"type":"string"},"url":{"type":"string","format":"uri"},"email":{"type":"string","format":"email"}}},"profile":{"type":"object","description":"Profiles are additional groups of properties that should only should become valid under specific conditions such as running in a build job or as part of a debug session.","additionalProperties":false,"required":["name","type"],"properties":{"name":{"type":"string","description":"The name of the profile.","examples":["dbb-build"]},"type":{"type":"string","enum":["dbb","rseapi","debug","preprocessor"],"description":"The type of the profile.","default":"dbb","examples":["dbb","rseapi","preprocessor"]},"location":{"type":"string","enum":["mvs","local"],"description":"A string of include file locations. For \'local\' libraries values can be absolute and relative filename paths using GLOB patterns. For \'mvs\' libraries value can be data set names. GLOB patterns for dat sets are currently not supported.","examples":["**/copybook","USER1.SAMPLE.COBCOPY"]},"settings":{"description":"Settings objects specific to the type specified for the profile.","type":"object"}},"anyOf":[{"required":["name","type","settings"],"additionalProperties":false,"properties":{"name":{"type":"string"},"type":{"const":"dbb","type":"string"},"settings":{"$ref":"#/definitions/dbbSettingsItem"}}},{"required":["name","type","settings"],"additionalProperties":false,"properties":{"name":{"type":"string"},"type":{"const":"rseapi","type":"string"},"settings":{"$ref":"#/definitions/rseapiSettingsItem"}}},{"required":["name","type","settings","location"],"additionalProperties":false,"properties":{"name":{"type":"string"},"type":{"const":"preprocessor","type":"string"},"location":{"const":"local","type":"string"},"settings":{"$ref":"#/definitions/localPreprocessorSettingsItem"}}},{"required":["name","type","settings","location"],"additionalProperties":false,"properties":{"name":{"type":"string"},"type":{"const":"preprocessor","type":"string"},"location":{"const":"mvs","type":"string"},"settings":{"$ref":"#/definitions/mvsPreprocessorSettingsItem"}}}]},"dbbSettingsItem":{"type":"object","additionalProperties":false,"required":["application","command"],"description":"DBB build script properties for running User Build on remote host.","properties":{"application":{"type":"string","description":"Defines the name of the application to build. Will be used to create a folder on USS to upload all files to."},"command":{"type":"string","description":"Command that the build script is executed with such as the path to groovyz and it\'s parameters."},"buildScriptPath":{"type":"string","description":"The full path of build script on the remote host that should be used with the command."},"buildScriptArgs":{"type":"array","items":{"type":"string"},"description":"A list of strings that are the parameters for the build script. Check the documentation for built-in variables, such as the name of the program to build, that can be used here."},"additionalDependencies":{"type":"array","items":{"type":"string"},"description":"Lists of GLOB patterns that define the files that should be uploaded to USS for a build. Relative path names are interpreted relative to the location of the ZAPP file that is being used for the build, which is a ZAPP file in the same workspace as the program to be build."},"logFilePatterns":{"type":"array","items":{"type":"string"},"description":"Lists of GLOB patterns that define the files that should be downloaded from USS after the build. Relative path names are interpreted relative to the DBB log directory user setting. If not provided then all files of the user setting location will be downloaded."}}},"rseapiSettingsItem":{"type":"object","additionalProperties":false,"description":"RSE API client settings for interactions with a z/OS remote host running an RSE API server.","required":["mappings","default.encoding"],"properties":{"mappings":{"type":"array","description":"A list of mapping objects that map local file extensions to transfer modes and encodings to MVS datasets that can be specified using wildcards.","items":{"$ref":"#/definitions/rseapiSettingsItemMapping"}},"default.encoding":{"type":"string","description":"The encoding to be used when no mapping can be found. If not provided then either the user or server default will be used."}}},"rseapiSettingsItemMapping":{"type":"object","additionalProperties":false,"description":"One mapping that contains at least transfer and resource values.","properties":{"extension":{"type":"string","description":"A local file extension such as cbl or pl1."},"transfer":{"type":"string","enum":["text","binary"],"description":"The transfer mode to be used. Can be \'text\' or \'binary\'."},"resource":{"type":"string","description":"The data set name to be mapped to. Can use a wildcard such as \'**CPY\'."},"encoding":{"type":"string","description":"The encoding to be used for text transfer. See the RSE API documentation for the values allowed."},"memberMappings":{"type":"array","items":{"type":"object","additionalProperties":false,"description":"One member mapping that contains at least transfer and resource values.","properties":{"extension":{"type":"string","description":"A local file extension such as cbl or pl1."},"transfer":{"type":"string","enum":["text","binary"],"description":"The transfer mode to be used. Can be \'text\' or \'binary\'."},"encoding":{"type":"string","description":"The encoding to be used for text transfer. See the RSE API documentation for the values allowed."},"resource":{"type":"string","description":"The data set member name to be mapped to. Can use a wildcard such as \'**CPY\'."}}},"description":"A nested mappings array with resource mappings to members of the data sets that were mapped by the parent mapping."}}},"localPreprocessorSettingsItem":{"type":"object","additionalProperties":false,"description":"Preprocessor properties for preprocessing COBOL/PL/I files.","required":["command","outputPath","fileExtension"],"properties":{"command":{"type":"string","description":"The command to run to execute the preprocessor executable."},"outputPath":{"type":"string","description":"Path where preprocessor produces its build output."},"fileExtension":{"type":"string","description":"The desired file extension for the post-processed file."},"environmentVariables":{"type":"object","additionalProperties":false,"description":"Specifies any user defined environment variables to be passed to the preprocessor.","patternProperties":{"[a-zA-Z_][a-zA-Z0-9_]*":{"anyOf":[{"type":"string"}]}}}}},"mvsPreprocessorSettingsItem":{"type":"object","additionalProperties":false,"description":"Preprocessor properties for preprocessing COBOL/PL/I files.","required":["commandDataSet","commandParameters","outputDataSet","tempDataHLQ"],"properties":{"commandDataSet":{"type":"string","description":"Specifies an input listing sequential data set."},"commandParameters":{"type":"string","description":"The parameters for the command being run."},"outputDataSet":{"type":"string","description":"Specifies an output listing sequential data set."},"tempDataHLQ":{"type":"string","description":"Specifies the high-level qualifier used for data sets created by plug-in requests to export observation files."}}}},"anyOf":[{"$ref":"#/definitions/coreProperties"}]}');class S extends m{static #e=this.validationFunction=S.initAjvValidator();static initAjvValidator(){let e=new(p(a))({allErrors:!0,strictTuples:!1,allowUnionTypes:!0});return p(n)(e),e.compile(v)}static createFromYamlString(e){return new S(e)}static createFromJsonString(e){let t="";try{let i=JSON.parse(e);return t=r.dump(i),this.createFromYamlString(t)}catch(e){return new S(t,e?.message||e)}}static createFromObject(e){return this.createFromJsonString(JSON.stringify(e))}static async createFromYamlFile(e){let t="";try{t=await this.readFileWithRetry(e);let i=this.createFromYamlString(t);return i.file={path:e,type:"yaml"},i}catch(e){return new S(t,e?.message||e)}}static async createFromJsonFile(e){let t="";try{t=await this.readFileWithRetry(e);let i=this.createFromJsonString(t);return i.file={path:e,type:"json"},i}catch(e){return new S(t,e?.message||e)}}static async createFromFile(e){return e?.endsWith(".yaml")||e?.endsWith(".yml")?await this.createFromYamlFile(e):e?.endsWith(".json")?await this.createFromJsonFile(e):new S("","Invalid filename for reading a ZAPP file.")}static async loadFromWorkspace(e){let t=this.findZappFile(e);return t?.type==="yaml"?await this.createFromYamlFile(t.path):t?.type==="json"?await this.createFromJsonFile(t.path):new S("",`No ZAPP file was found in "${e}".`)}static findZappFile(t){if(!t)return;let s=i.normalize(t),r=i.join(s,"zapp.yaml");if(e.existsSync(r))return{path:r,type:"yaml"};let a=i.join(s,"zapp.yml");if(e.existsSync(a))return{path:a,type:"yaml"};let n=i.join(s,"zapp.json");if(e.existsSync(n))return{path:n,type:"json"}}static isZappFileName(e){return/^(zapp\.)(yml|yaml|json)$/.test(e)}getVariables(){let e=[],t=this.getAsYaml();if(t){let i=t.match(/\${.*?}/g);i&&(e=(e=[...new Set(i)]).map(e=>e.replace(/[${}]/g,"")))}return e}getAsDocument(){try{let e=this.yawn.json;if(e)return e}catch(e){this.prependErrorMessage(e?.message)}}validate(){if(this.yawn){if(this.isValid=S.validationFunction(this.getAsObject()),!this.isValid){let e=S.validationFunction.errors;return e?e.forEach(e=>{let t=e.message;if(e.params){let i=e.params,s=Object.keys(i).map(e=>`${e}:${i[e]}`);t=`${t}(${s})`}this.appendErrorMessage(t)}):this.appendErrorMessage("Unknown validation error."),!1}return!0}return!1}constructor(...e){super(...e),this.type="zapp"}}class I extends f{static #e=this.cacheType="zapp";static getInstance(){return this.instance||(this.instance=new I(this.cacheType)),this.instance}static resetInstance(){this.instance=void 0}static getZappDocument(e){if(!e)return;let t=this.getInstance().normalizePath(e);if(this.getInstance().documentsCache.has(t))return this.getInstance().numberDocsFound++,this.getInstance().documentsCache.get(t)}static async loadZappDocument(e,t){if(!e)return;let s=this.getInstance().normalizePath(e),r=await S.createFromFile(s),a=t;return t||(a=i.dirname(s)),this.getInstance().addDocument(e,a,r),this.getInstance().numberDocsAdded++,r}static removeZappDocument(e){return this.getInstance().removeDocument(e)}static clearZappDocument(e){this.getInstance().clearSchemaDocument(e)}static getZappDocumentInWorkspace(e){if(!e)return;let t=this.getInstance().normalizePath(e),i=this.getInstance().workspacesMap.get(t);if(i)return this.getZappDocument(i)}static async loadZappDocumentInWorkspace(e){let t=this.getInstance().normalizePath(e),i=S.findZappFile(t);if(i){let s=await this.loadZappDocument(i.path,e);return this.getInstance().workspacesMap.set(t,i.path),s}}isValidFilename(e){return S.isZappFileName(e)}static getVariablesFromAllDocs(){let e=[];for(let t of this.getInstance().documentsCache.values())t instanceof S&&e.push(...t.getVariables());return e.length>1&&(e=[...new Set(e)]),e}static getCacheSize(){return this.getInstance().getCacheSize()}static getAllDocumentLocations(){return this.getInstance().getAllDocumentLocations()}static getCacheStats(){return this.getInstance().getCacheStats()}static clearCache(){this.getInstance().clearCache(),this.resetInstance()}}var D={};l(D,"ZappUserVariablesCache",()=>A);class A{static getInstance(){return this.instance||(this.instance=new A),this.instance}static resetInstance(){this.instance=void 0}static saveZappUserVariables(e){A.getInstance().zappUserSettingsMap=e,A.getInstance().zappUserSettingsMap.forEach((e,t)=>{if(e.includes(p(i).win32.sep)){let s=e.split(p(i).win32.sep).join(p(i).posix.sep);A.getInstance().zappUserSettingsMap.set(t,s)}})}static getZappUserVariables(){return A.getInstance().zappUserSettingsMap}static clearCache(){A.getInstance().zappUserSettingsMap.clear(),this.resetInstance()}static replaceUserVariables(e){if(!e)return;let t=JSON.stringify(e),i=A.getZappUserVariables();if(!i||0===i.size)return e;let s=t.replace(/\${.*?\}/g,e=>{let t=e.slice(2,-1),s=i.get(t)??e;return t.replace(t,s)});try{return JSON.parse(s)}catch(t){return e}}constructor(){this.zappUserSettingsMap=new Map}}class j{static getPropertyGroups(e,t){let i=[],s=I.getZappDocumentInWorkspace(e);if(s&&!s.errorMessages){let e=s.getAsDocument();if(e){let s=e.propertyGroups;s&&(i=s,t&&(i=s.filter(e=>!e.language||e.language===t)))}}return A.replaceUserVariables(i)}}var F={};l(F,"UserBuildController",()=>Z);var M={};l(M,"ZappProfilesController",()=>C);class C{static getZappProfiles(e){let t=I.getZappDocumentInWorkspace(e);if(!t||t.errorMessages)return;let i=t.getAsDocument();if(i&&i.profiles&&0!==i.profiles.length)return i.profiles}static async loadZappProfiles(e){if(await I.loadZappDocumentInWorkspace(e))return this.getZappProfiles(e)}}var x={};l(x,"zappConstants",()=>z);const z={profileTypeDbb:"dbb",profileTypeRseApi:"rseapi",propertyPropertyGroups:"propertyGroups",profileTypePreprocessor:"preprocessor"};class Z extends C{static getUserBuildProfileNames(e){let t=this.getZappProfiles(e);if(t&&t.length>0)return t.filter(e=>e.type===z.profileTypeDbb).map(e=>e.name)}static getUserBuildSettings(e,t){let i=this.getZappProfiles(e);if(i&&i.length>0){if(t){let e=i.find(e=>e.name===t);if(e?.type===z.profileTypeDbb)return A.replaceUserVariables(e.settings)}else{let e=i.find(e=>e.type===z.profileTypeDbb);return A.replaceUserVariables(e?.settings)}}}}var O={};l(O,"RseApiController",()=>T);class T extends C{static getRseApiProfileNames(e){let t=this.getZappProfiles(e);if(t&&t.length>0)return t.filter(e=>e.type===z.profileTypeRseApi).map(e=>e.name)}static onlyOneMappingsEntry(e){let t=this.getRseApiProfileNames(e);return t?.length===1}static getRseApiSettings(e){let t=this.getZappProfiles(e);if(t&&t.length>0){let e=t.find(e=>e.type===z.profileTypeRseApi);return A.replaceUserVariables(e?.settings)}}static async loadRseApiSettings(e){if(await this.loadZappProfiles(e))return this.getRseApiSettings(e)}}var k={};l(k,"PreprocessorController",()=>U);class U extends C{static getPreprocessorProfileNames(e){let t=this.getZappProfiles(e);if(t&&t.length>0)return t.filter(e=>e.type===z.profileTypePreprocessor).map(e=>e.name)}static getPreprocessorProfileNamesBasedOnLocation(e,t){let i=this.getZappProfiles(e);if(i&&i.length>0)return i.filter(e=>e.type===z.profileTypePreprocessor&&"location"in e&&e.location===t).map(e=>e.name)}static getLocalPreprocessorSettings(e){let t=this.getZappProfiles(e);if(t&&t.length>0){let e=t.find(e=>e.type===z.profileTypePreprocessor&&"location"in e&&"local"===e.location);return A.replaceUserVariables(e?.settings)}}static getMvsPreprocessorSettings(e){let t=this.getZappProfiles(e);if(t&&t.length>0){let e=t.find(e=>e.type===z.profileTypePreprocessor&&"location"in e&&"mvs"===e.location);return A.replaceUserVariables(e?.settings)}}}o(y,b),o(y,F),o(y,O),o(y,M),o(y,k);var $={};o($,{}),o($,P),o($,w),o($,x),o($,D),o(g,y),o(g,$),o(module.exports,c),o(module.exports,g);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ibm/zapp-core",
3
- "version": "1.0.4",
3
+ "version": "1.1.0",
4
4
  "description": "IBM ZAPP parser and core utilities",
5
5
  "publisher": "IBM",
6
6
  "license": "SEE LICENSE IN LICENSE.txt",
@@ -20,34 +20,33 @@
20
20
  "yawn-yaml": "1.5.0"
21
21
  },
22
22
  "devDependencies": {
23
- "@parcel/packager-ts": "^2.8.3",
24
- "@parcel/transformer-typescript-types": "^2.8.3",
25
- "@types/jest": "^29.4.1",
23
+ "@parcel/packager-ts": "^2.11.0",
24
+ "@parcel/transformer-typescript-types": "^2.11.0",
25
+ "@types/jest": "^29.5.10",
26
26
  "@types/js-yaml": "4.0.5",
27
- "@types/node": "^16.11.7",
28
- "@types/tmp": "0.2.3",
27
+ "@types/node": "18.x",
28
+ "@types/tmp": "0.2.6",
29
29
  "@types/yawn-yaml": "1.4.0",
30
- "@typescript-eslint/eslint-plugin": "^5.55.0",
31
- "@typescript-eslint/parser": "^5.55.0",
32
- "concurrently": "^7.6.0",
30
+ "@typescript-eslint/eslint-plugin": "^6.13.0",
31
+ "@typescript-eslint/parser": "^6.13.0",
32
+ "concurrently": "^8.2.2",
33
33
  "copyfiles": "^2.4.1",
34
- "eslint": "8.36.0",
35
- "eslint-config-prettier": "8.7.0",
36
- "eslint-plugin-prettier": "4.2.1",
37
- "jest": "^29.5.0",
38
- "jest-cli": "^29.5.0",
39
- "jest-junit": "^15.0.0",
34
+ "eslint": "8.54.0",
35
+ "eslint-config-prettier": "9.0.0",
36
+ "eslint-plugin-prettier": "5.0.1",
37
+ "jest": "^29.7.0",
38
+ "jest-cli": "^29.7.0",
39
+ "jest-junit": "^16.0.0",
40
40
  "jest-sonar-reporter": "^2.0.0",
41
- "jest-stare": "^2.5.0",
41
+ "jest-stare": "^2.5.1",
42
42
  "json-schema-to-typescript": "10.1.0",
43
43
  "madge": "^6.1.0",
44
- "npm": "^9.8.1",
45
- "parcel": "^2.8.3",
46
- "prettier": "2.8.4",
44
+ "parcel": "^2.11.0",
45
+ "prettier": "3.1.0",
47
46
  "rimraf": "^4.1.2",
48
47
  "tmp": "0.2.1",
49
- "ts-jest": "^29.0.5",
50
- "typescript": "^4.9.5"
48
+ "ts-jest": "^29.1.1",
49
+ "typescript": "^5.3.2"
51
50
  },
52
51
  "overrides": {
53
52
  "semver": "^7.5.3",
@@ -57,6 +56,9 @@
57
56
  "inlineFS": false,
58
57
  "inlineEnvironment": false
59
58
  },
59
+ "@parcel/resolver-default": {
60
+ "packageExports": true
61
+ },
60
62
  "targets": {
61
63
  "main": {
62
64
  "optimize": true,
@@ -66,7 +68,7 @@
66
68
  "scripts": {
67
69
  "prebuild": "npm run build:resources",
68
70
  "build": "tsc --pretty && npm run checkDeps && npm run lintErrors",
69
- "build:resources": "copyfiles -f ../../schema/*-schema-*.json ./resources",
71
+ "build:resources": "copyfiles -f ../../schema/*-schema-1.1.0.json ./resources",
70
72
  "build:version": "npm version --new-version $npm_package_version-`date '+%Y%m%d%H%M'`-`git rev-parse --short HEAD` --no-git-tag-version",
71
73
  "build:package": "npm run clean && parcel build",
72
74
  "build:test": "npm run clean && npm run build && npm run test",
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "$schema": "http://json-schema.org/draft-07/schema#",
3
3
  "title": "IBM Zapp Document",
4
- "description": "JSON schema for zapp.json and zapp.yaml files. Version 1.0.0 -- Licensed Materials - Property of IBM - (c) Copyright IBM Corporation 2022. All Rights Reserved.",
4
+ "description": "JSON schema for zapp.json and zapp.yaml files. Version 1.1.0 -- Licensed Materials - Property of IBM - (c) Copyright IBM Corporation 2022, 2023. All Rights Reserved.",
5
5
  "type": "object",
6
6
  "definitions": {
7
7
  "coreProperties": {
@@ -84,7 +84,7 @@
84
84
  "minItems": 1
85
85
  },
86
86
  "propertyGroups": {
87
- "description": "A list properties defining path names for resolving dependencies.",
87
+ "description": "A list of properties defining path names for resolving dependencies.",
88
88
  "type": "array",
89
89
  "items": {
90
90
  "$ref": "#/definitions/propertyGroupItem"
@@ -109,7 +109,7 @@
109
109
  "name": {
110
110
  "type": "string",
111
111
  "description": "The name of the property group, which is used in hovers and error messages.",
112
- "examples": ["sample-local"]
112
+ "examples": ["sample-local", "sample-remote"]
113
113
  },
114
114
  "language": {
115
115
  "type": "string",
@@ -150,7 +150,7 @@
150
150
  },
151
151
  "locations": {
152
152
  "type": "array",
153
- "description": "An array of include file locations. For 'local' libraries values can be absolute and relative filename paths using GLOB patterns. For 'mvs' libraries value can be data set names. GLOB patterns for dat sets are currently not supported.",
153
+ "description": "An array of include file locations. For 'local' libraries values can be absolute and relative filename paths using GLOB patterns. For 'mvs' libraries value can be data set names. GLOB patterns for data sets are currently not supported.",
154
154
  "items": {
155
155
  "type": "string"
156
156
  },
@@ -190,10 +190,16 @@
190
190
  },
191
191
  "type": {
192
192
  "type": "string",
193
- "enum": ["dbb", "rseapi", "debug"],
193
+ "enum": ["dbb", "rseapi", "debug", "preprocessor"],
194
194
  "description": "The type of the profile.",
195
195
  "default": "dbb",
196
- "examples": ["dbb", "rseapi"]
196
+ "examples": ["dbb", "rseapi", "preprocessor"]
197
+ },
198
+ "location": {
199
+ "type": "string",
200
+ "enum": ["mvs", "local"],
201
+ "description": "A string of include file locations. For 'local' libraries values can be absolute and relative filename paths using GLOB patterns. For 'mvs' libraries value can be data set names. GLOB patterns for dat sets are currently not supported.",
202
+ "examples": ["**/copybook", "USER1.SAMPLE.COBCOPY"]
197
203
  },
198
204
  "settings": {
199
205
  "description": "Settings objects specific to the type specified for the profile.",
@@ -222,6 +228,30 @@
222
228
  "$ref": "#/definitions/rseapiSettingsItem"
223
229
  }
224
230
  }
231
+ },
232
+ {
233
+ "required": ["name", "type", "settings", "location"],
234
+ "additionalProperties": false,
235
+ "properties": {
236
+ "name": { "type": "string" },
237
+ "type": { "const": "preprocessor", "type": "string" },
238
+ "location": { "const": "local", "type": "string" },
239
+ "settings": {
240
+ "$ref": "#/definitions/localPreprocessorSettingsItem"
241
+ }
242
+ }
243
+ },
244
+ {
245
+ "required": ["name", "type", "settings", "location"],
246
+ "additionalProperties": false,
247
+ "properties": {
248
+ "name": { "type": "string" },
249
+ "type": { "const": "preprocessor", "type": "string" },
250
+ "location": { "const": "mvs", "type": "string" },
251
+ "settings": {
252
+ "$ref": "#/definitions/mvsPreprocessorSettingsItem"
253
+ }
254
+ }
225
255
  }
226
256
  ]
227
257
  },
@@ -334,6 +364,60 @@
334
364
  "description": "A nested mappings array with resource mappings to members of the data sets that were mapped by the parent mapping."
335
365
  }
336
366
  }
367
+ },
368
+ "localPreprocessorSettingsItem": {
369
+ "type": "object",
370
+ "additionalProperties": false,
371
+ "description": "Preprocessor properties for preprocessing COBOL/PL/I files.",
372
+ "required": ["command", "outputPath", "fileExtension"],
373
+ "properties": {
374
+ "command": {
375
+ "type": "string",
376
+ "description": "The command to run to execute the preprocessor executable."
377
+ },
378
+ "outputPath": {
379
+ "type": "string",
380
+ "description": "Path where preprocessor produces its build output."
381
+ },
382
+ "fileExtension": {
383
+ "type": "string",
384
+ "description": "The desired file extension for the post-processed file."
385
+ },
386
+ "environmentVariables": {
387
+ "type": "object",
388
+ "additionalProperties": false,
389
+ "description": "Specifies any user defined environment variables to be passed to the preprocessor.",
390
+ "patternProperties": {
391
+ "[a-zA-Z_][a-zA-Z0-9_]*": {
392
+ "anyOf": [{ "type": "string" }]
393
+ }
394
+ }
395
+ }
396
+ }
397
+ },
398
+ "mvsPreprocessorSettingsItem": {
399
+ "type": "object",
400
+ "additionalProperties": false,
401
+ "description": "Preprocessor properties for preprocessing COBOL/PL/I files.",
402
+ "required": ["commandDataSet", "commandParameters", "outputDataSet", "tempDataHLQ"],
403
+ "properties": {
404
+ "commandDataSet": {
405
+ "type": "string",
406
+ "description": "Specifies an input listing sequential data set."
407
+ },
408
+ "commandParameters": {
409
+ "type": "string",
410
+ "description": "The parameters for the command being run."
411
+ },
412
+ "outputDataSet": {
413
+ "type": "string",
414
+ "description": "Specifies an output listing sequential data set."
415
+ },
416
+ "tempDataHLQ": {
417
+ "type": "string",
418
+ "description": "Specifies the high-level qualifier used for data sets created by plug-in requests to export observation files."
419
+ }
420
+ }
337
421
  }
338
422
  },
339
423
  "anyOf": [