vayu-ts 0.1.4 → 0.2.3

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 (158) hide show
  1. package/dist/openapi-v2/apis/AuthenticationApi.d.ts +24 -0
  2. package/dist/openapi-v2/apis/AuthenticationApi.js +79 -0
  3. package/dist/openapi-v2/apis/CustomersApi.d.ts +92 -0
  4. package/dist/openapi-v2/apis/CustomersApi.js +362 -0
  5. package/dist/openapi-v2/apis/EntitlementsApi.d.ts +49 -0
  6. package/dist/openapi-v2/apis/EntitlementsApi.js +176 -0
  7. package/dist/openapi-v2/apis/EventsApi.d.ts +63 -0
  8. package/dist/openapi-v2/apis/EventsApi.js +231 -0
  9. package/dist/openapi-v2/apis/InvoicesApi.d.ts +88 -0
  10. package/dist/openapi-v2/apis/InvoicesApi.js +344 -0
  11. package/dist/openapi-v2/apis/ProductsApi.d.ts +76 -0
  12. package/dist/openapi-v2/apis/ProductsApi.js +295 -0
  13. package/dist/openapi-v2/apis/baseapi.d.ts +33 -0
  14. package/dist/openapi-v2/apis/baseapi.js +41 -0
  15. package/dist/openapi-v2/apis/exception.d.ts +19 -0
  16. package/dist/openapi-v2/apis/exception.js +22 -0
  17. package/dist/openapi-v2/auth/auth.d.ts +38 -0
  18. package/dist/openapi-v2/auth/auth.js +16 -0
  19. package/dist/openapi-v2/configuration.d.ts +63 -0
  20. package/dist/openapi-v2/configuration.js +34 -0
  21. package/dist/openapi-v2/http/http.d.ts +142 -0
  22. package/dist/openapi-v2/http/http.js +229 -0
  23. package/dist/openapi-v2/http/isomorphic-fetch.d.ts +5 -0
  24. package/dist/openapi-v2/http/isomorphic-fetch.js +33 -0
  25. package/dist/openapi-v2/index.d.ts +10 -0
  26. package/dist/openapi-v2/index.js +33 -0
  27. package/dist/openapi-v2/middleware.d.ts +54 -0
  28. package/dist/openapi-v2/middleware.js +16 -0
  29. package/dist/openapi-v2/models/APICreateCustomerPayload.d.ts +45 -0
  30. package/dist/openapi-v2/models/APICreateCustomerPayload.js +49 -0
  31. package/dist/openapi-v2/models/APICreateInvoicePayload.d.ts +41 -0
  32. package/dist/openapi-v2/models/APICreateInvoicePayload.js +49 -0
  33. package/dist/openapi-v2/models/APICreateProductPayload.d.ts +43 -0
  34. package/dist/openapi-v2/models/APICreateProductPayload.js +55 -0
  35. package/dist/openapi-v2/models/APICustomer.d.ts +64 -0
  36. package/dist/openapi-v2/models/APICustomer.js +76 -0
  37. package/dist/openapi-v2/models/APIEntitlement.d.ts +56 -0
  38. package/dist/openapi-v2/models/APIEntitlement.js +79 -0
  39. package/dist/openapi-v2/models/APIEvent.d.ts +72 -0
  40. package/dist/openapi-v2/models/APIEvent.js +88 -0
  41. package/dist/openapi-v2/models/APIIngestEventPayload.d.ts +49 -0
  42. package/dist/openapi-v2/models/APIIngestEventPayload.js +55 -0
  43. package/dist/openapi-v2/models/APIInvoice.d.ts +71 -0
  44. package/dist/openapi-v2/models/APIInvoice.js +88 -0
  45. package/dist/openapi-v2/models/APIInvoiceBillingPeriod.d.ts +38 -0
  46. package/dist/openapi-v2/models/APIInvoiceBillingPeriod.js +40 -0
  47. package/dist/openapi-v2/models/APIProduct.d.ts +62 -0
  48. package/dist/openapi-v2/models/APIProduct.js +82 -0
  49. package/dist/openapi-v2/models/APIQueryPayloadAPICustomer.d.ts +43 -0
  50. package/dist/openapi-v2/models/APIQueryPayloadAPICustomer.js +49 -0
  51. package/dist/openapi-v2/models/APIQueryPayloadAPIEntitlement.d.ts +43 -0
  52. package/dist/openapi-v2/models/APIQueryPayloadAPIEntitlement.js +49 -0
  53. package/dist/openapi-v2/models/APIQueryPayloadAPIEvent.d.ts +43 -0
  54. package/dist/openapi-v2/models/APIQueryPayloadAPIEvent.js +49 -0
  55. package/dist/openapi-v2/models/APIQueryPayloadAPIInvoice.d.ts +43 -0
  56. package/dist/openapi-v2/models/APIQueryPayloadAPIInvoice.js +49 -0
  57. package/dist/openapi-v2/models/APIQueryPayloadAPIProduct.d.ts +43 -0
  58. package/dist/openapi-v2/models/APIQueryPayloadAPIProduct.js +49 -0
  59. package/dist/openapi-v2/models/APIUpdateCustomerPayload.d.ts +45 -0
  60. package/dist/openapi-v2/models/APIUpdateCustomerPayload.js +49 -0
  61. package/dist/openapi-v2/models/APIUpdateInvoicePayload.d.ts +41 -0
  62. package/dist/openapi-v2/models/APIUpdateInvoicePayload.js +49 -0
  63. package/dist/openapi-v2/models/APIUpdateProductPayload.d.ts +43 -0
  64. package/dist/openapi-v2/models/APIUpdateProductPayload.js +55 -0
  65. package/dist/openapi-v2/models/Aggregation.d.ts +32 -0
  66. package/dist/openapi-v2/models/Aggregation.js +43 -0
  67. package/dist/openapi-v2/models/AggregationMethods.d.ts +18 -0
  68. package/dist/openapi-v2/models/AggregationMethods.js +22 -0
  69. package/dist/openapi-v2/models/Condition.d.ts +29 -0
  70. package/dist/openapi-v2/models/Condition.js +31 -0
  71. package/dist/openapi-v2/models/Criterion.d.ts +32 -0
  72. package/dist/openapi-v2/models/Criterion.js +43 -0
  73. package/dist/openapi-v2/models/CriterionOperators.d.ts +23 -0
  74. package/dist/openapi-v2/models/CriterionOperators.js +27 -0
  75. package/dist/openapi-v2/models/CriterionValue.d.ts +27 -0
  76. package/dist/openapi-v2/models/CriterionValue.js +24 -0
  77. package/dist/openapi-v2/models/EntitlementRevision.d.ts +36 -0
  78. package/dist/openapi-v2/models/EntitlementRevision.js +55 -0
  79. package/dist/openapi-v2/models/Event.d.ts +54 -0
  80. package/dist/openapi-v2/models/Event.js +85 -0
  81. package/dist/openapi-v2/models/IngestEventToTheSystem201Response.d.ts +31 -0
  82. package/dist/openapi-v2/models/IngestEventToTheSystem201Response.js +43 -0
  83. package/dist/openapi-v2/models/InvoiceProductBreakdown.d.ts +36 -0
  84. package/dist/openapi-v2/models/InvoiceProductBreakdown.js +46 -0
  85. package/dist/openapi-v2/models/Login200Response.d.ts +28 -0
  86. package/dist/openapi-v2/models/Login200Response.js +31 -0
  87. package/dist/openapi-v2/models/LoginRequest.d.ts +28 -0
  88. package/dist/openapi-v2/models/LoginRequest.js +31 -0
  89. package/dist/openapi-v2/models/ObjectSerializer.d.ts +67 -0
  90. package/dist/openapi-v2/models/ObjectSerializer.js +377 -0
  91. package/dist/openapi-v2/models/Pricing.d.ts +30 -0
  92. package/dist/openapi-v2/models/Pricing.js +37 -0
  93. package/dist/openapi-v2/models/PricingTiersInner.d.ts +31 -0
  94. package/dist/openapi-v2/models/PricingTiersInner.js +49 -0
  95. package/dist/openapi-v2/models/ProductBreakdown.d.ts +29 -0
  96. package/dist/openapi-v2/models/ProductBreakdown.js +37 -0
  97. package/dist/openapi-v2/models/QueryResultAPICustomer.d.ts +40 -0
  98. package/dist/openapi-v2/models/QueryResultAPICustomer.js +43 -0
  99. package/dist/openapi-v2/models/QueryResultAPIEntitlement.d.ts +40 -0
  100. package/dist/openapi-v2/models/QueryResultAPIEntitlement.js +43 -0
  101. package/dist/openapi-v2/models/QueryResultAPIEvent.d.ts +40 -0
  102. package/dist/openapi-v2/models/QueryResultAPIEvent.js +43 -0
  103. package/dist/openapi-v2/models/QueryResultAPIInvoice.d.ts +40 -0
  104. package/dist/openapi-v2/models/QueryResultAPIInvoice.js +43 -0
  105. package/dist/openapi-v2/models/QueryResultAPIProduct.d.ts +40 -0
  106. package/dist/openapi-v2/models/QueryResultAPIProduct.js +43 -0
  107. package/dist/openapi-v2/models/ReviseEntitlementPayload.d.ts +37 -0
  108. package/dist/openapi-v2/models/ReviseEntitlementPayload.js +43 -0
  109. package/dist/openapi-v2/models/UpdateEventPayload.d.ts +33 -0
  110. package/dist/openapi-v2/models/UpdateEventPayload.js +31 -0
  111. package/dist/openapi-v2/models/all.d.ts +40 -0
  112. package/dist/openapi-v2/models/all.js +56 -0
  113. package/dist/openapi-v2/rxjsStub.d.ts +10 -0
  114. package/dist/openapi-v2/rxjsStub.js +31 -0
  115. package/dist/openapi-v2/servers.d.ts +38 -0
  116. package/dist/openapi-v2/servers.js +51 -0
  117. package/dist/openapi-v2/types/ObservableAPI.d.ts +281 -0
  118. package/dist/openapi-v2/types/ObservableAPI.js +694 -0
  119. package/dist/openapi-v2/types/PromiseAPI.d.ts +268 -0
  120. package/dist/openapi-v2/types/PromiseAPI.js +405 -0
  121. package/dist/openapi-v2/util.d.ts +15 -0
  122. package/dist/openapi-v2/util.js +42 -0
  123. package/dist/sdk/services/configuration.service.js +1 -1
  124. package/dist/sdk-v2/clients/CustomersClient.d.ts +11 -0
  125. package/dist/sdk-v2/clients/CustomersClient.js +50 -0
  126. package/dist/sdk-v2/clients/EntitlementsClient.d.ts +8 -0
  127. package/dist/sdk-v2/clients/EntitlementsClient.js +35 -0
  128. package/dist/sdk-v2/clients/EventsClient.d.ts +9 -0
  129. package/dist/sdk-v2/clients/EventsClient.js +40 -0
  130. package/dist/sdk-v2/clients/InvoicesClient.d.ts +11 -0
  131. package/dist/sdk-v2/clients/InvoicesClient.js +50 -0
  132. package/dist/sdk-v2/clients/ProductsClient.d.ts +10 -0
  133. package/dist/sdk-v2/clients/ProductsClient.js +45 -0
  134. package/dist/sdk-v2/clients/index.d.ts +4 -0
  135. package/dist/sdk-v2/clients/index.js +20 -0
  136. package/dist/sdk-v2/index.d.ts +11 -0
  137. package/dist/sdk-v2/index.js +53 -0
  138. package/dist/sdk-v2/services/configuration.service.d.ts +21 -0
  139. package/dist/sdk-v2/services/configuration.service.js +98 -0
  140. package/dist/sdk-v2/services/index.d.ts +1 -0
  141. package/dist/sdk-v2/services/index.js +17 -0
  142. package/dist/sdk-v2/types/Customers.d.ts +1 -0
  143. package/dist/sdk-v2/types/Customers.js +2 -0
  144. package/dist/sdk-v2/types/Entitlements.d.ts +1 -0
  145. package/dist/sdk-v2/types/Entitlements.js +2 -0
  146. package/dist/sdk-v2/types/Events.d.ts +1 -0
  147. package/dist/sdk-v2/types/Events.js +2 -0
  148. package/dist/sdk-v2/types/Invoices.d.ts +1 -0
  149. package/dist/sdk-v2/types/Invoices.js +2 -0
  150. package/dist/sdk-v2/types/Products.d.ts +1 -0
  151. package/dist/sdk-v2/types/Products.js +2 -0
  152. package/dist/sdk-v2/types/index.d.ts +6 -0
  153. package/dist/sdk-v2/types/index.js +24 -0
  154. package/dist/v2.d.ts +1 -0
  155. package/dist/v2.js +17 -0
  156. package/package.json +17 -1
  157. package/dist/openapi/types/ObjectParamAPI.d.ts +0 -845
  158. package/dist/openapi/types/ObjectParamAPI.js +0 -606
@@ -0,0 +1,142 @@
1
+ /// <reference types="node" />
2
+ /// <reference types="node" />
3
+ /// <reference types="node" />
4
+ /// <reference types="node" />
5
+ import * as FormData from "form-data";
6
+ import { URLSearchParams } from 'url';
7
+ import * as http from 'http';
8
+ import * as https from 'https';
9
+ import { Observable } from '../rxjsStub';
10
+ export * from './isomorphic-fetch';
11
+ /**
12
+ * Represents an HTTP method.
13
+ */
14
+ export declare enum HttpMethod {
15
+ GET = "GET",
16
+ HEAD = "HEAD",
17
+ POST = "POST",
18
+ PUT = "PUT",
19
+ DELETE = "DELETE",
20
+ CONNECT = "CONNECT",
21
+ OPTIONS = "OPTIONS",
22
+ TRACE = "TRACE",
23
+ PATCH = "PATCH"
24
+ }
25
+ /**
26
+ * Represents an HTTP file which will be transferred from or to a server.
27
+ */
28
+ export type HttpFile = {
29
+ data: Buffer;
30
+ name: string;
31
+ };
32
+ export declare class HttpException extends Error {
33
+ constructor(msg: string);
34
+ }
35
+ /**
36
+ * Represents the body of an outgoing HTTP request.
37
+ */
38
+ export type RequestBody = undefined | string | FormData | URLSearchParams;
39
+ /**
40
+ * Represents an HTTP request context
41
+ */
42
+ export declare class RequestContext {
43
+ private httpMethod;
44
+ private headers;
45
+ private body;
46
+ private url;
47
+ private agent;
48
+ /**
49
+ * Creates the request context using a http method and request resource url
50
+ *
51
+ * @param url url of the requested resource
52
+ * @param httpMethod http method
53
+ */
54
+ constructor(url: string, httpMethod: HttpMethod);
55
+ getUrl(): string;
56
+ /**
57
+ * Replaces the url set in the constructor with this url.
58
+ *
59
+ */
60
+ setUrl(url: string): void;
61
+ /**
62
+ * Sets the body of the http request either as a string or FormData
63
+ *
64
+ * Note that setting a body on a HTTP GET, HEAD, DELETE, CONNECT or TRACE
65
+ * request is discouraged.
66
+ * https://httpwg.org/http-core/draft-ietf-httpbis-semantics-latest.html#rfc.section.7.3.1
67
+ *
68
+ * @param body the body of the request
69
+ */
70
+ setBody(body: RequestBody): void;
71
+ getHttpMethod(): HttpMethod;
72
+ getHeaders(): {
73
+ [key: string]: string;
74
+ };
75
+ getBody(): RequestBody;
76
+ setQueryParam(name: string, value: string): void;
77
+ /**
78
+ * Sets a cookie with the name and value. NO check for duplicate cookies is performed
79
+ *
80
+ */
81
+ addCookie(name: string, value: string): void;
82
+ setHeaderParam(key: string, value: string): void;
83
+ setAgent(agent: http.Agent | https.Agent): void;
84
+ getAgent(): http.Agent | https.Agent | undefined;
85
+ }
86
+ export interface ResponseBody {
87
+ text(): Promise<string>;
88
+ binary(): Promise<Buffer>;
89
+ }
90
+ /**
91
+ * Helper class to generate a `ResponseBody` from binary data
92
+ */
93
+ export declare class SelfDecodingBody implements ResponseBody {
94
+ private dataSource;
95
+ constructor(dataSource: Promise<Buffer>);
96
+ binary(): Promise<Buffer>;
97
+ text(): Promise<string>;
98
+ }
99
+ export declare class ResponseContext {
100
+ httpStatusCode: number;
101
+ headers: {
102
+ [key: string]: string;
103
+ };
104
+ body: ResponseBody;
105
+ constructor(httpStatusCode: number, headers: {
106
+ [key: string]: string;
107
+ }, body: ResponseBody);
108
+ /**
109
+ * Parse header value in the form `value; param1="value1"`
110
+ *
111
+ * E.g. for Content-Type or Content-Disposition
112
+ * Parameter names are converted to lower case
113
+ * The first parameter is returned with the key `""`
114
+ */
115
+ getParsedHeader(headerName: string): {
116
+ [parameter: string]: string;
117
+ };
118
+ getBodyAsFile(): Promise<HttpFile>;
119
+ /**
120
+ * Use a heuristic to get a body of unknown data structure.
121
+ * Return as string if possible, otherwise as binary.
122
+ */
123
+ getBodyAsAny(): Promise<string | Buffer | undefined>;
124
+ }
125
+ export interface HttpLibrary {
126
+ send(request: RequestContext): Observable<ResponseContext>;
127
+ }
128
+ export interface PromiseHttpLibrary {
129
+ send(request: RequestContext): Promise<ResponseContext>;
130
+ }
131
+ export declare function wrapHttpLibrary(promiseHttpLibrary: PromiseHttpLibrary): HttpLibrary;
132
+ export declare class HttpInfo<T> extends ResponseContext {
133
+ httpStatusCode: number;
134
+ headers: {
135
+ [key: string]: string;
136
+ };
137
+ body: ResponseBody;
138
+ data: T;
139
+ constructor(httpStatusCode: number, headers: {
140
+ [key: string]: string;
141
+ }, body: ResponseBody, data: T);
142
+ }
@@ -0,0 +1,229 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
+ };
16
+ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
17
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
18
+ return new (P || (P = Promise))(function (resolve, reject) {
19
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
20
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
21
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
22
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
23
+ });
24
+ };
25
+ Object.defineProperty(exports, "__esModule", { value: true });
26
+ exports.HttpInfo = exports.wrapHttpLibrary = exports.ResponseContext = exports.SelfDecodingBody = exports.RequestContext = exports.HttpException = exports.HttpMethod = void 0;
27
+ const url_1 = require("url");
28
+ const rxjsStub_1 = require("../rxjsStub");
29
+ __exportStar(require("./isomorphic-fetch"), exports);
30
+ /**
31
+ * Represents an HTTP method.
32
+ */
33
+ var HttpMethod;
34
+ (function (HttpMethod) {
35
+ HttpMethod["GET"] = "GET";
36
+ HttpMethod["HEAD"] = "HEAD";
37
+ HttpMethod["POST"] = "POST";
38
+ HttpMethod["PUT"] = "PUT";
39
+ HttpMethod["DELETE"] = "DELETE";
40
+ HttpMethod["CONNECT"] = "CONNECT";
41
+ HttpMethod["OPTIONS"] = "OPTIONS";
42
+ HttpMethod["TRACE"] = "TRACE";
43
+ HttpMethod["PATCH"] = "PATCH";
44
+ })(HttpMethod = exports.HttpMethod || (exports.HttpMethod = {}));
45
+ class HttpException extends Error {
46
+ constructor(msg) {
47
+ super(msg);
48
+ }
49
+ }
50
+ exports.HttpException = HttpException;
51
+ function ensureAbsoluteUrl(url) {
52
+ if (url.startsWith("http://") || url.startsWith("https://")) {
53
+ return url;
54
+ }
55
+ throw new Error("You need to define an absolute base url for the server.");
56
+ }
57
+ /**
58
+ * Represents an HTTP request context
59
+ */
60
+ class RequestContext {
61
+ /**
62
+ * Creates the request context using a http method and request resource url
63
+ *
64
+ * @param url url of the requested resource
65
+ * @param httpMethod http method
66
+ */
67
+ constructor(url, httpMethod) {
68
+ this.httpMethod = httpMethod;
69
+ this.headers = {};
70
+ this.body = undefined;
71
+ this.agent = undefined;
72
+ this.url = new url_1.URL(ensureAbsoluteUrl(url));
73
+ }
74
+ /*
75
+ * Returns the url set in the constructor including the query string
76
+ *
77
+ */
78
+ getUrl() {
79
+ return this.url.toString().endsWith("/") ?
80
+ this.url.toString().slice(0, -1)
81
+ : this.url.toString();
82
+ }
83
+ /**
84
+ * Replaces the url set in the constructor with this url.
85
+ *
86
+ */
87
+ setUrl(url) {
88
+ this.url = new url_1.URL(ensureAbsoluteUrl(url));
89
+ }
90
+ /**
91
+ * Sets the body of the http request either as a string or FormData
92
+ *
93
+ * Note that setting a body on a HTTP GET, HEAD, DELETE, CONNECT or TRACE
94
+ * request is discouraged.
95
+ * https://httpwg.org/http-core/draft-ietf-httpbis-semantics-latest.html#rfc.section.7.3.1
96
+ *
97
+ * @param body the body of the request
98
+ */
99
+ setBody(body) {
100
+ this.body = body;
101
+ }
102
+ getHttpMethod() {
103
+ return this.httpMethod;
104
+ }
105
+ getHeaders() {
106
+ return this.headers;
107
+ }
108
+ getBody() {
109
+ return this.body;
110
+ }
111
+ setQueryParam(name, value) {
112
+ this.url.searchParams.set(name, value);
113
+ }
114
+ /**
115
+ * Sets a cookie with the name and value. NO check for duplicate cookies is performed
116
+ *
117
+ */
118
+ addCookie(name, value) {
119
+ if (!this.headers["Cookie"]) {
120
+ this.headers["Cookie"] = "";
121
+ }
122
+ this.headers["Cookie"] += name + "=" + value + "; ";
123
+ }
124
+ setHeaderParam(key, value) {
125
+ this.headers[key] = value;
126
+ }
127
+ setAgent(agent) {
128
+ this.agent = agent;
129
+ }
130
+ getAgent() {
131
+ return this.agent;
132
+ }
133
+ }
134
+ exports.RequestContext = RequestContext;
135
+ /**
136
+ * Helper class to generate a `ResponseBody` from binary data
137
+ */
138
+ class SelfDecodingBody {
139
+ constructor(dataSource) {
140
+ this.dataSource = dataSource;
141
+ }
142
+ binary() {
143
+ return this.dataSource;
144
+ }
145
+ text() {
146
+ return __awaiter(this, void 0, void 0, function* () {
147
+ const data = yield this.dataSource;
148
+ return data.toString();
149
+ });
150
+ }
151
+ }
152
+ exports.SelfDecodingBody = SelfDecodingBody;
153
+ class ResponseContext {
154
+ constructor(httpStatusCode, headers, body) {
155
+ this.httpStatusCode = httpStatusCode;
156
+ this.headers = headers;
157
+ this.body = body;
158
+ }
159
+ /**
160
+ * Parse header value in the form `value; param1="value1"`
161
+ *
162
+ * E.g. for Content-Type or Content-Disposition
163
+ * Parameter names are converted to lower case
164
+ * The first parameter is returned with the key `""`
165
+ */
166
+ getParsedHeader(headerName) {
167
+ const result = {};
168
+ if (!this.headers[headerName]) {
169
+ return result;
170
+ }
171
+ const parameters = this.headers[headerName].split(";");
172
+ for (const parameter of parameters) {
173
+ let [key, value] = parameter.split("=", 2);
174
+ key = key.toLowerCase().trim();
175
+ if (value === undefined) {
176
+ result[""] = key;
177
+ }
178
+ else {
179
+ value = value.trim();
180
+ if (value.startsWith('"') && value.endsWith('"')) {
181
+ value = value.substring(1, value.length - 1);
182
+ }
183
+ result[key] = value;
184
+ }
185
+ }
186
+ return result;
187
+ }
188
+ getBodyAsFile() {
189
+ return __awaiter(this, void 0, void 0, function* () {
190
+ const data = yield this.body.binary();
191
+ const fileName = this.getParsedHeader("content-disposition")["filename"] || "";
192
+ return { data, name: fileName };
193
+ });
194
+ }
195
+ /**
196
+ * Use a heuristic to get a body of unknown data structure.
197
+ * Return as string if possible, otherwise as binary.
198
+ */
199
+ getBodyAsAny() {
200
+ try {
201
+ return this.body.text();
202
+ }
203
+ catch (_a) { }
204
+ try {
205
+ return this.body.binary();
206
+ }
207
+ catch (_b) { }
208
+ return Promise.resolve(undefined);
209
+ }
210
+ }
211
+ exports.ResponseContext = ResponseContext;
212
+ function wrapHttpLibrary(promiseHttpLibrary) {
213
+ return {
214
+ send(request) {
215
+ return (0, rxjsStub_1.from)(promiseHttpLibrary.send(request));
216
+ }
217
+ };
218
+ }
219
+ exports.wrapHttpLibrary = wrapHttpLibrary;
220
+ class HttpInfo extends ResponseContext {
221
+ constructor(httpStatusCode, headers, body, data) {
222
+ super(httpStatusCode, headers, body);
223
+ this.httpStatusCode = httpStatusCode;
224
+ this.headers = headers;
225
+ this.body = body;
226
+ this.data = data;
227
+ }
228
+ }
229
+ exports.HttpInfo = HttpInfo;
@@ -0,0 +1,5 @@
1
+ import { HttpLibrary, RequestContext, ResponseContext } from './http';
2
+ import { Observable } from '../rxjsStub';
3
+ export declare class IsomorphicFetchHttpLibrary implements HttpLibrary {
4
+ send(request: RequestContext): Observable<ResponseContext>;
5
+ }
@@ -0,0 +1,33 @@
1
+ "use strict";
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ exports.IsomorphicFetchHttpLibrary = void 0;
7
+ const http_1 = require("./http");
8
+ const rxjsStub_1 = require("../rxjsStub");
9
+ const node_fetch_1 = __importDefault(require("node-fetch"));
10
+ class IsomorphicFetchHttpLibrary {
11
+ send(request) {
12
+ let method = request.getHttpMethod().toString();
13
+ let body = request.getBody();
14
+ const resultPromise = (0, node_fetch_1.default)(request.getUrl(), {
15
+ method: method,
16
+ body: body,
17
+ headers: request.getHeaders(),
18
+ agent: request.getAgent(),
19
+ }).then((resp) => {
20
+ const headers = {};
21
+ resp.headers.forEach((value, name) => {
22
+ headers[name] = value;
23
+ });
24
+ const body = {
25
+ text: () => resp.text(),
26
+ binary: () => resp.buffer()
27
+ };
28
+ return new http_1.ResponseContext(resp.status, headers, body);
29
+ });
30
+ return (0, rxjsStub_1.from)(resultPromise);
31
+ }
32
+ }
33
+ exports.IsomorphicFetchHttpLibrary = IsomorphicFetchHttpLibrary;
@@ -0,0 +1,10 @@
1
+ export * from "./http/http";
2
+ export * from "./auth/auth";
3
+ export * from "./models/all";
4
+ export { createConfiguration } from "./configuration";
5
+ export { Configuration } from "./configuration";
6
+ export * from "./apis/exception";
7
+ export * from "./servers";
8
+ export { RequiredError } from "./apis/baseapi";
9
+ export { PromiseMiddleware as Middleware } from './middleware';
10
+ export { PromiseAuthenticationApi as AuthenticationApi, PromiseCustomersApi as CustomersApi, PromiseEntitlementsApi as EntitlementsApi, PromiseEventsApi as EventsApi, PromiseInvoicesApi as InvoicesApi, PromiseProductsApi as ProductsApi } from './types/PromiseAPI';
@@ -0,0 +1,33 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
+ };
16
+ Object.defineProperty(exports, "__esModule", { value: true });
17
+ exports.ProductsApi = exports.InvoicesApi = exports.EventsApi = exports.EntitlementsApi = exports.CustomersApi = exports.AuthenticationApi = exports.RequiredError = exports.createConfiguration = void 0;
18
+ __exportStar(require("./http/http"), exports);
19
+ __exportStar(require("./auth/auth"), exports);
20
+ __exportStar(require("./models/all"), exports);
21
+ var configuration_1 = require("./configuration");
22
+ Object.defineProperty(exports, "createConfiguration", { enumerable: true, get: function () { return configuration_1.createConfiguration; } });
23
+ __exportStar(require("./apis/exception"), exports);
24
+ __exportStar(require("./servers"), exports);
25
+ var baseapi_1 = require("./apis/baseapi");
26
+ Object.defineProperty(exports, "RequiredError", { enumerable: true, get: function () { return baseapi_1.RequiredError; } });
27
+ var PromiseAPI_1 = require("./types/PromiseAPI");
28
+ Object.defineProperty(exports, "AuthenticationApi", { enumerable: true, get: function () { return PromiseAPI_1.PromiseAuthenticationApi; } });
29
+ Object.defineProperty(exports, "CustomersApi", { enumerable: true, get: function () { return PromiseAPI_1.PromiseCustomersApi; } });
30
+ Object.defineProperty(exports, "EntitlementsApi", { enumerable: true, get: function () { return PromiseAPI_1.PromiseEntitlementsApi; } });
31
+ Object.defineProperty(exports, "EventsApi", { enumerable: true, get: function () { return PromiseAPI_1.PromiseEventsApi; } });
32
+ Object.defineProperty(exports, "InvoicesApi", { enumerable: true, get: function () { return PromiseAPI_1.PromiseInvoicesApi; } });
33
+ Object.defineProperty(exports, "ProductsApi", { enumerable: true, get: function () { return PromiseAPI_1.PromiseProductsApi; } });
@@ -0,0 +1,54 @@
1
+ import { RequestContext, ResponseContext } from './http/http';
2
+ import { Observable } from './rxjsStub';
3
+ /**
4
+ * Defines the contract for a middleware intercepting requests before
5
+ * they are sent (but after the RequestContext was created)
6
+ * and before the ResponseContext is unwrapped.
7
+ *
8
+ */
9
+ export interface Middleware {
10
+ /**
11
+ * Modifies the request before the request is sent.
12
+ *
13
+ * @param context RequestContext of a request which is about to be sent to the server
14
+ * @returns an observable of the updated request context
15
+ *
16
+ */
17
+ pre(context: RequestContext): Observable<RequestContext>;
18
+ /**
19
+ * Modifies the returned response before it is deserialized.
20
+ *
21
+ * @param context ResponseContext of a sent request
22
+ * @returns an observable of the modified response context
23
+ */
24
+ post(context: ResponseContext): Observable<ResponseContext>;
25
+ }
26
+ export declare class PromiseMiddlewareWrapper implements Middleware {
27
+ private middleware;
28
+ constructor(middleware: PromiseMiddleware);
29
+ pre(context: RequestContext): Observable<RequestContext>;
30
+ post(context: ResponseContext): Observable<ResponseContext>;
31
+ }
32
+ /**
33
+ * Defines the contract for a middleware intercepting requests before
34
+ * they are sent (but after the RequestContext was created)
35
+ * and before the ResponseContext is unwrapped.
36
+ *
37
+ */
38
+ export interface PromiseMiddleware {
39
+ /**
40
+ * Modifies the request before the request is sent.
41
+ *
42
+ * @param context RequestContext of a request which is about to be sent to the server
43
+ * @returns an observable of the updated request context
44
+ *
45
+ */
46
+ pre(context: RequestContext): Promise<RequestContext>;
47
+ /**
48
+ * Modifies the returned response before it is deserialized.
49
+ *
50
+ * @param context ResponseContext of a sent request
51
+ * @returns an observable of the modified response context
52
+ */
53
+ post(context: ResponseContext): Promise<ResponseContext>;
54
+ }
@@ -0,0 +1,16 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.PromiseMiddlewareWrapper = void 0;
4
+ const rxjsStub_1 = require("./rxjsStub");
5
+ class PromiseMiddlewareWrapper {
6
+ constructor(middleware) {
7
+ this.middleware = middleware;
8
+ }
9
+ pre(context) {
10
+ return (0, rxjsStub_1.from)(this.middleware.pre(context));
11
+ }
12
+ post(context) {
13
+ return (0, rxjsStub_1.from)(this.middleware.post(context));
14
+ }
15
+ }
16
+ exports.PromiseMiddlewareWrapper = PromiseMiddlewareWrapper;
@@ -0,0 +1,45 @@
1
+ /**
2
+ * 24k
3
+ * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
4
+ *
5
+ * OpenAPI spec version: 1.0.0
6
+ *
7
+ *
8
+ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
9
+ * https://openapi-generator.tech
10
+ * Do not edit the class manually.
11
+ */
12
+ export declare class APICreateCustomerPayload {
13
+ /**
14
+ * Name
15
+ */
16
+ 'name': string;
17
+ /**
18
+ * External ID
19
+ */
20
+ 'externalId': string;
21
+ /**
22
+ * Construct a type with a set of properties K of type T
23
+ */
24
+ 'metadata'?: {
25
+ [key: string]: any;
26
+ };
27
+ /**
28
+ * Aliases
29
+ */
30
+ 'aliases'?: Array<string>;
31
+ static readonly discriminator: string | undefined;
32
+ static readonly attributeTypeMap: Array<{
33
+ name: string;
34
+ baseName: string;
35
+ type: string;
36
+ format: string;
37
+ }>;
38
+ static getAttributeTypeMap(): {
39
+ name: string;
40
+ baseName: string;
41
+ type: string;
42
+ format: string;
43
+ }[];
44
+ constructor();
45
+ }
@@ -0,0 +1,49 @@
1
+ "use strict";
2
+ /**
3
+ * 24k
4
+ * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
5
+ *
6
+ * OpenAPI spec version: 1.0.0
7
+ *
8
+ *
9
+ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
10
+ * https://openapi-generator.tech
11
+ * Do not edit the class manually.
12
+ */
13
+ Object.defineProperty(exports, "__esModule", { value: true });
14
+ exports.APICreateCustomerPayload = void 0;
15
+ class APICreateCustomerPayload {
16
+ static getAttributeTypeMap() {
17
+ return APICreateCustomerPayload.attributeTypeMap;
18
+ }
19
+ constructor() {
20
+ }
21
+ }
22
+ exports.APICreateCustomerPayload = APICreateCustomerPayload;
23
+ APICreateCustomerPayload.discriminator = undefined;
24
+ APICreateCustomerPayload.attributeTypeMap = [
25
+ {
26
+ "name": "name",
27
+ "baseName": "name",
28
+ "type": "string",
29
+ "format": ""
30
+ },
31
+ {
32
+ "name": "externalId",
33
+ "baseName": "externalId",
34
+ "type": "string",
35
+ "format": ""
36
+ },
37
+ {
38
+ "name": "metadata",
39
+ "baseName": "metadata",
40
+ "type": "{ [key: string]: any; }",
41
+ "format": ""
42
+ },
43
+ {
44
+ "name": "aliases",
45
+ "baseName": "aliases",
46
+ "type": "Array<string>",
47
+ "format": ""
48
+ }
49
+ ];
@@ -0,0 +1,41 @@
1
+ /**
2
+ * 24k
3
+ * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
4
+ *
5
+ * OpenAPI spec version: 1.0.0
6
+ *
7
+ *
8
+ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
9
+ * https://openapi-generator.tech
10
+ * Do not edit the class manually.
11
+ */
12
+ import { APIInvoiceBillingPeriod } from '../models/APIInvoiceBillingPeriod';
13
+ export declare class APICreateInvoicePayload {
14
+ /**
15
+ * Name
16
+ */
17
+ 'name': string;
18
+ /**
19
+ * Customer ID
20
+ */
21
+ 'customerId': string;
22
+ /**
23
+ * Products
24
+ */
25
+ 'products': Array<string>;
26
+ 'billingPeriod': APIInvoiceBillingPeriod;
27
+ static readonly discriminator: string | undefined;
28
+ static readonly attributeTypeMap: Array<{
29
+ name: string;
30
+ baseName: string;
31
+ type: string;
32
+ format: string;
33
+ }>;
34
+ static getAttributeTypeMap(): {
35
+ name: string;
36
+ baseName: string;
37
+ type: string;
38
+ format: string;
39
+ }[];
40
+ constructor();
41
+ }