@doist/todoist-sdk 9.0.0 → 9.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.
- package/dist/cjs/authentication.js +1 -0
- package/dist/cjs/clients/activity-client.js +63 -0
- package/dist/cjs/clients/app-client.js +347 -0
- package/dist/cjs/clients/backup-client.js +65 -0
- package/dist/cjs/clients/base-client.js +30 -0
- package/dist/cjs/clients/comment-client.js +92 -0
- package/dist/cjs/clients/email-client.js +43 -0
- package/dist/cjs/clients/folder-client.js +80 -0
- package/dist/cjs/clients/id-mapping-client.js +39 -0
- package/dist/cjs/clients/insights-client.js +88 -0
- package/dist/cjs/clients/label-client.js +127 -0
- package/dist/cjs/clients/productivity-client.js +27 -0
- package/dist/cjs/clients/project-client.js +232 -0
- package/dist/cjs/clients/reminder-client.js +198 -0
- package/dist/cjs/clients/section-client.js +118 -0
- package/dist/cjs/clients/task-client.js +255 -0
- package/dist/cjs/clients/template-client.js +89 -0
- package/dist/cjs/clients/ui-extension-client.js +109 -0
- package/dist/cjs/clients/upload-client.js +102 -0
- package/dist/cjs/clients/workspace-client.js +367 -0
- package/dist/cjs/consts/endpoints.js +66 -1
- package/dist/cjs/test-utils/test-defaults.js +77 -1
- package/dist/cjs/todoist-api.js +422 -1537
- package/dist/cjs/transport/http-client.js +1 -0
- package/dist/cjs/transport/sync-request.js +75 -0
- package/dist/cjs/types/apps/index.js +18 -0
- package/dist/cjs/types/apps/requests.js +2 -0
- package/dist/cjs/types/apps/types.js +253 -0
- package/dist/cjs/types/index.js +2 -0
- package/dist/cjs/types/ui-extensions/index.js +18 -0
- package/dist/cjs/types/ui-extensions/requests.js +2 -0
- package/dist/cjs/types/ui-extensions/types.js +77 -0
- package/dist/cjs/utils/headers.js +16 -0
- package/dist/cjs/utils/request-helpers.js +21 -0
- package/dist/cjs/utils/validators.js +52 -38
- package/dist/esm/authentication.js +1 -0
- package/dist/esm/clients/activity-client.js +59 -0
- package/dist/esm/clients/app-client.js +343 -0
- package/dist/esm/clients/backup-client.js +61 -0
- package/dist/esm/clients/base-client.js +26 -0
- package/dist/esm/clients/comment-client.js +88 -0
- package/dist/esm/clients/email-client.js +39 -0
- package/dist/esm/clients/folder-client.js +76 -0
- package/dist/esm/clients/id-mapping-client.js +35 -0
- package/dist/esm/clients/insights-client.js +84 -0
- package/dist/esm/clients/label-client.js +123 -0
- package/dist/esm/clients/productivity-client.js +23 -0
- package/dist/esm/clients/project-client.js +228 -0
- package/dist/esm/clients/reminder-client.js +194 -0
- package/dist/esm/clients/section-client.js +114 -0
- package/dist/esm/clients/task-client.js +251 -0
- package/dist/esm/clients/template-client.js +85 -0
- package/dist/esm/clients/ui-extension-client.js +105 -0
- package/dist/esm/clients/upload-client.js +98 -0
- package/dist/esm/clients/workspace-client.js +363 -0
- package/dist/esm/consts/endpoints.js +51 -0
- package/dist/esm/test-utils/test-defaults.js +75 -0
- package/dist/esm/todoist-api.js +425 -1540
- package/dist/esm/transport/http-client.js +1 -0
- package/dist/esm/transport/sync-request.js +72 -0
- package/dist/esm/types/apps/index.js +2 -0
- package/dist/esm/types/apps/requests.js +1 -0
- package/dist/esm/types/apps/types.js +248 -0
- package/dist/esm/types/index.js +2 -0
- package/dist/esm/types/ui-extensions/index.js +2 -0
- package/dist/esm/types/ui-extensions/requests.js +1 -0
- package/dist/esm/types/ui-extensions/types.js +74 -0
- package/dist/esm/utils/headers.js +13 -0
- package/dist/esm/utils/request-helpers.js +17 -0
- package/dist/esm/utils/validators.js +14 -0
- package/dist/types/authentication.d.ts +1 -1
- package/dist/types/clients/activity-client.d.ts +12 -0
- package/dist/types/clients/app-client.d.ts +37 -0
- package/dist/types/clients/backup-client.d.ts +14 -0
- package/dist/types/clients/base-client.d.ts +21 -0
- package/dist/types/clients/comment-client.d.ts +15 -0
- package/dist/types/clients/email-client.d.ts +13 -0
- package/dist/types/clients/folder-client.d.ts +16 -0
- package/dist/types/clients/id-mapping-client.d.ts +13 -0
- package/dist/types/clients/insights-client.d.ts +18 -0
- package/dist/types/clients/label-client.d.ts +19 -0
- package/dist/types/clients/productivity-client.d.ts +12 -0
- package/dist/types/clients/project-client.d.ts +26 -0
- package/dist/types/clients/reminder-client.d.ts +25 -0
- package/dist/types/clients/section-client.d.ts +18 -0
- package/dist/types/clients/task-client.d.ts +25 -0
- package/dist/types/clients/template-client.d.ts +17 -0
- package/dist/types/clients/ui-extension-client.d.ts +18 -0
- package/dist/types/clients/upload-client.d.ts +17 -0
- package/dist/types/clients/workspace-client.d.ts +43 -0
- package/dist/types/consts/endpoints.d.ts +24 -0
- package/dist/types/test-utils/test-defaults.d.ts +16 -1
- package/dist/types/todoist-api.d.ts +238 -17
- package/dist/types/transport/sync-request.d.ts +27 -0
- package/dist/types/types/apps/index.d.ts +2 -0
- package/dist/types/types/apps/requests.d.ts +89 -0
- package/dist/types/types/apps/types.d.ts +414 -0
- package/dist/types/types/http.d.ts +8 -1
- package/dist/types/types/index.d.ts +2 -0
- package/dist/types/types/sync/resources/user.d.ts +2 -2
- package/dist/types/types/sync/response.d.ts +2 -2
- package/dist/types/types/sync/user-preferences.d.ts +1 -1
- package/dist/types/types/ui-extensions/index.d.ts +2 -0
- package/dist/types/types/ui-extensions/requests.d.ts +108 -0
- package/dist/types/types/ui-extensions/types.d.ts +185 -0
- package/dist/types/utils/headers.d.ts +7 -0
- package/dist/types/utils/request-helpers.d.ts +13 -0
- package/dist/types/utils/validators.d.ts +223 -0
- package/package.json +1 -1
|
@@ -0,0 +1,108 @@
|
|
|
1
|
+
import type { ComposerExtensionContext, ContextMenuExtensionContext, UiExtensionType } from './types.js';
|
|
2
|
+
import { UiExtensionTypeEnum } from './types.js';
|
|
3
|
+
/**
|
|
4
|
+
* Fields common to every UI extension variant — shared across all add/update
|
|
5
|
+
* request shapes.
|
|
6
|
+
*/
|
|
7
|
+
type BaseUiExtensionFields = {
|
|
8
|
+
/** HTTPS URL the extension loads. */
|
|
9
|
+
url: string;
|
|
10
|
+
/** Extension display name. */
|
|
11
|
+
name: string;
|
|
12
|
+
/** Extension description. */
|
|
13
|
+
description: string;
|
|
14
|
+
/** Rendered width in pixels. */
|
|
15
|
+
width?: number | null;
|
|
16
|
+
/** Rendered height in pixels. */
|
|
17
|
+
height?: number | null;
|
|
18
|
+
/** Optional HTTPS URL for the extension icon. */
|
|
19
|
+
icon?: string | null;
|
|
20
|
+
/** Extension definition version. Defaults to the backend default. */
|
|
21
|
+
defVersion?: number;
|
|
22
|
+
/** Minimum Cardist renderer version required, as a decimal version string (e.g. `'0.60'`). */
|
|
23
|
+
minimumCardistVersion?: string;
|
|
24
|
+
/** Optional client-specified extension ID (server generates one if omitted). */
|
|
25
|
+
extensionId?: string | null;
|
|
26
|
+
};
|
|
27
|
+
/** Arguments for adding a context-menu UI extension. */
|
|
28
|
+
export type AddContextMenuExtensionArgs = BaseUiExtensionFields & {
|
|
29
|
+
/** The developer application (integration) ID the extension belongs to. */
|
|
30
|
+
integrationId: string;
|
|
31
|
+
extensionType: typeof UiExtensionTypeEnum.ContextMenu;
|
|
32
|
+
/** Where the extension appears. */
|
|
33
|
+
contextType: ContextMenuExtensionContext;
|
|
34
|
+
};
|
|
35
|
+
/** Arguments for adding a composer UI extension. */
|
|
36
|
+
export type AddComposerExtensionArgs = BaseUiExtensionFields & {
|
|
37
|
+
/** The developer application (integration) ID the extension belongs to. */
|
|
38
|
+
integrationId: string;
|
|
39
|
+
extensionType: typeof UiExtensionTypeEnum.Composer;
|
|
40
|
+
/** Which composer the extension appears in. */
|
|
41
|
+
composerType: ComposerExtensionContext;
|
|
42
|
+
};
|
|
43
|
+
/** Arguments for adding a settings UI extension. */
|
|
44
|
+
export type AddSettingsExtensionArgs = BaseUiExtensionFields & {
|
|
45
|
+
/** The developer application (integration) ID the extension belongs to. */
|
|
46
|
+
integrationId: string;
|
|
47
|
+
extensionType: typeof UiExtensionTypeEnum.Settings;
|
|
48
|
+
};
|
|
49
|
+
/**
|
|
50
|
+
* Arguments for adding a new UI extension to a developer application.
|
|
51
|
+
* Discriminated on `extensionType` so impossible combinations
|
|
52
|
+
* (e.g. `settings` + `contextType`) fail at compile time.
|
|
53
|
+
*/
|
|
54
|
+
export type AddUiExtensionArgs = AddContextMenuExtensionArgs | AddComposerExtensionArgs | AddSettingsExtensionArgs;
|
|
55
|
+
/**
|
|
56
|
+
* Fields that are optional on every update variant.
|
|
57
|
+
*/
|
|
58
|
+
type UpdateUiExtensionFields = {
|
|
59
|
+
url?: string;
|
|
60
|
+
name?: string;
|
|
61
|
+
description?: string;
|
|
62
|
+
width?: number | null;
|
|
63
|
+
height?: number | null;
|
|
64
|
+
icon?: string | null;
|
|
65
|
+
defVersion?: number;
|
|
66
|
+
minimumCardistVersion?: string;
|
|
67
|
+
extensionId?: string | null;
|
|
68
|
+
};
|
|
69
|
+
/**
|
|
70
|
+
* Arguments for updating a context-menu UI extension.
|
|
71
|
+
* `extensionType` is required to discriminate the variant — callers
|
|
72
|
+
* already have it from the fetched `UiExtension`.
|
|
73
|
+
*/
|
|
74
|
+
export type UpdateContextMenuExtensionArgs = UpdateUiExtensionFields & {
|
|
75
|
+
extensionType: typeof UiExtensionTypeEnum.ContextMenu;
|
|
76
|
+
contextType?: ContextMenuExtensionContext;
|
|
77
|
+
};
|
|
78
|
+
/**
|
|
79
|
+
* Arguments for updating a composer UI extension.
|
|
80
|
+
*/
|
|
81
|
+
export type UpdateComposerExtensionArgs = UpdateUiExtensionFields & {
|
|
82
|
+
extensionType: typeof UiExtensionTypeEnum.Composer;
|
|
83
|
+
composerType?: ComposerExtensionContext;
|
|
84
|
+
};
|
|
85
|
+
/**
|
|
86
|
+
* Arguments for updating a settings UI extension.
|
|
87
|
+
*/
|
|
88
|
+
export type UpdateSettingsExtensionArgs = UpdateUiExtensionFields & {
|
|
89
|
+
extensionType: typeof UiExtensionTypeEnum.Settings;
|
|
90
|
+
};
|
|
91
|
+
/**
|
|
92
|
+
* Arguments for updating a UI extension — all value fields are optional
|
|
93
|
+
* but `extensionType` is required so TypeScript can discriminate which
|
|
94
|
+
* variant-specific fields (`contextType`, `composerType`) apply.
|
|
95
|
+
*/
|
|
96
|
+
export type UpdateUiExtensionArgs = UpdateContextMenuExtensionArgs | UpdateComposerExtensionArgs | UpdateSettingsExtensionArgs;
|
|
97
|
+
export type { UiExtensionType };
|
|
98
|
+
/**
|
|
99
|
+
* Arguments for uploading a UI extension icon.
|
|
100
|
+
*/
|
|
101
|
+
export type UploadUiExtensionIconArgs = {
|
|
102
|
+
/** The UI extension ID. */
|
|
103
|
+
uiExtensionId: string;
|
|
104
|
+
/** The icon file to upload (Buffer, Stream, or file path). */
|
|
105
|
+
file: Buffer | NodeJS.ReadableStream | string | Blob;
|
|
106
|
+
/** The file name (required for Buffer/Stream uploads). */
|
|
107
|
+
fileName?: string;
|
|
108
|
+
};
|
|
@@ -0,0 +1,185 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
/**
|
|
3
|
+
* Discriminator values for the UI extension variants.
|
|
4
|
+
* Exposed as an enum-like object because the values are used in `z.literal()`
|
|
5
|
+
* across multiple variant schemas (see AGENTS.md "Discriminated unions" exception).
|
|
6
|
+
*/
|
|
7
|
+
export declare const UiExtensionTypeEnum: {
|
|
8
|
+
readonly ContextMenu: "context-menu";
|
|
9
|
+
readonly Composer: "composer";
|
|
10
|
+
readonly Settings: "settings";
|
|
11
|
+
};
|
|
12
|
+
/**
|
|
13
|
+
* All UI extension type values.
|
|
14
|
+
*/
|
|
15
|
+
export declare const UI_EXTENSION_TYPES: readonly ["context-menu", "composer", "settings"];
|
|
16
|
+
/**
|
|
17
|
+
* Type of UI extension.
|
|
18
|
+
*/
|
|
19
|
+
export type UiExtensionType = (typeof UI_EXTENSION_TYPES)[number];
|
|
20
|
+
/**
|
|
21
|
+
* Context locations where a context-menu extension can appear.
|
|
22
|
+
*/
|
|
23
|
+
export declare const CONTEXT_MENU_EXTENSION_CONTEXTS: readonly ["project", "task"];
|
|
24
|
+
/**
|
|
25
|
+
* Context location of a context-menu UI extension.
|
|
26
|
+
*/
|
|
27
|
+
export type ContextMenuExtensionContext = (typeof CONTEXT_MENU_EXTENSION_CONTEXTS)[number];
|
|
28
|
+
export declare const ContextMenuExtensionContextSchema: z.ZodEnum<{
|
|
29
|
+
task: "task";
|
|
30
|
+
project: "project";
|
|
31
|
+
}>;
|
|
32
|
+
/**
|
|
33
|
+
* Composer locations where a composer extension can appear.
|
|
34
|
+
*/
|
|
35
|
+
export declare const COMPOSER_EXTENSION_CONTEXTS: readonly ["task", "comment"];
|
|
36
|
+
/**
|
|
37
|
+
* Composer location of a composer UI extension.
|
|
38
|
+
*/
|
|
39
|
+
export type ComposerExtensionContext = (typeof COMPOSER_EXTENSION_CONTEXTS)[number];
|
|
40
|
+
export declare const ComposerExtensionContextSchema: z.ZodEnum<{
|
|
41
|
+
task: "task";
|
|
42
|
+
comment: "comment";
|
|
43
|
+
}>;
|
|
44
|
+
/**
|
|
45
|
+
* Shared fields across all UI extension variants.
|
|
46
|
+
*/
|
|
47
|
+
export declare const UiExtensionBaseSchema: z.ZodObject<{
|
|
48
|
+
id: z.ZodPipe<z.ZodUnion<readonly [z.ZodString, z.ZodNumber]>, z.ZodTransform<string, string | number>>;
|
|
49
|
+
integrationId: z.ZodPipe<z.ZodUnion<readonly [z.ZodString, z.ZodNumber]>, z.ZodTransform<string, string | number>>;
|
|
50
|
+
extensionId: z.ZodString;
|
|
51
|
+
url: z.ZodString;
|
|
52
|
+
icon: z.ZodNullable<z.ZodString>;
|
|
53
|
+
name: z.ZodString;
|
|
54
|
+
description: z.ZodString;
|
|
55
|
+
width: z.ZodNullable<z.ZodNumber>;
|
|
56
|
+
height: z.ZodNullable<z.ZodNumber>;
|
|
57
|
+
defVersion: z.ZodNumber;
|
|
58
|
+
minimumCardistVersion: z.ZodString;
|
|
59
|
+
}, z.core.$strip>;
|
|
60
|
+
/**
|
|
61
|
+
* Schema for a context-menu UI extension.
|
|
62
|
+
*/
|
|
63
|
+
export declare const ContextMenuExtensionSchema: z.ZodObject<{
|
|
64
|
+
id: z.ZodPipe<z.ZodUnion<readonly [z.ZodString, z.ZodNumber]>, z.ZodTransform<string, string | number>>;
|
|
65
|
+
integrationId: z.ZodPipe<z.ZodUnion<readonly [z.ZodString, z.ZodNumber]>, z.ZodTransform<string, string | number>>;
|
|
66
|
+
extensionId: z.ZodString;
|
|
67
|
+
url: z.ZodString;
|
|
68
|
+
icon: z.ZodNullable<z.ZodString>;
|
|
69
|
+
name: z.ZodString;
|
|
70
|
+
description: z.ZodString;
|
|
71
|
+
width: z.ZodNullable<z.ZodNumber>;
|
|
72
|
+
height: z.ZodNullable<z.ZodNumber>;
|
|
73
|
+
defVersion: z.ZodNumber;
|
|
74
|
+
minimumCardistVersion: z.ZodString;
|
|
75
|
+
extensionType: z.ZodLiteral<"context-menu">;
|
|
76
|
+
contextType: z.ZodEnum<{
|
|
77
|
+
task: "task";
|
|
78
|
+
project: "project";
|
|
79
|
+
}>;
|
|
80
|
+
}, z.core.$strip>;
|
|
81
|
+
/**
|
|
82
|
+
* A context-menu UI extension.
|
|
83
|
+
*/
|
|
84
|
+
export type ContextMenuExtension = z.infer<typeof ContextMenuExtensionSchema>;
|
|
85
|
+
/**
|
|
86
|
+
* Schema for a composer UI extension.
|
|
87
|
+
*/
|
|
88
|
+
export declare const ComposerExtensionSchema: z.ZodObject<{
|
|
89
|
+
id: z.ZodPipe<z.ZodUnion<readonly [z.ZodString, z.ZodNumber]>, z.ZodTransform<string, string | number>>;
|
|
90
|
+
integrationId: z.ZodPipe<z.ZodUnion<readonly [z.ZodString, z.ZodNumber]>, z.ZodTransform<string, string | number>>;
|
|
91
|
+
extensionId: z.ZodString;
|
|
92
|
+
url: z.ZodString;
|
|
93
|
+
icon: z.ZodNullable<z.ZodString>;
|
|
94
|
+
name: z.ZodString;
|
|
95
|
+
description: z.ZodString;
|
|
96
|
+
width: z.ZodNullable<z.ZodNumber>;
|
|
97
|
+
height: z.ZodNullable<z.ZodNumber>;
|
|
98
|
+
defVersion: z.ZodNumber;
|
|
99
|
+
minimumCardistVersion: z.ZodString;
|
|
100
|
+
extensionType: z.ZodLiteral<"composer">;
|
|
101
|
+
composerType: z.ZodEnum<{
|
|
102
|
+
task: "task";
|
|
103
|
+
comment: "comment";
|
|
104
|
+
}>;
|
|
105
|
+
}, z.core.$strip>;
|
|
106
|
+
/**
|
|
107
|
+
* A composer UI extension.
|
|
108
|
+
*/
|
|
109
|
+
export type ComposerExtension = z.infer<typeof ComposerExtensionSchema>;
|
|
110
|
+
/**
|
|
111
|
+
* Schema for a settings UI extension.
|
|
112
|
+
*/
|
|
113
|
+
export declare const SettingsExtensionSchema: z.ZodObject<{
|
|
114
|
+
id: z.ZodPipe<z.ZodUnion<readonly [z.ZodString, z.ZodNumber]>, z.ZodTransform<string, string | number>>;
|
|
115
|
+
integrationId: z.ZodPipe<z.ZodUnion<readonly [z.ZodString, z.ZodNumber]>, z.ZodTransform<string, string | number>>;
|
|
116
|
+
extensionId: z.ZodString;
|
|
117
|
+
url: z.ZodString;
|
|
118
|
+
icon: z.ZodNullable<z.ZodString>;
|
|
119
|
+
name: z.ZodString;
|
|
120
|
+
description: z.ZodString;
|
|
121
|
+
width: z.ZodNullable<z.ZodNumber>;
|
|
122
|
+
height: z.ZodNullable<z.ZodNumber>;
|
|
123
|
+
defVersion: z.ZodNumber;
|
|
124
|
+
minimumCardistVersion: z.ZodString;
|
|
125
|
+
extensionType: z.ZodLiteral<"settings">;
|
|
126
|
+
}, z.core.$strip>;
|
|
127
|
+
/**
|
|
128
|
+
* A settings UI extension.
|
|
129
|
+
*/
|
|
130
|
+
export type SettingsExtension = z.infer<typeof SettingsExtensionSchema>;
|
|
131
|
+
/**
|
|
132
|
+
* Discriminated union of all UI extension variants.
|
|
133
|
+
*/
|
|
134
|
+
export declare const UiExtensionSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
135
|
+
id: z.ZodPipe<z.ZodUnion<readonly [z.ZodString, z.ZodNumber]>, z.ZodTransform<string, string | number>>;
|
|
136
|
+
integrationId: z.ZodPipe<z.ZodUnion<readonly [z.ZodString, z.ZodNumber]>, z.ZodTransform<string, string | number>>;
|
|
137
|
+
extensionId: z.ZodString;
|
|
138
|
+
url: z.ZodString;
|
|
139
|
+
icon: z.ZodNullable<z.ZodString>;
|
|
140
|
+
name: z.ZodString;
|
|
141
|
+
description: z.ZodString;
|
|
142
|
+
width: z.ZodNullable<z.ZodNumber>;
|
|
143
|
+
height: z.ZodNullable<z.ZodNumber>;
|
|
144
|
+
defVersion: z.ZodNumber;
|
|
145
|
+
minimumCardistVersion: z.ZodString;
|
|
146
|
+
extensionType: z.ZodLiteral<"context-menu">;
|
|
147
|
+
contextType: z.ZodEnum<{
|
|
148
|
+
task: "task";
|
|
149
|
+
project: "project";
|
|
150
|
+
}>;
|
|
151
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
152
|
+
id: z.ZodPipe<z.ZodUnion<readonly [z.ZodString, z.ZodNumber]>, z.ZodTransform<string, string | number>>;
|
|
153
|
+
integrationId: z.ZodPipe<z.ZodUnion<readonly [z.ZodString, z.ZodNumber]>, z.ZodTransform<string, string | number>>;
|
|
154
|
+
extensionId: z.ZodString;
|
|
155
|
+
url: z.ZodString;
|
|
156
|
+
icon: z.ZodNullable<z.ZodString>;
|
|
157
|
+
name: z.ZodString;
|
|
158
|
+
description: z.ZodString;
|
|
159
|
+
width: z.ZodNullable<z.ZodNumber>;
|
|
160
|
+
height: z.ZodNullable<z.ZodNumber>;
|
|
161
|
+
defVersion: z.ZodNumber;
|
|
162
|
+
minimumCardistVersion: z.ZodString;
|
|
163
|
+
extensionType: z.ZodLiteral<"composer">;
|
|
164
|
+
composerType: z.ZodEnum<{
|
|
165
|
+
task: "task";
|
|
166
|
+
comment: "comment";
|
|
167
|
+
}>;
|
|
168
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
169
|
+
id: z.ZodPipe<z.ZodUnion<readonly [z.ZodString, z.ZodNumber]>, z.ZodTransform<string, string | number>>;
|
|
170
|
+
integrationId: z.ZodPipe<z.ZodUnion<readonly [z.ZodString, z.ZodNumber]>, z.ZodTransform<string, string | number>>;
|
|
171
|
+
extensionId: z.ZodString;
|
|
172
|
+
url: z.ZodString;
|
|
173
|
+
icon: z.ZodNullable<z.ZodString>;
|
|
174
|
+
name: z.ZodString;
|
|
175
|
+
description: z.ZodString;
|
|
176
|
+
width: z.ZodNullable<z.ZodNumber>;
|
|
177
|
+
height: z.ZodNullable<z.ZodNumber>;
|
|
178
|
+
defVersion: z.ZodNumber;
|
|
179
|
+
minimumCardistVersion: z.ZodString;
|
|
180
|
+
extensionType: z.ZodLiteral<"settings">;
|
|
181
|
+
}, z.core.$strip>], "extensionType">;
|
|
182
|
+
/**
|
|
183
|
+
* A UI extension attached to a developer application.
|
|
184
|
+
*/
|
|
185
|
+
export type UiExtension = z.infer<typeof UiExtensionSchema>;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Converts a native Fetch `Headers` object into a plain `Record<string, string>`.
|
|
3
|
+
* Used when wrapping a native `fetch` response into the SDK's `FileResponse`
|
|
4
|
+
* shape (which expects headers as a plain record for symmetry with
|
|
5
|
+
* `CustomFetchResponse`).
|
|
6
|
+
*/
|
|
7
|
+
export declare function headersToRecord(headers: Headers): Record<string, string>;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Joins path segments using `/` separator.
|
|
3
|
+
* @param segments A list of **valid** path segments.
|
|
4
|
+
* @returns A joined path.
|
|
5
|
+
*/
|
|
6
|
+
export declare function generatePath(...segments: string[]): string;
|
|
7
|
+
/**
|
|
8
|
+
* Returns `fn(value)` spread into an object if `value` is defined, otherwise an empty object.
|
|
9
|
+
*
|
|
10
|
+
* Used to conditionally include a property on a payload object without
|
|
11
|
+
* resorting to mutation or ternary-built object literals.
|
|
12
|
+
*/
|
|
13
|
+
export declare function spreadIfDefined<T, V extends Record<string, unknown>>(value: T | undefined, fn: (v: T) => V): V | Record<string, never>;
|
|
@@ -1520,3 +1520,226 @@ export declare const validateSuggestion: (input: unknown) => {
|
|
|
1520
1520
|
isDeleted: boolean;
|
|
1521
1521
|
})[];
|
|
1522
1522
|
export declare function parseSyncResponse(raw: Record<string, unknown>): SyncResponse;
|
|
1523
|
+
export declare const validateApp: (input: unknown) => {
|
|
1524
|
+
id: string;
|
|
1525
|
+
status: "public";
|
|
1526
|
+
displayName: string;
|
|
1527
|
+
userId: string;
|
|
1528
|
+
createdAt: Date;
|
|
1529
|
+
serviceUrl: string | null;
|
|
1530
|
+
oauthRedirectUri: string | null;
|
|
1531
|
+
description: string | null;
|
|
1532
|
+
iconSm: string | null;
|
|
1533
|
+
iconMd: string | null;
|
|
1534
|
+
iconLg: string | null;
|
|
1535
|
+
appTokenScopes: string[] | null;
|
|
1536
|
+
}, validateAppArray: (input: unknown) => {
|
|
1537
|
+
id: string;
|
|
1538
|
+
status: "public";
|
|
1539
|
+
displayName: string;
|
|
1540
|
+
userId: string;
|
|
1541
|
+
createdAt: Date;
|
|
1542
|
+
serviceUrl: string | null;
|
|
1543
|
+
oauthRedirectUri: string | null;
|
|
1544
|
+
description: string | null;
|
|
1545
|
+
iconSm: string | null;
|
|
1546
|
+
iconMd: string | null;
|
|
1547
|
+
iconLg: string | null;
|
|
1548
|
+
appTokenScopes: string[] | null;
|
|
1549
|
+
}[];
|
|
1550
|
+
export declare const validateAppWithUserCount: (input: unknown) => {
|
|
1551
|
+
id: string;
|
|
1552
|
+
status: "public";
|
|
1553
|
+
displayName: string;
|
|
1554
|
+
userId: string;
|
|
1555
|
+
createdAt: Date;
|
|
1556
|
+
serviceUrl: string | null;
|
|
1557
|
+
oauthRedirectUri: string | null;
|
|
1558
|
+
description: string | null;
|
|
1559
|
+
iconSm: string | null;
|
|
1560
|
+
iconMd: string | null;
|
|
1561
|
+
iconLg: string | null;
|
|
1562
|
+
appTokenScopes: string[] | null;
|
|
1563
|
+
userCount: number;
|
|
1564
|
+
};
|
|
1565
|
+
export declare const validateAppSecrets: (input: unknown) => {
|
|
1566
|
+
clientId: string;
|
|
1567
|
+
clientSecret: string;
|
|
1568
|
+
};
|
|
1569
|
+
export declare const validateAppVerificationToken: (input: unknown) => {
|
|
1570
|
+
verificationToken: string;
|
|
1571
|
+
};
|
|
1572
|
+
export declare const validateAppTestToken: (input: unknown) => {
|
|
1573
|
+
accessToken?: string | null | undefined;
|
|
1574
|
+
};
|
|
1575
|
+
export declare const validateAppDistributionToken: (input: unknown) => {
|
|
1576
|
+
distributionToken: string;
|
|
1577
|
+
};
|
|
1578
|
+
export declare const validateAppByDistributionToken: (input: unknown) => {
|
|
1579
|
+
id: string;
|
|
1580
|
+
displayName: string;
|
|
1581
|
+
description: string | null;
|
|
1582
|
+
iconMd: string | null;
|
|
1583
|
+
appTokenScopes: string[] | null;
|
|
1584
|
+
uiExtensions: {
|
|
1585
|
+
name: string;
|
|
1586
|
+
description: string;
|
|
1587
|
+
icon: string | null;
|
|
1588
|
+
extensionType: "context-menu" | "composer" | "settings";
|
|
1589
|
+
}[];
|
|
1590
|
+
};
|
|
1591
|
+
export declare const validateAppWebhook: (input: unknown) => {
|
|
1592
|
+
status: "active" | "invalid";
|
|
1593
|
+
callbackUrl: string;
|
|
1594
|
+
version: "1";
|
|
1595
|
+
events: ("project:added" | "project:updated" | "project:deleted" | "project:archived" | "project:unarchived" | "item:added" | "item:updated" | "item:completed" | "item:uncompleted" | "item:deleted" | "note:added" | "note:updated" | "note:deleted" | "section:added" | "section:updated" | "section:deleted" | "section:archived" | "section:unarchived" | "label:added" | "label:updated" | "label:deleted" | "filter:added" | "filter:updated" | "filter:deleted" | "reminder:fired")[];
|
|
1596
|
+
};
|
|
1597
|
+
export declare const validateAppInstallation: (input: unknown) => {
|
|
1598
|
+
id: string;
|
|
1599
|
+
creator: string;
|
|
1600
|
+
createdTs: number;
|
|
1601
|
+
installationType: "user";
|
|
1602
|
+
appTokenScopesValidated: boolean;
|
|
1603
|
+
integration: {
|
|
1604
|
+
id: string;
|
|
1605
|
+
status: "public";
|
|
1606
|
+
displayName: string;
|
|
1607
|
+
userId: string;
|
|
1608
|
+
createdAt: Date;
|
|
1609
|
+
serviceUrl: string | null;
|
|
1610
|
+
oauthRedirectUri: string | null;
|
|
1611
|
+
description: string | null;
|
|
1612
|
+
iconSm: string | null;
|
|
1613
|
+
iconMd: string | null;
|
|
1614
|
+
iconLg: string | null;
|
|
1615
|
+
appTokenScopes: string[] | null;
|
|
1616
|
+
} | null;
|
|
1617
|
+
}, validateAppInstallationArray: (input: unknown) => {
|
|
1618
|
+
id: string;
|
|
1619
|
+
creator: string;
|
|
1620
|
+
createdTs: number;
|
|
1621
|
+
installationType: "user";
|
|
1622
|
+
appTokenScopesValidated: boolean;
|
|
1623
|
+
integration: {
|
|
1624
|
+
id: string;
|
|
1625
|
+
status: "public";
|
|
1626
|
+
displayName: string;
|
|
1627
|
+
userId: string;
|
|
1628
|
+
createdAt: Date;
|
|
1629
|
+
serviceUrl: string | null;
|
|
1630
|
+
oauthRedirectUri: string | null;
|
|
1631
|
+
description: string | null;
|
|
1632
|
+
iconSm: string | null;
|
|
1633
|
+
iconMd: string | null;
|
|
1634
|
+
iconLg: string | null;
|
|
1635
|
+
appTokenScopes: string[] | null;
|
|
1636
|
+
} | null;
|
|
1637
|
+
}[];
|
|
1638
|
+
export declare const validateUserAuthorization: (input: unknown) => {
|
|
1639
|
+
accessTokenId: string;
|
|
1640
|
+
scope: string[];
|
|
1641
|
+
scopeDescriptions: string[];
|
|
1642
|
+
createdAt: Date;
|
|
1643
|
+
app: {
|
|
1644
|
+
id: string;
|
|
1645
|
+
displayName: string;
|
|
1646
|
+
description: string | null;
|
|
1647
|
+
serviceUrl: string | null;
|
|
1648
|
+
iconMd: string | null;
|
|
1649
|
+
} | null;
|
|
1650
|
+
}, validateUserAuthorizationArray: (input: unknown) => {
|
|
1651
|
+
accessTokenId: string;
|
|
1652
|
+
scope: string[];
|
|
1653
|
+
scopeDescriptions: string[];
|
|
1654
|
+
createdAt: Date;
|
|
1655
|
+
app: {
|
|
1656
|
+
id: string;
|
|
1657
|
+
displayName: string;
|
|
1658
|
+
description: string | null;
|
|
1659
|
+
serviceUrl: string | null;
|
|
1660
|
+
iconMd: string | null;
|
|
1661
|
+
} | null;
|
|
1662
|
+
}[];
|
|
1663
|
+
export declare const validateUiExtension: (input: unknown) => {
|
|
1664
|
+
id: string;
|
|
1665
|
+
integrationId: string;
|
|
1666
|
+
extensionId: string;
|
|
1667
|
+
url: string;
|
|
1668
|
+
icon: string | null;
|
|
1669
|
+
name: string;
|
|
1670
|
+
description: string;
|
|
1671
|
+
width: number | null;
|
|
1672
|
+
height: number | null;
|
|
1673
|
+
defVersion: number;
|
|
1674
|
+
minimumCardistVersion: string;
|
|
1675
|
+
extensionType: "context-menu";
|
|
1676
|
+
contextType: "task" | "project";
|
|
1677
|
+
} | {
|
|
1678
|
+
id: string;
|
|
1679
|
+
integrationId: string;
|
|
1680
|
+
extensionId: string;
|
|
1681
|
+
url: string;
|
|
1682
|
+
icon: string | null;
|
|
1683
|
+
name: string;
|
|
1684
|
+
description: string;
|
|
1685
|
+
width: number | null;
|
|
1686
|
+
height: number | null;
|
|
1687
|
+
defVersion: number;
|
|
1688
|
+
minimumCardistVersion: string;
|
|
1689
|
+
extensionType: "composer";
|
|
1690
|
+
composerType: "task" | "comment";
|
|
1691
|
+
} | {
|
|
1692
|
+
id: string;
|
|
1693
|
+
integrationId: string;
|
|
1694
|
+
extensionId: string;
|
|
1695
|
+
url: string;
|
|
1696
|
+
icon: string | null;
|
|
1697
|
+
name: string;
|
|
1698
|
+
description: string;
|
|
1699
|
+
width: number | null;
|
|
1700
|
+
height: number | null;
|
|
1701
|
+
defVersion: number;
|
|
1702
|
+
minimumCardistVersion: string;
|
|
1703
|
+
extensionType: "settings";
|
|
1704
|
+
}, validateUiExtensionArray: (input: unknown) => ({
|
|
1705
|
+
id: string;
|
|
1706
|
+
integrationId: string;
|
|
1707
|
+
extensionId: string;
|
|
1708
|
+
url: string;
|
|
1709
|
+
icon: string | null;
|
|
1710
|
+
name: string;
|
|
1711
|
+
description: string;
|
|
1712
|
+
width: number | null;
|
|
1713
|
+
height: number | null;
|
|
1714
|
+
defVersion: number;
|
|
1715
|
+
minimumCardistVersion: string;
|
|
1716
|
+
extensionType: "context-menu";
|
|
1717
|
+
contextType: "task" | "project";
|
|
1718
|
+
} | {
|
|
1719
|
+
id: string;
|
|
1720
|
+
integrationId: string;
|
|
1721
|
+
extensionId: string;
|
|
1722
|
+
url: string;
|
|
1723
|
+
icon: string | null;
|
|
1724
|
+
name: string;
|
|
1725
|
+
description: string;
|
|
1726
|
+
width: number | null;
|
|
1727
|
+
height: number | null;
|
|
1728
|
+
defVersion: number;
|
|
1729
|
+
minimumCardistVersion: string;
|
|
1730
|
+
extensionType: "composer";
|
|
1731
|
+
composerType: "task" | "comment";
|
|
1732
|
+
} | {
|
|
1733
|
+
id: string;
|
|
1734
|
+
integrationId: string;
|
|
1735
|
+
extensionId: string;
|
|
1736
|
+
url: string;
|
|
1737
|
+
icon: string | null;
|
|
1738
|
+
name: string;
|
|
1739
|
+
description: string;
|
|
1740
|
+
width: number | null;
|
|
1741
|
+
height: number | null;
|
|
1742
|
+
defVersion: number;
|
|
1743
|
+
minimumCardistVersion: string;
|
|
1744
|
+
extensionType: "settings";
|
|
1745
|
+
})[];
|
package/package.json
CHANGED