Releases: Shopify/shopify-api-js
@shopify/[email protected]
@shopify/[email protected]
@shopify/[email protected]
Patch Changes
- b60c6c9: Fixes bug, that is returning the onlineAccessInfo field on the session, when the session if offline
@shopify/[email protected]
Patch Changes
- 96a0aab: Fix bug that was causing duplicate keys in Session when using FromPropertyArray with returnUserData = true
@shopify/[email protected]
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 argumentreturnUserData
, (defaulted tofalse
), will return the user data if it is apart of the property array. This will be defaulted totrue
in an upcoming version.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 argumentreturnUserData
, (defaulted tofalse
), will return the user data as part of property array object. This will be defaulted totrue
in an upcoming version.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.
@shopify/[email protected]
Patch Changes
- d86dc11: Bumps @graphql-codegen/introspection from 4.0.0 to 4.0.3.
@shopify/[email protected]
Patch Changes
- 1344258: Bumps jose from 5.2.2 to 5.2.3.
@shopify/[email protected]
@shopify/[email protected]
Patch Changes
- Updated dependencies [e9652b7]
- @shopify/[email protected]
@shopify/[email protected]
Minor Changes
- 01371f7: Add function to authenticate fulfillment service requests
Patch Changes
- 4e7c479: Show an INFO log for disabled future flags to encourage apps to migrate ahead of time, making major version bumps simpler.
- 13a230d: Enabled returning the full response object in
Customer.search()
andGiftCard.search()
, so that apps can paginate through the results. - f57712c: Refactor HMAC validation to use a common function.
- 01a803d: Reintroduced logging of HTTP requests for OAuth processes, which was incorrectly removed when the new clients were introduced.
- @shopify/[email protected]
- @shopify/[email protected]