11import { ContentstackCollection } from "../contentstackCollection" ;
22import { AnyProperty , SystemFields } from "../utility/fields" ;
3- import { Creatable , SystemFunction } from "../utility/operations" ;
4- import { Pagination } from '../utility/pagination' ;
5- import { Authorization } from './authorization' ;
6- import { Hosting } from './hosting' ;
3+ import { SystemFunction } from "../utility/operations" ;
74import { Installation , Installations } from "./installation" ;
8- import { Oauth } from "./oath" ;
5+ import { App , Apps } from "./app" ;
6+ import { AppRequest } from "./apprequest" ;
97
10- export interface App extends SystemFields , SystemFunction < App > {
8+ export interface Marketplace extends SystemFields , SystemFunction < Marketplace > {
119
12- install ( data : { targetUid : string , targetType : AppTarget } ) : Promise < Installation >
10+ app ( ) : Apps
11+ app ( uid : string ) : App
1312 installation ( ) : Installations
1413 installation ( uid : string ) : Installation
15- hosting ( ) : Hosting
16- authorize ( param : {
17- responseType : string ,
18- clientId : string ,
19- redirectUri : string ,
20- scope : string ,
21- state : string } ) : Promise < AnyProperty >
22- listInstallations ( ) : Promise < ContentstackCollection < App > >
23- authorization ( ) : Authorization
24- oauth ( ) : Oauth
14+ appRequests ( ) : AppRequest
15+ findAllApps ( param ?: AnyProperty ) : Promise < ContentstackCollection < App > >
16+ findAllAuthorizedApps ( param ?: AnyProperty ) : Promise < AnyProperty >
2517}
26-
27- export interface Apps extends Creatable < App , AppData > {
28- findAll ( param ?: AnyProperty ) : Promise < ContentstackCollection < App > >
29- findAllAuthorized ( param ?: Pagination & AnyProperty ) : Promise < AnyProperty >
30- }
31-
32- export interface AppData extends AnyProperty {
33- name : string
34- description ?: string
35- icon ?: string
36- target_type : AppTarget
37- ui_location ?: UILocation
38- webhook ?: AppWebhook | AppWebhookChannel
39- oauth ?: AppOAuth
40- }
41-
42- export interface AppOAuth extends AnyProperty {
43- redirect_uri ?: string
44- app_token_config ?: TokenConfig
45- user_token_config ?: UserTokenConfig
46- }
47-
48- export interface TokenConfig extends AnyProperty {
49- enabled : boolean
50- scopes : string [ ]
51- }
52- export interface UserTokenConfig extends TokenConfig {
53- allow_pkce : boolean
54- }
55-
56- export interface AppWebhookChannel extends AppWebhook {
57- target_url : string
58- channels : string [ ]
59- }
60-
61- export interface AppWebhook extends AnyProperty {
62- signed : boolean
63- name : string
64- enabled ?: boolean
65- app_lifecycle_enabled ?: boolean
66- retry_policy ?: string
67- }
68-
69- export interface UILocation extends AnyProperty {
70- signed : boolean
71- base_url ?: string
72- locations : Location [ ]
73- }
74-
75- export interface Location extends AnyProperty {
76- type : string
77- meta : LocationMeta [ ]
78- }
79-
80- export interface LocationMeta extends AnyProperty {
81- signed : boolean
82- path : string
83- name : string
84- data_type ?: string
85- }
86-
87- export type AppTarget =
88- | 'stack'
89- | 'organization'
0 commit comments