@isomorph.ai/app-sdk 1.14.0 → 1.16.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 +50 -1
- package/dist/index.d.ts +183 -3
- package/dist/integration-execute-input-rules.d.ts +202 -0
- package/dist/integration-execute-input-rules.js +88 -2
- package/dist/integration-operations.d.ts +63 -0
- package/dist/integration-operations.js +81 -0
- package/dist/runtime.d.ts +1 -1
- package/dist/runtime.js +5 -0
- package/dist/supabase-compat.d.ts +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -168,7 +168,52 @@ await isomorph.integrations.execute('company-basecamp', {
|
|
|
168
168
|
});
|
|
169
169
|
```
|
|
170
170
|
|
|
171
|
-
|
|
171
|
+
SharePoint runs as the signed-in person after their consent. Every operation
|
|
172
|
+
names a site alias IT mapped to one site of the company's Microsoft 365 tenant.
|
|
173
|
+
Ids are opaque Microsoft Graph ids; a list item's `fields` are its columns by
|
|
174
|
+
internal name; adding an item or uploading a file is an explicit action with a
|
|
175
|
+
fresh UUID, while an update is a PATCH and needs none.
|
|
176
|
+
|
|
177
|
+
```ts
|
|
178
|
+
// The site's lists, then one list's open items
|
|
179
|
+
const { lists } = await isomorph.integrations.execute('company-sharepoint', {
|
|
180
|
+
operation: 'sharepoint.list.list', resource: 'intranet', input: {},
|
|
181
|
+
});
|
|
182
|
+
const open = await isomorph.integrations.execute('company-sharepoint', {
|
|
183
|
+
operation: 'sharepoint.item.list', resource: 'intranet',
|
|
184
|
+
input: { listId: lists[0].id, filter: "fields/Status eq 'Open'" },
|
|
185
|
+
});
|
|
186
|
+
// open.nextPageToken, when hasMore, is the next read's pageToken
|
|
187
|
+
|
|
188
|
+
// A new item, then one of its columns changed
|
|
189
|
+
const item = await isomorph.integrations.execute('company-sharepoint', {
|
|
190
|
+
operation: 'sharepoint.item.create', resource: 'intranet',
|
|
191
|
+
input: { listId: lists[0].id, fields: { Title: 'Confirm the venue', Status: 'Open', DueDate: '2026-10-20' } },
|
|
192
|
+
idempotencyKey: crypto.randomUUID(),
|
|
193
|
+
});
|
|
194
|
+
await isomorph.integrations.execute('company-sharepoint', {
|
|
195
|
+
operation: 'sharepoint.item.update', resource: 'intranet',
|
|
196
|
+
input: { listId: lists[0].id, itemId: item.id, fields: { Status: 'Done' } },
|
|
197
|
+
});
|
|
198
|
+
|
|
199
|
+
// The default library's root, a search, one file's bytes, and an upload into a folder
|
|
200
|
+
const { files } = await isomorph.integrations.execute('company-sharepoint', {
|
|
201
|
+
operation: 'sharepoint.file.list', resource: 'intranet', input: {},
|
|
202
|
+
});
|
|
203
|
+
const found = await isomorph.integrations.execute('company-sharepoint', {
|
|
204
|
+
operation: 'sharepoint.file.search', resource: 'intranet', input: { q: 'venue contract' },
|
|
205
|
+
});
|
|
206
|
+
const file = await isomorph.integrations.execute('company-sharepoint', {
|
|
207
|
+
operation: 'sharepoint.file.read', resource: 'intranet', input: { fileId: found.files[0].id },
|
|
208
|
+
});
|
|
209
|
+
await isomorph.integrations.execute('company-sharepoint', {
|
|
210
|
+
operation: 'sharepoint.file.upload', resource: 'intranet',
|
|
211
|
+
input: { filename: 'venue-contract-signed.pdf', contentType: 'application/pdf', dataBase64: file.dataBase64, folderId: files.find((entry) => entry.isFolder)?.id, conflict: 'rename' },
|
|
212
|
+
idempotencyKey: crypto.randomUUID(),
|
|
213
|
+
});
|
|
214
|
+
```
|
|
215
|
+
|
|
216
|
+
(1.16.0; contracts 0.78.0)
|
|
172
217
|
|
|
173
218
|
## Browser read tools
|
|
174
219
|
|
|
@@ -230,6 +275,10 @@ and no second GET is sent. When the refresh fails, `identity.current()`
|
|
|
230
275
|
answers `null` and listeners hear `null`, as before. On the page's own origin
|
|
231
276
|
the identity GET is never renewed (it is the renewal). (1.5.3)
|
|
232
277
|
|
|
278
|
+
## External OTP users
|
|
279
|
+
|
|
280
|
+
Use `user.id` for ownership and database row rules. External users can sign in with a phone number and have no email. `user.name`, `user.phone`, `user.email` and the `emailVerified`/`phoneVerified` flags describe their profile; an optional contact is not verified automatically. `user.directory` identifies `company` or `external`. Database transactions also expose `current_setting('harbour.directory', true)` when a row rule needs that distinction.
|
|
281
|
+
|
|
233
282
|
## The signed-in user's groups
|
|
234
283
|
|
|
235
284
|
`user.groups` — the company groups your identity provider sent at sign-in; use
|
package/dist/index.d.ts
CHANGED
|
@@ -13,7 +13,12 @@ export declare class IsomorphError extends Error {
|
|
|
13
13
|
}
|
|
14
14
|
export interface IsomorphUser {
|
|
15
15
|
id: string;
|
|
16
|
-
email
|
|
16
|
+
email?: string;
|
|
17
|
+
name?: string;
|
|
18
|
+
phone?: string;
|
|
19
|
+
directory?: 'company' | 'external';
|
|
20
|
+
emailVerified?: boolean;
|
|
21
|
+
phoneVerified?: boolean;
|
|
17
22
|
/**
|
|
18
23
|
* The company groups your identity provider sent at sign-in, `[]` when it
|
|
19
24
|
* sent none. Use them for in-app roles: who may open the app at all is
|
|
@@ -368,6 +373,113 @@ export interface BasecampPeopleListRequest {
|
|
|
368
373
|
pageToken?: string;
|
|
369
374
|
};
|
|
370
375
|
}
|
|
376
|
+
/** What `sharepoint.file.upload` does when the folder already has a file of that name: `rename` (the default), `replace` or `fail`. */
|
|
377
|
+
export type SharePointConflictBehavior = 'rename' | 'replace' | 'fail';
|
|
378
|
+
/** One column value as a SharePoint write takes it: a string of at most 4000 characters, a number, a boolean, or null (which clears the column on an update). */
|
|
379
|
+
export type SharePointFieldValue = string | number | boolean | null;
|
|
380
|
+
/** Lists the site's lists the signed-in person can see (hidden lists dropped); resource is a site alias. */
|
|
381
|
+
export interface SharePointListListRequest {
|
|
382
|
+
operation: 'sharepoint.list.list';
|
|
383
|
+
resource: string;
|
|
384
|
+
input?: {
|
|
385
|
+
/** The `nextPageToken` of the previous page; leave it out to read the first page. */
|
|
386
|
+
pageToken?: string;
|
|
387
|
+
};
|
|
388
|
+
}
|
|
389
|
+
/** Lists one list's items, 50 a page, filtered when `filter` says so. */
|
|
390
|
+
export interface SharePointItemListRequest {
|
|
391
|
+
operation: 'sharepoint.item.list';
|
|
392
|
+
resource: string;
|
|
393
|
+
input: {
|
|
394
|
+
/** The `id` a `sharepoint.list.list` result named. */
|
|
395
|
+
listId: string;
|
|
396
|
+
/** An OData `$filter` over the columns as `fields/<column> <op> <value>`, e.g. `fields/Status eq 'Open'`; 1 to 512 characters. */
|
|
397
|
+
filter?: string;
|
|
398
|
+
pageToken?: string;
|
|
399
|
+
};
|
|
400
|
+
}
|
|
401
|
+
/** Adds one item to a list as the signed-in person; an explicit action with its own idempotency key. */
|
|
402
|
+
export interface SharePointItemCreateRequest {
|
|
403
|
+
operation: 'sharepoint.item.create';
|
|
404
|
+
resource: string;
|
|
405
|
+
input: {
|
|
406
|
+
listId: string;
|
|
407
|
+
/** 1 to 32 column values keyed by the column's internal name (`Title`, `Status`, `DueDate`...); which columns the list has is Graph's check. */
|
|
408
|
+
fields: Record<string, SharePointFieldValue>;
|
|
409
|
+
};
|
|
410
|
+
/** A fresh UUID per authorized action, reused only to retry that action. */
|
|
411
|
+
idempotencyKey: string;
|
|
412
|
+
}
|
|
413
|
+
/** Changes the named columns of one item; a PATCH, the same outcome however often it runs, so no idempotency key. */
|
|
414
|
+
export interface SharePointItemUpdateRequest {
|
|
415
|
+
operation: 'sharepoint.item.update';
|
|
416
|
+
resource: string;
|
|
417
|
+
input: {
|
|
418
|
+
listId: string;
|
|
419
|
+
/** The `id` a `sharepoint.item.list` or `sharepoint.item.create` result named. */
|
|
420
|
+
itemId: string;
|
|
421
|
+
/** 1 to 32 column values; null clears a column. */
|
|
422
|
+
fields: Record<string, SharePointFieldValue>;
|
|
423
|
+
};
|
|
424
|
+
}
|
|
425
|
+
/** Lists the site's document libraries; their `id` is what the file operations take as `driveId`. */
|
|
426
|
+
export interface SharePointDriveListRequest {
|
|
427
|
+
operation: 'sharepoint.drive.list';
|
|
428
|
+
resource: string;
|
|
429
|
+
input?: {
|
|
430
|
+
pageToken?: string;
|
|
431
|
+
};
|
|
432
|
+
}
|
|
433
|
+
/** Lists one folder's entries, files and folders alike: the site's default library and its root when `driveId` and `folderId` are absent. */
|
|
434
|
+
export interface SharePointFileListRequest {
|
|
435
|
+
operation: 'sharepoint.file.list';
|
|
436
|
+
resource: string;
|
|
437
|
+
input?: {
|
|
438
|
+
driveId?: string;
|
|
439
|
+
/** The `id` of an entry with `isFolder` from an earlier listing. */
|
|
440
|
+
folderId?: string;
|
|
441
|
+
pageToken?: string;
|
|
442
|
+
};
|
|
443
|
+
}
|
|
444
|
+
/** Searches one library's file names and contents. */
|
|
445
|
+
export interface SharePointFileSearchRequest {
|
|
446
|
+
operation: 'sharepoint.file.search';
|
|
447
|
+
resource: string;
|
|
448
|
+
input: {
|
|
449
|
+
/** The words to search for, 1 to 256 characters. */
|
|
450
|
+
q: string;
|
|
451
|
+
driveId?: string;
|
|
452
|
+
pageToken?: string;
|
|
453
|
+
};
|
|
454
|
+
}
|
|
455
|
+
/** Reads one file's bytes (at most 2 MiB) as the signed-in person; `fileId` comes from a listing, a search or an upload. */
|
|
456
|
+
export interface SharePointFileReadRequest {
|
|
457
|
+
operation: 'sharepoint.file.read';
|
|
458
|
+
resource: string;
|
|
459
|
+
input: {
|
|
460
|
+
fileId: string;
|
|
461
|
+
driveId?: string;
|
|
462
|
+
};
|
|
463
|
+
}
|
|
464
|
+
/** Uploads one file (at most 2 MiB) as the signed-in person; an explicit action with its own idempotency key. */
|
|
465
|
+
export interface SharePointFileUploadRequest {
|
|
466
|
+
operation: 'sharepoint.file.upload';
|
|
467
|
+
resource: string;
|
|
468
|
+
input: {
|
|
469
|
+
/** The name to store it under, 1 to 255 characters; the result's `filename` is the stored name, which `conflict: 'rename'` may have changed. */
|
|
470
|
+
filename: string;
|
|
471
|
+
/** The file's MIME type, e.g. `application/pdf`. */
|
|
472
|
+
contentType: string;
|
|
473
|
+
/** The bytes as standard base64: at most 2 MiB of bytes (2,796,203 base64 characters). */
|
|
474
|
+
dataBase64: string;
|
|
475
|
+
driveId?: string;
|
|
476
|
+
folderId?: string;
|
|
477
|
+
/** `rename` when absent. */
|
|
478
|
+
conflict?: SharePointConflictBehavior;
|
|
479
|
+
};
|
|
480
|
+
/** A fresh UUID per authorized action, reused only to retry that action. */
|
|
481
|
+
idempotencyKey: string;
|
|
482
|
+
}
|
|
371
483
|
export interface ServiceRequest {
|
|
372
484
|
operation: 'service.request';
|
|
373
485
|
resource?: never;
|
|
@@ -385,7 +497,7 @@ export interface ServiceRequestResult {
|
|
|
385
497
|
headers: Record<string, string>;
|
|
386
498
|
body: unknown;
|
|
387
499
|
}
|
|
388
|
-
export type IntegrationRequest = ServiceRequest | SlackChannelHistoryRequest | SlackMessagePostRequest | SlackMessageUpdateRequest | SlackMessageDeleteRequest | SlackDmSendRequest | SlackUserLookupRequest | WarehouseViewReadRequest | GmailThreadListRequest | GmailThreadReadRequest | GmailMessageReadRequest | GmailAttachmentReadRequest | GmailMessageSendRequest | BasecampProjectListRequest | BasecampTodolistListRequest | BasecampTodoListRequest | BasecampTodoCreateRequest | BasecampTodoCompleteRequest | BasecampMessageListRequest | BasecampMessagePostRequest | BasecampCommentListRequest | BasecampCommentPostRequest | BasecampCampfirePostRequest | BasecampPeopleListRequest;
|
|
500
|
+
export type IntegrationRequest = ServiceRequest | SlackChannelHistoryRequest | SlackMessagePostRequest | SlackMessageUpdateRequest | SlackMessageDeleteRequest | SlackDmSendRequest | SlackUserLookupRequest | WarehouseViewReadRequest | GmailThreadListRequest | GmailThreadReadRequest | GmailMessageReadRequest | GmailAttachmentReadRequest | GmailMessageSendRequest | BasecampProjectListRequest | BasecampTodolistListRequest | BasecampTodoListRequest | BasecampTodoCreateRequest | BasecampTodoCompleteRequest | BasecampMessageListRequest | BasecampMessagePostRequest | BasecampCommentListRequest | BasecampCommentPostRequest | BasecampCampfirePostRequest | BasecampPeopleListRequest | SharePointListListRequest | SharePointItemListRequest | SharePointItemCreateRequest | SharePointItemUpdateRequest | SharePointDriveListRequest | SharePointFileListRequest | SharePointFileSearchRequest | SharePointFileReadRequest | SharePointFileUploadRequest;
|
|
389
501
|
export type IntegrationOperation = IntegrationRequest['operation'];
|
|
390
502
|
export interface SlackMessage {
|
|
391
503
|
id: string;
|
|
@@ -573,7 +685,75 @@ export interface BasecampTodoCompleteResult {
|
|
|
573
685
|
id: string;
|
|
574
686
|
completed: true;
|
|
575
687
|
}
|
|
576
|
-
|
|
688
|
+
/** One list of the site; `id` is the `listId` the item operations take. `template` is what Graph reports (genericList, documentLibrary, tasks, events...) when it does. */
|
|
689
|
+
export interface SharePointList {
|
|
690
|
+
id: string;
|
|
691
|
+
name: string;
|
|
692
|
+
description?: string;
|
|
693
|
+
webUrl: string;
|
|
694
|
+
template?: string;
|
|
695
|
+
}
|
|
696
|
+
/** One list item: `fields` are its column values keyed by internal column name as Graph returns them, system columns dropped and the whole object cut at 16 KiB; `id` is the `itemId` an update takes. */
|
|
697
|
+
export interface SharePointListItem {
|
|
698
|
+
id: string;
|
|
699
|
+
fields: Record<string, unknown>;
|
|
700
|
+
webUrl: string;
|
|
701
|
+
createdAt: string;
|
|
702
|
+
modifiedAt: string;
|
|
703
|
+
}
|
|
704
|
+
/** One document library; `id` is the `driveId` the file operations take. */
|
|
705
|
+
export interface SharePointDrive {
|
|
706
|
+
id: string;
|
|
707
|
+
name: string;
|
|
708
|
+
webUrl: string;
|
|
709
|
+
}
|
|
710
|
+
/** One entry of a folder or a search: a file (`mimeType` set; `id` is a `fileId`) or a folder (`isFolder`; `id` is a `folderId`). `size` is in bytes, a folder's the total of its contents. */
|
|
711
|
+
export interface SharePointFile {
|
|
712
|
+
id: string;
|
|
713
|
+
name: string;
|
|
714
|
+
isFolder: boolean;
|
|
715
|
+
size: number;
|
|
716
|
+
mimeType?: string;
|
|
717
|
+
webUrl: string;
|
|
718
|
+
modifiedAt: string;
|
|
719
|
+
}
|
|
720
|
+
/** One page of a SharePoint list; `nextPageToken` is present only when `hasMore` and is the next read's `pageToken`. */
|
|
721
|
+
export interface SharePointPage {
|
|
722
|
+
hasMore: boolean;
|
|
723
|
+
nextPageToken?: string;
|
|
724
|
+
}
|
|
725
|
+
export interface SharePointListListResult extends SharePointPage {
|
|
726
|
+
lists: SharePointList[];
|
|
727
|
+
}
|
|
728
|
+
export interface SharePointItemListResult extends SharePointPage {
|
|
729
|
+
items: SharePointListItem[];
|
|
730
|
+
}
|
|
731
|
+
export interface SharePointDriveListResult extends SharePointPage {
|
|
732
|
+
drives: SharePointDrive[];
|
|
733
|
+
}
|
|
734
|
+
/** `sharepoint.file.list` and `sharepoint.file.search` answer the same page of entries. */
|
|
735
|
+
export interface SharePointFileListResult extends SharePointPage {
|
|
736
|
+
files: SharePointFile[];
|
|
737
|
+
}
|
|
738
|
+
/** The new item and its SharePoint page, for a person to open. */
|
|
739
|
+
export interface SharePointItemCreateResult {
|
|
740
|
+
id: string;
|
|
741
|
+
webUrl: string;
|
|
742
|
+
}
|
|
743
|
+
export interface SharePointItemUpdateResult {
|
|
744
|
+
id: string;
|
|
745
|
+
}
|
|
746
|
+
/** The Gmail attachment shape plus the file's id. */
|
|
747
|
+
export interface SharePointFileReadResult extends GmailAttachmentReadResult {
|
|
748
|
+
id: string;
|
|
749
|
+
}
|
|
750
|
+
/** The stored file, under the name `conflict: 'rename'` may have given it, and its SharePoint page. */
|
|
751
|
+
export interface SharePointFileUploadResult {
|
|
752
|
+
id: string;
|
|
753
|
+
filename: string;
|
|
754
|
+
webUrl: string;
|
|
755
|
+
}
|
|
756
|
+
export type IntegrationResult<R extends IntegrationRequest> = R extends ServiceRequest ? ServiceRequestResult : R extends SlackChannelHistoryRequest ? SlackChannelHistoryResult : R extends SlackMessagePostRequest | SlackMessageUpdateRequest | SlackMessageDeleteRequest ? SlackMessagePostResult : R extends SlackDmSendRequest ? SlackDmSendResult : R extends SlackUserLookupRequest ? SlackUserLookupResult : R extends WarehouseViewReadRequest ? WarehouseViewReadResult : R extends GmailThreadListRequest ? GmailThreadListResult : R extends GmailThreadReadRequest ? GmailThreadReadResult : R extends GmailMessageReadRequest ? GmailMessageReadResult : R extends GmailAttachmentReadRequest ? GmailAttachmentReadResult : R extends GmailMessageSendRequest ? GmailMessageSendResult : R extends BasecampProjectListRequest ? BasecampProjectListResult : R extends BasecampTodolistListRequest ? BasecampTodolistListResult : R extends BasecampTodoListRequest ? BasecampTodoListResult : R extends BasecampMessageListRequest ? BasecampMessageListResult : R extends BasecampCommentListRequest ? BasecampCommentListResult : R extends BasecampPeopleListRequest ? BasecampPeopleListResult : R extends BasecampTodoCreateRequest | BasecampMessagePostRequest | BasecampCommentPostRequest | BasecampCampfirePostRequest ? BasecampRecordingResult : R extends BasecampTodoCompleteRequest ? BasecampTodoCompleteResult : R extends SharePointListListRequest ? SharePointListListResult : R extends SharePointItemListRequest ? SharePointItemListResult : R extends SharePointItemCreateRequest ? SharePointItemCreateResult : R extends SharePointItemUpdateRequest ? SharePointItemUpdateResult : R extends SharePointDriveListRequest ? SharePointDriveListResult : R extends SharePointFileListRequest | SharePointFileSearchRequest ? SharePointFileListResult : R extends SharePointFileReadRequest ? SharePointFileReadResult : R extends SharePointFileUploadRequest ? SharePointFileUploadResult : never;
|
|
577
757
|
export type IntegrationConnectResult = {
|
|
578
758
|
status: 'connected';
|
|
579
759
|
accountLabel: string;
|
|
@@ -56,9 +56,18 @@ export type IntegrationExecuteInputFieldRule = {
|
|
|
56
56
|
} | {
|
|
57
57
|
kind: 'boolean';
|
|
58
58
|
required: boolean;
|
|
59
|
+
} | {
|
|
60
|
+
kind: 'record';
|
|
61
|
+
required: boolean;
|
|
62
|
+
minProperties: number;
|
|
63
|
+
maxProperties: number;
|
|
64
|
+
types: readonly IntegrationExecuteInputRecordValueType[];
|
|
65
|
+
maxLength?: number;
|
|
59
66
|
};
|
|
60
67
|
/** The scalar types a `value` input accepts, alone or in its list form. */
|
|
61
68
|
export type IntegrationExecuteInputValueType = 'string' | 'number' | 'boolean';
|
|
69
|
+
/** The value types a `record` input accepts under each of its keys (0.78.0): a value type or null. */
|
|
70
|
+
export type IntegrationExecuteInputRecordValueType = IntegrationExecuteInputValueType | 'null';
|
|
62
71
|
export type IntegrationExecuteOperationRule = {
|
|
63
72
|
idempotencyKey: boolean;
|
|
64
73
|
fields: Record<string, IntegrationExecuteInputFieldRule>;
|
|
@@ -569,6 +578,199 @@ export declare const IntegrationExecuteInputRules: {
|
|
|
569
578
|
};
|
|
570
579
|
};
|
|
571
580
|
};
|
|
581
|
+
readonly "sharepoint.list.list": {
|
|
582
|
+
readonly idempotencyKey: false;
|
|
583
|
+
readonly fields: {
|
|
584
|
+
readonly pageToken: {
|
|
585
|
+
readonly kind: "string";
|
|
586
|
+
readonly required: false;
|
|
587
|
+
readonly minLength: 1;
|
|
588
|
+
readonly maxLength: 2048;
|
|
589
|
+
};
|
|
590
|
+
};
|
|
591
|
+
};
|
|
592
|
+
readonly "sharepoint.item.list": {
|
|
593
|
+
readonly idempotencyKey: false;
|
|
594
|
+
readonly fields: {
|
|
595
|
+
readonly listId: {
|
|
596
|
+
readonly kind: "string";
|
|
597
|
+
readonly required: true;
|
|
598
|
+
readonly minLength: 0;
|
|
599
|
+
readonly pattern: "^[A-Za-z0-9!._,=-]{1,256}$";
|
|
600
|
+
};
|
|
601
|
+
readonly filter: {
|
|
602
|
+
readonly kind: "string";
|
|
603
|
+
readonly required: false;
|
|
604
|
+
readonly minLength: 1;
|
|
605
|
+
readonly maxLength: 512;
|
|
606
|
+
};
|
|
607
|
+
readonly pageToken: {
|
|
608
|
+
readonly kind: "string";
|
|
609
|
+
readonly required: false;
|
|
610
|
+
readonly minLength: 1;
|
|
611
|
+
readonly maxLength: 2048;
|
|
612
|
+
};
|
|
613
|
+
};
|
|
614
|
+
};
|
|
615
|
+
readonly "sharepoint.item.create": {
|
|
616
|
+
readonly idempotencyKey: true;
|
|
617
|
+
readonly fields: {
|
|
618
|
+
readonly listId: {
|
|
619
|
+
readonly kind: "string";
|
|
620
|
+
readonly required: true;
|
|
621
|
+
readonly minLength: 0;
|
|
622
|
+
readonly pattern: "^[A-Za-z0-9!._,=-]{1,256}$";
|
|
623
|
+
};
|
|
624
|
+
readonly fields: {
|
|
625
|
+
readonly kind: "record";
|
|
626
|
+
readonly required: true;
|
|
627
|
+
readonly minProperties: 1;
|
|
628
|
+
readonly maxProperties: 32;
|
|
629
|
+
readonly types: readonly ["string", "number", "boolean", "null"];
|
|
630
|
+
readonly maxLength: 4000;
|
|
631
|
+
};
|
|
632
|
+
};
|
|
633
|
+
};
|
|
634
|
+
readonly "sharepoint.item.update": {
|
|
635
|
+
readonly idempotencyKey: false;
|
|
636
|
+
readonly fields: {
|
|
637
|
+
readonly listId: {
|
|
638
|
+
readonly kind: "string";
|
|
639
|
+
readonly required: true;
|
|
640
|
+
readonly minLength: 0;
|
|
641
|
+
readonly pattern: "^[A-Za-z0-9!._,=-]{1,256}$";
|
|
642
|
+
};
|
|
643
|
+
readonly itemId: {
|
|
644
|
+
readonly kind: "string";
|
|
645
|
+
readonly required: true;
|
|
646
|
+
readonly minLength: 0;
|
|
647
|
+
readonly pattern: "^[A-Za-z0-9!._,=-]{1,256}$";
|
|
648
|
+
};
|
|
649
|
+
readonly fields: {
|
|
650
|
+
readonly kind: "record";
|
|
651
|
+
readonly required: true;
|
|
652
|
+
readonly minProperties: 1;
|
|
653
|
+
readonly maxProperties: 32;
|
|
654
|
+
readonly types: readonly ["string", "number", "boolean", "null"];
|
|
655
|
+
readonly maxLength: 4000;
|
|
656
|
+
};
|
|
657
|
+
};
|
|
658
|
+
};
|
|
659
|
+
readonly "sharepoint.drive.list": {
|
|
660
|
+
readonly idempotencyKey: false;
|
|
661
|
+
readonly fields: {
|
|
662
|
+
readonly pageToken: {
|
|
663
|
+
readonly kind: "string";
|
|
664
|
+
readonly required: false;
|
|
665
|
+
readonly minLength: 1;
|
|
666
|
+
readonly maxLength: 2048;
|
|
667
|
+
};
|
|
668
|
+
};
|
|
669
|
+
};
|
|
670
|
+
readonly "sharepoint.file.list": {
|
|
671
|
+
readonly idempotencyKey: false;
|
|
672
|
+
readonly fields: {
|
|
673
|
+
readonly driveId: {
|
|
674
|
+
readonly kind: "string";
|
|
675
|
+
readonly required: false;
|
|
676
|
+
readonly minLength: 0;
|
|
677
|
+
readonly pattern: "^[A-Za-z0-9!._,=-]{1,256}$";
|
|
678
|
+
};
|
|
679
|
+
readonly folderId: {
|
|
680
|
+
readonly kind: "string";
|
|
681
|
+
readonly required: false;
|
|
682
|
+
readonly minLength: 0;
|
|
683
|
+
readonly pattern: "^[A-Za-z0-9!._,=-]{1,256}$";
|
|
684
|
+
};
|
|
685
|
+
readonly pageToken: {
|
|
686
|
+
readonly kind: "string";
|
|
687
|
+
readonly required: false;
|
|
688
|
+
readonly minLength: 1;
|
|
689
|
+
readonly maxLength: 2048;
|
|
690
|
+
};
|
|
691
|
+
};
|
|
692
|
+
};
|
|
693
|
+
readonly "sharepoint.file.search": {
|
|
694
|
+
readonly idempotencyKey: false;
|
|
695
|
+
readonly fields: {
|
|
696
|
+
readonly q: {
|
|
697
|
+
readonly kind: "string";
|
|
698
|
+
readonly required: true;
|
|
699
|
+
readonly minLength: 1;
|
|
700
|
+
readonly maxLength: 256;
|
|
701
|
+
};
|
|
702
|
+
readonly driveId: {
|
|
703
|
+
readonly kind: "string";
|
|
704
|
+
readonly required: false;
|
|
705
|
+
readonly minLength: 0;
|
|
706
|
+
readonly pattern: "^[A-Za-z0-9!._,=-]{1,256}$";
|
|
707
|
+
};
|
|
708
|
+
readonly pageToken: {
|
|
709
|
+
readonly kind: "string";
|
|
710
|
+
readonly required: false;
|
|
711
|
+
readonly minLength: 1;
|
|
712
|
+
readonly maxLength: 2048;
|
|
713
|
+
};
|
|
714
|
+
};
|
|
715
|
+
};
|
|
716
|
+
readonly "sharepoint.file.read": {
|
|
717
|
+
readonly idempotencyKey: false;
|
|
718
|
+
readonly fields: {
|
|
719
|
+
readonly fileId: {
|
|
720
|
+
readonly kind: "string";
|
|
721
|
+
readonly required: true;
|
|
722
|
+
readonly minLength: 0;
|
|
723
|
+
readonly pattern: "^[A-Za-z0-9!._,=-]{1,256}$";
|
|
724
|
+
};
|
|
725
|
+
readonly driveId: {
|
|
726
|
+
readonly kind: "string";
|
|
727
|
+
readonly required: false;
|
|
728
|
+
readonly minLength: 0;
|
|
729
|
+
readonly pattern: "^[A-Za-z0-9!._,=-]{1,256}$";
|
|
730
|
+
};
|
|
731
|
+
};
|
|
732
|
+
};
|
|
733
|
+
readonly "sharepoint.file.upload": {
|
|
734
|
+
readonly idempotencyKey: true;
|
|
735
|
+
readonly fields: {
|
|
736
|
+
readonly filename: {
|
|
737
|
+
readonly kind: "string";
|
|
738
|
+
readonly required: true;
|
|
739
|
+
readonly minLength: 1;
|
|
740
|
+
readonly maxLength: 255;
|
|
741
|
+
};
|
|
742
|
+
readonly contentType: {
|
|
743
|
+
readonly kind: "string";
|
|
744
|
+
readonly required: true;
|
|
745
|
+
readonly minLength: 1;
|
|
746
|
+
readonly maxLength: 128;
|
|
747
|
+
};
|
|
748
|
+
readonly dataBase64: {
|
|
749
|
+
readonly kind: "string";
|
|
750
|
+
readonly required: true;
|
|
751
|
+
readonly minLength: 1;
|
|
752
|
+
readonly maxLength: 2796203;
|
|
753
|
+
};
|
|
754
|
+
readonly driveId: {
|
|
755
|
+
readonly kind: "string";
|
|
756
|
+
readonly required: false;
|
|
757
|
+
readonly minLength: 0;
|
|
758
|
+
readonly pattern: "^[A-Za-z0-9!._,=-]{1,256}$";
|
|
759
|
+
};
|
|
760
|
+
readonly folderId: {
|
|
761
|
+
readonly kind: "string";
|
|
762
|
+
readonly required: false;
|
|
763
|
+
readonly minLength: 0;
|
|
764
|
+
readonly pattern: "^[A-Za-z0-9!._,=-]{1,256}$";
|
|
765
|
+
};
|
|
766
|
+
readonly conflict: {
|
|
767
|
+
readonly kind: "enum";
|
|
768
|
+
readonly required: false;
|
|
769
|
+
readonly values: readonly ["rename", "replace", "fail"];
|
|
770
|
+
readonly default: "rename";
|
|
771
|
+
};
|
|
772
|
+
};
|
|
773
|
+
};
|
|
572
774
|
readonly "warehouse.view.read": {
|
|
573
775
|
readonly idempotencyKey: false;
|
|
574
776
|
readonly fields: {
|
|
@@ -172,6 +172,75 @@ export const IntegrationExecuteInputRules = {
|
|
|
172
172
|
pageToken: { kind: "string", required: false, minLength: 1, maxLength: 256 },
|
|
173
173
|
},
|
|
174
174
|
},
|
|
175
|
+
"sharepoint.list.list": {
|
|
176
|
+
idempotencyKey: false,
|
|
177
|
+
fields: {
|
|
178
|
+
pageToken: { kind: "string", required: false, minLength: 1, maxLength: 2048 },
|
|
179
|
+
},
|
|
180
|
+
},
|
|
181
|
+
"sharepoint.item.list": {
|
|
182
|
+
idempotencyKey: false,
|
|
183
|
+
fields: {
|
|
184
|
+
listId: { kind: "string", required: true, minLength: 0, pattern: "^[A-Za-z0-9!._,=-]{1,256}$" },
|
|
185
|
+
filter: { kind: "string", required: false, minLength: 1, maxLength: 512 },
|
|
186
|
+
pageToken: { kind: "string", required: false, minLength: 1, maxLength: 2048 },
|
|
187
|
+
},
|
|
188
|
+
},
|
|
189
|
+
"sharepoint.item.create": {
|
|
190
|
+
idempotencyKey: true,
|
|
191
|
+
fields: {
|
|
192
|
+
listId: { kind: "string", required: true, minLength: 0, pattern: "^[A-Za-z0-9!._,=-]{1,256}$" },
|
|
193
|
+
fields: { kind: "record", required: true, minProperties: 1, maxProperties: 32, types: ["string", "number", "boolean", "null"], maxLength: 4000 },
|
|
194
|
+
},
|
|
195
|
+
},
|
|
196
|
+
"sharepoint.item.update": {
|
|
197
|
+
idempotencyKey: false,
|
|
198
|
+
fields: {
|
|
199
|
+
listId: { kind: "string", required: true, minLength: 0, pattern: "^[A-Za-z0-9!._,=-]{1,256}$" },
|
|
200
|
+
itemId: { kind: "string", required: true, minLength: 0, pattern: "^[A-Za-z0-9!._,=-]{1,256}$" },
|
|
201
|
+
fields: { kind: "record", required: true, minProperties: 1, maxProperties: 32, types: ["string", "number", "boolean", "null"], maxLength: 4000 },
|
|
202
|
+
},
|
|
203
|
+
},
|
|
204
|
+
"sharepoint.drive.list": {
|
|
205
|
+
idempotencyKey: false,
|
|
206
|
+
fields: {
|
|
207
|
+
pageToken: { kind: "string", required: false, minLength: 1, maxLength: 2048 },
|
|
208
|
+
},
|
|
209
|
+
},
|
|
210
|
+
"sharepoint.file.list": {
|
|
211
|
+
idempotencyKey: false,
|
|
212
|
+
fields: {
|
|
213
|
+
driveId: { kind: "string", required: false, minLength: 0, pattern: "^[A-Za-z0-9!._,=-]{1,256}$" },
|
|
214
|
+
folderId: { kind: "string", required: false, minLength: 0, pattern: "^[A-Za-z0-9!._,=-]{1,256}$" },
|
|
215
|
+
pageToken: { kind: "string", required: false, minLength: 1, maxLength: 2048 },
|
|
216
|
+
},
|
|
217
|
+
},
|
|
218
|
+
"sharepoint.file.search": {
|
|
219
|
+
idempotencyKey: false,
|
|
220
|
+
fields: {
|
|
221
|
+
q: { kind: "string", required: true, minLength: 1, maxLength: 256 },
|
|
222
|
+
driveId: { kind: "string", required: false, minLength: 0, pattern: "^[A-Za-z0-9!._,=-]{1,256}$" },
|
|
223
|
+
pageToken: { kind: "string", required: false, minLength: 1, maxLength: 2048 },
|
|
224
|
+
},
|
|
225
|
+
},
|
|
226
|
+
"sharepoint.file.read": {
|
|
227
|
+
idempotencyKey: false,
|
|
228
|
+
fields: {
|
|
229
|
+
fileId: { kind: "string", required: true, minLength: 0, pattern: "^[A-Za-z0-9!._,=-]{1,256}$" },
|
|
230
|
+
driveId: { kind: "string", required: false, minLength: 0, pattern: "^[A-Za-z0-9!._,=-]{1,256}$" },
|
|
231
|
+
},
|
|
232
|
+
},
|
|
233
|
+
"sharepoint.file.upload": {
|
|
234
|
+
idempotencyKey: true,
|
|
235
|
+
fields: {
|
|
236
|
+
filename: { kind: "string", required: true, minLength: 1, maxLength: 255 },
|
|
237
|
+
contentType: { kind: "string", required: true, minLength: 1, maxLength: 128 },
|
|
238
|
+
dataBase64: { kind: "string", required: true, minLength: 1, maxLength: 2796203 },
|
|
239
|
+
driveId: { kind: "string", required: false, minLength: 0, pattern: "^[A-Za-z0-9!._,=-]{1,256}$" },
|
|
240
|
+
folderId: { kind: "string", required: false, minLength: 0, pattern: "^[A-Za-z0-9!._,=-]{1,256}$" },
|
|
241
|
+
conflict: { kind: "enum", required: false, values: ["rename", "replace", "fail"], default: "rename" },
|
|
242
|
+
},
|
|
243
|
+
},
|
|
175
244
|
"warehouse.view.read": {
|
|
176
245
|
idempotencyKey: false,
|
|
177
246
|
fields: {
|
|
@@ -223,17 +292,22 @@ function matches(pattern, value) {
|
|
|
223
292
|
return compiled.test(value);
|
|
224
293
|
}
|
|
225
294
|
function refuse(field, message) { return { ok: false, problem: { field, message } }; }
|
|
226
|
-
const valueNouns = { string: ['a string', 'strings'], number: ['a number', 'numbers'], boolean: ['a boolean', 'booleans'] };
|
|
295
|
+
const valueNouns = { string: ['a string', 'strings'], number: ['a number', 'numbers'], boolean: ['a boolean', 'booleans'], null: ['null', 'nulls'] };
|
|
227
296
|
function either(parts) {
|
|
228
297
|
return parts.length > 1 ? `${parts.slice(0, -1).join(', ')} or ${parts[parts.length - 1]}` : parts.join('');
|
|
229
298
|
}
|
|
230
299
|
function isScalar(types, maxLength, value) {
|
|
300
|
+
if (value === null)
|
|
301
|
+
return types.includes('null');
|
|
231
302
|
if (typeof value === 'string')
|
|
232
303
|
return types.includes('string') && (maxLength === undefined || value.length <= maxLength);
|
|
233
304
|
if (typeof value === 'number')
|
|
234
305
|
return types.includes('number') && Number.isFinite(value);
|
|
235
306
|
return typeof value === 'boolean' && types.includes('boolean');
|
|
236
307
|
}
|
|
308
|
+
function scalarShapes(types, maxLength) {
|
|
309
|
+
return types.map(type => (type === 'string' && maxLength !== undefined ? `a string of at most ${maxLength} characters` : valueNouns[type][0]));
|
|
310
|
+
}
|
|
237
311
|
/**
|
|
238
312
|
* Checks one object's fields in rule order and applies defaults: the input
|
|
239
313
|
* itself (where null counts as absent), or one entry of an object[] input
|
|
@@ -273,6 +347,18 @@ function checkField(operation, path, name, field, value) {
|
|
|
273
347
|
if (typeof value !== 'boolean')
|
|
274
348
|
return refuse(path, `${path} must be a boolean`);
|
|
275
349
|
return { ok: true, value };
|
|
350
|
+
case 'record': {
|
|
351
|
+
if (value === null || typeof value !== 'object' || Array.isArray(value))
|
|
352
|
+
return refuse(path, `${path} must be a JSON object`);
|
|
353
|
+
const keys = Object.keys(value);
|
|
354
|
+
if (keys.length < field.minProperties || keys.length > field.maxProperties)
|
|
355
|
+
return refuse(path, `${path} must have ${field.minProperties} to ${field.maxProperties} properties`);
|
|
356
|
+
for (const key of keys) {
|
|
357
|
+
if (!isScalar(field.types, field.maxLength, value[key]))
|
|
358
|
+
return refuse(`${path}.${key}`, `${path}.${key} must be ${either(scalarShapes(field.types, field.maxLength))}`);
|
|
359
|
+
}
|
|
360
|
+
return { ok: true, value };
|
|
361
|
+
}
|
|
276
362
|
case 'integer':
|
|
277
363
|
if (typeof value !== 'number' || !Number.isInteger(value) || value < field.minimum || value > field.maximum)
|
|
278
364
|
return refuse(path, `${path} must be an integer between ${field.minimum} and ${field.maximum}`);
|
|
@@ -318,7 +404,7 @@ function checkField(operation, path, name, field, value) {
|
|
|
318
404
|
const { types, maxLength, list } = field;
|
|
319
405
|
if (isScalar(types, maxLength, value) || (list !== undefined && Array.isArray(value) && value.length >= list.minItems && value.length <= list.maxItems && value.every(item => isScalar(list.types, maxLength, item))))
|
|
320
406
|
return { ok: true, value };
|
|
321
|
-
const shapes = types
|
|
407
|
+
const shapes = scalarShapes(types, maxLength);
|
|
322
408
|
if (list !== undefined)
|
|
323
409
|
shapes.push(`a list of ${list.minItems} to ${list.maxItems} ${either(list.types.map(type => valueNouns[type][1]))}`);
|
|
324
410
|
return refuse(path, `${path} must be ${either(shapes)}`);
|
|
@@ -154,6 +154,69 @@ export declare const IntegrationOperations: {
|
|
|
154
154
|
readonly declaredMode: false;
|
|
155
155
|
readonly idempotencyKey: false;
|
|
156
156
|
};
|
|
157
|
+
readonly "sharepoint.list.list": {
|
|
158
|
+
readonly kind: "saas";
|
|
159
|
+
readonly identities: readonly ["user"];
|
|
160
|
+
readonly readOnly: true;
|
|
161
|
+
readonly declaredMode: false;
|
|
162
|
+
readonly idempotencyKey: false;
|
|
163
|
+
};
|
|
164
|
+
readonly "sharepoint.item.list": {
|
|
165
|
+
readonly kind: "saas";
|
|
166
|
+
readonly identities: readonly ["user"];
|
|
167
|
+
readonly readOnly: true;
|
|
168
|
+
readonly declaredMode: false;
|
|
169
|
+
readonly idempotencyKey: false;
|
|
170
|
+
};
|
|
171
|
+
readonly "sharepoint.item.create": {
|
|
172
|
+
readonly kind: "saas";
|
|
173
|
+
readonly identities: readonly ["user"];
|
|
174
|
+
readonly readOnly: false;
|
|
175
|
+
readonly declaredMode: false;
|
|
176
|
+
readonly idempotencyKey: true;
|
|
177
|
+
};
|
|
178
|
+
readonly "sharepoint.item.update": {
|
|
179
|
+
readonly kind: "saas";
|
|
180
|
+
readonly identities: readonly ["user"];
|
|
181
|
+
readonly readOnly: false;
|
|
182
|
+
readonly declaredMode: false;
|
|
183
|
+
readonly idempotencyKey: false;
|
|
184
|
+
};
|
|
185
|
+
readonly "sharepoint.drive.list": {
|
|
186
|
+
readonly kind: "saas";
|
|
187
|
+
readonly identities: readonly ["user"];
|
|
188
|
+
readonly readOnly: true;
|
|
189
|
+
readonly declaredMode: false;
|
|
190
|
+
readonly idempotencyKey: false;
|
|
191
|
+
};
|
|
192
|
+
readonly "sharepoint.file.list": {
|
|
193
|
+
readonly kind: "saas";
|
|
194
|
+
readonly identities: readonly ["user"];
|
|
195
|
+
readonly readOnly: true;
|
|
196
|
+
readonly declaredMode: false;
|
|
197
|
+
readonly idempotencyKey: false;
|
|
198
|
+
};
|
|
199
|
+
readonly "sharepoint.file.search": {
|
|
200
|
+
readonly kind: "saas";
|
|
201
|
+
readonly identities: readonly ["user"];
|
|
202
|
+
readonly readOnly: true;
|
|
203
|
+
readonly declaredMode: false;
|
|
204
|
+
readonly idempotencyKey: false;
|
|
205
|
+
};
|
|
206
|
+
readonly "sharepoint.file.read": {
|
|
207
|
+
readonly kind: "saas";
|
|
208
|
+
readonly identities: readonly ["user"];
|
|
209
|
+
readonly readOnly: true;
|
|
210
|
+
readonly declaredMode: false;
|
|
211
|
+
readonly idempotencyKey: false;
|
|
212
|
+
};
|
|
213
|
+
readonly "sharepoint.file.upload": {
|
|
214
|
+
readonly kind: "saas";
|
|
215
|
+
readonly identities: readonly ["user"];
|
|
216
|
+
readonly readOnly: false;
|
|
217
|
+
readonly declaredMode: false;
|
|
218
|
+
readonly idempotencyKey: true;
|
|
219
|
+
};
|
|
157
220
|
readonly "warehouse.view.read": {
|
|
158
221
|
readonly kind: "database";
|
|
159
222
|
readonly identities: readonly ["app"];
|
|
@@ -204,6 +204,87 @@ export const IntegrationOperations = {
|
|
|
204
204
|
"declaredMode": false,
|
|
205
205
|
"idempotencyKey": false
|
|
206
206
|
},
|
|
207
|
+
"sharepoint.list.list": {
|
|
208
|
+
"kind": "saas",
|
|
209
|
+
"identities": [
|
|
210
|
+
"user"
|
|
211
|
+
],
|
|
212
|
+
"readOnly": true,
|
|
213
|
+
"declaredMode": false,
|
|
214
|
+
"idempotencyKey": false
|
|
215
|
+
},
|
|
216
|
+
"sharepoint.item.list": {
|
|
217
|
+
"kind": "saas",
|
|
218
|
+
"identities": [
|
|
219
|
+
"user"
|
|
220
|
+
],
|
|
221
|
+
"readOnly": true,
|
|
222
|
+
"declaredMode": false,
|
|
223
|
+
"idempotencyKey": false
|
|
224
|
+
},
|
|
225
|
+
"sharepoint.item.create": {
|
|
226
|
+
"kind": "saas",
|
|
227
|
+
"identities": [
|
|
228
|
+
"user"
|
|
229
|
+
],
|
|
230
|
+
"readOnly": false,
|
|
231
|
+
"declaredMode": false,
|
|
232
|
+
"idempotencyKey": true
|
|
233
|
+
},
|
|
234
|
+
"sharepoint.item.update": {
|
|
235
|
+
"kind": "saas",
|
|
236
|
+
"identities": [
|
|
237
|
+
"user"
|
|
238
|
+
],
|
|
239
|
+
"readOnly": false,
|
|
240
|
+
"declaredMode": false,
|
|
241
|
+
"idempotencyKey": false
|
|
242
|
+
},
|
|
243
|
+
"sharepoint.drive.list": {
|
|
244
|
+
"kind": "saas",
|
|
245
|
+
"identities": [
|
|
246
|
+
"user"
|
|
247
|
+
],
|
|
248
|
+
"readOnly": true,
|
|
249
|
+
"declaredMode": false,
|
|
250
|
+
"idempotencyKey": false
|
|
251
|
+
},
|
|
252
|
+
"sharepoint.file.list": {
|
|
253
|
+
"kind": "saas",
|
|
254
|
+
"identities": [
|
|
255
|
+
"user"
|
|
256
|
+
],
|
|
257
|
+
"readOnly": true,
|
|
258
|
+
"declaredMode": false,
|
|
259
|
+
"idempotencyKey": false
|
|
260
|
+
},
|
|
261
|
+
"sharepoint.file.search": {
|
|
262
|
+
"kind": "saas",
|
|
263
|
+
"identities": [
|
|
264
|
+
"user"
|
|
265
|
+
],
|
|
266
|
+
"readOnly": true,
|
|
267
|
+
"declaredMode": false,
|
|
268
|
+
"idempotencyKey": false
|
|
269
|
+
},
|
|
270
|
+
"sharepoint.file.read": {
|
|
271
|
+
"kind": "saas",
|
|
272
|
+
"identities": [
|
|
273
|
+
"user"
|
|
274
|
+
],
|
|
275
|
+
"readOnly": true,
|
|
276
|
+
"declaredMode": false,
|
|
277
|
+
"idempotencyKey": false
|
|
278
|
+
},
|
|
279
|
+
"sharepoint.file.upload": {
|
|
280
|
+
"kind": "saas",
|
|
281
|
+
"identities": [
|
|
282
|
+
"user"
|
|
283
|
+
],
|
|
284
|
+
"readOnly": false,
|
|
285
|
+
"declaredMode": false,
|
|
286
|
+
"idempotencyKey": true
|
|
287
|
+
},
|
|
207
288
|
"warehouse.view.read": {
|
|
208
289
|
"kind": "database",
|
|
209
290
|
"identities": [
|
package/dist/runtime.d.ts
CHANGED
|
@@ -11,7 +11,7 @@ export declare const GET_RUN_ACTION = "isomorph-jobs-get";
|
|
|
11
11
|
export declare const CANCEL_RUN_ACTION = "isomorph-jobs-cancel";
|
|
12
12
|
export interface ActionContext {
|
|
13
13
|
signal: AbortSignal;
|
|
14
|
-
user:
|
|
14
|
+
user: IsomorphUser;
|
|
15
15
|
tenant: string;
|
|
16
16
|
app: string;
|
|
17
17
|
requestId: string;
|
package/dist/runtime.js
CHANGED
|
@@ -489,11 +489,16 @@ export class Runtime {
|
|
|
489
489
|
const controller = new AbortController();
|
|
490
490
|
const abort = () => controller.abort();
|
|
491
491
|
response.once('close', abort);
|
|
492
|
+
const directory = header(request, 'X-Harbour-Verified-Directory');
|
|
492
493
|
const user = {
|
|
493
494
|
id: header(request, 'X-Harbour-Verified-User-ID'),
|
|
494
495
|
email: header(request, 'X-Harbour-Verified-User-Email'),
|
|
495
496
|
groups: userGroupsFromHeader(header(request, 'X-Harbour-Verified-User-Groups')),
|
|
496
497
|
role: userRole(header(request, 'X-Harbour-Verified-User-Role')),
|
|
498
|
+
...(directory === 'company' || directory === 'external' ? { directory } : {}),
|
|
499
|
+
...(header(request, 'X-Harbour-Verified-User-Name') ? { name: header(request, 'X-Harbour-Verified-User-Name') } : {}),
|
|
500
|
+
...(header(request, 'X-Harbour-Verified-User-Phone') ? { phone: header(request, 'X-Harbour-Verified-User-Phone') } : {}),
|
|
501
|
+
...(directory === 'external' ? { emailVerified: header(request, 'X-Harbour-Verified-Email-Verified') === 'true', phoneVerified: header(request, 'X-Harbour-Verified-Phone-Verified') === 'true' } : {}),
|
|
497
502
|
};
|
|
498
503
|
const streams = header(request, 'accept').toLowerCase().includes(PROGRESS_MEDIA_TYPE);
|
|
499
504
|
let steps = 0;
|
|
@@ -130,7 +130,7 @@ export declare class SupabaseCompatQueryBuilder<T, Result = T[], Head extends bo
|
|
|
130
130
|
}
|
|
131
131
|
export interface SupabaseCompatUser {
|
|
132
132
|
id: string;
|
|
133
|
-
email
|
|
133
|
+
email?: string;
|
|
134
134
|
app_metadata: Record<string, unknown>;
|
|
135
135
|
/** Isomorph's per-app user record (`IsomorphUser.appUser`) when it is an object. */
|
|
136
136
|
user_metadata: Record<string, unknown>;
|