Skip to content

Commit

Permalink
Version Packages
Browse files Browse the repository at this point in the history
  • Loading branch information
github-actions[bot] committed Feb 8, 2024
1 parent 689d338 commit 12012e8
Show file tree
Hide file tree
Showing 42 changed files with 207 additions and 168 deletions.
2 changes: 0 additions & 2 deletions .changeset/big-humans-tease.md

This file was deleted.

5 changes: 0 additions & 5 deletions .changeset/chilled-singers-return.md

This file was deleted.

5 changes: 0 additions & 5 deletions .changeset/empty-queens-hide.md

This file was deleted.

5 changes: 0 additions & 5 deletions .changeset/few-pots-breathe.md

This file was deleted.

5 changes: 0 additions & 5 deletions .changeset/fifty-points-push.md

This file was deleted.

2 changes: 0 additions & 2 deletions .changeset/fresh-bottles-tell.md

This file was deleted.

5 changes: 0 additions & 5 deletions .changeset/friendly-laws-yell.md

This file was deleted.

2 changes: 0 additions & 2 deletions .changeset/lucky-cooks-glow.md

This file was deleted.

5 changes: 0 additions & 5 deletions .changeset/ninety-mugs-agree.md

This file was deleted.

2 changes: 0 additions & 2 deletions .changeset/proud-knives-happen.md

This file was deleted.

5 changes: 0 additions & 5 deletions .changeset/serious-bears-brake.md

This file was deleted.

5 changes: 0 additions & 5 deletions .changeset/sixty-boxes-matter.md

This file was deleted.

2 changes: 0 additions & 2 deletions .changeset/sixty-pans-wave.md

This file was deleted.

17 changes: 0 additions & 17 deletions .changeset/soft-knives-pretend.md

This file was deleted.

5 changes: 0 additions & 5 deletions .changeset/stupid-peas-lay.md

This file was deleted.

5 changes: 0 additions & 5 deletions .changeset/wild-vans-carry.md

This file was deleted.

21 changes: 15 additions & 6 deletions packages/shopify-app-express/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,14 @@
# Changelog

## 4.0.2

### Patch Changes

- f5742c1: Updated dependency on `@shopify/shopify-api`
- Updated dependencies [f5742c1]
- @shopify/shopify-app-session-storage-memory@2.0.5
- @shopify/shopify-app-session-storage@2.0.5

## 4.0.1

### Patch Changes
Expand Down Expand Up @@ -69,19 +78,19 @@ If you need to explicitly set those generics, you'll need to use the `AppConfigP
Before:

```ts
import {ShopifyApp} from '@shopify/shopify-app-express';
import {restResources} from '@shopify/shopify-api/rest/admin/2023-10';
import {MemorySessionStorage} from '@shopify/shopify-app-session-storage-memory';
import { ShopifyApp } from "@shopify/shopify-app-express";
import { restResources } from "@shopify/shopify-api/rest/admin/2023-10";
import { MemorySessionStorage } from "@shopify/shopify-app-session-storage-memory";

const myVariable: ShopifyApp<typeof restResources, MemorySessionStorage>;
```

After:

```ts
import {ShopifyApp, AppConfigParams} from '@shopify/shopify-app-express';
import {restResources} from '@shopify/shopify-api/rest/admin/2023-10';
import {MemorySessionStorage} from '@shopify/shopify-app-session-storage-memory';
import { ShopifyApp, AppConfigParams } from "@shopify/shopify-app-express";
import { restResources } from "@shopify/shopify-api/rest/admin/2023-10";
import { MemorySessionStorage } from "@shopify/shopify-app-session-storage-memory";

const myVariable: ShopifyApp<
AppConfigParams<typeof restResources, MemorySessionStorage>
Expand Down
6 changes: 3 additions & 3 deletions packages/shopify-app-express/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@shopify/shopify-app-express",
"version": "4.0.1",
"version": "4.0.2",
"description": "Shopify Express Middleware - to simplify the building of Shopify Apps with Express",
"repository": {
"type": "git",
Expand Down Expand Up @@ -31,8 +31,8 @@
],
"dependencies": {
"@shopify/shopify-api": "^9.1.0",
"@shopify/shopify-app-session-storage": "^2.0.4",
"@shopify/shopify-app-session-storage-memory": "^2.0.4",
"@shopify/shopify-app-session-storage": "^2.0.5",
"@shopify/shopify-app-session-storage-memory": "^2.0.5",
"cookie-parser": "^1.4.6",
"express": "^4.18.1",
"semver": "^7.5.4"
Expand Down
114 changes: 65 additions & 49 deletions packages/shopify-app-remix/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,21 @@
# @shopify/shopify-app-remix

## 2.5.0

### Minor Changes

- 6d5b4e0: Add check function to the billing API
- ba3eff7: Added a new method `shopify.authenticate.flow(request)`, which will validate a Flow extension request, and return the payload / API clients to the app.
- da09f4e: Add SessionNotFoundError for unauthenticated requests

### Patch Changes

- 8811faa: Updated the `@shopify/admin-api-client` dependency
- f5742c1: Updated dependency on `@shopify/shopify-api`
- 37dff44: Updated Remix dependencies to v2.5.1
- Updated dependencies [f5742c1]
- @shopify/shopify-app-session-storage@2.0.5

## 2.4.0

### Minor Changes
Expand Down Expand Up @@ -117,11 +133,11 @@
When using variables, `data` needs to be an object containing `query` and `variables`.

```ts
import {json, ActionFunctionArgs} from '@remix-run/node';
import {authenticate} from '../shopify.server';
import { json, ActionFunctionArgs } from "@remix-run/node";
import { authenticate } from "../shopify.server";

export async function action({request}: ActionFunctionArgs) {
const {admin} = await authenticate.webhook(request);
export async function action({ request }: ActionFunctionArgs) {
const { admin } = await authenticate.webhook(request);

const response = await admin?.graphql.query<any>({
data: {
Expand All @@ -133,23 +149,23 @@
}
}
}`,
variables: {input: {title: 'Product Name'}},
variables: { input: { title: "Product Name" } },
},
});

const productData = response?.body.data;
return json({data: productData.data});
return json({ data: productData.data });
}
```

With the `v3_webhookContext` flag enabled, `graphql` _is_ a function that takes in the query string and an optional settings object, including `variables`.

```ts
import {ActionFunctionArgs} from '@remix-run/node';
import {authenticate} from '../shopify.server';
import { ActionFunctionArgs } from "@remix-run/node";
import { authenticate } from "../shopify.server";

export async function action({request}: ActionFunctionArgs) {
const {admin} = await authenticate.webhook(request);
export async function action({ request }: ActionFunctionArgs) {
const { admin } = await authenticate.webhook(request);

const response = await admin?.graphql(
`#graphql
Expand All @@ -160,11 +176,11 @@
}
}
}`,
{variables: {input: {title: 'Product Name'}}},
{ variables: { input: { title: "Product Name" } } },
);

const productData = await response.json();
return json({data: productData.data});
return json({ data: productData.data });
}
```

Expand All @@ -190,12 +206,12 @@
<summary>App Proxy</summary>

```ts
import {json} from '@remix-run/node';
import {authenticate} from '~/shopify.server';
import { json } from "@remix-run/node";
import { authenticate } from "~/shopify.server";

export async function loader({request}) {
const {storefront} = await authenticate.public.appProxy(request);
const response = await storefront.graphql('{blogs(first: 10) {nodes{id}}}');
export async function loader({ request }) {
const { storefront } = await authenticate.public.appProxy(request);
const response = await storefront.graphql("{blogs(first: 10) {nodes{id}}}");

return json(await response.json());
}
Expand All @@ -207,17 +223,17 @@
<summary>Unauthenticated Storefront</summary>

```ts
import {json} from '@remix-run/node';
import {unauthenticated} from '~/shopify.server';
import {customAuthenticateRequest} from '~/helpers';
import { json } from "@remix-run/node";
import { unauthenticated } from "~/shopify.server";
import { customAuthenticateRequest } from "~/helpers";

export async function loader({request}) {
export async function loader({ request }) {
await customAuthenticateRequest(request);

const {storefront} = await unauthenticated.storefront(
'my-shop.myshopify.com',
const { storefront } = await unauthenticated.storefront(
"my-shop.myshopify.com",
);
const response = await storefront.graphql('{blogs(first: 10) {nodes{id}}}');
const response = await storefront.graphql("{blogs(first: 10) {nodes{id}}}");

return json(await response.json());
}
Expand All @@ -233,17 +249,17 @@
<summary>Override billing configs when calling <code>request</code></summary>

```ts
import {json} from '@remix-run/node';
import {authenticate} from '~/shopify.server';
import { json } from "@remix-run/node";
import { authenticate } from "~/shopify.server";

export async function loader({request}) {
const {billing} = await authenticate.admin(request);
export async function loader({ request }) {
const { billing } = await authenticate.admin(request);

await billing.require({
plans: ['plan1', 'plan2'],
plans: ["plan1", "plan2"],
onFailure: async () =>
await billing.request({
plan: 'plan1',
plan: "plan1",
trialDays: 5, // Override the trialDays config value
}),
});
Expand Down Expand Up @@ -275,12 +291,12 @@

```ts
// app/routes/**\/.ts
import {authenticate} from '~/shopify.server';
import { authenticate } from "~/shopify.server";

export async function loader({request}) {
const {liquid, admin} = authenticate.public.appProxy(request);
export async function loader({ request }) {
const { liquid, admin } = authenticate.public.appProxy(request);

return liquid('Hello {{shop.name}}');
return liquid("Hello {{shop.name}}");
}
```

Expand All @@ -291,12 +307,12 @@

```ts
// app/routes/**\/.ts
import {authenticate} from '~/shopify.server';
import { authenticate } from "~/shopify.server";

export async function loader({request}) {
const {liquid, admin} = authenticate.public.appProxy(request);
export async function loader({ request }) {
const { liquid, admin } = authenticate.public.appProxy(request);

const response = await admin.graphql('QUERY');
const response = await admin.graphql("QUERY");
const json = await response.json();

return json(json);
Expand Down Expand Up @@ -333,8 +349,8 @@

```ts
// app/shopify.server.ts
import {shopifyApp} from '@shopify/shopify-app-remix';
import {restResources} from '@shopify/shopify-api/rest/admin/2023-04';
import { shopifyApp } from "@shopify/shopify-app-remix";
import { restResources } from "@shopify/shopify-api/rest/admin/2023-04";

const shopify = shopifyApp({
restResources,
Expand All @@ -344,15 +360,15 @@
export default shopify;

// app/routes/\/.jsx
import {json} from '@remix-run/node';
import {authenticateExternalRequest} from '~/helpers/authenticate';
import shopify from '../../shopify.server';
import { json } from "@remix-run/node";
import { authenticateExternalRequest } from "~/helpers/authenticate";
import shopify from "../../shopify.server";

export async function loader({request}) {
export async function loader({ request }) {
const shop = await authenticateExternalRequest(request);
const {admin, session} = await shopify.unauthenticated.admin(shop);
const { admin, session } = await shopify.unauthenticated.admin(shop);

return json(await admin.rest.resources.Product.count({session}));
return json(await admin.rest.resources.Product.count({ session }));
}
```

Expand All @@ -366,10 +382,10 @@
<summary>See an example</summary>

```ts
export const loader = async ({request}) => {
const {redirect} = await authenticate.admin(request);
export const loader = async ({ request }) => {
const { redirect } = await authenticate.admin(request);

return redirect('https://www.example.com', {target: '_top'});
return redirect("https://www.example.com", { target: "_top" });
};
```

Expand Down
Loading

0 comments on commit 12012e8

Please sign in to comment.