@shopify/cli-kit 3.0.16 → 3.0.19

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