@greensecurity/javascript-sdk 0.48.0-beta.5 → 0.48.0-beta.7

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 (89) hide show
  1. package/README.md +1 -1
  2. package/dist/commonjs/__tests__/vendors.test.js +1 -1
  3. package/dist/commonjs/__tests__/webhooks.test.js +5 -4
  4. package/dist/commonjs/__tests__/webhooks.test.js.map +1 -1
  5. package/dist/commonjs/__tests__/zoneDevicesCreate.test.js +4 -0
  6. package/dist/commonjs/__tests__/zoneDevicesCreate.test.js.map +1 -1
  7. package/dist/commonjs/__tests__/zones.test.js +15 -9
  8. package/dist/commonjs/__tests__/zones.test.js.map +1 -1
  9. package/dist/commonjs/admin-funcs/zoneDevicesProvisioning.d.ts +4 -1
  10. package/dist/commonjs/admin-funcs/zoneDevicesProvisioning.d.ts.map +1 -1
  11. package/dist/commonjs/admin-funcs/zoneDevicesProvisioning.js +3 -8
  12. package/dist/commonjs/admin-funcs/zoneDevicesProvisioning.js.map +1 -1
  13. package/dist/commonjs/funcs/invoicesConvertQuote.d.ts +4 -1
  14. package/dist/commonjs/funcs/invoicesConvertQuote.d.ts.map +1 -1
  15. package/dist/commonjs/funcs/invoicesConvertQuote.js +6 -2
  16. package/dist/commonjs/funcs/invoicesConvertQuote.js.map +1 -1
  17. package/dist/commonjs/lib/config.d.ts +2 -2
  18. package/dist/commonjs/lib/config.js +2 -2
  19. package/dist/commonjs/models/components/invoice.d.ts +5 -0
  20. package/dist/commonjs/models/components/invoice.d.ts.map +1 -1
  21. package/dist/commonjs/models/components/invoice.js +4 -0
  22. package/dist/commonjs/models/components/invoice.js.map +1 -1
  23. package/dist/commonjs/models/operations/convertquote.d.ts +21 -0
  24. package/dist/commonjs/models/operations/convertquote.d.ts.map +1 -1
  25. package/dist/commonjs/models/operations/convertquote.js +18 -1
  26. package/dist/commonjs/models/operations/convertquote.js.map +1 -1
  27. package/dist/commonjs/models/operations/createinvoice.d.ts +25 -0
  28. package/dist/commonjs/models/operations/createinvoice.d.ts.map +1 -1
  29. package/dist/commonjs/models/operations/createinvoice.js +10 -0
  30. package/dist/commonjs/models/operations/createinvoice.js.map +1 -1
  31. package/dist/commonjs/react-query/invoicesConvertQuote.d.ts +4 -1
  32. package/dist/commonjs/react-query/invoicesConvertQuote.d.ts.map +1 -1
  33. package/dist/commonjs/react-query/invoicesConvertQuote.js +4 -1
  34. package/dist/commonjs/react-query/invoicesConvertQuote.js.map +1 -1
  35. package/dist/commonjs/sdk/invoices.d.ts +4 -1
  36. package/dist/commonjs/sdk/invoices.d.ts.map +1 -1
  37. package/dist/commonjs/sdk/invoices.js +4 -1
  38. package/dist/commonjs/sdk/invoices.js.map +1 -1
  39. package/dist/esm/__tests__/vendors.test.js +1 -1
  40. package/dist/esm/__tests__/webhooks.test.js +5 -4
  41. package/dist/esm/__tests__/webhooks.test.js.map +1 -1
  42. package/dist/esm/__tests__/zoneDevicesCreate.test.js +4 -0
  43. package/dist/esm/__tests__/zoneDevicesCreate.test.js.map +1 -1
  44. package/dist/esm/__tests__/zones.test.js +15 -9
  45. package/dist/esm/__tests__/zones.test.js.map +1 -1
  46. package/dist/esm/admin-funcs/zoneDevicesProvisioning.d.ts +4 -1
  47. package/dist/esm/admin-funcs/zoneDevicesProvisioning.d.ts.map +1 -1
  48. package/dist/esm/admin-funcs/zoneDevicesProvisioning.js +3 -8
  49. package/dist/esm/admin-funcs/zoneDevicesProvisioning.js.map +1 -1
  50. package/dist/esm/funcs/invoicesConvertQuote.d.ts +4 -1
  51. package/dist/esm/funcs/invoicesConvertQuote.d.ts.map +1 -1
  52. package/dist/esm/funcs/invoicesConvertQuote.js +7 -3
  53. package/dist/esm/funcs/invoicesConvertQuote.js.map +1 -1
  54. package/dist/esm/lib/config.d.ts +2 -2
  55. package/dist/esm/lib/config.js +2 -2
  56. package/dist/esm/models/components/invoice.d.ts +5 -0
  57. package/dist/esm/models/components/invoice.d.ts.map +1 -1
  58. package/dist/esm/models/components/invoice.js +4 -0
  59. package/dist/esm/models/components/invoice.js.map +1 -1
  60. package/dist/esm/models/operations/convertquote.d.ts +21 -0
  61. package/dist/esm/models/operations/convertquote.d.ts.map +1 -1
  62. package/dist/esm/models/operations/convertquote.js +16 -0
  63. package/dist/esm/models/operations/convertquote.js.map +1 -1
  64. package/dist/esm/models/operations/createinvoice.d.ts +25 -0
  65. package/dist/esm/models/operations/createinvoice.d.ts.map +1 -1
  66. package/dist/esm/models/operations/createinvoice.js +10 -0
  67. package/dist/esm/models/operations/createinvoice.js.map +1 -1
  68. package/dist/esm/react-query/invoicesConvertQuote.d.ts +4 -1
  69. package/dist/esm/react-query/invoicesConvertQuote.d.ts.map +1 -1
  70. package/dist/esm/react-query/invoicesConvertQuote.js +4 -1
  71. package/dist/esm/react-query/invoicesConvertQuote.js.map +1 -1
  72. package/dist/esm/sdk/invoices.d.ts +4 -1
  73. package/dist/esm/sdk/invoices.d.ts.map +1 -1
  74. package/dist/esm/sdk/invoices.js +4 -1
  75. package/dist/esm/sdk/invoices.js.map +1 -1
  76. package/jsr.json +1 -1
  77. package/package.json +1 -1
  78. package/src/__tests__/vendors.test.ts +1 -1
  79. package/src/__tests__/webhooks.test.ts +5 -4
  80. package/src/__tests__/zoneDevicesCreate.test.ts +6 -0
  81. package/src/__tests__/zones.test.ts +15 -9
  82. package/src/admin-funcs/zoneDevicesProvisioning.ts +14 -2
  83. package/src/funcs/invoicesConvertQuote.ts +7 -3
  84. package/src/lib/config.ts +2 -2
  85. package/src/models/components/invoice.ts +9 -0
  86. package/src/models/operations/convertquote.ts +46 -0
  87. package/src/models/operations/createinvoice.ts +35 -0
  88. package/src/react-query/invoicesConvertQuote.ts +4 -1
  89. package/src/sdk/invoices.ts +4 -1
@@ -23,7 +23,10 @@ import { useGreenSecurityContext } from "./_context.js";
23
23
  * invoices; a caller allowed to create the invoice but not to update the
24
24
  * linked `VendorCredential` responds `401`.
25
25
  *
26
- * Takes no request body.
26
+ * Optionally takes `send_to_company_manager`, for a quote linked to a
27
+ * `VendorCredential`: send `true` when the vendor is sending the
28
+ * converted invoice to their company managers to pay instead of paying
29
+ * it themselves. It follows the same rules as on `POST /invoices`.
27
30
  *
28
31
  * **Permissions.** Requires a valid token. This endpoint is not gated on a named permission—the caller's role and their relationship to the record decide what it returns.
29
32
  */
@@ -1 +1 @@
1
- {"version":3,"file":"invoicesConvertQuote.js","sourceRoot":"","sources":["../../../src/react-query/invoicesConvertQuote.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EAEL,WAAW,GAEZ,MAAM,uBAAuB,CAAC;AAE/B,OAAO,EAAE,oBAAoB,EAAE,MAAM,kCAAkC,CAAC;AACxE,OAAO,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAC;AActD,OAAO,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAC7C,OAAO,EAAE,uBAAuB,EAAE,MAAM,eAAe,CAAC;AAsBxD;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,MAAM,UAAU,+BAA+B,CAC7C,OAIC;IAMD,MAAM,MAAM,GAAG,uBAAuB,EAAE,CAAC;IACzC,OAAO,WAAW,CAAC;QACjB,GAAG,iCAAiC,CAAC,MAAM,EAAE,OAAO,CAAC;QACrD,GAAG,OAAO;KACX,CAAC,CAAC;AACL,CAAC;AAED,MAAM,UAAU,+BAA+B;IAC7C,OAAO,CAAC,+BAA+B,EAAE,UAAU,EAAE,cAAc,CAAC,CAAC;AACvE,CAAC;AAED,MAAM,UAAU,iCAAiC,CAC/C,OAA0B,EAC1B,WAA4B;IAO5B,OAAO;QACL,WAAW,EAAE,+BAA+B,EAAE;QAC9C,UAAU,EAAE,SAAS,8BAA8B,CAAC,EAClD,OAAO,EACP,OAAO,GACR;YACC,MAAM,aAAa,GAAG;gBACpB,GAAG,WAAW;gBACd,GAAG,OAAO;gBACV,YAAY,EAAE;oBACZ,GAAG,WAAW,EAAE,YAAY;oBAC5B,GAAG,OAAO,EAAE,YAAY;oBACxB,MAAM,EAAE,cAAc,CACpB,WAAW,EAAE,YAAY,EAAE,MAAM,EACjC,OAAO,EAAE,YAAY,EAAE,MAAM,CAC9B;iBACF;aACF,CAAC;YACF,OAAO,WAAW,CAAC,oBAAoB,CACrC,OAAO,EACP,OAAO,EACP,aAAa,CACd,CAAC,CAAC;QACL,CAAC;KACF,CAAC;AACJ,CAAC"}
1
+ {"version":3,"file":"invoicesConvertQuote.js","sourceRoot":"","sources":["../../../src/react-query/invoicesConvertQuote.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EAEL,WAAW,GAEZ,MAAM,uBAAuB,CAAC;AAE/B,OAAO,EAAE,oBAAoB,EAAE,MAAM,kCAAkC,CAAC;AACxE,OAAO,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAC;AActD,OAAO,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAC7C,OAAO,EAAE,uBAAuB,EAAE,MAAM,eAAe,CAAC;AAsBxD;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AACH,MAAM,UAAU,+BAA+B,CAC7C,OAIC;IAMD,MAAM,MAAM,GAAG,uBAAuB,EAAE,CAAC;IACzC,OAAO,WAAW,CAAC;QACjB,GAAG,iCAAiC,CAAC,MAAM,EAAE,OAAO,CAAC;QACrD,GAAG,OAAO;KACX,CAAC,CAAC;AACL,CAAC;AAED,MAAM,UAAU,+BAA+B;IAC7C,OAAO,CAAC,+BAA+B,EAAE,UAAU,EAAE,cAAc,CAAC,CAAC;AACvE,CAAC;AAED,MAAM,UAAU,iCAAiC,CAC/C,OAA0B,EAC1B,WAA4B;IAO5B,OAAO;QACL,WAAW,EAAE,+BAA+B,EAAE;QAC9C,UAAU,EAAE,SAAS,8BAA8B,CAAC,EAClD,OAAO,EACP,OAAO,GACR;YACC,MAAM,aAAa,GAAG;gBACpB,GAAG,WAAW;gBACd,GAAG,OAAO;gBACV,YAAY,EAAE;oBACZ,GAAG,WAAW,EAAE,YAAY;oBAC5B,GAAG,OAAO,EAAE,YAAY;oBACxB,MAAM,EAAE,cAAc,CACpB,WAAW,EAAE,YAAY,EAAE,MAAM,EACjC,OAAO,EAAE,YAAY,EAAE,MAAM,CAC9B;iBACF;aACF,CAAC;YACF,OAAO,WAAW,CAAC,oBAAoB,CACrC,OAAO,EACP,OAAO,EACP,aAAa,CACd,CAAC,CAAC;QACL,CAAC;KACF,CAAC;AACJ,CAAC"}
@@ -119,7 +119,10 @@ export declare class Invoices extends ClientSDK {
119
119
  * invoices; a caller allowed to create the invoice but not to update the
120
120
  * linked `VendorCredential` responds `401`.
121
121
  *
122
- * Takes no request body.
122
+ * Optionally takes `send_to_company_manager`, for a quote linked to a
123
+ * `VendorCredential`: send `true` when the vendor is sending the
124
+ * converted invoice to their company managers to pay instead of paying
125
+ * it themselves. It follows the same rules as on `POST /invoices`.
123
126
  *
124
127
  * **Permissions.** Requires a valid token. This endpoint is not gated on a named permission—the caller's role and their relationship to the record decide what it returns.
125
128
  */
@@ -1 +1 @@
1
- {"version":3,"file":"invoices.d.ts","sourceRoot":"","sources":["../../../src/sdk/invoices.ts"],"names":[],"mappings":"AAMA,OAAO,EACL,gCAAgC,EAEjC,MAAM,4CAA4C,CAAC;AAOpD,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,OAAO,EAAE,gCAAgC,EAAE,MAAM,4CAA4C,CAAC;AAE9F,qBAAa,QAAS,SAAQ,SAAS;IACrC;;;;;;;;;;;OAWG;IACG,UAAU,CACd,OAAO,EAAE,UAAU,CAAC,iBAAiB,EACrC,OAAO,CAAC,EAAE,cAAc,GACvB,OAAO,CAAC,UAAU,CAAC,OAAO,CAAC;IAQ9B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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ACG,WAAW,CACf,OAAO,EAAE,UAAU,CAAC,kBAAkB,EACtC,OAAO,CAAC,EAAE,cAAc,GACvB,OAAO,CAAC,UAAU,CAAC,wBAAwB,CAAC;IAQ/C;;;;;;;;;;;;;;;;;;;;;;;OAuBG;IACG,YAAY,CAChB,OAAO,EAAE,UAAU,CAAC,mBAAmB,EACvC,OAAO,CAAC,EAAE,cAAc,GACvB,OAAO,CAAC,UAAU,CAAC,0BAA0B,CAAC;IAQjD;;;;;;;;;;;;;;;;;;OAkBG;IACG,cAAc,CAClB,OAAO,EAAE,UAAU,CAAC,qBAAqB,EACzC,OAAO,CAAC,EAAE,cAAc,GACvB,OAAO,CAAC,UAAU,CAAC,yBAAyB,CAAC;IAQhD;;;;;;;;OAQG;IACG,uBAAuB,CAC3B,OAAO,EAAE,UAAU,CAAC,8BAA8B,EAClD,OAAO,CAAC,EAAE,cAAc,GACvB,OAAO,CAAC,UAAU,CAAC,mCAAmC,CAAC;IAQ1D;;;;;;;OAOG;IACG,sBAAsB,CAC1B,OAAO,EAAE,UAAU,CAAC,6BAA6B,EACjD,OAAO,CAAC,EAAE,cAAc,GAAG;QACzB,oBAAoB,CAAC,EAAE,gCAAgC,CAAC;KACzD,GACA,OAAO,CAAC,UAAU,CAAC,8BAA8B,GAAG,SAAS,CAAC;CAOlE"}
@@ -137,7 +137,10 @@ export class Invoices extends ClientSDK {
137
137
  * invoices; a caller allowed to create the invoice but not to update the
138
138
  * linked `VendorCredential` responds `401`.
139
139
  *
140
- * Takes no request body.
140
+ * Optionally takes `send_to_company_manager`, for a quote linked to a
141
+ * `VendorCredential`: send `true` when the vendor is sending the
142
+ * converted invoice to their company managers to pay instead of paying
143
+ * it themselves. It follows the same rules as on `POST /invoices`.
141
144
  *
142
145
  * **Permissions.** Requires a valid token. This endpoint is not gated on a named permission—the caller's role and their relationship to the record decide what it returns.
143
146
  */
@@ -1 +1 @@
1
- {"version":3,"file":"invoices.js","sourceRoot":"","sources":["../../../src/sdk/invoices.ts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AC,qBAAqB,CACtC,IAAI,EACJ,OAAO,EACP,OAAO,CACR,CAAC,CAAC;IACL,CAAC;IAED;;;;;;;;;;;;;;;;OAgBG;IACH,KAAK,CAAC,aAAa,CACjB,OAAwC,EACxC,OAAwB;QAExB,OAAO,WAAW,CAAC,qBAAqB,CACtC,IAAI,EACJ,OAAO,EACP,OAAO,CACR,CAAC,CAAC;IACL,CAAC;IAED;;;;;;;OAOG;IACH,KAAK,CAAC,WAAW,CACf,OAAsC,EACtC,OAAwB;QAExB,OAAO,WAAW,CAAC,mBAAmB,CACpC,IAAI,EACJ,OAAO,EACP,OAAO,CACR,CAAC,CAAC;IACL,CAAC;IAED;;;;;;;;;;;;;;;;;;;;OAoBG;IACH,KAAK,CAAC,YAAY,CAChB,OAAuC,EACvC,OAAwB;QAExB,OAAO,WAAW,CAAC,oBAAoB,CACrC,IAAI,EACJ,OAAO,EACP,OAAO,CACR,CAAC,CAAC;IACL,CAAC;IAED;;;;;;;;;;;;;;;;;;OAkBG;IACH,KAAK,CAAC,cAAc,CAClB,OAAyC,EACzC,OAAwB;QAExB,OAAO,WAAW,CAAC,sBAAsB,CACvC,IAAI,EACJ,OAAO,EACP,OAAO,CACR,CAAC,CAAC;IACL,CAAC;IAED;;;;;;;;OAQG;IACH,KAAK,CAAC,uBAAuB,CAC3B,OAAkD,EAClD,OAAwB;QAExB,OAAO,WAAW,CAAC,+BAA+B,CAChD,IAAI,EACJ,OAAO,EACP,OAAO,CACR,CAAC,CAAC;IACL,CAAC;IAED;;;;;;;OAOG;IACH,KAAK,CAAC,sBAAsB,CAC1B,OAAiD,EACjD,OAEC;QAED,OAAO,WAAW,CAAC,8BAA8B,CAC/C,IAAI,EACJ,OAAO,EACP,OAAO,CACR,CAAC,CAAC;IACL,CAAC;CACF"}
1
+ {"version":3,"file":"invoices.js","sourceRoot":"","sources":["../../../src/sdk/invoices.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EAAE,oBAAoB,EAAE,MAAM,k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CAAC;IAED;;;;;;;;;;;;;;;;OAgBG;IACH,KAAK,CAAC,aAAa,CACjB,OAAwC,EACxC,OAAwB;QAExB,OAAO,WAAW,CAAC,qBAAqB,CACtC,IAAI,EACJ,OAAO,EACP,OAAO,CACR,CAAC,CAAC;IACL,CAAC;IAED;;;;;;;OAOG;IACH,KAAK,CAAC,WAAW,CACf,OAAsC,EACtC,OAAwB;QAExB,OAAO,WAAW,CAAC,mBAAmB,CACpC,IAAI,EACJ,OAAO,EACP,OAAO,CACR,CAAC,CAAC;IACL,CAAC;IAED;;;;;;;;;;;;;;;;;;;;;;;OAuBG;IACH,KAAK,CAAC,YAAY,CAChB,OAAuC,EACvC,OAAwB;QAExB,OAAO,WAAW,CAAC,oBAAoB,CACrC,IAAI,EACJ,OAAO,EACP,OAAO,CACR,CAAC,CAAC;IACL,CAAC;IAED;;;;;;;;;;;;;;;;;;OAkBG;IACH,KAAK,CAAC,cAAc,CAClB,OAAyC,EACzC,OAAwB;QAExB,OAAO,WAAW,CAAC,sBAAsB,CACvC,IAAI,EACJ,OAAO,EACP,OAAO,CACR,CAAC,CAAC;IACL,CAAC;IAED;;;;;;;;OAQG;IACH,KAAK,CAAC,uBAAuB,CAC3B,OAAkD,EAClD,OAAwB;QAExB,OAAO,WAAW,CAAC,+BAA+B,CAChD,IAAI,EACJ,OAAO,EACP,OAAO,CACR,CAAC,CAAC;IACL,CAAC;IAED;;;;;;;OAOG;IACH,KAAK,CAAC,sBAAsB,CAC1B,OAAiD,EACjD,OAEC;QAED,OAAO,WAAW,CAAC,8BAA8B,CAC/C,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.48.0-beta.5",
5
+ "version": "0.48.0-beta.7",
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.48.0-beta.5",
3
+ "version": "0.48.0-beta.7",
4
4
  "author": "Green Security LLC",
5
5
  "type": "module",
6
6
  "tshy": {
@@ -121,7 +121,7 @@ test("Vendors List Vendor Credits", async () => {
121
121
  page: 1,
122
122
  useUrlParams: false,
123
123
  },
124
- creditBalance: 8145.95,
124
+ creditBalance: 9732.08,
125
125
  });
126
126
  });
127
127
 
@@ -62,10 +62,11 @@ test("Webhooks Updates The Webhook Endpoint With The Given Id", async () => {
62
62
  id: 220782,
63
63
  webhookEndpointUpdate: {
64
64
  webhookUrl: "https://example.com/webhook/incoming",
65
- subscriptions: [
66
- "Vendor.updated",
67
- "Vendor.created",
68
- ],
65
+ subscriptions: {
66
+ model: "Vendor",
67
+ action: "updated",
68
+ expands: "vendor.company,vendor.user",
69
+ },
69
70
  consumers: {
70
71
  systemId: 1,
71
72
  facilityId: 1,
@@ -45,6 +45,12 @@ describe("__internal.zoneDevices", () => {
45
45
  expect(doPostMock).toHaveBeenCalledWith("/zone-devices/42/provisioning", {});
46
46
  });
47
47
 
48
+ it("asks for provisioning without a certificate when told to", () => {
49
+ __internal.zoneDevices.provisioning(42, { certificate: false });
50
+
51
+ expect(doPostMock).toHaveBeenCalledWith("/zone-devices/42/provisioning", { certificate: false });
52
+ });
53
+
48
54
  it("posts the gateway body verbatim to /zone-devices", () => {
49
55
  const body = {
50
56
  zone_id: 7,
@@ -35,9 +35,6 @@ test("Zones List Or Search Security Zones", async () => {
35
35
  useUrlParams: false,
36
36
  },
37
37
  items: [
38
- {
39
- facility: {},
40
- },
41
38
  {
42
39
  facility: {
43
40
  contacts: {
@@ -45,24 +42,33 @@ test("Zones List Or Search Security Zones", async () => {
45
42
  status: "Deleted",
46
43
  department: 123,
47
44
  },
48
- adminContact: null,
49
- techContact: {
45
+ adminContact: {
50
46
  status: "Active",
51
- department: null,
47
+ department: 123,
48
+ },
49
+ techContact: {
50
+ status: "Deleted",
51
+ department: 123,
52
52
  },
53
53
  greenSecurityCsm: {
54
+ status: "Inactive",
55
+ department: 123,
56
+ },
57
+ accountManager: {
54
58
  status: "Active",
55
59
  department: 123,
56
60
  },
57
- accountManager: null,
58
61
  },
59
62
  vendorGuestPolicy: {
60
- enabled: true,
63
+ enabled: false,
61
64
  vendorGuestLimitAndOr: "and",
62
65
  vendorGuestRequireEmail: false,
63
66
  },
64
67
  },
65
68
  },
69
+ {
70
+ facility: {},
71
+ },
66
72
  ],
67
73
  });
68
74
  });
@@ -80,7 +86,7 @@ test("Zones Security Zone Checkin", async () => {
80
86
 
81
87
  const result = await greenSecurity.zones.securityZoneCheckin({
82
88
  qrCode: "<value>",
83
- zoneId: 542818,
89
+ zoneId: 185875,
84
90
  });
85
91
  expect(result).toBeDefined();
86
92
  expect(result).toEqual({});
@@ -7,6 +7,18 @@ import { $doPost, internalApiResult } from "./doAdmin.js";
7
7
  //
8
8
  // Internal for the same reason as zoneDevicesCreate. The response carries secrets: callers keep it
9
9
  // in memory for the provisioning run and never persist or log it.
10
- export function zoneDevicesProvisioning(zoneDeviceId: number): internalApiResult {
11
- return new APIPromise($doPost(`/zone-devices/${zoneDeviceId}/provisioning`, {}));
10
+ //
11
+ // `certificate: false` is for tasks that never write a certificate to the gateway (edit, reboot):
12
+ // the server then mints none and returns no IoT credentials, since minting revokes the certificate
13
+ // the gateway already runs on. Left out, the server mints when none is stored, as before.
14
+ export type zoneDevicesProvisioningOptions = {
15
+ certificate?: boolean;
16
+ };
17
+
18
+ export function zoneDevicesProvisioning(
19
+ zoneDeviceId: number,
20
+ options: zoneDevicesProvisioningOptions = {}
21
+ ): internalApiResult {
22
+ const body = options.certificate === false ? { certificate: false } : {};
23
+ return new APIPromise($doPost(`/zone-devices/${zoneDeviceId}/provisioning`, body));
12
24
  }
@@ -3,7 +3,7 @@
3
3
  */
4
4
 
5
5
  import { GreenSecurityCore } from "../core.js";
6
- import { encodeSimple } from "../lib/encodings.js";
6
+ import { encodeJSON, encodeSimple } from "../lib/encodings.js";
7
7
  import { matchStatusCode } from "../lib/http.js";
8
8
  import * as M from "../lib/matchers.js";
9
9
  import { compactMap } from "../lib/primitives.js";
@@ -43,7 +43,10 @@ import { Result } from "../types/fp.js";
43
43
  * invoices; a caller allowed to create the invoice but not to update the
44
44
  * linked `VendorCredential` responds `401`.
45
45
  *
46
- * Takes no request body.
46
+ * Optionally takes `send_to_company_manager`, for a quote linked to a
47
+ * `VendorCredential`: send `true` when the vendor is sending the
48
+ * converted invoice to their company managers to pay instead of paying
49
+ * it themselves. It follows the same rules as on `POST /invoices`.
47
50
  *
48
51
  * **Permissions.** Requires a valid token. This endpoint is not gated on a named permission—the caller's role and their relationship to the record decide what it returns.
49
52
  *
@@ -104,7 +107,7 @@ async function $do(
104
107
  return [parsed, { status: "invalid" }];
105
108
  }
106
109
  const payload = parsed.value;
107
- const body = null;
110
+ const body = encodeJSON("body", payload.RequestBody, { explode: true });
108
111
 
109
112
  const pathParams = {
110
113
  id: encodeSimple("id", payload.id, {
@@ -115,6 +118,7 @@ async function $do(
115
118
  const path = pathToFunc("/invoices/{id}/convert")(pathParams);
116
119
 
117
120
  const headers = new Headers(compactMap({
121
+ "Content-Type": "application/json",
118
122
  Accept: "application/json",
119
123
  }));
120
124
 
package/src/lib/config.ts CHANGED
@@ -80,8 +80,8 @@ export function serverURLFromOptions(options: SDKOptions): URL | null {
80
80
  export const SDK_METADATA = {
81
81
  language: "typescript",
82
82
  openapiDocVersion: "0.47.0",
83
- sdkVersion: "0.48.0-beta.5",
83
+ sdkVersion: "0.48.0-beta.7",
84
84
  genVersion: "2.950.2",
85
85
  userAgent:
86
- "speakeasy-sdk/typescript 0.48.0-beta.5 2.950.2 0.47.0 @greensecurity/javascript-sdk",
86
+ "speakeasy-sdk/typescript 0.48.0-beta.7 2.950.2 0.47.0 @greensecurity/javascript-sdk",
87
87
  } as const;
@@ -141,6 +141,10 @@ export type Invoice = {
141
141
  * When the invoice was created.
142
142
  */
143
143
  dateCreated?: string | null | undefined;
144
+ /**
145
+ * When the vendor sent this invoice to their company managers to pay instead of paying it themselves (`send_to_company_manager` on `POST /invoices` or `POST /invoices/{id}/convert`). `null` if it was never sent, or if the vendor took it back or settled it themselves. It is kept on an invoice the managers paid, and on one that was later voided.
146
+ */
147
+ dateSentToCompanyManager?: string | null | undefined;
144
148
  /**
145
149
  * The date the invoice payment is due. `null` if no due date is set.
146
150
  */
@@ -393,6 +397,7 @@ export const Invoice$inboundSchema: z.ZodType<Invoice, z.ZodTypeDef, unknown> =
393
397
  date_processed: z.nullable(types.string()).optional(),
394
398
  date_paid: z.nullable(types.string()).optional(),
395
399
  date_created: z.nullable(types.string()).optional(),
400
+ date_sent_to_company_manager: z.nullable(types.string()).optional(),
396
401
  date_due: z.nullable(types.string()).optional(),
397
402
  amount: z.nullable(types.number()).optional(),
398
403
  status: z.nullable(types.string()).optional(),
@@ -421,6 +426,7 @@ export const Invoice$inboundSchema: z.ZodType<Invoice, z.ZodTypeDef, unknown> =
421
426
  "date_processed": "dateProcessed",
422
427
  "date_paid": "datePaid",
423
428
  "date_created": "dateCreated",
429
+ "date_sent_to_company_manager": "dateSentToCompanyManager",
424
430
  "date_due": "dateDue",
425
431
  "financial_status": "financialStatus",
426
432
  "amount_not_paid": "amountNotPaid",
@@ -439,6 +445,7 @@ export type Invoice$Outbound = {
439
445
  date_processed?: string | null | undefined;
440
446
  date_paid?: string | null | undefined;
441
447
  date_created?: string | null | undefined;
448
+ date_sent_to_company_manager?: string | null | undefined;
442
449
  date_due?: string | null | undefined;
443
450
  amount?: number | null | undefined;
444
451
  status?: string | null | undefined;
@@ -471,6 +478,7 @@ export const Invoice$outboundSchema: z.ZodType<
471
478
  dateProcessed: z.nullable(z.string()).optional(),
472
479
  datePaid: z.nullable(z.string()).optional(),
473
480
  dateCreated: z.nullable(z.string()).optional(),
481
+ dateSentToCompanyManager: z.nullable(z.string()).optional(),
474
482
  dateDue: z.nullable(z.string()).optional(),
475
483
  amount: z.nullable(z.number().int()).optional(),
476
484
  status: z.nullable(z.string()).optional(),
@@ -498,6 +506,7 @@ export const Invoice$outboundSchema: z.ZodType<
498
506
  dateProcessed: "date_processed",
499
507
  datePaid: "date_paid",
500
508
  dateCreated: "date_created",
509
+ dateSentToCompanyManager: "date_sent_to_company_manager",
501
510
  dateDue: "date_due",
502
511
  financialStatus: "financial_status",
503
512
  amountNotPaid: "amount_not_paid",
@@ -9,11 +9,25 @@ import { Result as SafeParseResult } from "../../types/fp.js";
9
9
  import * as types from "../../types/primitives.js";
10
10
  import { SDKValidationError } from "../errors/sdkvalidationerror.js";
11
11
 
12
+ /**
13
+ * Whether the vendor is sending the converted invoice to their company managers.
14
+ */
15
+ export type ConvertQuoteRequestBody = {
16
+ /**
17
+ * Set to `true` when the vendor is sending the converted invoice to their company managers to pay instead of paying it themselves, and `false` to take it back. Recorded on the invoice as `date_sent_to_company_manager`; the managers are asked to pay once the credential is submitted. Omit the field to leave the invoice as it is. Ignored when no `VendorCredential` is linked to the quote, for an invoice with nothing left to pay, and when the caller is not the vendor. A vendor whose company has no active company manager who sends `true` is refused with `400` and the quote is not converted.
18
+ */
19
+ sendToCompanyManager?: boolean | undefined;
20
+ };
21
+
12
22
  export type ConvertQuoteRequest = {
13
23
  /**
14
24
  * The identifier of the object.
15
25
  */
16
26
  id: number;
27
+ /**
28
+ * Whether the vendor is sending the converted invoice to their company managers.
29
+ */
30
+ requestBody?: ConvertQuoteRequestBody | undefined;
17
31
  };
18
32
 
19
33
  /**
@@ -43,9 +57,36 @@ export type ConvertQuoteConvertQuoteOk = {
43
57
  total?: number | null | undefined;
44
58
  };
45
59
 
60
+ /** @internal */
61
+ export type ConvertQuoteRequestBody$Outbound = {
62
+ send_to_company_manager?: boolean | undefined;
63
+ };
64
+
65
+ /** @internal */
66
+ export const ConvertQuoteRequestBody$outboundSchema: z.ZodType<
67
+ ConvertQuoteRequestBody$Outbound,
68
+ z.ZodTypeDef,
69
+ ConvertQuoteRequestBody
70
+ > = z.object({
71
+ sendToCompanyManager: z.boolean().optional(),
72
+ }).transform((v) => {
73
+ return remap$(v, {
74
+ sendToCompanyManager: "send_to_company_manager",
75
+ });
76
+ });
77
+
78
+ export function convertQuoteRequestBodyToJSON(
79
+ convertQuoteRequestBody: ConvertQuoteRequestBody,
80
+ ): string {
81
+ return JSON.stringify(
82
+ ConvertQuoteRequestBody$outboundSchema.parse(convertQuoteRequestBody),
83
+ );
84
+ }
85
+
46
86
  /** @internal */
47
87
  export type ConvertQuoteRequest$Outbound = {
48
88
  id: number;
89
+ RequestBody?: ConvertQuoteRequestBody$Outbound | undefined;
49
90
  };
50
91
 
51
92
  /** @internal */
@@ -55,6 +96,11 @@ export const ConvertQuoteRequest$outboundSchema: z.ZodType<
55
96
  ConvertQuoteRequest
56
97
  > = z.object({
57
98
  id: z.number().int(),
99
+ requestBody: z.lazy(() => ConvertQuoteRequestBody$outboundSchema).optional(),
100
+ }).transform((v) => {
101
+ return remap$(v, {
102
+ requestBody: "RequestBody",
103
+ });
58
104
  });
59
105
 
60
106
  export function convertQuoteRequestToJSON(
@@ -62,6 +62,10 @@ export type Five = {
62
62
  * Set to `true` when the payer intends to settle this order from their credit balance before their payment method is charged. This affects only how the convenience fee is calculated: the fee pays for card processing, so it is assessed on the amount the card is left to cover once credits have been applied, and an order a balance covers in full carries none. No credits are debited here, and the balance is read from the payer's own ledger rather than taken from this request. Settle the credits with `POST /invoices/{id}/payment` and `use_credits: true`.
63
63
  */
64
64
  useCredits?: boolean | undefined;
65
+ /**
66
+ * For a `vendor_credential_id` invoice, set to `true` when the vendor is sending the invoice to their company managers to pay instead of paying it themselves. The server records it on the invoice as `date_sent_to_company_manager`, and asks the managers to pay once the credential is submitted. Send it without `credential_pricing_ids` to send an invoice the credential already has. Set to `false` to take the invoice back. Omit the field to leave the invoice as it is. Ignored for a quote, for an invoice with nothing left to pay, and when the caller is not the vendor. A vendor whose company has no active company manager who sends `true` is refused with `400` before anything is created.
67
+ */
68
+ sendToCompanyManager?: boolean | undefined;
65
69
  };
66
70
 
67
71
  export const CreateInvoiceRequestBodyInvoicesPaymentHandler = {
@@ -113,6 +117,10 @@ export type Four = {
113
117
  * Set to `true` when the payer intends to settle this order from their credit balance before their payment method is charged. This affects only how the convenience fee is calculated: the fee pays for card processing, so it is assessed on the amount the card is left to cover once credits have been applied, and an order a balance covers in full carries none. No credits are debited here, and the balance is read from the payer's own ledger rather than taken from this request. Settle the credits with `POST /invoices/{id}/payment` and `use_credits: true`.
114
118
  */
115
119
  useCredits?: boolean | undefined;
120
+ /**
121
+ * For a `vendor_credential_id` invoice, set to `true` when the vendor is sending the invoice to their company managers to pay instead of paying it themselves. The server records it on the invoice as `date_sent_to_company_manager`, and asks the managers to pay once the credential is submitted. Send it without `credential_pricing_ids` to send an invoice the credential already has. Set to `false` to take the invoice back. Omit the field to leave the invoice as it is. Ignored for a quote, for an invoice with nothing left to pay, and when the caller is not the vendor. A vendor whose company has no active company manager who sends `true` is refused with `400` before anything is created.
122
+ */
123
+ sendToCompanyManager?: boolean | undefined;
116
124
  };
117
125
 
118
126
  export const CreateInvoiceRequestBodyPaymentHandler = {
@@ -164,6 +172,10 @@ export type Three = {
164
172
  * Set to `true` when the payer intends to settle this order from their credit balance before their payment method is charged. This affects only how the convenience fee is calculated: the fee pays for card processing, so it is assessed on the amount the card is left to cover once credits have been applied, and an order a balance covers in full carries none. No credits are debited here, and the balance is read from the payer's own ledger rather than taken from this request. Settle the credits with `POST /invoices/{id}/payment` and `use_credits: true`.
165
173
  */
166
174
  useCredits?: boolean | undefined;
175
+ /**
176
+ * For a `vendor_credential_id` invoice, set to `true` when the vendor is sending the invoice to their company managers to pay instead of paying it themselves. The server records it on the invoice as `date_sent_to_company_manager`, and asks the managers to pay once the credential is submitted. Send it without `credential_pricing_ids` to send an invoice the credential already has. Set to `false` to take the invoice back. Omit the field to leave the invoice as it is. Ignored for a quote, for an invoice with nothing left to pay, and when the caller is not the vendor. A vendor whose company has no active company manager who sends `true` is refused with `400` before anything is created.
177
+ */
178
+ sendToCompanyManager?: boolean | undefined;
167
179
  };
168
180
 
169
181
  export const RequestBodyPaymentHandler = {
@@ -213,6 +225,10 @@ export type CreateInvoiceRequestBody2 = {
213
225
  * Set to `true` when the payer intends to settle this order from their credit balance before their payment method is charged. This affects only how the convenience fee is calculated: the fee pays for card processing, so it is assessed on the amount the card is left to cover once credits have been applied, and an order a balance covers in full carries none. No credits are debited here, and the balance is read from the payer's own ledger rather than taken from this request. Settle the credits with `POST /invoices/{id}/payment` and `use_credits: true`.
214
226
  */
215
227
  useCredits?: boolean | undefined;
228
+ /**
229
+ * For a `vendor_credential_id` invoice, set to `true` when the vendor is sending the invoice to their company managers to pay instead of paying it themselves. The server records it on the invoice as `date_sent_to_company_manager`, and asks the managers to pay once the credential is submitted. Send it without `credential_pricing_ids` to send an invoice the credential already has. Set to `false` to take the invoice back. Omit the field to leave the invoice as it is. Ignored for a quote, for an invoice with nothing left to pay, and when the caller is not the vendor. A vendor whose company has no active company manager who sends `true` is refused with `400` before anything is created.
230
+ */
231
+ sendToCompanyManager?: boolean | undefined;
216
232
  };
217
233
 
218
234
  export const PaymentHandler = {
@@ -260,6 +276,10 @@ export type RequestBody1 = {
260
276
  * Set to `true` when the payer intends to settle this order from their credit balance before their payment method is charged. This affects only how the convenience fee is calculated: the fee pays for card processing, so it is assessed on the amount the card is left to cover once credits have been applied, and an order a balance covers in full carries none. No credits are debited here, and the balance is read from the payer's own ledger rather than taken from this request. Settle the credits with `POST /invoices/{id}/payment` and `use_credits: true`.
261
277
  */
262
278
  useCredits?: boolean | undefined;
279
+ /**
280
+ * For a `vendor_credential_id` invoice, set to `true` when the vendor is sending the invoice to their company managers to pay instead of paying it themselves. The server records it on the invoice as `date_sent_to_company_manager`, and asks the managers to pay once the credential is submitted. Send it without `credential_pricing_ids` to send an invoice the credential already has. Set to `false` to take the invoice back. Omit the field to leave the invoice as it is. Ignored for a quote, for an invoice with nothing left to pay, and when the caller is not the vendor. A vendor whose company has no active company manager who sends `true` is refused with `400` before anything is created.
281
+ */
282
+ sendToCompanyManager?: boolean | undefined;
263
283
  };
264
284
 
265
285
  /**
@@ -357,6 +377,7 @@ export type Five$Outbound = {
357
377
  invoice_type?: string | undefined;
358
378
  promo?: string | undefined;
359
379
  use_credits: boolean;
380
+ send_to_company_manager?: boolean | undefined;
360
381
  };
361
382
 
362
383
  /** @internal */
@@ -372,12 +393,14 @@ export const Five$outboundSchema: z.ZodType<Five$Outbound, z.ZodTypeDef, Five> =
372
393
  .optional(),
373
394
  promo: z.string().optional(),
374
395
  useCredits: z.boolean().default(false),
396
+ sendToCompanyManager: z.boolean().optional(),
375
397
  }).transform((v) => {
376
398
  return remap$(v, {
377
399
  vendorCredentialId: "vendor_credential_id",
378
400
  credentialPricingIds: "credential_pricing_ids",
379
401
  invoiceType: "invoice_type",
380
402
  useCredits: "use_credits",
403
+ sendToCompanyManager: "send_to_company_manager",
381
404
  });
382
405
  });
383
406
 
@@ -456,6 +479,7 @@ export type Four$Outbound = {
456
479
  invoice_type?: string | undefined;
457
480
  promo?: string | undefined;
458
481
  use_credits: boolean;
482
+ send_to_company_manager?: boolean | undefined;
459
483
  };
460
484
 
461
485
  /** @internal */
@@ -470,12 +494,14 @@ export const Four$outboundSchema: z.ZodType<Four$Outbound, z.ZodTypeDef, Four> =
470
494
  .optional(),
471
495
  promo: z.string().optional(),
472
496
  useCredits: z.boolean().default(false),
497
+ sendToCompanyManager: z.boolean().optional(),
473
498
  }).transform((v) => {
474
499
  return remap$(v, {
475
500
  systemId: "system_id",
476
501
  credentialPricingIds: "credential_pricing_ids",
477
502
  invoiceType: "invoice_type",
478
503
  useCredits: "use_credits",
504
+ sendToCompanyManager: "send_to_company_manager",
479
505
  });
480
506
  });
481
507
 
@@ -556,6 +582,7 @@ export type Three$Outbound = {
556
582
  invoice_type?: string | undefined;
557
583
  promo?: string | undefined;
558
584
  use_credits: boolean;
585
+ send_to_company_manager?: boolean | undefined;
559
586
  };
560
587
 
561
588
  /** @internal */
@@ -571,12 +598,14 @@ export const Three$outboundSchema: z.ZodType<
571
598
  invoiceType: CreateInvoiceRequestBodyInvoiceType$outboundSchema.optional(),
572
599
  promo: z.string().optional(),
573
600
  useCredits: z.boolean().default(false),
601
+ sendToCompanyManager: z.boolean().optional(),
574
602
  }).transform((v) => {
575
603
  return remap$(v, {
576
604
  facilityId: "facility_id",
577
605
  credentialPricingIds: "credential_pricing_ids",
578
606
  invoiceType: "invoice_type",
579
607
  useCredits: "use_credits",
608
+ sendToCompanyManager: "send_to_company_manager",
580
609
  });
581
610
  });
582
611
 
@@ -652,6 +681,7 @@ export type CreateInvoiceRequestBody2$Outbound = {
652
681
  invoice_type?: string | undefined;
653
682
  promo?: string | undefined;
654
683
  use_credits: boolean;
684
+ send_to_company_manager?: boolean | undefined;
655
685
  };
656
686
 
657
687
  /** @internal */
@@ -666,12 +696,14 @@ export const CreateInvoiceRequestBody2$outboundSchema: z.ZodType<
666
696
  invoiceType: RequestBodyInvoiceType$outboundSchema.optional(),
667
697
  promo: z.string().optional(),
668
698
  useCredits: z.boolean().default(false),
699
+ sendToCompanyManager: z.boolean().optional(),
669
700
  }).transform((v) => {
670
701
  return remap$(v, {
671
702
  companyId: "company_id",
672
703
  credentialPricingIds: "credential_pricing_ids",
673
704
  invoiceType: "invoice_type",
674
705
  useCredits: "use_credits",
706
+ sendToCompanyManager: "send_to_company_manager",
675
707
  });
676
708
  });
677
709
 
@@ -746,6 +778,7 @@ export type RequestBody1$Outbound = {
746
778
  invoice_type?: string | undefined;
747
779
  promo?: string | undefined;
748
780
  use_credits: boolean;
781
+ send_to_company_manager?: boolean | undefined;
749
782
  };
750
783
 
751
784
  /** @internal */
@@ -760,12 +793,14 @@ export const RequestBody1$outboundSchema: z.ZodType<
760
793
  invoiceType: InvoiceType$outboundSchema.optional(),
761
794
  promo: z.string().optional(),
762
795
  useCredits: z.boolean().default(false),
796
+ sendToCompanyManager: z.boolean().optional(),
763
797
  }).transform((v) => {
764
798
  return remap$(v, {
765
799
  vendorId: "vendor_id",
766
800
  credentialPricingIds: "credential_pricing_ids",
767
801
  invoiceType: "invoice_type",
768
802
  useCredits: "use_credits",
803
+ sendToCompanyManager: "send_to_company_manager",
769
804
  });
770
805
  });
771
806
 
@@ -63,7 +63,10 @@ export type InvoicesConvertQuoteMutationError =
63
63
  * invoices; a caller allowed to create the invoice but not to update the
64
64
  * linked `VendorCredential` responds `401`.
65
65
  *
66
- * Takes no request body.
66
+ * Optionally takes `send_to_company_manager`, for a quote linked to a
67
+ * `VendorCredential`: send `true` when the vendor is sending the
68
+ * converted invoice to their company managers to pay instead of paying
69
+ * it themselves. It follows the same rules as on `POST /invoices`.
67
70
  *
68
71
  * **Permissions.** Requires a valid token. This endpoint is not gated on a named permission—the caller's role and their relationship to the record decide what it returns.
69
72
  */
@@ -185,7 +185,10 @@ export class Invoices extends ClientSDK {
185
185
  * invoices; a caller allowed to create the invoice but not to update the
186
186
  * linked `VendorCredential` responds `401`.
187
187
  *
188
- * Takes no request body.
188
+ * Optionally takes `send_to_company_manager`, for a quote linked to a
189
+ * `VendorCredential`: send `true` when the vendor is sending the
190
+ * converted invoice to their company managers to pay instead of paying
191
+ * it themselves. It follows the same rules as on `POST /invoices`.
189
192
  *
190
193
  * **Permissions.** Requires a valid token. This endpoint is not gated on a named permission—the caller's role and their relationship to the record decide what it returns.
191
194
  */