@stackable-labs/sdk-extension-contracts 1.83.1 → 1.84.0
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 +11 -11
- package/dist/index.js +17 -14
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { ISOTimestamp, MarketplaceMetadata } from '@stackable-labs/lib-contracts';
|
|
2
|
-
export { AppRegistryEntry, ClerkOrgId, ClerkUserId,
|
|
2
|
+
export { AppRegistryEntry, ClerkOrgId, ClerkUserId, EXTENSION_CATEGORY, EXTENSION_VISIBILITY, ExtensionCategory, ExtensionVisibility, ISOTimestamp, MarketplaceMetadata, asClerkOrgId, asClerkUserId, asISOTimestamp } from '@stackable-labs/lib-contracts';
|
|
3
3
|
|
|
4
4
|
/**
|
|
5
5
|
* Shared primitive types used across contracts.
|
|
@@ -331,14 +331,14 @@ type AllowedIconName = (typeof ALLOWED_ICONS)[number];
|
|
|
331
331
|
*/
|
|
332
332
|
|
|
333
333
|
/** Well-known identity event names. Hooks accept these directly (e.g., useIdentityEvent('login', ...)). */
|
|
334
|
-
declare const
|
|
334
|
+
declare const IDENTITY_EVENT: {
|
|
335
335
|
readonly LOGIN: "login";
|
|
336
336
|
readonly LOGOUT: "logout";
|
|
337
337
|
readonly REFRESH: "refresh";
|
|
338
338
|
readonly EXPIRED: "expired";
|
|
339
339
|
};
|
|
340
|
-
/** Domain-stripped identity event names — derived from
|
|
341
|
-
type IdentityEventType = typeof
|
|
340
|
+
/** Domain-stripped identity event names — derived from IDENTITY_EVENT. */
|
|
341
|
+
type IdentityEventType = typeof IDENTITY_EVENT[keyof typeof IDENTITY_EVENT];
|
|
342
342
|
interface UserIdentity {
|
|
343
343
|
id: string;
|
|
344
344
|
email?: string;
|
|
@@ -429,12 +429,12 @@ interface ConversationField {
|
|
|
429
429
|
value: string | number | boolean;
|
|
430
430
|
}
|
|
431
431
|
/** Known actions for actions.invoke capability */
|
|
432
|
-
declare const
|
|
432
|
+
declare const INVOKE_ACTION: {
|
|
433
433
|
readonly NEW_CONVERSATION: "newConversation";
|
|
434
434
|
readonly SET_CONVERSATION_TAGS: "setConversationTags";
|
|
435
435
|
readonly SET_CONVERSATION_FIELDS: "setConversationFields";
|
|
436
436
|
};
|
|
437
|
-
type InvokeAction = typeof
|
|
437
|
+
type InvokeAction = typeof INVOKE_ACTION[keyof typeof INVOKE_ACTION] | MessengerCommand | WidgetAction;
|
|
438
438
|
/** Typed payload for newConversation action */
|
|
439
439
|
interface NewConversationPayload {
|
|
440
440
|
metadata?: Record<string, unknown>;
|
|
@@ -525,7 +525,7 @@ type MessagingEventHandler = (event: MessagingEvent) => void;
|
|
|
525
525
|
* Types for the activity event system (host-to-extension push events).
|
|
526
526
|
*/
|
|
527
527
|
/** Well-known activity event names (aligned with GA conventions). Hosts can emit any custom string. */
|
|
528
|
-
declare const
|
|
528
|
+
declare const ACTIVITY_EVENT: {
|
|
529
529
|
readonly CLICK: "click";
|
|
530
530
|
readonly PAGE_VIEW: "page_view";
|
|
531
531
|
readonly FORM_SUBMIT: "form_submit";
|
|
@@ -534,7 +534,7 @@ declare const ACTIVITY_EVENTS: {
|
|
|
534
534
|
readonly PURCHASE: "purchase";
|
|
535
535
|
readonly SEARCH: "search";
|
|
536
536
|
};
|
|
537
|
-
type WellKnownActivityEvent = typeof
|
|
537
|
+
type WellKnownActivityEvent = typeof ACTIVITY_EVENT[keyof typeof ACTIVITY_EVENT];
|
|
538
538
|
/** Domain-stripped activity event names. Hooks accept these directly (e.g., useActivityEvent('product_view', ...)). */
|
|
539
539
|
type ActivityEventType = WellKnownActivityEvent | string;
|
|
540
540
|
/** Normalized activity event payload */
|
|
@@ -618,13 +618,13 @@ type Capability = keyof typeof CAPABILITY_PERMISSION_MAP;
|
|
|
618
618
|
*/
|
|
619
619
|
type Target = string;
|
|
620
620
|
/** Well-known surface target slots provided by the Stackable platform. */
|
|
621
|
-
declare const
|
|
621
|
+
declare const SURFACE_TARGET: {
|
|
622
622
|
readonly HEADER: "slot.header";
|
|
623
623
|
readonly CONTENT: "slot.content";
|
|
624
624
|
readonly FOOTER: "slot.footer";
|
|
625
625
|
readonly FOOTER_LINKS: "slot.footer-links";
|
|
626
626
|
};
|
|
627
|
-
type SurfaceTarget = typeof
|
|
627
|
+
type SurfaceTarget = typeof SURFACE_TARGET[keyof typeof SURFACE_TARGET];
|
|
628
628
|
interface ExtensionManifest {
|
|
629
629
|
/** Human-readable extension name */
|
|
630
630
|
name: string;
|
|
@@ -986,4 +986,4 @@ interface Order {
|
|
|
986
986
|
display_status?: OrderStatus;
|
|
987
987
|
}
|
|
988
988
|
|
|
989
|
-
export {
|
|
989
|
+
export { ACTIVITY_EVENT, ALLOWED_ICONS, type ActionInvokePayload, type ActionPayloadMap, type ActivityEvent, type ActivityEventHandler, type ActivityEventType, type Address, type AllowedIconName, type ApiError, type ApiRequest, type ApiResponse, 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, type EncryptedPayload, type EventDomain, type EventType, type ExtendIdentityHandler, type ExtendIdentityRequest, type ExtendIdentityResponse, type ExtensionManifest, type ExtensionRegistryEntry, type FetchRequest, type FetchRequestInit, type FetchResponse, type HostToSandboxMessage, IDENTITY_EVENT, INVOKE_ACTION, type IdentityBaseClaims, type IdentityEvent, type IdentityEventType, type IdentityState, type InstanceConfig, type InstanceOption, type InvokeAction, type MarketplaceExtension, 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 Price, RESERVED_CONTEXT_KEYS, type ReservedContextKey, SURFACE_TARGET, type SandboxToHostMessage, type Shipment, type SurfaceContext, type SurfaceLifecycleMessage, type SurfaceTarget, type Target, 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_DEFINITIONS, type UserIdentity, type WellKnownActivityEvent, type WidgetAction, tagToComponentName };
|
package/dist/index.js
CHANGED
|
@@ -21,15 +21,18 @@ var EDITOR_ROLES = [
|
|
|
21
21
|
];
|
|
22
22
|
|
|
23
23
|
// ../../../lib/contracts/src/marketplace.ts
|
|
24
|
-
var
|
|
25
|
-
"commerce",
|
|
26
|
-
"support",
|
|
27
|
-
"analytics",
|
|
28
|
-
"productivity",
|
|
29
|
-
"communication",
|
|
30
|
-
"other"
|
|
31
|
-
|
|
32
|
-
var
|
|
24
|
+
var EXTENSION_CATEGORY = {
|
|
25
|
+
COMMERCE: "commerce",
|
|
26
|
+
SUPPORT: "support",
|
|
27
|
+
ANALYTICS: "analytics",
|
|
28
|
+
PRODUCTIVITY: "productivity",
|
|
29
|
+
COMMUNICATION: "communication",
|
|
30
|
+
OTHER: "other"
|
|
31
|
+
};
|
|
32
|
+
var EXTENSION_VISIBILITY = {
|
|
33
|
+
PUBLIC: "public",
|
|
34
|
+
PROTECTED: "protected"
|
|
35
|
+
};
|
|
33
36
|
|
|
34
37
|
// src/components.ts
|
|
35
38
|
var UI_TAG_DEFINITIONS = {
|
|
@@ -334,7 +337,7 @@ var ALLOWED_ICONS = [
|
|
|
334
337
|
];
|
|
335
338
|
|
|
336
339
|
// src/capabilities.ts
|
|
337
|
-
var
|
|
340
|
+
var INVOKE_ACTION = {
|
|
338
341
|
NEW_CONVERSATION: "newConversation",
|
|
339
342
|
SET_CONVERSATION_TAGS: "setConversationTags",
|
|
340
343
|
SET_CONVERSATION_FIELDS: "setConversationFields"
|
|
@@ -342,7 +345,7 @@ var INVOKE_ACTIONS = {
|
|
|
342
345
|
var RESERVED_CONTEXT_KEYS = ["identity", "messaging"];
|
|
343
346
|
|
|
344
347
|
// src/identity.ts
|
|
345
|
-
var
|
|
348
|
+
var IDENTITY_EVENT = {
|
|
346
349
|
LOGIN: "login",
|
|
347
350
|
LOGOUT: "logout",
|
|
348
351
|
REFRESH: "refresh",
|
|
@@ -350,7 +353,7 @@ var IDENTITY_EVENTS = {
|
|
|
350
353
|
};
|
|
351
354
|
|
|
352
355
|
// src/activity.ts
|
|
353
|
-
var
|
|
356
|
+
var ACTIVITY_EVENT = {
|
|
354
357
|
CLICK: "click",
|
|
355
358
|
PAGE_VIEW: "page_view",
|
|
356
359
|
FORM_SUBMIT: "form_submit",
|
|
@@ -382,11 +385,11 @@ var CAPABILITY_PERMISSION_MAP = {
|
|
|
382
385
|
};
|
|
383
386
|
|
|
384
387
|
// src/manifest.ts
|
|
385
|
-
var
|
|
388
|
+
var SURFACE_TARGET = {
|
|
386
389
|
HEADER: "slot.header",
|
|
387
390
|
CONTENT: "slot.content",
|
|
388
391
|
FOOTER: "slot.footer",
|
|
389
392
|
FOOTER_LINKS: "slot.footer-links"
|
|
390
393
|
};
|
|
391
394
|
|
|
392
|
-
export {
|
|
395
|
+
export { ACTIVITY_EVENT, ALLOWED_ICONS, CAPABILITY_PERMISSION_MAP, EXTENSION_CATEGORY, EXTENSION_VISIBILITY, IDENTITY_EVENT, INVOKE_ACTION, PERMISSIONS, RESERVED_CONTEXT_KEYS, SURFACE_TARGET, UI_TAGS, UI_TAG_ATTRIBUTES, UI_TAG_ATTRIBUTE_VALUES, UI_TAG_CATEGORIES, UI_TAG_CHILDREN, UI_TAG_DEFINITIONS, asClerkOrgId, asClerkUserId, asISOTimestamp, tagToComponentName };
|