From e83d924e6a55e86546a9067f5d06c40617c295bf Mon Sep 17 00:00:00 2001 From: Paulo Margarido <64600052+paulomarg@users.noreply.github.com> Date: Tue, 6 Feb 2024 09:52:43 -0500 Subject: [PATCH] Improve intros in unauthenticated docs --- .changeset/sixty-pans-wave.md | 2 ++ .../docs/generated/generated_docs_data.json | 32 +++++++------------ .../admin/unauthenticated.admin.doc.ts | 9 +++--- .../unauthenticated.storefront.doc.ts | 9 +++--- 4 files changed, 24 insertions(+), 28 deletions(-) create mode 100644 .changeset/sixty-pans-wave.md diff --git a/.changeset/sixty-pans-wave.md b/.changeset/sixty-pans-wave.md new file mode 100644 index 0000000000..a845151cc8 --- /dev/null +++ b/.changeset/sixty-pans-wave.md @@ -0,0 +1,2 @@ +--- +--- diff --git a/packages/shopify-app-remix/docs/generated/generated_docs_data.json b/packages/shopify-app-remix/docs/generated/generated_docs_data.json index e0283d818f..aa99296ae2 100644 --- a/packages/shopify-app-remix/docs/generated/generated_docs_data.json +++ b/packages/shopify-app-remix/docs/generated/generated_docs_data.json @@ -16,6 +16,14 @@ "name": "AppProviderProps", "description": "", "members": [ + { + "filePath": "../../node_modules/@shopify/polaris/build/ts/src/components/AppProvider/AppProvider.d.ts", + "syntaxKind": "PropertySignature", + "name": "theme", + "value": "ThemeName", + "description": "", + "isOptional": true + }, { "filePath": "../../node_modules/@shopify/polaris/build/ts/src/components/AppProvider/AppProvider.d.ts", "syntaxKind": "PropertySignature", @@ -48,7 +56,7 @@ "isOptional": true } ], - "value": "export interface AppProviderProps {\n /** A locale object or array of locale objects that overrides default translations. If specifying an array then your primary language dictionary should come first, followed by your fallback language dictionaries */\n i18n: ConstructorParameters[0];\n /** A custom component to use for all links used by Polaris components */\n linkComponent?: LinkLikeComponent;\n /** For toggling features */\n features?: FeaturesConfig;\n /** Inner content of the application */\n children?: React.ReactNode;\n}" + "value": "export interface AppProviderProps {\n theme?: ThemeName;\n /** A locale object or array of locale objects that overrides default translations. If specifying an array then your primary language dictionary should come first, followed by your fallback language dictionaries */\n i18n: ConstructorParameters[0];\n /** A custom component to use for all links used by Polaris components */\n linkComponent?: LinkLikeComponent;\n /** For toggling features */\n features?: FeaturesConfig;\n /** Inner content of the application */\n children?: React.ReactNode;\n}" }, "TranslationDictionary": { "filePath": "../../node_modules/@shopify/polaris/build/ts/src/utilities/i18n/I18n.d.ts", @@ -79,25 +87,9 @@ "filePath": "../../node_modules/@shopify/polaris/build/ts/src/utilities/features/types.d.ts", "name": "[key: string]", "value": "boolean | undefined" - }, - { - "filePath": "../../node_modules/@shopify/polaris/build/ts/src/utilities/features/types.d.ts", - "syntaxKind": "PropertySignature", - "name": "polarisSummerEditions2023", - "value": "boolean", - "description": "", - "isOptional": true - }, - { - "filePath": "../../node_modules/@shopify/polaris/build/ts/src/utilities/features/types.d.ts", - "syntaxKind": "PropertySignature", - "name": "polarisSummerEditions2023ShadowBevelOptOut", - "value": "boolean", - "description": "", - "isOptional": true } ], - "value": "export interface FeaturesConfig {\n polarisSummerEditions2023?: boolean;\n polarisSummerEditions2023ShadowBevelOptOut?: boolean;\n [key: string]: boolean | undefined;\n}" + "value": "export interface FeaturesConfig {\n [key: string]: boolean | undefined;\n}" } } } @@ -14700,7 +14692,7 @@ }, { "name": "Unauthenticated admin", - "description": "Allows interacting with the Admin API on requests that didn't come from Shopify.\n\n> Caution: This should only be used for Requests that do not originate from Shopify.\n> You must do your own authentication before using this method.\n>This function doesn't perform **any** validation and shouldn't rely on unvalidated user input.", + "description": "Allows interacting with the Admin API on requests that didn't come from Shopify, which enables apps to integrate with 3rd party services.\n\nBecause the request isn't sent by Shopify, this package isn't able to authenticate the request.\nIn that case, it is up to the app to obtain the shop domain from the 3rd party service in a secure way.\n\n> Caution:\n> This function doesn't perform **any** validation and shouldn't rely on raw user input.", "category": "Unauthenticated", "type": "object", "isVisualComponent": false, @@ -15448,7 +15440,7 @@ }, { "name": "Unauthenticated storefront", - "description": "Allows interacting with the Storefront API on requests that didn't come from Shopify.\n\n> Caution: This should only be used for Requests that do not originate from Shopify.\n> You must do your own authentication before using this method.\n>This function doesn't perform **any** validation and shouldn't rely on unvalidated user input.", + "description": "Allows interacting with the Storefront API on requests that didn't come from Shopify, which enables apps to integrate with 3rd party services.\n\nBecause the request isn't sent by Shopify, this package isn't able to authenticate the request.\nIn that case, it is up to the app to obtain the shop domain from the 3rd party service in a secure way.\n\n> Caution:\n> This function doesn't perform **any** validation and shouldn't rely on raw user input.", "category": "Unauthenticated", "type": "object", "isVisualComponent": false, diff --git a/packages/shopify-app-remix/src/server/unauthenticated/admin/unauthenticated.admin.doc.ts b/packages/shopify-app-remix/src/server/unauthenticated/admin/unauthenticated.admin.doc.ts index d07bcd2195..d8c026775a 100644 --- a/packages/shopify-app-remix/src/server/unauthenticated/admin/unauthenticated.admin.doc.ts +++ b/packages/shopify-app-remix/src/server/unauthenticated/admin/unauthenticated.admin.doc.ts @@ -3,10 +3,11 @@ import {ReferenceEntityTemplateSchema} from '@shopify/generate-docs'; const data: ReferenceEntityTemplateSchema = { name: 'Unauthenticated admin', description: - "Allows interacting with the Admin API on requests that didn't come from Shopify." + - '\n\n> Caution: This should only be used for Requests that do not originate from Shopify.' + - '\n> You must do your own authentication before using this method.' + - "\n>This function doesn't perform **any** validation and shouldn't rely on unvalidated user input.", + "Allows interacting with the Admin API on requests that didn't come from Shopify, which enables apps to integrate with 3rd party services." + + "\n\nBecause the request isn't sent by Shopify, this package isn't able to authenticate the request." + + '\nIn that case, it is up to the app to obtain the shop domain from the 3rd party service in a secure way.' + + '\n\n> Caution:' + + "\n> This function doesn't perform **any** validation and shouldn't rely on raw user input.", category: 'Unauthenticated', type: 'object', isVisualComponent: false, diff --git a/packages/shopify-app-remix/src/server/unauthenticated/storefront/unauthenticated.storefront.doc.ts b/packages/shopify-app-remix/src/server/unauthenticated/storefront/unauthenticated.storefront.doc.ts index 2456cec4ad..55ab987310 100644 --- a/packages/shopify-app-remix/src/server/unauthenticated/storefront/unauthenticated.storefront.doc.ts +++ b/packages/shopify-app-remix/src/server/unauthenticated/storefront/unauthenticated.storefront.doc.ts @@ -3,10 +3,11 @@ import {ReferenceEntityTemplateSchema} from '@shopify/generate-docs'; const data: ReferenceEntityTemplateSchema = { name: 'Unauthenticated storefront', description: - "Allows interacting with the Storefront API on requests that didn't come from Shopify." + - '\n\n> Caution: This should only be used for Requests that do not originate from Shopify.' + - '\n> You must do your own authentication before using this method.' + - "\n>This function doesn't perform **any** validation and shouldn't rely on unvalidated user input.", + "Allows interacting with the Storefront API on requests that didn't come from Shopify, which enables apps to integrate with 3rd party services." + + "\n\nBecause the request isn't sent by Shopify, this package isn't able to authenticate the request." + + '\nIn that case, it is up to the app to obtain the shop domain from the 3rd party service in a secure way.' + + '\n\n> Caution:' + + "\n> This function doesn't perform **any** validation and shouldn't rely on raw user input.", category: 'Unauthenticated', type: 'object', isVisualComponent: false,