@digipair/skill-keycloak 0.32.0 → 0.32.2

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/index.cjs.js CHANGED
@@ -23523,14 +23523,14 @@ function indent(str, spaces) {
23523
23523
  var match = parseIdentifier(input, i1, namePart) || namePart && parseAdditionalSymbol(input, i1) || maybeSpace && parseSpaces(input, i1);
23524
23524
  // match is required
23525
23525
  if (!match) {
23526
- return tokens = tokens1, i = i1, nextMatch = nextMatch1, {
23526
+ return i = i1, tokens = tokens1, nextMatch = nextMatch1, {
23527
23527
  v: nextMatch1
23528
23528
  };
23529
23529
  }
23530
23530
  var token = match.token, offset = match.offset;
23531
23531
  i1 += offset;
23532
23532
  if (token === " ") {
23533
- return tokens = tokens1, i = i1, nextMatch = nextMatch1, "continue";
23533
+ return i = i1, tokens = tokens1, nextMatch = nextMatch1, "continue";
23534
23534
  }
23535
23535
  tokens1 = _to_consumable_array$3(tokens1).concat([
23536
23536
  token
@@ -23549,7 +23549,7 @@ function indent(str, spaces) {
23549
23549
  if (contextKeys.some(function(el) {
23550
23550
  return el.startsWith(name);
23551
23551
  })) {
23552
- return tokens = tokens1, i = i1, nextMatch = nextMatch1, "continue";
23552
+ return i = i1, tokens = tokens1, nextMatch = nextMatch1, "continue";
23553
23553
  }
23554
23554
  if (dateTimeIdentifiers.some(function(el) {
23555
23555
  return el === name;
@@ -23568,9 +23568,9 @@ function indent(str, spaces) {
23568
23568
  if (dateTimeIdentifiers.some(function(el) {
23569
23569
  return el.startsWith(name);
23570
23570
  })) {
23571
- return tokens = tokens1, i = i1, nextMatch = nextMatch1, "continue";
23571
+ return i = i1, tokens = tokens1, nextMatch = nextMatch1, "continue";
23572
23572
  }
23573
- return tokens = tokens1, i = i1, nextMatch = nextMatch1, {
23573
+ return i = i1, tokens = tokens1, nextMatch = nextMatch1, {
23574
23574
  v: nextMatch1
23575
23575
  };
23576
23576
  };
@@ -33262,13 +33262,13 @@ let KeycloakService = class KeycloakService {
33262
33262
  return await executePinsList(execute, context);
33263
33263
  }
33264
33264
  async boost(params, _pinsSettingsList, context) {
33265
- var _context_request_headers_authorization;
33265
+ var _context_request_headers_authorization, _steps_step;
33266
33266
  if (context.request.method !== 'POST') {
33267
33267
  return {
33268
33268
  error: 'Method not allowed'
33269
33269
  };
33270
33270
  }
33271
- const { execute, secured = true, url = context.privates.KEYCLOAK_URL, realm = context.privates.KEYCLOAK_REALM } = params;
33271
+ const { steps, secured = true, url = context.privates.KEYCLOAK_URL, realm = context.privates.KEYCLOAK_REALM } = params;
33272
33272
  const token = /^Bearer /g.test(context.request.headers.authorization) && ((_context_request_headers_authorization = context.request.headers.authorization) == null ? void 0 : _context_request_headers_authorization.replace(/^Bearer /g, ''));
33273
33273
  if (token) {
33274
33274
  context.keycloak = {
@@ -33283,7 +33283,13 @@ let KeycloakService = class KeycloakService {
33283
33283
  if (secured && !context.keycloak.decodedToken) {
33284
33284
  throw new Error('Unauthorized');
33285
33285
  }
33286
- const result = await executePinsList(execute, context);
33286
+ const step = context.request.body.step ? steps.findIndex(({ name })=>name === context.request.body.step) : 0;
33287
+ const execute = ((_steps_step = steps[step]) == null ? void 0 : _steps_step.execute) || [];
33288
+ const result = await executePinsList(execute, _extends({}, context, {
33289
+ boost: {
33290
+ steps
33291
+ }
33292
+ }));
33287
33293
  return result;
33288
33294
  }
33289
33295
  constructor(){
package/index.esm.js CHANGED
@@ -33233,13 +33233,13 @@ let KeycloakService = class KeycloakService {
33233
33233
  return await executePinsList(execute, context);
33234
33234
  }
33235
33235
  async boost(params, _pinsSettingsList, context) {
33236
- var _context_request_headers_authorization;
33236
+ var _context_request_headers_authorization, _steps_step;
33237
33237
  if (context.request.method !== 'POST') {
33238
33238
  return {
33239
33239
  error: 'Method not allowed'
33240
33240
  };
33241
33241
  }
33242
- const { execute, secured = true, url = context.privates.KEYCLOAK_URL, realm = context.privates.KEYCLOAK_REALM } = params;
33242
+ const { steps, secured = true, url = context.privates.KEYCLOAK_URL, realm = context.privates.KEYCLOAK_REALM } = params;
33243
33243
  const token = /^Bearer /g.test(context.request.headers.authorization) && ((_context_request_headers_authorization = context.request.headers.authorization) == null ? void 0 : _context_request_headers_authorization.replace(/^Bearer /g, ''));
33244
33244
  if (token) {
33245
33245
  context.keycloak = {
@@ -33254,7 +33254,13 @@ let KeycloakService = class KeycloakService {
33254
33254
  if (secured && !context.keycloak.decodedToken) {
33255
33255
  throw new Error('Unauthorized');
33256
33256
  }
33257
- const result = await executePinsList(execute, context);
33257
+ const step = context.request.body.step ? steps.findIndex(({ name })=>name === context.request.body.step) : 0;
33258
+ const execute = ((_steps_step = steps[step]) == null ? void 0 : _steps_step.execute) || [];
33259
+ const result = await executePinsList(execute, _extends({}, context, {
33260
+ boost: {
33261
+ steps
33262
+ }
33263
+ }));
33258
33264
  return result;
33259
33265
  }
33260
33266
  constructor(){
@@ -1,14 +1,9 @@
1
1
  export interface PinsSettings {
2
- element: string;
3
- name: string;
4
- description: string;
5
2
  library: string;
3
+ element: string;
6
4
  properties?: {
7
5
  [key: string]: any;
8
6
  };
9
- variables?: {
10
- [key: string]: any;
11
- };
12
7
  conditions?: {
13
8
  if?: boolean;
14
9
  each?: any[];
@@ -17,5 +12,4 @@ export interface PinsSettings {
17
12
  events?: {
18
13
  [key: string]: PinsSettings[];
19
14
  };
20
- context?: any;
21
15
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@digipair/skill-keycloak",
3
- "version": "0.32.0",
3
+ "version": "0.32.2",
4
4
  "dependencies": {},
5
5
  "main": "./index.cjs.js",
6
6
  "module": "./index.esm.js"
package/schema.en.json CHANGED
@@ -60,23 +60,17 @@
60
60
  },
61
61
  "components": {
62
62
  "schemas": {
63
- "SecuredBoost": {
63
+ "SecuredInput": {
64
64
  "type": "object",
65
65
  "tags": ["boost"],
66
- "summary": "Secure trigger",
66
+ "summary": "Secure input",
67
67
  "properties": {
68
- "name": {
69
- "type": "string"
70
- },
71
68
  "prompt": {
72
69
  "type": "boolean"
73
70
  },
74
71
  "required": {
75
72
  "type": "boolean"
76
73
  },
77
- "text": {
78
- "type": "string"
79
- },
80
74
  "selector": {
81
75
  "type": "string"
82
76
  },
@@ -91,6 +85,25 @@
91
85
  }
92
86
  },
93
87
  "required": []
88
+ },
89
+ "SecuredStep": {
90
+ "type": "object",
91
+ "tags": ["boost"],
92
+ "summary": "Step",
93
+ "properties": {
94
+ "name": {
95
+ "summary": "Step name",
96
+ "type": "string"
97
+ },
98
+ "execute": {
99
+ "summary": "Actions to execute",
100
+ "type": "array",
101
+ "items": {
102
+ "$ref": "https://schemas.digipair.ai/pinsSettings"
103
+ }
104
+ }
105
+ },
106
+ "required": ["name", "execute"]
94
107
  }
95
108
  }
96
109
  },
@@ -300,28 +313,34 @@
300
313
  "tags": ["boost", "service"],
301
314
  "metadata": [
302
315
  {
303
- "name": "boosts",
304
- "summary": "List of triggers",
316
+ "name": "boostSelector",
317
+ "summary": "Selector",
305
318
  "required": true,
306
- "description": "List of triggers for the boost",
319
+ "description": "CSS selector",
307
320
  "schema": {
308
- "type": "array",
309
- "items": {
310
- "$ref": "#/components/schemas/SecuredBoost"
311
- }
321
+ "type": "string"
322
+ }
323
+ },
324
+ {
325
+ "name": "boostUrl",
326
+ "summary": "RegEx Url",
327
+ "required": true,
328
+ "description": "RegEx url",
329
+ "schema": {
330
+ "type": "string"
312
331
  }
313
332
  }
314
333
  ],
315
334
  "parameters": [
316
335
  {
317
- "name": "execute",
318
- "summary": "Execution of actions",
319
- "required": false,
320
- "description": "List of actions to execute",
336
+ "name": "steps",
337
+ "summary": "Execute the following steps",
338
+ "required": true,
339
+ "description": "Execute the defined steps",
321
340
  "schema": {
322
341
  "type": "array",
323
342
  "items": {
324
- "$ref": "https://schemas.digipair.ai/pinsSettings"
343
+ "$ref": "#/components/schemas/SecuredStep"
325
344
  }
326
345
  }
327
346
  },
package/schema.fr.json CHANGED
@@ -60,23 +60,17 @@
60
60
  },
61
61
  "components": {
62
62
  "schemas": {
63
- "SecuredBoost": {
63
+ "SecuredInput": {
64
64
  "type": "object",
65
65
  "tags": ["boost"],
66
- "summary": "Déclencheur sécurisé",
66
+ "summary": "Entrées sécurisées",
67
67
  "properties": {
68
- "name": {
69
- "type": "string"
70
- },
71
68
  "prompt": {
72
69
  "type": "boolean"
73
70
  },
74
71
  "required": {
75
72
  "type": "boolean"
76
73
  },
77
- "text": {
78
- "type": "string"
79
- },
80
74
  "selector": {
81
75
  "type": "string"
82
76
  },
@@ -91,6 +85,25 @@
91
85
  }
92
86
  },
93
87
  "required": []
88
+ },
89
+ "SecuredStep": {
90
+ "type": "object",
91
+ "tags": ["boost"],
92
+ "summary": "Etape",
93
+ "properties": {
94
+ "name": {
95
+ "summary": "Nom de l'étape",
96
+ "type": "string"
97
+ },
98
+ "execute": {
99
+ "summary": "Actions à exécuter",
100
+ "type": "array",
101
+ "items": {
102
+ "$ref": "https://schemas.digipair.ai/pinsSettings"
103
+ }
104
+ }
105
+ },
106
+ "required": ["name", "execute"]
94
107
  }
95
108
  }
96
109
  },
@@ -300,28 +313,34 @@
300
313
  "tags": ["boost", "service"],
301
314
  "metadata": [
302
315
  {
303
- "name": "boosts",
304
- "summary": "Liste des déclencheurs",
316
+ "name": "boostSelector",
317
+ "summary": "Sélecteur CSS du déclencheur",
305
318
  "required": true,
306
- "description": "Liste des déclencheurs du boost",
319
+ "description": "Sélecteur CSS du déclencheur",
307
320
  "schema": {
308
- "type": "array",
309
- "items": {
310
- "$ref": "#/components/schemas/SecuredBoost"
311
- }
321
+ "type": "string"
322
+ }
323
+ },
324
+ {
325
+ "name": "boostUrl",
326
+ "summary": "Correspondance URL",
327
+ "required": false,
328
+ "description": "Correspondance URL du déclencheur",
329
+ "schema": {
330
+ "type": "string"
312
331
  }
313
332
  }
314
333
  ],
315
334
  "parameters": [
316
335
  {
317
- "name": "execute",
318
- "summary": "Exécution des actions",
319
- "required": false,
320
- "description": "Liste des actions à exécuter",
336
+ "name": "steps",
337
+ "summary": "Execute les étapes suivantes",
338
+ "required": true,
339
+ "description": "Execute les étapes définies suivantes",
321
340
  "schema": {
322
341
  "type": "array",
323
342
  "items": {
324
- "$ref": "https://schemas.digipair.ai/pinsSettings"
343
+ "$ref": "#/components/schemas/SecuredStep"
325
344
  }
326
345
  }
327
346
  },
package/schema.json CHANGED
@@ -60,23 +60,17 @@
60
60
  },
61
61
  "components": {
62
62
  "schemas": {
63
- "SecuredBoost": {
63
+ "SecuredInput": {
64
64
  "type": "object",
65
65
  "tags": ["boost"],
66
- "summary": "Secure trigger",
66
+ "summary": "Secure input",
67
67
  "properties": {
68
- "name": {
69
- "type": "string"
70
- },
71
68
  "prompt": {
72
69
  "type": "boolean"
73
70
  },
74
71
  "required": {
75
72
  "type": "boolean"
76
73
  },
77
- "text": {
78
- "type": "string"
79
- },
80
74
  "selector": {
81
75
  "type": "string"
82
76
  },
@@ -91,6 +85,25 @@
91
85
  }
92
86
  },
93
87
  "required": []
88
+ },
89
+ "SecuredStep": {
90
+ "type": "object",
91
+ "tags": ["boost"],
92
+ "summary": "Step",
93
+ "properties": {
94
+ "name": {
95
+ "summary": "Step name",
96
+ "type": "string"
97
+ },
98
+ "execute": {
99
+ "summary": "Actions to execute",
100
+ "type": "array",
101
+ "items": {
102
+ "$ref": "https://schemas.digipair.ai/pinsSettings"
103
+ }
104
+ }
105
+ },
106
+ "required": ["name", "execute"]
94
107
  }
95
108
  }
96
109
  },
@@ -300,28 +313,34 @@
300
313
  "tags": ["boost", "service"],
301
314
  "metadata": [
302
315
  {
303
- "name": "boosts",
304
- "summary": "List of triggers",
316
+ "name": "boostSelector",
317
+ "summary": "Selector",
305
318
  "required": true,
306
- "description": "List of triggers for the boost",
319
+ "description": "CSS selector",
307
320
  "schema": {
308
- "type": "array",
309
- "items": {
310
- "$ref": "#/components/schemas/SecuredBoost"
311
- }
321
+ "type": "string"
322
+ }
323
+ },
324
+ {
325
+ "name": "boostUrl",
326
+ "summary": "RegEx Url",
327
+ "required": true,
328
+ "description": "RegEx url",
329
+ "schema": {
330
+ "type": "string"
312
331
  }
313
332
  }
314
333
  ],
315
334
  "parameters": [
316
335
  {
317
- "name": "execute",
318
- "summary": "Execution of actions",
319
- "required": false,
320
- "description": "List of actions to execute",
336
+ "name": "steps",
337
+ "summary": "Execute the following steps",
338
+ "required": true,
339
+ "description": "Execute the defined steps",
321
340
  "schema": {
322
341
  "type": "array",
323
342
  "items": {
324
- "$ref": "https://schemas.digipair.ai/pinsSettings"
343
+ "$ref": "#/components/schemas/SecuredStep"
325
344
  }
326
345
  }
327
346
  },