@suffolklitlab/alkiln 5.12.0-delete6 → 5.13.0
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.
|
@@ -77,6 +77,6 @@ jobs:
|
|
|
77
77
|
# Internal: docassemble changes sometimes break @a11y tests. That is
|
|
78
78
|
# a da problem, not ours. We will trigger these tests manually when we
|
|
79
79
|
# want to check up on this.
|
|
80
|
-
ALKILN_TAG_EXPRESSION: "
|
|
80
|
+
ALKILN_TAG_EXPRESSION: "${{ env.ALKILN_TAG_EXPRESSION }}"
|
|
81
81
|
#### Developer note: You can probably leave this out
|
|
82
82
|
ALKILN_VERSION: delete
|
package/CHANGELOG.md
CHANGED
|
@@ -43,7 +43,13 @@ Format:
|
|
|
43
43
|
-
|
|
44
44
|
-->
|
|
45
45
|
|
|
46
|
-
## [Unreleased]
|
|
46
|
+
<!-- ## [Unreleased] -->
|
|
47
|
+
|
|
48
|
+
## [5.13.0] - 2024-07-11
|
|
49
|
+
|
|
50
|
+
## Added
|
|
51
|
+
|
|
52
|
+
- Authors can now make sure that ALKiln deletes the interviews it creates for an ALKiln testing account. They can add a new (optional) value, an API key, to [the "sign in" Step](https://assemblyline.suffolklitlab.org/docs/alkiln/writing/#sign-in) and use the ["start interview" Step](https://assemblyline.suffolklitlab.org/docs/alkiln/writing/#start-interview) to go to the interview. The API key must belong to the user who signs in. Example: `Given I sign in with the email "<username env var>", the password "<password env var>", and the API key "<user API key>`. Admins can create an API key for a regular user with https://docassemble.org/docs/api.html#api_user_user_id_api_post. We will add this to the documentation for the "sign in" Step.
|
|
47
53
|
|
|
48
54
|
### Changed
|
|
49
55
|
|
|
@@ -51,14 +57,15 @@ Format:
|
|
|
51
57
|
|
|
52
58
|
### Fixed
|
|
53
59
|
|
|
54
|
-
- Now ALKiln deletes interviews upon interview completion for [signed in users](https://assemblyline.suffolklitlab.org/docs/alkiln/writing/#sign-in) as long as the user has an API key. Also, the author must have used the ["start interview" Step](https://assemblyline.suffolklitlab.org/docs/alkiln/writing/#start-interview) to get to the interview. Admins can give a regular user
|
|
60
|
+
- Now ALKiln deletes interviews upon interview completion for [signed in users](https://assemblyline.suffolklitlab.org/docs/alkiln/writing/#sign-in) as long as the user has an API key. Also, the author must have used the ["start interview" Step](https://assemblyline.suffolklitlab.org/docs/alkiln/writing/#start-interview) to get to the interview. Admins can give an API key to a regular user with https://docassemble.org/docs/api.html#api_user_user_id_api_post. See [#831](https://github.com/SuffolkLITLab/ALKiln/issues/831).
|
|
55
61
|
|
|
56
62
|
### Internal
|
|
57
63
|
|
|
58
|
-
-
|
|
59
|
-
-
|
|
60
|
-
-
|
|
61
|
-
-
|
|
64
|
+
- Tests deleting interviews upon interview completion for signed in users.
|
|
65
|
+
- Switches to mostly using a lowest-access-level user account for actually running interviews.
|
|
66
|
+
- Switches to adding our own `users[0]` question because of changes in Assembly Line.
|
|
67
|
+
- Adds @temp_error to neutralize tests that are getting undesired errors right now, but which we anticipate being fixed soon. We want to ignore them for a short while. For example, an upstream change temporarily breaking some tests.
|
|
68
|
+
- Excludes docassemble/ALKiln files from log code checks.
|
|
62
69
|
|
|
63
70
|
## [5.12.0] - 2024-06-06
|
|
64
71
|
|
|
@@ -232,7 +232,7 @@ da_i.get_api_key_access_status = async function ({ timeout = null, api_key = nul
|
|
|
232
232
|
} // ends try
|
|
233
233
|
} // ends auth_data.codes only has the first code
|
|
234
234
|
|
|
235
|
-
log.
|
|
235
|
+
log.debug({ type: `da api info`, code: `ALK0202`,
|
|
236
236
|
pre: `API key authentication info`, data: auth_data });
|
|
237
237
|
|
|
238
238
|
return auth_data;
|
|
@@ -280,7 +280,7 @@ da_i.quietly_try_to_delete_interviews = async function ({ interviews = {}, api_k
|
|
|
280
280
|
});
|
|
281
281
|
responses.push( sub_responses );
|
|
282
282
|
} else {
|
|
283
|
-
log.
|
|
283
|
+
log.debug({ type: `da api info`, code: `ALK0191`, pre: `There is no interview to delete.` });
|
|
284
284
|
}
|
|
285
285
|
}
|
|
286
286
|
return responses;
|
|
@@ -295,7 +295,7 @@ da_i.quietly_delete_one_interview = async function ( timeout, { interview = {},
|
|
|
295
295
|
let responses = [];
|
|
296
296
|
for ( let api_key of api_keys ) {
|
|
297
297
|
try {
|
|
298
|
-
log.
|
|
298
|
+
log.debug({ type: `da api info`, code: `ALK0188`,
|
|
299
299
|
pre: `Trying to delete the interview with the id ${ interview.uid } and an API key.`
|
|
300
300
|
});
|
|
301
301
|
|
|
@@ -306,13 +306,13 @@ da_i.quietly_delete_one_interview = async function ( timeout, { interview = {},
|
|
|
306
306
|
});
|
|
307
307
|
responses.push( response );
|
|
308
308
|
|
|
309
|
-
log.
|
|
309
|
+
log.debug({ type: `da api info`, code: `ALK0189`,
|
|
310
310
|
pre: `No error when trying to delete interview ${ interview.uid } at ${ interview.i }.`
|
|
311
311
|
});
|
|
312
312
|
} catch ( error ) {
|
|
313
313
|
error.interview = interview;
|
|
314
314
|
let msg = `Error when deleting the interview. See https://docassemble.org/docs/api.html#session_delete.`
|
|
315
|
-
log.
|
|
315
|
+
log.debug({ type: `da api info`, code: `ALK0190`, pre: msg, data: error });
|
|
316
316
|
}
|
|
317
317
|
} // ends for api keys
|
|
318
318
|
return responses;
|
|
@@ -347,7 +347,7 @@ da_i.get_interview = async function ({ interview = {}, api_keys = [], options =
|
|
|
347
347
|
if ( interview && interview.uid ) {
|
|
348
348
|
for ( let api_key of api_keys ) {
|
|
349
349
|
try {
|
|
350
|
-
log.
|
|
350
|
+
log.debug({ type: `da api info`, code: `ALK0192`, pre: `Trying to get the interview with the id ${ interview.uid } and an API key.` });
|
|
351
351
|
|
|
352
352
|
// Actual work:
|
|
353
353
|
let response = await _da_REST.get_interview( timeout, {
|
|
@@ -356,20 +356,20 @@ da_i.get_interview = async function ({ interview = {}, api_keys = [], options =
|
|
|
356
356
|
});
|
|
357
357
|
|
|
358
358
|
if ( response && response.data && response.data.items && response.data.items[0] && response.data.items[0].session ) {
|
|
359
|
-
log.
|
|
359
|
+
log.debug({ type: `da api info`, code: `ALK0193`, pre: `Status ${ response.status }. Got ${ response.data.items[0].session }.`});
|
|
360
360
|
return response.data.items[0];
|
|
361
361
|
} else {
|
|
362
|
-
log.
|
|
362
|
+
log.debug({ type: `da api info`, code: `ALK0194`, pre: `Status ${ response.status }. Cannot find ${ interview.uid }`});
|
|
363
363
|
}
|
|
364
364
|
|
|
365
365
|
} catch ( error ) {
|
|
366
366
|
error.interview = interview;
|
|
367
367
|
let msg = `${ error.status || `No error.status.` } ${ error.statusText || error.data || `No error.statusText.` } Ran into an error when getting the interview ${ interview.uid }. See https://docassemble.org/docs/api.html#interviews.`
|
|
368
|
-
log.
|
|
368
|
+
log.debug({ type: `da api info`, code: `ALK0195`, pre: msg, data: error });
|
|
369
369
|
}
|
|
370
370
|
} // ends for api_keys
|
|
371
371
|
} else {
|
|
372
|
-
log.
|
|
372
|
+
log.debug({ type: `da api info`, code: `ALK0196`, pre: `There is no interview to get.` });
|
|
373
373
|
}
|
|
374
374
|
|
|
375
375
|
return null;
|