@intelligentgraphics/ig.gfx.packager 3.1.0-alpha.6 → 3.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/build/bin.mjs +1 -2
- package/build/bin.mjs.map +1 -1
- package/build/{cli-CRt1pnL8.mjs → cli-DIedP7qK.mjs} +8 -14
- package/build/cli-DIedP7qK.mjs.map +1 -0
- package/build/{dependencies-DzwnAMHr.mjs → dependencies-COlDsLND.mjs} +2 -2
- package/build/{dependencies-DzwnAMHr.mjs.map → dependencies-COlDsLND.mjs.map} +1 -1
- package/build/{generateIndex-1_US73VT.mjs → generateIndex-C3QM6b_P.mjs} +15 -13
- package/build/generateIndex-C3QM6b_P.mjs.map +1 -0
- package/build/{generateParameterType-DSWCBqzV.mjs → generateParameterType-BQWvx09Q.mjs} +3 -3
- package/build/{generateParameterType-DSWCBqzV.mjs.map → generateParameterType-BQWvx09Q.mjs.map} +1 -1
- package/build/{index-BIqEoSQH.mjs → index-DwMieljj.mjs} +7 -7
- package/build/{index-BIqEoSQH.mjs.map → index-DwMieljj.mjs.map} +1 -1
- package/build/{index-Sj6AX2Pu.mjs → index-DzhYnNye.mjs} +45 -17
- package/build/index-DzhYnNye.mjs.map +1 -0
- package/build/{postinstall-DLxLg3tD.mjs → postinstall-C--lHX5F.mjs} +4 -4
- package/build/{postinstall-DLxLg3tD.mjs.map → postinstall-C--lHX5F.mjs.map} +1 -1
- package/build/{publishNpm-ByIPsGI3.mjs → publishNpm-XfGrMd4N.mjs} +6 -6
- package/build/{publishNpm-ByIPsGI3.mjs.map → publishNpm-XfGrMd4N.mjs.map} +1 -1
- package/build/{rollup-Dspsy6kv.mjs → rollup-C1CqoDDv.mjs} +18 -120
- package/build/rollup-C1CqoDDv.mjs.map +1 -0
- package/build/{scripts-BmQnbRem.mjs → scripts-B3noxiX3.mjs} +2 -2
- package/build/{scripts-BmQnbRem.mjs.map → scripts-B3noxiX3.mjs.map} +1 -1
- package/build/{versionFile-CK9FMt3L.mjs → versionFile-DfWPXq6d.mjs} +4 -4
- package/build/{versionFile-CK9FMt3L.mjs.map → versionFile-DfWPXq6d.mjs.map} +1 -1
- package/lib/lib.mjs +53 -24
- package/package.json +4 -5
- package/readme.md +81 -43
- package/build/cli-CRt1pnL8.mjs.map +0 -1
- package/build/generateIndex-1_US73VT.mjs.map +0 -1
- package/build/index-Sj6AX2Pu.mjs.map +0 -1
- package/build/rollup-Dspsy6kv.mjs.map +0 -1
package/readme.md
CHANGED
|
@@ -146,18 +146,69 @@ This command also allows the address and service to be overwritten. A list of al
|
|
|
146
146
|
npm run upload -- --help
|
|
147
147
|
```
|
|
148
148
|
|
|
149
|
-
### Using
|
|
149
|
+
### Using ecma script modules
|
|
150
150
|
|
|
151
|
-
|
|
151
|
+
Using ecma script modules is the modern and standard way of writing typescript and javascript code. Instead of the content of all files existing in a shared global space, each file can have it's own private variables and functions, that no other module can access. Using exports and imports, modules can explicitly use code from other files.
|
|
152
152
|
|
|
153
|
-
|
|
153
|
+
firstModule.ts
|
|
154
154
|
|
|
155
|
-
|
|
155
|
+
```ts
|
|
156
|
+
const a = 2;
|
|
157
|
+
export const b = 3;
|
|
158
|
+
|
|
159
|
+
export function calculate() {
|
|
160
|
+
return a + b;
|
|
161
|
+
}
|
|
162
|
+
```
|
|
163
|
+
|
|
164
|
+
secondModule.ts
|
|
165
|
+
|
|
166
|
+
```ts
|
|
167
|
+
import { b, calculate } from "./firstModule";
|
|
168
|
+
|
|
169
|
+
console.log(b); // 3
|
|
170
|
+
console.log(calculate()); // 5
|
|
171
|
+
|
|
172
|
+
export function calculateMore() {
|
|
173
|
+
return calculate() + b;
|
|
174
|
+
}
|
|
175
|
+
```
|
|
176
|
+
|
|
177
|
+
To decide which of the variables and functions of the modules of a package should be available to consumers of a package, an entry module is used that exports all the public variables and functions that should be available to users of the package.
|
|
178
|
+
|
|
179
|
+
index.ts
|
|
180
|
+
|
|
181
|
+
```ts
|
|
182
|
+
// Expose calculate to the consumers of the package
|
|
183
|
+
export { calculate } from "./firstModule";
|
|
184
|
+
// Expose all exports (just calculateMore in this case) of secondModule to the consumers of the package
|
|
185
|
+
export * from "./secondModule";
|
|
186
|
+
```
|
|
187
|
+
|
|
188
|
+
Ecma script modules are currently only supported for writing script packages, but not within the gfx engine when executing javascript. To allow them to be executed within the gfx engine, the modules are compiled to an output similar to the namespaces and modules used in the past. The value of the Scope, if available, or the Package fields of the \_Package.json files are used to automatically create a namespace for the code of your package.
|
|
189
|
+
|
|
190
|
+
\_Package.json
|
|
191
|
+
|
|
192
|
+
```json
|
|
193
|
+
{
|
|
194
|
+
"Package": "IG.Test"
|
|
195
|
+
}
|
|
196
|
+
```
|
|
197
|
+
|
|
198
|
+
IG.Test.js
|
|
156
199
|
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
200
|
+
```js
|
|
201
|
+
this.IG = this.IG || {};
|
|
202
|
+
this.IG.Test = {
|
|
203
|
+
calculate: function() {...},
|
|
204
|
+
calculateMore: function() {...}
|
|
205
|
+
}
|
|
206
|
+
```
|
|
207
|
+
|
|
208
|
+
**Benefits**
|
|
209
|
+
|
|
210
|
+
- automatic scoping of the code / no more manual creation of the namespaces
|
|
211
|
+
- support for javascript apis included in newer javascript language versions with automatic polyfills for older environments
|
|
161
212
|
|
|
162
213
|
**How**
|
|
163
214
|
|
|
@@ -166,18 +217,29 @@ To configure a package to use modules, you first need to add a `module` property
|
|
|
166
217
|
```json
|
|
167
218
|
{
|
|
168
219
|
"compilerOptions": {
|
|
169
|
-
"target": "
|
|
170
|
-
"lib": ["
|
|
220
|
+
"target": "esnext",
|
|
221
|
+
"lib": ["es2024", "dom"],
|
|
171
222
|
"module": "es2015"
|
|
172
223
|
}
|
|
173
224
|
}
|
|
174
225
|
```
|
|
175
226
|
|
|
176
|
-
|
|
227
|
+
Note: For module based packages typescript declaration files are not created by default. You can enable the creation of these files, by setting declaration to true in the compiler options of the tsconfig.json.
|
|
228
|
+
|
|
229
|
+
```json
|
|
230
|
+
{
|
|
231
|
+
"compilerOptions": {
|
|
232
|
+
"target": "esnext",
|
|
233
|
+
"lib": ["es2024", "dom"],
|
|
234
|
+
"module": "es2015",
|
|
235
|
+
"declaration": true
|
|
236
|
+
}
|
|
237
|
+
}
|
|
238
|
+
```
|
|
177
239
|
|
|
178
240
|
**Setup for a context package**
|
|
179
241
|
|
|
180
|
-
Context.ts
|
|
242
|
+
Scripts/Context.ts
|
|
181
243
|
|
|
182
244
|
```ts
|
|
183
245
|
/// <reference types="@intelligentgraphics/3d.igx.eval" />
|
|
@@ -193,13 +255,13 @@ export class Context {
|
|
|
193
255
|
|
|
194
256
|
**Setup for an evaluator package**
|
|
195
257
|
|
|
196
|
-
index.ts
|
|
258
|
+
Scripts/index.ts
|
|
197
259
|
|
|
198
260
|
```ts
|
|
199
261
|
export { MyEvaluator } from "./MyEvaluator";
|
|
200
262
|
```
|
|
201
263
|
|
|
202
|
-
MyEvaluator.ts
|
|
264
|
+
Scripts/MyEvaluator.ts
|
|
203
265
|
|
|
204
266
|
```ts
|
|
205
267
|
/// <reference types="@intelligentgraphics/3d.igx.eval" />
|
|
@@ -215,18 +277,12 @@ export class MyEvaluator {
|
|
|
215
277
|
|
|
216
278
|
Note: for mixed evaluator and context packages, you need to export the context class from the context file.
|
|
217
279
|
|
|
218
|
-
index.ts
|
|
280
|
+
Script/index.ts
|
|
219
281
|
|
|
220
282
|
```ts
|
|
221
283
|
export { Context } from "./Context";
|
|
222
284
|
```
|
|
223
285
|
|
|
224
|
-
**Compilation output**
|
|
225
|
-
|
|
226
|
-
There are no runtime differences between the compiled output of a modules package and a legacy namespace package. A user of a package (either as a library or directly in the graphical data) will not be aware of wether a package is written with ecmascript or legacy modules.
|
|
227
|
-
|
|
228
|
-
To achieve this, modules will be combined on compilation and exposed under the package name. Similar logic is also applied to the typescript declaration files generated for a package. When using a package as a library, the type declarations for both, a legacy namespace package and and ecmascript module package, need to be included through typescript references.
|
|
229
|
-
|
|
230
286
|
### Using ig libraries
|
|
231
287
|
|
|
232
288
|
**Installation**
|
|
@@ -371,12 +427,12 @@ An asset can be referenced using the following syntax:
|
|
|
371
427
|
```ts
|
|
372
428
|
class Test {
|
|
373
429
|
/**
|
|
374
|
-
* <img src="
|
|
430
|
+
* <img src="image.png" alt="a png image"/>
|
|
375
431
|
*/
|
|
376
432
|
}
|
|
377
433
|
```
|
|
378
434
|
|
|
379
|
-
The
|
|
435
|
+
The specified path will be resolved within a directory called `Media` next to the \_Package.json file.
|
|
380
436
|
|
|
381
437
|
### \_Index.json generation
|
|
382
438
|
|
|
@@ -466,7 +522,7 @@ The code snippet above will generate the following \_Index.json output:
|
|
|
466
522
|
]
|
|
467
523
|
```
|
|
468
524
|
|
|
469
|
-
Additionally when using the `--strictOptional
|
|
525
|
+
Additionally when using the `--strictOptional` or when strict/strictNullChecks is configured in the tsconfig.json, this command will also mark non optional parameters as required.
|
|
470
526
|
|
|
471
527
|
**Example for non optional parameters**
|
|
472
528
|
|
|
@@ -556,29 +612,11 @@ Afterwards you may need to reload your editor in order for the installed files t
|
|
|
556
612
|
|
|
557
613
|
## History
|
|
558
614
|
|
|
559
|
-
**IG.GFX.Packager 3.1.0-alpha.6**
|
|
560
|
-
|
|
561
|
-
- update typescript
|
|
562
|
-
|
|
563
|
-
**IG.GFX.Packager 3.1.0-alpha.5**
|
|
564
|
-
|
|
565
|
-
- drop lodash dependency
|
|
566
|
-
- update dependencies
|
|
567
|
-
|
|
568
|
-
**IG.GFX.Packager 3.1.0-alpha.4**
|
|
569
|
-
|
|
570
|
-
- skip rollup write for watch build
|
|
571
|
-
|
|
572
|
-
**IG.GFX.Packager 3.1.0-alpha.3**
|
|
573
|
-
|
|
574
|
-
- add support for skipping declaration file creation
|
|
575
|
-
- fix entry point for declaration bundling
|
|
576
|
-
|
|
577
615
|
**IG.GFX.Packager 3.1.0**
|
|
578
616
|
|
|
579
|
-
- compile js for node 20+
|
|
580
617
|
- introduce es modules support for script packages
|
|
581
618
|
- automatically generate a console.log statement with the package name, version and copyright string from \_package.json if no version.ts is detected
|
|
619
|
+
- upgrade to typescript 5.9
|
|
582
620
|
|
|
583
621
|
**IG.GFX.Packager 3.0.28**
|
|
584
622
|
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"cli-CRt1pnL8.mjs","sources":["../../tools.core/build/stripUtf8Bom.mjs","../../tools.core/build/npmPackage.mjs","../../tools.core/build/error.mjs","../../tools.core/build/package.mjs","../../tools.core/build/workspace.mjs","../../tools.core/build/assetService.mjs","../src/lib/prompter.ts","../src/cli.ts"],"sourcesContent":["const stripUtf8Bom = (text)=>{\n // Catches EFBBBF (UTF-8 BOM) because the buffer-to-string\n // conversion translates it to FEFF (UTF-16 BOM).\n if (text.charCodeAt(0) === 0xfeff) {\n return text.slice(1);\n }\n return text;\n};\n\nexport { stripUtf8Bom };\n//# sourceMappingURL=stripUtf8Bom.mjs.map\n","import * as fs from 'fs';\nimport * as path from 'path';\nimport { writePackageSync } from 'write-pkg';\nimport { stripUtf8Bom } from './stripUtf8Bom.mjs';\n\nconst readNpmManifest = (directory)=>{\n const packageJsonPath = path.join(directory, \"package.json\");\n const packageJson = stripUtf8Bom(fs.readFileSync(packageJsonPath, {\n encoding: \"utf8\"\n }));\n return JSON.parse(packageJson);\n};\nconst writeNpmManifest = (directory, packageJson)=>{\n const packageJsonPath = path.join(directory, \"package.json\");\n writePackageSync(packageJsonPath, packageJson);\n};\n\nexport { readNpmManifest, writeNpmManifest };\n//# sourceMappingURL=npmPackage.mjs.map\n","const getNodeErrorCode = (error)=>{\n if (error !== null && typeof error === \"object\" && error.code !== undefined) {\n return error.code;\n }\n};\n/**\n * Permission denied: An attempt was made to access a file in a way forbidden by its file access permissions.\n *\n * @param {unknown} error\n */ const isErrorEACCES = (error)=>getNodeErrorCode(error) === \"EACCES\";\n/**\n * No such file or directory: Commonly raised by fs operations to indicate that a component of the specified pathname does not exist. No entity (file or directory) could be found by the given path.\n *\n * @param {unknown} error\n */ const isErrorENOENT = (error)=>getNodeErrorCode(error) === \"ENOENT\";\nconst isErrorEPERM = (error)=>getNodeErrorCode(error) === \"EPERM\";\n\nexport { getNodeErrorCode, isErrorEACCES, isErrorENOENT, isErrorEPERM };\n//# sourceMappingURL=error.mjs.map\n","import * as path from 'path';\nimport * as fs from 'fs';\nimport { isErrorENOENT } from './error.mjs';\nimport { readNpmManifest, writeNpmManifest } from './npmPackage.mjs';\nimport { stripUtf8Bom } from './stripUtf8Bom.mjs';\n\n// Functionality related to working with a single package.\nconst PACKAGE_FILE = \"_Package.json\";\nconst INDEX_FILE = \"_Index.json\";\nconst ANIMATION_FILE_SUFFIX = \".animation.json\";\nconst getCreatorIndexParameterPrimaryJSType = (type)=>{\n switch(type){\n case \"LengthM\":\n case \"ArcDEG\":\n case \"Integer\":\n case \"Int\":\n case \"Float\":\n return \"number\";\n case \"Boolean\":\n case \"Bool\":\n return \"boolean\";\n case \"String\":\n case \"Material\":\n case \"Geometry\":\n case \"Animation\":\n case \"Interactor\":\n case \"Evaluator\":\n default:\n return \"string\";\n }\n};\nfunction parseCreatorPackageName(manifest) {\n const [domain, subdomain] = manifest.Package.split(\".\");\n if (subdomain === undefined) {\n throw new Error(`Expected \"Package\" field of the _Package.json file to contain a value in the form of Domain.SubDomain`);\n }\n return {\n domain,\n subdomain\n };\n}\n/**\n * Detects the package at the given directory.\n *\n * @param {string} directory\n * @returns {PackageLocation}\n */ const detectPackage = (workspace, directory)=>{\n directory = path.resolve(workspace.path, directory);\n const scriptsPath = path.join(directory, \"Scripts\");\n const tsPath = path.join(directory, \"ts\");\n let location;\n if (fs.existsSync(scriptsPath)) {\n location = {\n _kind: \"PackageLocation\",\n path: directory,\n scriptsDir: scriptsPath,\n manifestDir: scriptsPath\n };\n } else if (fs.existsSync(tsPath)) {\n location = {\n _kind: \"PackageLocation\",\n path: directory,\n scriptsDir: tsPath,\n manifestDir: directory\n };\n } else {\n location = {\n _kind: \"PackageLocation\",\n path: directory,\n scriptsDir: directory,\n manifestDir: directory\n };\n }\n try {\n readPackageCreatorManifest(location);\n } catch (err) {\n if (isErrorENOENT(err)) {\n throw new Error(`No _Package.json found in ${location.manifestDir}`);\n }\n throw err;\n }\n return location;\n};\nconst detectPackageLocationFromCreatorWorkspaceLocation = (location)=>{\n const packageLocation = {\n _kind: \"PackageLocation\",\n path: location.path,\n scriptsDir: path.join(location.path, \"Scripts\"),\n manifestDir: path.join(location.path, \"Scripts\")\n };\n try {\n readPackageCreatorManifest(packageLocation);\n } catch (err) {\n if (isErrorENOENT(err)) {\n throw new Error(`No _Package.json found in ${packageLocation.manifestDir}`);\n }\n throw err;\n }\n return packageLocation;\n};\nconst detectPackageAsParentDirectory = (directory)=>{\n let directoryToCheck = directory;\n while(directoryToCheck !== path.dirname(directoryToCheck)){\n if (fs.existsSync(path.join(directoryToCheck, \"Scripts\"))) {\n return {\n _kind: \"PackageLocation\",\n path: directoryToCheck,\n scriptsDir: path.join(directoryToCheck, \"Scripts\"),\n manifestDir: path.join(directoryToCheck, \"Scripts\")\n };\n }\n directoryToCheck = path.dirname(directoryToCheck);\n }\n return undefined;\n};\nconst readPackageCreatorManifest = (location)=>{\n const packageJsonPath = path.join(location.manifestDir, PACKAGE_FILE);\n const packageJson = stripUtf8Bom(fs.readFileSync(packageJsonPath, {\n encoding: \"utf8\"\n }));\n return JSON.parse(packageJson);\n};\nconst writePackageCreatorManifest = (location, creatorPackage)=>{\n const packageJsonPath = path.join(location.manifestDir, PACKAGE_FILE);\n fs.writeFileSync(packageJsonPath, JSON.stringify(creatorPackage, null, \"\\t\") + \"\\n\");\n};\nconst getPackageCreatorIndexPath = (location)=>path.join(location.manifestDir, INDEX_FILE);\nconst readPackageCreatorIndex = (location)=>{\n try {\n const indexPath = getPackageCreatorIndexPath(location);\n const index = stripUtf8Bom(fs.readFileSync(indexPath, {\n encoding: \"utf8\"\n }));\n return JSON.parse(index);\n } catch (err) {\n if (isErrorENOENT(err)) {\n return undefined;\n }\n throw err;\n }\n};\nconst writePackageCreatorIndex = (location, index)=>{\n const indexPath = getPackageCreatorIndexPath(location);\n fs.writeFileSync(indexPath, JSON.stringify(index, null, \"\\t\") + \"\\n\");\n};\nconst readPackageNpmManifest = (location)=>{\n try {\n return readNpmManifest(location.manifestDir);\n } catch (err) {\n if (isErrorENOENT(err)) {\n return undefined;\n }\n throw err;\n }\n};\nconst writePackageNpmManifest = (location, packageJson)=>{\n writeNpmManifest(location.manifestDir, packageJson);\n};\nconst readPackageAnimationList = (location)=>{\n const directoryContent = fs.readdirSync(location.manifestDir);\n const animationPathList = [];\n for (const entry of directoryContent){\n if (entry.endsWith(ANIMATION_FILE_SUFFIX)) {\n const animationPath = path.join(location.manifestDir, entry);\n animationPathList.push(animationPath);\n }\n }\n return animationPathList;\n};\nconst getPackageReleasesDirectory = (location)=>path.join(location.path, \"Releases\");\nconst arePackageLocationsEqual = (a, b)=>a.path === b.path;\n\nexport { INDEX_FILE, PACKAGE_FILE, arePackageLocationsEqual, detectPackage, detectPackageAsParentDirectory, detectPackageLocationFromCreatorWorkspaceLocation, getCreatorIndexParameterPrimaryJSType, getPackageCreatorIndexPath, getPackageReleasesDirectory, parseCreatorPackageName, readPackageAnimationList, readPackageCreatorIndex, readPackageCreatorManifest, readPackageNpmManifest, writePackageCreatorIndex, writePackageCreatorManifest, writePackageNpmManifest };\n//# sourceMappingURL=package.mjs.map\n","import * as path from 'path';\nimport * as fs from 'fs';\nimport { isErrorENOENT } from './error.mjs';\nimport { writeNpmManifest, readNpmManifest } from './npmPackage.mjs';\nimport { detectPackage } from './package.mjs';\nimport { detectCreatorWorkspaceAsParentDirectory } from './creatorWorkspace.mjs';\n\n// Functionality related to working with a workspace consisting of multiple packages.\nconst detectWorkspace = (directory)=>{\n directory = path.resolve(process.cwd(), directory);\n return {\n _kind: \"WorkspaceLocation\",\n path: directory\n };\n};\nconst detectWorkspaceByPackageJsonLocation = (directory)=>{\n while(directory !== path.dirname(directory)){\n if (fs.existsSync(path.join(directory, \"package.json\"))) {\n return detectWorkspace(directory);\n }\n directory = path.dirname(directory);\n }\n return undefined;\n};\nconst readWorkspaceNpmManifest = (workspace)=>{\n try {\n return readNpmManifest(workspace.path);\n } catch (err) {\n if (isErrorENOENT(err)) {\n throw new Error(`Expected a package.json file to exist in ${workspace.path}. See packager readme for instructions on how to create the package.json.`);\n }\n throw err;\n }\n};\nconst writeWorkspaceNpmManifest = (workspace, packageJson)=>writeNpmManifest(workspace.path, packageJson);\nconst getWorkspaceOutputPath = (workspace)=>path.join(workspace.path, \"bin\");\nconst getWorkspaceLibPath = (workspace)=>path.join(workspace.path, \"lib\");\nfunction* iterateWorkspacePackages(workspace) {\n const entries = fs.readdirSync(workspace.path, {\n withFileTypes: true\n });\n for (const entry of entries){\n if (!entry.isDirectory()) {\n continue;\n }\n try {\n yield detectPackage(workspace, entry.name);\n } catch {}\n }\n}\nfunction* iterateWorkspaceCreatorWorkspaces(workspace) {\n const entries = fs.readdirSync(workspace.path, {\n withFileTypes: true\n });\n for (const entry of entries){\n if (!entry.isDirectory()) {\n continue;\n }\n const detected = detectCreatorWorkspaceAsParentDirectory(path.join(workspace.path, entry.name));\n if (detected !== undefined) {\n yield detected;\n }\n }\n}\n\nexport { detectWorkspace, detectWorkspaceByPackageJsonLocation, getWorkspaceLibPath, getWorkspaceOutputPath, iterateWorkspaceCreatorWorkspaces, iterateWorkspacePackages, readWorkspaceNpmManifest, writeWorkspaceNpmManifest };\n//# sourceMappingURL=workspace.mjs.map\n","import axios, { AxiosError } from 'axios';\n\nconst PLUGIN_ID = \"0feba3a0-b6d1-11e6-9598-0800200c9a66\";\n/**\n * Starts an IG.Asset.Server session and returns the sessionId\n *\n * @param {SessionStartParams} params\n * @returns\n */ const startSession = async ({ url, authentication, ...params })=>{\n const payload = {\n ...params,\n user: undefined,\n password: undefined,\n license: undefined,\n plugin: PLUGIN_ID\n };\n if (authentication.type === \"credentials\") {\n payload.user = authentication.username;\n payload.password = authentication.password;\n } else if (authentication.type === \"license\") {\n payload.license = authentication.license;\n }\n const { data: { session: sessionId, state, response } } = await axios.post(`Session/Start2`, JSON.stringify(payload), {\n baseURL: url\n });\n if (state !== \"SUCCESS\") {\n let message = `Could not start session. IG.Asset.Server responded with ${state}`;\n if (response) {\n message += `: ${response}`;\n }\n throw new Error(message);\n }\n return {\n _kind: \"AssetService\",\n url,\n sessionId,\n domain: params.domain,\n subDomain: params.subDomain\n };\n};\nconst closeSession = async (session)=>{\n await axios.get(`Session/Close/${session.sessionId}`, {\n baseURL: session.url\n });\n};\nconst uploadPackageFromBuffer = async (session, { name, version }, buffer)=>{\n try {\n await uploadPackageToUrl(session.url, `UploadPackage/${session.sessionId}/${name}_${version}`, buffer);\n } catch (err) {\n if (err instanceof AxiosError) {\n var _err_response;\n if (((_err_response = err.response) == null ? void 0 : _err_response.status) === 404) {\n await uploadPackageToUrl(session.url, `UploadPackage/${session.sessionId}/${name}_${version}/`, buffer);\n return;\n }\n throw new Error(`Failed to upload package: ${err.message}`);\n }\n throw err;\n }\n};\nconst uploadPackageToUrl = async (url, path, buffer)=>{\n const { data, status } = await axios.post(path, buffer, {\n baseURL: url\n });\n let objectBody;\n if (typeof data === \"string\") {\n try {\n objectBody = JSON.parse(data);\n } catch (err) {}\n } else if (typeof data === \"object\") {\n objectBody = data;\n }\n if (objectBody !== undefined) {\n if (\"state\" in objectBody && objectBody.state !== \"SUCCESS\") {\n throw new Error(objectBody.response ?? objectBody.state);\n }\n }\n if (status >= 400) {\n if (objectBody !== undefined) {\n let text_1 = \"\";\n for(const key in objectBody){\n text_1 += key + \": \\n\";\n if (typeof objectBody[key] === \"object\") {\n text_1 += JSON.stringify(objectBody[key], undefined, 2);\n } else {\n text_1 += objectBody[key];\n }\n text_1 += \"\\n\\n\";\n }\n throw new Error(text_1);\n }\n throw new Error(data);\n }\n return data;\n};\nconst getExistingPackages = async (session)=>{\n const { data } = await axios.get(`Script/GetInformation/${session.sessionId}`, {\n baseURL: session.url,\n validateStatus: (status)=>status === 404 || status === 200\n }).catch((err)=>{\n throw new Error(`Failed to get existing packages: ${err.message}`);\n });\n return data;\n};\nconst getMaterials = async (session)=>{\n const response = await axios.get(`Material/Get/${session.sessionId}`, {\n baseURL: session.url\n });\n const data = response.data;\n return data.materials;\n};\nconst getGeometries = async (session)=>{\n const response = await axios.get(`Geometry/Get/${session.sessionId}`, {\n baseURL: session.url\n });\n const data = response.data;\n return data.geometries;\n};\n\nexport { closeSession, getExistingPackages, getGeometries, getMaterials, startSession, uploadPackageFromBuffer };\n//# sourceMappingURL=assetService.mjs.map\n","import inquirer from \"inquirer\";\n\nexport interface PrompterOption {\n\tname: string;\n\tvalue: string;\n}\n\nexport interface PrompterQuestion {\n\tmessage: string;\n\toptions: PrompterOption[];\n\tdefault?: string;\n}\n\nexport interface Prompter {\n\tconfirm(message: string): Promise<boolean>;\n\n\task(question: PrompterQuestion): Promise<string>;\n}\n\nexport const createDefaultPrompter = (): Prompter => {\n\treturn {\n\t\tconfirm: async (message) => {\n\t\t\tconst { confirm } = await inquirer.prompt([\n\t\t\t\t{\n\t\t\t\t\ttype: \"confirm\",\n\t\t\t\t\tmessage,\n\t\t\t\t\tname: \"confirm\",\n\t\t\t\t},\n\t\t\t]);\n\t\t\treturn confirm as boolean;\n\t\t},\n\n\t\task: async (question) => {\n\t\t\tconst { answer } = await inquirer.prompt([\n\t\t\t\t{\n\t\t\t\t\ttype: \"list\",\n\t\t\t\t\tmessage: question.message,\n\t\t\t\t\tname: \"answer\",\n\t\t\t\t\tchoices: question.options,\n\t\t\t\t\tdefault: question.default,\n\t\t\t\t},\n\t\t\t]);\n\t\t\treturn answer as string;\n\t\t},\n\t};\n};\n","import updateNotifier from \"update-notifier\";\nimport * as fs from \"fs\";\nimport * as path from \"path\";\nimport yargs from \"yargs/yargs\";\nimport { fileURLToPath } from \"url\";\nimport * as glob from \"glob\";\n\nimport { AssetService } from \"@intelligentgraphics/ig.gfx.tools.core\";\n\nimport {\n\tdetectPackage,\n\tPackageLocation,\n\tparseCreatorPackageName,\n\treadPackageCreatorManifest,\n} from \"./lib/package\";\nimport {\n\tdetectWorkspace,\n\treadWorkspaceNpmManifest,\n\tWorkspaceLocation,\n\twriteWorkspaceNpmManifest,\n} from \"./lib/workspace\";\nimport type { ReleaseFolderOptions } from \"./commands/publish\";\nimport { createDefaultPrompter } from \"./lib/prompter\";\nimport { PackageJSON } from \"./lib/packageJSON\";\nimport { BuildFolderOptions } from \"./lib\";\n\nconst docsHandler: BuildFolderOptions[\"docsHandler\"] = async (\n\tlocation,\n\tdeclarationFile,\n\toutFolder,\n\tname,\n) => {\n\tconst { generateDocs } = await import(\"./lib/docs\");\n\treturn await generateDocs(location, declarationFile, outFolder, name);\n};\n\nconst __filename = fileURLToPath(import.meta.url);\nconst __dirname = path.dirname(__filename);\n\nconst pjson: PackageJSON = JSON.parse(\n\tfs.readFileSync(path.join(__dirname, \"..\", \"package.json\"), \"utf8\"),\n);\n\nconst captureError = (err: Error) => {\n\tconsole.log(\"\");\n\n\tif (process.env.NODE_ENV !== \"production\") {\n\t\tconsole.error(err);\n\t} else {\n\t\tconsole.error(\n\t\t\t\"Stopped execution because of the following error: \" + err.message,\n\t\t);\n\t}\n\n\tprocess.exit(1);\n};\n\nconst buildOptions = {\n\toutDir: {\n\t\tdescription: \"Output directory\",\n\t\ttype: \"string\",\n\t\tdefault: \"bin\",\n\t\tcoerce: (input: string | undefined | null) =>\n\t\t\tinput === undefined || input === null\n\t\t\t\t? undefined\n\t\t\t\t: path.resolve(process.cwd(), input),\n\t},\n\tminimize: {\n\t\tdescription: \"Minify output\",\n\t\ttype: \"boolean\",\n\t\tdefault: true,\n\t},\n\tcwd: {\n\t\tdescription: \"Working directory\",\n\t\ttype: \"string\",\n\t\tdefault: process.cwd(),\n\t},\n\tclean: {\n\t\tdescription: \"Empty output dir before compiling\",\n\t\ttype: \"boolean\",\n\t\tdefault: false,\n\t},\n\tdocs: {\n\t\ttype: \"boolean\",\n\t\tdefault: false,\n\t},\n\tskipDeclarations: {\n\t\tdescription: \"Skips the creation of typescript declaration files\",\n\t\ttype: \"boolean\",\n\t\tdefault: false,\n\t},\n} as const;\n\nconst preCommandCheck = async (workspaceLocation: WorkspaceLocation) => {\n\tconst executedLocalPackager = __filename.startsWith(workspaceLocation.path);\n\tconst repositoryPackage = readWorkspaceNpmManifest(workspaceLocation);\n\n\tif (\n\t\trepositoryPackage?.dependencies?.[\n\t\t\t\"@intelligentgraphics/ig.gfx.packager\"\n\t\t] ||\n\t\trepositoryPackage?.devDependencies?.[\n\t\t\t\"@intelligentgraphics/ig.gfx.packager\"\n\t\t]\n\t) {\n\t\tconst parts = [\"Detected locally installed ig.gfx.packager.\"];\n\n\t\tif (executedLocalPackager) {\n\t\t\tparts.push(\n\t\t\t\t'Run \"npm install -g @intelligentgraphics/ig.gfx.packager@latest\" to install the global version, if it is not yet installed.',\n\t\t\t);\n\t\t}\n\t\tparts.push(\n\t\t\t'Run \"npm uninstall @intelligentgraphics/ig.gfx.packager\" to remove the local version.',\n\t\t);\n\n\t\tconsole.error(parts.join(\"\\n\"));\n\t\tprocess.exit(1);\n\t}\n\n\tif (executedLocalPackager) {\n\t\tconsole.error(`Detected locally installed ig.gfx.packager.\nRun \"npm install -g @intelligentgraphics/ig.gfx.packager@latest\" to install the global version, if it is not yet installed.\nRun \"npm install\" to get rid of the local packager version.`);\n\t\tprocess.exit(1);\n\t}\n\n\tconst notifier = updateNotifier({\n\t\tpkg: pjson,\n\t\tshouldNotifyInNpmScript: true,\n\t\tupdateCheckInterval: 1000 * 60,\n\t});\n\n\tnotifier.notify({\n\t\tisGlobal: true,\n\t\tdefer: true,\n\t});\n\n\tif (repositoryPackage === undefined) {\n\t\tthrow new Error(\n\t\t\t\"Could not load package.json file in current directory\",\n\t\t);\n\t}\n\n\trepositoryPackage.scripts ??= {};\n\trepositoryPackage.scripts.postinstall = \"packager postinstall\";\n\n\twriteWorkspaceNpmManifest(workspaceLocation, repositoryPackage);\n};\n\nconst yargsInstance = yargs(process.argv.slice(2));\n\nconst resolvePackagesFromMaybePatterns = (\n\targs: string[] = [],\n\tworkspace: WorkspaceLocation,\n) => {\n\tconst folders = new Map<string, PackageLocation>();\n\n\tfor (const arg of args) {\n\t\tglob.sync(arg, { cwd: workspace.path, absolute: true }).forEach(\n\t\t\t(folder) => {\n\t\t\t\ttry {\n\t\t\t\t\tconst location = detectPackage(workspace, folder);\n\n\t\t\t\t\tfolders.set(folder, location);\n\t\t\t\t} catch (err) {}\n\t\t\t},\n\t\t);\n\t}\n\n\treturn Array.from(folders.values());\n};\n\nyargsInstance.command(\n\t\"build [directories...]\",\n\t\"Builds the specified directories\",\n\t(argv) =>\n\t\targv.options({\n\t\t\t...buildOptions,\n\t\t\twatch: {\n\t\t\t\ttype: \"boolean\",\n\t\t\t\tdefault: false,\n\t\t\t},\n\t\t}),\n\tasync ({ directories = [], watch, ...options }) => {\n\t\tconst workspace = detectWorkspace(options.cwd);\n\t\tconst folders = resolvePackagesFromMaybePatterns(\n\t\t\tdirectories as string[],\n\t\t\tworkspace,\n\t\t);\n\n\t\tawait preCommandCheck(workspace);\n\n\t\tif (folders.length === 0) {\n\t\t\treturn console.log(\n\t\t\t\t\"No build targets found. Please check wether a folder with the provided name exists and wether it has _Package.json.\",\n\t\t\t);\n\t\t}\n\n\t\tconst { buildFolders, buildFoldersWatch } =\n\t\t\tawait import(\"./commands/build\");\n\n\t\tif (watch) {\n\t\t\tawait buildFoldersWatch({\n\t\t\t\t...options,\n\t\t\t\tpackages: folders,\n\t\t\t\tworkspace,\n\t\t\t\tdocsHandler,\n\t\t\t}).catch(captureError);\n\t\t\treturn;\n\t\t}\n\n\t\tawait buildFolders({\n\t\t\t...options,\n\t\t\tpackages: folders,\n\t\t\tworkspace,\n\t\t\tdocsHandler,\n\t\t}).catch(captureError);\n\t},\n);\n\nyargsInstance.command(\n\t\"publish [directory]\",\n\t\"Publishes the specified directory\",\n\t(argv) =>\n\t\targv.options({\n\t\t\t...buildOptions,\n\t\t\tnoUpload: {\n\t\t\t\ttype: \"boolean\",\n\t\t\t\tdefault: false,\n\t\t\t\tdescription: \"Only zip built files and do not upload them\",\n\t\t\t},\n\t\t\tdomain: {\n\t\t\t\ttype: \"string\",\n\t\t\t\tdescription:\n\t\t\t\t\t\"Overwrite the publish domain. Defaults to the one in the _Package.json\",\n\t\t\t},\n\t\t\tsubdomain: {\n\t\t\t\ttype: \"string\",\n\t\t\t\tdescription:\n\t\t\t\t\t\"Overwrite the publish subdomain. Defaults to the one in the _Package.json\",\n\t\t\t},\n\t\t\tnewVersion: {\n\t\t\t\ttype: \"string\",\n\t\t\t\tdescription: \"The name of the new version\",\n\t\t\t\tdefault: process.env.VERSION,\n\t\t\t\trequired: true,\n\t\t\t},\n\t\t\taddress: {\n\t\t\t\ttype: \"string\",\n\t\t\t\tdescription: \"Address\",\n\t\t\t\tdefault: \"localhost\",\n\t\t\t},\n\t\t\tservice: {\n\t\t\t\ttype: \"string\",\n\t\t\t\tdescription: \"IG.Asset.Server url\",\n\t\t\t\tdefault: process.env.IG_GFX_ASSET_SERVICE,\n\t\t\t\trequired: true,\n\t\t\t},\n\t\t\tuser: {\n\t\t\t\ttype: \"string\",\n\t\t\t\tdescription: \"User\",\n\t\t\t\tdefault: process.env.IG_GFX_USER,\n\t\t\t},\n\t\t\tpassword: {\n\t\t\t\ttype: \"string\",\n\t\t\t\tdescription: \"Password\",\n\t\t\t\tdefault: process.env.IG_GFX_PWD,\n\t\t\t},\n\t\t\tdocs: {\n\t\t\t\ttype: \"boolean\",\n\t\t\t\tdefault: false,\n\t\t\t\tdescription: \"Generate typedoc documentation\",\n\t\t\t},\n\t\t\tpushOnly: {\n\t\t\t\ttype: \"boolean\",\n\t\t\t\tdefault: false,\n\t\t\t\tdescription:\n\t\t\t\t\t\"Try to upload an existing zip file without building and validating the version number\",\n\t\t\t},\n\t\t\tlicense: {\n\t\t\t\ttype: \"string\",\n\t\t\t\tdescription: \"Path to a license file\",\n\t\t\t\tdefault: process.env.IG_GFX_LICENSE,\n\t\t\t},\n\t\t\tskipDependencies: {\n\t\t\t\ttype: \"boolean\",\n\t\t\t\tdefault: false,\n\t\t\t\tdescription: \"Skip dependency checks\",\n\t\t\t},\n\t\t}),\n\tasync ({ directory, user, password, service, license, ...options }) => {\n\t\tconst workspace = detectWorkspace(options.cwd);\n\t\tconst folder = detectPackage(workspace, directory as string);\n\n\t\tawait preCommandCheck(workspace);\n\n\t\tif (!options.noUpload) {\n\t\t\tif (!service) {\n\t\t\t\tcaptureError(\n\t\t\t\t\tnew Error(\n\t\t\t\t\t\t'The IG.Asset.Server url has to either be provided using the option --service or through the \"IG_GFX_ASSET_SERVICE\" environment variable',\n\t\t\t\t\t),\n\t\t\t\t);\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tif (!license && (!user || !password)) {\n\t\t\t\tcaptureError(\n\t\t\t\t\tnew Error(\n\t\t\t\t\t\t`Expected authentication to be provided through either of the following methods:\n\t - as a path to a license file using the --license option or the IG_GFX_LICENSE environment variable\n\t - as a username and password using the --user and --password options, or the IG_GFX_USER and IG_GFX_PWD environment variables`,\n\t\t\t\t\t),\n\t\t\t\t);\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif (license && !license.endsWith(\".iglic\")) {\n\t\t\t\tcaptureError(\n\t\t\t\t\tnew Error(\n\t\t\t\t\t\t`Expected the license path to end with the extension .iglic. Received the path \"${license}\". You may need to reload your environment variables by restarting the program you're using to execute the packager.`,\n\t\t\t\t\t),\n\t\t\t\t);\n\t\t\t\treturn;\n\t\t\t}\n\t\t}\n\n\t\tlet authentication: AssetService.Authentication | undefined;\n\n\t\tif (license) {\n\t\t\tconst fullLicensePath = path.resolve(process.cwd(), license);\n\t\t\ttry {\n\t\t\t\tconst content = fs.readFileSync(fullLicensePath);\n\t\t\t\tauthentication = {\n\t\t\t\t\ttype: \"license\",\n\t\t\t\t\tlicense: content.toString(\"base64\"),\n\t\t\t\t};\n\t\t\t} catch (err) {\n\t\t\t\tif (err?.code === \"ENOENT\") {\n\t\t\t\t\tcaptureError(\n\t\t\t\t\t\tnew Error(\n\t\t\t\t\t\t\t`Expected to find a license file at path: ${fullLicensePath}`,\n\t\t\t\t\t\t),\n\t\t\t\t\t);\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\tcaptureError(\n\t\t\t\t\tnew Error(\n\t\t\t\t\t\t`Failed to read license file at path: ${fullLicensePath}`,\n\t\t\t\t\t),\n\t\t\t\t);\n\t\t\t\treturn;\n\t\t\t}\n\t\t} else if (user && password) {\n\t\t\tconsole.log(\n\t\t\t\t`Detected usage of username and password authentication. Please migrate to the new license file based authentication.`,\n\t\t\t);\n\t\t\tauthentication = {\n\t\t\t\ttype: \"credentials\",\n\t\t\t\tusername: user,\n\t\t\t\tpassword,\n\t\t\t};\n\t\t}\n\n\t\tconst { releaseFolder } = await import(\"./commands/publish\");\n\n\t\tconst prompter = createDefaultPrompter();\n\n\t\tconst fullOptions: ReleaseFolderOptions = {\n\t\t\t...options,\n\t\t\tauthentication,\n\t\t\tservice: service!,\n\t\t\tdirectory: folder,\n\t\t\tbanner: true,\n\t\t\tprompter,\n\t\t\tnewVersion: options.newVersion!,\n\t\t\tworkspace,\n\t\t\tdocsHandler,\n\t\t};\n\n\t\tawait releaseFolder(fullOptions).catch(captureError);\n\t},\n);\n\nyargsInstance.command(\n\t\"testConnection [directory]\",\n\t\"Tests connection to asset service\",\n\t(argv) =>\n\t\targv.options({\n\t\t\tdomain: {\n\t\t\t\ttype: \"string\",\n\t\t\t\tdescription:\n\t\t\t\t\t\"Overwrite the publish domain. Defaults to the one in the _Package.json\",\n\t\t\t},\n\t\t\tsubdomain: {\n\t\t\t\ttype: \"string\",\n\t\t\t\tdescription:\n\t\t\t\t\t\"Overwrite the publish subdomain. Defaults to the one in the _Package.json\",\n\t\t\t},\n\t\t\taddress: {\n\t\t\t\ttype: \"string\",\n\t\t\t\tdescription: \"Address\",\n\t\t\t\tdefault: \"localhost\",\n\t\t\t},\n\t\t\tservice: {\n\t\t\t\ttype: \"string\",\n\t\t\t\tdescription: \"IG.Asset.Server url\",\n\t\t\t\tdefault: process.env.IG_GFX_ASSET_SERVICE,\n\t\t\t\trequired: true,\n\t\t\t},\n\t\t\tuser: {\n\t\t\t\ttype: \"string\",\n\t\t\t\tdescription: \"User\",\n\t\t\t\tdefault: process.env.IG_GFX_USER,\n\t\t\t},\n\t\t\tpassword: {\n\t\t\t\ttype: \"string\",\n\t\t\t\tdescription: \"Password\",\n\t\t\t\tdefault: process.env.IG_GFX_PWD,\n\t\t\t},\n\t\t\tlicense: {\n\t\t\t\ttype: \"string\",\n\t\t\t\tdescription: \"Path to a license file\",\n\t\t\t\tdefault: process.env.IG_GFX_LICENSE,\n\t\t\t},\n\t\t}),\n\tasync ({\n\t\tuser,\n\t\tpassword,\n\t\tservice,\n\t\tlicense,\n\t\tsubdomain,\n\t\tdomain,\n\t\taddress,\n\t\tdirectory,\n\t}) => {\n\t\tif (!service) {\n\t\t\tcaptureError(\n\t\t\t\tnew Error(\n\t\t\t\t\t'The IG.Asset.Server url has to either be provided using the option --service or through the \"IG_GFX_ASSET_SERVICE\" environment variable',\n\t\t\t\t),\n\t\t\t);\n\t\t\treturn;\n\t\t}\n\n\t\tif (!license && (!user || !password)) {\n\t\t\tcaptureError(\n\t\t\t\tnew Error(\n\t\t\t\t\t`Expected authentication to be provided through either of the following methods:\n\t - as a path to a license file using the --license option or the IG_GFX_LICENSE environment variable\n\t - as a username and password using the --user and --password options, or the IG_GFX_USER and IG_GFX_PWD environment variables`,\n\t\t\t\t),\n\t\t\t);\n\t\t\treturn;\n\t\t}\n\t\tif (license && !license.endsWith(\".iglic\")) {\n\t\t\tcaptureError(\n\t\t\t\tnew Error(\n\t\t\t\t\t`Expected the license path to end with the extension .iglic. Received the path \"${license}\". You may need to reload your environment variables by restarting the program you're using to execute the packager.`,\n\t\t\t\t),\n\t\t\t);\n\t\t\treturn;\n\t\t}\n\n\t\tlet authentication: AssetService.Authentication | undefined;\n\n\t\tif (license) {\n\t\t\tconst fullLicensePath = path.resolve(process.cwd(), license);\n\t\t\ttry {\n\t\t\t\tconst content = fs.readFileSync(fullLicensePath);\n\t\t\t\tauthentication = {\n\t\t\t\t\ttype: \"license\",\n\t\t\t\t\tlicense: content.toString(\"base64\"),\n\t\t\t\t};\n\t\t\t} catch (err) {\n\t\t\t\tif (err?.code === \"ENOENT\") {\n\t\t\t\t\tcaptureError(\n\t\t\t\t\t\tnew Error(\n\t\t\t\t\t\t\t`Expected to find a license file at path: ${fullLicensePath}`,\n\t\t\t\t\t\t),\n\t\t\t\t\t);\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\tcaptureError(\n\t\t\t\t\tnew Error(\n\t\t\t\t\t\t`Failed to read license file at path: ${fullLicensePath}`,\n\t\t\t\t\t),\n\t\t\t\t);\n\t\t\t\treturn;\n\t\t\t}\n\t\t} else if (user && password) {\n\t\t\tconsole.log(\n\t\t\t\t`Detected usage of username and password authentication. Please migrate to the new license file based authentication.`,\n\t\t\t);\n\t\t\tauthentication = {\n\t\t\t\ttype: \"credentials\",\n\t\t\t\tusername: user,\n\t\t\t\tpassword,\n\t\t\t};\n\t\t}\n\n\t\tif (authentication === undefined) {\n\t\t\tthrow new Error(`Expected authentication to be available`);\n\t\t}\n\n\t\tif (typeof directory === \"string\") {\n\t\t\tconst workspace = detectWorkspace(process.cwd());\n\t\t\tconst folder = detectPackage(workspace, directory as string);\n\t\t\tconst manifest = readPackageCreatorManifest(folder);\n\t\t\tconst parsedName = parseCreatorPackageName(manifest);\n\n\t\t\tif (domain === undefined) {\n\t\t\t\tdomain = parsedName.domain;\n\t\t\t}\n\t\t\tif (subdomain === undefined) {\n\t\t\t\tsubdomain = parsedName.subdomain;\n\t\t\t}\n\t\t}\n\n\t\tif (domain === undefined || subdomain === undefined) {\n\t\t\tthrow new Error(\n\t\t\t\t`Expected either domain and subdomain to be provided through options or to be executed for a specific package directory`,\n\t\t\t);\n\t\t}\n\n\t\tconst session = await AssetService.startSession({\n\t\t\turl: service,\n\t\t\taddress,\n\t\t\tdomain,\n\t\t\tsubDomain: subdomain,\n\t\t\tauthentication,\n\t\t});\n\n\t\tawait AssetService.closeSession(session);\n\n\t\tconsole.log(`Asset service session successfully started and closed`);\n\t},\n);\n\nyargsInstance.command({\n\tcommand: \"generateIndex [directory]\",\n\tbuilder: (argv) =>\n\t\targv\n\t\t\t.option(\"ignore\", {\n\t\t\t\ttype: \"array\",\n\t\t\t\tdefault: [],\n\t\t\t\tdescription: \"Files to ignore while generating index\",\n\t\t\t})\n\t\t\t.option(\"strictOptional\", {\n\t\t\t\ttype: \"boolean\",\n\t\t\t\tdefault: false,\n\t\t\t\tdescription:\n\t\t\t\t\t\"Marks non optional parameter object properties as required\",\n\t\t\t}),\n\thandler: async ({ directory, ignore, strictOptional }) => {\n\t\tconst workspace = detectWorkspace(process.cwd());\n\n\t\tawait preCommandCheck(workspace);\n\n\t\tconst { generateIndex } = await import(\"./commands/generateIndex\");\n\n\t\tconst location = detectPackage(workspace, directory as string);\n\n\t\tgenerateIndex({\n\t\t\tlocation,\n\t\t\tignore: ignore as string[],\n\t\t\tstrictOptional,\n\t\t});\n\t},\n\tdescribe: \"Generates an index file for a package based on typescript types\",\n});\n\nyargsInstance.command({\n\tcommand: \"generateParameterType [directory] [name]\",\n\thandler: async ({ directory, name }) => {\n\t\tconst workspace = detectWorkspace(process.cwd());\n\n\t\tawait preCommandCheck(workspace);\n\n\t\tconst { generateParameterType } =\n\t\t\tawait import(\"./commands/generateParameterType\");\n\n\t\tconst location = detectPackage(workspace, directory as string);\n\n\t\tgenerateParameterType({\n\t\t\tlocation,\n\t\t\tname,\n\t\t});\n\t},\n\tdescribe: \"Generates a parameter type for an interactor or evaluator\",\n});\n\nyargsInstance.command({\n\tcommand: \"postinstall\",\n\tbuilder: (argv) => argv,\n\thandler: async () => {\n\t\tconst { executePostInstall } = await import(\"./commands/postinstall\");\n\n\t\texecutePostInstall(detectWorkspace(process.cwd()));\n\t},\n\tdescribe: \"Runs postinstall tasks\",\n});\n\nyargsInstance.command({\n\tcommand: \"publishNpm [directory]\",\n\tbuilder: (argv) =>\n\t\targv.options({\n\t\t\tnewVersion: {\n\t\t\t\ttype: \"string\",\n\t\t\t\tdescription: \"Name of the new version\",\n\t\t\t\tdefault: process.env.VERSION,\n\t\t\t\trequired: true,\n\t\t\t},\n\t\t\tdryRun: {\n\t\t\t\ttype: \"boolean\",\n\t\t\t},\n\t\t}),\n\thandler: async ({ directory, newVersion, dryRun }) => {\n\t\tconst workspace = detectWorkspace(process.cwd());\n\n\t\tconst { publishToNpm } = await import(\"./commands/publishNpm\");\n\n\t\tawait publishToNpm({\n\t\t\tworkspace,\n\t\t\tlocation: detectPackage(workspace, directory as string),\n\t\t\tversion: newVersion,\n\t\t\tdryRun,\n\t\t}).catch(captureError);\n\t},\n\tdescribe: \"Publishes the package to npm\",\n});\n\nyargsInstance\n\t.demandCommand()\n\t.pkgConf(\"packager\")\n\t.showHelpOnFail(false)\n\t.version(pjson.version).argv;\n"],"names":["stripUtf8Bom","text","charCodeAt","slice","readNpmManifest","directory","packageJsonPath","path","join","packageJson","fs","readFileSync","encoding","JSON","parse","writeNpmManifest","writePackageSync","getNodeErrorCode","error","code","undefined","isErrorEACCES","isErrorENOENT","isErrorEPERM","PACKAGE_FILE","INDEX_FILE","ANIMATION_FILE_SUFFIX","getCreatorIndexParameterPrimaryJSType","type","parseCreatorPackageName","manifest","domain","subdomain","Package","split","Error","detectPackage","workspace","resolve","scriptsPath","tsPath","location","existsSync","_kind","scriptsDir","manifestDir","readPackageCreatorManifest","err","writePackageCreatorManifest","creatorPackage","writeFileSync","stringify","getPackageCreatorIndexPath","readPackageCreatorIndex","indexPath","index","writePackageCreatorIndex","readPackageNpmManifest","writePackageNpmManifest","readPackageAnimationList","directoryContent","readdirSync","animationPathList","entry","endsWith","animationPath","push","getPackageReleasesDirectory","detectWorkspace","process","cwd","readWorkspaceNpmManifest","writeWorkspaceNpmManifest","getWorkspaceOutputPath","getWorkspaceLibPath","iterateWorkspacePackages","entries","withFileTypes","isDirectory","name","PLUGIN_ID","startSession","url","authentication","params","payload","user","password","license","plugin","username","data","session","sessionId","state","response","axios","post","baseURL","message","subDomain","closeSession","get","uploadPackageFromBuffer","version","buffer","uploadPackageToUrl","AxiosError","status","objectBody","text_1","key","getExistingPackages","validateStatus","catch","createDefaultPrompter","confirm","inquirer","prompt","ask","question","answer","choices","options","default","docsHandler","declarationFile","outFolder","generateDocs","__filename","fileURLToPath","__dirname","dirname","pjson","captureError","console","log","env","NODE_ENV","exit","buildOptions","outDir","description","coerce","input","minimize","clean","docs","skipDeclarations","preCommandCheck","workspaceLocation","executedLocalPackager","startsWith","repositoryPackage","dependencies","devDependencies","parts","notifier","updateNotifier","pkg","shouldNotifyInNpmScript","updateCheckInterval","notify","isGlobal","defer","scripts","postinstall","yargsInstance","yargs","argv","resolvePackagesFromMaybePatterns","args","folders","Map","arg","glob","sync","absolute","forEach","folder","set","Array","from","values","command","watch","directories","length","buildFolders","buildFoldersWatch","packages","noUpload","newVersion","VERSION","required","address","service","IG_GFX_ASSET_SERVICE","IG_GFX_USER","IG_GFX_PWD","pushOnly","IG_GFX_LICENSE","skipDependencies","fullLicensePath","content","toString","releaseFolder","prompter","fullOptions","banner","parsedName","AssetService","builder","option","handler","ignore","strictOptional","generateIndex","describe","generateParameterType","executePostInstall","dryRun","publishToNpm","demandCommand","pkgConf","showHelpOnFail"],"mappings":";;;;;;;;;;;AAAO,MAAMA,YAAAA,GAAe,CAACC,IAAAA,GAAAA;;;IAG5B,IAAIA,IAAAA,CAAKC,UAAU,CAAC,CAAA,CAAA,KAAO,MAAA,EAAQ;AAClC,QAAA,OAAOD,IAAAA,CAAKE,KAAK,CAAC,CAAA,CAAA;AACnB,IAAA;AAEA,IAAA,OAAOF,IAAAA;AACR;;ACDO,MAAMG,eAAAA,GAAkB,CAC9BC,SAAAA,GAAAA;IAEA,MAAMC,eAAAA,GAAkBC,IAAAA,CAAKC,IAAI,C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E,UAAAA,EAAY;gBACXpK,IAAAA,EAAM,QAAA;gBACNkH,WAAAA,EAAa,yBAAA;gBACblB,OAAAA,EAASvD,OAAAA,CAAQoE,GAAG,CAACwD,OAAO;gBAC5BC,QAAAA,EAAU;AACX,aAAA;YACA2B,MAAAA,EAAQ;gBACPjM,IAAAA,EAAM;AACP;AACD,SAAA,CAAA;AACD0L,IAAAA,OAAAA,EAAS,OAAO,EAAEjN,SAAS,EAAE2L,UAAU,EAAE6B,MAAM,EAAE,GAAA;QAChD,MAAMxL,SAAAA,GAAY+B,eAAAA,CAAgBC,OAAAA,CAAQC,GAAG,EAAA,CAAA;AAE7C,QAAA,MAAM,EAAEwJ,YAAY,EAAE,GAAG,MAAM,OAAO,2BAAA,CAAA;AAEtC,QAAA,MAAMA,YAAAA,CAAa;AAClBzL,YAAAA,SAAAA;AACAI,YAAAA,QAAAA,EAAUL,cAAcC,SAAAA,EAAWhC,SAAAA,CAAAA;YACnCmG,OAAAA,EAASwF,UAAAA;AACT6B,YAAAA;AACD,SAAA,CAAA,CAAG3G,KAAK,CAACoB,YAAAA,CAAAA;AACV,IAAA,CAAA;IACAoF,QAAAA,EAAU;AACX,CAAA,CAAA;AAEAnD,aAAAA,CACEwD,aAAa,EAAA,CACbC,OAAO,CAAC,UAAA,CAAA,CACRC,cAAc,CAAC,KAAA,CAAA,CACfzH,OAAO,CAAC6B,KAAAA,CAAM7B,OAAO,EAAEiE,IAAI;;;;;;;;"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"generateIndex-1_US73VT.mjs","sources":["../src/commands/generateIndex.ts"],"sourcesContent":["import ts from \"typescript\";\nimport * as fs from \"fs\";\nimport * as path from \"path\";\n\nimport {\n\tresolveNamespaceFullName,\n\tresolveNamespaces,\n\tNamespace,\n} from \"@intelligentgraphics/declarationbundler\";\n\nimport {\n\tPackageLocation,\n\twritePackageCreatorIndex,\n\treadPackageCreatorIndex,\n\treadPackageCreatorManifest,\n} from \"../lib/package\";\nimport {\n\tgetPackageTypescriptFiles,\n\treadScriptPackageTSConfig,\n\tresolveScriptPackageEntryModule,\n} from \"../lib/scripts\";\nimport {\n\tCreatorIndexEntry,\n\tCreatorIndexParameter,\n\tCreatorIndexParameterType,\n} from \"../lib/package\";\n\nexport interface GenerateIndexOptions {\n\tignore?: string[];\n\tlocation: PackageLocation;\n\n\t/**\n\t * Marks non optional parameter object properties as required in the generated index\n\t *\n\t * @type {boolean}\n\t */\n\tstrictOptional?: boolean;\n}\n\n/**\n * Extracts and returns script array for _Index.json from a src folder\n *\n * @param folderPath path to a src folder\n */\nexport function generateIndex({\n\tlocation,\n\tignore = [],\n\tstrictOptional = false,\n}: GenerateIndexOptions) {\n\tconst arr: CreatorIndexEntry[] = [];\n\n\tconst existingIndex = readPackageCreatorIndex(location) ?? [];\n\tconst manifest = readPackageCreatorManifest(location);\n\n\tconst compilerOptions = readScriptPackageTSConfig(location).options;\n\n\tconst isModule =\n\t\tcompilerOptions.module === ts.ModuleKind.ES2015 ||\n\t\tcompilerOptions.module === ts.ModuleKind.ESNext;\n\n\tconst files = getPackageTypescriptFiles(location).filter(\n\t\t(path) => !ignore.some((suffix) => path.endsWith(suffix)),\n\t);\n\n\tlet program: ts.Program;\n\tlet namespaces: Namespace[];\n\n\tif (isModule) {\n\t\tconst entryFilePath = resolveScriptPackageEntryModule(\n\t\t\tlocation,\n\t\t\tmanifest,\n\t\t);\n\n\t\tif (entryFilePath === undefined) {\n\t\t\tthrow new Error(`Could not resolve entry module`);\n\t\t}\n\n\t\tconst host = ts.createCompilerHost({}, true);\n\t\tprogram = ts.createProgram(\n\t\t\t[entryFilePath],\n\t\t\t{ allowJs: true, ...compilerOptions },\n\t\t\thost,\n\t\t);\n\n\t\tconst entryFile = program.getSourceFile(entryFilePath);\n\n\t\tif (entryFile === undefined) {\n\t\t\tthrow new Error(`Failed to find entry module`);\n\t\t}\n\n\t\tnamespaces = resolveNamespaces(\n\t\t\tentryFile,\n\t\t\tprogram,\n\t\t\thost,\n\t\t\tmanifest.Scope ?? manifest.Package,\n\t\t);\n\t} else {\n\t\tprogram = ts.createProgram(files, { allowJs: true });\n\t\tnamespaces = [];\n\t}\n\n\tconst typeChecker = program.getTypeChecker();\n\n\tfiles.forEach((file) => {\n\t\t// Create a Program to represent the project, then pull out the\n\t\t// source file to parse its AST.\n\t\tconst sourceFile = program.getSourceFile(file)!;\n\t\tconst namespace = namespaces.find((namespace) =>\n\t\t\tnamespace.files.includes(sourceFile),\n\t\t);\n\n\t\t// Loop through the root AST nodes of the file\n\n\t\tfor (const scriptingClass of findScriptingClasses(sourceFile)) {\n\t\t\tif (scriptingClass.node.name === undefined) {\n\t\t\t\tthrow new Error(\n\t\t\t\t\t`Expected ${scriptingClass.type} class to have a name`,\n\t\t\t\t);\n\t\t\t}\n\n\t\t\tlet name: string;\n\n\t\t\tif (isModule && namespace !== undefined) {\n\t\t\t\tconst moduleNamespace = resolveNamespaceFullName(namespace);\n\t\t\t\tname = `${moduleNamespace}.${scriptingClass.node.name.text}`;\n\t\t\t} else {\n\t\t\t\tname = typeChecker.getFullyQualifiedName(\n\t\t\t\t\ttypeChecker.getSymbolAtLocation(scriptingClass.node.name)!,\n\t\t\t\t);\n\t\t\t}\n\n\t\t\tif (name.length > 45) {\n\t\t\t\tthrow new Error(`Package name length >45 '${name}'`);\n\t\t\t}\n\n\t\t\tconst parameterDeclaration =\n\t\t\t\tgetScriptingClassParameterdeclaration(scriptingClass);\n\n\t\t\tconst parametersType =\n\t\t\t\tparameterDeclaration === undefined\n\t\t\t\t\t? undefined\n\t\t\t\t\t: typeChecker.getTypeAtLocation(parameterDeclaration);\n\n\t\t\tif (parametersType === undefined) {\n\t\t\t\tconsole.log(\n\t\t\t\t\t`Failed to find parameters type declaration for ${scriptingClass.type} ${name}. Skipping parameter list generation`,\n\t\t\t\t);\n\t\t\t}\n\n\t\t\tconst existingIndexEntry = existingIndex.find(\n\t\t\t\t(entry) => entry.Name === name,\n\t\t\t);\n\n\t\t\tconst obj: CreatorIndexEntry = {\n\t\t\t\tName: name,\n\t\t\t\tDescription: existingIndexEntry?.Description ?? name,\n\t\t\t\tType:\n\t\t\t\t\tscriptingClass.type === \"evaluator\"\n\t\t\t\t\t\t? \"Evaluator\"\n\t\t\t\t\t\t: \"Interactor\",\n\t\t\t\tParameters: [],\n\t\t\t};\n\n\t\t\tconst rawDocTags = ts.getJSDocTags(scriptingClass.node);\n\n\t\t\tconst dict = getTagDict(rawDocTags);\n\t\t\tif (dict.summary) {\n\t\t\t\tobj.Description = dict.summary;\n\t\t\t} else {\n\t\t\t\tconst comment = typeChecker\n\t\t\t\t\t.getTypeAtLocation(scriptingClass.node)\n\t\t\t\t\t.symbol.getDocumentationComment(typeChecker)\n\t\t\t\t\t.map((comment) => comment.text)\n\t\t\t\t\t.join(\" \");\n\n\t\t\t\tif (comment) {\n\t\t\t\t\tobj.Description = comment;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif (parametersType !== undefined) {\n\t\t\t\tobj.Parameters = parseParametersList(\n\t\t\t\t\ttypeChecker.getPropertiesOfType(parametersType),\n\t\t\t\t\tstrictOptional,\n\t\t\t\t);\n\n\t\t\t\tif (\n\t\t\t\t\tobj.Parameters.length === 0 &&\n\t\t\t\t\tparametersType.getStringIndexType() !== undefined\n\t\t\t\t) {\n\t\t\t\t\tobj.Parameters = existingIndexEntry?.Parameters ?? [];\n\t\t\t\t}\n\t\t\t} else if (existingIndexEntry !== undefined) {\n\t\t\t\tobj.Parameters = existingIndexEntry.Parameters;\n\t\t\t}\n\n\t\t\tarr.push(obj);\n\t\t}\n\t});\n\n\tarr.sort((a, b) => a.Name.localeCompare(b.Name));\n\n\twritePackageCreatorIndex(location, arr);\n}\n\nfunction capitalizeFirstLetter(string: string) {\n\treturn string?.charAt(0).toUpperCase() + string?.slice(1);\n}\n\nconst parseDefault = (value: string, type: string) => {\n\tconst uType: CreatorIndexParameterType = capitalizeFirstLetter(\n\t\ttype,\n\t) as CreatorIndexParameterType;\n\tif (value === \"null\") return null;\n\tswitch (uType) {\n\t\tcase \"LengthM\":\n\t\tcase \"ArcDEG\":\n\t\tcase \"Float\":\n\t\t\treturn parseFloat(value);\n\t\tcase \"Integer\":\n\t\tcase \"Int\":\n\t\t\treturn parseInt(value);\n\t\tcase \"Boolean\":\n\t\tcase \"Bool\":\n\t\t\treturn value === \"true\";\n\t\tcase \"Material\":\n\t\tcase \"String\":\n\t\tcase \"Geometry\":\n\t\tdefault:\n\t\t\treturn value.replace(/^\"/, \"\").replace(/\"$/, \"\");\n\t}\n};\n\nconst parseTypeFromName = (\n\tname: string,\n): CreatorIndexParameterType | undefined => {\n\tconst parts = name.split(\".\");\n\tconst identifier = parts[parts.length - 1];\n\n\tswitch (identifier) {\n\t\tcase \"LengthM\":\n\t\tcase \"ArcDEG\":\n\t\tcase \"Float\":\n\t\tcase \"Integer\":\n\t\t\treturn identifier;\n\t\tcase \"GeometryReference\":\n\t\t\treturn \"Geometry\";\n\t\tcase \"MaterialReference\":\n\t\t\treturn \"Material\";\n\t\tcase \"AnimationReference\":\n\t\t\treturn \"Animation\";\n\t\tcase \"InteractorReference\":\n\t\t\treturn \"Interactor\";\n\t\tcase \"EvaluatorReference\":\n\t\t\treturn \"Evaluator\";\n\t\tcase \"String\":\n\t\tcase \"string\":\n\t\t\treturn \"String\";\n\t\tcase \"number\":\n\t\tcase \"Number\":\n\t\t\treturn \"Float\";\n\t\tcase \"boolean\":\n\t\tcase \"Boolean\":\n\t\t\treturn \"Boolean\";\n\t}\n};\n\nconst parseParametersList = (\n\tproperties: ts.Symbol[],\n\tstrictOptional: boolean,\n): CreatorIndexParameter[] => {\n\treturn properties.map((symbol, i) => {\n\t\tconst parameter: CreatorIndexParameter = {\n\t\t\tName: symbol.name,\n\t\t\tDescription: undefined,\n\t\t\tType: \"String\",\n\t\t\tDefault: undefined,\n\t\t\tDisplayIndex: i + 1,\n\t\t};\n\n\t\tif (parameter.Name.length > 45) {\n\t\t\tthrow new Error(`Parameter name length >45 '${parameter.Name}'`);\n\t\t}\n\n\t\tlet declaration: ts.Declaration | undefined =\n\t\t\tsymbol.getDeclarations()?.[0];\n\t\tlet documentationComment = symbol.getDocumentationComment(undefined);\n\n\t\tlet checkLinksSymbol: ts.Symbol | undefined = symbol;\n\n\t\twhile (checkLinksSymbol !== undefined && declaration === undefined) {\n\t\t\tconst links = (\n\t\t\t\tcheckLinksSymbol as {\n\t\t\t\t\tlinks?: {\n\t\t\t\t\t\tmappedType?: ts.Type;\n\t\t\t\t\t\tsyntheticOrigin?: ts.Symbol;\n\t\t\t\t\t};\n\t\t\t\t} & ts.Symbol\n\t\t\t).links;\n\n\t\t\tif (links?.syntheticOrigin) {\n\t\t\t\tdeclaration = links.syntheticOrigin.getDeclarations()?.[0];\n\n\t\t\t\tif (documentationComment.length === 0) {\n\t\t\t\t\tdocumentationComment =\n\t\t\t\t\t\tlinks.syntheticOrigin.getDocumentationComment(\n\t\t\t\t\t\t\tundefined,\n\t\t\t\t\t\t);\n\t\t\t\t}\n\n\t\t\t\tcheckLinksSymbol = links.syntheticOrigin;\n\t\t\t}\n\t\t}\n\n\t\tif (declaration !== undefined) {\n\t\t\tconst rawDocTags = ts.getJSDocTags(declaration);\n\n\t\t\tconst dict = getTagDict(rawDocTags);\n\n\t\t\tif (dict.summary) {\n\t\t\t\tparameter.Description = dict.summary;\n\t\t\t} else {\n\t\t\t\tconst comment = documentationComment\n\t\t\t\t\t.map((comment) => comment.text)\n\t\t\t\t\t.join(\" \");\n\n\t\t\t\tif (comment) {\n\t\t\t\t\tparameter.Description = comment;\n\t\t\t\t}\n\t\t\t}\n\t\t\tif (dict.creatorType) {\n\t\t\t\tparameter.Type = dict.creatorType as CreatorIndexParameterType;\n\t\t\t} else {\n\t\t\t\tconst propertySignature = declaration as ts.PropertySignature;\n\t\t\t\tif (propertySignature.type !== undefined) {\n\t\t\t\t\tconst parsedType = parseTypeFromName(\n\t\t\t\t\t\tpropertySignature.type.getText(),\n\t\t\t\t\t);\n\n\t\t\t\t\tif (parsedType !== undefined) {\n\t\t\t\t\t\tparameter.Type = parsedType;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif (dict.default) {\n\t\t\t\tparameter.Default = parseDefault(dict.default, parameter.Type);\n\t\t\t}\n\n\t\t\tif (\n\t\t\t\tstrictOptional &&\n\t\t\t\tdeclaration.kind === ts.SyntaxKind.PropertySignature\n\t\t\t) {\n\t\t\t\tconst propertySignature = declaration as ts.PropertySignature;\n\t\t\t\tif (propertySignature.questionToken === undefined) {\n\t\t\t\t\tparameter.Required = true;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn parameter;\n\t});\n};\n\ninterface IDocTags {\n\tdefault?: string;\n\tcreatorType?: string;\n\tsummary?: string;\n}\n\nfunction getTagDict(tags: readonly ts.JSDocTag[]): IDocTags {\n\tconst dict: IDocTags = {};\n\n\tfor (const tag of tags) {\n\t\tdict[tag.tagName.text] = tag.comment;\n\t}\n\n\treturn dict;\n}\n\nconst getScriptingClassParameterdeclaration = (\n\tscriptingClass: ScriptingClass,\n) => {\n\tfor (const member of scriptingClass.node.members) {\n\t\tif (ts.isMethodDeclaration(member)) {\n\t\t\tfor (let index = 0; index < member.parameters.length; index++) {\n\t\t\t\tconst parameter = member.parameters[index];\n\t\t\t\tif (\n\t\t\t\t\tisScriptingClassParameterDeclaration(\n\t\t\t\t\t\tscriptingClass,\n\t\t\t\t\t\tmember,\n\t\t\t\t\t\tindex,\n\t\t\t\t\t)\n\t\t\t\t) {\n\t\t\t\t\treturn parameter;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tif (ts.isConstructorDeclaration(member)) {\n\t\t\tfor (let index = 0; index < member.parameters.length; index++) {\n\t\t\t\tconst parameter = member.parameters[index];\n\t\t\t\tif (\n\t\t\t\t\tisScriptingClassParameterDeclaration(\n\t\t\t\t\t\tscriptingClass,\n\t\t\t\t\t\tmember,\n\t\t\t\t\t\tindex,\n\t\t\t\t\t)\n\t\t\t\t) {\n\t\t\t\t\treturn parameter;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n};\n\nconst isScriptingClassParameterDeclaration = (\n\tscriptingClass: ScriptingClass,\n\tmemberNode: ts.ClassElement,\n\tparameterIndex: number,\n) => {\n\tif (scriptingClass.type === \"evaluator\") {\n\t\treturn memberNode?.name?.getText() == \"Create\" && parameterIndex === 2;\n\t}\n\tif (scriptingClass.type === \"interactor\") {\n\t\treturn (\n\t\t\tmemberNode.kind === ts.SyntaxKind.Constructor &&\n\t\t\tparameterIndex === 0\n\t\t);\n\t}\n\treturn false;\n};\n\ninterface ScriptingClass {\n\tnode: ts.ClassDeclaration;\n\ttype: \"interactor\" | \"evaluator\";\n}\n\n/**\n * Finds interactors and evaluators within a script file\n *\n * @param {ts.Node} node\n * @return {*}\n */\nfunction* findScriptingClasses(\n\tnode: ts.Node,\n): Generator<ScriptingClass, void, void> {\n\tfor (const child of node.getChildren()) {\n\t\tif (!ts.isClassDeclaration(child)) {\n\t\t\tyield* findScriptingClasses(child);\n\t\t\tcontinue;\n\t\t}\n\n\t\tconst scriptingClass = detectScriptingClass(child);\n\n\t\tif (scriptingClass !== undefined) {\n\t\t\tyield scriptingClass;\n\t\t}\n\t}\n}\n\nconst detectScriptingClass = (\n\tnode: ts.ClassDeclaration,\n): ScriptingClass | undefined => {\n\tconst isEvaluator = node.heritageClauses?.some((clause) => {\n\t\tif (\n\t\t\tclause.token !== ts.SyntaxKind.ExtendsKeyword &&\n\t\t\tclause.token !== ts.SyntaxKind.ImplementsKeyword\n\t\t) {\n\t\t\treturn false;\n\t\t}\n\n\t\treturn clause.types.some((type) =>\n\t\t\ttype.getText().includes(\"Evaluator\"),\n\t\t);\n\t});\n\n\tif (isEvaluator) {\n\t\treturn {\n\t\t\tnode,\n\t\t\ttype: \"evaluator\",\n\t\t};\n\t}\n\n\tconst isInteractor = node.heritageClauses?.some((clause) => {\n\t\tif (clause.token !== ts.SyntaxKind.ExtendsKeyword) {\n\t\t\treturn false;\n\t\t}\n\n\t\treturn clause.types.some((type) =>\n\t\t\ttype.getText().includes(\"Interactor\"),\n\t\t);\n\t});\n\n\tif (isInteractor) {\n\t\treturn {\n\t\t\tnode,\n\t\t\ttype: \"interactor\",\n\t\t};\n\t}\n};\n"],"names":["generateIndex","location","ignore","strictOptional","arr","existingIndex","readPackageCreatorIndex","manifest","readPackageCreatorManifest","compilerOptions","readScriptPackageTSConfig","options","isModule","module","ts","ModuleKind","ES2015","ESNext","files","getPackageTypescriptFiles","filter","path","some","suffix","endsWith","program","namespaces","entryFilePath","resolveScriptPackageEntryModule","undefined","Error","host","createCompilerHost","createProgram","allowJs","entryFile","getSourceFile","resolveNamespaces","Scope","Package","typeChecker","getTypeChecker","forEach","file","sourceFile","namespace","find","includes","scriptingClass","findScriptingClasses","node","name","type","moduleNamespace","resolveNamespaceFullName","text","getFullyQualifiedName","getSymbolAtLocation","length","parameterDeclaration","getScriptingClassParameterdeclaration","parametersType","getTypeAtLocation","console","log","existingIndexEntry","entry","Name","obj","Description","Type","Parameters","rawDocTags","getJSDocTags","dict","getTagDict","summary","comment","symbol","getDocumentationComment","map","join","parseParametersList","getPropertiesOfType","getStringIndexType","push","sort","a","b","localeCompare","writePackageCreatorIndex","capitalizeFirstLetter","string","charAt","toUpperCase","slice","parseDefault","value","uType","parseFloat","parseInt","replace","parseTypeFromName","parts","split","identifier","properties","i","parameter","Default","DisplayIndex","declaration","getDeclarations","documentationComment","checkLinksSymbol","links","syntheticOrigin","creatorType","propertySignature","parsedType","getText","default","kind","SyntaxKind","PropertySignature","questionToken","Required","tags","tag","tagName","member","members","isMethodDeclaration","index","parameters","isScriptingClassParameterDeclaration","isConstructorDeclaration","memberNode","parameterIndex","Constructor","child","getChildren","isClassDeclaration","detectScriptingClass","isEvaluator","heritageClauses","clause","token","ExtendsKeyword","ImplementsKeyword","types","isInteractor"],"mappings":";;;;;;;;;;;;;;;AAuCA;;;;IAKO,SAASA,aAAAA,CAAc,EAC7BC,QA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