@onivoro/onix 20.3.0 → 20.5.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 (159) hide show
  1. package/executors.json +32 -22
  2. package/package.json +6 -1
  3. package/src/executors/build-cli/executor.d.ts +2 -3
  4. package/src/executors/build-cli/executor.js +11 -14
  5. package/src/executors/build-cli/executor.js.map +1 -1
  6. package/src/executors/build-cli/schema.d.ts +1 -3
  7. package/src/executors/build-cli/schema.json +2 -7
  8. package/src/executors/deploy-ecs/executor.js +82 -0
  9. package/src/executors/deploy-ecs/executor.js.map +1 -0
  10. package/src/executors/deploy-ecs/schema.d.ts +9 -0
  11. package/src/executors/deploy-ecs/schema.json +32 -0
  12. package/src/executors/deploy-lambda/executor.d.ts +3 -0
  13. package/src/executors/deploy-lambda/executor.js +18 -0
  14. package/src/executors/deploy-lambda/executor.js.map +1 -0
  15. package/src/executors/deploy-lambda/schema.d.ts +3 -0
  16. package/src/executors/deploy-lambda/schema.json +57 -0
  17. package/src/executors/docker-run/executor.d.ts +3 -0
  18. package/src/executors/docker-run/executor.js +14 -0
  19. package/src/executors/docker-run/executor.js.map +1 -0
  20. package/src/executors/{docker → docker-run}/schema.d.ts +1 -1
  21. package/src/executors/{docker → docker-run}/schema.json +4 -4
  22. package/src/executors/local/executor.d.ts +2 -3
  23. package/src/executors/local/executor.js +9 -20
  24. package/src/executors/local/executor.js.map +1 -1
  25. package/src/executors/local/schema.d.ts +2 -3
  26. package/src/executors/local/schema.json +5 -12
  27. package/src/executors/openapi-gen/executor.d.ts +3 -0
  28. package/src/executors/openapi-gen/executor.js +11 -0
  29. package/src/executors/openapi-gen/executor.js.map +1 -0
  30. package/src/executors/openapi-gen/schema.d.ts +5 -0
  31. package/src/executors/openapi-gen/schema.json +25 -0
  32. package/src/executors/playwright/executor.d.ts +2 -3
  33. package/src/executors/playwright/executor.js +11 -15
  34. package/src/executors/playwright/executor.js.map +1 -1
  35. package/src/executors/playwright/schema.d.ts +1 -0
  36. package/src/executors/playwright/schema.json +5 -1
  37. package/src/executors/typeorm/executor.d.ts +3 -0
  38. package/src/executors/typeorm/executor.js +15 -0
  39. package/src/executors/typeorm/executor.js.map +1 -0
  40. package/src/executors/typeorm/schema.d.ts +5 -0
  41. package/src/executors/{db → typeorm}/schema.json +3 -7
  42. package/src/executors/xray/executor.d.ts +3 -0
  43. package/src/executors/xray/executor.js +21 -0
  44. package/src/executors/xray/executor.js.map +1 -0
  45. package/src/executors/xray/schema.d.ts +1 -0
  46. package/src/executors/xray/schema.json +9 -0
  47. package/src/functions/deploy-lambda.function.d.ts +17 -0
  48. package/src/functions/deploy-lambda.function.js +74 -0
  49. package/src/functions/deploy-lambda.function.js.map +1 -0
  50. package/src/functions/executor-factory.function.d.ts +5 -0
  51. package/src/functions/executor-factory.function.js +20 -0
  52. package/src/functions/executor-factory.function.js.map +1 -0
  53. package/src/functions/extract-project-build-assets.function.d.ts +2 -0
  54. package/src/functions/extract-project-build-assets.function.js +19 -0
  55. package/src/functions/extract-project-build-assets.function.js.map +1 -0
  56. package/src/functions/extract-project-build-outputs.function.d.ts +2 -0
  57. package/src/functions/extract-project-build-outputs.function.js +21 -0
  58. package/src/functions/extract-project-build-outputs.function.js.map +1 -0
  59. package/src/functions/extract-project-configuration.function.d.ts +2 -0
  60. package/src/functions/extract-project-configuration.function.js +14 -0
  61. package/src/functions/extract-project-configuration.function.js.map +1 -0
  62. package/src/functions/extract-target-configuration.function.d.ts +2 -0
  63. package/src/functions/extract-target-configuration.function.js +8 -0
  64. package/src/functions/extract-target-configuration.function.js.map +1 -0
  65. package/src/functions/interpolate.function.d.ts +2 -0
  66. package/src/functions/interpolate.function.js +8 -0
  67. package/src/functions/interpolate.function.js.map +1 -0
  68. package/src/functions/load-env-file.function.d.ts +1 -0
  69. package/src/functions/load-env-file.function.js +17 -0
  70. package/src/functions/load-env-file.function.js.map +1 -0
  71. package/src/functions/pm.function.d.ts +15 -0
  72. package/src/functions/pm.function.js +21 -0
  73. package/src/functions/pm.function.js.map +1 -0
  74. package/src/functions/pmx.function.d.ts +3 -0
  75. package/src/functions/pmx.function.js +21 -0
  76. package/src/functions/pmx.function.js.map +1 -0
  77. package/src/functions/push-image-to-ecr-wrapped.function.js +2 -1
  78. package/src/functions/push-image-to-ecr-wrapped.function.js.map +1 -1
  79. package/src/functions/push-image-to-ecr.function.d.ts +2 -3
  80. package/src/functions/push-image-to-ecr.function.js +39 -18
  81. package/src/functions/push-image-to-ecr.function.js.map +1 -1
  82. package/src/functions/resolve-aws-credentials.function.d.ts +1 -0
  83. package/src/functions/resolve-aws-credentials.function.js +15 -0
  84. package/src/functions/resolve-aws-credentials.function.js.map +1 -0
  85. package/src/functions/restart-ecs-service.function.d.ts +6 -0
  86. package/src/functions/restart-ecs-service.function.js +34 -0
  87. package/src/functions/restart-ecs-service.function.js.map +1 -0
  88. package/src/index.d.ts +17 -8
  89. package/src/index.js +17 -10
  90. package/src/index.js.map +1 -1
  91. package/src/{functions → inference}/add-db-target.function.js.map +1 -1
  92. package/src/{functions → inference}/add-db-targets.function.js.map +1 -1
  93. package/src/{functions → inference}/add-docker-deploy-target.function.js.map +1 -1
  94. package/src/{functions → inference}/add-docker-deploy-targets.function.js.map +1 -1
  95. package/src/{functions → inference}/add-docker-target.function.js.map +1 -1
  96. package/src/{functions → inference}/add-docker-targets.function.js +1 -1
  97. package/src/{functions → inference}/add-docker-targets.function.js.map +1 -1
  98. package/src/{functions → inference}/add-gen-target.function.js.map +1 -1
  99. package/src/{functions → inference}/add-serve-target.function.js.map +1 -1
  100. package/src/{functions → inference}/add-serve-targets.function.js +1 -1
  101. package/src/{functions → inference}/add-serve-targets.function.js.map +1 -1
  102. package/src/{functions → inference}/build-onix-targets.function.js.map +1 -1
  103. package/src/{functions → inference}/normalize-options.function.js.map +1 -1
  104. package/src/{functions → inference}/read-targets-cache.function.js.map +1 -1
  105. package/src/{functions → inference}/write-targets-to-cache.function.js.map +1 -1
  106. package/src/plugins/plugin.js +4 -4
  107. package/src/utils/vite-config-factory.d.ts +9 -0
  108. package/src/utils/vite-config-factory.js +48 -0
  109. package/src/utils/vite-config-factory.js.map +1 -0
  110. package/src/webpack/patch-nx-source-map-paths.function.d.ts +9 -0
  111. package/src/webpack/patch-nx-source-map-paths.function.js +13 -0
  112. package/src/webpack/patch-nx-source-map-paths.function.js.map +1 -0
  113. package/src/webpack/patch-nx-source-maps.plugin.d.ts +2 -0
  114. package/src/webpack/patch-nx-source-maps.plugin.js +11 -0
  115. package/src/webpack/patch-nx-source-maps.plugin.js.map +1 -0
  116. package/src/executors/db/executor.js +0 -20
  117. package/src/executors/db/executor.js.map +0 -1
  118. package/src/executors/db/schema.d.ts +0 -6
  119. package/src/executors/deploy/executor.d.ts +0 -4
  120. package/src/executors/deploy/executor.js +0 -33
  121. package/src/executors/deploy/executor.js.map +0 -1
  122. package/src/executors/deploy/schema.d.ts +0 -5
  123. package/src/executors/deploy/schema.json +0 -28
  124. package/src/executors/docker/executor.d.ts +0 -4
  125. package/src/executors/docker/executor.js +0 -24
  126. package/src/executors/docker/executor.js.map +0 -1
  127. package/src/executors/gen/executor.d.ts +0 -4
  128. package/src/executors/gen/executor.js +0 -19
  129. package/src/executors/gen/executor.js.map +0 -1
  130. package/src/executors/gen/schema.d.ts +0 -3
  131. package/src/executors/gen/schema.json +0 -14
  132. package/src/functions/create-nodes-internal.function.d.ts +0 -0
  133. package/src/functions/create-nodes-internal.function.js +0 -1
  134. package/src/functions/create-nodes-internal.function.js.map +0 -1
  135. /package/src/executors/{db → deploy-ecs}/executor.d.ts +0 -0
  136. /package/src/{functions → inference}/add-db-target.function.d.ts +0 -0
  137. /package/src/{functions → inference}/add-db-target.function.js +0 -0
  138. /package/src/{functions → inference}/add-db-targets.function.d.ts +0 -0
  139. /package/src/{functions → inference}/add-db-targets.function.js +0 -0
  140. /package/src/{functions → inference}/add-docker-deploy-target.function.d.ts +0 -0
  141. /package/src/{functions → inference}/add-docker-deploy-target.function.js +0 -0
  142. /package/src/{functions → inference}/add-docker-deploy-targets.function.d.ts +0 -0
  143. /package/src/{functions → inference}/add-docker-deploy-targets.function.js +0 -0
  144. /package/src/{functions → inference}/add-docker-target.function.d.ts +0 -0
  145. /package/src/{functions → inference}/add-docker-target.function.js +0 -0
  146. /package/src/{functions → inference}/add-docker-targets.function.d.ts +0 -0
  147. /package/src/{functions → inference}/add-gen-target.function.d.ts +0 -0
  148. /package/src/{functions → inference}/add-gen-target.function.js +0 -0
  149. /package/src/{functions → inference}/add-serve-target.function.d.ts +0 -0
  150. /package/src/{functions → inference}/add-serve-target.function.js +0 -0
  151. /package/src/{functions → inference}/add-serve-targets.function.d.ts +0 -0
  152. /package/src/{functions → inference}/build-onix-targets.function.d.ts +0 -0
  153. /package/src/{functions → inference}/build-onix-targets.function.js +0 -0
  154. /package/src/{functions → inference}/normalize-options.function.d.ts +0 -0
  155. /package/src/{functions → inference}/normalize-options.function.js +0 -0
  156. /package/src/{functions → inference}/read-targets-cache.function.d.ts +0 -0
  157. /package/src/{functions → inference}/read-targets-cache.function.js +0 -0
  158. /package/src/{functions → inference}/write-targets-to-cache.function.d.ts +0 -0
  159. /package/src/{functions → inference}/write-targets-to-cache.function.js +0 -0
@@ -3,19 +3,15 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  const tslib_1 = require("tslib");
4
4
  const devkit_1 = require("@nx/devkit");
5
5
  const child_process_1 = require("child_process");
6
- const get_project_path_from_name_function_1 = require("../../utils/get-project-path-from-name.function");
7
- const runExecutor = (options, context) => tslib_1.__awaiter(void 0, void 0, void 0, function* () {
8
- try {
9
- const command = `playwright test -c ${(0, get_project_path_from_name_function_1.getProjectPathFromName)(context.projectName)}/playwright.config.ts`;
10
- devkit_1.logger.info(command);
11
- (0, child_process_1.execSync)(command, { stdio: 'inherit' });
12
- return {
13
- success: true,
14
- };
15
- }
16
- catch (error) {
17
- return { success: false };
18
- }
19
- });
20
- exports.default = runExecutor;
6
+ const executor_factory_function_1 = require("../../functions/executor-factory.function");
7
+ const load_env_file_function_1 = require("../../functions/load-env-file.function");
8
+ const extract_project_configuration_function_1 = require("../../functions/extract-project-configuration.function");
9
+ exports.default = (0, executor_factory_function_1.executorFactory)((options, context) => tslib_1.__awaiter(void 0, void 0, void 0, function* () {
10
+ const { envFile } = options;
11
+ (0, load_env_file_function_1.loadEnvFile)(envFile);
12
+ const root = (0, extract_project_configuration_function_1.extractProjectConfiguration)(context, context.projectName).root;
13
+ const command = `playwright test -c ${root}/playwright.config.ts`;
14
+ devkit_1.logger.info(command);
15
+ (0, child_process_1.execSync)(command, { stdio: 'inherit' });
16
+ }));
21
17
  //# sourceMappingURL=executor.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"executor.js","sourceRoot":"","sources":["../../../../../onix/src/executors/playwright/executor.ts"],"names":[],"mappings":";;;AAAA,uCAAqD;AAErD,iDAAyC;AACzC,yGAAyF;AAEzF,MAAM,WAAW,GAAoC,CAAO,OAAO,EAAE,OAAO,EAAE,EAAE;IAC9E,IAAI,CAAC;QACH,MAAM,OAAO,GAAG,sBAAsB,IAAA,4DAAsB,EAAC,OAAO,CAAC,WAAY,CAAC,uBAAuB,CAAC;QAE1G,eAAM,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;QAErB,IAAA,wBAAQ,EAAC,OAAO,EAAE,EAAE,KAAK,EAAE,SAAS,EAAE,CAAC,CAAC;QAExC,OAAO;YACL,OAAO,EAAE,IAAI;SACd,CAAC;IACJ,CAAC;IAAC,OAAO,KAAK,EAAE,CAAC;QACf,OAAO,EAAE,OAAO,EAAE,KAAK,EAAE,CAAC;IAC5B,CAAC;AACH,CAAC,CAAA,CAAC;AAEF,kBAAe,WAAW,CAAC"}
1
+ {"version":3,"file":"executor.js","sourceRoot":"","sources":["../../../../../onix/src/executors/playwright/executor.ts"],"names":[],"mappings":";;;AAAA,uCAAoC;AAEpC,iDAAyC;AACzC,yFAA4E;AAC5E,mFAAqE;AACrE,mHAAqG;AAErG,kBAAe,IAAA,2CAAe,EAAC,CAAO,OAAuB,EAAE,OAAO,EAAE,EAAE;IACxE,MAAM,EAAE,OAAO,EAAE,GAAG,OAAO,CAAC;IAE5B,IAAA,oCAAW,EAAC,OAAO,CAAC,CAAC;IAErB,MAAM,IAAI,GAAG,IAAA,oEAA2B,EAAC,OAAO,EAAE,OAAO,CAAC,WAAW,CAAC,CAAC,IAAI,CAAC;IAE5E,MAAM,OAAO,GAAG,sBAAsB,IAAI,uBAAuB,CAAC;IAElE,eAAM,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;IAErB,IAAA,wBAAQ,EAAC,OAAO,EAAE,EAAE,KAAK,EAAE,SAAS,EAAE,CAAC,CAAC;AAC1C,CAAC,CAAA,CAAC,CAAC"}
@@ -1,2 +1,3 @@
1
1
  export interface ExecutorSchema {
2
+ envFile?: string;
2
3
  }
@@ -1,10 +1,14 @@
1
1
  {
2
2
  "$schema": "https://json-schema.org/schema",
3
3
  "version": 2,
4
- "title": "Gen executor",
4
+ "title": "Playwright executor",
5
5
  "description": "",
6
6
  "type": "object",
7
7
  "properties": {
8
+ "envFile": {
9
+ "type": "string",
10
+ "description": "Path and name of the .env file to load"
11
+ }
8
12
  },
9
13
  "required": []
10
14
  }
@@ -0,0 +1,3 @@
1
+ import { ExecutorSchema } from './schema';
2
+ declare const _default: import("@nx/devkit").PromiseExecutor<ExecutorSchema>;
3
+ export default _default;
@@ -0,0 +1,15 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ const tslib_1 = require("tslib");
4
+ const devkit_1 = require("@nx/devkit");
5
+ const child_process_1 = require("child_process");
6
+ const load_env_file_function_1 = require("../../functions/load-env-file.function");
7
+ const executor_factory_function_1 = require("../../functions/executor-factory.function");
8
+ const pm_function_1 = require("../../functions/pm.function");
9
+ exports.default = (0, executor_factory_function_1.executorFactory)((options, context) => tslib_1.__awaiter(void 0, void 0, void 0, function* () {
10
+ const { envFile, ormConfigPath, runOrRevert } = options;
11
+ (0, load_env_file_function_1.loadEnvFile)(envFile);
12
+ devkit_1.logger.info(`PACKAGE.JSON SHOULD HAVE A SCRIPT NAMED "typeorm" IN ORDER TO USE THIS EXECUTOR`);
13
+ (0, child_process_1.execSync)(`${(0, pm_function_1.pm)(context).run} run typeorm -- -d ${ormConfigPath} migration:${runOrRevert} -t=false`, { stdio: 'inherit' });
14
+ }));
15
+ //# sourceMappingURL=executor.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"executor.js","sourceRoot":"","sources":["../../../../../onix/src/executors/typeorm/executor.ts"],"names":[],"mappings":";;;AAAA,uCAAqD;AAErD,iDAAyC;AACzC,mFAAqE;AACrE,yFAA4E;AAC5E,6DAAiD;AAEjD,kBAAe,IAAA,2CAAe,EAAC,CAC7B,OAAuB,EACvB,OAAwB,EACxB,EAAE;IACF,MAAM,EAAE,OAAO,EAAE,aAAa,EAAE,WAAW,EAAE,GAAG,OAAO,CAAC;IAExD,IAAA,oCAAW,EAAC,OAAO,CAAC,CAAC;IAErB,eAAM,CAAC,IAAI,CAAC,iFAAiF,CAAC,CAAA;IAE9F,IAAA,wBAAQ,EAAC,GAAG,IAAA,gBAAE,EAAC,OAAO,CAAC,CAAC,GAAG,sBAAsB,aAAa,cAAc,WAAW,WAAW,EAAE,EAAE,KAAK,EAAE,SAAS,EAAE,CAAC,CAAC;AAC5H,CAAC,CAAA,CAAC,CAAC"}
@@ -0,0 +1,5 @@
1
+ export interface ExecutorSchema {
2
+ envFile: string;
3
+ ormConfigPath: string;
4
+ runOrRevert: 'run' | 'revert';
5
+ }
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "$schema": "https://json-schema.org/schema",
3
3
  "version": 2,
4
- "title": "Db executor",
4
+ "title": "TypeORM executor",
5
5
  "description": "",
6
6
  "type": "object",
7
7
  "properties": {
@@ -9,20 +9,16 @@
9
9
  "type": "string",
10
10
  "description": "TypeORM CLI command: 'run' or 'revert'"
11
11
  },
12
- "envPath": {
12
+ "envFile": {
13
13
  "type": "string",
14
14
  "description": "Path and name of the .env file to load"
15
15
  },
16
- "envKey": {
17
- "type": "string",
18
- "description": "Name of the environment variable that points to the location of the envFile"
19
- },
20
16
  "ormConfigPath": {
21
17
  "type": "string",
22
18
  "description": "Path and name of the ormconfig"
23
19
  }
24
20
  },
25
21
  "required": [
26
- "envPath", "envKey", "ormConfigPath"
22
+ "envFile", "ormConfigPath"
27
23
  ]
28
24
  }
@@ -0,0 +1,3 @@
1
+ import { ExecutorSchema } from './schema';
2
+ declare const _default: import("@nx/devkit").PromiseExecutor<ExecutorSchema>;
3
+ export default _default;
@@ -0,0 +1,21 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ const tslib_1 = require("tslib");
4
+ const devkit_1 = require("@nx/devkit");
5
+ const promises_1 = require("fs/promises");
6
+ const executor_factory_function_1 = require("../../functions/executor-factory.function");
7
+ exports.default = (0, executor_factory_function_1.executorFactory)((options, context) => tslib_1.__awaiter(void 0, void 0, void 0, function* () {
8
+ const wl = (0, devkit_1.workspaceLayout)();
9
+ const to = (0, devkit_1.readTargetOptions)({ project: context.projectName, target: context.targetName }, context);
10
+ const packageManager = (0, devkit_1.detectPackageManager)(context.root);
11
+ const packageManagerCommand = (0, devkit_1.getPackageManagerCommand)(packageManager);
12
+ yield (0, promises_1.writeFile)(`xray-${Date.now()}.json`, JSON.stringify({
13
+ packageManager,
14
+ packageManagerCommand,
15
+ options,
16
+ context,
17
+ workspaceLayout: wl,
18
+ targetOptions: to,
19
+ }, null, 2));
20
+ }));
21
+ //# sourceMappingURL=executor.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"executor.js","sourceRoot":"","sources":["../../../../../onix/src/executors/xray/executor.ts"],"names":[],"mappings":";;;AAAA,uCAOoB;AAEpB,0CAAwC;AACxC,yFAA4E;AAE5E,kBAAe,IAAA,2CAAe,EAAC,CAC7B,OAAuB,EACvB,OAAwB,EACxB,EAAE;IACF,MAAM,EAAE,GAAG,IAAA,wBAAe,GAAE,CAAC;IAC7B,MAAM,EAAE,GAAG,IAAA,0BAAiB,EAAC,EAAE,OAAO,EAAE,OAAO,CAAC,WAAW,EAAE,MAAM,EAAE,OAAO,CAAC,UAAU,EAAE,EAAE,OAAO,CAAC,CAAC;IACpG,MAAM,cAAc,GAAG,IAAA,6BAAoB,EAAC,OAAO,CAAC,IAAI,CAAC,CAAC;IAC1D,MAAM,qBAAqB,GAAG,IAAA,iCAAwB,EAAC,cAAc,CAAC,CAAC;IAEvE,MAAM,IAAA,oBAAS,EAAC,QAAQ,IAAI,CAAC,GAAG,EAAE,OAAO,EAAE,IAAI,CAAC,SAAS,CAAC;QACxD,cAAc;QACd,qBAAqB;QACrB,OAAO;QACP,OAAO;QACP,eAAe,EAAE,EAAE;QACnB,aAAa,EAAE,EAAE;KAClB,EAAE,IAAI,EAAE,CAAC,CAAC,CAAC,CAAC;AACf,CAAC,CAAA,CAAC,CAAC"}
@@ -0,0 +1 @@
1
+ export interface ExecutorSchema {}
@@ -0,0 +1,9 @@
1
+ {
2
+ "$schema": "https://json-schema.org/schema",
3
+ "version": 2,
4
+ "title": "Xray executor",
5
+ "description": "",
6
+ "type": "object",
7
+ "properties": {},
8
+ "required": []
9
+ }
@@ -0,0 +1,17 @@
1
+ import { Runtime } from "@aws-sdk/client-lambda";
2
+ export interface DeployLambdaConfig {
3
+ bucket: string;
4
+ functionName: string;
5
+ profile?: string;
6
+ region: string;
7
+ sourcePath: string;
8
+ roleArn: string;
9
+ runtime?: Runtime;
10
+ handler?: string;
11
+ memorySize?: number;
12
+ delayMs?: number;
13
+ environment?: {
14
+ [key: string]: string;
15
+ };
16
+ }
17
+ export declare function deployLambda({ functionName, sourcePath, region, bucket, roleArn, runtime, handler, memorySize, environment, delayMs, profile, }: DeployLambdaConfig): Promise<void>;
@@ -0,0 +1,74 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.deployLambda = deployLambda;
4
+ const tslib_1 = require("tslib");
5
+ const client_s3_1 = require("@aws-sdk/client-s3");
6
+ const client_lambda_1 = require("@aws-sdk/client-lambda");
7
+ const AdmZip = require("adm-zip");
8
+ const resolve_aws_credentials_function_1 = require("./resolve-aws-credentials.function");
9
+ function deployLambda(_a) {
10
+ return tslib_1.__awaiter(this, arguments, void 0, function* ({ functionName, sourcePath, region, bucket, roleArn, runtime = client_lambda_1.Runtime.nodejs22x, handler = 'index.handler', memorySize = 128, environment, delayMs = 5000, profile, }) {
11
+ const s3Client = new client_s3_1.S3Client({ region, credentials: (0, resolve_aws_credentials_function_1.resolveAwsCredentials)(profile) });
12
+ const lambdaClient = new client_lambda_1.LambdaClient({ region, credentials: (0, resolve_aws_credentials_function_1.resolveAwsCredentials)(profile) });
13
+ const zip = new AdmZip();
14
+ zip.addLocalFolder(sourcePath);
15
+ const zipBuffer = zip.toBuffer();
16
+ const key = `${functionName}.zip`;
17
+ yield s3Client.send(new client_s3_1.PutObjectCommand({
18
+ Bucket: bucket,
19
+ Key: key,
20
+ Body: zipBuffer
21
+ }));
22
+ const envVars = environment ? {
23
+ Variables: environment
24
+ } : undefined;
25
+ let functionExists = true;
26
+ let currentConfig;
27
+ try {
28
+ const response = yield lambdaClient.send(new client_lambda_1.GetFunctionCommand({
29
+ FunctionName: functionName
30
+ }));
31
+ currentConfig = response.Configuration;
32
+ }
33
+ catch (error) {
34
+ if (error.name === 'ResourceNotFoundException') {
35
+ functionExists = false;
36
+ }
37
+ else {
38
+ throw error;
39
+ }
40
+ }
41
+ if (!functionExists) {
42
+ yield lambdaClient.send(new client_lambda_1.CreateFunctionCommand({
43
+ FunctionName: functionName,
44
+ Runtime: runtime,
45
+ Role: roleArn,
46
+ Handler: handler,
47
+ Code: {
48
+ S3Bucket: bucket,
49
+ S3Key: key
50
+ },
51
+ MemorySize: memorySize,
52
+ Environment: envVars
53
+ }));
54
+ }
55
+ else {
56
+ let updatedEnvVars = envVars;
57
+ yield lambdaClient.send(new client_lambda_1.UpdateFunctionConfigurationCommand({
58
+ FunctionName: functionName,
59
+ Role: roleArn,
60
+ Handler: handler,
61
+ Runtime: runtime,
62
+ MemorySize: memorySize,
63
+ Environment: updatedEnvVars,
64
+ }));
65
+ yield new Promise(resolve => setTimeout(resolve, delayMs));
66
+ yield lambdaClient.send(new client_lambda_1.UpdateFunctionCodeCommand({
67
+ FunctionName: functionName,
68
+ S3Bucket: bucket,
69
+ S3Key: key
70
+ }));
71
+ }
72
+ });
73
+ }
74
+ //# sourceMappingURL=deploy-lambda.function.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"deploy-lambda.function.js","sourceRoot":"","sources":["../../../../onix/src/functions/deploy-lambda.function.ts"],"names":[],"mappings":"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"}
@@ -0,0 +1,5 @@
1
+ import { ExecutorContext, PromiseExecutor } from "@nx/devkit";
2
+ export type TOnixPromiseExecutor<TExecutorSchema = any> = (options: TExecutorSchema, context: ExecutorContext) => Promise<void | {
3
+ success: boolean;
4
+ }>;
5
+ export declare function executorFactory<TExecutorSchema>(executor: TOnixPromiseExecutor<TExecutorSchema>): PromiseExecutor<TExecutorSchema>;
@@ -0,0 +1,20 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.executorFactory = executorFactory;
4
+ const tslib_1 = require("tslib");
5
+ const devkit_1 = require("@nx/devkit");
6
+ function executorFactory(executor) {
7
+ const runExecutor = (options, context) => tslib_1.__awaiter(this, void 0, void 0, function* () {
8
+ try {
9
+ return (yield executor(options, context)) || { success: true };
10
+ }
11
+ catch (error) {
12
+ devkit_1.logger.error((error === null || error === void 0 ? void 0 : error.message) || error);
13
+ return {
14
+ success: false,
15
+ };
16
+ }
17
+ });
18
+ return runExecutor;
19
+ }
20
+ //# sourceMappingURL=executor-factory.function.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"executor-factory.function.js","sourceRoot":"","sources":["../../../../onix/src/functions/executor-factory.function.ts"],"names":[],"mappings":";;AAOA,0CAkBC;;AAzBD,uCAAsE;AAOtE,SAAgB,eAAe,CAAkB,QAA+C;IAE5F,MAAM,WAAW,GAAqC,CAClD,OAAwB,EACxB,OAAwB,EAC1B,EAAE;QACA,IAAI,CAAC;YACD,OAAO,CAAC,MAAM,QAAQ,CAAC,OAAO,EAAE,OAAO,CAAC,CAAC,IAAI,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC;QACnE,CAAC;QAAC,OAAO,KAAK,EAAE,CAAC;YACb,eAAM,CAAC,KAAK,CAAC,CAAA,KAAK,aAAL,KAAK,uBAAL,KAAK,CAAE,OAAO,KAAI,KAAK,CAAC,CAAC;YAEtC,OAAO;gBACH,OAAO,EAAE,KAAK;aACjB,CAAC;QACN,CAAC;IACL,CAAC,CAAA,CAAA;IAED,OAAO,WAAW,CAAC;AACvB,CAAC"}
@@ -0,0 +1,2 @@
1
+ import { ExecutorContext } from "@nx/devkit";
2
+ export declare function extractProjectBuildAssets(context: ExecutorContext, projectName: string): string[];
@@ -0,0 +1,19 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.extractProjectBuildAssets = extractProjectBuildAssets;
4
+ const devkit_1 = require("@nx/devkit");
5
+ const extract_project_configuration_function_1 = require("./extract-project-configuration.function");
6
+ function extractProjectBuildAssets(context, projectName) {
7
+ var _a, _b;
8
+ const projectConfiguration = (0, extract_project_configuration_function_1.extractProjectConfiguration)(context, projectName);
9
+ if (projectConfiguration) {
10
+ if ((_a = projectConfiguration.targets) === null || _a === void 0 ? void 0 : _a.build) {
11
+ return ((_b = projectConfiguration.targets.build.options) === null || _b === void 0 ? void 0 : _b.assets) || [];
12
+ }
13
+ else {
14
+ devkit_1.logger.warn(`project "${projectName}" does not have a "build" target`);
15
+ }
16
+ }
17
+ return [];
18
+ }
19
+ //# sourceMappingURL=extract-project-build-assets.function.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"extract-project-build-assets.function.js","sourceRoot":"","sources":["../../../../onix/src/functions/extract-project-build-assets.function.ts"],"names":[],"mappings":";;AAGA,8DAYC;AAfD,uCAAqD;AACrD,qGAAuF;AAEvF,SAAgB,yBAAyB,CAAE,OAAwB,EAAE,WAAmB;;IACpF,MAAM,oBAAoB,GAAG,IAAA,oEAA2B,EAAC,OAAO,EAAE,WAAW,CAAC,CAAC;IAE/E,IAAI,oBAAoB,EAAE,CAAC;QACvB,IAAG,MAAA,oBAAoB,CAAC,OAAO,0CAAE,KAAK,EAAE,CAAC;YACrC,OAAO,CAAA,MAAA,oBAAoB,CAAC,OAAO,CAAC,KAAK,CAAC,OAAO,0CAAE,MAAM,KAAI,EAAE,CAAC;QACpE,CAAC;aAAM,CAAC;YACJ,eAAM,CAAC,IAAI,CAAC,YAAY,WAAW,kCAAkC,CAAC,CAAA;QAC1E,CAAC;IACL,CAAC;IAED,OAAO,EAAE,CAAC;AACd,CAAC"}
@@ -0,0 +1,2 @@
1
+ import { ExecutorContext } from "@nx/devkit";
2
+ export declare function extractProjectBuildOutputs(context: ExecutorContext, projectName: string): string[];
@@ -0,0 +1,21 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.extractProjectBuildOutputs = extractProjectBuildOutputs;
4
+ const devkit_1 = require("@nx/devkit");
5
+ const extract_project_configuration_function_1 = require("./extract-project-configuration.function");
6
+ const interpolate_function_1 = require("./interpolate.function");
7
+ function extractProjectBuildOutputs(context, projectName) {
8
+ var _a, _b;
9
+ const projectConfiguration = (0, extract_project_configuration_function_1.extractProjectConfiguration)(context, projectName);
10
+ if (projectConfiguration) {
11
+ if ((_a = projectConfiguration === null || projectConfiguration === void 0 ? void 0 : projectConfiguration.targets) === null || _a === void 0 ? void 0 : _a.build) {
12
+ const output = ((_b = projectConfiguration.targets.build.options) === null || _b === void 0 ? void 0 : _b.outputPath) || projectConfiguration.targets.build.outputs || [];
13
+ return (output instanceof Array ? output : [output]).map((_) => (0, interpolate_function_1.interpolate)(context, _));
14
+ }
15
+ else {
16
+ devkit_1.logger.warn(`project "${projectName}" does not have a "build" target`);
17
+ }
18
+ }
19
+ return [];
20
+ }
21
+ //# sourceMappingURL=extract-project-build-outputs.function.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"extract-project-build-outputs.function.js","sourceRoot":"","sources":["../../../../onix/src/functions/extract-project-build-outputs.function.ts"],"names":[],"mappings":";;AAIA,gEAcC;AAlBD,uCAAqD;AACrD,qGAAuF;AACvF,iEAAqD;AAErD,SAAgB,0BAA0B,CAAC,OAAwB,EAAE,WAAmB;;IACpF,MAAM,oBAAoB,GAAG,IAAA,oEAA2B,EAAC,OAAO,EAAE,WAAW,CAAC,CAAC;IAE/E,IAAI,oBAAoB,EAAE,CAAC;QACvB,IAAI,MAAA,oBAAoB,aAApB,oBAAoB,uBAApB,oBAAoB,CAAE,OAAO,0CAAE,KAAK,EAAE,CAAC;YACvC,MAAM,MAAM,GAAG,CAAA,MAAA,oBAAoB,CAAC,OAAO,CAAC,KAAK,CAAC,OAAO,0CAAE,UAAU,KAAI,oBAAoB,CAAC,OAAO,CAAC,KAAK,CAAC,OAAO,IAAI,EAAE,CAAC;YAE1H,OAAO,CAAC,MAAM,YAAY,KAAK,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAS,EAAE,EAAE,CAAC,IAAA,kCAAW,EAAC,OAAO,EAAE,CAAC,CAAC,CAAC,CAAC;QACrG,CAAC;aAAM,CAAC;YACJ,eAAM,CAAC,IAAI,CAAC,YAAY,WAAW,kCAAkC,CAAC,CAAA;QAC1E,CAAC;IACL,CAAC;IAED,OAAO,EAAE,CAAC;AACd,CAAC"}
@@ -0,0 +1,2 @@
1
+ import { ExecutorContext } from "@nx/devkit";
2
+ export declare function extractProjectConfiguration(context: ExecutorContext, projectName: string): import("@nx/devkit").ProjectConfiguration;
@@ -0,0 +1,14 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.extractProjectConfiguration = extractProjectConfiguration;
4
+ const devkit_1 = require("@nx/devkit");
5
+ function extractProjectConfiguration(context, projectName) {
6
+ const projectConfiguration = context.projectsConfigurations.projects[projectName];
7
+ if (projectConfiguration) {
8
+ return projectConfiguration;
9
+ }
10
+ else {
11
+ devkit_1.logger.warn(`cannot locate project configuration for specified projectName "${projectName}" among ${Object.keys(context.projectsConfigurations.projects).map(_ => `"${_}"`).join(', ')}`);
12
+ }
13
+ }
14
+ //# sourceMappingURL=extract-project-configuration.function.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"extract-project-configuration.function.js","sourceRoot":"","sources":["../../../../onix/src/functions/extract-project-configuration.function.ts"],"names":[],"mappings":";;AAEA,kEAQC;AAVD,uCAAqD;AAErD,SAAgB,2BAA2B,CAAC,OAAwB,EAAE,WAAmB;IACrF,MAAM,oBAAoB,GAAG,OAAO,CAAC,sBAAsB,CAAC,QAAQ,CAAC,WAAW,CAAC,CAAC;IAElF,IAAI,oBAAoB,EAAE,CAAC;QACvB,OAAO,oBAAoB,CAAC;IAChC,CAAC;SAAM,CAAC;QACJ,eAAM,CAAC,IAAI,CAAC,kEAAkE,WAAW,WAAW,MAAM,CAAC,IAAI,CAAC,OAAO,CAAC,sBAAsB,CAAC,QAAQ,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;IAC9L,CAAC;AACL,CAAC"}
@@ -0,0 +1,2 @@
1
+ import { ExecutorContext } from "@nx/devkit";
2
+ export declare function extractTargetConfiguration(context: ExecutorContext): any;
@@ -0,0 +1,8 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.extractTargetConfiguration = extractTargetConfiguration;
4
+ function extractTargetConfiguration(context) {
5
+ var _a;
6
+ return (((_a = context === null || context === void 0 ? void 0 : context.target) === null || _a === void 0 ? void 0 : _a.configurations) || {})[(context === null || context === void 0 ? void 0 : context.configurationName) || 'N/A'];
7
+ }
8
+ //# sourceMappingURL=extract-target-configuration.function.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"extract-target-configuration.function.js","sourceRoot":"","sources":["../../../../onix/src/functions/extract-target-configuration.function.ts"],"names":[],"mappings":";;AAEA,gEAIC;AAJD,SAAgB,0BAA0B,CACtC,OAAwB;;IAExB,OAAO,CAAC,CAAA,MAAA,OAAO,aAAP,OAAO,uBAAP,OAAO,CAAE,MAAM,0CAAE,cAAc,KAAI,EAAE,CAAC,CAAC,CAAA,OAAO,aAAP,OAAO,uBAAP,OAAO,CAAE,iBAAiB,KAAI,KAAK,CAAC,CAAC;AACxF,CAAC"}
@@ -0,0 +1,2 @@
1
+ import { ExecutorContext } from "@nx/devkit";
2
+ export declare function interpolate(context: ExecutorContext, expression: string): string;
@@ -0,0 +1,8 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.interpolate = interpolate;
4
+ function interpolate(context, expression) {
5
+ const replacements = { workspaceRoot: context.root };
6
+ return Object.entries(replacements).reduce((_, [find, replace]) => _.replace('{' + find + '}', replace), expression || '');
7
+ }
8
+ //# sourceMappingURL=interpolate.function.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"interpolate.function.js","sourceRoot":"","sources":["../../../../onix/src/functions/interpolate.function.ts"],"names":[],"mappings":";;AAEA,kCAIC;AAJD,SAAgB,WAAW,CAAE,OAAwB,EAAE,UAAkB;IACrE,MAAM,YAAY,GAAG,EAAC,aAAa,EAAE,OAAO,CAAC,IAAI,EAAC,CAAC;IAEnD,OAAO,MAAM,CAAC,OAAO,CAAC,YAAY,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,CAAC,IAAI,EAAE,OAAO,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,OAAO,CAAC,GAAG,GAAG,IAAI,GAAG,GAAG,EAAE,OAAO,CAAC,EAAE,UAAU,IAAI,EAAE,CAAC,CAAC;AAC/H,CAAC"}
@@ -0,0 +1 @@
1
+ export declare function loadEnvFile(envFile?: string | undefined): void;
@@ -0,0 +1,17 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.loadEnvFile = loadEnvFile;
4
+ const devkit_1 = require("@nx/devkit");
5
+ const fs_1 = require("fs");
6
+ const process_1 = require("process");
7
+ function loadEnvFile(envFile) {
8
+ if (envFile) {
9
+ if ((0, fs_1.existsSync)(envFile)) {
10
+ (0, process_1.loadEnvFile)(envFile);
11
+ }
12
+ else {
13
+ devkit_1.logger.warn(`specified environment path "${envFile}" does not exist`);
14
+ }
15
+ }
16
+ }
17
+ //# sourceMappingURL=load-env-file.function.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"load-env-file.function.js","sourceRoot":"","sources":["../../../../onix/src/functions/load-env-file.function.ts"],"names":[],"mappings":";;AAIA,kCAQC;AAZD,uCAAoC;AACpC,2BAAgC;AAChC,qCAAyD;AAEzD,SAAgB,WAAW,CAAC,OAA4B;IACpD,IAAI,OAAO,EAAE,CAAC;QACV,IAAG,IAAA,eAAU,EAAC,OAAO,CAAC,EAAE,CAAC;YACrB,IAAA,qBAAe,EAAC,OAAO,CAAC,CAAC;QAC7B,CAAC;aAAM,CAAC;YACJ,eAAM,CAAC,IAAI,CAAC,+BAA+B,OAAO,kBAAkB,CAAC,CAAC;QAC1E,CAAC;IACL,CAAC;AACL,CAAC"}
@@ -0,0 +1,15 @@
1
+ import { ExecutorContext } from '@nx/devkit';
2
+ export declare function pm(context: ExecutorContext): {
3
+ run: import("@nx/devkit").PackageManager;
4
+ preInstall?: string;
5
+ install: string;
6
+ ciInstall: string;
7
+ updateLockFile: string;
8
+ add: string;
9
+ addDev: string;
10
+ rm: string;
11
+ exec: string;
12
+ dlx: string;
13
+ list: string;
14
+ getRegistryUrl?: string;
15
+ };
@@ -0,0 +1,21 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.pm = pm;
4
+ const devkit_1 = require("@nx/devkit");
5
+ function pm(context) {
6
+ const run = (0, devkit_1.detectPackageManager)(context.root);
7
+ return Object.assign(Object.assign({}, (0, devkit_1.getPackageManagerCommand)(run)), { run });
8
+ }
9
+ // {
10
+ // "run": "bun | npm" // special customization here
11
+ // "install": "bun install",
12
+ // "ciInstall": "bun install --no-cache",
13
+ // "updateLockFile": "bun install --frozen-lockfile",
14
+ // "add": "bun install",
15
+ // "addDev": "bun install -D",
16
+ // "rm": "bun rm",
17
+ // "exec": "bun",
18
+ // "dlx": "bunx",
19
+ // "list": "bun pm ls"
20
+ // },
21
+ //# sourceMappingURL=pm.function.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"pm.function.js","sourceRoot":"","sources":["../../../../onix/src/functions/pm.function.ts"],"names":[],"mappings":";;AAMA,gBAGC;AATD,uCAIoB;AAEpB,SAAgB,EAAE,CAAC,OAAwB;IACvC,MAAM,GAAG,GAAG,IAAA,6BAAoB,EAAC,OAAO,CAAC,IAAI,CAAC,CAAC;IAC/C,uCAAW,IAAA,iCAAwB,EAAC,GAAG,CAAC,KAAE,GAAG,IAAG;AACpD,CAAC;AAED,IAAI;AACJ,qDAAqD;AACrD,8BAA8B;AAC9B,2CAA2C;AAC3C,uDAAuD;AACvD,0BAA0B;AAC1B,gCAAgC;AAChC,oBAAoB;AACpB,mBAAmB;AACnB,mBAAmB;AACnB,wBAAwB;AACxB,KAAK"}
@@ -0,0 +1,3 @@
1
+ import { ExecutorContext } from '@nx/devkit';
2
+ export declare function pmxSpawn(context: ExecutorContext, command: string): void;
3
+ export declare function pmxExec(context: ExecutorContext, command: string): void;
@@ -0,0 +1,21 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.pmxSpawn = pmxSpawn;
4
+ exports.pmxExec = pmxExec;
5
+ const devkit_1 = require("@nx/devkit");
6
+ const child_process_1 = require("child_process");
7
+ const pm_function_1 = require("./pm.function");
8
+ function pmxSpawn(context, command) {
9
+ const { dlx } = (0, pm_function_1.pm)(context);
10
+ const completeCommand = `${dlx} ${command}`;
11
+ devkit_1.logger.info(completeCommand);
12
+ const [program, ...args] = completeCommand.split(' ');
13
+ (0, child_process_1.spawnSync)(program, args, { stdio: 'inherit' });
14
+ }
15
+ function pmxExec(context, command) {
16
+ const { dlx } = (0, pm_function_1.pm)(context);
17
+ const completeCommand = `${dlx} ${command}`;
18
+ devkit_1.logger.info(completeCommand);
19
+ (0, child_process_1.execSync)(completeCommand, { stdio: 'inherit' });
20
+ }
21
+ //# sourceMappingURL=pmx.function.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"pmx.function.js","sourceRoot":"","sources":["../../../../onix/src/functions/pmx.function.ts"],"names":[],"mappings":";;AAOA,4BAUC;AAED,0BAQC;AA3BD,uCAGoB;AACpB,iDAAoD;AACpD,+CAAmC;AAEnC,SAAgB,QAAQ,CAAC,OAAwB,EAAE,OAAe;IAC9D,MAAM,EAAE,GAAG,EAAE,GAAG,IAAA,gBAAE,EAAC,OAAO,CAAC,CAAC;IAE5B,MAAM,eAAe,GAAG,GAAG,GAAG,IAAI,OAAO,EAAE,CAAC;IAE5C,eAAM,CAAC,IAAI,CAAC,eAAe,CAAC,CAAC;IAE7B,MAAM,CAAC,OAAO,EAAE,GAAG,IAAI,CAAC,GAAG,eAAe,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;IAEtD,IAAA,yBAAS,EAAC,OAAO,EAAE,IAAI,EAAE,EAAE,KAAK,EAAE,SAAS,EAAE,CAAC,CAAC;AACnD,CAAC;AAED,SAAgB,OAAO,CAAC,OAAwB,EAAE,OAAe;IAC7D,MAAM,EAAE,GAAG,EAAE,GAAG,IAAA,gBAAE,EAAC,OAAO,CAAC,CAAC;IAE5B,MAAM,eAAe,GAAG,GAAG,GAAG,IAAI,OAAO,EAAE,CAAC;IAE5C,eAAM,CAAC,IAAI,CAAC,eAAe,CAAC,CAAC;IAE7B,IAAA,wBAAQ,EAAC,eAAe,EAAE,EAAE,KAAK,EAAE,SAAS,EAAE,CAAC,CAAC;AACpD,CAAC"}
@@ -3,12 +3,13 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.pushImageToECRWrapped = pushImageToECRWrapped;
4
4
  const tslib_1 = require("tslib");
5
5
  const push_image_to_ecr_function_1 = require("./push-image-to-ecr.function");
6
+ // TODO: DELETE THIS ABSTRACTION NOW THAT THE UNDERLYING FUNCTION ISN'T GOING TO CHANGE
6
7
  function pushImageToECRWrapped(_) {
7
8
  return tslib_1.__awaiter(this, void 0, void 0, function* () {
8
9
  const { ecr, profile } = _;
9
10
  const [registryId, region, repoColonTag] = ecr.replace('amazonaws.com', '').replace('dkr.ecr.', '').replace('/', '').split('.');
10
11
  const [repositoryName, imageTag] = repoColonTag.split(':');
11
- return yield (0, push_image_to_ecr_function_1.pushImageToECR)({ registryId, region, repositoryName, imageTag, profile });
12
+ return yield (0, push_image_to_ecr_function_1.pushImageToECR)({ registryId, region, ecr, profile });
12
13
  });
13
14
  }
14
15
  //# sourceMappingURL=push-image-to-ecr-wrapped.function.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"push-image-to-ecr-wrapped.function.js","sourceRoot":"","sources":["../../../../onix/src/functions/push-image-to-ecr-wrapped.function.ts"],"names":[],"mappings":";;AAEA,sDAMC;;AARD,6EAA8D;AAE9D,SAAsB,qBAAqB,CAAC,CAAmC;;QAC7E,MAAM,EAAE,GAAG,EAAE,OAAO,EAAE,GAAG,CAAC,CAAC;QAC3B,MAAM,CAAC,UAAU,EAAE,MAAM,EAAE,YAAY,CAAC,GAAG,GAAG,CAAC,OAAO,CAAC,eAAe,EAAE,EAAE,CAAC,CAAC,OAAO,CAAC,UAAU,EAAE,EAAE,CAAC,CAAC,OAAO,CAAC,GAAG,EAAE,EAAE,CAAC,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;QAChI,MAAM,CAAC,cAAc,EAAE,QAAQ,CAAC,GAAG,YAAY,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;QAE3D,OAAO,MAAM,IAAA,2CAAc,EAAC,EAAE,UAAU,EAAE,MAAM,EAAE,cAAc,EAAE,QAAQ,EAAE,OAAO,EAAE,CAAC,CAAC;IACzF,CAAC;CAAA"}
1
+ {"version":3,"file":"push-image-to-ecr-wrapped.function.js","sourceRoot":"","sources":["../../../../onix/src/functions/push-image-to-ecr-wrapped.function.ts"],"names":[],"mappings":";;AAGA,sDAMC;;AATD,6EAA8D;AAE9D,uFAAuF;AACvF,SAAsB,qBAAqB,CAAC,CAAmC;;QAC7E,MAAM,EAAE,GAAG,EAAE,OAAO,EAAE,GAAG,CAAC,CAAC;QAC3B,MAAM,CAAC,UAAU,EAAE,MAAM,EAAE,YAAY,CAAC,GAAG,GAAG,CAAC,OAAO,CAAC,eAAe,EAAE,EAAE,CAAC,CAAC,OAAO,CAAC,UAAU,EAAE,EAAE,CAAC,CAAC,OAAO,CAAC,GAAG,EAAE,EAAE,CAAC,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;QAChI,MAAM,CAAC,cAAc,EAAE,QAAQ,CAAC,GAAG,YAAY,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;QAE3D,OAAO,MAAM,IAAA,2CAAc,EAAC,EAAE,UAAU,EAAE,MAAM,EAAE,GAAG,EAAE,OAAO,EAAE,CAAC,CAAC;IACpE,CAAC;CAAA"}
@@ -1,8 +1,7 @@
1
1
  export interface PushImageConfig {
2
2
  region: string;
3
- repositoryName: string;
4
- imageTag: string;
3
+ ecr: string;
5
4
  registryId: string;
6
5
  profile: string;
7
6
  }
8
- export declare function pushImageToECR({ region, repositoryName, imageTag, registryId, profile }: PushImageConfig): Promise<void>;
7
+ export declare function pushImageToECR({ region, ecr, registryId, profile }: PushImageConfig): Promise<void>;