@greensecurity/javascript-sdk 0.12.0 → 0.13.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 (37) hide show
  1. package/bin/mcp-server.js +196 -48
  2. package/bin/mcp-server.js.map +11 -10
  3. package/jsr.json +1 -1
  4. package/lib/config.d.ts +3 -3
  5. package/lib/config.js +3 -3
  6. package/mcp-server/mcp-server.js +1 -1
  7. package/mcp-server/server.js +1 -1
  8. package/models/components/company.d.ts +177 -0
  9. package/models/components/company.d.ts.map +1 -0
  10. package/models/components/company.js +270 -0
  11. package/models/components/company.js.map +1 -0
  12. package/models/components/facility.d.ts +15 -15
  13. package/models/components/facility.d.ts.map +1 -1
  14. package/models/components/facility.js +18 -18
  15. package/models/components/facility.js.map +1 -1
  16. package/models/components/index.d.ts +1 -0
  17. package/models/components/index.d.ts.map +1 -1
  18. package/models/components/index.js +1 -0
  19. package/models/components/index.js.map +1 -1
  20. package/models/components/user.d.ts +6 -0
  21. package/models/components/user.d.ts.map +1 -1
  22. package/models/components/user.js +3 -0
  23. package/models/components/user.js.map +1 -1
  24. package/package.json +1 -5
  25. package/src/lib/config.ts +3 -3
  26. package/src/mcp-server/mcp-server.ts +1 -1
  27. package/src/mcp-server/server.ts +1 -1
  28. package/src/models/components/company.ts +403 -0
  29. package/src/models/components/facility.ts +28 -24
  30. package/src/models/components/index.ts +1 -0
  31. package/src/models/components/user.ts +13 -0
  32. package/src/__tests__/assertions.ts +0 -13
  33. package/src/__tests__/files.ts +0 -56
  34. package/src/__tests__/organizations.test.ts +0 -244
  35. package/src/__tests__/testclient.ts +0 -48
  36. package/src/__tests__/user.test.ts +0 -200
  37. package/src/__tests__/vendors.test.ts +0 -65
package/bin/mcp-server.js CHANGED
@@ -34172,9 +34172,9 @@ var init_config = __esm(() => {
34172
34172
  SDK_METADATA = {
34173
34173
  language: "typescript",
34174
34174
  openapiDocVersion: "0.0.3",
34175
- sdkVersion: "0.12.0",
34176
- genVersion: "2.529.2",
34177
- userAgent: "speakeasy-sdk/typescript 0.12.0 2.529.2 0.0.3 @greensecurity/javascript-sdk"
34175
+ sdkVersion: "0.13.0",
34176
+ genVersion: "2.533.0",
34177
+ userAgent: "speakeasy-sdk/typescript 0.13.0 2.533.0 0.0.3 @greensecurity/javascript-sdk"
34178
34178
  };
34179
34179
  });
34180
34180
 
@@ -35490,6 +35490,181 @@ var init_security = __esm(() => {
35490
35490
  };
35491
35491
  });
35492
35492
 
35493
+ // src/types/rfcdate.ts
35494
+ class RFCDate {
35495
+ serialized;
35496
+ static today() {
35497
+ return new RFCDate(new Date);
35498
+ }
35499
+ constructor(date2) {
35500
+ if (typeof date2 === "string" && !dateRE.test(date2)) {
35501
+ throw new RangeError("RFCDate: date strings must be in the format YYYY-MM-DD: " + date2);
35502
+ }
35503
+ const value = new Date(date2);
35504
+ if (isNaN(+value)) {
35505
+ throw new RangeError("RFCDate: invalid date provided: " + date2);
35506
+ }
35507
+ this.serialized = value.toISOString().slice(0, "YYYY-MM-DD".length);
35508
+ if (!dateRE.test(this.serialized)) {
35509
+ throw new TypeError(`RFCDate: failed to build valid date with given value: ${date2} serialized to ${this.serialized}`);
35510
+ }
35511
+ }
35512
+ toJSON() {
35513
+ return this.toString();
35514
+ }
35515
+ toString() {
35516
+ return this.serialized;
35517
+ }
35518
+ }
35519
+ var dateRE;
35520
+ var init_rfcdate = __esm(() => {
35521
+ dateRE = /^\d{4}-\d{2}-\d{2}$/;
35522
+ });
35523
+
35524
+ // src/models/components/company.ts
35525
+ var Location$inboundSchema, Location$outboundSchema, Location$, CompanyContact$inboundSchema, CompanyContact$outboundSchema, CompanyContact$, Tax$inboundSchema, Tax$outboundSchema, Tax$, Stats$inboundSchema, Stats$outboundSchema, Stats$, Company$inboundSchema, Company$outboundSchema, Company$;
35526
+ var init_company = __esm(() => {
35527
+ init_lib();
35528
+ init_primitives();
35529
+ init_rfcdate();
35530
+ Location$inboundSchema = objectType({
35531
+ address: nullableType(stringType()),
35532
+ phone: nullableType(stringType()).optional(),
35533
+ city: nullableType(stringType()).optional(),
35534
+ state: nullableType(stringType()).optional(),
35535
+ zip: nullableType(stringType()).optional(),
35536
+ country: nullableType(stringType()).optional()
35537
+ });
35538
+ Location$outboundSchema = objectType({
35539
+ address: nullableType(stringType()),
35540
+ phone: nullableType(stringType()).optional(),
35541
+ city: nullableType(stringType()).optional(),
35542
+ state: nullableType(stringType()).optional(),
35543
+ zip: nullableType(stringType()).optional(),
35544
+ country: nullableType(stringType()).optional()
35545
+ });
35546
+ ((Location$) => {
35547
+ Location$.inboundSchema = Location$inboundSchema;
35548
+ Location$.outboundSchema = Location$outboundSchema;
35549
+ })(Location$ ||= {});
35550
+ CompanyContact$inboundSchema = objectType({
35551
+ name: nullableType(stringType()),
35552
+ email: nullableType(stringType()).optional()
35553
+ });
35554
+ CompanyContact$outboundSchema = objectType({
35555
+ name: nullableType(stringType()),
35556
+ email: nullableType(stringType()).optional()
35557
+ });
35558
+ ((CompanyContact$) => {
35559
+ CompanyContact$.inboundSchema = CompanyContact$inboundSchema;
35560
+ CompanyContact$.outboundSchema = CompanyContact$outboundSchema;
35561
+ })(CompanyContact$ ||= {});
35562
+ Tax$inboundSchema = objectType({
35563
+ tax_id: nullableType(stringType()),
35564
+ tax_exempt: nullableType(booleanType()).optional(),
35565
+ tax_exempt_code: nullableType(stringType()).optional(),
35566
+ w9_file_name: nullableType(stringType()).optional(),
35567
+ w9_content_type: nullableType(stringType()).optional(),
35568
+ w9_file_size: nullableType(stringType()).optional(),
35569
+ w9_updated_at: nullableType(stringType().transform((v2) => new RFCDate(v2))).optional()
35570
+ }).transform((v2) => {
35571
+ return remap(v2, {
35572
+ tax_id: "taxId",
35573
+ tax_exempt: "taxExempt",
35574
+ tax_exempt_code: "taxExemptCode",
35575
+ w9_file_name: "w9FileName",
35576
+ w9_content_type: "w9ContentType",
35577
+ w9_file_size: "w9FileSize",
35578
+ w9_updated_at: "w9UpdatedAt"
35579
+ });
35580
+ });
35581
+ Tax$outboundSchema = objectType({
35582
+ taxId: nullableType(stringType()),
35583
+ taxExempt: nullableType(booleanType()).optional(),
35584
+ taxExemptCode: nullableType(stringType()).optional(),
35585
+ w9FileName: nullableType(stringType()).optional(),
35586
+ w9ContentType: nullableType(stringType()).optional(),
35587
+ w9FileSize: nullableType(stringType()).optional(),
35588
+ w9UpdatedAt: nullableType(instanceOfType(RFCDate).transform((v2) => v2.toString())).optional()
35589
+ }).transform((v2) => {
35590
+ return remap(v2, {
35591
+ taxId: "tax_id",
35592
+ taxExempt: "tax_exempt",
35593
+ taxExemptCode: "tax_exempt_code",
35594
+ w9FileName: "w9_file_name",
35595
+ w9ContentType: "w9_content_type",
35596
+ w9FileSize: "w9_file_size",
35597
+ w9UpdatedAt: "w9_updated_at"
35598
+ });
35599
+ });
35600
+ ((Tax$) => {
35601
+ Tax$.inboundSchema = Tax$inboundSchema;
35602
+ Tax$.outboundSchema = Tax$outboundSchema;
35603
+ })(Tax$ ||= {});
35604
+ Stats$inboundSchema = objectType({
35605
+ vendor_inactive_count: nullableType(numberType().int()).optional(),
35606
+ vendor_active_count: nullableType(numberType().int()).optional(),
35607
+ facility_targeted_count: nullableType(numberType().int()).optional(),
35608
+ facility_approved_count: nullableType(numberType().int()).optional()
35609
+ }).transform((v2) => {
35610
+ return remap(v2, {
35611
+ vendor_inactive_count: "vendorInactiveCount",
35612
+ vendor_active_count: "vendorActiveCount",
35613
+ facility_targeted_count: "facilityTargetedCount",
35614
+ facility_approved_count: "facilityApprovedCount"
35615
+ });
35616
+ });
35617
+ Stats$outboundSchema = objectType({
35618
+ vendorInactiveCount: nullableType(numberType().int()).optional(),
35619
+ vendorActiveCount: nullableType(numberType().int()).optional(),
35620
+ facilityTargetedCount: nullableType(numberType().int()).optional(),
35621
+ facilityApprovedCount: nullableType(numberType().int()).optional()
35622
+ }).transform((v2) => {
35623
+ return remap(v2, {
35624
+ vendorInactiveCount: "vendor_inactive_count",
35625
+ vendorActiveCount: "vendor_active_count",
35626
+ facilityTargetedCount: "facility_targeted_count",
35627
+ facilityApprovedCount: "facility_approved_count"
35628
+ });
35629
+ });
35630
+ ((Stats$) => {
35631
+ Stats$.inboundSchema = Stats$inboundSchema;
35632
+ Stats$.outboundSchema = Stats$outboundSchema;
35633
+ })(Stats$ ||= {});
35634
+ Company$inboundSchema = objectType({
35635
+ id: numberType().int(),
35636
+ name: nullableType(stringType()),
35637
+ status: nullableType(stringType()).optional(),
35638
+ credit_balance: nullableType(stringType()).optional(),
35639
+ location: nullableType(lazyType(() => Location$inboundSchema)).optional(),
35640
+ contact: lazyType(() => CompanyContact$inboundSchema).optional(),
35641
+ tax: lazyType(() => Tax$inboundSchema).optional(),
35642
+ stats: lazyType(() => Stats$inboundSchema).optional()
35643
+ }).transform((v2) => {
35644
+ return remap(v2, {
35645
+ credit_balance: "creditBalance"
35646
+ });
35647
+ });
35648
+ Company$outboundSchema = objectType({
35649
+ id: numberType().int(),
35650
+ name: nullableType(stringType()),
35651
+ status: nullableType(stringType()).optional(),
35652
+ creditBalance: nullableType(stringType()).optional(),
35653
+ location: nullableType(lazyType(() => Location$outboundSchema)).optional(),
35654
+ contact: lazyType(() => CompanyContact$outboundSchema).optional(),
35655
+ tax: lazyType(() => Tax$outboundSchema).optional(),
35656
+ stats: lazyType(() => Stats$outboundSchema).optional()
35657
+ }).transform((v2) => {
35658
+ return remap(v2, {
35659
+ creditBalance: "credit_balance"
35660
+ });
35661
+ });
35662
+ ((Company$) => {
35663
+ Company$.inboundSchema = Company$inboundSchema;
35664
+ Company$.outboundSchema = Company$outboundSchema;
35665
+ })(Company$ ||= {});
35666
+ });
35667
+
35493
35668
  // src/models/components/departmentsummary.ts
35494
35669
  var DepartmentSummary$inboundSchema, DepartmentSummary$outboundSchema, DepartmentSummary$;
35495
35670
  var init_departmentsummary = __esm(() => {
@@ -35643,37 +35818,6 @@ var init_expand = __esm(() => {
35643
35818
  })(Expand$ ||= {});
35644
35819
  });
35645
35820
 
35646
- // src/types/rfcdate.ts
35647
- class RFCDate {
35648
- serialized;
35649
- static today() {
35650
- return new RFCDate(new Date);
35651
- }
35652
- constructor(date2) {
35653
- if (typeof date2 === "string" && !dateRE.test(date2)) {
35654
- throw new RangeError("RFCDate: date strings must be in the format YYYY-MM-DD: " + date2);
35655
- }
35656
- const value = new Date(date2);
35657
- if (isNaN(+value)) {
35658
- throw new RangeError("RFCDate: invalid date provided: " + date2);
35659
- }
35660
- this.serialized = value.toISOString().slice(0, "YYYY-MM-DD".length);
35661
- if (!dateRE.test(this.serialized)) {
35662
- throw new TypeError(`RFCDate: failed to build valid date with given value: ${date2} serialized to ${this.serialized}`);
35663
- }
35664
- }
35665
- toJSON() {
35666
- return this.toString();
35667
- }
35668
- toString() {
35669
- return this.serialized;
35670
- }
35671
- }
35672
- var dateRE;
35673
- var init_rfcdate = __esm(() => {
35674
- dateRE = /^\d{4}-\d{2}-\d{2}$/;
35675
- });
35676
-
35677
35821
  // src/models/components/imageset.ts
35678
35822
  var ImageSet$inboundSchema, ImageSet$outboundSchema, ImageSet$;
35679
35823
  var init_imageset = __esm(() => {
@@ -35762,7 +35906,7 @@ var init_vendortype = __esm(() => {
35762
35906
  });
35763
35907
 
35764
35908
  // src/models/components/facility.ts
35765
- var VendorGuestLimitAndOr, AppointmentPolicy$inboundSchema, AppointmentPolicy$outboundSchema, AppointmentPolicy$, Contacts$inboundSchema, Contacts$outboundSchema, Contacts$, VendorCounts$inboundSchema, VendorCounts$outboundSchema, VendorCounts$, FacilityFluCredential$inboundSchema, FacilityFluCredential$outboundSchema, FacilityFluCredential$, FluCredential$inboundSchema, FluCredential$outboundSchema, FluCredential$, Location$inboundSchema, Location$outboundSchema, Location$, ScrubsPolicy$inboundSchema, ScrubsPolicy$outboundSchema, ScrubsPolicy$, FacilitySystem$inboundSchema, FacilitySystem$outboundSchema, FacilitySystem$, Uses$inboundSchema, Uses$outboundSchema, Uses$, VendorGuestLimitAndOr$inboundSchema, VendorGuestLimitAndOr$outboundSchema, VendorGuestLimitAndOr$, VendorGuestPolicy$inboundSchema, VendorGuestPolicy$outboundSchema, VendorGuestPolicy$, VendorPolicy$inboundSchema, VendorPolicy$outboundSchema, VendorPolicy$, VisitorPolicy$inboundSchema, VisitorPolicy$outboundSchema, VisitorPolicy$, WorkflowPolicy$inboundSchema, WorkflowPolicy$outboundSchema, WorkflowPolicy$, Facility$inboundSchema, Facility$outboundSchema, Facility$;
35909
+ var VendorGuestLimitAndOr, AppointmentPolicy$inboundSchema, AppointmentPolicy$outboundSchema, AppointmentPolicy$, Contacts$inboundSchema, Contacts$outboundSchema, Contacts$, VendorCounts$inboundSchema, VendorCounts$outboundSchema, VendorCounts$, FacilityFluCredential$inboundSchema, FacilityFluCredential$outboundSchema, FacilityFluCredential$, FluCredential$inboundSchema, FluCredential$outboundSchema, FluCredential$, FacilityLocation$inboundSchema, FacilityLocation$outboundSchema, FacilityLocation$, ScrubsPolicy$inboundSchema, ScrubsPolicy$outboundSchema, ScrubsPolicy$, FacilitySystem$inboundSchema, FacilitySystem$outboundSchema, FacilitySystem$, Uses$inboundSchema, Uses$outboundSchema, Uses$, VendorGuestLimitAndOr$inboundSchema, VendorGuestLimitAndOr$outboundSchema, VendorGuestLimitAndOr$, VendorGuestPolicy$inboundSchema, VendorGuestPolicy$outboundSchema, VendorGuestPolicy$, VendorPolicy$inboundSchema, VendorPolicy$outboundSchema, VendorPolicy$, VisitorPolicy$inboundSchema, VisitorPolicy$outboundSchema, VisitorPolicy$, WorkflowPolicy$inboundSchema, WorkflowPolicy$outboundSchema, WorkflowPolicy$, Facility$inboundSchema, Facility$outboundSchema, Facility$;
35766
35910
  var init_facility = __esm(() => {
35767
35911
  init_lib();
35768
35912
  init_primitives();
@@ -35927,7 +36071,7 @@ var init_facility = __esm(() => {
35927
36071
  FluCredential$.inboundSchema = FluCredential$inboundSchema;
35928
36072
  FluCredential$.outboundSchema = FluCredential$outboundSchema;
35929
36073
  })(FluCredential$ ||= {});
35930
- Location$inboundSchema = objectType({
36074
+ FacilityLocation$inboundSchema = objectType({
35931
36075
  street_address: nullableType(stringType()).optional(),
35932
36076
  city: nullableType(stringType()).optional(),
35933
36077
  state: nullableType(stringType()).optional(),
@@ -35944,7 +36088,7 @@ var init_facility = __esm(() => {
35944
36088
  utc_offset: "utcOffset"
35945
36089
  });
35946
36090
  });
35947
- Location$outboundSchema = objectType({
36091
+ FacilityLocation$outboundSchema = objectType({
35948
36092
  streetAddress: nullableType(stringType()).optional(),
35949
36093
  city: nullableType(stringType()).optional(),
35950
36094
  state: nullableType(stringType()).optional(),
@@ -35961,10 +36105,10 @@ var init_facility = __esm(() => {
35961
36105
  utcOffset: "utc_offset"
35962
36106
  });
35963
36107
  });
35964
- ((Location$) => {
35965
- Location$.inboundSchema = Location$inboundSchema;
35966
- Location$.outboundSchema = Location$outboundSchema;
35967
- })(Location$ ||= {});
36108
+ ((FacilityLocation$) => {
36109
+ FacilityLocation$.inboundSchema = FacilityLocation$inboundSchema;
36110
+ FacilityLocation$.outboundSchema = FacilityLocation$outboundSchema;
36111
+ })(FacilityLocation$ ||= {});
35968
36112
  ScrubsPolicy$inboundSchema = objectType({
35969
36113
  unlimited_scrubs: booleanType().optional(),
35970
36114
  scrub_debits_per_day: numberType().int().optional(),
@@ -36184,7 +36328,7 @@ var init_facility = __esm(() => {
36184
36328
  flu_credential: lazyType(() => FluCredential$inboundSchema).optional(),
36185
36329
  id: numberType().int().optional(),
36186
36330
  image_urls: ImageSet$inboundSchema.optional(),
36187
- location: lazyType(() => Location$inboundSchema).optional(),
36331
+ location: lazyType(() => FacilityLocation$inboundSchema).optional(),
36188
36332
  name: stringType().optional(),
36189
36333
  scrubs_policy: nullableType(lazyType(() => ScrubsPolicy$inboundSchema)).optional(),
36190
36334
  status: stringType().optional(),
@@ -36219,7 +36363,7 @@ var init_facility = __esm(() => {
36219
36363
  fluCredential: lazyType(() => FluCredential$outboundSchema).optional(),
36220
36364
  id: numberType().int().optional(),
36221
36365
  imageUrls: ImageSet$outboundSchema.optional(),
36222
- location: lazyType(() => Location$outboundSchema).optional(),
36366
+ location: lazyType(() => FacilityLocation$outboundSchema).optional(),
36223
36367
  name: stringType().optional(),
36224
36368
  scrubsPolicy: nullableType(lazyType(() => ScrubsPolicy$outboundSchema)).optional(),
36225
36369
  status: stringType().optional(),
@@ -36526,6 +36670,7 @@ var UserType, TokenType, UserType$inboundSchema, UserType$outboundSchema, UserTy
36526
36670
  var init_user = __esm(() => {
36527
36671
  init_lib();
36528
36672
  init_primitives();
36673
+ init_company();
36529
36674
  init_contact();
36530
36675
  init_imageset();
36531
36676
  UserType = {
@@ -36632,7 +36777,8 @@ var init_user = __esm(() => {
36632
36777
  user_token: lazyType(() => UserToken$inboundSchema),
36633
36778
  vendor: lazyType(() => Vendor$inboundSchema).optional(),
36634
36779
  inventory_manager: lazyType(() => InventoryManager$inboundSchema).optional(),
36635
- contact: Contact$inboundSchema.optional()
36780
+ contact: Contact$inboundSchema.optional(),
36781
+ company: Company$inboundSchema.optional()
36636
36782
  }).transform((v2) => {
36637
36783
  return remap(v2, {
36638
36784
  is_gatekeeper: "isGatekeeper",
@@ -36647,7 +36793,8 @@ var init_user = __esm(() => {
36647
36793
  userToken: lazyType(() => UserToken$outboundSchema),
36648
36794
  vendor: lazyType(() => Vendor$outboundSchema).optional(),
36649
36795
  inventoryManager: lazyType(() => InventoryManager$outboundSchema).optional(),
36650
- contact: Contact$outboundSchema.optional()
36796
+ contact: Contact$outboundSchema.optional(),
36797
+ company: Company$outboundSchema.optional()
36651
36798
  }).transform((v2) => {
36652
36799
  return remap(v2, {
36653
36800
  isGatekeeper: "is_gatekeeper",
@@ -36681,6 +36828,7 @@ var init_vendorjobtitle = __esm(() => {
36681
36828
 
36682
36829
  // src/models/components/index.ts
36683
36830
  var init_components = __esm(() => {
36831
+ init_company();
36684
36832
  init_contact();
36685
36833
  init_departmentsummary();
36686
36834
  init_desc();
@@ -38195,7 +38343,7 @@ List valid job titles for Vendors. This can be used during sign up or in a filte
38195
38343
  function createMCPServer(deps) {
38196
38344
  const server = new McpServer({
38197
38345
  name: "GreenSecurity",
38198
- version: "0.12.0"
38346
+ version: "0.13.0"
38199
38347
  });
38200
38348
  const client = new GreenSecurityCore({
38201
38349
  security: deps.security,
@@ -39417,7 +39565,7 @@ var routes = rn({
39417
39565
  var app = Ve(routes, {
39418
39566
  name: "mcp",
39419
39567
  versionInfo: {
39420
- currentVersion: "0.12.0"
39568
+ currentVersion: "0.13.0"
39421
39569
  }
39422
39570
  });
39423
39571
  _t(app, process3.argv.slice(2), buildContext(process3));
@@ -39425,5 +39573,5 @@ export {
39425
39573
  app
39426
39574
  };
39427
39575
 
39428
- //# debugId=A704FF916C71600F64756E2164756E21
39576
+ //# debugId=8C234B33AAB81C4664756E2164756E21
39429
39577
  //# sourceMappingURL=mcp-server.js.map