@nordcraft/core 1.0.66 → 1.0.68

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.
@@ -233,6 +233,9 @@ export interface CustomActionArgument {
233
233
  type?: any;
234
234
  description?: string;
235
235
  }
236
+ export interface ActionModelActions {
237
+ actions: ActionModel[];
238
+ }
236
239
  export interface CustomActionModel {
237
240
  type?: 'Custom';
238
241
  package?: string;
@@ -241,9 +244,7 @@ export interface CustomActionModel {
241
244
  group?: string;
242
245
  data?: string | number | boolean | Formula;
243
246
  arguments?: Partial<CustomActionArgument[]>;
244
- events?: Record<string, {
245
- actions: ActionModel[];
246
- }>;
247
+ events?: Record<string, ActionModelActions>;
247
248
  version?: 2 | never;
248
249
  label?: string;
249
250
  }
@@ -254,9 +255,7 @@ export interface SwitchActionModel {
254
255
  condition: Formula | null;
255
256
  actions: ActionModel[];
256
257
  }>;
257
- default: {
258
- actions: ActionModel[];
259
- };
258
+ default: ActionModelActions;
260
259
  }
261
260
  export interface VariableActionModel {
262
261
  type: 'SetVariable';
@@ -269,15 +268,9 @@ export interface FetchActionModel {
269
268
  inputs?: Record<string, {
270
269
  formula: Formula | null;
271
270
  }>;
272
- onSuccess: {
273
- actions: ActionModel[];
274
- };
275
- onError: {
276
- actions: ActionModel[];
277
- };
278
- onMessage?: {
279
- actions: ActionModel[];
280
- };
271
+ onSuccess: ActionModelActions;
272
+ onError: ActionModelActions;
273
+ onMessage?: ActionModelActions;
281
274
  }
282
275
  export interface SetURLParameterAction {
283
276
  type: 'SetURLParameter';
package/dist/types.d.ts CHANGED
@@ -23,10 +23,10 @@ export type FormulaHandler<T = void> = (args: unknown[], ctx: {
23
23
  interface PluginActionBase {
24
24
  name: string;
25
25
  description?: string;
26
- arguments: Array<{
26
+ arguments?: Array<{
27
27
  name: string;
28
28
  formula: Formula;
29
- }>;
29
+ }> | null;
30
30
  events?: Record<string, {
31
31
  dummyEvent?: any;
32
32
  }>;
package/package.json CHANGED
@@ -11,5 +11,5 @@
11
11
  },
12
12
  "files": ["dist", "src"],
13
13
  "main": "dist/index.js",
14
- "version": "1.0.66"
14
+ "version": "1.0.68"
15
15
  }
@@ -278,6 +278,10 @@ export interface CustomActionArgument {
278
278
  description?: string
279
279
  }
280
280
 
281
+ export interface ActionModelActions {
282
+ actions: ActionModel[]
283
+ }
284
+
281
285
  export interface CustomActionModel {
282
286
  // Some legacy custom actions use an undefined type
283
287
  type?: 'Custom'
@@ -287,7 +291,7 @@ export interface CustomActionModel {
287
291
  group?: string
288
292
  data?: string | number | boolean | Formula
289
293
  arguments?: Partial<CustomActionArgument[]>
290
- events?: Record<string, { actions: ActionModel[] }>
294
+ events?: Record<string, ActionModelActions>
291
295
  version?: 2 | never
292
296
  label?: string
293
297
  }
@@ -299,7 +303,7 @@ export interface SwitchActionModel {
299
303
  condition: Formula | null
300
304
  actions: ActionModel[]
301
305
  }>
302
- default: { actions: ActionModel[] }
306
+ default: ActionModelActions
303
307
  }
304
308
 
305
309
  export interface VariableActionModel {
@@ -311,9 +315,9 @@ export interface FetchActionModel {
311
315
  type: 'Fetch'
312
316
  api: string
313
317
  inputs?: Record<string, { formula: Formula | null }>
314
- onSuccess: { actions: ActionModel[] }
315
- onError: { actions: ActionModel[] }
316
- onMessage?: { actions: ActionModel[] }
318
+ onSuccess: ActionModelActions
319
+ onError: ActionModelActions
320
+ onMessage?: ActionModelActions
317
321
  }
318
322
 
319
323
  export interface SetURLParameterAction {
package/src/types.ts CHANGED
@@ -46,10 +46,10 @@ export type FormulaHandler<T = void> = (
46
46
  interface PluginActionBase {
47
47
  name: string
48
48
  description?: string
49
- arguments: Array<{
49
+ arguments?: Array<{
50
50
  name: string
51
51
  formula: Formula
52
- }>
52
+ }> | null
53
53
  // eslint-disable-next-line inclusive-language/use-inclusive-words
54
54
  events?: Record<string, { dummyEvent?: any }>
55
55
  variableArguments: boolean | null