From d92ad9bda408e0edd64320fe8b1670bbba0027f4 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Wed, 27 Mar 2024 14:10:45 +0000 Subject: [PATCH 1/2] Version Packages --- .changeset/big-donkeys-move.md | 5 - .changeset/rich-falcons-clean.md | 2 - .changeset/strong-falcons-develop.md | 2 - .changeset/warm-hotels-allow.md | 121 ---------------------- .changeset/young-bobcats-impress.md | 5 - packages/api-codegen-preset/CHANGELOG.md | 6 ++ packages/api-codegen-preset/package.json | 2 +- packages/shopify-api/CHANGELOG.md | 126 +++++++++++++++++++++++ packages/shopify-api/package.json | 2 +- 9 files changed, 134 insertions(+), 137 deletions(-) delete mode 100644 .changeset/big-donkeys-move.md delete mode 100644 .changeset/rich-falcons-clean.md delete mode 100644 .changeset/strong-falcons-develop.md delete mode 100644 .changeset/warm-hotels-allow.md delete mode 100644 .changeset/young-bobcats-impress.md diff --git a/.changeset/big-donkeys-move.md b/.changeset/big-donkeys-move.md deleted file mode 100644 index 99eff8634..000000000 --- a/.changeset/big-donkeys-move.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -"@shopify/api-codegen-preset": patch ---- - -Bumps @graphql-codegen/introspection from 4.0.0 to 4.0.3. diff --git a/.changeset/rich-falcons-clean.md b/.changeset/rich-falcons-clean.md deleted file mode 100644 index a845151cc..000000000 --- a/.changeset/rich-falcons-clean.md +++ /dev/null @@ -1,2 +0,0 @@ ---- ---- diff --git a/.changeset/strong-falcons-develop.md b/.changeset/strong-falcons-develop.md deleted file mode 100644 index a845151cc..000000000 --- a/.changeset/strong-falcons-develop.md +++ /dev/null @@ -1,2 +0,0 @@ ---- ---- diff --git a/.changeset/warm-hotels-allow.md b/.changeset/warm-hotels-allow.md deleted file mode 100644 index a0375448c..000000000 --- a/.changeset/warm-hotels-allow.md +++ /dev/null @@ -1,121 +0,0 @@ ---- -"@shopify/shopify-api": minor ---- -Updates the Session class to handle the associated user information on the session object. - -Updates the Session `fromPropertyArray` to handle all user info fields. - -
- -```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, - }, - } - } - */ -``` - -
- -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. - -
- -```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], - ], - */ -``` -
diff --git a/.changeset/young-bobcats-impress.md b/.changeset/young-bobcats-impress.md deleted file mode 100644 index 5fbd3bb12..000000000 --- a/.changeset/young-bobcats-impress.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -'@shopify/shopify-api': minor ---- - -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. diff --git a/packages/api-codegen-preset/CHANGELOG.md b/packages/api-codegen-preset/CHANGELOG.md index 83354e15c..00b04eac9 100644 --- a/packages/api-codegen-preset/CHANGELOG.md +++ b/packages/api-codegen-preset/CHANGELOG.md @@ -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 diff --git a/packages/api-codegen-preset/package.json b/packages/api-codegen-preset/package.json index 483d6563c..5c4dca695 100644 --- a/packages/api-codegen-preset/package.json +++ b/packages/api-codegen-preset/package.json @@ -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", diff --git a/packages/shopify-api/CHANGELOG.md b/packages/shopify-api/CHANGELOG.md index 9c374b37c..cb52f91cb 100644 --- a/packages/shopify-api/CHANGELOG.md +++ b/packages/shopify-api/CHANGELOG.md @@ -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. + +
+ + ```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, + }, + } + } + */ + ``` + +
+ + 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. + +
+ + ```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], + ], + */ + ``` + +
+ +- 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 diff --git a/packages/shopify-api/package.json b/packages/shopify-api/package.json index 2e02d1fe5..4ad98a8f1 100644 --- a/packages/shopify-api/package.json +++ b/packages/shopify-api/package.json @@ -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", From 86dd3270d050fc70c6bb2fcdf584844808139336 Mon Sep 17 00:00:00 2001 From: Elizabeth Kenyon Date: Wed, 27 Mar 2024 10:22:38 -0400 Subject: [PATCH 2/2] preparing for release --- packages/shopify-api/CHANGELOG.md | 2 +- packages/shopify-api/lib/version.ts | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/shopify-api/CHANGELOG.md b/packages/shopify-api/CHANGELOG.md index cb52f91cb..367f2816d 100644 --- a/packages/shopify-api/CHANGELOG.md +++ b/packages/shopify-api/CHANGELOG.md @@ -6,7 +6,7 @@ - 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. + 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.
diff --git a/packages/shopify-api/lib/version.ts b/packages/shopify-api/lib/version.ts index 304f9bf48..2ce6f5f73 100644 --- a/packages/shopify-api/lib/version.ts +++ b/packages/shopify-api/lib/version.ts @@ -1 +1 @@ -export const SHOPIFY_API_LIBRARY_VERSION = '9.5.1'; +export const SHOPIFY_API_LIBRARY_VERSION = '9.6.0';