@shopify/cli-kit 0.30.1 → 0.31.3
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/CHANGELOG.md +19 -0
- package/dist/{index-0360f23d.js → index-80382e6b.js} +97024 -1398
- package/dist/index-80382e6b.js.map +1 -0
- package/dist/index.d.ts +150 -357
- package/dist/index.js +3 -1
- package/dist/index.js.map +1 -1
- package/dist/{multipart-parser-580f5b8c.js → multipart-parser-54cbb259.js} +4 -2
- package/dist/multipart-parser-54cbb259.js.map +1 -0
- package/package.json +7 -3
- package/dist/index-0360f23d.js.map +0 -1
- package/dist/multipart-parser-580f5b8c.js.map +0 -1
package/dist/index.d.ts
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
/// <reference types="node" />
|
|
2
2
|
import { Writable } from 'node:stream';
|
|
3
|
+
import open from 'open';
|
|
3
4
|
import path$1 from 'path';
|
|
4
5
|
import * as fs from 'fs';
|
|
5
6
|
import { EventEmitter } from 'events';
|
|
@@ -101,15 +102,36 @@ declare const exec: (command: string, args: string[], options?: ExecOptions | un
|
|
|
101
102
|
type system_ExecOptions = ExecOptions;
|
|
102
103
|
declare const system_captureOutput: typeof captureOutput;
|
|
103
104
|
declare const system_exec: typeof exec;
|
|
105
|
+
declare const system_open: typeof open;
|
|
104
106
|
declare namespace system {
|
|
105
107
|
export {
|
|
106
108
|
system_ExecOptions as ExecOptions,
|
|
107
109
|
system_captureOutput as captureOutput,
|
|
108
110
|
system_exec as exec,
|
|
111
|
+
system_open as open,
|
|
109
112
|
};
|
|
110
113
|
}
|
|
111
114
|
|
|
112
|
-
declare function
|
|
115
|
+
declare function create(templateContent: string): (data: object) => Promise<string>;
|
|
116
|
+
/**
|
|
117
|
+
* Given a directory, it traverses the files and directories recursively
|
|
118
|
+
* and replaces variables in directory and file names, and files' content
|
|
119
|
+
* using the Liquid template engine.
|
|
120
|
+
* Files indicate that they are liquid template by using the .liquid extension.
|
|
121
|
+
* @param from {string} Directory that contains the template.
|
|
122
|
+
* @param to {string} Output directory.
|
|
123
|
+
* @param data {string} Data to feed the template engine.
|
|
124
|
+
*/
|
|
125
|
+
declare function recursiveDirectoryCopy(from: string, to: string, data: any): Promise<void>;
|
|
126
|
+
|
|
127
|
+
declare const template_create: typeof create;
|
|
128
|
+
declare const template_recursiveDirectoryCopy: typeof recursiveDirectoryCopy;
|
|
129
|
+
declare namespace template {
|
|
130
|
+
export {
|
|
131
|
+
template_create as create,
|
|
132
|
+
template_recursiveDirectoryCopy as recursiveDirectoryCopy,
|
|
133
|
+
};
|
|
134
|
+
}
|
|
113
135
|
|
|
114
136
|
interface Options$4 {
|
|
115
137
|
splitRegexp?: RegExp | RegExp[];
|
|
@@ -122,8 +144,13 @@ declare function camelCase(input: string, options?: Options$4): string;
|
|
|
122
144
|
|
|
123
145
|
declare function paramCase(input: string, options?: Options$4): string;
|
|
124
146
|
|
|
147
|
+
/** Returns a random string */
|
|
148
|
+
declare function randomHex(size: number): string;
|
|
149
|
+
|
|
150
|
+
declare const string_randomHex: typeof randomHex;
|
|
125
151
|
declare namespace string {
|
|
126
152
|
export {
|
|
153
|
+
string_randomHex as randomHex,
|
|
127
154
|
camelCase as camelize,
|
|
128
155
|
paramCase as hyphenize,
|
|
129
156
|
};
|
|
@@ -490,7 +517,19 @@ declare namespace path {
|
|
|
490
517
|
};
|
|
491
518
|
}
|
|
492
519
|
|
|
520
|
+
/**
|
|
521
|
+
* It reads a file and returns its content as a string using the
|
|
522
|
+
* utf-8 encoding
|
|
523
|
+
* @param path {string} Path to the file to read.
|
|
524
|
+
* @returns {Promise<string>} A promise that resolves with the content of the file.
|
|
525
|
+
*/
|
|
493
526
|
declare function read(path: string): Promise<string>;
|
|
527
|
+
/**
|
|
528
|
+
* Copies a file
|
|
529
|
+
* @param from {string} Path to the directory or file to be copied.
|
|
530
|
+
* @param to {string} Destination path.
|
|
531
|
+
*/
|
|
532
|
+
declare function copy(from: string, to: string): Promise<void>;
|
|
494
533
|
declare function write(path: string, data: string): Promise<void>;
|
|
495
534
|
declare function mkdir(path: string): Promise<void>;
|
|
496
535
|
declare function rmdir(path: string): Promise<void>;
|
|
@@ -499,6 +538,7 @@ declare function isDirectory(path: string): Promise<boolean>;
|
|
|
499
538
|
declare function exists(path: string): Promise<boolean>;
|
|
500
539
|
|
|
501
540
|
declare const file_read: typeof read;
|
|
541
|
+
declare const file_copy: typeof copy;
|
|
502
542
|
declare const file_write: typeof write;
|
|
503
543
|
declare const file_mkdir: typeof mkdir;
|
|
504
544
|
declare const file_rmdir: typeof rmdir;
|
|
@@ -508,6 +548,7 @@ declare const file_exists: typeof exists;
|
|
|
508
548
|
declare namespace file {
|
|
509
549
|
export {
|
|
510
550
|
file_read as read,
|
|
551
|
+
file_copy as copy,
|
|
511
552
|
file_write as write,
|
|
512
553
|
file_mkdir as mkdir,
|
|
513
554
|
file_rmdir as rmdir,
|
|
@@ -658,7 +699,7 @@ declare enum Environment {
|
|
|
658
699
|
* Returns the environment to be used for the interactions with the partners' CLI API.
|
|
659
700
|
* @param env The environment variables from the environment of the current process.
|
|
660
701
|
*/
|
|
661
|
-
declare function partners$
|
|
702
|
+
declare function partners$2(env?: NodeJS.ProcessEnv): Environment;
|
|
662
703
|
/**
|
|
663
704
|
* Returns the environment to be used for the interactions with the admin API.
|
|
664
705
|
* @param env The environment variables from the environment of the current process.
|
|
@@ -672,7 +713,7 @@ declare function identity$1(env?: NodeJS.ProcessEnv): Environment;
|
|
|
672
713
|
|
|
673
714
|
declare namespace service {
|
|
674
715
|
export {
|
|
675
|
-
partners$
|
|
716
|
+
partners$2 as partners,
|
|
676
717
|
shopify$1 as shopify,
|
|
677
718
|
identity$1 as identity,
|
|
678
719
|
};
|
|
@@ -686,7 +727,7 @@ declare const NotProvidedStoreFQDNError: Abort;
|
|
|
686
727
|
* It returns the Partners' API service we should interact with.
|
|
687
728
|
* @returns {string} Fully-qualified domain of the partners service we should interact with.
|
|
688
729
|
*/
|
|
689
|
-
declare function partners(): Promise<string>;
|
|
730
|
+
declare function partners$1(): Promise<string>;
|
|
690
731
|
/**
|
|
691
732
|
* It returns the Identity service we should interact with.
|
|
692
733
|
* @returns {string} Fully-qualified domain of the Identity service we should interact with.
|
|
@@ -705,7 +746,6 @@ declare const fqdn_CouldntObtainPartnersSpinFQDNError: typeof CouldntObtainPartn
|
|
|
705
746
|
declare const fqdn_CouldntObtainIdentitySpinFQDNError: typeof CouldntObtainIdentitySpinFQDNError;
|
|
706
747
|
declare const fqdn_CouldntObtainShopifySpinFQDNError: typeof CouldntObtainShopifySpinFQDNError;
|
|
707
748
|
declare const fqdn_NotProvidedStoreFQDNError: typeof NotProvidedStoreFQDNError;
|
|
708
|
-
declare const fqdn_partners: typeof partners;
|
|
709
749
|
declare const fqdn_identity: typeof identity;
|
|
710
750
|
declare const fqdn_shopify: typeof shopify;
|
|
711
751
|
declare namespace fqdn {
|
|
@@ -714,7 +754,7 @@ declare namespace fqdn {
|
|
|
714
754
|
fqdn_CouldntObtainIdentitySpinFQDNError as CouldntObtainIdentitySpinFQDNError,
|
|
715
755
|
fqdn_CouldntObtainShopifySpinFQDNError as CouldntObtainShopifySpinFQDNError,
|
|
716
756
|
fqdn_NotProvidedStoreFQDNError as NotProvidedStoreFQDNError,
|
|
717
|
-
|
|
757
|
+
partners$1 as partners,
|
|
718
758
|
fqdn_identity as identity,
|
|
719
759
|
fqdn_shopify as shopify,
|
|
720
760
|
};
|
|
@@ -731,6 +771,61 @@ declare namespace environment {
|
|
|
731
771
|
};
|
|
732
772
|
}
|
|
733
773
|
|
|
774
|
+
/**
|
|
775
|
+
* A scope supported by the Shopify Admin API.
|
|
776
|
+
*/
|
|
777
|
+
declare type AdminAPIScope = 'graphql' | 'themes' | 'collaborator' | string;
|
|
778
|
+
/**
|
|
779
|
+
* It represents the options to authenticate against the Shopify Admin API.
|
|
780
|
+
*/
|
|
781
|
+
interface AdminAPIOAuthOptions {
|
|
782
|
+
/** List of scopes to request permissions for */
|
|
783
|
+
scopes: AdminAPIScope[];
|
|
784
|
+
}
|
|
785
|
+
/**
|
|
786
|
+
* A scope supported by the Partners API.
|
|
787
|
+
*/
|
|
788
|
+
declare type PartnersAPIScope = 'cli' | string;
|
|
789
|
+
interface PartnersAPIOAuthOptions {
|
|
790
|
+
/** List of scopes to request permissions for */
|
|
791
|
+
scopes: PartnersAPIScope[];
|
|
792
|
+
}
|
|
793
|
+
/**
|
|
794
|
+
* A scope supported by the Storefront Renderer API.
|
|
795
|
+
*/
|
|
796
|
+
declare type StorefrontRendererScope = 'devtools' | string;
|
|
797
|
+
interface StorefrontRendererAPIOAuthOptions {
|
|
798
|
+
/** List of scopes to request permissions for */
|
|
799
|
+
scopes: StorefrontRendererScope[];
|
|
800
|
+
}
|
|
801
|
+
interface ShopifyOAuthOptions {
|
|
802
|
+
storeFqdn?: string;
|
|
803
|
+
storefrontRendererApi?: StorefrontRendererAPIOAuthOptions;
|
|
804
|
+
adminApi?: AdminAPIOAuthOptions;
|
|
805
|
+
}
|
|
806
|
+
/**
|
|
807
|
+
* It represents the authentication requirements and
|
|
808
|
+
* is the input necessary to trigger the authentication
|
|
809
|
+
* flow.
|
|
810
|
+
*/
|
|
811
|
+
interface OAuthApplications {
|
|
812
|
+
shopify?: ShopifyOAuthOptions;
|
|
813
|
+
partnersApi?: PartnersAPIOAuthOptions;
|
|
814
|
+
}
|
|
815
|
+
/**
|
|
816
|
+
* This method ensures that we have a valid session to authenticate against the given applications using the provided scopes.
|
|
817
|
+
* @param options {OAuthApplications} An object containing the applications we need to be authenticated with.
|
|
818
|
+
* @returns {OAuthSession} An instance with the access tokens organized by application.
|
|
819
|
+
*/
|
|
820
|
+
declare function ensureAuthenticated(applications: OAuthApplications): Promise<void>;
|
|
821
|
+
|
|
822
|
+
declare const session_ensureAuthenticated: typeof ensureAuthenticated;
|
|
823
|
+
declare namespace session {
|
|
824
|
+
export {
|
|
825
|
+
session_ensureAuthenticated as ensureAuthenticated,
|
|
826
|
+
};
|
|
827
|
+
}
|
|
828
|
+
|
|
734
829
|
declare namespace util {
|
|
735
830
|
type AssertEqual<T, Expected> = [T] extends [Expected] ? [Expected] extends [T] ? true : false : false;
|
|
736
831
|
function assertNever(_x: never): never;
|
|
@@ -2057,356 +2152,6 @@ declare namespace schema {
|
|
|
2057
2152
|
};
|
|
2058
2153
|
}
|
|
2059
2154
|
|
|
2060
|
-
/**
|
|
2061
|
-
* This schema represents the format of the session
|
|
2062
|
-
* that we cache in the system to avoid unnecessary
|
|
2063
|
-
* token exchanges.
|
|
2064
|
-
*
|
|
2065
|
-
* @example
|
|
2066
|
-
* {
|
|
2067
|
-
* "accounts.shopify.com": {...}
|
|
2068
|
-
* "identity.spin.com": {...}
|
|
2069
|
-
* }
|
|
2070
|
-
*
|
|
2071
|
-
*/
|
|
2072
|
-
declare const SessionSchema: ZodObject<{}, "strip", ZodObject<{
|
|
2073
|
-
/**
|
|
2074
|
-
* It contains the identity token. Before usint it, we exchange it
|
|
2075
|
-
* to get a token that we can use with different applications. The exchanged
|
|
2076
|
-
* tokens for the applications are stored under applications.
|
|
2077
|
-
*/
|
|
2078
|
-
identity: ZodObject<{
|
|
2079
|
-
accessToken: ZodString;
|
|
2080
|
-
refreshToken: ZodString;
|
|
2081
|
-
expiresAt: ZodEffects<ZodDate, Date, Date>;
|
|
2082
|
-
scopes: ZodArray<ZodString, "many">;
|
|
2083
|
-
}, "strip", ZodTypeAny, {
|
|
2084
|
-
accessToken: string;
|
|
2085
|
-
refreshToken: string;
|
|
2086
|
-
expiresAt: Date;
|
|
2087
|
-
scopes: string[];
|
|
2088
|
-
}, {
|
|
2089
|
-
accessToken: string;
|
|
2090
|
-
refreshToken: string;
|
|
2091
|
-
expiresAt: Date;
|
|
2092
|
-
scopes: string[];
|
|
2093
|
-
}>;
|
|
2094
|
-
/**
|
|
2095
|
-
* It contains exchanged tokens for the applications the CLI
|
|
2096
|
-
* authenticates with. Tokens are scoped under the fqdn of the applications.
|
|
2097
|
-
*/
|
|
2098
|
-
applications: ZodObject<{
|
|
2099
|
-
/**
|
|
2100
|
-
* Exchanged tokens for Admin applications.
|
|
2101
|
-
*/
|
|
2102
|
-
adminApi: ZodObject<{}, "strip", ZodObject<{
|
|
2103
|
-
accessToken: ZodString;
|
|
2104
|
-
expiresAt: ZodEffects<ZodDate, Date, Date>;
|
|
2105
|
-
scopes: ZodArray<ZodString, "many">;
|
|
2106
|
-
}, "strip", ZodTypeAny, {
|
|
2107
|
-
accessToken: string;
|
|
2108
|
-
expiresAt: Date;
|
|
2109
|
-
scopes: string[];
|
|
2110
|
-
}, {
|
|
2111
|
-
accessToken: string;
|
|
2112
|
-
expiresAt: Date;
|
|
2113
|
-
scopes: string[];
|
|
2114
|
-
}>, {
|
|
2115
|
-
[x: string]: {
|
|
2116
|
-
accessToken: string;
|
|
2117
|
-
expiresAt: Date;
|
|
2118
|
-
scopes: string[];
|
|
2119
|
-
};
|
|
2120
|
-
}, {
|
|
2121
|
-
[x: string]: {
|
|
2122
|
-
accessToken: string;
|
|
2123
|
-
expiresAt: Date;
|
|
2124
|
-
scopes: string[];
|
|
2125
|
-
};
|
|
2126
|
-
}>;
|
|
2127
|
-
/**
|
|
2128
|
-
* Exchanged tokens for Partner applications.
|
|
2129
|
-
*/
|
|
2130
|
-
partnersApi: ZodObject<{}, "strip", ZodObject<{
|
|
2131
|
-
accessToken: ZodString;
|
|
2132
|
-
expiresAt: ZodEffects<ZodDate, Date, Date>;
|
|
2133
|
-
scopes: ZodArray<ZodString, "many">;
|
|
2134
|
-
}, "strip", ZodTypeAny, {
|
|
2135
|
-
accessToken: string;
|
|
2136
|
-
expiresAt: Date;
|
|
2137
|
-
scopes: string[];
|
|
2138
|
-
}, {
|
|
2139
|
-
accessToken: string;
|
|
2140
|
-
expiresAt: Date;
|
|
2141
|
-
scopes: string[];
|
|
2142
|
-
}>, {
|
|
2143
|
-
[x: string]: {
|
|
2144
|
-
accessToken: string;
|
|
2145
|
-
expiresAt: Date;
|
|
2146
|
-
scopes: string[];
|
|
2147
|
-
};
|
|
2148
|
-
}, {
|
|
2149
|
-
[x: string]: {
|
|
2150
|
-
accessToken: string;
|
|
2151
|
-
expiresAt: Date;
|
|
2152
|
-
scopes: string[];
|
|
2153
|
-
};
|
|
2154
|
-
}>;
|
|
2155
|
-
/**
|
|
2156
|
-
* Exchanged tokens for Storefront Renderer applications.
|
|
2157
|
-
*/
|
|
2158
|
-
storefrontRendererApi: ZodObject<{}, "strip", ZodObject<{
|
|
2159
|
-
accessToken: ZodString;
|
|
2160
|
-
expiresAt: ZodEffects<ZodDate, Date, Date>;
|
|
2161
|
-
scopes: ZodArray<ZodString, "many">;
|
|
2162
|
-
}, "strip", ZodTypeAny, {
|
|
2163
|
-
accessToken: string;
|
|
2164
|
-
expiresAt: Date;
|
|
2165
|
-
scopes: string[];
|
|
2166
|
-
}, {
|
|
2167
|
-
accessToken: string;
|
|
2168
|
-
expiresAt: Date;
|
|
2169
|
-
scopes: string[];
|
|
2170
|
-
}>, {
|
|
2171
|
-
[x: string]: {
|
|
2172
|
-
accessToken: string;
|
|
2173
|
-
expiresAt: Date;
|
|
2174
|
-
scopes: string[];
|
|
2175
|
-
};
|
|
2176
|
-
}, {
|
|
2177
|
-
[x: string]: {
|
|
2178
|
-
accessToken: string;
|
|
2179
|
-
expiresAt: Date;
|
|
2180
|
-
scopes: string[];
|
|
2181
|
-
};
|
|
2182
|
-
}>;
|
|
2183
|
-
}, "strip", ZodTypeAny, {
|
|
2184
|
-
adminApi: {
|
|
2185
|
-
[x: string]: {
|
|
2186
|
-
accessToken: string;
|
|
2187
|
-
expiresAt: Date;
|
|
2188
|
-
scopes: string[];
|
|
2189
|
-
};
|
|
2190
|
-
};
|
|
2191
|
-
partnersApi: {
|
|
2192
|
-
[x: string]: {
|
|
2193
|
-
accessToken: string;
|
|
2194
|
-
expiresAt: Date;
|
|
2195
|
-
scopes: string[];
|
|
2196
|
-
};
|
|
2197
|
-
};
|
|
2198
|
-
storefrontRendererApi: {
|
|
2199
|
-
[x: string]: {
|
|
2200
|
-
accessToken: string;
|
|
2201
|
-
expiresAt: Date;
|
|
2202
|
-
scopes: string[];
|
|
2203
|
-
};
|
|
2204
|
-
};
|
|
2205
|
-
}, {
|
|
2206
|
-
adminApi: {
|
|
2207
|
-
[x: string]: {
|
|
2208
|
-
accessToken: string;
|
|
2209
|
-
expiresAt: Date;
|
|
2210
|
-
scopes: string[];
|
|
2211
|
-
};
|
|
2212
|
-
};
|
|
2213
|
-
partnersApi: {
|
|
2214
|
-
[x: string]: {
|
|
2215
|
-
accessToken: string;
|
|
2216
|
-
expiresAt: Date;
|
|
2217
|
-
scopes: string[];
|
|
2218
|
-
};
|
|
2219
|
-
};
|
|
2220
|
-
storefrontRendererApi: {
|
|
2221
|
-
[x: string]: {
|
|
2222
|
-
accessToken: string;
|
|
2223
|
-
expiresAt: Date;
|
|
2224
|
-
scopes: string[];
|
|
2225
|
-
};
|
|
2226
|
-
};
|
|
2227
|
-
}>;
|
|
2228
|
-
}, "strip", ZodTypeAny, {
|
|
2229
|
-
identity: {
|
|
2230
|
-
accessToken: string;
|
|
2231
|
-
refreshToken: string;
|
|
2232
|
-
expiresAt: Date;
|
|
2233
|
-
scopes: string[];
|
|
2234
|
-
};
|
|
2235
|
-
applications: {
|
|
2236
|
-
adminApi: {
|
|
2237
|
-
[x: string]: {
|
|
2238
|
-
accessToken: string;
|
|
2239
|
-
expiresAt: Date;
|
|
2240
|
-
scopes: string[];
|
|
2241
|
-
};
|
|
2242
|
-
};
|
|
2243
|
-
partnersApi: {
|
|
2244
|
-
[x: string]: {
|
|
2245
|
-
accessToken: string;
|
|
2246
|
-
expiresAt: Date;
|
|
2247
|
-
scopes: string[];
|
|
2248
|
-
};
|
|
2249
|
-
};
|
|
2250
|
-
storefrontRendererApi: {
|
|
2251
|
-
[x: string]: {
|
|
2252
|
-
accessToken: string;
|
|
2253
|
-
expiresAt: Date;
|
|
2254
|
-
scopes: string[];
|
|
2255
|
-
};
|
|
2256
|
-
};
|
|
2257
|
-
};
|
|
2258
|
-
}, {
|
|
2259
|
-
identity: {
|
|
2260
|
-
accessToken: string;
|
|
2261
|
-
refreshToken: string;
|
|
2262
|
-
expiresAt: Date;
|
|
2263
|
-
scopes: string[];
|
|
2264
|
-
};
|
|
2265
|
-
applications: {
|
|
2266
|
-
adminApi: {
|
|
2267
|
-
[x: string]: {
|
|
2268
|
-
accessToken: string;
|
|
2269
|
-
expiresAt: Date;
|
|
2270
|
-
scopes: string[];
|
|
2271
|
-
};
|
|
2272
|
-
};
|
|
2273
|
-
partnersApi: {
|
|
2274
|
-
[x: string]: {
|
|
2275
|
-
accessToken: string;
|
|
2276
|
-
expiresAt: Date;
|
|
2277
|
-
scopes: string[];
|
|
2278
|
-
};
|
|
2279
|
-
};
|
|
2280
|
-
storefrontRendererApi: {
|
|
2281
|
-
[x: string]: {
|
|
2282
|
-
accessToken: string;
|
|
2283
|
-
expiresAt: Date;
|
|
2284
|
-
scopes: string[];
|
|
2285
|
-
};
|
|
2286
|
-
};
|
|
2287
|
-
};
|
|
2288
|
-
}>, {
|
|
2289
|
-
[x: string]: {
|
|
2290
|
-
identity: {
|
|
2291
|
-
accessToken: string;
|
|
2292
|
-
refreshToken: string;
|
|
2293
|
-
expiresAt: Date;
|
|
2294
|
-
scopes: string[];
|
|
2295
|
-
};
|
|
2296
|
-
applications: {
|
|
2297
|
-
adminApi: {
|
|
2298
|
-
[x: string]: {
|
|
2299
|
-
accessToken: string;
|
|
2300
|
-
expiresAt: Date;
|
|
2301
|
-
scopes: string[];
|
|
2302
|
-
};
|
|
2303
|
-
};
|
|
2304
|
-
partnersApi: {
|
|
2305
|
-
[x: string]: {
|
|
2306
|
-
accessToken: string;
|
|
2307
|
-
expiresAt: Date;
|
|
2308
|
-
scopes: string[];
|
|
2309
|
-
};
|
|
2310
|
-
};
|
|
2311
|
-
storefrontRendererApi: {
|
|
2312
|
-
[x: string]: {
|
|
2313
|
-
accessToken: string;
|
|
2314
|
-
expiresAt: Date;
|
|
2315
|
-
scopes: string[];
|
|
2316
|
-
};
|
|
2317
|
-
};
|
|
2318
|
-
};
|
|
2319
|
-
};
|
|
2320
|
-
}, {
|
|
2321
|
-
[x: string]: {
|
|
2322
|
-
identity: {
|
|
2323
|
-
accessToken: string;
|
|
2324
|
-
refreshToken: string;
|
|
2325
|
-
expiresAt: Date;
|
|
2326
|
-
scopes: string[];
|
|
2327
|
-
};
|
|
2328
|
-
applications: {
|
|
2329
|
-
adminApi: {
|
|
2330
|
-
[x: string]: {
|
|
2331
|
-
accessToken: string;
|
|
2332
|
-
expiresAt: Date;
|
|
2333
|
-
scopes: string[];
|
|
2334
|
-
};
|
|
2335
|
-
};
|
|
2336
|
-
partnersApi: {
|
|
2337
|
-
[x: string]: {
|
|
2338
|
-
accessToken: string;
|
|
2339
|
-
expiresAt: Date;
|
|
2340
|
-
scopes: string[];
|
|
2341
|
-
};
|
|
2342
|
-
};
|
|
2343
|
-
storefrontRendererApi: {
|
|
2344
|
-
[x: string]: {
|
|
2345
|
-
accessToken: string;
|
|
2346
|
-
expiresAt: Date;
|
|
2347
|
-
scopes: string[];
|
|
2348
|
-
};
|
|
2349
|
-
};
|
|
2350
|
-
};
|
|
2351
|
-
};
|
|
2352
|
-
}>;
|
|
2353
|
-
declare type Session = TypeOf<typeof SessionSchema>;
|
|
2354
|
-
|
|
2355
|
-
/**
|
|
2356
|
-
* A scope supported by the Shopify Admin API.
|
|
2357
|
-
*/
|
|
2358
|
-
declare type AdminAPIScope = 'graphql' | 'themes' | 'collaborator' | string;
|
|
2359
|
-
/**
|
|
2360
|
-
* It represents the options to authenticate against the Shopify Admin API.
|
|
2361
|
-
*/
|
|
2362
|
-
interface AdminAPIOAuthOptions {
|
|
2363
|
-
/** List of scopes to request permissions for */
|
|
2364
|
-
scopes: AdminAPIScope[];
|
|
2365
|
-
}
|
|
2366
|
-
/**
|
|
2367
|
-
* A scope supported by the Partners API.
|
|
2368
|
-
*/
|
|
2369
|
-
declare type PartnersAPIScope = 'cli' | string;
|
|
2370
|
-
interface PartnersAPIOAuthOptions {
|
|
2371
|
-
/** List of scopes to request permissions for */
|
|
2372
|
-
scopes: PartnersAPIScope[];
|
|
2373
|
-
}
|
|
2374
|
-
/**
|
|
2375
|
-
* A scope supported by the Storefront Renderer API.
|
|
2376
|
-
*/
|
|
2377
|
-
declare type StorefrontRendererScope = 'devtools' | string;
|
|
2378
|
-
interface StorefrontRendererAPIOAuthOptions {
|
|
2379
|
-
/** List of scopes to request permissions for */
|
|
2380
|
-
scopes: StorefrontRendererScope[];
|
|
2381
|
-
}
|
|
2382
|
-
interface ShopifyOAuthOptions {
|
|
2383
|
-
storeFqdn?: string;
|
|
2384
|
-
storefrontRendererApi?: StorefrontRendererAPIOAuthOptions;
|
|
2385
|
-
adminApi?: AdminAPIOAuthOptions;
|
|
2386
|
-
}
|
|
2387
|
-
/**
|
|
2388
|
-
* It represents the authentication requirements and
|
|
2389
|
-
* is the input necessary to trigger the authentication
|
|
2390
|
-
* flow.
|
|
2391
|
-
*/
|
|
2392
|
-
interface OAuthApplications {
|
|
2393
|
-
shopify?: ShopifyOAuthOptions;
|
|
2394
|
-
partnersApi?: PartnersAPIOAuthOptions;
|
|
2395
|
-
}
|
|
2396
|
-
/**
|
|
2397
|
-
* This method ensures that we have a valid session to authenticate against the given applications using the provided scopes.
|
|
2398
|
-
* @param options {OAuthApplications} An object containing the applications we need to be authenticated with.
|
|
2399
|
-
* @returns {OAuthSession} An instance with the access tokens organized by application.
|
|
2400
|
-
*/
|
|
2401
|
-
declare function ensureAuthenticated(applications: OAuthApplications): Promise<Session>;
|
|
2402
|
-
|
|
2403
|
-
declare const session_ensureAuthenticated: typeof ensureAuthenticated;
|
|
2404
|
-
declare namespace session {
|
|
2405
|
-
export {
|
|
2406
|
-
session_ensureAuthenticated as ensureAuthenticated,
|
|
2407
|
-
};
|
|
2408
|
-
}
|
|
2409
|
-
|
|
2410
2155
|
declare function parse(input: string): object;
|
|
2411
2156
|
|
|
2412
2157
|
declare const toml_parse: typeof parse;
|
|
@@ -3621,6 +3366,51 @@ declare namespace store {
|
|
|
3621
3366
|
};
|
|
3622
3367
|
}
|
|
3623
3368
|
|
|
3369
|
+
/**
|
|
3370
|
+
* The schema represents an application token.
|
|
3371
|
+
*
|
|
3372
|
+
*/
|
|
3373
|
+
declare const ApplicationTokenSchema: ZodObject<{
|
|
3374
|
+
accessToken: ZodString;
|
|
3375
|
+
expiresAt: ZodEffects<ZodDate, Date, Date>;
|
|
3376
|
+
scopes: ZodArray<ZodString, "many">;
|
|
3377
|
+
}, "strip", ZodTypeAny, {
|
|
3378
|
+
accessToken: string;
|
|
3379
|
+
expiresAt: Date;
|
|
3380
|
+
scopes: string[];
|
|
3381
|
+
}, {
|
|
3382
|
+
accessToken: string;
|
|
3383
|
+
expiresAt: Date;
|
|
3384
|
+
scopes: string[];
|
|
3385
|
+
}>;
|
|
3386
|
+
declare type ApplicationToken = TypeOf<typeof ApplicationTokenSchema>;
|
|
3387
|
+
|
|
3388
|
+
declare function request$1<T>(query: any, token: ApplicationToken, store: string, variables?: any): Promise<T>;
|
|
3389
|
+
|
|
3390
|
+
declare namespace admin {
|
|
3391
|
+
export {
|
|
3392
|
+
request$1 as request,
|
|
3393
|
+
};
|
|
3394
|
+
}
|
|
3395
|
+
|
|
3396
|
+
declare function request<T>(query: any, token: ApplicationToken, variables?: any): Promise<T>;
|
|
3397
|
+
|
|
3398
|
+
declare const partners_request: typeof request;
|
|
3399
|
+
declare namespace partners {
|
|
3400
|
+
export {
|
|
3401
|
+
partners_request as request,
|
|
3402
|
+
};
|
|
3403
|
+
}
|
|
3404
|
+
|
|
3405
|
+
declare const api_admin: typeof admin;
|
|
3406
|
+
declare const api_partners: typeof partners;
|
|
3407
|
+
declare namespace api {
|
|
3408
|
+
export {
|
|
3409
|
+
api_admin as admin,
|
|
3410
|
+
api_partners as partners,
|
|
3411
|
+
};
|
|
3412
|
+
}
|
|
3413
|
+
|
|
3624
3414
|
/** @type {typeof globalThis.Blob} */
|
|
3625
3415
|
declare const Blob: typeof globalThis.Blob;
|
|
3626
3416
|
|
|
@@ -3858,7 +3648,10 @@ declare const constants: {
|
|
|
3858
3648
|
keychain: {
|
|
3859
3649
|
service: string;
|
|
3860
3650
|
};
|
|
3651
|
+
session: {
|
|
3652
|
+
expirationTimeMarginInMinutes: number;
|
|
3653
|
+
};
|
|
3861
3654
|
};
|
|
3862
3655
|
|
|
3863
|
-
export { constants, dependency, environment, error$1 as error, file, http, os, output$1 as output, path, schema, session, store, string, system, template, toml, ui, version };
|
|
3656
|
+
export { api, constants, dependency, environment, error$1 as error, file, http, os, output$1 as output, path, schema, session, store, string, system, template, toml, ui, version };
|
|
3864
3657
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export {
|
|
1
|
+
export { l as api, n as constants, d as dependency, g as environment, e as error, f as file, m as http, c as os, o as output, p as path, i as schema, h as session, k as store, b as string, s as system, t as template, j as toml, u as ui, v as version } from './index-80382e6b.js';
|
|
2
2
|
import 'assert';
|
|
3
3
|
import 'events';
|
|
4
4
|
import 'readline';
|
|
@@ -16,6 +16,7 @@ import 'node:url';
|
|
|
16
16
|
import 'node:os';
|
|
17
17
|
import 'buffer';
|
|
18
18
|
import 'util';
|
|
19
|
+
import 'open';
|
|
19
20
|
import 'node:fs';
|
|
20
21
|
import 'constants';
|
|
21
22
|
import 'http';
|
|
@@ -27,6 +28,7 @@ import 'http2';
|
|
|
27
28
|
import 'tls';
|
|
28
29
|
import 'net';
|
|
29
30
|
import 'crypto';
|
|
31
|
+
import 'punycode';
|
|
30
32
|
import 'node:http';
|
|
31
33
|
import 'node:https';
|
|
32
34
|
import 'node:zlib';
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import 'node:fs';
|
|
2
2
|
import 'node:path';
|
|
3
|
-
import { F as FormData, a as File } from './index-
|
|
3
|
+
import { F as FormData, a as File } from './index-80382e6b.js';
|
|
4
4
|
import 'assert';
|
|
5
5
|
import 'events';
|
|
6
6
|
import 'readline';
|
|
@@ -17,6 +17,7 @@ import 'node:url';
|
|
|
17
17
|
import 'node:os';
|
|
18
18
|
import 'buffer';
|
|
19
19
|
import 'util';
|
|
20
|
+
import 'open';
|
|
20
21
|
import 'constants';
|
|
21
22
|
import 'http';
|
|
22
23
|
import 'https';
|
|
@@ -27,6 +28,7 @@ import 'http2';
|
|
|
27
28
|
import 'tls';
|
|
28
29
|
import 'net';
|
|
29
30
|
import 'crypto';
|
|
31
|
+
import 'punycode';
|
|
30
32
|
import 'node:http';
|
|
31
33
|
import 'node:https';
|
|
32
34
|
import 'node:zlib';
|
|
@@ -465,4 +467,4 @@ async function toFormData(Body, ct) {
|
|
|
465
467
|
}
|
|
466
468
|
|
|
467
469
|
export { toFormData };
|
|
468
|
-
//# sourceMappingURL=multipart-parser-
|
|
470
|
+
//# sourceMappingURL=multipart-parser-54cbb259.js.map
|