@parra/parra-js-sdk 0.0.25 → 0.2.0

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 (73) hide show
  1. package/dist/AccessToken.d.ts +1 -0
  2. package/dist/AccessToken.js +63 -0
  3. package/dist/ParraAPI.d.ts +216 -563
  4. package/dist/ParraAPI.js +51 -552
  5. package/dist/index.d.ts +3 -5
  6. package/dist/index.js +5 -7
  7. package/package.json +5 -1
  8. package/dist/AuthInterceptor.d.ts +0 -13
  9. package/dist/AuthInterceptor.js +0 -99
  10. package/dist/HTTPClient.d.ts +0 -30
  11. package/dist/HTTPClient.js +0 -158
  12. package/dist/HTTPInterceptor.d.ts +0 -5
  13. package/dist/HTTPInterceptor.js +0 -2
  14. package/dist/URLBuilder.d.ts +0 -7
  15. package/dist/URLBuilder.js +0 -24
  16. package/dist/models/AdminUser.d.ts +0 -12
  17. package/dist/models/AdminUser.js +0 -2
  18. package/dist/models/Business.d.ts +0 -23
  19. package/dist/models/Business.js +0 -2
  20. package/dist/models/BusinessProfile.d.ts +0 -10
  21. package/dist/models/BusinessProfile.js +0 -2
  22. package/dist/models/Category.d.ts +0 -18
  23. package/dist/models/Category.js +0 -2
  24. package/dist/models/City.d.ts +0 -7
  25. package/dist/models/City.js +0 -2
  26. package/dist/models/CollectionResponse.d.ts +0 -6
  27. package/dist/models/CollectionResponse.js +0 -2
  28. package/dist/models/Coordinate.d.ts +0 -4
  29. package/dist/models/Coordinate.js +0 -2
  30. package/dist/models/Employee.d.ts +0 -22
  31. package/dist/models/Employee.js +0 -2
  32. package/dist/models/EmployeeProfile.d.ts +0 -6
  33. package/dist/models/EmployeeProfile.js +0 -2
  34. package/dist/models/Entity.d.ts +0 -6
  35. package/dist/models/Entity.js +0 -2
  36. package/dist/models/Feature.d.ts +0 -7
  37. package/dist/models/Feature.js +0 -2
  38. package/dist/models/ImageAsset.d.ts +0 -10
  39. package/dist/models/ImageAsset.js +0 -2
  40. package/dist/models/Industry.d.ts +0 -9
  41. package/dist/models/Industry.js +0 -2
  42. package/dist/models/Location.d.ts +0 -39
  43. package/dist/models/Location.js +0 -2
  44. package/dist/models/LocationAddress.d.ts +0 -17
  45. package/dist/models/LocationAddress.js +0 -2
  46. package/dist/models/LocationPhoto.d.ts +0 -10
  47. package/dist/models/LocationPhoto.js +0 -2
  48. package/dist/models/LocationProfile.d.ts +0 -12
  49. package/dist/models/LocationProfile.js +0 -2
  50. package/dist/models/LocationRating.d.ts +0 -10
  51. package/dist/models/LocationRating.js +0 -2
  52. package/dist/models/LocationReview.d.ts +0 -22
  53. package/dist/models/LocationReview.js +0 -2
  54. package/dist/models/LocationReviewSource.d.ts +0 -5
  55. package/dist/models/LocationReviewSource.js +0 -2
  56. package/dist/models/LocationReviewer.d.ts +0 -4
  57. package/dist/models/LocationReviewer.js +0 -2
  58. package/dist/models/LocationService.d.ts +0 -9
  59. package/dist/models/LocationService.js +0 -2
  60. package/dist/models/LocationServiceArea.d.ts +0 -11
  61. package/dist/models/LocationServiceArea.js +0 -2
  62. package/dist/models/Pagination.d.ts +0 -2
  63. package/dist/models/Pagination.js +0 -2
  64. package/dist/models/Query.d.ts +0 -9
  65. package/dist/models/Query.js +0 -2
  66. package/dist/models/StripeAccountLink.d.ts +0 -10
  67. package/dist/models/StripeAccountLink.js +0 -2
  68. package/dist/models/Tag.d.ts +0 -11
  69. package/dist/models/Tag.js +0 -2
  70. package/dist/models/User.d.ts +0 -12
  71. package/dist/models/User.js +0 -2
  72. package/dist/models/index.d.ts +0 -8
  73. package/dist/models/index.js +0 -20
package/dist/index.d.ts CHANGED
@@ -1,10 +1,8 @@
1
- import { AuthorizationProvider } from './AuthInterceptor';
2
- import { HTTPInterceptor } from './HTTPInterceptor';
1
+ import 'isomorphic-fetch';
2
+ import { AuthorizationProvider, HTTPInterceptor } from '@parra/http-client';
3
3
  import { default as ParraAPI } from './ParraAPI';
4
4
  export * from './ParraAPI';
5
- export * from './HTTPClient';
6
- export * from './HTTPInterceptor';
7
- export * from './AuthInterceptor';
5
+ export * from '@parra/http-client';
8
6
  export { ParraAPI };
9
7
  export declare type ParraAPIType = typeof ParraAPI;
10
8
  export interface ParraAPIOptions {
package/dist/index.js CHANGED
@@ -14,26 +14,24 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
14
14
  };
15
15
  Object.defineProperty(exports, "__esModule", { value: true });
16
16
  exports.ParraAPI = void 0;
17
- var AuthInterceptor_1 = require("./AuthInterceptor");
18
- var HTTPClient_1 = require("./HTTPClient");
17
+ require("isomorphic-fetch");
18
+ var http_client_1 = require("@parra/http-client");
19
19
  var ParraAPI_1 = __importDefault(require("./ParraAPI"));
20
20
  Object.defineProperty(exports, "ParraAPI", { enumerable: true, get: function () { return ParraAPI_1.default; } });
21
21
  __exportStar(require("./ParraAPI"), exports);
22
- __exportStar(require("./HTTPClient"), exports);
23
- __exportStar(require("./HTTPInterceptor"), exports);
24
- __exportStar(require("./AuthInterceptor"), exports);
22
+ __exportStar(require("@parra/http-client"), exports);
25
23
  function default_1(options) {
26
24
  if (options === void 0) { options = {}; }
27
25
  var baseUrl = options.baseUrl || 'https://api.parra.io';
28
26
  var interceptors = [];
29
27
  if (options.authorization) {
30
- var authInterceptor = new AuthInterceptor_1.AuthInterceptor(options.authorization);
28
+ var authInterceptor = new http_client_1.AuthInterceptor(options.authorization);
31
29
  interceptors.push(authInterceptor);
32
30
  }
33
31
  if (options.interceptors) {
34
32
  interceptors.push.apply(interceptors, options.interceptors);
35
33
  }
36
- var http = new HTTPClient_1.HTTPClient(interceptors);
34
+ var http = new http_client_1.HTTPClient(interceptors);
37
35
  return new ParraAPI_1.default(http, { baseUrl: baseUrl });
38
36
  }
39
37
  exports.default = default_1;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@parra/parra-js-sdk",
3
- "version": "0.0.25",
3
+ "version": "0.2.0",
4
4
  "description": "",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
@@ -21,5 +21,9 @@
21
21
  "nyc": "^15.1.0",
22
22
  "prettier": "^2.0.5",
23
23
  "typescript": "^3.9.7"
24
+ },
25
+ "dependencies": {
26
+ "@parra/http-client": "0.0.4",
27
+ "isomorphic-fetch": "^3.0.0"
24
28
  }
25
29
  }
@@ -1,13 +0,0 @@
1
- import { HTTPRequest } from "./HTTPClient";
2
- import { HTTPInterceptor } from "./HTTPInterceptor";
3
- export declare type Authorization = string | null | undefined;
4
- export declare type AuthFunctionProvider = () => Authorization;
5
- export declare type AuthPromiseProvider = () => Promise<Authorization>;
6
- export declare type AuthorizationProvider = Authorization | AuthPromiseProvider | AuthFunctionProvider;
7
- export declare class AuthInterceptor implements HTTPInterceptor {
8
- private authorization;
9
- constructor(authorization: AuthorizationProvider);
10
- private authorizationTokenForAuthorization;
11
- willSendRequest(req: HTTPRequest): Promise<HTTPRequest>;
12
- willHandleResponse(res: Response): Promise<Response>;
13
- }
@@ -1,99 +0,0 @@
1
- "use strict";
2
- var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
3
- function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
4
- return new (P || (P = Promise))(function (resolve, reject) {
5
- function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
6
- function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
7
- function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
8
- step((generator = generator.apply(thisArg, _arguments || [])).next());
9
- });
10
- };
11
- var __generator = (this && this.__generator) || function (thisArg, body) {
12
- var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
13
- return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
14
- function verb(n) { return function (v) { return step([n, v]); }; }
15
- function step(op) {
16
- if (f) throw new TypeError("Generator is already executing.");
17
- while (_) try {
18
- 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;
19
- if (y = 0, t) op = [op[0] & 2, t.value];
20
- switch (op[0]) {
21
- case 0: case 1: t = op; break;
22
- case 4: _.label++; return { value: op[1], done: false };
23
- case 5: _.label++; y = op[1]; op = [0]; continue;
24
- case 7: op = _.ops.pop(); _.trys.pop(); continue;
25
- default:
26
- if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
27
- if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
28
- if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
29
- if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
30
- if (t[2]) _.ops.pop();
31
- _.trys.pop(); continue;
32
- }
33
- op = body.call(thisArg, _);
34
- } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
35
- if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
36
- }
37
- };
38
- Object.defineProperty(exports, "__esModule", { value: true });
39
- exports.AuthInterceptor = void 0;
40
- var AuthInterceptor = /** @class */ (function () {
41
- function AuthInterceptor(authorization) {
42
- this.authorization = authorization;
43
- }
44
- AuthInterceptor.prototype.authorizationTokenForAuthorization = function (authorization) {
45
- if (!authorization) {
46
- return undefined;
47
- }
48
- if (typeof authorization === 'string') {
49
- return authorization;
50
- }
51
- else if (typeof authorization === 'function') {
52
- if (authorization.then && authorization.catch) {
53
- return authorization.then;
54
- }
55
- else {
56
- return authorization();
57
- }
58
- }
59
- };
60
- AuthInterceptor.prototype.willSendRequest = function (req) {
61
- return __awaiter(this, void 0, void 0, function () {
62
- var authToken, headers, err_1;
63
- return __generator(this, function (_a) {
64
- switch (_a.label) {
65
- case 0:
66
- if (!this.authorization) {
67
- return [2 /*return*/, req];
68
- }
69
- _a.label = 1;
70
- case 1:
71
- _a.trys.push([1, 3, , 4]);
72
- return [4 /*yield*/, this.authorizationTokenForAuthorization(this.authorization)];
73
- case 2:
74
- authToken = _a.sent();
75
- if (authToken) {
76
- headers = new Headers(req.headers);
77
- headers.set('Authorization', "Bearer " + authToken);
78
- req.headers = headers;
79
- }
80
- return [3 /*break*/, 4];
81
- case 3:
82
- err_1 = _a.sent();
83
- console.error(err_1);
84
- return [3 /*break*/, 4];
85
- case 4: return [2 /*return*/, req];
86
- }
87
- });
88
- });
89
- };
90
- AuthInterceptor.prototype.willHandleResponse = function (res) {
91
- return __awaiter(this, void 0, void 0, function () {
92
- return __generator(this, function (_a) {
93
- return [2 /*return*/, res];
94
- });
95
- });
96
- };
97
- return AuthInterceptor;
98
- }());
99
- exports.AuthInterceptor = AuthInterceptor;
@@ -1,30 +0,0 @@
1
- import { HTTPInterceptor } from "./HTTPInterceptor";
2
- import URLBuilder from "./URLBuilder";
3
- export declare type HTTPRequestBody = BodyInit;
4
- export declare type HTTPUrlComponent = number | string;
5
- export declare type HTTPResponse = Response;
6
- export declare type HTTPHeaders = Headers;
7
- export declare type HTTPQuery = URLSearchParams | {
8
- [param: string]: HTTPUrlComponent | undefined | null;
9
- } | object;
10
- export declare type HTTPMethod = 'GET' | 'POST' | 'PUT' | 'DELETE' | 'PATCH';
11
- export interface HTTPOptions {
12
- withCredentials?: boolean;
13
- signal?: AbortSignal | null;
14
- }
15
- export declare type HTTPRequest = RequestInit & {
16
- query?: HTTPQuery | null;
17
- };
18
- export declare class HTTPClient {
19
- private interceptors;
20
- private urlBuilder;
21
- constructor(interceptors?: Array<HTTPInterceptor>, urlBuilder?: URLBuilder);
22
- get<T>(path: string, query?: HTTPQuery, options?: HTTPOptions): Promise<T>;
23
- post<T>(path: string, body: HTTPRequestBody, options?: HTTPOptions): Promise<T>;
24
- put<T>(path: string, body: HTTPRequestBody, options?: HTTPOptions): Promise<T>;
25
- patch<T>(path: string, body: HTTPRequestBody, options?: HTTPOptions): Promise<T>;
26
- delete<T>(path: string, options?: HTTPOptions): Promise<T>;
27
- execute<T>(path: string, req: HTTPRequest): Promise<T>;
28
- willSendRequest(req: HTTPRequest): Promise<HTTPRequest>;
29
- willHandleResponse(res: HTTPResponse): Promise<HTTPResponse>;
30
- }
@@ -1,158 +0,0 @@
1
- "use strict";
2
- var __assign = (this && this.__assign) || function () {
3
- __assign = Object.assign || function(t) {
4
- for (var s, i = 1, n = arguments.length; i < n; i++) {
5
- s = arguments[i];
6
- for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
7
- t[p] = s[p];
8
- }
9
- return t;
10
- };
11
- return __assign.apply(this, arguments);
12
- };
13
- var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
14
- function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
15
- return new (P || (P = Promise))(function (resolve, reject) {
16
- function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
17
- function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
18
- function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
19
- step((generator = generator.apply(thisArg, _arguments || [])).next());
20
- });
21
- };
22
- var __generator = (this && this.__generator) || function (thisArg, body) {
23
- var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
24
- return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
25
- function verb(n) { return function (v) { return step([n, v]); }; }
26
- function step(op) {
27
- if (f) throw new TypeError("Generator is already executing.");
28
- while (_) try {
29
- 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;
30
- if (y = 0, t) op = [op[0] & 2, t.value];
31
- switch (op[0]) {
32
- case 0: case 1: t = op; break;
33
- case 4: _.label++; return { value: op[1], done: false };
34
- case 5: _.label++; y = op[1]; op = [0]; continue;
35
- case 7: op = _.ops.pop(); _.trys.pop(); continue;
36
- default:
37
- if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
38
- if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
39
- if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
40
- if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
41
- if (t[2]) _.ops.pop();
42
- _.trys.pop(); continue;
43
- }
44
- op = body.call(thisArg, _);
45
- } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
46
- if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
47
- }
48
- };
49
- Object.defineProperty(exports, "__esModule", { value: true });
50
- exports.HTTPClient = void 0;
51
- var URLBuilder_1 = require("./URLBuilder");
52
- var HTTPClient = /** @class */ (function () {
53
- function HTTPClient(interceptors, urlBuilder) {
54
- if (interceptors === void 0) { interceptors = new Array(); }
55
- if (urlBuilder === void 0) { urlBuilder = new URLBuilder_1.DefaultURLBuilder(); }
56
- this.interceptors = interceptors;
57
- this.urlBuilder = urlBuilder;
58
- }
59
- HTTPClient.prototype.get = function (path, query, options) {
60
- return this.execute(path, __assign(__assign({}, options), { method: 'GET', query: query }));
61
- };
62
- HTTPClient.prototype.post = function (path, body, options) {
63
- return this.execute(path, __assign(__assign({}, options), { method: 'POST', body: body }));
64
- };
65
- HTTPClient.prototype.put = function (path, body, options) {
66
- return this.execute(path, __assign(__assign({}, options), { method: 'PUT', body: body }));
67
- };
68
- HTTPClient.prototype.patch = function (path, body, options) {
69
- return this.execute(path, __assign(__assign({}, options), { method: 'PATCH', body: body }));
70
- };
71
- HTTPClient.prototype.delete = function (path, options) {
72
- return this.execute(path, __assign(__assign({}, options), { method: 'DELETE' }));
73
- };
74
- HTTPClient.prototype.execute = function (path, req) {
75
- return __awaiter(this, void 0, void 0, function () {
76
- var reqToSend, url, headers, res, contentType;
77
- return __generator(this, function (_a) {
78
- switch (_a.label) {
79
- case 0: return [4 /*yield*/, this.willSendRequest(req)];
80
- case 1:
81
- reqToSend = _a.sent();
82
- url = this.urlBuilder.buildUrl(path, reqToSend.query);
83
- headers = reqToSend.headers || new Headers();
84
- return [4 /*yield*/, fetch(url.toString(), {
85
- method: reqToSend.method,
86
- body: reqToSend.body,
87
- headers: headers,
88
- })];
89
- case 2:
90
- res = _a.sent();
91
- if (res.ok) {
92
- contentType = res.headers.get('content-type');
93
- if (contentType && contentType.includes('application/json')) {
94
- return [2 /*return*/, res.json()];
95
- }
96
- else {
97
- return [2 /*return*/, res];
98
- }
99
- }
100
- else {
101
- throw res.body;
102
- }
103
- return [2 /*return*/];
104
- }
105
- });
106
- });
107
- };
108
- HTTPClient.prototype.willSendRequest = function (req) {
109
- return __awaiter(this, void 0, void 0, function () {
110
- var request, _i, _a, interceptor;
111
- return __generator(this, function (_b) {
112
- switch (_b.label) {
113
- case 0:
114
- request = req;
115
- _i = 0, _a = this.interceptors;
116
- _b.label = 1;
117
- case 1:
118
- if (!(_i < _a.length)) return [3 /*break*/, 4];
119
- interceptor = _a[_i];
120
- return [4 /*yield*/, interceptor.willSendRequest(request)];
121
- case 2:
122
- request = _b.sent();
123
- _b.label = 3;
124
- case 3:
125
- _i++;
126
- return [3 /*break*/, 1];
127
- case 4: return [2 /*return*/, request];
128
- }
129
- });
130
- });
131
- };
132
- HTTPClient.prototype.willHandleResponse = function (res) {
133
- return __awaiter(this, void 0, void 0, function () {
134
- var response, _i, _a, interceptor;
135
- return __generator(this, function (_b) {
136
- switch (_b.label) {
137
- case 0:
138
- response = res;
139
- _i = 0, _a = this.interceptors;
140
- _b.label = 1;
141
- case 1:
142
- if (!(_i < _a.length)) return [3 /*break*/, 4];
143
- interceptor = _a[_i];
144
- return [4 /*yield*/, interceptor.willHandleResponse(response)];
145
- case 2:
146
- response = _b.sent();
147
- _b.label = 3;
148
- case 3:
149
- _i++;
150
- return [3 /*break*/, 1];
151
- case 4: return [2 /*return*/, response];
152
- }
153
- });
154
- });
155
- };
156
- return HTTPClient;
157
- }());
158
- exports.HTTPClient = HTTPClient;
@@ -1,5 +0,0 @@
1
- import { HTTPRequest, HTTPResponse } from "./HTTPClient";
2
- export interface HTTPInterceptor {
3
- willSendRequest(req: HTTPRequest): Promise<HTTPRequest>;
4
- willHandleResponse(res: HTTPResponse): Promise<HTTPResponse>;
5
- }
@@ -1,2 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
@@ -1,7 +0,0 @@
1
- import { HTTPQuery } from "./HTTPClient";
2
- export default interface URLBuilder {
3
- buildUrl(path: string, params?: HTTPQuery | null, baseUrl?: string | URL): URL;
4
- }
5
- export declare class DefaultURLBuilder {
6
- buildUrl(path: string, params?: HTTPQuery | null, baseUrl?: string | URL): URL;
7
- }
@@ -1,24 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.DefaultURLBuilder = void 0;
4
- var DefaultURLBuilder = /** @class */ (function () {
5
- function DefaultURLBuilder() {
6
- }
7
- DefaultURLBuilder.prototype.buildUrl = function (path, params, baseUrl) {
8
- var url = new URL(path, baseUrl);
9
- if (params) {
10
- Object.entries(params)
11
- .filter(function (_a) {
12
- var value = _a[1];
13
- return !!value;
14
- })
15
- .forEach(function (_a) {
16
- var key = _a[0], value = _a[1];
17
- return url.searchParams.append(key, value);
18
- });
19
- }
20
- return url;
21
- };
22
- return DefaultURLBuilder;
23
- }());
24
- exports.DefaultURLBuilder = DefaultURLBuilder;
@@ -1,12 +0,0 @@
1
- import { Entity } from './Entity';
2
- import { CollectionResponse } from './CollectionResponse';
3
- interface AdminUser extends Entity {
4
- subjectId?: string;
5
- email?: string;
6
- avatarUrl?: string;
7
- }
8
- export declare type AdminUserResponse = AdminUser;
9
- export declare type ListAdminUsersResponse = CollectionResponse<AdminUser>;
10
- export declare type UpdateAdminUserRequest = Pick<AdminUser, 'subjectId' | 'email'>;
11
- export declare type CreateAdminUserRequest = Pick<AdminUser, 'subjectId' | 'email'>;
12
- export {};
@@ -1,2 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
@@ -1,23 +0,0 @@
1
- import { Entity } from './Entity';
2
- import { CollectionResponse } from './CollectionResponse';
3
- interface BusinessProfile extends Entity {
4
- isPersonalName: boolean;
5
- name?: string;
6
- email?: string;
7
- phoneNumber?: string;
8
- website?: string;
9
- about?: string;
10
- }
11
- export interface Business extends Entity {
12
- name: string;
13
- isVerified: boolean;
14
- avatarUrl?: string;
15
- profileId?: string;
16
- profile?: BusinessProfile;
17
- }
18
- export declare type BusinessResponse = Business;
19
- export declare type ListBusinessesResponse = CollectionResponse<Business>;
20
- export declare type UpdateBusinessRequest = Pick<Business, 'name'>;
21
- export declare type CreateBusinessRequest = Pick<Business, 'name'>;
22
- export declare type UpdateBusinessProfileRequest = Pick<BusinessProfile, 'isPersonalName' | 'name' | 'email' | 'phoneNumber' | 'website' | 'about'>;
23
- export {};
@@ -1,2 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
@@ -1,10 +0,0 @@
1
- import { Entity } from './Entity';
2
- export declare type UpdateBusinessProfileRequest = Pick<BusinessProfile, 'isPersonalName' | 'name' | 'email' | 'phoneNumber' | 'website' | 'about'>;
3
- export interface BusinessProfile extends Entity {
4
- isPersonalName: boolean;
5
- name?: string;
6
- email?: string;
7
- phoneNumber?: string;
8
- website?: string;
9
- about?: string;
10
- }
@@ -1,2 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
@@ -1,18 +0,0 @@
1
- import { Entity } from './Entity';
2
- import { Location } from './Location';
3
- import { Tag } from './Tag';
4
- import { CollectionResponse } from './CollectionResponse';
5
- import { ImageAsset } from './ImageAsset';
6
- export declare type ListCategoriesResponse = CollectionResponse<Category>;
7
- export declare type UpdateCategoryRequest = Pick<Category, 'name' | 'detail' | 'industryId'>;
8
- export declare type CreateCategoryRequest = Pick<Category, 'name' | 'detail' | 'industryId'>;
9
- export interface Category extends Entity {
10
- name: string;
11
- detail?: string;
12
- locationCount?: number;
13
- industryId?: string;
14
- iconId?: string;
15
- locations?: Location[];
16
- tags?: Tag[];
17
- icon?: ImageAsset;
18
- }
@@ -1,2 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
@@ -1,7 +0,0 @@
1
- import { CityResponse, CreateCityRequest, UpdateCityRequest } from '../services/api/business-api/models/City';
2
- import { Pagination } from './Pagination';
3
- export declare type City = CityResponse;
4
- export declare type CityPagination = Pagination<City>;
5
- export declare type CityList = Array<City>;
6
- export declare type CreateCityFormBody = CreateCityRequest;
7
- export declare type UpdateCityFormBody = UpdateCityRequest;
@@ -1,2 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
@@ -1,6 +0,0 @@
1
- export interface CollectionResponse<T> {
2
- data: T[];
3
- page: number;
4
- pageCount: number;
5
- totalCount: number;
6
- }
@@ -1,2 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
@@ -1,4 +0,0 @@
1
- export interface Coordinate {
2
- latitude: number;
3
- longitude: number;
4
- }
@@ -1,2 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
@@ -1,22 +0,0 @@
1
- import { Entity } from './Entity';
2
- import { CollectionResponse } from './CollectionResponse';
3
- import { EmployeeProfile } from './EmployeeProfile';
4
- import { Business } from './Business';
5
- interface Employee extends Entity {
6
- isVerified: boolean;
7
- firstName: string;
8
- lastName: string;
9
- email?: string;
10
- avatarUrl?: string;
11
- name?: string;
12
- profileId?: string;
13
- businessId?: string;
14
- profile?: EmployeeProfile;
15
- business?: Business;
16
- }
17
- export declare type EmployeeResponse = Employee;
18
- export declare type ListEmployeesResponse = CollectionResponse<Employee>;
19
- export declare type UpdateEmployeeRequest = Pick<Employee, 'firstName' | 'lastName' | 'email'>;
20
- export declare type CreateEmployeeRequest = Pick<Employee, 'firstName' | 'lastName' | 'email'>;
21
- export declare type InviteEmployeeRequest = CreateEmployeeRequest;
22
- export {};
@@ -1,2 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
@@ -1,6 +0,0 @@
1
- import { Entity } from './Entity';
2
- export declare type UpdateEmployeeProfileRequest = Pick<EmployeeProfile, 'gender' | 'birthday'>;
3
- export interface EmployeeProfile extends Entity {
4
- gender?: string;
5
- birthday?: string;
6
- }
@@ -1,2 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
@@ -1,6 +0,0 @@
1
- export interface Entity {
2
- id: string;
3
- createdAt: string | null;
4
- updatedAt: string | null;
5
- deletedAt: string | null;
6
- }
@@ -1,2 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
@@ -1,7 +0,0 @@
1
- import { CreateFeatureRequest, FeatureResponse, UpdateFeatureRequest } from '../services/api/business-api/models/Feature';
2
- import { Pagination } from './Pagination';
3
- export declare type Feature = FeatureResponse;
4
- export declare type FeaturePagination = Pagination<Feature>;
5
- export declare type FeatureList = Array<Feature>;
6
- export declare type CreateFeatureFormBody = CreateFeatureRequest;
7
- export declare type UpdateFeatureFormBody = UpdateFeatureRequest;
@@ -1,2 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
@@ -1,10 +0,0 @@
1
- import { Entity } from './Entity';
2
- export declare type Avatar = ImageAsset;
3
- export declare type Icon = ImageAsset;
4
- export declare type Photo = ImageAsset;
5
- export interface ImageAsset extends Entity {
6
- width: number;
7
- height: number;
8
- url: string;
9
- identifier: string;
10
- }
@@ -1,2 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
@@ -1,9 +0,0 @@
1
- import { Entity } from './Entity';
2
- import { CollectionResponse } from './CollectionResponse';
3
- export declare type ListIndustriesResponse = CollectionResponse<Industry>;
4
- export declare type UpdateIndustryRequest = Pick<Industry, 'name' | 'detail'>;
5
- export declare type CreateIndustryRequest = Pick<Industry, 'name' | 'detail'>;
6
- export interface Industry extends Entity {
7
- name: string;
8
- detail?: string;
9
- }
@@ -1,2 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });