@medplum/core 0.9.22 → 0.9.23

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/dist/esm/index.js CHANGED
@@ -6336,15 +6336,48 @@ class MedplumClient extends EventTarget {
6336
6336
  return __classPrivateFieldGet(this, _MedplumClient_instances, "m", _MedplumClient_request).call(this, 'DELETE', url, options);
6337
6337
  }
6338
6338
  /**
6339
- * Tries to register a new user.
6339
+ * Initiates a new user flow.
6340
+ *
6341
+ * This method is part of the two different user registration flows:
6342
+ * 1) New Practitioner and new Project
6343
+ * 2) New Patient registration
6344
+ *
6340
6345
  * @category Authentication
6341
- * @param request The registration request.
6346
+ * @param registerRequest Register request including email and password.
6347
+ * @returns Promise to the authentication response.
6348
+ */
6349
+ startNewUser(registerRequest) {
6350
+ return __awaiter(this, void 0, void 0, function* () {
6351
+ yield __classPrivateFieldGet(this, _MedplumClient_instances, "m", _MedplumClient_startPkce).call(this);
6352
+ return this.post('auth/newuser', Object.assign(Object.assign({}, registerRequest), { codeChallengeMethod: 'S256', codeChallenge: __classPrivateFieldGet(this, _MedplumClient_storage, "f").getString('codeChallenge') }));
6353
+ });
6354
+ }
6355
+ /**
6356
+ * Initiates a new project flow.
6357
+ *
6358
+ * This requires a partial login from `startNewUser` or `startNewGoogleUser`.
6359
+ *
6360
+ * @param registerRequest Register request including email and password.
6361
+ * @param login The partial login to complete. This should come from the `startNewUser` method.
6362
+ * @returns Promise to the authentication response.
6363
+ */
6364
+ startNewProject(registerRequest, login) {
6365
+ return __awaiter(this, void 0, void 0, function* () {
6366
+ return this.post('auth/newproject', Object.assign(Object.assign({}, registerRequest), login));
6367
+ });
6368
+ }
6369
+ /**
6370
+ * Initiates a new patient flow.
6371
+ *
6372
+ * This requires a partial login from `startNewUser` or `startNewGoogleUser`.
6373
+ *
6374
+ * @param registerRequest Register request including email and password.
6375
+ * @param login The partial login to complete. This should come from the `startNewUser` method.
6342
6376
  * @returns Promise to the authentication response.
6343
6377
  */
6344
- register(request) {
6378
+ startNewPatient(registerRequest, login) {
6345
6379
  return __awaiter(this, void 0, void 0, function* () {
6346
- const response = yield this.post('auth/register', request);
6347
- yield this.setActiveLogin(response);
6380
+ return this.post('auth/newpatient', Object.assign(Object.assign({}, registerRequest), login));
6348
6381
  });
6349
6382
  }
6350
6383
  /**
@@ -10716,5 +10749,5 @@ function simplifyExpression(input) {
10716
10749
  return result;
10717
10750
  }
10718
10751
 
10719
- export { AndAtom, ArithemticOperatorAtom, AsAtom, COMPONENT_SEPARATOR, ConcatAtom, ContainsAtom, DEFAULT_SEARCH_COUNT, DotAtom, EmptySetAtom, EqualsAtom, EquivalentAtom, FIELD_SEPARATOR, FhirPathAtom, FunctionAtom, Hl7Field, Hl7Message, Hl7Segment, InAtom, IndexerAtom, IsAtom, LRUCache, LiteralAtom, MedplumClient, NotEqualsAtom, NotEquivalentAtom, OperationOutcomeError, Operator, OrAtom, PropertyType, ReadablePromise, SEGMENT_SEPARATOR, SearchParameterType, SymbolAtom, UnaryOperatorAtom, UnionAtom, XorAtom, accessDenied, allOk, arrayBufferToBase64, arrayBufferToHex, assertOk, badRequest, booleanToTypedValue, buildTypeName, calculateAge, calculateAgeString, capitalize, createReference, createSchema, createTypeSchema, created, deepEquals$1 as deepEquals, evalFhirPath, evalFhirPathTyped, fhirPathArrayEquals, fhirPathArrayEquivalent, fhirPathEquals, fhirPathEquivalent, fhirPathIs, fhirPathNot, findObservationInterval, formatAddress, formatFamilyName, formatGivenName, formatHumanName, formatSearchQuery, getCodeBySystem, getDateProperty, getDisplayString, getExpressionForResourceType, getExtensionValue, getIdentifier, getImageSrc, getPropertyDisplayName, getQuestionnaireAnswers, getReferenceString, getSearchParameterDetails, getStatus, getTypedPropertyValue, globalSchema, gone, indexSearchParameter, indexStructureDefinition, indexStructureDefinitionBundle, isGone, isLowerCase, isNotFound, isObject$1 as isObject, isOk, isPeriod, isProfileResource, isQuantity, isQuantityEquivalent, isStringArray, isUUID, matchesRange, notFound, notModified, parseFhirPath, parseSearchDefinition, preciseEquals, preciseGreaterThan, preciseGreaterThanOrEquals, preciseLessThan, preciseLessThanOrEquals, removeDuplicates, resolveId, setCodeBySystem, stringify, toJsBoolean, toTypedValue, tokenize };
10752
+ export { AndAtom, ArithemticOperatorAtom, AsAtom, COMPONENT_SEPARATOR, ConcatAtom, ContainsAtom, DEFAULT_SEARCH_COUNT, DotAtom, EmptySetAtom, EqualsAtom, EquivalentAtom, FIELD_SEPARATOR, FhirPathAtom, FunctionAtom, Hl7Field, Hl7Message, Hl7Segment, InAtom, IndexerAtom, IsAtom, LRUCache, LiteralAtom, MedplumClient, NotEqualsAtom, NotEquivalentAtom, OperationOutcomeError, Operator, OrAtom, PropertyType, ReadablePromise, SEGMENT_SEPARATOR, SearchParameterType, SymbolAtom, UnaryOperatorAtom, UnionAtom, XorAtom, accessDenied, allOk, arrayBufferToBase64, arrayBufferToHex, assertOk, badRequest, booleanToTypedValue, buildTypeName, calculateAge, calculateAgeString, capitalize, createReference, createSchema, createTypeSchema, created, deepEquals$1 as deepEquals, evalFhirPath, evalFhirPathTyped, fhirPathArrayEquals, fhirPathArrayEquivalent, fhirPathEquals, fhirPathEquivalent, fhirPathIs, fhirPathNot, findObservationInterval, formatAddress, formatFamilyName, formatGivenName, formatHumanName, formatSearchQuery, getCodeBySystem, getDateProperty, getDisplayString, getExpressionForResourceType, getExtensionValue, getIdentifier, getImageSrc, getPropertyDisplayName, getQuestionnaireAnswers, getReferenceString, getSearchParameterDetails, getStatus, getTypedPropertyValue, globalSchema, gone, indexSearchParameter, indexStructureDefinition, indexStructureDefinitionBundle, isGone, isLowerCase, isNotFound, isObject$1 as isObject, isOk, isPeriod, isProfileResource, isQuantity, isQuantityEquivalent, isStringArray, isUUID, matchesRange, notFound, notModified, parseFhirPath, parseJWTPayload, parseSearchDefinition, preciseEquals, preciseGreaterThan, preciseGreaterThanOrEquals, preciseLessThan, preciseLessThanOrEquals, removeDuplicates, resolveId, setCodeBySystem, stringify, toJsBoolean, toTypedValue, tokenize };
10720
10753
  //# sourceMappingURL=index.js.map