@stackable-labs/sdk-extension-contracts 1.69.1 → 1.70.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 +13 -10
- package/dist/index.js +32 -29
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -1,9 +1,10 @@
|
|
|
1
|
-
import { MarketplaceMetadata } from '@stackable-labs/lib-contracts';
|
|
2
|
-
export { AppRegistryEntry, EXTENSION_CATEGORIES, EXTENSION_VISIBILITIES, ExtensionCategory, ExtensionVisibility, MarketplaceMetadata } from '@stackable-labs/lib-contracts';
|
|
1
|
+
import { ISOTimestamp, MarketplaceMetadata } from '@stackable-labs/lib-contracts';
|
|
2
|
+
export { AppRegistryEntry, EXTENSION_CATEGORIES, EXTENSION_VISIBILITIES, ExtensionCategory, ExtensionVisibility, ISOTimestamp, MarketplaceMetadata, asISOTimestamp } from '@stackable-labs/lib-contracts';
|
|
3
3
|
|
|
4
4
|
/**
|
|
5
5
|
* Shared primitive types used across contracts.
|
|
6
6
|
*/
|
|
7
|
+
|
|
7
8
|
/** Lightweight reference to a named entity (e.g. extension, instance). */
|
|
8
9
|
interface NamedEntity {
|
|
9
10
|
id: string;
|
|
@@ -328,6 +329,7 @@ type AllowedIconName = (typeof ALLOWED_ICONS)[number];
|
|
|
328
329
|
* Messaging Contract
|
|
329
330
|
* Types for the messaging event system (postback buttons, etc.).
|
|
330
331
|
*/
|
|
332
|
+
|
|
331
333
|
/** Messaging event subscription types — 'postback' for all, 'postback:<actionName>' for specific */
|
|
332
334
|
type MessagingEventType = 'postback' | `postback:${string}`;
|
|
333
335
|
/** Normalized postback event payload */
|
|
@@ -335,7 +337,7 @@ interface MessagingPostbackEvent {
|
|
|
335
337
|
type: 'postback';
|
|
336
338
|
actionName: string;
|
|
337
339
|
conversationId: string;
|
|
338
|
-
timestamp:
|
|
340
|
+
timestamp: ISOTimestamp;
|
|
339
341
|
}
|
|
340
342
|
/** Union of all messaging events (extensible for future event types) */
|
|
341
343
|
type MessagingEvent = MessagingPostbackEvent;
|
|
@@ -359,12 +361,12 @@ interface UserIdentity {
|
|
|
359
361
|
interface IdentityState {
|
|
360
362
|
authenticated: boolean;
|
|
361
363
|
user: UserIdentity | null;
|
|
362
|
-
expiresAt?:
|
|
364
|
+
expiresAt?: ISOTimestamp;
|
|
363
365
|
}
|
|
364
366
|
interface IdentityEvent {
|
|
365
367
|
type: IdentityEventType;
|
|
366
368
|
state: IdentityState;
|
|
367
|
-
timestamp:
|
|
369
|
+
timestamp: ISOTimestamp;
|
|
368
370
|
}
|
|
369
371
|
/**
|
|
370
372
|
* Union of all event types that can appear in the manifest events array.
|
|
@@ -652,6 +654,7 @@ type SandboxToHostMessage = CapabilityRequest | {
|
|
|
652
654
|
* Ecommerce Type Definitions
|
|
653
655
|
* Ported from zendesk-embedded-widget/app/src/types/ecommerce.ts
|
|
654
656
|
*/
|
|
657
|
+
|
|
655
658
|
interface Price {
|
|
656
659
|
currency: string;
|
|
657
660
|
amount: number;
|
|
@@ -756,8 +759,8 @@ interface OrderItem {
|
|
|
756
759
|
meta: {
|
|
757
760
|
entity_id?: string;
|
|
758
761
|
timestamps: {
|
|
759
|
-
created_at:
|
|
760
|
-
updated_at:
|
|
762
|
+
created_at: ISOTimestamp;
|
|
763
|
+
updated_at: ISOTimestamp;
|
|
761
764
|
};
|
|
762
765
|
actions?: Array<{
|
|
763
766
|
id: string;
|
|
@@ -813,7 +816,7 @@ interface OrderItem {
|
|
|
813
816
|
}>;
|
|
814
817
|
name?: string;
|
|
815
818
|
timestamps?: {
|
|
816
|
-
created_at:
|
|
819
|
+
created_at: ISOTimestamp;
|
|
817
820
|
};
|
|
818
821
|
}>;
|
|
819
822
|
};
|
|
@@ -861,8 +864,8 @@ interface Order {
|
|
|
861
864
|
};
|
|
862
865
|
meta: {
|
|
863
866
|
timestamps: {
|
|
864
|
-
created_at:
|
|
865
|
-
updated_at:
|
|
867
|
+
created_at: ISOTimestamp;
|
|
868
|
+
updated_at: ISOTimestamp;
|
|
866
869
|
};
|
|
867
870
|
tax_mode: string;
|
|
868
871
|
entity_id: string;
|
package/dist/index.js
CHANGED
|
@@ -1,3 +1,34 @@
|
|
|
1
|
+
// ../../../lib/contracts/src/base.ts
|
|
2
|
+
var asISOTimestamp = (value) => value;
|
|
3
|
+
|
|
4
|
+
// ../../../lib/contracts/src/permissions.ts
|
|
5
|
+
var SUPER_ROLE = {
|
|
6
|
+
ADMIN: "org:super_admin"
|
|
7
|
+
};
|
|
8
|
+
var ORG_ROLE = {
|
|
9
|
+
ADMIN: "org:admin",
|
|
10
|
+
OWNER: "org:owner"};
|
|
11
|
+
var EDITOR_ROLES = [
|
|
12
|
+
SUPER_ROLE.ADMIN,
|
|
13
|
+
ORG_ROLE.ADMIN,
|
|
14
|
+
ORG_ROLE.OWNER
|
|
15
|
+
];
|
|
16
|
+
[
|
|
17
|
+
...Object.values(SUPER_ROLE),
|
|
18
|
+
...Object.values(EDITOR_ROLES)
|
|
19
|
+
];
|
|
20
|
+
|
|
21
|
+
// ../../../lib/contracts/src/marketplace.ts
|
|
22
|
+
var EXTENSION_CATEGORIES = [
|
|
23
|
+
"commerce",
|
|
24
|
+
"support",
|
|
25
|
+
"analytics",
|
|
26
|
+
"productivity",
|
|
27
|
+
"communication",
|
|
28
|
+
"other"
|
|
29
|
+
];
|
|
30
|
+
var EXTENSION_VISIBILITIES = ["public", "protected"];
|
|
31
|
+
|
|
1
32
|
// src/components.ts
|
|
2
33
|
var UI_TAG_DEFINITIONS = {
|
|
3
34
|
"ui-card": {
|
|
@@ -323,32 +354,4 @@ var CAPABILITY_PERMISSION_MAP = {
|
|
|
323
354
|
"extend.identity": "extend:identity"
|
|
324
355
|
};
|
|
325
356
|
|
|
326
|
-
|
|
327
|
-
var SUPER_ROLE = {
|
|
328
|
-
ADMIN: "org:super_admin"
|
|
329
|
-
};
|
|
330
|
-
var ORG_ROLE = {
|
|
331
|
-
ADMIN: "org:admin",
|
|
332
|
-
OWNER: "org:owner"};
|
|
333
|
-
var EDITOR_ROLES = [
|
|
334
|
-
SUPER_ROLE.ADMIN,
|
|
335
|
-
ORG_ROLE.ADMIN,
|
|
336
|
-
ORG_ROLE.OWNER
|
|
337
|
-
];
|
|
338
|
-
[
|
|
339
|
-
...Object.values(SUPER_ROLE),
|
|
340
|
-
...Object.values(EDITOR_ROLES)
|
|
341
|
-
];
|
|
342
|
-
|
|
343
|
-
// ../../../lib/contracts/src/marketplace.ts
|
|
344
|
-
var EXTENSION_CATEGORIES = [
|
|
345
|
-
"commerce",
|
|
346
|
-
"support",
|
|
347
|
-
"analytics",
|
|
348
|
-
"productivity",
|
|
349
|
-
"communication",
|
|
350
|
-
"other"
|
|
351
|
-
];
|
|
352
|
-
var EXTENSION_VISIBILITIES = ["public", "protected"];
|
|
353
|
-
|
|
354
|
-
export { ALLOWED_ICONS, CAPABILITY_PERMISSION_MAP, EXTENSION_CATEGORIES, EXTENSION_VISIBILITIES, PERMISSIONS, RESERVED_CONTEXT_KEYS, UI_TAGS, UI_TAG_ATTRIBUTES, UI_TAG_ATTRIBUTE_VALUES, UI_TAG_CATEGORIES, UI_TAG_CHILDREN, UI_TAG_DEFINITIONS, tagToComponentName };
|
|
357
|
+
export { ALLOWED_ICONS, CAPABILITY_PERMISSION_MAP, EXTENSION_CATEGORIES, EXTENSION_VISIBILITIES, PERMISSIONS, RESERVED_CONTEXT_KEYS, UI_TAGS, UI_TAG_ATTRIBUTES, UI_TAG_ATTRIBUTE_VALUES, UI_TAG_CATEGORIES, UI_TAG_CHILDREN, UI_TAG_DEFINITIONS, asISOTimestamp, tagToComponentName };
|