@shopify/cli-kit 3.0.15 → 3.0.18

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