@commercelayer/app-elements 3.2.1 → 3.3.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,4 +1,4 @@
1
- import { ListableResourceType, ResourceUpdate } from '@commercelayer/sdk';
1
+ import { ListableResourceType, ResourceTypeLock, ResourceUpdate } from '@commercelayer/sdk';
2
2
  /**
3
3
  * Format a resource name for display in the UI based on the count and format.
4
4
  * default format is lower case and singular
@@ -9,3 +9,11 @@ export declare function formatResourceName({ resource, count, format }: {
9
9
  format?: 'lower' | 'title';
10
10
  }): string;
11
11
  export type TriggerAttribute<Resource extends ResourceUpdate> = Extract<keyof Resource, `_${string}`>;
12
+ export type ResourceEndpoint = Exclude<ResourceTypeLock, 'applications' | 'organizations'> | ('organization' | 'application');
13
+ /**
14
+ * Get the resource endpoint for a given resource type.
15
+ * @param resourceType The resource type
16
+ * @returns The resource endpoint
17
+ * @example getResourceEndpoint('organizations') // 'organization'
18
+ */
19
+ export declare function getResourceEndpoint(resourceType: ResourceTypeLock): ResourceEndpoint;