@deliverart/sdk-js-company 2.5.34 → 2.6.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.
package/dist/index.cjs CHANGED
@@ -11282,7 +11282,7 @@ var import_sdk_js_core3 = require("@deliverart/sdk-js-core");
11282
11282
  var import_sdk_js_global_types3 = require("@deliverart/sdk-js-global-types");
11283
11283
  var getCompaniesQuerySchema = companiesQuerySchema;
11284
11284
  var getCompaniesInputSchema = external_exports.undefined();
11285
- var getCompaniesResponseSchema = (0, import_sdk_js_global_types3.createPaginatedSchema)(companySchema);
11285
+ var getCompaniesResponseSchema = (0, import_sdk_js_global_types3.mixedPaginationSchema)(companySchema);
11286
11286
  var GetCompanies = class extends import_sdk_js_core3.AbstractApiRequest {
11287
11287
  constructor(options) {
11288
11288
  super(void 0, options);
@@ -11293,14 +11293,12 @@ var GetCompanies = class extends import_sdk_js_core3.AbstractApiRequest {
11293
11293
  this.outputSchema = getCompaniesResponseSchema;
11294
11294
  this.querySchema = getCompaniesQuerySchema;
11295
11295
  this.headersSchema = void 0;
11296
+ this.listItemSchema = companySchema;
11297
+ this.paginationDefaultEnabled = true;
11296
11298
  }
11297
11299
  getPath() {
11298
11300
  return "/companies";
11299
11301
  }
11300
- parseResponse(data, rawResponse) {
11301
- const companies = external_exports.array(companySchema).parse(data);
11302
- return this.validateOutput({ data: companies, pagination: (0, import_sdk_js_global_types3.responseToPagination)(rawResponse) });
11303
- }
11304
11302
  };
11305
11303
 
11306
11304
  // src/requests/GetCompanyDetails.ts
@@ -11339,14 +11337,13 @@ var GetUserCompanies = class extends import_sdk_js_core5.AbstractApiRequest {
11339
11337
  this.outputSchema = getUserCompaniesResponseSchema;
11340
11338
  this.querySchema = getUserCompaniesQuerySchema;
11341
11339
  this.headersSchema = void 0;
11340
+ this.listItemSchema = companySchema;
11341
+ this.paginationDefaultEnabled = false;
11342
11342
  this.userId = userId;
11343
11343
  }
11344
11344
  getPath() {
11345
11345
  return `/users/${this.userId}/companies`;
11346
11346
  }
11347
- parseResponse(data) {
11348
- return external_exports.array(companySchema).parse(data);
11349
- }
11350
11347
  };
11351
11348
 
11352
11349
  // src/requests/UpdateCompany.ts
package/dist/index.d.cts CHANGED
@@ -1,5 +1,4 @@
1
1
  import * as _deliverart_sdk_js_global_types from '@deliverart/sdk-js-global-types';
2
- import { Paginated } from '@deliverart/sdk-js-global-types';
3
2
  import { z } from 'zod';
4
3
  import { AbstractApiRequest } from '@deliverart/sdk-js-core';
5
4
 
@@ -262,7 +261,7 @@ declare const getCompaniesQuerySchema: z.ZodObject<{
262
261
  type GetCompaniesQueryParams = z.infer<typeof getCompaniesQuerySchema>;
263
262
  declare const getCompaniesInputSchema: z.ZodUndefined;
264
263
  type GetCompaniesInput = z.input<typeof getCompaniesInputSchema>;
265
- declare const getCompaniesResponseSchema: z.ZodObject<{
264
+ declare const getCompaniesResponseSchema: z.ZodUnion<readonly [z.ZodObject<{
266
265
  data: z.ZodArray<z.ZodObject<{
267
266
  id: z.ZodString;
268
267
  businessName: z.ZodString;
@@ -287,14 +286,29 @@ declare const getCompaniesResponseSchema: z.ZodObject<{
287
286
  currentPage: z.ZodCoercedNumber<unknown>;
288
287
  lastPage: z.ZodCoercedNumber<unknown>;
289
288
  }, z.core.$strip>;
290
- }, z.core.$strip>;
289
+ }, z.core.$strip>, z.ZodArray<z.ZodObject<{
290
+ id: z.ZodString;
291
+ businessName: z.ZodString;
292
+ vat: z.ZodString;
293
+ taxCode: z.ZodNullable<z.ZodString>;
294
+ operationalAddress: z.ZodObject<{
295
+ line1: z.ZodOptional<z.ZodNullable<z.ZodString>>;
296
+ line2: z.ZodOptional<z.ZodNullable<z.ZodString>>;
297
+ city: z.ZodOptional<z.ZodNullable<z.ZodString>>;
298
+ region: z.ZodOptional<z.ZodNullable<z.ZodString>>;
299
+ postalCode: z.ZodOptional<z.ZodNullable<z.ZodString>>;
300
+ country: z.ZodOptional<z.ZodNullable<z.ZodString>>;
301
+ }, z.core.$strip>;
302
+ createdAt: z.ZodString;
303
+ updatedAt: z.ZodString;
304
+ }, z.core.$strip>>]>;
291
305
  type GetCompaniesResponse = z.infer<typeof getCompaniesResponseSchema>;
292
306
  declare class GetCompanies extends AbstractApiRequest<typeof getCompaniesInputSchema, typeof getCompaniesResponseSchema, GetCompaniesQueryParams> {
293
- readonly method = "GET";
294
- readonly contentType = "application/json";
295
- readonly accept = "application/json";
307
+ readonly method: "GET";
308
+ readonly contentType: "application/json";
309
+ readonly accept: "application/json";
296
310
  readonly inputSchema: z.ZodUndefined;
297
- readonly outputSchema: z.ZodObject<{
311
+ readonly outputSchema: z.ZodUnion<readonly [z.ZodObject<{
298
312
  data: z.ZodArray<z.ZodObject<{
299
313
  id: z.ZodString;
300
314
  businessName: z.ZodString;
@@ -319,7 +333,22 @@ declare class GetCompanies extends AbstractApiRequest<typeof getCompaniesInputSc
319
333
  currentPage: z.ZodCoercedNumber<unknown>;
320
334
  lastPage: z.ZodCoercedNumber<unknown>;
321
335
  }, z.core.$strip>;
322
- }, z.core.$strip>;
336
+ }, z.core.$strip>, z.ZodArray<z.ZodObject<{
337
+ id: z.ZodString;
338
+ businessName: z.ZodString;
339
+ vat: z.ZodString;
340
+ taxCode: z.ZodNullable<z.ZodString>;
341
+ operationalAddress: z.ZodObject<{
342
+ line1: z.ZodOptional<z.ZodNullable<z.ZodString>>;
343
+ line2: z.ZodOptional<z.ZodNullable<z.ZodString>>;
344
+ city: z.ZodOptional<z.ZodNullable<z.ZodString>>;
345
+ region: z.ZodOptional<z.ZodNullable<z.ZodString>>;
346
+ postalCode: z.ZodOptional<z.ZodNullable<z.ZodString>>;
347
+ country: z.ZodOptional<z.ZodNullable<z.ZodString>>;
348
+ }, z.core.$strip>;
349
+ createdAt: z.ZodString;
350
+ updatedAt: z.ZodString;
351
+ }, z.core.$strip>>]>;
323
352
  readonly querySchema: z.ZodObject<{
324
353
  businessName: z.ZodOptional<z.ZodString>;
325
354
  vat: z.ZodOptional<z.ZodString>;
@@ -343,11 +372,27 @@ declare class GetCompanies extends AbstractApiRequest<typeof getCompaniesInputSc
343
372
  page: z.ZodOptional<z.ZodCoercedNumber<unknown>>;
344
373
  }, z.core.$strip>;
345
374
  readonly headersSchema: undefined;
375
+ readonly listItemSchema: z.ZodObject<{
376
+ id: z.ZodString;
377
+ businessName: z.ZodString;
378
+ vat: z.ZodString;
379
+ taxCode: z.ZodNullable<z.ZodString>;
380
+ operationalAddress: z.ZodObject<{
381
+ line1: z.ZodOptional<z.ZodNullable<z.ZodString>>;
382
+ line2: z.ZodOptional<z.ZodNullable<z.ZodString>>;
383
+ city: z.ZodOptional<z.ZodNullable<z.ZodString>>;
384
+ region: z.ZodOptional<z.ZodNullable<z.ZodString>>;
385
+ postalCode: z.ZodOptional<z.ZodNullable<z.ZodString>>;
386
+ country: z.ZodOptional<z.ZodNullable<z.ZodString>>;
387
+ }, z.core.$strip>;
388
+ createdAt: z.ZodString;
389
+ updatedAt: z.ZodString;
390
+ }, z.core.$strip>;
391
+ readonly paginationDefaultEnabled = true;
346
392
  constructor(options?: {
347
393
  query?: GetCompaniesQueryParams;
348
394
  });
349
395
  getPath(): string;
350
- parseResponse(data: unknown, rawResponse: Response): Paginated<Company>;
351
396
  }
352
397
 
353
398
  declare const getCompanyDetailsInputSchema: z.ZodUndefined;
@@ -466,9 +511,9 @@ declare const getUserCompaniesResponseSchema: z.ZodArray<z.ZodObject<{
466
511
  }, z.core.$strip>>;
467
512
  type GetUserCompaniesResponse = z.infer<typeof getUserCompaniesResponseSchema>;
468
513
  declare class GetUserCompanies extends AbstractApiRequest<typeof getUserCompaniesInputSchema, typeof getUserCompaniesResponseSchema, GetUserCompaniesQueryParams> {
469
- readonly method = "GET";
470
- readonly contentType = "application/json";
471
- readonly accept = "application/json";
514
+ readonly method: "GET";
515
+ readonly contentType: "application/json";
516
+ readonly accept: "application/json";
472
517
  readonly inputSchema: z.ZodUndefined;
473
518
  readonly outputSchema: z.ZodArray<z.ZodObject<{
474
519
  id: z.ZodString;
@@ -509,12 +554,28 @@ declare class GetUserCompanies extends AbstractApiRequest<typeof getUserCompanie
509
554
  page: z.ZodOptional<z.ZodCoercedNumber<unknown>>;
510
555
  }, z.core.$strip>;
511
556
  readonly headersSchema: undefined;
557
+ readonly listItemSchema: z.ZodObject<{
558
+ id: z.ZodString;
559
+ businessName: z.ZodString;
560
+ vat: z.ZodString;
561
+ taxCode: z.ZodNullable<z.ZodString>;
562
+ operationalAddress: z.ZodObject<{
563
+ line1: z.ZodOptional<z.ZodNullable<z.ZodString>>;
564
+ line2: z.ZodOptional<z.ZodNullable<z.ZodString>>;
565
+ city: z.ZodOptional<z.ZodNullable<z.ZodString>>;
566
+ region: z.ZodOptional<z.ZodNullable<z.ZodString>>;
567
+ postalCode: z.ZodOptional<z.ZodNullable<z.ZodString>>;
568
+ country: z.ZodOptional<z.ZodNullable<z.ZodString>>;
569
+ }, z.core.$strip>;
570
+ createdAt: z.ZodString;
571
+ updatedAt: z.ZodString;
572
+ }, z.core.$strip>;
573
+ readonly paginationDefaultEnabled = false;
512
574
  private readonly userId;
513
575
  constructor(userId: string, options?: {
514
576
  query?: GetUserCompaniesQueryParams;
515
577
  });
516
578
  getPath(): string;
517
- parseResponse(data: unknown): Company[];
518
579
  }
519
580
 
520
581
  declare const updateCompanyInputSchema: z.ZodObject<{
package/dist/index.d.ts CHANGED
@@ -1,5 +1,4 @@
1
1
  import * as _deliverart_sdk_js_global_types from '@deliverart/sdk-js-global-types';
2
- import { Paginated } from '@deliverart/sdk-js-global-types';
3
2
  import { z } from 'zod';
4
3
  import { AbstractApiRequest } from '@deliverart/sdk-js-core';
5
4
 
@@ -262,7 +261,7 @@ declare const getCompaniesQuerySchema: z.ZodObject<{
262
261
  type GetCompaniesQueryParams = z.infer<typeof getCompaniesQuerySchema>;
263
262
  declare const getCompaniesInputSchema: z.ZodUndefined;
264
263
  type GetCompaniesInput = z.input<typeof getCompaniesInputSchema>;
265
- declare const getCompaniesResponseSchema: z.ZodObject<{
264
+ declare const getCompaniesResponseSchema: z.ZodUnion<readonly [z.ZodObject<{
266
265
  data: z.ZodArray<z.ZodObject<{
267
266
  id: z.ZodString;
268
267
  businessName: z.ZodString;
@@ -287,14 +286,29 @@ declare const getCompaniesResponseSchema: z.ZodObject<{
287
286
  currentPage: z.ZodCoercedNumber<unknown>;
288
287
  lastPage: z.ZodCoercedNumber<unknown>;
289
288
  }, z.core.$strip>;
290
- }, z.core.$strip>;
289
+ }, z.core.$strip>, z.ZodArray<z.ZodObject<{
290
+ id: z.ZodString;
291
+ businessName: z.ZodString;
292
+ vat: z.ZodString;
293
+ taxCode: z.ZodNullable<z.ZodString>;
294
+ operationalAddress: z.ZodObject<{
295
+ line1: z.ZodOptional<z.ZodNullable<z.ZodString>>;
296
+ line2: z.ZodOptional<z.ZodNullable<z.ZodString>>;
297
+ city: z.ZodOptional<z.ZodNullable<z.ZodString>>;
298
+ region: z.ZodOptional<z.ZodNullable<z.ZodString>>;
299
+ postalCode: z.ZodOptional<z.ZodNullable<z.ZodString>>;
300
+ country: z.ZodOptional<z.ZodNullable<z.ZodString>>;
301
+ }, z.core.$strip>;
302
+ createdAt: z.ZodString;
303
+ updatedAt: z.ZodString;
304
+ }, z.core.$strip>>]>;
291
305
  type GetCompaniesResponse = z.infer<typeof getCompaniesResponseSchema>;
292
306
  declare class GetCompanies extends AbstractApiRequest<typeof getCompaniesInputSchema, typeof getCompaniesResponseSchema, GetCompaniesQueryParams> {
293
- readonly method = "GET";
294
- readonly contentType = "application/json";
295
- readonly accept = "application/json";
307
+ readonly method: "GET";
308
+ readonly contentType: "application/json";
309
+ readonly accept: "application/json";
296
310
  readonly inputSchema: z.ZodUndefined;
297
- readonly outputSchema: z.ZodObject<{
311
+ readonly outputSchema: z.ZodUnion<readonly [z.ZodObject<{
298
312
  data: z.ZodArray<z.ZodObject<{
299
313
  id: z.ZodString;
300
314
  businessName: z.ZodString;
@@ -319,7 +333,22 @@ declare class GetCompanies extends AbstractApiRequest<typeof getCompaniesInputSc
319
333
  currentPage: z.ZodCoercedNumber<unknown>;
320
334
  lastPage: z.ZodCoercedNumber<unknown>;
321
335
  }, z.core.$strip>;
322
- }, z.core.$strip>;
336
+ }, z.core.$strip>, z.ZodArray<z.ZodObject<{
337
+ id: z.ZodString;
338
+ businessName: z.ZodString;
339
+ vat: z.ZodString;
340
+ taxCode: z.ZodNullable<z.ZodString>;
341
+ operationalAddress: z.ZodObject<{
342
+ line1: z.ZodOptional<z.ZodNullable<z.ZodString>>;
343
+ line2: z.ZodOptional<z.ZodNullable<z.ZodString>>;
344
+ city: z.ZodOptional<z.ZodNullable<z.ZodString>>;
345
+ region: z.ZodOptional<z.ZodNullable<z.ZodString>>;
346
+ postalCode: z.ZodOptional<z.ZodNullable<z.ZodString>>;
347
+ country: z.ZodOptional<z.ZodNullable<z.ZodString>>;
348
+ }, z.core.$strip>;
349
+ createdAt: z.ZodString;
350
+ updatedAt: z.ZodString;
351
+ }, z.core.$strip>>]>;
323
352
  readonly querySchema: z.ZodObject<{
324
353
  businessName: z.ZodOptional<z.ZodString>;
325
354
  vat: z.ZodOptional<z.ZodString>;
@@ -343,11 +372,27 @@ declare class GetCompanies extends AbstractApiRequest<typeof getCompaniesInputSc
343
372
  page: z.ZodOptional<z.ZodCoercedNumber<unknown>>;
344
373
  }, z.core.$strip>;
345
374
  readonly headersSchema: undefined;
375
+ readonly listItemSchema: z.ZodObject<{
376
+ id: z.ZodString;
377
+ businessName: z.ZodString;
378
+ vat: z.ZodString;
379
+ taxCode: z.ZodNullable<z.ZodString>;
380
+ operationalAddress: z.ZodObject<{
381
+ line1: z.ZodOptional<z.ZodNullable<z.ZodString>>;
382
+ line2: z.ZodOptional<z.ZodNullable<z.ZodString>>;
383
+ city: z.ZodOptional<z.ZodNullable<z.ZodString>>;
384
+ region: z.ZodOptional<z.ZodNullable<z.ZodString>>;
385
+ postalCode: z.ZodOptional<z.ZodNullable<z.ZodString>>;
386
+ country: z.ZodOptional<z.ZodNullable<z.ZodString>>;
387
+ }, z.core.$strip>;
388
+ createdAt: z.ZodString;
389
+ updatedAt: z.ZodString;
390
+ }, z.core.$strip>;
391
+ readonly paginationDefaultEnabled = true;
346
392
  constructor(options?: {
347
393
  query?: GetCompaniesQueryParams;
348
394
  });
349
395
  getPath(): string;
350
- parseResponse(data: unknown, rawResponse: Response): Paginated<Company>;
351
396
  }
352
397
 
353
398
  declare const getCompanyDetailsInputSchema: z.ZodUndefined;
@@ -466,9 +511,9 @@ declare const getUserCompaniesResponseSchema: z.ZodArray<z.ZodObject<{
466
511
  }, z.core.$strip>>;
467
512
  type GetUserCompaniesResponse = z.infer<typeof getUserCompaniesResponseSchema>;
468
513
  declare class GetUserCompanies extends AbstractApiRequest<typeof getUserCompaniesInputSchema, typeof getUserCompaniesResponseSchema, GetUserCompaniesQueryParams> {
469
- readonly method = "GET";
470
- readonly contentType = "application/json";
471
- readonly accept = "application/json";
514
+ readonly method: "GET";
515
+ readonly contentType: "application/json";
516
+ readonly accept: "application/json";
472
517
  readonly inputSchema: z.ZodUndefined;
473
518
  readonly outputSchema: z.ZodArray<z.ZodObject<{
474
519
  id: z.ZodString;
@@ -509,12 +554,28 @@ declare class GetUserCompanies extends AbstractApiRequest<typeof getUserCompanie
509
554
  page: z.ZodOptional<z.ZodCoercedNumber<unknown>>;
510
555
  }, z.core.$strip>;
511
556
  readonly headersSchema: undefined;
557
+ readonly listItemSchema: z.ZodObject<{
558
+ id: z.ZodString;
559
+ businessName: z.ZodString;
560
+ vat: z.ZodString;
561
+ taxCode: z.ZodNullable<z.ZodString>;
562
+ operationalAddress: z.ZodObject<{
563
+ line1: z.ZodOptional<z.ZodNullable<z.ZodString>>;
564
+ line2: z.ZodOptional<z.ZodNullable<z.ZodString>>;
565
+ city: z.ZodOptional<z.ZodNullable<z.ZodString>>;
566
+ region: z.ZodOptional<z.ZodNullable<z.ZodString>>;
567
+ postalCode: z.ZodOptional<z.ZodNullable<z.ZodString>>;
568
+ country: z.ZodOptional<z.ZodNullable<z.ZodString>>;
569
+ }, z.core.$strip>;
570
+ createdAt: z.ZodString;
571
+ updatedAt: z.ZodString;
572
+ }, z.core.$strip>;
573
+ readonly paginationDefaultEnabled = false;
512
574
  private readonly userId;
513
575
  constructor(userId: string, options?: {
514
576
  query?: GetUserCompaniesQueryParams;
515
577
  });
516
578
  getPath(): string;
517
- parseResponse(data: unknown): Company[];
518
579
  }
519
580
 
520
581
  declare const updateCompanyInputSchema: z.ZodObject<{
package/dist/index.js CHANGED
@@ -11239,13 +11239,10 @@ var DeleteCompany = class extends AbstractApiRequest2 {
11239
11239
 
11240
11240
  // src/requests/GetCompanies.ts
11241
11241
  import { AbstractApiRequest as AbstractApiRequest3 } from "@deliverart/sdk-js-core";
11242
- import {
11243
- createPaginatedSchema,
11244
- responseToPagination
11245
- } from "@deliverart/sdk-js-global-types";
11242
+ import { mixedPaginationSchema } from "@deliverart/sdk-js-global-types";
11246
11243
  var getCompaniesQuerySchema = companiesQuerySchema;
11247
11244
  var getCompaniesInputSchema = external_exports.undefined();
11248
- var getCompaniesResponseSchema = createPaginatedSchema(companySchema);
11245
+ var getCompaniesResponseSchema = mixedPaginationSchema(companySchema);
11249
11246
  var GetCompanies = class extends AbstractApiRequest3 {
11250
11247
  constructor(options) {
11251
11248
  super(void 0, options);
@@ -11256,14 +11253,12 @@ var GetCompanies = class extends AbstractApiRequest3 {
11256
11253
  this.outputSchema = getCompaniesResponseSchema;
11257
11254
  this.querySchema = getCompaniesQuerySchema;
11258
11255
  this.headersSchema = void 0;
11256
+ this.listItemSchema = companySchema;
11257
+ this.paginationDefaultEnabled = true;
11259
11258
  }
11260
11259
  getPath() {
11261
11260
  return "/companies";
11262
11261
  }
11263
- parseResponse(data, rawResponse) {
11264
- const companies = external_exports.array(companySchema).parse(data);
11265
- return this.validateOutput({ data: companies, pagination: responseToPagination(rawResponse) });
11266
- }
11267
11262
  };
11268
11263
 
11269
11264
  // src/requests/GetCompanyDetails.ts
@@ -11302,14 +11297,13 @@ var GetUserCompanies = class extends AbstractApiRequest5 {
11302
11297
  this.outputSchema = getUserCompaniesResponseSchema;
11303
11298
  this.querySchema = getUserCompaniesQuerySchema;
11304
11299
  this.headersSchema = void 0;
11300
+ this.listItemSchema = companySchema;
11301
+ this.paginationDefaultEnabled = false;
11305
11302
  this.userId = userId;
11306
11303
  }
11307
11304
  getPath() {
11308
11305
  return `/users/${this.userId}/companies`;
11309
11306
  }
11310
- parseResponse(data) {
11311
- return external_exports.array(companySchema).parse(data);
11312
- }
11313
11307
  };
11314
11308
 
11315
11309
  // src/requests/UpdateCompany.ts
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@deliverart/sdk-js-company",
3
3
  "description": "Deliverart JavaScript SDK for Company Management",
4
- "version": "2.5.34",
4
+ "version": "2.6.1",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",
7
7
  "types": "dist/index.d.ts",
@@ -18,9 +18,9 @@
18
18
  "dist"
19
19
  ],
20
20
  "dependencies": {
21
- "@deliverart/sdk-js-core": "2.5.34",
22
- "@deliverart/sdk-js-global-types": "2.5.34",
23
- "@deliverart/sdk-js-user": "2.5.34"
21
+ "@deliverart/sdk-js-core": "2.6.1",
22
+ "@deliverart/sdk-js-global-types": "2.6.1",
23
+ "@deliverart/sdk-js-user": "2.6.1"
24
24
  },
25
25
  "publishConfig": {
26
26
  "access": "public"