@dyedurham/search-and-file-widget 2.0.45 → 2.0.47

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 (2) hide show
  1. package/dnd-filing-shell.js +45 -23
  2. package/package.json +10 -10
@@ -84129,7 +84129,7 @@ Note: Recommended intrinsic image size is calculated assuming a maximum DPR of $
84129
84129
  const recMailingEffective = isRecMailingSame ? regMailingBC : recMailingBC;
84130
84130
  const isRecDeliverySame = !recDeliveryBC || sameAddress(recDeliveryBC, recMailingEffective);
84131
84131
  const { useFutureEffectiveDate, effectiveDate, effectiveTime } = getEffectiveDate(task);
84132
- const directors = affiliations.filter((a) => isPrincipalAffiliation2(a) && a.role?.role_name === DirectorRole.DIRECTOR && isActiveAffiliation(a) && a._participant?.participant_type === "person");
84132
+ const directors = affiliations.filter(isFilableBCDirector);
84133
84133
  const request = {
84134
84134
  reference: deltaData.referenceNumbers?.referenceNumber || void 0,
84135
84135
  docket: deltaData.referenceNumbers?.docketNumber || void 0,
@@ -84160,6 +84160,16 @@ Note: Recommended intrinsic image size is calculated assuming a maximum DPR of $
84160
84160
  };
84161
84161
  return pruneUndefined(request);
84162
84162
  }
84163
+ function stripBCDeltaSecrets(delta) {
84164
+ if (!delta?.entityDetails || !("password" in delta.entityDetails)) {
84165
+ return delta;
84166
+ }
84167
+ const _a = delta.entityDetails, { password: _password } = _a, entityDetails = __objRest(_a, ["password"]);
84168
+ return __spreadProps(__spreadValues({}, delta), { entityDetails });
84169
+ }
84170
+ function redactBCValidateRequest(request) {
84171
+ return __spreadProps(__spreadValues({}, request), { password: "" });
84172
+ }
84163
84173
  function getEffectiveDate(task) {
84164
84174
  const futureDate = task._ext._future_filing_date;
84165
84175
  const useFutureEffectiveDate = task._ext._is_future_date === true || Boolean(futureDate);
@@ -84221,6 +84231,9 @@ Note: Recommended intrinsic image size is calculated assuming a maximum DPR of $
84221
84231
  function isActiveAffiliation(affiliation) {
84222
84232
  return affiliation.status !== "inactive" && affiliation.status !== "closed";
84223
84233
  }
84234
+ function isFilableBCDirector(affiliation) {
84235
+ return isPrincipalAffiliation2(affiliation) && affiliation.role?.role_name === DirectorRole.DIRECTOR && isActiveAffiliation(affiliation) && affiliation._participant?.participant_type === "person";
84236
+ }
84224
84237
  function findSharedAddressAffiliation(affiliations, staticTitle) {
84225
84238
  return affiliations.find((a) => a.role?.role_name === AddressRole2.SHARED_ADDRESS && a.role?.static_title === staticTitle && isActiveAffiliation(a));
84226
84239
  }
@@ -84374,7 +84387,7 @@ Note: Recommended intrinsic image size is calculated assuming a maximum DPR of $
84374
84387
  });
84375
84388
  config2[BCFormationFormGroups.Notification] = this.generateNotificationFormGroup(delta?.notification, companyEmail);
84376
84389
  config2[BCFormationFormGroups.CompletingParty] = this.generateCompletingPartyFormGroup(task, delta?.completingParty, currentUser);
84377
- const directors = affiliations.filter((a) => isPrincipalAffiliation2(a) && a.role?.role_name === "Director");
84390
+ const directors = affiliations.filter(isFilableBCDirector);
84378
84391
  if (directors.length) {
84379
84392
  config2[BCFormationFormGroups.Directors] = new FormArray(directors.map((director) => this.generateDirectorFormGroup(director)));
84380
84393
  }
@@ -84612,8 +84625,9 @@ Note: Recommended intrinsic image size is calculated assuming a maximum DPR of $
84612
84625
  })
84613
84626
  });
84614
84627
  }
84628
+ /** Same rule as the payload: inactive / closed office affiliations are skipped. */
84615
84629
  static findSharedAddressAffiliation(affiliations, staticTitle) {
84616
- return affiliations.find((a) => a.role?.role_name === AddressRole2.SHARED_ADDRESS && a.role?.static_title === staticTitle);
84630
+ return findSharedAddressAffiliation(affiliations, staticTitle);
84617
84631
  }
84618
84632
  /**
84619
84633
  * Athennian stores one address per `location_type` ("Mailing", "Delivery", …).
@@ -86187,9 +86201,17 @@ Note: Recommended intrinsic image size is calculated assuming a maximum DPR of $
86187
86201
  }
86188
86202
  });
86189
86203
  }
86204
+ /**
86205
+ * The company password is a registry credential: it is passed to Validate (it is part of the
86206
+ * API request) but never included in the Delta Data the host persists.
86207
+ */
86190
86208
  onFormationValidate() {
86191
86209
  markFormGroupTouched(this.deltaForm());
86192
- this.formationValidate.emit(this.generateFormationDeltaData());
86210
+ const delta = this.generateFormationDeltaData();
86211
+ const password = this.deltaForm().get(BCFormationFormGroups.CorporationDetails)?.get(BCFormationFormControls.CompanyPassword)?.value;
86212
+ this.formationValidate.emit(__spreadProps(__spreadValues({}, delta), {
86213
+ entityDetails: __spreadProps(__spreadValues({}, delta.entityDetails), { password: password ?? null })
86214
+ }));
86193
86215
  }
86194
86216
  onFormationSave() {
86195
86217
  const delta = this.generateFormationDeltaData();
@@ -86220,8 +86242,8 @@ Note: Recommended intrinsic image size is calculated assuming a maximum DPR of $
86220
86242
  nameReservationNumber: isNamed2 ? corpDetails?.[BCFormationFormControls.NameReservationNumber] ?? null : null,
86221
86243
  usesNameTranslation,
86222
86244
  nameTranslations,
86223
- companyEmail: corpDetails?.[BCFormationFormControls.CompanyEmail] ?? null,
86224
- password: corpDetails?.[BCFormationFormControls.CompanyPassword] ?? null
86245
+ companyEmail: corpDetails?.[BCFormationFormControls.CompanyEmail] ?? null
86246
+ // `password` intentionally omitted – see onFormationValidate().
86225
86247
  },
86226
86248
  notification: {
86227
86249
  method: notification?.[BCFormationFormControls.NotificationMethod] ?? null,
@@ -86813,7 +86835,7 @@ Note: Recommended intrinsic image size is calculated assuming a maximum DPR of $
86813
86835
  {
86814
86836
  type: FormType.Input,
86815
86837
  label: "Nuans Report Reservation #",
86816
- formControlName: FederalFormationFormControl.SecondaryNuansReportReservation,
86838
+ formControlName: FederalFormationFormControl.SecondaryReservationNumber,
86817
86839
  isVisible: (form) => Boolean(form.get(FederalFormationFormControl.ProposedCorporateNameInOtherOfficialLanguage)?.value) && NameType2.NonPreapproved === form.get(FederalFormationFormControl.NameType)?.value,
86818
86840
  class: "span-3",
86819
86841
  required: true
@@ -87710,7 +87732,7 @@ Note: Recommended intrinsic image size is calculated assuming a maximum DPR of $
87710
87732
  [FederalFormationFormControl.SecondaryReservationDate]: new FormControl(""),
87711
87733
  [FederalFormationFormControl.LegalElement]: new FormControl(corporateName?.legalElement ?? task.entity._profile.legal_entity_identifier ?? null, requiredIfValue(FederalFormationFormControl.NameType, NameType2.Numbered)),
87712
87734
  [FederalFormationFormControl.NamePreapprovalConfirmationNumber]: new FormControl(corporateName?.preapprovalConfirmationNumber ?? "", requiredIfValue(FederalFormationFormControl.NameType, NameType2.Preapproved)),
87713
- [FederalFormationFormControl.BusinessActivities]: new FormControl(corporateName?.businessActivity ?? task.entity._articles?.restrictions),
87735
+ [FederalFormationFormControl.BusinessActivities]: new FormControl(corporateName?.businessActivity ?? null),
87714
87736
  [FederalFormationFormControl.ClienteleMarketType]: new FormControl(corporateName?.typeOfClientele ?? null),
87715
87737
  [FederalFormationFormControl.LocationTerritory]: new FormControl(corporateName?.locationOfOperations ?? null),
87716
87738
  [FederalFormationFormControl.KeywordOrigin]: new FormControl(corporateName?.originOfKeyword ?? null),
@@ -90315,7 +90337,6 @@ Note: Recommended intrinsic image size is calculated assuming a maximum DPR of $
90315
90337
  const task = this.task();
90316
90338
  if (task) {
90317
90339
  if (this.isFormationTask(task)) {
90318
- this.selectedDocuments.set(task.deltaData?.corporateName?.supportingDocuments ?? []);
90319
90340
  this.deltaForm.set(new FormGroup(FederalFormHelper.generateConfig(task)));
90320
90341
  this.restoreSelectedDocuments(task);
90321
90342
  this.deltaState.setFederalFormationInitialDelta(untracked2(() => this.generateFederalFormationDeltaData()));
@@ -92272,19 +92293,23 @@ Note: Recommended intrinsic image size is calculated assuming a maximum DPR of $
92272
92293
  });
92273
92294
 
92274
92295
  // src/app/services/british-columbia/british-columbia-formation.service.ts
92296
+ function failureMessage(status, action) {
92297
+ return status ? `BC ${action} was not successful (status: ${status}).` : `BC ${action} was not confirmed: the response had no status.`;
92298
+ }
92275
92299
  function toValidateErrors(errors) {
92276
92300
  if (!errors?.length) {
92277
92301
  return void 0;
92278
92302
  }
92279
92303
  return errors.map((e) => ({ Code: e.code, Message: e.message }));
92280
92304
  }
92281
- var INCORPORATION_PATH, BritishColumbiaFormationService;
92305
+ var INCORPORATION_PATH, SUCCESS_STATUS, BritishColumbiaFormationService;
92282
92306
  var init_british_columbia_formation_service = __esm({
92283
92307
  "src/app/services/british-columbia/british-columbia-formation.service.ts"() {
92284
92308
  init_core();
92285
92309
  init_common_utils();
92286
92310
  init_core();
92287
92311
  INCORPORATION_PATH = "filings/ca/bc/incorporation";
92312
+ SUCCESS_STATUS = "success";
92288
92313
  BritishColumbiaFormationService = class _BritishColumbiaFormationService {
92289
92314
  config;
92290
92315
  setConfig(config2) {
@@ -92306,13 +92331,14 @@ Note: Recommended intrinsic image size is calculated assuming a maximum DPR of $
92306
92331
  throw err2;
92307
92332
  }
92308
92333
  const payload = unwrapRequestResults(parsed.value);
92334
+ const succeeded = resp.ok && payload?.status === SUCCESS_STATUS && Boolean(payload?.serviceOrderId);
92309
92335
  const result = {
92310
92336
  Status: payload?.status,
92311
92337
  ServiceOrderId: payload?.serviceOrderId,
92312
92338
  Draft: payload?.draft,
92313
- Errors: toValidateErrors(payload?.errors)
92339
+ Errors: succeeded ? toValidateErrors(payload?.errors) : toValidateErrors(payload?.errors) ?? [{ Message: failureMessage(payload?.status, "validation") }]
92314
92340
  };
92315
- if (resp.ok && !result.Errors?.length) {
92341
+ if (succeeded && !result.Errors?.length) {
92316
92342
  return result;
92317
92343
  }
92318
92344
  const err = buildValidationError(resp.status, result);
@@ -92339,20 +92365,16 @@ Note: Recommended intrinsic image size is calculated assuming a maximum DPR of $
92339
92365
  const raw = yield resp.text();
92340
92366
  const parsed = tryParseJson(raw);
92341
92367
  if (!parsed.ok) {
92342
- if (resp.ok) {
92343
- this.emitSubmitSuccess(signature, serviceOrderId);
92344
- return { Status: "success", ServiceOrderId: serviceOrderId, raw };
92345
- }
92346
92368
  const err = new Error(`eCore submit returned ${resp.status} ${resp.statusText}: ${raw || "(empty response)"}`);
92347
92369
  err.httpStatus = resp.status;
92348
92370
  throw err;
92349
92371
  }
92350
92372
  const payload = unwrapRequestResults(parsed.value);
92351
- const failed = !resp.ok || payload?.status && payload.status !== "success";
92373
+ const failed = !resp.ok || payload?.status !== SUCCESS_STATUS;
92352
92374
  const result = {
92353
92375
  Status: payload?.status,
92354
92376
  ServiceOrderId: serviceOrderId,
92355
- Errors: failed ? toValidateErrors(payload?.errors) ?? (payload?.additionalInformation ?? [payload?.status ?? "failed"]).map((message) => ({
92377
+ Errors: failed ? toValidateErrors(payload?.errors) ?? (payload?.additionalInformation?.length ? payload.additionalInformation : [failureMessage(payload?.status, "filing")]).map((message) => ({
92356
92378
  Message: message
92357
92379
  })) : void 0
92358
92380
  };
@@ -92867,9 +92889,9 @@ Note: Recommended intrinsic image size is calculated assuming a maximum DPR of $
92867
92889
  if (validatedData) {
92868
92890
  delete this.task()?.deltaData.validatedData;
92869
92891
  }
92870
- this.deltaDataChange.emit(__spreadProps(__spreadValues({}, deltaData), {
92892
+ this.deltaDataChange.emit(__spreadProps(__spreadValues({}, stripBCDeltaSecrets(deltaData)), {
92871
92893
  serviceOrderId,
92872
- validatedData: JSON.parse(JSON.stringify(requestBody))
92894
+ validatedData: JSON.parse(JSON.stringify(redactBCValidateRequest(requestBody)))
92873
92895
  }));
92874
92896
  this.close.emit();
92875
92897
  }
@@ -92888,7 +92910,7 @@ Note: Recommended intrinsic image size is calculated assuming a maximum DPR of $
92888
92910
  if (oldDeltaData) {
92889
92911
  delete this.task()?.deltaData;
92890
92912
  }
92891
- this.deltaDataChange.emit(deltaData);
92913
+ this.deltaDataChange.emit(stripBCDeltaSecrets(deltaData));
92892
92914
  }
92893
92915
  /**
92894
92916
  * British Columbia Formation file (AC13): submits the staged incorporation by ServiceOrderId.
@@ -93268,7 +93290,7 @@ Note: Recommended intrinsic image size is calculated assuming a maximum DPR of $
93268
93290
  return buildOntarioFormationValidateRequest(task, deltaData);
93269
93291
  }
93270
93292
  if (isBritishColumbiaTask(task)) {
93271
- return buildBCFormationValidateRequest(task, deltaData);
93293
+ return redactBCValidateRequest(buildBCFormationValidateRequest(task, deltaData));
93272
93294
  }
93273
93295
  const federalPayload = buildFederalFormationValidateRequest(task, deltaData);
93274
93296
  const validatedIncorporation = deltaData?.validatedData?.Incorporation;
@@ -93450,7 +93472,7 @@ Note: Recommended intrinsic image size is calculated assuming a maximum DPR of $
93450
93472
  }], () => [], null);
93451
93473
  })();
93452
93474
  (() => {
93453
- (typeof ngDevMode === "undefined" || ngDevMode) && \u0275setClassDebugInfo(FilingComponent, { className: "FilingComponent", filePath: "src/app/components/filing/filing.component.ts", lineNumber: 82 });
93475
+ (typeof ngDevMode === "undefined" || ngDevMode) && \u0275setClassDebugInfo(FilingComponent, { className: "FilingComponent", filePath: "src/app/components/filing/filing.component.ts", lineNumber: 86 });
93454
93476
  })();
93455
93477
  }
93456
93478
  });
package/package.json CHANGED
@@ -1,11 +1,11 @@
1
- {
2
- "name": "@dyedurham/search-and-file-widget",
3
- "version": "2.0.45",
4
- "description": "",
5
- "main": "dnd-filing-shell.js",
6
- "scripts": {
7
- "test": "echo \"Error: no test specified\" && exit 1"
8
- },
9
- "author": "",
10
- "license": "ISC"
1
+ {
2
+ "name": "@dyedurham/search-and-file-widget",
3
+ "version": "2.0.47",
4
+ "description": "",
5
+ "main": "dnd-filing-shell.js",
6
+ "scripts": {
7
+ "test": "echo \"Error: no test specified\" && exit 1"
8
+ },
9
+ "author": "",
10
+ "license": "ISC"
11
11
  }