@fourier-labs/harbour-contracts 0.70.0 → 0.71.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/README.md +3 -3
- package/contract-release.json +20 -20
- package/dist/gen-ts/app-integrations-declaration.d.ts +24 -11
- package/dist/gen-ts/contract-release.d.ts +6 -6
- package/dist/gen-ts/contract-release.js +6 -6
- package/dist/gen-ts/data-grant-v2.d.ts +5 -5
- package/dist/gen-ts/integration-execute-input-rules.d.ts +193 -3
- package/dist/gen-ts/integration-execute-input-rules.js +60 -3
- package/dist/gen-ts/integration-execute-request.d.ts +79 -8
- package/dist/gen-ts/integration-execute-result.d.ts +74 -3
- package/dist/gen-ts/saas-connection.d.ts +62 -4
- package/gen-ts/app-integrations-declaration.ts +24 -11
- package/gen-ts/contract-release.ts +6 -6
- package/gen-ts/data-grant-v2.ts +10 -4
- package/gen-ts/integration-execute-input-rules.ts +60 -4
- package/gen-ts/integration-execute-request.ts +84 -7
- package/gen-ts/integration-execute-result.ts +74 -3
- package/gen-ts/saas-connection.ts +67 -3
- package/package.json +1 -1
- package/schema/app-integrations-declaration.schema.json +31 -9
- package/schema/data-grant-v2.schema.json +2 -2
- package/schema/integration-execute-request.schema.json +144 -11
- package/schema/integration-execute-result.schema.json +82 -7
- package/schema/saas-connection.schema.json +74 -5
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
// Code generated by tools/gen/gen.mjs from schema/*.json. DO NOT EDIT.
|
|
3
3
|
|
|
4
4
|
/**
|
|
5
|
-
* Body of POST /_harbour/integrations/execute (app SDK), forwarded unchanged to the governance development and runtime execute routes. Exactly one declared operation against one declared resource. The identity mode is fixed by the operation for every operation but slack.message.post, and always enforced from an approved grant; any identity/userId/scope field is rejected by additionalProperties. A
|
|
5
|
+
* Body of POST /_harbour/integrations/execute (app SDK), forwarded unchanged to the governance development and runtime execute routes. Exactly one declared operation against one declared resource. The identity mode is fixed by the operation for every operation but the declared-mode Slack operations (slack.channel.history, slack.message.post, slack.message.update, slack.message.delete; 0.71.0 widened history), and always enforced from an approved grant; any identity/userId/scope field is rejected by additionalProperties. A declared-mode operation runs as the app (for a post: the IT-approved per-app name from the grant, plus a "Posted by <app> on Isomorph" footer) or as the signed-in person (no name, no footer) — the same input either way — and since 0.55.0 the call names which of the app's approved modes it runs under (`mode`): required when IT approved both modes for the app (MODE_REQUIRED otherwise), optional when it approved one (that one is used), and a named mode without an approved grant is refused (MODE_NOT_GRANTED) rather than served under the other, so approval order never decides what a call does. Per-operation input bounds (0.71.0, ADR 0018): slack.channel.history {limit? 1..100, default 15, cursor?, oldest?, latest?}; slack.message.post {text 1..4000 chars, threadId?, format? plain|mrkdwn} and a required idempotencyKey retained across retries of one explicit Send; slack.message.update {messageId, text, format?}; slack.message.delete {messageId}; slack.dm.send {to 1..8 addresses, text, format?} (app mode only) with a required idempotencyKey; slack.user.lookup {email}; gmail.thread.list {limit? 1..50, default 15, q?, labelIds? default [INBOX], pageToken?}; gmail.thread.read {threadId}; gmail.message.read {messageId}; gmail.attachment.read {messageId, attachmentId}; gmail.message.send {to 1..50 addresses (to+cc+bcc <= 50 in total), cc?, bcc?, subject 1..256 chars, text 1..4000 chars, html? <= 64 KiB, attachments? 1..5 of <= 2 MiB each as base64, replyToMessageId?} and a required idempotencyKey like slack.message.post; warehouse.view.read {columns? 1..32, where? 1..16 filters, groupBy? 1..8 columns, aggregates? 1..16, orderBy? 1..8, limit? 1..1000, default 100} (0.70.0: a plain read names columns, an aggregate read names aggregates and optionally groupBy; the cross-field rules — exactly one of columns or aggregates, groupBy needs aggregates, a filter value that fits its op, orderBy naming a returned column, every named column approved — are enforced by governance, not expressible here; ADR 0017). Each operation's then-block is the one statement of its input rules: propertyNames.enum names the fields it accepts, required the ones it needs, and per-field overrides (maximum, default) narrow the shared property. Codegen derives IntegrationExecuteInputRules and validateIntegrationExecuteInput (gen-ts/integration-execute-input-rules.ts, gen-go/integration_execute_input_rules.go) from exactly these blocks, so the governance execute route, the app SDK and the kit's local check refuse the same request with the same message. Transport limits (not expressible here): request <= 16 KiB except a gmail.message.send carrying attachments (governance sizes that route for the attachment bound), total deadline 10 s.
|
|
6
6
|
*/
|
|
7
7
|
export type IntegrationExecuteRequest = {
|
|
8
8
|
/**
|
|
@@ -10,14 +10,20 @@ export type IntegrationExecuteRequest = {
|
|
|
10
10
|
*/
|
|
11
11
|
connection: string;
|
|
12
12
|
/**
|
|
13
|
-
* Closed operation set. Extending it is a contracts change. gmail.message.send (0.50.0) sends one
|
|
13
|
+
* Closed operation set. Extending it is a contracts change. gmail.message.send (0.50.0) sends one email as the signed-in person: a send like slack.message.post (explicit Send, idempotencyKey, write receipt) under user identity; since 0.71.0 it may carry an HTML body and attachments. slack.message.post (0.53.0) runs in the mode the app declares: app (the company's Slack app, under the IT-approved per-app name) or user (the signed-in person, after their consent); since 0.55.0 each call names which of the approved modes it runs under. 0.71.0 (ADR 0018) adds slack.message.update and slack.message.delete (declared mode, like post), slack.dm.send (app mode: a direct message to 1..8 workspace members named by email), slack.user.lookup (app mode: email to Slack user id), gmail.thread.read (every message of one thread) and gmail.attachment.read (one attachment's bytes), and lets slack.channel.history run in app mode as well as user mode.
|
|
14
14
|
*/
|
|
15
15
|
operation:
|
|
16
16
|
| 'slack.channel.history'
|
|
17
17
|
| 'slack.message.post'
|
|
18
|
+
| 'slack.message.update'
|
|
19
|
+
| 'slack.message.delete'
|
|
20
|
+
| 'slack.dm.send'
|
|
21
|
+
| 'slack.user.lookup'
|
|
18
22
|
| 'gmail.thread.list'
|
|
23
|
+
| 'gmail.thread.read'
|
|
19
24
|
| 'gmail.message.read'
|
|
20
25
|
| 'gmail.message.send'
|
|
26
|
+
| 'gmail.attachment.read'
|
|
21
27
|
| 'warehouse.view.read';
|
|
22
28
|
/**
|
|
23
29
|
* Tenant-wide logical alias of a connection (governance sourceId) or of a resource under it.
|
|
@@ -25,17 +31,60 @@ export type IntegrationExecuteRequest = {
|
|
|
25
31
|
resource: string;
|
|
26
32
|
input: {
|
|
27
33
|
/**
|
|
28
|
-
* Read operations: how many items to return; the per-operation then-block sets the real ceiling (
|
|
34
|
+
* Read operations: how many items to return; the per-operation then-block sets the real ceiling (100 for slack.channel.history, 50 for gmail.thread.list, 1000 for warehouse.view.read) and the default.
|
|
29
35
|
*/
|
|
30
36
|
limit?: number;
|
|
31
37
|
/**
|
|
32
|
-
* slack.message.post / gmail.message.send: the
|
|
38
|
+
* slack.message.post / slack.message.update / slack.dm.send / gmail.message.send: the body, 1..4000 characters (plain text, or Slack mrkdwn when `format` says so).
|
|
33
39
|
*/
|
|
34
40
|
text?: string;
|
|
35
41
|
/**
|
|
36
|
-
*
|
|
42
|
+
* slack.message.post / slack.message.update / slack.dm.send (0.71.0): how Slack renders `text`; plain when absent.
|
|
43
|
+
*/
|
|
44
|
+
format?: 'plain' | 'mrkdwn';
|
|
45
|
+
/**
|
|
46
|
+
* slack.message.post (0.71.0): the Slack message ts (a slack.channel.history message id) the post replies to, so it lands in that thread. gmail.thread.read: the Gmail thread id a gmail.thread.list result named.
|
|
47
|
+
*/
|
|
48
|
+
threadId?: string;
|
|
49
|
+
/**
|
|
50
|
+
* gmail.message.read / gmail.attachment.read: the Gmail message id a gmail.thread.list or gmail.thread.read result named. slack.message.update / slack.message.delete (0.71.0): the Slack message ts a post or history result named.
|
|
37
51
|
*/
|
|
38
52
|
messageId?: string;
|
|
53
|
+
/**
|
|
54
|
+
* gmail.attachment.read (0.71.0): the attachment id a gmail.message.read or gmail.thread.read result named.
|
|
55
|
+
*/
|
|
56
|
+
attachmentId?: string;
|
|
57
|
+
/**
|
|
58
|
+
* slack.channel.history (0.71.0): the `nextCursor` of the previous page; absent reads the newest page.
|
|
59
|
+
*/
|
|
60
|
+
cursor?: string;
|
|
61
|
+
/**
|
|
62
|
+
* slack.channel.history (0.71.0): only messages after this Slack ts.
|
|
63
|
+
*/
|
|
64
|
+
oldest?: string;
|
|
65
|
+
/**
|
|
66
|
+
* slack.channel.history (0.71.0): only messages before this Slack ts.
|
|
67
|
+
*/
|
|
68
|
+
latest?: string;
|
|
69
|
+
/**
|
|
70
|
+
* gmail.thread.list (0.71.0): a Gmail search query (the search-box syntax, e.g. `from:jane newer_than:7d`).
|
|
71
|
+
*/
|
|
72
|
+
q?: string;
|
|
73
|
+
/**
|
|
74
|
+
* gmail.thread.list (0.71.0): the Gmail labels a thread must carry (all of them); INBOX when absent.
|
|
75
|
+
*
|
|
76
|
+
* @minItems 1
|
|
77
|
+
* @maxItems 5
|
|
78
|
+
*/
|
|
79
|
+
labelIds?: string[];
|
|
80
|
+
/**
|
|
81
|
+
* gmail.thread.list (0.71.0): the `nextPageToken` of the previous page; absent reads the first page.
|
|
82
|
+
*/
|
|
83
|
+
pageToken?: string;
|
|
84
|
+
/**
|
|
85
|
+
* slack.user.lookup (0.71.0): the workspace member's email address to resolve to a Slack user id.
|
|
86
|
+
*/
|
|
87
|
+
email?: string;
|
|
39
88
|
to?: EmailAddressList;
|
|
40
89
|
cc?: EmailAddressList1;
|
|
41
90
|
bcc?: EmailAddressList2;
|
|
@@ -47,6 +96,17 @@ export type IntegrationExecuteRequest = {
|
|
|
47
96
|
* gmail.message.send: a Gmail message id (from gmail.thread.list / gmail.message.read) the email replies to; the send joins that thread.
|
|
48
97
|
*/
|
|
49
98
|
replyToMessageId?: string;
|
|
99
|
+
/**
|
|
100
|
+
* gmail.message.send (0.71.0): an HTML body sent beside `text` (which stays the plain-text alternative), at most 64 KiB.
|
|
101
|
+
*/
|
|
102
|
+
html?: string;
|
|
103
|
+
/**
|
|
104
|
+
* gmail.message.send (0.71.0): files to attach, 1..5, each at most 2 MiB (2,796,203 base64 characters).
|
|
105
|
+
*
|
|
106
|
+
* @minItems 1
|
|
107
|
+
* @maxItems 5
|
|
108
|
+
*/
|
|
109
|
+
attachments?: EmailAttachment[];
|
|
50
110
|
/**
|
|
51
111
|
* warehouse.view.read, a plain read: explicit columns, or `*` alone when the app's approved resource grant allows all current and future columns. An aggregate read names aggregates instead.
|
|
52
112
|
*
|
|
@@ -88,7 +148,7 @@ export type IntegrationExecuteRequest = {
|
|
|
88
148
|
*/
|
|
89
149
|
idempotencyKey?: string;
|
|
90
150
|
/**
|
|
91
|
-
* slack.message.post
|
|
151
|
+
* The declared-mode Slack operations only (slack.message.post since 0.55.0; slack.channel.history, slack.message.update and slack.message.delete since 0.71.0): which of the app's IT-approved modes this call runs under — app (the company's Slack app; a post goes out under the grant's per-app name and the footer) or user (the signed-in person, after their consent; no name, no footer). Required when the app holds approved grants for both modes (else MODE_REQUIRED); may be omitted when it holds one, which is then used. A named mode without an approved grant is refused with MODE_NOT_GRANTED; governance never falls back to the other mode. Every other operation's mode is fixed, so the field is refused there.
|
|
92
152
|
*/
|
|
93
153
|
mode?: 'app' | 'user';
|
|
94
154
|
};
|
|
@@ -97,7 +157,7 @@ export type IntegrationExecuteRequest = {
|
|
|
97
157
|
*/
|
|
98
158
|
export type EmailAddress = string;
|
|
99
159
|
/**
|
|
100
|
-
* gmail.message.send: primary recipients.
|
|
160
|
+
* gmail.message.send: primary recipients. slack.dm.send (0.71.0): the workspace members to message, by email, 1..8; several open one group DM.
|
|
101
161
|
*
|
|
102
162
|
* @minItems 1
|
|
103
163
|
* @maxItems 50
|
|
@@ -130,6 +190,23 @@ export type WarehouseAggregateFn = 'count' | 'sum' | 'avg' | 'min' | 'max';
|
|
|
130
190
|
*/
|
|
131
191
|
export type WarehouseOrderDirection = 'asc' | 'desc';
|
|
132
192
|
|
|
193
|
+
/**
|
|
194
|
+
* One file attached to a gmail.message.send (0.71.0), carried inline as base64. At most 2 MiB of bytes, which is 2,796,203 base64 characters.
|
|
195
|
+
*/
|
|
196
|
+
export interface EmailAttachment {
|
|
197
|
+
/**
|
|
198
|
+
* The name the recipient sees.
|
|
199
|
+
*/
|
|
200
|
+
filename: string;
|
|
201
|
+
/**
|
|
202
|
+
* The MIME type, e.g. application/pdf.
|
|
203
|
+
*/
|
|
204
|
+
contentType: string;
|
|
205
|
+
/**
|
|
206
|
+
* The file bytes, standard base64.
|
|
207
|
+
*/
|
|
208
|
+
dataBase64: string;
|
|
209
|
+
}
|
|
133
210
|
/**
|
|
134
211
|
* One warehouse.view.read filter (0.70.0): <column> <op> <value>. The value is always bound as a query parameter, never written into the SQL. Which value an op takes is a governance rule: isNull/isNotNull take none; in/notIn take a non-empty list of one scalar type; every other op takes one scalar, and a boolean only with eq/ne.
|
|
135
212
|
*/
|
|
@@ -2,19 +2,39 @@
|
|
|
2
2
|
// Code generated by tools/gen/gen.mjs from schema/*.json. DO NOT EDIT.
|
|
3
3
|
|
|
4
4
|
/**
|
|
5
|
-
* The `data` member of a successful execute response `{data, requestId}`; the SDK unwraps `data`. Exactly one of the
|
|
5
|
+
* The `data` member of a successful execute response `{data, requestId}`; the SDK unwraps `data`. Exactly one of the operation results (twelve operations since 0.71.0, ADR 0018): slack.channel.history -> {messages, hasMore, nextCursor?} (plain text/IDs/time, plus the display name and emoji icon a per-app-named app post carries — authorName/authorIcon, 0.55.0 — never the provider payload; `nextCursor` when hasMore, to pass as the next read's `cursor`); slack.message.post, slack.message.update, slack.message.delete -> {messageId} (the Slack ts); slack.dm.send -> {messageId, channelId} (the ts and the DM channel it went to); slack.user.lookup -> {userId, displayName}; gmail.thread.list -> {threads, hasMore, nextPageToken?} (newest matching threads; each `messageId` is the thread's newest message, what gmail.message.read takes; `nextPageToken` when hasMore); gmail.thread.read -> {id, emails} (every message of the thread, oldest first, each shaped like a gmail.message.read result); gmail.message.read -> {id, threadId, subject, from, to, date, text, truncated, attachments?} (headers plus the plain text with html stripped, cut at 16 KiB with `truncated` set; `attachments` lists the files without their bytes, which gmail.attachment.read fetches by id); gmail.attachment.read -> {filename, mimeType, size, dataBase64}; gmail.message.send -> {messageId, threadId} (the Gmail ids of the sent message and its thread); warehouse.view.read -> {rows, truncated} (rows keyed by the selected columns, or for an aggregate read by the groupBy columns then the aggregate aliases; decimal/64-bit values as strings, dates as ISO strings; since 0.70.0 every server sends `truncated`, true when more rows matched than `limit` — the server reads limit+1 rows to know — so the rows are incomplete and must not be totalled or averaged; a server before 0.70.0 omitted it). An unknown send outcome is never a result; it is an error with details.code SEND_OUTCOME_UNKNOWN. A whole result over 1 MiB is rejected, never cut down to fit — except a gmail.attachment.read, whose single attachment is bounded by its own 2 MiB.
|
|
6
6
|
*/
|
|
7
7
|
export type IntegrationExecuteResult = {
|
|
8
8
|
/**
|
|
9
|
-
* @maxItems
|
|
9
|
+
* @maxItems 100
|
|
10
10
|
*/
|
|
11
11
|
messages?: ChannelMessage[];
|
|
12
12
|
hasMore?: boolean;
|
|
13
|
+
/**
|
|
14
|
+
* slack.channel.history (0.71.0): the cursor of the next (older) page, present only when hasMore.
|
|
15
|
+
*/
|
|
16
|
+
nextCursor?: string;
|
|
13
17
|
messageId?: string;
|
|
14
18
|
/**
|
|
15
|
-
*
|
|
19
|
+
* slack.dm.send (0.71.0): the Slack DM channel id the message went to.
|
|
20
|
+
*/
|
|
21
|
+
channelId?: string;
|
|
22
|
+
/**
|
|
23
|
+
* slack.user.lookup (0.71.0): the Slack user id of the member with that email.
|
|
24
|
+
*/
|
|
25
|
+
userId?: string;
|
|
26
|
+
/**
|
|
27
|
+
* slack.user.lookup (0.71.0): the member's display name, or real name when they set no display name; may be empty.
|
|
28
|
+
*/
|
|
29
|
+
displayName?: string;
|
|
30
|
+
/**
|
|
31
|
+
* @maxItems 50
|
|
16
32
|
*/
|
|
17
33
|
threads?: GmailThread[];
|
|
34
|
+
/**
|
|
35
|
+
* gmail.thread.list (0.71.0): the token of the next page, present only when hasMore.
|
|
36
|
+
*/
|
|
37
|
+
nextPageToken?: string;
|
|
18
38
|
id?: string;
|
|
19
39
|
threadId?: string;
|
|
20
40
|
subject?: string;
|
|
@@ -26,6 +46,28 @@ export type IntegrationExecuteResult = {
|
|
|
26
46
|
* gmail.message.read: the text was cut at 16 KiB. warehouse.view.read (0.70.0): more rows matched than the read's limit, so `rows` is incomplete.
|
|
27
47
|
*/
|
|
28
48
|
truncated?: boolean;
|
|
49
|
+
/**
|
|
50
|
+
* gmail.message.read (0.71.0): the message's attachments, without their bytes.
|
|
51
|
+
*
|
|
52
|
+
* @maxItems 100
|
|
53
|
+
*/
|
|
54
|
+
attachments?: GmailAttachment[];
|
|
55
|
+
/**
|
|
56
|
+
* gmail.thread.read (0.71.0): every message of the thread, oldest first.
|
|
57
|
+
*
|
|
58
|
+
* @maxItems 100
|
|
59
|
+
*/
|
|
60
|
+
emails?: GmailMessage[];
|
|
61
|
+
filename?: string;
|
|
62
|
+
mimeType?: string;
|
|
63
|
+
/**
|
|
64
|
+
* gmail.attachment.read (0.71.0): the attachment's size in bytes.
|
|
65
|
+
*/
|
|
66
|
+
size?: number;
|
|
67
|
+
/**
|
|
68
|
+
* gmail.attachment.read (0.71.0): the attachment's bytes, standard base64, at most 2 MiB of bytes.
|
|
69
|
+
*/
|
|
70
|
+
dataBase64?: string;
|
|
29
71
|
/**
|
|
30
72
|
* @maxItems 1000
|
|
31
73
|
*/
|
|
@@ -56,3 +98,32 @@ export interface GmailThread {
|
|
|
56
98
|
date: string;
|
|
57
99
|
snippet: string;
|
|
58
100
|
}
|
|
101
|
+
/**
|
|
102
|
+
* One attachment of a Gmail message (0.71.0), named without its bytes; gmail.attachment.read fetches them by `id`.
|
|
103
|
+
*/
|
|
104
|
+
export interface GmailAttachment {
|
|
105
|
+
id: string;
|
|
106
|
+
filename: string;
|
|
107
|
+
mimeType: string;
|
|
108
|
+
/**
|
|
109
|
+
* Bytes.
|
|
110
|
+
*/
|
|
111
|
+
size: number;
|
|
112
|
+
}
|
|
113
|
+
/**
|
|
114
|
+
* One message of a gmail.thread.read result (0.71.0): the gmail.message.read shape.
|
|
115
|
+
*/
|
|
116
|
+
export interface GmailMessage {
|
|
117
|
+
id: string;
|
|
118
|
+
threadId: string;
|
|
119
|
+
subject: string;
|
|
120
|
+
from: string;
|
|
121
|
+
to: string;
|
|
122
|
+
date: string;
|
|
123
|
+
text: string;
|
|
124
|
+
truncated: boolean;
|
|
125
|
+
/**
|
|
126
|
+
* @maxItems 100
|
|
127
|
+
*/
|
|
128
|
+
attachments?: GmailAttachment[];
|
|
129
|
+
}
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
// Code generated by tools/gen/gen.mjs from schema/*.json. DO NOT EDIT.
|
|
3
3
|
|
|
4
4
|
/**
|
|
5
|
-
* Slack carries an installation and a channel map; Gmail is user-consent only
|
|
5
|
+
* Slack carries an installation and a channel map; Gmail is user-consent only.
|
|
6
6
|
*/
|
|
7
7
|
export type SaasProvider = 'slack' | 'gmail';
|
|
8
8
|
/**
|
|
@@ -10,6 +10,18 @@ export type SaasProvider = 'slack' | 'gmail';
|
|
|
10
10
|
*/
|
|
11
11
|
export type SaasConnectionStatus = 'ACTIVE' | 'DISABLED';
|
|
12
12
|
export type SaasInstallationStatus = 'installed' | 'reconnect_required' | 'revoked';
|
|
13
|
+
/**
|
|
14
|
+
* How a user-mode access request on this connection is approved (0.71.0): automatic — the person's own consent is the approval, since the app only ever acts as them; it — an IT admin reviews it like an app-mode request. Absent means it.
|
|
15
|
+
*/
|
|
16
|
+
export type UserModeApproval = 'automatic' | 'it';
|
|
17
|
+
/**
|
|
18
|
+
* signed_in_person — only the person using the app; channel_members — the members of the named channel; anyone — any workspace member.
|
|
19
|
+
*/
|
|
20
|
+
export type DirectMessageAudience = 'signed_in_person' | 'channel_members' | 'anyone';
|
|
21
|
+
/**
|
|
22
|
+
* block — every recipient must be internal (the default when absent); allowlist — internal or in `allowedDomains`; allow — any address.
|
|
23
|
+
*/
|
|
24
|
+
export type ExternalRecipientMode = 'block' | 'allowlist' | 'allow';
|
|
13
25
|
/**
|
|
14
26
|
*/
|
|
15
27
|
export type InstallationName = string;
|
|
@@ -43,20 +55,30 @@ export interface SaasConnection {
|
|
|
43
55
|
[k: string]: string;
|
|
44
56
|
};
|
|
45
57
|
/**
|
|
46
|
-
* Operations IT allows apps to request on this connection: the provider's own SaaS operations (Slack: slack.channel.history, slack.message.post; Gmail: gmail.thread.list, gmail.message.read, gmail.message.send). Never warehouse.view.read.
|
|
58
|
+
* Operations IT allows apps to request on this connection: the provider's own SaaS operations (Slack: slack.channel.history, slack.message.post, slack.message.update, slack.message.delete, slack.dm.send, slack.user.lookup; Gmail: gmail.thread.list, gmail.thread.read, gmail.message.read, gmail.message.send, gmail.attachment.read). Never warehouse.view.read.
|
|
47
59
|
*
|
|
48
60
|
* @minItems 1
|
|
49
|
-
* @maxItems
|
|
61
|
+
* @maxItems 11
|
|
50
62
|
*/
|
|
51
63
|
operations: (
|
|
52
64
|
| 'slack.channel.history'
|
|
53
65
|
| 'slack.message.post'
|
|
66
|
+
| 'slack.message.update'
|
|
67
|
+
| 'slack.message.delete'
|
|
68
|
+
| 'slack.dm.send'
|
|
69
|
+
| 'slack.user.lookup'
|
|
54
70
|
| 'gmail.thread.list'
|
|
71
|
+
| 'gmail.thread.read'
|
|
55
72
|
| 'gmail.message.read'
|
|
56
73
|
| 'gmail.message.send'
|
|
74
|
+
| 'gmail.attachment.read'
|
|
57
75
|
| 'warehouse.view.read'
|
|
58
76
|
)[];
|
|
59
77
|
developmentPreapproval: DevelopmentPreapproval;
|
|
78
|
+
oauthClient?: SaasOauthClient;
|
|
79
|
+
userModeApproval?: UserModeApproval;
|
|
80
|
+
directMessages?: DirectMessagePolicy;
|
|
81
|
+
externalRecipients?: ExternalRecipientPolicy;
|
|
60
82
|
/**
|
|
61
83
|
* Lower-cased builder emails excluded from development preapproval.
|
|
62
84
|
*
|
|
@@ -125,6 +147,48 @@ export interface DevelopmentPreapproval {
|
|
|
125
147
|
*/
|
|
126
148
|
hours: number;
|
|
127
149
|
}
|
|
150
|
+
/**
|
|
151
|
+
* The tenant's own OAuth client for this provider (0.71.0; the ADR 0068 follow-up): when present, installation and user consent run through the company's Slack app or Google Cloud project instead of the platform-owned one, so the tenant's IT sees and controls the app in their own admin console. A reference to the secret, never the secret.
|
|
152
|
+
*/
|
|
153
|
+
export interface SaasOauthClient {
|
|
154
|
+
clientId: string;
|
|
155
|
+
/**
|
|
156
|
+
* Where the client secret lives.
|
|
157
|
+
*/
|
|
158
|
+
secretRef: string;
|
|
159
|
+
setAt: string;
|
|
160
|
+
/**
|
|
161
|
+
* The IT admin who saved it (lower-cased email).
|
|
162
|
+
*/
|
|
163
|
+
setBy: string;
|
|
164
|
+
}
|
|
165
|
+
/**
|
|
166
|
+
* Whom an app may direct-message through slack.dm.send (0.71.0), set by IT on the connection and enforced by governance on every send.
|
|
167
|
+
*/
|
|
168
|
+
export interface DirectMessagePolicy {
|
|
169
|
+
allowed: DirectMessageAudience;
|
|
170
|
+
/**
|
|
171
|
+
* Tenant-wide logical alias of a connection (governance sourceId) or of a resource under it.
|
|
172
|
+
*/
|
|
173
|
+
channel?: string;
|
|
174
|
+
/**
|
|
175
|
+
* Distinct recipients one app may message per UTC day on this connection; the cap refuses the send that would exceed it.
|
|
176
|
+
*/
|
|
177
|
+
dailyRecipientCap: number;
|
|
178
|
+
}
|
|
179
|
+
/**
|
|
180
|
+
* Whether a gmail.message.send may address people outside the company (0.71.0). An external recipient is one whose email domain is not one of the tenant's verified domains.
|
|
181
|
+
*/
|
|
182
|
+
export interface ExternalRecipientPolicy {
|
|
183
|
+
mode: ExternalRecipientMode;
|
|
184
|
+
/**
|
|
185
|
+
* allowlist only: the external domains a send may address; a recipient's domain must equal one of them.
|
|
186
|
+
*
|
|
187
|
+
* @minItems 1
|
|
188
|
+
* @maxItems 50
|
|
189
|
+
*/
|
|
190
|
+
allowedDomains?: string[];
|
|
191
|
+
}
|
|
128
192
|
/**
|
|
129
193
|
* @deprecated
|
|
130
194
|
*/
|
package/package.json
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
"$schema": "http://json-schema.org/draft-07/schema#",
|
|
3
3
|
"$id": "https://schemas.harbour.dev/app-integrations-declaration.schema.json",
|
|
4
4
|
"title": "AppIntegrationsDeclaration",
|
|
5
|
-
"description": "Committed `.isomorph/integrations.json`: the app's declared use of tenant-wide integration connections. Keys are logical connection aliases (the governance sourceId); resources are logical names (Slack channel alias, warehouse view name), never IDs, tokens or URLs. The operation set is closed (
|
|
5
|
+
"description": "Committed `.isomorph/integrations.json`: the app's declared use of tenant-wide integration connections. Keys are logical connection aliases (the governance sourceId); resources are logical names (Slack channel alias, warehouse view name), never IDs, tokens or URLs. The operation set is closed (twelve operations since 0.71.0, ADR 0018). Each operation carries a fixed identity mode — slack.dm.send=app, slack.user.lookup=app, every gmail.* operation=user, warehouse.view.read=app — except the declared-mode Slack operations (slack.message.post, and since 0.71.0 slack.channel.history, slack.message.update and slack.message.delete), whose mode the app DECLARES: `app` acts as the company's Slack app (the one audited bot identity; a post goes out under the IT-approved per-app display name when the connection declares `presentation`), `user` acts as the signed-in person after their own consent (reads what they can read, edits what they wrote). The declared mode is the one the app requests access for; an app may hold approved grants for both modes after two requests, and each declared-mode call names which approved mode it runs under (`mode` on the execute request, 0.55.0) — a mode IT did not approve is refused, never swapped for the other. A `saas` connection may declare only the Slack and Gmail operations and a `database` connection only warehouse.view.read; `presentation` is a `saas` connection's optional per-app display name and icon for app-mode Slack posts, shown to IT at approval time and applied only from the approved grant. Gmail is user-mode only (reads, one send); its single resource is the fixed `inbox` alias. slack.dm.send and slack.user.lookup address people by email rather than a channel, so their single resource is the fixed `workspace` alias (the connection's installed workspace), the way Gmail's is `inbox`. This file also owns the shared IntegrationOperation / IntegrationIdentityMode / IntegrationEnvironment / IntegrationConnectionKind / IntegrationPresentation definitions referenced by the other integration schemas.",
|
|
6
6
|
"type": "object",
|
|
7
7
|
"additionalProperties": false,
|
|
8
8
|
"required": ["schema", "connections"],
|
|
@@ -25,13 +25,13 @@
|
|
|
25
25
|
"IntegrationConnectionKind": { "type": "string", "enum": ["saas", "database"] },
|
|
26
26
|
"IntegrationOperation": {
|
|
27
27
|
"type": "string",
|
|
28
|
-
"enum": ["slack.channel.history", "slack.message.post", "gmail.thread.list", "gmail.message.read", "gmail.message.send", "warehouse.view.read"],
|
|
29
|
-
"description": "Closed operation set. Extending it is a contracts change. gmail.message.send (0.50.0) sends one
|
|
28
|
+
"enum": ["slack.channel.history", "slack.message.post", "slack.message.update", "slack.message.delete", "slack.dm.send", "slack.user.lookup", "gmail.thread.list", "gmail.thread.read", "gmail.message.read", "gmail.message.send", "gmail.attachment.read", "warehouse.view.read"],
|
|
29
|
+
"description": "Closed operation set. Extending it is a contracts change. gmail.message.send (0.50.0) sends one email as the signed-in person: a send like slack.message.post (explicit Send, idempotencyKey, write receipt) under user identity; since 0.71.0 it may carry an HTML body and attachments. slack.message.post (0.53.0) runs in the mode the app declares: app (the company's Slack app, under the IT-approved per-app name) or user (the signed-in person, after their consent); since 0.55.0 each call names which of the approved modes it runs under. 0.71.0 (ADR 0018) adds slack.message.update and slack.message.delete (declared mode, like post), slack.dm.send (app mode: a direct message to 1..8 workspace members named by email), slack.user.lookup (app mode: email to Slack user id), gmail.thread.read (every message of one thread) and gmail.attachment.read (one attachment's bytes), and lets slack.channel.history run in app mode as well as user mode."
|
|
30
30
|
},
|
|
31
31
|
"IntegrationIdentityMode": {
|
|
32
32
|
"type": "string",
|
|
33
33
|
"enum": ["app", "user"],
|
|
34
|
-
"description": "Whose authority an operation runs under. Fixed per operation, except slack.message.post: declared per app for the access request, and named per call among the app's approved modes (execute request `mode`, 0.55.0)."
|
|
34
|
+
"description": "Whose authority an operation runs under. Fixed per operation, except the declared-mode Slack operations (slack.message.post; since 0.71.0 also slack.channel.history, slack.message.update, slack.message.delete): declared per app for the access request, and named per call among the app's approved modes (execute request `mode`, 0.55.0)."
|
|
35
35
|
},
|
|
36
36
|
"IntegrationEnvironment": {
|
|
37
37
|
"type": "string",
|
|
@@ -92,12 +92,22 @@
|
|
|
92
92
|
"type": "object",
|
|
93
93
|
"additionalProperties": false,
|
|
94
94
|
"required": ["identity", "resources"],
|
|
95
|
-
"description": "slack.message.post: the app declares the mode — app (
|
|
95
|
+
"description": "slack.message.post, slack.channel.history, slack.message.update, slack.message.delete: the app declares the mode — app (acts as the company's Slack app) or user (acts as the signed-in person).",
|
|
96
96
|
"properties": {
|
|
97
97
|
"identity": { "$ref": "#/definitions/IntegrationIdentityMode" },
|
|
98
98
|
"resources": { "$ref": "#/definitions/ResourceNames" }
|
|
99
99
|
}
|
|
100
100
|
},
|
|
101
|
+
"AppModeChannelOperation": {
|
|
102
|
+
"type": "object",
|
|
103
|
+
"additionalProperties": false,
|
|
104
|
+
"required": ["identity", "resources"],
|
|
105
|
+
"description": "slack.dm.send, slack.user.lookup (0.71.0): app mode only — the company's Slack app messages people or resolves them by email; the resource is the fixed `workspace` alias.",
|
|
106
|
+
"properties": {
|
|
107
|
+
"identity": { "type": "string", "const": "app" },
|
|
108
|
+
"resources": { "$ref": "#/definitions/ResourceNames" }
|
|
109
|
+
}
|
|
110
|
+
},
|
|
101
111
|
"AppModeViewOperation": {
|
|
102
112
|
"type": "object",
|
|
103
113
|
"additionalProperties": false,
|
|
@@ -125,11 +135,17 @@
|
|
|
125
135
|
"additionalProperties": false,
|
|
126
136
|
"minProperties": 1,
|
|
127
137
|
"properties": {
|
|
128
|
-
"slack.channel.history": { "$ref": "#/definitions/
|
|
138
|
+
"slack.channel.history": { "$ref": "#/definitions/DeclaredModeChannelOperation" },
|
|
129
139
|
"slack.message.post": { "$ref": "#/definitions/DeclaredModeChannelOperation" },
|
|
140
|
+
"slack.message.update": { "$ref": "#/definitions/DeclaredModeChannelOperation" },
|
|
141
|
+
"slack.message.delete": { "$ref": "#/definitions/DeclaredModeChannelOperation" },
|
|
142
|
+
"slack.dm.send": { "$ref": "#/definitions/AppModeChannelOperation" },
|
|
143
|
+
"slack.user.lookup": { "$ref": "#/definitions/AppModeChannelOperation" },
|
|
130
144
|
"gmail.thread.list": { "$ref": "#/definitions/UserModeChannelOperation" },
|
|
145
|
+
"gmail.thread.read": { "$ref": "#/definitions/UserModeChannelOperation" },
|
|
131
146
|
"gmail.message.read": { "$ref": "#/definitions/UserModeChannelOperation" },
|
|
132
147
|
"gmail.message.send": { "$ref": "#/definitions/UserModeChannelOperation" },
|
|
148
|
+
"gmail.attachment.read": { "$ref": "#/definitions/UserModeChannelOperation" },
|
|
133
149
|
"warehouse.view.read": { "$ref": "#/definitions/AppModeViewOperation" }
|
|
134
150
|
}
|
|
135
151
|
}
|
|
@@ -140,7 +156,7 @@
|
|
|
140
156
|
"not": { "required": ["presentation"] },
|
|
141
157
|
"properties": {
|
|
142
158
|
"operations": {
|
|
143
|
-
"not": { "anyOf": [{ "required": ["slack.channel.history"] }, { "required": ["slack.message.post"] }, { "required": ["gmail.thread.list"] }, { "required": ["gmail.message.read"] }, { "required": ["gmail.message.send"] }] }
|
|
159
|
+
"not": { "anyOf": [{ "required": ["slack.channel.history"] }, { "required": ["slack.message.post"] }, { "required": ["slack.message.update"] }, { "required": ["slack.message.delete"] }, { "required": ["slack.dm.send"] }, { "required": ["slack.user.lookup"] }, { "required": ["gmail.thread.list"] }, { "required": ["gmail.thread.read"] }, { "required": ["gmail.message.read"] }, { "required": ["gmail.message.send"] }, { "required": ["gmail.attachment.read"] }] }
|
|
144
160
|
}
|
|
145
161
|
}
|
|
146
162
|
}
|
|
@@ -155,15 +171,21 @@
|
|
|
155
171
|
"presentation": { "displayName": "Lunch Vote", "iconEmoji": ":sandwich:" },
|
|
156
172
|
"operations": {
|
|
157
173
|
"slack.channel.history": { "identity": "user", "resources": ["team-updates"] },
|
|
158
|
-
"slack.message.post": { "identity": "app", "resources": ["team-updates"] }
|
|
174
|
+
"slack.message.post": { "identity": "app", "resources": ["team-updates"] },
|
|
175
|
+
"slack.message.update": { "identity": "app", "resources": ["team-updates"] },
|
|
176
|
+
"slack.message.delete": { "identity": "app", "resources": ["team-updates"] },
|
|
177
|
+
"slack.dm.send": { "identity": "app", "resources": ["workspace"] },
|
|
178
|
+
"slack.user.lookup": { "identity": "app", "resources": ["workspace"] }
|
|
159
179
|
}
|
|
160
180
|
},
|
|
161
181
|
"gmail": {
|
|
162
182
|
"kind": "saas",
|
|
163
183
|
"operations": {
|
|
164
184
|
"gmail.thread.list": { "identity": "user", "resources": ["inbox"] },
|
|
185
|
+
"gmail.thread.read": { "identity": "user", "resources": ["inbox"] },
|
|
165
186
|
"gmail.message.read": { "identity": "user", "resources": ["inbox"] },
|
|
166
|
-
"gmail.message.send": { "identity": "user", "resources": ["inbox"] }
|
|
187
|
+
"gmail.message.send": { "identity": "user", "resources": ["inbox"] },
|
|
188
|
+
"gmail.attachment.read": { "identity": "user", "resources": ["inbox"] }
|
|
167
189
|
}
|
|
168
190
|
},
|
|
169
191
|
"sales-warehouse": {
|
|
@@ -17,10 +17,10 @@
|
|
|
17
17
|
"status": { "$ref": "#/definitions/DataGrantV2Status" },
|
|
18
18
|
"operations": {
|
|
19
19
|
"type": "array",
|
|
20
|
-
"maxItems":
|
|
20
|
+
"maxItems": 11,
|
|
21
21
|
"uniqueItems": true,
|
|
22
22
|
"items": { "$ref": "app-integrations-declaration.schema.json#/definitions/IntegrationOperation" },
|
|
23
|
-
"description": "Approved operations; each must match this grant's mode. Empty until the first approval."
|
|
23
|
+
"description": "Approved operations; each must match this grant's mode. Empty until the first approval. At most the eleven SaaS operations (0.71.0); a database grant holds one."
|
|
24
24
|
},
|
|
25
25
|
"resources": {
|
|
26
26
|
"type": "array",
|