Skip to content

Releases: Sitecore/marketplace-sdk

@sitecore-marketplace-sdk/core@0.2.2

09 Sep 02:09
522fba6
Compare
Choose a tag to compare

Patch Changes

  • a650e09: Add OrganizationID and MarketplaceTenantID in ApplicationRuntimeContext

@sitecore-marketplace-sdk/xmc@0.2.1

02 Sep 09:19
afda2e8
Compare
Choose a tag to compare

Patch Changes

  • fec9f87: # experimental_XMC

    🚀 What's New

    Server-side API Support

    experimental_XMC enables API access to Sitecore APIs without requiring the Client SDK mode. Perfect for server-side applications that need to communicate with Sitecore APIs.

    Setup

    import { experimental_createXMCClient } from '@sitecore-marketplace-sdk/xmc';
    
    // No Host SDK required
    const xmc = await experimental_createXMCClient({
      getAccessToken: () => auth0.getAccessTokenSilently(),
    });

    Enhanced Type Safety

    import { experimental_Sites } from '@sitecore-marketplace-sdk/xmc';
    
    // Optional: Full IntelliSense support with types
    const response = await xmc.sites.listLanguages();
    let data: experimental_Sites.ListLanguagesResponse = response.data!;

    🎯 Quick Start

    1. Install and Import

    import { experimental_createXMCClient } from '@sitecore-marketplace-sdk/xmc';
    // Optional: import types for enhanced IntelliSense
    import { experimental_Sites } from '@sitecore-marketplace-sdk/xmc';

    2. Initialize with Auth

    const xmc = await experimental_createXMCClient({
      getAccessToken: () => auth0.getAccessTokenSilently(),
    });

    3. Use APIs

    // Sites API
    const languages = await xmc.sites.listLanguages({
      query: { sitecoreContextId: 'your-context-id' },
    });
    
    // Pages API
    const pages = await xmc.pages.search({
      query: { sitecoreContextId: 'your-context-id' },
    });
    
    // Authoring API
    const result = await xmc.authoring.graphql({
      body: {
        query: `query {
          sites {
            name
          }
        }`,
      },
      query: { sitecoreContextId: 'your-context-id' },
    });
    
    // Content Transfer API
    const transfer = await xmc.contentTransfer.createContentTransfer({
      body: {
        configuration: {
          dataTrees: [
            {
              itemPath: '/sitecore/content/Home',
              scope: 'SingleItem',
              mergeStrategy: 'OverrideExistingItem',
            },
          ],
        },
        transferId: crypto.randomUUID(),
      },
      query: { sitecoreContextId: 'your-context-id' },
    });
    
    // Preview API
    const previewContent = await xmc.preview.graphql({
      body: {
        query: `query {
          item(path: "/sitecore/content/Home", language: "en") {
            id
            name
            path
            fields {
              name
              value
            }
          }
        }`,
      },
      query: { sitecoreContextId: 'your-context-id' },
    });
    
    // Live API
    const liveContent = await xmc.live.graphql({
      body: {
        query: `query {
          item(path: "/sitecore/content/Home", language: "en") {
            id
            name
            path
            fields {
              name
              value
            }
          }
        }`,
      },
      query: { sitecoreContextId: 'your-context-id' },
    });

    🔧 Use Cases

    Server-Side Applications

    // Node.js server, Azure Functions, AWS Lambda, etc.
    const xmc = await experimental_createXMCClient({
      getAccessToken: () => getServerSideToken(),
    });
    
    // Direct API calls without browser context
    const languages = await xmc.sites.listLanguages();

    🎨 Optional Type Support

    For enhanced IntelliSense, you can optionally import type namespaces:

    • experimental_Sites.* - Sites API types
    • experimental_Pages.* - Pages API types
    • experimental_Authoring.* - Authoring API types
    • experimental_ContentTransfer.* - Content Transfer API types
    • experimental_Content.* - Content API types

@sitecore-marketplace-sdk/xmc@0.2.0

14 Aug 01:33
8290f9c
Compare
Choose a tag to compare

Minor Changes

  • ff3ca07: Update XMC SDK to support new extensionPoint naming conventions

    Compatibility Update:

    • Updated to work with new extensionPoint interfaces from core SDK
    • Maintains full backward compatibility with existing touchpoint-based code
    • No breaking changes to XMC-specific functionality

    What changed:

    • Updated dependencies to support new extensionPoint types
    • Enhanced type compatibility for both old and new naming conventions
    • Maintained all XMC-specific functionality while supporting new interface names

Patch Changes

  • Updated dependencies [ff3ca07]
    • @sitecore-marketplace-sdk/client@0.2.0

@sitecore-marketplace-sdk/client@0.2.0

14 Aug 01:32
8290f9c
Compare
Choose a tag to compare

Minor Changes

  • ff3ca07: Updated application context response with improved property naming and enhanced type definitions

    🔄 What's Changed in Application Context Response:

    When you call client.query('application.context'), the response now includes updated property names for better clarity:

    New Property Names (Recommended):

    const context = await client.query('application.context');
    
    // ✅ New: resourceAccess (replaces resources)
    context.data.resourceAccess; // Array of resource access information
    
    // ✅ New: extensionPoints (replaces touchpoints)
    context.data.extensionPoints; // Array of available extension points

    Legacy Properties (Still Supported):

    // ⚠️ Deprecated but still works: resources
    context.data.resources; // Still returns resource data
    
    // ⚠️ Deprecated but still works: touchpoints
    context.data.touchpoints; // Still returns extension point data

    📋 Updated Response Structure:

    // Application context now returns both old and new properties
    interface ApplicationContext {
      // Resource access information
      resourceAccess: ApplicationResourceContext[]; // ✅ New name
      resources: ApplicationResourceContext[]; // ⚠️ Deprecated
    
      // Extension points information
      extensionPoints: ApplicationExtensionPointContext[]; // ✅ New name
      touchpoints: ApplicationTouchpointContext[]; // ⚠️ Deprecated
    
      // Other properties remain unchanged
      id: string;
      name: string;
      url: string;
      // ... etc
    }

    ✅ Full Backward Compatibility:

    Your existing code continues to work without any changes:

    • ✅ All existing property access (resources, touchpoints) functions normally
    • ✅ No breaking changes to response structure
    • ✅ Both old and new properties are available in every response
    • ✅ Update at your own pace - no migration pressure

    🚀 Benefits of New Names:

    • resourceAccess: More accurately describes granted access permissions
    • extensionPoints: Better describes integration points in your application
    • Consistency: Aligns with modern naming conventions across Sitecore products
    • Clarity: More descriptive names improve code readability

    📖 Migration Examples:

    // Before (still works)
    const resources = context.data.resources;
    const touchpoints = context.data.touchpoints;
    
    resources.forEach((resource) => {
      console.log(`Access to: ${resource.resourceId}`);
    });
    
    touchpoints.forEach((touchpoint) => {
      console.log(`Extension point: ${touchpoint.touchpointId}`);
    });
    
    // After (recommended for new code)
    const resourceAccess = context.data.resourceAccess;
    const extensionPoints = context.data.extensionPoints;
    
    resourceAccess.forEach((access) => {
      console.log(`Access to: ${access.resourceId}`);
    });
    
    extensionPoints.forEach((point) => {
      console.log(`Extension point: ${point.extensionPointId}`);
    });

    🔧 Recommended Migration Path:

    1. Immediate: No action required - existing code continues working
    2. New Code: Use resourceAccess and extensionPoints for new implementations
    3. Gradual Updates: Update existing code when convenient during regular maintenance
    4. IDE Benefits: New property names provide better IntelliSense and type checking

    This update improves the clarity of your application context data while maintaining complete backward compatibility.

@sitecore-marketplace-sdk/core@0.2.1

11 Aug 14:28
ea2f21d
Compare
Choose a tag to compare

Patch Changes

  • d41657b: Fixes AllowedExtensionPoints exports

@sitecore-marketplace-sdk/core@0.2.0

11 Aug 03:35
fd8b6a4
Compare
Choose a tag to compare

Minor Changes

  • ff3ca07: Introduce new extensionPoint naming conventions with full backward compatibility

    New Features:

    • Added AllowedExtensionPoints type alias for AllowedTouchpoints enum
    • Added ApplicationExtensionPointContext interface as the new standard (replaces ApplicationTouchpointContext)
    • Added ApplicationExtensionPointMetaContext interface as the new standard (replaces ApplicationTouchpointMetaContext)
    • Added extensionPoints property to ApplicationContext and ApplicationRuntimeContext interfaces
    • Updated resourceAccess property naming (replaces deprecated resources)

    Backward Compatibility:

    This is a fully backward-compatible change. All existing code will continue to work without modifications:

    • AllowedTouchpoints enum remains unchanged and fully functional
    • ApplicationTouchpointContext and ApplicationTouchpointMetaContext interfaces remain functional but are marked as deprecated
    • touchpoints and resources properties continue to work but show deprecation warnings

    What changed:

    • Added new extensionPoints property alongside deprecated touchpoints
    • Added new extension point interfaces with cleaner naming
    • Added type alias for better API consistency
    • Maintained full backward compatibility with automatic property mapping

@sitecore-marketplace-sdk/xmc@0.1.7

21 Jul 04:35
ffea8ea
Compare
Choose a tag to compare

Patch Changes

  • 90aaa94: XMC package now includes exported types for query and mutation requests and responses.

@sitecore-marketplace-sdk/core@0.1.6

23 Jun 08:06
0d33a8e
Compare
Choose a tag to compare

Patch Changes

  • d2f72e4: Updates itemVersion field type to number in pages context mutation
  • 11081ee: Updates application touchpoint context to support multiple dashboard blocks

@sitecore-marketplace-sdk/xmc@0.1.4

17 Jun 05:11
52e0e14
Compare
Choose a tag to compare

Patch Changes

  • Updated dependencies [d385577]
  • Updated dependencies [7f64b54]
  • Updated dependencies [b48590c]
  • Updated dependencies [da1106f]
    • @sitecore-marketplace-sdk/client@0.1.4

@sitecore-marketplace-sdk/core@0.1.5

17 Jun 06:47
088b5cb
Compare
Choose a tag to compare

Patch Changes

  • 402b92a: Adds types for host init new property applicationContext