@shortcut/client 1.1.0 → 2.1.0

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.
@@ -0,0 +1,62 @@
1
+ import { AxiosInstance, AxiosRequestConfig, AxiosResponse, ResponseType } from "axios";
2
+
3
+ //#region src/generated/http-client.d.ts
4
+ type QueryParamsType = Record<string | number, any>;
5
+ interface FullRequestParams extends Omit<AxiosRequestConfig, "data" | "params" | "url" | "responseType"> {
6
+ /** set parameter to `true` for call `securityWorker` for this request */
7
+ secure?: boolean;
8
+ /** request path */
9
+ path: string;
10
+ /** content type of request body */
11
+ type?: ContentType;
12
+ /** query params */
13
+ query?: QueryParamsType;
14
+ /** format of response (i.e. response.json() -> format: "json") */
15
+ format?: ResponseType;
16
+ /** request body */
17
+ body?: unknown;
18
+ }
19
+ type RequestParams = Omit<FullRequestParams, "body" | "method" | "query" | "path">;
20
+ interface ApiConfig<SecurityDataType = unknown> extends Omit<AxiosRequestConfig, "data" | "cancelToken"> {
21
+ securityWorker?: (securityData: SecurityDataType | null) => Promise<AxiosRequestConfig | void> | AxiosRequestConfig | void;
22
+ secure?: boolean;
23
+ format?: ResponseType;
24
+ }
25
+ declare enum ContentType {
26
+ Json = "application/json",
27
+ FormData = "multipart/form-data",
28
+ UrlEncoded = "application/x-www-form-urlencoded",
29
+ Text = "text/plain",
30
+ }
31
+ /**
32
+ * @internal
33
+ * @private
34
+ */
35
+ declare class HttpClient<SecurityDataType = unknown> {
36
+ instance: AxiosInstance;
37
+ private securityData;
38
+ private securityWorker?;
39
+ private secure?;
40
+ private format?;
41
+ constructor({
42
+ securityWorker,
43
+ secure,
44
+ format,
45
+ ...axiosConfig
46
+ }?: ApiConfig<SecurityDataType>);
47
+ setSecurityData: (data: SecurityDataType | null) => void;
48
+ protected mergeRequestParams(params1: AxiosRequestConfig, params2?: AxiosRequestConfig): AxiosRequestConfig;
49
+ protected stringifyFormItem(formItem: unknown): string;
50
+ protected createFormData(input: Record<string, unknown>): FormData;
51
+ request: <T = any, _E = any>({
52
+ secure,
53
+ path,
54
+ type,
55
+ query,
56
+ format,
57
+ body,
58
+ ...params
59
+ }: FullRequestParams) => Promise<AxiosResponse<T>>;
60
+ }
61
+ //#endregion
62
+ export { ApiConfig, HttpClient, RequestParams };
@@ -1,45 +1,62 @@
1
- import type { AxiosInstance, AxiosRequestConfig, AxiosResponse, ResponseType } from 'axios';
2
- export type QueryParamsType = Record<string | number, any>;
3
- export interface FullRequestParams extends Omit<AxiosRequestConfig, 'data' | 'params' | 'url' | 'responseType'> {
4
- /** set parameter to `true` for call `securityWorker` for this request */
5
- secure?: boolean;
6
- /** request path */
7
- path: string;
8
- /** content type of request body */
9
- type?: ContentType;
10
- /** query params */
11
- query?: QueryParamsType;
12
- /** format of response (i.e. response.json() -> format: "json") */
13
- format?: ResponseType;
14
- /** request body */
15
- body?: unknown;
1
+ import { AxiosInstance, AxiosRequestConfig, AxiosResponse, ResponseType } from "axios";
2
+
3
+ //#region src/generated/http-client.d.ts
4
+ type QueryParamsType = Record<string | number, any>;
5
+ interface FullRequestParams extends Omit<AxiosRequestConfig, "data" | "params" | "url" | "responseType"> {
6
+ /** set parameter to `true` for call `securityWorker` for this request */
7
+ secure?: boolean;
8
+ /** request path */
9
+ path: string;
10
+ /** content type of request body */
11
+ type?: ContentType;
12
+ /** query params */
13
+ query?: QueryParamsType;
14
+ /** format of response (i.e. response.json() -> format: "json") */
15
+ format?: ResponseType;
16
+ /** request body */
17
+ body?: unknown;
16
18
  }
17
- export type RequestParams = Omit<FullRequestParams, 'body' | 'method' | 'query' | 'path'>;
18
- export interface ApiConfig<SecurityDataType = unknown> extends Omit<AxiosRequestConfig, 'data' | 'cancelToken'> {
19
- securityWorker?: (securityData: SecurityDataType | null) => Promise<AxiosRequestConfig | void> | AxiosRequestConfig | void;
20
- secure?: boolean;
21
- format?: ResponseType;
19
+ type RequestParams = Omit<FullRequestParams, "body" | "method" | "query" | "path">;
20
+ interface ApiConfig<SecurityDataType = unknown> extends Omit<AxiosRequestConfig, "data" | "cancelToken"> {
21
+ securityWorker?: (securityData: SecurityDataType | null) => Promise<AxiosRequestConfig | void> | AxiosRequestConfig | void;
22
+ secure?: boolean;
23
+ format?: ResponseType;
22
24
  }
23
- export declare enum ContentType {
24
- Json = "application/json",
25
- FormData = "multipart/form-data",
26
- UrlEncoded = "application/x-www-form-urlencoded",
27
- Text = "text/plain"
25
+ declare enum ContentType {
26
+ Json = "application/json",
27
+ FormData = "multipart/form-data",
28
+ UrlEncoded = "application/x-www-form-urlencoded",
29
+ Text = "text/plain",
28
30
  }
29
31
  /**
30
32
  * @internal
31
33
  * @private
32
34
  */
33
- export declare class HttpClient<SecurityDataType = unknown> {
34
- instance: AxiosInstance;
35
- private securityData;
36
- private securityWorker?;
37
- private secure?;
38
- private format?;
39
- constructor({ securityWorker, secure, format, ...axiosConfig }?: ApiConfig<SecurityDataType>);
40
- setSecurityData: (data: SecurityDataType | null) => void;
41
- protected mergeRequestParams(params1: AxiosRequestConfig, params2?: AxiosRequestConfig): AxiosRequestConfig;
42
- protected stringifyFormItem(formItem: unknown): string;
43
- protected createFormData(input: Record<string, unknown>): FormData;
44
- request: <T = any, _E = any>({ secure, path, type, query, format, body, ...params }: FullRequestParams) => Promise<AxiosResponse<T, any>>;
35
+ declare class HttpClient<SecurityDataType = unknown> {
36
+ instance: AxiosInstance;
37
+ private securityData;
38
+ private securityWorker?;
39
+ private secure?;
40
+ private format?;
41
+ constructor({
42
+ securityWorker,
43
+ secure,
44
+ format,
45
+ ...axiosConfig
46
+ }?: ApiConfig<SecurityDataType>);
47
+ setSecurityData: (data: SecurityDataType | null) => void;
48
+ protected mergeRequestParams(params1: AxiosRequestConfig, params2?: AxiosRequestConfig): AxiosRequestConfig;
49
+ protected stringifyFormItem(formItem: unknown): string;
50
+ protected createFormData(input: Record<string, unknown>): FormData;
51
+ request: <T = any, _E = any>({
52
+ secure,
53
+ path,
54
+ type,
55
+ query,
56
+ format,
57
+ body,
58
+ ...params
59
+ }: FullRequestParams) => Promise<AxiosResponse<T>>;
45
60
  }
61
+ //#endregion
62
+ export { ApiConfig, HttpClient, RequestParams };
@@ -1,98 +1,84 @@
1
- "use strict";
2
- /* eslint-disable */
3
- /* tslint:disable */
4
- /*
5
- * ---------------------------------------------------------------
6
- * ## THIS FILE WAS GENERATED VIA SWAGGER-TYPESCRIPT-API ##
7
- * ## ##
8
- * ## AUTHOR: acacode ##
9
- * ## SOURCE: https://github.com/acacode/swagger-typescript-api ##
10
- * ---------------------------------------------------------------
11
- */
12
- var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
13
- function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
14
- return new (P || (P = Promise))(function (resolve, reject) {
15
- function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
16
- function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
17
- function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
18
- step((generator = generator.apply(thisArg, _arguments || [])).next());
19
- });
1
+ const require_rolldown_runtime = require('../_virtual/rolldown_runtime.js');
2
+ const axios = require_rolldown_runtime.__toESM(require("axios"));
3
+
4
+ //#region src/generated/http-client.ts
5
+ let ContentType = /* @__PURE__ */ function(ContentType$1) {
6
+ ContentType$1["Json"] = "application/json";
7
+ ContentType$1["FormData"] = "multipart/form-data";
8
+ ContentType$1["UrlEncoded"] = "application/x-www-form-urlencoded";
9
+ ContentType$1["Text"] = "text/plain";
10
+ return ContentType$1;
11
+ }({});
12
+ /**
13
+ * @internal
14
+ * @private
15
+ */
16
+ var HttpClient = class {
17
+ instance;
18
+ securityData = null;
19
+ securityWorker;
20
+ secure;
21
+ format;
22
+ constructor({ securityWorker, secure, format,...axiosConfig } = {}) {
23
+ this.instance = axios.default.create({
24
+ ...axiosConfig,
25
+ baseURL: axiosConfig.baseURL || "https://api.app.shortcut.com"
26
+ });
27
+ this.secure = secure;
28
+ this.format = format;
29
+ this.securityWorker = securityWorker;
30
+ }
31
+ setSecurityData = (data) => {
32
+ this.securityData = data;
33
+ };
34
+ mergeRequestParams(params1, params2) {
35
+ const method = params1.method || params2 && params2.method;
36
+ return {
37
+ ...this.instance.defaults,
38
+ ...params1,
39
+ ...params2 || {},
40
+ headers: {
41
+ ...method && this.instance.defaults.headers[method.toLowerCase()] || {},
42
+ ...params1.headers || {},
43
+ ...params2 && params2.headers || {}
44
+ }
45
+ };
46
+ }
47
+ stringifyFormItem(formItem) {
48
+ if (typeof formItem === "object" && formItem !== null) return JSON.stringify(formItem);
49
+ else return `${formItem}`;
50
+ }
51
+ createFormData(input) {
52
+ return Object.keys(input || {}).reduce((formData, key) => {
53
+ const property = input[key];
54
+ const propertyContent = property instanceof Array ? property : [property];
55
+ for (const formItem of propertyContent) {
56
+ const isFileType = formItem instanceof Blob;
57
+ formData.append(key, isFileType ? formItem : this.stringifyFormItem(formItem));
58
+ }
59
+ return formData;
60
+ }, new FormData());
61
+ }
62
+ request = async ({ secure, path, type, query, format, body,...params }) => {
63
+ const secureParams = (typeof secure === "boolean" ? secure : this.secure) && this.securityWorker && await this.securityWorker(this.securityData) || {};
64
+ const requestParams = this.mergeRequestParams(params, secureParams);
65
+ const responseFormat = format || this.format || void 0;
66
+ if (type === ContentType.FormData && body && body !== null && typeof body === "object") body = this.createFormData(body);
67
+ if (type === ContentType.Text && body && body !== null && typeof body !== "string") body = JSON.stringify(body);
68
+ return this.instance.request({
69
+ ...requestParams,
70
+ headers: {
71
+ ...requestParams.headers || {},
72
+ ...type && type !== ContentType.FormData ? { "Content-Type": type } : {}
73
+ },
74
+ params: query,
75
+ responseType: responseFormat,
76
+ data: body,
77
+ url: path
78
+ });
79
+ };
20
80
  };
21
- var __rest = (this && this.__rest) || function (s, e) {
22
- var t = {};
23
- for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
24
- t[p] = s[p];
25
- if (s != null && typeof Object.getOwnPropertySymbols === "function")
26
- for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
27
- if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
28
- t[p[i]] = s[p[i]];
29
- }
30
- return t;
31
- };
32
- Object.defineProperty(exports, "__esModule", { value: true });
33
- exports.HttpClient = exports.ContentType = void 0;
34
- const axios_1 = require("axios");
35
- var ContentType;
36
- (function (ContentType) {
37
- ContentType["Json"] = "application/json";
38
- ContentType["FormData"] = "multipart/form-data";
39
- ContentType["UrlEncoded"] = "application/x-www-form-urlencoded";
40
- ContentType["Text"] = "text/plain";
41
- })(ContentType || (exports.ContentType = ContentType = {}));
42
- /**
43
- * @internal
44
- * @private
45
- */
46
- class HttpClient {
47
- constructor(_a = {}) {
48
- var { securityWorker, secure, format } = _a, axiosConfig = __rest(_a, ["securityWorker", "secure", "format"]);
49
- this.securityData = null;
50
- this.setSecurityData = (data) => {
51
- this.securityData = data;
52
- };
53
- this.request = (_b) => __awaiter(this, void 0, void 0, function* () {
54
- var { secure, path, type, query, format, body } = _b, params = __rest(_b, ["secure", "path", "type", "query", "format", "body"]);
55
- const secureParams = ((typeof secure === 'boolean' ? secure : this.secure) &&
56
- this.securityWorker &&
57
- (yield this.securityWorker(this.securityData))) ||
58
- {};
59
- const requestParams = this.mergeRequestParams(params, secureParams);
60
- const responseFormat = format || this.format || undefined;
61
- if (type === ContentType.FormData && body && body !== null && typeof body === 'object') {
62
- body = this.createFormData(body);
63
- }
64
- if (type === ContentType.Text && body && body !== null && typeof body !== 'string') {
65
- body = JSON.stringify(body);
66
- }
67
- return this.instance.request(Object.assign(Object.assign({}, requestParams), { headers: Object.assign(Object.assign({}, (requestParams.headers || {})), (type && type !== ContentType.FormData ? { 'Content-Type': type } : {})), params: query, responseType: responseFormat, data: body, url: path }));
68
- });
69
- this.instance = axios_1.default.create(Object.assign(Object.assign({}, axiosConfig), { baseURL: axiosConfig.baseURL || 'https://api.app.shortcut.com' }));
70
- this.secure = secure;
71
- this.format = format;
72
- this.securityWorker = securityWorker;
73
- }
74
- mergeRequestParams(params1, params2) {
75
- const method = params1.method || (params2 && params2.method);
76
- return Object.assign(Object.assign(Object.assign(Object.assign({}, this.instance.defaults), params1), (params2 || {})), { headers: Object.assign(Object.assign(Object.assign({}, ((method && this.instance.defaults.headers[method.toLowerCase()]) || {})), (params1.headers || {})), ((params2 && params2.headers) || {})) });
77
- }
78
- stringifyFormItem(formItem) {
79
- if (typeof formItem === 'object' && formItem !== null) {
80
- return JSON.stringify(formItem);
81
- }
82
- else {
83
- return `${formItem}`;
84
- }
85
- }
86
- createFormData(input) {
87
- return Object.keys(input || {}).reduce((formData, key) => {
88
- const property = input[key];
89
- const propertyContent = property instanceof Array ? property : [property];
90
- for (const formItem of propertyContent) {
91
- const isFileType = formItem instanceof Blob;
92
- formData.append(key, isFileType ? formItem : this.stringifyFormItem(formItem));
93
- }
94
- return formData;
95
- }, new FormData());
96
- }
97
- }
98
- exports.HttpClient = HttpClient;
81
+
82
+ //#endregion
83
+ exports.ContentType = ContentType;
84
+ exports.HttpClient = HttpClient;
@@ -0,0 +1,82 @@
1
+ import axios from "axios";
2
+
3
+ //#region src/generated/http-client.ts
4
+ let ContentType = /* @__PURE__ */ function(ContentType$1) {
5
+ ContentType$1["Json"] = "application/json";
6
+ ContentType$1["FormData"] = "multipart/form-data";
7
+ ContentType$1["UrlEncoded"] = "application/x-www-form-urlencoded";
8
+ ContentType$1["Text"] = "text/plain";
9
+ return ContentType$1;
10
+ }({});
11
+ /**
12
+ * @internal
13
+ * @private
14
+ */
15
+ var HttpClient = class {
16
+ instance;
17
+ securityData = null;
18
+ securityWorker;
19
+ secure;
20
+ format;
21
+ constructor({ securityWorker, secure, format,...axiosConfig } = {}) {
22
+ this.instance = axios.create({
23
+ ...axiosConfig,
24
+ baseURL: axiosConfig.baseURL || "https://api.app.shortcut.com"
25
+ });
26
+ this.secure = secure;
27
+ this.format = format;
28
+ this.securityWorker = securityWorker;
29
+ }
30
+ setSecurityData = (data) => {
31
+ this.securityData = data;
32
+ };
33
+ mergeRequestParams(params1, params2) {
34
+ const method = params1.method || params2 && params2.method;
35
+ return {
36
+ ...this.instance.defaults,
37
+ ...params1,
38
+ ...params2 || {},
39
+ headers: {
40
+ ...method && this.instance.defaults.headers[method.toLowerCase()] || {},
41
+ ...params1.headers || {},
42
+ ...params2 && params2.headers || {}
43
+ }
44
+ };
45
+ }
46
+ stringifyFormItem(formItem) {
47
+ if (typeof formItem === "object" && formItem !== null) return JSON.stringify(formItem);
48
+ else return `${formItem}`;
49
+ }
50
+ createFormData(input) {
51
+ return Object.keys(input || {}).reduce((formData, key) => {
52
+ const property = input[key];
53
+ const propertyContent = property instanceof Array ? property : [property];
54
+ for (const formItem of propertyContent) {
55
+ const isFileType = formItem instanceof Blob;
56
+ formData.append(key, isFileType ? formItem : this.stringifyFormItem(formItem));
57
+ }
58
+ return formData;
59
+ }, new FormData());
60
+ }
61
+ request = async ({ secure, path, type, query, format, body,...params }) => {
62
+ const secureParams = (typeof secure === "boolean" ? secure : this.secure) && this.securityWorker && await this.securityWorker(this.securityData) || {};
63
+ const requestParams = this.mergeRequestParams(params, secureParams);
64
+ const responseFormat = format || this.format || void 0;
65
+ if (type === ContentType.FormData && body && body !== null && typeof body === "object") body = this.createFormData(body);
66
+ if (type === ContentType.Text && body && body !== null && typeof body !== "string") body = JSON.stringify(body);
67
+ return this.instance.request({
68
+ ...requestParams,
69
+ headers: {
70
+ ...requestParams.headers || {},
71
+ ...type && type !== ContentType.FormData ? { "Content-Type": type } : {}
72
+ },
73
+ params: query,
74
+ responseType: responseFormat,
75
+ data: body,
76
+ url: path
77
+ });
78
+ };
79
+ };
80
+
81
+ //#endregion
82
+ export { ContentType, HttpClient };
@@ -0,0 +1,3 @@
1
+ import { BaseTaskParams, BasicWorkspaceInfo, Branch, Category, Commit, CreateCategory, CreateCategoryParams, CreateCommentComment, CreateDoc, CreateEntityTemplate, CreateEpic, CreateEpicComment, CreateEpicHealth, CreateGenericIntegration, CreateGroup, CreateIteration, CreateLabelParams, CreateLinkedFile, CreateMilestone, CreateObjective, CreateOrDeleteStoryReaction, CreateProject, CreateStories, CreateStoryComment, CreateStoryCommentParams, CreateStoryContents, CreateStoryFromTemplateParams, CreateStoryLink, CreateStoryLinkParams, CreateStoryParams, CreateSubTaskParams, CreateTask, CreateTaskParams, CustomField, CustomFieldEnumValue, CustomFieldValueParams, DataConflictError, DeleteStories, DisabledFeatureError, DocSlim, EntityTemplate, Epic, EpicAssociatedGroup, EpicPaginatedResults, EpicSearchResult, EpicSearchResults, EpicSlim, EpicState, EpicStats, EpicWorkflow, Group, Health, History, HistoryActionBranchCreate, HistoryActionBranchMerge, HistoryActionBranchPush, HistoryActionLabelCreate, HistoryActionLabelDelete, HistoryActionLabelUpdate, HistoryActionProjectUpdate, HistoryActionPullRequest, HistoryActionStoryCommentCreate, HistoryActionStoryCreate, HistoryActionStoryDelete, HistoryActionStoryLinkCreate, HistoryActionStoryLinkDelete, HistoryActionStoryLinkUpdate, HistoryActionStoryUpdate, HistoryActionTaskCreate, HistoryActionTaskDelete, HistoryActionTaskUpdate, HistoryActionWorkspace2BulkUpdate, HistoryChangesStory, HistoryChangesStoryLink, HistoryChangesTask, HistoryReferenceBranch, HistoryReferenceCommit, HistoryReferenceCustomFieldEnumValue, HistoryReferenceEpic, HistoryReferenceGeneral, HistoryReferenceGroup, HistoryReferenceIteration, HistoryReferenceLabel, HistoryReferenceProject, HistoryReferenceStory, HistoryReferenceStoryTask, HistoryReferenceWorkflowState, Icon, Identity, Iteration, IterationAssociatedGroup, IterationSearchResults, IterationSlim, IterationStats, KeyResult, KeyResultValue, Label, LabelSlim, LabelStats, LinkSubTaskParams, LinkedFile, MaxSearchResultsExceededError, Member, MemberInfo, MemberInfoOrganization2, Milestone, MilestoneStats, Objective, ObjectiveSearchResult, ObjectiveSearchResults, ObjectiveStats, Profile, Project, ProjectStats, PullRequest, PullRequestLabel, RemoveCustomFieldParams, RemoveLabelParams, Repository, SearchResults, SearchStories, Story, StoryComment, StoryContents, StoryContentsTask, StoryCustomField, StoryHistoryChangeAddsRemovesInt, StoryHistoryChangeAddsRemovesUuid, StoryHistoryChangeOldNewBool, StoryHistoryChangeOldNewInt, StoryHistoryChangeOldNewStr, StoryHistoryChangeOldNewUuid, StoryLink, StoryReaction, StorySearchResult, StorySearchResults, StorySlim, StoryStats, SyncedItem, Task, ThreadedComment, TypedStoryLink, UnusableEntitlementError, UpdateCategory, UpdateComment, UpdateCustomField, UpdateCustomFieldEnumValue, UpdateEntityTemplate, UpdateEpic, UpdateFile, UpdateGroup, UpdateHealth, UpdateIteration, UpdateKeyResult, UpdateLabel, UpdateLinkedFile, UpdateMilestone, UpdateObjective, UpdateProject, UpdateStories, UpdateStory, UpdateStoryComment, UpdateStoryContents, UpdateStoryLink, UpdateTask, UploadedFile, Workflow, WorkflowState } from "./generated/data-contracts.mjs";
2
+ import { ShortcutClient } from "./ShortcutClient.mjs";
3
+ export { BaseTaskParams, BasicWorkspaceInfo, Branch, Category, Commit, CreateCategory, CreateCategoryParams, CreateCommentComment, CreateDoc, CreateEntityTemplate, CreateEpic, CreateEpicComment, CreateEpicHealth, CreateGenericIntegration, CreateGroup, CreateIteration, CreateLabelParams, CreateLinkedFile, CreateMilestone, CreateObjective, CreateOrDeleteStoryReaction, CreateProject, CreateStories, CreateStoryComment, CreateStoryCommentParams, CreateStoryContents, CreateStoryFromTemplateParams, CreateStoryLink, CreateStoryLinkParams, CreateStoryParams, CreateSubTaskParams, CreateTask, CreateTaskParams, CustomField, CustomFieldEnumValue, CustomFieldValueParams, DataConflictError, DeleteStories, DisabledFeatureError, DocSlim, EntityTemplate, Epic, EpicAssociatedGroup, EpicPaginatedResults, EpicSearchResult, EpicSearchResults, EpicSlim, EpicState, EpicStats, EpicWorkflow, Group, Health, History, HistoryActionBranchCreate, HistoryActionBranchMerge, HistoryActionBranchPush, HistoryActionLabelCreate, HistoryActionLabelDelete, HistoryActionLabelUpdate, HistoryActionProjectUpdate, HistoryActionPullRequest, HistoryActionStoryCommentCreate, HistoryActionStoryCreate, HistoryActionStoryDelete, HistoryActionStoryLinkCreate, HistoryActionStoryLinkDelete, HistoryActionStoryLinkUpdate, HistoryActionStoryUpdate, HistoryActionTaskCreate, HistoryActionTaskDelete, HistoryActionTaskUpdate, HistoryActionWorkspace2BulkUpdate, HistoryChangesStory, HistoryChangesStoryLink, HistoryChangesTask, HistoryReferenceBranch, HistoryReferenceCommit, HistoryReferenceCustomFieldEnumValue, HistoryReferenceEpic, HistoryReferenceGeneral, HistoryReferenceGroup, HistoryReferenceIteration, HistoryReferenceLabel, HistoryReferenceProject, HistoryReferenceStory, HistoryReferenceStoryTask, HistoryReferenceWorkflowState, Icon, Identity, Iteration, IterationAssociatedGroup, IterationSearchResults, IterationSlim, IterationStats, KeyResult, KeyResultValue, Label, LabelSlim, LabelStats, LinkSubTaskParams, LinkedFile, MaxSearchResultsExceededError, Member, MemberInfo, MemberInfoOrganization2, Milestone, MilestoneStats, Objective, ObjectiveSearchResult, ObjectiveSearchResults, ObjectiveStats, Profile, Project, ProjectStats, PullRequest, PullRequestLabel, RemoveCustomFieldParams, RemoveLabelParams, Repository, SearchResults, SearchStories, ShortcutClient, Story, StoryComment, StoryContents, StoryContentsTask, StoryCustomField, StoryHistoryChangeAddsRemovesInt, StoryHistoryChangeAddsRemovesUuid, StoryHistoryChangeOldNewBool, StoryHistoryChangeOldNewInt, StoryHistoryChangeOldNewStr, StoryHistoryChangeOldNewUuid, StoryLink, StoryReaction, StorySearchResult, StorySearchResults, StorySlim, StoryStats, SyncedItem, Task, ThreadedComment, TypedStoryLink, UnusableEntitlementError, UpdateCategory, UpdateComment, UpdateCustomField, UpdateCustomFieldEnumValue, UpdateEntityTemplate, UpdateEpic, UpdateFile, UpdateGroup, UpdateHealth, UpdateIteration, UpdateKeyResult, UpdateLabel, UpdateLinkedFile, UpdateMilestone, UpdateObjective, UpdateProject, UpdateStories, UpdateStory, UpdateStoryComment, UpdateStoryContents, UpdateStoryLink, UpdateTask, UploadedFile, Workflow, WorkflowState, ShortcutClient as default };
package/lib/index.d.ts CHANGED
@@ -1,3 +1,3 @@
1
- export { ShortcutClient as default } from './ShortcutClient';
2
- export * from './ShortcutClient';
3
- export * from './generated/data-contracts';
1
+ import { BaseTaskParams, BasicWorkspaceInfo, Branch, Category, Commit, CreateCategory, CreateCategoryParams, CreateCommentComment, CreateDoc, CreateEntityTemplate, CreateEpic, CreateEpicComment, CreateEpicHealth, CreateGenericIntegration, CreateGroup, CreateIteration, CreateLabelParams, CreateLinkedFile, CreateMilestone, CreateObjective, CreateOrDeleteStoryReaction, CreateProject, CreateStories, CreateStoryComment, CreateStoryCommentParams, CreateStoryContents, CreateStoryFromTemplateParams, CreateStoryLink, CreateStoryLinkParams, CreateStoryParams, CreateSubTaskParams, CreateTask, CreateTaskParams, CustomField, CustomFieldEnumValue, CustomFieldValueParams, DataConflictError, DeleteStories, DisabledFeatureError, DocSlim, EntityTemplate, Epic, EpicAssociatedGroup, EpicPaginatedResults, EpicSearchResult, EpicSearchResults, EpicSlim, EpicState, EpicStats, EpicWorkflow, Group, Health, History, HistoryActionBranchCreate, HistoryActionBranchMerge, HistoryActionBranchPush, HistoryActionLabelCreate, HistoryActionLabelDelete, HistoryActionLabelUpdate, HistoryActionProjectUpdate, HistoryActionPullRequest, HistoryActionStoryCommentCreate, HistoryActionStoryCreate, HistoryActionStoryDelete, HistoryActionStoryLinkCreate, HistoryActionStoryLinkDelete, HistoryActionStoryLinkUpdate, HistoryActionStoryUpdate, HistoryActionTaskCreate, HistoryActionTaskDelete, HistoryActionTaskUpdate, HistoryActionWorkspace2BulkUpdate, HistoryChangesStory, HistoryChangesStoryLink, HistoryChangesTask, HistoryReferenceBranch, HistoryReferenceCommit, HistoryReferenceCustomFieldEnumValue, HistoryReferenceEpic, HistoryReferenceGeneral, HistoryReferenceGroup, HistoryReferenceIteration, HistoryReferenceLabel, HistoryReferenceProject, HistoryReferenceStory, HistoryReferenceStoryTask, HistoryReferenceWorkflowState, Icon, Identity, Iteration, IterationAssociatedGroup, IterationSearchResults, IterationSlim, IterationStats, KeyResult, KeyResultValue, Label, LabelSlim, LabelStats, LinkSubTaskParams, LinkedFile, MaxSearchResultsExceededError, Member, MemberInfo, MemberInfoOrganization2, Milestone, MilestoneStats, Objective, ObjectiveSearchResult, ObjectiveSearchResults, ObjectiveStats, Profile, Project, ProjectStats, PullRequest, PullRequestLabel, RemoveCustomFieldParams, RemoveLabelParams, Repository, SearchResults, SearchStories, Story, StoryComment, StoryContents, StoryContentsTask, StoryCustomField, StoryHistoryChangeAddsRemovesInt, StoryHistoryChangeAddsRemovesUuid, StoryHistoryChangeOldNewBool, StoryHistoryChangeOldNewInt, StoryHistoryChangeOldNewStr, StoryHistoryChangeOldNewUuid, StoryLink, StoryReaction, StorySearchResult, StorySearchResults, StorySlim, StoryStats, SyncedItem, Task, ThreadedComment, TypedStoryLink, UnusableEntitlementError, UpdateCategory, UpdateComment, UpdateCustomField, UpdateCustomFieldEnumValue, UpdateEntityTemplate, UpdateEpic, UpdateFile, UpdateGroup, UpdateHealth, UpdateIteration, UpdateKeyResult, UpdateLabel, UpdateLinkedFile, UpdateMilestone, UpdateObjective, UpdateProject, UpdateStories, UpdateStory, UpdateStoryComment, UpdateStoryContents, UpdateStoryLink, UpdateTask, UploadedFile, Workflow, WorkflowState } from "./generated/data-contracts.js";
2
+ import { ShortcutClient } from "./ShortcutClient.js";
3
+ export { BaseTaskParams, BasicWorkspaceInfo, Branch, Category, Commit, CreateCategory, CreateCategoryParams, CreateCommentComment, CreateDoc, CreateEntityTemplate, CreateEpic, CreateEpicComment, CreateEpicHealth, CreateGenericIntegration, CreateGroup, CreateIteration, CreateLabelParams, CreateLinkedFile, CreateMilestone, CreateObjective, CreateOrDeleteStoryReaction, CreateProject, CreateStories, CreateStoryComment, CreateStoryCommentParams, CreateStoryContents, CreateStoryFromTemplateParams, CreateStoryLink, CreateStoryLinkParams, CreateStoryParams, CreateSubTaskParams, CreateTask, CreateTaskParams, CustomField, CustomFieldEnumValue, CustomFieldValueParams, DataConflictError, DeleteStories, DisabledFeatureError, DocSlim, EntityTemplate, Epic, EpicAssociatedGroup, EpicPaginatedResults, EpicSearchResult, EpicSearchResults, EpicSlim, EpicState, EpicStats, EpicWorkflow, Group, Health, History, HistoryActionBranchCreate, HistoryActionBranchMerge, HistoryActionBranchPush, HistoryActionLabelCreate, HistoryActionLabelDelete, HistoryActionLabelUpdate, HistoryActionProjectUpdate, HistoryActionPullRequest, HistoryActionStoryCommentCreate, HistoryActionStoryCreate, HistoryActionStoryDelete, HistoryActionStoryLinkCreate, HistoryActionStoryLinkDelete, HistoryActionStoryLinkUpdate, HistoryActionStoryUpdate, HistoryActionTaskCreate, HistoryActionTaskDelete, HistoryActionTaskUpdate, HistoryActionWorkspace2BulkUpdate, HistoryChangesStory, HistoryChangesStoryLink, HistoryChangesTask, HistoryReferenceBranch, HistoryReferenceCommit, HistoryReferenceCustomFieldEnumValue, HistoryReferenceEpic, HistoryReferenceGeneral, HistoryReferenceGroup, HistoryReferenceIteration, HistoryReferenceLabel, HistoryReferenceProject, HistoryReferenceStory, HistoryReferenceStoryTask, HistoryReferenceWorkflowState, Icon, Identity, Iteration, IterationAssociatedGroup, IterationSearchResults, IterationSlim, IterationStats, KeyResult, KeyResultValue, Label, LabelSlim, LabelStats, LinkSubTaskParams, LinkedFile, MaxSearchResultsExceededError, Member, MemberInfo, MemberInfoOrganization2, Milestone, MilestoneStats, Objective, ObjectiveSearchResult, ObjectiveSearchResults, ObjectiveStats, Profile, Project, ProjectStats, PullRequest, PullRequestLabel, RemoveCustomFieldParams, RemoveLabelParams, Repository, SearchResults, SearchStories, ShortcutClient, Story, StoryComment, StoryContents, StoryContentsTask, StoryCustomField, StoryHistoryChangeAddsRemovesInt, StoryHistoryChangeAddsRemovesUuid, StoryHistoryChangeOldNewBool, StoryHistoryChangeOldNewInt, StoryHistoryChangeOldNewStr, StoryHistoryChangeOldNewUuid, StoryLink, StoryReaction, StorySearchResult, StorySearchResults, StorySlim, StoryStats, SyncedItem, Task, ThreadedComment, TypedStoryLink, UnusableEntitlementError, UpdateCategory, UpdateComment, UpdateCustomField, UpdateCustomFieldEnumValue, UpdateEntityTemplate, UpdateEpic, UpdateFile, UpdateGroup, UpdateHealth, UpdateIteration, UpdateKeyResult, UpdateLabel, UpdateLinkedFile, UpdateMilestone, UpdateObjective, UpdateProject, UpdateStories, UpdateStory, UpdateStoryComment, UpdateStoryContents, UpdateStoryLink, UpdateTask, UploadedFile, Workflow, WorkflowState, ShortcutClient as default };
package/lib/index.js CHANGED
@@ -1,21 +1,5 @@
1
- "use strict";
2
- var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
- if (k2 === undefined) k2 = k;
4
- var desc = Object.getOwnPropertyDescriptor(m, k);
5
- if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
- desc = { enumerable: true, get: function() { return m[k]; } };
7
- }
8
- Object.defineProperty(o, k2, desc);
9
- }) : (function(o, m, k, k2) {
10
- if (k2 === undefined) k2 = k;
11
- o[k2] = m[k];
12
- }));
13
- var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
- for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
- };
16
- Object.defineProperty(exports, "__esModule", { value: true });
17
- exports.default = void 0;
18
- var ShortcutClient_1 = require("./ShortcutClient");
19
- Object.defineProperty(exports, "default", { enumerable: true, get: function () { return ShortcutClient_1.ShortcutClient; } });
20
- __exportStar(require("./ShortcutClient"), exports);
21
- __exportStar(require("./generated/data-contracts"), exports);
1
+ Object.defineProperty(exports, '__esModule', { value: true });
2
+ const require_ShortcutClient = require('./ShortcutClient.js');
3
+
4
+ exports.ShortcutClient = require_ShortcutClient.ShortcutClient;
5
+ exports.default = require_ShortcutClient.ShortcutClient;
package/lib/index.mjs ADDED
@@ -0,0 +1,3 @@
1
+ import { ShortcutClient } from "./ShortcutClient.mjs";
2
+
3
+ export { ShortcutClient, ShortcutClient as default };
package/package.json CHANGED
@@ -1,62 +1,44 @@
1
1
  {
2
2
  "name": "@shortcut/client",
3
- "version": "1.1.0",
4
- "description": "A Promise based library to the Shortcut REST API",
5
- "main": "lib/index.js",
6
- "types": "lib/index.d.ts",
7
- "files": [
8
- "lib"
9
- ],
3
+ "version": "2.1.0",
4
+ "description": "A library for interacting with the Shortcut REST API",
5
+ "homepage": "https://github.com/useshortcut/shortcut-client-js",
10
6
  "bugs": {
11
7
  "url": "https://github.com/useshortcut/shortcut-client-js/issues"
12
8
  },
13
- "homepage": "https://github.com/useshortcut/shortcut-client-js",
14
- "readme": "https://github.com/useshortcut/shortcut-client-js#readme",
15
9
  "repository": {
16
10
  "type": "git",
17
11
  "url": "https://github.com/useshortcut/shortcut-client-js.git"
18
12
  },
19
13
  "license": "MIT",
14
+ "sideEffects": false,
15
+ "type": "commonjs",
16
+ "exports": {
17
+ ".": {
18
+ "import": "./lib/index.mjs",
19
+ "require": "./lib/index.js"
20
+ }
21
+ },
22
+ "main": "./lib/index.js",
23
+ "module": "./lib/index.mjs",
24
+ "types": "./lib/index.d.ts",
25
+ "files": [
26
+ "lib"
27
+ ],
20
28
  "scripts": {
21
- "build": "yarn build:client && yarn build:add-typedoc-comments && tsc",
22
- "build:client": "swagger-typescript-api -p ./schema/shortcut.swagger.json -o ./src/generated --clean-output --axios --modular --templates ./templates",
29
+ "build": "yarn build:client && yarn build:add-typedoc-comments && tsdown",
23
30
  "build:add-typedoc-comments": "npx jscodeshift -t scripts/add-typedoc-comments.ts --extensions=ts --parser=ts src/generated/**",
31
+ "build:client": "swagger-typescript-api generate --path ./schema/shortcut.swagger.json --output ./src/generated --clean-output --axios --modular --templates ./templates",
24
32
  "build:docs": "typedoc ./src --exclude 'src/__tests__/**'",
25
- "validate:examples": "npx tsc examples/*.ts --noEmit",
33
+ "check-exports": "attw --pack .",
34
+ "format": "prettier --write -l *.{json,md,prettierrc} '{src,scripts}/**/*.ts'",
35
+ "format:check": "prettier --check *.{json,md,prettierrc} '{src,scripts}/**/*.ts'",
36
+ "lint": "eslint 'src/**/*.{js,ts}'",
26
37
  "prepublishOnly": "yarn build",
27
38
  "sync:schema": "curl --silent https://developer.shortcut.com/api/rest/v3/shortcut.swagger.json --output ./schema/shortcut.swagger.json && yarn validate:schema",
28
- "validate:schema": "swagger-cli validate ./schema/shortcut.swagger.json",
29
- "lint": "eslint 'src/**/*.{js,ts}'",
30
39
  "test": "jest",
31
- "format": "prettier --write -l *.{json,md,prettierrc} '{src,scripts}/**/*.ts'",
32
- "format:check": "prettier --check *.{json,md,prettierrc} '{src,scripts}/**/*.ts'"
33
- },
34
- "dependencies": {
35
- "axios": "^1.5.0"
36
- },
37
- "devDependencies": {
38
- "@types/jest": "^29.5.4",
39
- "@types/jscodeshift": "0.11.6",
40
- "@types/node": "^20.5.7",
41
- "@typescript-eslint/eslint-plugin": "^6.5.0",
42
- "@typescript-eslint/parser": "^6.5.0",
43
- "eslint": "^8.48.0",
44
- "eslint-config-airbnb-base": "^15.0.0",
45
- "eslint-config-prettier": "^9.0.0",
46
- "eslint-plugin-import": "^2.28.1",
47
- "eslint-plugin-jest": "^27.2.3",
48
- "eslint-plugin-prettier": "^5.0.0",
49
- "jest": "^29.6.4",
50
- "jscodeshift": "^0.15.0",
51
- "prettier": "^3.0.3",
52
- "rimraf": "^5.0.1",
53
- "stream-to-blob": "^2.0.1",
54
- "swagger-cli": "^4.0.4",
55
- "swagger-typescript-api": "^13.0.3",
56
- "ts-jest": "^29.1.1",
57
- "typedoc": "0.25.0",
58
- "typedoc-plugin-merge-modules": "5.1.0",
59
- "typescript": "^5.2.2"
40
+ "validate:examples": "npx tsc examples/*.ts --noEmit",
41
+ "validate:schema": "swagger-cli validate ./schema/shortcut.swagger.json"
60
42
  },
61
43
  "jest": {
62
44
  "preset": "ts-jest",
@@ -65,5 +47,37 @@
65
47
  "<rootDir>/lib/",
66
48
  "<rootDir>/node_modules/"
67
49
  ]
68
- }
50
+ },
51
+ "dependencies": {
52
+ "axios": "^1.9.0"
53
+ },
54
+ "devDependencies": {
55
+ "@arethetypeswrong/cli": "^0.18.1",
56
+ "@total-typescript/tsconfig": "^1.0.4",
57
+ "@types/glob": "^8.1.0",
58
+ "@types/jest": "^29.5.14",
59
+ "@types/jscodeshift": "17.3.0",
60
+ "@types/node": "^22.15.30",
61
+ "@typescript-eslint/eslint-plugin": "^8.33.1",
62
+ "@typescript-eslint/parser": "^8.33.1",
63
+ "eslint": "^8.57.1",
64
+ "eslint-config-airbnb-base": "^15.0.0",
65
+ "eslint-config-prettier": "^10.1.5",
66
+ "eslint-plugin-import": "^2.31.0",
67
+ "eslint-plugin-jest": "^28.12.0",
68
+ "eslint-plugin-prettier": "^5.4.1",
69
+ "glob": "^11.0.2",
70
+ "jest": "^29.7.0",
71
+ "jscodeshift": "^17.3.0",
72
+ "prettier": "^3.5.3",
73
+ "stream-to-blob": "^2.0.1",
74
+ "swagger-cli": "^4.0.4",
75
+ "swagger-typescript-api": "^13.2.0",
76
+ "ts-jest": "^29.3.4",
77
+ "tsdown": "^0.12.7",
78
+ "typedoc": "0.28.5",
79
+ "typedoc-plugin-merge-modules": "7.0.0",
80
+ "typescript": "^5.8.3"
81
+ },
82
+ "readme": "https://github.com/useshortcut/shortcut-client-js#readme"
69
83
  }
@@ -1,12 +0,0 @@
1
- "use strict";
2
- /* eslint-disable */
3
- /* tslint:disable */
4
- /*
5
- * ---------------------------------------------------------------
6
- * ## THIS FILE WAS GENERATED VIA SWAGGER-TYPESCRIPT-API ##
7
- * ## ##
8
- * ## AUTHOR: acacode ##
9
- * ## SOURCE: https://github.com/acacode/swagger-typescript-api ##
10
- * ---------------------------------------------------------------
11
- */
12
- Object.defineProperty(exports, "__esModule", { value: true });