Skip to content

Commit 564d661

Browse files
its-mashMohammod Al Amin Ashik
andauthored
Adds applicationContext type (#29)
Co-authored-by: Mohammod Al Amin Ashik <alamin.ashik@sitecore.com>
1 parent 52e0e14 commit 564d661

File tree

2 files changed

+42
-17
lines changed

2 files changed

+42
-17
lines changed

.changeset/fuzzy-suns-push.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
'@sitecore-marketplace-sdk/core': patch
3+
---
4+
5+
Adds types for host init new property `applicationContext`

packages/core/src/shared-types.ts

Lines changed: 37 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -99,6 +99,24 @@ export class GenericResponseData {
9999
}
100100
}
101101

102+
export interface ApplicationResourceContext {
103+
resourceId: string;
104+
tenantId: string;
105+
tenantName?: string;
106+
tenantDisplayName?: string;
107+
context: {
108+
live: string;
109+
preview: string;
110+
};
111+
[key: string]: any;
112+
}
113+
114+
export interface ApplicationTouchpointContext {
115+
touchpointId: string;
116+
route?: string;
117+
[key: string]: any;
118+
}
119+
102120
export interface ApplicationContext {
103121
id: string;
104122
url: string;
@@ -107,26 +125,28 @@ export interface ApplicationContext {
107125
iconUrl?: string;
108126
state?: string;
109127
installationId?: string;
110-
resources?: [
111-
{
112-
resourceId?: string;
113-
tenantId?: string;
114-
tenantName?: string;
115-
context?: {
116-
live?: string;
117-
preview?: string;
118-
};
119-
}
120-
];
121-
touchpoints?: [
122-
{
123-
touchpointId: string;
124-
route: string
125-
}
126-
];
128+
resources?: ApplicationResourceContext[];
129+
touchpoints?: ApplicationTouchpointContext[];
127130
[key: string]: any;
128131
}
129132

133+
/**
134+
* Represents the runtime context of an application.
135+
*/
136+
export interface ApplicationRuntimeContext {
137+
installationId: string;
138+
application: {
139+
id: string;
140+
name: string;
141+
type: string;
142+
url: string;
143+
iconUrl?: string;
144+
state: string;
145+
};
146+
resources: ApplicationResourceContext[];
147+
touchpoints: ApplicationTouchpointContext[];
148+
}
149+
130150
/**
131151
* External URL navigation payload.
132152
*/

0 commit comments

Comments
 (0)