@compassdigital/sdk.typescript 3.0.0-beta.13 → 3.0.0-beta.14
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.
- package/README.md +10 -5
- package/gen.ts +13 -5
- package/lib/announcement.d.ts.map +1 -1
- package/lib/announcement.js +1 -0
- package/lib/announcement.js.map +1 -1
- package/lib/base.d.ts.map +1 -1
- package/lib/base.js.map +1 -1
- package/lib/brand.d.ts.map +1 -1
- package/lib/brand.js +1 -0
- package/lib/brand.js.map +1 -1
- package/lib/calendar.d.ts.map +1 -1
- package/lib/calendar.js +1 -0
- package/lib/calendar.js.map +1 -1
- package/lib/client/base.d.ts +157 -0
- package/lib/client/base.d.ts.map +1 -0
- package/lib/client/base.js +392 -0
- package/lib/client/base.js.map +1 -0
- package/lib/client/index.d.ts +1877 -0
- package/lib/client/index.d.ts.map +1 -0
- package/lib/client/index.js +2208 -0
- package/lib/client/index.js.map +1 -0
- package/lib/config.d.ts.map +1 -1
- package/lib/config.js +1 -0
- package/lib/config.js.map +1 -1
- package/lib/datalake.d.ts.map +1 -1
- package/lib/datalake.js +1 -0
- package/lib/datalake.js.map +1 -1
- package/lib/delivery.d.ts.map +1 -1
- package/lib/delivery.js +1 -0
- package/lib/delivery.js.map +1 -1
- package/lib/dh.d.ts.map +1 -1
- package/lib/dh.js +1 -0
- package/lib/dh.js.map +1 -1
- package/lib/email.d.ts.map +1 -1
- package/lib/email.js +1 -0
- package/lib/email.js.map +1 -1
- package/lib/file.d.ts.map +1 -1
- package/lib/file.js +1 -0
- package/lib/file.js.map +1 -1
- package/lib/index.d.ts +8 -19
- package/lib/index.d.ts.map +1 -1
- package/lib/index.js +11 -2
- package/lib/index.js.map +1 -1
- package/lib/interface/announcement.d.ts +76 -0
- package/lib/interface/announcement.d.ts.map +1 -0
- package/lib/interface/announcement.js +4 -0
- package/lib/interface/announcement.js.map +1 -0
- package/lib/interface/brand.d.ts +16 -0
- package/lib/interface/brand.d.ts.map +1 -0
- package/lib/interface/brand.js +4 -0
- package/lib/interface/brand.js.map +1 -0
- package/lib/interface/calendar.d.ts +85 -0
- package/lib/interface/calendar.d.ts.map +1 -0
- package/lib/interface/calendar.js +4 -0
- package/lib/interface/calendar.js.map +1 -0
- package/lib/interface/config.d.ts +68 -0
- package/lib/interface/config.d.ts.map +1 -0
- package/lib/interface/config.js +4 -0
- package/lib/interface/config.js.map +1 -0
- package/lib/interface/datalake.d.ts +19 -0
- package/lib/interface/datalake.d.ts.map +1 -0
- package/lib/interface/datalake.js +4 -0
- package/lib/interface/datalake.js.map +1 -0
- package/lib/interface/delivery.d.ts +34 -0
- package/lib/interface/delivery.d.ts.map +1 -0
- package/lib/interface/delivery.js +4 -0
- package/lib/interface/delivery.js.map +1 -0
- package/lib/interface/dh.d.ts +9 -0
- package/lib/interface/dh.d.ts.map +1 -0
- package/lib/interface/dh.js +4 -0
- package/lib/interface/dh.js.map +1 -0
- package/lib/interface/email.d.ts +5 -0
- package/lib/interface/email.d.ts.map +1 -0
- package/lib/interface/email.js +4 -0
- package/lib/interface/email.js.map +1 -0
- package/lib/interface/file.d.ts +17 -0
- package/lib/interface/file.d.ts.map +1 -0
- package/lib/interface/file.js +4 -0
- package/lib/interface/file.js.map +1 -0
- package/lib/interface/kds.d.ts +58 -0
- package/lib/interface/kds.d.ts.map +1 -0
- package/lib/interface/kds.js +4 -0
- package/lib/interface/kds.js.map +1 -0
- package/lib/interface/location.d.ts +747 -0
- package/lib/interface/location.d.ts.map +1 -0
- package/lib/interface/location.js +4 -0
- package/lib/interface/location.js.map +1 -0
- package/lib/interface/logger.d.ts +29 -0
- package/lib/interface/logger.d.ts.map +1 -0
- package/lib/interface/logger.js +4 -0
- package/lib/interface/logger.js.map +1 -0
- package/lib/interface/loyalty.d.ts +350 -0
- package/lib/interface/loyalty.d.ts.map +1 -0
- package/lib/interface/loyalty.js +4 -0
- package/lib/interface/loyalty.js.map +1 -0
- package/lib/interface/mealplan.d.ts +177 -0
- package/lib/interface/mealplan.d.ts.map +1 -0
- package/lib/interface/mealplan.js +4 -0
- package/lib/interface/mealplan.js.map +1 -0
- package/lib/interface/message.d.ts +38 -0
- package/lib/interface/message.d.ts.map +1 -0
- package/lib/interface/message.js +4 -0
- package/lib/interface/message.js.map +1 -0
- package/lib/interface/order.d.ts +303 -0
- package/lib/interface/order.d.ts.map +1 -0
- package/lib/interface/order.js +4 -0
- package/lib/interface/order.js.map +1 -0
- package/lib/interface/partner.d.ts +402 -0
- package/lib/interface/partner.d.ts.map +1 -0
- package/lib/interface/partner.js +4 -0
- package/lib/interface/partner.js.map +1 -0
- package/lib/interface/payment.d.ts +250 -0
- package/lib/interface/payment.d.ts.map +1 -0
- package/lib/interface/payment.js +4 -0
- package/lib/interface/payment.js.map +1 -0
- package/lib/interface/promo.d.ts +312 -0
- package/lib/interface/promo.d.ts.map +1 -0
- package/lib/interface/promo.js +4 -0
- package/lib/interface/promo.js.map +1 -0
- package/lib/interface/report.d.ts +376 -0
- package/lib/interface/report.d.ts.map +1 -0
- package/lib/interface/report.js +4 -0
- package/lib/interface/report.js.map +1 -0
- package/lib/interface/schedule.d.ts +95 -0
- package/lib/interface/schedule.d.ts.map +1 -0
- package/lib/interface/schedule.js +4 -0
- package/lib/interface/schedule.js.map +1 -0
- package/lib/interface/shoppingcart.d.ts +279 -0
- package/lib/interface/shoppingcart.d.ts.map +1 -0
- package/lib/interface/shoppingcart.js +4 -0
- package/lib/interface/shoppingcart.js.map +1 -0
- package/lib/interface/task.d.ts +171 -0
- package/lib/interface/task.d.ts.map +1 -0
- package/lib/interface/task.js +4 -0
- package/lib/interface/task.js.map +1 -0
- package/lib/interface/user.d.ts +359 -0
- package/lib/interface/user.d.ts.map +1 -0
- package/lib/interface/user.js +4 -0
- package/lib/interface/user.js.map +1 -0
- package/lib/interface/vote.d.ts +52 -0
- package/lib/interface/vote.d.ts.map +1 -0
- package/lib/interface/vote.js +4 -0
- package/lib/interface/vote.js.map +1 -0
- package/lib/kds.d.ts.map +1 -1
- package/lib/kds.js +1 -0
- package/lib/kds.js.map +1 -1
- package/lib/location.d.ts +4 -4
- package/lib/location.d.ts.map +1 -1
- package/lib/location.js +1 -0
- package/lib/location.js.map +1 -1
- package/lib/logger.d.ts.map +1 -1
- package/lib/logger.js +1 -0
- package/lib/logger.js.map +1 -1
- package/lib/loyalty.d.ts.map +1 -1
- package/lib/loyalty.js +1 -0
- package/lib/loyalty.js.map +1 -1
- package/lib/mealplan.d.ts.map +1 -1
- package/lib/mealplan.js +1 -0
- package/lib/mealplan.js.map +1 -1
- package/lib/message.d.ts.map +1 -1
- package/lib/message.js +1 -0
- package/lib/message.js.map +1 -1
- package/lib/order.d.ts.map +1 -1
- package/lib/order.js +1 -0
- package/lib/order.js.map +1 -1
- package/lib/partner.d.ts +13 -0
- package/lib/partner.d.ts.map +1 -1
- package/lib/partner.js +1 -0
- package/lib/partner.js.map +1 -1
- package/lib/payment.d.ts.map +1 -1
- package/lib/payment.js +1 -0
- package/lib/payment.js.map +1 -1
- package/lib/promo.d.ts.map +1 -1
- package/lib/promo.js +1 -0
- package/lib/promo.js.map +1 -1
- package/lib/report.d.ts.map +1 -1
- package/lib/report.js +1 -0
- package/lib/report.js.map +1 -1
- package/lib/schedule.d.ts.map +1 -1
- package/lib/schedule.js +1 -0
- package/lib/schedule.js.map +1 -1
- package/lib/shoppingcart.d.ts.map +1 -1
- package/lib/shoppingcart.js +1 -0
- package/lib/shoppingcart.js.map +1 -1
- package/lib/task.d.ts.map +1 -1
- package/lib/task.js +1 -0
- package/lib/task.js.map +1 -1
- package/lib/user.d.ts.map +1 -1
- package/lib/user.js +1 -0
- package/lib/user.js.map +1 -1
- package/lib/vote.d.ts.map +1 -1
- package/lib/vote.js +1 -0
- package/lib/vote.js.map +1 -1
- package/package.json +1 -1
- package/src/{index.ts → client/index.ts} +54 -24
- package/src/{announcement.ts → interface/announcement.ts} +2 -0
- package/src/{brand.ts → interface/brand.ts} +2 -0
- package/src/{calendar.ts → interface/calendar.ts} +2 -0
- package/src/{config.ts → interface/config.ts} +2 -0
- package/src/{datalake.ts → interface/datalake.ts} +2 -0
- package/src/{delivery.ts → interface/delivery.ts} +2 -0
- package/src/{dh.ts → interface/dh.ts} +2 -0
- package/src/{email.ts → interface/email.ts} +2 -0
- package/src/{file.ts → interface/file.ts} +2 -0
- package/src/{kds.ts → interface/kds.ts} +2 -0
- package/src/{location.ts → interface/location.ts} +2 -0
- package/src/{logger.ts → interface/logger.ts} +2 -0
- package/src/{loyalty.ts → interface/loyalty.ts} +2 -0
- package/src/{mealplan.ts → interface/mealplan.ts} +2 -0
- package/src/{message.ts → interface/message.ts} +2 -0
- package/src/{order.ts → interface/order.ts} +2 -0
- package/src/{partner.ts → interface/partner.ts} +25 -0
- package/src/{payment.ts → interface/payment.ts} +2 -0
- package/src/{promo.ts → interface/promo.ts} +2 -0
- package/src/{report.ts → interface/report.ts} +2 -0
- package/src/{schedule.ts → interface/schedule.ts} +2 -0
- package/src/{shoppingcart.ts → interface/shoppingcart.ts} +2 -0
- package/src/{task.ts → interface/task.ts} +2 -0
- package/src/{user.ts → interface/user.ts} +2 -0
- package/src/{vote.ts → interface/vote.ts} +2 -0
- package/test/client.test.ts +57 -73
- /package/src/{base.ts → client/base.ts} +0 -0
|
@@ -0,0 +1,392 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __extends = (this && this.__extends) || (function () {
|
|
3
|
+
var extendStatics = function (d, b) {
|
|
4
|
+
extendStatics = Object.setPrototypeOf ||
|
|
5
|
+
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
|
|
6
|
+
function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
|
|
7
|
+
return extendStatics(d, b);
|
|
8
|
+
};
|
|
9
|
+
return function (d, b) {
|
|
10
|
+
if (typeof b !== "function" && b !== null)
|
|
11
|
+
throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
|
|
12
|
+
extendStatics(d, b);
|
|
13
|
+
function __() { this.constructor = d; }
|
|
14
|
+
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
|
15
|
+
};
|
|
16
|
+
})();
|
|
17
|
+
var __assign = (this && this.__assign) || function () {
|
|
18
|
+
__assign = Object.assign || function(t) {
|
|
19
|
+
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
20
|
+
s = arguments[i];
|
|
21
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
22
|
+
t[p] = s[p];
|
|
23
|
+
}
|
|
24
|
+
return t;
|
|
25
|
+
};
|
|
26
|
+
return __assign.apply(this, arguments);
|
|
27
|
+
};
|
|
28
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
29
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
30
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
31
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
32
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
33
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
34
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
35
|
+
});
|
|
36
|
+
};
|
|
37
|
+
var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
38
|
+
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
|
|
39
|
+
return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
|
|
40
|
+
function verb(n) { return function (v) { return step([n, v]); }; }
|
|
41
|
+
function step(op) {
|
|
42
|
+
if (f) throw new TypeError("Generator is already executing.");
|
|
43
|
+
while (_) try {
|
|
44
|
+
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
|
|
45
|
+
if (y = 0, t) op = [op[0] & 2, t.value];
|
|
46
|
+
switch (op[0]) {
|
|
47
|
+
case 0: case 1: t = op; break;
|
|
48
|
+
case 4: _.label++; return { value: op[1], done: false };
|
|
49
|
+
case 5: _.label++; y = op[1]; op = [0]; continue;
|
|
50
|
+
case 7: op = _.ops.pop(); _.trys.pop(); continue;
|
|
51
|
+
default:
|
|
52
|
+
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
|
|
53
|
+
if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
|
|
54
|
+
if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
|
|
55
|
+
if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
|
|
56
|
+
if (t[2]) _.ops.pop();
|
|
57
|
+
_.trys.pop(); continue;
|
|
58
|
+
}
|
|
59
|
+
op = body.call(thisArg, _);
|
|
60
|
+
} catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
|
|
61
|
+
if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
|
|
62
|
+
}
|
|
63
|
+
};
|
|
64
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
65
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
66
|
+
};
|
|
67
|
+
var _a;
|
|
68
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
69
|
+
exports.BaseServiceClient = exports.ServiceError = exports.ResponsePromise = void 0;
|
|
70
|
+
var cross_fetch_1 = __importDefault(require("cross-fetch"));
|
|
71
|
+
/**
|
|
72
|
+
* We have to re-implement the promise methods instead of just existing
|
|
73
|
+
* the existing Promise class due to: https://github.com/microsoft/TypeScript/issues/15202
|
|
74
|
+
*/
|
|
75
|
+
var ResponsePromise = /** @class */ (function () {
|
|
76
|
+
function ResponsePromise(promise) {
|
|
77
|
+
this.promise = promise;
|
|
78
|
+
/**
|
|
79
|
+
* Implements Promise interface.
|
|
80
|
+
*/
|
|
81
|
+
this[_a] = "[object ResponsePromise]";
|
|
82
|
+
}
|
|
83
|
+
/**
|
|
84
|
+
* Implements Promise interface.
|
|
85
|
+
*/
|
|
86
|
+
ResponsePromise.prototype.then = function (onfulfilled, onrejected) {
|
|
87
|
+
return new ResponsePromise(this.promise.then(onfulfilled, onrejected));
|
|
88
|
+
};
|
|
89
|
+
/**
|
|
90
|
+
* Implements Promise interface.
|
|
91
|
+
*/
|
|
92
|
+
ResponsePromise.prototype.catch = function (onrejected) {
|
|
93
|
+
return new ResponsePromise(this.promise.catch(onrejected));
|
|
94
|
+
};
|
|
95
|
+
/**
|
|
96
|
+
* Implements Promise interface.
|
|
97
|
+
*/
|
|
98
|
+
ResponsePromise.prototype.finally = function (onfinally) {
|
|
99
|
+
return new ResponsePromise(this.promise.finally(onfinally));
|
|
100
|
+
};
|
|
101
|
+
/**
|
|
102
|
+
* Returns a promise that resolves to null if http status code
|
|
103
|
+
* or service error code matches one of the provided codes.
|
|
104
|
+
* If no codes are specified, all codes are ignored.
|
|
105
|
+
*/
|
|
106
|
+
ResponsePromise.prototype.ignore = function () {
|
|
107
|
+
var codes = [];
|
|
108
|
+
for (var _i = 0; _i < arguments.length; _i++) {
|
|
109
|
+
codes[_i] = arguments[_i];
|
|
110
|
+
}
|
|
111
|
+
return new ResponsePromise(ServiceError.ignore(codes, this.promise));
|
|
112
|
+
};
|
|
113
|
+
/**
|
|
114
|
+
* Returns a promise that resolves to either the response body
|
|
115
|
+
* or a ServiceError.
|
|
116
|
+
*/
|
|
117
|
+
ResponsePromise.prototype.combine = function () {
|
|
118
|
+
var codes = [];
|
|
119
|
+
for (var _i = 0; _i < arguments.length; _i++) {
|
|
120
|
+
codes[_i] = arguments[_i];
|
|
121
|
+
}
|
|
122
|
+
return new ResponsePromise(ServiceError.combine(codes, this.promise));
|
|
123
|
+
};
|
|
124
|
+
return ResponsePromise;
|
|
125
|
+
}());
|
|
126
|
+
exports.ResponsePromise = ResponsePromise;
|
|
127
|
+
_a = Symbol.toStringTag;
|
|
128
|
+
/**
|
|
129
|
+
* An error returned from an api service.
|
|
130
|
+
*/
|
|
131
|
+
var ServiceError = /** @class */ (function (_super) {
|
|
132
|
+
__extends(ServiceError, _super);
|
|
133
|
+
function ServiceError(status, // http status
|
|
134
|
+
code, // service error code
|
|
135
|
+
message // service error message
|
|
136
|
+
) {
|
|
137
|
+
var _this = _super.call(this, message) || this;
|
|
138
|
+
_this.status = status;
|
|
139
|
+
_this.code = code;
|
|
140
|
+
_this.name = "ServiceError(" + code + ")";
|
|
141
|
+
// TODO: remove this if we change compilation target > es5
|
|
142
|
+
Object.setPrototypeOf(_this, ServiceError.prototype);
|
|
143
|
+
return _this;
|
|
144
|
+
}
|
|
145
|
+
/**
|
|
146
|
+
* Returns the http status code from err.
|
|
147
|
+
* If err isn't an instance of ServiceError, -1 is returned.
|
|
148
|
+
*/
|
|
149
|
+
ServiceError.status = function (err) {
|
|
150
|
+
if (err instanceof ServiceError) {
|
|
151
|
+
return err.status;
|
|
152
|
+
}
|
|
153
|
+
return -1;
|
|
154
|
+
};
|
|
155
|
+
/**
|
|
156
|
+
* Returns the service error code from err.
|
|
157
|
+
* If err isn't an instance of ServiceError, -1 is returned.
|
|
158
|
+
*/
|
|
159
|
+
ServiceError.code = function (err) {
|
|
160
|
+
if (err instanceof ServiceError) {
|
|
161
|
+
return err.code;
|
|
162
|
+
}
|
|
163
|
+
return -1;
|
|
164
|
+
};
|
|
165
|
+
/**
|
|
166
|
+
* Returns a promise that resolves to null if http status code
|
|
167
|
+
* or service error code matches one of the provided codes.
|
|
168
|
+
* If no codes are specified, all codes are ignored.
|
|
169
|
+
*/
|
|
170
|
+
ServiceError.ignore = function (codes, response) {
|
|
171
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
172
|
+
var err_1, _i, codes_1, code;
|
|
173
|
+
return __generator(this, function (_b) {
|
|
174
|
+
switch (_b.label) {
|
|
175
|
+
case 0:
|
|
176
|
+
_b.trys.push([0, 2, , 3]);
|
|
177
|
+
return [4 /*yield*/, response];
|
|
178
|
+
case 1: return [2 /*return*/, _b.sent()];
|
|
179
|
+
case 2:
|
|
180
|
+
err_1 = _b.sent();
|
|
181
|
+
if (err_1 instanceof ServiceError) {
|
|
182
|
+
if (codes.length === 0) {
|
|
183
|
+
return [2 /*return*/, null];
|
|
184
|
+
}
|
|
185
|
+
for (_i = 0, codes_1 = codes; _i < codes_1.length; _i++) {
|
|
186
|
+
code = codes_1[_i];
|
|
187
|
+
if (err_1.status === code || err_1.code === code) {
|
|
188
|
+
return [2 /*return*/, null];
|
|
189
|
+
}
|
|
190
|
+
}
|
|
191
|
+
}
|
|
192
|
+
throw err_1;
|
|
193
|
+
case 3: return [2 /*return*/];
|
|
194
|
+
}
|
|
195
|
+
});
|
|
196
|
+
});
|
|
197
|
+
};
|
|
198
|
+
/**
|
|
199
|
+
* Returns a promise that resolves to either T or a ServiceError.
|
|
200
|
+
*/
|
|
201
|
+
ServiceError.combine = function (codes, response) {
|
|
202
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
203
|
+
var data, err_2, _i, codes_2, code;
|
|
204
|
+
return __generator(this, function (_b) {
|
|
205
|
+
switch (_b.label) {
|
|
206
|
+
case 0:
|
|
207
|
+
_b.trys.push([0, 2, , 3]);
|
|
208
|
+
return [4 /*yield*/, response];
|
|
209
|
+
case 1:
|
|
210
|
+
data = _b.sent();
|
|
211
|
+
return [2 /*return*/, { ok: true, data: data, err: null }];
|
|
212
|
+
case 2:
|
|
213
|
+
err_2 = _b.sent();
|
|
214
|
+
if (err_2 instanceof ServiceError) {
|
|
215
|
+
if (codes.length === 0) {
|
|
216
|
+
return [2 /*return*/, { ok: false, data: null, err: err_2 }];
|
|
217
|
+
}
|
|
218
|
+
for (_i = 0, codes_2 = codes; _i < codes_2.length; _i++) {
|
|
219
|
+
code = codes_2[_i];
|
|
220
|
+
if (err_2.status === code || err_2.code === code) {
|
|
221
|
+
return [2 /*return*/, { ok: false, data: null, err: err_2 }];
|
|
222
|
+
}
|
|
223
|
+
}
|
|
224
|
+
}
|
|
225
|
+
throw err_2;
|
|
226
|
+
case 3: return [2 /*return*/];
|
|
227
|
+
}
|
|
228
|
+
});
|
|
229
|
+
});
|
|
230
|
+
};
|
|
231
|
+
/**
|
|
232
|
+
* Constructs a ServiceError from the provided response data.
|
|
233
|
+
*/
|
|
234
|
+
ServiceError.from_res = function (res) {
|
|
235
|
+
var message = res.body;
|
|
236
|
+
var code = res.status;
|
|
237
|
+
try {
|
|
238
|
+
var data = JSON.parse(res.body);
|
|
239
|
+
if (data.code && (data.message || data.error)) {
|
|
240
|
+
code = data.code;
|
|
241
|
+
message = data.message || data.error;
|
|
242
|
+
}
|
|
243
|
+
}
|
|
244
|
+
catch (_) { }
|
|
245
|
+
var err = new ServiceError(res.status, code, message);
|
|
246
|
+
// override the stack trace so that it doesn't include the from_res helper.
|
|
247
|
+
if (Error.captureStackTrace) {
|
|
248
|
+
Error.captureStackTrace(err, ServiceError.from_res);
|
|
249
|
+
}
|
|
250
|
+
return err;
|
|
251
|
+
};
|
|
252
|
+
return ServiceError;
|
|
253
|
+
}(Error));
|
|
254
|
+
exports.ServiceError = ServiceError;
|
|
255
|
+
/**
|
|
256
|
+
* BaseServiceClient contains the logic for executing http requests.
|
|
257
|
+
* This class is meant to be extended by the generated code.
|
|
258
|
+
*/
|
|
259
|
+
var BaseServiceClient = /** @class */ (function () {
|
|
260
|
+
function BaseServiceClient(options) {
|
|
261
|
+
this.options = options !== null && options !== void 0 ? options : {};
|
|
262
|
+
}
|
|
263
|
+
/**
|
|
264
|
+
* Combine the route and query parameters into a full url.
|
|
265
|
+
*/
|
|
266
|
+
BaseServiceClient.prototype.build_url = function (route, _b, params) {
|
|
267
|
+
var base_url = _b.base_url, _c = _b.stage, stage = _c === void 0 ? "dev" : _c;
|
|
268
|
+
var url = "https://api.compassdigital.org/" + stage + route;
|
|
269
|
+
// use the base url if one was provided.
|
|
270
|
+
if (base_url) {
|
|
271
|
+
if (base_url.endsWith("/")) {
|
|
272
|
+
base_url = base_url.slice(0, -1);
|
|
273
|
+
}
|
|
274
|
+
url = "" + base_url + route;
|
|
275
|
+
}
|
|
276
|
+
// add query parameters.
|
|
277
|
+
var query = [];
|
|
278
|
+
for (var _i = 0, _d = Object.entries(params); _i < _d.length; _i++) {
|
|
279
|
+
var _e = _d[_i], name_1 = _e[0], value = _e[1];
|
|
280
|
+
query.push(encodeURIComponent(name_1) + "=" + encodeURIComponent(value));
|
|
281
|
+
}
|
|
282
|
+
if (query.length > 0) {
|
|
283
|
+
url += "?" + query.join("&");
|
|
284
|
+
}
|
|
285
|
+
return url;
|
|
286
|
+
};
|
|
287
|
+
/**
|
|
288
|
+
* Perform the http request or pass it to the intercept function
|
|
289
|
+
* if one was configured.
|
|
290
|
+
*/
|
|
291
|
+
BaseServiceClient.prototype.fetch = function (req, options) {
|
|
292
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
293
|
+
var res;
|
|
294
|
+
var _b;
|
|
295
|
+
return __generator(this, function (_c) {
|
|
296
|
+
switch (_c.label) {
|
|
297
|
+
case 0:
|
|
298
|
+
if (options === null || options === void 0 ? void 0 : options.intercept) {
|
|
299
|
+
return [2 /*return*/, options.intercept(req, this.fetch.bind(this))];
|
|
300
|
+
}
|
|
301
|
+
return [4 /*yield*/, (0, cross_fetch_1.default)(req.url, {
|
|
302
|
+
method: req.method,
|
|
303
|
+
body: req.body,
|
|
304
|
+
headers: req.headers,
|
|
305
|
+
})];
|
|
306
|
+
case 1:
|
|
307
|
+
res = _c.sent();
|
|
308
|
+
_b = {
|
|
309
|
+
ok: res.ok,
|
|
310
|
+
status: res.status
|
|
311
|
+
};
|
|
312
|
+
return [4 /*yield*/, res.text()];
|
|
313
|
+
case 2: return [2 /*return*/, (_b.body = _c.sent(),
|
|
314
|
+
_b)];
|
|
315
|
+
}
|
|
316
|
+
});
|
|
317
|
+
});
|
|
318
|
+
};
|
|
319
|
+
/**
|
|
320
|
+
* Returns true if the response status was a 4xx error.
|
|
321
|
+
*/
|
|
322
|
+
BaseServiceClient.prototype.is_4xx = function (res) {
|
|
323
|
+
return 400 <= res.status && res.status < 500;
|
|
324
|
+
};
|
|
325
|
+
/**
|
|
326
|
+
* Returns the merged options.
|
|
327
|
+
*/
|
|
328
|
+
BaseServiceClient.prototype.get_options = function (options) {
|
|
329
|
+
return __assign(__assign(__assign({}, this.options), options), { headers: __assign(__assign({}, this.options.headers), options.headers) });
|
|
330
|
+
};
|
|
331
|
+
/**
|
|
332
|
+
* A delegate to _request that wraps the response in a ResponsePromise.
|
|
333
|
+
*/
|
|
334
|
+
BaseServiceClient.prototype.request = function (service, name, method, route, body, options) {
|
|
335
|
+
if (options === void 0) { options = {}; }
|
|
336
|
+
var promise = this._request(service, name, method, route, body, options);
|
|
337
|
+
return new ResponsePromise(promise);
|
|
338
|
+
};
|
|
339
|
+
/**
|
|
340
|
+
* The main logic for fulfilling a request as perscribed by
|
|
341
|
+
* the request options.
|
|
342
|
+
*/
|
|
343
|
+
BaseServiceClient.prototype._request = function (service, name, method, route, body, options) {
|
|
344
|
+
var _b;
|
|
345
|
+
if (options === void 0) { options = {}; }
|
|
346
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
347
|
+
var url, headers, req, res, err, data;
|
|
348
|
+
return __generator(this, function (_c) {
|
|
349
|
+
switch (_c.label) {
|
|
350
|
+
case 0:
|
|
351
|
+
options = this.get_options(options);
|
|
352
|
+
url = this.build_url(route, options, (_b = options.query) !== null && _b !== void 0 ? _b : {});
|
|
353
|
+
headers = Object.assign({
|
|
354
|
+
"User-Agent": "CDL/ServiceClient"
|
|
355
|
+
}, options.headers);
|
|
356
|
+
if (options.token) {
|
|
357
|
+
headers["Authorization"] = "Bearer " + options.token;
|
|
358
|
+
}
|
|
359
|
+
req = { name: name, service: service, url: url, method: method, headers: headers };
|
|
360
|
+
if (body) {
|
|
361
|
+
req.body = JSON.stringify(body);
|
|
362
|
+
}
|
|
363
|
+
if (options.debug) {
|
|
364
|
+
console.log("REQ(" + method.toUpperCase() + ")", url, JSON.stringify(req, null, 2));
|
|
365
|
+
}
|
|
366
|
+
return [4 /*yield*/, this.fetch(req, options)];
|
|
367
|
+
case 1:
|
|
368
|
+
res = _c.sent();
|
|
369
|
+
if (!res.ok) {
|
|
370
|
+
err = ServiceError.from_res(res);
|
|
371
|
+
if (options.debug) {
|
|
372
|
+
console.log("ERR(" + res.status + ")", url, err.message);
|
|
373
|
+
}
|
|
374
|
+
if (typeof options.retry === "number" && options.retry > 0 && !this.is_4xx(res)) {
|
|
375
|
+
options.retry--;
|
|
376
|
+
return [2 /*return*/, this.request(service, name, method, route, body, options)];
|
|
377
|
+
}
|
|
378
|
+
throw err;
|
|
379
|
+
}
|
|
380
|
+
data = res.body ? JSON.parse(res.body) : res.body;
|
|
381
|
+
if (options.debug) {
|
|
382
|
+
console.log("RES(" + res.status + ")", url, JSON.stringify(data, null, 2));
|
|
383
|
+
}
|
|
384
|
+
return [2 /*return*/, data];
|
|
385
|
+
}
|
|
386
|
+
});
|
|
387
|
+
});
|
|
388
|
+
};
|
|
389
|
+
return BaseServiceClient;
|
|
390
|
+
}());
|
|
391
|
+
exports.BaseServiceClient = BaseServiceClient;
|
|
392
|
+
//# sourceMappingURL=base.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"base.js","sourceRoot":"","sources":["../../src/client/base.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AACA,4DAAgC;AAqDhC;;;GAGG;AACH;IAOE,yBAAoB,OAAmB;QAAnB,YAAO,GAAP,OAAO,CAAY;QALvC;;WAEG;QACH,QAAoB,GAAG,0BAA0B,CAAC;IAER,CAAC;IAE3C;;OAEG;IACH,8BAAI,GAAJ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