@sfship/plugin-ship 1.0.0-beta.2

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 (229) hide show
  1. package/LICENSE.txt +206 -0
  2. package/README.md +164 -0
  3. package/lib/commands/ship/flow/eject.d.ts +15 -0
  4. package/lib/commands/ship/flow/eject.js +55 -0
  5. package/lib/commands/ship/flow/eject.js.map +1 -0
  6. package/lib/commands/ship/flow/info.d.ts +15 -0
  7. package/lib/commands/ship/flow/info.js +86 -0
  8. package/lib/commands/ship/flow/info.js.map +1 -0
  9. package/lib/commands/ship/flow/list.d.ts +12 -0
  10. package/lib/commands/ship/flow/list.js +51 -0
  11. package/lib/commands/ship/flow/list.js.map +1 -0
  12. package/lib/commands/ship/flow/run.d.ts +16 -0
  13. package/lib/commands/ship/flow/run.js +90 -0
  14. package/lib/commands/ship/flow/run.js.map +1 -0
  15. package/lib/commands/ship/project/init.d.ts +13 -0
  16. package/lib/commands/ship/project/init.js +81 -0
  17. package/lib/commands/ship/project/init.js.map +1 -0
  18. package/lib/commands/ship/service/connect/github.d.ts +12 -0
  19. package/lib/commands/ship/service/connect/github.js +47 -0
  20. package/lib/commands/ship/service/connect/github.js.map +1 -0
  21. package/lib/commands/ship/service/delete.d.ts +13 -0
  22. package/lib/commands/ship/service/delete.js +44 -0
  23. package/lib/commands/ship/service/delete.js.map +1 -0
  24. package/lib/commands/ship/service/info.d.ts +13 -0
  25. package/lib/commands/ship/service/info.js +51 -0
  26. package/lib/commands/ship/service/info.js.map +1 -0
  27. package/lib/commands/ship/service/list.d.ts +9 -0
  28. package/lib/commands/ship/service/list.js +55 -0
  29. package/lib/commands/ship/service/list.js.map +1 -0
  30. package/lib/commands/ship/task/info.d.ts +15 -0
  31. package/lib/commands/ship/task/info.js +75 -0
  32. package/lib/commands/ship/task/info.js.map +1 -0
  33. package/lib/commands/ship/task/list.d.ts +12 -0
  34. package/lib/commands/ship/task/list.js +45 -0
  35. package/lib/commands/ship/task/list.js.map +1 -0
  36. package/lib/commands/ship/task/run.d.ts +16 -0
  37. package/lib/commands/ship/task/run.js +72 -0
  38. package/lib/commands/ship/task/run.js.map +1 -0
  39. package/lib/core/config.dependency.schema.d.ts +24 -0
  40. package/lib/core/config.dependency.schema.js +34 -0
  41. package/lib/core/config.dependency.schema.js.map +1 -0
  42. package/lib/core/config.loader.d.ts +23 -0
  43. package/lib/core/config.loader.js +62 -0
  44. package/lib/core/config.loader.js.map +1 -0
  45. package/lib/core/config.ship.schema.d.ts +174 -0
  46. package/lib/core/config.ship.schema.js +67 -0
  47. package/lib/core/config.ship.schema.js.map +1 -0
  48. package/lib/core/error.d.ts +29 -0
  49. package/lib/core/error.js +59 -0
  50. package/lib/core/error.js.map +1 -0
  51. package/lib/core/file.d.ts +34 -0
  52. package/lib/core/file.js +123 -0
  53. package/lib/core/file.js.map +1 -0
  54. package/lib/core/flow.context.d.ts +22 -0
  55. package/lib/core/flow.context.js +4 -0
  56. package/lib/core/flow.context.js.map +1 -0
  57. package/lib/core/flow.definition.schema.d.ts +60 -0
  58. package/lib/core/flow.definition.schema.js +56 -0
  59. package/lib/core/flow.definition.schema.js.map +1 -0
  60. package/lib/core/flow.interpolate.d.ts +21 -0
  61. package/lib/core/flow.interpolate.js +64 -0
  62. package/lib/core/flow.interpolate.js.map +1 -0
  63. package/lib/core/flow.registry.d.ts +32 -0
  64. package/lib/core/flow.registry.js +99 -0
  65. package/lib/core/flow.registry.js.map +1 -0
  66. package/lib/core/flow.renderer.d.ts +51 -0
  67. package/lib/core/flow.renderer.js +137 -0
  68. package/lib/core/flow.renderer.js.map +1 -0
  69. package/lib/core/flow.runner.d.ts +13 -0
  70. package/lib/core/flow.runner.js +133 -0
  71. package/lib/core/flow.runner.js.map +1 -0
  72. package/lib/core/flow.store.d.ts +24 -0
  73. package/lib/core/flow.store.js +57 -0
  74. package/lib/core/flow.store.js.map +1 -0
  75. package/lib/core/flow.view.d.ts +20 -0
  76. package/lib/core/flow.view.js +77 -0
  77. package/lib/core/flow.view.js.map +1 -0
  78. package/lib/core/flows/create/package.yml +18 -0
  79. package/lib/core/flows/dependencies/lock.yml +4 -0
  80. package/lib/core/flows/deploy/beta.yml +38 -0
  81. package/lib/core/flows/deploy/dev.yml +26 -0
  82. package/lib/core/flows/deploy/feature.yml +56 -0
  83. package/lib/core/flows/deploy/qa.yml +51 -0
  84. package/lib/core/flows/deploy/regression.yml +60 -0
  85. package/lib/core/flows/deploy/release.yml +38 -0
  86. package/lib/core/flows/release/beta.yml +25 -0
  87. package/lib/core/flows/release/production.yml +16 -0
  88. package/lib/core/org.registry.d.ts +45 -0
  89. package/lib/core/org.registry.js +76 -0
  90. package/lib/core/org.registry.js.map +1 -0
  91. package/lib/core/org.scratch.schema.d.ts +44 -0
  92. package/lib/core/org.scratch.schema.js +62 -0
  93. package/lib/core/org.scratch.schema.js.map +1 -0
  94. package/lib/core/package.dependencies.d.ts +45 -0
  95. package/lib/core/package.dependencies.js +158 -0
  96. package/lib/core/package.dependencies.js.map +1 -0
  97. package/lib/core/package.installer.d.ts +13 -0
  98. package/lib/core/package.installer.js +60 -0
  99. package/lib/core/package.installer.js.map +1 -0
  100. package/lib/core/package.metadata.d.ts +6 -0
  101. package/lib/core/package.metadata.js +33 -0
  102. package/lib/core/package.metadata.js.map +1 -0
  103. package/lib/core/package.namespace.d.ts +10 -0
  104. package/lib/core/package.namespace.js +40 -0
  105. package/lib/core/package.namespace.js.map +1 -0
  106. package/lib/core/package.version.d.ts +42 -0
  107. package/lib/core/package.version.js +60 -0
  108. package/lib/core/package.version.js.map +1 -0
  109. package/lib/core/project.init.d.ts +11 -0
  110. package/lib/core/project.init.js +121 -0
  111. package/lib/core/project.init.js.map +1 -0
  112. package/lib/core/service.d.ts +45 -0
  113. package/lib/core/service.github.d.ts +98 -0
  114. package/lib/core/service.github.js +270 -0
  115. package/lib/core/service.github.js.map +1 -0
  116. package/lib/core/service.js +91 -0
  117. package/lib/core/service.js.map +1 -0
  118. package/lib/core/sfdx-project.d.ts +25 -0
  119. package/lib/core/sfdx-project.js +39 -0
  120. package/lib/core/sfdx-project.js.map +1 -0
  121. package/lib/core/stdout.d.ts +1 -0
  122. package/lib/core/stdout.js +27 -0
  123. package/lib/core/stdout.js.map +1 -0
  124. package/lib/core/task.definition.schema.d.ts +69 -0
  125. package/lib/core/task.definition.schema.js +33 -0
  126. package/lib/core/task.definition.schema.js.map +1 -0
  127. package/lib/core/task.output.d.ts +29 -0
  128. package/lib/core/task.output.js +39 -0
  129. package/lib/core/task.output.js.map +1 -0
  130. package/lib/core/task.param.d.ts +30 -0
  131. package/lib/core/task.param.js +141 -0
  132. package/lib/core/task.param.js.map +1 -0
  133. package/lib/core/task.param.schema.d.ts +22 -0
  134. package/lib/core/task.param.schema.js +26 -0
  135. package/lib/core/task.param.schema.js.map +1 -0
  136. package/lib/core/task.registry.d.ts +22 -0
  137. package/lib/core/task.registry.js +85 -0
  138. package/lib/core/task.registry.js.map +1 -0
  139. package/lib/core/task.view.d.ts +10 -0
  140. package/lib/core/task.view.js +25 -0
  141. package/lib/core/task.view.js.map +1 -0
  142. package/lib/core/tasks/apex/run/test.d.ts +25 -0
  143. package/lib/core/tasks/apex/run/test.js +85 -0
  144. package/lib/core/tasks/apex/run/test.js.map +1 -0
  145. package/lib/core/tasks/data/import/tree.d.ts +12 -0
  146. package/lib/core/tasks/data/import/tree.js +61 -0
  147. package/lib/core/tasks/data/import/tree.js.map +1 -0
  148. package/lib/core/tasks/git/release/create.d.ts +42 -0
  149. package/lib/core/tasks/git/release/create.js +197 -0
  150. package/lib/core/tasks/git/release/create.js.map +1 -0
  151. package/lib/core/tasks/git/release/fetch.d.ts +24 -0
  152. package/lib/core/tasks/git/release/fetch.js +93 -0
  153. package/lib/core/tasks/git/release/fetch.js.map +1 -0
  154. package/lib/core/tasks/git/repo/info.d.ts +12 -0
  155. package/lib/core/tasks/git/repo/info.js +47 -0
  156. package/lib/core/tasks/git/repo/info.js.map +1 -0
  157. package/lib/core/tasks/metadata/deploy.d.ts +12 -0
  158. package/lib/core/tasks/metadata/deploy.js +39 -0
  159. package/lib/core/tasks/metadata/deploy.js.map +1 -0
  160. package/lib/core/tasks/org/assign/permsets.d.ts +12 -0
  161. package/lib/core/tasks/org/assign/permsets.js +54 -0
  162. package/lib/core/tasks/org/assign/permsets.js.map +1 -0
  163. package/lib/core/tasks/org/create/scratch.d.ts +36 -0
  164. package/lib/core/tasks/org/create/scratch.js +127 -0
  165. package/lib/core/tasks/org/create/scratch.js.map +1 -0
  166. package/lib/core/tasks/org/delete/scratch.d.ts +12 -0
  167. package/lib/core/tasks/org/delete/scratch.js +10 -0
  168. package/lib/core/tasks/org/delete/scratch.js.map +1 -0
  169. package/lib/core/tasks/package/create.d.ts +36 -0
  170. package/lib/core/tasks/package/create.js +93 -0
  171. package/lib/core/tasks/package/create.js.map +1 -0
  172. package/lib/core/tasks/package/dependencies/lock.d.ts +6 -0
  173. package/lib/core/tasks/package/dependencies/lock.js +35 -0
  174. package/lib/core/tasks/package/dependencies/lock.js.map +1 -0
  175. package/lib/core/tasks/package/dependencies/verify.d.ts +6 -0
  176. package/lib/core/tasks/package/dependencies/verify.js +44 -0
  177. package/lib/core/tasks/package/dependencies/verify.js.map +1 -0
  178. package/lib/core/tasks/package/install/dependencies.d.ts +22 -0
  179. package/lib/core/tasks/package/install/dependencies.js +43 -0
  180. package/lib/core/tasks/package/install/dependencies.js.map +1 -0
  181. package/lib/core/tasks/package/install/index.d.ts +25 -0
  182. package/lib/core/tasks/package/install/index.js +37 -0
  183. package/lib/core/tasks/package/install/index.js.map +1 -0
  184. package/lib/core/tasks/package/version/create.d.ts +36 -0
  185. package/lib/core/tasks/package/version/create.js +133 -0
  186. package/lib/core/tasks/package/version/create.js.map +1 -0
  187. package/lib/core/tasks/package/version/promote.d.ts +30 -0
  188. package/lib/core/tasks/package/version/promote.js +79 -0
  189. package/lib/core/tasks/package/version/promote.js.map +1 -0
  190. package/lib/core/tasks/package/version/resolve-latest.d.ts +24 -0
  191. package/lib/core/tasks/package/version/resolve-latest.js +78 -0
  192. package/lib/core/tasks/package/version/resolve-latest.js.map +1 -0
  193. package/lib/core/tasks/package/version/resolve-next.d.ts +24 -0
  194. package/lib/core/tasks/package/version/resolve-next.js +49 -0
  195. package/lib/core/tasks/package/version/resolve-next.js.map +1 -0
  196. package/lib/core/tasks/project/deploy/start.d.ts +22 -0
  197. package/lib/core/tasks/project/deploy/start.js +117 -0
  198. package/lib/core/tasks/project/deploy/start.js.map +1 -0
  199. package/lib/core/tasks/project/reset/tracking.d.ts +25 -0
  200. package/lib/core/tasks/project/reset/tracking.js +32 -0
  201. package/lib/core/tasks/project/reset/tracking.js.map +1 -0
  202. package/lib/core/tasks/util/file/exists.d.ts +24 -0
  203. package/lib/core/tasks/util/file/exists.js +53 -0
  204. package/lib/core/tasks/util/file/exists.js.map +1 -0
  205. package/lib/core/tasks/util/file/find.d.ts +30 -0
  206. package/lib/core/tasks/util/file/find.js +70 -0
  207. package/lib/core/tasks/util/file/find.js.map +1 -0
  208. package/lib/core/tasks/util/log.d.ts +13 -0
  209. package/lib/core/tasks/util/log.js +10 -0
  210. package/lib/core/tasks/util/log.js.map +1 -0
  211. package/lib/core/templates/README.md +35 -0
  212. package/lib/core/tree.d.ts +7 -0
  213. package/lib/core/tree.js +42 -0
  214. package/lib/core/tree.js.map +1 -0
  215. package/messages/service.connect.github.md +16 -0
  216. package/messages/ship.flow.eject.md +21 -0
  217. package/messages/ship.flow.info.md +21 -0
  218. package/messages/ship.flow.list.md +15 -0
  219. package/messages/ship.flow.run.md +23 -0
  220. package/messages/ship.project.init.md +23 -0
  221. package/messages/ship.service.delete.md +19 -0
  222. package/messages/ship.service.info.md +19 -0
  223. package/messages/ship.service.list.md +11 -0
  224. package/messages/ship.task.info.md +25 -0
  225. package/messages/ship.task.list.md +15 -0
  226. package/messages/ship.task.run.md +29 -0
  227. package/oclif.lock +10313 -0
  228. package/oclif.manifest.json +707 -0
  229. package/package.json +254 -0
@@ -0,0 +1,127 @@
1
+ /*
2
+ * Licensed under the Apache License, Version 2.0 (the "License");
3
+ * you may not use this file except in compliance with the License.
4
+ * You may obtain a copy of the License at
5
+ *
6
+ * http://www.apache.org/licenses/LICENSE-2.0
7
+ *
8
+ * Unless required by applicable law or agreed to in writing, software
9
+ * distributed under the License is distributed on an "AS IS" BASIS,
10
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
11
+ * See the License for the specific language governing permissions and
12
+ * limitations under the License.
13
+ */
14
+ import { readFileSync } from 'node:fs';
15
+ import { resolve, basename, extname } from 'node:path';
16
+ import { scratchOrgCreate, Org, ConfigAggregator, OrgConfigProperties } from '@salesforce/core';
17
+ import { ExpectedError } from '../../../error.js';
18
+ export default {
19
+ description: 'Creates a scratch org, or skips if a healthy one already exists under the same alias.',
20
+ outputs: [
21
+ { name: 'target-org', type: 'string', description: 'The alias of the created (or existing) scratch org.' },
22
+ {
23
+ name: 'created',
24
+ type: 'boolean',
25
+ description: 'True if a new scratch org was created; false if a healthy existing one was reused.',
26
+ },
27
+ ],
28
+ params: [
29
+ {
30
+ name: 'scratch-def',
31
+ type: 'string',
32
+ required: true,
33
+ description: 'Scratch org def alias (looked up in <shipDir>/orgs/) or path to a .json def file.',
34
+ },
35
+ {
36
+ name: 'alias',
37
+ type: 'string',
38
+ required: false,
39
+ description: 'Override the org alias. Defaults to the def name prefixed by the project name.',
40
+ },
41
+ { name: 'duration', type: 'number', required: false, description: 'Duration in days. Defaults to 1.' },
42
+ {
43
+ name: 'dev-hub',
44
+ type: 'string',
45
+ required: false,
46
+ description: 'Dev hub alias or username. Defaults to the SF CLI default target-dev-hub.',
47
+ },
48
+ {
49
+ name: 'set-default',
50
+ type: 'boolean',
51
+ required: false,
52
+ description: 'Set as default org after creation. Defaults to true.',
53
+ },
54
+ {
55
+ name: 'no-namespace',
56
+ type: 'boolean',
57
+ required: false,
58
+ description: 'Create the scratch without the project namespace. Defaults to false (inherits the sfdx-project.json namespace). Set true for orgs that install a managed package of the same namespace, e.g. feature or beta CI orgs.',
59
+ },
60
+ ],
61
+ async run({ flow, params, output }) {
62
+ const scratchDef = params['scratch-def'];
63
+ const definitionPath = scratchDef.endsWith('.json')
64
+ ? resolve(process.cwd(), scratchDef)
65
+ : resolve(flow.shipDir, 'orgs', `${scratchDef}.json`);
66
+ const orgConfig = JSON.parse(readFileSync(definitionPath, 'utf8'));
67
+ const defName = basename(definitionPath, extname(definitionPath));
68
+ const alias = params['alias'] ?? flow.orgs.resolveAlias(defName);
69
+ const duration = params['duration'] ?? 1;
70
+ let hubOrg;
71
+ if (params['dev-hub']) {
72
+ hubOrg = await Org.create({ aliasOrUsername: params['dev-hub'] });
73
+ }
74
+ else {
75
+ const configAggregator = await ConfigAggregator.create();
76
+ const devHub = configAggregator.getPropertyValue(OrgConfigProperties.TARGET_DEV_HUB);
77
+ if (!devHub)
78
+ throw new ExpectedError('No dev hub found. Pass `dev-hub` param or set a default with `sf config set target-dev-hub`.');
79
+ hubOrg = await Org.create({ aliasOrUsername: String(devHub) });
80
+ }
81
+ try {
82
+ const existingOrg = await Org.create({ aliasOrUsername: alias });
83
+ try {
84
+ await existingOrg.checkScratchOrg(hubOrg.getUsername());
85
+ flow.log(`Scratch org ${alias} already exists, skipping.`);
86
+ output.set('target-org', alias);
87
+ output.set('created', false);
88
+ return;
89
+ }
90
+ catch (healthErr) {
91
+ if (healthErr instanceof Error && healthErr.name === 'NoResultsError') {
92
+ flow.log(`Scratch org ${alias} is expired, removing and recreating.`);
93
+ await existingOrg.remove();
94
+ }
95
+ else {
96
+ throw healthErr;
97
+ }
98
+ }
99
+ }
100
+ catch (err) {
101
+ if (err instanceof Error && err.name !== 'NamedOrgNotFoundError')
102
+ throw err;
103
+ }
104
+ // The library's auto-lookup via SfProjectJson.create({}) doesn't reliably
105
+ // resolve sfdx-project.json from our in-process invocation context, but it
106
+ // reads orgConfig.namespace before falling back to auto-lookup — so inject it.
107
+ const wantNoNamespace = params['no-namespace'] === true;
108
+ const namespace = flow.config.project.package?.namespace;
109
+ if (namespace && !wantNoNamespace) {
110
+ orgConfig.namespace = namespace;
111
+ }
112
+ const result = await scratchOrgCreate({
113
+ hubOrg,
114
+ orgConfig,
115
+ alias,
116
+ setDefault: params['set-default'] ?? true,
117
+ durationDays: duration,
118
+ nonamespace: wantNoNamespace,
119
+ });
120
+ for (const warning of result.warnings)
121
+ flow.log(warning);
122
+ flow.log(`Created scratch org: ${result.username ?? alias}`);
123
+ output.set('target-org', alias);
124
+ output.set('created', true);
125
+ },
126
+ };
127
+ //# sourceMappingURL=scratch.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"scratch.js","sourceRoot":"","sources":["../../../../../src/core/tasks/org/create/scratch.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AACH,OAAO,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AACvC,OAAO,EAAE,OAAO,EAAE,QAAQ,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACvD,OAAO,EAAE,gBAAgB,EAAE,GAAG,EAAE,gBAAgB,EAAE,mBAAmB,EAAE,MAAM,kBAAkB,CAAC;AAEhG,OAAO,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAC;AAElD,eAAe;IACb,WAAW,EAAE,uFAAuF;IACpG,OAAO,EAAE;QACP,EAAE,IAAI,EAAE,YAAY,EAAE,IAAI,EAAE,QAAQ,EAAE,WAAW,EAAE,qDAAqD,EAAE;QAC1G;YACE,IAAI,EAAE,SAAS;YACf,IAAI,EAAE,SAAS;YACf,WAAW,EAAE,oFAAoF;SAClG;KACF;IACD,MAAM,EAAE;QACN;YACE,IAAI,EAAE,aAAa;YACnB,IAAI,EAAE,QAAQ;YACd,QAAQ,EAAE,IAAI;YACd,WAAW,EAAE,mFAAmF;SACjG;QACD;YACE,IAAI,EAAE,OAAO;YACb,IAAI,EAAE,QAAQ;YACd,QAAQ,EAAE,KAAK;YACf,WAAW,EAAE,gFAAgF;SAC9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YACb,IAAI,GAAG,YAAY,KAAK,IAAI,GAAG,CAAC,IAAI,KAAK,uBAAuB;gBAAE,MAAM,GAAG,CAAC;QAC9E,CAAC;QAED,0EAA0E;QAC1E,2EAA2E;QAC3E,+EAA+E;QAC/E,MAAM,eAAe,GAAG,MAAM,CAAC,cAAc,CAAC,KAAK,IAAI,CAAC;QACxD,MAAM,SAAS,GAAG,IAAI,CAAC,MAAM,CAAC,OAAO,CAAC,OAAO,EAAE,SAAS,CAAC;QACzD,IAAI,SAAS,IAAI,CAAC,eAAe,EAAE,CAAC;YAClC,SAAS,CAAC,SAAS,GAAG,SAAS,CAAC;QAClC,CAAC;QAED,MAAM,MAAM,GAAG,MAAM,gBAAgB,CAAC;YACpC,MAAM;YACN,SAAS;YACT,KAAK;YACL,UAAU,EAAG,MAAM,CAAC,aAAa,CAAyB,IAAI,IAAI;YAClE,YAAY,EAAE,QAAQ;YACtB,WAAW,EAAE,eAAe;SAC7B,CAAC,CAAC;QAEH,KAAK,MAAM,OAAO,IAAI,MAAM,CAAC,QAAQ;YAAE,IAAI,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC;QACzD,IAAI,CAAC,GAAG,CAAC,wBAAwB,MAAM,CAAC,QAAQ,IAAI,KAAK,EAAE,CAAC,CAAC;QAC7D,MAAM,CAAC,GAAG,CAAC,YAAY,EAAE,KAAK,CAAC,CAAC;QAChC,MAAM,CAAC,GAAG,CAAC,SAAS,EAAE,IAAI,CAAC,CAAC;IAC9B,CAAC;CACuB,CAAC"}
@@ -0,0 +1,12 @@
1
+ import type { TaskContext } from '../../../task.definition.schema.js';
2
+ declare const _default: {
3
+ description: string;
4
+ params: {
5
+ name: string;
6
+ type: "string";
7
+ required: true;
8
+ description: string;
9
+ }[];
10
+ run({ flow, params }: TaskContext): Promise<void>;
11
+ };
12
+ export default _default;
@@ -0,0 +1,10 @@
1
+ export default {
2
+ description: 'Deletes a scratch org by alias. Passthrough for `sf org delete scratch`.',
3
+ params: [{ name: 'alias', type: 'string', required: true, description: 'The scratch org alias to delete.' }],
4
+ async run({ flow, params }) {
5
+ const alias = flow.orgs.resolveAlias(params['alias']);
6
+ await flow.runCommand('org:delete:scratch', ['--target-org', alias, '--no-prompt']);
7
+ flow.log(`Deleted scratch org: ${alias}`);
8
+ },
9
+ };
10
+ //# sourceMappingURL=scratch.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"scratch.js","sourceRoot":"","sources":["../../../../../src/core/tasks/org/delete/scratch.ts"],"names":[],"mappings":"AAeA,eAAe;IACb,WAAW,EAAE,0EAA0E;IACvF,MAAM,EAAE,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,IAAI,EAAE,QAAQ,EAAE,QAAQ,EAAE,IAAI,EAAE,WAAW,EAAE,kCAAkC,EAAE,CAAC;IAC5G,KAAK,CAAC,GAAG,CAAC,EAAE,IAAI,EAAE,MAAM,EAAe;QACrC,MAAM,KAAK,GAAG,IAAI,CAAC,IAAI,CAAC,YAAY,CAAC,MAAM,CAAC,OAAO,CAAW,CAAC,CAAC;QAChE,MAAM,IAAI,CAAC,UAAU,CAAC,oBAAoB,EAAE,CAAC,cAAc,EAAE,KAAK,EAAE,aAAa,CAAC,CAAC,CAAC;QACpF,IAAI,CAAC,GAAG,CAAC,wBAAwB,KAAK,EAAE,CAAC,CAAC;IAC5C,CAAC;CACuB,CAAC"}
@@ -0,0 +1,36 @@
1
+ import type { TaskContext } from '../../task.definition.schema.js';
2
+ declare const _default: {
3
+ description: string;
4
+ params: ({
5
+ name: string;
6
+ type: "string";
7
+ required: false;
8
+ description: string;
9
+ default?: undefined;
10
+ } | {
11
+ name: string;
12
+ type: "string";
13
+ required: true;
14
+ description: string;
15
+ default?: undefined;
16
+ } | {
17
+ name: string;
18
+ type: "string";
19
+ required: false;
20
+ default: string;
21
+ description: string;
22
+ } | {
23
+ name: string;
24
+ type: "boolean";
25
+ required: false;
26
+ description: string;
27
+ default?: undefined;
28
+ })[];
29
+ outputs: {
30
+ name: string;
31
+ type: "string";
32
+ description: string;
33
+ }[];
34
+ run({ flow, params, output }: TaskContext): Promise<void>;
35
+ };
36
+ export default _default;
@@ -0,0 +1,93 @@
1
+ import { resolvePassthroughArgs } from '../../task.param.js';
2
+ import { ExpectedError } from '../../error.js';
3
+ import { readSfdxProject, writeSfdxProject } from '../../sfdx-project.js';
4
+ export default {
5
+ description: 'Registers a 2GP managed or unlocked package on the Dev Hub. Passthrough for `sf package create`. Writes the new 0Ho into sfdx-project.json packageAliases. Idempotent: skips if the package is already in packageAliases.',
6
+ params: [
7
+ {
8
+ name: 'name',
9
+ type: 'string',
10
+ required: false,
11
+ description: 'Display name for the package. Defaults to project.package.name from ship.yml.',
12
+ },
13
+ {
14
+ name: 'package-type',
15
+ type: 'string',
16
+ required: true,
17
+ description: 'Package type: Managed or Unlocked.',
18
+ },
19
+ {
20
+ name: 'path',
21
+ type: 'string',
22
+ required: false,
23
+ default: 'force-app',
24
+ description: 'Path to the package source directory.',
25
+ },
26
+ {
27
+ name: 'description',
28
+ type: 'string',
29
+ required: false,
30
+ description: 'Description of the package.',
31
+ },
32
+ {
33
+ name: 'no-namespace',
34
+ type: 'boolean',
35
+ required: false,
36
+ description: 'Create the package as no-namespace.',
37
+ },
38
+ {
39
+ name: 'target-dev-hub',
40
+ type: 'string',
41
+ required: false,
42
+ description: 'Dev hub alias or username. Defaults to the SF CLI default target-dev-hub.',
43
+ },
44
+ {
45
+ name: 'org-dependent',
46
+ type: 'boolean',
47
+ required: false,
48
+ description: 'Mark as org-dependent. Only valid for Unlocked package types.',
49
+ },
50
+ {
51
+ name: 'error-notification-username',
52
+ type: 'string',
53
+ required: false,
54
+ description: 'Username to receive package upload failure notifications.',
55
+ },
56
+ ],
57
+ outputs: [
58
+ {
59
+ name: 'package-id',
60
+ type: 'string',
61
+ description: 'The 0Ho Package2Id of the created (or already-registered) package.',
62
+ },
63
+ ],
64
+ async run({ flow, params, output }) {
65
+ const name = params['name'] ?? flow.config.project.package?.name;
66
+ if (!name) {
67
+ throw new ExpectedError('No package name. Pass `name` param or set project.package.name in ship.yml.');
68
+ }
69
+ const existing = readSfdxProject(flow.projectDir).packageAliases ?? {};
70
+ if (existing[name]) {
71
+ flow.log(`Package "${name}" already registered as ${existing[name]} — skipping.`);
72
+ output.set('package-id', existing[name]);
73
+ return;
74
+ }
75
+ const argv = resolvePassthroughArgs(params, {
76
+ '--name': name,
77
+ });
78
+ // Disable sf's sfdx-project.json autoupdate. We write the alias ourselves below.
79
+ // https://developer.salesforce.com/docs/atlas.en-us.sfdx_setup.meta/sfdx_setup/sfdx_dev_cli_env_variables.htm
80
+ process.env.SF_PROJECT_AUTOUPDATE_DISABLE_FOR_PACKAGE_CREATE = 'true';
81
+ flow.log(`Creating package "${name}"...`);
82
+ const result = (await flow.runCommand('package:create', argv));
83
+ if (!result.Id) {
84
+ throw new ExpectedError('Package create completed without a Package2Id.');
85
+ }
86
+ const sfdxProject = readSfdxProject(flow.projectDir);
87
+ sfdxProject.packageAliases = { ...sfdxProject.packageAliases, [name]: result.Id };
88
+ writeSfdxProject(flow.projectDir, sfdxProject);
89
+ flow.log(`Created package ${result.Id} and wrote alias "${name}" to sfdx-project.json.`);
90
+ output.set('package-id', result.Id);
91
+ },
92
+ };
93
+ //# sourceMappingURL=create.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"create.js","sourceRoot":"","sources":["../../../../src/core/tasks/package/create.ts"],"names":[],"mappings":"AAcA,OAAO,EAAE,sBAAsB,EAAE,MAAM,qBAAqB,CAAC;AAC7D,OAAO,EAAE,aAAa,EAAE,MAAM,gBAAgB,CAAC;AAC/C,OAAO,EAAE,eAAe,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAC;AAM1E,eAAe;IACb,WAAW,EACT,2NAA2N;IAC7N,MAAM,EAAE;QACN;YACE,IAAI,EAAE,MAAM;YACZ,IAAI,EAAE,QAAQ;YACd,QAAQ,EAAE,KAAK;YACf,WAAW,EAAE,+EAA+E;SAC7F;QACD;YACE,IAAI,E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
3
+ description: string;
4
+ run({ flow }: TaskContext): Promise<void>;
5
+ };
6
+ export default _default;
@@ -0,0 +1,35 @@
1
+ import { resolveDependencies } from '../../../package.dependencies.js';
2
+ import { readSfdxProject, writeSfdxProject, defaultPackageDirectory } from '../../../sfdx-project.js';
3
+ import { ExpectedError } from '../../../error.js';
4
+ export default {
5
+ description: 'Resolves the dependencies declared in ship.yml and writes them into sfdx-project.json so a validated `package version create` can compile against them. Run whenever your dependencies change and commit the diff — that diff is your record of which dependency versions a release builds against.',
6
+ async run({ flow }) {
7
+ const deps = flow.config.project.package?.dependencies ?? [];
8
+ const steps = (await resolveDependencies(deps)).filter((s) => s.kind === 'package-id');
9
+ const project = readSfdxProject(flow.projectDir);
10
+ const packageDir = defaultPackageDirectory(project);
11
+ if (!packageDir?.package) {
12
+ throw new ExpectedError('No package registered in sfdx-project.json (the default packageDirectory has no "package"). Run `sf ship flow run create/package` first.');
13
+ }
14
+ // Reference each named dependency through a packageAlias so the diff stays readable;
15
+ // fall back to the raw 04t for dependencies that declare no name in ship.yml.
16
+ const aliases = { ...project.packageAliases };
17
+ const dependencies = steps.map((step) => {
18
+ if (step.name) {
19
+ aliases[step.name] = step.versionId;
20
+ return { package: step.name };
21
+ }
22
+ return { package: step.versionId };
23
+ });
24
+ if (dependencies.length)
25
+ packageDir.dependencies = dependencies;
26
+ else
27
+ delete packageDir.dependencies;
28
+ project.packageAliases = aliases;
29
+ writeSfdxProject(flow.projectDir, project);
30
+ flow.log(dependencies.length
31
+ ? `Wrote ${dependencies.length} dependenc${dependencies.length === 1 ? 'y' : 'ies'} to sfdx-project.json.`
32
+ : 'No dependencies in ship.yml — cleared sfdx-project.json dependencies.');
33
+ },
34
+ };
35
+ //# sourceMappingURL=lock.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"lock.js","sourceRoot":"","sources":["../../../../../src/core/tasks/package/dependencies/lock.ts"],"names":[],"mappings":"AAcA,OAAO,EAAE,mBAAmB,EAAsB,MAAM,kCAAk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AC3D,OAAO,UAAU,CAAC,YAAY,CAAC;QACpC,OAAO,CAAC,cAAc,GAAG,OAAO,CAAC;QAEjC,gBAAgB,CAAC,IAAI,CAAC,UAAU,EAAE,OAAO,CAAC,CAAC;QAE3C,IAAI,CAAC,GAAG,CACN,YAAY,CAAC,MAAM;YACjB,CAAC,CAAC,SAAS,YAAY,CAAC,MAAM,aAAa,YAAY,CAAC,MAAM,KAAK,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,KAAK,wBAAwB;YAC1G,CAAC,CAAC,uEAAuE,CAC5E,CAAC;IACJ,CAAC;CACuB,CAAC"}
@@ -0,0 +1,6 @@
1
+ import type { TaskContext } from '../../../task.definition.schema.js';
2
+ declare const _default: {
3
+ description: string;
4
+ run({ flow }: TaskContext): Promise<void>;
5
+ };
6
+ export default _default;
@@ -0,0 +1,44 @@
1
+ /*
2
+ * Licensed under the Apache License, Version 2.0 (the "License");
3
+ * you may not use this file except in compliance with the License.
4
+ * You may obtain a copy of the License at
5
+ *
6
+ * http://www.apache.org/licenses/LICENSE-2.0
7
+ *
8
+ * Unless required by applicable law or agreed to in writing, software
9
+ * distributed under the License is distributed on an "AS IS" BASIS,
10
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
11
+ * See the License for the specific language governing permissions and
12
+ * limitations under the License.
13
+ */
14
+ import { StandardColors } from '@salesforce/sf-plugins-core';
15
+ import { resolveDependencies, computeDrift } from '../../../package.dependencies.js';
16
+ import { readSfdxProject } from '../../../sfdx-project.js';
17
+ import { ExpectedError } from '../../../error.js';
18
+ export default {
19
+ description: 'Verifies that the dependencies declared in ship.yml match what is committed in sfdx-project.json, failing if they have drifted. Guards a release build against stale or unsynced dependencies.',
20
+ async run({ flow }) {
21
+ const deps = flow.config.project.package?.dependencies ?? [];
22
+ const steps = (await resolveDependencies(deps)).filter((s) => s.kind === 'package-id');
23
+ const { missing, stale, names } = computeDrift(steps, readSfdxProject(flow.projectDir));
24
+ if (missing.length || stale.length) {
25
+ const label = (id) => {
26
+ const name = names.get(id);
27
+ return name ? `${name} (${id})` : id;
28
+ };
29
+ const width = Math.max(...[...missing, ...stale].map((id) => label(id).length));
30
+ throw new ExpectedError([
31
+ StandardColors.error('Dependencies are out of sync.'),
32
+ `${StandardColors.info('ship.yml')} resolves to a different set than ${StandardColors.info('sfdx-project.json')} declares:`,
33
+ '',
34
+ ...missing.map((id) => ` ${StandardColors.success('+')} ${label(id).padEnd(width)} in ship.yml, missing from sfdx-project.json`),
35
+ ...stale.map((id) => ` ${StandardColors.error('-')} ${label(id).padEnd(width)} in sfdx-project.json, dropped from ship.yml`),
36
+ '',
37
+ `${StandardColors.info('→ To fix, run this and commit the change:')}`,
38
+ ` ${StandardColors.success('sf ship flow run dependencies/lock')}`,
39
+ ].join('\n'));
40
+ }
41
+ flow.log(`Dependencies in sync (${steps.length} package${steps.length === 1 ? '' : 's'}).`);
42
+ },
43
+ };
44
+ //# sourceMappingURL=verify.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"verify.js","sourceRoot":"","sources":["../../../../../src/core/tasks/package/dependencies/verify.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AACH,OAAO,EAAE,cAAc,EAAE,MAAM,6BAA6B,CAAC;AAE7D,OAAO,EAAE,mBAAmB,EAAE,YAAY,EAAsB,MAAM,kCAAkC,CAAC;AACzG,OAAO,EAAE,eAAe,EAAE,MAAM,0BAA0B,CAAC;AAC3D,OAAO,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAC;AAElD,eAAe;IACb,WAAW,EACT,gMAAgM;IAClM,KAAK,CAAC,GAAG,CAAC,EAAE,IAAI,EAAe;QAC7B,MAAM,IAAI,GAAG,IAAI,CAAC,MAAM,CAAC,OAAO,CAAC,OAAO,EAAE,YAAY,IAAI,EAAE,CAAC;QAC7D,MAAM,KAAK,GAAG,CAAC,MAAM,mBAAmB,CAAC,IAAI,CAAC,CAAC,CAAC,MAAM,CAAC,CAA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C,+CAA+C,CAC7G;gBACD,EAAE;gBACF,GAAG,cAAc,CAAC,IAAI,CAAC,2CAA2C,CAAC,EAAE;gBACrE,OAAO,cAAc,CAAC,OAAO,CAAC,oCAAoC,CAAC,EAAE;aACtE,CAAC,IAAI,CAAC,IAAI,CAAC,CACb,CAAC;QACJ,CAAC;QAED,IAAI,CAAC,GAAG,CAAC,yBAAyB,KAAK,CAAC,MAAM,WAAW,KAAK,CAAC,MAAM,KAAK,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,GAAG,IAAI,CAAC,CAAC;IAC9F,CAAC;CACuB,CAAC"}
@@ -0,0 +1,22 @@
1
+ import type { TaskContext } from '../../../task.definition.schema.js';
2
+ declare const _default: {
3
+ description: string;
4
+ params: ({
5
+ name: string;
6
+ type: "string";
7
+ required: false;
8
+ description: string;
9
+ } | {
10
+ name: string;
11
+ type: "number";
12
+ required: false;
13
+ description: string;
14
+ } | {
15
+ name: string;
16
+ type: "boolean";
17
+ required: false;
18
+ description: string;
19
+ })[];
20
+ run({ flow, params }: TaskContext): Promise<void>;
21
+ };
22
+ export default _default;
@@ -0,0 +1,43 @@
1
+ import { installDependencies } from '../../../package.installer.js';
2
+ export default {
3
+ description: 'Resolves and installs all dependencies declared in ship.yml in topological order. ' +
4
+ 'Package versions already installed in the target org are skipped unless `force` is set.',
5
+ params: [
6
+ {
7
+ name: 'target-org',
8
+ type: 'string',
9
+ required: false,
10
+ description: 'Org alias or username to install packages into. Defaults to the SF CLI default target-org.',
11
+ },
12
+ {
13
+ name: 'wait',
14
+ type: 'number',
15
+ required: false,
16
+ description: 'Minutes to wait per package installation. Defaults to 10.',
17
+ },
18
+ {
19
+ name: 'dry-run',
20
+ type: 'boolean',
21
+ required: false,
22
+ description: 'When true, resolves and logs dependency steps without installing.',
23
+ },
24
+ {
25
+ name: 'force',
26
+ type: 'boolean',
27
+ required: false,
28
+ description: 'Reinstall package versions even if the target org already has them installed.',
29
+ },
30
+ ],
31
+ async run({ flow, params }) {
32
+ await installDependencies(flow.config.project.package?.dependencies ?? [], {
33
+ alias: flow.orgs.resolveAlias(params['target-org']),
34
+ wait: params['wait'] ?? 10,
35
+ dryRun: params['dry-run'] === true,
36
+ force: params['force'] === true,
37
+ shipDir: flow.shipDir,
38
+ log: flow.log,
39
+ runCommand: flow.runCommand,
40
+ });
41
+ },
42
+ };
43
+ //# sourceMappingURL=dependencies.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"dependencies.js","sourceRoot":"","sources":["../../../../../src/core/tasks/package/install/dependencies.ts"],"names":[],"mappings":"AAcA,OAAO,EAAE,mBAAmB,EAAE,MAAM,+BAA+B,CAAC;AAEpE,eAAe;IACb,WAAW,EACT,oFAAoF;QACpF,yFAAyF;IAC3F,MAAM,EAAE;QACN;YACE,IAAI,EAAE,YAAY;YAClB,IAAI,EAAE,QAAQ;YACd,QAAQ,EAAE,KAAK;YACf,WAAW,EAAE,4FAA4F;SAC1G;QACD;YACE,IAAI,EAAE,MAAM;YACZ,IAAI,EAAE,QAAQ;YACd,QAAQ,EAAE,KAAK;YACf,WAAW,EAAE,2DAA2D;SACzE;QACD;YACE,IAAI,EAAE,SAAS;YACf,IAAI,EAAE,SAAS;YACf,QAAQ,EAAE,KAAK;YACf,WAAW,EAAE,mEAAmE;SACjF;QACD;YACE,IAAI,EAAE,OAAO;YACb,IAAI,EAAE,SAAS;YACf,QAAQ,EAAE,KAAK;YACf,WAAW,EAAE,+EAA+E;SAC7F;KACF;IACD,KAAK,CAAC,GAAG,CAAC,EAAE,IAAI,EAAE,MAAM,EAAe;QACrC,MAAM,mBAAmB,CAAC,IAAI,CAAC,MAAM,CAAC,OAAO,CAAC,OAAO,EAAE,YAAY,IAAI,EAAE,EAAE;YACzE,KAAK,EAAE,IAAI,CAAC,IAAI,CAAC,YAAY,CAAC,MAAM,CAAC,YAAY,CAAuB,CAAC;YACzE,IAAI,EAAG,MAAM,CAAC,MAAM,CAAwB,IAAI,EAAE;YAClD,MAAM,EAAE,MAAM,CAAC,SAAS,CAAC,KAAK,IAAI;YAClC,KAAK,EAAE,MAAM,CAAC,OAAO,CAAC,KAAK,IAAI;YAC/B,OAAO,EAAE,IAAI,CAAC,OAAO;YACrB,GAAG,EAAE,IAAI,CAAC,GAAG;YACb,UAAU,EAAE,IAAI,CAAC,UAAU;SAC5B,CAAC,CAAC;IACL,CAAC;CACuB,CAAC"}
@@ -0,0 +1,25 @@
1
+ import type { TaskContext } from '../../../task.definition.schema.js';
2
+ declare const _default: {
3
+ description: string;
4
+ params: ({
5
+ name: string;
6
+ type: "string";
7
+ required: true;
8
+ description: string;
9
+ default?: undefined;
10
+ } | {
11
+ name: string;
12
+ type: "string";
13
+ required: false;
14
+ description: string;
15
+ default?: undefined;
16
+ } | {
17
+ name: string;
18
+ type: "number";
19
+ required: false;
20
+ default: number;
21
+ description: string;
22
+ })[];
23
+ run({ flow, params }: TaskContext): Promise<void>;
24
+ };
25
+ export default _default;
@@ -0,0 +1,37 @@
1
+ import { resolvePassthroughArgs } from '../../../task.param.js';
2
+ export default {
3
+ description: 'Installs a package version into a Salesforce org. Passthrough for `sf package install`.',
4
+ params: [
5
+ {
6
+ name: 'version-id',
7
+ type: 'string',
8
+ required: true,
9
+ description: 'The 04t package version ID to install.',
10
+ },
11
+ {
12
+ name: 'target-org',
13
+ type: 'string',
14
+ required: false,
15
+ description: 'Org alias or username to install the package into. Defaults to the SF CLI default target-org.',
16
+ },
17
+ {
18
+ name: 'wait',
19
+ type: 'number',
20
+ required: false,
21
+ default: 10,
22
+ description: 'Minutes to wait for installation to complete. Defaults to 10.',
23
+ },
24
+ ],
25
+ async run({ flow, params }) {
26
+ const versionId = params['version-id'];
27
+ const alias = flow.orgs.resolveAlias(params['target-org']);
28
+ const argv = resolvePassthroughArgs(params, {
29
+ '--target-org': alias ?? null,
30
+ '--package': versionId,
31
+ '--version-id': null,
32
+ });
33
+ await flow.runCommand('package:install', argv);
34
+ flow.log(`Package ${versionId} installed successfully.`);
35
+ },
36
+ };
37
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../src/core/tasks/package/install/index.ts"],"names":[],"mappings":"AAcA,OAAO,EAAE,sBAAsB,EAAE,MAAM,wBAAwB,CAAC;AAEhE,eAAe;IACb,WAAW,EAAE,yFAAyF;IACtG,MAAM,EAAE;QACN;YACE,IAAI,EAAE,YAAY;YAClB,IAAI,EAAE,QAAQ;YACd,QAAQ,EAAE,IAAI;YACd,WAAW,EAAE,wCAAwC;SACtD;QACD;YACE,IAAI,EAAE,YAAY;YAClB,IAAI,EAAE,QAAQ;YACd,QAAQ,EAAE,KAAK;YACf,WAAW,EAAE,+FAA+F;SAC7G;QACD;YACE,IAAI,EAAE,MAAM;YACZ,IAAI,EAAE,QAAQ;YACd,QAAQ,EAAE,KAAK;YACf,OAAO,EAAE,EAAE;YACX,WAAW,EAAE,+DAA+D;SAC7E;KACF;IACD,KAAK,CAAC,GAAG,CAAC,EAAE,IAAI,EAAE,MAAM,EAAe;QACrC,MAAM,SAAS,GAAG,MAAM,CAAC,YAAY,CAAW,CAAC;QACjD,MAAM,KAAK,GAAG,IAAI,CAAC,IAAI,CAAC,YAAY,CAAC,MAAM,CAAC,YAAY,CAAuB,CAAC,CAAC;QACjF,MAAM,IAAI,GAAG,sBAAsB,CAAC,MAAM,EAAE;YAC1C,cAAc,EAAE,KAAK,IAAI,IAAI;YAC7B,WAAW,EAAE,SAAS;YACtB,cAAc,EAAE,IAAI;SACrB,CAAC,CAAC;QACH,MAAM,IAAI,CAAC,UAAU,CAAC,iBAAiB,EAAE,IAAI,CAAC,CAAC;QAC/C,IAAI,CAAC,GAAG,CAAC,WAAW,SAAS,0BAA0B,CAAC,CAAC;IAC3D,CAAC;CACuB,CAAC"}
@@ -0,0 +1,36 @@
1
+ import type { TaskContext } from '../../../task.definition.schema.js';
2
+ declare const _default: {
3
+ description: string;
4
+ params: ({
5
+ name: string;
6
+ type: "string";
7
+ required: false;
8
+ description: string;
9
+ default?: undefined;
10
+ } | {
11
+ name: string;
12
+ type: "number";
13
+ required: false;
14
+ description: string;
15
+ default?: undefined;
16
+ } | {
17
+ name: string;
18
+ type: "boolean";
19
+ required: false;
20
+ description: string;
21
+ default?: undefined;
22
+ } | {
23
+ name: string;
24
+ type: "boolean";
25
+ required: false;
26
+ default: true;
27
+ description: string;
28
+ })[];
29
+ outputs: {
30
+ name: string;
31
+ type: "string";
32
+ description: string;
33
+ }[];
34
+ run({ flow, params, output }: TaskContext): Promise<void>;
35
+ };
36
+ export default _default;