@shopify/cli-kit 3.0.17 → 3.0.20

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