@thunderid/javascript 1.10.3 → 1.12.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.
Files changed (40) hide show
  1. package/dist/api/auth/executeEmbeddedDeviceGrantFlow.d.ts.map +1 -1
  2. package/dist/api/auth/executeEmbeddedSelfFlow.d.ts +57 -0
  3. package/dist/api/auth/executeEmbeddedSelfFlow.d.ts.map +1 -0
  4. package/dist/cjs/index.cjs +414 -6
  5. package/dist/constants/AttributeVerificationConstants.d.ts +13 -0
  6. package/dist/constants/AttributeVerificationConstants.d.ts.map +1 -0
  7. package/dist/edge/index.js +407 -7
  8. package/dist/i18n/models/i18n.d.ts +14 -0
  9. package/dist/i18n/models/i18n.d.ts.map +1 -1
  10. package/dist/i18n/translations/en-US.d.ts.map +1 -1
  11. package/dist/i18n/translations/fr-FR.d.ts.map +1 -1
  12. package/dist/i18n/translations/hi-IN.d.ts.map +1 -1
  13. package/dist/i18n/translations/ja-JP.d.ts.map +1 -1
  14. package/dist/i18n/translations/pt-BR.d.ts.map +1 -1
  15. package/dist/i18n/translations/pt-PT.d.ts.map +1 -1
  16. package/dist/i18n/translations/si-LK.d.ts.map +1 -1
  17. package/dist/i18n/translations/ta-IN.d.ts.map +1 -1
  18. package/dist/i18n/translations/te-IN.d.ts.map +1 -1
  19. package/dist/index.d.ts +14 -1
  20. package/dist/index.d.ts.map +1 -1
  21. package/dist/index.js +407 -7
  22. package/dist/models/embedded-flow.d.ts +3 -0
  23. package/dist/models/embedded-flow.d.ts.map +1 -1
  24. package/dist/models/embedded-self-flow.d.ts +75 -0
  25. package/dist/models/embedded-self-flow.d.ts.map +1 -0
  26. package/dist/models/extensions/components.d.ts +1 -1
  27. package/dist/models/extensions/components.d.ts.map +1 -1
  28. package/dist/models/user.d.ts +9 -0
  29. package/dist/models/user.d.ts.map +1 -1
  30. package/dist/utils/compileConsentDecisions.d.ts +14 -0
  31. package/dist/utils/compileConsentDecisions.d.ts.map +1 -0
  32. package/dist/utils/getFlowStepComponents.d.ts +26 -0
  33. package/dist/utils/getFlowStepComponents.d.ts.map +1 -0
  34. package/dist/utils/getVerifiedAttributes.d.ts +14 -0
  35. package/dist/utils/getVerifiedAttributes.d.ts.map +1 -0
  36. package/dist/utils/isVerifiableAttribute.d.ts +22 -0
  37. package/dist/utils/isVerifiableAttribute.d.ts.map +1 -0
  38. package/dist/utils/parseSelfFlowRequest.d.ts +24 -0
  39. package/dist/utils/parseSelfFlowRequest.d.ts.map +1 -0
  40. package/package.json +1 -1
@@ -1 +1 @@
1
- {"version":3,"file":"executeEmbeddedDeviceGrantFlow.d.ts","sourceRoot":"","sources":["../../../src/api/auth/executeEmbeddedDeviceGrantFlow.ts"],"names":[],"mappings":"AAIA,OAAO,EAAC,gCAAgC,EAAE,gBAAgB,EAAC,MAAM,4BAA4B,CAAC;AAC9F,OAAO,EAAC,0BAA0B,EAA2B,MAAM,mCAAmC,CAAC;AAEvG,MAAM,WAAW,mCAAmC;IAClD,aAAa,EAAE,MAAM,CAAC;IACtB,QAAQ,EAAE,gBAAgB,CAAC,WAAW,CAAC;IACvC,MAAM,EAAE;QAAC,SAAS,CAAC,EAAE,MAAM,CAAA;KAAC,CAAC;CAC9B;AAED,MAAM,WAAW,0CAA0C;IACzD,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,WAAW,EAAE,MAAM,CAAC;IACpB,MAAM,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;CAClC;AAED,MAAM,MAAM,8BAA8B,GACtC,mCAAmC,GACnC,0CAA0C,CAAC;AAE/C,qEAAqE;AACrE,MAAM,MAAM,+BAA+B,GAAG,0BAA0B,CAAC;AAEzE,MAAM,WAAW,oCACf,SAAQ,IAAI,CAAC,gCAAgC,CAAC,8BAA8B,CAAC,EAAE,QAAQ,GAAG,YAAY,CAAC;IACvG,OAAO,CAAC,EAAE,8BAA8B,CAAC;CAC1C;AAiED;;;;;;;GAOG;AACH,QAAA,MAAM,8BAA8B,GAAU,6CAK3C,oCAAoC,KAAG,OAAO,CAAC,+BAA+B,CAkIhF,CAAC;AAEF,eAAe,8BAA8B,CAAC"}
1
+ {"version":3,"file":"executeEmbeddedDeviceGrantFlow.d.ts","sourceRoot":"","sources":["../../../src/api/auth/executeEmbeddedDeviceGrantFlow.ts"],"names":[],"mappings":"AAIA,OAAO,EAAC,gCAAgC,EAAE,gBAAgB,EAAC,MAAM,4BAA4B,CAAC;AAC9F,OAAO,EAAC,0BAA0B,EAA2B,MAAM,mCAAmC,CAAC;AAEvG,MAAM,WAAW,mCAAmC;IAClD,aAAa,EAAE,MAAM,CAAC;IACtB,QAAQ,EAAE,gBAAgB,CAAC,WAAW,CAAC;IACvC,MAAM,EAAE;QAAC,SAAS,CAAC,EAAE,MAAM,CAAA;KAAC,CAAC;CAC9B;AAED,MAAM,WAAW,0CAA0C;IACzD,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,WAAW,EAAE,MAAM,CAAC;IACpB,MAAM,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;CAClC;AAED,MAAM,MAAM,8BAA8B,GACtC,mCAAmC,GACnC,0CAA0C,CAAC;AAE/C,qEAAqE;AACrE,MAAM,MAAM,+BAA+B,GAAG,0BAA0B,CAAC;AAEzE,MAAM,WAAW,oCACf,SAAQ,IAAI,CAAC,gCAAgC,CAAC,8BAA8B,CAAC,EAAE,QAAQ,GAAG,YAAY,CAAC;IACvG,OAAO,CAAC,EAAE,8BAA8B,CAAC;CAC1C;AAiED;;;;;;;GAOG;AACH,QAAA,MAAM,8BAA8B,GAAU,6CAK3C,oCAAoC,KAAG,OAAO,CAAC,+BAA+B,CA6KhF,CAAC;AAEF,eAAe,8BAA8B,CAAC"}
@@ -0,0 +1,57 @@
1
+ import { EmbeddedSelfFlowRequest, EmbeddedSelfFlowResponse } from '../../models/embedded-self-flow';
2
+ /**
3
+ * Configuration for the executeEmbeddedSelfFlow request.
4
+ */
5
+ export interface ExecuteEmbeddedSelfFlowConfig extends Omit<RequestInit, 'method' | 'body'> {
6
+ /**
7
+ * The base path of the API endpoint.
8
+ */
9
+ baseUrl?: string;
10
+ /**
11
+ * Optional custom fetcher function. If not provided, native fetch is used, which sends no
12
+ * access token; framework SDKs pass a fetcher that attaches the signed-in user's token.
13
+ */
14
+ fetcher?: (url: string, config: RequestInit) => Promise<Response>;
15
+ /**
16
+ * The step to execute: an initiating request or a continuation.
17
+ */
18
+ payload: EmbeddedSelfFlowRequest;
19
+ /**
20
+ * The absolute flow execution endpoint.
21
+ */
22
+ url?: string;
23
+ }
24
+ /**
25
+ * Executes one step of a `SELF` flow, an operation the signed-in user performs on their own
26
+ * account, such as verifying their email address. A new execution names the flow by its handle; the
27
+ * server takes the user from the access token on that first request and keeps it for the execution.
28
+ *
29
+ * @param config - Configuration object with URL, payload, fetcher and optional request config.
30
+ * @returns A promise that resolves with the flow step.
31
+ * @throws ThunderIDAPIError when the input is invalid or the request fails, coded
32
+ * `executeEmbeddedSelfFlow-` plus `ValidationError-001` (invalid `url` or `baseUrl`), `ValidationError-002`
33
+ * (no payload), `ValidationError-003` (a new flow without a handle), `ResponseError-001` (the server refused, with
34
+ * its status) or `NetworkError-001` (no response, or an unreadable one).
35
+ *
36
+ * @example
37
+ * ```typescript
38
+ * const step = await executeEmbeddedSelfFlow({
39
+ * baseUrl: 'https://localhost:8090',
40
+ * payload: {
41
+ * flowType: 'SELF',
42
+ * handle: 'default-self-attribute-verification-flow',
43
+ * inputs: {attribute: 'email'},
44
+ * },
45
+ * fetcher: authenticatedFetcher,
46
+ * });
47
+ *
48
+ * await executeEmbeddedSelfFlow({
49
+ * baseUrl: 'https://localhost:8090',
50
+ * payload: {executionId: step.executionId, action: 'verify', inputs: {otp: '123456'}},
51
+ * fetcher: authenticatedFetcher,
52
+ * });
53
+ * ```
54
+ */
55
+ declare const executeEmbeddedSelfFlow: ({ url, baseUrl, payload, fetcher, ...requestConfig }: ExecuteEmbeddedSelfFlowConfig) => Promise<EmbeddedSelfFlowResponse>;
56
+ export default executeEmbeddedSelfFlow;
57
+ //# sourceMappingURL=executeEmbeddedSelfFlow.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"executeEmbeddedSelfFlow.d.ts","sourceRoot":"","sources":["../../../src/api/auth/executeEmbeddedSelfFlow.ts"],"names":[],"mappings":"AAIA,OAAO,EAAC,uBAAuB,EAAE,wBAAwB,EAAC,MAAM,iCAAiC,CAAC;AAElG;;GAEG;AACH,MAAM,WAAW,6BAA8B,SAAQ,IAAI,CAAC,WAAW,EAAE,QAAQ,GAAG,MAAM,CAAC;IACzF;;OAEG;IACH,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB;;;OAGG;IACH,OAAO,CAAC,EAAE,CAAC,GAAG,EAAE,MAAM,EAAE,MAAM,EAAE,WAAW,KAAK,OAAO,CAAC,QAAQ,CAAC,CAAC;IAClE;;OAEG;IACH,OAAO,EAAE,uBAAuB,CAAC;IACjC;;OAEG;IACH,GAAG,CAAC,EAAE,MAAM,CAAC;CACd;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA8BG;AACH,QAAA,MAAM,uBAAuB,GAAU,sDAMpC,6BAA6B,KAAG,OAAO,CAAC,wBAAwB,CA+ElE,CAAC;AAEF,eAAe,uBAAuB,CAAC"}