apimo.js 1.0.1

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/.github/workflows/ci.yml +37 -0
  2. package/.github/workflows/publish.yml +69 -0
  3. package/.idea/apimo.js.iml +13 -0
  4. package/.idea/copilotDiffState.xml +43 -0
  5. package/.idea/inspectionProfiles/Project_Default.xml +6 -0
  6. package/.idea/jsLinters/eslint.xml +6 -0
  7. package/.idea/modules.xml +8 -0
  8. package/.idea/prettier.xml +6 -0
  9. package/.idea/vcs.xml +6 -0
  10. package/README.md +91 -0
  11. package/dist/src/consts/catalogs.d.ts +2 -0
  12. package/dist/src/consts/catalogs.js +53 -0
  13. package/dist/src/consts/languages.d.ts +2 -0
  14. package/dist/src/consts/languages.js +20 -0
  15. package/dist/src/core/api.d.ts +389 -0
  16. package/dist/src/core/api.js +157 -0
  17. package/dist/src/core/api.test.d.ts +1 -0
  18. package/dist/src/core/api.test.js +246 -0
  19. package/dist/src/core/converters.d.ts +4 -0
  20. package/dist/src/core/converters.js +4 -0
  21. package/dist/src/schemas/agency.d.ts +416 -0
  22. package/dist/src/schemas/agency.js +61 -0
  23. package/dist/src/schemas/common.d.ts +153 -0
  24. package/dist/src/schemas/common.js +47 -0
  25. package/dist/src/schemas/internal.d.ts +3 -0
  26. package/dist/src/schemas/internal.js +11 -0
  27. package/dist/src/schemas/property.d.ts +1500 -0
  28. package/dist/src/schemas/property.js +238 -0
  29. package/dist/src/services/storage/dummy.cache.d.ts +10 -0
  30. package/dist/src/services/storage/dummy.cache.js +28 -0
  31. package/dist/src/services/storage/dummy.cache.test.d.ts +1 -0
  32. package/dist/src/services/storage/dummy.cache.test.js +96 -0
  33. package/dist/src/services/storage/filesystem.cache.d.ts +18 -0
  34. package/dist/src/services/storage/filesystem.cache.js +85 -0
  35. package/dist/src/services/storage/filesystem.cache.test.d.ts +1 -0
  36. package/dist/src/services/storage/filesystem.cache.test.js +197 -0
  37. package/dist/src/services/storage/memory.cache.d.ts +20 -0
  38. package/dist/src/services/storage/memory.cache.js +62 -0
  39. package/dist/src/services/storage/memory.cache.test.d.ts +1 -0
  40. package/dist/src/services/storage/memory.cache.test.js +80 -0
  41. package/dist/src/services/storage/types.d.ts +16 -0
  42. package/dist/src/services/storage/types.js +4 -0
  43. package/dist/src/types/index.d.ts +4 -0
  44. package/dist/src/types/index.js +1 -0
  45. package/dist/src/utils/url.d.ts +14 -0
  46. package/dist/src/utils/url.js +11 -0
  47. package/dist/src/utils/url.test.d.ts +1 -0
  48. package/dist/src/utils/url.test.js +18 -0
  49. package/dist/vitest.config.d.ts +2 -0
  50. package/dist/vitest.config.js +6 -0
  51. package/eslint.config.mjs +3 -0
  52. package/package.json +45 -0
  53. package/src/consts/catalogs.ts +55 -0
  54. package/src/consts/languages.ts +22 -0
  55. package/src/core/api.test.ts +308 -0
  56. package/src/core/api.ts +230 -0
  57. package/src/core/converters.ts +7 -0
  58. package/src/schemas/agency.ts +66 -0
  59. package/src/schemas/common.ts +67 -0
  60. package/src/schemas/internal.ts +13 -0
  61. package/src/schemas/property.ts +257 -0
  62. package/src/services/storage/dummy.cache.test.ts +110 -0
  63. package/src/services/storage/dummy.cache.ts +21 -0
  64. package/src/services/storage/filesystem.cache.test.ts +243 -0
  65. package/src/services/storage/filesystem.cache.ts +94 -0
  66. package/src/services/storage/memory.cache.test.ts +94 -0
  67. package/src/services/storage/memory.cache.ts +69 -0
  68. package/src/services/storage/types.ts +20 -0
  69. package/src/types/index.ts +5 -0
  70. package/src/utils/url.test.ts +21 -0
  71. package/src/utils/url.ts +27 -0
  72. package/tsconfig.json +13 -0
  73. package/vitest.config.ts +7 -0
@@ -0,0 +1,246 @@
1
+ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
2
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
3
+ return new (P || (P = Promise))(function (resolve, reject) {
4
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
5
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
6
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
7
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
8
+ });
9
+ };
10
+ import { afterEach, beforeEach, it as defaultIt, describe, expect, vi } from 'vitest';
11
+ import { z } from 'zod';
12
+ import { DummyCache } from '../services/storage/dummy.cache';
13
+ import { MemoryCache } from '../services/storage/memory.cache';
14
+ import { Api, DEFAULT_BASE_URL } from './api';
15
+ // Mock fetch globally
16
+ const mockFetch = vi.fn();
17
+ const PROVIDER = '0';
18
+ const TOKEN = 'TOKEN';
19
+ const BasicAuthHeaders = {
20
+ Authorization: `Basic ${btoa(`${PROVIDER}:${TOKEN}`)}`,
21
+ };
22
+ const it = defaultIt.extend({
23
+ // eslint-disable-next-line no-empty-pattern
24
+ api: (_a, use_1) => __awaiter(void 0, [_a, use_1], void 0, function* ({}, use) {
25
+ let api = new Api('0', 'TOKEN', {
26
+ catalogs: {
27
+ transform: {
28
+ active: false,
29
+ },
30
+ },
31
+ });
32
+ yield use(api);
33
+ api = null;
34
+ }),
35
+ // eslint-disable-next-line no-empty-pattern
36
+ mockResponse: (_a, use_1) => __awaiter(void 0, [_a, use_1], void 0, function* ({}, use) {
37
+ const mockResponse = (config) => {
38
+ var _a, _b;
39
+ mockFetch.mockResolvedValue({
40
+ ok: (_a = config === null || config === void 0 ? void 0 : config.ok) !== null && _a !== void 0 ? _a : true,
41
+ status: (_b = config === null || config === void 0 ? void 0 : config.status) !== null && _b !== void 0 ? _b : 200,
42
+ json: (config === null || config === void 0 ? void 0 : config.json) ? vi.fn().mockResolvedValue(config.json()) : vi.fn().mockResolvedValue({}),
43
+ text: vi.fn(),
44
+ headers: new Headers(),
45
+ statusText: 'OK',
46
+ url: '',
47
+ redirected: false,
48
+ type: 'basic',
49
+ body: null,
50
+ bodyUsed: false,
51
+ clone: vi.fn(),
52
+ arrayBuffer: vi.fn(),
53
+ blob: vi.fn(),
54
+ formData: vi.fn(),
55
+ });
56
+ };
57
+ yield use(mockResponse);
58
+ }),
59
+ });
60
+ describe('api', () => {
61
+ let mockResponse;
62
+ beforeEach(() => {
63
+ // Mock global fetch
64
+ vi.stubGlobal('fetch', mockFetch);
65
+ // Create a mock response object
66
+ mockResponse = {
67
+ ok: true,
68
+ status: 200,
69
+ json: vi.fn(),
70
+ text: vi.fn(),
71
+ headers: new Headers(),
72
+ statusText: 'OK',
73
+ url: '',
74
+ redirected: false,
75
+ type: 'basic',
76
+ body: null,
77
+ bodyUsed: false,
78
+ clone: vi.fn(),
79
+ arrayBuffer: vi.fn(),
80
+ blob: vi.fn(),
81
+ formData: vi.fn(),
82
+ };
83
+ mockFetch.mockResolvedValue(mockResponse);
84
+ });
85
+ afterEach(() => {
86
+ vi.unstubAllGlobals();
87
+ vi.clearAllMocks();
88
+ });
89
+ describe('constructor', () => {
90
+ it('should accept a provider, a token and a base config', ({ api }) => {
91
+ expect(api).toBeInstanceOf(Api);
92
+ });
93
+ it('should use default config when no additional config provided', ({ api }) => {
94
+ expect(api.config).toStrictEqual({
95
+ baseUrl: DEFAULT_BASE_URL,
96
+ culture: 'en',
97
+ catalogs: {
98
+ cache: {
99
+ active: true,
100
+ adapter: expect.any(MemoryCache),
101
+ },
102
+ transform: {
103
+ active: false,
104
+ },
105
+ },
106
+ });
107
+ });
108
+ it('should merge custom config with defaults', () => {
109
+ const testApi = new Api('provider', 'token', {
110
+ baseUrl: 'https://custom.api.com',
111
+ culture: 'fr',
112
+ catalogs: {
113
+ cache: {
114
+ active: false,
115
+ adapter: new DummyCache(),
116
+ },
117
+ },
118
+ });
119
+ expect(testApi.config).toStrictEqual({
120
+ baseUrl: 'https://custom.api.com',
121
+ culture: 'fr',
122
+ catalogs: {
123
+ cache: {
124
+ active: false,
125
+ adapter: expect.any(DummyCache),
126
+ },
127
+ transform: {
128
+ active: true,
129
+ },
130
+ },
131
+ });
132
+ });
133
+ it('should use provided cache adapter', () => {
134
+ const testApi = new Api('provider', 'token', {
135
+ catalogs: {
136
+ cache: {
137
+ adapter: new DummyCache(),
138
+ },
139
+ },
140
+ });
141
+ expect(testApi.cache).toBeInstanceOf(DummyCache);
142
+ });
143
+ it('should use DummyCache when cache is not active', () => {
144
+ const testApi = new Api('provider', 'token', {
145
+ catalogs: {
146
+ cache: {
147
+ active: false,
148
+ adapter: new MemoryCache(),
149
+ },
150
+ },
151
+ });
152
+ expect(testApi.cache).toBeInstanceOf(DummyCache);
153
+ });
154
+ });
155
+ describe('fetch', () => {
156
+ it('should have the right authorization headers when fetching', () => __awaiter(void 0, void 0, void 0, function* () {
157
+ const testApi = new Api('provider', 'token');
158
+ yield testApi.fetch(DEFAULT_BASE_URL);
159
+ expect(mockFetch).toHaveBeenCalledExactlyOnceWith(DEFAULT_BASE_URL, {
160
+ headers: {
161
+ Authorization: `Basic ${btoa('provider:token')}`,
162
+ },
163
+ });
164
+ }));
165
+ it('should merge additional headers with authorization', (_a) => __awaiter(void 0, [_a], void 0, function* ({ api }) {
166
+ const customHeaders = { 'Content-Type': 'application/json' };
167
+ yield api.fetch(DEFAULT_BASE_URL, { headers: customHeaders });
168
+ expect(mockFetch).toHaveBeenCalledWith(DEFAULT_BASE_URL, {
169
+ headers: Object.assign(Object.assign({}, BasicAuthHeaders), { 'Content-Type': 'application/json' }),
170
+ });
171
+ }));
172
+ it('should pass through other fetch options', (_a) => __awaiter(void 0, [_a], void 0, function* ({ api }) {
173
+ const options = {
174
+ method: 'POST',
175
+ body: JSON.stringify({ test: 'data' }),
176
+ headers: { 'Custom-Header': 'value' },
177
+ };
178
+ yield api.fetch(DEFAULT_BASE_URL, options);
179
+ expect(mockFetch).toHaveBeenCalledWith(DEFAULT_BASE_URL, {
180
+ method: 'POST',
181
+ body: JSON.stringify({ test: 'data' }),
182
+ headers: Object.assign(Object.assign({}, BasicAuthHeaders), { 'Custom-Header': 'value' }),
183
+ });
184
+ }));
185
+ it('should handle rate limiting with Bottleneck', (_a) => __awaiter(void 0, [_a], void 0, function* ({ api }) {
186
+ // Make multiple concurrent requests to test rate limiting
187
+ const promises = Array.from({ length: 3 }, () => api.fetch(DEFAULT_BASE_URL));
188
+ yield Promise.all(promises);
189
+ expect(mockFetch).toHaveBeenCalledTimes(3);
190
+ }));
191
+ });
192
+ describe('get', () => {
193
+ it('should fetch and parse according to the specified schema', (_a) => __awaiter(void 0, [_a], void 0, function* ({ mockResponse, api }) {
194
+ mockResponse({
195
+ json: () => ({ success: true }),
196
+ });
197
+ const spy = vi.spyOn(api, 'fetch');
198
+ yield api.get(['path', 'to', 'catalogs'], z.object({ success: z.boolean() }), { culture: 'en' });
199
+ expect(spy).toHaveBeenCalledExactlyOnceWith(new URL('https://api.apimo.pro/path/to/catalogs?culture=en'));
200
+ }));
201
+ });
202
+ describe('populateCache', () => {
203
+ it('should populate cache without returning entry when no id provided', (_a) => __awaiter(void 0, [_a], void 0, function* ({ api, mockResponse }) {
204
+ const catalogName = 'property_type';
205
+ const culture = 'en';
206
+ const mockEntries = [
207
+ { id: 1, name: 'Apartment', name_plurial: 'Apartments' },
208
+ { id: 2, name: 'House', name_plurial: 'Houses' },
209
+ ];
210
+ mockResponse({
211
+ json: () => mockEntries,
212
+ });
213
+ const result = yield api.populateCache(catalogName, culture);
214
+ expect(result).toBeUndefined();
215
+ expect(mockFetch).toHaveBeenCalledExactlyOnceWith(new URL(`https://api.apimo.pro/catalogs/${catalogName}?culture=${culture}`), {
216
+ headers: BasicAuthHeaders,
217
+ });
218
+ }));
219
+ it('should populate cache and return specific entry when id provided', (_a) => __awaiter(void 0, [_a], void 0, function* ({ api, mockResponse }) {
220
+ const catalogName = 'property_type';
221
+ const culture = 'en';
222
+ const mockEntries = [
223
+ { id: 1, name: 'Apartment', name_plurial: 'Apartments' },
224
+ { id: 2, name: 'House', name_plurial: 'Houses' },
225
+ ];
226
+ mockResponse({
227
+ json: () => mockEntries,
228
+ });
229
+ const result = yield api.populateCache(catalogName, culture, 1);
230
+ expect(result).toEqual({
231
+ name: 'Apartment',
232
+ namePlural: 'Apartments',
233
+ });
234
+ }));
235
+ it('should return null when requested id not found', (_a) => __awaiter(void 0, [_a], void 0, function* ({ api, mockResponse }) {
236
+ const catalogName = 'property_type';
237
+ const culture = 'en';
238
+ const mockEntries = [
239
+ { id: 1, name: 'Apartment', name_plurial: 'Apartments' },
240
+ ];
241
+ mockResponse({ json: () => mockEntries });
242
+ const result = yield api.populateCache(catalogName, culture, 999);
243
+ expect(result).toBeNull();
244
+ }));
245
+ });
246
+ });
@@ -0,0 +1,4 @@
1
+ export declare const Converters: {
2
+ toDate: (v: string) => Date;
3
+ toUrl: (path: string, baseUrl: string) => (v: string) => string;
4
+ };
@@ -0,0 +1,4 @@
1
+ export const Converters = {
2
+ toDate: (v) => new Date(v),
3
+ toUrl: (path, baseUrl) => (v) => new URL(`${path}${v}`, baseUrl).href,
4
+ };
@@ -0,0 +1,416 @@
1
+ import type { AdditionalConfig } from '../core/api';
2
+ import type { LocalizedCatalogTransformer } from './common';
3
+ import { z } from 'zod';
4
+ export declare function getRateSchema(transformer: LocalizedCatalogTransformer): z.ZodObject<{
5
+ id: z.ZodNumber;
6
+ category: z.ZodEffects<z.ZodNumber, string | import("../services/storage/types").CatalogEntryName | null, number>;
7
+ range_min: z.ZodNullable<z.ZodNumber>;
8
+ range_max: z.ZodNullable<z.ZodNumber>;
9
+ commission_price: z.ZodNullable<z.ZodNumber>;
10
+ commission_rate: z.ZodNullable<z.ZodNumber>;
11
+ comment: z.ZodString;
12
+ url: z.ZodNullable<z.ZodString>;
13
+ }, "strip", z.ZodTypeAny, {
14
+ id: number;
15
+ category: string | import("../services/storage/types").CatalogEntryName | null;
16
+ range_min: number | null;
17
+ range_max: number | null;
18
+ commission_price: number | null;
19
+ commission_rate: number | null;
20
+ comment: string;
21
+ url: string | null;
22
+ }, {
23
+ id: number;
24
+ category: number;
25
+ range_min: number | null;
26
+ range_max: number | null;
27
+ commission_price: number | null;
28
+ commission_rate: number | null;
29
+ comment: string;
30
+ url: string | null;
31
+ }>;
32
+ export declare const PartnerSchema: z.ZodObject<{
33
+ type: z.ZodNumber;
34
+ partner: z.ZodNullable<z.ZodNumber>;
35
+ name: z.ZodNullable<z.ZodString>;
36
+ reference: z.ZodString;
37
+ amount: z.ZodNumber;
38
+ currency: z.ZodString;
39
+ }, "strip", z.ZodTypeAny, {
40
+ name: string | null;
41
+ type: number;
42
+ partner: number | null;
43
+ reference: string;
44
+ amount: number;
45
+ currency: string;
46
+ }, {
47
+ name: string | null;
48
+ type: number;
49
+ partner: number | null;
50
+ reference: string;
51
+ amount: number;
52
+ currency: string;
53
+ }>;
54
+ export declare function getAgencySchema(transformer: LocalizedCatalogTransformer, config: AdditionalConfig): z.ZodObject<{
55
+ id: z.ZodNumber;
56
+ reference: z.ZodNumber;
57
+ active: z.ZodBoolean;
58
+ name: z.ZodString;
59
+ company: z.ZodObject<{
60
+ id: z.ZodNumber;
61
+ name: z.ZodString;
62
+ }, "strip", z.ZodTypeAny, {
63
+ id: number;
64
+ name: string;
65
+ }, {
66
+ id: number;
67
+ name: string;
68
+ }>;
69
+ brand: z.ZodNullable<z.ZodUnknown>;
70
+ networks: z.ZodArray<z.ZodUnknown, "many">;
71
+ address: z.ZodString;
72
+ address_more: z.ZodNullable<z.ZodString>;
73
+ city: z.ZodObject<{
74
+ id: z.ZodNumber;
75
+ name: z.ZodString;
76
+ } & {
77
+ zipcode: z.ZodString;
78
+ }, "strip", z.ZodTypeAny, {
79
+ id: number;
80
+ name: string;
81
+ zipcode: string;
82
+ }, {
83
+ id: number;
84
+ name: string;
85
+ zipcode: string;
86
+ }>;
87
+ district: z.ZodUnknown;
88
+ country: z.ZodString;
89
+ region: z.ZodString;
90
+ latitude: z.ZodNumber;
91
+ longitude: z.ZodNumber;
92
+ email: z.ZodString;
93
+ phone: z.ZodString;
94
+ fax: z.ZodNullable<z.ZodString>;
95
+ url: z.ZodString;
96
+ logo: z.ZodString;
97
+ logo_svg: z.ZodNullable<z.ZodString>;
98
+ picture: z.ZodString;
99
+ currency: z.ZodString;
100
+ timetable: z.ZodString;
101
+ created_at: z.ZodEffects<z.ZodString, Date, string>;
102
+ updated_at: z.ZodEffects<z.ZodString, Date, string>;
103
+ providers: z.ZodEffects<z.ZodString, string, string>;
104
+ rates: z.ZodArray<z.ZodObject<{
105
+ id: z.ZodNumber;
106
+ category: z.ZodEffects<z.ZodNumber, string | import("../services/storage/types").CatalogEntryName | null, number>;
107
+ range_min: z.ZodNullable<z.ZodNumber>;
108
+ range_max: z.ZodNullable<z.ZodNumber>;
109
+ commission_price: z.ZodNullable<z.ZodNumber>;
110
+ commission_rate: z.ZodNullable<z.ZodNumber>;
111
+ comment: z.ZodString;
112
+ url: z.ZodNullable<z.ZodString>;
113
+ }, "strip", z.ZodTypeAny, {
114
+ id: number;
115
+ category: string | import("../services/storage/types").CatalogEntryName | null;
116
+ range_min: number | null;
117
+ range_max: number | null;
118
+ commission_price: number | null;
119
+ commission_rate: number | null;
120
+ comment: string;
121
+ url: string | null;
122
+ }, {
123
+ id: number;
124
+ category: number;
125
+ range_min: number | null;
126
+ range_max: number | null;
127
+ commission_price: number | null;
128
+ commission_rate: number | null;
129
+ comment: string;
130
+ url: string | null;
131
+ }>, "many">;
132
+ partners: z.ZodArray<z.ZodObject<{
133
+ type: z.ZodNumber;
134
+ partner: z.ZodNullable<z.ZodNumber>;
135
+ name: z.ZodNullable<z.ZodString>;
136
+ reference: z.ZodString;
137
+ amount: z.ZodNumber;
138
+ currency: z.ZodString;
139
+ }, "strip", z.ZodTypeAny, {
140
+ name: string | null;
141
+ type: number;
142
+ partner: number | null;
143
+ reference: string;
144
+ amount: number;
145
+ currency: string;
146
+ }, {
147
+ name: string | null;
148
+ type: number;
149
+ partner: number | null;
150
+ reference: string;
151
+ amount: number;
152
+ currency: string;
153
+ }>, "many">;
154
+ stories: z.ZodArray<z.ZodUnknown, "many">;
155
+ users: z.ZodArray<z.ZodObject<{
156
+ id: z.ZodNumber;
157
+ agency: z.ZodNumber;
158
+ active: z.ZodBoolean;
159
+ created_at: z.ZodEffects<z.ZodString, Date, string>;
160
+ updated_at: z.ZodEffects<z.ZodString, Date, string>;
161
+ firstname: z.ZodString;
162
+ lastname: z.ZodString;
163
+ username: z.ZodOptional<z.ZodString>;
164
+ password: z.ZodOptional<z.ZodString>;
165
+ language: z.ZodString;
166
+ spoken_languages: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
167
+ group: z.ZodEffects<z.ZodNumber, string | import("../services/storage/types").CatalogEntryName | null, number>;
168
+ email: z.ZodString;
169
+ phone: z.ZodNullable<z.ZodString>;
170
+ mobile: z.ZodString;
171
+ fax: z.ZodNullable<z.ZodString>;
172
+ city: z.ZodOptional<z.ZodNullable<z.ZodObject<{
173
+ id: z.ZodNumber;
174
+ name: z.ZodString;
175
+ }, "strip", z.ZodTypeAny, {
176
+ id: number;
177
+ name: string;
178
+ }, {
179
+ id: number;
180
+ name: string;
181
+ }>>>;
182
+ birthday_at: z.ZodEffects<z.ZodString, Date, string>;
183
+ timezone: z.ZodNullable<z.ZodString>;
184
+ picture: z.ZodNullable<z.ZodString>;
185
+ partners: z.ZodOptional<z.ZodArray<z.ZodUnknown, "many">>;
186
+ stories: z.ZodOptional<z.ZodArray<z.ZodUnknown, "many">>;
187
+ rates: z.ZodUnknown;
188
+ }, "strip", z.ZodTypeAny, {
189
+ id: number;
190
+ agency: number;
191
+ active: boolean;
192
+ created_at: Date;
193
+ updated_at: Date;
194
+ firstname: string;
195
+ lastname: string;
196
+ language: string;
197
+ group: string | import("../services/storage/types").CatalogEntryName | null;
198
+ email: string;
199
+ phone: string | null;
200
+ mobile: string;
201
+ fax: string | null;
202
+ birthday_at: Date;
203
+ timezone: string | null;
204
+ picture: string | null;
205
+ username?: string | undefined;
206
+ password?: string | undefined;
207
+ spoken_languages?: string[] | undefined;
208
+ city?: {
209
+ id: number;
210
+ name: string;
211
+ } | null | undefined;
212
+ partners?: unknown[] | undefined;
213
+ stories?: unknown[] | undefined;
214
+ rates?: unknown;
215
+ }, {
216
+ id: number;
217
+ agency: number;
218
+ active: boolean;
219
+ created_at: string;
220
+ updated_at: string;
221
+ firstname: string;
222
+ lastname: string;
223
+ language: string;
224
+ group: number;
225
+ email: string;
226
+ phone: string | null;
227
+ mobile: string;
228
+ fax: string | null;
229
+ birthday_at: string;
230
+ timezone: string | null;
231
+ picture: string | null;
232
+ username?: string | undefined;
233
+ password?: string | undefined;
234
+ spoken_languages?: string[] | undefined;
235
+ city?: {
236
+ id: number;
237
+ name: string;
238
+ } | null | undefined;
239
+ partners?: unknown[] | undefined;
240
+ stories?: unknown[] | undefined;
241
+ rates?: unknown;
242
+ }>, "many">;
243
+ sectors: z.ZodArray<z.ZodUnknown, "many">;
244
+ parameters: z.ZodEffects<z.ZodString, string, string>;
245
+ subscription: z.ZodString;
246
+ }, "strip", z.ZodTypeAny, {
247
+ id: number;
248
+ name: string;
249
+ active: boolean;
250
+ created_at: Date;
251
+ updated_at: Date;
252
+ email: string;
253
+ phone: string;
254
+ fax: string | null;
255
+ city: {
256
+ id: number;
257
+ name: string;
258
+ zipcode: string;
259
+ };
260
+ picture: string;
261
+ partners: {
262
+ name: string | null;
263
+ type: number;
264
+ partner: number | null;
265
+ reference: string;
266
+ amount: number;
267
+ currency: string;
268
+ }[];
269
+ stories: unknown[];
270
+ rates: {
271
+ id: number;
272
+ category: string | import("../services/storage/types").CatalogEntryName | null;
273
+ range_min: number | null;
274
+ range_max: number | null;
275
+ commission_price: number | null;
276
+ commission_rate: number | null;
277
+ comment: string;
278
+ url: string | null;
279
+ }[];
280
+ url: string;
281
+ reference: number;
282
+ currency: string;
283
+ company: {
284
+ id: number;
285
+ name: string;
286
+ };
287
+ networks: unknown[];
288
+ address: string;
289
+ address_more: string | null;
290
+ country: string;
291
+ region: string;
292
+ latitude: number;
293
+ longitude: number;
294
+ logo: string;
295
+ logo_svg: string | null;
296
+ timetable: string;
297
+ providers: string;
298
+ users: {
299
+ id: number;
300
+ agency: number;
301
+ active: boolean;
302
+ created_at: Date;
303
+ updated_at: Date;
304
+ firstname: string;
305
+ lastname: string;
306
+ language: string;
307
+ group: string | import("../services/storage/types").CatalogEntryName | null;
308
+ email: string;
309
+ phone: string | null;
310
+ mobile: string;
311
+ fax: string | null;
312
+ birthday_at: Date;
313
+ timezone: string | null;
314
+ picture: string | null;
315
+ username?: string | undefined;
316
+ password?: string | undefined;
317
+ spoken_languages?: string[] | undefined;
318
+ city?: {
319
+ id: number;
320
+ name: string;
321
+ } | null | undefined;
322
+ partners?: unknown[] | undefined;
323
+ stories?: unknown[] | undefined;
324
+ rates?: unknown;
325
+ }[];
326
+ sectors: unknown[];
327
+ parameters: string;
328
+ subscription: string;
329
+ brand?: unknown;
330
+ district?: unknown;
331
+ }, {
332
+ id: number;
333
+ name: string;
334
+ active: boolean;
335
+ created_at: string;
336
+ updated_at: string;
337
+ email: string;
338
+ phone: string;
339
+ fax: string | null;
340
+ city: {
341
+ id: number;
342
+ name: string;
343
+ zipcode: string;
344
+ };
345
+ picture: string;
346
+ partners: {
347
+ name: string | null;
348
+ type: number;
349
+ partner: number | null;
350
+ reference: string;
351
+ amount: number;
352
+ currency: string;
353
+ }[];
354
+ stories: unknown[];
355
+ rates: {
356
+ id: number;
357
+ category: number;
358
+ range_min: number | null;
359
+ range_max: number | null;
360
+ commission_price: number | null;
361
+ commission_rate: number | null;
362
+ comment: string;
363
+ url: string | null;
364
+ }[];
365
+ url: string;
366
+ reference: number;
367
+ currency: string;
368
+ company: {
369
+ id: number;
370
+ name: string;
371
+ };
372
+ networks: unknown[];
373
+ address: string;
374
+ address_more: string | null;
375
+ country: string;
376
+ region: string;
377
+ latitude: number;
378
+ longitude: number;
379
+ logo: string;
380
+ logo_svg: string | null;
381
+ timetable: string;
382
+ providers: string;
383
+ users: {
384
+ id: number;
385
+ agency: number;
386
+ active: boolean;
387
+ created_at: string;
388
+ updated_at: string;
389
+ firstname: string;
390
+ lastname: string;
391
+ language: string;
392
+ group: number;
393
+ email: string;
394
+ phone: string | null;
395
+ mobile: string;
396
+ fax: string | null;
397
+ birthday_at: string;
398
+ timezone: string | null;
399
+ picture: string | null;
400
+ username?: string | undefined;
401
+ password?: string | undefined;
402
+ spoken_languages?: string[] | undefined;
403
+ city?: {
404
+ id: number;
405
+ name: string;
406
+ } | null | undefined;
407
+ partners?: unknown[] | undefined;
408
+ stories?: unknown[] | undefined;
409
+ rates?: unknown;
410
+ }[];
411
+ sectors: unknown[];
412
+ parameters: string;
413
+ subscription: string;
414
+ brand?: unknown;
415
+ district?: unknown;
416
+ }>;