@memberjunction/server 2.121.0 → 2.122.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.
@@ -240,12 +240,16 @@ let QueryFieldType = class QueryFieldType {
240
240
  QueryID;
241
241
  Name;
242
242
  Description;
243
- Type;
244
243
  Sequence;
245
244
  SQLBaseType;
246
245
  SQLFullType;
246
+ SourceEntityID;
247
+ SourceEntity;
248
+ SourceFieldName;
247
249
  IsComputed;
248
250
  ComputationDescription;
251
+ IsSummary;
252
+ SummaryDescription;
249
253
  };
250
254
  __decorate([
251
255
  Field(() => String),
@@ -263,10 +267,6 @@ __decorate([
263
267
  Field(() => String, { nullable: true }),
264
268
  __metadata("design:type", String)
265
269
  ], QueryFieldType.prototype, "Description", void 0);
266
- __decorate([
267
- Field(() => String, { nullable: true }),
268
- __metadata("design:type", String)
269
- ], QueryFieldType.prototype, "Type", void 0);
270
270
  __decorate([
271
271
  Field(() => Number),
272
272
  __metadata("design:type", Number)
@@ -279,6 +279,18 @@ __decorate([
279
279
  Field(() => String, { nullable: true }),
280
280
  __metadata("design:type", String)
281
281
  ], QueryFieldType.prototype, "SQLFullType", void 0);
282
+ __decorate([
283
+ Field(() => String, { nullable: true }),
284
+ __metadata("design:type", String)
285
+ ], QueryFieldType.prototype, "SourceEntityID", void 0);
286
+ __decorate([
287
+ Field(() => String, { nullable: true }),
288
+ __metadata("design:type", String)
289
+ ], QueryFieldType.prototype, "SourceEntity", void 0);
290
+ __decorate([
291
+ Field(() => String, { nullable: true }),
292
+ __metadata("design:type", String)
293
+ ], QueryFieldType.prototype, "SourceFieldName", void 0);
282
294
  __decorate([
283
295
  Field(() => Boolean),
284
296
  __metadata("design:type", Boolean)
@@ -287,6 +299,14 @@ __decorate([
287
299
  Field(() => String, { nullable: true }),
288
300
  __metadata("design:type", String)
289
301
  ], QueryFieldType.prototype, "ComputationDescription", void 0);
302
+ __decorate([
303
+ Field(() => Boolean, { nullable: true }),
304
+ __metadata("design:type", Boolean)
305
+ ], QueryFieldType.prototype, "IsSummary", void 0);
306
+ __decorate([
307
+ Field(() => String, { nullable: true }),
308
+ __metadata("design:type", String)
309
+ ], QueryFieldType.prototype, "SummaryDescription", void 0);
290
310
  QueryFieldType = __decorate([
291
311
  ObjectType()
292
312
  ], QueryFieldType);
@@ -295,10 +315,12 @@ let QueryParameterType = class QueryParameterType {
295
315
  ID;
296
316
  QueryID;
297
317
  Name;
318
+ Description;
298
319
  Type;
299
- DefaultValue;
300
- Comments;
301
320
  IsRequired;
321
+ DefaultValue;
322
+ SampleValue;
323
+ ValidationFilters;
302
324
  };
303
325
  __decorate([
304
326
  Field(() => String),
@@ -312,10 +334,18 @@ __decorate([
312
334
  Field(() => String),
313
335
  __metadata("design:type", String)
314
336
  ], QueryParameterType.prototype, "Name", void 0);
337
+ __decorate([
338
+ Field(() => String, { nullable: true }),
339
+ __metadata("design:type", String)
340
+ ], QueryParameterType.prototype, "Description", void 0);
315
341
  __decorate([
316
342
  Field(() => String),
317
343
  __metadata("design:type", String)
318
344
  ], QueryParameterType.prototype, "Type", void 0);
345
+ __decorate([
346
+ Field(() => Boolean),
347
+ __metadata("design:type", Boolean)
348
+ ], QueryParameterType.prototype, "IsRequired", void 0);
319
349
  __decorate([
320
350
  Field(() => String, { nullable: true }),
321
351
  __metadata("design:type", String)
@@ -323,11 +353,11 @@ __decorate([
323
353
  __decorate([
324
354
  Field(() => String, { nullable: true }),
325
355
  __metadata("design:type", String)
326
- ], QueryParameterType.prototype, "Comments", void 0);
356
+ ], QueryParameterType.prototype, "SampleValue", void 0);
327
357
  __decorate([
328
- Field(() => Boolean),
329
- __metadata("design:type", Boolean)
330
- ], QueryParameterType.prototype, "IsRequired", void 0);
358
+ Field(() => String, { nullable: true }),
359
+ __metadata("design:type", String)
360
+ ], QueryParameterType.prototype, "ValidationFilters", void 0);
331
361
  QueryParameterType = __decorate([
332
362
  ObjectType()
333
363
  ], QueryParameterType);
@@ -336,7 +366,7 @@ let QueryEntityType = class QueryEntityType {
336
366
  ID;
337
367
  QueryID;
338
368
  EntityID;
339
- EntityName;
369
+ Entity;
340
370
  };
341
371
  __decorate([
342
372
  Field(() => String),
@@ -353,7 +383,7 @@ __decorate([
353
383
  __decorate([
354
384
  Field(() => String, { nullable: true }),
355
385
  __metadata("design:type", String)
356
- ], QueryEntityType.prototype, "EntityName", void 0);
386
+ ], QueryEntityType.prototype, "Entity", void 0);
357
387
  QueryEntityType = __decorate([
358
388
  ObjectType()
359
389
  ], QueryEntityType);
@@ -362,7 +392,7 @@ let QueryPermissionType = class QueryPermissionType {
362
392
  ID;
363
393
  QueryID;
364
394
  RoleID;
365
- RoleName;
395
+ Role;
366
396
  };
367
397
  __decorate([
368
398
  Field(() => String),
@@ -379,7 +409,7 @@ __decorate([
379
409
  __decorate([
380
410
  Field(() => String, { nullable: true }),
381
411
  __metadata("design:type", String)
382
- ], QueryPermissionType.prototype, "RoleName", void 0);
412
+ ], QueryPermissionType.prototype, "Role", void 0);
383
413
  QueryPermissionType = __decorate([
384
414
  ObjectType()
385
415
  ], QueryPermissionType);
@@ -387,7 +417,17 @@ export { QueryPermissionType };
387
417
  let CreateQueryResultType = class CreateQueryResultType {
388
418
  Success;
389
419
  ErrorMessage;
390
- QueryData;
420
+ ID;
421
+ Name;
422
+ Description;
423
+ CategoryID;
424
+ Category;
425
+ SQL;
426
+ Status;
427
+ QualityRank;
428
+ EmbeddingVector;
429
+ EmbeddingModelID;
430
+ EmbeddingModelName;
391
431
  Fields;
392
432
  Parameters;
393
433
  Entities;
@@ -404,7 +444,47 @@ __decorate([
404
444
  __decorate([
405
445
  Field(() => String, { nullable: true }),
406
446
  __metadata("design:type", String)
407
- ], CreateQueryResultType.prototype, "QueryData", void 0);
447
+ ], CreateQueryResultType.prototype, "ID", void 0);
448
+ __decorate([
449
+ Field(() => String, { nullable: true }),
450
+ __metadata("design:type", String)
451
+ ], CreateQueryResultType.prototype, "Name", void 0);
452
+ __decorate([
453
+ Field(() => String, { nullable: true }),
454
+ __metadata("design:type", String)
455
+ ], CreateQueryResultType.prototype, "Description", void 0);
456
+ __decorate([
457
+ Field(() => String, { nullable: true }),
458
+ __metadata("design:type", String)
459
+ ], CreateQueryResultType.prototype, "CategoryID", void 0);
460
+ __decorate([
461
+ Field(() => String, { nullable: true }),
462
+ __metadata("design:type", String)
463
+ ], CreateQueryResultType.prototype, "Category", void 0);
464
+ __decorate([
465
+ Field(() => String, { nullable: true }),
466
+ __metadata("design:type", String)
467
+ ], CreateQueryResultType.prototype, "SQL", void 0);
468
+ __decorate([
469
+ Field(() => String, { nullable: true }),
470
+ __metadata("design:type", String)
471
+ ], CreateQueryResultType.prototype, "Status", void 0);
472
+ __decorate([
473
+ Field(() => Number, { nullable: true }),
474
+ __metadata("design:type", Number)
475
+ ], CreateQueryResultType.prototype, "QualityRank", void 0);
476
+ __decorate([
477
+ Field(() => String, { nullable: true }),
478
+ __metadata("design:type", String)
479
+ ], CreateQueryResultType.prototype, "EmbeddingVector", void 0);
480
+ __decorate([
481
+ Field(() => String, { nullable: true }),
482
+ __metadata("design:type", String)
483
+ ], CreateQueryResultType.prototype, "EmbeddingModelID", void 0);
484
+ __decorate([
485
+ Field(() => String, { nullable: true }),
486
+ __metadata("design:type", String)
487
+ ], CreateQueryResultType.prototype, "EmbeddingModelName", void 0);
408
488
  __decorate([
409
489
  Field(() => [QueryFieldType], { nullable: true }),
410
490
  __metadata("design:type", Array)
@@ -428,7 +508,17 @@ export { CreateQueryResultType };
428
508
  let UpdateQueryResultType = class UpdateQueryResultType {
429
509
  Success;
430
510
  ErrorMessage;
431
- QueryData;
511
+ ID;
512
+ Name;
513
+ Description;
514
+ CategoryID;
515
+ Category;
516
+ SQL;
517
+ Status;
518
+ QualityRank;
519
+ EmbeddingVector;
520
+ EmbeddingModelID;
521
+ EmbeddingModelName;
432
522
  Fields;
433
523
  Parameters;
434
524
  Entities;
@@ -445,7 +535,47 @@ __decorate([
445
535
  __decorate([
446
536
  Field(() => String, { nullable: true }),
447
537
  __metadata("design:type", String)
448
- ], UpdateQueryResultType.prototype, "QueryData", void 0);
538
+ ], UpdateQueryResultType.prototype, "ID", void 0);
539
+ __decorate([
540
+ Field(() => String, { nullable: true }),
541
+ __metadata("design:type", String)
542
+ ], UpdateQueryResultType.prototype, "Name", void 0);
543
+ __decorate([
544
+ Field(() => String, { nullable: true }),
545
+ __metadata("design:type", String)
546
+ ], UpdateQueryResultType.prototype, "Description", void 0);
547
+ __decorate([
548
+ Field(() => String, { nullable: true }),
549
+ __metadata("design:type", String)
550
+ ], UpdateQueryResultType.prototype, "CategoryID", void 0);
551
+ __decorate([
552
+ Field(() => String, { nullable: true }),
553
+ __metadata("design:type", String)
554
+ ], UpdateQueryResultType.prototype, "Category", void 0);
555
+ __decorate([
556
+ Field(() => String, { nullable: true }),
557
+ __metadata("design:type", String)
558
+ ], UpdateQueryResultType.prototype, "SQL", void 0);
559
+ __decorate([
560
+ Field(() => String, { nullable: true }),
561
+ __metadata("design:type", String)
562
+ ], UpdateQueryResultType.prototype, "Status", void 0);
563
+ __decorate([
564
+ Field(() => Number, { nullable: true }),
565
+ __metadata("design:type", Number)
566
+ ], UpdateQueryResultType.prototype, "QualityRank", void 0);
567
+ __decorate([
568
+ Field(() => String, { nullable: true }),
569
+ __metadata("design:type", String)
570
+ ], UpdateQueryResultType.prototype, "EmbeddingVector", void 0);
571
+ __decorate([
572
+ Field(() => String, { nullable: true }),
573
+ __metadata("design:type", String)
574
+ ], UpdateQueryResultType.prototype, "EmbeddingModelID", void 0);
575
+ __decorate([
576
+ Field(() => String, { nullable: true }),
577
+ __metadata("design:type", String)
578
+ ], UpdateQueryResultType.prototype, "EmbeddingModelName", void 0);
449
579
  __decorate([
450
580
  Field(() => [QueryFieldType], { nullable: true }),
451
581
  __metadata("design:type", Array)
@@ -469,7 +599,12 @@ export { UpdateQueryResultType };
469
599
  let DeleteQueryResultType = class DeleteQueryResultType {
470
600
  Success;
471
601
  ErrorMessage;
472
- QueryData;
602
+ ID;
603
+ Name;
604
+ Description;
605
+ CategoryID;
606
+ SQL;
607
+ Status;
473
608
  };
474
609
  __decorate([
475
610
  Field(() => Boolean),
@@ -482,7 +617,27 @@ __decorate([
482
617
  __decorate([
483
618
  Field(() => String, { nullable: true }),
484
619
  __metadata("design:type", String)
485
- ], DeleteQueryResultType.prototype, "QueryData", void 0);
620
+ ], DeleteQueryResultType.prototype, "ID", void 0);
621
+ __decorate([
622
+ Field(() => String, { nullable: true }),
623
+ __metadata("design:type", String)
624
+ ], DeleteQueryResultType.prototype, "Name", void 0);
625
+ __decorate([
626
+ Field(() => String, { nullable: true }),
627
+ __metadata("design:type", String)
628
+ ], DeleteQueryResultType.prototype, "Description", void 0);
629
+ __decorate([
630
+ Field(() => String, { nullable: true }),
631
+ __metadata("design:type", String)
632
+ ], DeleteQueryResultType.prototype, "CategoryID", void 0);
633
+ __decorate([
634
+ Field(() => String, { nullable: true }),
635
+ __metadata("design:type", String)
636
+ ], DeleteQueryResultType.prototype, "SQL", void 0);
637
+ __decorate([
638
+ Field(() => String, { nullable: true }),
639
+ __metadata("design:type", String)
640
+ ], DeleteQueryResultType.prototype, "Status", void 0);
486
641
  DeleteQueryResultType = __decorate([
487
642
  ObjectType()
488
643
  ], DeleteQueryResultType);
@@ -530,16 +685,56 @@ let MJQueryResolverExtended = class MJQueryResolverExtended extends MJQueryResol
530
685
  await provider.Refresh();
531
686
  return {
532
687
  Success: true,
533
- QueryData: JSON.stringify(record.GetAll()),
534
- Fields: record.QueryFields,
535
- Parameters: record.QueryParameters,
536
- Entities: record.QueryEntities.map(e => {
537
- return {
538
- ...e,
539
- EntityName: e.Entity
540
- };
541
- }),
542
- Permissions: record.QueryPermissions
688
+ ID: record.ID,
689
+ Name: record.Name,
690
+ Description: record.Description,
691
+ CategoryID: record.CategoryID,
692
+ Category: record.Category,
693
+ SQL: record.SQL,
694
+ Status: record.Status,
695
+ QualityRank: record.QualityRank,
696
+ EmbeddingVector: record.EmbeddingVector,
697
+ EmbeddingModelID: record.EmbeddingModelID,
698
+ EmbeddingModelName: record.EmbeddingModel,
699
+ Fields: record.QueryFields.map(f => ({
700
+ ID: f.ID,
701
+ QueryID: f.QueryID,
702
+ Name: f.Name,
703
+ Description: f.Description,
704
+ Sequence: f.Sequence,
705
+ SQLBaseType: f.SQLBaseType,
706
+ SQLFullType: f.SQLFullType,
707
+ SourceEntityID: f.SourceEntityID,
708
+ SourceEntity: f.SourceEntity,
709
+ SourceFieldName: f.SourceFieldName,
710
+ IsComputed: f.IsComputed,
711
+ ComputationDescription: f.ComputationDescription,
712
+ IsSummary: f.IsSummary,
713
+ SummaryDescription: f.SummaryDescription
714
+ })),
715
+ Parameters: record.QueryParameters.map(p => ({
716
+ ID: p.ID,
717
+ QueryID: p.QueryID,
718
+ Name: p.Name,
719
+ Description: p.Description,
720
+ Type: p.Type,
721
+ IsRequired: p.IsRequired,
722
+ DefaultValue: p.DefaultValue,
723
+ SampleValue: p.SampleValue,
724
+ ValidationFilters: p.ValidationFilters
725
+ })),
726
+ Entities: record.QueryEntities.map(e => ({
727
+ ID: e.ID,
728
+ QueryID: e.QueryID,
729
+ EntityID: e.EntityID,
730
+ Entity: e.Entity
731
+ })),
732
+ Permissions: record.QueryPermissions.map(p => ({
733
+ ID: p.ID,
734
+ QueryID: p.QueryID,
735
+ RoleID: p.RoleID,
736
+ Role: p.Role
737
+ }))
543
738
  };
544
739
  }
545
740
  else {
@@ -548,16 +743,56 @@ let MJQueryResolverExtended = class MJQueryResolverExtended extends MJQueryResol
548
743
  LogStatus(`[CreateQuery] Unique constraint detected for query '${input.Name}'. Using existing query (ID: ${existingQuery.ID}) created by concurrent request.`);
549
744
  return {
550
745
  Success: true,
551
- QueryData: JSON.stringify(existingQuery),
552
- Fields: existingQuery.Fields || [],
553
- Parameters: existingQuery.Parameters || [],
554
- Entities: existingQuery.Entities?.map(e => ({
746
+ ID: existingQuery.ID,
747
+ Name: existingQuery.Name,
748
+ Description: existingQuery.Description,
749
+ CategoryID: existingQuery.CategoryID,
750
+ Category: existingQuery.Category,
751
+ SQL: existingQuery.SQL,
752
+ Status: existingQuery.Status,
753
+ QualityRank: existingQuery.QualityRank,
754
+ EmbeddingVector: existingQuery.EmbeddingVector,
755
+ EmbeddingModelID: existingQuery.EmbeddingModelID,
756
+ EmbeddingModelName: existingQuery.EmbeddingModel,
757
+ Fields: existingQuery.Fields?.map((f) => ({
758
+ ID: f.ID,
759
+ QueryID: f.QueryID,
760
+ Name: f.Name,
761
+ Description: f.Description,
762
+ Sequence: f.Sequence,
763
+ SQLBaseType: f.SQLBaseType,
764
+ SQLFullType: f.SQLFullType,
765
+ SourceEntityID: f.SourceEntityID,
766
+ SourceEntity: f.SourceEntity,
767
+ SourceFieldName: f.SourceFieldName,
768
+ IsComputed: f.IsComputed,
769
+ ComputationDescription: f.ComputationDescription,
770
+ IsSummary: f.IsSummary,
771
+ SummaryDescription: f.SummaryDescription
772
+ })) || [],
773
+ Parameters: existingQuery.Parameters?.map((p) => ({
774
+ ID: p.ID,
775
+ QueryID: p.QueryID,
776
+ Name: p.Name,
777
+ Description: p.Description,
778
+ Type: p.Type,
779
+ IsRequired: p.IsRequired,
780
+ DefaultValue: p.DefaultValue,
781
+ SampleValue: p.SampleValue,
782
+ ValidationFilters: p.ValidationFilters
783
+ })) || [],
784
+ Entities: existingQuery.Entities?.map((e) => ({
555
785
  ID: e.ID,
556
786
  QueryID: e.QueryID,
557
787
  EntityID: e.EntityID,
558
- EntityName: e.Entity
788
+ Entity: e.Entity
559
789
  })) || [],
560
- Permissions: existingQuery.Permissions || []
790
+ Permissions: existingQuery.Permissions?.map((p) => ({
791
+ ID: p.ID,
792
+ QueryID: p.QueryID,
793
+ RoleID: p.RoleID,
794
+ Role: p.Role
795
+ })) || []
561
796
  };
562
797
  }
563
798
  const errorMessage = record.LatestResult?.Message || '';
@@ -589,7 +824,7 @@ let MJQueryResolverExtended = class MJQueryResolverExtended extends MJQueryResol
589
824
  ID: permissionEntity.ID,
590
825
  QueryID: permissionEntity.QueryID,
591
826
  RoleID: permissionEntity.RoleID,
592
- RoleName: permissionEntity.Role
827
+ Role: permissionEntity.Role
593
828
  });
594
829
  }
595
830
  }
@@ -678,46 +913,58 @@ let MJQueryResolverExtended = class MJQueryResolverExtended extends MJQueryResol
678
913
  await this.createPermissions(provider, input.Permissions, queryID, context.userPayload.userRecord);
679
914
  await queryEntity.RefreshRelatedMetadata(true);
680
915
  }
681
- const fields = queryEntity.QueryFields.map(f => ({
682
- ID: f.ID,
683
- QueryID: f.QueryID,
684
- Name: f.Name,
685
- Description: f.Description || undefined,
686
- Type: f.SQLBaseType || undefined,
687
- Sequence: f.Sequence,
688
- SQLBaseType: f.SQLBaseType || undefined,
689
- SQLFullType: f.SQLFullType || undefined,
690
- IsComputed: f.IsComputed,
691
- ComputationDescription: f.ComputationDescription || undefined
692
- }));
693
- const parameters = queryEntity.QueryParameters.map(p => ({
694
- ID: p.ID,
695
- QueryID: p.QueryID,
696
- Name: p.Name,
697
- Type: p.Type,
698
- DefaultValue: p.DefaultValue || undefined,
699
- Comments: '',
700
- IsRequired: p.IsRequired
701
- }));
702
- const entities = queryEntity.QueryEntities.map(e => ({
703
- ID: e.ID,
704
- QueryID: e.QueryID,
705
- EntityID: e.EntityID,
706
- EntityName: e.Entity || undefined
707
- }));
708
- const permissions = queryEntity.QueryPermissions.map(p => ({
709
- ID: p.ID,
710
- QueryID: p.QueryID,
711
- RoleID: p.RoleID,
712
- RoleName: p.Role || undefined
713
- }));
714
916
  return {
715
917
  Success: true,
716
- QueryData: JSON.stringify(queryEntity.GetAll()),
717
- Fields: fields,
718
- Parameters: parameters,
719
- Entities: entities,
720
- Permissions: permissions
918
+ ID: queryEntity.ID,
919
+ Name: queryEntity.Name,
920
+ Description: queryEntity.Description,
921
+ CategoryID: queryEntity.CategoryID,
922
+ Category: queryEntity.Category,
923
+ SQL: queryEntity.SQL,
924
+ Status: queryEntity.Status,
925
+ QualityRank: queryEntity.QualityRank,
926
+ EmbeddingVector: queryEntity.EmbeddingVector,
927
+ EmbeddingModelID: queryEntity.EmbeddingModelID,
928
+ EmbeddingModelName: queryEntity.EmbeddingModel,
929
+ Fields: queryEntity.QueryFields.map(f => ({
930
+ ID: f.ID,
931
+ QueryID: f.QueryID,
932
+ Name: f.Name,
933
+ Description: f.Description,
934
+ Sequence: f.Sequence,
935
+ SQLBaseType: f.SQLBaseType,
936
+ SQLFullType: f.SQLFullType,
937
+ SourceEntityID: f.SourceEntityID,
938
+ SourceEntity: f.SourceEntity,
939
+ SourceFieldName: f.SourceFieldName,
940
+ IsComputed: f.IsComputed,
941
+ ComputationDescription: f.ComputationDescription,
942
+ IsSummary: f.IsSummary,
943
+ SummaryDescription: f.SummaryDescription
944
+ })),
945
+ Parameters: queryEntity.QueryParameters.map(p => ({
946
+ ID: p.ID,
947
+ QueryID: p.QueryID,
948
+ Name: p.Name,
949
+ Description: p.Description,
950
+ Type: p.Type,
951
+ IsRequired: p.IsRequired,
952
+ DefaultValue: p.DefaultValue,
953
+ SampleValue: p.SampleValue,
954
+ ValidationFilters: p.ValidationFilters
955
+ })),
956
+ Entities: queryEntity.QueryEntities.map(e => ({
957
+ ID: e.ID,
958
+ QueryID: e.QueryID,
959
+ EntityID: e.EntityID,
960
+ Entity: e.Entity
961
+ })),
962
+ Permissions: queryEntity.QueryPermissions.map(p => ({
963
+ ID: p.ID,
964
+ QueryID: p.QueryID,
965
+ RoleID: p.RoleID,
966
+ Role: p.Role
967
+ }))
721
968
  };
722
969
  }
723
970
  catch (err) {
@@ -746,7 +993,12 @@ let MJQueryResolverExtended = class MJQueryResolverExtended extends MJQueryResol
746
993
  if (deletedQuery) {
747
994
  return {
748
995
  Success: true,
749
- QueryData: JSON.stringify(deletedQuery)
996
+ ID: deletedQuery.ID,
997
+ Name: deletedQuery.Name,
998
+ Description: deletedQuery.Description,
999
+ CategoryID: deletedQuery.CategoryID,
1000
+ SQL: deletedQuery.SQL,
1001
+ Status: deletedQuery.Status
750
1002
  };
751
1003
  }
752
1004
  else {