fortiplugin-bundle-adapter 0.0.7 → 0.0.8

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/types.cjs ADDED
@@ -0,0 +1,19 @@
1
+ "use strict";
2
+ var __defProp = Object.defineProperty;
3
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
+ var __getOwnPropNames = Object.getOwnPropertyNames;
5
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
6
+ var __copyProps = (to, from, except, desc) => {
7
+ if (from && typeof from === "object" || typeof from === "function") {
8
+ for (let key of __getOwnPropNames(from))
9
+ if (!__hasOwnProp.call(to, key) && key !== except)
10
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
11
+ }
12
+ return to;
13
+ };
14
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
15
+
16
+ // src/types.ts
17
+ var types_exports = {};
18
+ module.exports = __toCommonJS(types_exports);
19
+ //# sourceMappingURL=types.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/types.ts"],"sourcesContent":["export * from './plugin/decisions'\r\nexport * from './plugin/list-payload'\r\nexport * from './plugin/upsert-payload'"],"mappings":";;;;;;;;;;;;;;;;AAAA;AAAA;","names":[]}
@@ -0,0 +1,299 @@
1
+ type PermissionType = "db" | "file" | "notification" | "module" | "network" | "codec";
2
+ /**
3
+ * previous = the concrete's CURRENT natural_key you are modifying.
4
+ * (server will build a new naturalKey from current target + merged actions)
5
+ */
6
+ interface PermissionDecisionBase<TType extends PermissionType> {
7
+ type: TType;
8
+ previous: string;
9
+ }
10
+ /** Tri-state toggle: null = do not touch */
11
+ type TriState = boolean | null;
12
+ interface DbPermissionDecisionDetail extends PermissionDecisionBase<"db"> {
13
+ select?: TriState;
14
+ insert?: TriState;
15
+ update?: TriState;
16
+ delete?: TriState;
17
+ truncate?: TriState;
18
+ grouped_queries?: TriState;
19
+ }
20
+ interface FilePermissionDecisionDetail extends PermissionDecisionBase<"file"> {
21
+ read?: TriState;
22
+ write?: TriState;
23
+ append?: TriState;
24
+ delete?: TriState;
25
+ mkdir?: TriState;
26
+ rmdir?: TriState;
27
+ list?: TriState;
28
+ }
29
+ interface NotificationPermissionDecisionDetail extends PermissionDecisionBase<"notification"> {
30
+ send?: TriState;
31
+ receive?: TriState;
32
+ }
33
+ interface ModulePermissionDecisionDetail extends PermissionDecisionBase<"module"> {
34
+ call?: TriState;
35
+ }
36
+ interface NetworkPermissionDecisionDetail extends PermissionDecisionBase<"network"> {
37
+ request?: TriState;
38
+ }
39
+ interface CodecPermissionDecisionDetail extends PermissionDecisionBase<"codec"> {
40
+ invoke?: TriState;
41
+ }
42
+ type PermissionDecisionDetail = DbPermissionDecisionDetail | FilePermissionDecisionDetail | NotificationPermissionDecisionDetail | ModulePermissionDecisionDetail | NetworkPermissionDecisionDetail | CodecPermissionDecisionDetail;
43
+ type DbActionKey = "select" | "insert" | "update" | "delete" | "truncate" | "grouped_queries";
44
+ type FileActionKey = "read" | "write" | "append" | "delete" | "mkdir" | "rmdir" | "list";
45
+ type NotificationActionKey = "send" | "receive";
46
+ type ModuleActionKey = "call";
47
+ type NetworkActionKey = "request";
48
+ type CodecActionKey = "invoke";
49
+ type PermissionActionKeyByType = {
50
+ db: DbActionKey;
51
+ file: FileActionKey;
52
+ notification: NotificationActionKey;
53
+ module: ModuleActionKey;
54
+ network: NetworkActionKey;
55
+ codec: CodecActionKey;
56
+ };
57
+ interface PermissionDecisionRequestDto {
58
+ plugin_id: number;
59
+ detail: PermissionDecisionDetail;
60
+ /**
61
+ * Host-side metadata only.
62
+ * Keep this minimal; justification is dev-only and should not be part of host decision payload.
63
+ */
64
+ meta?: {
65
+ active?: boolean;
66
+ constraints?: Record<string, unknown> | null;
67
+ audit?: Record<string, unknown> | null;
68
+ };
69
+ }
70
+
71
+ type PermissionWindow = null | {
72
+ limited: true;
73
+ type: string | null;
74
+ value: string | null;
75
+ };
76
+ type PermissionConstraints = (Record<string, unknown> & {
77
+ required?: boolean;
78
+ }) | null;
79
+ type PermissionAudit = Record<string, unknown> | null;
80
+ interface PermissionSourceDirect {
81
+ assignment_id: number | string | null;
82
+ active: boolean;
83
+ window: PermissionWindow;
84
+ constraints: PermissionConstraints;
85
+ audit: PermissionAudit;
86
+ justification: string | null;
87
+ /** derived in listPermissions() from constraints.required */
88
+ required: boolean;
89
+ }
90
+ interface PermissionSourceTag {
91
+ tag_id: number | string | null;
92
+ tag_name: string | null;
93
+ active: boolean;
94
+ constraints: PermissionConstraints;
95
+ audit: PermissionAudit;
96
+ }
97
+ interface PermissionListSources {
98
+ direct: PermissionSourceDirect[];
99
+ tags: PermissionSourceTag[];
100
+ }
101
+ interface DbPermissionPresentation {
102
+ model: string | null;
103
+ table: string | null;
104
+ columns: string[] | null;
105
+ }
106
+ interface FilePermissionPresentation {
107
+ base_dir: string;
108
+ paths: string[];
109
+ follow_symlinks: boolean;
110
+ }
111
+ interface NotificationPermissionPresentation {
112
+ channel: string | null;
113
+ channels: string[] | null;
114
+ templates: string[] | null;
115
+ recipients: string[] | null;
116
+ }
117
+ interface ModulePermissionPresentation {
118
+ plugin: string | null;
119
+ plugin_fqcn: string | null;
120
+ apis: string[];
121
+ plugin_docs: string | null;
122
+ }
123
+ interface NetworkPermissionPresentation {
124
+ hosts: string[];
125
+ methods: string[];
126
+ schemes: ("https" | "http" | string)[] | null;
127
+ ports: number[] | null;
128
+ paths: string[] | null;
129
+ headers_allowed: string[] | null;
130
+ ips_allowed: string[] | null;
131
+ auth_via_host_secret: boolean;
132
+ }
133
+ interface CodecPermissionPresentation {
134
+ module: string;
135
+ allowed: unknown | null;
136
+ methods: unknown | null;
137
+ groups: unknown | null;
138
+ options: unknown | null;
139
+ }
140
+ /**
141
+ * For unknown/new types, your PHP falls back to $presentation = $row.
142
+ * So this is the generic fallback.
143
+ */
144
+ type UnknownPresentation = Record<string, unknown>;
145
+ type ActionFlags = Record<string, boolean>;
146
+ type DbActionFlags = ActionFlags & {
147
+ select?: boolean;
148
+ insert?: boolean;
149
+ update?: boolean;
150
+ delete?: boolean;
151
+ truncate?: boolean;
152
+ grouped_queries?: boolean;
153
+ };
154
+ type FileActionFlags = ActionFlags & {
155
+ read?: boolean;
156
+ write?: boolean;
157
+ append?: boolean;
158
+ delete?: boolean;
159
+ mkdir?: boolean;
160
+ rmdir?: boolean;
161
+ list?: boolean;
162
+ };
163
+ type NotificationActionFlags = ActionFlags & {
164
+ send?: boolean;
165
+ receive?: boolean;
166
+ };
167
+ type ModuleActionFlags = ActionFlags & {
168
+ call?: boolean;
169
+ publish?: boolean;
170
+ subscribe?: boolean;
171
+ };
172
+ type NetworkActionFlags = ActionFlags & {
173
+ request?: boolean;
174
+ };
175
+ type CodecActionFlags = ActionFlags & {
176
+ invoke?: boolean;
177
+ };
178
+ type ConcreteRow = Record<string, unknown>;
179
+ interface PermissionListItemBase<TType extends PermissionType, TPresentation, TActions extends ActionFlags> {
180
+ type: TType;
181
+ concreteId: number;
182
+ naturalKey: string | null;
183
+ presentation: TPresentation;
184
+ effectiveActions: TActions;
185
+ concrete: ConcreteRow;
186
+ /** NOTE: nested under sources.{direct,tags} */
187
+ sources: PermissionListSources;
188
+ required: boolean;
189
+ activeEffective: boolean;
190
+ }
191
+ type DbPermissionListItem = PermissionListItemBase<"db", DbPermissionPresentation, DbActionFlags>;
192
+ type FilePermissionListItem = PermissionListItemBase<"file", FilePermissionPresentation, FileActionFlags>;
193
+ type NotificationPermissionListItem = PermissionListItemBase<"notification", NotificationPermissionPresentation, NotificationActionFlags>;
194
+ type ModulePermissionListItem = PermissionListItemBase<"module", ModulePermissionPresentation, ModuleActionFlags>;
195
+ type NetworkPermissionListItem = PermissionListItemBase<"network", NetworkPermissionPresentation, NetworkActionFlags>;
196
+ type CodecPermissionListItem = PermissionListItemBase<"codec", CodecPermissionPresentation, CodecActionFlags>;
197
+ type UnknownPermissionListItem = PermissionListItemBase<PermissionType, UnknownPresentation, ActionFlags>;
198
+ type PermissionListItem = DbPermissionListItem | FilePermissionListItem | NotificationPermissionListItem | ModulePermissionListItem | NetworkPermissionListItem | CodecPermissionListItem | UnknownPermissionListItem;
199
+ interface PermissionListSummaryDto {
200
+ totals: {
201
+ by_type: Record<string, number>;
202
+ total: number;
203
+ active: number;
204
+ inactive: number;
205
+ };
206
+ required: {
207
+ total: number;
208
+ satisfied: number;
209
+ pending: number;
210
+ };
211
+ }
212
+ interface PermissionListResultDto {
213
+ items: PermissionListItem[];
214
+ summary: PermissionListSummaryDto;
215
+ }
216
+
217
+ /** --- db --- */
218
+ type DbPermissionActions = {
219
+ select: boolean;
220
+ insert: boolean;
221
+ update: boolean;
222
+ delete: boolean;
223
+ truncate: boolean;
224
+ grouped_queries: boolean;
225
+ };
226
+ interface DbPermissionAttributes {
227
+ model: string;
228
+ readable_columns: string[] | null;
229
+ writable_columns: string[] | null;
230
+ permissions: DbPermissionActions;
231
+ }
232
+ /** --- file --- */
233
+ type FilePermissionActions = {
234
+ read: boolean;
235
+ write: boolean;
236
+ append: boolean;
237
+ delete: boolean;
238
+ mkdir: boolean;
239
+ rmdir: boolean;
240
+ list: boolean;
241
+ };
242
+ interface FilePermissionAttributes {
243
+ base_dir: string;
244
+ paths: string[];
245
+ follow_symlinks: boolean;
246
+ permissions: FilePermissionActions;
247
+ }
248
+ /** --- notification --- */
249
+ type NotificationPermissionActions = {
250
+ send: boolean;
251
+ receive: boolean;
252
+ };
253
+ interface NotificationPermissionAttributes {
254
+ channel: string;
255
+ templates_allowed: string[] | null;
256
+ recipients_allowed: string[] | null;
257
+ permissions: NotificationPermissionActions;
258
+ }
259
+ /** --- module --- */
260
+ interface ModulePermissionAttributes {
261
+ module: string;
262
+ apis: string[];
263
+ access: boolean;
264
+ }
265
+ /** --- network --- */
266
+ interface NetworkPermissionAttributes {
267
+ hosts: string[];
268
+ methods: string[];
269
+ schemes: string[] | null;
270
+ ports: number[] | null;
271
+ paths: string[] | null;
272
+ headers_allowed: string[] | null;
273
+ ips_allowed: string[] | null;
274
+ auth_via_host_secret: boolean;
275
+ access: boolean;
276
+ label: string | null;
277
+ }
278
+ /** --- codec --- */
279
+ interface CodecPermissionAttributes {
280
+ module: string;
281
+ allowed: string[];
282
+ access: boolean;
283
+ }
284
+ /** Convenience map + generic record wrapper (useful for UI) */
285
+ type PermissionAttributesByType = {
286
+ db: DbPermissionAttributes;
287
+ file: FilePermissionAttributes;
288
+ notification: NotificationPermissionAttributes;
289
+ module: ModulePermissionAttributes;
290
+ network: NetworkPermissionAttributes;
291
+ codec: CodecPermissionAttributes;
292
+ };
293
+ type PermissionUpsertRecord<T extends PermissionType = PermissionType> = {
294
+ type: T;
295
+ natural_key: string;
296
+ attributes: PermissionAttributesByType[T];
297
+ };
298
+
299
+ export type { ActionFlags, CodecActionFlags, CodecActionKey, CodecPermissionAttributes, CodecPermissionDecisionDetail, CodecPermissionListItem, CodecPermissionPresentation, ConcreteRow, DbActionFlags, DbActionKey, DbPermissionActions, DbPermissionAttributes, DbPermissionDecisionDetail, DbPermissionListItem, DbPermissionPresentation, FileActionFlags, FileActionKey, FilePermissionActions, FilePermissionAttributes, FilePermissionDecisionDetail, FilePermissionListItem, FilePermissionPresentation, ModuleActionFlags, ModuleActionKey, ModulePermissionAttributes, ModulePermissionDecisionDetail, ModulePermissionListItem, ModulePermissionPresentation, NetworkActionFlags, NetworkActionKey, NetworkPermissionAttributes, NetworkPermissionDecisionDetail, NetworkPermissionListItem, NetworkPermissionPresentation, NotificationActionFlags, NotificationActionKey, NotificationPermissionActions, NotificationPermissionAttributes, NotificationPermissionDecisionDetail, NotificationPermissionListItem, NotificationPermissionPresentation, PermissionActionKeyByType, PermissionAttributesByType, PermissionAudit, PermissionConstraints, PermissionDecisionBase, PermissionDecisionDetail, PermissionDecisionRequestDto, PermissionListItem, PermissionListItemBase, PermissionListResultDto, PermissionListSources, PermissionListSummaryDto, PermissionSourceDirect, PermissionSourceTag, PermissionType, PermissionUpsertRecord, PermissionWindow, TriState, UnknownPermissionListItem, UnknownPresentation };
@@ -0,0 +1,299 @@
1
+ type PermissionType = "db" | "file" | "notification" | "module" | "network" | "codec";
2
+ /**
3
+ * previous = the concrete's CURRENT natural_key you are modifying.
4
+ * (server will build a new naturalKey from current target + merged actions)
5
+ */
6
+ interface PermissionDecisionBase<TType extends PermissionType> {
7
+ type: TType;
8
+ previous: string;
9
+ }
10
+ /** Tri-state toggle: null = do not touch */
11
+ type TriState = boolean | null;
12
+ interface DbPermissionDecisionDetail extends PermissionDecisionBase<"db"> {
13
+ select?: TriState;
14
+ insert?: TriState;
15
+ update?: TriState;
16
+ delete?: TriState;
17
+ truncate?: TriState;
18
+ grouped_queries?: TriState;
19
+ }
20
+ interface FilePermissionDecisionDetail extends PermissionDecisionBase<"file"> {
21
+ read?: TriState;
22
+ write?: TriState;
23
+ append?: TriState;
24
+ delete?: TriState;
25
+ mkdir?: TriState;
26
+ rmdir?: TriState;
27
+ list?: TriState;
28
+ }
29
+ interface NotificationPermissionDecisionDetail extends PermissionDecisionBase<"notification"> {
30
+ send?: TriState;
31
+ receive?: TriState;
32
+ }
33
+ interface ModulePermissionDecisionDetail extends PermissionDecisionBase<"module"> {
34
+ call?: TriState;
35
+ }
36
+ interface NetworkPermissionDecisionDetail extends PermissionDecisionBase<"network"> {
37
+ request?: TriState;
38
+ }
39
+ interface CodecPermissionDecisionDetail extends PermissionDecisionBase<"codec"> {
40
+ invoke?: TriState;
41
+ }
42
+ type PermissionDecisionDetail = DbPermissionDecisionDetail | FilePermissionDecisionDetail | NotificationPermissionDecisionDetail | ModulePermissionDecisionDetail | NetworkPermissionDecisionDetail | CodecPermissionDecisionDetail;
43
+ type DbActionKey = "select" | "insert" | "update" | "delete" | "truncate" | "grouped_queries";
44
+ type FileActionKey = "read" | "write" | "append" | "delete" | "mkdir" | "rmdir" | "list";
45
+ type NotificationActionKey = "send" | "receive";
46
+ type ModuleActionKey = "call";
47
+ type NetworkActionKey = "request";
48
+ type CodecActionKey = "invoke";
49
+ type PermissionActionKeyByType = {
50
+ db: DbActionKey;
51
+ file: FileActionKey;
52
+ notification: NotificationActionKey;
53
+ module: ModuleActionKey;
54
+ network: NetworkActionKey;
55
+ codec: CodecActionKey;
56
+ };
57
+ interface PermissionDecisionRequestDto {
58
+ plugin_id: number;
59
+ detail: PermissionDecisionDetail;
60
+ /**
61
+ * Host-side metadata only.
62
+ * Keep this minimal; justification is dev-only and should not be part of host decision payload.
63
+ */
64
+ meta?: {
65
+ active?: boolean;
66
+ constraints?: Record<string, unknown> | null;
67
+ audit?: Record<string, unknown> | null;
68
+ };
69
+ }
70
+
71
+ type PermissionWindow = null | {
72
+ limited: true;
73
+ type: string | null;
74
+ value: string | null;
75
+ };
76
+ type PermissionConstraints = (Record<string, unknown> & {
77
+ required?: boolean;
78
+ }) | null;
79
+ type PermissionAudit = Record<string, unknown> | null;
80
+ interface PermissionSourceDirect {
81
+ assignment_id: number | string | null;
82
+ active: boolean;
83
+ window: PermissionWindow;
84
+ constraints: PermissionConstraints;
85
+ audit: PermissionAudit;
86
+ justification: string | null;
87
+ /** derived in listPermissions() from constraints.required */
88
+ required: boolean;
89
+ }
90
+ interface PermissionSourceTag {
91
+ tag_id: number | string | null;
92
+ tag_name: string | null;
93
+ active: boolean;
94
+ constraints: PermissionConstraints;
95
+ audit: PermissionAudit;
96
+ }
97
+ interface PermissionListSources {
98
+ direct: PermissionSourceDirect[];
99
+ tags: PermissionSourceTag[];
100
+ }
101
+ interface DbPermissionPresentation {
102
+ model: string | null;
103
+ table: string | null;
104
+ columns: string[] | null;
105
+ }
106
+ interface FilePermissionPresentation {
107
+ base_dir: string;
108
+ paths: string[];
109
+ follow_symlinks: boolean;
110
+ }
111
+ interface NotificationPermissionPresentation {
112
+ channel: string | null;
113
+ channels: string[] | null;
114
+ templates: string[] | null;
115
+ recipients: string[] | null;
116
+ }
117
+ interface ModulePermissionPresentation {
118
+ plugin: string | null;
119
+ plugin_fqcn: string | null;
120
+ apis: string[];
121
+ plugin_docs: string | null;
122
+ }
123
+ interface NetworkPermissionPresentation {
124
+ hosts: string[];
125
+ methods: string[];
126
+ schemes: ("https" | "http" | string)[] | null;
127
+ ports: number[] | null;
128
+ paths: string[] | null;
129
+ headers_allowed: string[] | null;
130
+ ips_allowed: string[] | null;
131
+ auth_via_host_secret: boolean;
132
+ }
133
+ interface CodecPermissionPresentation {
134
+ module: string;
135
+ allowed: unknown | null;
136
+ methods: unknown | null;
137
+ groups: unknown | null;
138
+ options: unknown | null;
139
+ }
140
+ /**
141
+ * For unknown/new types, your PHP falls back to $presentation = $row.
142
+ * So this is the generic fallback.
143
+ */
144
+ type UnknownPresentation = Record<string, unknown>;
145
+ type ActionFlags = Record<string, boolean>;
146
+ type DbActionFlags = ActionFlags & {
147
+ select?: boolean;
148
+ insert?: boolean;
149
+ update?: boolean;
150
+ delete?: boolean;
151
+ truncate?: boolean;
152
+ grouped_queries?: boolean;
153
+ };
154
+ type FileActionFlags = ActionFlags & {
155
+ read?: boolean;
156
+ write?: boolean;
157
+ append?: boolean;
158
+ delete?: boolean;
159
+ mkdir?: boolean;
160
+ rmdir?: boolean;
161
+ list?: boolean;
162
+ };
163
+ type NotificationActionFlags = ActionFlags & {
164
+ send?: boolean;
165
+ receive?: boolean;
166
+ };
167
+ type ModuleActionFlags = ActionFlags & {
168
+ call?: boolean;
169
+ publish?: boolean;
170
+ subscribe?: boolean;
171
+ };
172
+ type NetworkActionFlags = ActionFlags & {
173
+ request?: boolean;
174
+ };
175
+ type CodecActionFlags = ActionFlags & {
176
+ invoke?: boolean;
177
+ };
178
+ type ConcreteRow = Record<string, unknown>;
179
+ interface PermissionListItemBase<TType extends PermissionType, TPresentation, TActions extends ActionFlags> {
180
+ type: TType;
181
+ concreteId: number;
182
+ naturalKey: string | null;
183
+ presentation: TPresentation;
184
+ effectiveActions: TActions;
185
+ concrete: ConcreteRow;
186
+ /** NOTE: nested under sources.{direct,tags} */
187
+ sources: PermissionListSources;
188
+ required: boolean;
189
+ activeEffective: boolean;
190
+ }
191
+ type DbPermissionListItem = PermissionListItemBase<"db", DbPermissionPresentation, DbActionFlags>;
192
+ type FilePermissionListItem = PermissionListItemBase<"file", FilePermissionPresentation, FileActionFlags>;
193
+ type NotificationPermissionListItem = PermissionListItemBase<"notification", NotificationPermissionPresentation, NotificationActionFlags>;
194
+ type ModulePermissionListItem = PermissionListItemBase<"module", ModulePermissionPresentation, ModuleActionFlags>;
195
+ type NetworkPermissionListItem = PermissionListItemBase<"network", NetworkPermissionPresentation, NetworkActionFlags>;
196
+ type CodecPermissionListItem = PermissionListItemBase<"codec", CodecPermissionPresentation, CodecActionFlags>;
197
+ type UnknownPermissionListItem = PermissionListItemBase<PermissionType, UnknownPresentation, ActionFlags>;
198
+ type PermissionListItem = DbPermissionListItem | FilePermissionListItem | NotificationPermissionListItem | ModulePermissionListItem | NetworkPermissionListItem | CodecPermissionListItem | UnknownPermissionListItem;
199
+ interface PermissionListSummaryDto {
200
+ totals: {
201
+ by_type: Record<string, number>;
202
+ total: number;
203
+ active: number;
204
+ inactive: number;
205
+ };
206
+ required: {
207
+ total: number;
208
+ satisfied: number;
209
+ pending: number;
210
+ };
211
+ }
212
+ interface PermissionListResultDto {
213
+ items: PermissionListItem[];
214
+ summary: PermissionListSummaryDto;
215
+ }
216
+
217
+ /** --- db --- */
218
+ type DbPermissionActions = {
219
+ select: boolean;
220
+ insert: boolean;
221
+ update: boolean;
222
+ delete: boolean;
223
+ truncate: boolean;
224
+ grouped_queries: boolean;
225
+ };
226
+ interface DbPermissionAttributes {
227
+ model: string;
228
+ readable_columns: string[] | null;
229
+ writable_columns: string[] | null;
230
+ permissions: DbPermissionActions;
231
+ }
232
+ /** --- file --- */
233
+ type FilePermissionActions = {
234
+ read: boolean;
235
+ write: boolean;
236
+ append: boolean;
237
+ delete: boolean;
238
+ mkdir: boolean;
239
+ rmdir: boolean;
240
+ list: boolean;
241
+ };
242
+ interface FilePermissionAttributes {
243
+ base_dir: string;
244
+ paths: string[];
245
+ follow_symlinks: boolean;
246
+ permissions: FilePermissionActions;
247
+ }
248
+ /** --- notification --- */
249
+ type NotificationPermissionActions = {
250
+ send: boolean;
251
+ receive: boolean;
252
+ };
253
+ interface NotificationPermissionAttributes {
254
+ channel: string;
255
+ templates_allowed: string[] | null;
256
+ recipients_allowed: string[] | null;
257
+ permissions: NotificationPermissionActions;
258
+ }
259
+ /** --- module --- */
260
+ interface ModulePermissionAttributes {
261
+ module: string;
262
+ apis: string[];
263
+ access: boolean;
264
+ }
265
+ /** --- network --- */
266
+ interface NetworkPermissionAttributes {
267
+ hosts: string[];
268
+ methods: string[];
269
+ schemes: string[] | null;
270
+ ports: number[] | null;
271
+ paths: string[] | null;
272
+ headers_allowed: string[] | null;
273
+ ips_allowed: string[] | null;
274
+ auth_via_host_secret: boolean;
275
+ access: boolean;
276
+ label: string | null;
277
+ }
278
+ /** --- codec --- */
279
+ interface CodecPermissionAttributes {
280
+ module: string;
281
+ allowed: string[];
282
+ access: boolean;
283
+ }
284
+ /** Convenience map + generic record wrapper (useful for UI) */
285
+ type PermissionAttributesByType = {
286
+ db: DbPermissionAttributes;
287
+ file: FilePermissionAttributes;
288
+ notification: NotificationPermissionAttributes;
289
+ module: ModulePermissionAttributes;
290
+ network: NetworkPermissionAttributes;
291
+ codec: CodecPermissionAttributes;
292
+ };
293
+ type PermissionUpsertRecord<T extends PermissionType = PermissionType> = {
294
+ type: T;
295
+ natural_key: string;
296
+ attributes: PermissionAttributesByType[T];
297
+ };
298
+
299
+ export type { ActionFlags, CodecActionFlags, CodecActionKey, CodecPermissionAttributes, CodecPermissionDecisionDetail, CodecPermissionListItem, CodecPermissionPresentation, ConcreteRow, DbActionFlags, DbActionKey, DbPermissionActions, DbPermissionAttributes, DbPermissionDecisionDetail, DbPermissionListItem, DbPermissionPresentation, FileActionFlags, FileActionKey, FilePermissionActions, FilePermissionAttributes, FilePermissionDecisionDetail, FilePermissionListItem, FilePermissionPresentation, ModuleActionFlags, ModuleActionKey, ModulePermissionAttributes, ModulePermissionDecisionDetail, ModulePermissionListItem, ModulePermissionPresentation, NetworkActionFlags, NetworkActionKey, NetworkPermissionAttributes, NetworkPermissionDecisionDetail, NetworkPermissionListItem, NetworkPermissionPresentation, NotificationActionFlags, NotificationActionKey, NotificationPermissionActions, NotificationPermissionAttributes, NotificationPermissionDecisionDetail, NotificationPermissionListItem, NotificationPermissionPresentation, PermissionActionKeyByType, PermissionAttributesByType, PermissionAudit, PermissionConstraints, PermissionDecisionBase, PermissionDecisionDetail, PermissionDecisionRequestDto, PermissionListItem, PermissionListItemBase, PermissionListResultDto, PermissionListSources, PermissionListSummaryDto, PermissionSourceDirect, PermissionSourceTag, PermissionType, PermissionUpsertRecord, PermissionWindow, TriState, UnknownPermissionListItem, UnknownPresentation };
package/dist/types.mjs ADDED
@@ -0,0 +1 @@
1
+ //# sourceMappingURL=types.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":[],"sourcesContent":[],"mappings":"","names":[]}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "fortiplugin-bundle-adapter",
3
- "version": "0.0.7",
3
+ "version": "0.0.8",
4
4
  "description": "",
5
5
  "files": [
6
6
  "dist"
@@ -14,6 +14,11 @@
14
14
  "types": "./dist/index.d.ts",
15
15
  "import": "./dist/index.mjs",
16
16
  "require": "./dist/index.cjs"
17
+ },
18
+ "./types": {
19
+ "types": "./dist/types.d.ts",
20
+ "import": "./dist/types.mjs",
21
+ "require": "./dist/types.cjs"
17
22
  }
18
23
  },
19
24
  "scripts": {
@@ -22,7 +27,7 @@
22
27
  "typecheck": "tsc -p tsconfig.json",
23
28
  "test:transform": "node tests/run-transform.mjs",
24
29
  "prepublishOnly": "npm run build",
25
- "postpublish": "npm version patch && git commit -m \"Updated package.json\" && git push origin --follow-tags"
30
+ "postpublish": "npm version patch --no-git-tag-version"
26
31
  },
27
32
  "dependencies": {
28
33
  "@babel/core": "^7.28.5",
@@ -66,4 +71,4 @@
66
71
  "url": "https://github.com/timeax/fortiplugin-bundle-adapter/issues"
67
72
  },
68
73
  "homepage": "https://github.com/timeax/fortiplugin-bundle-adapter#readme"
69
- }
74
+ }