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

Releases: Shopify/shopify-api-js

@shopify/shopify-api@9.7.1

08 Apr 16:21
a2a3fd1
Compare
Choose a tag to compare

Patch Changes

  • a60c214: Fix type error in graphql error handler
  • 513f9e6: Fixed an issue with the RecurringApplicationCharge REST resource currency type

@shopify/shopify-api@9.7.0

03 Apr 21:26
4b31178
Compare
Choose a tag to compare

Minor Changes

  • 3415a8c: Added support for the 2024-04 API version.
  • c9dff9f: Add Shop.current() method to the REST resources

@shopify/shopify-api@9.6.2

01 Apr 20:24
f6b31b4
Compare
Choose a tag to compare

Patch Changes

  • b60c6c9: Fixes bug, that is returning the onlineAccessInfo field on the session, when the session if offline

@shopify/shopify-api@9.6.1

01 Apr 18:39
af30ecd
Compare
Choose a tag to compare

Patch Changes

  • 96a0aab: Fix bug that was causing duplicate keys in Session when using FromPropertyArray with returnUserData = true

@shopify/shopify-api@9.6.0

27 Mar 14:37
7390cd1
Compare
Choose a tag to compare

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.

    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

27 Mar 14:37
7390cd1
Compare
Choose a tag to compare

Patch Changes

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

@shopify/shopify-api@9.5.1

14 Mar 16:11
dce7ce2
Compare
Choose a tag to compare

Patch Changes

  • 1344258: Bumps jose from 5.2.2 to 5.2.3.

@shopify/api-codegen-preset@0.0.6

14 Mar 16:11
dce7ce2
Compare
Choose a tag to compare

Patch Changes

  • dba2232: Bumps @graphql-codegen/cli from 5.0.0 to 5.0.2.
  • edb4bb0: Bumps @parcel/watcher from 2.4.0 to 2.4.1.

@shopify/storefront-api-client@0.3.3

06 Mar 15:56
2f949f7
Compare
Choose a tag to compare

Patch Changes

  • Updated dependencies [e9652b7]
    • @shopify/graphql-client@0.10.3

@shopify/shopify-api@9.5.0

06 Mar 15:55
2f949f7
Compare
Choose a tag to compare

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() and GiftCard.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/admin-api-client@0.2.8
    • @shopify/storefront-api-client@0.3.3