@shopify/shopify-app-remix 1.2.1 → 2.0.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 (187) hide show
  1. package/README.md +35 -284
  2. package/build/cjs/react/components/AppProvider/AppProvider.js +35 -4
  3. package/build/cjs/server/authenticate/admin/billing/request.js +4 -2
  4. package/build/cjs/server/authenticate/public/appProxy/authenticate.js +7 -1
  5. package/build/cjs/server/authenticate/public/factory.js +1 -1
  6. package/build/cjs/server/authenticate/webhooks/authenticate.js +38 -20
  7. package/build/cjs/server/boundary/index.js +6 -6
  8. package/build/cjs/server/clients/storefront/factory.js +35 -0
  9. package/build/cjs/server/shopify-app.js +11 -9
  10. package/build/cjs/server/types.js +1 -1
  11. package/build/cjs/server/unauthenticated/admin/factory.js +2 -2
  12. package/build/cjs/server/unauthenticated/helpers/get-offline-session.js +14 -0
  13. package/build/cjs/server/unauthenticated/storefront/factory.js +25 -0
  14. package/build/cjs/server/version.js +1 -1
  15. package/build/ts/react/components/AppProvider/AppProvider.d.ts +48 -8
  16. package/build/ts/react/components/AppProvider/AppProvider.d.ts.map +1 -1
  17. package/build/ts/react/components/AppProvider/AppProvider.doc.d.ts +4 -0
  18. package/build/ts/react/components/AppProvider/AppProvider.doc.d.ts.map +1 -0
  19. package/build/ts/react/components/AppProvider/AppProvider.doc.js +34 -0
  20. package/build/ts/react/components/AppProvider/AppProvider.doc.js.map +1 -0
  21. package/build/ts/react/components/AppProvider/AppProvider.js +35 -3
  22. package/build/ts/react/components/AppProvider/AppProvider.js.map +1 -1
  23. package/build/ts/server/__test-helpers/expect-admin-api-client.d.ts +1 -1
  24. package/build/ts/server/__test-helpers/expect-admin-api-client.d.ts.map +1 -1
  25. package/build/ts/server/__test-helpers/expect-storefront-api-client.d.ts +8 -0
  26. package/build/ts/server/__test-helpers/expect-storefront-api-client.d.ts.map +1 -0
  27. package/build/ts/server/__test-helpers/expect-storefront-api-client.js +57 -0
  28. package/build/ts/server/__test-helpers/expect-storefront-api-client.js.map +1 -0
  29. package/build/ts/server/__test-helpers/index.d.ts +1 -0
  30. package/build/ts/server/__test-helpers/index.d.ts.map +1 -1
  31. package/build/ts/server/__test-helpers/index.js +1 -0
  32. package/build/ts/server/__test-helpers/index.js.map +1 -1
  33. package/build/ts/server/__test-helpers/test-config.d.ts +9 -4
  34. package/build/ts/server/__test-helpers/test-config.d.ts.map +1 -1
  35. package/build/ts/server/__test-helpers/test-config.js +2 -2
  36. package/build/ts/server/__test-helpers/test-config.js.map +1 -1
  37. package/build/ts/server/authenticate/admin/authenticate.admin.doc.d.ts +4 -0
  38. package/build/ts/server/authenticate/admin/authenticate.admin.doc.d.ts.map +1 -0
  39. package/build/ts/server/authenticate/admin/authenticate.admin.doc.js +35 -0
  40. package/build/ts/server/authenticate/admin/authenticate.admin.doc.js.map +1 -0
  41. package/build/ts/server/authenticate/admin/authenticate.d.ts.map +1 -1
  42. package/build/ts/server/authenticate/admin/authenticate.js.map +1 -1
  43. package/build/ts/server/authenticate/admin/billing/authenticate.admin.billing.doc.d.ts +4 -0
  44. package/build/ts/server/authenticate/admin/billing/authenticate.admin.billing.doc.d.ts.map +1 -0
  45. package/build/ts/server/authenticate/admin/billing/authenticate.admin.billing.doc.js +26 -0
  46. package/build/ts/server/authenticate/admin/billing/authenticate.admin.billing.doc.js.map +1 -0
  47. package/build/ts/server/authenticate/admin/billing/request.d.ts +1 -1
  48. package/build/ts/server/authenticate/admin/billing/request.d.ts.map +1 -1
  49. package/build/ts/server/authenticate/admin/billing/request.js +2 -8
  50. package/build/ts/server/authenticate/admin/billing/request.js.map +1 -1
  51. package/build/ts/server/authenticate/admin/billing/types.d.ts +71 -63
  52. package/build/ts/server/authenticate/admin/billing/types.d.ts.map +1 -1
  53. package/build/ts/server/authenticate/admin/types.d.ts +76 -40
  54. package/build/ts/server/authenticate/admin/types.d.ts.map +1 -1
  55. package/build/ts/server/authenticate/helpers/add-response-headers.d.ts +2 -1
  56. package/build/ts/server/authenticate/helpers/add-response-headers.d.ts.map +1 -1
  57. package/build/ts/server/authenticate/helpers/add-response-headers.js.map +1 -1
  58. package/build/ts/server/authenticate/public/appProxy/authenticate.d.ts.map +1 -1
  59. package/build/ts/server/authenticate/public/appProxy/authenticate.js +4 -2
  60. package/build/ts/server/authenticate/public/appProxy/authenticate.js.map +1 -1
  61. package/build/ts/server/authenticate/public/appProxy/authenticate.public.app-proxy.doc.d.ts +4 -0
  62. package/build/ts/server/authenticate/public/appProxy/authenticate.public.app-proxy.doc.d.ts.map +1 -0
  63. package/build/ts/server/authenticate/public/appProxy/authenticate.public.app-proxy.doc.js +32 -0
  64. package/build/ts/server/authenticate/public/appProxy/authenticate.public.app-proxy.doc.js.map +1 -0
  65. package/build/ts/server/authenticate/public/appProxy/types.d.ts +64 -8
  66. package/build/ts/server/authenticate/public/appProxy/types.d.ts.map +1 -1
  67. package/build/ts/server/authenticate/public/checkout/authenticate.public.checkout.doc.d.ts +4 -0
  68. package/build/ts/server/authenticate/public/checkout/authenticate.public.checkout.doc.d.ts.map +1 -0
  69. package/build/ts/server/authenticate/public/checkout/authenticate.public.checkout.doc.js +21 -0
  70. package/build/ts/server/authenticate/public/checkout/authenticate.public.checkout.doc.js.map +1 -0
  71. package/build/ts/server/authenticate/public/checkout/types.d.ts +19 -17
  72. package/build/ts/server/authenticate/public/checkout/types.d.ts.map +1 -1
  73. package/build/ts/server/authenticate/public/factory.js +1 -1
  74. package/build/ts/server/authenticate/public/types.d.ts +23 -21
  75. package/build/ts/server/authenticate/public/types.d.ts.map +1 -1
  76. package/build/ts/server/authenticate/webhooks/authenticate.d.ts +3 -2
  77. package/build/ts/server/authenticate/webhooks/authenticate.d.ts.map +1 -1
  78. package/build/ts/server/authenticate/webhooks/authenticate.js +31 -19
  79. package/build/ts/server/authenticate/webhooks/authenticate.js.map +1 -1
  80. package/build/ts/server/authenticate/webhooks/authenticate.webhooks.doc.d.ts +4 -0
  81. package/build/ts/server/authenticate/webhooks/authenticate.webhooks.doc.d.ts.map +1 -0
  82. package/build/ts/server/authenticate/webhooks/authenticate.webhooks.doc.js +27 -0
  83. package/build/ts/server/authenticate/webhooks/authenticate.webhooks.doc.js.map +1 -0
  84. package/build/ts/server/authenticate/webhooks/types.d.ts +170 -6
  85. package/build/ts/server/authenticate/webhooks/types.d.ts.map +1 -1
  86. package/build/ts/server/boundary/index.d.ts +6 -6
  87. package/build/ts/server/boundary/index.js +6 -6
  88. package/build/ts/server/clients/admin/authenticate.admin.api.doc.d.ts +4 -0
  89. package/build/ts/server/clients/admin/authenticate.admin.api.doc.d.ts.map +1 -0
  90. package/build/ts/server/clients/admin/authenticate.admin.api.doc.js +32 -0
  91. package/build/ts/server/clients/admin/authenticate.admin.api.doc.js.map +1 -0
  92. package/build/ts/server/clients/admin/factory.d.ts +1 -1
  93. package/build/ts/server/clients/admin/factory.d.ts.map +1 -1
  94. package/build/ts/server/clients/admin/factory.js.map +1 -1
  95. package/build/ts/server/clients/admin/graphql.d.ts +3 -15
  96. package/build/ts/server/clients/admin/graphql.d.ts.map +1 -1
  97. package/build/ts/server/clients/admin/graphql.js.map +1 -1
  98. package/build/ts/server/clients/admin/index.d.ts +1 -0
  99. package/build/ts/server/clients/admin/index.d.ts.map +1 -1
  100. package/build/ts/server/clients/admin/index.js +1 -0
  101. package/build/ts/server/clients/admin/index.js.map +1 -1
  102. package/build/ts/server/clients/admin/rest.d.ts +1 -1
  103. package/build/ts/server/clients/admin/rest.d.ts.map +1 -1
  104. package/build/ts/server/clients/admin/types.d.ts +105 -1
  105. package/build/ts/server/clients/admin/types.d.ts.map +1 -1
  106. package/build/ts/server/clients/index.d.ts +3 -0
  107. package/build/ts/server/clients/index.d.ts.map +1 -0
  108. package/build/ts/server/clients/index.js +6 -0
  109. package/build/ts/server/clients/index.js.map +1 -0
  110. package/build/ts/server/clients/storefront/authenticate.storefront.api.doc.d.ts +4 -0
  111. package/build/ts/server/clients/storefront/authenticate.storefront.api.doc.d.ts.map +1 -0
  112. package/build/ts/server/clients/storefront/authenticate.storefront.api.doc.js +32 -0
  113. package/build/ts/server/clients/storefront/authenticate.storefront.api.doc.js.map +1 -0
  114. package/build/ts/server/clients/storefront/factory.d.ts +8 -0
  115. package/build/ts/server/clients/storefront/factory.d.ts.map +1 -0
  116. package/build/ts/server/clients/storefront/factory.js +39 -0
  117. package/build/ts/server/clients/storefront/factory.js.map +1 -0
  118. package/build/ts/server/clients/storefront/index.d.ts +3 -0
  119. package/build/ts/server/clients/storefront/index.d.ts.map +1 -0
  120. package/build/ts/server/clients/storefront/index.js +6 -0
  121. package/build/ts/server/clients/storefront/index.js.map +1 -0
  122. package/build/ts/server/clients/storefront/types.d.ts +29 -0
  123. package/build/ts/server/clients/storefront/types.d.ts.map +1 -0
  124. package/build/ts/server/clients/storefront/types.js +3 -0
  125. package/build/ts/server/clients/storefront/types.js.map +1 -0
  126. package/build/ts/server/clients/types.d.ts +15 -0
  127. package/build/ts/server/clients/types.d.ts.map +1 -0
  128. package/build/ts/server/clients/types.js +3 -0
  129. package/build/ts/server/clients/types.js.map +1 -0
  130. package/build/ts/server/config-types.d.ts +39 -121
  131. package/build/ts/server/config-types.d.ts.map +1 -1
  132. package/build/ts/server/future/flags.d.ts +11 -0
  133. package/build/ts/server/future/flags.d.ts.map +1 -0
  134. package/build/ts/server/future/flags.js +3 -0
  135. package/build/ts/server/future/flags.js.map +1 -0
  136. package/build/ts/server/shopify-app.d.ts +3 -3
  137. package/build/ts/server/shopify-app.d.ts.map +1 -1
  138. package/build/ts/server/shopify-app.doc.d.ts +4 -0
  139. package/build/ts/server/shopify-app.doc.d.ts.map +1 -0
  140. package/build/ts/server/shopify-app.doc.js +42 -0
  141. package/build/ts/server/shopify-app.doc.js.map +1 -0
  142. package/build/ts/server/shopify-app.js +9 -8
  143. package/build/ts/server/shopify-app.js.map +1 -1
  144. package/build/ts/server/types.d.ts +202 -170
  145. package/build/ts/server/types.d.ts.map +1 -1
  146. package/build/ts/server/types.js.map +1 -1
  147. package/build/ts/server/unauthenticated/admin/factory.d.ts.map +1 -1
  148. package/build/ts/server/unauthenticated/admin/factory.js +3 -4
  149. package/build/ts/server/unauthenticated/admin/factory.js.map +1 -1
  150. package/build/ts/server/unauthenticated/admin/types.d.ts +11 -9
  151. package/build/ts/server/unauthenticated/admin/types.d.ts.map +1 -1
  152. package/build/ts/server/unauthenticated/admin/unauthenticated.admin.doc.d.ts +4 -0
  153. package/build/ts/server/unauthenticated/admin/unauthenticated.admin.doc.d.ts.map +1 -0
  154. package/build/ts/server/unauthenticated/admin/unauthenticated.admin.doc.js +29 -0
  155. package/build/ts/server/unauthenticated/admin/unauthenticated.admin.doc.js.map +1 -0
  156. package/build/ts/server/unauthenticated/helpers/get-offline-session.d.ts +4 -0
  157. package/build/ts/server/unauthenticated/helpers/get-offline-session.d.ts.map +1 -0
  158. package/build/ts/server/unauthenticated/helpers/get-offline-session.js +22 -0
  159. package/build/ts/server/unauthenticated/helpers/get-offline-session.js.map +1 -0
  160. package/build/ts/server/unauthenticated/helpers/index.d.ts +2 -0
  161. package/build/ts/server/unauthenticated/helpers/index.d.ts.map +1 -0
  162. package/build/ts/server/unauthenticated/helpers/index.js +5 -0
  163. package/build/ts/server/unauthenticated/helpers/index.js.map +1 -0
  164. package/build/ts/server/unauthenticated/storefront/factory.d.ts +4 -0
  165. package/build/ts/server/unauthenticated/storefront/factory.d.ts.map +1 -0
  166. package/build/ts/server/unauthenticated/storefront/factory.js +29 -0
  167. package/build/ts/server/unauthenticated/storefront/factory.js.map +1 -0
  168. package/build/ts/server/unauthenticated/storefront/index.d.ts +2 -0
  169. package/build/ts/server/unauthenticated/storefront/index.d.ts.map +1 -0
  170. package/build/ts/server/unauthenticated/storefront/index.js +5 -0
  171. package/build/ts/server/unauthenticated/storefront/index.js.map +1 -0
  172. package/build/ts/server/unauthenticated/storefront/types.d.ts +34 -0
  173. package/build/ts/server/unauthenticated/storefront/types.d.ts.map +1 -0
  174. package/build/ts/server/unauthenticated/storefront/types.js +3 -0
  175. package/build/ts/server/unauthenticated/storefront/types.js.map +1 -0
  176. package/build/ts/server/unauthenticated/storefront/unauthenticated.storefront.doc.d.ts +4 -0
  177. package/build/ts/server/unauthenticated/storefront/unauthenticated.storefront.doc.d.ts.map +1 -0
  178. package/build/ts/server/unauthenticated/storefront/unauthenticated.storefront.doc.js +29 -0
  179. package/build/ts/server/unauthenticated/storefront/unauthenticated.storefront.doc.js.map +1 -0
  180. package/build/ts/server/unauthenticated/types.d.ts +66 -0
  181. package/build/ts/server/unauthenticated/types.d.ts.map +1 -0
  182. package/build/ts/server/unauthenticated/types.js +3 -0
  183. package/build/ts/server/unauthenticated/types.js.map +1 -0
  184. package/build/ts/server/version.d.ts +1 -1
  185. package/build/ts/server/version.js +1 -1
  186. package/package.json +11 -6
  187. package/build/tsconfig.tsbuildinfo +0 -1
@@ -1 +1 @@
1
- {"version":3,"file":"add-response-headers.js","sourceRoot":"","sources":["../../../../../src/server/authenticate/helpers/add-response-headers.ts"],"names":[],"mappings":";;;AAEA,SAAgB,iCAAiC,CAAC,MAAmB;IAC5D,IAAA,GAAG,GAAY,MAAM,IAAlB,EAAE,MAAM,GAAI,MAAM,OAAV,CAAW;IAE7B,OAAO,UAAU,OAAgB,EAAE,OAAgB;QAC1C,IAAA,YAAY,GAAI,IAAI,GAAG,CAAC,OAAO,CAAC,GAAG,CAAC,aAAxB,CAAyB;QAC5C,IAAM,IAAI,GAAG,GAAG,CAAC,KAAK,CAAC,YAAY,CAAC,YAAY,CAAC,GAAG,CAAC,MAAM,CAAE,CAAC,CAAC;QAE/D,0BAA0B,CAAC,OAAO,EAAE,MAAM,CAAC,aAAa,EAAE,IAAI,CAAC,CAAC;IAClE,CAAC,CAAC;AACJ,CAAC;AATD,8EASC;AAED,SAAgB,0BAA0B,CACxC,OAAgB,EAChB,aAAsB,EACtB,IAA+B;IAE/B,IAAI,IAAI,EAAE;QACR,OAAO,CAAC,GAAG,CACT,MAAM,EACN,mFAAmF,CACpF,CAAC;KACH;IAED,IAAI,aAAa,EAAE;QACjB,IAAI,IAAI,EAAE;YACR,OAAO,CAAC,GAAG,CACT,yBAAyB,EACzB,kCAA2B,IAAI,mDAAgD,CAChF,CAAC;SACH;KACF;SAAM;QACL,OAAO,CAAC,GAAG,CAAC,yBAAyB,EAAE,yBAAyB,CAAC,CAAC;KACnE;AACH,CAAC;AAtBD,gEAsBC"}
1
+ {"version":3,"file":"add-response-headers.js","sourceRoot":"","sources":["../../../../../src/server/authenticate/helpers/add-response-headers.ts"],"names":[],"mappings":";;;AAOA,SAAgB,iCAAiC,CAC/C,MAAmB;IAEZ,IAAA,GAAG,GAAY,MAAM,IAAlB,EAAE,MAAM,GAAI,MAAM,OAAV,CAAW;IAE7B,OAAO,UAAU,OAAgB,EAAE,OAAgB;QAC1C,IAAA,YAAY,GAAI,IAAI,GAAG,CAAC,OAAO,CAAC,GAAG,CAAC,aAAxB,CAAyB;QAC5C,IAAM,IAAI,GAAG,GAAG,CAAC,KAAK,CAAC,YAAY,CAAC,YAAY,CAAC,GAAG,CAAC,MAAM,CAAE,CAAC,CAAC;QAE/D,0BAA0B,CAAC,OAAO,EAAE,MAAM,CAAC,aAAa,EAAE,IAAI,CAAC,CAAC;IAClE,CAAC,CAAC;AACJ,CAAC;AAXD,8EAWC;AAED,SAAgB,0BAA0B,CACxC,OAAgB,EAChB,aAAsB,EACtB,IAA+B;IAE/B,IAAI,IAAI,EAAE;QACR,OAAO,CAAC,GAAG,CACT,MAAM,EACN,mFAAmF,CACpF,CAAC;KACH;IAED,IAAI,aAAa,EAAE;QACjB,IAAI,IAAI,EAAE;YACR,OAAO,CAAC,GAAG,CACT,yBAAyB,EACzB,kCAA2B,IAAI,mDAAgD,CAChF,CAAC;SACH;KACF;SAAM;QACL,OAAO,CAAC,GAAG,CAAC,yBAAyB,EAAE,yBAAyB,CAAC,CAAC;KACnE;AACH,CAAC;AAtBD,gEAsBC"}
@@ -1 +1 @@
1
- {"version":3,"file":"authenticate.d.ts","sourceRoot":"","sources":["../../../../../../src/server/authenticate/public/appProxy/authenticate.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,oBAAoB,EAAC,MAAM,sBAAsB,CAAC;AAG1D,OAAO,EAAC,WAAW,EAAC,MAAM,gBAAgB,CAAC;AAE3C,OAAO,EAGL,oBAAoB,EAErB,MAAM,SAAS,CAAC;AAEjB,wBAAgB,2BAA2B,CACzC,SAAS,SAAS,oBAAoB,EACtC,MAAM,EAAE,WAAW,GAAG,oBAAoB,CAmD3C"}
1
+ {"version":3,"file":"authenticate.d.ts","sourceRoot":"","sources":["../../../../../../src/server/authenticate/public/appProxy/authenticate.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,oBAAoB,EAAC,MAAM,sBAAsB,CAAC;AAG1D,OAAO,EAAC,WAAW,EAAC,MAAM,gBAAgB,CAAC;AAE3C,OAAO,EAGL,oBAAoB,EAErB,MAAM,SAAS,CAAC;AAEjB,wBAAgB,2BAA2B,CACzC,SAAS,SAAS,oBAAoB,EACtC,MAAM,EAAE,WAAW,GAAG,oBAAoB,CAqD3C"}
@@ -2,7 +2,7 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.authenticateAppProxyFactory = void 0;
4
4
  var tslib_1 = require("tslib");
5
- var admin_1 = require("../../../clients/admin");
5
+ var clients_1 = require("../../../clients");
6
6
  function authenticateAppProxyFactory(params) {
7
7
  var api = params.api, config = params.config, logger = params.logger;
8
8
  return function authenticate(request) {
@@ -46,13 +46,15 @@ function authenticateAppProxyFactory(params) {
46
46
  liquid: liquid,
47
47
  session: undefined,
48
48
  admin: undefined,
49
+ storefront: undefined,
49
50
  };
50
51
  return [2 /*return*/, context_1];
51
52
  }
52
53
  context = {
53
54
  liquid: liquid,
54
55
  session: session,
55
- admin: (0, admin_1.adminClientFactory)({ params: params, session: session }),
56
+ admin: (0, clients_1.adminClientFactory)({ params: params, session: session }),
57
+ storefront: (0, clients_1.storefrontClientFactory)({ params: params, session: session }),
56
58
  };
57
59
  return [2 /*return*/, context];
58
60
  }
@@ -1 +1 @@
1
- {"version":3,"file":"authenticate.js","sourceRoot":"","sources":["../../../../../../src/server/authenticate/public/appProxy/authenticate.ts"],"names":[],"mappings":";;;;AAEA,gDAA0D;AAU1D,SAAgB,2BAA2B,CAEzC,MAAmB;IACZ,IAAA,GAAG,GAAoB,MAAM,IAA1B,EAAE,MAAM,GAAY,MAAM,OAAlB,EAAE,MAAM,GAAI,MAAM,OAAV,CAAW;IAErC,OAAO,SAAe,YAAY,CAChC,OAAO;;;;;;wBAEP,MAAM,CAAC,IAAI,CAAC,kCAAkC,CAAC,CAAC;wBAEzC,YAAY,GAAI,IAAI,GAAG,CAAC,OAAO,CAAC,GAAG,CAAC,aAAxB,CAAyB;wBACtC,KAAK,GAAG,MAAM,CAAC,WAAW,CAAC,YAAY,CAAC,OAAO,EAAE,CAAC,CAAC;wBACrD,OAAO,GAAG,KAAK,CAAC;;;;wBAGR,qBAAM,GAAG,CAAC,KAAK,CAAC,YAAY,CAAC,KAAK,EAAE;gCAC5C,QAAQ,EAAE,UAAU;6BACrB,CAAC,EAAA;;wBAFF,OAAO,GAAG,SAER,CAAC;;;;wBAEH,MAAM,CAAC,IAAI,CAAC,OAAK,CAAC,OAAO,CAAC,CAAC;wBAC3B,MAAM,IAAI,QAAQ,CAAC,SAAS,EAAE,EAAC,MAAM,EAAE,GAAG,EAAE,UAAU,EAAE,aAAa,EAAC,CAAC,CAAC;;wBAG1E,IAAI,CAAC,OAAO,EAAE;4BACZ,MAAM,CAAC,IAAI,CAAC,yCAAyC,CAAC,CAAC;4BACvD,MAAM,IAAI,QAAQ,CAAC,SAAS,EAAE;gCAC5B,MAAM,EAAE,GAAG;gCACX,UAAU,EAAE,aAAa;6BAC1B,CAAC,CAAC;yBACJ;wBAEK,IAAI,GAAG,YAAY,CAAC,GAAG,CAAC,MAAM,CAAE,CAAC;wBACjC,SAAS,GAAG,GAAG,CAAC,OAAO,CAAC,YAAY,CAAC,IAAI,CAAC,CA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ceEntityTemplateSchema } from '@shopify/generate-docs';
2
+ declare const data: ReferenceEntityTemplateSchema;
3
+ export default data;
4
+ //# sourceMappingURL=authenticate.public.app-proxy.doc.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"authenticate.public.app-proxy.doc.d.ts","sourceRoot":"","sources":["../../../../../../src/server/authenticate/public/appProxy/authenticate.public.app-proxy.doc.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,6BAA6B,EAAC,MAAM,wBAAwB,CAAC;AAErE,QAAA,MAAM,IAAI,EAAE,6BA4BX,CAAC;AAEF,eAAe,IAAI,CAAC"}
@@ -0,0 +1,32 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ var data = {
4
+ name: 'App proxy',
5
+ description: 'The `authenticate.public.appProxy` function validates app proxy requests made by Shopify, and returns a context to enable querying Shopify APIs.',
6
+ category: 'Authenticate',
7
+ subCategory: 'Public',
8
+ type: 'object',
9
+ isVisualComponent: false,
10
+ definitions: [
11
+ {
12
+ title: 'authenticate.public.appProxy',
13
+ description: 'Authenticates requests coming from Shopify app proxies.',
14
+ type: 'AuthenticateAppProxy',
15
+ },
16
+ ],
17
+ jsDocTypeExamples: ['AppProxyContextWithSession'],
18
+ related: [
19
+ {
20
+ name: 'Admin API context',
21
+ subtitle: 'Interact with the Admin API.',
22
+ url: '/docs/api/shopify-app-remix/apis/admin-api',
23
+ },
24
+ {
25
+ name: 'Storefront API context',
26
+ subtitle: 'Interact with the Storefront API.',
27
+ url: '/docs/api/shopify-app-remix/apis/storefront-api',
28
+ },
29
+ ],
30
+ };
31
+ exports.default = data;
32
+ //# sourceMappingURL=authenticate.public.app-proxy.doc.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"authenticate.public.app-proxy.doc.js","sourceRoot":"","sources":["../../../../../../src/server/authenticate/public/appProxy/authenticate.public.app-proxy.doc.ts"],"names":[],"mappings":";;AAEA,IAAM,IAAI,GAAkC;IAC1C,IAAI,EAAE,WAAW;IACjB,WAAW,EACT,kJAAkJ;IACpJ,QAAQ,EAAE,cAAc;IACxB,WAAW,EAAE,QAAQ;IACrB,IAAI,EAAE,QAAQ;IACd,iBAAiB,EAAE,KAAK;IACxB,WAAW,EAAE;QACX;YACE,KAAK,EAAE,8BAA8B;YACrC,WAAW,EAAE,yDAAyD;YACtE,IAAI,EAAE,sBAAsB;SAC7B;KACF;IACD,iBAAiB,EAAE,CAAC,4BAA4B,CAAC;IACjD,OAAO,EAAE;QACP;YACE,IAAI,EAAE,mBAAmB;YACzB,QAAQ,EAAE,8BAA8B;YACxC,GAAG,EAAE,4CAA4C;SAClD;QACD;YACE,IAAI,EAAE,wBAAwB;YAC9B,QAAQ,EAAE,mCAAmC;YAC7C,GAAG,EAAE,iDAAiD;SACvD;KACF;CACF,CAAC;AAEF,kBAAe,IAAI,CAAC"}
@@ -1,5 +1,5 @@
1
1
  import { Session, ShopifyRestResources } from '@shopify/shopify-api';
2
- import { AdminApiContext } from '../../../config-types';
2
+ import { AdminApiContext, StorefrontContext } from '../../../clients';
3
3
  export type AuthenticateAppProxy = (request: Request) => Promise<AppProxyContext | AppProxyContextWithSession>;
4
4
  interface Options {
5
5
  layout?: boolean;
@@ -10,7 +10,8 @@ interface Context {
10
10
  * A utility for creating a Liquid Response.
11
11
  *
12
12
  * @example
13
- * <caption>Returning a Liquid Response from an app proxy route</caption>
13
+ * <caption>Rendering liquid content.</caption>
14
+ * <description>Use the `liquid` helper to render a `Response` with Liquid content.</description>
14
15
  * ```ts
15
16
  * // app/routes/**\/.ts
16
17
  * import {authenticate} from "~/shopify.server"
@@ -34,9 +35,14 @@ export interface AppProxyContext extends Context {
34
35
  session: undefined;
35
36
  /**
36
37
  * No session is available for the shop that made this request.
37
- * Therefore no methods for interacting with the Shopify GraphQL / REST Admin APIs are available.
38
+ * Therefore no methods for interacting with the GraphQL / REST Admin APIs are available.
38
39
  */
39
40
  admin: undefined;
41
+ /**
42
+ * No session is available for the shop that made this request.
43
+ * Therefore no method for interacting with the Storefront API is available.
44
+ */
45
+ storefront: undefined;
40
46
  }
41
47
  export interface AppProxyContextWithSession<Resources extends ShopifyRestResources = ShopifyRestResources> extends Context {
42
48
  /**
@@ -44,27 +50,77 @@ export interface AppProxyContextWithSession<Resources extends ShopifyRestResourc
44
50
  *
45
51
  * This comes from the session storage which `shopifyApp` uses to store sessions in your database of choice.
46
52
  *
47
- * Use this to get shop or user specific data.
53
+ * Use this to get shop or user-specific data.
48
54
  *
49
55
  * @example
50
- * <caption>Getting your app's shop specific widget data using an offline session</caption>
56
+ * <caption>Using the session object.</caption>
57
+ * <description>Get your app's data using an offline session for the shop that made the request.</description>
51
58
  * ```ts
52
59
  * // app/routes/**\/.ts
53
60
  * import { json } from "@remix-run/node";
54
61
  * import { authenticate } from "../shopify.server";
55
- * import { getWidgets } from "~/db/widgets.server";
62
+ * import { getMyAppModelData } from "~/db/model.server";
56
63
  *
57
64
  * export const loader = async ({ request }) => {
58
65
  * const { session } = await authenticate.public.appProxy(request);
59
- * return json(await getWidgets({shop: session.shop));
66
+ * return json(await getMyAppModelData({shop: session.shop));
60
67
  * };
61
68
  * ```
62
69
  */
63
70
  session: Session;
64
71
  /**
65
- * Methods for interacting with the Shopify GraphQL / REST Admin APIs for the store that made the request
72
+ * Methods for interacting with the GraphQL / REST Admin APIs for the store that made the request.
73
+ *
74
+ * @example
75
+ * <caption>Interacting with the Admin API.</caption>
76
+ * <description>Use the `admin` object to interact with the REST or GraphQL APIs.</description>
77
+ * ```ts
78
+ * // app/routes/**\/.ts
79
+ * import { json } from "@remix-run/node";
80
+ * import { authenticate } from "../shopify.server";
81
+ *
82
+ * export async function action({ request }: ActionFunctionArgs) {
83
+ * const { admin } = await authenticate.public.appProxy(request);
84
+ *
85
+ * const response = await admin.graphql(
86
+ * `#graphql
87
+ * mutation populateProduct($input: ProductInput!) {
88
+ * productCreate(input: $input) {
89
+ * product {
90
+ * id
91
+ * }
92
+ * }
93
+ * }`,
94
+ * { variables: { input: { title: "Product Name" } } }
95
+ * );
96
+ *
97
+ * const productData = await response.json();
98
+ * return json({ data: productData.data });
99
+ * }
100
+ * ```
66
101
  */
67
102
  admin: AdminApiContext<Resources>;
103
+ /**
104
+ * Method for interacting with the Shopify Storefront Graphql API for the store that made the request.
105
+ *
106
+ * @example
107
+ * <caption>Interacting with the Storefront API.</caption>
108
+ * <description>Use the `storefront` object to interact with the GraphQL API.</description>
109
+ * ```ts
110
+ * // app/routes/**\/.ts
111
+ * import { json } from "@remix-run/node";
112
+ * import { authenticate } from "../shopify.server";
113
+ *
114
+ * export async function action({ request }: ActionFunctionArgs) {
115
+ * const { admin } = await authenticate.public.appProxy(request);
116
+ *
117
+ * const response = await storefront.graphql(`{blogs(first: 10) { edges { node { id } } } }`);
118
+ *
119
+ * return json(await response.json());
120
+ * }
121
+ * ```
122
+ */
123
+ storefront: StorefrontContext;
68
124
  }
69
125
  export {};
70
126
  //# sourceMappingURL=types.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../../../src/server/authenticate/public/appProxy/types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,OAAO,EAAE,oBAAoB,EAAC,MAAM,sBAAsB,CAAC;AAEnE,OAAO,EAAC,eAAe,EAAC,MAAM,uBAAuB,CAAC;AAEtD,MAAM,MAAM,oBAAoB,GAAG,CACjC,OAAO,EAAE,OAAO,KACb,OAAO,CAAC,eAAe,GAAG,0BAA0B,CAAC,CAAC;AAE3D,UAAU,OAAO;IACf,MAAM,CAAC,EAAE,OAAO,CAAC;CAClB;AAED,MAAM,MAAM,sBAAsB,GAAG,CACnC,IAAI,EAAE,MAAM,EACZ,cAAc,CAAC,EAAE,MAAM,GAAG,CAAC,YAAY,GAAG,OAAO,CAAC,KAC/C,QAAQ,CAAC;AAEd,UAAU,OAAO;IACf;;;;;;;;;;;;;;;;OAgBG;IACH,MAAM,EAAE,sBAAsB,CAAC;CAChC;AAED,MAAM,WAAW,eAAgB,SAAQ,OAAO;IAC9C;;;;OAIG;IACH,OAAO,EAAE,SAAS,CAAC;IACnB;;;OAGG;IACH,KAAK,EAAE,SAAS,CAAC;CAClB;AAED,MAAM,WAAW,0BAA0B,CACzC,SAAS,SAAS,oBAAoB,GAAG,oBAAoB,CAC7D,SAAQ,OAAO;IACf;;;;;;;;;;;;;;;;;;;;OAoBG;IACH,OAAO,EAAE,OAAO,CAAC;IACjB;;OAEG;IACH,KAAK,EAAE,eAAe,CAAC,SAAS,CAAC,CAAC;CACnC"}
1
+ {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../../../src/server/authenticate/public/appProxy/types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,OAAO,EAAE,oBAAoB,EAAC,MAAM,sBAAsB,CAAC;AAEnE,OAAO,EAAC,eAAe,EAAE,iBAAiB,EAAC,MAAM,kBAAkB,CAAC;AAEpE,MAAM,MAAM,oBAAoB,GAAG,CACjC,OAAO,EAAE,OAAO,KACb,OAAO,CAAC,eAAe,GAAG,0BAA0B,CAAC,CAAC;AAE3D,UAAU,OAAO;IACf,MAAM,CAAC,EAAE,OAAO,CAAC;CAClB;AAED,MAAM,MAAM,sBAAsB,GAAG,CACnC,IAAI,EAAE,MAAM,EACZ,cAAc,CAAC,EAAE,MAAM,GAAG,CAAC,YAAY,GAAG,OAAO,CAAC,KAC/C,QAAQ,CAAC;AAEd,UAAU,OAAO;IACf;;;;;;;;;;;;;;;;;OAiBG;IACH,MAAM,EAAE,sBAAsB,CAAC;CAChC;AAED,MAAM,WAAW,eAAgB,SAAQ,OAAO;IAC9C;;;;OAIG;IACH,OAAO,EAAE,SAAS,CAAC;IAEnB;;;OAGG;IACH,KAAK,EAAE,SAAS,CAAC;IAEjB;;;OAGG;IACH,UAAU,EAAE,SAAS,CAAC;CACvB;AAED,MAAM,WAAW,0BAA0B,CACzC,SAAS,SAAS,oBAAoB,GAAG,oBAAoB,CAC7D,SAAQ,OAAO;IACf;;;;;;;;;;;;;;;;;;;;;OAqBG;IACH,OAAO,EAAE,OAAO,CAAC;IAEjB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;OA8BG;IACH,KAAK,EAAE,eAAe,CAAC,SAAS,CAAC,CAAC;IAElC;;;;;;;;;;;;;;;;;;;OAmBG;IACH,UAAU,EAAE,iBAAiB,CAAC;CAC/B"}
@@ -0,0 +1,4 @@
1
+ import { ReferenceEntityTemplateSchema } from '@shopify/generate-docs';
2
+ declare const data: ReferenceEntityTemplateSchema;
3
+ export default data;
4
+ //# sourceMappingURL=authenticate.public.checkout.doc.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"authenticate.public.checkout.doc.d.ts","sourceRoot":"","sources":["../../../../../../src/server/authenticate/public/checkout/authenticate.public.checkout.doc.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,6BAA6B,EAAC,MAAM,wBAAwB,CAAC;AAErE,QAAA,MAAM,IAAI,EAAE,6BAkBX,CAAC;AAEF,eAAe,IAAI,CAAC"}
@@ -0,0 +1,21 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ var data = {
4
+ name: 'Checkout',
5
+ description: 'The `authenticate.public.checkout` function ensures that checkout extension requests are coming from Shopify, and returns helpers to respond with the correct headers.',
6
+ category: 'Authenticate',
7
+ subCategory: 'Public',
8
+ type: 'object',
9
+ isVisualComponent: false,
10
+ definitions: [
11
+ {
12
+ title: 'authenticate.public.checkout',
13
+ description: 'Authenticates requests coming from Shopify checkout extensions.',
14
+ type: 'AuthenticateCheckout',
15
+ },
16
+ ],
17
+ jsDocTypeExamples: ['CheckoutContext'],
18
+ related: [],
19
+ };
20
+ exports.default = data;
21
+ //# sourceMappingURL=authenticate.public.checkout.doc.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"authenticate.public.checkout.doc.js","sourceRoot":"","sources":["../../../../../../src/server/authenticate/public/checkout/authenticate.public.checkout.doc.ts"],"names":[],"mappings":";;AAEA,IAAM,IAAI,GAAkC;IAC1C,IAAI,EAAE,UAAU;IAChB,WAAW,EACT,wKAAwK;IAC1K,QAAQ,EAAE,cAAc;IACxB,WAAW,EAAE,QAAQ;IACrB,IAAI,EAAE,QAAQ;IACd,iBAAiB,EAAE,KAAK;IACxB,WAAW,EAAE;QACX;YACE,KAAK,EAAE,8BAA8B;YACrC,WAAW,EACT,iEAAiE;YACnE,IAAI,EAAE,sBAAsB;SAC7B;KACF;IACD,iBAAiB,EAAE,CAAC,iBAAiB,CAAC;IACtC,OAAO,EAAE,EAAE;CACZ,CAAC;AAEF,kBAAe,IAAI,CAAC"}
@@ -11,43 +11,45 @@ export interface CheckoutContext {
11
11
  /**
12
12
  * The decoded and validated session token for the request
13
13
  *
14
- * The payload of the Session Token is described here: {@link https://shopify.dev/docs/apps/auth/oauth/session-tokens#payload}
14
+ * Refer to the OAuth docs for the [session token payload](https://shopify.dev/docs/apps/auth/oauth/session-tokens#payload).
15
15
  *
16
16
  * @example
17
- * <caption>Get store specific widget data using the session token</caption>
17
+ * <caption>Using the decoded session token.</caption>
18
+ * <description>Get store-specific data using the `sessionToken` object.</description>
18
19
  * ```ts
19
- * // app/routes/public/widgets.ts
20
- * import { LoaderArgs, json } from "@remix-run/node";
20
+ * // app/routes/public/my-route.ts
21
+ * import { LoaderFunctionArgs, json } from "@remix-run/node";
21
22
  * import { authenticate } from "../shopify.server";
22
- * import { getWidgets } from "~/db/widgets.server";
23
+ * import { getMyAppData } from "~/db/model.server";
23
24
  *
24
- * export const loader = async ({ request }: LoaderArgs) => {
25
- * const { sessionToken } = await authenticate.public(
25
+ * export const loader = async ({ request }: LoaderFunctionArgs) => {
26
+ * const { sessionToken } = await authenticate.public.checkout(
26
27
  * request
27
28
  * );
28
- * return json(await getWidgets({shop: sessionToken.dest}));
29
+ * return json(await getMyAppData({shop: sessionToken.dest}));
29
30
  * };
30
31
  * ```
31
32
  */
32
33
  sessionToken: JwtPayload;
33
34
  /**
34
- * A function that ensures the CORS headers are set correctly for the response
35
+ * A function that ensures the CORS headers are set correctly for the response.
35
36
  *
36
37
  * @example
37
- * <caption>Setting CORS headers for a public request</caption>
38
+ * <caption>Setting CORS headers for a public request.</caption>
39
+ * <description>Use the `cors` helper to ensure your app can respond to checkout extension requests.</description>
38
40
  * ```ts
39
- * // app/routes/public/widgets.ts
40
- * import { LoaderArgs, json } from "@remix-run/node";
41
+ * // app/routes/public/my-route.ts
42
+ * import { LoaderFunctionArgs, json } from "@remix-run/node";
41
43
  * import { authenticate } from "../shopify.server";
42
- * import { getWidgets } from "~/db/widgets.server";
44
+ * import { getMyAppData } from "~/db/model.server";
43
45
  *
44
- * export const loader = async ({ request }: LoaderArgs) => {
45
- * const { sessionToken, cors } = await authenticate.public(
46
+ * export const loader = async ({ request }: LoaderFunctionArgs) => {
47
+ * const { sessionToken, cors } = await authenticate.public.checkout(
46
48
  * request,
47
49
  * { corsHeaders: ["X-My-Custom-Header"] }
48
50
  * );
49
- * const widgets = await getWidgets({shop: sessionToken.dest});
50
- * return cors(json(widgets));
51
+ * const data = await getMyAppData({shop: sessionToken.dest});
52
+ * return cors(json(data));
51
53
  * };
52
54
  * ```
53
55
  */
@@ -1 +1 @@
1
- {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../../../src/server/authenticate/public/checkout/types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,UAAU,EAAC,MAAM,sBAAsB,CAAC;AAEhD,OAAO,EAAC,kBAAkB,EAAC,MAAM,mCAAmC,CAAC;AAErE,MAAM,MAAM,oBAAoB,GAAG,CACjC,OAAO,EAAE,OAAO,EAChB,OAAO,CAAC,EAAE,2BAA2B,KAClC,OAAO,CAAC,eAAe,CAAC,CAAC;AAE9B,MAAM,WAAW,2BAA2B;IAC1C,WAAW,CAAC,EAAE,MAAM,EAAE,CAAC;CACxB;AAED;;GAEG;AACH,MAAM,WAAW,eAAe;IAC9B;;;;;;;;;;;;;;;;;;;;OAoBG;IACH,YAAY,EAAE,UAAU,CAAC;IAEzB;;;;;;;;;;;;;;;;;;;;OAoBG;IACH,IAAI,EAAE,kBAAkB,CAAC;CAC1B"}
1
+ {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../../../src/server/authenticate/public/checkout/types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,UAAU,EAAC,MAAM,sBAAsB,CAAC;AAEhD,OAAO,EAAC,kBAAkB,EAAC,MAAM,mCAAmC,CAAC;AAErE,MAAM,MAAM,oBAAoB,GAAG,CACjC,OAAO,EAAE,OAAO,EAChB,OAAO,CAAC,EAAE,2BAA2B,KAClC,OAAO,CAAC,eAAe,CAAC,CAAC;AAE9B,MAAM,WAAW,2BAA2B;IAC1C,WAAW,CAAC,EAAE,MAAM,EAAE,CAAC;CACxB;AAED;;GAEG;AACH,MAAM,WAAW,eAAe;IAC9B;;;;;;;;;;;;;;;;;;;;;OAqBG;IACH,YAAY,EAAE,UAAU,CAAC;IAEzB;;;;;;;;;;;;;;;;;;;;;OAqBG;IACH,IAAI,EAAE,kBAAkB,CAAC;CAC1B"}
@@ -7,7 +7,7 @@ function authenticatePublicFactory(params) {
7
7
  var logger = params.logger;
8
8
  var authenticateCheckout = (0, authenticate_1.authenticateCheckoutFactory)(params);
9
9
  var authenticatePublic = function (request, options) {
10
- logger.deprecated('2.0.0', 'authenticate.public() will be deprecated in v2. Use authenticate.public.checkout() instead.');
10
+ logger.deprecated('3.0.0', 'authenticate.public() will be deprecated in v3. Use authenticate.public.checkout() instead.');
11
11
  return authenticateCheckout(request, options);
12
12
  };
13
13
  authenticatePublic.checkout = authenticateCheckout;
@@ -1,30 +1,17 @@
1
1
  import type { AuthenticateCheckout } from './checkout/types';
2
2
  import type { AuthenticateAppProxy } from './appProxy/types';
3
- /**
4
- * Methods for authenticating Requests from Shopify's public surfaces
5
- *
6
- * To maintain backwards compatability this is a function and an object.
7
- *
8
- * Do not use `authenticate.public()`. Use `authenticate.public.checkout()` instead.
9
- * `authenticate.public()` will be removed in v2.
10
- *
11
- * Methods are:
12
- *
13
- * - `authenticate.public.checkout()` for authenticating requests from checkout extensions
14
- * - `authenticate.public.appProxy()` for authenticating requests from app proxies
15
- */
16
- export type AuthenticatePublic = AuthenticateCheckout & {
3
+ interface AuthenticatePublicObject {
17
4
  /**
18
5
  * Authenticate a request from a checkout extension
19
6
  *
20
7
  * @example
21
8
  * <caption>Authenticating a checkout extension request</caption>
22
9
  * ```ts
23
- * // app/routes/public/widgets.ts
24
- * import { LoaderArgs, json } from "@remix-run/node";
10
+ * // /app/routes/public/widgets.ts
11
+ * import { LoaderFunctionArgs, json } from "@remix-run/node";
25
12
  * import { authenticate } from "../shopify.server";
26
13
  *
27
- * export const loader = async ({ request }: LoaderArgs) => {
14
+ * export const loader = async ({ request }: LoaderFunctionArgs) => {
28
15
  * const { sessionToken, cors } = await authenticate.public.checkout(
29
16
  * request,
30
17
  * );
@@ -39,11 +26,11 @@ export type AuthenticatePublic = AuthenticateCheckout & {
39
26
  * @example
40
27
  * <caption>Authenticating an app proxy request</caption>
41
28
  * ```ts
42
- * // app/routes/public/widgets.ts
43
- * import { LoaderArgs, json } from "@remix-run/node";
29
+ * // /app/routes/public/widgets.ts
30
+ * import { LoaderFunctionArgs, json } from "@remix-run/node";
44
31
  * import { authenticate } from "../shopify.server";
45
32
  *
46
- * export const loader = async ({ request }: LoaderArgs) => {
33
+ * export const loader = async ({ request }: LoaderFunctionArgs) => {
47
34
  * await authenticate.public.appProxy(
48
35
  * request,
49
36
  * );
@@ -57,5 +44,20 @@ export type AuthenticatePublic = AuthenticateCheckout & {
57
44
  * ```
58
45
  */
59
46
  appProxy: AuthenticateAppProxy;
60
- };
47
+ }
48
+ /**
49
+ * Methods for authenticating Requests from Shopify's public surfaces
50
+ *
51
+ * To maintain backwards compatability this is a function and an object.
52
+ *
53
+ * Do not use `authenticate.public()`. Use `authenticate.public.checkout()` instead.
54
+ * `authenticate.public()` will be removed in v2.
55
+ *
56
+ * Methods are:
57
+ *
58
+ * - `authenticate.public.checkout()` for authenticating requests from checkout extensions
59
+ * - `authenticate.public.appProxy()` for authenticating requests from app proxies
60
+ */
61
+ export type AuthenticatePublic = AuthenticateCheckout & AuthenticatePublicObject;
62
+ export {};
61
63
  //# sourceMappingURL=types.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../../src/server/authenticate/public/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAC,oBAAoB,EAAC,MAAM,kBAAkB,CAAC;AAC3D,OAAO,KAAK,EAAC,oBAAoB,EAAC,MAAM,kBAAkB,CAAC;AAO3D;;;;;;;;;;;;GAYG;AACH,MAAM,MAAM,kBAAkB,GAAG,oBAAoB,GAAG;IACtD;;;;;;;;;;;;;;;;;OAiBG;IACH,QAAQ,EAAE,oBAAoB,CAAC;IAE/B;;;;;;;;;;;;;;;;;;;;;;OAsBG;IACH,QAAQ,EAAE,oBAAoB,CAAC;CAChC,CAAC"}
1
+ {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../../src/server/authenticate/public/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAC,oBAAoB,EAAC,MAAM,kBAAkB,CAAC;AAC3D,OAAO,KAAK,EAAC,oBAAoB,EAAC,MAAM,kBAAkB,CAAC;AAO3D,UAAU,wBAAwB;IAChC;;;;;;;;;;;;;;;;;OAiBG;IACH,QAAQ,EAAE,oBAAoB,CAAC;IAE/B;;;;;;;;;;;;;;;;;;;;;;OAsBG;IACH,QAAQ,EAAE,oBAAoB,CAAC;CAChC;AAED;;;;;;;;;;;;GAYG;AACH,MAAM,MAAM,kBAAkB,GAAG,oBAAoB,GACnD,wBAAwB,CAAC"}
@@ -1,5 +1,6 @@
1
1
  import { ShopifyRestResources } from '@shopify/shopify-api';
2
2
  import type { BasicParams, MandatoryTopics } from '../../types';
3
- import type { WebhookContext, WebhookContextWithSession } from './types';
4
- export declare function authenticateWebhookFactory<Resources extends ShopifyRestResources, Topics extends string | number | symbol | MandatoryTopics>({ api, config, logger }: BasicParams): (request: Request) => Promise<WebhookContext<Topics> | WebhookContextWithSession<Topics, Resources>>;
3
+ import { FutureFlagOptions } from '../../future/flags';
4
+ import type { AuthenticateWebhook } from './types';
5
+ export declare function authenticateWebhookFactory<Future extends FutureFlagOptions, Resources extends ShopifyRestResources, Topics extends string | number | symbol | MandatoryTopics>(params: BasicParams): AuthenticateWebhook<Future, Resources, Topics>;
5
6
  //# sourceMappingURL=authenticate.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"authenticate.d.ts","sourceRoot":"","sources":["../../../../../src/server/authenticate/webhooks/authenticate.ts"],"names":[],"mappings":"AAAA,OAAO,EAAa,oBAAoB,EAAC,MAAM,sBAAsB,CAAC;AAEtE,OAAO,KAAK,EAAC,WAAW,EAAE,eAAe,EAAC,MAAM,aAAa,CAAC;AAE9D,OAAO,KAAK,EAAC,cAAc,EAAE,yBAAyB,EAAC,MAAM,SAAS,CAAC;AAEvE,wBAAgB,0BAA0B,CACxC,SAAS,SAAS,oBAAoB,EACtC,MAAM,SAAS,MAAM,GAAG,MAAM,GAAG,MAAM,GAAG,eAAe,EACzD,EAAC,GAAG,EAAE,MAAM,EAAE,MAAM,EAAC,EAAE,WAAW,aAEvB,OAAO,KACf,QACD,eAAe,MAAM,CAAC,GAAG,0BAA0B,MAAM,EAAE,SAAS,CAAC,CACtE,CA+DF"}
1
+ {"version":3,"file":"authenticate.d.ts","sourceRoot":"","sources":["../../../../../src/server/authenticate/webhooks/authenticate.ts"],"names":[],"mappings":"AAAA,OAAO,EAAa,oBAAoB,EAAC,MAAM,sBAAsB,CAAC;AAEtE,OAAO,KAAK,EAAC,WAAW,EAAE,eAAe,EAAC,MAAM,aAAa,CAAC;AAG9D,OAAO,EAAC,iBAAiB,EAAC,MAAM,oBAAoB,CAAC;AAErD,OAAO,KAAK,EACV,mBAAmB,EAKpB,MAAM,SAAS,CAAC;AAEjB,wBAAgB,0BAA0B,CACxC,MAAM,SAAS,iBAAiB,EAChC,SAAS,SAAS,oBAAoB,EACtC,MAAM,SAAS,MAAM,GAAG,MAAM,GAAG,MAAM,GAAG,eAAe,EACzD,MAAM,EAAE,WAAW,GAAG,mBAAmB,CAAC,MAAM,EAAE,SAAS,EAAE,MAAM,CAAC,CAgFrE"}
@@ -2,11 +2,13 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.authenticateWebhookFactory = void 0;
4
4
  var tslib_1 = require("tslib");
5
- function authenticateWebhookFactory(_a) {
6
- var api = _a.api, config = _a.config, logger = _a.logger;
5
+ var clients_1 = require("../../clients");
6
+ var helpers_1 = require("../admin/helpers");
7
+ function authenticateWebhookFactory(params) {
8
+ var api = params.api, config = params.config, logger = params.logger;
7
9
  return function authenticate(request) {
8
10
  return tslib_1.__awaiter(this, void 0, void 0, function () {
9
- var rawBody, check, sessionId, session, webhookContext, restClient, graphqlClient;
11
+ var rawBody, check, sessionId, session, webhookContext, admin, restClient_1, graphqlClient;
10
12
  return tslib_1.__generator(this, function (_a) {
11
13
  switch (_a.label) {
12
14
  case 0:
@@ -46,22 +48,32 @@ function authenticateWebhookFactory(_a) {
46
48
  if (!session) {
47
49
  return [2 /*return*/, webhookContext];
48
50
  }
49
- restClient = new api.clients.Rest({
50
- session: session,
51
- apiVersion: check.apiVersion,
52
- });
53
- graphqlClient = new api.clients.Graphql({
54
- session: session,
55
- apiVersion: check.apiVersion,
56
- });
57
- Object.entries(api.rest).forEach(function (_a) {
58
- var _b = tslib_1.__read(_a, 2), name = _b[0], resource = _b[1];
59
- Reflect.set(restClient, name, resource);
60
- });
61
- return [2 /*return*/, tslib_1.__assign(tslib_1.__assign({}, webhookContext), { session: session, admin: {
62
- rest: restClient,
63
- graphql: graphqlClient,
64
- } })];
51
+ if (config.future.v3_webhookAdminContext) {
52
+ admin = (0, clients_1.adminClientFactory)({
53
+ params: params,
54
+ session: session,
55
+ handleClientError: (0, helpers_1.handleClientErrorFactory)({ request: request }),
56
+ });
57
+ }
58
+ else {
59
+ restClient_1 = new api.clients.Rest({
60
+ session: session,
61
+ apiVersion: check.apiVersion,
62
+ });
63
+ graphqlClient = new api.clients.Graphql({
64
+ session: session,
65
+ apiVersion: check.apiVersion,
66
+ });
67
+ Object.entries(api.rest).forEach(function (_a) {
68
+ var _b = tslib_1.__read(_a, 2), name = _b[0], resource = _b[1];
69
+ Reflect.set(restClient_1, name, resource);
70
+ });
71
+ admin = {
72
+ rest: restClient_1,
73
+ graphql: graphqlClient,
74
+ };
75
+ }
76
+ return [2 /*return*/, tslib_1.__assign(tslib_1.__assign({}, webhookContext), { session: session, admin: admin })];
65
77
  }
66
78
  });
67
79
  });
@@ -1 +1 @@
1
- {"version":3,"file":"authenticate.js","sourceRoot":"","sources":["../../../../../src/server/authenticate/webhooks/authenticate.ts"],"names":[],"mappings":";;;;AAMA,SAAgB,0BAA0B,CAGxC,EAAkC;QAAjC,GAAG,SAAA,EAAE,MAAM,YAAA,EAAE,MAAM,YAAA;IACpB,OAAO,SAAe,YAAY,CAChC,OAAgB;;;;;;wBAIhB,IAAI,OAAO,CAAC,MAAM,KAAK,MAAM,EAAE;4BAC7B,MAAM,CAAC,KAAK,CACV,4EAA4E,EAC5E,EAAC,GAAG,EAAE,OAAO,CAAC,GAAG,EAAE,MAAM,EAAE,OAAO,CAAC,MAAM,EAAC,CAC3C,CAAC;4BACF,MAAM,IAAI,QAAQ,CAAC,SAAS,EAAE;gCAC5B,MAAM,EAAE,GAAG;gCACX,UAAU,EAAE,oBAAoB;6BACjC,CAAC,CAAC;yBACJ;wBAEe,qBAAM,OAAO,CAAC,IAAI,EAAE,EAAA;;wBAA9B,OAAO,GAAG,SAAoB;wBAEtB,qBAAM,GAAG,CAAC,QAAQ,CAAC,QAAQ,CAAC;gCACxC,OAAO,SAAA;gCACP,UAAU,EAAE,OAAO;6BACpB,CAAC,EAAA;;wBAHI,KAAK,GAAG,SAGZ;wBAEF,IAAI,CAAC,KAAK,CAAC,KAAK,EAAE;4BAChB,MAAM,CAAC,KAAK,CAAC,2BAA2B,EAAE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C;4BAC1C,CAAC,CAAC,CAAC;4BAEH,KAAK,GAAG;gCACN,IAAI,EAAE,YAA2C;gCACjD,OAAO,EAAE,aAAa;6BACvB,CAAC;yBACH;wBAED,4DACK,cAAc,KACjB,OAAO,SAAA,EACP,KAAK,EAAE,KAA+C,KACtD;;;;KACH,CAAC;AACJ,CAAC;AApFD,gEAoFC"}
@@ -0,0 +1,4 @@
1
+ import { ReferenceEntityTemplateSchema } from '@shopify/generate-docs';
2
+ declare const data: ReferenceEntityTemplateSchema;
3
+ export default data;
4
+ //# sourceMappingURL=authenticate.webhooks.doc.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"authenticate.webhooks.doc.d.ts","sourceRoot":"","sources":["../../../../../src/server/authenticate/webhooks/authenticate.webhooks.doc.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,6BAA6B,EAAC,MAAM,wBAAwB,CAAC;AAErE,QAAA,MAAM,IAAI,EAAE,6BAuBX,CAAC;AAEF,eAAe,IAAI,CAAC"}
@@ -0,0 +1,27 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ var data = {
4
+ name: 'Webhook',
5
+ description: 'Contains functions for verifying Shopify webhooks.' +
6
+ '\n\n> Note: The format of the `admin` object returned by this function changes with the `v3_webhookAdminContext` future flag. Learn more about [gradual feature adoption](/docs/api/shopify-app-remix/guide-future-flags).',
7
+ category: 'Authenticate',
8
+ type: 'object',
9
+ isVisualComponent: false,
10
+ definitions: [
11
+ {
12
+ title: 'authenticate.webhook',
13
+ description: 'Verifies requests coming from Shopify webhooks.',
14
+ type: 'AuthenticateWebhook',
15
+ },
16
+ ],
17
+ jsDocTypeExamples: ['WebhookContextWithSession'],
18
+ related: [
19
+ {
20
+ name: 'Admin API context',
21
+ subtitle: 'Interact with the Admin API.',
22
+ url: '/docs/api/shopify-app-remix/apis/admin-api',
23
+ },
24
+ ],
25
+ };
26
+ exports.default = data;
27
+ //# sourceMappingURL=authenticate.webhooks.doc.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"authenticate.webhooks.doc.js","sourceRoot":"","sources":["../../../../../src/server/authenticate/webhooks/authenticate.webhooks.doc.ts"],"names":[],"mappings":";;AAEA,IAAM,IAAI,GAAkC;IAC1C,IAAI,EAAE,SAAS;IACf,WAAW,EACT,oDAAoD;QACpD,4NAA4N;IAC9N,QAAQ,EAAE,cAAc;IACxB,IAAI,EAAE,QAAQ;IACd,iBAAiB,EAAE,KAAK;IACxB,WAAW,EAAE;QACX;YACE,KAAK,EAAE,sBAAsB;YAC7B,WAAW,EAAE,iDAAiD;YAC9D,IAAI,EAAE,qBAAqB;SAC5B;KACF;IACD,iBAAiB,EAAE,CAAC,2BAA2B,CAAC;IAChD,OAAO,EAAE;QACP;YACE,IAAI,EAAE,mBAAmB;YACzB,QAAQ,EAAE,8BAA8B;YACxC,GAAG,EAAE,4CAA4C;SAClD;KACF;CACF,CAAC;AAEF,kBAAe,IAAI,CAAC"}