Skip to content

Commit f0df583

Browse files
authored
Merge pull request #948 from dhis2/LIBS-808
fix: additionalNamespaces type in d2config
2 parents a16af7a + 309a12e commit f0df583

1 file changed

Lines changed: 39 additions & 15 deletions

File tree

cli/src/index.d.ts

Lines changed: 39 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -102,8 +102,32 @@ export type D2Config = Partial<{
102102

103103
/**
104104
* An array of additional datastore namespaces that should be associated with the app. For each, the user can specify the authorities required to read/write. See more in the Additional datastore namespaces section below.
105+
*
106+
* @example
107+
* additionalNamespaces: [
108+
* { namespace: 'extra1', authorities: ['F_READ_AND_WRITE'] },
109+
* { namespace: 'extra2', readAuthorities: ['F_READ'], writeAuthorities: ['F_WRITE'] }
110+
* ]
105111
*/
106-
additionalNamespaces: string[]
112+
113+
additionalNamespaces: Array<{
114+
/**
115+
* The namespace identifier
116+
*/
117+
namespace: string
118+
/**
119+
* Authorities required for both read and write operations
120+
*/
121+
authorities?: string[]
122+
/**
123+
* Authorities required for read operations
124+
*/
125+
readAuthorities?: string[]
126+
/**
127+
* Authorities required for write operations
128+
*/
129+
writeAuthorities?: string[]
130+
}>
107131

108132
/**
109133
* An array of custom authorities to create when installing the app, these do not provide security protections in the DHIS2 REST API but can be assigned to user roles and used to modify the interface displayed to a user - see the webapp manifest docs
@@ -196,19 +220,19 @@ export type D2Config = Partial<{
196220
*/
197221
globsToOmitFromPrecache: string[]
198222
}
199-
200-
/**
201-
* Vite config options that can be merged onto the App Platform's base
202-
* Vite config.
203-
*
204-
* The value can be either an **Object** following Vite's `UserConfig`
205-
* type, which may be appropriate for a simple set of options;
206-
* or an **path to a file** that follows the same rules as Vite
207-
* configuration files, which can be useful for more complex options.
208-
* https://vite.dev/config/
209-
*
210-
* See the platform config docs for more detail and examples.
211-
*/
212-
viteConfigExtensions?: UserConfig | string
213223
}>
224+
225+
/**
226+
* Vite config options that can be merged onto the App Platform's base
227+
* Vite config.
228+
*
229+
* The value can be either an **Object** following Vite's `UserConfig`
230+
* type, which may be appropriate for a simple set of options;
231+
* or an **path to a file** that follows the same rules as Vite
232+
* configuration files, which can be useful for more complex options.
233+
* https://vite.dev/config/
234+
*
235+
* See the platform config docs for more detail and examples.
236+
*/
237+
viteConfigExtensions?: UserConfig | string
214238
}>

0 commit comments

Comments
 (0)