@greensecurity/javascript-sdk 0.45.0-beta.7 → 0.45.0-beta.8

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 +4 -1
  2. package/dist/commonjs/__tests__/invoices.test.js +18 -0
  3. package/dist/commonjs/__tests__/invoices.test.js.map +1 -1
  4. package/dist/commonjs/__tests__/vendors.test.js +1 -1
  5. package/dist/commonjs/__tests__/webhooks.test.js +5 -4
  6. package/dist/commonjs/__tests__/webhooks.test.js.map +1 -1
  7. package/dist/commonjs/__tests__/zones.test.js +59 -3
  8. package/dist/commonjs/__tests__/zones.test.js.map +1 -1
  9. package/dist/commonjs/funcs/invoicesConvertQuote.d.ts +33 -0
  10. package/dist/commonjs/funcs/invoicesConvertQuote.d.ts.map +1 -0
  11. package/dist/commonjs/funcs/invoicesConvertQuote.js +138 -0
  12. package/dist/commonjs/funcs/invoicesConvertQuote.js.map +1 -0
  13. package/dist/commonjs/lib/config.d.ts +2 -2
  14. package/dist/commonjs/lib/config.js +2 -2
  15. package/dist/commonjs/models/operations/convertquote.d.ts +46 -0
  16. package/dist/commonjs/models/operations/convertquote.d.ts.map +1 -0
  17. package/dist/commonjs/models/operations/convertquote.js +69 -0
  18. package/dist/commonjs/models/operations/convertquote.js.map +1 -0
  19. package/dist/commonjs/models/operations/createinvoice.d.ts +85 -0
  20. package/dist/commonjs/models/operations/createinvoice.d.ts.map +1 -1
  21. package/dist/commonjs/models/operations/createinvoice.js +56 -1
  22. package/dist/commonjs/models/operations/createinvoice.js.map +1 -1
  23. package/dist/commonjs/models/operations/index.d.ts +1 -0
  24. package/dist/commonjs/models/operations/index.d.ts.map +1 -1
  25. package/dist/commonjs/models/operations/index.js +1 -0
  26. package/dist/commonjs/models/operations/index.js.map +1 -1
  27. package/dist/commonjs/react-query/index.d.ts +1 -0
  28. package/dist/commonjs/react-query/index.d.ts.map +1 -1
  29. package/dist/commonjs/react-query/index.js +1 -0
  30. package/dist/commonjs/react-query/index.js.map +1 -1
  31. package/dist/commonjs/react-query/invoicesConvertQuote.d.ts +42 -0
  32. package/dist/commonjs/react-query/invoicesConvertQuote.d.ts.map +1 -0
  33. package/dist/commonjs/react-query/invoicesConvertQuote.js +60 -0
  34. package/dist/commonjs/react-query/invoicesConvertQuote.js.map +1 -0
  35. package/dist/commonjs/sdk/invoices.d.ts +20 -0
  36. package/dist/commonjs/sdk/invoices.d.ts.map +1 -1
  37. package/dist/commonjs/sdk/invoices.js +23 -0
  38. package/dist/commonjs/sdk/invoices.js.map +1 -1
  39. package/dist/esm/__tests__/invoices.test.js +18 -0
  40. package/dist/esm/__tests__/invoices.test.js.map +1 -1
  41. package/dist/esm/__tests__/vendors.test.js +1 -1
  42. package/dist/esm/__tests__/webhooks.test.js +5 -4
  43. package/dist/esm/__tests__/webhooks.test.js.map +1 -1
  44. package/dist/esm/__tests__/zones.test.js +59 -3
  45. package/dist/esm/__tests__/zones.test.js.map +1 -1
  46. package/dist/esm/funcs/invoicesConvertQuote.d.ts +33 -0
  47. package/dist/esm/funcs/invoicesConvertQuote.d.ts.map +1 -0
  48. package/dist/esm/funcs/invoicesConvertQuote.js +102 -0
  49. package/dist/esm/funcs/invoicesConvertQuote.js.map +1 -0
  50. package/dist/esm/lib/config.d.ts +2 -2
  51. package/dist/esm/lib/config.js +2 -2
  52. package/dist/esm/models/operations/convertquote.d.ts +46 -0
  53. package/dist/esm/models/operations/convertquote.d.ts.map +1 -0
  54. package/dist/esm/models/operations/convertquote.js +31 -0
  55. package/dist/esm/models/operations/convertquote.js.map +1 -0
  56. package/dist/esm/models/operations/createinvoice.d.ts +85 -0
  57. package/dist/esm/models/operations/createinvoice.d.ts.map +1 -1
  58. package/dist/esm/models/operations/createinvoice.js +55 -0
  59. package/dist/esm/models/operations/createinvoice.js.map +1 -1
  60. package/dist/esm/models/operations/index.d.ts +1 -0
  61. package/dist/esm/models/operations/index.d.ts.map +1 -1
  62. package/dist/esm/models/operations/index.js +1 -0
  63. package/dist/esm/models/operations/index.js.map +1 -1
  64. package/dist/esm/react-query/index.d.ts +1 -0
  65. package/dist/esm/react-query/index.d.ts.map +1 -1
  66. package/dist/esm/react-query/index.js +1 -0
  67. package/dist/esm/react-query/index.js.map +1 -1
  68. package/dist/esm/react-query/invoicesConvertQuote.d.ts +42 -0
  69. package/dist/esm/react-query/invoicesConvertQuote.d.ts.map +1 -0
  70. package/dist/esm/react-query/invoicesConvertQuote.js +55 -0
  71. package/dist/esm/react-query/invoicesConvertQuote.js.map +1 -0
  72. package/dist/esm/sdk/invoices.d.ts +20 -0
  73. package/dist/esm/sdk/invoices.d.ts.map +1 -1
  74. package/dist/esm/sdk/invoices.js +23 -0
  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__/invoices.test.ts +21 -0
  79. package/src/__tests__/vendors.test.ts +1 -1
  80. package/src/__tests__/webhooks.test.ts +5 -4
  81. package/src/__tests__/zones.test.ts +59 -3
  82. package/src/funcs/invoicesConvertQuote.ts +190 -0
  83. package/src/lib/config.ts +2 -2
  84. package/src/models/operations/convertquote.ts +94 -0
  85. package/src/models/operations/createinvoice.ts +124 -0
  86. package/src/models/operations/index.ts +1 -0
  87. package/src/react-query/index.ts +1 -0
  88. package/src/react-query/invoicesConvertQuote.ts +124 -0
  89. package/src/sdk/invoices.ts +31 -0
@@ -0,0 +1 @@
1
+ {"version":3,"file":"invoicesConvertQuote.d.ts","sourceRoot":"","sources":["../../../src/react-query/invoicesConvertQuote.ts"],"names":[],"mappings":"AAIA,OAAO,EACL,WAAW,EAEX,iBAAiB,EAClB,MAAM,uBAAuB,CAAC;AAC/B,OAAO,EAAE,iBAAiB,EAAE,MAAM,YAAY,CAAC;AAG/C,OAAO,EAAE,cAAc,EAAE,MAAM,gBAAgB,CAAC;AAChD,OAAO,EAAE,kBAAkB,EAAE,MAAM,wCAAwC,CAAC;AAC5E,OAAO,EACL,eAAe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+ */
4
+ import { useMutation, } from "@tanstack/react-query";
5
+ import { invoicesConvertQuote } from "../funcs/invoicesConvertQuote.js";
6
+ import { combineSignals } from "../lib/primitives.js";
7
+ import { unwrapAsync } from "../types/fp.js";
8
+ import { useGreenSecurityContext } from "./_context.js";
9
+ /**
10
+ * Convert a quote into an invoice
11
+ *
12
+ * @remarks
13
+ * Converts a quote into the real invoice its caller will be charged for, and
14
+ * returns the new invoice with its calculated totals. Any `VendorCredential`
15
+ * linked to the quote is re-pointed at the new invoice.
16
+ *
17
+ * The operation is idempotent: converting a quote that has already been
18
+ * processed returns the invoice previously created from it rather than
19
+ * creating a second one, so a retried request is safe.
20
+ *
21
+ * The referenced invoice must actually be a quote — a non-quote invoice id
22
+ * responds `400`. Requires a caller whose access scope permits creating
23
+ * invoices; a caller allowed to create the invoice but not to update the
24
+ * linked `VendorCredential` responds `401`.
25
+ *
26
+ * Takes no request body.
27
+ */
28
+ export function useInvoicesConvertQuoteMutation(options) {
29
+ const client = useGreenSecurityContext();
30
+ return useMutation({
31
+ ...buildInvoicesConvertQuoteMutation(client, options),
32
+ ...options,
33
+ });
34
+ }
35
+ export function mutationKeyInvoicesConvertQuote() {
36
+ return ["@greensecurity/javascript-sdk", "invoices", "convertQuote"];
37
+ }
38
+ export function buildInvoicesConvertQuoteMutation(client$, hookOptions) {
39
+ return {
40
+ mutationKey: mutationKeyInvoicesConvertQuote(),
41
+ mutationFn: function invoicesConvertQuoteMutationFn({ request, options, }) {
42
+ const mergedOptions = {
43
+ ...hookOptions,
44
+ ...options,
45
+ fetchOptions: {
46
+ ...hookOptions?.fetchOptions,
47
+ ...options?.fetchOptions,
48
+ signal: combineSignals(hookOptions?.fetchOptions?.signal, options?.fetchOptions?.signal),
49
+ },
50
+ };
51
+ return unwrapAsync(invoicesConvertQuote(client$, request, mergedOptions));
52
+ },
53
+ };
54
+ }
55
+ //# sourceMappingURL=invoicesConvertQuote.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"invoicesCon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,6 +87,26 @@ export declare class Invoices extends ClientSDK {
87
87
  * Make payment for the invoice
88
88
  */
89
89
  makePayment(request: operations.MakePaymentRequest, options?: RequestOptions): Promise<operations.MakePaymentMakePaymentOk>;
90
+ /**
91
+ * Convert a quote into an invoice
92
+ *
93
+ * @remarks
94
+ * Converts a quote into the real invoice its caller will be charged for, and
95
+ * returns the new invoice with its calculated totals. Any `VendorCredential`
96
+ * linked to the quote is re-pointed at the new invoice.
97
+ *
98
+ * The operation is idempotent: converting a quote that has already been
99
+ * processed returns the invoice previously created from it rather than
100
+ * creating a second one, so a retried request is safe.
101
+ *
102
+ * The referenced invoice must actually be a quote — a non-quote invoice id
103
+ * responds `400`. Requires a caller whose access scope permits creating
104
+ * invoices; a caller allowed to create the invoice but not to update the
105
+ * linked `VendorCredential` responds `401`.
106
+ *
107
+ * Takes no request body.
108
+ */
109
+ convertQuote(request: operations.ConvertQuoteRequest, options?: RequestOptions): Promise<operations.ConvertQuoteConvertQuoteOk>;
90
110
  /**
91
111
  * Export invoices to csv (async)
92
112
  *
@@ -1 +1 @@
1
- {"version":3,"file":"invoices.d.ts","sourceRoot":"","sources":["../../../src/sdk/invoices.ts"],"names":[],"mappings":"AAKA,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;;;;;;;;;OASG;IACG,UAAU,CACd,OAAO,EAAE,UAAU,CAAC,iBAAiB,EACrC,OAAO,CAAC,EAAE,cAAc,GACvB,OAAO,CAAC,UAAU,CAAC,OAAO,CAAC;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OAAO,EAAE,UAAU,CAAC,mBAAmB,EACvC,OAAO,CAAC,EAAE,cAAc,GACvB,OAAO,CAAC,UAAU,CAAC,0BAA0B,CAAC;IAQjD;;;;;;OAMG;IACG,cAAc,CAClB,OAAO,EAAE,UAAU,CAAC,qBAAqB,EACzC,OAAO,CAAC,EAAE,cAAc,GACvB,OAAO,CAAC,UAAU,CAAC,yBAAyB,CAAC;IAQhD;;;;;;OAMG;IACG,uBAAuB,CAC3B,OAAO,EAAE,UAAU,CAAC,8BAA8B,EAClD,OAAO,CAAC,EAAE,cAAc,GACvB,OAAO,CAAC,UAAU,CAAC,mCAAmC,CAAC;IAQ1D;;;;;OAKG;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"}
@@ -1,6 +1,7 @@
1
1
  /*
2
2
  * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
3
3
  */
4
+ import { invoicesConvertQuote } from "../funcs/invoicesConvertQuote.js";
4
5
  import { invoicesCreateInvoice } from "../funcs/invoicesCreateInvoice.js";
5
6
  import { invoicesDownloadInvoicesExport, } from "../funcs/invoicesDownloadInvoicesExport.js";
6
7
  import { invoicesGetInvoice } from "../funcs/invoicesGetInvoice.js";
@@ -104,6 +105,28 @@ export class Invoices extends ClientSDK {
104
105
  async makePayment(request, options) {
105
106
  return unwrapAsync(invoicesMakePayment(this, request, options));
106
107
  }
108
+ /**
109
+ * Convert a quote into an invoice
110
+ *
111
+ * @remarks
112
+ * Converts a quote into the real invoice its caller will be charged for, and
113
+ * returns the new invoice with its calculated totals. Any `VendorCredential`
114
+ * linked to the quote is re-pointed at the new invoice.
115
+ *
116
+ * The operation is idempotent: converting a quote that has already been
117
+ * processed returns the invoice previously created from it rather than
118
+ * creating a second one, so a retried request is safe.
119
+ *
120
+ * The referenced invoice must actually be a quote — a non-quote invoice id
121
+ * responds `400`. Requires a caller whose access scope permits creating
122
+ * invoices; a caller allowed to create the invoice but not to update the
123
+ * linked `VendorCredential` responds `401`.
124
+ *
125
+ * Takes no request body.
126
+ */
127
+ async convertQuote(request, options) {
128
+ return unwrapAsync(invoicesConvertQuote(this, request, options));
129
+ }
107
130
  /**
108
131
  * Export invoices to csv (async)
109
132
  *
@@ -1 +1 @@
1
- {"version":3,"file":"invoices.js","sourceRoot":"","sources":["../../../src/sdk/invoices.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EAAE,qBAAqB,EAAE,MAAM,mCAAmC,CAAC;AAC1E,OAAO,EAEL,8BAA8B,GAC/B,MAAM,4CAA4C,CAAC;AACpD,OAAO,EAAE,kBAAkB,EAAE,MAAM,gCAAgC,CAAC;AACpE,OAAO,EAAE,+BAA+B,EAAE,MAAM,6CAA6C,CAAC;AAC9F,OAAO,EAAE,sBAAsB,EAAE,MAAM,oCAAoC,CAAC;AAC5E,OAAO,EAAE,oBAAoB,EAAE,MAAM,kCAAkC,CAAC;AACxE,OAAO,EAAE,mBAAmB,EAAE,MAAM,iCAAiC,CAAC;AACtE,OAAO,EAAE,qBAAqB,EAAE,MAAM,mCAAmC,CAAC;AAC1E,OAAO,EAAE,SAAS,EAAkB,MAAM,gBAAgB,CAAC;AAG3D,OAAO,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAC7C,OAAO,EAAgB,oBAAoB,EAAE,MAAM,wBAAwB,CAAC;AAE5E,OAAO,EAAE,gCAAgC,EAAE,MAAM,4CAA4C,CAAC;AAE9F,MAAM,OAAO,QAAS,SAAQ,SAAS;IACrC;;;;;;;;;OASG;IACH,KAAK,CAAC,UAAU,CACd,OAAqC,EACrC,OAAwB;QAExB,OAAO,WAAW,CAAC,kBAAkB,CACnC,IAAI,EACJ,OAAO,EACP,OAAO,CACR,CAAC,CAAC;IACL,CAAC;IAED;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BAAqB,CACtC,IAAI,EACJ,OAAO,EACP,OAAO,CACR,CAAC,CAAC;IACL,CAAC;IAED;;;;;;;;;;;;;;OAcG;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;;;;;OAKG;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;;;;;;;;;;;;;;;;;;OAkBG;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;;;;;;OAMG;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;;;;;;OAMG;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;;;;;OAKG;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.45.0-beta.7",
5
+ "version": "0.45.0-beta.8",
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.45.0-beta.7",
3
+ "version": "0.45.0-beta.8",
4
4
  "author": "Green Security LLC",
5
5
  "type": "module",
6
6
  "tshy": {
@@ -242,3 +242,24 @@ test("Invoices Get Invoice Id", async () => {
242
242
  id: 892625,
243
243
  });
244
244
  });
245
+
246
+ test("Invoices Convert Quote", async () => {
247
+ const testHttpClient = createTestHTTPClient("convertQuote");
248
+
249
+ const greenSecurity = new GreenSecurity({
250
+ serverURL: process.env["TEST_SERVER_URL"] ?? "https://localhost:3000/api",
251
+ httpClient: testHttpClient,
252
+ security: {
253
+ token: process.env["GREEN_SECURITY_TOKEN"] ?? "value",
254
+ },
255
+ });
256
+
257
+ const result = await greenSecurity.invoices.convertQuote({
258
+ id: 492224,
259
+ });
260
+ expect(result).toBeDefined();
261
+ expect(result).toEqual({
262
+ id: 11396,
263
+ success: true,
264
+ });
265
+ });
@@ -121,7 +121,7 @@ test("Vendors List Vendor Credits", async () => {
121
121
  page: 1,
122
122
  useUrlParams: false,
123
123
  },
124
- creditBalance: 1263.08,
124
+ creditBalance: 5361.49,
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,
@@ -36,10 +36,66 @@ test("Zones List Or Search Security Zones", async () => {
36
36
  },
37
37
  items: [
38
38
  {
39
- facility: {},
39
+ facility: {
40
+ contacts: {
41
+ contact: {
42
+ status: "Inactive",
43
+ department: null,
44
+ },
45
+ adminContact: {
46
+ status: "Deleted",
47
+ department: 123,
48
+ },
49
+ techContact: {
50
+ status: "Deleted",
51
+ department: 123,
52
+ },
53
+ greenSecurityCsm: {
54
+ status: "Deleted",
55
+ department: 123,
56
+ },
57
+ accountManager: {
58
+ status: "Active",
59
+ department: 123,
60
+ },
61
+ },
62
+ vendorGuestPolicy: {
63
+ enabled: false,
64
+ vendorGuestLimitAndOr: "and",
65
+ vendorGuestRequireEmail: false,
66
+ },
67
+ },
40
68
  },
41
69
  {
42
- facility: {},
70
+ facility: {
71
+ contacts: {
72
+ contact: {
73
+ status: "Inactive",
74
+ department: null,
75
+ },
76
+ adminContact: {
77
+ status: "Deleted",
78
+ department: 123,
79
+ },
80
+ techContact: {
81
+ status: "Deleted",
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: false,
95
+ vendorGuestLimitAndOr: "and",
96
+ vendorGuestRequireEmail: false,
97
+ },
98
+ },
43
99
  },
44
100
  ],
45
101
  });
@@ -58,7 +114,7 @@ test("Zones Security Zone Checkin", async () => {
58
114
 
59
115
  const result = await greenSecurity.zones.securityZoneCheckin({
60
116
  qrCode: "<value>",
61
- zoneId: 997849,
117
+ zoneId: 834385,
62
118
  });
63
119
  expect(result).toBeDefined();
64
120
  expect(result).toEqual({});
@@ -0,0 +1,190 @@
1
+ /*
2
+ * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
3
+ */
4
+
5
+ import { GreenSecurityCore } from "../core.js";
6
+ import { 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
+ * Convert a quote into an invoice
31
+ *
32
+ * @remarks
33
+ * Converts a quote into the real invoice its caller will be charged for, and
34
+ * returns the new invoice with its calculated totals. Any `VendorCredential`
35
+ * linked to the quote is re-pointed at the new invoice.
36
+ *
37
+ * The operation is idempotent: converting a quote that has already been
38
+ * processed returns the invoice previously created from it rather than
39
+ * creating a second one, so a retried request is safe.
40
+ *
41
+ * The referenced invoice must actually be a quote — a non-quote invoice id
42
+ * responds `400`. Requires a caller whose access scope permits creating
43
+ * invoices; a caller allowed to create the invoice but not to update the
44
+ * linked `VendorCredential` responds `401`.
45
+ *
46
+ * Takes no request body.
47
+ *
48
+ * If set, this operation will use {@link Security.bearerJwt} from the global security.
49
+ */
50
+ export function invoicesConvertQuote(
51
+ client: GreenSecurityCore,
52
+ request: operations.ConvertQuoteRequest,
53
+ options?: RequestOptions,
54
+ ): APIPromise<
55
+ Result<
56
+ operations.ConvertQuoteConvertQuoteOk,
57
+ | errors.ApiErrorResponse
58
+ | GreenSecurityError
59
+ | ResponseValidationError
60
+ | ConnectionError
61
+ | RequestAbortedError
62
+ | RequestTimeoutError
63
+ | InvalidRequestError
64
+ | UnexpectedClientError
65
+ | SDKValidationError
66
+ >
67
+ > {
68
+ return new APIPromise($do(
69
+ client,
70
+ request,
71
+ options,
72
+ ));
73
+ }
74
+
75
+ async function $do(
76
+ client: GreenSecurityCore,
77
+ request: operations.ConvertQuoteRequest,
78
+ options?: RequestOptions,
79
+ ): Promise<
80
+ [
81
+ Result<
82
+ operations.ConvertQuoteConvertQuoteOk,
83
+ | errors.ApiErrorResponse
84
+ | GreenSecurityError
85
+ | ResponseValidationError
86
+ | ConnectionError
87
+ | RequestAbortedError
88
+ | RequestTimeoutError
89
+ | InvalidRequestError
90
+ | UnexpectedClientError
91
+ | SDKValidationError
92
+ >,
93
+ APICall,
94
+ ]
95
+ > {
96
+ const parsed = safeParse(
97
+ request,
98
+ (value) => operations.ConvertQuoteRequest$outboundSchema.parse(value),
99
+ "Input validation failed",
100
+ );
101
+ if (!parsed.ok) {
102
+ return [parsed, { status: "invalid" }];
103
+ }
104
+ const payload = parsed.value;
105
+ const body = null;
106
+
107
+ const pathParams = {
108
+ id: encodeSimple("id", payload.id, {
109
+ explode: false,
110
+ charEncoding: "percent",
111
+ }),
112
+ };
113
+ const path = pathToFunc("/invoices/{id}/convert")(pathParams);
114
+
115
+ const headers = new Headers(compactMap({
116
+ Accept: "application/json",
117
+ }));
118
+
119
+ const securityInput = await extractSecurity(client._options.security);
120
+ const requestSecurity = resolveGlobalSecurity(securityInput, [1]);
121
+
122
+ const context = {
123
+ options: client._options,
124
+ baseURL: options?.serverURL ?? client._baseURL ?? "",
125
+ operationID: "convertQuote",
126
+ oAuth2Scopes: null,
127
+
128
+ resolvedSecurity: requestSecurity,
129
+
130
+ securitySource: client._options.security,
131
+ retryConfig: options?.retries
132
+ || client._options.retryConfig
133
+ || { strategy: "none" },
134
+ retryCodes: options?.retryCodes || ["429", "500", "502", "503", "504"],
135
+ };
136
+
137
+ const requestRes = client._createRequest(context, {
138
+ security: requestSecurity,
139
+ method: "POST",
140
+ baseURL: options?.serverURL,
141
+ path: path,
142
+ headers: headers,
143
+ body: body,
144
+ userAgent: client._options.userAgent,
145
+ timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1,
146
+ }, options);
147
+ if (!requestRes.ok) {
148
+ return [requestRes, { status: "invalid" }];
149
+ }
150
+ const req = requestRes.value;
151
+
152
+ const doResult = await client._do(req, {
153
+ context,
154
+ isErrorStatusCode: (statusCode: number) =>
155
+ matchStatusCode({ status: statusCode } as Response, ["4XX", "5XX"]),
156
+ retryConfig: context.retryConfig,
157
+ retryCodes: context.retryCodes,
158
+ });
159
+ if (!doResult.ok) {
160
+ return [doResult, { status: "request-error", request: req }];
161
+ }
162
+ const response = doResult.value;
163
+
164
+ const responseFields = {
165
+ HttpMeta: { Response: response, Request: req },
166
+ };
167
+
168
+ const [result] = await M.match<
169
+ operations.ConvertQuoteConvertQuoteOk,
170
+ | errors.ApiErrorResponse
171
+ | GreenSecurityError
172
+ | ResponseValidationError
173
+ | ConnectionError
174
+ | RequestAbortedError
175
+ | RequestTimeoutError
176
+ | InvalidRequestError
177
+ | UnexpectedClientError
178
+ | SDKValidationError
179
+ >(
180
+ M.json(200, operations.ConvertQuoteConvertQuoteOk$inboundSchema),
181
+ M.jsonErr([400, 401, 403, 404], errors.ApiErrorResponse$inboundSchema),
182
+ M.fail("4XX"),
183
+ M.fail([500, "5XX"]),
184
+ )(response, req, { extraFields: responseFields });
185
+ if (!result.ok) {
186
+ return [result, { status: "complete", request: req, response }];
187
+ }
188
+
189
+ return [result, { status: "complete", request: req, response }];
190
+ }
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.44.0",
83
- sdkVersion: "0.45.0-beta.7",
83
+ sdkVersion: "0.45.0-beta.8",
84
84
  genVersion: "2.933.0",
85
85
  userAgent:
86
- "speakeasy-sdk/typescript 0.45.0-beta.7 2.933.0 0.44.0 @greensecurity/javascript-sdk",
86
+ "speakeasy-sdk/typescript 0.45.0-beta.8 2.933.0 0.44.0 @greensecurity/javascript-sdk",
87
87
  } as const;
@@ -0,0 +1,94 @@
1
+ /*
2
+ * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
3
+ */
4
+
5
+ import * as z from "zod/v3";
6
+ import { remap as remap$ } from "../../lib/primitives.js";
7
+ import { safeParse } from "../../lib/schemas.js";
8
+ import { Result as SafeParseResult } from "../../types/fp.js";
9
+ import * as types from "../../types/primitives.js";
10
+ import { SDKValidationError } from "../errors/sdkvalidationerror.js";
11
+
12
+ export type ConvertQuoteRequest = {
13
+ /**
14
+ * The identifier of the object
15
+ */
16
+ id: number;
17
+ };
18
+
19
+ /**
20
+ * The quote was converted, and the server has returned the resulting invoice.
21
+ */
22
+ export type ConvertQuoteConvertQuoteOk = {
23
+ /**
24
+ * Identifier of the invoice the quote was converted into.
25
+ */
26
+ id: number;
27
+ success: boolean;
28
+ /**
29
+ * Tax calculated on the new invoice.
30
+ */
31
+ tax?: number | null | undefined;
32
+ /**
33
+ * Shipping calculated on the new invoice.
34
+ */
35
+ shipping?: number | null | undefined;
36
+ /**
37
+ * Convenience fee calculated on the new invoice.
38
+ */
39
+ convenienceFee?: number | null | undefined;
40
+ /**
41
+ * Total amount due on the new invoice, including tax, shipping and the convenience fee.
42
+ */
43
+ total?: number | null | undefined;
44
+ };
45
+
46
+ /** @internal */
47
+ export type ConvertQuoteRequest$Outbound = {
48
+ id: number;
49
+ };
50
+
51
+ /** @internal */
52
+ export const ConvertQuoteRequest$outboundSchema: z.ZodType<
53
+ ConvertQuoteRequest$Outbound,
54
+ z.ZodTypeDef,
55
+ ConvertQuoteRequest
56
+ > = z.object({
57
+ id: z.number().int(),
58
+ });
59
+
60
+ export function convertQuoteRequestToJSON(
61
+ convertQuoteRequest: ConvertQuoteRequest,
62
+ ): string {
63
+ return JSON.stringify(
64
+ ConvertQuoteRequest$outboundSchema.parse(convertQuoteRequest),
65
+ );
66
+ }
67
+
68
+ /** @internal */
69
+ export const ConvertQuoteConvertQuoteOk$inboundSchema: z.ZodType<
70
+ ConvertQuoteConvertQuoteOk,
71
+ z.ZodTypeDef,
72
+ unknown
73
+ > = z.object({
74
+ id: types.number(),
75
+ success: types.boolean(),
76
+ tax: z.nullable(types.number()).optional(),
77
+ shipping: z.nullable(types.number()).optional(),
78
+ convenience_fee: z.nullable(types.number()).optional(),
79
+ total: z.nullable(types.number()).optional(),
80
+ }).transform((v) => {
81
+ return remap$(v, {
82
+ "convenience_fee": "convenienceFee",
83
+ });
84
+ });
85
+
86
+ export function convertQuoteConvertQuoteOkFromJSON(
87
+ jsonString: string,
88
+ ): SafeParseResult<ConvertQuoteConvertQuoteOk, SDKValidationError> {
89
+ return safeParse(
90
+ jsonString,
91
+ (x) => ConvertQuoteConvertQuoteOk$inboundSchema.parse(JSON.parse(x)),
92
+ `Failed to parse 'ConvertQuoteConvertQuoteOk' from JSON`,
93
+ );
94
+ }