@catladder/cli 0.0.0-refactor-docker-de6b3576 → 0.0.0-refactor-docker-c24f8608

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 (156) hide show
  1. package/dist/bundles/catenv/index.js +95 -75
  2. package/dist/bundles/cli/index.js +87 -63
  3. package/dist/cli/src/apps/catenv/catenv.js +8 -12
  4. package/dist/cli/src/apps/catenv/catenv.js.map +1 -1
  5. package/dist/cli/src/apps/cli/commands/project/commandCloudSqlProxy.js.map +1 -1
  6. package/dist/cli/src/apps/cli/commands/project/commandPortForward.js.map +1 -1
  7. package/dist/cli/src/apps/cli/commands/project/setup/setupCloudRun.d.ts +2 -2
  8. package/dist/cli/src/apps/cli/commands/project/setup/setupCloudRun.js.map +1 -1
  9. package/dist/cli/src/apps/cli/commands/project/setup/setupContext.d.ts +2 -2
  10. package/dist/cli/src/apps/cli/commands/project/setup/setupContext.js.map +1 -1
  11. package/dist/cli/src/apps/cli/commands/project/setup/setupKubernetes.d.ts +2 -2
  12. package/dist/cli/src/apps/cli/commands/project/setup/setupKubernetes.js.map +1 -1
  13. package/dist/cli/src/apps/cli/commands/project/utils/ensureNamespace.d.ts +2 -2
  14. package/dist/cli/src/apps/cli/commands/project/utils/ensureNamespace.js.map +1 -1
  15. package/dist/cli/src/config/getProjectConfig.d.ts +2 -2
  16. package/dist/cli/src/config/getProjectConfig.js +1 -1
  17. package/dist/cli/src/config/getProjectConfig.js.map +1 -1
  18. package/dist/cli/src/gcloud/cloudRun/openCloudRunDashboards.d.ts +2 -2
  19. package/dist/cli/src/gcloud/cloudRun/openCloudRunDashboards.js.map +1 -1
  20. package/dist/cli/src/gcloud/serviceAccounts.d.ts +2 -2
  21. package/dist/cli/src/gcloud/serviceAccounts.js.map +1 -1
  22. package/dist/cli/src/kubernetes/openKubernetesDashboards.d.ts +3 -3
  23. package/dist/cli/src/kubernetes/openKubernetesDashboards.js.map +1 -1
  24. package/dist/cli/src/utils/gitlab.d.ts +1 -1
  25. package/dist/cli/src/utils/gitlab.js +37 -24
  26. package/dist/cli/src/utils/gitlab.js.map +1 -1
  27. package/dist/pipeline/src/build/base/createAppBuildJob.d.ts +2 -2
  28. package/dist/pipeline/src/build/base/createAppBuildJob.js +1 -1
  29. package/dist/pipeline/src/build/base/createAppBuildJob.js.map +1 -1
  30. package/dist/pipeline/src/build/base/index.d.ts +2 -2
  31. package/dist/pipeline/src/build/base/index.js.map +1 -1
  32. package/dist/pipeline/src/build/base/writeBuildInfo.d.ts +2 -2
  33. package/dist/pipeline/src/build/base/writeBuildInfo.js.map +1 -1
  34. package/dist/pipeline/src/build/base/writeDotEnv.d.ts +2 -2
  35. package/dist/pipeline/src/build/base/writeDotEnv.js.map +1 -1
  36. package/dist/pipeline/src/build/custom/buildJob.d.ts +2 -2
  37. package/dist/pipeline/src/build/custom/buildJob.js.map +1 -1
  38. package/dist/pipeline/src/build/custom/index.d.ts +2 -2
  39. package/dist/pipeline/src/build/custom/index.js.map +1 -1
  40. package/dist/pipeline/src/build/custom/testJob.d.ts +2 -2
  41. package/dist/pipeline/src/build/custom/testJob.js.map +1 -1
  42. package/dist/pipeline/src/build/docker.d.ts +11 -11
  43. package/dist/pipeline/src/build/docker.js +5 -5
  44. package/dist/pipeline/src/build/docker.js.map +1 -1
  45. package/dist/pipeline/src/build/index.d.ts +2 -2
  46. package/dist/pipeline/src/build/node/buildJob.d.ts +2 -2
  47. package/dist/pipeline/src/build/node/buildJob.js +9 -7
  48. package/dist/pipeline/src/build/node/buildJob.js.map +1 -1
  49. package/dist/pipeline/src/build/node/cache.d.ts +5 -5
  50. package/dist/pipeline/src/build/node/cache.js +4 -4
  51. package/dist/pipeline/src/build/node/cache.js.map +1 -1
  52. package/dist/pipeline/src/build/node/index.d.ts +4 -4
  53. package/dist/pipeline/src/build/node/index.js.map +1 -1
  54. package/dist/pipeline/src/build/node/meteor.d.ts +2 -2
  55. package/dist/pipeline/src/build/node/meteor.js +2 -2
  56. package/dist/pipeline/src/build/node/meteor.js.map +1 -1
  57. package/dist/pipeline/src/build/node/testJob.d.ts +2 -2
  58. package/dist/pipeline/src/build/node/testJob.js +4 -4
  59. package/dist/pipeline/src/build/node/testJob.js.map +1 -1
  60. package/dist/pipeline/src/build/node/yarn.d.ts +4 -4
  61. package/dist/pipeline/src/build/node/yarn.js +1 -3
  62. package/dist/pipeline/src/build/node/yarn.js.map +1 -1
  63. package/dist/pipeline/src/build/rails/build.d.ts +2 -2
  64. package/dist/pipeline/src/build/rails/build.js.map +1 -1
  65. package/dist/pipeline/src/build/rails/index.d.ts +2 -2
  66. package/dist/pipeline/src/build/rails/index.js.map +1 -1
  67. package/dist/pipeline/src/build/rails/test.d.ts +2 -2
  68. package/dist/pipeline/src/build/rails/test.js.map +1 -1
  69. package/dist/pipeline/src/build/sbom.d.ts +2 -2
  70. package/dist/pipeline/src/build/sbom.js +2 -2
  71. package/dist/pipeline/src/build/sbom.js.map +1 -1
  72. package/dist/pipeline/src/context/getEnvironment.d.ts +2 -2
  73. package/dist/pipeline/src/context/getEnvironment.js.map +1 -1
  74. package/dist/pipeline/src/context/getEnvironmentContext.d.ts +2 -2
  75. package/dist/pipeline/src/context/getEnvironmentContext.js.map +1 -1
  76. package/dist/pipeline/src/context/getEnvironmentVariables.d.ts +4 -4
  77. package/dist/pipeline/src/context/getEnvironmentVariables.js.map +1 -1
  78. package/dist/pipeline/src/context/getLabels.d.ts +2 -2
  79. package/dist/pipeline/src/context/getLabels.js.map +1 -1
  80. package/dist/pipeline/src/context/index.d.ts +7 -3
  81. package/dist/pipeline/src/context/index.js +12 -3
  82. package/dist/pipeline/src/context/index.js.map +1 -1
  83. package/dist/pipeline/src/deploy/base/deploy.d.ts +2 -2
  84. package/dist/pipeline/src/deploy/base/deploy.js.map +1 -1
  85. package/dist/pipeline/src/deploy/base/index.d.ts +2 -2
  86. package/dist/pipeline/src/deploy/base/index.js.map +1 -1
  87. package/dist/pipeline/src/deploy/base/rollback.d.ts +2 -2
  88. package/dist/pipeline/src/deploy/base/rollback.js.map +1 -1
  89. package/dist/pipeline/src/deploy/base/stop.d.ts +2 -2
  90. package/dist/pipeline/src/deploy/base/stop.js.map +1 -1
  91. package/dist/pipeline/src/deploy/cloudRun/artifactsRegistry.d.ts +7 -7
  92. package/dist/pipeline/src/deploy/cloudRun/artifactsRegistry.js.map +1 -1
  93. package/dist/pipeline/src/deploy/cloudRun/cleanup.d.ts +2 -2
  94. package/dist/pipeline/src/deploy/cloudRun/cleanup.js.map +1 -1
  95. package/dist/pipeline/src/deploy/cloudRun/cloudRunRevisions.d.ts +2 -2
  96. package/dist/pipeline/src/deploy/cloudRun/cloudRunRevisions.js.map +1 -1
  97. package/dist/pipeline/src/deploy/cloudRun/createJobs/cloudRunJobs.d.ts +6 -6
  98. package/dist/pipeline/src/deploy/cloudRun/createJobs/cloudRunJobs.js.map +1 -1
  99. package/dist/pipeline/src/deploy/cloudRun/createJobs/cloudRunServices.d.ts +3 -3
  100. package/dist/pipeline/src/deploy/cloudRun/createJobs/cloudRunServices.js.map +1 -1
  101. package/dist/pipeline/src/deploy/cloudRun/createJobs/common.d.ts +4 -4
  102. package/dist/pipeline/src/deploy/cloudRun/createJobs/common.js.map +1 -1
  103. package/dist/pipeline/src/deploy/cloudRun/createJobs/getCloudRunDeployScripts.d.ts +2 -2
  104. package/dist/pipeline/src/deploy/cloudRun/createJobs/getCloudRunDeployScripts.js.map +1 -1
  105. package/dist/pipeline/src/deploy/cloudRun/createJobs/getCloudRunStopScripts.d.ts +2 -2
  106. package/dist/pipeline/src/deploy/cloudRun/createJobs/getCloudRunStopScripts.js.map +1 -1
  107. package/dist/pipeline/src/deploy/cloudRun/createJobs/index.d.ts +2 -2
  108. package/dist/pipeline/src/deploy/cloudRun/createJobs/index.js.map +1 -1
  109. package/dist/pipeline/src/deploy/cloudRun/utils/database.d.ts +3 -3
  110. package/dist/pipeline/src/deploy/cloudRun/utils/database.js.map +1 -1
  111. package/dist/pipeline/src/deploy/cloudRun/utils/gcloudServiceAccountLoginCommands.d.ts +2 -2
  112. package/dist/pipeline/src/deploy/cloudRun/utils/gcloudServiceAccountLoginCommands.js.map +1 -1
  113. package/dist/pipeline/src/deploy/cloudRun/utils/getServiceName.d.ts +2 -2
  114. package/dist/pipeline/src/deploy/cloudRun/utils/getServiceName.js.map +1 -1
  115. package/dist/pipeline/src/deploy/custom/deployJob.d.ts +2 -2
  116. package/dist/pipeline/src/deploy/custom/deployJob.js +3 -1
  117. package/dist/pipeline/src/deploy/custom/deployJob.js.map +1 -1
  118. package/dist/pipeline/src/deploy/dockerTag/deployJob.d.ts +2 -2
  119. package/dist/pipeline/src/deploy/dockerTag/deployJob.js.map +1 -1
  120. package/dist/pipeline/src/deploy/index.d.ts +2 -2
  121. package/dist/pipeline/src/deploy/kubernetes/cloudSql/index.d.ts +3 -3
  122. package/dist/pipeline/src/deploy/kubernetes/cloudSql/index.js.map +1 -1
  123. package/dist/pipeline/src/deploy/kubernetes/deployJob.d.ts +2 -2
  124. package/dist/pipeline/src/deploy/kubernetes/deployJob.js.map +1 -1
  125. package/dist/pipeline/src/deploy/kubernetes/kubeEnv.d.ts +2 -2
  126. package/dist/pipeline/src/deploy/kubernetes/kubeEnv.js.map +1 -1
  127. package/dist/pipeline/src/deploy/kubernetes/kubeValues.d.ts +2 -2
  128. package/dist/pipeline/src/deploy/kubernetes/kubeValues.js.map +1 -1
  129. package/dist/pipeline/src/deploy/kubernetes/mongodb.d.ts +2 -2
  130. package/dist/pipeline/src/deploy/kubernetes/mongodb.js.map +1 -1
  131. package/dist/pipeline/src/deploy/sbom.d.ts +4 -4
  132. package/dist/pipeline/src/deploy/sbom.js.map +1 -1
  133. package/dist/pipeline/src/deploy/utils.d.ts +2 -2
  134. package/dist/pipeline/src/deploy/utils.js.map +1 -1
  135. package/dist/pipeline/src/pipeline/createJobsForComponent.d.ts +2 -2
  136. package/dist/pipeline/src/pipeline/createJobsForComponent.js +1 -1
  137. package/dist/pipeline/src/pipeline/createJobsForComponent.js.map +1 -1
  138. package/dist/pipeline/src/pipeline/generatePipelineFiles.js +5 -5
  139. package/dist/pipeline/src/pipeline/generatePipelineFiles.js.map +1 -1
  140. package/dist/pipeline/src/pipeline/gitlab/createGitlabJobs.js.map +1 -1
  141. package/dist/pipeline/src/types/config.d.ts +2 -2
  142. package/dist/pipeline/src/types/context.d.ts +16 -2
  143. package/dist/tsconfig.tsbuildinfo +1 -1
  144. package/package.json +1 -1
  145. package/src/apps/catenv/catenv.ts +8 -7
  146. package/src/apps/cli/commands/project/commandCloudSqlProxy.ts +3 -3
  147. package/src/apps/cli/commands/project/commandPortForward.ts +5 -2
  148. package/src/apps/cli/commands/project/setup/setupCloudRun.ts +2 -2
  149. package/src/apps/cli/commands/project/setup/setupContext.ts +2 -2
  150. package/src/apps/cli/commands/project/setup/setupKubernetes.ts +2 -2
  151. package/src/apps/cli/commands/project/utils/ensureNamespace.ts +2 -2
  152. package/src/config/getProjectConfig.ts +2 -2
  153. package/src/gcloud/cloudRun/openCloudRunDashboards.ts +2 -2
  154. package/src/gcloud/serviceAccounts.ts +3 -3
  155. package/src/kubernetes/openKubernetesDashboards.ts +3 -3
  156. package/src/utils/gitlab.ts +26 -10
package/package.json CHANGED
@@ -52,7 +52,7 @@
52
52
  }
53
53
  ],
54
54
  "license": "MIT",
55
- "version": "0.0.0-refactor-docker-de6b3576",
55
+ "version": "0.0.0-refactor-docker-c24f8608",
56
56
  "scripts": {
57
57
  "lint": "eslint \"src/**/*.ts\"",
58
58
  "lint:fix": "eslint \"src/**/*.ts\" --fix",
@@ -11,13 +11,14 @@ export default async (choice?: Choice) => {
11
11
  return;
12
12
  }
13
13
 
14
- if (config.pipelineType) {
15
- await generatePipelineFiles(config, config.pipelineType, "local");
16
- }
17
-
18
- await writeDotEnvFiles(config, choice);
14
+ await Promise.all([
15
+ config.pipelineType
16
+ ? generatePipelineFiles(config, config.pipelineType, "local")
17
+ : undefined,
18
+ writeDotEnvFiles(config, choice),
19
19
 
20
- await writeDTsFiles(config, choice);
20
+ writeDTsFiles(config, choice),
21
21
 
22
- await printVariables(config, choice);
22
+ printVariables(config, choice),
23
+ ]);
23
24
  };
@@ -1,4 +1,4 @@
1
- import type { Context } from "@catladder/pipeline";
1
+ import type { ComponentContext } from "@catladder/pipeline";
2
2
  import {
3
3
  createKubernetesCloudsqlBaseValues,
4
4
  isOfDeployType,
@@ -79,7 +79,7 @@ export default async (vorpal: Vorpal) =>
79
79
 
80
80
  const getProxyInfoForKubernetes = async (
81
81
  vorpal: CommandInstance,
82
- context: Context,
82
+ context: ComponentContext,
83
83
  ): Promise<ProxyInfo> => {
84
84
  if (!isOfDeployType(context.componentConfig.deploy, "kubernetes")) {
85
85
  throw new Error("unsupported");
@@ -109,7 +109,7 @@ const getProxyInfoForKubernetes = async (
109
109
 
110
110
  const getProxyInfoForCloudRun = async (
111
111
  vorpal: CommandInstance,
112
- context: Context,
112
+ context: ComponentContext,
113
113
  ): Promise<ProxyInfo> => {
114
114
  if (
115
115
  !isOfDeployType(context.componentConfig.deploy, "google-cloudrun") ||
@@ -8,7 +8,7 @@ import ensureCluster from "./utils/ensureCluster";
8
8
  import type { CommandInstance } from "vorpal";
9
9
  import { parseChoice } from "../../../../config/parseChoice";
10
10
  import { getPipelineContextByChoice } from "../../../../config/getProjectConfig";
11
- import type { Context } from "@catladder/pipeline";
11
+ import type { ComponentContext } from "@catladder/pipeline";
12
12
  import { isOfDeployType } from "@catladder/pipeline";
13
13
  import { startPortForwardCommand } from "../../../../utils/portForwards";
14
14
  import open from "open";
@@ -44,7 +44,10 @@ const kubePortForward = async (cmd: CommandInstance, envComponent: string) => {
44
44
  return startKubePortForward(podName, localPort, remotePort, namespace);
45
45
  };
46
46
 
47
- const cloudRunPortForward = async (cmd: CommandInstance, context: Context) => {
47
+ const cloudRunPortForward = async (
48
+ cmd: CommandInstance,
49
+ context: ComponentContext,
50
+ ) => {
48
51
  if (!isOfDeployType(context.componentConfig.deploy, "google-cloudrun")) {
49
52
  throw new Error("not cloud run");
50
53
  }
@@ -1,4 +1,4 @@
1
- import type { Context } from "@catladder/pipeline";
1
+ import type { ComponentContext } from "@catladder/pipeline";
2
2
  import {
3
3
  GCLOUD_DEPLOY_CREDENTIALS_KEY,
4
4
  GCLOUD_RUN_CANONICAL_HOST_SUFFIX,
@@ -14,7 +14,7 @@ import { upsertAllVariables } from "../../../../../utils/gitlab";
14
14
 
15
15
  export const setupCloudRun = async (
16
16
  instance: CommandInstance,
17
- context: Context,
17
+ context: ComponentContext,
18
18
  ) => {
19
19
  if (!isOfDeployType(context.componentConfig.deploy, "google-cloudrun")) {
20
20
  throw new Error("deploy config is not of type 'google-cloudrun'");
@@ -1,4 +1,4 @@
1
- import type { Context } from "@catladder/pipeline";
1
+ import type { ComponentContext } from "@catladder/pipeline";
2
2
  import { isOfDeployType } from "@catladder/pipeline";
3
3
  import type { CommandInstance } from "vorpal";
4
4
  import { setupCloudRun } from "./setupCloudRun";
@@ -7,7 +7,7 @@ import { setupKubernetes } from "./setupKubernetes";
7
7
 
8
8
  export const setupContext = async (
9
9
  instance: CommandInstance,
10
- context: Context,
10
+ context: ComponentContext,
11
11
  ) => {
12
12
  instance.log("");
13
13
  instance.log(
@@ -1,4 +1,4 @@
1
- import type { Context } from "@catladder/pipeline";
1
+ import type { ComponentContext } from "@catladder/pipeline";
2
2
  import {
3
3
  getFullKubernetesClusterName,
4
4
  isOfDeployType,
@@ -15,7 +15,7 @@ import ensureNamespace from "../utils/ensureNamespace";
15
15
 
16
16
  export const setupKubernetes = async (
17
17
  instance: CommandInstance,
18
- context: Context,
18
+ context: ComponentContext,
19
19
  ) => {
20
20
  const deployConfig = context.componentConfig.deploy;
21
21
  if (!isOfDeployType(deployConfig, "kubernetes")) {
@@ -1,10 +1,10 @@
1
- import type { Context } from "@catladder/pipeline";
1
+ import type { ComponentContext } from "@catladder/pipeline";
2
2
  import { getKubernetesNamespace } from "@catladder/pipeline";
3
3
  import type { V1ObjectMeta } from "@kubernetes/client-node";
4
4
  import { V1Namespace } from "@kubernetes/client-node";
5
5
  import { getk8sApi } from "../../../../../k8sApi";
6
6
 
7
- export default async function (context: Context) {
7
+ export default async function (context: ComponentContext) {
8
8
  const namespace = getKubernetesNamespace(
9
9
  context.fullConfig,
10
10
  context.environment.shortName,
@@ -3,7 +3,7 @@ import {
3
3
  readConfigSync,
4
4
  getAllEnvs,
5
5
  getEnvironment as _getEnvironment,
6
- createContext,
6
+ createComponentContext,
7
7
  getSecretVarName,
8
8
  } from "@catladder/pipeline";
9
9
 
@@ -53,7 +53,7 @@ export const getPipelineContextByChoice = async (
53
53
  componentName: string,
54
54
  ) => {
55
55
  const config = await getProjectConfig();
56
- return await createContext({
56
+ return await createComponentContext({
57
57
  config,
58
58
  componentName,
59
59
  env,
@@ -1,11 +1,11 @@
1
- import type { Context } from "@catladder/pipeline";
1
+ import type { ComponentContext } from "@catladder/pipeline";
2
2
  import { isOfDeployType } from "@catladder/pipeline";
3
3
  import type { CommandInstance } from "vorpal";
4
4
  import { openGoogleCloudDashboard } from "../openDashboard";
5
5
 
6
6
  export const openGoogleCloudRunDashboard = async (
7
7
  instance: CommandInstance,
8
- context: Context,
8
+ context: ComponentContext,
9
9
  ) => {
10
10
  if (!isOfDeployType(context.componentConfig.deploy, "google-cloudrun")) {
11
11
  throw new Error("deploy type is not google-cloudrun ");
@@ -1,4 +1,4 @@
1
- import type { Context } from "@catladder/pipeline";
1
+ import type { ComponentContext } from "@catladder/pipeline";
2
2
 
3
3
  import { exec } from "child-process-promise";
4
4
  import { createHmac } from "crypto";
@@ -22,7 +22,7 @@ type ServiceAccount = {
22
22
  description: string;
23
23
  };
24
24
  const upsertGcloudServiceAccount = async (
25
- context: Context,
25
+ context: ComponentContext,
26
26
  account: ServiceAccount,
27
27
  ): Promise<string> => {
28
28
  const { projectId, name, displayName, roles, description } = account;
@@ -76,7 +76,7 @@ const upsertGcloudServiceAccount = async (
76
76
 
77
77
  export const upsertGcloudServiceAccountAndSaveSecret = async (
78
78
  instance: CommandInstance,
79
- context: Context,
79
+ context: ComponentContext,
80
80
  account: ServiceAccount,
81
81
  secretName: string,
82
82
  ): Promise<void> => {
@@ -1,11 +1,11 @@
1
- import type { Context } from "@catladder/pipeline";
1
+ import type { ComponentContext } from "@catladder/pipeline";
2
2
  import { isOfDeployType } from "@catladder/pipeline";
3
3
  import type { CommandInstance } from "vorpal";
4
4
  import { openGoogleCloudDashboard } from "../gcloud/openDashboard";
5
5
 
6
6
  export const openGoogleCloudLogs = async (
7
7
  instance: CommandInstance,
8
- context: Context,
8
+ context: ComponentContext,
9
9
  ) => {
10
10
  const deployConfig = context.componentConfig.deploy;
11
11
  if (!isOfDeployType(deployConfig, "kubernetes")) {
@@ -31,7 +31,7 @@ export const openGoogleCloudLogs = async (
31
31
 
32
32
  export const openGoogleCloudKubernetesDashboard = async (
33
33
  instance: CommandInstance,
34
- context: Context,
34
+ context: ComponentContext,
35
35
  ) => {
36
36
  const deployConfig = context.componentConfig.deploy;
37
37
  if (!isOfDeployType(deployConfig, "kubernetes")) {
@@ -114,20 +114,36 @@ type GitlabVariable = {
114
114
  environment_scope: string;
115
115
  };
116
116
  export const getAllVariables = memoizee(
117
- async (vorpal: CommandInstance | null): Promise<Array<GitlabVariable>> => {
117
+ async (
118
+ vorpal: CommandInstance | null,
119
+ n = 5, // how many requests to do in parallel, 5 seems a good value for many projects, ideally we would do one request in parallel per component
120
+ ): Promise<Array<GitlabVariable>> => {
118
121
  const { id } = await getProjectInfo(vorpal);
122
+
119
123
  let all: Array<GitlabVariable> = [];
120
- let result: Array<GitlabVariable>;
124
+ let result: Array<Array<GitlabVariable>> = [];
121
125
  let page = 1;
126
+
122
127
  do {
123
- result = await doGitlabRequest(
124
- vorpal,
125
- // 100 is max page size
126
- `projects/${id}/variables?per_page=100&page=${page}`,
127
- );
128
- page++;
129
- all = [...all, ...result];
130
- } while (result?.length > 0);
128
+ // Create an array of promises for N pages
129
+ const promises = Array.from({ length: n }, (_, i) => {
130
+ return doGitlabRequest(
131
+ vorpal,
132
+ `projects/${id}/variables?per_page=100&page=${page + i}`,
133
+ );
134
+ });
135
+
136
+ // Wait for all promises to resolve
137
+ result = await Promise.all(promises);
138
+
139
+ // Increment the page by N
140
+ page += n;
141
+
142
+ // Flatten the result array and add it to 'all'
143
+ all = [...all, ...result.flat()];
144
+ // Continue only if the last page had results
145
+ } while (result.length > 0 && result[result.length - 1].length > 0);
146
+
131
147
  return all;
132
148
  },
133
149
  { promise: true },