diff --git a/packages/screeb-sdk-angular/docs/classes/Screeb.md b/packages/screeb-sdk-angular/docs/classes/Screeb.md index f01375f..51ddf01 100644 --- a/packages/screeb-sdk-angular/docs/classes/Screeb.md +++ b/packages/screeb-sdk-angular/docs/classes/Screeb.md @@ -501,7 +501,7 @@ ___ ### surveyStart -▸ **surveyStart**(`surveyId`, `allowMultipleResponses`, `hiddenFields`, `hooks?`, `language?`): `Promise`\<`unknown`\> +▸ **surveyStart**(`surveyId`, `distributionId`, `allowMultipleResponses`, `hiddenFields`, `hooks?`, `language?`): `Promise`\<`unknown`\> Starts a survey by its ID. @@ -510,6 +510,7 @@ Starts a survey by its ID. | Name | Type | | :------ | :------ | | `surveyId` | `string` | +| `distributionId` | `string` | | `allowMultipleResponses` | `boolean` | | `hiddenFields` | `PropertyRecord` | | `hooks?` | `Hooks` | @@ -523,6 +524,7 @@ Starts a survey by its ID. ```ts this.screeb.surveyStart( + '', '', false, { diff --git a/packages/screeb-sdk-angular/projects/screeb-sdk-angular/src/lib/screeb.ts b/packages/screeb-sdk-angular/projects/screeb-sdk-angular/src/lib/screeb.ts index 2479474..eab0d3e 100644 --- a/packages/screeb-sdk-angular/projects/screeb-sdk-angular/src/lib/screeb.ts +++ b/packages/screeb-sdk-angular/projects/screeb-sdk-angular/src/lib/screeb.ts @@ -306,6 +306,7 @@ export class Screeb { * ```ts * this.screeb.surveyStart( * '', + * '', * false, * { * color: "green", @@ -321,6 +322,7 @@ export class Screeb { */ public async surveyStart( surveyId: string, + distributionId: string, allowMultipleResponses: boolean, hiddenFields: _Screeb.PropertyRecord, hooks?: _Screeb.Hooks, @@ -330,6 +332,7 @@ export class Screeb { return _Screeb.surveyStart( surveyId, + distributionId, allowMultipleResponses, hiddenFields, hooks, diff --git a/packages/screeb-sdk-browser/docs/README.md b/packages/screeb-sdk-browser/docs/README.md index e263a2c..47cdf27 100644 --- a/packages/screeb-sdk-browser/docs/README.md +++ b/packages/screeb-sdk-browser/docs/README.md @@ -878,7 +878,7 @@ ___ ### surveyStart -▸ **surveyStart**(`surveyId`, `allowMultipleResponses?`, `hiddenFields?`, `hooks?`, `language?`): `void` \| `Promise`\<`unknown`\> +▸ **surveyStart**(`surveyId`, `distributionId`, `allowMultipleResponses?`, `hiddenFields?`, `hooks?`, `language?`): `void` \| `Promise`\<`unknown`\> Starts a survey by its ID. @@ -887,6 +887,7 @@ Starts a survey by its ID. | Name | Type | Default value | | :------ | :------ | :------ | | `surveyId` | `string` | `undefined` | +| `distributionId` | `string` | `undefined` | | `allowMultipleResponses` | `boolean` | `true` | | `hiddenFields` | [`PropertyRecord`](README.md#propertyrecord) | `{}` | | `hooks?` | [`Hooks`](README.md#hooks) | `undefined` | @@ -902,6 +903,7 @@ Starts a survey by its ID. import * as Screeb from "@screeb/sdk-browser"; Screeb.surveyStart( + '', '', false, { diff --git a/packages/screeb-sdk-browser/src/index.ts b/packages/screeb-sdk-browser/src/index.ts index 0d89673..e196aa0 100644 --- a/packages/screeb-sdk-browser/src/index.ts +++ b/packages/screeb-sdk-browser/src/index.ts @@ -431,6 +431,7 @@ export const surveyClose = () => callScreebCommand("survey.close"); * * Screeb.surveyStart( * '', + * '', * false, * { * color: "green", @@ -446,12 +447,14 @@ export const surveyClose = () => callScreebCommand("survey.close"); */ export const surveyStart = ( surveyId: string, + distributionId: string, allowMultipleResponses = true, hiddenFields: PropertyRecord = {}, hooks?: Hooks, language?: string, ) => callScreebCommand("survey.start", surveyId, { + distribution_id: distributionId, allow_multiple_responses: allowMultipleResponses, language: language, hidden_fields: hiddenFields, diff --git a/packages/screeb-sdk-react/docs/README.md b/packages/screeb-sdk-react/docs/README.md index 76edae1..512995d 100644 --- a/packages/screeb-sdk-react/docs/README.md +++ b/packages/screeb-sdk-react/docs/README.md @@ -585,7 +585,7 @@ ___ ### SurveyStartFunction -Ƭ **SurveyStartFunction**: (`surveyId`: `string`, `allowMultipleResponses`: `boolean`, `hiddenFields`: `PropertyRecord`, `hooks?`: `Hooks`, `language?`: `string`) => `Promise`\<`unknown`\> +Ƭ **SurveyStartFunction**: (`surveyId`: `string`, `distributionId`: `string`, `allowMultipleResponses`: `boolean`, `hiddenFields`: `PropertyRecord`, `hooks?`: `Hooks`, `language?`: `string`) => `Promise`\<`unknown`\> Starts a survey by its ID. @@ -595,6 +595,7 @@ Starts a survey by its ID. const { surveyStart } = useScreeb(); surveyStart( + '', '', false, { @@ -606,13 +607,14 @@ surveyStart( #### Type declaration -▸ (`surveyId`, `allowMultipleResponses`, `hiddenFields`, `hooks?`, `language?`): `Promise`\<`unknown`\> +▸ (`surveyId`, `distributionId`, `allowMultipleResponses`, `hiddenFields`, `hooks?`, `language?`): `Promise`\<`unknown`\> ##### Parameters | Name | Type | | :------ | :------ | | `surveyId` | `string` | +| `distributionId` | `string` | | `allowMultipleResponses` | `boolean` | | `hiddenFields` | `PropertyRecord` | | `hooks?` | `Hooks` | diff --git a/packages/screeb-sdk-react/src/provider.tsx b/packages/screeb-sdk-react/src/provider.tsx index b826135..ebbc028 100644 --- a/packages/screeb-sdk-react/src/provider.tsx +++ b/packages/screeb-sdk-react/src/provider.tsx @@ -197,6 +197,7 @@ export const ScreebProvider: React.FC< const surveyStart = React.useCallback( async ( surveyId: string, + distributionId: string, allowMultipleResponses: boolean, hiddenFields: Screeb.PropertyRecord, hooks?: Screeb.Hooks, @@ -205,6 +206,7 @@ export const ScreebProvider: React.FC< await ensureScreeb("surveyStart", () => Screeb.surveyStart( surveyId, + distributionId, allowMultipleResponses, hiddenFields, hooks, diff --git a/packages/screeb-sdk-react/src/types.ts b/packages/screeb-sdk-react/src/types.ts index fae5602..910f05e 100644 --- a/packages/screeb-sdk-react/src/types.ts +++ b/packages/screeb-sdk-react/src/types.ts @@ -333,6 +333,7 @@ export type SurveyCloseFunction = () => Promise; * * surveyStart( * '', + * '', * false, * { * color: "green", @@ -343,6 +344,7 @@ export type SurveyCloseFunction = () => Promise; */ export type SurveyStartFunction = ( surveyId: string, + distributionId: string, allowMultipleResponses: boolean, hiddenFields: PropertyRecord, hooks?: Hooks,