@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
|
@@ -100,6 +100,7 @@ async function request(args) {
|
|
|
100
100
|
break;
|
|
101
101
|
case 'POST':
|
|
102
102
|
case 'PUT':
|
|
103
|
+
case 'PATCH':
|
|
103
104
|
case 'DELETE': {
|
|
104
105
|
// Convert payload from camelCase to snake_case
|
|
105
106
|
// Note: While DELETE with body is uncommon, the Todoist API uses it for some endpoints
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.performSyncRequest = performSyncRequest;
|
|
4
|
+
const endpoints_1 = require("../consts/endpoints");
|
|
5
|
+
const types_1 = require("../types");
|
|
6
|
+
const sync_1 = require("../types/sync");
|
|
7
|
+
const request_helpers_1 = require("../utils/request-helpers");
|
|
8
|
+
const validators_1 = require("../utils/validators");
|
|
9
|
+
const http_client_1 = require("./http-client");
|
|
10
|
+
function serializeUserUpdateArgs(args) {
|
|
11
|
+
return Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({}, args), (0, request_helpers_1.spreadIfDefined)(args.dateFormat, (v) => ({
|
|
12
|
+
dateFormat: sync_1.DATE_FORMAT_TO_API[v],
|
|
13
|
+
}))), (0, request_helpers_1.spreadIfDefined)(args.timeFormat, (v) => ({
|
|
14
|
+
timeFormat: sync_1.TIME_FORMAT_TO_API[v],
|
|
15
|
+
}))), (0, request_helpers_1.spreadIfDefined)(args.startDay, (v) => ({
|
|
16
|
+
startDay: sync_1.DAY_OF_WEEK_TO_API[v],
|
|
17
|
+
}))), (0, request_helpers_1.spreadIfDefined)(args.nextWeek, (v) => ({
|
|
18
|
+
nextWeek: sync_1.DAY_OF_WEEK_TO_API[v],
|
|
19
|
+
})));
|
|
20
|
+
}
|
|
21
|
+
function serializeTaskUpdateDateCompleteArgs(args) {
|
|
22
|
+
return Object.assign(Object.assign(Object.assign({}, args), { isForward: args.isForward ? 1 : 0 }), (0, request_helpers_1.spreadIfDefined)(args.resetSubtasks, (v) => ({
|
|
23
|
+
resetSubtasks: v ? 1 : 0,
|
|
24
|
+
})));
|
|
25
|
+
}
|
|
26
|
+
function serializeUpdateGoalsArgs(args) {
|
|
27
|
+
return Object.assign(Object.assign(Object.assign({}, args), (0, request_helpers_1.spreadIfDefined)(args.vacationMode, (v) => ({ vacationMode: v ? 1 : 0 }))), (0, request_helpers_1.spreadIfDefined)(args.karmaDisabled, (v) => ({
|
|
28
|
+
karmaDisabled: v ? 1 : 0,
|
|
29
|
+
})));
|
|
30
|
+
}
|
|
31
|
+
function preprocessSyncCommands(commands) {
|
|
32
|
+
return commands.map((cmd) => {
|
|
33
|
+
if (cmd.type === 'user_update')
|
|
34
|
+
return Object.assign(Object.assign({}, cmd), { args: serializeUserUpdateArgs(cmd.args) });
|
|
35
|
+
if (cmd.type === 'item_update_date_complete')
|
|
36
|
+
return Object.assign(Object.assign({}, cmd), { args: serializeTaskUpdateDateCompleteArgs(cmd.args) });
|
|
37
|
+
if (cmd.type === 'update_goals')
|
|
38
|
+
return Object.assign(Object.assign({}, cmd), { args: serializeUpdateGoalsArgs(cmd.args) });
|
|
39
|
+
return cmd;
|
|
40
|
+
});
|
|
41
|
+
}
|
|
42
|
+
/**
|
|
43
|
+
* Makes a request to the Sync API and handles error checking.
|
|
44
|
+
*
|
|
45
|
+
* @param ctx - HTTP identity (auth token, sync API base URI, optional custom fetch).
|
|
46
|
+
* @param syncRequest - The sync request payload.
|
|
47
|
+
* @param options - Optional request identifier and commands flag.
|
|
48
|
+
* @returns The sync response data.
|
|
49
|
+
* @throws TodoistRequestError if sync status contains errors.
|
|
50
|
+
*/
|
|
51
|
+
async function performSyncRequest(ctx, syncRequest, options = {}) {
|
|
52
|
+
var _a;
|
|
53
|
+
const { requestId, hasSyncCommands = false } = options;
|
|
54
|
+
const processedRequest = ((_a = syncRequest.commands) === null || _a === void 0 ? void 0 : _a.length)
|
|
55
|
+
? Object.assign(Object.assign({}, syncRequest), { commands: preprocessSyncCommands(syncRequest.commands) }) : syncRequest;
|
|
56
|
+
const response = await (0, http_client_1.request)({
|
|
57
|
+
httpMethod: 'POST',
|
|
58
|
+
baseUri: ctx.syncApiBase,
|
|
59
|
+
relativePath: endpoints_1.ENDPOINT_SYNC,
|
|
60
|
+
apiToken: ctx.authToken,
|
|
61
|
+
customFetch: ctx.customFetch,
|
|
62
|
+
payload: processedRequest,
|
|
63
|
+
requestId: requestId,
|
|
64
|
+
hasSyncCommands: hasSyncCommands,
|
|
65
|
+
});
|
|
66
|
+
// Check for sync errors and throw if any are found
|
|
67
|
+
if (response.data.syncStatus) {
|
|
68
|
+
Object.entries(response.data.syncStatus).forEach(([_, value]) => {
|
|
69
|
+
if (value === 'ok')
|
|
70
|
+
return;
|
|
71
|
+
throw new types_1.TodoistRequestError(value.error, value.httpCode, value.errorExtra);
|
|
72
|
+
});
|
|
73
|
+
}
|
|
74
|
+
return (0, validators_1.parseSyncResponse)(response.data);
|
|
75
|
+
}
|
|
@@ -0,0 +1,18 @@
|
|
|
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
|
+
__exportStar(require("./types"), exports);
|
|
18
|
+
__exportStar(require("./requests"), exports);
|
|
@@ -0,0 +1,253 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.UserAuthorizationSchema = exports.UserAuthorizationAppSchema = exports.AppInstallationSchema = exports.InstalledIntegrationSchema = exports.AppWebhookSchema = exports.AppByDistributionTokenSchema = exports.AppByDistributionTokenUiExtensionSchema = exports.AppDistributionTokenSchema = exports.AppTestTokenSchema = exports.AppVerificationTokenSchema = exports.AppSecretsSchema = exports.AppWithUserCountSchema = exports.AppSchema = exports.AppTokenScopesSchema = exports.InstallationTypeSchema = exports.INSTALLATION_TYPES = exports.WebhookVersionSchema = exports.WEBHOOK_VERSIONS = exports.WebhookStatusSchema = exports.WEBHOOK_STATUSES = exports.WebhookEventWireNameSchema = exports.WEBHOOK_EVENT_WIRE_NAMES = exports.WebhookEventSchema = exports.WEBHOOK_EVENTS = exports.AppStatusSchema = exports.APP_STATUSES = void 0;
|
|
4
|
+
exports.webhookEventFromWireName = webhookEventFromWireName;
|
|
5
|
+
exports.webhookEventToWireName = webhookEventToWireName;
|
|
6
|
+
const zod_1 = require("zod");
|
|
7
|
+
const common_1 = require("../common");
|
|
8
|
+
const types_1 = require("../ui-extensions/types");
|
|
9
|
+
/**
|
|
10
|
+
* Available statuses for a developer application.
|
|
11
|
+
*/
|
|
12
|
+
exports.APP_STATUSES = ['public'];
|
|
13
|
+
exports.AppStatusSchema = zod_1.z.enum(exports.APP_STATUSES);
|
|
14
|
+
/**
|
|
15
|
+
* Webhook event types that can be subscribed to.
|
|
16
|
+
*
|
|
17
|
+
* These are the friendly public names the backend uses in webhook payloads.
|
|
18
|
+
* The on-the-wire config endpoint uses a different (legacy) form (see
|
|
19
|
+
* {@link WEBHOOK_EVENT_WIRE_NAMES}); the SDK converts between the two
|
|
20
|
+
* so consumers only ever work with these pretty names.
|
|
21
|
+
*
|
|
22
|
+
* @see https://developer.todoist.com/sync/v1/#webhooks
|
|
23
|
+
*/
|
|
24
|
+
exports.WEBHOOK_EVENTS = [
|
|
25
|
+
'item:added',
|
|
26
|
+
'item:updated',
|
|
27
|
+
'item:completed',
|
|
28
|
+
'item:uncompleted',
|
|
29
|
+
'item:deleted',
|
|
30
|
+
'note:added',
|
|
31
|
+
'note:updated',
|
|
32
|
+
'note:deleted',
|
|
33
|
+
'project:added',
|
|
34
|
+
'project:updated',
|
|
35
|
+
'project:deleted',
|
|
36
|
+
'project:archived',
|
|
37
|
+
'project:unarchived',
|
|
38
|
+
'section:added',
|
|
39
|
+
'section:updated',
|
|
40
|
+
'section:deleted',
|
|
41
|
+
'section:archived',
|
|
42
|
+
'section:unarchived',
|
|
43
|
+
'label:added',
|
|
44
|
+
'label:updated',
|
|
45
|
+
'label:deleted',
|
|
46
|
+
'filter:added',
|
|
47
|
+
'filter:updated',
|
|
48
|
+
'filter:deleted',
|
|
49
|
+
'reminder:fired',
|
|
50
|
+
];
|
|
51
|
+
exports.WebhookEventSchema = zod_1.z.enum(exports.WEBHOOK_EVENTS);
|
|
52
|
+
/**
|
|
53
|
+
* Raw wire-format webhook event names used by the config endpoint
|
|
54
|
+
* (`POST/GET /apps/<id>/webhook`). Exported for completeness — prefer
|
|
55
|
+
* {@link WEBHOOK_EVENTS} when working with the SDK.
|
|
56
|
+
*/
|
|
57
|
+
exports.WEBHOOK_EVENT_WIRE_NAMES = [
|
|
58
|
+
'e_item_added',
|
|
59
|
+
'e_item_updated',
|
|
60
|
+
'e_item_completed',
|
|
61
|
+
'e_item_uncompleted',
|
|
62
|
+
'e_item_deleted',
|
|
63
|
+
'e_note_added',
|
|
64
|
+
'e_note_updated',
|
|
65
|
+
'e_note_deleted',
|
|
66
|
+
'e_project_added',
|
|
67
|
+
'e_project_updated',
|
|
68
|
+
'e_project_deleted',
|
|
69
|
+
'e_project_archived',
|
|
70
|
+
'e_project_unarchived',
|
|
71
|
+
'e_section_added',
|
|
72
|
+
'e_section_updated',
|
|
73
|
+
'e_section_deleted',
|
|
74
|
+
'e_section_archived',
|
|
75
|
+
'e_section_unarchived',
|
|
76
|
+
'e_label_added',
|
|
77
|
+
'e_label_updated',
|
|
78
|
+
'e_label_deleted',
|
|
79
|
+
'e_filter_added',
|
|
80
|
+
'e_filter_updated',
|
|
81
|
+
'e_filter_deleted',
|
|
82
|
+
'e_reminder_fired',
|
|
83
|
+
];
|
|
84
|
+
exports.WebhookEventWireNameSchema = zod_1.z.enum(exports.WEBHOOK_EVENT_WIRE_NAMES);
|
|
85
|
+
/**
|
|
86
|
+
* Translates a wire-format event name (`'e_item_added'`) to its pretty form (`'item:added'`).
|
|
87
|
+
*/
|
|
88
|
+
function webhookEventFromWireName(wireName) {
|
|
89
|
+
// Strip leading `e_`, replace first `_` with `:`. The resulting string is
|
|
90
|
+
// guaranteed to be a `WebhookEvent` by construction of the two const arrays.
|
|
91
|
+
return wireName.slice(2).replace('_', ':');
|
|
92
|
+
}
|
|
93
|
+
/**
|
|
94
|
+
* Translates a pretty event name (`'item:added'`) to its wire-format form (`'e_item_added'`).
|
|
95
|
+
*/
|
|
96
|
+
function webhookEventToWireName(event) {
|
|
97
|
+
return ('e_' + event.replace(':', '_'));
|
|
98
|
+
}
|
|
99
|
+
/**
|
|
100
|
+
* Available statuses for an app webhook.
|
|
101
|
+
*/
|
|
102
|
+
exports.WEBHOOK_STATUSES = ['active', 'invalid'];
|
|
103
|
+
exports.WebhookStatusSchema = zod_1.z.enum(exports.WEBHOOK_STATUSES);
|
|
104
|
+
/**
|
|
105
|
+
* Supported webhook payload versions. v9 is deprecated and intentionally excluded.
|
|
106
|
+
*/
|
|
107
|
+
exports.WEBHOOK_VERSIONS = ['1'];
|
|
108
|
+
exports.WebhookVersionSchema = zod_1.z.enum(exports.WEBHOOK_VERSIONS);
|
|
109
|
+
/**
|
|
110
|
+
* Available installation types for an app installation.
|
|
111
|
+
*/
|
|
112
|
+
exports.INSTALLATION_TYPES = ['user'];
|
|
113
|
+
exports.InstallationTypeSchema = zod_1.z.enum(exports.INSTALLATION_TYPES);
|
|
114
|
+
/**
|
|
115
|
+
* Transforms a comma-separated scope string into `string[] | null`.
|
|
116
|
+
*
|
|
117
|
+
* The backend stores `app_token_scopes` as a single comma-separated string
|
|
118
|
+
* (e.g. `"data:read,task:add"`). Reads are exposed as `string[]` (rather than
|
|
119
|
+
* `Permission[]`) so that newly added backend scopes don't break parsing —
|
|
120
|
+
* writes accept `Permission` for autocomplete while still permitting `string`
|
|
121
|
+
* (via `UpdateAppArgs`), so a fetched `App.appTokenScopes` can be round-tripped
|
|
122
|
+
* back into `updateApp()` without casts.
|
|
123
|
+
*
|
|
124
|
+
* Preserves `null` on read (backend returns `null` for apps that have had
|
|
125
|
+
* their scopes cleared via `updateApp({ appTokenScopes: null })`) so the
|
|
126
|
+
* read and write shapes line up and information is not lost.
|
|
127
|
+
*/
|
|
128
|
+
exports.AppTokenScopesSchema = zod_1.z
|
|
129
|
+
.string()
|
|
130
|
+
.nullable()
|
|
131
|
+
.transform((value) => {
|
|
132
|
+
if (value === null)
|
|
133
|
+
return null;
|
|
134
|
+
if (value === '')
|
|
135
|
+
return [];
|
|
136
|
+
return value.split(',').filter(Boolean);
|
|
137
|
+
});
|
|
138
|
+
/**
|
|
139
|
+
* Schema for a developer application.
|
|
140
|
+
* @see https://developer.todoist.com/api/v1/#tag/Apps
|
|
141
|
+
*/
|
|
142
|
+
exports.AppSchema = zod_1.z.object({
|
|
143
|
+
id: common_1.StringOrNumberSchema,
|
|
144
|
+
status: exports.AppStatusSchema,
|
|
145
|
+
displayName: zod_1.z.string(),
|
|
146
|
+
userId: common_1.StringOrNumberSchema,
|
|
147
|
+
createdAt: zod_1.z.coerce.date(),
|
|
148
|
+
serviceUrl: zod_1.z.string().nullable(),
|
|
149
|
+
oauthRedirectUri: zod_1.z.string().nullable(),
|
|
150
|
+
description: zod_1.z.string().nullable(),
|
|
151
|
+
iconSm: zod_1.z.string().nullable(),
|
|
152
|
+
iconMd: zod_1.z.string().nullable(),
|
|
153
|
+
iconLg: zod_1.z.string().nullable(),
|
|
154
|
+
appTokenScopes: exports.AppTokenScopesSchema,
|
|
155
|
+
});
|
|
156
|
+
/**
|
|
157
|
+
* Schema for a developer application that includes the user count.
|
|
158
|
+
* Returned by most endpoints that manage a single app (get, update, delete).
|
|
159
|
+
*/
|
|
160
|
+
exports.AppWithUserCountSchema = exports.AppSchema.extend({
|
|
161
|
+
userCount: zod_1.z.number().int(),
|
|
162
|
+
});
|
|
163
|
+
/**
|
|
164
|
+
* OAuth client credentials for a developer application.
|
|
165
|
+
*/
|
|
166
|
+
exports.AppSecretsSchema = zod_1.z.object({
|
|
167
|
+
clientId: zod_1.z.string(),
|
|
168
|
+
clientSecret: zod_1.z.string(),
|
|
169
|
+
});
|
|
170
|
+
/**
|
|
171
|
+
* Webhook verification token for a developer application.
|
|
172
|
+
*/
|
|
173
|
+
exports.AppVerificationTokenSchema = zod_1.z.object({
|
|
174
|
+
verificationToken: zod_1.z.string(),
|
|
175
|
+
});
|
|
176
|
+
/**
|
|
177
|
+
* Developer test access token for a developer application.
|
|
178
|
+
*/
|
|
179
|
+
exports.AppTestTokenSchema = zod_1.z.object({
|
|
180
|
+
accessToken: zod_1.z.string().nullish(),
|
|
181
|
+
});
|
|
182
|
+
/**
|
|
183
|
+
* Distribution token for a developer application.
|
|
184
|
+
*/
|
|
185
|
+
exports.AppDistributionTokenSchema = zod_1.z.object({
|
|
186
|
+
distributionToken: zod_1.z.string(),
|
|
187
|
+
});
|
|
188
|
+
/**
|
|
189
|
+
* Subset of an app returned when resolving by distribution token — used by the installation flow.
|
|
190
|
+
* Includes a lightweight list of the app's UI extensions (not full `UIExtension` records).
|
|
191
|
+
*/
|
|
192
|
+
exports.AppByDistributionTokenUiExtensionSchema = zod_1.z.object({
|
|
193
|
+
name: zod_1.z.string(),
|
|
194
|
+
description: zod_1.z.string(),
|
|
195
|
+
icon: zod_1.z.string().nullable(),
|
|
196
|
+
extensionType: zod_1.z.enum(types_1.UI_EXTENSION_TYPES),
|
|
197
|
+
});
|
|
198
|
+
exports.AppByDistributionTokenSchema = zod_1.z.object({
|
|
199
|
+
id: common_1.StringOrNumberSchema,
|
|
200
|
+
displayName: zod_1.z.string(),
|
|
201
|
+
description: zod_1.z.string().nullable(),
|
|
202
|
+
iconMd: zod_1.z.string().nullable(),
|
|
203
|
+
appTokenScopes: exports.AppTokenScopesSchema,
|
|
204
|
+
uiExtensions: zod_1.z.array(exports.AppByDistributionTokenUiExtensionSchema),
|
|
205
|
+
});
|
|
206
|
+
/**
|
|
207
|
+
* Schema for an app webhook.
|
|
208
|
+
*
|
|
209
|
+
* Events arrive from the wire in their `e_*` form and are transformed to
|
|
210
|
+
* their pretty `item:added`-style names for SDK consumers.
|
|
211
|
+
*/
|
|
212
|
+
exports.AppWebhookSchema = zod_1.z.object({
|
|
213
|
+
status: exports.WebhookStatusSchema,
|
|
214
|
+
callbackUrl: zod_1.z.string(),
|
|
215
|
+
version: exports.WebhookVersionSchema,
|
|
216
|
+
events: zod_1.z.array(exports.WebhookEventWireNameSchema.transform(webhookEventFromWireName)),
|
|
217
|
+
});
|
|
218
|
+
/**
|
|
219
|
+
* Lightweight view of an app embedded in an installation record.
|
|
220
|
+
* Mirrors `AppSchema` shape — backend returns the same `ApplicationRestView`.
|
|
221
|
+
*/
|
|
222
|
+
exports.InstalledIntegrationSchema = exports.AppSchema;
|
|
223
|
+
/**
|
|
224
|
+
* Schema for an installed application (integration installed to a user's account).
|
|
225
|
+
*/
|
|
226
|
+
exports.AppInstallationSchema = zod_1.z.object({
|
|
227
|
+
id: common_1.StringOrNumberSchema,
|
|
228
|
+
creator: common_1.StringOrNumberSchema,
|
|
229
|
+
createdTs: zod_1.z.number().int(),
|
|
230
|
+
installationType: exports.InstallationTypeSchema,
|
|
231
|
+
appTokenScopesValidated: zod_1.z.boolean(),
|
|
232
|
+
integration: exports.InstalledIntegrationSchema.nullable(),
|
|
233
|
+
});
|
|
234
|
+
/**
|
|
235
|
+
* Lightweight app info included on a user authorization record.
|
|
236
|
+
*/
|
|
237
|
+
exports.UserAuthorizationAppSchema = zod_1.z.object({
|
|
238
|
+
id: common_1.StringOrNumberSchema,
|
|
239
|
+
displayName: zod_1.z.string(),
|
|
240
|
+
description: zod_1.z.string().nullable(),
|
|
241
|
+
serviceUrl: zod_1.z.string().nullable(),
|
|
242
|
+
iconMd: zod_1.z.string().nullable(),
|
|
243
|
+
});
|
|
244
|
+
/**
|
|
245
|
+
* Schema for a user authorization entry — a token the user has granted to a third-party app.
|
|
246
|
+
*/
|
|
247
|
+
exports.UserAuthorizationSchema = zod_1.z.object({
|
|
248
|
+
accessTokenId: common_1.StringOrNumberSchema,
|
|
249
|
+
scope: zod_1.z.array(zod_1.z.string()),
|
|
250
|
+
scopeDescriptions: zod_1.z.array(zod_1.z.string()),
|
|
251
|
+
createdAt: zod_1.z.coerce.date(),
|
|
252
|
+
app: exports.UserAuthorizationAppSchema.nullable(),
|
|
253
|
+
});
|
package/dist/cjs/types/index.js
CHANGED
|
@@ -34,3 +34,5 @@ __exportStar(require("./templates"), exports);
|
|
|
34
34
|
__exportStar(require("./errors"), exports);
|
|
35
35
|
__exportStar(require("./http"), exports);
|
|
36
36
|
__exportStar(require("./sync"), exports);
|
|
37
|
+
__exportStar(require("./apps"), exports);
|
|
38
|
+
__exportStar(require("./ui-extensions"), exports);
|
|
@@ -0,0 +1,18 @@
|
|
|
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
|
+
__exportStar(require("./types"), exports);
|
|
18
|
+
__exportStar(require("./requests"), exports);
|
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.UiExtensionSchema = exports.SettingsExtensionSchema = exports.ComposerExtensionSchema = exports.ContextMenuExtensionSchema = exports.UiExtensionBaseSchema = exports.ComposerExtensionContextSchema = exports.COMPOSER_EXTENSION_CONTEXTS = exports.ContextMenuExtensionContextSchema = exports.CONTEXT_MENU_EXTENSION_CONTEXTS = exports.UI_EXTENSION_TYPES = exports.UiExtensionTypeEnum = void 0;
|
|
4
|
+
const zod_1 = require("zod");
|
|
5
|
+
const common_1 = require("../common");
|
|
6
|
+
/**
|
|
7
|
+
* Discriminator values for the UI extension variants.
|
|
8
|
+
* Exposed as an enum-like object because the values are used in `z.literal()`
|
|
9
|
+
* across multiple variant schemas (see AGENTS.md "Discriminated unions" exception).
|
|
10
|
+
*/
|
|
11
|
+
exports.UiExtensionTypeEnum = {
|
|
12
|
+
ContextMenu: 'context-menu',
|
|
13
|
+
Composer: 'composer',
|
|
14
|
+
Settings: 'settings',
|
|
15
|
+
};
|
|
16
|
+
/**
|
|
17
|
+
* All UI extension type values.
|
|
18
|
+
*/
|
|
19
|
+
exports.UI_EXTENSION_TYPES = [
|
|
20
|
+
exports.UiExtensionTypeEnum.ContextMenu,
|
|
21
|
+
exports.UiExtensionTypeEnum.Composer,
|
|
22
|
+
exports.UiExtensionTypeEnum.Settings,
|
|
23
|
+
];
|
|
24
|
+
/**
|
|
25
|
+
* Context locations where a context-menu extension can appear.
|
|
26
|
+
*/
|
|
27
|
+
exports.CONTEXT_MENU_EXTENSION_CONTEXTS = ['project', 'task'];
|
|
28
|
+
exports.ContextMenuExtensionContextSchema = zod_1.z.enum(exports.CONTEXT_MENU_EXTENSION_CONTEXTS);
|
|
29
|
+
/**
|
|
30
|
+
* Composer locations where a composer extension can appear.
|
|
31
|
+
*/
|
|
32
|
+
exports.COMPOSER_EXTENSION_CONTEXTS = ['task', 'comment'];
|
|
33
|
+
exports.ComposerExtensionContextSchema = zod_1.z.enum(exports.COMPOSER_EXTENSION_CONTEXTS);
|
|
34
|
+
/**
|
|
35
|
+
* Shared fields across all UI extension variants.
|
|
36
|
+
*/
|
|
37
|
+
exports.UiExtensionBaseSchema = zod_1.z.object({
|
|
38
|
+
id: common_1.StringOrNumberSchema,
|
|
39
|
+
integrationId: common_1.StringOrNumberSchema,
|
|
40
|
+
extensionId: zod_1.z.string(),
|
|
41
|
+
url: zod_1.z.string(),
|
|
42
|
+
icon: zod_1.z.string().nullable(),
|
|
43
|
+
name: zod_1.z.string(),
|
|
44
|
+
description: zod_1.z.string(),
|
|
45
|
+
width: zod_1.z.number().int().nullable(),
|
|
46
|
+
height: zod_1.z.number().int().nullable(),
|
|
47
|
+
defVersion: zod_1.z.number().int(),
|
|
48
|
+
minimumCardistVersion: zod_1.z.string(),
|
|
49
|
+
});
|
|
50
|
+
/**
|
|
51
|
+
* Schema for a context-menu UI extension.
|
|
52
|
+
*/
|
|
53
|
+
exports.ContextMenuExtensionSchema = exports.UiExtensionBaseSchema.extend({
|
|
54
|
+
extensionType: zod_1.z.literal(exports.UiExtensionTypeEnum.ContextMenu),
|
|
55
|
+
contextType: exports.ContextMenuExtensionContextSchema,
|
|
56
|
+
});
|
|
57
|
+
/**
|
|
58
|
+
* Schema for a composer UI extension.
|
|
59
|
+
*/
|
|
60
|
+
exports.ComposerExtensionSchema = exports.UiExtensionBaseSchema.extend({
|
|
61
|
+
extensionType: zod_1.z.literal(exports.UiExtensionTypeEnum.Composer),
|
|
62
|
+
composerType: exports.ComposerExtensionContextSchema,
|
|
63
|
+
});
|
|
64
|
+
/**
|
|
65
|
+
* Schema for a settings UI extension.
|
|
66
|
+
*/
|
|
67
|
+
exports.SettingsExtensionSchema = exports.UiExtensionBaseSchema.extend({
|
|
68
|
+
extensionType: zod_1.z.literal(exports.UiExtensionTypeEnum.Settings),
|
|
69
|
+
});
|
|
70
|
+
/**
|
|
71
|
+
* Discriminated union of all UI extension variants.
|
|
72
|
+
*/
|
|
73
|
+
exports.UiExtensionSchema = zod_1.z.discriminatedUnion('extensionType', [
|
|
74
|
+
exports.ContextMenuExtensionSchema,
|
|
75
|
+
exports.ComposerExtensionSchema,
|
|
76
|
+
exports.SettingsExtensionSchema,
|
|
77
|
+
]);
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.headersToRecord = headersToRecord;
|
|
4
|
+
/**
|
|
5
|
+
* Converts a native Fetch `Headers` object into a plain `Record<string, string>`.
|
|
6
|
+
* Used when wrapping a native `fetch` response into the SDK's `FileResponse`
|
|
7
|
+
* shape (which expects headers as a plain record for symmetry with
|
|
8
|
+
* `CustomFetchResponse`).
|
|
9
|
+
*/
|
|
10
|
+
function headersToRecord(headers) {
|
|
11
|
+
const result = {};
|
|
12
|
+
headers.forEach((value, key) => {
|
|
13
|
+
result[key] = value;
|
|
14
|
+
});
|
|
15
|
+
return result;
|
|
16
|
+
}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.generatePath = generatePath;
|
|
4
|
+
exports.spreadIfDefined = spreadIfDefined;
|
|
5
|
+
/**
|
|
6
|
+
* Joins path segments using `/` separator.
|
|
7
|
+
* @param segments A list of **valid** path segments.
|
|
8
|
+
* @returns A joined path.
|
|
9
|
+
*/
|
|
10
|
+
function generatePath(...segments) {
|
|
11
|
+
return segments.join('/');
|
|
12
|
+
}
|
|
13
|
+
/**
|
|
14
|
+
* Returns `fn(value)` spread into an object if `value` is defined, otherwise an empty object.
|
|
15
|
+
*
|
|
16
|
+
* Used to conditionally include a property on a payload object without
|
|
17
|
+
* resorting to mutation or ternary-built object literals.
|
|
18
|
+
*/
|
|
19
|
+
function spreadIfDefined(value, fn) {
|
|
20
|
+
return value !== undefined ? fn(value) : {};
|
|
21
|
+
}
|
|
@@ -1,23 +1,25 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y, _z, _0, _1, _2, _3, _4, _5, _6, _7, _8;
|
|
2
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y, _z, _0, _1, _2, _3, _4, _5, _6, _7, _8, _9, _10, _11, _12;
|
|
3
3
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
4
|
exports.validateFolderArray = exports.validateFolder = exports.validateCollaboratorStateArray = exports.validateCollaboratorState = exports.validateCollaboratorArray = exports.validateCollaborator = exports.validateFilterArray = exports.validateFilter = exports.validateMovedIdArray = exports.validateMovedId = exports.validateIdMappingArray = exports.validateIdMapping = exports.validateBackupArray = exports.validateBackup = exports.validateWorkspaceInsights = exports.validateProjectProgress = exports.validateProjectHealthContext = exports.validateProjectHealth = exports.validateProjectActivityStats = exports.validateWorkspaceUserTaskArray = exports.validateWorkspaceUserTask = exports.validateMemberActivityInfoArray = exports.validateMemberActivityInfo = exports.validateWorkspaceArray = exports.validateWorkspace = exports.validateJoinWorkspaceResult = exports.validateWorkspacePlanDetails = exports.validateWorkspaceInvitationArray = exports.validateWorkspaceInvitation = exports.validateWorkspaceUserArray = exports.validateWorkspaceUser = exports.validateAttachment = exports.validateActivityEventArray = exports.validateActivityEvent = exports.validateCurrentUser = exports.validateProductivityStats = exports.validateUserArray = exports.validateUser = exports.validateCommentArray = exports.validateComment = exports.validateLabelArray = exports.validateLabel = exports.validateSectionArray = exports.validateSection = exports.validateWorkspaceProjectArray = exports.validateWorkspaceProject = exports.validateProjectArray = exports.validateProject = exports.validateTaskArray = exports.validateTask = void 0;
|
|
5
|
-
exports.validateSuggestionArray = exports.validateSuggestion = exports.validateUserSettings = exports.validateSyncUser = exports.validateSyncWorkspaceArray = exports.validateSyncWorkspace = exports.validateLiveNotificationArray = exports.validateLiveNotification = exports.validateUserPlanLimits = exports.validateProjectViewOptionsDefaultsArray = exports.validateProjectViewOptionsDefaults = exports.validateViewOptionsArray = exports.validateViewOptions = exports.validateCompletedInfoArray = exports.validateCompletedInfo = exports.validateLocationReminderArray = exports.validateLocationReminder = exports.validateReminderArray = exports.validateReminder = exports.validateCalendarAccountArray = exports.validateCalendarAccount = exports.validateCalendarArray = exports.validateCalendar = exports.validateWorkspaceGoalArray = exports.validateWorkspaceGoal = exports.validateWorkspaceFilterArray = exports.validateWorkspaceFilter = exports.validateTooltips = exports.validateNoteArray = exports.validateNote = void 0;
|
|
5
|
+
exports.validateUiExtensionArray = exports.validateUiExtension = exports.validateUserAuthorizationArray = exports.validateUserAuthorization = exports.validateAppInstallationArray = exports.validateAppInstallation = exports.validateAppWebhook = exports.validateAppByDistributionToken = exports.validateAppDistributionToken = exports.validateAppTestToken = exports.validateAppVerificationToken = exports.validateAppSecrets = exports.validateAppWithUserCount = exports.validateAppArray = exports.validateApp = exports.validateSuggestionArray = exports.validateSuggestion = exports.validateUserSettings = exports.validateSyncUser = exports.validateSyncWorkspaceArray = exports.validateSyncWorkspace = exports.validateLiveNotificationArray = exports.validateLiveNotification = exports.validateUserPlanLimits = exports.validateProjectViewOptionsDefaultsArray = exports.validateProjectViewOptionsDefaults = exports.validateViewOptionsArray = exports.validateViewOptions = exports.validateCompletedInfoArray = exports.validateCompletedInfo = exports.validateLocationReminderArray = exports.validateLocationReminder = exports.validateReminderArray = exports.validateReminder = exports.validateCalendarAccountArray = exports.validateCalendarAccount = exports.validateCalendarArray = exports.validateCalendar = exports.validateWorkspaceGoalArray = exports.validateWorkspaceGoal = exports.validateWorkspaceFilterArray = exports.validateWorkspaceFilter = exports.validateTooltips = exports.validateNoteArray = exports.validateNote = void 0;
|
|
6
6
|
exports.parseSyncResponse = parseSyncResponse;
|
|
7
7
|
const zod_1 = require("zod");
|
|
8
8
|
const types_1 = require("../types/activity/types");
|
|
9
|
-
const types_2 = require("../types/
|
|
10
|
-
const types_3 = require("../types/
|
|
11
|
-
const types_4 = require("../types/
|
|
12
|
-
const types_5 = require("../types/
|
|
13
|
-
const types_6 = require("../types/
|
|
14
|
-
const types_7 = require("../types/
|
|
15
|
-
const types_8 = require("../types/
|
|
16
|
-
const types_9 = require("../types/
|
|
9
|
+
const types_2 = require("../types/apps/types");
|
|
10
|
+
const types_3 = require("../types/backups/types");
|
|
11
|
+
const types_4 = require("../types/comments/types");
|
|
12
|
+
const types_5 = require("../types/id-mappings/types");
|
|
13
|
+
const types_6 = require("../types/insights/types");
|
|
14
|
+
const types_7 = require("../types/labels/types");
|
|
15
|
+
const types_8 = require("../types/productivity/types");
|
|
16
|
+
const types_9 = require("../types/projects/types");
|
|
17
|
+
const types_10 = require("../types/sections/types");
|
|
17
18
|
const response_1 = require("../types/sync/response");
|
|
18
|
-
const
|
|
19
|
-
const
|
|
20
|
-
const
|
|
19
|
+
const types_11 = require("../types/tasks/types");
|
|
20
|
+
const types_12 = require("../types/ui-extensions/types");
|
|
21
|
+
const types_13 = require("../types/users/types");
|
|
22
|
+
const types_14 = require("../types/workspaces/types");
|
|
21
23
|
const resources_1 = require("../types/sync/resources");
|
|
22
24
|
function createValidator(schema) {
|
|
23
25
|
return {
|
|
@@ -26,37 +28,37 @@ function createValidator(schema) {
|
|
|
26
28
|
};
|
|
27
29
|
}
|
|
28
30
|
// Entity validators
|
|
29
|
-
_a = createValidator(
|
|
31
|
+
_a = createValidator(types_11.TaskSchema), exports.validateTask = _a.validate, exports.validateTaskArray = _a.validateArray;
|
|
30
32
|
/**
|
|
31
33
|
* Validates and parses a project input.
|
|
32
34
|
* @param input The input to validate
|
|
33
35
|
* @returns A validated project (either PersonalProject or WorkspaceProject)
|
|
34
36
|
*/
|
|
35
|
-
_b = createValidator(
|
|
36
|
-
_c = createValidator(
|
|
37
|
-
_d = createValidator(
|
|
38
|
-
_e = createValidator(
|
|
39
|
-
_f = createValidator(
|
|
40
|
-
_g = createValidator(
|
|
41
|
-
exports.validateProductivityStats = createValidator(
|
|
42
|
-
exports.validateCurrentUser = createValidator(
|
|
37
|
+
_b = createValidator(types_9.ProjectSchema), exports.validateProject = _b.validate, exports.validateProjectArray = _b.validateArray;
|
|
38
|
+
_c = createValidator(types_9.WorkspaceProjectSchema), exports.validateWorkspaceProject = _c.validate, exports.validateWorkspaceProjectArray = _c.validateArray;
|
|
39
|
+
_d = createValidator(types_10.SectionSchema), exports.validateSection = _d.validate, exports.validateSectionArray = _d.validateArray;
|
|
40
|
+
_e = createValidator(types_7.LabelSchema), exports.validateLabel = _e.validate, exports.validateLabelArray = _e.validateArray;
|
|
41
|
+
_f = createValidator(types_4.CommentSchema), exports.validateComment = _f.validate, exports.validateCommentArray = _f.validateArray;
|
|
42
|
+
_g = createValidator(types_13.UserSchema), exports.validateUser = _g.validate, exports.validateUserArray = _g.validateArray;
|
|
43
|
+
exports.validateProductivityStats = createValidator(types_8.ProductivityStatsSchema).validate;
|
|
44
|
+
exports.validateCurrentUser = createValidator(types_13.CurrentUserSchema).validate;
|
|
43
45
|
_h = createValidator(types_1.ActivityEventSchema), exports.validateActivityEvent = _h.validate, exports.validateActivityEventArray = _h.validateArray;
|
|
44
|
-
exports.validateAttachment = createValidator(
|
|
45
|
-
_j = createValidator(
|
|
46
|
-
_k = createValidator(
|
|
47
|
-
exports.validateWorkspacePlanDetails = createValidator(
|
|
48
|
-
exports.validateJoinWorkspaceResult = createValidator(
|
|
49
|
-
_l = createValidator(
|
|
50
|
-
_m = createValidator(
|
|
51
|
-
_o = createValidator(
|
|
52
|
-
exports.validateProjectActivityStats = createValidator(
|
|
53
|
-
exports.validateProjectHealth = createValidator(
|
|
54
|
-
exports.validateProjectHealthContext = createValidator(
|
|
55
|
-
exports.validateProjectProgress = createValidator(
|
|
56
|
-
exports.validateWorkspaceInsights = createValidator(
|
|
57
|
-
_p = createValidator(
|
|
58
|
-
_q = createValidator(
|
|
59
|
-
_r = createValidator(
|
|
46
|
+
exports.validateAttachment = createValidator(types_4.AttachmentSchema).validate;
|
|
47
|
+
_j = createValidator(types_14.WorkspaceUserSchema), exports.validateWorkspaceUser = _j.validate, exports.validateWorkspaceUserArray = _j.validateArray;
|
|
48
|
+
_k = createValidator(types_14.WorkspaceInvitationSchema), exports.validateWorkspaceInvitation = _k.validate, exports.validateWorkspaceInvitationArray = _k.validateArray;
|
|
49
|
+
exports.validateWorkspacePlanDetails = createValidator(types_14.WorkspacePlanDetailsSchema).validate;
|
|
50
|
+
exports.validateJoinWorkspaceResult = createValidator(types_14.JoinWorkspaceResultSchema).validate;
|
|
51
|
+
_l = createValidator(types_14.WorkspaceSchema), exports.validateWorkspace = _l.validate, exports.validateWorkspaceArray = _l.validateArray;
|
|
52
|
+
_m = createValidator(types_14.MemberActivityInfoSchema), exports.validateMemberActivityInfo = _m.validate, exports.validateMemberActivityInfoArray = _m.validateArray;
|
|
53
|
+
_o = createValidator(types_14.WorkspaceUserTaskSchema), exports.validateWorkspaceUserTask = _o.validate, exports.validateWorkspaceUserTaskArray = _o.validateArray;
|
|
54
|
+
exports.validateProjectActivityStats = createValidator(types_6.ProjectActivityStatsSchema).validate;
|
|
55
|
+
exports.validateProjectHealth = createValidator(types_6.ProjectHealthSchema).validate;
|
|
56
|
+
exports.validateProjectHealthContext = createValidator(types_6.ProjectHealthContextSchema).validate;
|
|
57
|
+
exports.validateProjectProgress = createValidator(types_6.ProjectProgressSchema).validate;
|
|
58
|
+
exports.validateWorkspaceInsights = createValidator(types_6.WorkspaceInsightsSchema).validate;
|
|
59
|
+
_p = createValidator(types_3.BackupSchema), exports.validateBackup = _p.validate, exports.validateBackupArray = _p.validateArray;
|
|
60
|
+
_q = createValidator(types_5.IdMappingSchema), exports.validateIdMapping = _q.validate, exports.validateIdMappingArray = _q.validateArray;
|
|
61
|
+
_r = createValidator(types_5.MovedIdSchema), exports.validateMovedId = _r.validate, exports.validateMovedIdArray = _r.validateArray;
|
|
60
62
|
// Sync resource validators
|
|
61
63
|
_s = createValidator(resources_1.FilterSchema), exports.validateFilter = _s.validate, exports.validateFilterArray = _s.validateArray;
|
|
62
64
|
_t = createValidator(resources_1.CollaboratorSchema), exports.validateCollaborator = _t.validate, exports.validateCollaboratorArray = _t.validateArray;
|
|
@@ -82,3 +84,15 @@ _8 = createValidator(resources_1.SuggestionSchema), exports.validateSuggestion =
|
|
|
82
84
|
function parseSyncResponse(raw) {
|
|
83
85
|
return response_1.SyncResponseSchema.parse(raw);
|
|
84
86
|
}
|
|
87
|
+
// App management validators
|
|
88
|
+
_9 = createValidator(types_2.AppSchema), exports.validateApp = _9.validate, exports.validateAppArray = _9.validateArray;
|
|
89
|
+
exports.validateAppWithUserCount = createValidator(types_2.AppWithUserCountSchema).validate;
|
|
90
|
+
exports.validateAppSecrets = createValidator(types_2.AppSecretsSchema).validate;
|
|
91
|
+
exports.validateAppVerificationToken = createValidator(types_2.AppVerificationTokenSchema).validate;
|
|
92
|
+
exports.validateAppTestToken = createValidator(types_2.AppTestTokenSchema).validate;
|
|
93
|
+
exports.validateAppDistributionToken = createValidator(types_2.AppDistributionTokenSchema).validate;
|
|
94
|
+
exports.validateAppByDistributionToken = createValidator(types_2.AppByDistributionTokenSchema).validate;
|
|
95
|
+
exports.validateAppWebhook = createValidator(types_2.AppWebhookSchema).validate;
|
|
96
|
+
_10 = createValidator(types_2.AppInstallationSchema), exports.validateAppInstallation = _10.validate, exports.validateAppInstallationArray = _10.validateArray;
|
|
97
|
+
_11 = createValidator(types_2.UserAuthorizationSchema), exports.validateUserAuthorization = _11.validate, exports.validateUserAuthorizationArray = _11.validateArray;
|
|
98
|
+
_12 = createValidator(types_12.UiExtensionSchema), exports.validateUiExtension = _12.validate, exports.validateUiExtensionArray = _12.validateArray;
|