Skip to content
This repository has been archived by the owner on Apr 11, 2024. It is now read-only.

Commit

Permalink
Merge pull request #1286 from Shopify/changeset-release/main
Browse files Browse the repository at this point in the history
Packages for release
  • Loading branch information
lizkenyon authored Mar 27, 2024
2 parents 9f3a2f9 + 86dd327 commit 7390cd1
Show file tree
Hide file tree
Showing 10 changed files with 135 additions and 138 deletions.
5 changes: 0 additions & 5 deletions .changeset/big-donkeys-move.md

This file was deleted.

2 changes: 0 additions & 2 deletions .changeset/rich-falcons-clean.md

This file was deleted.

2 changes: 0 additions & 2 deletions .changeset/strong-falcons-develop.md

This file was deleted.

121 changes: 0 additions & 121 deletions .changeset/warm-hotels-allow.md

This file was deleted.

5 changes: 0 additions & 5 deletions .changeset/young-bobcats-impress.md

This file was deleted.

6 changes: 6 additions & 0 deletions packages/api-codegen-preset/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
# Changelog

## 0.0.7

### Patch Changes

- d86dc11: Bumps @graphql-codegen/introspection from 4.0.0 to 4.0.3.

## 0.0.6

### Patch Changes
Expand Down
2 changes: 1 addition & 1 deletion packages/api-codegen-preset/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@shopify/api-codegen-preset",
"version": "0.0.6",
"version": "0.0.7",
"description": "Preset for graphql-codegen to parse and type queries to Shopify APIs",
"author": "Shopify",
"license": "MIT",
Expand Down
126 changes: 126 additions & 0 deletions packages/shopify-api/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,131 @@
# Changelog

## 9.6.0

### Minor Changes

- b912ecd: Updates the Session class to handle the associated user information on the session object.

Updates the Session `fromPropertyArray` to handle all user info fields. New optional argument `returnUserData`, (defaulted to `false`), will return the user data if it is apart of the property array. This will be defaulted to `true` in an upcoming version.

<details>

```ts
const sessionProperties = session.toPropertyArray(true);
/*
if sessionProperties has the following data...
[
['id', 'online_session_id'],
['shop', 'online-session-shop'],
['state', 'online-session-state'],
['isOnline', true],
['scope', 'online-session-scope'],
['accessToken', 'online-session-token'],
['expires', 1641013200000], // example = January 1, 2022, as number of milliseconds since Jan 1, 1970
['userId', 1],
['first_name', 'online-session-first-name'],
['last_name', 'online-session-last-name'],
['email', 'online-session-email'],
['locale', 'online-session-locale'],
['email_verified', false]
['account_owner', true,]
['collaborator', false],
],
*/

const session = Session.fromPropertyArray(sessionProperties, true);
/*
... then session will have the following data...
{
id: 'online_session_id',
shop: 'online-session-shop',
state: 'online-session-state',
isOnline: true,
scope: 'online-session-scope',
accessToken: 'online-session-token',
expires: 2022-01-01T05:00:00.000Z, // Date object
onlineAccessInfo: {
associated_user: {
id: 1,
first_name: 'online-session-first-name'
last_name: 'online-session-last-name',
email: 'online-session-email',
locale: 'online-session-locale',
email_verified: false,
account_owner: true,
collaborator: false,
},
}
}
*/
```

</details>

Updates the Session `toPropertyArray` to handle all user info fields. New optional argument `returnUserData`, (defaulted to `false`), will return the user data as part of property array object. This will be defaulted to `true` in an upcoming version.

<details>

```ts
const { session, headers } = shopify.auth.callback({
rawRequest: req,
rawResponse: res,
});
/*
If session has the following data content...
{
id: 'online_session_id',
shop: 'online-session-shop',
state: 'online-session-state',
isOnline: true,
scope: 'online-session-scope',
accessToken: 'online-session-token',
expires: 2022-01-01T05:00:00.000Z, // Date object
onlineAccessInfo: {
expires_in: 1,
associated_user_scope: 'online-session-user-scope',
associated_user: {
id: 1,
first_name: 'online-session-first-name',
last_name: 'online-session-last-name',
email: 'online-session-email',
locale: 'online-session-locale',
email_verified: true,
account_owner: true,
collaborator: false,
},
}
}
*/
const sessionProperties = session.toPropertyArray();
/*
... then sessionProperties will have the following data...
[
['id', 'online_session_id'],
['shop', 'online-session-shop'],
['state', 'online-session-state'],
['isOnline', true],
['scope', 'online-session-scope'],
['accessToken', 'online-session-token'],
['expires', 1641013200000], // example = January 1, 2022, as number of milliseconds since Jan 1, 1970
['userId', 1], // New returns the user id under the userId key instead of onlineAccessInfo
['first_name', 'online-session-first-name'],
['last_name', 'online-session-last-name'],
['email', 'online-session-email'],
['locale', 'online-session-locale'],
['email_verified', false]
['account_owner', true,]
['collaborator', false],
],
*/
```

</details>

- 87208ea: Add a context argument to webhooks process function to make it easier for Cloudflare apps (and others that might use a context object) to pass information to the handler.

## 9.5.1

### Patch Changes
Expand Down
2 changes: 1 addition & 1 deletion packages/shopify-api/lib/version.ts
Original file line number Diff line number Diff line change
@@ -1 +1 @@
export const SHOPIFY_API_LIBRARY_VERSION = '9.5.1';
export const SHOPIFY_API_LIBRARY_VERSION = '9.6.0';
2 changes: 1 addition & 1 deletion packages/shopify-api/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@shopify/shopify-api",
"version": "9.5.1",
"version": "9.6.0",
"description": "Shopify API Library for Node - accelerate development with support for authentication, graphql proxy, webhooks",
"main": "./lib/index.js",
"types": "./lib/index.d.ts",
Expand Down

0 comments on commit 7390cd1

Please sign in to comment.