@incomy/platform-sdk 0.6.1-beta.2501 → 0.6.1-beta.2566

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.
@@ -24,9 +24,13 @@ export type { CompanyInsert } from './models/CompanyInsert';
24
24
  export type { CompanyPaginatedList } from './models/CompanyPaginatedList';
25
25
  export type { CurrencyInfo } from './models/CurrencyInfo';
26
26
  export type { Document } from './models/Document';
27
+ export type { DocumentEdit } from './models/DocumentEdit';
27
28
  export type { DocumentLinkRequest } from './models/DocumentLinkRequest';
29
+ export type { DocumentLinkTarget } from './models/DocumentLinkTarget';
30
+ export type { DocumentPaginatedList } from './models/DocumentPaginatedList';
28
31
  export type { DocumentUploadRequest } from './models/DocumentUploadRequest';
29
32
  export type { DocumentUploadTicket } from './models/DocumentUploadTicket';
33
+ export type { EventDocumentsEdit } from './models/EventDocumentsEdit';
30
34
  export type { Icon } from './models/Icon';
31
35
  export type { InputFieldDefinition } from './models/InputFieldDefinition';
32
36
  export type { Label } from './models/Label';
@@ -1,4 +1,5 @@
1
1
  import type { BucketBreakdown } from './BucketBreakdown';
2
+ import type { EventDocumentsEdit } from './EventDocumentsEdit';
2
3
  import type { Money } from './Money';
3
4
  import type { TemplateInfo } from './TemplateInfo';
4
5
  export type AccrualEdit = {
@@ -16,6 +17,7 @@ export type AccrualEdit = {
16
17
  * If provided, sets whether this accrual is expected to have an attached document (advisory). Null leaves it unchanged.
17
18
  */
18
19
  documentRequired?: boolean | null;
20
+ documents?: EventDocumentsEdit;
19
21
  /**
20
22
  * If null, the source is the Project itself.
21
23
  */
@@ -17,6 +17,12 @@ export type Document = {
17
17
  downloadUrl?: string | null;
18
18
  fileName: string;
19
19
  id: string;
20
+ /**
21
+ * Number of events (operations/accruals) this document is currently linked to. Populated on the project
22
+ * documents-library read so the UI can distinguish a linked document (> 0) from an unlinked library member
23
+ * (0). Not populated on the per-event list (it is always this event, so it stays 0 there).
24
+ */
25
+ linkedEventCount?: number;
20
26
  /**
21
27
  * Size of the binary in bytes.
22
28
  */
@@ -0,0 +1,6 @@
1
+ /**
2
+ * Editable document metadata — currently just its display file name (rename).
3
+ */
4
+ export type DocumentEdit = {
5
+ fileName: string;
6
+ };
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,10 @@
1
+ /**
2
+ * One live event a document is linked to — for showing / navigating to a document's attachments. Exactly
3
+ * one of the two ids is set (operation XOR accrual); Incomy.Platform.Hub.Models.DocumentLinkTarget.Name is that event's display name. Trashed
4
+ * events are excluded (you cannot navigate to them in the logbook).
5
+ */
6
+ export type DocumentLinkTarget = {
7
+ accrualId?: string | null;
8
+ name: string;
9
+ operationId?: string | null;
10
+ };
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,15 @@
1
+ import type { Document } from './Document';
2
+ export type DocumentPaginatedList = {
3
+ /**
4
+ * Results for the current query
5
+ */
6
+ items: Array<Document>;
7
+ /**
8
+ * Token item to start the next query from; Empty start from the beginning
9
+ */
10
+ next: string;
11
+ /**
12
+ * Estimated total count over all pages. -1 means the total count could not be determined.
13
+ */
14
+ totalCount?: number;
15
+ };
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,31 @@
1
+ import type { DocumentEdit } from './DocumentEdit';
2
+ /**
3
+ * Apply-on-save document changes carried inside an event edit (operation or accrual). Every member is optional and
4
+ * a null member leaves that aspect untouched, so an edit that omits the whole envelope changes nothing about the
5
+ * event's documents (backward compatible). Mirrors how a multievent carries its children in one payload: the entire
6
+ * set of document changes rides the single event PATCH and is applied server-side in that one request (link/unlink
7
+ * reconcile + rename + soft-delete), so the client never makes separate per-document calls.
8
+ */
9
+ export type EventDocumentsEdit = {
10
+ /**
11
+ * Documents to soft-delete into the Trash in this save — removing them from the library everywhere, not just
12
+ * this event (distinct from unlink, which keeps the document). Restorable from the Trash. Null or empty deletes
13
+ * nothing.
14
+ */
15
+ deleted?: Array<string> | null;
16
+ /**
17
+ * The desired final set of documents linked to this event. When non-null it is authoritative: an id in the set
18
+ * but not yet linked is linked; a document currently linked but absent from the set is unlinked (it stays in the
19
+ * project library). An empty list unlinks all. Null leaves the links unchanged. Each id must belong to the
20
+ * project; the per-event document limit applies. Ignored for a template-backed event (its documents come from
21
+ * the template's documents input).
22
+ */
23
+ ids?: Array<string> | null;
24
+ /**
25
+ * Metadata edits to apply in this save: document id -> the edited metadata (currently a rename via
26
+ * DocumentEdit.FileName). Applied to the project-library document, so the change is visible from every event it
27
+ * is linked to. Modelled as a DocumentEdit (not a bare string) so future editable document properties extend the
28
+ * payload without a breaking wire change. Null or empty edits nothing.
29
+ */
30
+ updates?: Record<string, DocumentEdit> | null;
31
+ };
@@ -0,0 +1 @@
1
+ export {};
@@ -2,5 +2,5 @@ export type InputFieldDefinition = {
2
2
  defaultValue?: string | null;
3
3
  id: string;
4
4
  name: string;
5
- type: 'string' | 'number' | 'boolean' | 'member' | 'bucket' | 'wallet' | 'currency';
5
+ type: 'string' | 'number' | 'boolean' | 'member' | 'bucket' | 'wallet' | 'currency' | 'documents';
6
6
  };
@@ -1,4 +1,5 @@
1
1
  import type { BucketBreakdown } from './BucketBreakdown';
2
+ import type { EventDocumentsEdit } from './EventDocumentsEdit';
2
3
  import type { Money } from './Money';
3
4
  import type { TemplateInfo } from './TemplateInfo';
4
5
  export type OperationEdit = {
@@ -11,6 +12,7 @@ export type OperationEdit = {
11
12
  * If provided, sets whether this operation is expected to have an attached document (advisory). Null leaves it unchanged.
12
13
  */
13
14
  documentRequired?: boolean | null;
15
+ documents?: EventDocumentsEdit;
14
16
  labelIds?: Array<string> | null;
15
17
  money?: Money;
16
18
  /**
@@ -2,6 +2,19 @@ import type { MoneyExpression } from './MoneyExpression';
2
2
  import type { TemplateBucketBreakdownDefinition } from './TemplateBucketBreakdownDefinition';
3
3
  export type TemplateAccrualDefinition = {
4
4
  bucketBreakdownDefinitions?: Array<TemplateBucketBreakdownDefinition> | null;
5
+ /**
6
+ * Optional expression evaluated to a bool at apply time; sets the created accrual's advisory
7
+ * Incomy.Platform.Hub.Models.Accrual.DocumentRequired flag. Empty/null ⇒ false. May bind a boolean input,
8
+ * e.g. "inputs.needsReceipt".
9
+ */
10
+ documentRequiredExpression?: string | null;
11
+ /**
12
+ * Optional expression evaluated to a list of project-document ids to attach to the created accrual at
13
+ * apply time, typically a bound Incomy.Platform.Hub.Models.FieldType.Documents input (e.g. "inputs.receipt"). Empty/null
14
+ * ⇒ none. Same upload-first-then-link flow as Incomy.Platform.Hub.Models.AccrualInsert.DocumentIds; the per-event
15
+ * document cap applies.
16
+ */
17
+ documentsExpression?: string | null;
5
18
  fromMemberIdExpression?: string | null;
6
19
  money: MoneyExpression;
7
20
  nameExpression: string;
@@ -2,6 +2,19 @@ import type { MoneyExpression } from './MoneyExpression';
2
2
  import type { TemplateBucketBreakdownDefinition } from './TemplateBucketBreakdownDefinition';
3
3
  export type TemplateOperationDefinition = {
4
4
  bucketBreakdownDefinitions?: Array<TemplateBucketBreakdownDefinition> | null;
5
+ /**
6
+ * Optional expression evaluated to a bool at apply time; sets the created operation's advisory
7
+ * Incomy.Platform.Hub.Models.Operation.DocumentRequired flag. Empty/null ⇒ false. May bind a boolean input,
8
+ * e.g. "inputs.needsReceipt".
9
+ */
10
+ documentRequiredExpression?: string | null;
11
+ /**
12
+ * Optional expression evaluated to a list of project-document ids to attach to the created operation at
13
+ * apply time, typically a bound Incomy.Platform.Hub.Models.FieldType.Documents input (e.g. "inputs.receipt"). Empty/null
14
+ * ⇒ none. Same upload-first-then-link flow as Incomy.Platform.Hub.Models.OperationInsert.DocumentIds; the per-event
15
+ * document cap applies.
16
+ */
17
+ documentsExpression?: string | null;
5
18
  money: MoneyExpression;
6
19
  nameExpression: string;
7
20
  originWalletIdExpression?: string | null;
@@ -1,19 +1,30 @@
1
1
  import type { Document } from '../models/Document';
2
+ import type { DocumentEdit } from '../models/DocumentEdit';
2
3
  import type { DocumentLinkRequest } from '../models/DocumentLinkRequest';
4
+ import type { DocumentLinkTarget } from '../models/DocumentLinkTarget';
5
+ import type { DocumentPaginatedList } from '../models/DocumentPaginatedList';
3
6
  import type { DocumentUploadRequest } from '../models/DocumentUploadRequest';
4
7
  import type { DocumentUploadTicket } from '../models/DocumentUploadTicket';
5
8
  import type { CancelablePromise } from '../core/CancelablePromise';
6
9
  export declare class ProjectDocumentsService {
7
10
  /**
8
- * Documents attached to an event supply exactly one of `operationId`/`accrualId`.
9
- * @returns Document OK
11
+ * List documents. With `operationId` OR `accrualId`: the documents attached to that event (returned as a
12
+ * single page). With neither: the whole project documents library, paginated and optionally filtered by a filename
13
+ * `query` (each item carries its `linkedEventCount`). Sorted by file name (`orderByName`) when set;
14
+ * otherwise by date added (`orderByDateAdded`, newest first by default). Supplying both event ids is a 400.
15
+ * @returns DocumentPaginatedList OK
10
16
  * @throws ApiError
11
17
  */
12
- static getProjectsDocuments({ projectId, operationId, accrualId, }: {
18
+ static getProjectsDocuments({ projectId, operationId, accrualId, query, orderByName, orderByDateAdded, limit, next, }: {
13
19
  projectId: string;
14
20
  operationId?: string;
15
21
  accrualId?: string;
16
- }): CancelablePromise<Array<Document>>;
22
+ query?: string;
23
+ orderByName?: 'Desc' | 'Asc';
24
+ orderByDateAdded?: 'Desc' | 'Asc';
25
+ limit?: number;
26
+ next?: string;
27
+ }): CancelablePromise<DocumentPaginatedList>;
17
28
  /**
18
29
  * @returns DocumentUploadTicket OK
19
30
  * @throws ApiError
@@ -40,12 +51,23 @@ export declare class ProjectDocumentsService {
40
51
  documentId: string;
41
52
  }): CancelablePromise<Document>;
42
53
  /**
54
+ * Edit a document's metadata (currently just its display file name).
43
55
  * @returns Document OK
44
56
  * @throws ApiError
45
57
  */
46
- static postProjectsDocumentsComplete({ projectId, documentId, }: {
58
+ static patchProjectsDocuments({ projectId, documentId, requestBody, }: {
47
59
  projectId: string;
48
60
  documentId: string;
61
+ requestBody?: DocumentEdit;
62
+ }): CancelablePromise<Document>;
63
+ /**
64
+ * @returns Document OK
65
+ * @throws ApiError
66
+ */
67
+ static postProjectsDocumentsComplete({ projectId, documentId, finalize, }: {
68
+ projectId: string;
69
+ documentId: string;
70
+ finalize?: boolean;
49
71
  }): CancelablePromise<Document>;
50
72
  /**
51
73
  * Detach a document from one event — supply exactly one of `operationId`/`accrualId`.
@@ -58,8 +80,19 @@ export declare class ProjectDocumentsService {
58
80
  operationId?: string;
59
81
  accrualId?: string;
60
82
  }): CancelablePromise<any>;
83
+ /**
84
+ * The live events (operations/accruals) this document is linked to, with their names — for showing and
85
+ * navigating to a document's attachments. Trashed events are excluded.
86
+ * @returns DocumentLinkTarget OK
87
+ * @throws ApiError
88
+ */
89
+ static getProjectsDocumentsLinks({ projectId, documentId, }: {
90
+ projectId: string;
91
+ documentId: string;
92
+ }): CancelablePromise<Array<DocumentLinkTarget>>;
61
93
  /**
62
94
  * Attach a document to an event (many-to-many) — the body sets exactly one of the two event ids.
95
+ * Rejected (409) on a template-created event: its documents are managed through the template's documents input.
63
96
  * @returns any OK
64
97
  * @throws ApiError
65
98
  */
@@ -2,11 +2,14 @@ import { OpenAPI } from '../core/OpenAPI';
2
2
  import { request as __request } from '../core/request';
3
3
  export class ProjectDocumentsService {
4
4
  /**
5
- * Documents attached to an event supply exactly one of `operationId`/`accrualId`.
6
- * @returns Document OK
5
+ * List documents. With `operationId` OR `accrualId`: the documents attached to that event (returned as a
6
+ * single page). With neither: the whole project documents library, paginated and optionally filtered by a filename
7
+ * `query` (each item carries its `linkedEventCount`). Sorted by file name (`orderByName`) when set;
8
+ * otherwise by date added (`orderByDateAdded`, newest first by default). Supplying both event ids is a 400.
9
+ * @returns DocumentPaginatedList OK
7
10
  * @throws ApiError
8
11
  */
9
- static getProjectsDocuments({ projectId, operationId, accrualId, }) {
12
+ static getProjectsDocuments({ projectId, operationId, accrualId, query, orderByName, orderByDateAdded, limit = 50, next, }) {
10
13
  return __request(OpenAPI, {
11
14
  method: 'GET',
12
15
  url: '/projects/{projectId}/documents',
@@ -16,6 +19,11 @@ export class ProjectDocumentsService {
16
19
  query: {
17
20
  'operationId': operationId,
18
21
  'accrualId': accrualId,
22
+ 'query': query,
23
+ 'orderByName': orderByName,
24
+ 'orderByDateAdded': orderByDateAdded,
25
+ 'limit': limit,
26
+ 'next': next,
19
27
  },
20
28
  });
21
29
  }
@@ -63,11 +71,28 @@ export class ProjectDocumentsService {
63
71
  },
64
72
  });
65
73
  }
74
+ /**
75
+ * Edit a document's metadata (currently just its display file name).
76
+ * @returns Document OK
77
+ * @throws ApiError
78
+ */
79
+ static patchProjectsDocuments({ projectId, documentId, requestBody, }) {
80
+ return __request(OpenAPI, {
81
+ method: 'PATCH',
82
+ url: '/projects/{projectId}/documents/{documentId}',
83
+ path: {
84
+ 'projectId': projectId,
85
+ 'documentId': documentId,
86
+ },
87
+ body: requestBody,
88
+ mediaType: 'application/json',
89
+ });
90
+ }
66
91
  /**
67
92
  * @returns Document OK
68
93
  * @throws ApiError
69
94
  */
70
- static postProjectsDocumentsComplete({ projectId, documentId, }) {
95
+ static postProjectsDocumentsComplete({ projectId, documentId, finalize, }) {
71
96
  return __request(OpenAPI, {
72
97
  method: 'POST',
73
98
  url: '/projects/{projectId}/documents/{documentId}/complete',
@@ -75,6 +100,9 @@ export class ProjectDocumentsService {
75
100
  'projectId': projectId,
76
101
  'documentId': documentId,
77
102
  },
103
+ query: {
104
+ 'finalize': finalize,
105
+ },
78
106
  });
79
107
  }
80
108
  /**
@@ -96,8 +124,25 @@ export class ProjectDocumentsService {
96
124
  },
97
125
  });
98
126
  }
127
+ /**
128
+ * The live events (operations/accruals) this document is linked to, with their names — for showing and
129
+ * navigating to a document's attachments. Trashed events are excluded.
130
+ * @returns DocumentLinkTarget OK
131
+ * @throws ApiError
132
+ */
133
+ static getProjectsDocumentsLinks({ projectId, documentId, }) {
134
+ return __request(OpenAPI, {
135
+ method: 'GET',
136
+ url: '/projects/{projectId}/documents/{documentId}/links',
137
+ path: {
138
+ 'projectId': projectId,
139
+ 'documentId': documentId,
140
+ },
141
+ });
142
+ }
99
143
  /**
100
144
  * Attach a document to an event (many-to-many) — the body sets exactly one of the two event ids.
145
+ * Rejected (409) on a template-created event: its documents are managed through the template's documents input.
101
146
  * @returns any OK
102
147
  * @throws ApiError
103
148
  */
package/meta.json CHANGED
@@ -1,11 +1,11 @@
1
1
  {
2
- "sdkVersion": "0.6.1-beta.2501",
3
- "generatedAt": "2026-07-16T21:50:08.266Z",
4
- "apiCommit": "1bd63c91",
5
- "pipelineUrl": "https://gitlab.com/incomy/platform/-/pipelines/2683078023",
2
+ "sdkVersion": "0.6.1-beta.2566",
3
+ "generatedAt": "2026-07-23T22:33:03.369Z",
4
+ "apiCommit": "75e19710",
5
+ "pipelineUrl": "https://gitlab.com/incomy/platform/-/pipelines/2701666425",
6
6
  "sources": {
7
7
  "hub": {
8
- "sha256": "c6182e4e8a190a63fe6f9427235c7b7704cd7fbbe28950285685a571dd0a018c"
8
+ "sha256": "cb2bd93078ce929375c991f45fd9fc8b24d88e3515aaa88dc2447c78262f7893"
9
9
  }
10
10
  }
11
11
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@incomy/platform-sdk",
3
- "version": "0.6.1-beta.2501",
3
+ "version": "0.6.1-beta.2566",
4
4
  "private": false,
5
5
  "type": "module",
6
6
  "files": [