@shopify/cli-kit 3.0.17 → 3.0.18

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.d.ts CHANGED
@@ -1,23 +1,23 @@
1
- import { Listr, ListrTaskWrapper, ListrDefaultRenderer, ListrTask } from 'listr2';
2
- import { AbortSignal, AbortController } from 'abort-controller';
1
+ import { AbortController, AbortSignal } from 'abort-controller';
2
+ import { RequestDocument, Variables } from 'graphql-request';
3
3
  import { Writable } from 'node:stream';
4
- import { camelCase, paramCase, snakeCase, constantCase } from 'change-case';
4
+ import * as _oclif_core_lib_interfaces from '@oclif/core/lib/interfaces';
5
+ import { Plugin } from '@oclif/core/lib/interfaces';
6
+ import * as simple_git from 'simple-git';
7
+ import nodeFetch, { RequestInfo, RequestInit } from 'node-fetch';
8
+ import FormData from 'form-data';
9
+ import { platform } from 'node:process';
5
10
  import * as pathe from 'pathe';
6
11
  import { findUp } from 'find-up';
7
12
  import fastGlob from 'fast-glob';
8
13
  import { pathToFileURL } from 'node:url';
9
- import * as simple_git from 'simple-git';
10
- import { platform } from 'node:process';
11
14
  import { z } from 'zod';
12
- import * as toml$1 from '@iarna/toml';
13
- import Conf from 'conf';
14
- import { RequestDocument, Variables } from 'graphql-request';
15
- import nodeFetch, { RequestInfo, RequestInit } from 'node-fetch';
16
- import FormData from 'form-data';
17
15
  import semver$1 from 'semver/classes/semver';
18
16
  import coerce from 'semver/functions/coerce';
19
- import * as _oclif_core_lib_interfaces from '@oclif/core/lib/interfaces';
20
- import { Plugin } from '@oclif/core/lib/interfaces';
17
+ import Conf from 'conf';
18
+ import { camelCase, paramCase, snakeCase, constantCase } from 'change-case';
19
+ import * as toml$1 from '@iarna/toml';
20
+ import { Listr, ListrTaskWrapper, ListrDefaultRenderer, ListrTask } from 'listr2';
21
21
 
22
22
  function _mergeNamespaces(n, m) {
23
23
  m.forEach(function (e) {
@@ -34,1648 +34,1531 @@ function _mergeNamespaces(n, m) {
34
34
  return Object.freeze(n);
35
35
  }
36
36
 
37
- interface BaseQuestion<TName extends string> {
38
- name: TName;
39
- message: string;
40
- preface?: string;
41
- validate?: (value: string) => string | true;
42
- default?: string;
43
- result?: (value: string) => string | boolean;
44
- }
45
- declare type InputQuestion<TName extends string> = BaseQuestion<TName> & {
46
- type: 'input';
47
- };
48
- declare type SelectQuestion<TName extends string> = BaseQuestion<TName> & {
49
- type: 'select';
50
- choices: string[] | {
51
- name: string;
52
- value: string;
53
- }[];
54
- };
55
- declare type AutocompleteQuestion<TName extends string> = BaseQuestion<TName> & {
56
- type: 'autocomplete';
57
- choices: string[] | {
58
- name: string;
59
- value: string;
60
- }[];
61
- };
62
- declare type PasswordQuestion<TName extends string> = BaseQuestion<TName> & {
63
- type: 'password';
37
+ declare const constants: {
38
+ environmentVariables: {
39
+ unitTest: string;
40
+ shopifyConfig: string;
41
+ runAsUser: string;
42
+ partnersEnv: string;
43
+ shopifyEnv: string;
44
+ identityEnv: string;
45
+ spin: string;
46
+ spinInstance: string;
47
+ spinWorkspace: string;
48
+ spinNamespace: string;
49
+ spinHost: string;
50
+ partnersToken: string;
51
+ verbose: string;
52
+ noAnalytics: string;
53
+ };
54
+ paths: {
55
+ executables: {
56
+ dev: string;
57
+ };
58
+ directories: {
59
+ cache: {
60
+ path: () => string;
61
+ vendor: {
62
+ path: () => string;
63
+ binaries: () => string;
64
+ };
65
+ };
66
+ };
67
+ };
68
+ /**
69
+ * Versions are resolved at build time by Rollup's JSON plugin.
70
+ */
71
+ versions: {
72
+ cliKit: string;
73
+ };
74
+ keychain: {
75
+ service: string;
76
+ };
77
+ session: {
78
+ expirationTimeMarginInMinutes: number;
79
+ };
64
80
  };
65
- declare type Question<TName extends string = string> = InputQuestion<TName> | SelectQuestion<TName> | AutocompleteQuestion<TName> | PasswordQuestion<TName>;
66
- declare const prompt: <TName extends string & keyof TAnswers, TAnswers extends { [key in TName]: string; } = { [key_1 in TName]: string; }>(questions: readonly Question<TName>[], debugForceInquirer?: boolean) => Promise<TAnswers>;
67
- declare function nonEmptyDirectoryPrompt(directory: string): Promise<void>;
68
81
 
69
- type ui_InputQuestion<TName extends string> = InputQuestion<TName>;
70
- type ui_SelectQuestion<TName extends string> = SelectQuestion<TName>;
71
- type ui_AutocompleteQuestion<TName extends string> = AutocompleteQuestion<TName>;
72
- type ui_PasswordQuestion<TName extends string> = PasswordQuestion<TName>;
73
- type ui_Question<TName extends string = string> = Question<TName>;
74
- declare const ui_prompt: typeof prompt;
75
- declare const ui_nonEmptyDirectoryPrompt: typeof nonEmptyDirectoryPrompt;
76
- declare const ui_Listr: typeof Listr;
77
- declare const ui_ListrTaskWrapper: typeof ListrTaskWrapper;
78
- declare const ui_ListrDefaultRenderer: typeof ListrDefaultRenderer;
79
- declare const ui_ListrTask: typeof ListrTask;
80
- declare namespace ui {
82
+ declare namespace abort {
81
83
  export {
82
- ui_InputQuestion as InputQuestion,
83
- ui_SelectQuestion as SelectQuestion,
84
- ui_AutocompleteQuestion as AutocompleteQuestion,
85
- ui_PasswordQuestion as PasswordQuestion,
86
- ui_Question as Question,
87
- ui_prompt as prompt,
88
- ui_nonEmptyDirectoryPrompt as nonEmptyDirectoryPrompt,
89
- ui_Listr as Listr,
90
- ui_ListrTaskWrapper as ListrTaskWrapper,
91
- ui_ListrDefaultRenderer as ListrDefaultRenderer,
92
- ui_ListrTask as ListrTask,
84
+ AbortController as Controller,
85
+ AbortSignal as Signal,
86
+ };
87
+ }
88
+
89
+ declare const url = "https://monorail-edge.shopifysvc.com/v1/produce";
90
+ declare const reportEvent: (command: string, args: string[]) => Promise<void>;
91
+
92
+ declare const analytics_url: typeof url;
93
+ declare const analytics_reportEvent: typeof reportEvent;
94
+ declare namespace analytics {
95
+ export {
96
+ analytics_url as url,
97
+ analytics_reportEvent as reportEvent,
93
98
  };
94
99
  }
95
100
 
96
- declare const genericConfigurationFileNames: {
97
- readonly yarn: {
98
- readonly lockfile: "yarn.lock";
99
- };
100
- readonly pnpm: {
101
- readonly lockfile: "pnpm-lock.yaml";
102
- };
103
- };
104
- declare const dependencyManager: readonly ["yarn", "npm", "pnpm"];
105
- declare type DependencyManager = typeof dependencyManager[number];
106
- declare const PackageJsonNotFoundError: (directory: string) => Abort;
107
101
  /**
108
- * Returns the dependency manager used to run the create workflow.
109
- * @param env {Object} The environment variables of the process in which the CLI runs.
110
- * @returns The dependency manager
102
+ * A scope supported by the Shopify Admin API.
111
103
  */
112
- declare function dependencyManagerUsedForCreating(env?: NodeJS.ProcessEnv): DependencyManager;
104
+ declare type AdminAPIScope = 'graphql' | 'themes' | 'collaborator' | string;
113
105
  /**
114
- * Returns the dependency manager used by an existing project.
115
- * @param directory {string} The root directory of the project.
116
- * @returns The dependency manager
106
+ * It represents the options to authenticate against the Shopify Admin API.
117
107
  */
118
- declare function getDependencyManager(directory: string): Promise<DependencyManager>;
119
- interface InstallNPMDependenciesRecursivelyOptions {
120
- /**
121
- * The dependency manager to use to install the dependencies.
122
- */
123
- dependencyManager: DependencyManager;
124
- /**
125
- * The directory from where we'll find package.json's recursively
126
- */
127
- directory: string;
128
- /**
129
- * Specifies the maximum depth of the glob search.
130
- */
131
- deep?: number;
108
+ interface AdminAPIOAuthOptions {
109
+ /** Store to request permissions for */
110
+ storeFqdn: string;
111
+ /** List of scopes to request permissions for */
112
+ scopes: AdminAPIScope[];
132
113
  }
133
114
  /**
134
- * This function traverses down a directory tree to find directories containing a package.json
135
- * and installs the dependencies if needed. To know if it's needed, it uses the "check" command
136
- * provided by dependency managers.
137
- * @param options {InstallNPMDependenciesRecursivelyOptions} Options to install dependencies recursively.
138
- */
139
- declare function installNPMDependenciesRecursively(options: InstallNPMDependenciesRecursivelyOptions): Promise<void>;
140
- /**
141
- * Installs the dependencies in the given directory.
142
- * @param directory {string} The directory that contains the package.json
143
- * @param dependencyManager {DependencyManager} The dependency manager to use to install the dependencies.
144
- * @param stdout {Writable} Standard output stream.
145
- * @param stderr {Writable} Standard error stream.
146
- * @param signal {AbortSignal} Abort signal.
147
- * @returns stderr {Writable} Standard error stream.
115
+ * A scope supported by the Partners API.
148
116
  */
149
- declare function install(directory: string, dependencyManager: DependencyManager, stdout?: Writable, stderr?: Writable, signal?: AbortSignal): Promise<void>;
117
+ declare type PartnersAPIScope = 'cli' | string;
118
+ interface PartnersAPIOAuthOptions {
119
+ /** List of scopes to request permissions for */
120
+ scopes: PartnersAPIScope[];
121
+ }
150
122
  /**
151
- * Returns the name of the package configured in its package.json
152
- * @param packageJsonPath {string} Path to the package.json file
153
- * @returns A promise that resolves with the name.
123
+ * A scope supported by the Storefront Renderer API.
154
124
  */
155
- declare function getPackageName(packageJsonPath: string): Promise<string>;
125
+ declare type StorefrontRendererScope = 'devtools' | string;
126
+ interface StorefrontRendererAPIOAuthOptions {
127
+ /** List of scopes to request permissions for */
128
+ scopes: StorefrontRendererScope[];
129
+ }
156
130
  /**
157
- * Returns the list of production and dev dependencies of a package.json
158
- * @param packageJsonPath {string} Path to the package.json file
159
- * @returns A promise that resolves with the list of dependencies.
131
+ * It represents the authentication requirements and
132
+ * is the input necessary to trigger the authentication
133
+ * flow.
160
134
  */
161
- declare function getDependencies(packageJsonPath: string): Promise<{
162
- [key: string]: string;
163
- }>;
164
- declare function checkForNewVersion(dependency: string, currentVersion: string): Promise<string | undefined>;
165
- declare function getOutputUpdateCLIReminder(dependencyManager: DependencyManager, version: string): string;
166
- interface PackageJSONContents {
167
- name: string;
168
- version?: string;
169
- dependencies?: {
170
- [key: string]: string;
171
- };
172
- devDependencies?: {
173
- [key: string]: string;
174
- };
135
+ interface OAuthApplications {
136
+ adminApi?: AdminAPIOAuthOptions;
137
+ storefrontRendererApi?: StorefrontRendererAPIOAuthOptions;
138
+ partnersApi?: PartnersAPIOAuthOptions;
175
139
  }
176
- declare function packageJSONContents(packageJsonPath: string): Promise<PackageJSONContents>;
177
- declare type DependencyType = 'dev' | 'prod' | 'peer';
178
- interface AddNPMDependenciesIfNeededOptions {
179
- /** How dependencies should be added */
180
- type: DependencyType;
181
- /** The dependency manager to use to add dependencies */
182
- dependencyManager: DependencyManager;
183
- /** The directory that contains the package.json where dependencies will be added */
184
- directory: string;
185
- /** Standard output coming from the underlying installation process */
186
- stdout?: Writable;
187
- /** Standard error coming from the underlying installation process */
188
- stderr?: Writable;
189
- /** Abort signal to stop the process */
190
- signal?: AbortSignal;
140
+ interface AdminSession {
141
+ token: string;
142
+ storeFqdn: string;
143
+ }
144
+ interface OAuthSession {
145
+ admin?: AdminSession;
146
+ partners?: string;
147
+ storefront?: string;
191
148
  }
192
149
  /**
193
- * Adds dependencies to a Node project (i.e. a project that has a package.json)
194
- * @param dependencies {string[]} List of dependencies to be added.
195
- * @param options {AddNPMDependenciesIfNeededOptions} Options for adding dependencies.
150
+ * Ensure that we have a valid session to access the Partners API.
151
+ * If SHOPIFY_CLI_PARTNERS_TOKEN exists, that token will be used to obtain a valid Partners Token
152
+ * If SHOPIFY_CLI_PARTNERS_TOKEN exists, scopes will be ignored
153
+ * @param scopes {string[]} Optional array of extra scopes to authenticate with.
154
+ * @returns {Promise<string>} The access token for the Partners API.
196
155
  */
197
- declare function addNPMDependenciesIfNeeded(dependencies: string[], options: AddNPMDependenciesIfNeededOptions): Promise<void>;
198
- declare function addLatestNPMDependencies(dependencies: string[], options: AddNPMDependenciesIfNeededOptions): Promise<void>;
199
-
200
- declare const dependency_genericConfigurationFileNames: typeof genericConfigurationFileNames;
201
- declare const dependency_dependencyManager: typeof dependencyManager;
202
- type dependency_DependencyManager = DependencyManager;
203
- declare const dependency_PackageJsonNotFoundError: typeof PackageJsonNotFoundError;
204
- declare const dependency_dependencyManagerUsedForCreating: typeof dependencyManagerUsedForCreating;
205
- declare const dependency_getDependencyManager: typeof getDependencyManager;
206
- declare const dependency_installNPMDependenciesRecursively: typeof installNPMDependenciesRecursively;
207
- declare const dependency_install: typeof install;
208
- declare const dependency_getPackageName: typeof getPackageName;
209
- declare const dependency_getDependencies: typeof getDependencies;
210
- declare const dependency_checkForNewVersion: typeof checkForNewVersion;
211
- declare const dependency_getOutputUpdateCLIReminder: typeof getOutputUpdateCLIReminder;
212
- declare const dependency_packageJSONContents: typeof packageJSONContents;
213
- type dependency_DependencyType = DependencyType;
214
- declare const dependency_addNPMDependenciesIfNeeded: typeof addNPMDependenciesIfNeeded;
215
- declare const dependency_addLatestNPMDependencies: typeof addLatestNPMDependencies;
216
- declare namespace dependency {
217
- export {
218
- dependency_genericConfigurationFileNames as genericConfigurationFileNames,
219
- dependency_dependencyManager as dependencyManager,
220
- dependency_DependencyManager as DependencyManager,
221
- dependency_PackageJsonNotFoundError as PackageJsonNotFoundError,
222
- dependency_dependencyManagerUsedForCreating as dependencyManagerUsedForCreating,
223
- dependency_getDependencyManager as getDependencyManager,
224
- dependency_installNPMDependenciesRecursively as installNPMDependenciesRecursively,
225
- dependency_install as install,
226
- dependency_getPackageName as getPackageName,
227
- dependency_getDependencies as getDependencies,
228
- dependency_checkForNewVersion as checkForNewVersion,
229
- dependency_getOutputUpdateCLIReminder as getOutputUpdateCLIReminder,
230
- dependency_packageJSONContents as packageJSONContents,
231
- dependency_DependencyType as DependencyType,
232
- dependency_addNPMDependenciesIfNeeded as addNPMDependenciesIfNeeded,
233
- dependency_addLatestNPMDependencies as addLatestNPMDependencies,
234
- };
235
- }
236
-
237
- declare enum ContentTokenType {
238
- Raw = 0,
239
- Command = 1,
240
- Json = 2,
241
- Path = 3,
242
- Link = 4,
243
- Heading = 5,
244
- SubHeading = 6,
245
- Italic = 7,
246
- ErrorText = 8,
247
- Yellow = 9,
248
- Cyan = 10,
249
- Magenta = 11,
250
- Green = 12
251
- }
252
- interface ContentMetadata {
253
- link?: string;
254
- }
255
- declare class ContentToken {
256
- type: ContentTokenType;
257
- value: Message;
258
- metadata: ContentMetadata;
259
- constructor(value: Message, metadata: ContentMetadata | undefined, type: ContentTokenType);
260
- }
261
- declare const token: {
262
- raw: (value: Message) => ContentToken;
263
- genericShellCommand: (value: Message) => ContentToken;
264
- json: (value: any) => ContentToken;
265
- path: (value: Message) => ContentToken;
266
- link: (value: Message, link: string) => ContentToken;
267
- heading: (value: Message) => ContentToken;
268
- subheading: (value: Message) => ContentToken;
269
- italic: (value: Message) => ContentToken;
270
- errorText: (value: Message) => ContentToken;
271
- cyan: (value: Message) => ContentToken;
272
- yellow: (value: Message) => ContentToken;
273
- magenta: (value: Message) => ContentToken;
274
- green: (value: Message) => ContentToken;
275
- packagejsonScript: (dependencyManager: DependencyManager, scriptName: string, ...scriptArgs: string[]) => ContentToken;
276
- successIcon: () => ContentToken;
277
- failIcon: () => ContentToken;
278
- };
279
- declare class TokenizedString {
280
- value: string;
281
- constructor(value: string);
282
- }
283
- declare type Message = string | TokenizedString;
284
- declare function content(strings: TemplateStringsArray, ...keys: (ContentToken | string)[]): TokenizedString;
285
- /** Log levels */
286
- declare type LogLevel = 'fatal' | 'error' | 'warn' | 'info' | 'debug' | 'trace' | 'silent';
287
- /**
288
- *
289
- * @returns {LogLevel} It returns the log level set by the user.
290
- */
291
- declare const currentLogLevel: () => LogLevel;
292
- declare const shouldOutput: (logLevel: LogLevel) => boolean;
293
- /**
294
- * Ouputs information to the user. This is akin to "console.log"
295
- * Info messages don't get additional formatting.
296
- * Note: Info messages are sent through the standard output.
297
- * @param content {string} The content to be output to the user.
298
- */
299
- declare const info: (content: Message) => void;
300
- /**
301
- * Outputs a success message to the user.
302
- * Success message receive a special formatting to make them stand out in the console.
303
- * Note: Success messages are sent through the standard output.
304
- * @param content {string} The content to be output to the user.
305
- */
306
- declare const success: (content: Message) => void;
307
- /**
308
- * Outputs a completed message to the user.
309
- * Completed message receive a special formatting to make them stand out in the console.
310
- * Note: Completed messages are sent through the standard output.
311
- * @param content {string} The content to be output to the user.
312
- */
313
- declare const completed: (content: Message) => void;
156
+ declare function ensureAuthenticatedPartners(scopes?: string[], env?: NodeJS.ProcessEnv): Promise<string>;
314
157
  /**
315
- * Ouputs debug information to the user. By default these output is hidden unless the user calls the CLI with --verbose.
316
- * Debug messages don't get additional formatting.
317
- * Note: Debug messages are sent through the standard output.
318
- * @param content {string} The content to be output to the user.
158
+ * Ensure that we have a valid session to access the Storefront API.
159
+ * @param scopes {string[]} Optional array of extra scopes to authenticate with.
160
+ * @returns {Promise<string>} The access token for the Storefront API.
319
161
  */
320
- declare const debug: (content: Message) => void;
162
+ declare function ensureAuthenticatedStorefront(scopes?: string[]): Promise<string>;
321
163
  /**
322
- * Outputs a warning message to the user.
323
- * Warning messages receive a special formatting to make them stand out in the console.
324
- * Note: Warning messages are sent through the standard output.
325
- * @param content {string} The content to be output to the user.
164
+ * Ensure that we have a valid Admin session for the given store.
165
+ * @param store {string} Store fqdn to request auth for
166
+ * @param scopes {string[]} Optional array of extra scopes to authenticate with.
167
+ * @returns {Promise<string>} The access token for the Admin API
326
168
  */
327
- declare const warn: (content: Message) => void;
169
+ declare function ensureAuthenticatedAdmin(store: string, scopes?: string[]): Promise<AdminSession>;
328
170
  /**
329
- * Prints a new line in the terminal.
171
+ * This method ensures that we have a valid session to authenticate against the given applications using the provided scopes.
172
+ * @param applications {OAuthApplications} An object containing the applications we need to be authenticated with.
173
+ * @returns {OAuthSession} An instance with the access tokens organized by application.
330
174
  */
331
- declare const newline: () => void;
175
+ declare function ensureAuthenticated(applications: OAuthApplications, env?: NodeJS.ProcessEnv): Promise<OAuthSession>;
176
+ declare function logout(): Promise<void>;
177
+
178
+ type session_OAuthApplications = OAuthApplications;
179
+ type session_AdminSession = AdminSession;
180
+ type session_OAuthSession = OAuthSession;
181
+ declare const session_ensureAuthenticatedPartners: typeof ensureAuthenticatedPartners;
182
+ declare const session_ensureAuthenticatedStorefront: typeof ensureAuthenticatedStorefront;
183
+ declare const session_ensureAuthenticatedAdmin: typeof ensureAuthenticatedAdmin;
184
+ declare const session_ensureAuthenticated: typeof ensureAuthenticated;
185
+ declare const session_logout: typeof logout;
186
+ declare namespace session {
187
+ export {
188
+ session_OAuthApplications as OAuthApplications,
189
+ session_AdminSession as AdminSession,
190
+ session_OAuthSession as OAuthSession,
191
+ session_ensureAuthenticatedPartners as ensureAuthenticatedPartners,
192
+ session_ensureAuthenticatedStorefront as ensureAuthenticatedStorefront,
193
+ session_ensureAuthenticatedAdmin as ensureAuthenticatedAdmin,
194
+ session_ensureAuthenticated as ensureAuthenticated,
195
+ session_logout as logout,
196
+ };
197
+ }
198
+
199
+ declare function request$1<T>(query: RequestDocument, session: AdminSession, variables?: Variables): Promise<T>;
200
+
201
+ declare namespace admin {
202
+ export {
203
+ request$1 as request,
204
+ };
205
+ }
206
+
207
+ declare function request<T>(query: RequestDocument, token: string, variables?: Variables): Promise<T>;
332
208
  /**
333
- * Formats and outputs a fatal error.
334
- * Note: This API is not intended to be used internally. If you want to
335
- * abort the execution due to an error, raise a fatal error and let the
336
- * error handler handle and format it.
337
- * @param content {Fatal} The fatal error to be output.
209
+ * Check if the given token is revoked and no longer valid to interact with the Partners API.
210
+ * @param token {string} - The token to check
211
+ * @returns {Promise<boolean>} - True if the token is revoked, false otherwise
338
212
  */
339
- declare const error$1: (content: Fatal) => Promise<void>;
340
- declare function stringifyMessage(message: Message): string;
341
- interface OutputProcess {
342
- /** The prefix to include in the logs
343
- * [vite] Output coming from Vite
344
- */
345
- prefix: string;
346
- /**
347
- * A callback to invoke the process. stdout and stderr should be used
348
- * to send standard output and error data that gets formatted with the
349
- * right prefix.
350
- */
351
- action: (stdout: Writable, stderr: Writable, signal: AbortSignal) => Promise<void>;
352
- }
213
+ declare function checkIfTokenIsRevoked(token: string): Promise<boolean>;
353
214
  /**
354
- * Use this function when you have multiple concurrent processes that send data events
355
- * and we need to output them ensuring that they can visually differenciated by the user.
215
+ * Function queries are proxied through the script service proxy.
216
+ * To execute a query, we encapsulate it inside another query (including the variables)
217
+ * This is done automatically, you just need to provide the query and the variables.
356
218
  *
357
- * @param processes {OutputProcess[]} A list of processes to run concurrently.
219
+ * @param apiKey {string} APIKey of the app where the query will be executed.
220
+ * @param query {any} GraphQL query to execute.
221
+ * @param token {string} Partners token
222
+ * @param variables {any} GraphQL variables to pass to the query.
223
+ * @returns {Promise<T>} The response of the query.
358
224
  */
359
- declare function concurrent(processes: OutputProcess[], callback?: ((signal: AbortSignal) => void) | undefined): Promise<void>;
360
- declare function unstyled(message: string): string;
361
- declare function shouldDisplayColors(): boolean;
225
+ declare function functionProxyRequest<T>(apiKey: string, query: unknown, token: string, variables?: unknown): Promise<T>;
362
226
 
363
- declare const output_token: typeof token;
364
- type output_TokenizedString = TokenizedString;
365
- declare const output_TokenizedString: typeof TokenizedString;
366
- type output_Message = Message;
367
- declare const output_content: typeof content;
368
- type output_LogLevel = LogLevel;
369
- declare const output_currentLogLevel: typeof currentLogLevel;
370
- declare const output_shouldOutput: typeof shouldOutput;
371
- declare const output_info: typeof info;
372
- declare const output_success: typeof success;
373
- declare const output_completed: typeof completed;
374
- declare const output_debug: typeof debug;
375
- declare const output_warn: typeof warn;
376
- declare const output_newline: typeof newline;
377
- declare const output_stringifyMessage: typeof stringifyMessage;
378
- type output_OutputProcess = OutputProcess;
379
- declare const output_concurrent: typeof concurrent;
380
- declare const output_unstyled: typeof unstyled;
381
- declare const output_shouldDisplayColors: typeof shouldDisplayColors;
382
- declare namespace output {
227
+ declare const partners$2_request: typeof request;
228
+ declare const partners$2_checkIfTokenIsRevoked: typeof checkIfTokenIsRevoked;
229
+ declare const partners$2_functionProxyRequest: typeof functionProxyRequest;
230
+ declare namespace partners$2 {
383
231
  export {
384
- output_token as token,
385
- output_TokenizedString as TokenizedString,
386
- output_Message as Message,
387
- output_content as content,
388
- output_LogLevel as LogLevel,
389
- output_currentLogLevel as currentLogLevel,
390
- output_shouldOutput as shouldOutput,
391
- output_info as info,
392
- output_success as success,
393
- output_completed as completed,
394
- output_debug as debug,
395
- output_warn as warn,
396
- output_newline as newline,
397
- error$1 as error,
398
- output_stringifyMessage as stringifyMessage,
399
- output_OutputProcess as OutputProcess,
400
- output_concurrent as concurrent,
401
- output_unstyled as unstyled,
402
- output_shouldDisplayColors as shouldDisplayColors,
232
+ partners$2_request as request,
233
+ partners$2_checkIfTokenIsRevoked as checkIfTokenIsRevoked,
234
+ partners$2_functionProxyRequest as functionProxyRequest,
403
235
  };
404
236
  }
405
237
 
406
- declare enum FatalErrorType {
407
- Abort = 0,
408
- AbortSilent = 1,
409
- Bug = 2
410
- }
411
- declare class CancelExecution extends Error {
412
- }
413
- /**
414
- * A fatal error represents an error shouldn't be rescued and that causes the execution to terminate.
415
- * There shouldn't be code that catches fatal errors.
416
- */
417
- declare abstract class Fatal extends Error {
418
- tryMessage: string | null;
419
- type: FatalErrorType;
420
- constructor(message: Message, type: FatalErrorType, tryMessage?: Message | null);
421
- }
422
- /**
423
- * An abort error is a fatal error that shouldn't be reported as a bug.
424
- * Those usually represent unexpected scenarios that we can't handle and that usually require some action from the developer
425
- */
426
- declare class Abort extends Fatal {
427
- constructor(message: Message, tryMessage?: Message | null);
238
+ declare const FindOrganizationQuery: string;
239
+ interface FindOrganizationQuerySchema {
240
+ organizations: {
241
+ nodes: {
242
+ id: string;
243
+ businessName: string;
244
+ website: string;
245
+ appsNext: boolean;
246
+ apps: {
247
+ nodes: {
248
+ id: string;
249
+ title: string;
250
+ apiKey: string;
251
+ apiSecretKeys: {
252
+ secret: string;
253
+ }[];
254
+ appType: string;
255
+ }[];
256
+ };
257
+ }[];
258
+ };
428
259
  }
429
- declare class AbortSilent extends Fatal {
430
- constructor();
260
+
261
+ interface AllOrganizationsQuerySchemaOrganization {
262
+ id: string;
263
+ businessName: string;
264
+ website: string;
265
+ appsNext: boolean;
266
+ apps: {
267
+ nodes: {
268
+ id: string;
269
+ title: string;
270
+ apiKey: string;
271
+ apiSecretKeys: {
272
+ secret: string;
273
+ }[];
274
+ appType: string;
275
+ }[];
276
+ };
431
277
  }
432
- /**
433
- * A bug error is an error that represents a bug and therefore should be reported.
434
- */
435
- declare class Bug extends Fatal {
436
- constructor(message: Message, tryMessage?: string | null);
278
+ interface AllOrganizationsQuerySchema {
279
+ organizations: {
280
+ nodes: AllOrganizationsQuerySchemaOrganization[];
281
+ };
437
282
  }
438
- /**
439
- * A function that handles errors that blow up in the CLI.
440
- * @param error Error to be handled.
441
- * @returns A promise that resolves with the error passed.
442
- */
443
- declare function handler(error: Error): Promise<Error>;
444
- declare function mapper(error: Error): Promise<Error>;
445
- declare function isFatal(error: Error): boolean;
446
- declare function shouldReport(error: Error): boolean;
283
+ declare const AllOrganizationsQuery: string;
447
284
 
448
- type error_CancelExecution = CancelExecution;
449
- declare const error_CancelExecution: typeof CancelExecution;
450
- type error_Fatal = Fatal;
451
- declare const error_Fatal: typeof Fatal;
452
- type error_Abort = Abort;
453
- declare const error_Abort: typeof Abort;
454
- type error_AbortSilent = AbortSilent;
455
- declare const error_AbortSilent: typeof AbortSilent;
456
- type error_Bug = Bug;
457
- declare const error_Bug: typeof Bug;
458
- declare const error_handler: typeof handler;
459
- declare const error_mapper: typeof mapper;
460
- declare const error_isFatal: typeof isFatal;
461
- declare const error_shouldReport: typeof shouldReport;
462
- declare const error_AbortSignal: typeof AbortSignal;
463
- declare namespace error {
464
- export {
465
- error_CancelExecution as CancelExecution,
466
- error_Fatal as Fatal,
467
- error_Abort as Abort,
468
- error_AbortSilent as AbortSilent,
469
- error_Bug as Bug,
470
- error_handler as handler,
471
- error_mapper as mapper,
472
- error_isFatal as isFatal,
473
- error_shouldReport as shouldReport,
474
- error_AbortSignal as AbortSignal,
475
- };
285
+ declare const CreateAppQuery: string;
286
+ interface CreateAppQueryVariables {
287
+ org: number;
288
+ title: string;
289
+ appUrl: string;
290
+ redir: string[];
291
+ type: string;
476
292
  }
477
-
478
- interface ExecOptions {
479
- cwd?: string;
480
- env?: {
481
- [key: string]: string | undefined;
293
+ interface CreateAppQuerySchema {
294
+ appCreate: {
295
+ app: {
296
+ id: string;
297
+ apiKey: string;
298
+ title: string;
299
+ applicationUrl: string;
300
+ redirectUrlWhitelist: string[];
301
+ apiSecretKeys: {
302
+ secret: string;
303
+ }[];
304
+ appType: string;
305
+ };
306
+ userErrors: {
307
+ field: string[];
308
+ message: string;
309
+ }[];
482
310
  };
483
- stdout?: Writable;
484
- stderr?: Writable;
485
- stdin?: string;
486
- signal?: AbortSignal;
487
- }
488
- declare const open: (url: string) => Promise<void>;
489
- /**
490
- * Runs a command asynchronously, aggregates the stdout data, and returns it.
491
- * @param command {string} Command to be executed.
492
- * @param args {string[]} Arguments to pass to the command.
493
- * @returns A promise that resolves with the aggregatted stdout of the command.
494
- */
495
- declare const captureOutput: (command: string, args: string[], options?: ExecOptions) => Promise<string>;
496
- declare const exec: (command: string, args: string[], options?: ExecOptions) => Promise<void>;
497
- interface ConcurrentExecCommand {
498
- prefix: string;
499
- executable: string;
500
- args: string[];
501
- cwd: string;
502
311
  }
503
- /**
504
- * Runs commands concurrently and combines the standard output and error data
505
- * into a single stream that differenciates the sources using a colored prefix:
506
- *
507
- * Example:
508
- * [my-extension] Log coming from my-extension
509
- * [my-script] Log coming from my script
510
- *
511
- * If one of the processes fails, it aborts the running ones and exits with that error.
512
- * @param commands {ConcurrentExecCommand[]} Commands to execute.
513
- */
514
- declare const concurrentExec: (commands: ConcurrentExecCommand[]) => Promise<void>;
515
312
 
516
- type system_ExecOptions = ExecOptions;
517
- declare const system_open: typeof open;
518
- declare const system_captureOutput: typeof captureOutput;
519
- declare const system_exec: typeof exec;
520
- declare const system_concurrentExec: typeof concurrentExec;
521
- declare namespace system {
522
- export {
523
- system_ExecOptions as ExecOptions,
524
- system_open as open,
525
- system_captureOutput as captureOutput,
526
- system_exec as exec,
527
- system_concurrentExec as concurrentExec,
528
- };
313
+ declare const UpdateURLsQuery: string;
314
+ interface UpdateURLsQueryVariables {
315
+ apiKey: string;
316
+ appUrl: string;
317
+ redir: string[];
529
318
  }
530
-
531
- declare function create(templateContent: string): (data: object) => Promise<string>;
532
- /**
533
- * Given a directory, it traverses the files and directories recursively
534
- * and replaces variables in directory and file names, and files' content
535
- * using the Liquid template engine.
536
- * Files indicate that they are liquid template by using the .liquid extension.
537
- * @param from {string} Directory that contains the template.
538
- * @param to {string} Output directory.
539
- * @param data {string} Data to feed the template engine.
540
- */
541
- declare function recursiveDirectoryCopy(from: string, to: string, data: object): Promise<void>;
542
-
543
- declare const template_create: typeof create;
544
- declare const template_recursiveDirectoryCopy: typeof recursiveDirectoryCopy;
545
- declare namespace template {
546
- export {
547
- template_create as create,
548
- template_recursiveDirectoryCopy as recursiveDirectoryCopy,
549
- };
319
+ interface UpdateURLsQuerySchema {
320
+ appUpdate: {
321
+ userErrors: {
322
+ field: string[];
323
+ message: string;
324
+ }[];
325
+ };
550
326
  }
551
327
 
552
- /** Returns a random string */
553
- declare function randomHex(size: number): string;
554
- declare function generateRandomChallengePair(): {
555
- codeVerifier: string;
556
- codeChallenge: string;
557
- };
558
- /**
559
- * Given a string, it returns it with the first letter capitalized.
560
- * @param string {string} String whose first letter will be caplitalized.
561
- * @returns The given string with its first letter capitalized.
562
- */
563
- declare function capitalize(string: string): string;
564
- /**
565
- * Given a store, returns a valid store fqdn removing protocol and adding .myshopify.com domain
566
- * @param store Original store name provided by the user
567
- * @returns a valid store fqdn
568
- */
569
- declare function normalizeStoreName(store: string): string;
570
-
571
- declare const string_randomHex: typeof randomHex;
572
- declare const string_generateRandomChallengePair: typeof generateRandomChallengePair;
573
- declare const string_capitalize: typeof capitalize;
574
- declare const string_normalizeStoreName: typeof normalizeStoreName;
575
- declare namespace string {
576
- export {
577
- string_randomHex as randomHex,
578
- string_generateRandomChallengePair as generateRandomChallengePair,
579
- string_capitalize as capitalize,
580
- string_normalizeStoreName as normalizeStoreName,
581
- camelCase as camelize,
582
- paramCase as hyphenize,
583
- snakeCase as underscore,
584
- constantCase as constantize,
585
- };
328
+ declare const FindAppQuery: string;
329
+ interface FindAppQuerySchema {
330
+ app: {
331
+ id: string;
332
+ title: string;
333
+ apiKey: string;
334
+ apiSecretKeys: {
335
+ secret: string;
336
+ }[];
337
+ appType: string;
338
+ };
586
339
  }
587
340
 
588
- /**
589
- * Given an absolute filesystem path, it makes it relative to
590
- * the current working directory. This is useful when logging paths
591
- * to allow the users to click on the file and let the OS open it
592
- * in the editor of choice.
593
- * @param path {string} Path to relativize
594
- * @returns {string} Relativized path.
595
- */
596
- declare function relativize(path: string): string;
597
-
598
- var path = /*#__PURE__*/_mergeNamespaces({
599
- __proto__: null,
600
- relativize: relativize,
601
- findUp: findUp,
602
- glob: fastGlob,
603
- pathToFileURL: pathToFileURL
604
- }, [pathe]);
605
-
606
- declare function stripUp(path: string, strip: number): string;
607
- /**
608
- * Creates a temporary directory and ties its lifecycle ot the lifecycle of the callback.
609
- * @param callback - The callback that receives the temporary directory.
610
- */
611
- declare function inTemporaryDirectory<T>(callback: (tmpDir: string) => T | Promise<T>): Promise<T>;
612
- /**
613
- * It reads a file and returns its content as a string using the
614
- * utf-8 encoding
615
- * @param path {string} Path to the file to read.
616
- * @returns {Promise<string>} A promise that resolves with the content of the file.
617
- */
618
- declare function read$1(path: string, options?: object): Promise<string>;
619
- /**
620
- * Copies a file
621
- * @param from {string} Path to the directory or file to be copied.
622
- * @param to {string} Destination path.
623
- */
624
- declare function copy(from: string, to: string): Promise<void>;
625
- declare function touch(path: string): Promise<void>;
626
- declare function write$1(path: string, data: string): Promise<void>;
627
- declare function append(path: string, data: string): Promise<void>;
628
- declare function mkdir(path: string): Promise<void>;
629
- declare function remove(path: string): Promise<void>;
630
- declare function rmdir(path: string, { force }?: {
631
- force?: boolean;
632
- }): Promise<void>;
633
- declare function mkTmpDir(): Promise<string>;
634
- declare function isDirectory(path: string): Promise<boolean>;
635
- declare function size(path: string): Promise<number>;
636
- /**
637
- * Moves a file.
638
- * @param src {string} File to be moved.
639
- * @param dest {string} Path to be moved to.
640
- * @param options {object} Moving options.
641
- */
642
- declare function move(src: string, dest: string, options?: {
643
- overwrite?: boolean;
644
- }): Promise<void>;
645
- /**
646
- * Changes the permissions of a directory or file.
647
- * @param path {string} Path to the file or directory whose permissions will be modified.
648
- * @param mode {string | numbers} Permissions to set to the file or directory.
649
- */
650
- declare function chmod(path: string, mode: number | string): Promise<void>;
651
- /**
652
- * Checks if a file has executable permissions.
653
- * @param path {string} Path to the file whose permissions will be checked.
654
- */
655
- declare function hasExecutablePermissions(path: string): Promise<boolean>;
656
- /**
657
- * Returns true if a file or directory exists
658
- * @param path {string} Path to the directory or file.
659
- * @returns {boolean} True if it exists.
660
- */
661
- declare function exists(path: string): Promise<boolean>;
662
- /**
663
- * Format a string using prettier. Return the formatted content.
664
- */
665
- declare function format(content: string, options: {
666
- path: string;
667
- }): Promise<string>;
668
-
669
- declare const file_stripUp: typeof stripUp;
670
- declare const file_inTemporaryDirectory: typeof inTemporaryDirectory;
671
- declare const file_copy: typeof copy;
672
- declare const file_touch: typeof touch;
673
- declare const file_append: typeof append;
674
- declare const file_mkdir: typeof mkdir;
675
- declare const file_remove: typeof remove;
676
- declare const file_rmdir: typeof rmdir;
677
- declare const file_mkTmpDir: typeof mkTmpDir;
678
- declare const file_isDirectory: typeof isDirectory;
679
- declare const file_size: typeof size;
680
- declare const file_move: typeof move;
681
- declare const file_chmod: typeof chmod;
682
- declare const file_hasExecutablePermissions: typeof hasExecutablePermissions;
683
- declare const file_exists: typeof exists;
684
- declare const file_format: typeof format;
685
- declare namespace file {
686
- export {
687
- file_stripUp as stripUp,
688
- file_inTemporaryDirectory as inTemporaryDirectory,
689
- read$1 as read,
690
- file_copy as copy,
691
- file_touch as touch,
692
- write$1 as write,
693
- file_append as append,
694
- file_mkdir as mkdir,
695
- file_remove as remove,
696
- file_rmdir as rmdir,
697
- file_mkTmpDir as mkTmpDir,
698
- file_isDirectory as isDirectory,
699
- file_size as size,
700
- file_move as move,
701
- file_chmod as chmod,
702
- file_hasExecutablePermissions as hasExecutablePermissions,
703
- file_exists as exists,
704
- file_format as format,
705
- };
341
+ declare const ExtensionUpdateDraftMutation: string;
342
+ interface ExtensionUpdateDraftInput {
343
+ apiKey: string;
344
+ config: string;
345
+ context: string | undefined;
346
+ registrationId: string;
347
+ }
348
+ interface ExtensionUpdateDraftPayload {
349
+ clientMutationId: string;
350
+ extensionVersion: ExtensionVersion;
351
+ userErrors: {
352
+ field: string[];
353
+ message: string;
354
+ }[];
355
+ }
356
+ interface ExtensionVersion {
357
+ config: string;
358
+ context: string;
359
+ id: string;
360
+ lastUserInteractionAt: string;
361
+ location: string;
362
+ registrationId: string;
363
+ registrationUuid: string;
364
+ uuid: string;
365
+ validationErrors: {
366
+ field: string[];
367
+ message: string;
368
+ }[];
369
+ versionTag: string;
370
+ }
371
+ interface ExtensionUpdateSchema {
372
+ extensionUpdateDraft: ExtensionUpdateDraftPayload;
706
373
  }
707
374
 
708
- declare const factory: simple_git.SimpleGitFactory;
709
- declare const GitNotPresentError: () => Abort;
710
- declare function initializeRepository(directory: string): Promise<void>;
711
- declare function downloadRepository({ repoUrl, destination }: {
712
- repoUrl: string;
713
- destination: string;
714
- }): Promise<void>;
715
- /**
716
- * If "git" is not present in the environment it throws
717
- * an abort error.
718
- */
719
- declare function ensurePresentOrAbort(): Promise<void>;
375
+ declare const GenerateSignedUploadUrl: string;
376
+ interface GenerateSignedUploadUrlVariables {
377
+ apiKey: string;
378
+ deploymentUuid: string;
379
+ bundleFormat: number;
380
+ }
381
+ interface GenerateSignedUploadUrlSchema {
382
+ deploymentGenerateSignedUploadUrl: {
383
+ signedUploadUrl: string;
384
+ userErrors: {
385
+ field: string[];
386
+ message: string;
387
+ }[];
388
+ };
389
+ }
720
390
 
721
- declare const git_factory: typeof factory;
722
- declare const git_GitNotPresentError: typeof GitNotPresentError;
723
- declare const git_initializeRepository: typeof initializeRepository;
724
- declare const git_downloadRepository: typeof downloadRepository;
725
- declare const git_ensurePresentOrAbort: typeof ensurePresentOrAbort;
726
- declare namespace git {
727
- export {
728
- git_factory as factory,
729
- git_GitNotPresentError as GitNotPresentError,
730
- git_initializeRepository as initializeRepository,
731
- git_downloadRepository as downloadRepository,
732
- git_ensurePresentOrAbort as ensurePresentOrAbort,
733
- };
391
+ declare const CreateDeployment: string;
392
+ interface ExtensionSettings {
393
+ uuid: string;
394
+ config: string;
395
+ context: string;
396
+ }
397
+ interface CreateDeploymentVariables {
398
+ apiKey: string;
399
+ uuid: string;
400
+ bundleUrl: string;
401
+ extensions: ExtensionSettings[];
402
+ }
403
+ interface CreateDeploymentSchema {
404
+ deploymentCreate: {
405
+ deployment: {
406
+ uuid: string;
407
+ };
408
+ userErrors: {
409
+ field: string[];
410
+ message: string;
411
+ }[];
412
+ };
734
413
  }
735
414
 
736
- interface GithubRelease {
737
- id: number;
738
- url: string;
739
- tag_name: string;
740
- name: string;
741
- body: string;
742
- draft: boolean;
743
- prerelease: boolean;
744
- created_at: string;
745
- published_at: string;
746
- tarball_url: string;
415
+ declare const AllStoresByOrganizationQuery: string;
416
+ interface AllStoresByOrganizationSchema {
417
+ organizations: {
418
+ nodes: {
419
+ id: string;
420
+ stores: {
421
+ nodes: {
422
+ shopId: string;
423
+ link: string;
424
+ shopDomain: string;
425
+ shopName: string;
426
+ transferDisabled: boolean;
427
+ convertableToPartnerTest: boolean;
428
+ }[];
429
+ };
430
+ }[];
431
+ };
747
432
  }
748
- interface Options {
749
- filter: (release: GithubRelease) => boolean;
433
+
434
+ declare const ConvertDevToTestStoreQuery: string;
435
+ interface ConvertDevToTestStoreVariables {
436
+ input: {
437
+ organizationID: number;
438
+ shopId: string;
439
+ };
750
440
  }
751
- declare function getLatestRelease(user: string, repo: string, { filter }?: Options): Promise<GithubRelease>;
752
- declare function parseRepoUrl(src: string): {
753
- site: string;
754
- user: string;
755
- name: string;
756
- ref: string;
757
- subDirectory: string;
758
- ssh: string;
759
- http: string;
760
- };
761
- interface GithubRepoReference {
762
- repoBaseUrl: string;
763
- branch?: string;
764
- filePath?: string;
441
+ interface ConvertDevToTestStoreSchema {
442
+ convertDevToTestStore: {
443
+ convertedToTestStore: boolean;
444
+ userErrors: {
445
+ field: string[];
446
+ message: string;
447
+ }[];
448
+ };
765
449
  }
766
- declare function parseGithubRepoReference(src: string): GithubRepoReference;
767
450
 
768
- type github_GithubRelease = GithubRelease;
769
- declare const github_getLatestRelease: typeof getLatestRelease;
770
- declare const github_parseRepoUrl: typeof parseRepoUrl;
771
- type github_GithubRepoReference = GithubRepoReference;
772
- declare const github_parseGithubRepoReference: typeof parseGithubRepoReference;
773
- declare namespace github {
774
- export {
775
- github_GithubRelease as GithubRelease,
776
- github_getLatestRelease as getLatestRelease,
777
- github_parseRepoUrl as parseRepoUrl,
778
- github_GithubRepoReference as GithubRepoReference,
779
- github_parseGithubRepoReference as parseGithubRepoReference,
780
- };
451
+ declare const ExtensionCreateQuery: string;
452
+ interface ExtensionCreateVariables {
453
+ apiKey: string;
454
+ type: string;
455
+ title: string;
456
+ config: string;
457
+ context?: string | null;
458
+ }
459
+ interface ExtensionCreateSchema {
460
+ extensionCreate: {
461
+ extensionRegistration: {
462
+ id: string;
463
+ uuid: string;
464
+ type: string;
465
+ title: string;
466
+ draftVersion: {
467
+ registrationId: string;
468
+ lastUserInteractionAt: string;
469
+ validationErrors: {
470
+ field: string[];
471
+ message: string;
472
+ }[];
473
+ };
474
+ };
475
+ userErrors: {
476
+ field: string[];
477
+ message: string;
478
+ }[];
479
+ };
781
480
  }
782
481
 
783
- declare function generate(suffix: string): string;
482
+ declare const ExtensionSpecificationsQuery: string;
483
+ interface ExtensionSpecificationsQueryVariables {
484
+ api_key: string;
485
+ }
486
+ interface ExtensionSpecificationsQuerySchema {
487
+ extensionSpecifications: {
488
+ name: string;
489
+ identifier: string;
490
+ options: {
491
+ managementExperience: 'cli' | 'custom' | 'dashboard';
492
+ }[];
493
+ features?: {
494
+ argo?: {
495
+ surface: string;
496
+ };
497
+ };
498
+ }[];
499
+ }
784
500
 
785
- declare const haiku_generate: typeof generate;
786
- declare namespace haiku {
787
- export {
788
- haiku_generate as generate,
789
- };
501
+ declare const AllAppExtensionRegistrationsQuery: string;
502
+ interface AllAppExtensionRegistrationsQueryVariables {
503
+ apiKey: string;
504
+ }
505
+ interface AllAppExtensionRegistrationsQuerySchema {
506
+ app: {
507
+ extensionRegistrations: {
508
+ id: string;
509
+ uuid: string;
510
+ title: string;
511
+ type: string;
512
+ }[];
513
+ };
790
514
  }
791
515
 
792
- /**
793
- * Returns the latest available version of an NPM package.
794
- * @param name {string} The name of the NPM package.
795
- * @returns A promise to get the latest available version of a package.
796
- */
797
- declare function latestNpmPackageVersion(name: string): Promise<string>;
516
+ declare const FindProductVariantQuery: string;
517
+ interface FindProductVariantSchema {
518
+ products: {
519
+ edges: {
520
+ node: {
521
+ id: string;
522
+ variants: {
523
+ edges: {
524
+ node: {
525
+ id: string;
526
+ };
527
+ }[];
528
+ };
529
+ };
530
+ }[];
531
+ };
532
+ }
798
533
 
799
- declare const version$1_latestNpmPackageVersion: typeof latestNpmPackageVersion;
800
- declare namespace version$1 {
801
- export {
802
- version$1_latestNpmPackageVersion as latestNpmPackageVersion,
803
- };
534
+ declare const ScriptServiceProxyQuery: string;
535
+ interface ScriptServiceProxyQuerySchema {
536
+ scriptServiceProxy: unknown;
804
537
  }
805
538
 
806
- declare const username: (platform?: typeof platform) => Promise<string | null>;
807
- /**
808
- * Returns the platform and architecture.
809
- * @returns {{platform: string, arch: string}} Returns the current platform and architecture.
810
- */
811
- declare const platformAndArch: (platform?: typeof platform) => {
812
- platform: string;
813
- arch: string;
814
- };
539
+ declare const GetAppFunctionsQuery: string;
815
540
 
816
- declare const os_username: typeof username;
817
- declare const os_platformAndArch: typeof platformAndArch;
818
- declare namespace os {
819
- export {
820
- os_username as username,
821
- os_platformAndArch as platformAndArch,
822
- };
541
+ declare const ModuleUploadUrlGenerateMutation: string;
542
+ interface ModuleUploadUrlGenerateMutationSchema {
543
+ data: {
544
+ moduleUploadUrlGenerate: {
545
+ details: {
546
+ url: string;
547
+ headers: {
548
+ [key: string]: string;
549
+ };
550
+ humanizedMaxSize: string;
551
+ };
552
+ userErrors: {
553
+ field: string;
554
+ message: string;
555
+ }[];
556
+ };
557
+ };
823
558
  }
824
559
 
825
- /**
826
- * It returns true if the terminal is interactive.
827
- * @returns {boolean} True if the terminal is interactive.
828
- */
829
- declare function isTerminalInteractive(): boolean;
830
- /**
831
- * Returns the path to the user's home directory.
832
- * @returns {string} The path to the user's home directory.
833
- */
834
- declare function homeDirectory(): string;
835
- /**
836
- * Returns true if the CLI is running in debug mode.
837
- * @param env The environment variables from the environment of the current process.
838
- * @returns true if SHOPIFY_CONFIG is debug
839
- */
840
- declare function isDebug(env?: NodeJS.ProcessEnv): boolean;
841
- /**
842
- * Returns true if the CLI is running in verbose mode.
843
- * @param env The environment variables from the environment of the current process.
844
- * @returns true if SHOPIFY_FLAG_VERBOSE is truthy or the flag --verbose has been passed
845
- */
846
- declare function isVerbose(env?: NodeJS.ProcessEnv): boolean;
847
- /**
848
- * Returns true if the environment in which the CLI is running is either
849
- * a local environment (where dev is present) or a cloud environment (spin).
850
- * @returns {boolean} True if the CLI is used in a Shopify environment.
851
- */
852
- declare function isShopify(env?: NodeJS.ProcessEnv): Promise<boolean>;
853
- /**
854
- * This variable is used when running unit tests to indicate that the CLI's business logic
855
- * is run as a subject of a unit test. We can use this variable to disable output through
856
- * the standard streams.
857
- * @param env The environment variables from the environment of the current process.
858
- * @returns True if the SHOPIFY_UNIT_TEST environment variable is truthy.
859
- */
860
- declare function isUnitTest(env?: NodeJS.ProcessEnv): boolean;
861
- /**
862
- * Returns true if reporting analytics is enabled.
863
- * @param env The environment variables from the environment of the current process.
864
- * @returns true unless SHOPIFY_CLI_NO_ANALYTICS is truthy.
865
- */
866
- declare function analyticsDisabled(env?: NodeJS.ProcessEnv): boolean;
867
- /**
868
- * Returns whether the environment has Git available.
869
- * @returns {Promise<boolean>} A promise that resolves with the value.
870
- */
871
- declare function hasGit(): Promise<boolean>;
560
+ declare const AppFunctionSetMutation: string;
561
+ interface AppFunctionSetMutationSchema {
562
+ data: {
563
+ appScriptSet: {
564
+ userErrors: {
565
+ field: string;
566
+ message: string;
567
+ tag: string;
568
+ }[];
569
+ appScript?: {
570
+ uuid: string;
571
+ appKey: string;
572
+ configSchema: unknown;
573
+ extensionPointName: string;
574
+ title: string;
575
+ };
576
+ };
577
+ };
578
+ }
579
+ interface AppFunctionSetVariables {
580
+ uuid?: string;
581
+ extensionPointName: string;
582
+ title: string;
583
+ description?: string;
584
+ force?: boolean;
585
+ schemaMajorVersion?: string;
586
+ schemaMinorVersion?: string;
587
+ scriptConfigVersion?: string;
588
+ configurationUi: boolean;
589
+ configurationDefinition?: string;
590
+ moduleUploadUrl: string;
591
+ library?: {
592
+ language: string;
593
+ version: string;
594
+ };
595
+ appBridge?: {
596
+ createPath?: string;
597
+ detailsPath?: string;
598
+ };
599
+ inputQuery?: string;
600
+ }
872
601
 
873
- declare const local_isTerminalInteractive: typeof isTerminalInteractive;
874
- declare const local_homeDirectory: typeof homeDirectory;
875
- declare const local_isDebug: typeof isDebug;
876
- declare const local_isVerbose: typeof isVerbose;
877
- declare const local_isShopify: typeof isShopify;
878
- declare const local_isUnitTest: typeof isUnitTest;
879
- declare const local_analyticsDisabled: typeof analyticsDisabled;
880
- declare const local_hasGit: typeof hasGit;
881
- declare namespace local {
602
+ declare const index_FindOrganizationQuery: typeof FindOrganizationQuery;
603
+ type index_FindOrganizationQuerySchema = FindOrganizationQuerySchema;
604
+ type index_AllOrganizationsQuerySchemaOrganization = AllOrganizationsQuerySchemaOrganization;
605
+ type index_AllOrganizationsQuerySchema = AllOrganizationsQuerySchema;
606
+ declare const index_AllOrganizationsQuery: typeof AllOrganizationsQuery;
607
+ declare const index_CreateAppQuery: typeof CreateAppQuery;
608
+ type index_CreateAppQueryVariables = CreateAppQueryVariables;
609
+ type index_CreateAppQuerySchema = CreateAppQuerySchema;
610
+ declare const index_UpdateURLsQuery: typeof UpdateURLsQuery;
611
+ type index_UpdateURLsQueryVariables = UpdateURLsQueryVariables;
612
+ type index_UpdateURLsQuerySchema = UpdateURLsQuerySchema;
613
+ declare const index_FindAppQuery: typeof FindAppQuery;
614
+ type index_FindAppQuerySchema = FindAppQuerySchema;
615
+ declare const index_ExtensionUpdateDraftMutation: typeof ExtensionUpdateDraftMutation;
616
+ type index_ExtensionUpdateDraftInput = ExtensionUpdateDraftInput;
617
+ type index_ExtensionUpdateDraftPayload = ExtensionUpdateDraftPayload;
618
+ type index_ExtensionVersion = ExtensionVersion;
619
+ type index_ExtensionUpdateSchema = ExtensionUpdateSchema;
620
+ declare const index_GenerateSignedUploadUrl: typeof GenerateSignedUploadUrl;
621
+ type index_GenerateSignedUploadUrlVariables = GenerateSignedUploadUrlVariables;
622
+ type index_GenerateSignedUploadUrlSchema = GenerateSignedUploadUrlSchema;
623
+ declare const index_CreateDeployment: typeof CreateDeployment;
624
+ type index_ExtensionSettings = ExtensionSettings;
625
+ type index_CreateDeploymentVariables = CreateDeploymentVariables;
626
+ type index_CreateDeploymentSchema = CreateDeploymentSchema;
627
+ declare const index_AllStoresByOrganizationQuery: typeof AllStoresByOrganizationQuery;
628
+ type index_AllStoresByOrganizationSchema = AllStoresByOrganizationSchema;
629
+ declare const index_ConvertDevToTestStoreQuery: typeof ConvertDevToTestStoreQuery;
630
+ type index_ConvertDevToTestStoreVariables = ConvertDevToTestStoreVariables;
631
+ type index_ConvertDevToTestStoreSchema = ConvertDevToTestStoreSchema;
632
+ declare const index_ExtensionCreateQuery: typeof ExtensionCreateQuery;
633
+ type index_ExtensionCreateVariables = ExtensionCreateVariables;
634
+ type index_ExtensionCreateSchema = ExtensionCreateSchema;
635
+ declare const index_ExtensionSpecificationsQuery: typeof ExtensionSpecificationsQuery;
636
+ type index_ExtensionSpecificationsQueryVariables = ExtensionSpecificationsQueryVariables;
637
+ type index_ExtensionSpecificationsQuerySchema = ExtensionSpecificationsQuerySchema;
638
+ declare const index_AllAppExtensionRegistrationsQuery: typeof AllAppExtensionRegistrationsQuery;
639
+ type index_AllAppExtensionRegistrationsQueryVariables = AllAppExtensionRegistrationsQueryVariables;
640
+ type index_AllAppExtensionRegistrationsQuerySchema = AllAppExtensionRegistrationsQuerySchema;
641
+ declare const index_FindProductVariantQuery: typeof FindProductVariantQuery;
642
+ type index_FindProductVariantSchema = FindProductVariantSchema;
643
+ declare const index_ScriptServiceProxyQuery: typeof ScriptServiceProxyQuery;
644
+ type index_ScriptServiceProxyQuerySchema = ScriptServiceProxyQuerySchema;
645
+ declare const index_GetAppFunctionsQuery: typeof GetAppFunctionsQuery;
646
+ declare const index_ModuleUploadUrlGenerateMutation: typeof ModuleUploadUrlGenerateMutation;
647
+ type index_ModuleUploadUrlGenerateMutationSchema = ModuleUploadUrlGenerateMutationSchema;
648
+ declare const index_AppFunctionSetMutation: typeof AppFunctionSetMutation;
649
+ type index_AppFunctionSetMutationSchema = AppFunctionSetMutationSchema;
650
+ type index_AppFunctionSetVariables = AppFunctionSetVariables;
651
+ declare namespace index {
882
652
  export {
883
- local_isTerminalInteractive as isTerminalInteractive,
884
- local_homeDirectory as homeDirectory,
885
- local_isDebug as isDebug,
886
- local_isVerbose as isVerbose,
887
- local_isShopify as isShopify,
888
- local_isUnitTest as isUnitTest,
889
- local_analyticsDisabled as analyticsDisabled,
890
- local_hasGit as hasGit,
653
+ index_FindOrganizationQuery as FindOrganizationQuery,
654
+ index_FindOrganizationQuerySchema as FindOrganizationQuerySchema,
655
+ index_AllOrganizationsQuerySchemaOrganization as AllOrganizationsQuerySchemaOrganization,
656
+ index_AllOrganizationsQuerySchema as AllOrganizationsQuerySchema,
657
+ index_AllOrganizationsQuery as AllOrganizationsQuery,
658
+ index_CreateAppQuery as CreateAppQuery,
659
+ index_CreateAppQueryVariables as CreateAppQueryVariables,
660
+ index_CreateAppQuerySchema as CreateAppQuerySchema,
661
+ index_UpdateURLsQuery as UpdateURLsQuery,
662
+ index_UpdateURLsQueryVariables as UpdateURLsQueryVariables,
663
+ index_UpdateURLsQuerySchema as UpdateURLsQuerySchema,
664
+ index_FindAppQuery as FindAppQuery,
665
+ index_FindAppQuerySchema as FindAppQuerySchema,
666
+ index_ExtensionUpdateDraftMutation as ExtensionUpdateDraftMutation,
667
+ index_ExtensionUpdateDraftInput as ExtensionUpdateDraftInput,
668
+ index_ExtensionUpdateDraftPayload as ExtensionUpdateDraftPayload,
669
+ index_ExtensionVersion as ExtensionVersion,
670
+ index_ExtensionUpdateSchema as ExtensionUpdateSchema,
671
+ index_GenerateSignedUploadUrl as GenerateSignedUploadUrl,
672
+ index_GenerateSignedUploadUrlVariables as GenerateSignedUploadUrlVariables,
673
+ index_GenerateSignedUploadUrlSchema as GenerateSignedUploadUrlSchema,
674
+ index_CreateDeployment as CreateDeployment,
675
+ index_ExtensionSettings as ExtensionSettings,
676
+ index_CreateDeploymentVariables as CreateDeploymentVariables,
677
+ index_CreateDeploymentSchema as CreateDeploymentSchema,
678
+ index_AllStoresByOrganizationQuery as AllStoresByOrganizationQuery,
679
+ index_AllStoresByOrganizationSchema as AllStoresByOrganizationSchema,
680
+ index_ConvertDevToTestStoreQuery as ConvertDevToTestStoreQuery,
681
+ index_ConvertDevToTestStoreVariables as ConvertDevToTestStoreVariables,
682
+ index_ConvertDevToTestStoreSchema as ConvertDevToTestStoreSchema,
683
+ index_ExtensionCreateQuery as ExtensionCreateQuery,
684
+ index_ExtensionCreateVariables as ExtensionCreateVariables,
685
+ index_ExtensionCreateSchema as ExtensionCreateSchema,
686
+ index_ExtensionSpecificationsQuery as ExtensionSpecificationsQuery,
687
+ index_ExtensionSpecificationsQueryVariables as ExtensionSpecificationsQueryVariables,
688
+ index_ExtensionSpecificationsQuerySchema as ExtensionSpecificationsQuerySchema,
689
+ index_AllAppExtensionRegistrationsQuery as AllAppExtensionRegistrationsQuery,
690
+ index_AllAppExtensionRegistrationsQueryVariables as AllAppExtensionRegistrationsQueryVariables,
691
+ index_AllAppExtensionRegistrationsQuerySchema as AllAppExtensionRegistrationsQuerySchema,
692
+ index_FindProductVariantQuery as FindProductVariantQuery,
693
+ index_FindProductVariantSchema as FindProductVariantSchema,
694
+ index_ScriptServiceProxyQuery as ScriptServiceProxyQuery,
695
+ index_ScriptServiceProxyQuerySchema as ScriptServiceProxyQuerySchema,
696
+ index_GetAppFunctionsQuery as GetAppFunctionsQuery,
697
+ index_ModuleUploadUrlGenerateMutation as ModuleUploadUrlGenerateMutation,
698
+ index_ModuleUploadUrlGenerateMutationSchema as ModuleUploadUrlGenerateMutationSchema,
699
+ index_AppFunctionSetMutation as AppFunctionSetMutation,
700
+ index_AppFunctionSetMutationSchema as AppFunctionSetMutationSchema,
701
+ index_AppFunctionSetVariables as AppFunctionSetVariables,
891
702
  };
892
703
  }
893
704
 
894
- /**
895
- * Enum that represents the environment to use for a given service.
896
- * @readonly
897
- * @enum {number}
898
- */
899
- declare enum Environment {
900
- Local = "local",
901
- Production = "production",
902
- Spin = "spin"
903
- }
904
-
905
- /**
906
- * Returns the environment to be used for the interactions with the partners' CLI API.
907
- * @param env The environment variables from the environment of the current process.
908
- */
909
- declare function partners$2(env?: NodeJS.ProcessEnv): Environment;
910
- /**
911
- * Returns the environment to be used for the interactions with the admin API.
912
- * @param env The environment variables from the environment of the current process.
913
- */
914
- declare function shopify$1(env?: NodeJS.ProcessEnv): Environment;
915
- /**
916
- * Returns the environment to be used for the interactions with identity.
917
- * @param env The environment variables from the environment of the current process.
918
- */
919
- declare function identity$1(env?: NodeJS.ProcessEnv): Environment;
920
-
921
- declare namespace service {
705
+ declare const api_admin: typeof admin;
706
+ declare namespace api {
922
707
  export {
708
+ api_admin as admin,
923
709
  partners$2 as partners,
924
- shopify$1 as shopify,
925
- identity$1 as identity,
710
+ index as graphql,
926
711
  };
927
712
  }
928
713
 
929
- declare const CouldntObtainPartnersSpinFQDNError: Abort;
930
- declare const CouldntObtainIdentitySpinFQDNError: Abort;
931
- declare const CouldntObtainShopifySpinFQDNError: Abort;
932
- declare const NotProvidedStoreFQDNError: Abort;
933
- /**
934
- * It returns the Partners' API service we should interact with.
935
- * @returns {string} Fully-qualified domain of the partners service we should interact with.
936
- */
937
- declare function partners$1(): Promise<string>;
938
- /**
939
- * It returns the Identity service we should interact with.
940
- * @returns {string} Fully-qualified domain of the Identity service we should interact with.
941
- */
942
- declare function identity(): Promise<string>;
943
- /**
944
- * It returns the Shopify service we should interact with.
945
- * Note the same fqdn is sued for the Admin and the Storefront Renderer APIs.
946
- * @returns {string} Fully-qualified domain of the Shopify service we should interact with.
947
- */
948
- declare function shopify(options?: {
949
- storeFqdn?: string;
950
- }): Promise<string>;
714
+ declare function zip(inputDirectory: string, outputZipPath: string): Promise<void>;
951
715
 
952
- declare const fqdn_CouldntObtainPartnersSpinFQDNError: typeof CouldntObtainPartnersSpinFQDNError;
953
- declare const fqdn_CouldntObtainIdentitySpinFQDNError: typeof CouldntObtainIdentitySpinFQDNError;
954
- declare const fqdn_CouldntObtainShopifySpinFQDNError: typeof CouldntObtainShopifySpinFQDNError;
955
- declare const fqdn_NotProvidedStoreFQDNError: typeof NotProvidedStoreFQDNError;
956
- declare const fqdn_identity: typeof identity;
957
- declare const fqdn_shopify: typeof shopify;
958
- declare namespace fqdn {
716
+ declare const archiver_zip: typeof zip;
717
+ declare namespace archiver {
959
718
  export {
960
- fqdn_CouldntObtainPartnersSpinFQDNError as CouldntObtainPartnersSpinFQDNError,
961
- fqdn_CouldntObtainIdentitySpinFQDNError as CouldntObtainIdentitySpinFQDNError,
962
- fqdn_CouldntObtainShopifySpinFQDNError as CouldntObtainShopifySpinFQDNError,
963
- fqdn_NotProvidedStoreFQDNError as NotProvidedStoreFQDNError,
964
- partners$1 as partners,
965
- fqdn_identity as identity,
966
- fqdn_shopify as shopify,
719
+ archiver_zip as zip,
967
720
  };
968
721
  }
969
722
 
723
+ declare const genericConfigurationFileNames: {
724
+ readonly yarn: {
725
+ readonly lockfile: "yarn.lock";
726
+ };
727
+ readonly pnpm: {
728
+ readonly lockfile: "pnpm-lock.yaml";
729
+ };
730
+ };
731
+ declare const dependencyManager: readonly ["yarn", "npm", "pnpm"];
732
+ declare type DependencyManager = typeof dependencyManager[number];
733
+ declare const PackageJsonNotFoundError: (directory: string) => Abort;
970
734
  /**
971
- * Returns whether an environment variable value represents a truthy value.
972
- * @param variable {string | undefined} Given a environment variable value, it returns true if it represents a truthy value.
973
- * @returns {boolean}
735
+ * Returns the dependency manager used to run the create workflow.
736
+ * @param env {Object} The environment variables of the process in which the CLI runs.
737
+ * @returns The dependency manager
974
738
  */
975
- declare function isTruthy(variable: string | undefined): boolean;
976
-
977
- declare const utilities_isTruthy: typeof isTruthy;
978
- declare namespace utilities {
979
- export {
980
- utilities_isTruthy as isTruthy,
981
- };
982
- }
983
-
984
- declare const environment_local: typeof local;
985
- declare const environment_service: typeof service;
986
- declare const environment_fqdn: typeof fqdn;
987
- declare const environment_utilities: typeof utilities;
988
- declare namespace environment {
989
- export {
990
- environment_local as local,
991
- environment_service as service,
992
- environment_fqdn as fqdn,
993
- environment_utilities as utilities,
994
- };
739
+ declare function dependencyManagerUsedForCreating(env?: NodeJS.ProcessEnv): DependencyManager;
740
+ /**
741
+ * Returns the dependency manager used by an existing project.
742
+ * @param directory {string} The root directory of the project.
743
+ * @returns The dependency manager
744
+ */
745
+ declare function getDependencyManager(directory: string): Promise<DependencyManager>;
746
+ interface InstallNPMDependenciesRecursivelyOptions {
747
+ /**
748
+ * The dependency manager to use to install the dependencies.
749
+ */
750
+ dependencyManager: DependencyManager;
751
+ /**
752
+ * The directory from where we'll find package.json's recursively
753
+ */
754
+ directory: string;
755
+ /**
756
+ * Specifies the maximum depth of the glob search.
757
+ */
758
+ deep?: number;
995
759
  }
996
-
997
760
  /**
998
- * A scope supported by the Shopify Admin API.
761
+ * This function traverses down a directory tree to find directories containing a package.json
762
+ * and installs the dependencies if needed. To know if it's needed, it uses the "check" command
763
+ * provided by dependency managers.
764
+ * @param options {InstallNPMDependenciesRecursivelyOptions} Options to install dependencies recursively.
999
765
  */
1000
- declare type AdminAPIScope = 'graphql' | 'themes' | 'collaborator' | string;
766
+ declare function installNPMDependenciesRecursively(options: InstallNPMDependenciesRecursivelyOptions): Promise<void>;
1001
767
  /**
1002
- * It represents the options to authenticate against the Shopify Admin API.
768
+ * Installs the dependencies in the given directory.
769
+ * @param directory {string} The directory that contains the package.json
770
+ * @param dependencyManager {DependencyManager} The dependency manager to use to install the dependencies.
771
+ * @param stdout {Writable} Standard output stream.
772
+ * @param stderr {Writable} Standard error stream.
773
+ * @param signal {AbortSignal} Abort signal.
774
+ * @returns stderr {Writable} Standard error stream.
1003
775
  */
1004
- interface AdminAPIOAuthOptions {
1005
- /** Store to request permissions for */
1006
- storeFqdn: string;
1007
- /** List of scopes to request permissions for */
1008
- scopes: AdminAPIScope[];
1009
- }
776
+ declare function install(directory: string, dependencyManager: DependencyManager, stdout?: Writable, stderr?: Writable, signal?: AbortSignal): Promise<void>;
1010
777
  /**
1011
- * A scope supported by the Partners API.
778
+ * Returns the name of the package configured in its package.json
779
+ * @param packageJsonPath {string} Path to the package.json file
780
+ * @returns A promise that resolves with the name.
1012
781
  */
1013
- declare type PartnersAPIScope = 'cli' | string;
1014
- interface PartnersAPIOAuthOptions {
1015
- /** List of scopes to request permissions for */
1016
- scopes: PartnersAPIScope[];
1017
- }
782
+ declare function getPackageName(packageJsonPath: string): Promise<string>;
1018
783
  /**
1019
- * A scope supported by the Storefront Renderer API.
784
+ * Returns the list of production and dev dependencies of a package.json
785
+ * @param packageJsonPath {string} Path to the package.json file
786
+ * @returns A promise that resolves with the list of dependencies.
1020
787
  */
1021
- declare type StorefrontRendererScope = 'devtools' | string;
1022
- interface StorefrontRendererAPIOAuthOptions {
1023
- /** List of scopes to request permissions for */
1024
- scopes: StorefrontRendererScope[];
788
+ declare function getDependencies(packageJsonPath: string): Promise<{
789
+ [key: string]: string;
790
+ }>;
791
+ declare function checkForNewVersion(dependency: string, currentVersion: string): Promise<string | undefined>;
792
+ declare function getOutputUpdateCLIReminder(dependencyManager: DependencyManager, version: string): string;
793
+ interface PackageJSONContents {
794
+ name: string;
795
+ version?: string;
796
+ dependencies?: {
797
+ [key: string]: string;
798
+ };
799
+ devDependencies?: {
800
+ [key: string]: string;
801
+ };
802
+ }
803
+ declare function packageJSONContents(packageJsonPath: string): Promise<PackageJSONContents>;
804
+ declare type DependencyType = 'dev' | 'prod' | 'peer';
805
+ interface AddNPMDependenciesIfNeededOptions {
806
+ /** How dependencies should be added */
807
+ type: DependencyType;
808
+ /** The dependency manager to use to add dependencies */
809
+ dependencyManager: DependencyManager;
810
+ /** The directory that contains the package.json where dependencies will be added */
811
+ directory: string;
812
+ /** Standard output coming from the underlying installation process */
813
+ stdout?: Writable;
814
+ /** Standard error coming from the underlying installation process */
815
+ stderr?: Writable;
816
+ /** Abort signal to stop the process */
817
+ signal?: AbortSignal;
1025
818
  }
1026
819
  /**
1027
- * It represents the authentication requirements and
1028
- * is the input necessary to trigger the authentication
1029
- * flow.
820
+ * Adds dependencies to a Node project (i.e. a project that has a package.json)
821
+ * @param dependencies {string[]} List of dependencies to be added.
822
+ * @param options {AddNPMDependenciesIfNeededOptions} Options for adding dependencies.
1030
823
  */
1031
- interface OAuthApplications {
1032
- adminApi?: AdminAPIOAuthOptions;
1033
- storefrontRendererApi?: StorefrontRendererAPIOAuthOptions;
1034
- partnersApi?: PartnersAPIOAuthOptions;
824
+ declare function addNPMDependenciesIfNeeded(dependencies: string[], options: AddNPMDependenciesIfNeededOptions): Promise<void>;
825
+ declare function addLatestNPMDependencies(dependencies: string[], options: AddNPMDependenciesIfNeededOptions): Promise<void>;
826
+
827
+ declare const dependency_genericConfigurationFileNames: typeof genericConfigurationFileNames;
828
+ declare const dependency_dependencyManager: typeof dependencyManager;
829
+ type dependency_DependencyManager = DependencyManager;
830
+ declare const dependency_PackageJsonNotFoundError: typeof PackageJsonNotFoundError;
831
+ declare const dependency_dependencyManagerUsedForCreating: typeof dependencyManagerUsedForCreating;
832
+ declare const dependency_getDependencyManager: typeof getDependencyManager;
833
+ declare const dependency_installNPMDependenciesRecursively: typeof installNPMDependenciesRecursively;
834
+ declare const dependency_install: typeof install;
835
+ declare const dependency_getPackageName: typeof getPackageName;
836
+ declare const dependency_getDependencies: typeof getDependencies;
837
+ declare const dependency_checkForNewVersion: typeof checkForNewVersion;
838
+ declare const dependency_getOutputUpdateCLIReminder: typeof getOutputUpdateCLIReminder;
839
+ declare const dependency_packageJSONContents: typeof packageJSONContents;
840
+ type dependency_DependencyType = DependencyType;
841
+ declare const dependency_addNPMDependenciesIfNeeded: typeof addNPMDependenciesIfNeeded;
842
+ declare const dependency_addLatestNPMDependencies: typeof addLatestNPMDependencies;
843
+ declare namespace dependency {
844
+ export {
845
+ dependency_genericConfigurationFileNames as genericConfigurationFileNames,
846
+ dependency_dependencyManager as dependencyManager,
847
+ dependency_DependencyManager as DependencyManager,
848
+ dependency_PackageJsonNotFoundError as PackageJsonNotFoundError,
849
+ dependency_dependencyManagerUsedForCreating as dependencyManagerUsedForCreating,
850
+ dependency_getDependencyManager as getDependencyManager,
851
+ dependency_installNPMDependenciesRecursively as installNPMDependenciesRecursively,
852
+ dependency_install as install,
853
+ dependency_getPackageName as getPackageName,
854
+ dependency_getDependencies as getDependencies,
855
+ dependency_checkForNewVersion as checkForNewVersion,
856
+ dependency_getOutputUpdateCLIReminder as getOutputUpdateCLIReminder,
857
+ dependency_packageJSONContents as packageJSONContents,
858
+ dependency_DependencyType as DependencyType,
859
+ dependency_addNPMDependenciesIfNeeded as addNPMDependenciesIfNeeded,
860
+ dependency_addLatestNPMDependencies as addLatestNPMDependencies,
861
+ };
1035
862
  }
1036
- interface AdminSession {
1037
- token: string;
1038
- storeFqdn: string;
863
+
864
+ declare function initiateLogging({ logDir, filename, }: {
865
+ logDir?: string;
866
+ filename?: string;
867
+ }): void;
868
+ declare enum ContentTokenType {
869
+ Raw = 0,
870
+ Command = 1,
871
+ Json = 2,
872
+ Path = 3,
873
+ Link = 4,
874
+ Heading = 5,
875
+ SubHeading = 6,
876
+ Italic = 7,
877
+ ErrorText = 8,
878
+ Yellow = 9,
879
+ Cyan = 10,
880
+ Magenta = 11,
881
+ Green = 12
1039
882
  }
1040
- interface OAuthSession {
1041
- admin?: AdminSession;
1042
- partners?: string;
1043
- storefront?: string;
883
+ interface ContentMetadata {
884
+ link?: string;
885
+ }
886
+ declare class ContentToken {
887
+ type: ContentTokenType;
888
+ value: Message;
889
+ metadata: ContentMetadata;
890
+ constructor(value: Message, metadata: ContentMetadata | undefined, type: ContentTokenType);
891
+ }
892
+ declare const token: {
893
+ raw: (value: Message) => ContentToken;
894
+ genericShellCommand: (value: Message) => ContentToken;
895
+ json: (value: any) => ContentToken;
896
+ path: (value: Message) => ContentToken;
897
+ link: (value: Message, link: string) => ContentToken;
898
+ heading: (value: Message) => ContentToken;
899
+ subheading: (value: Message) => ContentToken;
900
+ italic: (value: Message) => ContentToken;
901
+ errorText: (value: Message) => ContentToken;
902
+ cyan: (value: Message) => ContentToken;
903
+ yellow: (value: Message) => ContentToken;
904
+ magenta: (value: Message) => ContentToken;
905
+ green: (value: Message) => ContentToken;
906
+ packagejsonScript: (dependencyManager: DependencyManager, scriptName: string, ...scriptArgs: string[]) => ContentToken;
907
+ successIcon: () => ContentToken;
908
+ failIcon: () => ContentToken;
909
+ };
910
+ declare class TokenizedString {
911
+ value: string;
912
+ constructor(value: string);
1044
913
  }
914
+ declare type Message = string | TokenizedString;
915
+ declare function content(strings: TemplateStringsArray, ...keys: (ContentToken | string)[]): TokenizedString;
916
+ /** Log levels */
917
+ declare type LogLevel = 'fatal' | 'error' | 'warn' | 'info' | 'debug' | 'trace' | 'silent';
1045
918
  /**
1046
- * Ensure that we have a valid session to access the Partners API.
1047
- * If SHOPIFY_CLI_PARTNERS_TOKEN exists, that token will be used to obtain a valid Partners Token
1048
- * If SHOPIFY_CLI_PARTNERS_TOKEN exists, scopes will be ignored
1049
- * @param scopes {string[]} Optional array of extra scopes to authenticate with.
1050
- * @returns {Promise<string>} The access token for the Partners API.
919
+ *
920
+ * @returns {LogLevel} It returns the log level set by the user.
1051
921
  */
1052
- declare function ensureAuthenticatedPartners(scopes?: string[], env?: NodeJS.ProcessEnv): Promise<string>;
922
+ declare const currentLogLevel: () => LogLevel;
923
+ declare const shouldOutput: (logLevel: LogLevel) => boolean;
1053
924
  /**
1054
- * Ensure that we have a valid session to access the Storefront API.
1055
- * @param scopes {string[]} Optional array of extra scopes to authenticate with.
1056
- * @returns {Promise<string>} The access token for the Storefront API.
925
+ * Ouputs information to the user. This is akin to "console.log"
926
+ * Info messages don't get additional formatting.
927
+ * Note: Info messages are sent through the standard output.
928
+ * @param content {string} The content to be output to the user.
1057
929
  */
1058
- declare function ensureAuthenticatedStorefront(scopes?: string[]): Promise<string>;
930
+ declare const info: (content: Message) => void;
1059
931
  /**
1060
- * Ensure that we have a valid Admin session for the given store.
1061
- * @param store {string} Store fqdn to request auth for
1062
- * @param scopes {string[]} Optional array of extra scopes to authenticate with.
1063
- * @returns {Promise<string>} The access token for the Admin API
932
+ * Outputs a success message to the user.
933
+ * Success message receive a special formatting to make them stand out in the console.
934
+ * Note: Success messages are sent through the standard output.
935
+ * @param content {string} The content to be output to the user.
1064
936
  */
1065
- declare function ensureAuthenticatedAdmin(store: string, scopes?: string[]): Promise<AdminSession>;
937
+ declare const success: (content: Message) => void;
1066
938
  /**
1067
- * This method ensures that we have a valid session to authenticate against the given applications using the provided scopes.
1068
- * @param applications {OAuthApplications} An object containing the applications we need to be authenticated with.
1069
- * @returns {OAuthSession} An instance with the access tokens organized by application.
939
+ * Outputs a completed message to the user.
940
+ * Completed message receive a special formatting to make them stand out in the console.
941
+ * Note: Completed messages are sent through the standard output.
942
+ * @param content {string} The content to be output to the user.
1070
943
  */
1071
- declare function ensureAuthenticated(applications: OAuthApplications, env?: NodeJS.ProcessEnv): Promise<OAuthSession>;
1072
- declare function logout(): Promise<void>;
1073
-
1074
- type session_OAuthApplications = OAuthApplications;
1075
- type session_AdminSession = AdminSession;
1076
- type session_OAuthSession = OAuthSession;
1077
- declare const session_ensureAuthenticatedPartners: typeof ensureAuthenticatedPartners;
1078
- declare const session_ensureAuthenticatedStorefront: typeof ensureAuthenticatedStorefront;
1079
- declare const session_ensureAuthenticatedAdmin: typeof ensureAuthenticatedAdmin;
1080
- declare const session_ensureAuthenticated: typeof ensureAuthenticated;
1081
- declare const session_logout: typeof logout;
1082
- declare namespace session {
1083
- export {
1084
- session_OAuthApplications as OAuthApplications,
1085
- session_AdminSession as AdminSession,
1086
- session_OAuthSession as OAuthSession,
1087
- session_ensureAuthenticatedPartners as ensureAuthenticatedPartners,
1088
- session_ensureAuthenticatedStorefront as ensureAuthenticatedStorefront,
1089
- session_ensureAuthenticatedAdmin as ensureAuthenticatedAdmin,
1090
- session_ensureAuthenticated as ensureAuthenticated,
1091
- session_logout as logout,
1092
- };
1093
- }
1094
-
1095
- declare namespace schema {
1096
- export {
1097
- z as define,
1098
- };
944
+ declare const completed: (content: Message) => void;
945
+ /**
946
+ * Ouputs debug information to the user. By default these output is hidden unless the user calls the CLI with --verbose.
947
+ * Debug messages don't get additional formatting.
948
+ * Note: Debug messages are sent through the standard output.
949
+ * @param content {string} The content to be output to the user.
950
+ */
951
+ declare const debug: (content: Message) => void;
952
+ /**
953
+ * Outputs a warning message to the user.
954
+ * Warning messages receive a special formatting to make them stand out in the console.
955
+ * Note: Warning messages are sent through the standard output.
956
+ * @param content {string} The content to be output to the user.
957
+ */
958
+ declare const warn: (content: Message) => void;
959
+ /**
960
+ * Prints a new line in the terminal.
961
+ */
962
+ declare const newline: () => void;
963
+ /**
964
+ * Formats and outputs a fatal error.
965
+ * Note: This API is not intended to be used internally. If you want to
966
+ * abort the execution due to an error, raise a fatal error and let the
967
+ * error handler handle and format it.
968
+ * @param content {Fatal} The fatal error to be output.
969
+ */
970
+ declare const error$1: (content: Fatal) => Promise<void>;
971
+ declare function stringifyMessage(message: Message): string;
972
+ interface OutputProcess {
973
+ /** The prefix to include in the logs
974
+ * [vite] Output coming from Vite
975
+ */
976
+ prefix: string;
977
+ /**
978
+ * A callback to invoke the process. stdout and stderr should be used
979
+ * to send standard output and error data that gets formatted with the
980
+ * right prefix.
981
+ */
982
+ action: (stdout: Writable, stderr: Writable, signal: AbortSignal) => Promise<void>;
1099
983
  }
984
+ /**
985
+ * Use this function when you have multiple concurrent processes that send data events
986
+ * and we need to output them ensuring that they can visually differenciated by the user.
987
+ *
988
+ * @param processes {OutputProcess[]} A list of processes to run concurrently.
989
+ */
990
+ declare function concurrent(processes: OutputProcess[], callback?: ((signal: AbortSignal) => void) | undefined): Promise<void>;
991
+ declare function unstyled(message: string): string;
992
+ declare function shouldDisplayColors(): boolean;
993
+ declare function pageLogs(): Promise<void>;
1100
994
 
1101
- declare function decode$1(input: string): object;
1102
- declare function encode$1(content: toml$1.JsonMap): string;
1103
-
1104
- declare namespace toml {
995
+ declare const output_initiateLogging: typeof initiateLogging;
996
+ declare const output_token: typeof token;
997
+ type output_TokenizedString = TokenizedString;
998
+ declare const output_TokenizedString: typeof TokenizedString;
999
+ type output_Message = Message;
1000
+ declare const output_content: typeof content;
1001
+ type output_LogLevel = LogLevel;
1002
+ declare const output_currentLogLevel: typeof currentLogLevel;
1003
+ declare const output_shouldOutput: typeof shouldOutput;
1004
+ declare const output_info: typeof info;
1005
+ declare const output_success: typeof success;
1006
+ declare const output_completed: typeof completed;
1007
+ declare const output_debug: typeof debug;
1008
+ declare const output_warn: typeof warn;
1009
+ declare const output_newline: typeof newline;
1010
+ declare const output_stringifyMessage: typeof stringifyMessage;
1011
+ type output_OutputProcess = OutputProcess;
1012
+ declare const output_concurrent: typeof concurrent;
1013
+ declare const output_unstyled: typeof unstyled;
1014
+ declare const output_shouldDisplayColors: typeof shouldDisplayColors;
1015
+ declare const output_pageLogs: typeof pageLogs;
1016
+ declare namespace output {
1105
1017
  export {
1106
- decode$1 as decode,
1107
- encode$1 as encode,
1018
+ output_initiateLogging as initiateLogging,
1019
+ output_token as token,
1020
+ output_TokenizedString as TokenizedString,
1021
+ output_Message as Message,
1022
+ output_content as content,
1023
+ output_LogLevel as LogLevel,
1024
+ output_currentLogLevel as currentLogLevel,
1025
+ output_shouldOutput as shouldOutput,
1026
+ output_info as info,
1027
+ output_success as success,
1028
+ output_completed as completed,
1029
+ output_debug as debug,
1030
+ output_warn as warn,
1031
+ output_newline as newline,
1032
+ error$1 as error,
1033
+ output_stringifyMessage as stringifyMessage,
1034
+ output_OutputProcess as OutputProcess,
1035
+ output_concurrent as concurrent,
1036
+ output_unstyled as unstyled,
1037
+ output_shouldDisplayColors as shouldDisplayColors,
1038
+ output_pageLogs as pageLogs,
1108
1039
  };
1109
1040
  }
1110
1041
 
1111
- declare function decode(input: string): unknown;
1112
- declare function encode(content: unknown): string;
1113
-
1114
- declare const yaml_decode: typeof decode;
1115
- declare const yaml_encode: typeof encode;
1116
- declare namespace yaml {
1117
- export {
1118
- yaml_decode as decode,
1119
- yaml_encode as encode,
1120
- };
1042
+ declare enum FatalErrorType {
1043
+ Abort = 0,
1044
+ AbortSilent = 1,
1045
+ Bug = 2
1121
1046
  }
1122
-
1123
- interface CachedAppInfo {
1124
- directory: string;
1125
- appId: string;
1126
- title?: string;
1127
- orgId?: string;
1128
- storeFqdn?: string;
1047
+ declare class CancelExecution extends Error {
1129
1048
  }
1130
- interface ConfSchema {
1131
- appInfo: CachedAppInfo[];
1132
- themeStore: string;
1049
+ /**
1050
+ * A fatal error represents an error shouldn't be rescued and that causes the execution to terminate.
1051
+ * There shouldn't be code that catches fatal errors.
1052
+ */
1053
+ declare abstract class Fatal extends Error {
1054
+ tryMessage: string | null;
1055
+ type: FatalErrorType;
1056
+ constructor(message: Message, type: FatalErrorType, tryMessage?: Message | null);
1133
1057
  }
1134
- declare const cliKit: Conf<ConfSchema>;
1135
- declare function getAppInfo(directory: string): CachedAppInfo | undefined;
1136
- declare function setAppInfo(options: {
1137
- directory: string;
1138
- appId: string;
1139
- title?: string;
1140
- storeFqdn?: string;
1141
- orgId?: string;
1142
- }): void;
1143
- declare function clearAppInfo(directory: string): void;
1144
- declare function getThemeStore(): string | undefined;
1145
- declare function setThemeStore(store: string): void;
1146
-
1147
- type store_CachedAppInfo = CachedAppInfo;
1148
- declare const store_cliKit: typeof cliKit;
1149
- declare const store_getAppInfo: typeof getAppInfo;
1150
- declare const store_setAppInfo: typeof setAppInfo;
1151
- declare const store_clearAppInfo: typeof clearAppInfo;
1152
- declare const store_getThemeStore: typeof getThemeStore;
1153
- declare const store_setThemeStore: typeof setThemeStore;
1154
- declare namespace store {
1155
- export {
1156
- store_CachedAppInfo as CachedAppInfo,
1157
- store_cliKit as cliKit,
1158
- store_getAppInfo as getAppInfo,
1159
- store_setAppInfo as setAppInfo,
1160
- store_clearAppInfo as clearAppInfo,
1161
- store_getThemeStore as getThemeStore,
1162
- store_setThemeStore as setThemeStore,
1163
- };
1058
+ /**
1059
+ * An abort error is a fatal error that shouldn't be reported as a bug.
1060
+ * Those usually represent unexpected scenarios that we can't handle and that usually require some action from the developer
1061
+ */
1062
+ declare class Abort extends Fatal {
1063
+ constructor(message: Message, tryMessage?: Message | null);
1164
1064
  }
1165
-
1166
- declare function request$1<T>(query: RequestDocument, session: AdminSession, variables?: Variables): Promise<T>;
1167
-
1168
- declare namespace admin {
1169
- export {
1170
- request$1 as request,
1171
- };
1065
+ declare class AbortSilent extends Fatal {
1066
+ constructor();
1172
1067
  }
1173
-
1174
- declare function request<T>(query: RequestDocument, token: string, variables?: Variables): Promise<T>;
1175
1068
  /**
1176
- * Check if the given token is revoked and no longer valid to interact with the Partners API.
1177
- * @param token {string} - The token to check
1178
- * @returns {Promise<boolean>} - True if the token is revoked, false otherwise
1069
+ * A bug error is an error that represents a bug and therefore should be reported.
1179
1070
  */
1180
- declare function checkIfTokenIsRevoked(token: string): Promise<boolean>;
1071
+ declare class Bug extends Fatal {
1072
+ constructor(message: Message, tryMessage?: string | null);
1073
+ }
1181
1074
  /**
1182
- * Function queries are proxied through the script service proxy.
1183
- * To execute a query, we encapsulate it inside another query (including the variables)
1184
- * This is done automatically, you just need to provide the query and the variables.
1185
- *
1186
- * @param apiKey {string} APIKey of the app where the query will be executed.
1187
- * @param query {any} GraphQL query to execute.
1188
- * @param token {string} Partners token
1189
- * @param variables {any} GraphQL variables to pass to the query.
1190
- * @returns {Promise<T>} The response of the query.
1075
+ * A function that handles errors that blow up in the CLI.
1076
+ * @param error Error to be handled.
1077
+ * @returns A promise that resolves with the error passed.
1191
1078
  */
1192
- declare function functionProxyRequest<T>(apiKey: string, query: unknown, token: string, variables?: unknown): Promise<T>;
1079
+ declare function handler(error: Error): Promise<Error>;
1080
+ declare function mapper(error: Error): Promise<Error>;
1081
+ declare function isFatal(error: Error): boolean;
1082
+ declare function shouldReport(error: Error): boolean;
1193
1083
 
1194
- declare const partners_request: typeof request;
1195
- declare const partners_checkIfTokenIsRevoked: typeof checkIfTokenIsRevoked;
1196
- declare const partners_functionProxyRequest: typeof functionProxyRequest;
1197
- declare namespace partners {
1084
+ type error_CancelExecution = CancelExecution;
1085
+ declare const error_CancelExecution: typeof CancelExecution;
1086
+ type error_Fatal = Fatal;
1087
+ declare const error_Fatal: typeof Fatal;
1088
+ type error_Abort = Abort;
1089
+ declare const error_Abort: typeof Abort;
1090
+ type error_AbortSilent = AbortSilent;
1091
+ declare const error_AbortSilent: typeof AbortSilent;
1092
+ type error_Bug = Bug;
1093
+ declare const error_Bug: typeof Bug;
1094
+ declare const error_handler: typeof handler;
1095
+ declare const error_mapper: typeof mapper;
1096
+ declare const error_isFatal: typeof isFatal;
1097
+ declare const error_shouldReport: typeof shouldReport;
1098
+ declare const error_AbortSignal: typeof AbortSignal;
1099
+ declare namespace error {
1198
1100
  export {
1199
- partners_request as request,
1200
- partners_checkIfTokenIsRevoked as checkIfTokenIsRevoked,
1201
- partners_functionProxyRequest as functionProxyRequest,
1202
- };
1203
- }
1204
-
1205
- declare const FindOrganizationQuery: string;
1206
- interface FindOrganizationQuerySchema {
1207
- organizations: {
1208
- nodes: {
1209
- id: string;
1210
- businessName: string;
1211
- website: string;
1212
- appsNext: boolean;
1213
- apps: {
1214
- nodes: {
1215
- id: string;
1216
- title: string;
1217
- apiKey: string;
1218
- apiSecretKeys: {
1219
- secret: string;
1220
- }[];
1221
- appType: string;
1222
- }[];
1223
- };
1224
- }[];
1225
- };
1226
- }
1227
-
1228
- interface AllOrganizationsQuerySchemaOrganization {
1229
- id: string;
1230
- businessName: string;
1231
- website: string;
1232
- appsNext: boolean;
1233
- apps: {
1234
- nodes: {
1235
- id: string;
1236
- title: string;
1237
- apiKey: string;
1238
- apiSecretKeys: {
1239
- secret: string;
1240
- }[];
1241
- appType: string;
1242
- }[];
1243
- };
1244
- }
1245
- interface AllOrganizationsQuerySchema {
1246
- organizations: {
1247
- nodes: AllOrganizationsQuerySchemaOrganization[];
1248
- };
1101
+ error_CancelExecution as CancelExecution,
1102
+ error_Fatal as Fatal,
1103
+ error_Abort as Abort,
1104
+ error_AbortSilent as AbortSilent,
1105
+ error_Bug as Bug,
1106
+ error_handler as handler,
1107
+ error_mapper as mapper,
1108
+ error_isFatal as isFatal,
1109
+ error_shouldReport as shouldReport,
1110
+ error_AbortSignal as AbortSignal,
1111
+ };
1249
1112
  }
1250
- declare const AllOrganizationsQuery: string;
1251
1113
 
1252
- declare const CreateAppQuery: string;
1253
- interface CreateAppQueryVariables {
1254
- org: number;
1255
- title: string;
1256
- appUrl: string;
1257
- redir: string[];
1258
- type: string;
1259
- }
1260
- interface CreateAppQuerySchema {
1261
- appCreate: {
1262
- app: {
1263
- id: string;
1264
- apiKey: string;
1265
- title: string;
1266
- applicationUrl: string;
1267
- redirectUrlWhitelist: string[];
1268
- apiSecretKeys: {
1269
- secret: string;
1270
- }[];
1271
- appType: string;
1272
- };
1273
- userErrors: {
1274
- field: string[];
1275
- message: string;
1276
- }[];
1277
- };
1278
- }
1114
+ declare const InvalidChecksumError: ({ file, expected, got }: {
1115
+ file: string;
1116
+ expected: string;
1117
+ got: string;
1118
+ }) => Abort;
1119
+ /**
1120
+ * Given a local file and a URL pointing to a remote file representing the MD5 of a local file,
1121
+ * it validates the authenticity of the binary using an MD5 checksum.
1122
+ * @param options: The file to validate and the URL that points to the file containing the MD5.
1123
+ */
1124
+ declare function validateMD5({ file, md5FileURL }: {
1125
+ file: string;
1126
+ md5FileURL: string;
1127
+ }): Promise<void>;
1279
1128
 
1280
- declare const UpdateURLsQuery: string;
1281
- interface UpdateURLsQueryVariables {
1282
- apiKey: string;
1283
- appUrl: string;
1284
- redir: string[];
1285
- }
1286
- interface UpdateURLsQuerySchema {
1287
- appUpdate: {
1288
- userErrors: {
1289
- field: string[];
1290
- message: string;
1291
- }[];
1292
- };
1129
+ declare const checksum_InvalidChecksumError: typeof InvalidChecksumError;
1130
+ declare const checksum_validateMD5: typeof validateMD5;
1131
+ declare namespace checksum {
1132
+ export {
1133
+ checksum_InvalidChecksumError as InvalidChecksumError,
1134
+ checksum_validateMD5 as validateMD5,
1135
+ };
1293
1136
  }
1294
1137
 
1295
- declare const FindAppQuery: string;
1296
- interface FindAppQuerySchema {
1297
- app: {
1298
- id: string;
1299
- title: string;
1300
- apiKey: string;
1301
- apiSecretKeys: {
1302
- secret: string;
1303
- }[];
1304
- appType: string;
1305
- };
1306
- }
1138
+ /**
1139
+ * An object that contains the flags that
1140
+ * are shared across all the commands.
1141
+ */
1142
+ declare const globalFlags: {
1143
+ verbose: _oclif_core_lib_interfaces.BooleanFlag<boolean>;
1144
+ };
1307
1145
 
1308
- declare const ExtensionUpdateDraftMutation: string;
1309
- interface ExtensionUpdateDraftInput {
1310
- apiKey: string;
1311
- config: string;
1312
- context: string | undefined;
1313
- registrationId: string;
1314
- }
1315
- interface ExtensionUpdateDraftPayload {
1316
- clientMutationId: string;
1317
- extensionVersion: ExtensionVersion;
1318
- userErrors: {
1319
- field: string[];
1320
- message: string;
1321
- }[];
1322
- }
1323
- interface ExtensionVersion {
1324
- config: string;
1325
- context: string;
1326
- id: string;
1327
- lastUserInteractionAt: string;
1328
- location: string;
1329
- registrationId: string;
1330
- registrationUuid: string;
1331
- uuid: string;
1332
- validationErrors: {
1333
- field: string[];
1334
- message: string;
1335
- }[];
1336
- versionTag: string;
1337
- }
1338
- interface ExtensionUpdateSchema {
1339
- extensionUpdateDraft: ExtensionUpdateDraftPayload;
1146
+ declare const cli_globalFlags: typeof globalFlags;
1147
+ declare namespace cli {
1148
+ export {
1149
+ cli_globalFlags as globalFlags,
1150
+ };
1340
1151
  }
1341
1152
 
1342
- declare const GenerateSignedUploadUrl: string;
1343
- interface GenerateSignedUploadUrlVariables {
1344
- apiKey: string;
1345
- deploymentUuid: string;
1346
- bundleFormat: number;
1347
- }
1348
- interface GenerateSignedUploadUrlSchema {
1349
- deploymentGenerateSignedUploadUrl: {
1350
- signedUploadUrl: string;
1351
- userErrors: {
1352
- field: string[];
1353
- message: string;
1354
- }[];
1153
+ /**
1154
+ * Error that's thrown when the .env is not found.
1155
+ * @param path {string} Path to the .env file.
1156
+ * @returns {Abort} An abort error.
1157
+ */
1158
+ declare const DotEnvNotFoundError: (path: string) => Abort;
1159
+ /**
1160
+ * This interface represents a .env file.
1161
+ */
1162
+ interface DotEnvFile {
1163
+ /**
1164
+ * Path to the .env file.
1165
+ */
1166
+ path: string;
1167
+ /**
1168
+ * Variables of the .env file.
1169
+ */
1170
+ variables: {
1171
+ [name: string]: string;
1355
1172
  };
1356
1173
  }
1174
+ declare function read$1(path: string): Promise<DotEnvFile>;
1175
+ /**
1176
+ * Writes a .env file to disk.
1177
+ * @param file {DotEnvFile} .env file to be written.
1178
+ */
1179
+ declare function write$1(file: DotEnvFile): Promise<void>;
1357
1180
 
1358
- declare const CreateDeployment: string;
1359
- interface ExtensionSettings {
1360
- uuid: string;
1361
- config: string;
1362
- context: string;
1363
- }
1364
- interface CreateDeploymentVariables {
1365
- apiKey: string;
1366
- uuid: string;
1367
- bundleUrl: string;
1368
- extensions: ExtensionSettings[];
1181
+ declare const dotEnv_DotEnvNotFoundError: typeof DotEnvNotFoundError;
1182
+ type dotEnv_DotEnvFile = DotEnvFile;
1183
+ declare namespace dotEnv {
1184
+ export {
1185
+ dotEnv_DotEnvNotFoundError as DotEnvNotFoundError,
1186
+ dotEnv_DotEnvFile as DotEnvFile,
1187
+ read$1 as read,
1188
+ write$1 as write,
1189
+ };
1369
1190
  }
1370
- interface CreateDeploymentSchema {
1371
- deploymentCreate: {
1372
- deployment: {
1373
- uuid: string;
1374
- };
1375
- userErrors: {
1376
- field: string[];
1377
- message: string;
1378
- }[];
1379
- };
1191
+
1192
+ /**
1193
+ * It returns true if the terminal is interactive.
1194
+ * @returns {boolean} True if the terminal is interactive.
1195
+ */
1196
+ declare function isTerminalInteractive(): boolean;
1197
+ /**
1198
+ * Returns the path to the user's home directory.
1199
+ * @returns {string} The path to the user's home directory.
1200
+ */
1201
+ declare function homeDirectory(): string;
1202
+ /**
1203
+ * Returns true if the CLI is running in debug mode.
1204
+ * @param env The environment variables from the environment of the current process.
1205
+ * @returns true if SHOPIFY_CONFIG is debug
1206
+ */
1207
+ declare function isDebug(env?: NodeJS.ProcessEnv): boolean;
1208
+ /**
1209
+ * Returns true if the CLI is running in verbose mode.
1210
+ * @param env The environment variables from the environment of the current process.
1211
+ * @returns true if SHOPIFY_FLAG_VERBOSE is truthy or the flag --verbose has been passed
1212
+ */
1213
+ declare function isVerbose(env?: NodeJS.ProcessEnv): boolean;
1214
+ /**
1215
+ * Returns true if the environment in which the CLI is running is either
1216
+ * a local environment (where dev is present) or a cloud environment (spin).
1217
+ * @returns {boolean} True if the CLI is used in a Shopify environment.
1218
+ */
1219
+ declare function isShopify(env?: NodeJS.ProcessEnv): Promise<boolean>;
1220
+ /**
1221
+ * This variable is used when running unit tests to indicate that the CLI's business logic
1222
+ * is run as a subject of a unit test. We can use this variable to disable output through
1223
+ * the standard streams.
1224
+ * @param env The environment variables from the environment of the current process.
1225
+ * @returns True if the SHOPIFY_UNIT_TEST environment variable is truthy.
1226
+ */
1227
+ declare function isUnitTest(env?: NodeJS.ProcessEnv): boolean;
1228
+ /**
1229
+ * Returns true if reporting analytics is enabled.
1230
+ * @param env The environment variables from the environment of the current process.
1231
+ * @returns true unless SHOPIFY_CLI_NO_ANALYTICS is truthy.
1232
+ */
1233
+ declare function analyticsDisabled(env?: NodeJS.ProcessEnv): boolean;
1234
+ /**
1235
+ * Returns whether the environment has Git available.
1236
+ * @returns {Promise<boolean>} A promise that resolves with the value.
1237
+ */
1238
+ declare function hasGit(): Promise<boolean>;
1239
+
1240
+ declare const local_isTerminalInteractive: typeof isTerminalInteractive;
1241
+ declare const local_homeDirectory: typeof homeDirectory;
1242
+ declare const local_isDebug: typeof isDebug;
1243
+ declare const local_isVerbose: typeof isVerbose;
1244
+ declare const local_isShopify: typeof isShopify;
1245
+ declare const local_isUnitTest: typeof isUnitTest;
1246
+ declare const local_analyticsDisabled: typeof analyticsDisabled;
1247
+ declare const local_hasGit: typeof hasGit;
1248
+ declare namespace local {
1249
+ export {
1250
+ local_isTerminalInteractive as isTerminalInteractive,
1251
+ local_homeDirectory as homeDirectory,
1252
+ local_isDebug as isDebug,
1253
+ local_isVerbose as isVerbose,
1254
+ local_isShopify as isShopify,
1255
+ local_isUnitTest as isUnitTest,
1256
+ local_analyticsDisabled as analyticsDisabled,
1257
+ local_hasGit as hasGit,
1258
+ };
1380
1259
  }
1381
1260
 
1382
- declare const AllStoresByOrganizationQuery: string;
1383
- interface AllStoresByOrganizationSchema {
1384
- organizations: {
1385
- nodes: {
1386
- id: string;
1387
- stores: {
1388
- nodes: {
1389
- shopId: string;
1390
- link: string;
1391
- shopDomain: string;
1392
- shopName: string;
1393
- transferDisabled: boolean;
1394
- convertableToPartnerTest: boolean;
1395
- }[];
1396
- };
1397
- }[];
1398
- };
1261
+ /**
1262
+ * Enum that represents the environment to use for a given service.
1263
+ * @readonly
1264
+ * @enum {number}
1265
+ */
1266
+ declare enum Environment {
1267
+ Local = "local",
1268
+ Production = "production",
1269
+ Spin = "spin"
1399
1270
  }
1400
1271
 
1401
- declare const ConvertDevToTestStoreQuery: string;
1402
- interface ConvertDevToTestStoreVariables {
1403
- input: {
1404
- organizationID: number;
1405
- shopId: string;
1406
- };
1407
- }
1408
- interface ConvertDevToTestStoreSchema {
1409
- convertDevToTestStore: {
1410
- convertedToTestStore: boolean;
1411
- userErrors: {
1412
- field: string[];
1413
- message: string;
1414
- }[];
1415
- };
1416
- }
1272
+ /**
1273
+ * Returns the environment to be used for the interactions with the partners' CLI API.
1274
+ * @param env The environment variables from the environment of the current process.
1275
+ */
1276
+ declare function partners$1(env?: NodeJS.ProcessEnv): Environment;
1277
+ /**
1278
+ * Returns the environment to be used for the interactions with the admin API.
1279
+ * @param env The environment variables from the environment of the current process.
1280
+ */
1281
+ declare function shopify$1(env?: NodeJS.ProcessEnv): Environment;
1282
+ /**
1283
+ * Returns the environment to be used for the interactions with identity.
1284
+ * @param env The environment variables from the environment of the current process.
1285
+ */
1286
+ declare function identity$1(env?: NodeJS.ProcessEnv): Environment;
1417
1287
 
1418
- declare const ExtensionCreateQuery: string;
1419
- interface ExtensionCreateVariables {
1420
- apiKey: string;
1421
- type: string;
1422
- title: string;
1423
- config: string;
1424
- context?: string | null;
1425
- }
1426
- interface ExtensionCreateSchema {
1427
- extensionCreate: {
1428
- extensionRegistration: {
1429
- id: string;
1430
- uuid: string;
1431
- type: string;
1432
- title: string;
1433
- draftVersion: {
1434
- registrationId: string;
1435
- lastUserInteractionAt: string;
1436
- validationErrors: {
1437
- field: string[];
1438
- message: string;
1439
- }[];
1440
- };
1441
- };
1442
- userErrors: {
1443
- field: string[];
1444
- message: string;
1445
- }[];
1446
- };
1288
+ declare namespace service {
1289
+ export {
1290
+ partners$1 as partners,
1291
+ shopify$1 as shopify,
1292
+ identity$1 as identity,
1293
+ };
1447
1294
  }
1448
1295
 
1449
- declare const ExtensionSpecificationsQuery: string;
1450
- interface ExtensionSpecificationsQueryVariables {
1451
- api_key: string;
1452
- }
1453
- interface ExtensionSpecificationsQuerySchema {
1454
- extensionSpecifications: {
1455
- name: string;
1456
- identifier: string;
1457
- options: {
1458
- managementExperience: 'cli' | 'custom' | 'dashboard';
1459
- }[];
1460
- features?: {
1461
- argo?: {
1462
- surface: string;
1463
- };
1464
- };
1465
- }[];
1466
- }
1296
+ declare const CouldntObtainPartnersSpinFQDNError: Abort;
1297
+ declare const CouldntObtainIdentitySpinFQDNError: Abort;
1298
+ declare const CouldntObtainShopifySpinFQDNError: Abort;
1299
+ declare const NotProvidedStoreFQDNError: Abort;
1300
+ /**
1301
+ * It returns the Partners' API service we should interact with.
1302
+ * @returns {string} Fully-qualified domain of the partners service we should interact with.
1303
+ */
1304
+ declare function partners(): Promise<string>;
1305
+ /**
1306
+ * It returns the Identity service we should interact with.
1307
+ * @returns {string} Fully-qualified domain of the Identity service we should interact with.
1308
+ */
1309
+ declare function identity(): Promise<string>;
1310
+ /**
1311
+ * It returns the Shopify service we should interact with.
1312
+ * Note the same fqdn is sued for the Admin and the Storefront Renderer APIs.
1313
+ * @returns {string} Fully-qualified domain of the Shopify service we should interact with.
1314
+ */
1315
+ declare function shopify(options?: {
1316
+ storeFqdn?: string;
1317
+ }): Promise<string>;
1467
1318
 
1468
- declare const AllAppExtensionRegistrationsQuery: string;
1469
- interface AllAppExtensionRegistrationsQueryVariables {
1470
- apiKey: string;
1319
+ declare const fqdn_CouldntObtainPartnersSpinFQDNError: typeof CouldntObtainPartnersSpinFQDNError;
1320
+ declare const fqdn_CouldntObtainIdentitySpinFQDNError: typeof CouldntObtainIdentitySpinFQDNError;
1321
+ declare const fqdn_CouldntObtainShopifySpinFQDNError: typeof CouldntObtainShopifySpinFQDNError;
1322
+ declare const fqdn_NotProvidedStoreFQDNError: typeof NotProvidedStoreFQDNError;
1323
+ declare const fqdn_partners: typeof partners;
1324
+ declare const fqdn_identity: typeof identity;
1325
+ declare const fqdn_shopify: typeof shopify;
1326
+ declare namespace fqdn {
1327
+ export {
1328
+ fqdn_CouldntObtainPartnersSpinFQDNError as CouldntObtainPartnersSpinFQDNError,
1329
+ fqdn_CouldntObtainIdentitySpinFQDNError as CouldntObtainIdentitySpinFQDNError,
1330
+ fqdn_CouldntObtainShopifySpinFQDNError as CouldntObtainShopifySpinFQDNError,
1331
+ fqdn_NotProvidedStoreFQDNError as NotProvidedStoreFQDNError,
1332
+ fqdn_partners as partners,
1333
+ fqdn_identity as identity,
1334
+ fqdn_shopify as shopify,
1335
+ };
1471
1336
  }
1472
- interface AllAppExtensionRegistrationsQuerySchema {
1473
- app: {
1474
- extensionRegistrations: {
1475
- id: string;
1476
- uuid: string;
1477
- title: string;
1478
- type: string;
1479
- }[];
1480
- };
1337
+
1338
+ /**
1339
+ * Returns whether an environment variable value represents a truthy value.
1340
+ * @param variable {string | undefined} Given a environment variable value, it returns true if it represents a truthy value.
1341
+ * @returns {boolean}
1342
+ */
1343
+ declare function isTruthy(variable: string | undefined): boolean;
1344
+
1345
+ declare const utilities_isTruthy: typeof isTruthy;
1346
+ declare namespace utilities {
1347
+ export {
1348
+ utilities_isTruthy as isTruthy,
1349
+ };
1481
1350
  }
1482
1351
 
1483
- declare const FindProductVariantQuery: string;
1484
- interface FindProductVariantSchema {
1485
- products: {
1486
- edges: {
1487
- node: {
1488
- id: string;
1489
- variants: {
1490
- edges: {
1491
- node: {
1492
- id: string;
1493
- };
1494
- }[];
1495
- };
1496
- };
1497
- }[];
1498
- };
1352
+ declare const environment_local: typeof local;
1353
+ declare const environment_service: typeof service;
1354
+ declare const environment_fqdn: typeof fqdn;
1355
+ declare const environment_utilities: typeof utilities;
1356
+ declare namespace environment {
1357
+ export {
1358
+ environment_local as local,
1359
+ environment_service as service,
1360
+ environment_fqdn as fqdn,
1361
+ environment_utilities as utilities,
1362
+ };
1499
1363
  }
1500
1364
 
1501
- declare const ScriptServiceProxyQuery: string;
1502
- interface ScriptServiceProxyQuerySchema {
1503
- scriptServiceProxy: unknown;
1365
+ declare function stripUp(path: string, strip: number): string;
1366
+ /**
1367
+ * Creates a temporary directory and ties its lifecycle ot the lifecycle of the callback.
1368
+ * @param callback - The callback that receives the temporary directory.
1369
+ */
1370
+ declare function inTemporaryDirectory<T>(callback: (tmpDir: string) => T | Promise<T>): Promise<T>;
1371
+ /**
1372
+ * It reads a file and returns its content as a string using the
1373
+ * utf-8 encoding
1374
+ * @param path {string} Path to the file to read.
1375
+ * @returns {Promise<string>} A promise that resolves with the content of the file.
1376
+ */
1377
+ declare function read(path: string, options?: object): Promise<string>;
1378
+ declare function readSync(path: string, options?: object): string;
1379
+ /**
1380
+ * Copies a file
1381
+ * @param from {string} Path to the directory or file to be copied.
1382
+ * @param to {string} Destination path.
1383
+ */
1384
+ declare function copy(from: string, to: string): Promise<void>;
1385
+ declare function touch(path: string): Promise<void>;
1386
+ declare function write(path: string, data: string): Promise<void>;
1387
+ declare function writeSync(path: string, data: string): void;
1388
+ declare function append(path: string, data: string): Promise<void>;
1389
+ declare function mkdir(path: string): Promise<void>;
1390
+ declare function mkdirSync(path: string): void;
1391
+ declare function remove(path: string): Promise<void>;
1392
+ declare function rmdir(path: string, { force }?: {
1393
+ force?: boolean;
1394
+ }): Promise<void>;
1395
+ declare function mkTmpDir(): Promise<string>;
1396
+ declare function isDirectory(path: string): Promise<boolean>;
1397
+ declare function size(path: string): Promise<number>;
1398
+ declare function sizeSync(path: string): number;
1399
+ /**
1400
+ * Moves a file.
1401
+ * @param src {string} File to be moved.
1402
+ * @param dest {string} Path to be moved to.
1403
+ * @param options {object} Moving options.
1404
+ */
1405
+ declare function move(src: string, dest: string, options?: {
1406
+ overwrite?: boolean;
1407
+ }): Promise<void>;
1408
+ /**
1409
+ * Changes the permissions of a directory or file.
1410
+ * @param path {string} Path to the file or directory whose permissions will be modified.
1411
+ * @param mode {string | numbers} Permissions to set to the file or directory.
1412
+ */
1413
+ declare function chmod(path: string, mode: number | string): Promise<void>;
1414
+ /**
1415
+ * Checks if a file has executable permissions.
1416
+ * @param path {string} Path to the file whose permissions will be checked.
1417
+ */
1418
+ declare function hasExecutablePermissions(path: string): Promise<boolean>;
1419
+ /**
1420
+ * Returns true if a file or directory exists
1421
+ * @param path {string} Path to the directory or file.
1422
+ * @returns {boolean} True if it exists.
1423
+ */
1424
+ declare function exists(path: string): Promise<boolean>;
1425
+ /**
1426
+ * Format a string using prettier. Return the formatted content.
1427
+ */
1428
+ declare function format(content: string, options: {
1429
+ path: string;
1430
+ }): Promise<string>;
1431
+
1432
+ declare const file_stripUp: typeof stripUp;
1433
+ declare const file_inTemporaryDirectory: typeof inTemporaryDirectory;
1434
+ declare const file_read: typeof read;
1435
+ declare const file_readSync: typeof readSync;
1436
+ declare const file_copy: typeof copy;
1437
+ declare const file_touch: typeof touch;
1438
+ declare const file_write: typeof write;
1439
+ declare const file_writeSync: typeof writeSync;
1440
+ declare const file_append: typeof append;
1441
+ declare const file_mkdir: typeof mkdir;
1442
+ declare const file_mkdirSync: typeof mkdirSync;
1443
+ declare const file_remove: typeof remove;
1444
+ declare const file_rmdir: typeof rmdir;
1445
+ declare const file_mkTmpDir: typeof mkTmpDir;
1446
+ declare const file_isDirectory: typeof isDirectory;
1447
+ declare const file_size: typeof size;
1448
+ declare const file_sizeSync: typeof sizeSync;
1449
+ declare const file_move: typeof move;
1450
+ declare const file_chmod: typeof chmod;
1451
+ declare const file_hasExecutablePermissions: typeof hasExecutablePermissions;
1452
+ declare const file_exists: typeof exists;
1453
+ declare const file_format: typeof format;
1454
+ declare namespace file {
1455
+ export {
1456
+ file_stripUp as stripUp,
1457
+ file_inTemporaryDirectory as inTemporaryDirectory,
1458
+ file_read as read,
1459
+ file_readSync as readSync,
1460
+ file_copy as copy,
1461
+ file_touch as touch,
1462
+ file_write as write,
1463
+ file_writeSync as writeSync,
1464
+ file_append as append,
1465
+ file_mkdir as mkdir,
1466
+ file_mkdirSync as mkdirSync,
1467
+ file_remove as remove,
1468
+ file_rmdir as rmdir,
1469
+ file_mkTmpDir as mkTmpDir,
1470
+ file_isDirectory as isDirectory,
1471
+ file_size as size,
1472
+ file_sizeSync as sizeSync,
1473
+ file_move as move,
1474
+ file_chmod as chmod,
1475
+ file_hasExecutablePermissions as hasExecutablePermissions,
1476
+ file_exists as exists,
1477
+ file_format as format,
1478
+ };
1504
1479
  }
1505
1480
 
1506
- declare const GetAppFunctionsQuery: string;
1481
+ declare const factory: simple_git.SimpleGitFactory;
1482
+ declare const GitNotPresentError: () => Abort;
1483
+ declare function initializeRepository(directory: string): Promise<void>;
1484
+ declare function downloadRepository({ repoUrl, destination }: {
1485
+ repoUrl: string;
1486
+ destination: string;
1487
+ }): Promise<void>;
1488
+ /**
1489
+ * If "git" is not present in the environment it throws
1490
+ * an abort error.
1491
+ */
1492
+ declare function ensurePresentOrAbort(): Promise<void>;
1507
1493
 
1508
- declare const ModuleUploadUrlGenerateMutation: string;
1509
- interface ModuleUploadUrlGenerateMutationSchema {
1510
- data: {
1511
- moduleUploadUrlGenerate: {
1512
- details: {
1513
- url: string;
1514
- headers: {
1515
- [key: string]: string;
1516
- };
1517
- humanizedMaxSize: string;
1518
- };
1519
- userErrors: {
1520
- field: string;
1521
- message: string;
1522
- }[];
1523
- };
1524
- };
1494
+ declare const git_factory: typeof factory;
1495
+ declare const git_GitNotPresentError: typeof GitNotPresentError;
1496
+ declare const git_initializeRepository: typeof initializeRepository;
1497
+ declare const git_downloadRepository: typeof downloadRepository;
1498
+ declare const git_ensurePresentOrAbort: typeof ensurePresentOrAbort;
1499
+ declare namespace git {
1500
+ export {
1501
+ git_factory as factory,
1502
+ git_GitNotPresentError as GitNotPresentError,
1503
+ git_initializeRepository as initializeRepository,
1504
+ git_downloadRepository as downloadRepository,
1505
+ git_ensurePresentOrAbort as ensurePresentOrAbort,
1506
+ };
1525
1507
  }
1526
1508
 
1527
- declare const AppFunctionSetMutation: string;
1528
- interface AppFunctionSetMutationSchema {
1529
- data: {
1530
- appScriptSet: {
1531
- userErrors: {
1532
- field: string;
1533
- message: string;
1534
- tag: string;
1535
- }[];
1536
- appScript?: {
1537
- uuid: string;
1538
- appKey: string;
1539
- configSchema: unknown;
1540
- extensionPointName: string;
1541
- title: string;
1542
- };
1543
- };
1544
- };
1509
+ interface GithubRelease {
1510
+ id: number;
1511
+ url: string;
1512
+ tag_name: string;
1513
+ name: string;
1514
+ body: string;
1515
+ draft: boolean;
1516
+ prerelease: boolean;
1517
+ created_at: string;
1518
+ published_at: string;
1519
+ tarball_url: string;
1545
1520
  }
1546
- interface AppFunctionSetVariables {
1547
- uuid?: string;
1548
- extensionPointName: string;
1549
- title: string;
1550
- description?: string;
1551
- force?: boolean;
1552
- schemaMajorVersion?: string;
1553
- schemaMinorVersion?: string;
1554
- scriptConfigVersion?: string;
1555
- configurationUi: boolean;
1556
- configurationDefinition?: string;
1557
- moduleUploadUrl: string;
1558
- library?: {
1559
- language: string;
1560
- version: string;
1561
- };
1562
- appBridge?: {
1563
- createPath?: string;
1564
- detailsPath?: string;
1565
- };
1566
- inputQuery?: string;
1521
+ interface Options {
1522
+ filter: (release: GithubRelease) => boolean;
1523
+ }
1524
+ declare function getLatestRelease(user: string, repo: string, { filter }?: Options): Promise<GithubRelease>;
1525
+ declare function parseRepoUrl(src: string): {
1526
+ site: string;
1527
+ user: string;
1528
+ name: string;
1529
+ ref: string;
1530
+ subDirectory: string;
1531
+ ssh: string;
1532
+ http: string;
1533
+ };
1534
+ interface GithubRepoReference {
1535
+ repoBaseUrl: string;
1536
+ branch?: string;
1537
+ filePath?: string;
1567
1538
  }
1539
+ declare function parseGithubRepoReference(src: string): GithubRepoReference;
1568
1540
 
1569
- declare const index_FindOrganizationQuery: typeof FindOrganizationQuery;
1570
- type index_FindOrganizationQuerySchema = FindOrganizationQuerySchema;
1571
- type index_AllOrganizationsQuerySchemaOrganization = AllOrganizationsQuerySchemaOrganization;
1572
- type index_AllOrganizationsQuerySchema = AllOrganizationsQuerySchema;
1573
- declare const index_AllOrganizationsQuery: typeof AllOrganizationsQuery;
1574
- declare const index_CreateAppQuery: typeof CreateAppQuery;
1575
- type index_CreateAppQueryVariables = CreateAppQueryVariables;
1576
- type index_CreateAppQuerySchema = CreateAppQuerySchema;
1577
- declare const index_UpdateURLsQuery: typeof UpdateURLsQuery;
1578
- type index_UpdateURLsQueryVariables = UpdateURLsQueryVariables;
1579
- type index_UpdateURLsQuerySchema = UpdateURLsQuerySchema;
1580
- declare const index_FindAppQuery: typeof FindAppQuery;
1581
- type index_FindAppQuerySchema = FindAppQuerySchema;
1582
- declare const index_ExtensionUpdateDraftMutation: typeof ExtensionUpdateDraftMutation;
1583
- type index_ExtensionUpdateDraftInput = ExtensionUpdateDraftInput;
1584
- type index_ExtensionUpdateDraftPayload = ExtensionUpdateDraftPayload;
1585
- type index_ExtensionVersion = ExtensionVersion;
1586
- type index_ExtensionUpdateSchema = ExtensionUpdateSchema;
1587
- declare const index_GenerateSignedUploadUrl: typeof GenerateSignedUploadUrl;
1588
- type index_GenerateSignedUploadUrlVariables = GenerateSignedUploadUrlVariables;
1589
- type index_GenerateSignedUploadUrlSchema = GenerateSignedUploadUrlSchema;
1590
- declare const index_CreateDeployment: typeof CreateDeployment;
1591
- type index_ExtensionSettings = ExtensionSettings;
1592
- type index_CreateDeploymentVariables = CreateDeploymentVariables;
1593
- type index_CreateDeploymentSchema = CreateDeploymentSchema;
1594
- declare const index_AllStoresByOrganizationQuery: typeof AllStoresByOrganizationQuery;
1595
- type index_AllStoresByOrganizationSchema = AllStoresByOrganizationSchema;
1596
- declare const index_ConvertDevToTestStoreQuery: typeof ConvertDevToTestStoreQuery;
1597
- type index_ConvertDevToTestStoreVariables = ConvertDevToTestStoreVariables;
1598
- type index_ConvertDevToTestStoreSchema = ConvertDevToTestStoreSchema;
1599
- declare const index_ExtensionCreateQuery: typeof ExtensionCreateQuery;
1600
- type index_ExtensionCreateVariables = ExtensionCreateVariables;
1601
- type index_ExtensionCreateSchema = ExtensionCreateSchema;
1602
- declare const index_ExtensionSpecificationsQuery: typeof ExtensionSpecificationsQuery;
1603
- type index_ExtensionSpecificationsQueryVariables = ExtensionSpecificationsQueryVariables;
1604
- type index_ExtensionSpecificationsQuerySchema = ExtensionSpecificationsQuerySchema;
1605
- declare const index_AllAppExtensionRegistrationsQuery: typeof AllAppExtensionRegistrationsQuery;
1606
- type index_AllAppExtensionRegistrationsQueryVariables = AllAppExtensionRegistrationsQueryVariables;
1607
- type index_AllAppExtensionRegistrationsQuerySchema = AllAppExtensionRegistrationsQuerySchema;
1608
- declare const index_FindProductVariantQuery: typeof FindProductVariantQuery;
1609
- type index_FindProductVariantSchema = FindProductVariantSchema;
1610
- declare const index_ScriptServiceProxyQuery: typeof ScriptServiceProxyQuery;
1611
- type index_ScriptServiceProxyQuerySchema = ScriptServiceProxyQuerySchema;
1612
- declare const index_GetAppFunctionsQuery: typeof GetAppFunctionsQuery;
1613
- declare const index_ModuleUploadUrlGenerateMutation: typeof ModuleUploadUrlGenerateMutation;
1614
- type index_ModuleUploadUrlGenerateMutationSchema = ModuleUploadUrlGenerateMutationSchema;
1615
- declare const index_AppFunctionSetMutation: typeof AppFunctionSetMutation;
1616
- type index_AppFunctionSetMutationSchema = AppFunctionSetMutationSchema;
1617
- type index_AppFunctionSetVariables = AppFunctionSetVariables;
1618
- declare namespace index {
1619
- export {
1620
- index_FindOrganizationQuery as FindOrganizationQuery,
1621
- index_FindOrganizationQuerySchema as FindOrganizationQuerySchema,
1622
- index_AllOrganizationsQuerySchemaOrganization as AllOrganizationsQuerySchemaOrganization,
1623
- index_AllOrganizationsQuerySchema as AllOrganizationsQuerySchema,
1624
- index_AllOrganizationsQuery as AllOrganizationsQuery,
1625
- index_CreateAppQuery as CreateAppQuery,
1626
- index_CreateAppQueryVariables as CreateAppQueryVariables,
1627
- index_CreateAppQuerySchema as CreateAppQuerySchema,
1628
- index_UpdateURLsQuery as UpdateURLsQuery,
1629
- index_UpdateURLsQueryVariables as UpdateURLsQueryVariables,
1630
- index_UpdateURLsQuerySchema as UpdateURLsQuerySchema,
1631
- index_FindAppQuery as FindAppQuery,
1632
- index_FindAppQuerySchema as FindAppQuerySchema,
1633
- index_ExtensionUpdateDraftMutation as ExtensionUpdateDraftMutation,
1634
- index_ExtensionUpdateDraftInput as ExtensionUpdateDraftInput,
1635
- index_ExtensionUpdateDraftPayload as ExtensionUpdateDraftPayload,
1636
- index_ExtensionVersion as ExtensionVersion,
1637
- index_ExtensionUpdateSchema as ExtensionUpdateSchema,
1638
- index_GenerateSignedUploadUrl as GenerateSignedUploadUrl,
1639
- index_GenerateSignedUploadUrlVariables as GenerateSignedUploadUrlVariables,
1640
- index_GenerateSignedUploadUrlSchema as GenerateSignedUploadUrlSchema,
1641
- index_CreateDeployment as CreateDeployment,
1642
- index_ExtensionSettings as ExtensionSettings,
1643
- index_CreateDeploymentVariables as CreateDeploymentVariables,
1644
- index_CreateDeploymentSchema as CreateDeploymentSchema,
1645
- index_AllStoresByOrganizationQuery as AllStoresByOrganizationQuery,
1646
- index_AllStoresByOrganizationSchema as AllStoresByOrganizationSchema,
1647
- index_ConvertDevToTestStoreQuery as ConvertDevToTestStoreQuery,
1648
- index_ConvertDevToTestStoreVariables as ConvertDevToTestStoreVariables,
1649
- index_ConvertDevToTestStoreSchema as ConvertDevToTestStoreSchema,
1650
- index_ExtensionCreateQuery as ExtensionCreateQuery,
1651
- index_ExtensionCreateVariables as ExtensionCreateVariables,
1652
- index_ExtensionCreateSchema as ExtensionCreateSchema,
1653
- index_ExtensionSpecificationsQuery as ExtensionSpecificationsQuery,
1654
- index_ExtensionSpecificationsQueryVariables as ExtensionSpecificationsQueryVariables,
1655
- index_ExtensionSpecificationsQuerySchema as ExtensionSpecificationsQuerySchema,
1656
- index_AllAppExtensionRegistrationsQuery as AllAppExtensionRegistrationsQuery,
1657
- index_AllAppExtensionRegistrationsQueryVariables as AllAppExtensionRegistrationsQueryVariables,
1658
- index_AllAppExtensionRegistrationsQuerySchema as AllAppExtensionRegistrationsQuerySchema,
1659
- index_FindProductVariantQuery as FindProductVariantQuery,
1660
- index_FindProductVariantSchema as FindProductVariantSchema,
1661
- index_ScriptServiceProxyQuery as ScriptServiceProxyQuery,
1662
- index_ScriptServiceProxyQuerySchema as ScriptServiceProxyQuerySchema,
1663
- index_GetAppFunctionsQuery as GetAppFunctionsQuery,
1664
- index_ModuleUploadUrlGenerateMutation as ModuleUploadUrlGenerateMutation,
1665
- index_ModuleUploadUrlGenerateMutationSchema as ModuleUploadUrlGenerateMutationSchema,
1666
- index_AppFunctionSetMutation as AppFunctionSetMutation,
1667
- index_AppFunctionSetMutationSchema as AppFunctionSetMutationSchema,
1668
- index_AppFunctionSetVariables as AppFunctionSetVariables,
1541
+ type github_GithubRelease = GithubRelease;
1542
+ declare const github_getLatestRelease: typeof getLatestRelease;
1543
+ declare const github_parseRepoUrl: typeof parseRepoUrl;
1544
+ type github_GithubRepoReference = GithubRepoReference;
1545
+ declare const github_parseGithubRepoReference: typeof parseGithubRepoReference;
1546
+ declare namespace github {
1547
+ export {
1548
+ github_GithubRelease as GithubRelease,
1549
+ github_getLatestRelease as getLatestRelease,
1550
+ github_parseRepoUrl as parseRepoUrl,
1551
+ github_GithubRepoReference as GithubRepoReference,
1552
+ github_parseGithubRepoReference as parseGithubRepoReference,
1669
1553
  };
1670
1554
  }
1671
1555
 
1672
- declare const api_admin: typeof admin;
1673
- declare const api_partners: typeof partners;
1674
- declare namespace api {
1556
+ declare function generate(suffix: string): string;
1557
+
1558
+ declare const haiku_generate: typeof generate;
1559
+ declare namespace haiku {
1675
1560
  export {
1676
- api_admin as admin,
1677
- api_partners as partners,
1678
- index as graphql,
1561
+ haiku_generate as generate,
1679
1562
  };
1680
1563
  }
1681
1564
 
@@ -1704,36 +1587,124 @@ declare namespace http {
1704
1587
  };
1705
1588
  }
1706
1589
 
1707
- declare function zip(inputDirectory: string, outputZipPath: string): Promise<void>;
1590
+ /**
1591
+ * Generates and returns a random UUID.
1592
+ * @returns {string} The random UUID generated.
1593
+ */
1594
+ declare const generateRandomUUID: () => string;
1595
+ declare const generateShortId: () => string;
1708
1596
 
1709
- declare const archiver_zip: typeof zip;
1710
- declare namespace archiver {
1597
+ declare const id_generateRandomUUID: typeof generateRandomUUID;
1598
+ declare const id_generateShortId: typeof generateShortId;
1599
+ declare namespace id {
1711
1600
  export {
1712
- archiver_zip as zip,
1601
+ id_generateRandomUUID as generateRandomUUID,
1602
+ id_generateShortId as generateShortId,
1713
1603
  };
1714
1604
  }
1715
1605
 
1716
- declare const InvalidChecksumError: ({ file, expected, got }: {
1717
- file: string;
1718
- expected: string;
1719
- got: string;
1720
- }) => Abort;
1606
+ interface JSON {
1607
+ [key: string]: JSONValue;
1608
+ }
1609
+ declare type JSONValue = string | number | boolean | JSON | JSONValue[];
1610
+ interface PackageJSON extends JSON {
1611
+ name: string;
1612
+ author: string;
1613
+ dependencies: {
1614
+ [key: string]: string;
1615
+ };
1616
+ devDependencies: {
1617
+ [key: string]: string;
1618
+ };
1619
+ resolutions: {
1620
+ [key: string]: string;
1621
+ };
1622
+ overrides: {
1623
+ [key: string]: string;
1624
+ };
1625
+ scripts: {
1626
+ [key: string]: string;
1627
+ };
1628
+ }
1629
+ declare function readPackageJSON(directory: string): Promise<PackageJSON>;
1630
+ declare function writePackageJSON(directory: string, packageJSON: JSON): Promise<void>;
1631
+ declare function updateAppData(packageJSON: JSON, name: string): Promise<void>;
1632
+
1633
+ type npm_PackageJSON = PackageJSON;
1634
+ declare const npm_readPackageJSON: typeof readPackageJSON;
1635
+ declare const npm_writePackageJSON: typeof writePackageJSON;
1636
+ declare const npm_updateAppData: typeof updateAppData;
1637
+ declare namespace npm {
1638
+ export {
1639
+ npm_PackageJSON as PackageJSON,
1640
+ npm_readPackageJSON as readPackageJSON,
1641
+ npm_writePackageJSON as writePackageJSON,
1642
+ npm_updateAppData as updateAppData,
1643
+ };
1644
+ }
1645
+
1646
+ declare const username: (platform?: typeof platform) => Promise<string | null>;
1721
1647
  /**
1722
- * Given a local file and a URL pointing to a remote file representing the MD5 of a local file,
1723
- * it validates the authenticity of the binary using an MD5 checksum.
1724
- * @param options: The file to validate and the URL that points to the file containing the MD5.
1648
+ * Returns the platform and architecture.
1649
+ * @returns {{platform: string, arch: string}} Returns the current platform and architecture.
1725
1650
  */
1726
- declare function validateMD5({ file, md5FileURL }: {
1727
- file: string;
1728
- md5FileURL: string;
1729
- }): Promise<void>;
1651
+ declare const platformAndArch: (platform?: typeof platform) => {
1652
+ platform: string;
1653
+ arch: string;
1654
+ };
1730
1655
 
1731
- declare const checksum_InvalidChecksumError: typeof InvalidChecksumError;
1732
- declare const checksum_validateMD5: typeof validateMD5;
1733
- declare namespace checksum {
1656
+ declare const os_username: typeof username;
1657
+ declare const os_platformAndArch: typeof platformAndArch;
1658
+ declare namespace os {
1734
1659
  export {
1735
- checksum_InvalidChecksumError as InvalidChecksumError,
1736
- checksum_validateMD5 as validateMD5,
1660
+ os_username as username,
1661
+ os_platformAndArch as platformAndArch,
1662
+ };
1663
+ }
1664
+
1665
+ /**
1666
+ * Given an absolute filesystem path, it makes it relative to
1667
+ * the current working directory. This is useful when logging paths
1668
+ * to allow the users to click on the file and let the OS open it
1669
+ * in the editor of choice.
1670
+ * @param path {string} Path to relativize
1671
+ * @returns {string} Relativized path.
1672
+ */
1673
+ declare function relativize(path: string): string;
1674
+
1675
+ var path = /*#__PURE__*/_mergeNamespaces({
1676
+ __proto__: null,
1677
+ relativize: relativize,
1678
+ findUp: findUp,
1679
+ glob: fastGlob,
1680
+ pathToFileURL: pathToFileURL
1681
+ }, [pathe]);
1682
+
1683
+ interface TunnelPlugin {
1684
+ start: (options: TunnelStartOptions) => Promise<string>;
1685
+ }
1686
+ interface TunnelStartOptions {
1687
+ port: number;
1688
+ }
1689
+ declare function lookupTunnelPlugin(plugins: Plugin[]): Promise<TunnelPlugin | undefined>;
1690
+
1691
+ declare const plugins_lookupTunnelPlugin: typeof lookupTunnelPlugin;
1692
+ declare namespace plugins {
1693
+ export {
1694
+ plugins_lookupTunnelPlugin as lookupTunnelPlugin,
1695
+ };
1696
+ }
1697
+
1698
+ /**
1699
+ * Returns an available port in the current environment.
1700
+ * @returns {Promise<number>} A promise that resolves with an availabe port.
1701
+ */
1702
+ declare function getRandomPort(): Promise<number>;
1703
+
1704
+ declare const port_getRandomPort: typeof getRandomPort;
1705
+ declare namespace port {
1706
+ export {
1707
+ port_getRandomPort as getRandomPort,
1737
1708
  };
1738
1709
  }
1739
1710
 
@@ -1753,16 +1724,21 @@ interface ExecThemeCheckCLIOptions {
1753
1724
  stderr: Writable;
1754
1725
  }
1755
1726
  declare function execThemeCheckCLI({ directories, args, stdout, stderr, }: ExecThemeCheckCLIOptions): Promise<void[]>;
1756
- declare function version(): Promise<string | undefined>;
1727
+ declare function version$1(): Promise<string | undefined>;
1757
1728
 
1758
1729
  declare const ruby_execCLI: typeof execCLI;
1759
1730
  declare const ruby_execThemeCheckCLI: typeof execThemeCheckCLI;
1760
- declare const ruby_version: typeof version;
1761
1731
  declare namespace ruby {
1762
1732
  export {
1763
1733
  ruby_execCLI as execCLI,
1764
1734
  ruby_execThemeCheckCLI as execThemeCheckCLI,
1765
- ruby_version as version,
1735
+ version$1 as version,
1736
+ };
1737
+ }
1738
+
1739
+ declare namespace schema {
1740
+ export {
1741
+ z as define,
1766
1742
  };
1767
1743
  }
1768
1744
 
@@ -1774,87 +1750,170 @@ declare namespace semver {
1774
1750
  };
1775
1751
  }
1776
1752
 
1777
- interface JSON {
1778
- [key: string]: JSONValue;
1753
+ interface CachedAppInfo {
1754
+ directory: string;
1755
+ appId: string;
1756
+ title?: string;
1757
+ orgId?: string;
1758
+ storeFqdn?: string;
1779
1759
  }
1780
- declare type JSONValue = string | number | boolean | JSON | JSONValue[];
1781
- interface PackageJSON extends JSON {
1782
- name: string;
1783
- author: string;
1784
- dependencies: {
1785
- [key: string]: string;
1786
- };
1787
- devDependencies: {
1788
- [key: string]: string;
1789
- };
1790
- resolutions: {
1791
- [key: string]: string;
1792
- };
1793
- overrides: {
1794
- [key: string]: string;
1795
- };
1796
- scripts: {
1797
- [key: string]: string;
1798
- };
1760
+ interface ConfSchema {
1761
+ appInfo: CachedAppInfo[];
1762
+ themeStore: string;
1799
1763
  }
1800
- declare function readPackageJSON(directory: string): Promise<PackageJSON>;
1801
- declare function writePackageJSON(directory: string, packageJSON: JSON): Promise<void>;
1802
- declare function updateAppData(packageJSON: JSON, name: string): Promise<void>;
1764
+ declare const cliKit: Conf<ConfSchema>;
1765
+ declare function getAppInfo(directory: string): CachedAppInfo | undefined;
1766
+ declare function setAppInfo(options: {
1767
+ directory: string;
1768
+ appId: string;
1769
+ title?: string;
1770
+ storeFqdn?: string;
1771
+ orgId?: string;
1772
+ }): void;
1773
+ declare function clearAppInfo(directory: string): void;
1774
+ declare function getThemeStore(): string | undefined;
1775
+ declare function setThemeStore(store: string): void;
1803
1776
 
1804
- type npm_PackageJSON = PackageJSON;
1805
- declare const npm_readPackageJSON: typeof readPackageJSON;
1806
- declare const npm_writePackageJSON: typeof writePackageJSON;
1807
- declare const npm_updateAppData: typeof updateAppData;
1808
- declare namespace npm {
1777
+ type store_CachedAppInfo = CachedAppInfo;
1778
+ declare const store_cliKit: typeof cliKit;
1779
+ declare const store_getAppInfo: typeof getAppInfo;
1780
+ declare const store_setAppInfo: typeof setAppInfo;
1781
+ declare const store_clearAppInfo: typeof clearAppInfo;
1782
+ declare const store_getThemeStore: typeof getThemeStore;
1783
+ declare const store_setThemeStore: typeof setThemeStore;
1784
+ declare namespace store {
1809
1785
  export {
1810
- npm_PackageJSON as PackageJSON,
1811
- npm_readPackageJSON as readPackageJSON,
1812
- npm_writePackageJSON as writePackageJSON,
1813
- npm_updateAppData as updateAppData,
1786
+ store_CachedAppInfo as CachedAppInfo,
1787
+ store_cliKit as cliKit,
1788
+ store_getAppInfo as getAppInfo,
1789
+ store_setAppInfo as setAppInfo,
1790
+ store_clearAppInfo as clearAppInfo,
1791
+ store_getThemeStore as getThemeStore,
1792
+ store_setThemeStore as setThemeStore,
1793
+ };
1794
+ }
1795
+
1796
+ /** Returns a random string */
1797
+ declare function randomHex(size: number): string;
1798
+ declare function generateRandomChallengePair(): {
1799
+ codeVerifier: string;
1800
+ codeChallenge: string;
1801
+ };
1802
+ /**
1803
+ * Given a string, it returns it with the first letter capitalized.
1804
+ * @param string {string} String whose first letter will be caplitalized.
1805
+ * @returns The given string with its first letter capitalized.
1806
+ */
1807
+ declare function capitalize(string: string): string;
1808
+ /**
1809
+ * Given a store, returns a valid store fqdn removing protocol and adding .myshopify.com domain
1810
+ * @param store Original store name provided by the user
1811
+ * @returns a valid store fqdn
1812
+ */
1813
+ declare function normalizeStoreName(store: string): string;
1814
+
1815
+ declare const string_randomHex: typeof randomHex;
1816
+ declare const string_generateRandomChallengePair: typeof generateRandomChallengePair;
1817
+ declare const string_capitalize: typeof capitalize;
1818
+ declare const string_normalizeStoreName: typeof normalizeStoreName;
1819
+ declare namespace string {
1820
+ export {
1821
+ string_randomHex as randomHex,
1822
+ string_generateRandomChallengePair as generateRandomChallengePair,
1823
+ string_capitalize as capitalize,
1824
+ string_normalizeStoreName as normalizeStoreName,
1825
+ camelCase as camelize,
1826
+ paramCase as hyphenize,
1827
+ snakeCase as underscore,
1828
+ constantCase as constantize,
1814
1829
  };
1815
1830
  }
1816
1831
 
1832
+ interface ExecOptions {
1833
+ cwd?: string;
1834
+ env?: {
1835
+ [key: string]: string | undefined;
1836
+ };
1837
+ stdout?: Writable | 'inherit';
1838
+ stderr?: Writable;
1839
+ stdin?: string;
1840
+ signal?: AbortSignal;
1841
+ }
1842
+ declare type WritableExecOptions = Omit<ExecOptions, 'stdout'> & {
1843
+ stdout?: Writable;
1844
+ };
1845
+ declare const open: (url: string) => Promise<void>;
1817
1846
  /**
1818
- * Returns an available port in the current environment.
1819
- * @returns {Promise<number>} A promise that resolves with an availabe port.
1847
+ * Runs a command asynchronously, aggregates the stdout data, and returns it.
1848
+ * @param command {string} Command to be executed.
1849
+ * @param args {string[]} Arguments to pass to the command.
1850
+ * @returns A promise that resolves with the aggregatted stdout of the command.
1820
1851
  */
1821
- declare function getRandomPort(): Promise<number>;
1822
-
1823
- declare const port_getRandomPort: typeof getRandomPort;
1824
- declare namespace port {
1825
- export {
1826
- port_getRandomPort as getRandomPort,
1827
- };
1852
+ declare const captureOutput: (command: string, args: string[], options?: ExecOptions) => Promise<string>;
1853
+ declare const exec: (command: string, args: string[], options?: ExecOptions) => Promise<void>;
1854
+ interface ConcurrentExecCommand {
1855
+ prefix: string;
1856
+ executable: string;
1857
+ args: string[];
1858
+ cwd: string;
1828
1859
  }
1829
-
1830
1860
  /**
1831
- * An object that contains the flags that
1832
- * are shared across all the commands.
1861
+ * Runs commands concurrently and combines the standard output and error data
1862
+ * into a single stream that differenciates the sources using a colored prefix:
1863
+ *
1864
+ * Example:
1865
+ * [my-extension] Log coming from my-extension
1866
+ * [my-script] Log coming from my script
1867
+ *
1868
+ * If one of the processes fails, it aborts the running ones and exits with that error.
1869
+ * @param commands {ConcurrentExecCommand[]} Commands to execute.
1833
1870
  */
1834
- declare const globalFlags: {
1835
- verbose: _oclif_core_lib_interfaces.BooleanFlag<boolean>;
1836
- };
1871
+ declare const concurrentExec: (commands: ConcurrentExecCommand[]) => Promise<void>;
1872
+ /**
1873
+ * Displays a large file using the terminal pager set by the user, or a
1874
+ * reasonable default for the user's OS:
1875
+ *
1876
+ * @param filename string The path to the file to be displayed.
1877
+ */
1878
+ declare function page(filename: string): Promise<void>;
1837
1879
 
1838
- declare const cli_globalFlags: typeof globalFlags;
1839
- declare namespace cli {
1880
+ type system_ExecOptions = ExecOptions;
1881
+ type system_WritableExecOptions = WritableExecOptions;
1882
+ declare const system_open: typeof open;
1883
+ declare const system_captureOutput: typeof captureOutput;
1884
+ declare const system_exec: typeof exec;
1885
+ declare const system_concurrentExec: typeof concurrentExec;
1886
+ declare const system_page: typeof page;
1887
+ declare namespace system {
1840
1888
  export {
1841
- cli_globalFlags as globalFlags,
1889
+ system_ExecOptions as ExecOptions,
1890
+ system_WritableExecOptions as WritableExecOptions,
1891
+ system_open as open,
1892
+ system_captureOutput as captureOutput,
1893
+ system_exec as exec,
1894
+ system_concurrentExec as concurrentExec,
1895
+ system_page as page,
1842
1896
  };
1843
1897
  }
1844
1898
 
1899
+ declare function create(templateContent: string): (data: object) => Promise<string>;
1845
1900
  /**
1846
- * Generates and returns a random UUID.
1847
- * @returns {string} The random UUID generated.
1901
+ * Given a directory, it traverses the files and directories recursively
1902
+ * and replaces variables in directory and file names, and files' content
1903
+ * using the Liquid template engine.
1904
+ * Files indicate that they are liquid template by using the .liquid extension.
1905
+ * @param from {string} Directory that contains the template.
1906
+ * @param to {string} Output directory.
1907
+ * @param data {string} Data to feed the template engine.
1848
1908
  */
1849
- declare const generateRandomUUID: () => string;
1850
- declare const generateShortId: () => string;
1909
+ declare function recursiveDirectoryCopy(from: string, to: string, data: object): Promise<void>;
1851
1910
 
1852
- declare const id_generateRandomUUID: typeof generateRandomUUID;
1853
- declare const id_generateShortId: typeof generateShortId;
1854
- declare namespace id {
1911
+ declare const template_create: typeof create;
1912
+ declare const template_recursiveDirectoryCopy: typeof recursiveDirectoryCopy;
1913
+ declare namespace template {
1855
1914
  export {
1856
- id_generateRandomUUID as generateRandomUUID,
1857
- id_generateShortId as generateShortId,
1915
+ template_create as create,
1916
+ template_recursiveDirectoryCopy as recursiveDirectoryCopy,
1858
1917
  };
1859
1918
  }
1860
1919
 
@@ -1872,111 +1931,92 @@ declare namespace temporary {
1872
1931
  };
1873
1932
  }
1874
1933
 
1875
- /**
1876
- * Error that's thrown when the .env is not found.
1877
- * @param path {string} Path to the .env file.
1878
- * @returns {Abort} An abort error.
1879
- */
1880
- declare const DotEnvNotFoundError: (path: string) => Abort;
1881
- /**
1882
- * This interface represents a .env file.
1883
- */
1884
- interface DotEnvFile {
1885
- /**
1886
- * Path to the .env file.
1887
- */
1888
- path: string;
1889
- /**
1890
- * Variables of the .env file.
1891
- */
1892
- variables: {
1893
- [name: string]: string;
1894
- };
1895
- }
1896
- declare function read(path: string): Promise<DotEnvFile>;
1897
- /**
1898
- * Writes a .env file to disk.
1899
- * @param file {DotEnvFile} .env file to be written.
1900
- */
1901
- declare function write(file: DotEnvFile): Promise<void>;
1934
+ declare function decode$1(input: string): object;
1935
+ declare function encode$1(content: toml$1.JsonMap): string;
1902
1936
 
1903
- declare const dotEnv_DotEnvNotFoundError: typeof DotEnvNotFoundError;
1904
- type dotEnv_DotEnvFile = DotEnvFile;
1905
- declare const dotEnv_read: typeof read;
1906
- declare const dotEnv_write: typeof write;
1907
- declare namespace dotEnv {
1937
+ declare namespace toml {
1908
1938
  export {
1909
- dotEnv_DotEnvNotFoundError as DotEnvNotFoundError,
1910
- dotEnv_DotEnvFile as DotEnvFile,
1911
- dotEnv_read as read,
1912
- dotEnv_write as write,
1939
+ decode$1 as decode,
1940
+ encode$1 as encode,
1913
1941
  };
1914
1942
  }
1915
1943
 
1916
- declare namespace abort {
1917
- export {
1918
- AbortController as Controller,
1919
- AbortSignal as Signal,
1920
- };
1944
+ interface BaseQuestion<TName extends string> {
1945
+ name: TName;
1946
+ message: string;
1947
+ preface?: string;
1948
+ validate?: (value: string) => string | true;
1949
+ default?: string;
1950
+ result?: (value: string) => string | boolean;
1921
1951
  }
1922
-
1923
- declare const constants: {
1924
- environmentVariables: {
1925
- unitTest: string;
1926
- shopifyConfig: string;
1927
- runAsUser: string;
1928
- partnersEnv: string;
1929
- shopifyEnv: string;
1930
- identityEnv: string;
1931
- spin: string;
1932
- spinInstance: string;
1933
- spinWorkspace: string;
1934
- spinNamespace: string;
1935
- spinHost: string;
1936
- partnersToken: string;
1937
- verbose: string;
1938
- noAnalytics: string;
1939
- };
1940
- paths: {
1941
- executables: {
1942
- dev: string;
1943
- };
1944
- directories: {
1945
- cache: {
1946
- path: () => string;
1947
- vendor: {
1948
- path: () => string;
1949
- binaries: () => string;
1950
- };
1951
- };
1952
- };
1953
- };
1954
- /**
1955
- * Versions are resolved at build time by Rollup's JSON plugin.
1956
- */
1957
- versions: {
1958
- cliKit: string;
1959
- };
1960
- keychain: {
1961
- service: string;
1962
- };
1963
- session: {
1964
- expirationTimeMarginInMinutes: number;
1965
- };
1952
+ declare type InputQuestion<TName extends string> = BaseQuestion<TName> & {
1953
+ type: 'input';
1954
+ };
1955
+ declare type SelectQuestion<TName extends string> = BaseQuestion<TName> & {
1956
+ type: 'select';
1957
+ choices: string[] | {
1958
+ name: string;
1959
+ value: string;
1960
+ }[];
1961
+ };
1962
+ declare type AutocompleteQuestion<TName extends string> = BaseQuestion<TName> & {
1963
+ type: 'autocomplete';
1964
+ choices: string[] | {
1965
+ name: string;
1966
+ value: string;
1967
+ }[];
1968
+ };
1969
+ declare type PasswordQuestion<TName extends string> = BaseQuestion<TName> & {
1970
+ type: 'password';
1966
1971
  };
1972
+ declare type Question<TName extends string = string> = InputQuestion<TName> | SelectQuestion<TName> | AutocompleteQuestion<TName> | PasswordQuestion<TName>;
1973
+ declare const prompt: <TName extends string & keyof TAnswers, TAnswers extends { [key in TName]: string; } = { [key_1 in TName]: string; }>(questions: readonly Question<TName>[], debugForceInquirer?: boolean) => Promise<TAnswers>;
1974
+ declare function nonEmptyDirectoryPrompt(directory: string): Promise<void>;
1975
+ declare const keypress: () => Promise<void>;
1967
1976
 
1968
- interface TunnelPlugin {
1969
- start: (options: TunnelStartOptions) => Promise<string>;
1970
- }
1971
- interface TunnelStartOptions {
1972
- port: number;
1977
+ type ui_InputQuestion<TName extends string> = InputQuestion<TName>;
1978
+ type ui_SelectQuestion<TName extends string> = SelectQuestion<TName>;
1979
+ type ui_AutocompleteQuestion<TName extends string> = AutocompleteQuestion<TName>;
1980
+ type ui_PasswordQuestion<TName extends string> = PasswordQuestion<TName>;
1981
+ type ui_Question<TName extends string = string> = Question<TName>;
1982
+ declare const ui_prompt: typeof prompt;
1983
+ declare const ui_nonEmptyDirectoryPrompt: typeof nonEmptyDirectoryPrompt;
1984
+ declare const ui_keypress: typeof keypress;
1985
+ declare const ui_Listr: typeof Listr;
1986
+ declare const ui_ListrTaskWrapper: typeof ListrTaskWrapper;
1987
+ declare const ui_ListrDefaultRenderer: typeof ListrDefaultRenderer;
1988
+ declare const ui_ListrTask: typeof ListrTask;
1989
+ declare namespace ui {
1990
+ export {
1991
+ ui_InputQuestion as InputQuestion,
1992
+ ui_SelectQuestion as SelectQuestion,
1993
+ ui_AutocompleteQuestion as AutocompleteQuestion,
1994
+ ui_PasswordQuestion as PasswordQuestion,
1995
+ ui_Question as Question,
1996
+ ui_prompt as prompt,
1997
+ ui_nonEmptyDirectoryPrompt as nonEmptyDirectoryPrompt,
1998
+ ui_keypress as keypress,
1999
+ ui_Listr as Listr,
2000
+ ui_ListrTaskWrapper as ListrTaskWrapper,
2001
+ ui_ListrDefaultRenderer as ListrDefaultRenderer,
2002
+ ui_ListrTask as ListrTask,
2003
+ };
1973
2004
  }
1974
- declare function lookupTunnelPlugin(plugins: Plugin[]): Promise<TunnelPlugin | undefined>;
1975
2005
 
1976
- declare const plugins_lookupTunnelPlugin: typeof lookupTunnelPlugin;
1977
- declare namespace plugins {
2006
+ /**
2007
+ * Returns the latest available version of an NPM package.
2008
+ * @param name {string} The name of the NPM package.
2009
+ * @returns A promise to get the latest available version of a package.
2010
+ */
2011
+ declare function latestNpmPackageVersion(name: string): Promise<string>;
2012
+ declare function cliVersion(): string;
2013
+
2014
+ declare const version_latestNpmPackageVersion: typeof latestNpmPackageVersion;
2015
+ declare const version_cliVersion: typeof cliVersion;
2016
+ declare namespace version {
1978
2017
  export {
1979
- plugins_lookupTunnelPlugin as lookupTunnelPlugin,
2018
+ version_latestNpmPackageVersion as latestNpmPackageVersion,
2019
+ version_cliVersion as cliVersion,
1980
2020
  };
1981
2021
  }
1982
2022
 
@@ -1998,5 +2038,17 @@ declare namespace vscode {
1998
2038
  };
1999
2039
  }
2000
2040
 
2001
- export { abort, api, archiver, checksum, cli, constants, dependency, dotEnv as dotenv, environment, error, file, git, github, haiku, http, id, npm, os, output, path, plugins, port, ruby, schema, semver, session, store, string, system, template, temporary, toml, ui, version$1 as version, vscode, yaml };
2041
+ declare function decode(input: string): unknown;
2042
+ declare function encode(content: unknown): string;
2043
+
2044
+ declare const yaml_decode: typeof decode;
2045
+ declare const yaml_encode: typeof encode;
2046
+ declare namespace yaml {
2047
+ export {
2048
+ yaml_decode as decode,
2049
+ yaml_encode as encode,
2050
+ };
2051
+ }
2052
+
2053
+ export { abort, analytics, api, archiver, checksum, cli, constants, dependency, dotEnv as dotenv, environment, error, file, git, github, haiku, http, id, npm, os, output, path, plugins, port, ruby, schema, semver, session, store, string, system, template, temporary, toml, ui, version, vscode, yaml };
2002
2054
  //# sourceMappingURL=index.d.ts.map