@shopify/cli-kit 3.0.25 → 3.1.0

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.
Files changed (289) hide show
  1. package/CHANGELOG.md +34 -0
  2. package/assets/auth-error.html +2 -4
  3. package/assets/empty-url.html +2 -4
  4. package/assets/missing-code.html +2 -4
  5. package/assets/missing-state.html +2 -4
  6. package/assets/style.css +5 -8
  7. package/assets/success.html +1 -1
  8. package/dist/abort.d.ts +1 -0
  9. package/dist/abort.js +2 -0
  10. package/dist/abort.js.map +1 -0
  11. package/dist/analytics.d.ts +13 -0
  12. package/dist/analytics.js +111 -0
  13. package/dist/analytics.js.map +1 -0
  14. package/dist/api/admin.d.ts +3 -0
  15. package/dist/api/admin.js +80 -0
  16. package/dist/api/admin.js.map +1 -0
  17. package/dist/api/common.d.ts +11 -0
  18. package/dist/api/common.js +40 -0
  19. package/dist/api/common.js.map +1 -0
  20. package/dist/api/graphql/all_app_extension_registrations.d.ts +14 -0
  21. package/dist/api/graphql/all_app_extension_registrations.js +14 -0
  22. package/dist/api/graphql/all_app_extension_registrations.js.map +1 -0
  23. package/dist/api/graphql/all_orgs.d.ts +12 -0
  24. package/dist/api/graphql/all_orgs.js +14 -0
  25. package/dist/api/graphql/all_orgs.js.map +1 -0
  26. package/dist/api/graphql/all_stores_by_org.d.ts +18 -0
  27. package/dist/api/graphql/all_stores_by_org.js +21 -0
  28. package/dist/api/graphql/all_stores_by_org.js.map +1 -0
  29. package/dist/api/graphql/convert_dev_to_test_store.d.ts +16 -0
  30. package/dist/api/graphql/convert_dev_to_test_store.js +13 -0
  31. package/dist/api/graphql/convert_dev_to_test_store.js.map +1 -0
  32. package/dist/api/graphql/create_app.d.ts +28 -0
  33. package/dist/api/graphql/create_app.js +32 -0
  34. package/dist/api/graphql/create_app.js.map +1 -0
  35. package/dist/api/graphql/create_deployment.d.ts +33 -0
  36. package/dist/api/graphql/create_deployment.js +25 -0
  37. package/dist/api/graphql/create_deployment.js.map +1 -0
  38. package/dist/api/graphql/extension_create.d.ts +30 -0
  39. package/dist/api/graphql/extension_create.js +26 -0
  40. package/dist/api/graphql/extension_create.js.map +1 -0
  41. package/dist/api/graphql/extension_specifications.d.ts +18 -0
  42. package/dist/api/graphql/extension_specifications.js +18 -0
  43. package/dist/api/graphql/extension_specifications.js.map +1 -0
  44. package/dist/api/graphql/find_app.d.ts +13 -0
  45. package/dist/api/graphql/find_app.js +16 -0
  46. package/dist/api/graphql/find_app.js.map +1 -0
  47. package/dist/api/graphql/find_org.d.ts +23 -0
  48. package/dist/api/graphql/find_org.js +26 -0
  49. package/dist/api/graphql/find_org.js.map +1 -0
  50. package/dist/api/graphql/find_org_basic.d.ts +11 -0
  51. package/dist/api/graphql/find_org_basic.js +14 -0
  52. package/dist/api/graphql/find_org_basic.js.map +1 -0
  53. package/dist/api/graphql/find_store_by_domain.d.ts +21 -0
  54. package/dist/api/graphql/find_store_by_domain.js +24 -0
  55. package/dist/api/graphql/find_store_by_domain.js.map +1 -0
  56. package/dist/api/graphql/functions/app_function_set.d.ts +43 -0
  57. package/dist/api/graphql/functions/app_function_set.js +52 -0
  58. package/dist/api/graphql/functions/app_function_set.js.map +1 -0
  59. package/dist/api/graphql/functions/compile_module.d.ts +15 -0
  60. package/dist/api/graphql/functions/compile_module.js +13 -0
  61. package/dist/api/graphql/functions/compile_module.js.map +1 -0
  62. package/dist/api/graphql/functions/function_service_proxy.d.ts +4 -0
  63. package/dist/api/graphql/functions/function_service_proxy.js +7 -0
  64. package/dist/api/graphql/functions/function_service_proxy.js.map +1 -0
  65. package/dist/api/graphql/functions/get_app_functions.d.ts +1 -0
  66. package/dist/api/graphql/functions/get_app_functions.js +10 -0
  67. package/dist/api/graphql/functions/get_app_functions.js.map +1 -0
  68. package/dist/api/graphql/functions/module_compilation_status.d.ts +15 -0
  69. package/dist/api/graphql/functions/module_compilation_status.js +13 -0
  70. package/dist/api/graphql/functions/module_compilation_status.js.map +1 -0
  71. package/dist/api/graphql/functions/module_upload_url_generate.d.ts +18 -0
  72. package/dist/api/graphql/functions/module_upload_url_generate.js +17 -0
  73. package/dist/api/graphql/functions/module_upload_url_generate.js.map +1 -0
  74. package/dist/api/graphql/generate_signed_upload_url.d.ts +15 -0
  75. package/dist/api/graphql/generate_signed_upload_url.js +15 -0
  76. package/dist/api/graphql/generate_signed_upload_url.js.map +1 -0
  77. package/dist/api/graphql/get_variant_id.d.ts +17 -0
  78. package/dist/api/graphql/get_variant_id.js +20 -0
  79. package/dist/api/graphql/get_variant_id.js.map +1 -0
  80. package/dist/api/graphql/index.d.ts +22 -0
  81. package/dist/api/graphql/index.js +23 -0
  82. package/dist/api/graphql/index.js.map +1 -0
  83. package/dist/api/graphql/update_draft.d.ts +33 -0
  84. package/dist/api/graphql/update_draft.js +24 -0
  85. package/dist/api/graphql/update_draft.js.map +1 -0
  86. package/dist/api/graphql/update_urls.d.ts +14 -0
  87. package/dist/api/graphql/update_urls.js +12 -0
  88. package/dist/api/graphql/update_urls.js.map +1 -0
  89. package/dist/api/identity.d.ts +1 -0
  90. package/dist/api/identity.js +32 -0
  91. package/dist/api/identity.js.map +1 -0
  92. package/dist/api/partners.d.ts +25 -0
  93. package/dist/api/partners.js +100 -0
  94. package/dist/api/partners.js.map +1 -0
  95. package/dist/api.d.ts +5 -0
  96. package/dist/api.js +6 -0
  97. package/dist/api.js.map +1 -0
  98. package/dist/cli.d.ts +7 -0
  99. package/dist/cli.js +13 -0
  100. package/dist/cli.js.map +1 -0
  101. package/dist/constants.d.ts +43 -0
  102. package/dist/constants.js +63 -0
  103. package/dist/constants.js.map +1 -0
  104. package/dist/environment/fqdn.d.ts +23 -0
  105. package/dist/environment/fqdn.js +61 -0
  106. package/dist/environment/fqdn.js.map +1 -0
  107. package/dist/environment/local.d.ts +48 -0
  108. package/dist/environment/local.js +82 -0
  109. package/dist/environment/local.js.map +1 -0
  110. package/dist/environment/service.d.ts +17 -0
  111. package/dist/environment/service.js +41 -0
  112. package/dist/environment/service.js.map +1 -0
  113. package/dist/environment/spin.d.ts +47 -0
  114. package/dist/environment/spin.js +83 -0
  115. package/dist/environment/spin.js.map +1 -0
  116. package/dist/environment/utilities.d.ts +6 -0
  117. package/dist/environment/utilities.js +12 -0
  118. package/dist/environment/utilities.js.map +1 -0
  119. package/dist/environment.d.ts +5 -0
  120. package/dist/environment.js +6 -0
  121. package/dist/environment.js.map +1 -0
  122. package/dist/error.d.ts +44 -0
  123. package/dist/error.js +91 -0
  124. package/dist/error.js.map +1 -0
  125. package/dist/file.d.ts +67 -0
  126. package/dist/file.js +165 -0
  127. package/dist/file.js.map +1 -0
  128. package/dist/git.d.ts +15 -0
  129. package/dist/git.js +48 -0
  130. package/dist/git.js.map +1 -0
  131. package/dist/github.d.ts +33 -0
  132. package/dist/github.js +56 -0
  133. package/dist/github.js.map +1 -0
  134. package/dist/haiku.d.ts +1 -0
  135. package/dist/haiku.js +8 -0
  136. package/dist/haiku.js.map +1 -0
  137. package/dist/http/fetch.d.ts +16 -0
  138. package/dist/http/fetch.js +18 -0
  139. package/dist/http/fetch.js.map +1 -0
  140. package/dist/http/formdata.d.ts +3 -0
  141. package/dist/http/formdata.js +6 -0
  142. package/dist/http/formdata.js.map +1 -0
  143. package/dist/http.d.ts +2 -0
  144. package/dist/http.js +3 -0
  145. package/dist/http.js.map +1 -0
  146. package/dist/id.d.ts +6 -0
  147. package/dist/id.js +18 -0
  148. package/dist/id.js.map +1 -0
  149. package/dist/index.d.ts +33 -2179
  150. package/dist/index.js +34 -3264
  151. package/dist/index.js.map +1 -1
  152. package/dist/network/api.d.ts +2 -0
  153. package/dist/network/api.js +2 -0
  154. package/dist/network/api.js.map +1 -0
  155. package/dist/network/service.d.ts +16 -0
  156. package/dist/network/service.js +12 -0
  157. package/dist/network/service.js.map +1 -0
  158. package/dist/{archiver.d.ts → node/archiver.d.ts} +1 -4
  159. package/dist/node/archiver.js +22 -42
  160. package/dist/node/archiver.js.map +1 -1
  161. package/dist/node/checksum.d.ts +20 -0
  162. package/dist/node/checksum.js +32 -0
  163. package/dist/node/checksum.js.map +1 -0
  164. package/dist/node/cli.d.ts +18 -0
  165. package/dist/node/cli.js +96 -0
  166. package/dist/node/cli.js.map +1 -0
  167. package/dist/node/colors.d.ts +1 -0
  168. package/dist/node/colors.js +8 -0
  169. package/dist/node/colors.js.map +1 -0
  170. package/dist/node/dot-env.d.ts +33 -0
  171. package/dist/node/dot-env.js +36 -0
  172. package/dist/node/dot-env.js.map +1 -0
  173. package/dist/node/node-package-manager.d.ts +197 -0
  174. package/dist/node/node-package-manager.js +309 -0
  175. package/dist/node/node-package-manager.js.map +1 -0
  176. package/dist/node/ruby.d.ts +30 -0
  177. package/dist/node/ruby.js +197 -0
  178. package/dist/node/ruby.js.map +1 -0
  179. package/dist/npm.d.ts +27 -0
  180. package/dist/npm.js +20 -0
  181. package/dist/npm.js.map +1 -0
  182. package/dist/os.d.ts +10 -0
  183. package/dist/os.js +70 -0
  184. package/dist/os.js.map +1 -0
  185. package/dist/output.d.ts +149 -0
  186. package/dist/output.js +515 -0
  187. package/dist/output.js.map +1 -0
  188. package/dist/path.d.ts +22 -0
  189. package/dist/path.js +43 -0
  190. package/dist/path.js.map +1 -0
  191. package/dist/plugins.d.ts +9 -0
  192. package/dist/plugins.js +12 -0
  193. package/dist/plugins.js.map +1 -0
  194. package/dist/port.d.ts +5 -0
  195. package/dist/port.js +35 -0
  196. package/dist/port.js.map +1 -0
  197. package/dist/schema.d.ts +1 -0
  198. package/dist/schema.js +2 -0
  199. package/dist/schema.js.map +1 -0
  200. package/dist/secure-store.d.ts +19 -0
  201. package/dist/secure-store.js +63 -0
  202. package/dist/secure-store.js.map +1 -0
  203. package/dist/semver.d.ts +3 -0
  204. package/dist/semver.js +6 -0
  205. package/dist/semver.js.map +1 -0
  206. package/dist/session/authorize.d.ts +7 -0
  207. package/dist/session/authorize.js +40 -0
  208. package/dist/session/authorize.js.map +1 -0
  209. package/dist/session/exchange.d.ts +42 -0
  210. package/dist/session/exchange.js +144 -0
  211. package/dist/session/exchange.js.map +1 -0
  212. package/dist/session/identity.d.ts +3 -0
  213. package/dist/session/identity.js +58 -0
  214. package/dist/session/identity.js.map +1 -0
  215. package/dist/session/post-auth.d.ts +13 -0
  216. package/dist/session/post-auth.js +56 -0
  217. package/dist/session/post-auth.js.map +1 -0
  218. package/dist/session/redirect-listener.d.ts +34 -0
  219. package/dist/session/redirect-listener.js +97 -0
  220. package/dist/session/redirect-listener.js.map +1 -0
  221. package/dist/session/schema.d.ts +174 -0
  222. package/dist/session/schema.js +59 -0
  223. package/dist/session/schema.js.map +1 -0
  224. package/dist/session/scopes.d.ts +16 -0
  225. package/dist/session/scopes.js +53 -0
  226. package/dist/session/scopes.js.map +1 -0
  227. package/dist/session/store.d.ts +24 -0
  228. package/dist/session/store.js +88 -0
  229. package/dist/session/store.js.map +1 -0
  230. package/dist/session/token.d.ts +40 -0
  231. package/dist/session/token.js +22 -0
  232. package/dist/session/token.js.map +1 -0
  233. package/dist/session/validate.d.ts +17 -0
  234. package/dist/session/validate.js +75 -0
  235. package/dist/session/validate.js.map +1 -0
  236. package/dist/session.d.ts +88 -0
  237. package/dist/session.js +251 -0
  238. package/dist/session.js.map +1 -0
  239. package/dist/store/schema.d.ts +3 -0
  240. package/dist/store/schema.js +27 -0
  241. package/dist/store/schema.js.map +1 -0
  242. package/dist/store.d.ts +32 -0
  243. package/dist/store.js +102 -0
  244. package/dist/store.js.map +1 -0
  245. package/dist/string.d.ts +22 -0
  246. package/dist/string.js +38 -0
  247. package/dist/string.js.map +1 -0
  248. package/dist/system.d.ts +53 -0
  249. package/dist/system.js +109 -0
  250. package/dist/system.js.map +1 -0
  251. package/dist/template.d.ts +11 -0
  252. package/dist/template.js +50 -0
  253. package/dist/template.js.map +1 -0
  254. package/dist/testing/output.d.ts +9 -0
  255. package/dist/testing/output.js +15 -0
  256. package/dist/testing/output.js.map +1 -0
  257. package/dist/testing/store.d.ts +7 -0
  258. package/dist/testing/store.js +26 -0
  259. package/dist/testing/store.js.map +1 -0
  260. package/dist/toml.d.ts +3 -0
  261. package/dist/toml.js +8 -0
  262. package/dist/toml.js.map +1 -0
  263. package/dist/tsconfig.tsbuildinfo +1 -0
  264. package/dist/ui/autocomplete.d.ts +7 -0
  265. package/dist/ui/autocomplete.js +43 -0
  266. package/dist/ui/autocomplete.js.map +1 -0
  267. package/dist/ui/input.d.ts +7 -0
  268. package/dist/ui/input.js +48 -0
  269. package/dist/ui/input.js.map +1 -0
  270. package/dist/ui/select.d.ts +6 -0
  271. package/dist/ui/select.js +30 -0
  272. package/dist/ui/select.js.map +1 -0
  273. package/dist/ui.d.ts +36 -0
  274. package/dist/ui.js +124 -0
  275. package/dist/ui.js.map +1 -0
  276. package/dist/version.d.ts +19 -0
  277. package/dist/version.js +34 -0
  278. package/dist/version.js.map +1 -0
  279. package/dist/vscode.d.ts +8 -0
  280. package/dist/vscode.js +36 -0
  281. package/dist/vscode.js.map +1 -0
  282. package/dist/yaml.d.ts +2 -0
  283. package/dist/yaml.js +8 -0
  284. package/dist/yaml.js.map +1 -0
  285. package/package.json +19 -8
  286. package/dist/archiver.d.ts.map +0 -1
  287. package/dist/index.d.ts.map +0 -1
  288. package/dist/local-d0094ffe.js +0 -1344
  289. package/dist/local-d0094ffe.js.map +0 -1
@@ -0,0 +1,17 @@
1
+ import { gql } from 'graphql-request';
2
+ export const ModuleUploadUrlGenerateMutation = gql `
3
+ mutation moduleUploadUrlGenerate {
4
+ moduleUploadUrlGenerate {
5
+ details {
6
+ url
7
+ headers
8
+ humanizedMaxSize
9
+ }
10
+ userErrors {
11
+ field
12
+ message
13
+ }
14
+ }
15
+ }
16
+ `;
17
+ //# sourceMappingURL=module_upload_url_generate.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"module_upload_url_generate.js","sourceRoot":"","sources":["../../../../src/api/graphql/functions/module_upload_url_generate.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,GAAG,EAAC,MAAM,iBAAiB,CAAA;AAEnC,MAAM,CAAC,MAAM,+BAA+B,GAAG,GAAG,CAAA;;;;;;;;;;;;;;CAcjD,CAAA","sourcesContent":["import {gql} from 'graphql-request'\n\nexport const ModuleUploadUrlGenerateMutation = gql`\n mutation moduleUploadUrlGenerate {\n moduleUploadUrlGenerate {\n details {\n url\n headers\n humanizedMaxSize\n }\n userErrors {\n field\n message\n }\n }\n }\n`\n\nexport interface ModuleUploadUrlGenerateMutationSchema {\n data: {\n moduleUploadUrlGenerate: {\n details: {\n url: string\n headers: {[key: string]: string}\n humanizedMaxSize: string\n }\n userErrors: {\n field: string\n message: string\n }[]\n }\n }\n}\n"]}
@@ -0,0 +1,15 @@
1
+ export declare const GenerateSignedUploadUrl: string;
2
+ export interface GenerateSignedUploadUrlVariables {
3
+ apiKey: string;
4
+ deploymentUuid: string;
5
+ bundleFormat: number;
6
+ }
7
+ export interface GenerateSignedUploadUrlSchema {
8
+ deploymentGenerateSignedUploadUrl: {
9
+ signedUploadUrl: string;
10
+ userErrors: {
11
+ field: string[];
12
+ message: string;
13
+ }[];
14
+ };
15
+ }
@@ -0,0 +1,15 @@
1
+ import { gql } from 'graphql-request';
2
+ export const GenerateSignedUploadUrl = gql `
3
+ mutation GenerateSignedUploadUrl($apiKey: String!, $deploymentUuid: String!, $bundleFormat: Int!) {
4
+ deploymentGenerateSignedUploadUrl(
5
+ input: {apiKey: $apiKey, deploymentUuid: $deploymentUuid, bundleFormat: $bundleFormat}
6
+ ) {
7
+ signedUploadUrl
8
+ userErrors {
9
+ field
10
+ message
11
+ }
12
+ }
13
+ }
14
+ `;
15
+ //# sourceMappingURL=generate_signed_upload_url.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"generate_signed_upload_url.js","sourceRoot":"","sources":["../../../src/api/graphql/generate_signed_upload_url.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,GAAG,EAAC,MAAM,iBAAiB,CAAA;AAEnC,MAAM,CAAC,MAAM,uBAAuB,GAAG,GAAG,CAAA;;;;;;;;;;;;CAYzC,CAAA","sourcesContent":["import {gql} from 'graphql-request'\n\nexport const GenerateSignedUploadUrl = gql`\n mutation GenerateSignedUploadUrl($apiKey: String!, $deploymentUuid: String!, $bundleFormat: Int!) {\n deploymentGenerateSignedUploadUrl(\n input: {apiKey: $apiKey, deploymentUuid: $deploymentUuid, bundleFormat: $bundleFormat}\n ) {\n signedUploadUrl\n userErrors {\n field\n message\n }\n }\n }\n`\n\nexport interface GenerateSignedUploadUrlVariables {\n apiKey: string\n deploymentUuid: string\n bundleFormat: number\n}\n\nexport interface GenerateSignedUploadUrlSchema {\n deploymentGenerateSignedUploadUrl: {\n signedUploadUrl: string\n userErrors: {\n field: string[]\n message: string\n }[]\n }\n}\n"]}
@@ -0,0 +1,17 @@
1
+ export declare const FindProductVariantQuery: string;
2
+ export interface FindProductVariantSchema {
3
+ products: {
4
+ edges: {
5
+ node: {
6
+ id: string;
7
+ variants: {
8
+ edges: {
9
+ node: {
10
+ id: string;
11
+ };
12
+ }[];
13
+ };
14
+ };
15
+ }[];
16
+ };
17
+ }
@@ -0,0 +1,20 @@
1
+ import { gql } from 'graphql-request';
2
+ export const FindProductVariantQuery = gql `
3
+ query {
4
+ products(first: 1) {
5
+ edges {
6
+ node {
7
+ id
8
+ variants(first: 1) {
9
+ edges {
10
+ node {
11
+ id
12
+ }
13
+ }
14
+ }
15
+ }
16
+ }
17
+ }
18
+ }
19
+ `;
20
+ //# sourceMappingURL=get_variant_id.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"get_variant_id.js","sourceRoot":"","sources":["../../../src/api/graphql/get_variant_id.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,GAAG,EAAC,MAAM,iBAAiB,CAAA;AAEnC,MAAM,CAAC,MAAM,uBAAuB,GAAG,GAAG,CAAA;;;;;;;;;;;;;;;;;CAiBzC,CAAA","sourcesContent":["import {gql} from 'graphql-request'\n\nexport const FindProductVariantQuery = gql`\n query {\n products(first: 1) {\n edges {\n node {\n id\n variants(first: 1) {\n edges {\n node {\n id\n }\n }\n }\n }\n }\n }\n }\n`\n\nexport interface FindProductVariantSchema {\n products: {\n edges: {\n node: {\n id: string\n variants: {\n edges: {\n node: {\n id: string\n }\n }[]\n }\n }\n }[]\n }\n}\n"]}
@@ -0,0 +1,22 @@
1
+ export * from './find_org.js';
2
+ export * from './all_orgs.js';
3
+ export * from './create_app.js';
4
+ export * from './update_urls.js';
5
+ export * from './find_app.js';
6
+ export * from './update_draft.js';
7
+ export * from './generate_signed_upload_url.js';
8
+ export * from './create_deployment.js';
9
+ export * from './all_stores_by_org.js';
10
+ export * from './convert_dev_to_test_store.js';
11
+ export * from './extension_create.js';
12
+ export * from './extension_specifications.js';
13
+ export * from './all_app_extension_registrations.js';
14
+ export * from './get_variant_id.js';
15
+ export * from './functions/function_service_proxy.js';
16
+ export * from './functions/get_app_functions.js';
17
+ export * from './functions/module_upload_url_generate.js';
18
+ export * from './functions/app_function_set.js';
19
+ export * from './functions/compile_module.js';
20
+ export * from './functions/module_compilation_status.js';
21
+ export * from './find_org_basic.js';
22
+ export * from './find_store_by_domain.js';
@@ -0,0 +1,23 @@
1
+ export * from './find_org.js';
2
+ export * from './all_orgs.js';
3
+ export * from './create_app.js';
4
+ export * from './update_urls.js';
5
+ export * from './find_app.js';
6
+ export * from './update_draft.js';
7
+ export * from './generate_signed_upload_url.js';
8
+ export * from './create_deployment.js';
9
+ export * from './all_stores_by_org.js';
10
+ export * from './convert_dev_to_test_store.js';
11
+ export * from './extension_create.js';
12
+ export * from './extension_specifications.js';
13
+ export * from './all_app_extension_registrations.js';
14
+ export * from './get_variant_id.js';
15
+ export * from './functions/function_service_proxy.js';
16
+ export * from './functions/get_app_functions.js';
17
+ export * from './functions/module_upload_url_generate.js';
18
+ export * from './functions/app_function_set.js';
19
+ export * from './functions/compile_module.js';
20
+ export * from './functions/module_compilation_status.js';
21
+ export * from './find_org_basic.js';
22
+ export * from './find_store_by_domain.js';
23
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/api/graphql/index.ts"],"names":[],"mappings":"AAAA,cAAc,eAAe,CAAA;AAC7B,cAAc,eAAe,CAAA;AAC7B,cAAc,iBAAiB,CAAA;AAC/B,cAAc,kBAAkB,CAAA;AAChC,cAAc,eAAe,CAAA;AAC7B,cAAc,mBAAmB,CAAA;AACjC,cAAc,iCAAiC,CAAA;AAC/C,cAAc,wBAAwB,CAAA;AACtC,cAAc,wBAAwB,CAAA;AACtC,cAAc,gCAAgC,CAAA;AAC9C,cAAc,uBAAuB,CAAA;AACrC,cAAc,+BAA+B,CAAA;AAC7C,cAAc,sCAAsC,CAAA;AACpD,cAAc,qBAAqB,CAAA;AACnC,cAAc,uCAAuC,CAAA;AACrD,cAAc,kCAAkC,CAAA;AAChD,cAAc,2CAA2C,CAAA;AACzD,cAAc,iCAAiC,CAAA;AAC/C,cAAc,+BAA+B,CAAA;AAC7C,cAAc,0CAA0C,CAAA;AACxD,cAAc,qBAAqB,CAAA;AACnC,cAAc,2BAA2B,CAAA","sourcesContent":["export * from './find_org.js'\nexport * from './all_orgs.js'\nexport * from './create_app.js'\nexport * from './update_urls.js'\nexport * from './find_app.js'\nexport * from './update_draft.js'\nexport * from './generate_signed_upload_url.js'\nexport * from './create_deployment.js'\nexport * from './all_stores_by_org.js'\nexport * from './convert_dev_to_test_store.js'\nexport * from './extension_create.js'\nexport * from './extension_specifications.js'\nexport * from './all_app_extension_registrations.js'\nexport * from './get_variant_id.js'\nexport * from './functions/function_service_proxy.js'\nexport * from './functions/get_app_functions.js'\nexport * from './functions/module_upload_url_generate.js'\nexport * from './functions/app_function_set.js'\nexport * from './functions/compile_module.js'\nexport * from './functions/module_compilation_status.js'\nexport * from './find_org_basic.js'\nexport * from './find_store_by_domain.js'\n"]}
@@ -0,0 +1,33 @@
1
+ export declare const ExtensionUpdateDraftMutation: string;
2
+ export interface ExtensionUpdateDraftInput {
3
+ apiKey: string;
4
+ config: string;
5
+ context: string | undefined;
6
+ registrationId: string;
7
+ }
8
+ export interface ExtensionUpdateDraftPayload {
9
+ clientMutationId: string;
10
+ extensionVersion: ExtensionVersion;
11
+ userErrors: {
12
+ field: string[];
13
+ message: string;
14
+ }[];
15
+ }
16
+ export interface ExtensionVersion {
17
+ config: string;
18
+ context: string;
19
+ id: string;
20
+ lastUserInteractionAt: string;
21
+ location: string;
22
+ registrationId: string;
23
+ registrationUuid: string;
24
+ uuid: string;
25
+ validationErrors: {
26
+ field: string[];
27
+ message: string;
28
+ }[];
29
+ versionTag: string;
30
+ }
31
+ export interface ExtensionUpdateSchema {
32
+ extensionUpdateDraft: ExtensionUpdateDraftPayload;
33
+ }
@@ -0,0 +1,24 @@
1
+ import { gql } from 'graphql-request';
2
+ export const ExtensionUpdateDraftMutation = gql `
3
+ mutation ExtensionUpdateDraft($apiKey: String!, $registrationId: ID!, $config: JSON!, $context: String) {
4
+ extensionUpdateDraft(
5
+ input: {apiKey: $apiKey, registrationId: $registrationId, config: $config, context: $context}
6
+ ) {
7
+ extensionVersion {
8
+ registrationId
9
+ context
10
+ lastUserInteractionAt
11
+ location
12
+ validationErrors {
13
+ field
14
+ message
15
+ }
16
+ }
17
+ userErrors {
18
+ field
19
+ message
20
+ }
21
+ }
22
+ }
23
+ `;
24
+ //# sourceMappingURL=update_draft.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"update_draft.js","sourceRoot":"","sources":["../../../src/api/graphql/update_draft.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,GAAG,EAAC,MAAM,iBAAiB,CAAA;AAEnC,MAAM,CAAC,MAAM,4BAA4B,GAAG,GAAG,CAAA;;;;;;;;;;;;;;;;;;;;;CAqB9C,CAAA","sourcesContent":["import {gql} from 'graphql-request'\n\nexport const ExtensionUpdateDraftMutation = gql`\n mutation ExtensionUpdateDraft($apiKey: String!, $registrationId: ID!, $config: JSON!, $context: String) {\n extensionUpdateDraft(\n input: {apiKey: $apiKey, registrationId: $registrationId, config: $config, context: $context}\n ) {\n extensionVersion {\n registrationId\n context\n lastUserInteractionAt\n location\n validationErrors {\n field\n message\n }\n }\n userErrors {\n field\n message\n }\n }\n }\n`\n\nexport interface ExtensionUpdateDraftInput {\n apiKey: string\n config: string\n // not all extensions require configs, e.g. subscription\n context: string | undefined\n registrationId: string\n}\n\n// \"\"\"\n// Autogenerated return type of ExtensionUpdateDraft\n// \"\"\"\nexport interface ExtensionUpdateDraftPayload {\n // \"\"\"\n // A unique identifier for the client performing the mutation.\n // \"\"\"\n clientMutationId: string\n extensionVersion: ExtensionVersion\n // userErrors: [UserError]\n userErrors: {\n field: string[]\n message: string\n }[]\n}\n\n// \"\"\"\n// A particular version of an extension belonging to a Shopify Partner App.\n// \"\"\"\nexport interface ExtensionVersion {\n // \"\"\"\n // The serialized JSON config for the extension version\n // \"\"\"\n config: string\n\n // \"\"\"\n // The context of an extension version, indicating where it will be rendered\n // \"\"\"\n context: string\n\n // \"\"\"\n // The unique identifier of the extension version\n // \"\"\"\n // id: ID\n id: string\n\n // \"\"\"\n // The last time a user updated an extension version\n // \"\"\"\n // lastUserInteractionAt: DateTime\n lastUserInteractionAt: string\n\n // \"\"\"\n // The URL to view the app extension version in the partners dashboard\n // \"\"\"\n // location: Url\n location: string\n\n // \"\"\"\n // The unique identifier of the extension registration this version belongs to\n // \"\"\"\n // registrationId: ID\n registrationId: string\n\n // \"\"\"\n // The uuid of the extension registration this version belongs to\n // \"\"\"\n registrationUuid: string\n\n // \"\"\"\n // The uuid of the extension version\n // \"\"\"\n uuid: string\n\n // \"\"\"\n // The validation errors for an extension version\n // \"\"\"\n // validationErrors: [ValidationError]\n validationErrors: {\n field: string[]\n message: string\n }[]\n\n // \"\"\"\n // The version tag of the extension version\n // \"\"\"\n versionTag: string\n}\n\nexport interface ExtensionUpdateSchema {\n extensionUpdateDraft: ExtensionUpdateDraftPayload\n}\n"]}
@@ -0,0 +1,14 @@
1
+ export declare const UpdateURLsQuery: string;
2
+ export interface UpdateURLsQueryVariables {
3
+ apiKey: string;
4
+ appUrl: string;
5
+ redir: string[];
6
+ }
7
+ export interface UpdateURLsQuerySchema {
8
+ appUpdate: {
9
+ userErrors: {
10
+ field: string[];
11
+ message: string;
12
+ }[];
13
+ };
14
+ }
@@ -0,0 +1,12 @@
1
+ import { gql } from 'graphql-request';
2
+ export const UpdateURLsQuery = gql `
3
+ mutation appUpdate($apiKey: String!, $appUrl: Url!, $redir: [Url]!) {
4
+ appUpdate(input: {apiKey: $apiKey, applicationUrl: $appUrl, redirectUrlWhitelist: $redir}) {
5
+ userErrors {
6
+ message
7
+ field
8
+ }
9
+ }
10
+ }
11
+ `;
12
+ //# sourceMappingURL=update_urls.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"update_urls.js","sourceRoot":"","sources":["../../../src/api/graphql/update_urls.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,GAAG,EAAC,MAAM,iBAAiB,CAAA;AAEnC,MAAM,CAAC,MAAM,eAAe,GAAG,GAAG,CAAA;;;;;;;;;CASjC,CAAA","sourcesContent":["import {gql} from 'graphql-request'\n\nexport const UpdateURLsQuery = gql`\n mutation appUpdate($apiKey: String!, $appUrl: Url!, $redir: [Url]!) {\n appUpdate(input: {apiKey: $apiKey, applicationUrl: $appUrl, redirectUrlWhitelist: $redir}) {\n userErrors {\n message\n field\n }\n }\n }\n`\n\nexport interface UpdateURLsQueryVariables {\n apiKey: string\n appUrl: string\n redir: string[]\n}\n\nexport interface UpdateURLsQuerySchema {\n appUpdate: {\n userErrors: {\n field: string[]\n message: string\n }[]\n }\n}\n"]}
@@ -0,0 +1 @@
1
+ export declare function validateIdentityToken(token: string): Promise<any>;
@@ -0,0 +1,32 @@
1
+ import { identity } from '../environment/fqdn.js';
2
+ import { debug } from '../output.js';
3
+ import { fetch } from '../http.js';
4
+ export async function validateIdentityToken(token) {
5
+ try {
6
+ const instrospectionURL = await getInstrospectionEndpoint();
7
+ const options = {
8
+ method: 'POST',
9
+ // eslint-disable-next-line @typescript-eslint/naming-convention
10
+ headers: { Authorization: `Bearer ${token}`, 'Content-Type': 'application/json' },
11
+ body: JSON.stringify({ token }),
12
+ };
13
+ debug(`Sending Identity Introspection request to URL: ${instrospectionURL}`);
14
+ const response = await fetch(instrospectionURL, options);
15
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
16
+ const json = await response.json();
17
+ debug(`The identity token is valid: ${json.valid}`);
18
+ return json.valid;
19
+ // eslint-disable-next-line no-catch-all/no-catch-all
20
+ }
21
+ catch (error) {
22
+ debug(`The identity token is invalid: ${error}`);
23
+ return false;
24
+ }
25
+ }
26
+ async function getInstrospectionEndpoint() {
27
+ const response = await fetch(`https://${await identity()}/.well-known/openid-configuration.json`);
28
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
29
+ const json = await response.json();
30
+ return json.introspection_endpoint;
31
+ }
32
+ //# sourceMappingURL=identity.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"identity.js","sourceRoot":"","sources":["../../src/api/identity.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,QAAQ,EAAC,MAAM,wBAAwB,CAAA;AAC/C,OAAO,EAAC,KAAK,EAAC,MAAM,cAAc,CAAA;AAClC,OAAO,EAAC,KAAK,EAAC,MAAM,YAAY,CAAA;AAEhC,MAAM,CAAC,KAAK,UAAU,qBAAqB,CAAC,KAAa;IACvD,IAAI;QACF,MAAM,iBAAiB,GAAG,MAAM,yBAAyB,EAAE,CAAA;QAC3D,MAAM,OAAO,GAAG;YACd,MAAM,EAAE,MAAM;YACd,gEAAgE;YAChE,OAAO,EAAE,EAAC,aAAa,EAAE,UAAU,KAAK,EAAE,EAAE,cAAc,EAAE,kBAAkB,EAAC;YAC/E,IAAI,EAAE,IAAI,CAAC,SAAS,CAAC,EAAC,KAAK,EAAC,CAAC;SAC9B,CAAA;QACD,KAAK,CAAC,kDAAkD,iBAAiB,EAAE,CAAC,CAAA;QAE5E,MAAM,QAAQ,GAAG,MAAM,KAAK,CAAC,iBAAiB,EAAE,OAAO,CAAC,CAAA;QACxD,8DAA8D;QAC9D,MAAM,IAAI,GAAQ,MAAM,QAAQ,CAAC,IAAI,EAAE,CAAA;QAEvC,KAAK,CAAC,gCAAgC,IAAI,CAAC,KAAK,EAAE,CAAC,CAAA;QACnD,OAAO,IAAI,CAAC,KAAK,CAAA;QACjB,qDAAqD;KACtD;IAAC,OAAO,KAAK,EAAE;QACd,KAAK,CAAC,kCAAkC,KAAK,EAAE,CAAC,CAAA;QAChD,OAAO,KAAK,CAAA;KACb;AACH,CAAC;AAED,KAAK,UAAU,yBAAyB;IACtC,MAAM,QAAQ,GAAG,MAAM,KAAK,CAAC,WAAW,MAAM,QAAQ,EAAE,wCAAwC,CAAC,CAAA;IACjG,8DAA8D;IAC9D,MAAM,IAAI,GAAQ,MAAM,QAAQ,CAAC,IAAI,EAAE,CAAA;IACvC,OAAO,IAAI,CAAC,sBAAsB,CAAA;AACpC,CAAC","sourcesContent":["import {identity} from '../environment/fqdn.js'\nimport {debug} from '../output.js'\nimport {fetch} from '../http.js'\n\nexport async function validateIdentityToken(token: string) {\n try {\n const instrospectionURL = await getInstrospectionEndpoint()\n const options = {\n method: 'POST',\n // eslint-disable-next-line @typescript-eslint/naming-convention\n headers: {Authorization: `Bearer ${token}`, 'Content-Type': 'application/json'},\n body: JSON.stringify({token}),\n }\n debug(`Sending Identity Introspection request to URL: ${instrospectionURL}`)\n\n const response = await fetch(instrospectionURL, options)\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n const json: any = await response.json()\n\n debug(`The identity token is valid: ${json.valid}`)\n return json.valid\n // eslint-disable-next-line no-catch-all/no-catch-all\n } catch (error) {\n debug(`The identity token is invalid: ${error}`)\n return false\n }\n}\n\nasync function getInstrospectionEndpoint(): Promise<string> {\n const response = await fetch(`https://${await identity()}/.well-known/openid-configuration.json`)\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n const json: any = await response.json()\n return json.introspection_endpoint\n}\n"]}
@@ -0,0 +1,25 @@
1
+ import { ExtendableError } from '../error.js';
2
+ import { Variables, RequestDocument } from 'graphql-request';
3
+ export declare class RequestClientError extends ExtendableError {
4
+ statusCode: number;
5
+ constructor(message: string, statusCode: number);
6
+ }
7
+ export declare function request<T>(query: RequestDocument, token: string, variables?: Variables): Promise<T>;
8
+ /**
9
+ * Check if the given token is revoked and no longer valid to interact with the Partners API.
10
+ * @param token {string} - The token to check
11
+ * @returns {Promise<boolean>} - True if the token is revoked, false otherwise
12
+ */
13
+ export declare function checkIfTokenIsRevoked(token: string): Promise<boolean>;
14
+ /**
15
+ * Function queries are proxied through the script service proxy.
16
+ * To execute a query, we encapsulate it inside another query (including the variables)
17
+ * This is done automatically, you just need to provide the query and the variables.
18
+ *
19
+ * @param apiKey {string} APIKey of the app where the query will be executed.
20
+ * @param query {any} GraphQL query to execute.
21
+ * @param token {string} Partners token
22
+ * @param variables {any} GraphQL variables to pass to the query.
23
+ * @returns {Promise<T>} The response of the query.
24
+ */
25
+ export declare function functionProxyRequest<T>(apiKey: string, query: unknown, token: string, variables?: unknown): Promise<T>;
@@ -0,0 +1,100 @@
1
+ import { buildHeaders, sanitizedHeadersOutput } from './common.js';
2
+ import { ScriptServiceProxyQuery } from './graphql/index.js';
3
+ import { partners as partnersFqdn } from '../environment/fqdn.js';
4
+ import { debug, stringifyMessage, content, token as outputToken } from '../output.js';
5
+ import { ExtendableError } from '../error.js';
6
+ import { request as graphqlRequest, ClientError, gql } from 'graphql-request';
7
+ export class RequestClientError extends ExtendableError {
8
+ constructor(message, statusCode) {
9
+ super(message);
10
+ this.statusCode = statusCode;
11
+ }
12
+ }
13
+ export async function request(query, token, variables) {
14
+ const fqdn = await partnersFqdn();
15
+ const url = `https://${fqdn}/api/cli/graphql`;
16
+ const headers = await buildHeaders(token);
17
+ debug(`
18
+ Sending Partners GraphQL request:
19
+ ${query}
20
+
21
+ With variables:
22
+ ${variables ? JSON.stringify(variables, null, 2) : ''}
23
+
24
+ And headers:
25
+ ${sanitizedHeadersOutput(headers)}
26
+ `);
27
+ try {
28
+ const response = await graphqlRequest(url, query, variables, headers);
29
+ return response;
30
+ }
31
+ catch (error) {
32
+ if (error instanceof ClientError) {
33
+ const errorMessage = stringifyMessage(content `
34
+ The Partners GraphQL API responded unsuccessfully with the HTTP status ${`${error.response.status}`} and errors:
35
+
36
+ ${outputToken.json(error.response.errors)}
37
+ `);
38
+ const mappedError = new RequestClientError(errorMessage, error.response.status);
39
+ mappedError.stack = error.stack;
40
+ throw mappedError;
41
+ }
42
+ else {
43
+ throw error;
44
+ }
45
+ }
46
+ }
47
+ /**
48
+ * Check if the given token is revoked and no longer valid to interact with the Partners API.
49
+ * @param token {string} - The token to check
50
+ * @returns {Promise<boolean>} - True if the token is revoked, false otherwise
51
+ */
52
+ export async function checkIfTokenIsRevoked(token) {
53
+ const query = gql `
54
+ {
55
+ organizations(first: 1) {
56
+ nodes {
57
+ id
58
+ }
59
+ }
60
+ }
61
+ `;
62
+ const fqdn = await partnersFqdn();
63
+ const url = `https://${fqdn}/api/cli/graphql`;
64
+ const headers = await buildHeaders(token);
65
+ try {
66
+ await graphqlRequest(url, query, {}, headers);
67
+ return false;
68
+ // eslint-disable-next-line no-catch-all/no-catch-all
69
+ }
70
+ catch (error) {
71
+ if (error instanceof ClientError) {
72
+ return error.response.status === 401;
73
+ }
74
+ return false;
75
+ }
76
+ }
77
+ /**
78
+ * Function queries are proxied through the script service proxy.
79
+ * To execute a query, we encapsulate it inside another query (including the variables)
80
+ * This is done automatically, you just need to provide the query and the variables.
81
+ *
82
+ * @param apiKey {string} APIKey of the app where the query will be executed.
83
+ * @param query {any} GraphQL query to execute.
84
+ * @param token {string} Partners token
85
+ * @param variables {any} GraphQL variables to pass to the query.
86
+ * @returns {Promise<T>} The response of the query.
87
+ */
88
+ export async function functionProxyRequest(apiKey, query, token, variables) {
89
+ const proxyVariables = {
90
+ // eslint-disable-next-line @typescript-eslint/naming-convention
91
+ api_key: apiKey,
92
+ query,
93
+ variables: JSON.stringify(variables) || '{}',
94
+ };
95
+ const proxyQuery = ScriptServiceProxyQuery;
96
+ const res = await request(proxyQuery, token, proxyVariables);
97
+ const json = JSON.parse(res.scriptServiceProxy);
98
+ return json;
99
+ }
100
+ //# sourceMappingURL=partners.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"partners.js","sourceRoot":"","sources":["../../src/api/partners.ts"],"names":[],"mappings":"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","sourcesContent":["import {buildHeaders, sanitizedHeadersOutput} from './common.js'\nimport {ScriptServiceProxyQuery} from './graphql/index.js'\nimport {partners as partnersFqdn} from '../environment/fqdn.js'\nimport {debug, stringifyMessage, content, token as outputToken} from '../output.js'\nimport {ExtendableError} from '../error.js'\nimport {request as graphqlRequest, Variables, RequestDocument, ClientError, gql} from 'graphql-request'\n\nexport class RequestClientError extends ExtendableError {\n statusCode: number\n public constructor(message: string, statusCode: number) {\n super(message)\n this.statusCode = statusCode\n }\n}\n\nexport async function request<T>(query: RequestDocument, token: string, variables?: Variables): Promise<T> {\n const fqdn = await partnersFqdn()\n const url = `https://${fqdn}/api/cli/graphql`\n const headers = await buildHeaders(token)\n debug(`\nSending Partners GraphQL request:\n${query}\n\nWith variables:\n${variables ? JSON.stringify(variables, null, 2) : ''}\n\nAnd headers:\n${sanitizedHeadersOutput(headers)}\n `)\n\n try {\n const response = await graphqlRequest<T>(url, query, variables, headers)\n return response\n } catch (error) {\n if (error instanceof ClientError) {\n const errorMessage = stringifyMessage(content`\nThe Partners GraphQL API responded unsuccessfully with the HTTP status ${`${error.response.status}`} and errors:\n\n${outputToken.json(error.response.errors)}\n `)\n const mappedError = new RequestClientError(errorMessage, error.response.status)\n mappedError.stack = error.stack\n throw mappedError\n } else {\n throw error\n }\n }\n}\n\n/**\n * Check if the given token is revoked and no longer valid to interact with the Partners API.\n * @param token {string} - The token to check\n * @returns {Promise<boolean>} - True if the token is revoked, false otherwise\n */\nexport async function checkIfTokenIsRevoked(token: string): Promise<boolean> {\n const query = gql`\n {\n organizations(first: 1) {\n nodes {\n id\n }\n }\n }\n `\n\n const fqdn = await partnersFqdn()\n const url = `https://${fqdn}/api/cli/graphql`\n const headers = await buildHeaders(token)\n\n try {\n await graphqlRequest(url, query, {}, headers)\n return false\n // eslint-disable-next-line no-catch-all/no-catch-all\n } catch (error) {\n if (error instanceof ClientError) {\n return error.response.status === 401\n }\n return false\n }\n}\n\ninterface ProxyResponse {\n scriptServiceProxy: string\n}\n\n/**\n * Function queries are proxied through the script service proxy.\n * To execute a query, we encapsulate it inside another query (including the variables)\n * This is done automatically, you just need to provide the query and the variables.\n *\n * @param apiKey {string} APIKey of the app where the query will be executed.\n * @param query {any} GraphQL query to execute.\n * @param token {string} Partners token\n * @param variables {any} GraphQL variables to pass to the query.\n * @returns {Promise<T>} The response of the query.\n */\nexport async function functionProxyRequest<T>(\n apiKey: string,\n query: unknown,\n token: string,\n variables?: unknown,\n): Promise<T> {\n const proxyVariables = {\n // eslint-disable-next-line @typescript-eslint/naming-convention\n api_key: apiKey,\n query,\n variables: JSON.stringify(variables) || '{}',\n }\n const proxyQuery = ScriptServiceProxyQuery\n const res: ProxyResponse = await request(proxyQuery, token, proxyVariables)\n const json = JSON.parse(res.scriptServiceProxy)\n return json as T\n}\n"]}
package/dist/api.d.ts ADDED
@@ -0,0 +1,5 @@
1
+ import * as admin from './api/admin.js';
2
+ import * as partners from './api/partners.js';
3
+ import * as graphql from './api/graphql/index.js';
4
+ import * as identity from './api/identity.js';
5
+ export { admin, partners, graphql, identity };
package/dist/api.js ADDED
@@ -0,0 +1,6 @@
1
+ import * as admin from './api/admin.js';
2
+ import * as partners from './api/partners.js';
3
+ import * as graphql from './api/graphql/index.js';
4
+ import * as identity from './api/identity.js';
5
+ export { admin, partners, graphql, identity };
6
+ //# sourceMappingURL=api.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"api.js","sourceRoot":"","sources":["../src/api.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,gBAAgB,CAAA;AACvC,OAAO,KAAK,QAAQ,MAAM,mBAAmB,CAAA;AAC7C,OAAO,KAAK,OAAO,MAAM,wBAAwB,CAAA;AACjD,OAAO,KAAK,QAAQ,MAAM,mBAAmB,CAAA;AAE7C,OAAO,EAAC,KAAK,EAAE,QAAQ,EAAE,OAAO,EAAE,QAAQ,EAAC,CAAA","sourcesContent":["import * as admin from './api/admin.js'\nimport * as partners from './api/partners.js'\nimport * as graphql from './api/graphql/index.js'\nimport * as identity from './api/identity.js'\n\nexport {admin, partners, graphql, identity}\n"]}
package/dist/cli.d.ts ADDED
@@ -0,0 +1,7 @@
1
+ /**
2
+ * An object that contains the flags that
3
+ * are shared across all the commands.
4
+ */
5
+ export declare const globalFlags: {
6
+ verbose: import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
7
+ };
package/dist/cli.js ADDED
@@ -0,0 +1,13 @@
1
+ import { Flags } from '@oclif/core';
2
+ /**
3
+ * An object that contains the flags that
4
+ * are shared across all the commands.
5
+ */
6
+ export const globalFlags = {
7
+ verbose: Flags.boolean({
8
+ hidden: false,
9
+ description: 'Increase the verbosity of the logs.',
10
+ env: 'SHOPIFY_FLAG_VERBOSE',
11
+ }),
12
+ };
13
+ //# sourceMappingURL=cli.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"cli.js","sourceRoot":"","sources":["../src/cli.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,KAAK,EAAC,MAAM,aAAa,CAAA;AAEjC;;;GAGG;AACH,MAAM,CAAC,MAAM,WAAW,GAAG;IACzB,OAAO,EAAE,KAAK,CAAC,OAAO,CAAC;QACrB,MAAM,EAAE,KAAK;QACb,WAAW,EAAE,qCAAqC;QAClD,GAAG,EAAE,sBAAsB;KAC5B,CAAC;CACH,CAAA","sourcesContent":["import {Flags} from '@oclif/core'\n\n/**\n * An object that contains the flags that\n * are shared across all the commands.\n */\nexport const globalFlags = {\n verbose: Flags.boolean({\n hidden: false,\n description: 'Increase the verbosity of the logs.',\n env: 'SHOPIFY_FLAG_VERBOSE',\n }),\n}\n"]}
@@ -0,0 +1,43 @@
1
+ declare const constants: {
2
+ environmentVariables: {
3
+ unitTest: string;
4
+ shopifyConfig: string;
5
+ runAsUser: string;
6
+ partnersEnv: string;
7
+ shopifyEnv: string;
8
+ identityEnv: string;
9
+ spin: string;
10
+ spinInstance: string;
11
+ spinWorkspace: string;
12
+ spinNamespace: string;
13
+ spinHost: string;
14
+ partnersToken: string;
15
+ verbose: string;
16
+ noAnalytics: string;
17
+ };
18
+ paths: {
19
+ executables: {
20
+ dev: string;
21
+ };
22
+ directories: {
23
+ cache: {
24
+ path: () => string;
25
+ vendor: {
26
+ path: () => string;
27
+ binaries: () => string;
28
+ };
29
+ };
30
+ };
31
+ };
32
+ versions: {
33
+ cliKit: () => Promise<string>;
34
+ };
35
+ keychain: {
36
+ service: string;
37
+ };
38
+ session: {
39
+ expirationTimeMarginInMinutes: number;
40
+ };
41
+ };
42
+ export declare const bugsnagApiKey = "9e1e6889176fd0c795d5c659225e0fae";
43
+ export default constants;
@@ -0,0 +1,63 @@
1
+ // eslint-disable-next-line @typescript-eslint/ban-ts-comment
2
+ // @ts-ignore
3
+ import { join as pathJoin } from './path.js';
4
+ import { findPackageVersionUp } from './version.js';
5
+ import envPaths from 'env-paths';
6
+ const identifier = 'shopify-cli';
7
+ const cacheFolder = () => {
8
+ if (process.env.XDG_CACHE_HOME)
9
+ return process.env.XDG_CACHE_HOME;
10
+ return envPaths(identifier).cache;
11
+ };
12
+ const constants = {
13
+ environmentVariables: {
14
+ unitTest: 'SHOPIFY_UNIT_TEST',
15
+ shopifyConfig: 'SHOPIFY_CONFIG',
16
+ runAsUser: 'SHOPIFY_RUN_AS_USER',
17
+ partnersEnv: 'SHOPIFY_PARTNERS_ENV',
18
+ shopifyEnv: 'SHOPIFY_SHOPIFY_ENV',
19
+ identityEnv: 'SHOPIFY_IDENTITY_ENV',
20
+ spin: 'SPIN',
21
+ spinInstance: 'SPIN_INSTANCE',
22
+ spinWorkspace: 'SPIN_WORKSPACE',
23
+ spinNamespace: 'SPIN_NAMESPACE',
24
+ spinHost: 'SPIN_HOST',
25
+ partnersToken: 'SHOPIFY_CLI_PARTNERS_TOKEN',
26
+ verbose: 'SHOPIFY_FLAG_VERBOSE',
27
+ noAnalytics: 'SHOPIFY_CLI_NO_ANALYTICS',
28
+ },
29
+ paths: {
30
+ executables: {
31
+ dev: '/opt/dev/bin/dev',
32
+ },
33
+ directories: {
34
+ cache: {
35
+ path: () => {
36
+ return cacheFolder();
37
+ },
38
+ vendor: {
39
+ path: () => {
40
+ return pathJoin(cacheFolder(), 'vendor');
41
+ },
42
+ binaries: () => {
43
+ return pathJoin(cacheFolder(), 'vendor', 'binaries');
44
+ },
45
+ },
46
+ },
47
+ },
48
+ },
49
+ versions: {
50
+ cliKit: async () => {
51
+ return findPackageVersionUp({ fromModuleURL: import.meta.url });
52
+ },
53
+ },
54
+ keychain: {
55
+ service: 'shopify-cli',
56
+ },
57
+ session: {
58
+ expirationTimeMarginInMinutes: 4,
59
+ },
60
+ };
61
+ export const bugsnagApiKey = '9e1e6889176fd0c795d5c659225e0fae';
62
+ export default constants;
63
+ //# sourceMappingURL=constants.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"constants.js","sourceRoot":"","sources":["../src/constants.ts"],"names":[],"mappings":"AAAA,6DAA6D;AAC7D,aAAa;AACb,OAAO,EAAC,IAAI,IAAI,QAAQ,EAAC,MAAM,WAAW,CAAA;AAC1C,OAAO,EAAC,oBAAoB,EAAC,MAAM,cAAc,CAAA;AACjD,OAAO,QAAQ,MAAM,WAAW,CAAA;AAEhC,MAAM,UAAU,GAAG,aAAa,CAAA;AAEhC,MAAM,WAAW,GAAG,GAAG,EAAE;IACvB,IAAI,OAAO,CAAC,GAAG,CAAC,cAAc;QAAE,OAAO,OAAO,CAAC,GAAG,CAAC,cAAc,CAAA;IACjE,OAAO,QAAQ,CAAC,UAAU,CAAC,CAAC,KAAK,CAAA;AACnC,CAAC,CAAA;AAED,MAAM,SAAS,GAAG;IAChB,oBAAoB,EAAE;QACpB,QAAQ,EAAE,mBAAmB;QAC7B,aAAa,EAAE,gBAAgB;QAC/B,SAAS,EAAE,qBAAqB;QAChC,WAAW,EAAE,sBAAsB;QACnC,UAAU,EAAE,qBAAqB;QACjC,WAAW,EAAE,sBAAsB;QACnC,IAAI,EAAE,MAAM;QACZ,YAAY,EAAE,eAAe;QAC7B,aAAa,EAAE,gBAAgB;QAC/B,aAAa,EAAE,gBAAgB;QAC/B,QAAQ,EAAE,WAAW;QACrB,aAAa,EAAE,4BAA4B;QAC3C,OAAO,EAAE,sBAAsB;QAC/B,WAAW,EAAE,0BAA0B;KACxC;IACD,KAAK,EAAE;QACL,WAAW,EAAE;YACX,GAAG,EAAE,kBAAkB;SACxB;QACD,WAAW,EAAE;YACX,KAAK,EAAE;gBACL,IAAI,EAAE,GAAG,EAAE;oBACT,OAAO,WAAW,EAAE,CAAA;gBACtB,CAAC;gBACD,MAAM,EAAE;oBACN,IAAI,EAAE,GAAG,EAAE;wBACT,OAAO,QAAQ,CAAC,WAAW,EAAE,EAAE,QAAQ,CAAC,CAAA;oBAC1C,CAAC;oBACD,QAAQ,EAAE,GAAG,EAAE;wBACb,OAAO,QAAQ,CAAC,WAAW,EAAE,EAAE,QAAQ,EAAE,UAAU,CAAC,CAAA;oBACtD,CAAC;iBACF;aACF;SACF;KACF;IACD,QAAQ,EAAE;QACR,MAAM,EAAE,KAAK,IAAI,EAAE;YACjB,OAAO,oBAAoB,CAAC,EAAC,aAAa,EAAE,MAAM,CAAC,IAAI,CAAC,GAAG,EAAC,CAAC,CAAA;QAC/D,CAAC;KACF;IACD,QAAQ,EAAE;QACR,OAAO,EAAE,aAAa;KACvB;IACD,OAAO,EAAE;QACP,6BAA6B,EAAE,CAAC;KACjC;CACF,CAAA;AAED,MAAM,CAAC,MAAM,aAAa,GAAG,kCAAkC,CAAA;AAE/D,eAAe,SAAS,CAAA","sourcesContent":["// eslint-disable-next-line @typescript-eslint/ban-ts-comment\n// @ts-ignore\nimport {join as pathJoin} from './path.js'\nimport {findPackageVersionUp} from './version.js'\nimport envPaths from 'env-paths'\n\nconst identifier = 'shopify-cli'\n\nconst cacheFolder = () => {\n if (process.env.XDG_CACHE_HOME) return process.env.XDG_CACHE_HOME\n return envPaths(identifier).cache\n}\n\nconst constants = {\n environmentVariables: {\n unitTest: 'SHOPIFY_UNIT_TEST',\n shopifyConfig: 'SHOPIFY_CONFIG',\n runAsUser: 'SHOPIFY_RUN_AS_USER',\n partnersEnv: 'SHOPIFY_PARTNERS_ENV',\n shopifyEnv: 'SHOPIFY_SHOPIFY_ENV',\n identityEnv: 'SHOPIFY_IDENTITY_ENV',\n spin: 'SPIN',\n spinInstance: 'SPIN_INSTANCE',\n spinWorkspace: 'SPIN_WORKSPACE',\n spinNamespace: 'SPIN_NAMESPACE',\n spinHost: 'SPIN_HOST',\n partnersToken: 'SHOPIFY_CLI_PARTNERS_TOKEN',\n verbose: 'SHOPIFY_FLAG_VERBOSE',\n noAnalytics: 'SHOPIFY_CLI_NO_ANALYTICS',\n },\n paths: {\n executables: {\n dev: '/opt/dev/bin/dev',\n },\n directories: {\n cache: {\n path: () => {\n return cacheFolder()\n },\n vendor: {\n path: () => {\n return pathJoin(cacheFolder(), 'vendor')\n },\n binaries: () => {\n return pathJoin(cacheFolder(), 'vendor', 'binaries')\n },\n },\n },\n },\n },\n versions: {\n cliKit: async () => {\n return findPackageVersionUp({fromModuleURL: import.meta.url})\n },\n },\n keychain: {\n service: 'shopify-cli',\n },\n session: {\n expirationTimeMarginInMinutes: 4,\n },\n}\n\nexport const bugsnagApiKey = '9e1e6889176fd0c795d5c659225e0fae'\n\nexport default constants\n"]}
@@ -0,0 +1,23 @@
1
+ import { Abort } from '../error.js';
2
+ export declare const CouldntObtainPartnersSpinFQDNError: Abort;
3
+ export declare const CouldntObtainIdentitySpinFQDNError: Abort;
4
+ export declare const CouldntObtainShopifySpinFQDNError: Abort;
5
+ export declare const NotProvidedStoreFQDNError: Abort;
6
+ /**
7
+ * It returns the Partners' API service we should interact with.
8
+ * @returns {string} Fully-qualified domain of the partners service we should interact with.
9
+ */
10
+ export declare function partners(): Promise<string>;
11
+ /**
12
+ * It returns the Identity service we should interact with.
13
+ * @returns {string} Fully-qualified domain of the Identity service we should interact with.
14
+ */
15
+ export declare function identity(): Promise<string>;
16
+ /**
17
+ * It returns the Shopify service we should interact with.
18
+ * Note the same fqdn is sued for the Admin and the Storefront Renderer APIs.
19
+ * @returns {string} Fully-qualified domain of the Shopify service we should interact with.
20
+ */
21
+ export declare function shopify(options?: {
22
+ storeFqdn?: string;
23
+ }): Promise<string>;