@stackable-labs/sdk-extension-contracts 2.31.0 → 3.0.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.
package/dist/index.d.ts CHANGED
@@ -1111,16 +1111,33 @@ declare const CAPABILITY_PERMISSION_MAP: {
1111
1111
  /** Capability key type — dot-notation API names (e.g., 'data.query', 'actions.toast') */
1112
1112
  type Capability = keyof typeof CAPABILITY_PERMISSION_MAP;
1113
1113
  /**
1114
- * Maps event hook names (as used in source code) to the permission required to
1115
- * subscribe via that hook.
1114
+ * Maps event-hook names to the permission required to subscribe via that hook.
1115
+ * Use this when iterating event hooks specifically (e.g., docs that talk about
1116
+ * the manifest `events` array, drift guardrails over `## events:*` doc sections).
1117
+ * For broader "any hook → permission" detection, use HOOK_PERMISSION_MAP below.
1116
1118
  */
1117
1119
  declare const EVENT_HOOK_PERMISSION_MAP: {
1118
1120
  readonly useIdentityEvent: "events:identity";
1119
1121
  readonly useMessagingEvent: "events:messaging";
1120
1122
  readonly useActivityEvent: "events:activity";
1121
1123
  };
1122
- /** Event-hook key type — hook names (e.g., 'useIdentityEvent', 'useMessagingEvent') */
1124
+ /** Event-hook key type — hook names that subscribe to host events. */
1123
1125
  type EventHook = keyof typeof EVENT_HOOK_PERMISSION_MAP;
1126
+ /**
1127
+ * Maps React hook names (as used in source code) to the permission required to
1128
+ * use that hook. Covers event hooks AND non-event hooks (useExtendIdentity,
1129
+ * useMessaging) so static analysis can detect the full author-facing surface.
1130
+ * Composed from EVENT_HOOK_PERMISSION_MAP + the non-event additions.
1131
+ */
1132
+ declare const HOOK_PERMISSION_MAP: {
1133
+ readonly useMessaging: "messaging:send";
1134
+ readonly useExtendIdentity: "identity:extend";
1135
+ readonly useIdentityEvent: "events:identity";
1136
+ readonly useMessagingEvent: "events:messaging";
1137
+ readonly useActivityEvent: "events:activity";
1138
+ };
1139
+ /** Hook key type — React hook names (e.g., 'useIdentityEvent', 'useMessaging'). */
1140
+ type Hook = keyof typeof HOOK_PERMISSION_MAP;
1124
1141
 
1125
1142
  /**
1126
1143
  * Extension Manifest Schema
@@ -1271,6 +1288,9 @@ type HostToSandboxMessage = {
1271
1288
  } | {
1272
1289
  type: 'surface-lifecycle';
1273
1290
  data: SurfaceLifecycleMessage;
1291
+ } | {
1292
+ type: 'messaging-lifecycle';
1293
+ enabled: boolean;
1274
1294
  } | {
1275
1295
  type: 'extension-encryption-key';
1276
1296
  encryptionKey: string;
@@ -1529,4 +1549,4 @@ interface Order {
1529
1549
  declare const TEMPLATE_FLAVORS: readonly ["minimal", "starter", "kitchen-sink"];
1530
1550
  type TemplateFlavor = typeof TEMPLATE_FLAVORS[number];
1531
1551
 
1532
- export { ACTIVITY_EVENT, ALLOWED_ICONS, type ActionInvokePayload, type ActionMetadataValue, type ActionPayloadMap, type ActivityEvent, type ActivityEventHandler, type ActivityEventType, type Address, type AllowedIconName, type ApiError, type ApiRequest, type ApiResponse, type BaseAction, type BaseMessagePayload, CAPABILITY_PERMISSION_MAP, type Capability, type CapabilityCall, type CapabilityRequest, type CapabilityResponse, type CapabilityType, type ContextData, type ConversationField, type ConversationTags, type Customer, type DataField, type DataFieldType, EVENT_HOOK_PERMISSION_MAP, type EncryptedPayload, type EventDomain, type EventHook, type EventType, type ExtendIdentityHandler, type ExtendIdentityRequest, type ExtendIdentityResponse, type ExtensionGroup, type ExtensionManifest, type ExtensionRegistryEntry, type FetchRequest, type FetchRequestInit, type FetchResponse, type HostToSandboxMessage, IDENTITY_CLAIMS_MAX_KEYS, IDENTITY_CLAIM_KEY_PATTERN, IDENTITY_CLAIM_MAX_STRING_VALUE_LEN, IDENTITY_EVENT, INVOKE_ACTION, type IdentityBaseClaims, type IdentityEvent, type IdentityEventType, type IdentityExtendPayload, type IdentityExtendResponse, type IdentityState, type InstanceConfig, type InstanceOption, type InvokeAction, type LinkAction, type LocationRequestAction, MESSAGING_ACTION_EXAMPLES, MESSAGING_SEND_EXAMPLES, type MarketplaceExtension, type MessageAction, type MessageItem, type MessageItemAction, type MessagePayloadKind, type MessagingContext, type MessagingEvent, type MessagingEventHandler, type MessagingEventType, type MessagingPostbackEvent, type MessengerCommand, type NamedEntity, type NewConversationPayload, type Order, type OrderAction, type OrderItem, type OrderStatus, type OrderStatuses, PERMISSIONS, type Permission, type PostbackAction, type Price, RESERVED_CONTEXT_KEYS, RESERVED_IDENTITY_CLAIM_KEYS, type ReplyAction, type ReservedContextKey, STANDARD_IDENTITY_CLAIM_KEYS, SURFACE_TARGET, type SandboxToHostMessage, type SendCarouselMessagePayload, type SendFileMessagePayload, type SendImageMessagePayload, type SendMessageActionableErrorCode, type SendMessageErrorCode, type SendMessagePayload, type SendMessageResponse, type SendTextMessagePayload, type Shipment, type SurfaceContext, type SurfaceLifecycleMessage, type SurfaceTarget, TEMPLATE_FLAVORS, type Target, type TemplateFlavor, type TextEnabledPayload, type TextFormat, type Theme, type ToastPayload, type UITag, type UITagCategory, UI_TAGS, UI_TAG_ATTRIBUTES, UI_TAG_ATTRIBUTE_VALUES, UI_TAG_CATEGORIES, UI_TAG_CHILDREN, UI_TAG_CHILD_ONLY, UI_TAG_COMPOUND, UI_TAG_DEFINITIONS, UI_TAG_SELF_CLOSING, type UserIdentity, type WellKnownActivityEvent, type WidgetAction, tagToComponentName };
1552
+ export { ACTIVITY_EVENT, ALLOWED_ICONS, type ActionInvokePayload, type ActionMetadataValue, type ActionPayloadMap, type ActivityEvent, type ActivityEventHandler, type ActivityEventType, type Address, type AllowedIconName, type ApiError, type ApiRequest, type ApiResponse, type BaseAction, type BaseMessagePayload, CAPABILITY_PERMISSION_MAP, type Capability, type CapabilityCall, type CapabilityRequest, type CapabilityResponse, type CapabilityType, type ContextData, type ConversationField, type ConversationTags, type Customer, type DataField, type DataFieldType, EVENT_HOOK_PERMISSION_MAP, type EncryptedPayload, type EventDomain, type EventHook, type EventType, type ExtendIdentityHandler, type ExtendIdentityRequest, type ExtendIdentityResponse, type ExtensionGroup, type ExtensionManifest, type ExtensionRegistryEntry, type FetchRequest, type FetchRequestInit, type FetchResponse, HOOK_PERMISSION_MAP, type Hook, type HostToSandboxMessage, IDENTITY_CLAIMS_MAX_KEYS, IDENTITY_CLAIM_KEY_PATTERN, IDENTITY_CLAIM_MAX_STRING_VALUE_LEN, IDENTITY_EVENT, INVOKE_ACTION, type IdentityBaseClaims, type IdentityEvent, type IdentityEventType, type IdentityExtendPayload, type IdentityExtendResponse, type IdentityState, type InstanceConfig, type InstanceOption, type InvokeAction, type LinkAction, type LocationRequestAction, MESSAGING_ACTION_EXAMPLES, MESSAGING_SEND_EXAMPLES, type MarketplaceExtension, type MessageAction, type MessageItem, type MessageItemAction, type MessagePayloadKind, type MessagingContext, type MessagingEvent, type MessagingEventHandler, type MessagingEventType, type MessagingPostbackEvent, type MessengerCommand, type NamedEntity, type NewConversationPayload, type Order, type OrderAction, type OrderItem, type OrderStatus, type OrderStatuses, PERMISSIONS, type Permission, type PostbackAction, type Price, RESERVED_CONTEXT_KEYS, RESERVED_IDENTITY_CLAIM_KEYS, type ReplyAction, type ReservedContextKey, STANDARD_IDENTITY_CLAIM_KEYS, SURFACE_TARGET, type SandboxToHostMessage, type SendCarouselMessagePayload, type SendFileMessagePayload, type SendImageMessagePayload, type SendMessageActionableErrorCode, type SendMessageErrorCode, type SendMessagePayload, type SendMessageResponse, type SendTextMessagePayload, type Shipment, type SurfaceContext, type SurfaceLifecycleMessage, type SurfaceTarget, TEMPLATE_FLAVORS, type Target, type TemplateFlavor, type TextEnabledPayload, type TextFormat, type Theme, type ToastPayload, type UITag, type UITagCategory, UI_TAGS, UI_TAG_ATTRIBUTES, UI_TAG_ATTRIBUTE_VALUES, UI_TAG_CATEGORIES, UI_TAG_CHILDREN, UI_TAG_CHILD_ONLY, UI_TAG_COMPOUND, UI_TAG_DEFINITIONS, UI_TAG_SELF_CLOSING, type UserIdentity, type WellKnownActivityEvent, type WidgetAction, tagToComponentName };
package/dist/index.js CHANGED
@@ -522,6 +522,11 @@ var EVENT_HOOK_PERMISSION_MAP = {
522
522
  useMessagingEvent: "events:messaging",
523
523
  useActivityEvent: "events:activity"
524
524
  };
525
+ var HOOK_PERMISSION_MAP = {
526
+ ...EVENT_HOOK_PERMISSION_MAP,
527
+ useMessaging: "messaging:send",
528
+ useExtendIdentity: "identity:extend"
529
+ };
525
530
 
526
531
  // src/manifest.ts
527
532
  var SURFACE_TARGET = {
@@ -534,4 +539,4 @@ var SURFACE_TARGET = {
534
539
  // src/scaffold.ts
535
540
  var TEMPLATE_FLAVORS = ["minimal", "starter", "kitchen-sink"];
536
541
 
537
- export { ACTIVITY_EVENT, ALLOWED_ICONS, CAPABILITY_PERMISSION_MAP, EVENT_HOOK_PERMISSION_MAP, EXTENSION_CATEGORY, EXTENSION_VISIBILITY, IDENTITY_CLAIMS_MAX_KEYS, IDENTITY_CLAIM_KEY_PATTERN, IDENTITY_CLAIM_MAX_STRING_VALUE_LEN, IDENTITY_EVENT, INVOKE_ACTION, MESSAGING_ACTION_EXAMPLES, MESSAGING_SEND_EXAMPLES, PERMISSIONS, RESERVED_CONTEXT_KEYS, RESERVED_IDENTITY_CLAIM_KEYS, STANDARD_IDENTITY_CLAIM_KEYS, SURFACE_TARGET, TEMPLATE_FLAVORS, UI_TAGS, UI_TAG_ATTRIBUTES, UI_TAG_ATTRIBUTE_VALUES, UI_TAG_CATEGORIES, UI_TAG_CHILDREN, UI_TAG_CHILD_ONLY, UI_TAG_COMPOUND, UI_TAG_DEFINITIONS, UI_TAG_SELF_CLOSING, asClerkOrgId, asClerkUserId, asISOTimestamp, tagToComponentName };
542
+ export { ACTIVITY_EVENT, ALLOWED_ICONS, CAPABILITY_PERMISSION_MAP, EVENT_HOOK_PERMISSION_MAP, EXTENSION_CATEGORY, EXTENSION_VISIBILITY, HOOK_PERMISSION_MAP, IDENTITY_CLAIMS_MAX_KEYS, IDENTITY_CLAIM_KEY_PATTERN, IDENTITY_CLAIM_MAX_STRING_VALUE_LEN, IDENTITY_EVENT, INVOKE_ACTION, MESSAGING_ACTION_EXAMPLES, MESSAGING_SEND_EXAMPLES, PERMISSIONS, RESERVED_CONTEXT_KEYS, RESERVED_IDENTITY_CLAIM_KEYS, STANDARD_IDENTITY_CLAIM_KEYS, SURFACE_TARGET, TEMPLATE_FLAVORS, UI_TAGS, UI_TAG_ATTRIBUTES, UI_TAG_ATTRIBUTE_VALUES, UI_TAG_CATEGORIES, UI_TAG_CHILDREN, UI_TAG_CHILD_ONLY, UI_TAG_COMPOUND, UI_TAG_DEFINITIONS, UI_TAG_SELF_CLOSING, asClerkOrgId, asClerkUserId, asISOTimestamp, tagToComponentName };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@stackable-labs/sdk-extension-contracts",
3
- "version": "2.31.0",
3
+ "version": "3.0.1",
4
4
  "type": "module",
5
5
  "sideEffects": false,
6
6
  "private": false,