@vindentech/api-client 2.0.0-next.0 → 2.0.0-next.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.
@@ -59,7 +59,7 @@ export type articlesControllerUpdateArticleV1ResponseSuccess = (articlesControll
59
59
  export type articlesControllerUpdateArticleV1Response = (articlesControllerUpdateArticleV1ResponseSuccess);
60
60
  export declare const getArticlesControllerUpdateArticleV1Url: (id: string) => string;
61
61
  /**
62
- * 🔒 Requires permission: article:write. Gate UI with hasRequiredPermissions() from @vindentech/api-client.
62
+ * Only the fields given are written; `translations` is replaced whole. An invoice row takes the article's name, in the invoice's language, when the invoice is sent to Stripe or Fortnox: a change reaches every invoice not yet sent, drafts included, and does not rewrite one already sent. 🔒 Requires permission: article:write. Gate UI with hasRequiredPermissions() from @vindentech/api-client.
63
63
  * @summary Update a tenant article
64
64
  */
65
65
  export declare const articlesControllerUpdateArticleV1: (id: string, updateArticleDto: UpdateArticleDto, options?: Parameters<typeof customFetch>[1]) => Promise<articlesControllerUpdateArticleV1Response>;
@@ -64,7 +64,7 @@ export const getArticlesControllerUpdateArticleV1Url = (id) => {
64
64
  return `/v1/billing/articles/${id}`;
65
65
  };
66
66
  /**
67
- * 🔒 Requires permission: article:write. Gate UI with hasRequiredPermissions() from @vindentech/api-client.
67
+ * Only the fields given are written; `translations` is replaced whole. An invoice row takes the article's name, in the invoice's language, when the invoice is sent to Stripe or Fortnox: a change reaches every invoice not yet sent, drafts included, and does not rewrite one already sent. 🔒 Requires permission: article:write. Gate UI with hasRequiredPermissions() from @vindentech/api-client.
68
68
  * @summary Update a tenant article
69
69
  */
70
70
  export const articlesControllerUpdateArticleV1 = async (id, updateArticleDto, options) => {
@@ -1534,20 +1534,36 @@ export interface UpdateOrgContactDto {
1534
1534
  companyName?: string;
1535
1535
  notes?: string;
1536
1536
  }
1537
- export type OrganizationDtoType = typeof OrganizationDtoType[keyof typeof OrganizationDtoType];
1538
- export declare const OrganizationDtoType: {
1537
+ export interface OrganizationOwnerDto {
1538
+ /** The member's user id (Keycloak subject). */
1539
+ sub: string;
1540
+ /** The member's role in the organization, e.g. `owner` or `org-admin`. */
1541
+ role: string;
1542
+ /** @nullable */
1543
+ displayName: string | null;
1544
+ /** @nullable */
1545
+ firstName: string | null;
1546
+ /** @nullable */
1547
+ lastName: string | null;
1548
+ /** @nullable */
1549
+ email: string | null;
1550
+ /** @nullable */
1551
+ phone: string | null;
1552
+ }
1553
+ export type OrganizationListItemDtoType = typeof OrganizationListItemDtoType[keyof typeof OrganizationListItemDtoType];
1554
+ export declare const OrganizationListItemDtoType: {
1539
1555
  readonly business: "business";
1540
1556
  readonly personal: "personal";
1541
1557
  };
1542
1558
  /**
1543
1559
  * @nullable
1544
1560
  */
1545
- export type OrganizationDtoMetadata = {
1561
+ export type OrganizationListItemDtoMetadata = {
1546
1562
  [key: string]: unknown;
1547
1563
  } | null;
1548
- export interface OrganizationDto {
1564
+ export interface OrganizationListItemDto {
1549
1565
  organizationId: string;
1550
- type: OrganizationDtoType;
1566
+ type: OrganizationListItemDtoType;
1551
1567
  name: string;
1552
1568
  slug: string;
1553
1569
  /** @nullable */
@@ -1560,13 +1576,18 @@ export interface OrganizationDto {
1560
1576
  */
1561
1577
  preferredLocale: string | null;
1562
1578
  /** @nullable */
1563
- metadata: OrganizationDtoMetadata;
1579
+ metadata: OrganizationListItemDtoMetadata;
1564
1580
  createdAt: string;
1565
1581
  updatedAt: string;
1582
+ /**
1583
+ * Who the organization belongs to, so an account nobody has named can be told apart without reading its members. null when the organization has no live member, and always null for a caller without `member:read` (the org-user roles org-orders, org-billing, org-viewer and member).
1584
+ * @nullable
1585
+ */
1586
+ owner: OrganizationOwnerDto | null;
1566
1587
  }
1567
1588
  export interface PaginatedOrganizationsDto {
1568
1589
  /** The page of rows. */
1569
- items: OrganizationDto[];
1590
+ items: OrganizationListItemDto[];
1570
1591
  /** Exact count of all rows matching the filter, pre-pagination (RLS-scoped). */
1571
1592
  total: number;
1572
1593
  /** Effective max rows applied (after defaults/clamp). */
@@ -1590,6 +1611,36 @@ export interface OrganizationStatsDto {
1590
1611
  /** Matching organizations grouped by type. A type with no matching organization is absent rather than zero. */
1591
1612
  byType: OrganizationTypeCountDto[];
1592
1613
  }
1614
+ export type OrganizationDtoType = typeof OrganizationDtoType[keyof typeof OrganizationDtoType];
1615
+ export declare const OrganizationDtoType: {
1616
+ readonly business: "business";
1617
+ readonly personal: "personal";
1618
+ };
1619
+ /**
1620
+ * @nullable
1621
+ */
1622
+ export type OrganizationDtoMetadata = {
1623
+ [key: string]: unknown;
1624
+ } | null;
1625
+ export interface OrganizationDto {
1626
+ organizationId: string;
1627
+ type: OrganizationDtoType;
1628
+ name: string;
1629
+ slug: string;
1630
+ /** @nullable */
1631
+ corporateIdentityNumber: string | null;
1632
+ /** @nullable */
1633
+ preferredWarehouseId: string | null;
1634
+ /**
1635
+ * The language this customer's messages are written in (order confirmations, storage notices). null = not stated: the language follows the country of the customer's billing account (SE → sv-SE, FI → fi-FI, otherwise en-GB). A language with no authored template falls back to en-GB, then sv-SE.
1636
+ * @nullable
1637
+ */
1638
+ preferredLocale: string | null;
1639
+ /** @nullable */
1640
+ metadata: OrganizationDtoMetadata;
1641
+ createdAt: string;
1642
+ updatedAt: string;
1643
+ }
1593
1644
  export type CreateOrganizationDtoType = typeof CreateOrganizationDtoType[keyof typeof CreateOrganizationDtoType];
1594
1645
  export declare const CreateOrganizationDtoType: {
1595
1646
  readonly business: "business";
@@ -8757,12 +8808,24 @@ export interface SendInvoiceResponseDto {
8757
8808
  /** The routing token enqueued for the Worker's InvoiceSendProcessor — derived from paymentProvider (manual → fortnox-email, stripe → stripe-payment). */
8758
8809
  rail: SendInvoiceResponseDtoRail;
8759
8810
  }
8811
+ export interface ArticleTranslationDto {
8812
+ /** @maxLength 80 */
8813
+ name: string;
8814
+ }
8815
+ export interface ArticleTranslationsDto {
8816
+ 'sv-SE'?: ArticleTranslationDto;
8817
+ 'en-GB'?: ArticleTranslationDto;
8818
+ 'fi-FI'?: ArticleTranslationDto;
8819
+ }
8760
8820
  export interface ArticleDto {
8761
8821
  articleId: string;
8762
8822
  /** @nullable */
8763
8823
  tenantId: string | null;
8764
8824
  code: string;
8825
+ /** The article's default name, and the text an invoice row starts with for a locale with no entry in `translations`. */
8765
8826
  name: string;
8827
+ /** The article's name per locale, keyed by BCP-47 tag (sv-SE, en-GB, fi-FI). `name` is the default: show `translations[locale]?.name ?? name`. The invoice pushes write the name in the invoice's language when the invoice is sent to Stripe or Fortnox, so a change reaches every invoice not yet sent and does not rewrite one already sent. `{}` when the article has no translations. */
8828
+ translations: ArticleTranslationsDto;
8766
8829
  /** @nullable */
8767
8830
  description: string | null;
8768
8831
  /** @nullable */
@@ -8778,9 +8841,30 @@ export interface ArticleDto {
8778
8841
  createdAt: string;
8779
8842
  updatedAt: string;
8780
8843
  }
8844
+ export interface ArticleTranslationInputDto {
8845
+ /**
8846
+ * The article's name in this locale.
8847
+ * @maxLength 80
8848
+ */
8849
+ name: string;
8850
+ }
8851
+ export interface ArticleTranslationsInputDto {
8852
+ /** @nullable */
8853
+ 'sv-SE'?: ArticleTranslationInputDto | null;
8854
+ /** @nullable */
8855
+ 'en-GB'?: ArticleTranslationInputDto | null;
8856
+ /** @nullable */
8857
+ 'fi-FI'?: ArticleTranslationInputDto | null;
8858
+ }
8781
8859
  export interface CreateArticleDto {
8782
8860
  code: string;
8861
+ /**
8862
+ * The default name, shown on an invoice row for a locale with no entry in `translations`.
8863
+ * @maxLength 80
8864
+ */
8783
8865
  name: string;
8866
+ /** The name per locale. A locale left out shows `name`. Omitted stores none. */
8867
+ translations?: ArticleTranslationsInputDto;
8784
8868
  description?: string;
8785
8869
  unit?: string;
8786
8870
  articleCategory?: string;
@@ -8793,7 +8877,13 @@ export interface CreateArticleDto {
8793
8877
  }
8794
8878
  export interface UpdateArticleDto {
8795
8879
  code?: string;
8880
+ /**
8881
+ * The default name, shown on an invoice row for a locale with no entry in `translations`.
8882
+ * @maxLength 80
8883
+ */
8796
8884
  name?: string;
8885
+ /** Replaces the article's per-locale names WHOLE: a locale left out loses its entry, and `{}` removes them all. Omitted leaves them alone. */
8886
+ translations?: ArticleTranslationsInputDto;
8797
8887
  description?: string;
8798
8888
  unit?: string;
8799
8889
  articleCategory?: string;
@@ -14038,7 +14128,7 @@ export type OrganizationsControllerListV1Params = {
14038
14128
  */
14039
14129
  type?: OrganizationsControllerListV1Type;
14040
14130
  /**
14041
- * Case-insensitive substring search over organization name and corporate identity number (orgnr) (accelerated by the pg_trgm GIN indexes)
14131
+ * Case-insensitive substring search. Always matches the organization name, its corporate identity number (orgnr) and, given a whole id, the organization id. For tenant staff with `member:read`, and platform-admin, it also matches any live member's email, display name, first name, last name, "first last", and phone, and the billing account's invoice email; the member matched need not be the one shown as `owner`. Other callers, org users included, are not matched on those fields.
14042
14132
  * @maxLength 200
14043
14133
  */
14044
14134
  search?: string;
@@ -14058,7 +14148,7 @@ export type OrganizationsControllerStatsV1Params = {
14058
14148
  */
14059
14149
  type?: OrganizationsControllerStatsV1Type;
14060
14150
  /**
14061
- * Case-insensitive substring search over organization name and corporate identity number (orgnr)
14151
+ * Case-insensitive substring search. Always matches the organization name, its corporate identity number (orgnr) and, given a whole id, the organization id. For tenant staff with `member:read`, and platform-admin, it also matches any live member's email, display name, first name, last name, "first last", and phone, and the billing account's invoice email; the member matched need not be the one shown as `owner`. Other callers, org users included, are not matched on those fields. Matches exactly what GET /v1/organizations matches for the same caller.
14062
14152
  * @maxLength 200
14063
14153
  */
14064
14154
  search?: string;