@b-jones-rfd/qualtrics-api-tasks 0.3.1 → 0.3.3

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/CHANGELOG.md CHANGED
@@ -1,5 +1,17 @@
1
1
  # @b-jones-rfd/qualtrics-api-tasks
2
2
 
3
+ ## 0.3.3
4
+
5
+ ### Patch Changes
6
+
7
+ - e64a943: Fix export responses date range
8
+
9
+ ## 0.3.2
10
+
11
+ ### Patch Changes
12
+
13
+ - ec58f5e: Added distribute surveys method to documentation
14
+
3
15
  ## 0.3.1
4
16
 
5
17
  ### Patch Changes
package/README.md CHANGED
@@ -1,6 +1,6 @@
1
1
  ![GitHub Actions CI](https://github.com/B-Jones-RFD/qualtrics-api-tasks/actions/workflows/main.yml/badge.svg)
2
2
  [![npm version](https://img.shields.io/npm/v/@b-jones-rfd/qualtrics-api-tasks.svg?style=flat-square)](https://www.npmjs.com/package/@b-jones-rfd/qualtrics-api-tasks)
3
- ![npm bundle size](https://img.shields.io/bundlephobia/min/%40b-jones-rfd%2Fqualtrics-api-tasks)
3
+ [![npm bundle size](https://img.shields.io/bundlephobia/min/%40b-jones-rfd%2Fqualtrics-api-tasks)](https://bundlephobia.com/package/@b-jones-rfd/qualtrics-api-tasks)
4
4
  [![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg?style=flat-square)](https://github.com/prettier/prettier)
5
5
 
6
6
  # Qualtrics API Tasks
@@ -207,7 +207,11 @@ Implements [Get Contacts Import Summary](https://api.qualtrics.com/6f0480b307053
207
207
 
208
208
  ##### importContacts(options)
209
209
 
210
- Implements [Contact Import](https://api.qualtrics.com/1ac99fba8ca5b-contact-imports) multistep process
210
+ Implements [Contact Import](https://api.qualtrics.com/1ac99fba8ca5b-contact-imports) multistep process. This runs the following actions:
211
+
212
+ 1. [Start Contacts Import](#startcontactsimportoptions)
213
+ 2. Polls [Get Contacts Import Status](#getcontactsimportstatusoptions)
214
+ 3. [Get Contacts Import Summary](#getcontactsimportsummaryoptions)
211
215
 
212
216
  `options`
213
217
 
@@ -279,6 +283,44 @@ Implements [Create Reminder Distribution](https://api.qualtrics.com/764630bb0633
279
283
  | sendDate | Date | Date time to send | Y |
280
284
  | bearerToken | string | Valid Bearer Token | N |
281
285
 
286
+ ##### distributeSurveys(options)
287
+
288
+ Multistep process to execute a survey distribution. Runs the following actions:
289
+
290
+ 1. [Create Mailing List](#createmailinglistoptions)
291
+ 2. [Import Contacts](#importcontactsoptions)
292
+ 3. [Create Distribution](#createdistributionoptions)
293
+ 4. [Create Reminder](#createreminderoptions)
294
+
295
+ `options`
296
+
297
+ | Property | Type | Description | Required | Default |
298
+ | ----------------------- | ---------------------- | ---------------------------------- | -------- | ------- |
299
+ | directoryId | string | Quatrics Directory ID | Y | |
300
+ | mailingListName | string | Mailing List Name | Y | |
301
+ | ownerId | string | Owner ID | Y | |
302
+ | prioritizeListMetadata | boolean | Import metadata as list metadata | N | false |
303
+ | contacts | Contact[] | Contacts array | Y | |
304
+ | transactionMeta | object | Transaction meta data | N | |
305
+ | libraryId | string | Quatrics Library ID | Y | |
306
+ | distributionMessageId | string | Distribution Message ID | Y | |
307
+ | distributionMessageText | string | Message text to send | N | |
308
+ | reminderMessageId | string | Reminder Message ID | Y | |
309
+ | reminderMessageText | string | Reminder message text to send | N | |
310
+ | transactionBatchId | string | Transaction Batch ID | N | |
311
+ | fromEmail | string | Originating email | Y | |
312
+ | replyToEmail | string | Email reply-to address | N | |
313
+ | fromName | string | Email from name | Y | |
314
+ | distributionSubject | string | Distribution email subject | Y | |
315
+ | reminderSubject | string | Reminder email subject | Y | |
316
+ | surveyId | string | Qualtrics Survey ID | Y | |
317
+ | expirationDate | Date | Distribution expiration date time | Y | |
318
+ | type | enum | Individual, Multiple, or Anonymous | Y | |
319
+ | embeddedData | Record<string, string> | Up to 10 subkeys | N | |
320
+ | distributionSendDate | Date | Date time to send distribution | Y | |
321
+ | reminderSendDate | Date | Date time to send reminder | Y | |
322
+ | bearerToken | string | Valid Bearer Token | N | |
323
+
282
324
  ##### getDistribution(options)
283
325
 
284
326
  Implements [Get Distribution](https://api.qualtrics.com/f5b1d8775d803-get-distribution)
@@ -313,7 +355,11 @@ Implements [List Distributions](https://api.qualtrics.com/234bb6b16cf6d-list-dis
313
355
 
314
356
  ##### exportResponses(options)
315
357
 
316
- Implements [Survey Response File Export](https://api.qualtrics.com/u9e5lh4172v0v-survey-response-export-guide) multistep process.
358
+ Implements [Survey Response File Export](https://api.qualtrics.com/u9e5lh4172v0v-survey-response-export-guide) multistep process. Runs the following actions:
359
+
360
+ 1. [Start Response Export](#startresponseexportsoptions)
361
+ 2. Polls [Get Response Export Progress](#getresponseexportprogressoptions)
362
+ 3. [Get Response Export File](#getresponseexportfileoptions)
317
363
 
318
364
  `options`
319
365
 
package/dist/index.d.mts CHANGED
@@ -278,16 +278,19 @@ type DistributionOptions = {
278
278
  distributionMessageId: string;
279
279
  distributionMessageText?: string;
280
280
  reminderMessageId: string;
281
+ reminderMessageText?: string;
281
282
  transactionBatchId?: string;
282
283
  fromEmail: string;
283
284
  replyToEmail?: string;
284
285
  fromName: string;
285
- subject: string;
286
+ distributionSubject: string;
287
+ reminderSubject: string;
286
288
  surveyId: string;
287
289
  expirationDate: Date;
288
290
  type: 'Individual' | 'Multiple' | 'Anonymous';
289
291
  embeddedData?: Record<string, string>;
290
- sendDate: Date;
292
+ distributionSendDate: Date;
293
+ reminderSendDate: Date;
291
294
  bearerToken?: string;
292
295
  };
293
296
 
package/dist/index.d.ts CHANGED
@@ -278,16 +278,19 @@ type DistributionOptions = {
278
278
  distributionMessageId: string;
279
279
  distributionMessageText?: string;
280
280
  reminderMessageId: string;
281
+ reminderMessageText?: string;
281
282
  transactionBatchId?: string;
282
283
  fromEmail: string;
283
284
  replyToEmail?: string;
284
285
  fromName: string;
285
- subject: string;
286
+ distributionSubject: string;
287
+ reminderSubject: string;
286
288
  surveyId: string;
287
289
  expirationDate: Date;
288
290
  type: 'Individual' | 'Multiple' | 'Anonymous';
289
291
  embeddedData?: Record<string, string>;
290
- sendDate: Date;
292
+ distributionSendDate: Date;
293
+ reminderSendDate: Date;
291
294
  bearerToken?: string;
292
295
  };
293
296
 
package/dist/index.js CHANGED
@@ -456,12 +456,12 @@ var distributeSurveys = (connectionOptions) => async (options) => {
456
456
  fromEmail: options.fromEmail,
457
457
  fromName: options.fromName,
458
458
  replyToEmail: options.replyToEmail,
459
- subject: options.subject,
459
+ subject: options.distributionSubject,
460
460
  surveyId: options.surveyId,
461
461
  expirationDate: options.expirationDate,
462
462
  type: options.type,
463
463
  embeddedData: options.embeddedData,
464
- sendDate: options.sendDate,
464
+ sendDate: options.distributionSendDate,
465
465
  bearerToken: options.bearerToken
466
466
  });
467
467
  if (!distributionResponse.success)
@@ -474,9 +474,9 @@ var distributeSurveys = (connectionOptions) => async (options) => {
474
474
  fromEmail: options.fromEmail,
475
475
  fromName: options.fromName,
476
476
  replyToEmail: options.replyToEmail,
477
- subject: options.subject,
477
+ subject: options.reminderSubject,
478
478
  embeddedData: options.embeddedData,
479
- sendDate: options.sendDate,
479
+ sendDate: options.reminderSendDate,
480
480
  bearerToken: options.bearerToken
481
481
  });
482
482
  if (!reminderResponse.success)
@@ -501,10 +501,8 @@ var startResponseExport = (connectionOptions) => async ({
501
501
  try {
502
502
  const headers = getAuthHeaders(connectionOptions.apiToken, bearerToken);
503
503
  const body = JSON.stringify({
504
- startDate: "2024-03-01T06:00:00Z",
505
- //startDate.toISOString(),
506
- endDate: "2024-03-05T06:00:00Z",
507
- //endDate.toISOString(),
504
+ startDate: startDate.toISOString(),
505
+ endDate: endDate.toISOString(),
508
506
  format,
509
507
  ...rest
510
508
  });
package/dist/index.mjs CHANGED
@@ -413,12 +413,12 @@ var distributeSurveys = (connectionOptions) => async (options) => {
413
413
  fromEmail: options.fromEmail,
414
414
  fromName: options.fromName,
415
415
  replyToEmail: options.replyToEmail,
416
- subject: options.subject,
416
+ subject: options.distributionSubject,
417
417
  surveyId: options.surveyId,
418
418
  expirationDate: options.expirationDate,
419
419
  type: options.type,
420
420
  embeddedData: options.embeddedData,
421
- sendDate: options.sendDate,
421
+ sendDate: options.distributionSendDate,
422
422
  bearerToken: options.bearerToken
423
423
  });
424
424
  if (!distributionResponse.success)
@@ -431,9 +431,9 @@ var distributeSurveys = (connectionOptions) => async (options) => {
431
431
  fromEmail: options.fromEmail,
432
432
  fromName: options.fromName,
433
433
  replyToEmail: options.replyToEmail,
434
- subject: options.subject,
434
+ subject: options.reminderSubject,
435
435
  embeddedData: options.embeddedData,
436
- sendDate: options.sendDate,
436
+ sendDate: options.reminderSendDate,
437
437
  bearerToken: options.bearerToken
438
438
  });
439
439
  if (!reminderResponse.success)
@@ -458,10 +458,8 @@ var startResponseExport = (connectionOptions) => async ({
458
458
  try {
459
459
  const headers = getAuthHeaders(connectionOptions.apiToken, bearerToken);
460
460
  const body = JSON.stringify({
461
- startDate: "2024-03-01T06:00:00Z",
462
- //startDate.toISOString(),
463
- endDate: "2024-03-05T06:00:00Z",
464
- //endDate.toISOString(),
461
+ startDate: startDate.toISOString(),
462
+ endDate: endDate.toISOString(),
465
463
  format,
466
464
  ...rest
467
465
  });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@b-jones-rfd/qualtrics-api-tasks",
3
- "version": "0.3.1",
3
+ "version": "0.3.3",
4
4
  "description": "Perform common tasks using the Qualtrics API",
5
5
  "private": false,
6
6
  "main": "./dist/index.js",