Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@makeplane/plane-node-sdk",
"version": "0.3.0",
"version": "0.3.1",
"description": "Node SDK for Plane",
"author": "Plane <engineering@plane.so>",
"repository": {
Expand Down
43 changes: 26 additions & 17 deletions scripts/__fixtures__/types-bundle-exports.snapshot.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ root AddEpicWorkItems AddEpicWorkItems 1a7fcb98960f392a
root AddInitiativeEpicsRequest AddInitiativeEpicsRequest 1f9bd4f3adcdb4ba
root AddInitiativeLabelsRequest AddInitiativeLabelsRequest 4a3a7e57dd2157c0
root AddInitiativeProjectsRequest AddInitiativeProjectsRequest 53a0593ceff8cbd3
root AddInitiativeWorkItemsRequest AddInitiativeWorkItemsRequest f86b1aad08ab61ea
root AddReleaseItemLabel AddReleaseItemLabel 572875acd1554656
root AddReleaseWorkItems AddReleaseWorkItems 1d52f5148f2b617e
root AddTeamspaceMembersRequest AddTeamspaceMembersRequest e940c26eb5341c32
Expand Down Expand Up @@ -96,7 +97,7 @@ root CreateCollectionMember CreateCollectionMember d688f78bf4d913a2
root CreateCustomer CreateCustomer$1 fd9de350af2b072c
root CreateCustomerProperty CreateCustomerProperty 420db71864a79391
root CreateCustomerPropertyOption CreateCustomerPropertyOption e818442a4ce6c3a0
root CreateCustomerPropertyRequest CreateCustomerPropertyRequest 52ea388107f77ac4
root CreateCustomerPropertyRequest CreateCustomerPropertyRequest c5f32e591ff1043c
root CreateCustomerPropertyValues CreateCustomerPropertyValues da41ca7f5977895d
root CreateCustomerRequest CreateCustomerRequest$1 565f10415fc05cb5
root CreateCycle CreateCycle 23f0ebe512ec0384
Expand Down Expand Up @@ -171,14 +172,15 @@ root CustomerIds CustomerIds da099612e4d1ca99
root CustomerNavigation CustomerNavigation 3fcc0ea61d9a2865
root CustomerOrderBy CustomerOrderBy f7a9e1ab0c718d10
root CustomerProperties Properties 1d1c9c2934eb5b6d
root CustomerProperty CustomerProperty$1 b0f376acacc1899a
root CustomerProperty CustomerProperty$1 161e0d613d54fe4d
root CustomerPropertyField CustomerPropertyField 2c47c1217ab07847
root CustomerPropertyFieldsParams CustomerPropertyFieldsParams 10d3ef57db12a3bf
root CustomerPropertyOrderBy CustomerPropertyOrderBy dfdb2d89b5562988
root CustomerPropertyRelationType CustomerPropertyRelationType 2bfd7d84e1fefe5e
root CustomerPropertyType CustomerPropertyType bc8c90c3a66852ae
root CustomerPropertyType CustomerPropertyType$1 a6b1556bab3db81f
root CustomerPropertyValue CustomerPropertyValue fdc1e31a279eab61
root CustomerPropertyValuesMap CustomerPropertyValuesMap 2938d2ca1c056e61
root CustomerRelationType CustomerRelationType 8e3a8dcbf3f71a7e
root CustomerRequest CustomerRequest$1 874a4ddd78db455e
root CustomerRequestField CustomerRequestField b9db5f28b94dda8b
root CustomerRequestOrderBy CustomerRequestOrderBy c7f657f358bd2825
Expand Down Expand Up @@ -246,9 +248,10 @@ root InitiativeLabelShapeParams InitiativeLabelShapeParams 8216078f53b0a3c4
root InitiativeNavigation InitiativeNavigation b6d25992d3ffa107
root InitiativeOrderBy InitiativeOrderBy 14d95f84f079cbb4
root InitiativeProjects Projects$3 d4f6849dc8399f2c
root Initiatives Initiatives$1 61b33657c48439c5
root Initiatives Initiatives$1 6fc71b7e6d37d5a4
root InitiativeShapeParams InitiativeShapeParams e7f44418db729904
root InitiativeState InitiativeState$1 d5be5f442a985ecc
root InitiativeWorkItems WorkItems$2 8439a00256575c60
root Intake Intake c78459a12fde46c4
root IntakeWorkItem IntakeWorkItem$1 a54033b5c1d929fb
root IntakeWorkItemCreateRequest IntakeWorkItemCreateRequest b1f2db6caa073ad0
Expand Down Expand Up @@ -286,6 +289,7 @@ root ListGroupSyncProjectMappingsParams ListGroupSyncProjectMappingsParams 00a09
root ListGroupSyncWorkspaceMappingsParams ListGroupSyncWorkspaceMappingsParams ad5f3613b6d163ae
root ListInitiativeLabelsParams ListInitiativeLabelsParams$1 1f240d14b7dd66e4
root ListInitiativesParams ListInitiativesParams$1 a8adc5407126753e
root ListInitiativeWorkItemsParams ListInitiativeWorkItemsParams da1f25c4a3013844
root ListIntakeWorkItemsParams ListIntakeWorkItemsParams 6a0e589c4f8e87d4
root ListInvitationsParams ListInvitationsParams fcb36743411aade9
root ListLabelsParams ListLabelsParams$1 e67ed5e903ccc1b0
Expand Down Expand Up @@ -475,15 +479,15 @@ root Projects Projects$1 088f47c4abed128d
root ProjectShapeParams ProjectShapeParams f165757a25bd5926
root ProjectSummary ProjectSummary d65cc65ce9e01fe5
root ProjectSummaryCount ProjectSummaryCount a56d0cafb6046549
root ProjectTemplates ProjectTemplates b1e0bab17e0c95dc
root ProjectTemplates ProjectTemplates 5f9538bf1fe3fe4b
root ProjectTimezone ProjectTimezone 2af873c204b08948
root ProjectTypeWorkflow ProjectTypeWorkflow dcadb1ebcca53d7c
root ProjectTypeWorkflows ProjectWorkflows b7c56692cb749a18
root ProjectViewOrderBy ProjectViewOrderBy ad8cf1c8aef1ae5a
root ProjectWorkflowPickResult ProjectWorkflowPickResult 30eae8d7c955a00c
root ProjectWorkItemTemplates WorkItems$4 5ce2a347cfa3551a
root PropertyRelationType PropertyRelationType 5f402ef77ff8b22e
root PropertyType PropertyType 6cd58d6f37f54af9
root ProjectWorkItemTemplates WorkItems$5 e2b728d58c51ad5c
root PropertyRelationType PropertyRelationType 37a110acff15960e
root PropertyType PropertyType 51aae2d5a6908d1a
root Release Release$1 cf6bbf767217dc91
root ReleaseChangelog ReleaseChangelog$1 66538285fea72acc
root ReleaseChangelogResource Changelog$1 9ba6e3cb0b90f118
Expand All @@ -507,25 +511,28 @@ root ReleaseLinks Links$3 55229b3f4762953e
root ReleaseLinkShapeParams ReleaseLinkShapeParams ceb34e2325d893bd
root ReleaseNavigation ReleaseNavigation 58886251bbfe75d3
root ReleaseOrderBy ReleaseOrderBy a7f347071a76ae95
root Releases Releases$1 ba35112122cbd4b9
root Releases Releases$1 c848279647822021
root ReleaseStatus ReleaseStatus$1 6ff81d7c7dbd4413
root ReleaseStatusFilter ReleaseStatusFilter d7d8095303a2d206
root ReleaseTag ReleaseTag$1 0dd988c4efa89124
root ReleaseTagField ReleaseTagField 04b2d3c20f2d15cc
root ReleaseTagOrderBy ReleaseTagOrderBy 235fab9b00a78cd7
root ReleaseTags Tags 0e7155950d78390d
root ReleaseWorkItem ReleaseWorkItem 197e573f1a5b1c83
root ReleaseWorkItems WorkItems$3 5be6361eba6d2074
root ReleaseWorkItems WorkItems$4 281bfaf3c9f3401c
root RemoveCycleIssuesRequestRequest RemoveCycleIssuesRequestRequest 4f49b7fff51d6a19
root RemoveInitiativeEpicsRequest RemoveInitiativeEpicsRequest baad4f6ec5b883d3
root RemoveInitiativeLabelsRequest RemoveInitiativeLabelsRequest b5735e3f255e412c
root RemoveInitiativeProjectsRequest RemoveInitiativeProjectsRequest 57db26014fd0b23e
root RemoveInitiativeWorkItemsRequest RemoveInitiativeWorkItemsRequest 74a230e6752c6b73
root RemoveReleaseItemLabel RemoveReleaseItemLabel e773b24b75b94c9d
root RemoveReleaseWorkItems RemoveReleaseWorkItems bfbddac452d9649d
root RemoveTeamspaceMembersRequest RemoveTeamspaceMembersRequest 3fdb94634e5a0385
root RemoveTeamspaceProjectsRequest RemoveTeamspaceProjectsRequest 86bd33d72e7a34f6
root RemoveWorkspaceWorkflowState RemoveWorkspaceWorkflowState 0e9bf5130afa56f1
root ResponseEntity ResponseEntity f4502bde26dca136
root RichTextValue RichTextValue 5aa030d4c4208d7f
root RichTextValueDetail RichTextValueDetail 2ed03e51a72f7d0c
root Role Role$1 5dc96afcd19d6bb0
root RoleField RoleField 685a79b673e0226d
root RoleFieldsParams RoleFieldsParams 7b5e84b4cf0bece1
Expand Down Expand Up @@ -573,7 +580,7 @@ root UpdateCollectionMember UpdateCollectionMember 666db61788c83904
root UpdateCollectionPage UpdateCollectionPage f1ba419b598788d8
root UpdateCustomer UpdateCustomer$1 07514df5c6112dc4
root UpdateCustomerProperty UpdateCustomerProperty 58cdd9a89580f0e0
root UpdateCustomerPropertyRequest UpdateCustomerPropertyRequest e907cf34064f40a7
root UpdateCustomerPropertyRequest UpdateCustomerPropertyRequest 91caac25caa63141
root UpdateCustomerPropertyValue UpdateCustomerPropertyValue 60f25edbb6c8a557
root UpdateCustomerRequest UpdateCustomerRequest$1 9492d2887887f4bf
root UpdateCycle UpdateCycle d7a6321443f778fc
Expand Down Expand Up @@ -619,14 +626,14 @@ root UpdateWorkflow UpdateWorkflow$1 0929b3752ee0fe44
root UpdateWorkflowState UpdateWorkflowState$1 ecb713c892cf7421
root UpdateWorkflowTransition UpdateWorkflowTransition$1 9190e212b49f3955
root UpdateWorkflowTransitionHook UpdateWorkflowTransitionHook 5b56015072b853f6
root UpdateWorkItem UpdateWorkItem$1 77833463edc21c90
root UpdateWorkItem UpdateWorkItem$1 6a37c05e0699ba0b
root UpdateWorkItemAttachmentRequest UpdateWorkItemAttachmentRequest 22b4f17db1cfe987
root UpdateWorkItemComment UpdateWorkItemComment 4f6aaf6666082c30
root UpdateWorkItemLink UpdateWorkItemLink 67f7ea8ef968edfb
root UpdateWorkItemProperty UpdateWorkItemProperty$1 c062887b65f5eaa7
root UpdateWorkItemPropertyContext UpdateWorkItemPropertyContext b19d5a82a8ce76ef
root UpdateWorkItemPropertyOption UpdateWorkItemPropertyOption$1 6d23dbf98435bcec
root UpdateWorkItemPropertyValue UpdateWorkItemPropertyValue 223f7ca36e4bcee8
root UpdateWorkItemPropertyValue UpdateWorkItemPropertyValue 23b58c453ef01ec9
root UpdateWorkItemRelationDefinition UpdateWorkItemRelationDefinition$1 dad02a1ef882b7c4
root UpdateWorkItemTemplate UpdateWorkItemTemplate$1 856cdfea975105b7
root UpdateWorkItemType UpdateWorkItemType$1 7db0326070f3a59e
Expand Down Expand Up @@ -684,6 +691,7 @@ root V2CreateWorkItemTemplate CreateWorkItemTemplate 82d42c0b427052e8
root V2CreateWorkItemType CreateWorkItemType 6455106b39dd4b1d
root V2Customer Customer 89d52a530f3465fc
root V2CustomerProperty CustomerProperty 36edbe2c51ea4a4e
root V2CustomerPropertyType CustomerPropertyType 526e078c93f38f76
root V2CustomerRequest CustomerRequest 918f9ce3c12e4dab
root V2Cycle Cycle 0fbe8469e892070f
root V2Estimate Estimate 66f37d2b160c0e65
Expand Down Expand Up @@ -893,8 +901,9 @@ root WorkItemPropertySettings WorkItemPropertySettings 655ea56b1c16fdb3
root WorkItemPropertyShapeParams WorkItemPropertyShapeParams f6cfd6133817f659
root WorkItemPropertyType WorkItemPropertyType e60994cc895bf11c
root WorkItemPropertyValue WorkItemPropertyValue 91e586665aacbe28
root WorkItemPropertyValueDetail WorkItemPropertyValueDetail 2e9b50d3e0720448
root WorkItemPropertyValueMap WorkItemPropertyValues 685636134b0e4719
root WorkItemPropertyValues Values cb2abfa681e961da
root WorkItemPropertyValues Values 6df7f2214d886508
root WorkItemRelation WorkItemRelation 1b48e223ba35b073
root WorkItemRelationCreateRequest WorkItemRelationCreateRequest$1 18172f4acc699cd0
root WorkItemRelationDefinition WorkItemRelationDefinition$1 d217e346ff9547b4
Expand Down Expand Up @@ -983,7 +992,7 @@ root WorkspaceProjectStates WorkspaceProjectStates b62090f3daa94215
root WorkspaceProjectTemplate WorkspaceProjectTemplate 44e9b4a4f2108f7a
root WorkspaceProjectTemplates Projects$4 cd08047c8ba2bd05
root WorkspaceStates WorkspaceStates aaa1c34fc4c585b2
root WorkspaceTemplates WorkspaceTemplates e5c624f470f55546
root WorkspaceTemplates WorkspaceTemplates 38a3350046a5b258
root WorkspaceViewOrderBy WorkspaceViewOrderBy ea48a52e1e6e629d
root WorkspaceWorkflow WorkspaceWorkflow c6f13f923af229f1
root WorkspaceWorkflows WorkspaceWorkflows 68b5cca36b2e6514
Expand All @@ -1007,7 +1016,7 @@ root WorkspaceWorkItemTemplate WorkspaceWorkItemTemplate 353773bbf7425bbf
root WorkspaceWorkItemTemplateField WorkspaceWorkItemTemplateField ebccf9986a66dcd6
root WorkspaceWorkItemTemplateFieldsParams WorkspaceWorkItemTemplateFieldsParams ee15d91efcc41baf
root WorkspaceWorkItemTemplateOrderBy WorkspaceWorkItemTemplateOrderBy 96cf8171f05f86e8
root WorkspaceWorkItemTemplates WorkItems$2 e41f16d6ba508918
root WorkspaceWorkItemTemplates WorkItems$3 0dbd4bbf71e4299c
root WorkspaceWorkItemTypeIds WorkspaceWorkItemTypeIds 3dc8ddaa2f4b2030
root WorkspaceWorkItemTypeNavigation WorkspaceWorkItemTypeNavigation a8daaff83f39f30a
root WorkspaceWorkItemTypeProperties Properties$1 b6f1cc8592d0b98a
Expand Down Expand Up @@ -1542,7 +1551,7 @@ v2models CursorPage CursorPage fcc2a5033696f854
v2models Customer Customer 89d52a530f3465fc
v2models CustomerProperty CustomerProperty 36edbe2c51ea4a4e
v2models CustomerPropertyRelationType CustomerPropertyRelationType 2bfd7d84e1fefe5e
v2models CustomerPropertyType CustomerPropertyType bc8c90c3a66852ae
v2models CustomerPropertyType CustomerPropertyType 526e078c93f38f76
v2models CustomerPropertyValuesMap CustomerPropertyValuesMap 2938d2ca1c056e61
v2models CustomerRequest CustomerRequest 918f9ce3c12e4dab
v2models Cycle Cycle 0fbe8469e892070f
Expand Down
7 changes: 6 additions & 1 deletion src/api/Initiatives/Epics.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,12 @@ import { AddInitiativeEpicsRequest, RemoveInitiativeEpicsRequest } from "../../m

/**
* Initiative Epics API resource
* Handles initiative epic relationships
*
* @deprecated Use `client.initiatives.workItems`. The `/epics/` endpoints are preserved
* for backward compatibility. Server-side they share one implementation and one
* association model with `/work-items/`, so any work item type is accepted and returned
* here despite the name; the request field is spelled `epic_ids` only because it
* predates the unified model.
*/
export class Epics extends BaseResource {
constructor(config: Configuration) {
Expand Down
67 changes: 67 additions & 0 deletions src/api/Initiatives/WorkItems.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
import { BaseResource } from "../BaseResource";
import { Configuration } from "../../Configuration";
import { WorkItem } from "../../models/WorkItem";
import { PaginatedResponse } from "../../models/common";
import {
AddInitiativeWorkItemsRequest,
ListInitiativeWorkItemsParams,
RemoveInitiativeWorkItemsRequest,
} from "../../models/Initiative";

/**
* Initiative Work Items API resource
* Handles the work items associated with an initiative.
*
* This is the successor to `client.initiatives.epics`. The two surfaces share one implementation
* server-side and one association model, so they behave identically; they differ only
* in the URL and in the request field name (`work_item_ids` here, `epic_ids` there).
* Any work item type is accepted -- the `/epics/` spelling reflects the old Epic-only
* model and is deprecated.
*/
export class WorkItems extends BaseResource {
constructor(config: Configuration) {
super(config);
}

/**
* List the work items associated with an initiative (paginated).
*
* Returns one page (20 by default). Pass `per_page`/`cursor` and follow
* `next_cursor` to page through the rest.
*/
async list(
workspaceSlug: string,
initiativeId: string,
params?: ListInitiativeWorkItemsParams
): Promise<PaginatedResponse<WorkItem>> {
return this.get<PaginatedResponse<WorkItem>>(
`/workspaces/${workspaceSlug}/initiatives/${initiativeId}/work-items/`,
params
);
}

/**
* Associate work items with an initiative.
*
* Work items already associated are skipped. The response covers every id
* requested, not only the newly added ones.
*/
async add(
workspaceSlug: string,
initiativeId: string,
addWorkItems: AddInitiativeWorkItemsRequest
): Promise<WorkItem[]> {
return this.post<WorkItem[]>(`/workspaces/${workspaceSlug}/initiatives/${initiativeId}/work-items/`, addWorkItems);
}

/**
* Remove work items from an initiative
*/
async remove(
workspaceSlug: string,
initiativeId: string,
removeWorkItems: RemoveInitiativeWorkItemsRequest
): Promise<void> {
return this.httpDelete(`/workspaces/${workspaceSlug}/initiatives/${initiativeId}/work-items/`, removeWorkItems);
}
}
4 changes: 4 additions & 0 deletions src/api/Initiatives/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import { PaginatedResponse } from "../../models/common";
import { Labels } from "./Labels";
import { Projects } from "./Projects";
import { Epics } from "./Epics";
import { WorkItems } from "./WorkItems";

/**
* Initiatives API resource
Expand All @@ -13,12 +14,15 @@ import { Epics } from "./Epics";
export class Initiatives extends BaseResource {
public labels: Labels;
public projects: Projects;
public workItems: WorkItems;
/** @deprecated Use {@link Initiatives.workItems}; it accepts every work item type. */
public epics: Epics;

constructor(config: Configuration) {
super(config);
this.labels = new Labels(config);
this.projects = new Projects(config);
this.workItems = new WorkItems(config);
this.epics = new Epics(config);
}

Expand Down
26 changes: 17 additions & 9 deletions src/api/WorkItemProperties/Values.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import { Configuration } from "../../Configuration";
import {
UpdateWorkItemPropertyValue,
ListWorkItemPropertyValuesParams,
WorkItemPropertyValueDetail,
WorkItemPropertyValues,
} from "../../models/WorkItemProperty";

Expand All @@ -16,15 +17,19 @@ export class Values extends BaseResource {
}

/**
* Retrieve a property value by ID
* Retrieve a work item's value(s) for one property
*
* Answers a single value, or a list when the property holds more than one
* (multi-select, or a cascading property's levels). A rich text value carries its
* HTML in `value_detail`; its `value` is the ID of the stored content.
*/
async retrieve(
workspaceSlug: string,
projectId: string,
workItemId: string,
propertyId: string
): Promise<WorkItemPropertyValues> {
const propertyValues = await this.get<WorkItemPropertyValues>(
): Promise<WorkItemPropertyValueDetail | WorkItemPropertyValueDetail[]> {
const propertyValues = await this.get<WorkItemPropertyValueDetail | WorkItemPropertyValueDetail[]>(
`/workspaces/${workspaceSlug}/projects/${projectId}/work-items/${workItemId}/work-item-properties/${propertyId}/values/`
);
return propertyValues;
Expand All @@ -48,9 +53,12 @@ export class Values extends BaseResource {
/**
* Create/update a property value
*
* A rich text property (`relation_type: "RICH_TEXT"`) takes a `RichTextValue`
* object, not a bare HTML string.
*
* For single-value properties:
* - Acts as an upsert operation (create or update)
* - Returns a single WorkItemPropertyValues
* - Returns a single WorkItemPropertyValueDetail
*
* For multi-value properties (is_multi=True):
* - Replaces all existing values with the new ones (sync operation)
Expand All @@ -62,8 +70,8 @@ export class Values extends BaseResource {
workItemId: string,
propertyId: string,
updateData: UpdateWorkItemPropertyValue
): Promise<WorkItemPropertyValues> {
return this.post<WorkItemPropertyValues>(
): Promise<WorkItemPropertyValueDetail | WorkItemPropertyValueDetail[]> {
return this.post<WorkItemPropertyValueDetail | WorkItemPropertyValueDetail[]>(
`/workspaces/${workspaceSlug}/projects/${projectId}/work-items/${workItemId}/work-item-properties/${propertyId}/values/`,
updateData
);
Expand All @@ -74,7 +82,7 @@ export class Values extends BaseResource {
*
* For single-value properties:
* - Updates the existing value
* - Returns a single WorkItemPropertyValues
* - Returns a single WorkItemPropertyValueDetail
*
* For multi-value properties (is_multi=True):
* - Replaces all existing values with the new ones (sync operation)
Expand All @@ -88,8 +96,8 @@ export class Values extends BaseResource {
workItemId: string,
propertyId: string,
updateData: UpdateWorkItemPropertyValue
): Promise<WorkItemPropertyValues> {
return this.patch<WorkItemPropertyValues>(
): Promise<WorkItemPropertyValueDetail | WorkItemPropertyValueDetail[]> {
return this.patch<WorkItemPropertyValueDetail | WorkItemPropertyValueDetail[]>(
`/workspaces/${workspaceSlug}/projects/${projectId}/work-items/${workItemId}/work-item-properties/${propertyId}/values/`,
updateData
);
Expand Down
Loading
Loading