@greensecurity/javascript-sdk 0.44.0-beta.15 → 0.44.0-beta.17

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 (200) hide show
  1. package/README.md +9 -0
  2. package/dist/commonjs/__tests__/organizations.test.js +72 -6
  3. package/dist/commonjs/__tests__/organizations.test.js.map +1 -1
  4. package/dist/commonjs/__tests__/webhooks.test.js +1 -1
  5. package/dist/commonjs/__tests__/webhooks.test.js.map +1 -1
  6. package/dist/commonjs/__tests__/zones.test.js +34 -6
  7. package/dist/commonjs/__tests__/zones.test.js.map +1 -1
  8. package/dist/commonjs/funcs/organizationsCreateCompanyTargetFacility.d.ts +34 -0
  9. package/dist/commonjs/funcs/organizationsCreateCompanyTargetFacility.d.ts.map +1 -0
  10. package/dist/commonjs/funcs/organizationsCreateCompanyTargetFacility.js +145 -0
  11. package/dist/commonjs/funcs/organizationsCreateCompanyTargetFacility.js.map +1 -0
  12. package/dist/commonjs/funcs/organizationsDeleteCompanyTargetFacility.d.ts +28 -0
  13. package/dist/commonjs/funcs/organizationsDeleteCompanyTargetFacility.d.ts.map +1 -0
  14. package/dist/commonjs/funcs/organizationsDeleteCompanyTargetFacility.js +138 -0
  15. package/dist/commonjs/funcs/organizationsDeleteCompanyTargetFacility.js.map +1 -0
  16. package/dist/commonjs/funcs/organizationsListCompanyTargetFacilities.d.ts +42 -0
  17. package/dist/commonjs/funcs/organizationsListCompanyTargetFacilities.d.ts.map +1 -0
  18. package/dist/commonjs/funcs/organizationsListCompanyTargetFacilities.js +194 -0
  19. package/dist/commonjs/funcs/organizationsListCompanyTargetFacilities.js.map +1 -0
  20. package/dist/commonjs/lib/config.d.ts +3 -3
  21. package/dist/commonjs/lib/config.js +3 -3
  22. package/dist/commonjs/models/components/companytargetfacility.d.ts +54 -0
  23. package/dist/commonjs/models/components/companytargetfacility.d.ts.map +1 -0
  24. package/dist/commonjs/models/components/companytargetfacility.js +80 -0
  25. package/dist/commonjs/models/components/companytargetfacility.js.map +1 -0
  26. package/dist/commonjs/models/components/index.d.ts +1 -0
  27. package/dist/commonjs/models/components/index.d.ts.map +1 -1
  28. package/dist/commonjs/models/components/index.js +1 -0
  29. package/dist/commonjs/models/components/index.js.map +1 -1
  30. package/dist/commonjs/models/operations/createcompanytargetfacility.d.ts +50 -0
  31. package/dist/commonjs/models/operations/createcompanytargetfacility.d.ts.map +1 -0
  32. package/dist/commonjs/models/operations/createcompanytargetfacility.js +84 -0
  33. package/dist/commonjs/models/operations/createcompanytargetfacility.js.map +1 -0
  34. package/dist/commonjs/models/operations/deletecompanytargetfacility.d.ts +20 -0
  35. package/dist/commonjs/models/operations/deletecompanytargetfacility.d.ts.map +1 -0
  36. package/dist/commonjs/models/operations/deletecompanytargetfacility.js +55 -0
  37. package/dist/commonjs/models/operations/deletecompanytargetfacility.js.map +1 -0
  38. package/dist/commonjs/models/operations/exportcompanytargetfacilities.d.ts +16 -16
  39. package/dist/commonjs/models/operations/exportcompanytargetfacilities.d.ts.map +1 -1
  40. package/dist/commonjs/models/operations/exportcompanytargetfacilities.js +14 -15
  41. package/dist/commonjs/models/operations/exportcompanytargetfacilities.js.map +1 -1
  42. package/dist/commonjs/models/operations/index.d.ts +3 -0
  43. package/dist/commonjs/models/operations/index.d.ts.map +1 -1
  44. package/dist/commonjs/models/operations/index.js +3 -0
  45. package/dist/commonjs/models/operations/index.js.map +1 -1
  46. package/dist/commonjs/models/operations/listcompanytargetfacilities.d.ts +173 -0
  47. package/dist/commonjs/models/operations/listcompanytargetfacilities.d.ts.map +1 -0
  48. package/dist/commonjs/models/operations/listcompanytargetfacilities.js +150 -0
  49. package/dist/commonjs/models/operations/listcompanytargetfacilities.js.map +1 -0
  50. package/dist/commonjs/models/operations/listfacilityvendors.d.ts +4 -4
  51. package/dist/commonjs/models/operations/listfacilityvendors.d.ts.map +1 -1
  52. package/dist/commonjs/models/operations/listfacilityvendors.js +4 -4
  53. package/dist/commonjs/models/operations/listfacilityvendors.js.map +1 -1
  54. package/dist/commonjs/react-query/index.d.ts +3 -0
  55. package/dist/commonjs/react-query/index.d.ts.map +1 -1
  56. package/dist/commonjs/react-query/index.js +3 -0
  57. package/dist/commonjs/react-query/index.js.map +1 -1
  58. package/dist/commonjs/react-query/organizationsCreateCompanyTargetFacility.d.ts +43 -0
  59. package/dist/commonjs/react-query/organizationsCreateCompanyTargetFacility.d.ts.map +1 -0
  60. package/dist/commonjs/react-query/organizationsCreateCompanyTargetFacility.js +65 -0
  61. package/dist/commonjs/react-query/organizationsCreateCompanyTargetFacility.js.map +1 -0
  62. package/dist/commonjs/react-query/organizationsDeleteCompanyTargetFacility.d.ts +37 -0
  63. package/dist/commonjs/react-query/organizationsDeleteCompanyTargetFacility.d.ts.map +1 -0
  64. package/dist/commonjs/react-query/organizationsDeleteCompanyTargetFacility.js +59 -0
  65. package/dist/commonjs/react-query/organizationsDeleteCompanyTargetFacility.js.map +1 -0
  66. package/dist/commonjs/react-query/organizationsExportCompanyTargetFacilities.core.d.ts +4 -4
  67. package/dist/commonjs/react-query/organizationsExportCompanyTargetFacilities.core.d.ts.map +1 -1
  68. package/dist/commonjs/react-query/organizationsExportCompanyTargetFacilities.core.js.map +1 -1
  69. package/dist/commonjs/react-query/organizationsExportCompanyTargetFacilities.d.ts +8 -8
  70. package/dist/commonjs/react-query/organizationsExportCompanyTargetFacilities.d.ts.map +1 -1
  71. package/dist/commonjs/react-query/organizationsExportCompanyTargetFacilities.js.map +1 -1
  72. package/dist/commonjs/react-query/organizationsListCompanyTargetFacilities.core.d.ts +54 -0
  73. package/dist/commonjs/react-query/organizationsListCompanyTargetFacilities.core.d.ts.map +1 -0
  74. package/dist/commonjs/react-query/organizationsListCompanyTargetFacilities.core.js +111 -0
  75. package/dist/commonjs/react-query/organizationsListCompanyTargetFacilities.core.js.map +1 -0
  76. package/dist/commonjs/react-query/organizationsListCompanyTargetFacilities.d.ts +154 -0
  77. package/dist/commonjs/react-query/organizationsListCompanyTargetFacilities.d.ts.map +1 -0
  78. package/dist/commonjs/react-query/organizationsListCompanyTargetFacilities.js +180 -0
  79. package/dist/commonjs/react-query/organizationsListCompanyTargetFacilities.js.map +1 -0
  80. package/dist/commonjs/react-query/organizationsListFacilityVendors.core.d.ts +2 -2
  81. package/dist/commonjs/react-query/organizationsListFacilityVendors.core.d.ts.map +1 -1
  82. package/dist/commonjs/react-query/organizationsListFacilityVendors.d.ts +2 -2
  83. package/dist/commonjs/react-query/organizationsListFacilityVendors.d.ts.map +1 -1
  84. package/dist/commonjs/sdk/organizations.d.ts +64 -0
  85. package/dist/commonjs/sdk/organizations.d.ts.map +1 -1
  86. package/dist/commonjs/sdk/organizations.js +71 -0
  87. package/dist/commonjs/sdk/organizations.js.map +1 -1
  88. package/dist/esm/__tests__/organizations.test.js +73 -7
  89. package/dist/esm/__tests__/organizations.test.js.map +1 -1
  90. package/dist/esm/__tests__/webhooks.test.js +1 -1
  91. package/dist/esm/__tests__/webhooks.test.js.map +1 -1
  92. package/dist/esm/__tests__/zones.test.js +34 -6
  93. package/dist/esm/__tests__/zones.test.js.map +1 -1
  94. package/dist/esm/funcs/organizationsCreateCompanyTargetFacility.d.ts +34 -0
  95. package/dist/esm/funcs/organizationsCreateCompanyTargetFacility.d.ts.map +1 -0
  96. package/dist/esm/funcs/organizationsCreateCompanyTargetFacility.js +109 -0
  97. package/dist/esm/funcs/organizationsCreateCompanyTargetFacility.js.map +1 -0
  98. package/dist/esm/funcs/organizationsDeleteCompanyTargetFacility.d.ts +28 -0
  99. package/dist/esm/funcs/organizationsDeleteCompanyTargetFacility.d.ts.map +1 -0
  100. package/dist/esm/funcs/organizationsDeleteCompanyTargetFacility.js +102 -0
  101. package/dist/esm/funcs/organizationsDeleteCompanyTargetFacility.js.map +1 -0
  102. package/dist/esm/funcs/organizationsListCompanyTargetFacilities.d.ts +42 -0
  103. package/dist/esm/funcs/organizationsListCompanyTargetFacilities.d.ts.map +1 -0
  104. package/dist/esm/funcs/organizationsListCompanyTargetFacilities.js +158 -0
  105. package/dist/esm/funcs/organizationsListCompanyTargetFacilities.js.map +1 -0
  106. package/dist/esm/lib/config.d.ts +3 -3
  107. package/dist/esm/lib/config.js +3 -3
  108. package/dist/esm/models/components/companytargetfacility.d.ts +54 -0
  109. package/dist/esm/models/components/companytargetfacility.d.ts.map +1 -0
  110. package/dist/esm/models/components/companytargetfacility.js +41 -0
  111. package/dist/esm/models/components/companytargetfacility.js.map +1 -0
  112. package/dist/esm/models/components/index.d.ts +1 -0
  113. package/dist/esm/models/components/index.d.ts.map +1 -1
  114. package/dist/esm/models/components/index.js +1 -0
  115. package/dist/esm/models/components/index.js.map +1 -1
  116. package/dist/esm/models/operations/createcompanytargetfacility.d.ts +50 -0
  117. package/dist/esm/models/operations/createcompanytargetfacility.d.ts.map +1 -0
  118. package/dist/esm/models/operations/createcompanytargetfacility.js +45 -0
  119. package/dist/esm/models/operations/createcompanytargetfacility.js.map +1 -0
  120. package/dist/esm/models/operations/deletecompanytargetfacility.d.ts +20 -0
  121. package/dist/esm/models/operations/deletecompanytargetfacility.d.ts.map +1 -0
  122. package/dist/esm/models/operations/deletecompanytargetfacility.js +18 -0
  123. package/dist/esm/models/operations/deletecompanytargetfacility.js.map +1 -0
  124. package/dist/esm/models/operations/exportcompanytargetfacilities.d.ts +16 -16
  125. package/dist/esm/models/operations/exportcompanytargetfacilities.d.ts.map +1 -1
  126. package/dist/esm/models/operations/exportcompanytargetfacilities.js +13 -14
  127. package/dist/esm/models/operations/exportcompanytargetfacilities.js.map +1 -1
  128. package/dist/esm/models/operations/index.d.ts +3 -0
  129. package/dist/esm/models/operations/index.d.ts.map +1 -1
  130. package/dist/esm/models/operations/index.js +3 -0
  131. package/dist/esm/models/operations/index.js.map +1 -1
  132. package/dist/esm/models/operations/listcompanytargetfacilities.d.ts +173 -0
  133. package/dist/esm/models/operations/listcompanytargetfacilities.d.ts.map +1 -0
  134. package/dist/esm/models/operations/listcompanytargetfacilities.js +111 -0
  135. package/dist/esm/models/operations/listcompanytargetfacilities.js.map +1 -0
  136. package/dist/esm/models/operations/listfacilityvendors.d.ts +4 -4
  137. package/dist/esm/models/operations/listfacilityvendors.d.ts.map +1 -1
  138. package/dist/esm/models/operations/listfacilityvendors.js +3 -3
  139. package/dist/esm/models/operations/listfacilityvendors.js.map +1 -1
  140. package/dist/esm/react-query/index.d.ts +3 -0
  141. package/dist/esm/react-query/index.d.ts.map +1 -1
  142. package/dist/esm/react-query/index.js +3 -0
  143. package/dist/esm/react-query/index.js.map +1 -1
  144. package/dist/esm/react-query/organizationsCreateCompanyTargetFacility.d.ts +43 -0
  145. package/dist/esm/react-query/organizationsCreateCompanyTargetFacility.d.ts.map +1 -0
  146. package/dist/esm/react-query/organizationsCreateCompanyTargetFacility.js +60 -0
  147. package/dist/esm/react-query/organizationsCreateCompanyTargetFacility.js.map +1 -0
  148. package/dist/esm/react-query/organizationsDeleteCompanyTargetFacility.d.ts +37 -0
  149. package/dist/esm/react-query/organizationsDeleteCompanyTargetFacility.d.ts.map +1 -0
  150. package/dist/esm/react-query/organizationsDeleteCompanyTargetFacility.js +54 -0
  151. package/dist/esm/react-query/organizationsDeleteCompanyTargetFacility.js.map +1 -0
  152. package/dist/esm/react-query/organizationsExportCompanyTargetFacilities.core.d.ts +4 -4
  153. package/dist/esm/react-query/organizationsExportCompanyTargetFacilities.core.d.ts.map +1 -1
  154. package/dist/esm/react-query/organizationsExportCompanyTargetFacilities.core.js.map +1 -1
  155. package/dist/esm/react-query/organizationsExportCompanyTargetFacilities.d.ts +8 -8
  156. package/dist/esm/react-query/organizationsExportCompanyTargetFacilities.d.ts.map +1 -1
  157. package/dist/esm/react-query/organizationsExportCompanyTargetFacilities.js.map +1 -1
  158. package/dist/esm/react-query/organizationsListCompanyTargetFacilities.core.d.ts +54 -0
  159. package/dist/esm/react-query/organizationsListCompanyTargetFacilities.core.d.ts.map +1 -0
  160. package/dist/esm/react-query/organizationsListCompanyTargetFacilities.core.js +103 -0
  161. package/dist/esm/react-query/organizationsListCompanyTargetFacilities.core.js.map +1 -0
  162. package/dist/esm/react-query/organizationsListCompanyTargetFacilities.d.ts +154 -0
  163. package/dist/esm/react-query/organizationsListCompanyTargetFacilities.d.ts.map +1 -0
  164. package/dist/esm/react-query/organizationsListCompanyTargetFacilities.js +165 -0
  165. package/dist/esm/react-query/organizationsListCompanyTargetFacilities.js.map +1 -0
  166. package/dist/esm/react-query/organizationsListFacilityVendors.core.d.ts +2 -2
  167. package/dist/esm/react-query/organizationsListFacilityVendors.core.d.ts.map +1 -1
  168. package/dist/esm/react-query/organizationsListFacilityVendors.d.ts +2 -2
  169. package/dist/esm/react-query/organizationsListFacilityVendors.d.ts.map +1 -1
  170. package/dist/esm/sdk/organizations.d.ts +64 -0
  171. package/dist/esm/sdk/organizations.d.ts.map +1 -1
  172. package/dist/esm/sdk/organizations.js +71 -0
  173. package/dist/esm/sdk/organizations.js.map +1 -1
  174. package/jsr.json +1 -1
  175. package/package.json +1 -1
  176. package/src/__tests__/organizations.test.ts +79 -13
  177. package/src/__tests__/webhooks.test.ts +1 -1
  178. package/src/__tests__/zones.test.ts +34 -6
  179. package/src/funcs/organizationsCreateCompanyTargetFacility.ts +204 -0
  180. package/src/funcs/organizationsDeleteCompanyTargetFacility.ts +193 -0
  181. package/src/funcs/organizationsListCompanyTargetFacilities.ts +291 -0
  182. package/src/lib/config.ts +3 -3
  183. package/src/models/components/companytargetfacility.ts +124 -0
  184. package/src/models/components/index.ts +1 -0
  185. package/src/models/operations/createcompanytargetfacility.ts +132 -0
  186. package/src/models/operations/deletecompanytargetfacility.ts +47 -0
  187. package/src/models/operations/exportcompanytargetfacilities.ts +34 -31
  188. package/src/models/operations/index.ts +3 -0
  189. package/src/models/operations/listcompanytargetfacilities.ts +293 -0
  190. package/src/models/operations/listfacilityvendors.ts +10 -7
  191. package/src/react-query/index.ts +3 -0
  192. package/src/react-query/organizationsCreateCompanyTargetFacility.ts +129 -0
  193. package/src/react-query/organizationsDeleteCompanyTargetFacility.ts +122 -0
  194. package/src/react-query/organizationsExportCompanyTargetFacilities.core.ts +4 -6
  195. package/src/react-query/organizationsExportCompanyTargetFacilities.ts +12 -10
  196. package/src/react-query/organizationsListCompanyTargetFacilities.core.ts +239 -0
  197. package/src/react-query/organizationsListCompanyTargetFacilities.ts +369 -0
  198. package/src/react-query/organizationsListFacilityVendors.core.ts +2 -2
  199. package/src/react-query/organizationsListFacilityVendors.ts +2 -2
  200. package/src/sdk/organizations.ts +102 -0
@@ -41,6 +41,70 @@ export declare class Organizations extends ClientSDK {
41
41
  listOrSearchDepartments(request: operations.ListOrSearchDepartmentsRequest, options?: RequestOptions): Promise<PageIterator<operations.ListOrSearchDepartmentsResponse, {
42
42
  page: number;
43
43
  }>>;
44
+ /**
45
+ * List company target facilities
46
+ *
47
+ * @remarks
48
+ * Lists the CompanyTargetFacility links for a company — the facilities the
49
+ * company is targeting. Each row carries the linked facility (with location
50
+ * and parent system), the link status, and per-facility counts of the
51
+ * company's individuals targeting it.
52
+ *
53
+ * When `include_potential_targets=true`, returns ALL non-deleted facilities
54
+ * via a LEFT JOIN. Targeted rows carry their CTF `id` and `status`; non-targeted
55
+ * rows have `id: null` and `status: "Not Targeted"`.
56
+ *
57
+ * Access control: the URL's `company_id` must be in the caller's read scope
58
+ * for Company (a company manager's or vendor's own company, or a company
59
+ * whose app is activated for the API user). Callers outside that scope
60
+ * receive `404 Company not found`.
61
+ *
62
+ * Filter with `has_individual` / `has_active_individual` to drive the
63
+ * facility roster views.
64
+ *
65
+ * Available `expand` scopes are:
66
+ *
67
+ * - company_target_facility.facility
68
+ */
69
+ listCompanyTargetFacilities(request: operations.ListCompanyTargetFacilitiesRequest, options?: RequestOptions): Promise<PageIterator<operations.ListCompanyTargetFacilitiesResponse, {
70
+ page: number;
71
+ }>>;
72
+ /**
73
+ * Add a company target facility
74
+ *
75
+ * @remarks
76
+ * Links the URL's company to an existing facility. The link is created with
77
+ * status `Pending`. Only the link row is created — the Facility entity
78
+ * itself is never created or modified by this endpoint.
79
+ *
80
+ * Access control: the URL's `company_id` must be in the caller's update
81
+ * scope for Company, AND the `facility_id` must be in the caller's create
82
+ * scope for Facility (a facility on the company's site, or a facility
83
+ * reachable via the API user's site/system/facility-scoped activation).
84
+ * Either being out of scope returns `404 Company not found` /
85
+ * `404 Facility not found` respectively. Deleted facilities also return
86
+ * `404 Facility not found`.
87
+ *
88
+ * Available `expand` scopes are:
89
+ *
90
+ * - company_target_facility.facility
91
+ */
92
+ createCompanyTargetFacility(request: operations.CreateCompanyTargetFacilityRequest, options?: RequestOptions): Promise<operations.CreateCompanyTargetFacilityCreateCompanyTargetFacilityOk>;
93
+ /**
94
+ * Remove a company target facility
95
+ *
96
+ * @remarks
97
+ * Removes a CompanyTargetFacility link. Blocked when any of the company's
98
+ * individuals still target the same facility (to avoid orphaning their
99
+ * vendor-scoped target rows). Only the link row is removed — the Facility
100
+ * entity itself is never touched.
101
+ *
102
+ * Access control: the URL's `company_id` must be in the caller's update
103
+ * scope for Company (a company manager's or vendor's own company, or a
104
+ * company whose app is activated for the API user). Callers outside that
105
+ * scope receive `404 Company not found`.
106
+ */
107
+ deleteCompanyTargetFacility(request: operations.DeleteCompanyTargetFacilityRequest, options?: RequestOptions): Promise<boolean>;
44
108
  /**
45
109
  * Export company target facilities to CSV (async)
46
110
  *
@@ -1 +1 @@
1
- {"version":3,"file":"organizations.d.ts","sourceRoot":"","sources":["../../../src/sdk/organizations.ts"],"names":[],"mappings":"AAYA,OAAO,EAAE,SAAS,EAAE,cAAc,EAAE,MAAM,gBAAgB,CAAC;AAC3D,OAAO,KAAK,UAAU,MAAM,+BAA+B,CAAC;AAC5D,OAAO,KAAK,UAAU,MAAM,+BAA+B,CAAC;AAE5D,OAAO,EAAE,YAAY,EAAwB,MAAM,wBAAwB,CAAC;AAE5E,qBAAa,aAAc,SAAQ,SAAS;IAC1C;;;;;;;;;;;;;;;;;;OAkBG;IACG,sBAAsB,CAC1B,OAAO,EAAE,UAAU,CAAC,6BAA6B,EAC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,13 @@
1
1
  /*
2
2
  * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
3
3
  */
4
+ import { organizationsCreateCompanyTargetFacility } from "../funcs/organizationsCreateCompanyTargetFacility.js";
5
+ import { organizationsDeleteCompanyTargetFacility } from "../funcs/organizationsDeleteCompanyTargetFacility.js";
4
6
  import { organizationsDownloadCompanyTargetFacilitiesExport } from "../funcs/organizationsDownloadCompanyTargetFacilitiesExport.js";
5
7
  import { organizationsExportCompanyTargetFacilities } from "../funcs/organizationsExportCompanyTargetFacilities.js";
6
8
  import { organizationsGetCompanyTargetFacilitiesExportStatus } from "../funcs/organizationsGetCompanyTargetFacilitiesExportStatus.js";
7
9
  import { organizationsGetFacility } from "../funcs/organizationsGetFacility.js";
10
+ import { organizationsListCompanyTargetFacilities } from "../funcs/organizationsListCompanyTargetFacilities.js";
8
11
  import { organizationsListFacilityVendors } from "../funcs/organizationsListFacilityVendors.js";
9
12
  import { organizationsListOrSearchDepartmentContacts } from "../funcs/organizationsListOrSearchDepartmentContacts.js";
10
13
  import { organizationsListOrSearchDepartments } from "../funcs/organizationsListOrSearchDepartments.js";
@@ -53,6 +56,74 @@ export class Organizations extends ClientSDK {
53
56
  async listOrSearchDepartments(request, options) {
54
57
  return unwrapResultIterator(organizationsListOrSearchDepartments(this, request, options));
55
58
  }
59
+ /**
60
+ * List company target facilities
61
+ *
62
+ * @remarks
63
+ * Lists the CompanyTargetFacility links for a company — the facilities the
64
+ * company is targeting. Each row carries the linked facility (with location
65
+ * and parent system), the link status, and per-facility counts of the
66
+ * company's individuals targeting it.
67
+ *
68
+ * When `include_potential_targets=true`, returns ALL non-deleted facilities
69
+ * via a LEFT JOIN. Targeted rows carry their CTF `id` and `status`; non-targeted
70
+ * rows have `id: null` and `status: "Not Targeted"`.
71
+ *
72
+ * Access control: the URL's `company_id` must be in the caller's read scope
73
+ * for Company (a company manager's or vendor's own company, or a company
74
+ * whose app is activated for the API user). Callers outside that scope
75
+ * receive `404 Company not found`.
76
+ *
77
+ * Filter with `has_individual` / `has_active_individual` to drive the
78
+ * facility roster views.
79
+ *
80
+ * Available `expand` scopes are:
81
+ *
82
+ * - company_target_facility.facility
83
+ */
84
+ async listCompanyTargetFacilities(request, options) {
85
+ return unwrapResultIterator(organizationsListCompanyTargetFacilities(this, request, options));
86
+ }
87
+ /**
88
+ * Add a company target facility
89
+ *
90
+ * @remarks
91
+ * Links the URL's company to an existing facility. The link is created with
92
+ * status `Pending`. Only the link row is created — the Facility entity
93
+ * itself is never created or modified by this endpoint.
94
+ *
95
+ * Access control: the URL's `company_id` must be in the caller's update
96
+ * scope for Company, AND the `facility_id` must be in the caller's create
97
+ * scope for Facility (a facility on the company's site, or a facility
98
+ * reachable via the API user's site/system/facility-scoped activation).
99
+ * Either being out of scope returns `404 Company not found` /
100
+ * `404 Facility not found` respectively. Deleted facilities also return
101
+ * `404 Facility not found`.
102
+ *
103
+ * Available `expand` scopes are:
104
+ *
105
+ * - company_target_facility.facility
106
+ */
107
+ async createCompanyTargetFacility(request, options) {
108
+ return unwrapAsync(organizationsCreateCompanyTargetFacility(this, request, options));
109
+ }
110
+ /**
111
+ * Remove a company target facility
112
+ *
113
+ * @remarks
114
+ * Removes a CompanyTargetFacility link. Blocked when any of the company's
115
+ * individuals still target the same facility (to avoid orphaning their
116
+ * vendor-scoped target rows). Only the link row is removed — the Facility
117
+ * entity itself is never touched.
118
+ *
119
+ * Access control: the URL's `company_id` must be in the caller's update
120
+ * scope for Company (a company manager's or vendor's own company, or a
121
+ * company whose app is activated for the API user). Callers outside that
122
+ * scope receive `404 Company not found`.
123
+ */
124
+ async deleteCompanyTargetFacility(request, options) {
125
+ return unwrapAsync(organizationsDeleteCompanyTargetFacility(this, request, options));
126
+ }
56
127
  /**
57
128
  * Export company target facilities to CSV (async)
58
129
  *
@@ -1 +1 @@
1
- {"version":3,"file":"organizations.js","sourceRoot":"","sources":["../../../src/sdk/organizations.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,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CAC3D,IAAI,EACJ,OAAO,EACP,OAAO,CACR,CAAC,CAAC;IACL,CAAC;IAED;;;;;;OAMG;IACH,KAAK,CAAC,sCAAsC,CAC1C,OAAiE,EACjE,OAAwB;QAExB,OAAO,WAAW,CAAC,mDAAmD,CACpE,IAAI,EACJ,OAAO,EACP,OAAO,CACR,CAAC,CAAC;IACL,CAAC;IAED;;;;;;OAMG;IACH,KAAK,CAAC,qCAAqC,CACzC,OAAgE,EAChE,OAAwB;QAIxB,OAAO,WAAW,CAAC,kDAAkD,CACnE,IAAI,EACJ,OAAO,EACP,OAAO,CACR,CAAC,CAAC;IACL,CAAC;IAED;;;;;;;;;;;;;;;;;;;;;;;;OAwBG;IACH,KAAK,CAAC,mBAAmB,CACvB,OAA8C,EAC9C,OAAwB;QAIxB,OAAO,oBAAoB,CAAC,gCAAgC,CAC1D,IAAI,EACJ,OAAO,EACP,OAAO,CACR,CAAC,CAAC;IACL,CAAC;IAED;;;;;;;;;;OAUG;IACH,KAAK,CAAC,8BAA8B,CAClC,OAAyD,EACzD,OAAwB;QAOxB,OAAO,oBAAoB,CAAC,2CAA2C,CACrE,IAAI,EACJ,OAAO,EACP,OAAO,CACR,CAAC,CAAC;IACL,CAAC;CACF"}
1
+ {"version":3,"file":"organizations.js","sourceRoot":"","sources":["../../../src/sdk/organizations.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EAAE,wCAAwC,EAAE,MAAM,sDAAsD,CAAC;AAChH,OAAO,EAAE,wCAAwC,EAAE,MAAM,sDAAsD,CAAC;AAChH,OAAO,EAAE,kDAAkD,EAAE,MAAM,gEAAgE,CAAC;AACpI,OAAO,EAAE,0CAA0C,EAAE,MAAM,wDAAwD,CAAC;AACpH,OAAO,EAAE,mDAAmD,EAAE,MAAM,iEAAiE,CAAC;AACtI,OAAO,EAAE,wBAAwB,EAAE,MAAM,sCAAsC,CAAC;AAChF,OAAO,EAAE,wCAAwC,EAAE,MAAM,sDAAsD,CAAC;AAChH,OAA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IAAI,EACJ,OAAO,EACP,OAAO,CACR,CAAC,CAAC;IACL,CAAC;IAED;;;;;;;;;;;;;OAaG;IACH,KAAK,CAAC,2BAA2B,CAC/B,OAAsD,EACtD,OAAwB;QAExB,OAAO,WAAW,CAAC,wCAAwC,CACzD,IAAI,EACJ,OAAO,EACP,OAAO,CACR,CAAC,CAAC;IACL,CAAC;IAED;;;;;;;;;;;;OAYG;IACH,KAAK,CAAC,6BAA6B,CACjC,OAAwD,EACxD,OAAwB;QAExB,OAAO,WAAW,CAAC,0CAA0C,CAC3D,IAAI,EACJ,OAAO,EACP,OAAO,CACR,CAAC,CAAC;IACL,CAAC;IAED;;;;;;OAMG;IACH,KAAK,CAAC,sCAAsC,CAC1C,OAAiE,EACjE,OAAwB;QAExB,OAAO,WAAW,CAAC,mDAAmD,CACpE,IAAI,EACJ,OAAO,EACP,OAAO,CACR,CAAC,CAAC;IACL,CAAC;IAED;;;;;;OAMG;IACH,KAAK,CAAC,qCAAqC,CACzC,OAAgE,EAChE,OAAwB;QAIxB,OAAO,WAAW,CAAC,kDAAkD,CACnE,IAAI,EACJ,OAAO,EACP,OAAO,CACR,CAAC,CAAC;IACL,CAAC;IAED;;;;;;;;;;;;;;;;;;;;;;;;OAwBG;IACH,KAAK,CAAC,mBAAmB,CACvB,OAA8C,EAC9C,OAAwB;QAIxB,OAAO,oBAAoB,CAAC,gCAAgC,CAC1D,IAAI,EACJ,OAAO,EACP,OAAO,CACR,CAAC,CAAC;IACL,CAAC;IAED;;;;;;;;;;OAUG;IACH,KAAK,CAAC,8BAA8B,CAClC,OAAyD,EACzD,OAAwB;QAOxB,OAAO,oBAAoB,CAAC,2CAA2C,CACrE,IAAI,EACJ,OAAO,EACP,OAAO,CACR,CAAC,CAAC;IACL,CAAC;CACF"}
package/jsr.json CHANGED
@@ -2,7 +2,7 @@
2
2
 
3
3
  {
4
4
  "name": "@greensecurity/javascript-sdk",
5
- "version": "0.44.0-beta.15",
5
+ "version": "0.44.0-beta.17",
6
6
  "exports": {
7
7
  ".": "./src/index.ts",
8
8
  "./models/errors": "./src/models/errors/index.ts",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@greensecurity/javascript-sdk",
3
- "version": "0.44.0-beta.15",
3
+ "version": "0.44.0-beta.17",
4
4
  "author": "Green Security LLC",
5
5
  "type": "module",
6
6
  "tshy": {
@@ -2,7 +2,7 @@
2
2
  * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
3
3
  */
4
4
 
5
- import { assert, expect, it, test } from "vitest";
5
+ import { expect, test } from "vitest";
6
6
  import { GreenSecurity } from "../index.js";
7
7
  import { createTestHTTPClient } from "./testclient.js";
8
8
 
@@ -84,22 +84,88 @@ test("Organizations List Or Search Department Contacts", async () => {
84
84
  });
85
85
  });
86
86
 
87
- it.skip("Organizations List Company Target Facilities", async () => {
88
- assert.fail(
89
- "incomplete test found please make sure to address the following errors: [`workflow step listCompanyTargetFacilities.test referencing operation listCompanyTargetFacilities not found in document`]",
90
- );
87
+ test("Organizations List Company Target Facilities", async () => {
88
+ const testHttpClient = createTestHTTPClient("listCompanyTargetFacilities");
89
+
90
+ const greenSecurity = new GreenSecurity({
91
+ serverURL: process.env["TEST_SERVER_URL"] ?? "https://localhost:3000/api",
92
+ httpClient: testHttpClient,
93
+ security: {
94
+ token: process.env["GREEN_SECURITY_TOKEN"] ?? "value",
95
+ },
96
+ });
97
+
98
+ const result = await greenSecurity.organizations.listCompanyTargetFacilities({
99
+ companyId: 864839,
100
+ expand: [
101
+ "facility.system",
102
+ ],
103
+ desc: true,
104
+ itemsPerPage: 25,
105
+ });
106
+ expect(result).toBeDefined();
107
+ expect(result!.result).toBeDefined();
108
+ expect(result!.result).toEqual({
109
+ pager: {
110
+ baseUrl: "api/vendors/job_titles",
111
+ sort: "job,title",
112
+ desc: 0,
113
+ itemCount: 228,
114
+ itemsPerPage: 112555,
115
+ page: 1,
116
+ useUrlParams: true,
117
+ },
118
+ items: [],
119
+ });
91
120
  });
92
121
 
93
- it.skip("Organizations Create Company Target Facility", async () => {
94
- assert.fail(
95
- "incomplete test found please make sure to address the following errors: [`workflow step createCompanyTargetFacility.test referencing operation createCompanyTargetFacility not found in document`]",
96
- );
122
+ test("Organizations Create Company Target Facility", async () => {
123
+ const testHttpClient = createTestHTTPClient("createCompanyTargetFacility");
124
+
125
+ const greenSecurity = new GreenSecurity({
126
+ serverURL: process.env["TEST_SERVER_URL"] ?? "https://localhost:3000/api",
127
+ httpClient: testHttpClient,
128
+ security: {
129
+ token: process.env["GREEN_SECURITY_TOKEN"] ?? "value",
130
+ },
131
+ });
132
+
133
+ const result = await greenSecurity.organizations.createCompanyTargetFacility({
134
+ companyId: 846108,
135
+ expand: [
136
+ "facility.system",
137
+ ],
138
+ requestBody: {
139
+ facilityId: 253646,
140
+ },
141
+ });
142
+ expect(result).toBeDefined();
143
+ expect(result).toEqual({
144
+ companyTargetFacility: {
145
+ id: 335466,
146
+ facility: 582706,
147
+ status: "<value>",
148
+ },
149
+ });
97
150
  });
98
151
 
99
- it.skip("Organizations Delete Company Target Facility", async () => {
100
- assert.fail(
101
- "incomplete test found please make sure to address the following errors: [`workflow step deleteCompanyTargetFacility.test referencing operation deleteCompanyTargetFacility not found in document`]",
102
- );
152
+ test("Organizations Delete Company Target Facility", async () => {
153
+ const testHttpClient = createTestHTTPClient("deleteCompanyTargetFacility");
154
+
155
+ const greenSecurity = new GreenSecurity({
156
+ serverURL: process.env["TEST_SERVER_URL"] ?? "https://localhost:3000/api",
157
+ httpClient: testHttpClient,
158
+ security: {
159
+ token: process.env["GREEN_SECURITY_TOKEN"] ?? "value",
160
+ },
161
+ });
162
+
163
+ const result = await greenSecurity.organizations.deleteCompanyTargetFacility({
164
+ companyId: 56711,
165
+ id: 304723,
166
+ });
167
+ expect(result).toBeDefined();
168
+ expect(result).toEqual(true);
103
169
  });
104
170
 
105
171
  test("Organizations Export Company Target Facilities", async () => {
@@ -20,7 +20,7 @@ test("Webhooks List All Webhook Endpoints", async () => {
20
20
  const testWebhookListForVendorUserResult = await greenSecurity.webhooks
21
21
  .listAllWebhookEndpoints({
22
22
  itemsPerPage: 25,
23
- desc: 0,
23
+ desc: true,
24
24
  sort: "",
25
25
  });
26
26
  expect(testWebhookListForVendorUserResult).toBeDefined();
@@ -40,7 +40,7 @@ test("Zones List Or Search Security Zones", async () => {
40
40
  contacts: {
41
41
  contact: {
42
42
  status: "Active",
43
- department: null,
43
+ department: 123,
44
44
  },
45
45
  adminContact: {
46
46
  status: "Deleted",
@@ -51,7 +51,7 @@ test("Zones List Or Search Security Zones", async () => {
51
51
  department: 123,
52
52
  },
53
53
  greenSecurityCsm: {
54
- status: "Inactive",
54
+ status: "Deleted",
55
55
  department: 123,
56
56
  },
57
57
  accountManager: {
@@ -60,14 +60,42 @@ test("Zones List Or Search Security Zones", async () => {
60
60
  },
61
61
  },
62
62
  vendorGuestPolicy: {
63
- enabled: false,
63
+ enabled: true,
64
64
  vendorGuestLimitAndOr: "and",
65
- vendorGuestRequireEmail: false,
65
+ vendorGuestRequireEmail: true,
66
66
  },
67
67
  },
68
68
  },
69
69
  {
70
- facility: {},
70
+ facility: {
71
+ contacts: {
72
+ contact: {
73
+ status: "Active",
74
+ department: 123,
75
+ },
76
+ adminContact: {
77
+ status: "Deleted",
78
+ department: null,
79
+ },
80
+ techContact: {
81
+ status: "Inactive",
82
+ department: 123,
83
+ },
84
+ greenSecurityCsm: {
85
+ status: "Deleted",
86
+ department: 123,
87
+ },
88
+ accountManager: {
89
+ status: "Active",
90
+ department: 123,
91
+ },
92
+ },
93
+ vendorGuestPolicy: {
94
+ enabled: true,
95
+ vendorGuestLimitAndOr: "and",
96
+ vendorGuestRequireEmail: true,
97
+ },
98
+ },
71
99
  },
72
100
  ],
73
101
  });
@@ -86,7 +114,7 @@ test("Zones Security Zone Checkin", async () => {
86
114
 
87
115
  const result = await greenSecurity.zones.securityZoneCheckin({
88
116
  qrCode: "<value>",
89
- zoneId: 130889,
117
+ zoneId: 290531,
90
118
  });
91
119
  expect(result).toBeDefined();
92
120
  expect(result).toEqual({});
@@ -0,0 +1,204 @@
1
+ /*
2
+ * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
3
+ */
4
+
5
+ import { GreenSecurityCore } from "../core.js";
6
+ import { encodeFormQuery, encodeJSON, encodeSimple } from "../lib/encodings.js";
7
+ import { matchStatusCode } from "../lib/http.js";
8
+ import * as M from "../lib/matchers.js";
9
+ import { compactMap } from "../lib/primitives.js";
10
+ import { safeParse } from "../lib/schemas.js";
11
+ import { RequestOptions } from "../lib/sdks.js";
12
+ import { extractSecurity, resolveGlobalSecurity } from "../lib/security.js";
13
+ import { pathToFunc } from "../lib/url.js";
14
+ import { GreenSecurityError } from "../models/errors/greensecurityerror.js";
15
+ import {
16
+ ConnectionError,
17
+ InvalidRequestError,
18
+ RequestAbortedError,
19
+ RequestTimeoutError,
20
+ UnexpectedClientError,
21
+ } from "../models/errors/httpclienterrors.js";
22
+ import * as errors from "../models/errors/index.js";
23
+ import { ResponseValidationError } from "../models/errors/responsevalidationerror.js";
24
+ import { SDKValidationError } from "../models/errors/sdkvalidationerror.js";
25
+ import * as operations from "../models/operations/index.js";
26
+ import { APICall, APIPromise } from "../types/async.js";
27
+ import { Result } from "../types/fp.js";
28
+
29
+ /**
30
+ * Add a company target facility
31
+ *
32
+ * @remarks
33
+ * Links the URL's company to an existing facility. The link is created with
34
+ * status `Pending`. Only the link row is created — the Facility entity
35
+ * itself is never created or modified by this endpoint.
36
+ *
37
+ * Access control: the URL's `company_id` must be in the caller's update
38
+ * scope for Company, AND the `facility_id` must be in the caller's create
39
+ * scope for Facility (a facility on the company's site, or a facility
40
+ * reachable via the API user's site/system/facility-scoped activation).
41
+ * Either being out of scope returns `404 Company not found` /
42
+ * `404 Facility not found` respectively. Deleted facilities also return
43
+ * `404 Facility not found`.
44
+ *
45
+ * Available `expand` scopes are:
46
+ *
47
+ * - company_target_facility.facility
48
+ *
49
+ * If set, this operation will use {@link Security.bearerJwt} from the global security.
50
+ */
51
+ export function organizationsCreateCompanyTargetFacility(
52
+ client: GreenSecurityCore,
53
+ request: operations.CreateCompanyTargetFacilityRequest,
54
+ options?: RequestOptions,
55
+ ): APIPromise<
56
+ Result<
57
+ operations.CreateCompanyTargetFacilityCreateCompanyTargetFacilityOk,
58
+ | errors.ApiErrorResponse
59
+ | GreenSecurityError
60
+ | ResponseValidationError
61
+ | ConnectionError
62
+ | RequestAbortedError
63
+ | RequestTimeoutError
64
+ | InvalidRequestError
65
+ | UnexpectedClientError
66
+ | SDKValidationError
67
+ >
68
+ > {
69
+ return new APIPromise($do(
70
+ client,
71
+ request,
72
+ options,
73
+ ));
74
+ }
75
+
76
+ async function $do(
77
+ client: GreenSecurityCore,
78
+ request: operations.CreateCompanyTargetFacilityRequest,
79
+ options?: RequestOptions,
80
+ ): Promise<
81
+ [
82
+ Result<
83
+ operations.CreateCompanyTargetFacilityCreateCompanyTargetFacilityOk,
84
+ | errors.ApiErrorResponse
85
+ | GreenSecurityError
86
+ | ResponseValidationError
87
+ | ConnectionError
88
+ | RequestAbortedError
89
+ | RequestTimeoutError
90
+ | InvalidRequestError
91
+ | UnexpectedClientError
92
+ | SDKValidationError
93
+ >,
94
+ APICall,
95
+ ]
96
+ > {
97
+ const parsed = safeParse(
98
+ request,
99
+ (value) =>
100
+ operations.CreateCompanyTargetFacilityRequest$outboundSchema.parse(value),
101
+ "Input validation failed",
102
+ );
103
+ if (!parsed.ok) {
104
+ return [parsed, { status: "invalid" }];
105
+ }
106
+ const payload = parsed.value;
107
+ const body = encodeJSON("body", payload.RequestBody, { explode: true });
108
+
109
+ const pathParams = {
110
+ company_id: encodeSimple("company_id", payload.company_id, {
111
+ explode: false,
112
+ charEncoding: "percent",
113
+ }),
114
+ };
115
+ const path = pathToFunc("/companies/{company_id}/target-facilities")(
116
+ pathParams,
117
+ );
118
+
119
+ const query = encodeFormQuery({
120
+ "expand": payload.expand,
121
+ }, { explode: false });
122
+
123
+ const headers = new Headers(compactMap({
124
+ "Content-Type": "application/json",
125
+ Accept: "application/json",
126
+ }));
127
+
128
+ const securityInput = await extractSecurity(client._options.security);
129
+ const requestSecurity = resolveGlobalSecurity(securityInput, [1]);
130
+
131
+ const context = {
132
+ options: client._options,
133
+ baseURL: options?.serverURL ?? client._baseURL ?? "",
134
+ operationID: "createCompanyTargetFacility",
135
+ oAuth2Scopes: null,
136
+
137
+ resolvedSecurity: requestSecurity,
138
+
139
+ securitySource: client._options.security,
140
+ retryConfig: options?.retries
141
+ || client._options.retryConfig
142
+ || { strategy: "none" },
143
+ retryCodes: options?.retryCodes || ["429", "500", "502", "503", "504"],
144
+ };
145
+
146
+ const requestRes = client._createRequest(context, {
147
+ security: requestSecurity,
148
+ method: "POST",
149
+ baseURL: options?.serverURL,
150
+ path: path,
151
+ headers: headers,
152
+ query: query,
153
+ body: body,
154
+ userAgent: client._options.userAgent,
155
+ timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1,
156
+ }, options);
157
+ if (!requestRes.ok) {
158
+ return [requestRes, { status: "invalid" }];
159
+ }
160
+ const req = requestRes.value;
161
+
162
+ const doResult = await client._do(req, {
163
+ context,
164
+ isErrorStatusCode: (statusCode: number) =>
165
+ matchStatusCode({ status: statusCode } as Response, ["4XX", "5XX"]),
166
+ retryConfig: context.retryConfig,
167
+ retryCodes: context.retryCodes,
168
+ });
169
+ if (!doResult.ok) {
170
+ return [doResult, { status: "request-error", request: req }];
171
+ }
172
+ const response = doResult.value;
173
+
174
+ const responseFields = {
175
+ HttpMeta: { Response: response, Request: req },
176
+ };
177
+
178
+ const [result] = await M.match<
179
+ operations.CreateCompanyTargetFacilityCreateCompanyTargetFacilityOk,
180
+ | errors.ApiErrorResponse
181
+ | GreenSecurityError
182
+ | ResponseValidationError
183
+ | ConnectionError
184
+ | RequestAbortedError
185
+ | RequestTimeoutError
186
+ | InvalidRequestError
187
+ | UnexpectedClientError
188
+ | SDKValidationError
189
+ >(
190
+ M.json(
191
+ 201,
192
+ operations
193
+ .CreateCompanyTargetFacilityCreateCompanyTargetFacilityOk$inboundSchema,
194
+ ),
195
+ M.jsonErr([400, 401, 403, 404, 422], errors.ApiErrorResponse$inboundSchema),
196
+ M.fail("4XX"),
197
+ M.fail([500, "5XX"]),
198
+ )(response, req, { extraFields: responseFields });
199
+ if (!result.ok) {
200
+ return [result, { status: "complete", request: req, response }];
201
+ }
202
+
203
+ return [result, { status: "complete", request: req, response }];
204
+ }