shopify-nuxt 0.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +275 -0
- package/dist/module.d.mts +7 -0
- package/dist/module.json +9 -0
- package/dist/module.mjs +134 -0
- package/dist/runtime/components/ShopifyAppProvider.d.vue.ts +13 -0
- package/dist/runtime/components/ShopifyAppProvider.vue +11 -0
- package/dist/runtime/components/ShopifyAppProvider.vue.d.ts +13 -0
- package/dist/runtime/components/polaris/ShAppNav.d.vue.ts +13 -0
- package/dist/runtime/components/polaris/ShAppNav.vue +9 -0
- package/dist/runtime/components/polaris/ShAppNav.vue.d.ts +13 -0
- package/dist/runtime/components/polaris/ShAvatar.d.vue.ts +19 -0
- package/dist/runtime/components/polaris/ShAvatar.vue +15 -0
- package/dist/runtime/components/polaris/ShAvatar.vue.d.ts +19 -0
- package/dist/runtime/components/polaris/ShBadge.d.vue.ts +20 -0
- package/dist/runtime/components/polaris/ShBadge.vue +16 -0
- package/dist/runtime/components/polaris/ShBadge.vue.d.ts +20 -0
- package/dist/runtime/components/polaris/ShBanner.d.vue.ts +19 -0
- package/dist/runtime/components/polaris/ShBanner.vue +15 -0
- package/dist/runtime/components/polaris/ShBanner.vue.d.ts +19 -0
- package/dist/runtime/components/polaris/ShBox.d.vue.ts +39 -0
- package/dist/runtime/components/polaris/ShBox.vue +35 -0
- package/dist/runtime/components/polaris/ShBox.vue.d.ts +39 -0
- package/dist/runtime/components/polaris/ShButton.d.vue.ts +28 -0
- package/dist/runtime/components/polaris/ShButton.vue +24 -0
- package/dist/runtime/components/polaris/ShButton.vue.d.ts +28 -0
- package/dist/runtime/components/polaris/ShButtonGroup.d.vue.ts +17 -0
- package/dist/runtime/components/polaris/ShButtonGroup.vue +13 -0
- package/dist/runtime/components/polaris/ShButtonGroup.vue.d.ts +17 -0
- package/dist/runtime/components/polaris/ShCheckbox.d.vue.ts +28 -0
- package/dist/runtime/components/polaris/ShCheckbox.vue +24 -0
- package/dist/runtime/components/polaris/ShCheckbox.vue.d.ts +28 -0
- package/dist/runtime/components/polaris/ShChip.d.vue.ts +17 -0
- package/dist/runtime/components/polaris/ShChip.vue +13 -0
- package/dist/runtime/components/polaris/ShChip.vue.d.ts +17 -0
- package/dist/runtime/components/polaris/ShChoice.d.vue.ts +20 -0
- package/dist/runtime/components/polaris/ShChoice.vue +16 -0
- package/dist/runtime/components/polaris/ShChoice.vue.d.ts +20 -0
- package/dist/runtime/components/polaris/ShChoiceList.d.vue.ts +23 -0
- package/dist/runtime/components/polaris/ShChoiceList.vue +19 -0
- package/dist/runtime/components/polaris/ShChoiceList.vue.d.ts +23 -0
- package/dist/runtime/components/polaris/ShClickable.d.vue.ts +48 -0
- package/dist/runtime/components/polaris/ShClickable.vue +44 -0
- package/dist/runtime/components/polaris/ShClickable.vue.d.ts +48 -0
- package/dist/runtime/components/polaris/ShClickableChip.d.vue.ts +24 -0
- package/dist/runtime/components/polaris/ShClickableChip.vue +20 -0
- package/dist/runtime/components/polaris/ShClickableChip.vue.d.ts +24 -0
- package/dist/runtime/components/polaris/ShColorField.d.vue.ts +29 -0
- package/dist/runtime/components/polaris/ShColorField.vue +25 -0
- package/dist/runtime/components/polaris/ShColorField.vue.d.ts +29 -0
- package/dist/runtime/components/polaris/ShColorPicker.d.vue.ts +19 -0
- package/dist/runtime/components/polaris/ShColorPicker.vue +15 -0
- package/dist/runtime/components/polaris/ShColorPicker.vue.d.ts +19 -0
- package/dist/runtime/components/polaris/ShDateField.d.vue.ts +34 -0
- package/dist/runtime/components/polaris/ShDateField.vue +30 -0
- package/dist/runtime/components/polaris/ShDateField.vue.d.ts +34 -0
- package/dist/runtime/components/polaris/ShDatePicker.d.vue.ts +25 -0
- package/dist/runtime/components/polaris/ShDatePicker.vue +21 -0
- package/dist/runtime/components/polaris/ShDatePicker.vue.d.ts +25 -0
- package/dist/runtime/components/polaris/ShDivider.d.vue.ts +17 -0
- package/dist/runtime/components/polaris/ShDivider.vue +13 -0
- package/dist/runtime/components/polaris/ShDivider.vue.d.ts +17 -0
- package/dist/runtime/components/polaris/ShDropZone.d.vue.ts +25 -0
- package/dist/runtime/components/polaris/ShDropZone.vue +21 -0
- package/dist/runtime/components/polaris/ShDropZone.vue.d.ts +25 -0
- package/dist/runtime/components/polaris/ShEmailField.d.vue.ts +30 -0
- package/dist/runtime/components/polaris/ShEmailField.vue +26 -0
- package/dist/runtime/components/polaris/ShEmailField.vue.d.ts +30 -0
- package/dist/runtime/components/polaris/ShGrid.d.vue.ts +50 -0
- package/dist/runtime/components/polaris/ShGrid.vue +46 -0
- package/dist/runtime/components/polaris/ShGrid.vue.d.ts +50 -0
- package/dist/runtime/components/polaris/ShGridItem.d.vue.ts +41 -0
- package/dist/runtime/components/polaris/ShGridItem.vue +37 -0
- package/dist/runtime/components/polaris/ShGridItem.vue.d.ts +41 -0
- package/dist/runtime/components/polaris/ShHeading.d.vue.ts +18 -0
- package/dist/runtime/components/polaris/ShHeading.vue +14 -0
- package/dist/runtime/components/polaris/ShHeading.vue.d.ts +18 -0
- package/dist/runtime/components/polaris/ShIcon.d.vue.ts +20 -0
- package/dist/runtime/components/polaris/ShIcon.vue +16 -0
- package/dist/runtime/components/polaris/ShIcon.vue.d.ts +20 -0
- package/dist/runtime/components/polaris/ShImage.d.vue.ts +18 -0
- package/dist/runtime/components/polaris/ShImage.vue +14 -0
- package/dist/runtime/components/polaris/ShImage.vue.d.ts +18 -0
- package/dist/runtime/components/polaris/ShLink.d.vue.ts +24 -0
- package/dist/runtime/components/polaris/ShLink.vue +20 -0
- package/dist/runtime/components/polaris/ShLink.vue.d.ts +24 -0
- package/dist/runtime/components/polaris/ShListItem.d.vue.ts +13 -0
- package/dist/runtime/components/polaris/ShListItem.vue +9 -0
- package/dist/runtime/components/polaris/ShListItem.vue.d.ts +13 -0
- package/dist/runtime/components/polaris/ShMenu.d.vue.ts +16 -0
- package/dist/runtime/components/polaris/ShMenu.vue +12 -0
- package/dist/runtime/components/polaris/ShMenu.vue.d.ts +16 -0
- package/dist/runtime/components/polaris/ShModal.d.vue.ts +19 -0
- package/dist/runtime/components/polaris/ShModal.vue +15 -0
- package/dist/runtime/components/polaris/ShModal.vue.d.ts +19 -0
- package/dist/runtime/components/polaris/ShMoneyField.d.vue.ts +30 -0
- package/dist/runtime/components/polaris/ShMoneyField.vue +26 -0
- package/dist/runtime/components/polaris/ShMoneyField.vue.d.ts +30 -0
- package/dist/runtime/components/polaris/ShNumberField.d.vue.ts +34 -0
- package/dist/runtime/components/polaris/ShNumberField.vue +30 -0
- package/dist/runtime/components/polaris/ShNumberField.vue.d.ts +34 -0
- package/dist/runtime/components/polaris/ShOption.d.vue.ts +19 -0
- package/dist/runtime/components/polaris/ShOption.vue +15 -0
- package/dist/runtime/components/polaris/ShOption.vue.d.ts +19 -0
- package/dist/runtime/components/polaris/ShOptionGroup.d.vue.ts +17 -0
- package/dist/runtime/components/polaris/ShOptionGroup.vue +13 -0
- package/dist/runtime/components/polaris/ShOptionGroup.vue.d.ts +17 -0
- package/dist/runtime/components/polaris/ShOrderedList.d.vue.ts +13 -0
- package/dist/runtime/components/polaris/ShOrderedList.vue +9 -0
- package/dist/runtime/components/polaris/ShOrderedList.vue.d.ts +13 -0
- package/dist/runtime/components/polaris/ShPage.d.vue.ts +17 -0
- package/dist/runtime/components/polaris/ShPage.vue +13 -0
- package/dist/runtime/components/polaris/ShPage.vue.d.ts +17 -0
- package/dist/runtime/components/polaris/ShParagraph.d.vue.ts +21 -0
- package/dist/runtime/components/polaris/ShParagraph.vue +17 -0
- package/dist/runtime/components/polaris/ShParagraph.vue.d.ts +21 -0
- package/dist/runtime/components/polaris/ShPasswordField.d.vue.ts +30 -0
- package/dist/runtime/components/polaris/ShPasswordField.vue +26 -0
- package/dist/runtime/components/polaris/ShPasswordField.vue.d.ts +30 -0
- package/dist/runtime/components/polaris/ShPopover.d.vue.ts +21 -0
- package/dist/runtime/components/polaris/ShPopover.vue +17 -0
- package/dist/runtime/components/polaris/ShPopover.vue.d.ts +21 -0
- package/dist/runtime/components/polaris/ShQueryContainer.d.vue.ts +16 -0
- package/dist/runtime/components/polaris/ShQueryContainer.vue +12 -0
- package/dist/runtime/components/polaris/ShQueryContainer.vue.d.ts +16 -0
- package/dist/runtime/components/polaris/ShSearchField.d.vue.ts +30 -0
- package/dist/runtime/components/polaris/ShSearchField.vue +26 -0
- package/dist/runtime/components/polaris/ShSearchField.vue.d.ts +30 -0
- package/dist/runtime/components/polaris/ShSection.d.vue.ts +18 -0
- package/dist/runtime/components/polaris/ShSection.vue +14 -0
- package/dist/runtime/components/polaris/ShSection.vue.d.ts +18 -0
- package/dist/runtime/components/polaris/ShSelect.d.vue.ts +26 -0
- package/dist/runtime/components/polaris/ShSelect.vue +22 -0
- package/dist/runtime/components/polaris/ShSelect.vue.d.ts +26 -0
- package/dist/runtime/components/polaris/ShSpinner.d.vue.ts +17 -0
- package/dist/runtime/components/polaris/ShSpinner.vue +13 -0
- package/dist/runtime/components/polaris/ShSpinner.vue.d.ts +17 -0
- package/dist/runtime/components/polaris/ShStack.d.vue.ts +46 -0
- package/dist/runtime/components/polaris/ShStack.vue +42 -0
- package/dist/runtime/components/polaris/ShStack.vue.d.ts +46 -0
- package/dist/runtime/components/polaris/ShSwitch.d.vue.ts +27 -0
- package/dist/runtime/components/polaris/ShSwitch.vue +23 -0
- package/dist/runtime/components/polaris/ShSwitch.vue.d.ts +27 -0
- package/dist/runtime/components/polaris/ShTable.d.vue.ts +20 -0
- package/dist/runtime/components/polaris/ShTable.vue +16 -0
- package/dist/runtime/components/polaris/ShTable.vue.d.ts +20 -0
- package/dist/runtime/components/polaris/ShTableBody.d.vue.ts +13 -0
- package/dist/runtime/components/polaris/ShTableBody.vue +9 -0
- package/dist/runtime/components/polaris/ShTableBody.vue.d.ts +13 -0
- package/dist/runtime/components/polaris/ShTableCell.d.vue.ts +13 -0
- package/dist/runtime/components/polaris/ShTableCell.vue +9 -0
- package/dist/runtime/components/polaris/ShTableCell.vue.d.ts +13 -0
- package/dist/runtime/components/polaris/ShTableHeader.d.vue.ts +17 -0
- package/dist/runtime/components/polaris/ShTableHeader.vue +13 -0
- package/dist/runtime/components/polaris/ShTableHeader.vue.d.ts +17 -0
- package/dist/runtime/components/polaris/ShTableHeaderRow.d.vue.ts +13 -0
- package/dist/runtime/components/polaris/ShTableHeaderRow.vue +9 -0
- package/dist/runtime/components/polaris/ShTableHeaderRow.vue.d.ts +13 -0
- package/dist/runtime/components/polaris/ShTableRow.d.vue.ts +16 -0
- package/dist/runtime/components/polaris/ShTableRow.vue +12 -0
- package/dist/runtime/components/polaris/ShTableRow.vue.d.ts +16 -0
- package/dist/runtime/components/polaris/ShText.d.vue.ts +22 -0
- package/dist/runtime/components/polaris/ShText.vue +18 -0
- package/dist/runtime/components/polaris/ShText.vue.d.ts +22 -0
- package/dist/runtime/components/polaris/ShTextArea.d.vue.ts +31 -0
- package/dist/runtime/components/polaris/ShTextArea.vue +27 -0
- package/dist/runtime/components/polaris/ShTextArea.vue.d.ts +31 -0
- package/dist/runtime/components/polaris/ShTextField.d.vue.ts +33 -0
- package/dist/runtime/components/polaris/ShTextField.vue +29 -0
- package/dist/runtime/components/polaris/ShTextField.vue.d.ts +33 -0
- package/dist/runtime/components/polaris/ShThumbnail.d.vue.ts +18 -0
- package/dist/runtime/components/polaris/ShThumbnail.vue +14 -0
- package/dist/runtime/components/polaris/ShThumbnail.vue.d.ts +18 -0
- package/dist/runtime/components/polaris/ShTooltip.d.vue.ts +13 -0
- package/dist/runtime/components/polaris/ShTooltip.vue +9 -0
- package/dist/runtime/components/polaris/ShTooltip.vue.d.ts +13 -0
- package/dist/runtime/components/polaris/ShUnorderedList.d.vue.ts +13 -0
- package/dist/runtime/components/polaris/ShUnorderedList.vue +9 -0
- package/dist/runtime/components/polaris/ShUnorderedList.vue.d.ts +13 -0
- package/dist/runtime/components/polaris/ShUrlField.d.vue.ts +30 -0
- package/dist/runtime/components/polaris/ShUrlField.vue +26 -0
- package/dist/runtime/components/polaris/ShUrlField.vue.d.ts +30 -0
- package/dist/runtime/components/polaris/types.d.ts +1 -0
- package/dist/runtime/components/polaris/types.js +0 -0
- package/dist/runtime/composables/useAppBridge.d.ts +8 -0
- package/dist/runtime/composables/useAppBridge.js +21 -0
- package/dist/runtime/composables/useShopifyFetch.d.ts +4 -0
- package/dist/runtime/composables/useShopifyFetch.js +32 -0
- package/dist/runtime/middleware/shopify-auth.d.ts +2 -0
- package/dist/runtime/middleware/shopify-auth.js +11 -0
- package/dist/runtime/plugin.d.ts +1 -0
- package/dist/runtime/plugin.js +1 -0
- package/dist/runtime/plugins/app-bridge.d.ts +12 -0
- package/dist/runtime/plugins/app-bridge.js +28 -0
- package/dist/runtime/plugins/polaris.d.ts +1 -0
- package/dist/runtime/plugins/polaris.js +0 -0
- package/dist/runtime/server/index.d.ts +2 -0
- package/dist/runtime/server/index.js +7 -0
- package/dist/runtime/server/routes/auth-callback.d.ts +6 -0
- package/dist/runtime/server/routes/auth-callback.js +45 -0
- package/dist/runtime/server/routes/auth-exit-iframe.d.ts +6 -0
- package/dist/runtime/server/routes/auth-exit-iframe.js +11 -0
- package/dist/runtime/server/routes/auth-session-token.d.ts +7 -0
- package/dist/runtime/server/routes/auth-session-token.js +27 -0
- package/dist/runtime/server/routes/auth.d.ts +6 -0
- package/dist/runtime/server/routes/auth.js +23 -0
- package/dist/runtime/server/services/shopify.d.ts +38 -0
- package/dist/runtime/server/services/shopify.js +89 -0
- package/dist/runtime/server/test-helpers/index.d.ts +25 -0
- package/dist/runtime/server/test-helpers/index.js +25 -0
- package/dist/runtime/server/test-helpers/package.json +4 -0
- package/dist/runtime/server/tsconfig.json +3 -0
- package/dist/runtime/server/utils/authenticate-admin.d.ts +17 -0
- package/dist/runtime/server/utils/authenticate-admin.js +197 -0
- package/dist/runtime/server/utils/authenticate-flow.d.ts +17 -0
- package/dist/runtime/server/utils/authenticate-flow.js +70 -0
- package/dist/runtime/server/utils/authenticate-fulfillment-service.d.ts +16 -0
- package/dist/runtime/server/utils/authenticate-fulfillment-service.js +54 -0
- package/dist/runtime/server/utils/authenticate-pos.d.ts +18 -0
- package/dist/runtime/server/utils/authenticate-pos.js +31 -0
- package/dist/runtime/server/utils/authenticate-public.d.ts +17 -0
- package/dist/runtime/server/utils/authenticate-public.js +31 -0
- package/dist/runtime/server/utils/authenticate-webhook.d.ts +26 -0
- package/dist/runtime/server/utils/authenticate-webhook.js +76 -0
- package/dist/runtime/server/utils/clients.d.ts +25 -0
- package/dist/runtime/server/utils/clients.js +36 -0
- package/dist/runtime/server/utils/helpers.d.ts +10 -0
- package/dist/runtime/server/utils/helpers.js +96 -0
- package/dist/runtime/server/utils/login.d.ts +17 -0
- package/dist/runtime/server/utils/login.js +44 -0
- package/dist/runtime/server/utils/register-webhooks.d.ts +19 -0
- package/dist/runtime/server/utils/register-webhooks.js +5 -0
- package/dist/runtime/server/utils/unauthenticated-admin.d.ts +21 -0
- package/dist/runtime/server/utils/unauthenticated-admin.js +15 -0
- package/dist/runtime/server/utils/unauthenticated-storefront.d.ts +24 -0
- package/dist/runtime/server/utils/unauthenticated-storefront.js +21 -0
- package/dist/runtime/types.d.ts +141 -0
- package/dist/runtime/types.js +11 -0
- package/dist/types.d.mts +3 -0
- package/package.json +66 -0
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import type { Session } from '@shopify/shopify-api';
|
|
2
|
+
export interface StorefrontApiContext {
|
|
3
|
+
graphql: (query: string, options?: {
|
|
4
|
+
variables?: Record<string, any>;
|
|
5
|
+
}) => Promise<any>;
|
|
6
|
+
}
|
|
7
|
+
/**
|
|
8
|
+
* Get an unauthenticated Storefront API context for a given shop.
|
|
9
|
+
*
|
|
10
|
+
* Uses the stored offline session to access the Storefront API without an incoming request.
|
|
11
|
+
*
|
|
12
|
+
* ```ts
|
|
13
|
+
* // server/api/public/products.ts
|
|
14
|
+
* export default defineEventHandler(async (event) => {
|
|
15
|
+
* const { storefront } = await useShopifyUnauthenticatedStorefront('my-shop.myshopify.com')
|
|
16
|
+
* const products = await storefront.graphql(`{ products(first: 10) { edges { node { id title } } } }`)
|
|
17
|
+
* return products
|
|
18
|
+
* })
|
|
19
|
+
* ```
|
|
20
|
+
*/
|
|
21
|
+
export declare function useShopifyUnauthenticatedStorefront(shop: string): Promise<{
|
|
22
|
+
storefront: StorefrontApiContext;
|
|
23
|
+
session: Session;
|
|
24
|
+
}>;
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { getShopifyApi, getSessionStorage } from "../services/shopify.js";
|
|
2
|
+
export async function useShopifyUnauthenticatedStorefront(shop) {
|
|
3
|
+
const api = getShopifyApi();
|
|
4
|
+
const sessionStorage = getSessionStorage();
|
|
5
|
+
const offlineId = api.session.getOfflineId(shop);
|
|
6
|
+
const session = await sessionStorage.loadSession(offlineId);
|
|
7
|
+
if (!session) {
|
|
8
|
+
throw new Error(
|
|
9
|
+
`No offline session found for shop "${shop}". The shop must install the app first.`
|
|
10
|
+
);
|
|
11
|
+
}
|
|
12
|
+
const storefront = {
|
|
13
|
+
graphql: async (query, options) => {
|
|
14
|
+
const client = new api.clients.Storefront({ session });
|
|
15
|
+
return client.request(query, {
|
|
16
|
+
variables: options?.variables
|
|
17
|
+
});
|
|
18
|
+
}
|
|
19
|
+
};
|
|
20
|
+
return { storefront, session };
|
|
21
|
+
}
|
|
@@ -0,0 +1,141 @@
|
|
|
1
|
+
import type { ApiVersion, Session, JwtPayload, WebhookHandler } from '@shopify/shopify-api';
|
|
2
|
+
import type { SessionStorage } from '@shopify/shopify-app-session-storage';
|
|
3
|
+
import type { AdminApiContext } from './server/utils/clients.js';
|
|
4
|
+
export declare enum AppDistribution {
|
|
5
|
+
AppStore = "app_store",
|
|
6
|
+
SingleMerchant = "single_merchant",
|
|
7
|
+
ShopifyAdmin = "shopify_admin"
|
|
8
|
+
}
|
|
9
|
+
export interface ModuleOptions {
|
|
10
|
+
/**
|
|
11
|
+
* The Shopify API key for your app.
|
|
12
|
+
* Can also be set via `NUXT_SHOPIFY_API_KEY` env var.
|
|
13
|
+
*/
|
|
14
|
+
apiKey: string;
|
|
15
|
+
/**
|
|
16
|
+
* The Shopify API secret key for your app.
|
|
17
|
+
* Can also be set via `NUXT_SHOPIFY_API_SECRET_KEY` env var.
|
|
18
|
+
*/
|
|
19
|
+
apiSecretKey: string;
|
|
20
|
+
/**
|
|
21
|
+
* The scopes your app needs from the Shopify API.
|
|
22
|
+
*/
|
|
23
|
+
scopes: string[];
|
|
24
|
+
/**
|
|
25
|
+
* The URL your app is running on. In development, this is typically a tunnel URL.
|
|
26
|
+
* Can also be set via `NUXT_SHOPIFY_APP_URL` env var.
|
|
27
|
+
*/
|
|
28
|
+
appUrl: string;
|
|
29
|
+
/**
|
|
30
|
+
* The Shopify API version to use. Defaults to the latest stable version.
|
|
31
|
+
*/
|
|
32
|
+
apiVersion?: ApiVersion;
|
|
33
|
+
/**
|
|
34
|
+
* A path prefix for Shopify auth endpoints.
|
|
35
|
+
* @default '/_shopify/auth'
|
|
36
|
+
*/
|
|
37
|
+
authPathPrefix?: string;
|
|
38
|
+
/**
|
|
39
|
+
* How your app is distributed.
|
|
40
|
+
* @default 'app_store'
|
|
41
|
+
*/
|
|
42
|
+
distribution?: AppDistribution;
|
|
43
|
+
/**
|
|
44
|
+
* Whether to use online tokens (user-specific) instead of offline tokens (shop-specific).
|
|
45
|
+
* If true, both online and offline tokens will be stored.
|
|
46
|
+
* @default false
|
|
47
|
+
*/
|
|
48
|
+
useOnlineTokens?: boolean;
|
|
49
|
+
}
|
|
50
|
+
export type WebhookConfig = Record<string, WebhookHandler | WebhookHandler[]>;
|
|
51
|
+
export interface AfterAuthOptions {
|
|
52
|
+
session: Session;
|
|
53
|
+
admin: AdminApiContext;
|
|
54
|
+
}
|
|
55
|
+
export interface HooksConfig {
|
|
56
|
+
afterAuth?: (options: AfterAuthOptions) => void | Promise<void>;
|
|
57
|
+
}
|
|
58
|
+
export interface ShopifyRuntimeConfig {
|
|
59
|
+
/** Session storage adapter */
|
|
60
|
+
sessionStorage?: SessionStorage;
|
|
61
|
+
/** Webhook handler configuration */
|
|
62
|
+
webhooks?: WebhookConfig;
|
|
63
|
+
/** Lifecycle hooks */
|
|
64
|
+
hooks?: HooksConfig;
|
|
65
|
+
/** Billing configuration */
|
|
66
|
+
billing?: Record<string, any>;
|
|
67
|
+
}
|
|
68
|
+
export interface AdminContext {
|
|
69
|
+
/** The authenticated session */
|
|
70
|
+
session: Session;
|
|
71
|
+
/** Admin API client (graphql + rest) */
|
|
72
|
+
admin: AdminApiContext;
|
|
73
|
+
/** The decoded session token (embedded apps only) */
|
|
74
|
+
sessionToken?: JwtPayload;
|
|
75
|
+
/** Billing helpers */
|
|
76
|
+
billing: BillingContext;
|
|
77
|
+
/** CORS header helper */
|
|
78
|
+
cors: (response: Response) => Response;
|
|
79
|
+
/** Redirect helper for embedded apps */
|
|
80
|
+
redirect: (url: string, init?: {
|
|
81
|
+
target?: '_self' | '_parent' | '_top' | '_blank';
|
|
82
|
+
}) => Response;
|
|
83
|
+
}
|
|
84
|
+
export interface BillingContext {
|
|
85
|
+
require: (options: {
|
|
86
|
+
plans: string | string[];
|
|
87
|
+
}) => Promise<void>;
|
|
88
|
+
check: (options?: {
|
|
89
|
+
plans?: string | string[];
|
|
90
|
+
}) => Promise<any>;
|
|
91
|
+
request: (options: {
|
|
92
|
+
plan: string;
|
|
93
|
+
isTest?: boolean;
|
|
94
|
+
returnUrl?: string;
|
|
95
|
+
}) => Promise<Response>;
|
|
96
|
+
}
|
|
97
|
+
export interface WebhookContext {
|
|
98
|
+
topic: string;
|
|
99
|
+
shop: string;
|
|
100
|
+
session?: Session;
|
|
101
|
+
payload: Record<string, any>;
|
|
102
|
+
apiVersion: string;
|
|
103
|
+
}
|
|
104
|
+
export interface FlowContext {
|
|
105
|
+
session: Session;
|
|
106
|
+
admin: AdminApiContext;
|
|
107
|
+
payload: Record<string, any>;
|
|
108
|
+
}
|
|
109
|
+
export interface PublicContext {
|
|
110
|
+
sessionToken: JwtPayload;
|
|
111
|
+
cors: (response: Response) => Response;
|
|
112
|
+
}
|
|
113
|
+
export interface LoginError {
|
|
114
|
+
shop?: LoginErrorType;
|
|
115
|
+
}
|
|
116
|
+
export declare enum LoginErrorType {
|
|
117
|
+
MissingShop = "MISSING_SHOP",
|
|
118
|
+
InvalidShop = "INVALID_SHOP"
|
|
119
|
+
}
|
|
120
|
+
export interface AuthConfig {
|
|
121
|
+
path: string;
|
|
122
|
+
callbackPath: string;
|
|
123
|
+
exitIframePath: string;
|
|
124
|
+
patchSessionTokenPath: string;
|
|
125
|
+
loginPath: string;
|
|
126
|
+
}
|
|
127
|
+
export interface ResolvedConfig {
|
|
128
|
+
apiKey: string;
|
|
129
|
+
apiSecretKey: string;
|
|
130
|
+
scopes: string[];
|
|
131
|
+
appUrl: string;
|
|
132
|
+
apiVersion: string;
|
|
133
|
+
authPathPrefix: string;
|
|
134
|
+
distribution: AppDistribution;
|
|
135
|
+
useOnlineTokens: boolean;
|
|
136
|
+
auth: AuthConfig;
|
|
137
|
+
sessionStorage?: SessionStorage;
|
|
138
|
+
webhooks?: WebhookConfig;
|
|
139
|
+
hooks: HooksConfig;
|
|
140
|
+
billing?: Record<string, any>;
|
|
141
|
+
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
export var AppDistribution = /* @__PURE__ */ ((AppDistribution2) => {
|
|
2
|
+
AppDistribution2["AppStore"] = "app_store";
|
|
3
|
+
AppDistribution2["SingleMerchant"] = "single_merchant";
|
|
4
|
+
AppDistribution2["ShopifyAdmin"] = "shopify_admin";
|
|
5
|
+
return AppDistribution2;
|
|
6
|
+
})(AppDistribution || {});
|
|
7
|
+
export var LoginErrorType = /* @__PURE__ */ ((LoginErrorType2) => {
|
|
8
|
+
LoginErrorType2["MissingShop"] = "MISSING_SHOP";
|
|
9
|
+
LoginErrorType2["InvalidShop"] = "INVALID_SHOP";
|
|
10
|
+
return LoginErrorType2;
|
|
11
|
+
})(LoginErrorType || {});
|
package/dist/types.d.mts
ADDED
package/package.json
ADDED
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "shopify-nuxt",
|
|
3
|
+
"version": "0.0.1",
|
|
4
|
+
"description": "Shopify app integration for Nuxt - authentication, webhooks, billing, and App Bridge",
|
|
5
|
+
"repository": "yanuaraditia/shopify-nuxt",
|
|
6
|
+
"license": "MIT",
|
|
7
|
+
"type": "module",
|
|
8
|
+
"exports": {
|
|
9
|
+
".": {
|
|
10
|
+
"types": "./dist/types.d.mts",
|
|
11
|
+
"import": "./dist/module.mjs"
|
|
12
|
+
},
|
|
13
|
+
"./test-helpers": {
|
|
14
|
+
"types": "./dist/runtime/server/test-helpers/index.d.ts",
|
|
15
|
+
"import": "./dist/runtime/server/test-helpers/index.js"
|
|
16
|
+
}
|
|
17
|
+
},
|
|
18
|
+
"main": "./dist/module.mjs",
|
|
19
|
+
"typesVersions": {
|
|
20
|
+
"*": {
|
|
21
|
+
".": [
|
|
22
|
+
"./dist/types.d.mts"
|
|
23
|
+
]
|
|
24
|
+
}
|
|
25
|
+
},
|
|
26
|
+
"files": [
|
|
27
|
+
"dist"
|
|
28
|
+
],
|
|
29
|
+
"workspaces": [
|
|
30
|
+
"playground"
|
|
31
|
+
],
|
|
32
|
+
"scripts": {
|
|
33
|
+
"prepack": "nuxt-module-build build",
|
|
34
|
+
"dev": "bun run dev:prepare && nuxt dev playground",
|
|
35
|
+
"dev:build": "nuxt build playground",
|
|
36
|
+
"dev:prepare": "nuxt-module-build build --stub && nuxt-module-build prepare && nuxt prepare playground",
|
|
37
|
+
"release": "bun run lint && bun run test && bun run prepack && changelogen --release && npm publish && git push --follow-tags",
|
|
38
|
+
"lint": "eslint .",
|
|
39
|
+
"test": "vitest run",
|
|
40
|
+
"test:watch": "vitest watch",
|
|
41
|
+
"test:types": "vue-tsc --noEmit && cd playground && vue-tsc --noEmit"
|
|
42
|
+
},
|
|
43
|
+
"dependencies": {
|
|
44
|
+
"@nuxt/kit": "^4.4.2",
|
|
45
|
+
"@shopify/app-bridge-types": "^0.7.0",
|
|
46
|
+
"@shopify/cli": "^3.92.1",
|
|
47
|
+
"@shopify/polaris-types": "^1.0.1",
|
|
48
|
+
"@shopify/shopify-api": "^13.0.0",
|
|
49
|
+
"@shopify/shopify-app-session-storage": "^5.0.0",
|
|
50
|
+
"isbot": "^5.1.36"
|
|
51
|
+
},
|
|
52
|
+
"devDependencies": {
|
|
53
|
+
"@nuxt/devtools": "^3.2.4",
|
|
54
|
+
"@nuxt/eslint-config": "^1.15.2",
|
|
55
|
+
"@nuxt/module-builder": "^1.0.2",
|
|
56
|
+
"@nuxt/schema": "^4.4.2",
|
|
57
|
+
"@nuxt/test-utils": "^4.0.0",
|
|
58
|
+
"@types/node": "^25.5.0",
|
|
59
|
+
"changelogen": "^0.6.2",
|
|
60
|
+
"eslint": "^10.1.0",
|
|
61
|
+
"nuxt": "^4.4.2",
|
|
62
|
+
"typescript": "6.0.2",
|
|
63
|
+
"vitest": "^4.1.2",
|
|
64
|
+
"vue-tsc": "^3.2.6"
|
|
65
|
+
}
|
|
66
|
+
}
|