@transcend-io/cli 6.2.3 → 6.4.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.
Files changed (40) hide show
  1. package/README.md +4 -3
  2. package/build/cli-cron-pull-identifiers.js +4 -0
  3. package/build/cli-cron-pull-identifiers.js.map +1 -1
  4. package/build/cli-cron-pull-profiles.d.ts +3 -0
  5. package/build/cli-cron-pull-profiles.d.ts.map +1 -0
  6. package/build/cli-cron-pull-profiles.js +113 -0
  7. package/build/cli-cron-pull-profiles.js.map +1 -0
  8. package/build/code-scanning/constants.d.ts.map +1 -1
  9. package/build/code-scanning/constants.js +1 -0
  10. package/build/code-scanning/constants.js.map +1 -1
  11. package/build/code-scanning/integrations/composerJson.d.ts +3 -0
  12. package/build/code-scanning/integrations/composerJson.d.ts.map +1 -0
  13. package/build/code-scanning/integrations/composerJson.js +34 -0
  14. package/build/code-scanning/integrations/composerJson.js.map +1 -0
  15. package/build/code-scanning/integrations/index.d.ts +1 -0
  16. package/build/code-scanning/integrations/index.d.ts.map +1 -1
  17. package/build/code-scanning/integrations/index.js +1 -0
  18. package/build/code-scanning/integrations/index.js.map +1 -1
  19. package/build/codecs.d.ts +2 -0
  20. package/build/codecs.d.ts.map +1 -1
  21. package/build/graphql/fetchRequestFilesForRequest.d.ts +19 -0
  22. package/build/graphql/fetchRequestFilesForRequest.d.ts.map +1 -0
  23. package/build/graphql/fetchRequestFilesForRequest.js +34 -0
  24. package/build/graphql/fetchRequestFilesForRequest.js.map +1 -0
  25. package/build/graphql/gqls/index.d.ts +1 -0
  26. package/build/graphql/gqls/index.d.ts.map +1 -1
  27. package/build/graphql/gqls/index.js +1 -0
  28. package/build/graphql/gqls/index.js.map +1 -1
  29. package/build/graphql/gqls/requestFile.d.ts +2 -0
  30. package/build/graphql/gqls/requestFile.d.ts.map +1 -0
  31. package/build/graphql/gqls/requestFile.js +30 -0
  32. package/build/graphql/gqls/requestFile.js.map +1 -0
  33. package/build/graphql/index.d.ts +1 -0
  34. package/build/graphql/index.d.ts.map +1 -1
  35. package/build/graphql/index.js +1 -0
  36. package/build/graphql/index.js.map +1 -1
  37. package/build/tests/findCodePackagesInFolder.test.js +123 -0
  38. package/build/tests/findCodePackagesInFolder.test.js.map +1 -1
  39. package/build/tsbuildinfo +1 -1
  40. package/package.json +3 -2
package/README.md CHANGED
@@ -760,6 +760,7 @@ Transcend can scan your codebase to inventory your code packages and dependencie
760
760
  - build.gradle
761
761
  - pubspec.yaml
762
762
  - Gemfile & .gemspec
763
+ - composer.json
763
764
 
764
765
  The command will scan the folder you point at to look for any of these files. Once found, the build file will be parsed in search of dependencies. Those code packages and dependencies will be uploaded to [Transcend](https://app.transcend.io/code-scanning/code-packages). The only information shared with Transcend includes:
765
766
 
@@ -796,19 +797,19 @@ yarn tr-scan-packages --auth=$TRANSCEND_API_KEY
796
797
  Scan a specific directory
797
798
 
798
799
  ```sh
799
- yarn tr-discover-silos --auth=$TRANSCEND_API_KEY --scanPath=./examples/
800
+ yarn tr-scan-packages --auth=$TRANSCEND_API_KEY --scanPath=./examples/
800
801
  ```
801
802
 
802
803
  Ignore certain folders
803
804
 
804
805
  ```sh
805
- yarn tr-discover-silos --auth=$TRANSCEND_API_KEY --ignoreDirs=./test,./build
806
+ yarn tr-scan-packages --auth=$TRANSCEND_API_KEY --ignoreDirs=./test,./build
806
807
  ```
807
808
 
808
809
  Specify the name of the repository
809
810
 
810
811
  ```sh
811
- yarn tr-discover-silos --auth=$TRANSCEND_API_KEY --repositoryName="transcend-io/test"
812
+ yarn tr-scan-packages --auth=$TRANSCEND_API_KEY --repositoryName="transcend-io/test"
812
813
  ```
813
814
 
814
815
  ### tr-discover-silos
@@ -37,6 +37,10 @@ async function main() {
37
37
  logger_1.logger.error(colors_1.default.red('A Transcend API key must be provided. You can specify using --auth=$TRANSCEND_API_KEY'));
38
38
  process.exit(1);
39
39
  }
40
+ if (!dataSiloId) {
41
+ logger_1.logger.error(colors_1.default.red('A data silo ID must be provided. You can specify using --dataSiloId=92636cda-b7c6-48c6-b1b1-2df574596cbc'));
42
+ process.exit(1);
43
+ }
40
44
  if (!actions) {
41
45
  logger_1.logger.error(colors_1.default.red('At least one action must be provided. You can specify using --actions=ERASURE'));
42
46
  process.exit(1);
@@ -1 +1 @@
1
- {"version":3,"file":"cli-cron-pull-identifiers.js","sourceRoot":"","sources":["../src/cli-cron-pull-identifiers.ts"],"names":[],"mappings":";;;;;;AAEA,gEAAiC;AACjC,oDAA4B;AAE5B,qCAAkC;AAClC,uDAA+B;AAC/B,iCAAwE;AACxE,+DAA4D;AAC5D,2CAAoD;AACpD,yCAA4C;AAE5C;;;;;;;;;;;;;;;;GAgBG;AACH,KAAK,UAAU,IAAI;IACjB,+BAA+B;IAC/B,MAAM,EACJ,IAAI,GAAG,wBAAwB,EAC/B,YAAY,GAAG,iCAAqB,EACpC,IAAI,EACJ,UAAU,EACV,UAAU,EACV,OAAO,EACP,SAAS,GAAG,KAAK,GAClB,GAAG,IAAA,sBAAK,EAAC,OAAO,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,CAA8B,CAAC;IAE9D,wBAAwB;IACxB,IAAI,CAAC,IAAI,EAAE;QACT,eAAM,CAAC,KAAK,CACV,gBAAM,CAAC,GAAG,CACR,uFAAuF,CACxF,CACF,CAAC;QACF,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;KACjB;IAED,IAAI,CAAC,OAAO,EAAE;QACZ,eAAM,CAAC,KAAK,CACV,gBAAM,CAAC,GAAG,CACR,+EAA+E,CAChF,CACF,CAAC;QACF,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;KACjB;IAED,mBAAmB;IACnB,MAAM,aAAa,GAAG,IAAA,yBAAc,EAAC,OAAO,CAAoB,CAAC;IACjE,MAAM,cAAc,GAAG,aAAa,CAAC,MAAM;IACzC,8DAA8D;IAC9D,CAAC,IAAI,EAAE,EAAE,CAAC,CAAC,MAAM,CAAC,MAAM,CAAC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AAC,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,CAClE,CACF,CAAC;QACF,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;KACjB;IAED,oCAAoC;IACpC,MAAM,EAAE,0BAA0B,EAAE,GAClC,MAAM,IAAA,2CAAoC,EAAC;QACzC,YAAY;QACZ,SAAS,EAAE,QAAQ,CAAC,SAAS,EAAE,EAAE,CAAC;QAClC,OAAO,EAAE,aAAa;QACtB,IAAI;QACJ,UAAU;QACV,UAAU;KACX,CAAC,CAAC;IAEL,YAAY;IACZ,MAAM,OAAO,GAAG,IAAA,cAAI,EAClB,0BAA0B,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC,IAAI,EAAE,CAC7D,CAAC;IACF,IAAA,eAAQ,EAAC,IAAI,EAAE,0BAA0B,EAAE,OAAO,CAAC,CAAC;IACpD,eAAM,CAAC,IAAI,CACT,gBAAM,CAAC,KAAK,CACV,sBAAsB,0BAA0B,CAAC,MAAM,yBAAyB,IAAI,GAAG,CACxF,CACF,CAAC;AACJ,CAAC;AAED,IAAI,EAAE,CAAC"}
@@ -0,0 +1,3 @@
1
+ #!/usr/bin/env node
2
+ export {};
3
+ //# sourceMappingURL=cli-cron-pull-profiles.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"cli-cron-pull-profiles.d.ts","sourceRoot":"","sources":["../src/cli-cron-pull-profiles.ts"],"names":[],"mappings":""}
@@ -0,0 +1,113 @@
1
+ #!/usr/bin/env node
2
+ "use strict";
3
+ var __importDefault = (this && this.__importDefault) || function (mod) {
4
+ return (mod && mod.__esModule) ? mod : { "default": mod };
5
+ };
6
+ Object.defineProperty(exports, "__esModule", { value: true });
7
+ const yargs_parser_1 = __importDefault(require("yargs-parser"));
8
+ const colors_1 = __importDefault(require("colors"));
9
+ const logger_1 = require("./logger");
10
+ const uniq_1 = __importDefault(require("lodash/uniq"));
11
+ const cron_1 = require("./cron");
12
+ const privacy_types_1 = require("@transcend-io/privacy-types");
13
+ const constants_1 = require("./constants");
14
+ const requests_1 = require("./requests");
15
+ const bluebird_1 = require("bluebird");
16
+ const graphql_1 = require("./graphql");
17
+ /**
18
+ * This is a temporary script that can be removed after the launch of workflows v2
19
+ * TODO: https://transcend.height.app/T-39035 - remove this
20
+ *
21
+ * Requires an API key with:
22
+ * - scope for "View the Request Compilation"
23
+ *
24
+ * Dev Usage:
25
+ * yarn ts-node ./src/cli-cron-pull-profiles.ts --auth=$TRANSCEND_API_KEY \
26
+ * --cronDataSiloId=92636cda-b7c6-48c6-b1b1-2df574596cbc \
27
+ * --targetDataSiloId=40ec5df2-61f7-41e6-80d7-afe7c2f0e390 \
28
+ * --actions=ERASURE \
29
+ * --file=/Users/michaelfarrell/Desktop/test.csv \
30
+ * --fileTarget=/Users/michaelfarrell/Desktop/test-target.csv
31
+ *
32
+ * Standard usage:
33
+ * yarn tr-cron-pull-identifiers --auth=$TRANSCEND_API_KEY \
34
+ * --cronDataSiloId=92636cda-b7c6-48c6-b1b1-2df574596cbc \
35
+ * --targetDataSiloId=40ec5df2-61f7-41e6-80d7-afe7c2f0e390 \
36
+ * --actions=ERASURE \
37
+ * --file=/Users/michaelfarrell/Desktop/test.csv \
38
+ * --fileTarget=/Users/michaelfarrell/Desktop/test-target.csv
39
+ */
40
+ async function main() {
41
+ // Parse command line arguments
42
+ const { file = './cron-identifiers.csv', fileTarget = './cron-identifiers-target.csv', transcendUrl = constants_1.DEFAULT_TRANSCEND_API, auth, sombraAuth, cronDataSiloId, targetDataSiloId, actions, pageLimit = '100', } = (0, yargs_parser_1.default)(process.argv.slice(2));
43
+ // Ensure auth is passed
44
+ if (!auth) {
45
+ logger_1.logger.error(colors_1.default.red('A Transcend API key must be provided. You can specify using --auth=$TRANSCEND_API_KEY'));
46
+ process.exit(1);
47
+ }
48
+ // Ensure cronDataSiloId
49
+ if (!cronDataSiloId) {
50
+ logger_1.logger.error(colors_1.default.red('A cronDataSiloId must be provided. You can specify using --cronDataSiloId=92636cda-b7c6-48c6-b1b1-2df574596cbc'));
51
+ process.exit(1);
52
+ }
53
+ // Ensure targetDataSiloId
54
+ if (!targetDataSiloId) {
55
+ logger_1.logger.error(colors_1.default.red('A targetDataSiloId must be provided. You can specify using --targetDataSiloId=40ec5df2-61f7-41e6-80d7-afe7c2f0e390'));
56
+ process.exit(1);
57
+ }
58
+ // Ensure actions
59
+ if (!actions) {
60
+ logger_1.logger.error(colors_1.default.red('At least one action must be provided. You can specify using --actions=ERASURE'));
61
+ process.exit(1);
62
+ }
63
+ // Validate actions
64
+ const parsedActions = (0, requests_1.splitCsvToList)(actions);
65
+ const invalidActions = parsedActions.filter(
66
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
67
+ (type) => !Object.values(privacy_types_1.RequestAction).includes(type));
68
+ if (invalidActions.length > 0) {
69
+ logger_1.logger.error(colors_1.default.red(`Failed to parse actions:"${invalidActions.join(',')}".\n` +
70
+ `Expected one of: \n${Object.values(privacy_types_1.RequestAction).join('\n')}`));
71
+ process.exit(1);
72
+ }
73
+ // Pull down outstanding identifiers
74
+ const { identifiersFormattedForCsv } = await (0, cron_1.pullCustomSiloOutstandingIdentifiers)({
75
+ transcendUrl,
76
+ pageLimit: parseInt(pageLimit, 10),
77
+ actions: parsedActions,
78
+ auth,
79
+ sombraAuth,
80
+ dataSiloId: cronDataSiloId,
81
+ });
82
+ // Grab the requestIds from the list of silos to process
83
+ const requestIds = identifiersFormattedForCsv.map((d) => d.requestId);
84
+ // Create GraphQL client to connect to Transcend backend
85
+ const client = (0, graphql_1.buildTranscendGraphQLClient)(transcendUrl, auth);
86
+ // Pull down target identifiers
87
+ const results = await (0, bluebird_1.map)((0, uniq_1.default)(requestIds), async (requestId) => {
88
+ const results = await (0, graphql_1.fetchRequestFilesForRequest)(client, { requestId });
89
+ return results.map(({ fileName, ...res }) => {
90
+ var _a;
91
+ return ({
92
+ ...res,
93
+ requestId,
94
+ datapointName: (_a = fileName
95
+ .replace('.json', '')
96
+ .split('/')
97
+ .pop()) === null || _a === void 0 ? void 0 : _a.replace(' Information', ''),
98
+ });
99
+ });
100
+ }, {
101
+ concurrency: 10,
102
+ });
103
+ // Write CSV
104
+ const headers = (0, uniq_1.default)(identifiersFormattedForCsv.map((d) => Object.keys(d)).flat());
105
+ (0, cron_1.writeCsv)(file, identifiersFormattedForCsv, headers);
106
+ logger_1.logger.info(colors_1.default.green(`Successfully wrote ${identifiersFormattedForCsv.length} identifiers to file "${file}"`));
107
+ const targetIdentifiers = results.flat();
108
+ const headers2 = (0, uniq_1.default)(targetIdentifiers.map((d) => Object.keys(d)).flat());
109
+ (0, cron_1.writeCsv)(fileTarget, targetIdentifiers, headers2);
110
+ logger_1.logger.info(colors_1.default.green(`Successfully wrote ${targetIdentifiers.length} identifiers to file "${fileTarget}"`));
111
+ }
112
+ main();
113
+ //# sourceMappingURL=cli-cron-pull-profiles.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"cli-cron-pull-profiles.js","sourceRoot":"","sources":["../src/cli-cron-pull-profiles.ts"],"names":[],"mappings":";;;;;;AAEA,gEAAiC;AACjC,oDAA4B;AAE5B,qCAAkC;AAClC,uDAA+B;AAC/B,iCAAwE;AACxE,+DAA4D;AAC5D,2CAAoD;AACpD,yCAA4C;AAC5C,uCAA+B;AAC/B,uCAGmB;AAEnB;;;;;;;;;;;;;;;;;;;;;;GAsBG;AACH,KAAK,UAAU,IAAI;IACjB,+BAA+B;IAC/B,MAAM,EACJ,IAAI,GAAG,wBAAwB,EAC/B,UAAU,GAAG,+BAA+B,EAC5C,YAAY,GAAG,iCAAqB,EACpC,IAAI,EACJ,UAAU,EACV,cAAc,EACd,gBAAgB,EAChB,OAAO,EACP,SAAS,GAAG,KAAK,GAClB,GAAG,IAAA,sBAAK,EAAC,OAAO,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,CAA8B,CAAC;IAE9D,wBAAwB;IACxB,IAAI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AAC,CAAC,CAAC,IAAI,EAAE,CAC7D,CAAC;IACF,IAAA,eAAQ,EAAC,IAAI,EAAE,0BAA0B,EAAE,OAAO,CAAC,CAAC;IACpD,eAAM,CAAC,IAAI,CACT,gBAAM,CAAC,KAAK,CACV,sBAAsB,0BAA0B,CAAC,MAAM,yBAAyB,IAAI,GAAG,CACxF,CACF,CAAC;IAEF,MAAM,iBAAiB,GAAG,OAAO,CAAC,IAAI,EAAE,CAAC;IACzC,MAAM,QAAQ,GAAG,IAAA,cAAI,EAAC,iBAAiB,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC,IAAI,EAAE,CAAC,CAAC;IAC3E,IAAA,eAAQ,EAAC,UAAU,EAAE,iBAAiB,EAAE,QAAQ,CAAC,CAAC;IAClD,eAAM,CAAC,IAAI,CACT,gBAAM,CAAC,KAAK,CACV,sBAAsB,iBAAiB,CAAC,MAAM,yBAAyB,UAAU,GAAG,CACrF,CACF,CAAC;AACJ,CAAC;AAED,IAAI,EAAE,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../../src/code-scanning/constants.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,kBAAkB,EAAE,MAAM,SAAS,CAAC;AAS7C,OAAO,EAAE,eAAe,EAAE,MAAM,6BAA6B,CAAC;AAE9D;;GAEG;AACH,eAAO,MAAM,sBAAsB,EAAE;KAClC,CAAC,IAAI,MAAM,GAAG,kBAAkB;CAQlC,CAAC;AAEF,eAAO,MAAM,qBAAqB,EAAE;KACjC,CAAC,IAAI,eAAe,GAAG,kBAAkB;CAQ3C,CAAC"}
1
+ {"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../../src/code-scanning/constants.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,kBAAkB,EAAE,MAAM,SAAS,CAAC;AAU7C,OAAO,EAAE,eAAe,EAAE,MAAM,6BAA6B,CAAC;AAE9D;;GAEG;AACH,eAAO,MAAM,sBAAsB,EAAE;KAClC,CAAC,IAAI,MAAM,GAAG,kBAAkB;CAQlC,CAAC;AAEF,eAAO,MAAM,qBAAqB,EAAE;KACjC,CAAC,IAAI,eAAe,GAAG,kBAAkB;CAS3C,CAAC"}
@@ -21,5 +21,6 @@ exports.CODE_SCANNING_CONFIGS = {
21
21
  [privacy_types_1.CodePackageType.RequirementsTxt]: integrations_1.pythonRequirementsTxt,
22
22
  [privacy_types_1.CodePackageType.Gemfile]: integrations_1.gemfile,
23
23
  [privacy_types_1.CodePackageType.Pubspec]: integrations_1.pubspec,
24
+ [privacy_types_1.CodePackageType.ComposerJson]: integrations_1.composerJson,
24
25
  };
25
26
  //# sourceMappingURL=constants.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"constants.js","sourceRoot":"","sources":["../../src/code-scanning/constants.ts"],"names":[],"mappings":";;;AACA,iDAOwB;AACxB,+DAA8D;AAE9D;;GAEG;AACU,QAAA,sBAAsB,GAE/B;IACF,SAAS,EAAT,wBAAS;IACT,MAAM,EAAN,qBAAM;IACN,qBAAqB,EAArB,oCAAqB;IACrB,qBAAqB,EAArB,oCAAqB;IACrB,OAAO,EAAP,sBAAO;IACP,OAAO,EAAP,sBAAO;CACR,CAAC;AAEW,QAAA,qBAAqB,GAE9B;IACF,CAAC,+BAAe,CAAC,SAAS,CAAC,EAAE,wBAAS;IACtC,CAAC,+BAAe,CAAC,MAAM,CAAC,EAAE,qBAAM;IAChC,CAAC,+BAAe,CAAC,WAAW,CAAC,EAAE,oCAAqB;IACpD,CAAC,+BAAe,CAAC,eAAe,CAAC,EAAE,oCAAqB;IACxD,CAAC,+BAAe,CAAC,OAAO,CAAC,EAAE,sBAAO;IAClC,CAAC,+BAAe,CAAC,OAAO,CAAC,EAAE,sBAAO;CACnC,CAAC"}
1
+ {"version":3,"file":"constants.js","sourceRoot":"","sources":["../../src/code-scanning/constants.ts"],"names":[],"mappings":";;;AACA,iDAQwB;AACxB,+DAA8D;AAE9D;;GAEG;AACU,QAAA,sBAAsB,GAE/B;IACF,SAAS,EAAT,wBAAS;IACT,MAAM,EAAN,qBAAM;IACN,qBAAqB,EAArB,oCAAqB;IACrB,qBAAqB,EAArB,oCAAqB;IACrB,OAAO,EAAP,sBAAO;IACP,OAAO,EAAP,sBAAO;CACR,CAAC;AAEW,QAAA,qBAAqB,GAE9B;IACF,CAAC,+BAAe,CAAC,SAAS,CAAC,EAAE,wBAAS;IACtC,CAAC,+BAAe,CAAC,MAAM,CAAC,EAAE,qBAAM;IAChC,CAAC,+BAAe,CAAC,WAAW,CAAC,EAAE,oCAAqB;IACpD,CAAC,+BAAe,CAAC,eAAe,CAAC,EAAE,oCAAqB;IACxD,CAAC,+BAAe,CAAC,OAAO,CAAC,EAAE,sBAAO;IAClC,CAAC,+BAAe,CAAC,OAAO,CAAC,EAAE,sBAAO;IAClC,CAAC,+BAAe,CAAC,YAAY,CAAC,EAAE,2BAAY;CAC7C,CAAC"}
@@ -0,0 +1,3 @@
1
+ import { CodeScanningConfig } from '../types';
2
+ export declare const composerJson: CodeScanningConfig;
3
+ //# sourceMappingURL=composerJson.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"composerJson.d.ts","sourceRoot":"","sources":["../../../src/code-scanning/integrations/composerJson.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,kBAAkB,EAAE,MAAM,UAAU,CAAC;AAI9C,eAAO,MAAM,YAAY,EAAE,kBAoC1B,CAAC"}
@@ -0,0 +1,34 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.composerJson = void 0;
4
+ const fs_1 = require("fs");
5
+ const path_1 = require("path");
6
+ exports.composerJson = {
7
+ supportedFiles: ['composer.json'],
8
+ ignoreDirs: ['vendor', 'node_modules', 'cache', 'build', 'dist'],
9
+ scanFunction: (filePath) => {
10
+ const file = (0, fs_1.readFileSync)(filePath, 'utf-8');
11
+ const directory = (0, path_1.dirname)(filePath);
12
+ const asJson = JSON.parse(file);
13
+ const { name, description, require: requireDependencies = {}, 'require-dev': requiredDevDependencies = {}, } = asJson;
14
+ return [
15
+ {
16
+ // name of the package
17
+ name: name || directory.split('/').pop(),
18
+ description,
19
+ softwareDevelopmentKits: [
20
+ ...Object.entries(requireDependencies).map(([name, version]) => ({
21
+ name,
22
+ version: typeof version === 'string' ? version : undefined,
23
+ })),
24
+ ...Object.entries(requiredDevDependencies).map(([name, version]) => ({
25
+ name,
26
+ version: typeof version === 'string' ? version : undefined,
27
+ isDevDependency: true,
28
+ })),
29
+ ],
30
+ },
31
+ ];
32
+ },
33
+ };
34
+ //# sourceMappingURL=composerJson.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"composerJson.js","sourceRoot":"","sources":["../../../src/code-scanning/integrations/composerJson.ts"],"names":[],"mappings":";;;AAAA,2BAAkC;AAGlC,+BAA+B;AAElB,QAAA,YAAY,GAAuB;IAC9C,cAAc,EAAE,CAAC,eAAe,CAAC;IACjC,UAAU,EAAE,CAAC,QAAQ,EAAE,cAAc,EAAE,OAAO,EAAE,OAAO,EAAE,MAAM,CAAC;IAChE,YAAY,EAAE,CAAC,QAAQ,EAAE,EAAE;QACzB,MAAM,IAAI,GAAG,IAAA,iBAAY,EAAC,QAAQ,EAAE,OAAO,CAAC,CAAC;QAC7C,MAAM,SAAS,GAAG,IAAA,cAAO,EAAC,QAAQ,CAAC,CAAC;QACpC,MAAM,MAAM,GAAG,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC;QAChC,MAAM,EACJ,IAAI,EACJ,WAAW,EACX,OAAO,EAAE,mBAAmB,GAAG,EAAE,EACjC,aAAa,EAAE,uBAAuB,GAAG,EAAE,GAC5C,GAAG,MAAM,CAAC;QACX,OAAO;YACL;gBACE,sBAAsB;gBACtB,IAAI,EAAE,IAAI,IAAI,SAAS,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,GAAG,EAAG;gBACzC,WAAW;gBACX,uBAAuB,EAAE;oBACvB,GAAG,MAAM,CAAC,OAAO,CAAC,mBAAmB,CAAC,CAAC,GAAG,CACxC,CAAC,CAAC,IAAI,EAAE,OAAO,CAAC,EAAkB,EAAE,CAAC,CAAC;wBACpC,IAAI;wBACJ,OAAO,EAAE,OAAO,OAAO,KAAK,QAAQ,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,SAAS;qBAC3D,CAAC,CACH;oBACD,GAAG,MAAM,CAAC,OAAO,CAAC,uBAAuB,CAAC,CAAC,GAAG,CAC5C,CAAC,CAAC,IAAI,EAAE,OAAO,CAAC,EAAkB,EAAE,CAAC,CAAC;wBACpC,IAAI;wBACJ,OAAO,EAAE,OAAO,OAAO,KAAK,QAAQ,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,SAAS;wBAC1D,eAAe,EAAE,IAAI;qBACtB,CAAC,CACH;iBACF;aACF;SACF,CAAC;IACJ,CAAC;CACF,CAAC"}
@@ -4,4 +4,5 @@ export * from './javascriptPackageJson';
4
4
  export * from './pythonRequirementsTxt';
5
5
  export * from './gemfile';
6
6
  export * from './pubspec';
7
+ export * from './composerJson';
7
8
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/code-scanning/integrations/index.ts"],"names":[],"mappings":"AAAA,cAAc,aAAa,CAAC;AAC5B,cAAc,UAAU,CAAC;AACzB,cAAc,yBAAyB,CAAC;AACxC,cAAc,yBAAyB,CAAC;AACxC,cAAc,WAAW,CAAC;AAC1B,cAAc,WAAW,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/code-scanning/integrations/index.ts"],"names":[],"mappings":"AAAA,cAAc,aAAa,CAAC;AAC5B,cAAc,UAAU,CAAC;AACzB,cAAc,yBAAyB,CAAC;AACxC,cAAc,yBAAyB,CAAC;AACxC,cAAc,WAAW,CAAC;AAC1B,cAAc,WAAW,CAAC;AAC1B,cAAc,gBAAgB,CAAC"}
@@ -20,4 +20,5 @@ __exportStar(require("./javascriptPackageJson"), exports);
20
20
  __exportStar(require("./pythonRequirementsTxt"), exports);
21
21
  __exportStar(require("./gemfile"), exports);
22
22
  __exportStar(require("./pubspec"), exports);
23
+ __exportStar(require("./composerJson"), exports);
23
24
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/code-scanning/integrations/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,8CAA4B;AAC5B,2CAAyB;AACzB,0DAAwC;AACxC,0DAAwC;AACxC,4CAA0B;AAC1B,4CAA0B"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/code-scanning/integrations/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,8CAA4B;AAC5B,2CAAyB;AACzB,0DAAwC;AACxC,0DAAwC;AACxC,4CAA0B;AAC1B,4CAA0B;AAC1B,iDAA+B"}
package/build/codecs.d.ts CHANGED
@@ -17392,6 +17392,7 @@ export declare const SoftwareDevelopmentKitInput: t.IntersectionC<[t.TypeC<{
17392
17392
  COCOA_PODS: unknown;
17393
17393
  PUBSPEC: unknown;
17394
17394
  GEMFILE: unknown;
17395
+ COMPOSER_JSON: unknown;
17395
17396
  }>;
17396
17397
  }>, t.PartialC<{
17397
17398
  /** Description of the SDK */
@@ -17439,6 +17440,7 @@ export declare const CodePackageInput: t.IntersectionC<[t.TypeC<{
17439
17440
  COCOA_PODS: unknown;
17440
17441
  PUBSPEC: unknown;
17441
17442
  GEMFILE: unknown;
17443
+ COMPOSER_JSON: unknown;
17442
17444
  }>;
17443
17445
  /** Relative path to code package within the repository */
17444
17446
  relativePath: t.StringC;