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

Packages for release #1286

Merged
merged 2 commits into from
Mar 27, 2024
Merged

Packages for release #1286

merged 2 commits into from
Mar 27, 2024

Conversation

shopify-github-actions-access[bot]
Copy link

@shopify-github-actions-access shopify-github-actions-access bot commented Mar 18, 2024

This PR was opened by the Changesets release GitHub action. When you're ready to do a release, you can merge this and the packages will be published to npm automatically. If you're not ready to do a release yet, that's fine, whenever you add more changesets to main, this PR will be updated.

Releases

@shopify/shopify-api@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.

    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.

    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/api-codegen-preset@0.0.7

Patch Changes

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

@shopify-github-actions-access shopify-github-actions-access bot requested a review from a team as a code owner March 18, 2024 15:48
@github-actions github-actions bot force-pushed the changeset-release/main branch 5 times, most recently from 03005f3 to 19daf29 Compare March 25, 2024 14:38
@github-actions github-actions bot force-pushed the changeset-release/main branch 5 times, most recently from 8ce7065 to ccd35d1 Compare March 27, 2024 14:04
@github-actions github-actions bot force-pushed the changeset-release/main branch from ccd35d1 to d92ad9b Compare March 27, 2024 14:10
@lizkenyon lizkenyon merged commit 7390cd1 into main Mar 27, 2024
10 checks passed
@lizkenyon lizkenyon deleted the changeset-release/main branch March 27, 2024 14:36
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant