Compare commits
362 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 647f09f2f3 | |||
| bd103802f9 | |||
| 1e12366e5a | |||
| 98978a9992 | |||
| d7dcb1bf61 | |||
| 3bece03c7f | |||
| 60fdde1919 | |||
| c42d03a4a6 | |||
| 58a6ef436a | |||
| 3ab542b03f | |||
| 2a760f1f2a | |||
| 0a06e84350 | |||
| f2c07c1a31 | |||
| 829b851588 | |||
| 8f524f8c21 | |||
| 0e2a7313c6 | |||
| 9ab7530070 | |||
| f4833d3c1c | |||
| 6d01f2ab0c | |||
| 6b5ebe79f4 | |||
| 83dece4617 | |||
| 0b66a9ab37 | |||
| 4b50bf777f | |||
| 77a8505098 | |||
| 1da4797835 | |||
| 410b282d38 | |||
| 5d012a483d | |||
| 0feb793ce5 | |||
| 26cccd15f9 | |||
| be4da5661e | |||
| e5717080f2 | |||
| de87d71e63 | |||
| e93ecf4f8d | |||
| dae3edd3cd | |||
| af445a8f6d | |||
| 02d114d6f0 | |||
| 8518531cf4 | |||
| 192aad66b3 | |||
| 872b4a5e4d | |||
| 63a11f3f1b | |||
| 6d1bb15d46 | |||
| aba95aaa04 | |||
| 338c0f0d4e | |||
| fd61a002a9 | |||
| fec7a0c96f | |||
| d06e9194c9 | |||
| f8374783c1 | |||
| 6f3be0138d | |||
| 15e527456d | |||
| 7d7e7ba078 | |||
| 1af020f8b8 | |||
| 79a1f5daea | |||
| cee489025f | |||
| e00a048afc | |||
| 0ecebabd3f | |||
| a9591ca396 | |||
| db6be0f7cb | |||
| 683f24d4e4 | |||
| c4249d9e78 | |||
| e714b69896 | |||
| 378a7e390e | |||
| 96a5ccd715 | |||
| d3be9dc294 | |||
| 3f60917d17 | |||
| 8430820faf | |||
| 7f5151dcf2 | |||
| 8725a80d78 | |||
| fd85667515 | |||
| 16107fa5e6 | |||
| ec727646fe | |||
| a7f4362a8b | |||
| 7c5d97c603 | |||
| f7850c14f9 | |||
| a4813fe141 | |||
| 5e45309b81 | |||
| 5f0cebc879 | |||
| 122020e66b | |||
| c166ca6aa5 | |||
| 7bbe42935e | |||
| decb17c1ab | |||
| 61246dcfb4 | |||
| 9625258394 | |||
| c051aa284a | |||
| b605ecdaaa | |||
| 27d8742829 | |||
| 7cb350e37b | |||
| e400d2f1fb | |||
| 221370ba9e | |||
| a446367514 | |||
| 50e6d37780 | |||
| 4803ad3c9a | |||
| 7db68764ac | |||
| ef48592a73 | |||
| d0dd3d5acf | |||
| 0c74035a8f | |||
| 213012b66e | |||
| 2022d0ba56 | |||
| ae68825306 | |||
| aa575b0d79 | |||
| 4e83ef642d | |||
| e6740b5451 | |||
| 2e0a820518 | |||
| b5e47b7d60 | |||
| 3d328aeaaf | |||
| 952fa6bc9e | |||
| 7d3bc03594 | |||
| 19baf3f04a | |||
| 73d488f97d | |||
| d6d8ca67a8 | |||
| 9a93b0fee7 | |||
| 900eece37d | |||
| 20711ce4b2 | |||
| d9a43dc579 | |||
| f2aac62611 | |||
| 26d2392ac2 | |||
| 64585b3393 | |||
| 58d919efdc | |||
| 5eeb275b32 | |||
| 629ee14b55 | |||
| 113752e3e9 | |||
| 758fad8447 | |||
| 3967befabd | |||
| cbff0baf15 | |||
| b0cccc059a | |||
| c879f48109 | |||
| fce52cee6b | |||
| aedf7e7295 | |||
| c593132663 | |||
| ff7bdd7619 | |||
| c229fa31fc | |||
| 632f76cbb9 | |||
| 5dae509aa9 | |||
| 1b902dabfa | |||
| a1043a3b28 | |||
| 22c682bf4c | |||
| 0b67b51ae4 | |||
| 1673d4527a | |||
| 5e762a9cbf | |||
| 406be0107e | |||
| 4ab4174cb2 | |||
| 78e6ed9bfc | |||
| f813e59b0c | |||
| 2992a855f9 | |||
| f172a0ee1a | |||
| 3c74e4f5f6 | |||
| bf4eefe4fd | |||
| 2e81d6fe20 | |||
| 77f243a14a | |||
| 4245c21248 | |||
| e6d276de03 | |||
| 3c09c1704d | |||
| 0e3c3a78d7 | |||
| fa28005f40 | |||
| 3a956c2718 | |||
| a21e9e9838 | |||
| c109a9f31c | |||
| c1dd5e92fe | |||
| 441183975c | |||
| 0f9c0a8d06 | |||
| 5beba8f12e | |||
| 9b7102605f | |||
| 0618cd0d7a | |||
| bc7f11fb57 | |||
| 19d731eebb | |||
| e2b183bd96 | |||
| 80709c5415 | |||
| 22e3c7f5f2 | |||
| 843231c410 | |||
| 1a33bdd3ae | |||
| c0300c6bec | |||
| bffa5ef0e2 | |||
| 4e95232d59 | |||
| ca64356f12 | |||
| c2c1b0feb4 | |||
| 57afaf1995 | |||
| 4c965ed5a2 | |||
| 0462141e1b | |||
| ce39397c57 | |||
| 55cb81f7af | |||
| f7a4e69025 | |||
| 55ac0019b7 | |||
| b87a3dd2ba | |||
| 41c751c081 | |||
| 1f34a22bd8 | |||
| 10ef03eee0 | |||
| bef6de13db | |||
| bd356663cc | |||
| 1670c3e19b | |||
| aa35555356 | |||
| 1520be20c4 | |||
| 9cd49a40d5 | |||
| d27f11e26c | |||
| 9aff64183b | |||
| 5e32c8498b | |||
| bd2f2d442d | |||
| 328ff206d7 | |||
| 774a0fe9e3 | |||
| 3eb76739cc | |||
| f00f6ae1bd | |||
| 7798c0166d | |||
| 9c63687d56 | |||
| 28cad34c5f | |||
| 86d345bffc | |||
| 9cdab61eaf | |||
| 48b35c47b4 | |||
| 349d7f38cc | |||
| 7cbc279407 | |||
| 301d500c3d | |||
| 4150ba8786 | |||
| f39bc44eec | |||
| 4fabd481e6 | |||
| a374338ac5 | |||
| a7337478d0 | |||
| a7b37e9f7b | |||
| 48e0cff123 | |||
| 8a4cc312a1 | |||
| f008f803b8 | |||
| b43224c353 | |||
| 8bb9798ff4 | |||
| 86ae6f927a | |||
| c0693ac508 | |||
| ab512157a5 | |||
| 86475d4e3c | |||
| c5084209eb | |||
| eada69040c | |||
| 6deabb21ba | |||
| 2bb324752e | |||
| 174954511e | |||
| 408bd6ddc8 | |||
| 1789d9d215 | |||
| f3ac17ad91 | |||
| 71d78805e7 | |||
| 3012771a21 | |||
| 5ec7198046 | |||
| 60cb8d54c4 | |||
| 9d7186eba5 | |||
| 5401fa1acb | |||
| 79f21fd94e | |||
| fa7ec12434 | |||
| c6a668a5f6 | |||
| dd786845b7 | |||
| 03e90ea48f | |||
| fee24168aa | |||
| b344dfaaf8 | |||
| ce019c7b96 | |||
| 9a52afe1e2 | |||
| d67e429f23 | |||
| 628726459a | |||
| 603c3953c6 | |||
| 8a7795bd4d | |||
| 9202d3458a | |||
| fb98a4708f | |||
| b29039735b | |||
| 4d5303b0ad | |||
| c3f292a320 | |||
| cb414b448e | |||
| 5ad6330868 | |||
| e8ee088f85 | |||
| 167b1d1db9 | |||
| a365b81915 | |||
| 697e8f930a | |||
| 0e0baa8af8 | |||
| a82088c243 | |||
| e4fc05924e | |||
| b3a46212ee | |||
| dec790e4a3 | |||
| a146469d63 | |||
| e5a3bb8903 | |||
| b61b5054dc | |||
| b613f3bbfc | |||
| 800ae1d834 | |||
| d5d3786a97 | |||
| b90eeea1e8 | |||
| aa30013e05 | |||
| eaf06638c3 | |||
| 4834eabb9d | |||
| 8aceb6418a | |||
| da6062a20c | |||
| b57241951b | |||
| 6a1823b242 | |||
| 2ad039f867 | |||
| 634ec6c1e3 | |||
| a73ddb2dad | |||
| 0504667334 | |||
| 6d85eee0cd | |||
| 1f43988ad9 | |||
| 0129cbb162 | |||
| 0121e1b50d | |||
| 63b1c2237a | |||
| c72120eab0 | |||
| 85ced7818f | |||
| 313b7163e8 | |||
| 55eb81f219 | |||
| 0f90ea9455 | |||
| 6d2217bd18 | |||
| 0f51328979 | |||
| aea812f621 | |||
| 4fe573b397 | |||
| d338b95e7e | |||
| 2d9bdb26d4 | |||
| b660a4c07f | |||
| 65aa6e4e4c | |||
| 0432a64357 | |||
| c2eea6c2b6 | |||
| 81bbae977f | |||
| 37bd8f4952 | |||
| 20d6c6fdfb | |||
| ebc45b7f8d | |||
| 77f146210a | |||
| 18cb9c6bec | |||
| dfd4966cb0 | |||
| d7384bf481 | |||
| f7dfc712b5 | |||
| 1cfb93ada9 | |||
| 7437d9fbd6 | |||
| 16c152ec26 | |||
| 92d4008cc2 | |||
| 2770df644b | |||
| 7bebf919e2 | |||
| 4b6e21d6d4 | |||
| 21d70821de | |||
| a4d3f1b61c | |||
| 42e297474c | |||
| a40afd55d2 | |||
| 621254d0ab | |||
| 0ff568843d | |||
| 1bc9bc9244 | |||
| 2fea9e5a6c | |||
| 2756bfe073 | |||
| 165ca9cb0f | |||
| 840435284b | |||
| d65ef5eb87 | |||
| 71007b5f60 | |||
| 43250c444e | |||
| 0ccc6d3729 | |||
| e779cff42a | |||
| 0b3c3758a7 | |||
| ab351cbc8e | |||
| dd4fc8c262 | |||
| a55acb6296 | |||
| 4cae6fed63 | |||
| 28c70ab9d1 | |||
| 9d65a1a2c3 | |||
| fc3e85f93e | |||
| 8252f3ef86 | |||
| 7d78089275 | |||
| 5ae21f28c3 | |||
| 2614860862 | |||
| c2d8934820 | |||
| 2edff18a59 | |||
| fc94c78109 | |||
| 77a99c226d | |||
| 50921f1307 | |||
| 5445abeb9d | |||
| 160ab22f70 | |||
| 0cf3ebfae3 | |||
| 8767403a44 | |||
| 5f1ac75044 | |||
| 0f75d15df6 | |||
| df1f695f9b | |||
| 5fa751cd76 | |||
| 8961a30bf8 |
+2
-1
@@ -45,4 +45,5 @@ yarn-error.log*
|
||||
.output
|
||||
apps/**/public/build
|
||||
.tests-container-id.txt
|
||||
.sentryclirc
|
||||
.sentryclirc
|
||||
.buildt
|
||||
@@ -52,6 +52,9 @@ windows:
|
||||
- cwd: /Users/eric/code/triggerdotdev/trigger.dev
|
||||
commands:
|
||||
- exec: ./scripts/proxy-pizzly.sh <your-pizzly-dev>
|
||||
- cwd: /Users/eric/code/triggerdotdev/trigger.dev
|
||||
commands:
|
||||
- exec: ./scripts/proxy-wss.sh <your-wss-dev>
|
||||
- title: wss and examples
|
||||
layout:
|
||||
split_direction: horizontal
|
||||
|
||||
@@ -9,6 +9,7 @@ To add a changeset, use `pnpm run changeset:add` and follow the instructions [he
|
||||
- `@trigger.dev/sdk`
|
||||
- `@trigger.dev/integration-sdk`
|
||||
- `@trigger.dev/github`
|
||||
- `@trigger.dev/notion`
|
||||
- `@trigger.dev/slack`
|
||||
- `@trigger.dev/shopify`
|
||||
- `@trigger.dev/resend`
|
||||
|
||||
@@ -7,18 +7,22 @@
|
||||
"scripts": {
|
||||
"build": "tsup",
|
||||
"start": "node dist/index.js",
|
||||
"dev": "concurrently \"tsup --watch\" \"nodemon -r dotenv/config -q dist/index.js\"",
|
||||
"dev": "node -r dotenv/config dist/index.js",
|
||||
"test": "vitest",
|
||||
"typecheck": "tsc -b",
|
||||
"lint": "eslint --no-error-on-unmatched-pattern src/**",
|
||||
"lint-fix": "eslint --no-error-on-unmatched-pattern --fix src/**",
|
||||
"generate-integrations": "tsx src/trigger/sdk/generate.ts",
|
||||
"generate-integrations": "NODE_OPTIONS=--max-old-space-size=16384 tsx src/trigger/sdk/generate.ts generate",
|
||||
"generate": "prisma generate",
|
||||
"convert": "tsx src/tools/schemas/typescript-to-json-schema.ts convert",
|
||||
"db:migrate:deploy": "prisma migrate deploy",
|
||||
"db:migrate:dev": "prisma migrate dev"
|
||||
},
|
||||
"dependencies": {
|
||||
"@cfworker/json-schema": "^1.12.5",
|
||||
"@prisma/client": "^4.3.0",
|
||||
"@sentry/node": "^7.38.0",
|
||||
"ajv": "^8.12.0",
|
||||
"express": "^4.18.1",
|
||||
"express-async-errors": "^3.1.1",
|
||||
"json-pointer": "^0.6.2",
|
||||
@@ -27,15 +31,18 @@
|
||||
"loglevel": "^1.8.1",
|
||||
"morgan": "^1.10.0",
|
||||
"node-fetch": "^3.3.0",
|
||||
"node-object-hash": "^2.3.10",
|
||||
"zod": "^3.20.2"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@apidevtools/json-schema-ref-parser": "^10.1.0",
|
||||
"@types/eslint": "^8.4.6",
|
||||
"@types/express": "^4.17.13",
|
||||
"@types/json-pointer": "^1.0.31",
|
||||
"@types/morgan": "^1.9.3",
|
||||
"@types/node": "^18.13.0",
|
||||
"@typescript-eslint/eslint-plugin": "^5.51.0",
|
||||
"commander": "^9.4.1",
|
||||
"concurrently": "^7.6.0",
|
||||
"dotenv": "^16.0.3",
|
||||
"eslint": "^8.34.0",
|
||||
@@ -49,6 +56,7 @@
|
||||
"prisma": "^4.3.0",
|
||||
"rimraf": "^4.1.2",
|
||||
"tiny-invariant": "^1.2.0",
|
||||
"ts-json-schema-generator": "^1.2.0",
|
||||
"ts-morph": "^17.0.1",
|
||||
"tsup": "^6.6.2",
|
||||
"tsx": "^3.12.3",
|
||||
@@ -60,4 +68,4 @@
|
||||
"engines": {
|
||||
"node": ">=16.0.0"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -16,13 +16,12 @@ export function createParametersBody(
|
||||
parameters[p.name] = params[p.name];
|
||||
});
|
||||
|
||||
const bodyProperties = inputSpec.body?.properties;
|
||||
if (bodyProperties) {
|
||||
//everything left should go in the body
|
||||
if (inputSpec.body) {
|
||||
body = {};
|
||||
Object.keys(bodyProperties).forEach((name) => {
|
||||
const value = params?.[name];
|
||||
if (value !== undefined) {
|
||||
body[name] = value;
|
||||
Object.keys(params).forEach((name) => {
|
||||
if (!inputSpec.parameters?.find((p) => p.name === name)) {
|
||||
body[name] = params[name];
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
@@ -12,7 +12,7 @@ type ServiceMetadata = {
|
||||
authentication: IntegrationAuthentication;
|
||||
};
|
||||
|
||||
export async function handleServices(req: Request, res: Response) {
|
||||
export async function handleServices(_req: Request, res: Response) {
|
||||
const servicesMetadata: Record<string, ServiceMetadata> = {};
|
||||
Object.entries(catalog.services).forEach(([key, service]) => {
|
||||
if (service.live === false) return;
|
||||
@@ -30,7 +30,9 @@ export async function handleServices(req: Request, res: Response) {
|
||||
);
|
||||
}
|
||||
|
||||
function omitExtraInfo(service: Service): ServiceMetadata {
|
||||
function omitExtraInfo(
|
||||
service: Service
|
||||
): Omit<Service, "actions" | "retryableStatusCodes"> {
|
||||
const { actions, retryableStatusCodes, ...rest } = service;
|
||||
return rest;
|
||||
}
|
||||
|
||||
@@ -2,7 +2,7 @@ import { CacheService } from "core/cache/types";
|
||||
import { Endpoint } from "core/endpoint/types";
|
||||
import { RequestData, RequestResponse } from "core/request/types";
|
||||
import { getDisplayProperties } from "./getDisplayProperties";
|
||||
import { Action, Metadata } from "./types";
|
||||
import { Action, InputSpec, Metadata, OutputSpec } from "./types";
|
||||
import { makeInputSpec, makeOutputSpec } from "./utilities";
|
||||
|
||||
/** Create an action where you specify the spec and action */
|
||||
@@ -37,23 +37,36 @@ export const makeAdvancedAction = ({
|
||||
};
|
||||
};
|
||||
|
||||
/** Creates an action that calls an endpoint */
|
||||
export const makeSimpleAction = (endpoint: Endpoint) => {
|
||||
/** Creates an action where the spec and data is manipulated */
|
||||
export const makeSimpleAction = (
|
||||
endpoint: Endpoint,
|
||||
processSpec?: (specs: Action["spec"]) => Action["spec"],
|
||||
preRequest?: (data: RequestData) => RequestData
|
||||
) => {
|
||||
let specs = {
|
||||
input: makeInputSpec(endpoint),
|
||||
output: makeOutputSpec(endpoint),
|
||||
};
|
||||
|
||||
if (processSpec) {
|
||||
specs = processSpec(specs);
|
||||
}
|
||||
|
||||
const action = async (
|
||||
data: RequestData,
|
||||
cache?: CacheService,
|
||||
metadata?: Metadata
|
||||
) => {
|
||||
if (preRequest) {
|
||||
data = preRequest(data);
|
||||
}
|
||||
//a simple request doesn't use the cache or metadata
|
||||
return await endpoint.request(data);
|
||||
};
|
||||
|
||||
return makeAdvancedAction({
|
||||
endpoint,
|
||||
spec: {
|
||||
input: makeInputSpec(endpoint),
|
||||
output: makeOutputSpec(endpoint),
|
||||
},
|
||||
spec: specs,
|
||||
action,
|
||||
});
|
||||
};
|
||||
@@ -62,12 +75,14 @@ export const makeSimpleActions = <
|
||||
TEndpoints extends Record<string, Endpoint>,
|
||||
K extends keyof TEndpoints
|
||||
>(
|
||||
endpoints: TEndpoints
|
||||
endpoints: TEndpoints,
|
||||
processSpec?: (specs: Action["spec"]) => Action["spec"],
|
||||
preRequest?: (data: RequestData) => RequestData
|
||||
): Record<K, Action> => {
|
||||
const actions: any = {};
|
||||
|
||||
Object.entries(endpoints).forEach(([name, endpoint]) => {
|
||||
actions[name as K] = makeSimpleAction(endpoint);
|
||||
actions[name as K] = makeSimpleAction(endpoint, processSpec, preRequest);
|
||||
});
|
||||
|
||||
return actions;
|
||||
|
||||
@@ -27,10 +27,7 @@ export interface EndpointSpec {
|
||||
parameters?: EndpointSpecParameter[];
|
||||
security?: Record<string, string[]>;
|
||||
request: EndpointSpecRequest;
|
||||
responses: { default: EndpointSpecResponse[] } & Record<
|
||||
string,
|
||||
EndpointSpecResponse[]
|
||||
>;
|
||||
responses: EndpointSpecResponse[];
|
||||
}
|
||||
|
||||
export interface EndpointSpecParameter {
|
||||
@@ -49,6 +46,16 @@ interface EndpointSpecRequest {
|
||||
}
|
||||
|
||||
export interface EndpointSpecResponse {
|
||||
/** If you return true then this response is the relevant one */
|
||||
matches: ({
|
||||
statusCode,
|
||||
headers,
|
||||
body,
|
||||
}: {
|
||||
statusCode: number;
|
||||
headers: Record<string, string>;
|
||||
body: any;
|
||||
}) => boolean;
|
||||
success: boolean;
|
||||
name: string;
|
||||
description?: string;
|
||||
|
||||
@@ -38,6 +38,6 @@ export function responseFromCaughtError(error: any): RequestResponse {
|
||||
success: false,
|
||||
status: 400,
|
||||
headers: {},
|
||||
body: { error: JSON.stringify(error) },
|
||||
body: { error },
|
||||
};
|
||||
}
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
import { applyCredentials } from "core/authentication/credentials";
|
||||
import { EndpointSpec, EndpointSpecResponse } from "core/endpoint/types";
|
||||
import {
|
||||
getFetch,
|
||||
normalizeHeaders,
|
||||
@@ -7,13 +6,13 @@ import {
|
||||
safeGetJson,
|
||||
} from "core/fetch/fetchUtilities";
|
||||
import { JSONSchemaError } from "core/schemas/types";
|
||||
import { validate } from "core/schemas/validate";
|
||||
import {
|
||||
FetchConfig,
|
||||
RequestData,
|
||||
RequestResponse,
|
||||
RequestSpec,
|
||||
} from "./types";
|
||||
import * as Sentry from "@sentry/node";
|
||||
|
||||
export async function requestEndpoint(
|
||||
{ baseUrl, endpointSpec, authentication }: RequestSpec,
|
||||
@@ -29,14 +28,6 @@ export async function requestEndpoint(
|
||||
};
|
||||
}
|
||||
|
||||
const requestValid = await validate(body, request.body?.schema);
|
||||
if (!requestValid.success) {
|
||||
throw {
|
||||
type: "request_body_invalid",
|
||||
errors: requestValid.errors,
|
||||
};
|
||||
}
|
||||
|
||||
let headers: Record<string, string> = {};
|
||||
|
||||
// validate and add the parameters
|
||||
@@ -59,18 +50,6 @@ export async function requestEndpoint(
|
||||
}
|
||||
|
||||
const element = parameters[name];
|
||||
//validate the parameter against the schema
|
||||
const valid = await validate(element, parameter.schema);
|
||||
if (!valid.success) {
|
||||
throw {
|
||||
type: "parameter_invalid",
|
||||
parameter: {
|
||||
name,
|
||||
value: element,
|
||||
},
|
||||
errors: valid.errors,
|
||||
};
|
||||
}
|
||||
|
||||
//add the parameter
|
||||
switch (location) {
|
||||
@@ -147,63 +126,57 @@ export async function requestEndpoint(
|
||||
const response = await fetch(fetchConfig.url, fetchObject);
|
||||
const json = await safeGetJson(response);
|
||||
|
||||
// validate the response against the specs
|
||||
const responseSpecs = getResponseSpecsForStatusCode(
|
||||
response.status,
|
||||
responses
|
||||
);
|
||||
if (!responseSpecs) {
|
||||
throw {
|
||||
type: "no_response_spec",
|
||||
const normalizedHeaders = normalizeHeaders(response.headers);
|
||||
|
||||
// start with the first response spec and loop through them, if one succeeds then return that
|
||||
const specErrors: Array<{ name: string; errors: JSONSchemaError[] }> = [];
|
||||
for (const spec of responses) {
|
||||
const isMatch = spec.matches({
|
||||
statusCode: response.status,
|
||||
headers: normalizedHeaders,
|
||||
body: json,
|
||||
});
|
||||
|
||||
if (!isMatch) {
|
||||
continue;
|
||||
}
|
||||
|
||||
return {
|
||||
success: spec.success,
|
||||
status: response.status,
|
||||
headers: normalizedHeaders,
|
||||
body: json,
|
||||
};
|
||||
}
|
||||
|
||||
// start with the first spec and loop through them, if one succeeds then return that
|
||||
const specErrors: Array<{ name: string; errors: JSONSchemaError[] }> = [];
|
||||
for (const spec of responseSpecs) {
|
||||
const responseValid = await validate(json, spec.schema);
|
||||
if (responseValid.success) {
|
||||
if (process.env.NODE_ENV === "production") {
|
||||
//if it's a 2xx response, even if it fails validation we'll return it as a success
|
||||
if (response.status >= 200 && response.status < 300) {
|
||||
//we want to report this to Sentry though so we can improve the schemas
|
||||
Sentry.captureException({
|
||||
type: "response_invalid",
|
||||
baseUrl: baseUrl,
|
||||
spec: endpointSpec,
|
||||
status: response.status,
|
||||
body: json,
|
||||
errors: specErrors,
|
||||
});
|
||||
|
||||
return {
|
||||
success: spec.success,
|
||||
success: true,
|
||||
status: response.status,
|
||||
headers: normalizeHeaders(response.headers),
|
||||
body: json,
|
||||
};
|
||||
} else {
|
||||
if (responseValid.errors != null) {
|
||||
specErrors.push({ name: spec.name, errors: responseValid.errors });
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
throw {
|
||||
type: "response_invalid",
|
||||
type: "no_response_spec",
|
||||
status: response.status,
|
||||
body: json,
|
||||
errors: specErrors,
|
||||
};
|
||||
} catch (error: any) {
|
||||
return responseFromCaughtError(error);
|
||||
}
|
||||
}
|
||||
|
||||
/** Get the appropriate endpoint response object based on the status code. It supports wild cards like 20x and 2xx */
|
||||
function getResponseSpecsForStatusCode(
|
||||
statusCode: number,
|
||||
endpointResponseSpecs: EndpointSpec["responses"]
|
||||
): EndpointSpecResponse[] {
|
||||
let specs = endpointResponseSpecs[statusCode.toString()];
|
||||
if (specs) return specs;
|
||||
|
||||
specs =
|
||||
endpointResponseSpecs[
|
||||
`${statusCode.toString().charAt(0)}${statusCode.toString().charAt(1)}x`
|
||||
];
|
||||
if (specs) return specs;
|
||||
|
||||
specs = endpointResponseSpecs[`${statusCode.toString().charAt(0)}xx`];
|
||||
if (specs) return specs;
|
||||
|
||||
return endpointResponseSpecs.default;
|
||||
}
|
||||
|
||||
@@ -0,0 +1,182 @@
|
||||
import { describe, expect, test } from "vitest";
|
||||
import { AutoReffer } from "./autoReffer";
|
||||
import { JSONSchema } from "./types";
|
||||
|
||||
describe("autoReffer", async () => {
|
||||
test("simple", async () => {
|
||||
const schema: JSONSchema = {
|
||||
type: "object",
|
||||
properties: {
|
||||
type: {
|
||||
type: "string",
|
||||
const: "person",
|
||||
},
|
||||
person: {
|
||||
title: "Person",
|
||||
type: "object",
|
||||
properties: {
|
||||
email: {
|
||||
type: "string",
|
||||
},
|
||||
timezone: {
|
||||
type: "string",
|
||||
enum: [
|
||||
"Africa/Abidjan",
|
||||
"Africa/Accra",
|
||||
"Africa/Addis_Ababa",
|
||||
"Africa/Algiers",
|
||||
"Africa/Asmara",
|
||||
"Africa/Asmera",
|
||||
],
|
||||
},
|
||||
props: {
|
||||
anyOf: [
|
||||
{
|
||||
type: "object",
|
||||
properties: {
|
||||
first: {
|
||||
type: "string",
|
||||
},
|
||||
last: {
|
||||
type: "string",
|
||||
},
|
||||
},
|
||||
},
|
||||
],
|
||||
},
|
||||
},
|
||||
additionalProperties: false,
|
||||
},
|
||||
parent: {
|
||||
title: "Person",
|
||||
type: "object",
|
||||
properties: {
|
||||
email: {
|
||||
type: "string",
|
||||
},
|
||||
timezone: {
|
||||
type: "string",
|
||||
enum: [
|
||||
"Africa/Abidjan",
|
||||
"Africa/Accra",
|
||||
"Africa/Addis_Ababa",
|
||||
"Africa/Algiers",
|
||||
"Africa/Asmara",
|
||||
"Africa/Asmera",
|
||||
],
|
||||
},
|
||||
props: {
|
||||
anyOf: [
|
||||
{
|
||||
type: "object",
|
||||
properties: {
|
||||
first: {
|
||||
type: "string",
|
||||
},
|
||||
last: {
|
||||
type: "string",
|
||||
},
|
||||
},
|
||||
},
|
||||
],
|
||||
},
|
||||
},
|
||||
additionalProperties: false,
|
||||
},
|
||||
id: {
|
||||
type: "string",
|
||||
},
|
||||
tz: {
|
||||
type: "string",
|
||||
enum: [
|
||||
"Africa/Abidjan",
|
||||
"Africa/Accra",
|
||||
"Africa/Addis_Ababa",
|
||||
"Africa/Algiers",
|
||||
"Africa/Asmara",
|
||||
"Africa/Asmera",
|
||||
],
|
||||
},
|
||||
},
|
||||
required: ["type", "person", "id"],
|
||||
additionalProperties: false,
|
||||
};
|
||||
|
||||
const autoReffer = new AutoReffer(schema);
|
||||
const optimizedSchema = autoReffer.optimize();
|
||||
|
||||
expect(optimizedSchema).toMatchInlineSnapshot(`
|
||||
{
|
||||
"additionalProperties": false,
|
||||
"definitions": {
|
||||
"Person": {
|
||||
"additionalProperties": false,
|
||||
"properties": {
|
||||
"email": {
|
||||
"type": "string",
|
||||
},
|
||||
"props": {
|
||||
"anyOf": [
|
||||
{
|
||||
"$ref": "#/definitions/Props",
|
||||
},
|
||||
],
|
||||
},
|
||||
"timezone": {
|
||||
"$ref": "#/definitions/Timezone",
|
||||
},
|
||||
},
|
||||
"title": "Person",
|
||||
"type": "object",
|
||||
},
|
||||
"Props": {
|
||||
"properties": {
|
||||
"first": {
|
||||
"type": "string",
|
||||
},
|
||||
"last": {
|
||||
"type": "string",
|
||||
},
|
||||
},
|
||||
"type": "object",
|
||||
},
|
||||
"Timezone": {
|
||||
"enum": [
|
||||
"Africa/Abidjan",
|
||||
"Africa/Accra",
|
||||
"Africa/Addis_Ababa",
|
||||
"Africa/Algiers",
|
||||
"Africa/Asmara",
|
||||
"Africa/Asmera",
|
||||
],
|
||||
"type": "string",
|
||||
},
|
||||
},
|
||||
"properties": {
|
||||
"id": {
|
||||
"type": "string",
|
||||
},
|
||||
"parent": {
|
||||
"$ref": "#/definitions/Person",
|
||||
},
|
||||
"person": {
|
||||
"$ref": "#/definitions/Person",
|
||||
},
|
||||
"type": {
|
||||
"const": "person",
|
||||
"type": "string",
|
||||
},
|
||||
"tz": {
|
||||
"$ref": "#/definitions/Timezone",
|
||||
},
|
||||
},
|
||||
"required": [
|
||||
"type",
|
||||
"person",
|
||||
"id",
|
||||
],
|
||||
"type": "object",
|
||||
}
|
||||
`);
|
||||
});
|
||||
});
|
||||
@@ -0,0 +1,222 @@
|
||||
import { JSONSchema } from "./types";
|
||||
import nodeObjectHash from "node-object-hash";
|
||||
import pointer from "json-pointer";
|
||||
|
||||
type JSONPointer = string[];
|
||||
const hasher = nodeObjectHash({ sort: true });
|
||||
|
||||
type Options = {
|
||||
refIfMoreThan: number;
|
||||
};
|
||||
|
||||
export class AutoReffer {
|
||||
#schemaPointers = new Map<string, JSONPointer[]>();
|
||||
#schema: JSONSchema;
|
||||
#options: Options;
|
||||
|
||||
constructor(schema: JSONSchema, options: Options = { refIfMoreThan: 2 }) {
|
||||
this.#schema = schema;
|
||||
this.#options = options;
|
||||
}
|
||||
|
||||
optimize() {
|
||||
this.#walk(this.#schema, []);
|
||||
const optimizedSchema = this.#addRefs();
|
||||
return optimizedSchema;
|
||||
}
|
||||
|
||||
#walk(schema: JSONSchema, pointer: JSONPointer) {
|
||||
if (schema.type === "object" || (schema.type === "string" && schema.enum)) {
|
||||
const hash = hasher.hash(schema);
|
||||
const existingPath = this.#schemaPointers.get(hash);
|
||||
if (existingPath) {
|
||||
existingPath.push(pointer);
|
||||
} else {
|
||||
this.#schemaPointers.set(hash, [pointer]);
|
||||
}
|
||||
}
|
||||
|
||||
if (schema.properties) {
|
||||
for (const [key, value] of Object.entries(schema.properties)) {
|
||||
if (typeof value === "boolean") continue;
|
||||
this.#walk(value, [...pointer, "properties", key]);
|
||||
}
|
||||
}
|
||||
|
||||
if (schema.items) {
|
||||
if (typeof schema.items === "boolean") return;
|
||||
this.#walk(schema.items, [...pointer, "items"]);
|
||||
}
|
||||
|
||||
if (schema.additionalProperties) {
|
||||
if (typeof schema.additionalProperties === "boolean") return;
|
||||
this.#walk(schema.additionalProperties, [
|
||||
...pointer,
|
||||
"additionalProperties",
|
||||
]);
|
||||
}
|
||||
|
||||
if (schema.allOf) {
|
||||
schema.allOf.forEach((item, index) => {
|
||||
this.#walk(item, [...pointer, "allOf", `${index}`]);
|
||||
});
|
||||
}
|
||||
|
||||
if (schema.anyOf) {
|
||||
schema.anyOf.forEach((item, index) => {
|
||||
this.#walk(item, [...pointer, "anyOf", `${index}`]);
|
||||
});
|
||||
}
|
||||
|
||||
if (schema.oneOf) {
|
||||
schema.oneOf.forEach((item, index) => {
|
||||
this.#walk(item, [...pointer, "oneOf", `${index}`]);
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
#addRefs(): JSONSchema {
|
||||
const newSchema: JSONSchema = JSON.parse(JSON.stringify(this.#schema));
|
||||
//create definitions structure if it doesn't exist
|
||||
if (!newSchema.definitions) {
|
||||
newSchema.definitions = {};
|
||||
}
|
||||
|
||||
//turn the map into an array of [hash, pointers]
|
||||
const schemaPaths = Array.from(this.#schemaPointers.entries());
|
||||
|
||||
//filter out the ones that are not used more than the threshold
|
||||
const filteredSchemaPaths = schemaPaths.filter(
|
||||
([hash, pointers]) => pointers.length >= this.#options.refIfMoreThan
|
||||
);
|
||||
|
||||
//now flatten it to an array of pointers with name
|
||||
const names = new Set<string>();
|
||||
const pointers = filteredSchemaPaths.flatMap(([hash, pointers]) => {
|
||||
//the name must be unique
|
||||
const name = this.#inventName(pointers, newSchema, names);
|
||||
return pointers.map((p) => ({
|
||||
pointer: p,
|
||||
name: name,
|
||||
}));
|
||||
});
|
||||
|
||||
//now we want to sort them by their path, so we start out with the deepest ones in the tree
|
||||
const sortedPointers = pointers.sort((a, b) => {
|
||||
return b.pointer.join("/").localeCompare(a.pointer.join("/"));
|
||||
});
|
||||
|
||||
for (let index = 0; index < sortedPointers.length; index++) {
|
||||
const element = sortedPointers[index];
|
||||
try {
|
||||
const originalObject = pointer.get(newSchema, element.pointer);
|
||||
const ref = `#/definitions/${element.name}`;
|
||||
newSchema.definitions[element.name] = originalObject;
|
||||
|
||||
//set the ref
|
||||
pointer.set(newSchema, element.pointer, { $ref: ref });
|
||||
} catch (e) {
|
||||
//
|
||||
}
|
||||
}
|
||||
|
||||
return newSchema;
|
||||
}
|
||||
|
||||
#inventName(
|
||||
pointers: JSONPointer[],
|
||||
schema: JSONSchema,
|
||||
names: Set<string>
|
||||
): string {
|
||||
const candidates: string[] = [];
|
||||
for (const ptr of pointers) {
|
||||
try {
|
||||
const object = pointer.get(schema, ptr);
|
||||
if (object.title) {
|
||||
candidates.push(object.title);
|
||||
}
|
||||
} catch (e) {
|
||||
//
|
||||
}
|
||||
}
|
||||
|
||||
if (candidates.length > 0) {
|
||||
const mostCommon = mode(candidates);
|
||||
if (mostCommon) {
|
||||
const name = toTitleCase(mostCommon);
|
||||
if (!names.has(name)) {
|
||||
names.add(name);
|
||||
return name;
|
||||
}
|
||||
|
||||
//if the name is already taken, we need to add a number to it
|
||||
let i = 1;
|
||||
while (names.has(`${name}${i}`)) {
|
||||
i++;
|
||||
}
|
||||
names.add(`${name}${i}`);
|
||||
return `${name}${i}`;
|
||||
}
|
||||
}
|
||||
|
||||
//failing finding a title we can look at the path and try create a name from that
|
||||
const namesFromPointer = pointers.map((ptr) =>
|
||||
findAppropriateNameFromPointer(ptr)
|
||||
);
|
||||
|
||||
const mostCommon = mode(namesFromPointer);
|
||||
const name = toTitleCase(mostCommon ?? namesFromPointer[0]);
|
||||
if (!names.has(name)) {
|
||||
names.add(name);
|
||||
return name;
|
||||
}
|
||||
|
||||
//if the name is already taken, we need to add a number to it
|
||||
let i = 1;
|
||||
while (names.has(`${name}${i}`)) {
|
||||
i++;
|
||||
}
|
||||
names.add(`${name}${i}`);
|
||||
return `${name}${i}`;
|
||||
}
|
||||
}
|
||||
|
||||
function mode(arr: string[]) {
|
||||
return arr
|
||||
.sort(
|
||||
(a, b) =>
|
||||
arr.filter((v) => v === a).length - arr.filter((v) => v === b).length
|
||||
)
|
||||
.pop();
|
||||
}
|
||||
|
||||
//remove spaces and convert to TitleCase, deal with single words
|
||||
function toTitleCase(str: string) {
|
||||
return str
|
||||
.split(" ")
|
||||
.map((word) => word.charAt(0).toUpperCase() + word.slice(1))
|
||||
.join("");
|
||||
}
|
||||
|
||||
function nameIsJustNumbers(name: string | undefined) {
|
||||
if (!name) return false;
|
||||
return /^\d+$/.test(name);
|
||||
}
|
||||
|
||||
function findAppropriateNameFromPointer(pointer: JSONPointer): string {
|
||||
//start with the last segment and loop backwards
|
||||
for (let i = pointer.length - 1; i >= 0; i--) {
|
||||
const name = pointer[i];
|
||||
|
||||
if (name === "anyOf" || name === "oneOf" || name === "allOf") {
|
||||
continue;
|
||||
}
|
||||
|
||||
//check if the segment is a number, if so we need to look at the previous segment
|
||||
if (!nameIsJustNumbers(name)) {
|
||||
return name;
|
||||
}
|
||||
}
|
||||
|
||||
return "Item";
|
||||
}
|
||||
@@ -1,10 +1,11 @@
|
||||
import { JSONSchema } from "./types";
|
||||
import { JSONSchema, JSONSchemaInstanceType } from "./types";
|
||||
|
||||
export function makeStringSchema(
|
||||
title: string,
|
||||
description?: string,
|
||||
options?: {
|
||||
defaultValue?: string;
|
||||
const?: string;
|
||||
enum?: string[];
|
||||
}
|
||||
): JSONSchema {
|
||||
@@ -25,6 +26,10 @@ export function makeStringSchema(
|
||||
schema.enum = options.enum;
|
||||
}
|
||||
|
||||
if (options?.const) {
|
||||
schema.const = options.const;
|
||||
}
|
||||
|
||||
return schema;
|
||||
}
|
||||
|
||||
@@ -57,6 +62,7 @@ export function makeBooleanSchema(
|
||||
options?: {
|
||||
defaultValue?: boolean;
|
||||
enum?: boolean;
|
||||
const?: boolean;
|
||||
}
|
||||
): JSONSchema {
|
||||
const schema: JSONSchema = {
|
||||
@@ -76,6 +82,10 @@ export function makeBooleanSchema(
|
||||
schema.enum = [options.enum];
|
||||
}
|
||||
|
||||
if (options?.const) {
|
||||
schema.const = options.const;
|
||||
}
|
||||
|
||||
return schema;
|
||||
}
|
||||
|
||||
@@ -126,6 +136,23 @@ export function makeObjectSchema(
|
||||
};
|
||||
}
|
||||
|
||||
export function makeRecordSchema(
|
||||
title: string,
|
||||
schema: JSONSchema
|
||||
): JSONSchema {
|
||||
return {
|
||||
type: "object",
|
||||
title,
|
||||
additionalProperties: schema,
|
||||
};
|
||||
}
|
||||
|
||||
export function makeNull(): JSONSchema {
|
||||
return {
|
||||
type: "null",
|
||||
};
|
||||
}
|
||||
|
||||
export function makeOneOf(title: string, schemas: JSONSchema[]): JSONSchema {
|
||||
return {
|
||||
title,
|
||||
@@ -139,3 +166,70 @@ export function makeAnyOf(title: string, schemas: JSONSchema[]): JSONSchema {
|
||||
anyOf: schemas,
|
||||
};
|
||||
}
|
||||
|
||||
export function makeNullable(schema: JSONSchema): JSONSchema {
|
||||
//if there's no existing type then we need to create an anyOf with null
|
||||
if (!schema.type) {
|
||||
return {
|
||||
title: schema.title,
|
||||
description: schema.description,
|
||||
anyOf: [
|
||||
{
|
||||
type: "null",
|
||||
},
|
||||
schema,
|
||||
],
|
||||
};
|
||||
}
|
||||
|
||||
//if there is a type then we can add the "null" type to it
|
||||
let combinedTypes: JSONSchemaInstanceType[] = [];
|
||||
switch (typeof schema.type) {
|
||||
case "string":
|
||||
combinedTypes = [schema.type, "null"];
|
||||
break;
|
||||
case "object":
|
||||
combinedTypes = [...schema.type, "null"];
|
||||
break;
|
||||
default:
|
||||
throw new Error(`Invalid schema type: ${typeof schema.type}`);
|
||||
}
|
||||
|
||||
return {
|
||||
...schema,
|
||||
type: combinedTypes,
|
||||
};
|
||||
}
|
||||
|
||||
export function makeAllPropertiesOptional(schema: JSONSchema): JSONSchema {
|
||||
if (schema.type !== "object") {
|
||||
throw new Error("Schema must be an object");
|
||||
}
|
||||
|
||||
if (!schema.properties) {
|
||||
throw new Error("Schema must have properties");
|
||||
}
|
||||
|
||||
return {
|
||||
...schema,
|
||||
required: [],
|
||||
};
|
||||
}
|
||||
|
||||
export function makePropertiesOptional(
|
||||
schema: JSONSchema,
|
||||
properties: string[]
|
||||
): JSONSchema {
|
||||
if (schema.type !== "object") {
|
||||
throw new Error("Schema must be an object");
|
||||
}
|
||||
|
||||
if (!schema.properties) {
|
||||
throw new Error("Schema must have properties");
|
||||
}
|
||||
|
||||
return {
|
||||
...schema,
|
||||
required: schema.required?.filter((p) => !properties.includes(p)),
|
||||
};
|
||||
}
|
||||
|
||||
@@ -1,4 +1,6 @@
|
||||
import { Schema, OutputUnit } from "@cfworker/json-schema";
|
||||
import { Schema, InstanceType } from "@cfworker/json-schema";
|
||||
import { ErrorObject } from "ajv";
|
||||
|
||||
export type JSONSchema = Schema;
|
||||
export type JSONSchemaError = OutputUnit;
|
||||
export type JSONSchemaInstanceType = InstanceType;
|
||||
export type JSONSchemaError = ErrorObject;
|
||||
|
||||
@@ -1,6 +1,32 @@
|
||||
import { JSONSchema } from "./types";
|
||||
import { JSONSchema, JSONSchemaError } from "./types";
|
||||
import nodeObjectHash from "node-object-hash";
|
||||
import Ajv from "ajv";
|
||||
import { performance, PerformanceObserver } from "perf_hooks";
|
||||
|
||||
export async function validate(data: any, schema?: JSONSchema) {
|
||||
//setup performance tracking
|
||||
const perfObserver = new PerformanceObserver((items) => {
|
||||
return;
|
||||
});
|
||||
perfObserver.observe({ entryTypes: ["measure"], buffered: true });
|
||||
|
||||
const ajv = new Ajv({
|
||||
strict: false,
|
||||
logger: false,
|
||||
});
|
||||
|
||||
type SuccessResult = {
|
||||
success: true;
|
||||
};
|
||||
|
||||
type FailureResult = {
|
||||
success: false;
|
||||
errors: JSONSchemaError[];
|
||||
};
|
||||
|
||||
export async function validate(
|
||||
data: any,
|
||||
schema?: JSONSchema
|
||||
): Promise<SuccessResult | FailureResult> {
|
||||
try {
|
||||
if (schema === undefined) {
|
||||
return {
|
||||
@@ -14,21 +40,44 @@ export async function validate(data: any, schema?: JSONSchema) {
|
||||
errors: [
|
||||
{
|
||||
keyword: "undefined",
|
||||
keywordLocation: "undefined",
|
||||
instanceLocation: "undefined",
|
||||
error: "data is undefined",
|
||||
instancePath: "undefined",
|
||||
schemaPath: "undefined",
|
||||
params: {},
|
||||
},
|
||||
],
|
||||
};
|
||||
}
|
||||
|
||||
const Validator = await getValidator();
|
||||
const validator = new Validator(schema);
|
||||
const result = validator.validate(data);
|
||||
if (!result.valid) {
|
||||
performance.mark("get-validator-start");
|
||||
const validator = getValidator(schema);
|
||||
performance.mark("get-validator-end");
|
||||
|
||||
performance.mark("validate-start");
|
||||
const result = validator(data);
|
||||
performance.mark("validate-end");
|
||||
|
||||
const getValidatorPerformance = performance.measure(
|
||||
"get-validator",
|
||||
"get-validator-start",
|
||||
"get-validator-end"
|
||||
);
|
||||
const validatePerformance = performance.measure(
|
||||
"validate",
|
||||
"validate-start",
|
||||
"validate-end"
|
||||
);
|
||||
|
||||
if (process.env.SHOW_PERFORMANCE_TESTS === "true") {
|
||||
console.log("validate benchmarks:", {
|
||||
getValidator: getValidatorPerformance.duration,
|
||||
validate: validatePerformance.duration,
|
||||
});
|
||||
}
|
||||
|
||||
if (!result) {
|
||||
return {
|
||||
success: false as const,
|
||||
errors: result.errors,
|
||||
errors: validator.errors ?? [],
|
||||
};
|
||||
}
|
||||
|
||||
@@ -42,16 +91,32 @@ export async function validate(data: any, schema?: JSONSchema) {
|
||||
errors: [
|
||||
{
|
||||
keyword: "undefined",
|
||||
keywordLocation: "undefined",
|
||||
instanceLocation: "undefined",
|
||||
error: e.toString(),
|
||||
instancePath: "undefined",
|
||||
schemaPath: "undefined",
|
||||
params: {},
|
||||
message: e.toString(),
|
||||
},
|
||||
],
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
async function getValidator() {
|
||||
const tool = await import("@cfworker/json-schema");
|
||||
return tool.Validator;
|
||||
//we are going to has the schemas and use that as the key to find the cached validator
|
||||
const hasher = nodeObjectHash({ sort: false });
|
||||
|
||||
function getValidator(schema: JSONSchema) {
|
||||
const hash = hasher.hash(schema);
|
||||
|
||||
// get the validator from the cache, if it doesn't exist, add it to the cache
|
||||
let validator = ajv.getSchema(hash);
|
||||
if (validator === undefined) {
|
||||
ajv.addSchema(schema, hash);
|
||||
validator = ajv.getSchema(hash);
|
||||
}
|
||||
|
||||
if (validator === undefined) {
|
||||
throw new Error("Could not get validator");
|
||||
}
|
||||
|
||||
return validator;
|
||||
}
|
||||
|
||||
@@ -50,18 +50,6 @@ export async function validateInputs(
|
||||
};
|
||||
}
|
||||
|
||||
//validate the request body against the schema
|
||||
const requestValid = await validate(body, inputSpec.body);
|
||||
if (!requestValid.success) {
|
||||
return {
|
||||
success: false,
|
||||
error: {
|
||||
type: "request_body_invalid",
|
||||
errors: requestValid.errors,
|
||||
},
|
||||
};
|
||||
}
|
||||
|
||||
//validate the parameters
|
||||
if (inputSpec.parameters != null) {
|
||||
for (const parameter of inputSpec.parameters) {
|
||||
|
||||
@@ -0,0 +1,120 @@
|
||||
[
|
||||
{
|
||||
"scope": "https://api.notion.com:443",
|
||||
"method": "PATCH",
|
||||
"path": "/v1/blocks/b4609033-b45a-4fc6-8d15-f06920495ab1/children",
|
||||
"body": {
|
||||
"children": [
|
||||
{
|
||||
"heading_1": {
|
||||
"rich_text": [
|
||||
{
|
||||
"type": "text",
|
||||
"text": {
|
||||
"content": "This new title is appended using appendBlockChildren()"
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
]
|
||||
},
|
||||
"status": 200,
|
||||
"response": {
|
||||
"object": "list",
|
||||
"results": [
|
||||
{
|
||||
"object": "block",
|
||||
"id": "4c946f30-ebc2-4eed-bfbc-094226ae9659",
|
||||
"parent": {
|
||||
"type": "page_id",
|
||||
"page_id": "b4609033-b45a-4fc6-8d15-f06920495ab1"
|
||||
},
|
||||
"created_time": "2023-02-27T11:22:00.000Z",
|
||||
"last_edited_time": "2023-02-27T11:22:00.000Z",
|
||||
"created_by": {
|
||||
"object": "user",
|
||||
"id": "bcd4bb6e-7cb4-4e04-8609-10744a579644"
|
||||
},
|
||||
"last_edited_by": {
|
||||
"object": "user",
|
||||
"id": "bcd4bb6e-7cb4-4e04-8609-10744a579644"
|
||||
},
|
||||
"has_children": false,
|
||||
"archived": false,
|
||||
"type": "heading_1",
|
||||
"heading_1": {
|
||||
"rich_text": [
|
||||
{
|
||||
"type": "text",
|
||||
"text": {
|
||||
"content": "This new title is appended using appendBlockChildren()",
|
||||
"link": null
|
||||
},
|
||||
"annotations": {
|
||||
"bold": false,
|
||||
"italic": false,
|
||||
"strikethrough": false,
|
||||
"underline": false,
|
||||
"code": false,
|
||||
"color": "default"
|
||||
},
|
||||
"plain_text": "This new title is appended using appendBlockChildren()",
|
||||
"href": null
|
||||
}
|
||||
],
|
||||
"is_toggleable": false,
|
||||
"color": "default"
|
||||
}
|
||||
}
|
||||
],
|
||||
"next_cursor": null,
|
||||
"has_more": false,
|
||||
"type": "block",
|
||||
"block": {}
|
||||
},
|
||||
"rawHeaders": [
|
||||
"Date",
|
||||
"Mon, 27 Feb 2023 11:22:57 GMT",
|
||||
"Content-Type",
|
||||
"application/json; charset=utf-8",
|
||||
"Transfer-Encoding",
|
||||
"chunked",
|
||||
"Connection",
|
||||
"close",
|
||||
"Set-Cookie",
|
||||
"notion_browser_id=53f6ccf8-1698-4ece-ab61-a73987903c80; Domain=www.notion.so; Path=/; Expires=Tue, 27 Feb 2024 11:22:56 GMT; Secure",
|
||||
"Content-Security-Policy",
|
||||
"script-src 'self' 'unsafe-inline' 'unsafe-eval' https://gist.github.com https://apis.google.com https://www.google.com https://www.gstatic.com https://cdn.amplitude.com https://api.amplitude.com http://dev-embed.notion.co http://embed.notion.co https://widget.intercom.io https://js.intercomcdn.com https://static.zdassets.com https://api.smooch.io\t https://logs-01.loggly.com https://http-inputs-notion.splunkcloud.com https://cdn.segment.com https://analytics.pgncs.notion.so https://o324374.ingest.sentry.io https://checkout.stripe.com https://js.stripe.com https://embed.typeform.com https://admin.typeform.com https://public.profitwell.com https://static.profitwell.com js.sentry-cdn.com https://js.chilipiper.com https://platform.twitter.com https://cdn.syndication.twimg.com https://accounts.google.com https://www.googletagmanager.com https://www.googleadservices.com https://googleads.g.doubleclick.net https://api-v2.mutinyhq.io https://client-registry.mutinycdn.com https://client.mutinycdn.com https://user-data.mutinycdn.com https://cdn.metadata.io https://platformapi.metadata.io https://d2hrivdxn8ekm8.cloudfront.net https://d1lu3pmaz2ilpx.cloudfront.net https://dvqigh9b7wa32.cloudfront.net https://d330aiyvva2oww.cloudfront.net https://cdn.transcend.io https://cdn01.boxcdn.net https://cdn.sprig.com assets.customer.io code.gist.build;connect-src 'self' data: blob: https://msgstore.www.notion.so wss://msgstore.www.notion.so ws://localhost:* ws://127.0.0.1:* https://notion-emojis.s3-us-west-2.amazonaws.com https://s3-us-west-2.amazonaws.com https://s3.us-west-2.amazonaws.com https://notion-production-snapshots-2.s3.us-west-2.amazonaws.com https://cdn.amplitude.com https://api.amplitude.com https://www.notion.so https://api.embed.ly http://dev-embed.notion.co http://embed.notion.co https://js.intercomcdn.com https://api-iam.intercom.io https://uploads.intercomcdn.com wss://nexus-websocket-a.intercom.io https://ekr.zdassets.com https://ekr.zendesk.com\t https://makenotion.zendesk.com\t https://api.smooch.io\t wss://api.smooch.io\t https://logs-01.loggly.com https://http-inputs-notion.splunkcloud.com https://cdn.segment.com https://api.segment.io https://analytics.pgncs.notion.so https://api.pgncs.notion.so https://o324374.ingest.sentry.io https://checkout.stripe.com https://js.stripe.com https://cdn.contentful.com https://preview.contentful.com https://images.ctfassets.net https://www2.profitwell.com https://tracking.chilipiper.com https://api.chilipiper.com https://api.unsplash.com https://boards-api.greenhouse.io https://accounts.google.com https://oauth2.googleapis.com https://www.googletagmanager.com https://analytics.google.com https://www.googleadservices.com https://googleads.g.doubleclick.net https://region1.google-analytics.com https://region1.analytics.google.com https://www.google-analytics.com https://api-v2.mutinyhq.io https://client-registry.mutinycdn.com https://client.mutinycdn.com https://user-data.mutinycdn.com https://cdn.metadata.io https://platformapi.metadata.io https://d2hrivdxn8ekm8.cloudfront.net https://d1lu3pmaz2ilpx.cloudfront.net https://dvqigh9b7wa32.cloudfront.net https://d330aiyvva2oww.cloudfront.net https://cdn.transcend.io https://telemetry.transcend.io https://api.statuspage.io https://pgncd.notion.so https://api.statsig.com https://statsigapi.net https://exp.notion.so https://file.notion.so notion://file.notion.so https://api.box.com https://*.mux.com https://api.sprig.com https://storage.googleapis.com https://cdn.sprig.com https://cdn.userleap.com track.customer.io *.api.gist.build *.cloud.gist.build;font-src 'self' data: https://cdnjs.cloudflare.com https://js.intercomcdn.com https://cdn01.boxcdn.net;img-src 'self' data: blob: https: https://platform.twitter.com https://syndication.twitter.com https://pbs.twimg.com https://ton.twimg.com https://region1.google-analytics.com https://region1.analytics.google.com https://file.notion.so notion://file.notion.so https://*.mux.com track.customer.io;style-src 'self' 'unsafe-inline' https://cdnjs.cloudflare.com https://github.githubassets.com https://js.chilipiper.com https://platform.twitter.com https://ton.twimg.com https://accounts.google.com https://cdn.transcend.io https://cdn01.boxcdn.net code.gist.build;media-src blob: https: http: https://file.notion.so notion://file.notion.so https://*.mux.com;worker-src blob:;frame-src https: http: https://accounts.google.com renderer.gist.build code.gist.build",
|
||||
"X-DNS-Prefetch-Control",
|
||||
"off",
|
||||
"X-Frame-Options",
|
||||
"SAMEORIGIN",
|
||||
"Strict-Transport-Security",
|
||||
"max-age=5184000; includeSubDomains",
|
||||
"X-Download-Options",
|
||||
"noopen",
|
||||
"X-Content-Type-Options",
|
||||
"nosniff",
|
||||
"X-Permitted-Cross-Domain-Policies",
|
||||
"none",
|
||||
"Referrer-Policy",
|
||||
"strict-origin-when-cross-origin",
|
||||
"X-XSS-Protection",
|
||||
"0",
|
||||
"ETag",
|
||||
"W/\"383-2rLMttu6Pq17KGfS6h8OoM7fsF0\"",
|
||||
"Vary",
|
||||
"Accept-Encoding",
|
||||
"CF-Cache-Status",
|
||||
"DYNAMIC",
|
||||
"Set-Cookie",
|
||||
"notion_check_cookie_consent=true; Domain=www.notion.so; Path=/; Expires=Tue, 28 Feb 2023 11:22:56 GMT; Secure",
|
||||
"Set-Cookie",
|
||||
"__cf_bm=VXShyz_MBH77_gf3gFuj9pOYT7KvZ0tAI1g76xSEsck-1677496977-0-AUaWjGjnwWhILvSEGODB1JprJBjZrmavjD0fIoD8o74Vdpn24iAC1GFwI+oEzZMuV8/3uv4uYpo9ZB8PP0HV/c4=; path=/; expires=Mon, 27-Feb-23 11:52:57 GMT; domain=.notion.com; HttpOnly; Secure; SameSite=None",
|
||||
"Server",
|
||||
"cloudflare"
|
||||
],
|
||||
"responseIsBinary": false
|
||||
}
|
||||
]
|
||||
@@ -0,0 +1,98 @@
|
||||
[
|
||||
{
|
||||
"scope": "https://api.notion.com:443",
|
||||
"method": "POST",
|
||||
"path": "/v1/comments",
|
||||
"body": {
|
||||
"parent": {
|
||||
"type": "page_id",
|
||||
"page_id": "b4609033-b45a-4fc6-8d15-f06920495ab1"
|
||||
},
|
||||
"rich_text": [
|
||||
{
|
||||
"text": {
|
||||
"content": "Hello world"
|
||||
}
|
||||
}
|
||||
]
|
||||
},
|
||||
"status": 200,
|
||||
"response": {
|
||||
"object": "comment",
|
||||
"id": "6ff7c4ea-2666-4fe7-a256-56b43a73ea10",
|
||||
"parent": {
|
||||
"type": "page_id",
|
||||
"page_id": "b4609033-b45a-4fc6-8d15-f06920495ab1"
|
||||
},
|
||||
"discussion_id": "81530ca2-4afa-44c0-b298-7fab0a72b563",
|
||||
"created_time": "2023-02-27T13:00:00.000Z",
|
||||
"last_edited_time": "2023-02-27T13:00:00.000Z",
|
||||
"created_by": {
|
||||
"object": "user",
|
||||
"id": "bcd4bb6e-7cb4-4e04-8609-10744a579644"
|
||||
},
|
||||
"rich_text": [
|
||||
{
|
||||
"type": "text",
|
||||
"text": {
|
||||
"content": "Hello world",
|
||||
"link": null
|
||||
},
|
||||
"annotations": {
|
||||
"bold": false,
|
||||
"italic": false,
|
||||
"strikethrough": false,
|
||||
"underline": false,
|
||||
"code": false,
|
||||
"color": "default"
|
||||
},
|
||||
"plain_text": "Hello world",
|
||||
"href": null
|
||||
}
|
||||
]
|
||||
},
|
||||
"rawHeaders": [
|
||||
"Date",
|
||||
"Mon, 27 Feb 2023 13:00:37 GMT",
|
||||
"Content-Type",
|
||||
"application/json; charset=utf-8",
|
||||
"Transfer-Encoding",
|
||||
"chunked",
|
||||
"Connection",
|
||||
"close",
|
||||
"Set-Cookie",
|
||||
"notion_browser_id=7bc1c0a7-d91d-4689-91b6-c883d992ffec; Domain=www.notion.so; Path=/; Expires=Tue, 27 Feb 2024 13:00:37 GMT; Secure",
|
||||
"Content-Security-Policy",
|
||||
"script-src 'self' 'unsafe-inline' 'unsafe-eval' https://gist.github.com https://apis.google.com https://www.google.com https://www.gstatic.com https://cdn.amplitude.com https://api.amplitude.com http://dev-embed.notion.co http://embed.notion.co https://widget.intercom.io https://js.intercomcdn.com https://static.zdassets.com https://api.smooch.io\t https://logs-01.loggly.com https://http-inputs-notion.splunkcloud.com https://cdn.segment.com https://analytics.pgncs.notion.so https://o324374.ingest.sentry.io https://checkout.stripe.com https://js.stripe.com https://embed.typeform.com https://admin.typeform.com https://public.profitwell.com https://static.profitwell.com js.sentry-cdn.com https://js.chilipiper.com https://platform.twitter.com https://cdn.syndication.twimg.com https://accounts.google.com https://www.googletagmanager.com https://www.googleadservices.com https://googleads.g.doubleclick.net https://api-v2.mutinyhq.io https://client-registry.mutinycdn.com https://client.mutinycdn.com https://user-data.mutinycdn.com https://cdn.metadata.io https://platformapi.metadata.io https://d2hrivdxn8ekm8.cloudfront.net https://d1lu3pmaz2ilpx.cloudfront.net https://dvqigh9b7wa32.cloudfront.net https://d330aiyvva2oww.cloudfront.net https://cdn.transcend.io https://cdn01.boxcdn.net https://cdn.sprig.com assets.customer.io code.gist.build;connect-src 'self' data: blob: https://msgstore.www.notion.so wss://msgstore.www.notion.so ws://localhost:* ws://127.0.0.1:* https://notion-emojis.s3-us-west-2.amazonaws.com https://s3-us-west-2.amazonaws.com https://s3.us-west-2.amazonaws.com https://notion-production-snapshots-2.s3.us-west-2.amazonaws.com https://cdn.amplitude.com https://api.amplitude.com https://www.notion.so https://api.embed.ly http://dev-embed.notion.co http://embed.notion.co https://js.intercomcdn.com https://api-iam.intercom.io https://uploads.intercomcdn.com wss://nexus-websocket-a.intercom.io https://ekr.zdassets.com https://ekr.zendesk.com\t https://makenotion.zendesk.com\t https://api.smooch.io\t wss://api.smooch.io\t https://logs-01.loggly.com https://http-inputs-notion.splunkcloud.com https://cdn.segment.com https://api.segment.io https://analytics.pgncs.notion.so https://api.pgncs.notion.so https://o324374.ingest.sentry.io https://checkout.stripe.com https://js.stripe.com https://cdn.contentful.com https://preview.contentful.com https://images.ctfassets.net https://www2.profitwell.com https://tracking.chilipiper.com https://api.chilipiper.com https://api.unsplash.com https://boards-api.greenhouse.io https://accounts.google.com https://oauth2.googleapis.com https://www.googletagmanager.com https://analytics.google.com https://www.googleadservices.com https://googleads.g.doubleclick.net https://region1.google-analytics.com https://region1.analytics.google.com https://www.google-analytics.com https://api-v2.mutinyhq.io https://client-registry.mutinycdn.com https://client.mutinycdn.com https://user-data.mutinycdn.com https://cdn.metadata.io https://platformapi.metadata.io https://d2hrivdxn8ekm8.cloudfront.net https://d1lu3pmaz2ilpx.cloudfront.net https://dvqigh9b7wa32.cloudfront.net https://d330aiyvva2oww.cloudfront.net https://cdn.transcend.io https://telemetry.transcend.io https://api.statuspage.io https://pgncd.notion.so https://api.statsig.com https://statsigapi.net https://exp.notion.so https://file.notion.so notion://file.notion.so https://api.box.com https://*.mux.com https://api.sprig.com https://storage.googleapis.com https://cdn.sprig.com https://cdn.userleap.com track.customer.io *.api.gist.build *.cloud.gist.build;font-src 'self' data: https://cdnjs.cloudflare.com https://js.intercomcdn.com https://cdn01.boxcdn.net;img-src 'self' data: blob: https: https://platform.twitter.com https://syndication.twitter.com https://pbs.twimg.com https://ton.twimg.com https://region1.google-analytics.com https://region1.analytics.google.com https://file.notion.so notion://file.notion.so https://*.mux.com track.customer.io;style-src 'self' 'unsafe-inline' https://cdnjs.cloudflare.com https://github.githubassets.com https://js.chilipiper.com https://platform.twitter.com https://ton.twimg.com https://accounts.google.com https://cdn.transcend.io https://cdn01.boxcdn.net code.gist.build;media-src blob: https: http: https://file.notion.so notion://file.notion.so https://*.mux.com;worker-src blob:;frame-src https: http: https://accounts.google.com renderer.gist.build code.gist.build",
|
||||
"X-DNS-Prefetch-Control",
|
||||
"off",
|
||||
"X-Frame-Options",
|
||||
"SAMEORIGIN",
|
||||
"Strict-Transport-Security",
|
||||
"max-age=5184000; includeSubDomains",
|
||||
"X-Download-Options",
|
||||
"noopen",
|
||||
"X-Content-Type-Options",
|
||||
"nosniff",
|
||||
"X-Permitted-Cross-Domain-Policies",
|
||||
"none",
|
||||
"Referrer-Policy",
|
||||
"strict-origin-when-cross-origin",
|
||||
"X-XSS-Protection",
|
||||
"0",
|
||||
"ETag",
|
||||
"W/\"24c-39U+DEocpupSzxBZH1jvsL+yyfE\"",
|
||||
"Vary",
|
||||
"Accept-Encoding",
|
||||
"CF-Cache-Status",
|
||||
"DYNAMIC",
|
||||
"Set-Cookie",
|
||||
"notion_check_cookie_consent=true; Domain=www.notion.so; Path=/; Expires=Tue, 28 Feb 2023 13:00:37 GMT; Secure",
|
||||
"Set-Cookie",
|
||||
"__cf_bm=JdgeEvg_PUn_06.lvhPATrAM_WVGfxBXIcOghAm6Yr0-1677502837-0-AbYTmwFA+LHk4LeVThTqVragQppCTfC0TAHONeLrHzQP4RvMSSL92kGXM1mtAufkMHDcaHDftwzDCzLiKkGNOtg=; path=/; expires=Mon, 27-Feb-23 13:30:37 GMT; domain=.notion.com; HttpOnly; Secure; SameSite=None",
|
||||
"Server",
|
||||
"cloudflare"
|
||||
],
|
||||
"responseIsBinary": false
|
||||
}
|
||||
]
|
||||
@@ -0,0 +1,165 @@
|
||||
[
|
||||
{
|
||||
"scope": "https://api.notion.com:443",
|
||||
"method": "POST",
|
||||
"path": "/v1/databases",
|
||||
"body": {
|
||||
"parent": {
|
||||
"type": "page_id",
|
||||
"page_id": "b4609033-b45a-4fc6-8d15-f06920495ab1"
|
||||
},
|
||||
"icon": {
|
||||
"type": "emoji",
|
||||
"emoji": "📝"
|
||||
},
|
||||
"title": [
|
||||
{
|
||||
"type": "text",
|
||||
"text": {
|
||||
"content": "Trigger.dev created db",
|
||||
"link": null
|
||||
}
|
||||
}
|
||||
],
|
||||
"properties": {
|
||||
"Name": {
|
||||
"title": {}
|
||||
},
|
||||
"Description": {
|
||||
"rich_text": {}
|
||||
},
|
||||
"In stock": {
|
||||
"checkbox": {}
|
||||
},
|
||||
"+1": {
|
||||
"people": {}
|
||||
},
|
||||
"Photo": {
|
||||
"files": {}
|
||||
}
|
||||
}
|
||||
},
|
||||
"status": 200,
|
||||
"response": {
|
||||
"object": "database",
|
||||
"id": "8db50793-ac53-496b-bbff-a74be0fb78b4",
|
||||
"cover": null,
|
||||
"icon": {
|
||||
"type": "emoji",
|
||||
"emoji": "📝"
|
||||
},
|
||||
"created_time": "2023-02-27T12:03:00.000Z",
|
||||
"created_by": {
|
||||
"object": "user",
|
||||
"id": "bcd4bb6e-7cb4-4e04-8609-10744a579644"
|
||||
},
|
||||
"last_edited_by": {
|
||||
"object": "user",
|
||||
"id": "bcd4bb6e-7cb4-4e04-8609-10744a579644"
|
||||
},
|
||||
"last_edited_time": "2023-02-27T12:03:00.000Z",
|
||||
"title": [
|
||||
{
|
||||
"type": "text",
|
||||
"text": {
|
||||
"content": "Trigger.dev created db",
|
||||
"link": null
|
||||
},
|
||||
"annotations": {
|
||||
"bold": false,
|
||||
"italic": false,
|
||||
"strikethrough": false,
|
||||
"underline": false,
|
||||
"code": false,
|
||||
"color": "default"
|
||||
},
|
||||
"plain_text": "Trigger.dev created db",
|
||||
"href": null
|
||||
}
|
||||
],
|
||||
"description": [],
|
||||
"is_inline": false,
|
||||
"properties": {
|
||||
"Photo": {
|
||||
"id": "JvIM",
|
||||
"name": "Photo",
|
||||
"type": "files",
|
||||
"files": {}
|
||||
},
|
||||
"Description": {
|
||||
"id": "al%3E%3F",
|
||||
"name": "Description",
|
||||
"type": "rich_text",
|
||||
"rich_text": {}
|
||||
},
|
||||
"+1": {
|
||||
"id": "b%7DNi",
|
||||
"name": "+1",
|
||||
"type": "people",
|
||||
"people": {}
|
||||
},
|
||||
"In stock": {
|
||||
"id": "q%60gF",
|
||||
"name": "In stock",
|
||||
"type": "checkbox",
|
||||
"checkbox": {}
|
||||
},
|
||||
"Name": {
|
||||
"id": "title",
|
||||
"name": "Name",
|
||||
"type": "title",
|
||||
"title": {}
|
||||
}
|
||||
},
|
||||
"parent": {
|
||||
"type": "page_id",
|
||||
"page_id": "b4609033-b45a-4fc6-8d15-f06920495ab1"
|
||||
},
|
||||
"url": "https://www.notion.so/8db50793ac53496bbbffa74be0fb78b4",
|
||||
"archived": false
|
||||
},
|
||||
"rawHeaders": [
|
||||
"Date",
|
||||
"Mon, 27 Feb 2023 12:03:23 GMT",
|
||||
"Content-Type",
|
||||
"application/json; charset=utf-8",
|
||||
"Transfer-Encoding",
|
||||
"chunked",
|
||||
"Connection",
|
||||
"close",
|
||||
"Set-Cookie",
|
||||
"notion_browser_id=45d29e4b-e829-4c24-b6a4-6220d6103576; Domain=www.notion.so; Path=/; Expires=Tue, 27 Feb 2024 12:03:22 GMT; Secure",
|
||||
"Content-Security-Policy",
|
||||
"script-src 'self' 'unsafe-inline' 'unsafe-eval' https://gist.github.com https://apis.google.com https://www.google.com https://www.gstatic.com https://cdn.amplitude.com https://api.amplitude.com http://dev-embed.notion.co http://embed.notion.co https://widget.intercom.io https://js.intercomcdn.com https://static.zdassets.com https://api.smooch.io\t https://logs-01.loggly.com https://http-inputs-notion.splunkcloud.com https://cdn.segment.com https://analytics.pgncs.notion.so https://o324374.ingest.sentry.io https://checkout.stripe.com https://js.stripe.com https://embed.typeform.com https://admin.typeform.com https://public.profitwell.com https://static.profitwell.com js.sentry-cdn.com https://js.chilipiper.com https://platform.twitter.com https://cdn.syndication.twimg.com https://accounts.google.com https://www.googletagmanager.com https://www.googleadservices.com https://googleads.g.doubleclick.net https://api-v2.mutinyhq.io https://client-registry.mutinycdn.com https://client.mutinycdn.com https://user-data.mutinycdn.com https://cdn.metadata.io https://platformapi.metadata.io https://d2hrivdxn8ekm8.cloudfront.net https://d1lu3pmaz2ilpx.cloudfront.net https://dvqigh9b7wa32.cloudfront.net https://d330aiyvva2oww.cloudfront.net https://cdn.transcend.io https://cdn01.boxcdn.net https://cdn.sprig.com assets.customer.io code.gist.build;connect-src 'self' data: blob: https://msgstore.www.notion.so wss://msgstore.www.notion.so ws://localhost:* ws://127.0.0.1:* https://notion-emojis.s3-us-west-2.amazonaws.com https://s3-us-west-2.amazonaws.com https://s3.us-west-2.amazonaws.com https://notion-production-snapshots-2.s3.us-west-2.amazonaws.com https://cdn.amplitude.com https://api.amplitude.com https://www.notion.so https://api.embed.ly http://dev-embed.notion.co http://embed.notion.co https://js.intercomcdn.com https://api-iam.intercom.io https://uploads.intercomcdn.com wss://nexus-websocket-a.intercom.io https://ekr.zdassets.com https://ekr.zendesk.com\t https://makenotion.zendesk.com\t https://api.smooch.io\t wss://api.smooch.io\t https://logs-01.loggly.com https://http-inputs-notion.splunkcloud.com https://cdn.segment.com https://api.segment.io https://analytics.pgncs.notion.so https://api.pgncs.notion.so https://o324374.ingest.sentry.io https://checkout.stripe.com https://js.stripe.com https://cdn.contentful.com https://preview.contentful.com https://images.ctfassets.net https://www2.profitwell.com https://tracking.chilipiper.com https://api.chilipiper.com https://api.unsplash.com https://boards-api.greenhouse.io https://accounts.google.com https://oauth2.googleapis.com https://www.googletagmanager.com https://analytics.google.com https://www.googleadservices.com https://googleads.g.doubleclick.net https://region1.google-analytics.com https://region1.analytics.google.com https://www.google-analytics.com https://api-v2.mutinyhq.io https://client-registry.mutinycdn.com https://client.mutinycdn.com https://user-data.mutinycdn.com https://cdn.metadata.io https://platformapi.metadata.io https://d2hrivdxn8ekm8.cloudfront.net https://d1lu3pmaz2ilpx.cloudfront.net https://dvqigh9b7wa32.cloudfront.net https://d330aiyvva2oww.cloudfront.net https://cdn.transcend.io https://telemetry.transcend.io https://api.statuspage.io https://pgncd.notion.so https://api.statsig.com https://statsigapi.net https://exp.notion.so https://file.notion.so notion://file.notion.so https://api.box.com https://*.mux.com https://api.sprig.com https://storage.googleapis.com https://cdn.sprig.com https://cdn.userleap.com track.customer.io *.api.gist.build *.cloud.gist.build;font-src 'self' data: https://cdnjs.cloudflare.com https://js.intercomcdn.com https://cdn01.boxcdn.net;img-src 'self' data: blob: https: https://platform.twitter.com https://syndication.twitter.com https://pbs.twimg.com https://ton.twimg.com https://region1.google-analytics.com https://region1.analytics.google.com https://file.notion.so notion://file.notion.so https://*.mux.com track.customer.io;style-src 'self' 'unsafe-inline' https://cdnjs.cloudflare.com https://github.githubassets.com https://js.chilipiper.com https://platform.twitter.com https://ton.twimg.com https://accounts.google.com https://cdn.transcend.io https://cdn01.boxcdn.net code.gist.build;media-src blob: https: http: https://file.notion.so notion://file.notion.so https://*.mux.com;worker-src blob:;frame-src https: http: https://accounts.google.com renderer.gist.build code.gist.build",
|
||||
"X-DNS-Prefetch-Control",
|
||||
"off",
|
||||
"X-Frame-Options",
|
||||
"SAMEORIGIN",
|
||||
"Strict-Transport-Security",
|
||||
"max-age=5184000; includeSubDomains",
|
||||
"X-Download-Options",
|
||||
"noopen",
|
||||
"X-Content-Type-Options",
|
||||
"nosniff",
|
||||
"X-Permitted-Cross-Domain-Policies",
|
||||
"none",
|
||||
"Referrer-Policy",
|
||||
"strict-origin-when-cross-origin",
|
||||
"X-XSS-Protection",
|
||||
"0",
|
||||
"ETag",
|
||||
"W/\"48b-o15ev/xDPCB+PMklXFEv7yjRNjg\"",
|
||||
"Vary",
|
||||
"Accept-Encoding",
|
||||
"CF-Cache-Status",
|
||||
"DYNAMIC",
|
||||
"Set-Cookie",
|
||||
"notion_check_cookie_consent=true; Domain=www.notion.so; Path=/; Expires=Tue, 28 Feb 2023 12:03:22 GMT; Secure",
|
||||
"Set-Cookie",
|
||||
"__cf_bm=oTxAMd2fa8cXyXzIAradg5hbvrWNohWvKiBn_nAAT.Q-1677499403-0-AcoKZ8MVXztc+eW5DoC2TGRVKUWQIgFsB8w8UHKbORoTp8Qw7uTk/efMwoQoW2BTGY6Qy4GJEn1P8iZ/DRsSLIA=; path=/; expires=Mon, 27-Feb-23 12:33:23 GMT; domain=.notion.com; HttpOnly; Secure; SameSite=None",
|
||||
"Server",
|
||||
"cloudflare"
|
||||
],
|
||||
"responseIsBinary": false
|
||||
}
|
||||
]
|
||||
@@ -0,0 +1,116 @@
|
||||
[
|
||||
{
|
||||
"scope": "https://api.notion.com:443",
|
||||
"method": "POST",
|
||||
"path": "/v1/pages",
|
||||
"body": {
|
||||
"parent": {
|
||||
"type": "page_id",
|
||||
"page_id": "b4609033-b45a-4fc6-8d15-f06920495ab1"
|
||||
},
|
||||
"properties": {
|
||||
"title": {
|
||||
"title": [
|
||||
{
|
||||
"type": "text",
|
||||
"text": {
|
||||
"content": "Test page"
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
},
|
||||
"status": 200,
|
||||
"response": {
|
||||
"object": "page",
|
||||
"id": "8bd3c664-d6ef-46af-9910-e22686eb997e",
|
||||
"created_time": "2023-02-26T17:38:00.000Z",
|
||||
"last_edited_time": "2023-02-26T17:38:00.000Z",
|
||||
"created_by": {
|
||||
"object": "user",
|
||||
"id": "bcd4bb6e-7cb4-4e04-8609-10744a579644"
|
||||
},
|
||||
"last_edited_by": {
|
||||
"object": "user",
|
||||
"id": "bcd4bb6e-7cb4-4e04-8609-10744a579644"
|
||||
},
|
||||
"cover": null,
|
||||
"icon": null,
|
||||
"parent": {
|
||||
"type": "page_id",
|
||||
"page_id": "b4609033-b45a-4fc6-8d15-f06920495ab1"
|
||||
},
|
||||
"archived": false,
|
||||
"properties": {
|
||||
"title": {
|
||||
"id": "title",
|
||||
"type": "title",
|
||||
"title": [
|
||||
{
|
||||
"type": "text",
|
||||
"text": {
|
||||
"content": "Test page",
|
||||
"link": null
|
||||
},
|
||||
"annotations": {
|
||||
"bold": false,
|
||||
"italic": false,
|
||||
"strikethrough": false,
|
||||
"underline": false,
|
||||
"code": false,
|
||||
"color": "default"
|
||||
},
|
||||
"plain_text": "Test page",
|
||||
"href": null
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
"url": "https://www.notion.so/Test-page-8bd3c664d6ef46af9910e22686eb997e"
|
||||
},
|
||||
"rawHeaders": [
|
||||
"Date",
|
||||
"Sun, 26 Feb 2023 17:38:03 GMT",
|
||||
"Content-Type",
|
||||
"application/json; charset=utf-8",
|
||||
"Transfer-Encoding",
|
||||
"chunked",
|
||||
"Connection",
|
||||
"close",
|
||||
"Set-Cookie",
|
||||
"notion_browser_id=0584f959-2ff5-46b1-9d5d-832c26040396; Domain=www.notion.so; Path=/; Expires=Mon, 26 Feb 2024 17:38:02 GMT; Secure",
|
||||
"Content-Security-Policy",
|
||||
"script-src 'self' 'unsafe-inline' 'unsafe-eval' https://gist.github.com https://apis.google.com https://www.google.com https://www.gstatic.com https://cdn.amplitude.com https://api.amplitude.com http://dev-embed.notion.co http://embed.notion.co https://widget.intercom.io https://js.intercomcdn.com https://static.zdassets.com https://api.smooch.io\t https://logs-01.loggly.com https://http-inputs-notion.splunkcloud.com https://cdn.segment.com https://analytics.pgncs.notion.so https://o324374.ingest.sentry.io https://checkout.stripe.com https://js.stripe.com https://embed.typeform.com https://admin.typeform.com https://public.profitwell.com https://static.profitwell.com js.sentry-cdn.com https://js.chilipiper.com https://platform.twitter.com https://cdn.syndication.twimg.com https://accounts.google.com https://www.googletagmanager.com https://www.googleadservices.com https://googleads.g.doubleclick.net https://api-v2.mutinyhq.io https://client-registry.mutinycdn.com https://client.mutinycdn.com https://user-data.mutinycdn.com https://cdn.metadata.io https://platformapi.metadata.io https://d2hrivdxn8ekm8.cloudfront.net https://d1lu3pmaz2ilpx.cloudfront.net https://dvqigh9b7wa32.cloudfront.net https://d330aiyvva2oww.cloudfront.net https://cdn.transcend.io https://cdn01.boxcdn.net https://cdn.sprig.com assets.customer.io code.gist.build;connect-src 'self' data: blob: https://msgstore.www.notion.so wss://msgstore.www.notion.so ws://localhost:* ws://127.0.0.1:* https://notion-emojis.s3-us-west-2.amazonaws.com https://s3-us-west-2.amazonaws.com https://s3.us-west-2.amazonaws.com https://notion-production-snapshots-2.s3.us-west-2.amazonaws.com https://cdn.amplitude.com https://api.amplitude.com https://www.notion.so https://api.embed.ly http://dev-embed.notion.co http://embed.notion.co https://js.intercomcdn.com https://api-iam.intercom.io https://uploads.intercomcdn.com wss://nexus-websocket-a.intercom.io https://ekr.zdassets.com https://ekr.zendesk.com\t https://makenotion.zendesk.com\t https://api.smooch.io\t wss://api.smooch.io\t https://logs-01.loggly.com https://http-inputs-notion.splunkcloud.com https://cdn.segment.com https://api.segment.io https://analytics.pgncs.notion.so https://api.pgncs.notion.so https://o324374.ingest.sentry.io https://checkout.stripe.com https://js.stripe.com https://cdn.contentful.com https://preview.contentful.com https://images.ctfassets.net https://www2.profitwell.com https://tracking.chilipiper.com https://api.chilipiper.com https://api.unsplash.com https://boards-api.greenhouse.io https://accounts.google.com https://oauth2.googleapis.com https://www.googletagmanager.com https://analytics.google.com https://www.googleadservices.com https://googleads.g.doubleclick.net https://region1.google-analytics.com https://region1.analytics.google.com https://www.google-analytics.com https://api-v2.mutinyhq.io https://client-registry.mutinycdn.com https://client.mutinycdn.com https://user-data.mutinycdn.com https://cdn.metadata.io https://platformapi.metadata.io https://d2hrivdxn8ekm8.cloudfront.net https://d1lu3pmaz2ilpx.cloudfront.net https://dvqigh9b7wa32.cloudfront.net https://d330aiyvva2oww.cloudfront.net https://cdn.transcend.io https://telemetry.transcend.io https://api.statuspage.io https://pgncd.notion.so https://api.statsig.com https://statsigapi.net https://exp.notion.so https://file.notion.so notion://file.notion.so https://api.box.com https://*.mux.com https://api.sprig.com https://storage.googleapis.com https://cdn.sprig.com https://cdn.userleap.com track.customer.io *.api.gist.build *.cloud.gist.build;font-src 'self' data: https://cdnjs.cloudflare.com https://js.intercomcdn.com https://cdn01.boxcdn.net;img-src 'self' data: blob: https: https://platform.twitter.com https://syndication.twitter.com https://pbs.twimg.com https://ton.twimg.com https://region1.google-analytics.com https://region1.analytics.google.com https://file.notion.so notion://file.notion.so https://*.mux.com track.customer.io;style-src 'self' 'unsafe-inline' https://cdnjs.cloudflare.com https://github.githubassets.com https://js.chilipiper.com https://platform.twitter.com https://ton.twimg.com https://accounts.google.com https://cdn.transcend.io https://cdn01.boxcdn.net code.gist.build;media-src blob: https: http: https://file.notion.so notion://file.notion.so https://*.mux.com;worker-src blob:;frame-src https: http: https://accounts.google.com renderer.gist.build code.gist.build",
|
||||
"X-DNS-Prefetch-Control",
|
||||
"off",
|
||||
"X-Frame-Options",
|
||||
"SAMEORIGIN",
|
||||
"Strict-Transport-Security",
|
||||
"max-age=5184000; includeSubDomains",
|
||||
"X-Download-Options",
|
||||
"noopen",
|
||||
"X-Content-Type-Options",
|
||||
"nosniff",
|
||||
"X-Permitted-Cross-Domain-Policies",
|
||||
"none",
|
||||
"Referrer-Policy",
|
||||
"strict-origin-when-cross-origin",
|
||||
"X-XSS-Protection",
|
||||
"0",
|
||||
"ETag",
|
||||
"W/\"301-5q45Nq2W9keK4up4HOm5qUpzNKo\"",
|
||||
"Vary",
|
||||
"Accept-Encoding",
|
||||
"CF-Cache-Status",
|
||||
"DYNAMIC",
|
||||
"Set-Cookie",
|
||||
"notion_check_cookie_consent=true; Domain=www.notion.so; Path=/; Expires=Mon, 27 Feb 2023 17:38:02 GMT; Secure",
|
||||
"Set-Cookie",
|
||||
"__cf_bm=MeS4vVeV5Sms1RFoqYUoJ.onoMrGFyS6M_b0rfN7aho-1677433083-0-AQTR+b9TQ5LWf2yEhTnFj4QFuWs/C0ySl36mDO9bwhQ2rnsR1I8wrFgFls6yg4BJuorZQBnYtmIw00LnCvDHTfA=; path=/; expires=Sun, 26-Feb-23 18:08:03 GMT; domain=.notion.com; HttpOnly; Secure; SameSite=None",
|
||||
"Server",
|
||||
"cloudflare"
|
||||
],
|
||||
"responseIsBinary": false
|
||||
}
|
||||
]
|
||||
@@ -0,0 +1,96 @@
|
||||
[
|
||||
{
|
||||
"scope": "https://api.notion.com:443",
|
||||
"method": "DELETE",
|
||||
"path": "/v1/blocks/4c946f30-ebc2-4eed-bfbc-094226ae9659",
|
||||
"body": "",
|
||||
"status": 200,
|
||||
"response": {
|
||||
"object": "block",
|
||||
"id": "4c946f30-ebc2-4eed-bfbc-094226ae9659",
|
||||
"parent": {
|
||||
"type": "page_id",
|
||||
"page_id": "b4609033-b45a-4fc6-8d15-f06920495ab1"
|
||||
},
|
||||
"created_time": "2023-02-27T11:22:00.000Z",
|
||||
"last_edited_time": "2023-02-27T11:26:00.000Z",
|
||||
"created_by": {
|
||||
"object": "user",
|
||||
"id": "bcd4bb6e-7cb4-4e04-8609-10744a579644"
|
||||
},
|
||||
"last_edited_by": {
|
||||
"object": "user",
|
||||
"id": "bcd4bb6e-7cb4-4e04-8609-10744a579644"
|
||||
},
|
||||
"has_children": false,
|
||||
"archived": true,
|
||||
"type": "heading_1",
|
||||
"heading_1": {
|
||||
"rich_text": [
|
||||
{
|
||||
"type": "text",
|
||||
"text": {
|
||||
"content": "This new title is appended using appendBlockChildren()",
|
||||
"link": null
|
||||
},
|
||||
"annotations": {
|
||||
"bold": false,
|
||||
"italic": false,
|
||||
"strikethrough": false,
|
||||
"underline": false,
|
||||
"code": false,
|
||||
"color": "default"
|
||||
},
|
||||
"plain_text": "This new title is appended using appendBlockChildren()",
|
||||
"href": null
|
||||
}
|
||||
],
|
||||
"is_toggleable": false,
|
||||
"color": "default"
|
||||
}
|
||||
},
|
||||
"rawHeaders": [
|
||||
"Date",
|
||||
"Mon, 27 Feb 2023 11:26:10 GMT",
|
||||
"Content-Type",
|
||||
"application/json; charset=utf-8",
|
||||
"Transfer-Encoding",
|
||||
"chunked",
|
||||
"Connection",
|
||||
"close",
|
||||
"Set-Cookie",
|
||||
"notion_browser_id=d7b221d7-718e-45a2-a11e-1406aa98975d; Domain=www.notion.so; Path=/; Expires=Tue, 27 Feb 2024 11:26:09 GMT; Secure",
|
||||
"Content-Security-Policy",
|
||||
"script-src 'self' 'unsafe-inline' 'unsafe-eval' https://gist.github.com https://apis.google.com https://www.google.com https://www.gstatic.com https://cdn.amplitude.com https://api.amplitude.com http://dev-embed.notion.co http://embed.notion.co https://widget.intercom.io https://js.intercomcdn.com https://static.zdassets.com https://api.smooch.io\t https://logs-01.loggly.com https://http-inputs-notion.splunkcloud.com https://cdn.segment.com https://analytics.pgncs.notion.so https://o324374.ingest.sentry.io https://checkout.stripe.com https://js.stripe.com https://embed.typeform.com https://admin.typeform.com https://public.profitwell.com https://static.profitwell.com js.sentry-cdn.com https://js.chilipiper.com https://platform.twitter.com https://cdn.syndication.twimg.com https://accounts.google.com https://www.googletagmanager.com https://www.googleadservices.com https://googleads.g.doubleclick.net https://api-v2.mutinyhq.io https://client-registry.mutinycdn.com https://client.mutinycdn.com https://user-data.mutinycdn.com https://cdn.metadata.io https://platformapi.metadata.io https://d2hrivdxn8ekm8.cloudfront.net https://d1lu3pmaz2ilpx.cloudfront.net https://dvqigh9b7wa32.cloudfront.net https://d330aiyvva2oww.cloudfront.net https://cdn.transcend.io https://cdn01.boxcdn.net https://cdn.sprig.com assets.customer.io code.gist.build;connect-src 'self' data: blob: https://msgstore.www.notion.so wss://msgstore.www.notion.so ws://localhost:* ws://127.0.0.1:* https://notion-emojis.s3-us-west-2.amazonaws.com https://s3-us-west-2.amazonaws.com https://s3.us-west-2.amazonaws.com https://notion-production-snapshots-2.s3.us-west-2.amazonaws.com https://cdn.amplitude.com https://api.amplitude.com https://www.notion.so https://api.embed.ly http://dev-embed.notion.co http://embed.notion.co https://js.intercomcdn.com https://api-iam.intercom.io https://uploads.intercomcdn.com wss://nexus-websocket-a.intercom.io https://ekr.zdassets.com https://ekr.zendesk.com\t https://makenotion.zendesk.com\t https://api.smooch.io\t wss://api.smooch.io\t https://logs-01.loggly.com https://http-inputs-notion.splunkcloud.com https://cdn.segment.com https://api.segment.io https://analytics.pgncs.notion.so https://api.pgncs.notion.so https://o324374.ingest.sentry.io https://checkout.stripe.com https://js.stripe.com https://cdn.contentful.com https://preview.contentful.com https://images.ctfassets.net https://www2.profitwell.com https://tracking.chilipiper.com https://api.chilipiper.com https://api.unsplash.com https://boards-api.greenhouse.io https://accounts.google.com https://oauth2.googleapis.com https://www.googletagmanager.com https://analytics.google.com https://www.googleadservices.com https://googleads.g.doubleclick.net https://region1.google-analytics.com https://region1.analytics.google.com https://www.google-analytics.com https://api-v2.mutinyhq.io https://client-registry.mutinycdn.com https://client.mutinycdn.com https://user-data.mutinycdn.com https://cdn.metadata.io https://platformapi.metadata.io https://d2hrivdxn8ekm8.cloudfront.net https://d1lu3pmaz2ilpx.cloudfront.net https://dvqigh9b7wa32.cloudfront.net https://d330aiyvva2oww.cloudfront.net https://cdn.transcend.io https://telemetry.transcend.io https://api.statuspage.io https://pgncd.notion.so https://api.statsig.com https://statsigapi.net https://exp.notion.so https://file.notion.so notion://file.notion.so https://api.box.com https://*.mux.com https://api.sprig.com https://storage.googleapis.com https://cdn.sprig.com https://cdn.userleap.com track.customer.io *.api.gist.build *.cloud.gist.build;font-src 'self' data: https://cdnjs.cloudflare.com https://js.intercomcdn.com https://cdn01.boxcdn.net;img-src 'self' data: blob: https: https://platform.twitter.com https://syndication.twitter.com https://pbs.twimg.com https://ton.twimg.com https://region1.google-analytics.com https://region1.analytics.google.com https://file.notion.so notion://file.notion.so https://*.mux.com track.customer.io;style-src 'self' 'unsafe-inline' https://cdnjs.cloudflare.com https://github.githubassets.com https://js.chilipiper.com https://platform.twitter.com https://ton.twimg.com https://accounts.google.com https://cdn.transcend.io https://cdn01.boxcdn.net code.gist.build;media-src blob: https: http: https://file.notion.so notion://file.notion.so https://*.mux.com;worker-src blob:;frame-src https: http: https://accounts.google.com renderer.gist.build code.gist.build",
|
||||
"X-DNS-Prefetch-Control",
|
||||
"off",
|
||||
"X-Frame-Options",
|
||||
"SAMEORIGIN",
|
||||
"Strict-Transport-Security",
|
||||
"max-age=5184000; includeSubDomains",
|
||||
"X-Download-Options",
|
||||
"noopen",
|
||||
"X-Content-Type-Options",
|
||||
"nosniff",
|
||||
"X-Permitted-Cross-Domain-Policies",
|
||||
"none",
|
||||
"Referrer-Policy",
|
||||
"strict-origin-when-cross-origin",
|
||||
"X-XSS-Protection",
|
||||
"0",
|
||||
"ETag",
|
||||
"W/\"326-D6+1VY70vo6bSnfGivDXLQlR9sA\"",
|
||||
"Vary",
|
||||
"Accept-Encoding",
|
||||
"CF-Cache-Status",
|
||||
"DYNAMIC",
|
||||
"Set-Cookie",
|
||||
"notion_check_cookie_consent=true; Domain=www.notion.so; Path=/; Expires=Tue, 28 Feb 2023 11:26:09 GMT; Secure",
|
||||
"Set-Cookie",
|
||||
"__cf_bm=LargbK1gg7PjzvuUZu9DAsNpgc2zb3YdVGwgePQccYg-1677497170-0-Af8+5TWVeIgr9kq8MfM0cIPW6rO2QT0AA7cuyIFfJYni14Qvd5M0V+CkIF/Vrto9qbmPTD6L40sKr4fkr12MIkA=; path=/; expires=Mon, 27-Feb-23 11:56:10 GMT; domain=.notion.com; HttpOnly; Secure; SameSite=None",
|
||||
"Server",
|
||||
"cloudflare"
|
||||
],
|
||||
"responseIsBinary": false
|
||||
}
|
||||
]
|
||||
@@ -0,0 +1,76 @@
|
||||
[
|
||||
{
|
||||
"scope": "https://api.notion.com:443",
|
||||
"method": "GET",
|
||||
"path": "/v1/blocks/b4609033-b45a-4fc6-8d15-f06920495ab1",
|
||||
"body": "",
|
||||
"status": 200,
|
||||
"response": {
|
||||
"object": "block",
|
||||
"id": "b4609033-b45a-4fc6-8d15-f06920495ab1",
|
||||
"parent": {
|
||||
"type": "workspace",
|
||||
"workspace": true
|
||||
},
|
||||
"created_time": "2023-02-24T19:07:00.000Z",
|
||||
"last_edited_time": "2023-02-27T09:19:00.000Z",
|
||||
"created_by": {
|
||||
"object": "user",
|
||||
"id": "cc18a80a-973f-42c4-8fed-a055f8ae31f4"
|
||||
},
|
||||
"last_edited_by": {
|
||||
"object": "user",
|
||||
"id": "bcd4bb6e-7cb4-4e04-8609-10744a579644"
|
||||
},
|
||||
"has_children": true,
|
||||
"archived": false,
|
||||
"type": "child_page",
|
||||
"child_page": {
|
||||
"title": "Personal Home"
|
||||
}
|
||||
},
|
||||
"rawHeaders": [
|
||||
"Date",
|
||||
"Mon, 27 Feb 2023 09:26:00 GMT",
|
||||
"Content-Type",
|
||||
"application/json; charset=utf-8",
|
||||
"Transfer-Encoding",
|
||||
"chunked",
|
||||
"Connection",
|
||||
"close",
|
||||
"Set-Cookie",
|
||||
"notion_browser_id=5d40d8ce-14ac-4534-a52e-1fc1b79f6242; Domain=www.notion.so; Path=/; Expires=Tue, 27 Feb 2024 09:26:00 GMT; Secure",
|
||||
"Content-Security-Policy",
|
||||
"script-src 'self' 'unsafe-inline' 'unsafe-eval' https://gist.github.com https://apis.google.com https://www.google.com https://www.gstatic.com https://cdn.amplitude.com https://api.amplitude.com http://dev-embed.notion.co http://embed.notion.co https://widget.intercom.io https://js.intercomcdn.com https://static.zdassets.com https://api.smooch.io\t https://logs-01.loggly.com https://http-inputs-notion.splunkcloud.com https://cdn.segment.com https://analytics.pgncs.notion.so https://o324374.ingest.sentry.io https://checkout.stripe.com https://js.stripe.com https://embed.typeform.com https://admin.typeform.com https://public.profitwell.com https://static.profitwell.com js.sentry-cdn.com https://js.chilipiper.com https://platform.twitter.com https://cdn.syndication.twimg.com https://accounts.google.com https://www.googletagmanager.com https://www.googleadservices.com https://googleads.g.doubleclick.net https://api-v2.mutinyhq.io https://client-registry.mutinycdn.com https://client.mutinycdn.com https://user-data.mutinycdn.com https://cdn.metadata.io https://platformapi.metadata.io https://d2hrivdxn8ekm8.cloudfront.net https://d1lu3pmaz2ilpx.cloudfront.net https://dvqigh9b7wa32.cloudfront.net https://d330aiyvva2oww.cloudfront.net https://cdn.transcend.io https://cdn01.boxcdn.net https://cdn.sprig.com assets.customer.io code.gist.build;connect-src 'self' data: blob: https://msgstore.www.notion.so wss://msgstore.www.notion.so ws://localhost:* ws://127.0.0.1:* https://notion-emojis.s3-us-west-2.amazonaws.com https://s3-us-west-2.amazonaws.com https://s3.us-west-2.amazonaws.com https://notion-production-snapshots-2.s3.us-west-2.amazonaws.com https://cdn.amplitude.com https://api.amplitude.com https://www.notion.so https://api.embed.ly http://dev-embed.notion.co http://embed.notion.co https://js.intercomcdn.com https://api-iam.intercom.io https://uploads.intercomcdn.com wss://nexus-websocket-a.intercom.io https://ekr.zdassets.com https://ekr.zendesk.com\t https://makenotion.zendesk.com\t https://api.smooch.io\t wss://api.smooch.io\t https://logs-01.loggly.com https://http-inputs-notion.splunkcloud.com https://cdn.segment.com https://api.segment.io https://analytics.pgncs.notion.so https://api.pgncs.notion.so https://o324374.ingest.sentry.io https://checkout.stripe.com https://js.stripe.com https://cdn.contentful.com https://preview.contentful.com https://images.ctfassets.net https://www2.profitwell.com https://tracking.chilipiper.com https://api.chilipiper.com https://api.unsplash.com https://boards-api.greenhouse.io https://accounts.google.com https://oauth2.googleapis.com https://www.googletagmanager.com https://analytics.google.com https://www.googleadservices.com https://googleads.g.doubleclick.net https://region1.google-analytics.com https://region1.analytics.google.com https://www.google-analytics.com https://api-v2.mutinyhq.io https://client-registry.mutinycdn.com https://client.mutinycdn.com https://user-data.mutinycdn.com https://cdn.metadata.io https://platformapi.metadata.io https://d2hrivdxn8ekm8.cloudfront.net https://d1lu3pmaz2ilpx.cloudfront.net https://dvqigh9b7wa32.cloudfront.net https://d330aiyvva2oww.cloudfront.net https://cdn.transcend.io https://telemetry.transcend.io https://api.statuspage.io https://pgncd.notion.so https://api.statsig.com https://statsigapi.net https://exp.notion.so https://file.notion.so notion://file.notion.so https://api.box.com https://*.mux.com https://api.sprig.com https://storage.googleapis.com https://cdn.sprig.com https://cdn.userleap.com track.customer.io *.api.gist.build *.cloud.gist.build;font-src 'self' data: https://cdnjs.cloudflare.com https://js.intercomcdn.com https://cdn01.boxcdn.net;img-src 'self' data: blob: https: https://platform.twitter.com https://syndication.twitter.com https://pbs.twimg.com https://ton.twimg.com https://region1.google-analytics.com https://region1.analytics.google.com https://file.notion.so notion://file.notion.so https://*.mux.com track.customer.io;style-src 'self' 'unsafe-inline' https://cdnjs.cloudflare.com https://github.githubassets.com https://js.chilipiper.com https://platform.twitter.com https://ton.twimg.com https://accounts.google.com https://cdn.transcend.io https://cdn01.boxcdn.net code.gist.build;media-src blob: https: http: https://file.notion.so notion://file.notion.so https://*.mux.com;worker-src blob:;frame-src https: http: https://accounts.google.com renderer.gist.build code.gist.build",
|
||||
"X-DNS-Prefetch-Control",
|
||||
"off",
|
||||
"X-Frame-Options",
|
||||
"SAMEORIGIN",
|
||||
"Strict-Transport-Security",
|
||||
"max-age=5184000; includeSubDomains",
|
||||
"X-Download-Options",
|
||||
"noopen",
|
||||
"X-Content-Type-Options",
|
||||
"nosniff",
|
||||
"X-Permitted-Cross-Domain-Policies",
|
||||
"none",
|
||||
"Referrer-Policy",
|
||||
"strict-origin-when-cross-origin",
|
||||
"X-XSS-Protection",
|
||||
"0",
|
||||
"ETag",
|
||||
"W/\"1bf-Xn6bRYmy8GO/bp7WIQLZCOHSxRw\"",
|
||||
"Vary",
|
||||
"Accept-Encoding",
|
||||
"CF-Cache-Status",
|
||||
"DYNAMIC",
|
||||
"Set-Cookie",
|
||||
"notion_check_cookie_consent=true; Domain=www.notion.so; Path=/; Expires=Tue, 28 Feb 2023 09:26:00 GMT; Secure",
|
||||
"Set-Cookie",
|
||||
"__cf_bm=xDv5oNogRgQN.m5YOrYBRu7vQPpAprpUNpqRES8Zbp8-1677489960-0-AS3KjttcIVVXJO5WedstOC9vc78EcmHw2kyHHdUTBVk3Uufe8/r5VygzgdKwS8XiDkYFQFYaMzvUMIcZwcXBNeE=; path=/; expires=Mon, 27-Feb-23 09:56:00 GMT; domain=.notion.com; HttpOnly; Secure; SameSite=None",
|
||||
"Server",
|
||||
"cloudflare"
|
||||
],
|
||||
"responseIsBinary": false
|
||||
}
|
||||
]
|
||||
@@ -0,0 +1,223 @@
|
||||
[
|
||||
{
|
||||
"scope": "https://api.notion.com:443",
|
||||
"method": "GET",
|
||||
"path": "/v1/blocks/b4609033-b45a-4fc6-8d15-f06920495ab1/children",
|
||||
"body": "",
|
||||
"status": 200,
|
||||
"response": {
|
||||
"object": "list",
|
||||
"results": [
|
||||
{
|
||||
"object": "block",
|
||||
"id": "2675c67d-392a-4b86-86f6-93de22c797bd",
|
||||
"parent": {
|
||||
"type": "page_id",
|
||||
"page_id": "b4609033-b45a-4fc6-8d15-f06920495ab1"
|
||||
},
|
||||
"created_time": "2023-02-24T19:07:00.000Z",
|
||||
"last_edited_time": "2023-02-24T19:07:00.000Z",
|
||||
"created_by": {
|
||||
"object": "user",
|
||||
"id": "cc18a80a-973f-42c4-8fed-a055f8ae31f4"
|
||||
},
|
||||
"last_edited_by": {
|
||||
"object": "user",
|
||||
"id": "cc18a80a-973f-42c4-8fed-a055f8ae31f4"
|
||||
},
|
||||
"has_children": false,
|
||||
"archived": false,
|
||||
"type": "paragraph",
|
||||
"paragraph": {
|
||||
"rich_text": [
|
||||
{
|
||||
"type": "text",
|
||||
"text": {
|
||||
"content": "Organize everything in your life in one place.",
|
||||
"link": null
|
||||
},
|
||||
"annotations": {
|
||||
"bold": false,
|
||||
"italic": false,
|
||||
"strikethrough": false,
|
||||
"underline": false,
|
||||
"code": false,
|
||||
"color": "default"
|
||||
},
|
||||
"plain_text": "Organize everything in your life in one place.",
|
||||
"href": null
|
||||
}
|
||||
],
|
||||
"color": "gray"
|
||||
}
|
||||
},
|
||||
{
|
||||
"object": "block",
|
||||
"id": "f3df1513-efda-4caf-af5b-f08a0ebe3dfa",
|
||||
"parent": {
|
||||
"type": "page_id",
|
||||
"page_id": "b4609033-b45a-4fc6-8d15-f06920495ab1"
|
||||
},
|
||||
"created_time": "2023-02-24T19:07:00.000Z",
|
||||
"last_edited_time": "2023-02-24T19:07:00.000Z",
|
||||
"created_by": {
|
||||
"object": "user",
|
||||
"id": "cc18a80a-973f-42c4-8fed-a055f8ae31f4"
|
||||
},
|
||||
"last_edited_by": {
|
||||
"object": "user",
|
||||
"id": "cc18a80a-973f-42c4-8fed-a055f8ae31f4"
|
||||
},
|
||||
"has_children": true,
|
||||
"archived": false,
|
||||
"type": "column_list",
|
||||
"column_list": {}
|
||||
},
|
||||
{
|
||||
"object": "block",
|
||||
"id": "d843f4ae-6cc2-44df-a294-3d9405c950bb",
|
||||
"parent": {
|
||||
"type": "page_id",
|
||||
"page_id": "b4609033-b45a-4fc6-8d15-f06920495ab1"
|
||||
},
|
||||
"created_time": "2023-02-26T17:36:00.000Z",
|
||||
"last_edited_time": "2023-02-26T17:36:00.000Z",
|
||||
"created_by": {
|
||||
"object": "user",
|
||||
"id": "bcd4bb6e-7cb4-4e04-8609-10744a579644"
|
||||
},
|
||||
"last_edited_by": {
|
||||
"object": "user",
|
||||
"id": "bcd4bb6e-7cb4-4e04-8609-10744a579644"
|
||||
},
|
||||
"has_children": false,
|
||||
"archived": false,
|
||||
"type": "child_page",
|
||||
"child_page": {
|
||||
"title": "Test page"
|
||||
}
|
||||
},
|
||||
{
|
||||
"object": "block",
|
||||
"id": "026566db-b2a0-4d0a-96f1-1007fccc28df",
|
||||
"parent": {
|
||||
"type": "page_id",
|
||||
"page_id": "b4609033-b45a-4fc6-8d15-f06920495ab1"
|
||||
},
|
||||
"created_time": "2023-02-26T17:37:00.000Z",
|
||||
"last_edited_time": "2023-02-26T17:37:00.000Z",
|
||||
"created_by": {
|
||||
"object": "user",
|
||||
"id": "bcd4bb6e-7cb4-4e04-8609-10744a579644"
|
||||
},
|
||||
"last_edited_by": {
|
||||
"object": "user",
|
||||
"id": "bcd4bb6e-7cb4-4e04-8609-10744a579644"
|
||||
},
|
||||
"has_children": false,
|
||||
"archived": false,
|
||||
"type": "child_page",
|
||||
"child_page": {
|
||||
"title": "Test page"
|
||||
}
|
||||
},
|
||||
{
|
||||
"object": "block",
|
||||
"id": "8bd3c664-d6ef-46af-9910-e22686eb997e",
|
||||
"parent": {
|
||||
"type": "page_id",
|
||||
"page_id": "b4609033-b45a-4fc6-8d15-f06920495ab1"
|
||||
},
|
||||
"created_time": "2023-02-26T17:38:00.000Z",
|
||||
"last_edited_time": "2023-02-26T17:38:00.000Z",
|
||||
"created_by": {
|
||||
"object": "user",
|
||||
"id": "bcd4bb6e-7cb4-4e04-8609-10744a579644"
|
||||
},
|
||||
"last_edited_by": {
|
||||
"object": "user",
|
||||
"id": "bcd4bb6e-7cb4-4e04-8609-10744a579644"
|
||||
},
|
||||
"has_children": false,
|
||||
"archived": false,
|
||||
"type": "child_page",
|
||||
"child_page": {
|
||||
"title": "Test page"
|
||||
}
|
||||
},
|
||||
{
|
||||
"object": "block",
|
||||
"id": "fe7ade22-66de-45fb-b3b5-4a467ff67d2b",
|
||||
"parent": {
|
||||
"type": "page_id",
|
||||
"page_id": "b4609033-b45a-4fc6-8d15-f06920495ab1"
|
||||
},
|
||||
"created_time": "2023-02-26T17:38:00.000Z",
|
||||
"last_edited_time": "2023-02-26T17:38:00.000Z",
|
||||
"created_by": {
|
||||
"object": "user",
|
||||
"id": "cc18a80a-973f-42c4-8fed-a055f8ae31f4"
|
||||
},
|
||||
"last_edited_by": {
|
||||
"object": "user",
|
||||
"id": "cc18a80a-973f-42c4-8fed-a055f8ae31f4"
|
||||
},
|
||||
"has_children": false,
|
||||
"archived": false,
|
||||
"type": "paragraph",
|
||||
"paragraph": {
|
||||
"rich_text": [],
|
||||
"color": "default"
|
||||
}
|
||||
}
|
||||
],
|
||||
"next_cursor": null,
|
||||
"has_more": false,
|
||||
"type": "block",
|
||||
"block": {}
|
||||
},
|
||||
"rawHeaders": [
|
||||
"Date",
|
||||
"Mon, 27 Feb 2023 11:09:36 GMT",
|
||||
"Content-Type",
|
||||
"application/json; charset=utf-8",
|
||||
"Transfer-Encoding",
|
||||
"chunked",
|
||||
"Connection",
|
||||
"close",
|
||||
"Set-Cookie",
|
||||
"notion_browser_id=86f94a88-a9d2-4e88-abf9-3d364583ad08; Domain=www.notion.so; Path=/; Expires=Tue, 27 Feb 2024 11:09:36 GMT; Secure",
|
||||
"Content-Security-Policy",
|
||||
"script-src 'self' 'unsafe-inline' 'unsafe-eval' https://gist.github.com https://apis.google.com https://www.google.com https://www.gstatic.com https://cdn.amplitude.com https://api.amplitude.com http://dev-embed.notion.co http://embed.notion.co https://widget.intercom.io https://js.intercomcdn.com https://static.zdassets.com https://api.smooch.io\t https://logs-01.loggly.com https://http-inputs-notion.splunkcloud.com https://cdn.segment.com https://analytics.pgncs.notion.so https://o324374.ingest.sentry.io https://checkout.stripe.com https://js.stripe.com https://embed.typeform.com https://admin.typeform.com https://public.profitwell.com https://static.profitwell.com js.sentry-cdn.com https://js.chilipiper.com https://platform.twitter.com https://cdn.syndication.twimg.com https://accounts.google.com https://www.googletagmanager.com https://www.googleadservices.com https://googleads.g.doubleclick.net https://api-v2.mutinyhq.io https://client-registry.mutinycdn.com https://client.mutinycdn.com https://user-data.mutinycdn.com https://cdn.metadata.io https://platformapi.metadata.io https://d2hrivdxn8ekm8.cloudfront.net https://d1lu3pmaz2ilpx.cloudfront.net https://dvqigh9b7wa32.cloudfront.net https://d330aiyvva2oww.cloudfront.net https://cdn.transcend.io https://cdn01.boxcdn.net https://cdn.sprig.com assets.customer.io code.gist.build;connect-src 'self' data: blob: https://msgstore.www.notion.so wss://msgstore.www.notion.so ws://localhost:* ws://127.0.0.1:* https://notion-emojis.s3-us-west-2.amazonaws.com https://s3-us-west-2.amazonaws.com https://s3.us-west-2.amazonaws.com https://notion-production-snapshots-2.s3.us-west-2.amazonaws.com https://cdn.amplitude.com https://api.amplitude.com https://www.notion.so https://api.embed.ly http://dev-embed.notion.co http://embed.notion.co https://js.intercomcdn.com https://api-iam.intercom.io https://uploads.intercomcdn.com wss://nexus-websocket-a.intercom.io https://ekr.zdassets.com https://ekr.zendesk.com\t https://makenotion.zendesk.com\t https://api.smooch.io\t wss://api.smooch.io\t https://logs-01.loggly.com https://http-inputs-notion.splunkcloud.com https://cdn.segment.com https://api.segment.io https://analytics.pgncs.notion.so https://api.pgncs.notion.so https://o324374.ingest.sentry.io https://checkout.stripe.com https://js.stripe.com https://cdn.contentful.com https://preview.contentful.com https://images.ctfassets.net https://www2.profitwell.com https://tracking.chilipiper.com https://api.chilipiper.com https://api.unsplash.com https://boards-api.greenhouse.io https://accounts.google.com https://oauth2.googleapis.com https://www.googletagmanager.com https://analytics.google.com https://www.googleadservices.com https://googleads.g.doubleclick.net https://region1.google-analytics.com https://region1.analytics.google.com https://www.google-analytics.com https://api-v2.mutinyhq.io https://client-registry.mutinycdn.com https://client.mutinycdn.com https://user-data.mutinycdn.com https://cdn.metadata.io https://platformapi.metadata.io https://d2hrivdxn8ekm8.cloudfront.net https://d1lu3pmaz2ilpx.cloudfront.net https://dvqigh9b7wa32.cloudfront.net https://d330aiyvva2oww.cloudfront.net https://cdn.transcend.io https://telemetry.transcend.io https://api.statuspage.io https://pgncd.notion.so https://api.statsig.com https://statsigapi.net https://exp.notion.so https://file.notion.so notion://file.notion.so https://api.box.com https://*.mux.com https://api.sprig.com https://storage.googleapis.com https://cdn.sprig.com https://cdn.userleap.com track.customer.io *.api.gist.build *.cloud.gist.build;font-src 'self' data: https://cdnjs.cloudflare.com https://js.intercomcdn.com https://cdn01.boxcdn.net;img-src 'self' data: blob: https: https://platform.twitter.com https://syndication.twitter.com https://pbs.twimg.com https://ton.twimg.com https://region1.google-analytics.com https://region1.analytics.google.com https://file.notion.so notion://file.notion.so https://*.mux.com track.customer.io;style-src 'self' 'unsafe-inline' https://cdnjs.cloudflare.com https://github.githubassets.com https://js.chilipiper.com https://platform.twitter.com https://ton.twimg.com https://accounts.google.com https://cdn.transcend.io https://cdn01.boxcdn.net code.gist.build;media-src blob: https: http: https://file.notion.so notion://file.notion.so https://*.mux.com;worker-src blob:;frame-src https: http: https://accounts.google.com renderer.gist.build code.gist.build",
|
||||
"X-DNS-Prefetch-Control",
|
||||
"off",
|
||||
"X-Frame-Options",
|
||||
"SAMEORIGIN",
|
||||
"Strict-Transport-Security",
|
||||
"max-age=5184000; includeSubDomains",
|
||||
"X-Download-Options",
|
||||
"noopen",
|
||||
"X-Content-Type-Options",
|
||||
"nosniff",
|
||||
"X-Permitted-Cross-Domain-Policies",
|
||||
"none",
|
||||
"Referrer-Policy",
|
||||
"strict-origin-when-cross-origin",
|
||||
"X-XSS-Protection",
|
||||
"0",
|
||||
"ETag",
|
||||
"W/\"c9a-7ksTq1q+y6dBHZKFnoF7Xfgs/Fw\"",
|
||||
"Vary",
|
||||
"Accept-Encoding",
|
||||
"CF-Cache-Status",
|
||||
"DYNAMIC",
|
||||
"Set-Cookie",
|
||||
"notion_check_cookie_consent=true; Domain=www.notion.so; Path=/; Expires=Tue, 28 Feb 2023 11:09:36 GMT; Secure",
|
||||
"Set-Cookie",
|
||||
"__cf_bm=ipVUIrHFEqeTilNjmbfPoJKioZkTOB97pJd9mYe9zIk-1677496176-0-AZfFsUjfINaIHmGd5kPe0tqoBC2UgOqo1kL89YPsBd4fTQWgiJ5PdZFotvJdsHaXlUTyGswSb6HQO3kF6D7POjw=; path=/; expires=Mon, 27-Feb-23 11:39:36 GMT; domain=.notion.com; HttpOnly; Secure; SameSite=None",
|
||||
"Server",
|
||||
"cloudflare"
|
||||
],
|
||||
"responseIsBinary": false
|
||||
}
|
||||
]
|
||||
@@ -0,0 +1,75 @@
|
||||
[
|
||||
{
|
||||
"scope": "https://api.notion.com:443",
|
||||
"method": "GET",
|
||||
"path": "/v1/users/me",
|
||||
"body": "",
|
||||
"status": 200,
|
||||
"response": {
|
||||
"object": "user",
|
||||
"id": "bcd4bb6e-7cb4-4e04-8609-10744a579644",
|
||||
"name": "Trigger.dev (localhost)",
|
||||
"avatar_url": "https://s3-us-west-2.amazonaws.com/public.notion-static.com/b374368f-9f41-460a-bf8e-5e19f8fb0e07/td-square-logo_512.png",
|
||||
"type": "bot",
|
||||
"bot": {
|
||||
"owner": {
|
||||
"type": "user",
|
||||
"user": {
|
||||
"object": "user",
|
||||
"id": "cc18a80a-973f-42c4-8fed-a055f8ae31f4",
|
||||
"name": "Matt Aitken",
|
||||
"avatar_url": "https://s3-us-west-2.amazonaws.com/public.notion-static.com/0ccadce7-a4aa-4a69-92e6-2ac708593613/matt-wedding.jpg",
|
||||
"type": "person",
|
||||
"person": {
|
||||
"email": "matt@apihero.run"
|
||||
}
|
||||
}
|
||||
},
|
||||
"workspace_name": "Notion integration test workspace"
|
||||
}
|
||||
},
|
||||
"rawHeaders": [
|
||||
"Date",
|
||||
"Sun, 26 Feb 2023 17:03:48 GMT",
|
||||
"Content-Type",
|
||||
"application/json; charset=utf-8",
|
||||
"Transfer-Encoding",
|
||||
"chunked",
|
||||
"Connection",
|
||||
"close",
|
||||
"Set-Cookie",
|
||||
"notion_browser_id=9231cce8-e2ce-411c-b0e1-2597eb62b367; Domain=www.notion.so; Path=/; Expires=Mon, 26 Feb 2024 17:03:48 GMT; Secure",
|
||||
"Content-Security-Policy",
|
||||
"script-src 'self' 'unsafe-inline' 'unsafe-eval' https://gist.github.com https://apis.google.com https://www.google.com https://www.gstatic.com https://cdn.amplitude.com https://api.amplitude.com http://dev-embed.notion.co http://embed.notion.co https://widget.intercom.io https://js.intercomcdn.com https://static.zdassets.com https://api.smooch.io\t https://logs-01.loggly.com https://http-inputs-notion.splunkcloud.com https://cdn.segment.com https://analytics.pgncs.notion.so https://o324374.ingest.sentry.io https://checkout.stripe.com https://js.stripe.com https://embed.typeform.com https://admin.typeform.com https://public.profitwell.com https://static.profitwell.com js.sentry-cdn.com https://js.chilipiper.com https://platform.twitter.com https://cdn.syndication.twimg.com https://accounts.google.com https://www.googletagmanager.com https://www.googleadservices.com https://googleads.g.doubleclick.net https://api-v2.mutinyhq.io https://client-registry.mutinycdn.com https://client.mutinycdn.com https://user-data.mutinycdn.com https://cdn.metadata.io https://platformapi.metadata.io https://d2hrivdxn8ekm8.cloudfront.net https://d1lu3pmaz2ilpx.cloudfront.net https://dvqigh9b7wa32.cloudfront.net https://d330aiyvva2oww.cloudfront.net https://cdn.transcend.io https://cdn01.boxcdn.net https://cdn.sprig.com assets.customer.io code.gist.build;connect-src 'self' data: blob: https://msgstore.www.notion.so wss://msgstore.www.notion.so ws://localhost:* ws://127.0.0.1:* https://notion-emojis.s3-us-west-2.amazonaws.com https://s3-us-west-2.amazonaws.com https://s3.us-west-2.amazonaws.com https://notion-production-snapshots-2.s3.us-west-2.amazonaws.com https://cdn.amplitude.com https://api.amplitude.com https://www.notion.so https://api.embed.ly http://dev-embed.notion.co http://embed.notion.co https://js.intercomcdn.com https://api-iam.intercom.io https://uploads.intercomcdn.com wss://nexus-websocket-a.intercom.io https://ekr.zdassets.com https://ekr.zendesk.com\t https://makenotion.zendesk.com\t https://api.smooch.io\t wss://api.smooch.io\t https://logs-01.loggly.com https://http-inputs-notion.splunkcloud.com https://cdn.segment.com https://api.segment.io https://analytics.pgncs.notion.so https://api.pgncs.notion.so https://o324374.ingest.sentry.io https://checkout.stripe.com https://js.stripe.com https://cdn.contentful.com https://preview.contentful.com https://images.ctfassets.net https://www2.profitwell.com https://tracking.chilipiper.com https://api.chilipiper.com https://api.unsplash.com https://boards-api.greenhouse.io https://accounts.google.com https://oauth2.googleapis.com https://www.googletagmanager.com https://analytics.google.com https://www.googleadservices.com https://googleads.g.doubleclick.net https://region1.google-analytics.com https://region1.analytics.google.com https://www.google-analytics.com https://api-v2.mutinyhq.io https://client-registry.mutinycdn.com https://client.mutinycdn.com https://user-data.mutinycdn.com https://cdn.metadata.io https://platformapi.metadata.io https://d2hrivdxn8ekm8.cloudfront.net https://d1lu3pmaz2ilpx.cloudfront.net https://dvqigh9b7wa32.cloudfront.net https://d330aiyvva2oww.cloudfront.net https://cdn.transcend.io https://telemetry.transcend.io https://api.statuspage.io https://pgncd.notion.so https://api.statsig.com https://statsigapi.net https://exp.notion.so https://file.notion.so notion://file.notion.so https://api.box.com https://*.mux.com https://api.sprig.com https://storage.googleapis.com https://cdn.sprig.com https://cdn.userleap.com track.customer.io *.api.gist.build *.cloud.gist.build;font-src 'self' data: https://cdnjs.cloudflare.com https://js.intercomcdn.com https://cdn01.boxcdn.net;img-src 'self' data: blob: https: https://platform.twitter.com https://syndication.twitter.com https://pbs.twimg.com https://ton.twimg.com https://region1.google-analytics.com https://region1.analytics.google.com https://file.notion.so notion://file.notion.so https://*.mux.com track.customer.io;style-src 'self' 'unsafe-inline' https://cdnjs.cloudflare.com https://github.githubassets.com https://js.chilipiper.com https://platform.twitter.com https://ton.twimg.com https://accounts.google.com https://cdn.transcend.io https://cdn01.boxcdn.net code.gist.build;media-src blob: https: http: https://file.notion.so notion://file.notion.so https://*.mux.com;worker-src blob:;frame-src https: http: https://accounts.google.com renderer.gist.build code.gist.build",
|
||||
"X-DNS-Prefetch-Control",
|
||||
"off",
|
||||
"X-Frame-Options",
|
||||
"SAMEORIGIN",
|
||||
"Strict-Transport-Security",
|
||||
"max-age=5184000; includeSubDomains",
|
||||
"X-Download-Options",
|
||||
"noopen",
|
||||
"X-Content-Type-Options",
|
||||
"nosniff",
|
||||
"X-Permitted-Cross-Domain-Policies",
|
||||
"none",
|
||||
"Referrer-Policy",
|
||||
"strict-origin-when-cross-origin",
|
||||
"X-XSS-Protection",
|
||||
"0",
|
||||
"ETag",
|
||||
"W/\"258-Y7OR6G0p0SWytfeYN6CvqKvsRr4\"",
|
||||
"Vary",
|
||||
"Accept-Encoding",
|
||||
"CF-Cache-Status",
|
||||
"DYNAMIC",
|
||||
"Set-Cookie",
|
||||
"notion_check_cookie_consent=true; Domain=www.notion.so; Path=/; Expires=Mon, 27 Feb 2023 17:03:48 GMT; Secure",
|
||||
"Set-Cookie",
|
||||
"__cf_bm=bFtxnRN2taXobaLZvnlr6T3gU61eVngXy2I7_UV5sQs-1677431028-0-AVKDesaUNQBhdDqVjtHeh1Up5jm+pHl7pOcmzOpVMuUGHrrNulojcu6nNhI8Qp0hIs2e5m2DF/7wTh8dzT4KPOc=; path=/; expires=Sun, 26-Feb-23 17:33:48 GMT; domain=.notion.com; HttpOnly; Secure; SameSite=None",
|
||||
"Server",
|
||||
"cloudflare"
|
||||
],
|
||||
"responseIsBinary": false
|
||||
}
|
||||
]
|
||||
@@ -0,0 +1,95 @@
|
||||
[
|
||||
{
|
||||
"scope": "https://api.notion.com:443",
|
||||
"method": "GET",
|
||||
"path": "/v1/comments?block_id=b4609033-b45a-4fc6-8d15-f06920495ab1",
|
||||
"body": "",
|
||||
"status": 200,
|
||||
"response": {
|
||||
"object": "list",
|
||||
"results": [
|
||||
{
|
||||
"object": "comment",
|
||||
"id": "6ff7c4ea-2666-4fe7-a256-56b43a73ea10",
|
||||
"parent": {
|
||||
"type": "page_id",
|
||||
"page_id": "b4609033-b45a-4fc6-8d15-f06920495ab1"
|
||||
},
|
||||
"discussion_id": "81530ca2-4afa-44c0-b298-7fab0a72b563",
|
||||
"created_time": "2023-02-27T13:00:00.000Z",
|
||||
"last_edited_time": "2023-02-27T13:00:00.000Z",
|
||||
"created_by": {
|
||||
"object": "user",
|
||||
"id": "bcd4bb6e-7cb4-4e04-8609-10744a579644"
|
||||
},
|
||||
"rich_text": [
|
||||
{
|
||||
"type": "text",
|
||||
"text": {
|
||||
"content": "Hello world",
|
||||
"link": null
|
||||
},
|
||||
"annotations": {
|
||||
"bold": false,
|
||||
"italic": false,
|
||||
"strikethrough": false,
|
||||
"underline": false,
|
||||
"code": false,
|
||||
"color": "default"
|
||||
},
|
||||
"plain_text": "Hello world",
|
||||
"href": null
|
||||
}
|
||||
]
|
||||
}
|
||||
],
|
||||
"next_cursor": null,
|
||||
"has_more": false,
|
||||
"type": "comment",
|
||||
"comment": {}
|
||||
},
|
||||
"rawHeaders": [
|
||||
"Date",
|
||||
"Mon, 27 Feb 2023 13:00:58 GMT",
|
||||
"Content-Type",
|
||||
"application/json; charset=utf-8",
|
||||
"Transfer-Encoding",
|
||||
"chunked",
|
||||
"Connection",
|
||||
"close",
|
||||
"Set-Cookie",
|
||||
"notion_browser_id=c81c8597-3ce1-47c0-8534-3d082e8bad6c; Domain=www.notion.so; Path=/; Expires=Tue, 27 Feb 2024 13:00:58 GMT; Secure",
|
||||
"Content-Security-Policy",
|
||||
"script-src 'self' 'unsafe-inline' 'unsafe-eval' https://gist.github.com https://apis.google.com https://www.google.com https://www.gstatic.com https://cdn.amplitude.com https://api.amplitude.com http://dev-embed.notion.co http://embed.notion.co https://widget.intercom.io https://js.intercomcdn.com https://static.zdassets.com https://api.smooch.io\t https://logs-01.loggly.com https://http-inputs-notion.splunkcloud.com https://cdn.segment.com https://analytics.pgncs.notion.so https://o324374.ingest.sentry.io https://checkout.stripe.com https://js.stripe.com https://embed.typeform.com https://admin.typeform.com https://public.profitwell.com https://static.profitwell.com js.sentry-cdn.com https://js.chilipiper.com https://platform.twitter.com https://cdn.syndication.twimg.com https://accounts.google.com https://www.googletagmanager.com https://www.googleadservices.com https://googleads.g.doubleclick.net https://api-v2.mutinyhq.io https://client-registry.mutinycdn.com https://client.mutinycdn.com https://user-data.mutinycdn.com https://cdn.metadata.io https://platformapi.metadata.io https://d2hrivdxn8ekm8.cloudfront.net https://d1lu3pmaz2ilpx.cloudfront.net https://dvqigh9b7wa32.cloudfront.net https://d330aiyvva2oww.cloudfront.net https://cdn.transcend.io https://cdn01.boxcdn.net https://cdn.sprig.com assets.customer.io code.gist.build;connect-src 'self' data: blob: https://msgstore.www.notion.so wss://msgstore.www.notion.so ws://localhost:* ws://127.0.0.1:* https://notion-emojis.s3-us-west-2.amazonaws.com https://s3-us-west-2.amazonaws.com https://s3.us-west-2.amazonaws.com https://notion-production-snapshots-2.s3.us-west-2.amazonaws.com https://cdn.amplitude.com https://api.amplitude.com https://www.notion.so https://api.embed.ly http://dev-embed.notion.co http://embed.notion.co https://js.intercomcdn.com https://api-iam.intercom.io https://uploads.intercomcdn.com wss://nexus-websocket-a.intercom.io https://ekr.zdassets.com https://ekr.zendesk.com\t https://makenotion.zendesk.com\t https://api.smooch.io\t wss://api.smooch.io\t https://logs-01.loggly.com https://http-inputs-notion.splunkcloud.com https://cdn.segment.com https://api.segment.io https://analytics.pgncs.notion.so https://api.pgncs.notion.so https://o324374.ingest.sentry.io https://checkout.stripe.com https://js.stripe.com https://cdn.contentful.com https://preview.contentful.com https://images.ctfassets.net https://www2.profitwell.com https://tracking.chilipiper.com https://api.chilipiper.com https://api.unsplash.com https://boards-api.greenhouse.io https://accounts.google.com https://oauth2.googleapis.com https://www.googletagmanager.com https://analytics.google.com https://www.googleadservices.com https://googleads.g.doubleclick.net https://region1.google-analytics.com https://region1.analytics.google.com https://www.google-analytics.com https://api-v2.mutinyhq.io https://client-registry.mutinycdn.com https://client.mutinycdn.com https://user-data.mutinycdn.com https://cdn.metadata.io https://platformapi.metadata.io https://d2hrivdxn8ekm8.cloudfront.net https://d1lu3pmaz2ilpx.cloudfront.net https://dvqigh9b7wa32.cloudfront.net https://d330aiyvva2oww.cloudfront.net https://cdn.transcend.io https://telemetry.transcend.io https://api.statuspage.io https://pgncd.notion.so https://api.statsig.com https://statsigapi.net https://exp.notion.so https://file.notion.so notion://file.notion.so https://api.box.com https://*.mux.com https://api.sprig.com https://storage.googleapis.com https://cdn.sprig.com https://cdn.userleap.com track.customer.io *.api.gist.build *.cloud.gist.build;font-src 'self' data: https://cdnjs.cloudflare.com https://js.intercomcdn.com https://cdn01.boxcdn.net;img-src 'self' data: blob: https: https://platform.twitter.com https://syndication.twitter.com https://pbs.twimg.com https://ton.twimg.com https://region1.google-analytics.com https://region1.analytics.google.com https://file.notion.so notion://file.notion.so https://*.mux.com track.customer.io;style-src 'self' 'unsafe-inline' https://cdnjs.cloudflare.com https://github.githubassets.com https://js.chilipiper.com https://platform.twitter.com https://ton.twimg.com https://accounts.google.com https://cdn.transcend.io https://cdn01.boxcdn.net code.gist.build;media-src blob: https: http: https://file.notion.so notion://file.notion.so https://*.mux.com;worker-src blob:;frame-src https: http: https://accounts.google.com renderer.gist.build code.gist.build",
|
||||
"X-DNS-Prefetch-Control",
|
||||
"off",
|
||||
"X-Frame-Options",
|
||||
"SAMEORIGIN",
|
||||
"Strict-Transport-Security",
|
||||
"max-age=5184000; includeSubDomains",
|
||||
"X-Download-Options",
|
||||
"noopen",
|
||||
"X-Content-Type-Options",
|
||||
"nosniff",
|
||||
"X-Permitted-Cross-Domain-Policies",
|
||||
"none",
|
||||
"Referrer-Policy",
|
||||
"strict-origin-when-cross-origin",
|
||||
"X-XSS-Protection",
|
||||
"0",
|
||||
"ETag",
|
||||
"W/\"2ac-O+0+EDR87lnud1uk0Nv98XVEwRE\"",
|
||||
"Vary",
|
||||
"Accept-Encoding",
|
||||
"CF-Cache-Status",
|
||||
"DYNAMIC",
|
||||
"Set-Cookie",
|
||||
"notion_check_cookie_consent=true; Domain=www.notion.so; Path=/; Expires=Tue, 28 Feb 2023 13:00:58 GMT; Secure",
|
||||
"Set-Cookie",
|
||||
"__cf_bm=SZWrmwDFWsjiBWbj0XSJiw.u3NWFS5JHraec1hFlXTU-1677502858-0-AceoZDX4TcA2W/fyWOdl8ZvCnFibpJWx8CF8vLabqtJQK1ZqHHYc5yitwJd6ylJC1pCsnGxwqDtKKPSThXMs5Hc=; path=/; expires=Mon, 27-Feb-23 13:30:58 GMT; domain=.notion.com; HttpOnly; Secure; SameSite=None",
|
||||
"Server",
|
||||
"cloudflare"
|
||||
],
|
||||
"responseIsBinary": false
|
||||
}
|
||||
]
|
||||
@@ -0,0 +1,164 @@
|
||||
[
|
||||
{
|
||||
"scope": "https://api.notion.com:443",
|
||||
"method": "GET",
|
||||
"path": "/v1/databases/0fadc732-4472-418c-83dc-04454332cb52",
|
||||
"body": "",
|
||||
"status": 200,
|
||||
"response": {
|
||||
"object": "database",
|
||||
"id": "0fadc732-4472-418c-83dc-04454332cb52",
|
||||
"cover": null,
|
||||
"icon": {
|
||||
"type": "emoji",
|
||||
"emoji": "📓"
|
||||
},
|
||||
"created_time": "2023-02-24T19:07:00.000Z",
|
||||
"created_by": {
|
||||
"object": "user",
|
||||
"id": "cc18a80a-973f-42c4-8fed-a055f8ae31f4"
|
||||
},
|
||||
"last_edited_by": {
|
||||
"object": "user",
|
||||
"id": "cc18a80a-973f-42c4-8fed-a055f8ae31f4"
|
||||
},
|
||||
"last_edited_time": "2023-02-24T19:09:00.000Z",
|
||||
"title": [
|
||||
{
|
||||
"type": "text",
|
||||
"text": {
|
||||
"content": "Journal",
|
||||
"link": null
|
||||
},
|
||||
"annotations": {
|
||||
"bold": false,
|
||||
"italic": false,
|
||||
"strikethrough": false,
|
||||
"underline": false,
|
||||
"code": false,
|
||||
"color": "default"
|
||||
},
|
||||
"plain_text": "Journal",
|
||||
"href": null
|
||||
}
|
||||
],
|
||||
"description": [
|
||||
{
|
||||
"type": "text",
|
||||
"text": {
|
||||
"content": "Document your life - daily happenings, special occasions, and reflections on your goals.\nCategorize entries with tags and automatically capture the date.\n\n↓ Click through the different database tabs to filter entries by a specific category such as daily or personal.",
|
||||
"link": null
|
||||
},
|
||||
"annotations": {
|
||||
"bold": false,
|
||||
"italic": false,
|
||||
"strikethrough": false,
|
||||
"underline": false,
|
||||
"code": false,
|
||||
"color": "default"
|
||||
},
|
||||
"plain_text": "Document your life - daily happenings, special occasions, and reflections on your goals.\nCategorize entries with tags and automatically capture the date.\n\n↓ Click through the different database tabs to filter entries by a specific category such as daily or personal.",
|
||||
"href": null
|
||||
}
|
||||
],
|
||||
"is_inline": false,
|
||||
"properties": {
|
||||
"Tags": {
|
||||
"id": "!'(w",
|
||||
"name": "Tags",
|
||||
"type": "multi_select",
|
||||
"multi_select": {
|
||||
"options": [
|
||||
{
|
||||
"id": "4322f3ac-635f-4d2f-808f-22d639bc393b",
|
||||
"name": "Daily",
|
||||
"color": "purple"
|
||||
},
|
||||
{
|
||||
"id": "00a58cba-c800-40cd-a8f1-6e42527b0a29",
|
||||
"name": "Special Event",
|
||||
"color": "yellow"
|
||||
},
|
||||
{
|
||||
"id": "f4cf83a1-4b72-494e-bbc7-4a3c5cbaca4e",
|
||||
"name": "Work",
|
||||
"color": "blue"
|
||||
},
|
||||
{
|
||||
"id": "b28c7f82-f6e4-4a72-a790-78585e7ead7e",
|
||||
"name": "Personal",
|
||||
"color": "red"
|
||||
},
|
||||
{
|
||||
"id": "7973659c-e670-44c5-95bd-ee8bea4410fe",
|
||||
"name": "Planning",
|
||||
"color": "orange"
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
"Created": {
|
||||
"id": "%7D%25j%7B",
|
||||
"name": "Created",
|
||||
"type": "created_time",
|
||||
"created_time": {}
|
||||
},
|
||||
"Name": {
|
||||
"id": "title",
|
||||
"name": "Name",
|
||||
"type": "title",
|
||||
"title": {}
|
||||
}
|
||||
},
|
||||
"parent": {
|
||||
"type": "workspace",
|
||||
"workspace": true
|
||||
},
|
||||
"url": "https://www.notion.so/0fadc7324472418c83dc04454332cb52",
|
||||
"archived": false
|
||||
},
|
||||
"rawHeaders": [
|
||||
"Date",
|
||||
"Mon, 27 Feb 2023 11:31:56 GMT",
|
||||
"Content-Type",
|
||||
"application/json; charset=utf-8",
|
||||
"Transfer-Encoding",
|
||||
"chunked",
|
||||
"Connection",
|
||||
"close",
|
||||
"Set-Cookie",
|
||||
"notion_browser_id=b02dceea-7410-4b8b-9953-39e385a6602f; Domain=www.notion.so; Path=/; Expires=Tue, 27 Feb 2024 11:31:56 GMT; Secure",
|
||||
"Content-Security-Policy",
|
||||
"script-src 'self' 'unsafe-inline' 'unsafe-eval' https://gist.github.com https://apis.google.com https://www.google.com https://www.gstatic.com https://cdn.amplitude.com https://api.amplitude.com http://dev-embed.notion.co http://embed.notion.co https://widget.intercom.io https://js.intercomcdn.com https://static.zdassets.com https://api.smooch.io\t https://logs-01.loggly.com https://http-inputs-notion.splunkcloud.com https://cdn.segment.com https://analytics.pgncs.notion.so https://o324374.ingest.sentry.io https://checkout.stripe.com https://js.stripe.com https://embed.typeform.com https://admin.typeform.com https://public.profitwell.com https://static.profitwell.com js.sentry-cdn.com https://js.chilipiper.com https://platform.twitter.com https://cdn.syndication.twimg.com https://accounts.google.com https://www.googletagmanager.com https://www.googleadservices.com https://googleads.g.doubleclick.net https://api-v2.mutinyhq.io https://client-registry.mutinycdn.com https://client.mutinycdn.com https://user-data.mutinycdn.com https://cdn.metadata.io https://platformapi.metadata.io https://d2hrivdxn8ekm8.cloudfront.net https://d1lu3pmaz2ilpx.cloudfront.net https://dvqigh9b7wa32.cloudfront.net https://d330aiyvva2oww.cloudfront.net https://cdn.transcend.io https://cdn01.boxcdn.net https://cdn.sprig.com assets.customer.io code.gist.build;connect-src 'self' data: blob: https://msgstore.www.notion.so wss://msgstore.www.notion.so ws://localhost:* ws://127.0.0.1:* https://notion-emojis.s3-us-west-2.amazonaws.com https://s3-us-west-2.amazonaws.com https://s3.us-west-2.amazonaws.com https://notion-production-snapshots-2.s3.us-west-2.amazonaws.com https://cdn.amplitude.com https://api.amplitude.com https://www.notion.so https://api.embed.ly http://dev-embed.notion.co http://embed.notion.co https://js.intercomcdn.com https://api-iam.intercom.io https://uploads.intercomcdn.com wss://nexus-websocket-a.intercom.io https://ekr.zdassets.com https://ekr.zendesk.com\t https://makenotion.zendesk.com\t https://api.smooch.io\t wss://api.smooch.io\t https://logs-01.loggly.com https://http-inputs-notion.splunkcloud.com https://cdn.segment.com https://api.segment.io https://analytics.pgncs.notion.so https://api.pgncs.notion.so https://o324374.ingest.sentry.io https://checkout.stripe.com https://js.stripe.com https://cdn.contentful.com https://preview.contentful.com https://images.ctfassets.net https://www2.profitwell.com https://tracking.chilipiper.com https://api.chilipiper.com https://api.unsplash.com https://boards-api.greenhouse.io https://accounts.google.com https://oauth2.googleapis.com https://www.googletagmanager.com https://analytics.google.com https://www.googleadservices.com https://googleads.g.doubleclick.net https://region1.google-analytics.com https://region1.analytics.google.com https://www.google-analytics.com https://api-v2.mutinyhq.io https://client-registry.mutinycdn.com https://client.mutinycdn.com https://user-data.mutinycdn.com https://cdn.metadata.io https://platformapi.metadata.io https://d2hrivdxn8ekm8.cloudfront.net https://d1lu3pmaz2ilpx.cloudfront.net https://dvqigh9b7wa32.cloudfront.net https://d330aiyvva2oww.cloudfront.net https://cdn.transcend.io https://telemetry.transcend.io https://api.statuspage.io https://pgncd.notion.so https://api.statsig.com https://statsigapi.net https://exp.notion.so https://file.notion.so notion://file.notion.so https://api.box.com https://*.mux.com https://api.sprig.com https://storage.googleapis.com https://cdn.sprig.com https://cdn.userleap.com track.customer.io *.api.gist.build *.cloud.gist.build;font-src 'self' data: https://cdnjs.cloudflare.com https://js.intercomcdn.com https://cdn01.boxcdn.net;img-src 'self' data: blob: https: https://platform.twitter.com https://syndication.twitter.com https://pbs.twimg.com https://ton.twimg.com https://region1.google-analytics.com https://region1.analytics.google.com https://file.notion.so notion://file.notion.so https://*.mux.com track.customer.io;style-src 'self' 'unsafe-inline' https://cdnjs.cloudflare.com https://github.githubassets.com https://js.chilipiper.com https://platform.twitter.com https://ton.twimg.com https://accounts.google.com https://cdn.transcend.io https://cdn01.boxcdn.net code.gist.build;media-src blob: https: http: https://file.notion.so notion://file.notion.so https://*.mux.com;worker-src blob:;frame-src https: http: https://accounts.google.com renderer.gist.build code.gist.build",
|
||||
"X-DNS-Prefetch-Control",
|
||||
"off",
|
||||
"X-Frame-Options",
|
||||
"SAMEORIGIN",
|
||||
"Strict-Transport-Security",
|
||||
"max-age=5184000; includeSubDomains",
|
||||
"X-Download-Options",
|
||||
"noopen",
|
||||
"X-Content-Type-Options",
|
||||
"nosniff",
|
||||
"X-Permitted-Cross-Domain-Policies",
|
||||
"none",
|
||||
"Referrer-Policy",
|
||||
"strict-origin-when-cross-origin",
|
||||
"X-XSS-Protection",
|
||||
"0",
|
||||
"ETag",
|
||||
"W/\"848-0VcVJU20PQNFJSOeYVumjc5lRqY\"",
|
||||
"Vary",
|
||||
"Accept-Encoding",
|
||||
"CF-Cache-Status",
|
||||
"DYNAMIC",
|
||||
"Set-Cookie",
|
||||
"notion_check_cookie_consent=true; Domain=www.notion.so; Path=/; Expires=Tue, 28 Feb 2023 11:31:56 GMT; Secure",
|
||||
"Set-Cookie",
|
||||
"__cf_bm=uuQBm38FV5ll_bzRt2ubDw9OzPXYBeijloNaM81LTJU-1677497516-0-AfW2IE7SMS9u4DCuJo99WPCqCycUNmDB75jASkaVcuA5lfUjhFko1coulGCEfqctYOnwFGsTRXkTUmhyigS0rIc=; path=/; expires=Mon, 27-Feb-23 12:01:56 GMT; domain=.notion.com; HttpOnly; Secure; SameSite=None",
|
||||
"Server",
|
||||
"cloudflare"
|
||||
],
|
||||
"responseIsBinary": false
|
||||
}
|
||||
]
|
||||
@@ -0,0 +1,107 @@
|
||||
[
|
||||
{
|
||||
"scope": "https://api.notion.com:443",
|
||||
"method": "GET",
|
||||
"path": "/v1/pages/b4609033-b45a-4fc6-8d15-f06920495ab1",
|
||||
"body": "",
|
||||
"status": 200,
|
||||
"response": {
|
||||
"object": "page",
|
||||
"id": "b4609033-b45a-4fc6-8d15-f06920495ab1",
|
||||
"created_time": "2023-02-24T19:07:00.000Z",
|
||||
"last_edited_time": "2023-02-24T19:09:00.000Z",
|
||||
"created_by": {
|
||||
"object": "user",
|
||||
"id": "cc18a80a-973f-42c4-8fed-a055f8ae31f4"
|
||||
},
|
||||
"last_edited_by": {
|
||||
"object": "user",
|
||||
"id": "cc18a80a-973f-42c4-8fed-a055f8ae31f4"
|
||||
},
|
||||
"cover": {
|
||||
"type": "external",
|
||||
"external": {
|
||||
"url": "https://www.notion.so/images/page-cover/met_horace_pippin.jpg"
|
||||
}
|
||||
},
|
||||
"icon": {
|
||||
"type": "emoji",
|
||||
"emoji": "🏡"
|
||||
},
|
||||
"parent": {
|
||||
"type": "workspace",
|
||||
"workspace": true
|
||||
},
|
||||
"archived": false,
|
||||
"properties": {
|
||||
"title": {
|
||||
"id": "title",
|
||||
"type": "title",
|
||||
"title": [
|
||||
{
|
||||
"type": "text",
|
||||
"text": {
|
||||
"content": "Personal Home",
|
||||
"link": null
|
||||
},
|
||||
"annotations": {
|
||||
"bold": false,
|
||||
"italic": false,
|
||||
"strikethrough": false,
|
||||
"underline": false,
|
||||
"code": false,
|
||||
"color": "default"
|
||||
},
|
||||
"plain_text": "Personal Home",
|
||||
"href": null
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
"url": "https://www.notion.so/Personal-Home-b4609033b45a4fc68d15f06920495ab1"
|
||||
},
|
||||
"rawHeaders": [
|
||||
"Date",
|
||||
"Sun, 26 Feb 2023 17:03:49 GMT",
|
||||
"Content-Type",
|
||||
"application/json; charset=utf-8",
|
||||
"Transfer-Encoding",
|
||||
"chunked",
|
||||
"Connection",
|
||||
"close",
|
||||
"Set-Cookie",
|
||||
"notion_browser_id=837961ad-d90a-4d47-a6f1-ef58202dc051; Domain=www.notion.so; Path=/; Expires=Mon, 26 Feb 2024 17:03:49 GMT; Secure",
|
||||
"Content-Security-Policy",
|
||||
"script-src 'self' 'unsafe-inline' 'unsafe-eval' https://gist.github.com https://apis.google.com https://www.google.com https://www.gstatic.com https://cdn.amplitude.com https://api.amplitude.com http://dev-embed.notion.co http://embed.notion.co https://widget.intercom.io https://js.intercomcdn.com https://static.zdassets.com https://api.smooch.io\t https://logs-01.loggly.com https://http-inputs-notion.splunkcloud.com https://cdn.segment.com https://analytics.pgncs.notion.so https://o324374.ingest.sentry.io https://checkout.stripe.com https://js.stripe.com https://embed.typeform.com https://admin.typeform.com https://public.profitwell.com https://static.profitwell.com js.sentry-cdn.com https://js.chilipiper.com https://platform.twitter.com https://cdn.syndication.twimg.com https://accounts.google.com https://www.googletagmanager.com https://www.googleadservices.com https://googleads.g.doubleclick.net https://api-v2.mutinyhq.io https://client-registry.mutinycdn.com https://client.mutinycdn.com https://user-data.mutinycdn.com https://cdn.metadata.io https://platformapi.metadata.io https://d2hrivdxn8ekm8.cloudfront.net https://d1lu3pmaz2ilpx.cloudfront.net https://dvqigh9b7wa32.cloudfront.net https://d330aiyvva2oww.cloudfront.net https://cdn.transcend.io https://cdn01.boxcdn.net https://cdn.sprig.com assets.customer.io code.gist.build;connect-src 'self' data: blob: https://msgstore.www.notion.so wss://msgstore.www.notion.so ws://localhost:* ws://127.0.0.1:* https://notion-emojis.s3-us-west-2.amazonaws.com https://s3-us-west-2.amazonaws.com https://s3.us-west-2.amazonaws.com https://notion-production-snapshots-2.s3.us-west-2.amazonaws.com https://cdn.amplitude.com https://api.amplitude.com https://www.notion.so https://api.embed.ly http://dev-embed.notion.co http://embed.notion.co https://js.intercomcdn.com https://api-iam.intercom.io https://uploads.intercomcdn.com wss://nexus-websocket-a.intercom.io https://ekr.zdassets.com https://ekr.zendesk.com\t https://makenotion.zendesk.com\t https://api.smooch.io\t wss://api.smooch.io\t https://logs-01.loggly.com https://http-inputs-notion.splunkcloud.com https://cdn.segment.com https://api.segment.io https://analytics.pgncs.notion.so https://api.pgncs.notion.so https://o324374.ingest.sentry.io https://checkout.stripe.com https://js.stripe.com https://cdn.contentful.com https://preview.contentful.com https://images.ctfassets.net https://www2.profitwell.com https://tracking.chilipiper.com https://api.chilipiper.com https://api.unsplash.com https://boards-api.greenhouse.io https://accounts.google.com https://oauth2.googleapis.com https://www.googletagmanager.com https://analytics.google.com https://www.googleadservices.com https://googleads.g.doubleclick.net https://region1.google-analytics.com https://region1.analytics.google.com https://www.google-analytics.com https://api-v2.mutinyhq.io https://client-registry.mutinycdn.com https://client.mutinycdn.com https://user-data.mutinycdn.com https://cdn.metadata.io https://platformapi.metadata.io https://d2hrivdxn8ekm8.cloudfront.net https://d1lu3pmaz2ilpx.cloudfront.net https://dvqigh9b7wa32.cloudfront.net https://d330aiyvva2oww.cloudfront.net https://cdn.transcend.io https://telemetry.transcend.io https://api.statuspage.io https://pgncd.notion.so https://api.statsig.com https://statsigapi.net https://exp.notion.so https://file.notion.so notion://file.notion.so https://api.box.com https://*.mux.com https://api.sprig.com https://storage.googleapis.com https://cdn.sprig.com https://cdn.userleap.com track.customer.io *.api.gist.build *.cloud.gist.build;font-src 'self' data: https://cdnjs.cloudflare.com https://js.intercomcdn.com https://cdn01.boxcdn.net;img-src 'self' data: blob: https: https://platform.twitter.com https://syndication.twitter.com https://pbs.twimg.com https://ton.twimg.com https://region1.google-analytics.com https://region1.analytics.google.com https://file.notion.so notion://file.notion.so https://*.mux.com track.customer.io;style-src 'self' 'unsafe-inline' https://cdnjs.cloudflare.com https://github.githubassets.com https://js.chilipiper.com https://platform.twitter.com https://ton.twimg.com https://accounts.google.com https://cdn.transcend.io https://cdn01.boxcdn.net code.gist.build;media-src blob: https: http: https://file.notion.so notion://file.notion.so https://*.mux.com;worker-src blob:;frame-src https: http: https://accounts.google.com renderer.gist.build code.gist.build",
|
||||
"X-DNS-Prefetch-Control",
|
||||
"off",
|
||||
"X-Frame-Options",
|
||||
"SAMEORIGIN",
|
||||
"Strict-Transport-Security",
|
||||
"max-age=5184000; includeSubDomains",
|
||||
"X-Download-Options",
|
||||
"noopen",
|
||||
"X-Content-Type-Options",
|
||||
"nosniff",
|
||||
"X-Permitted-Cross-Domain-Policies",
|
||||
"none",
|
||||
"Referrer-Policy",
|
||||
"strict-origin-when-cross-origin",
|
||||
"X-XSS-Protection",
|
||||
"0",
|
||||
"ETag",
|
||||
"W/\"36c-te9LAYsMgFb2lhvFvIZkYRlpBwU\"",
|
||||
"Vary",
|
||||
"Accept-Encoding",
|
||||
"CF-Cache-Status",
|
||||
"DYNAMIC",
|
||||
"Set-Cookie",
|
||||
"notion_check_cookie_consent=true; Domain=www.notion.so; Path=/; Expires=Mon, 27 Feb 2023 17:03:49 GMT; Secure",
|
||||
"Set-Cookie",
|
||||
"__cf_bm=c4loqDfzCMnR_nUxqp_cUN9b64H5.AYvYzoiD2k3Dys-1677431029-0-AdU9UH0qjksRe8fwh1fJEjKmMC1iLs8At3ExpapYqTIt2++8Ygcgg/6mhzD8rEvFPpWIDSDdfXLmwEWtH2uWfPI=; path=/; expires=Sun, 26-Feb-23 17:33:49 GMT; domain=.notion.com; HttpOnly; Secure; SameSite=None",
|
||||
"Server",
|
||||
"cloudflare"
|
||||
],
|
||||
"responseIsBinary": false
|
||||
}
|
||||
]
|
||||
@@ -0,0 +1,62 @@
|
||||
[
|
||||
{
|
||||
"scope": "https://api.notion.com:443",
|
||||
"method": "GET",
|
||||
"path": "/v1/users/cc18a80a-973f-42c4-8fed-a055f8ae31f4",
|
||||
"body": "",
|
||||
"status": 200,
|
||||
"response": {
|
||||
"object": "user",
|
||||
"id": "cc18a80a-973f-42c4-8fed-a055f8ae31f4",
|
||||
"name": "Matt Aitken",
|
||||
"avatar_url": "https://s3-us-west-2.amazonaws.com/public.notion-static.com/0ccadce7-a4aa-4a69-92e6-2ac708593613/matt-wedding.jpg",
|
||||
"type": "person",
|
||||
"person": {
|
||||
"email": "matt@apihero.run"
|
||||
}
|
||||
},
|
||||
"rawHeaders": [
|
||||
"Date",
|
||||
"Sun, 26 Feb 2023 17:03:48 GMT",
|
||||
"Content-Type",
|
||||
"application/json; charset=utf-8",
|
||||
"Transfer-Encoding",
|
||||
"chunked",
|
||||
"Connection",
|
||||
"close",
|
||||
"Set-Cookie",
|
||||
"notion_browser_id=7a2dbb41-36d9-4105-a02e-5d48c2b39738; Domain=www.notion.so; Path=/; Expires=Mon, 26 Feb 2024 17:03:48 GMT; Secure",
|
||||
"Content-Security-Policy",
|
||||
"script-src 'self' 'unsafe-inline' 'unsafe-eval' https://gist.github.com https://apis.google.com https://www.google.com https://www.gstatic.com https://cdn.amplitude.com https://api.amplitude.com http://dev-embed.notion.co http://embed.notion.co https://widget.intercom.io https://js.intercomcdn.com https://static.zdassets.com https://api.smooch.io\t https://logs-01.loggly.com https://http-inputs-notion.splunkcloud.com https://cdn.segment.com https://analytics.pgncs.notion.so https://o324374.ingest.sentry.io https://checkout.stripe.com https://js.stripe.com https://embed.typeform.com https://admin.typeform.com https://public.profitwell.com https://static.profitwell.com js.sentry-cdn.com https://js.chilipiper.com https://platform.twitter.com https://cdn.syndication.twimg.com https://accounts.google.com https://www.googletagmanager.com https://www.googleadservices.com https://googleads.g.doubleclick.net https://api-v2.mutinyhq.io https://client-registry.mutinycdn.com https://client.mutinycdn.com https://user-data.mutinycdn.com https://cdn.metadata.io https://platformapi.metadata.io https://d2hrivdxn8ekm8.cloudfront.net https://d1lu3pmaz2ilpx.cloudfront.net https://dvqigh9b7wa32.cloudfront.net https://d330aiyvva2oww.cloudfront.net https://cdn.transcend.io https://cdn01.boxcdn.net https://cdn.sprig.com assets.customer.io code.gist.build;connect-src 'self' data: blob: https://msgstore.www.notion.so wss://msgstore.www.notion.so ws://localhost:* ws://127.0.0.1:* https://notion-emojis.s3-us-west-2.amazonaws.com https://s3-us-west-2.amazonaws.com https://s3.us-west-2.amazonaws.com https://notion-production-snapshots-2.s3.us-west-2.amazonaws.com https://cdn.amplitude.com https://api.amplitude.com https://www.notion.so https://api.embed.ly http://dev-embed.notion.co http://embed.notion.co https://js.intercomcdn.com https://api-iam.intercom.io https://uploads.intercomcdn.com wss://nexus-websocket-a.intercom.io https://ekr.zdassets.com https://ekr.zendesk.com\t https://makenotion.zendesk.com\t https://api.smooch.io\t wss://api.smooch.io\t https://logs-01.loggly.com https://http-inputs-notion.splunkcloud.com https://cdn.segment.com https://api.segment.io https://analytics.pgncs.notion.so https://api.pgncs.notion.so https://o324374.ingest.sentry.io https://checkout.stripe.com https://js.stripe.com https://cdn.contentful.com https://preview.contentful.com https://images.ctfassets.net https://www2.profitwell.com https://tracking.chilipiper.com https://api.chilipiper.com https://api.unsplash.com https://boards-api.greenhouse.io https://accounts.google.com https://oauth2.googleapis.com https://www.googletagmanager.com https://analytics.google.com https://www.googleadservices.com https://googleads.g.doubleclick.net https://region1.google-analytics.com https://region1.analytics.google.com https://www.google-analytics.com https://api-v2.mutinyhq.io https://client-registry.mutinycdn.com https://client.mutinycdn.com https://user-data.mutinycdn.com https://cdn.metadata.io https://platformapi.metadata.io https://d2hrivdxn8ekm8.cloudfront.net https://d1lu3pmaz2ilpx.cloudfront.net https://dvqigh9b7wa32.cloudfront.net https://d330aiyvva2oww.cloudfront.net https://cdn.transcend.io https://telemetry.transcend.io https://api.statuspage.io https://pgncd.notion.so https://api.statsig.com https://statsigapi.net https://exp.notion.so https://file.notion.so notion://file.notion.so https://api.box.com https://*.mux.com https://api.sprig.com https://storage.googleapis.com https://cdn.sprig.com https://cdn.userleap.com track.customer.io *.api.gist.build *.cloud.gist.build;font-src 'self' data: https://cdnjs.cloudflare.com https://js.intercomcdn.com https://cdn01.boxcdn.net;img-src 'self' data: blob: https: https://platform.twitter.com https://syndication.twitter.com https://pbs.twimg.com https://ton.twimg.com https://region1.google-analytics.com https://region1.analytics.google.com https://file.notion.so notion://file.notion.so https://*.mux.com track.customer.io;style-src 'self' 'unsafe-inline' https://cdnjs.cloudflare.com https://github.githubassets.com https://js.chilipiper.com https://platform.twitter.com https://ton.twimg.com https://accounts.google.com https://cdn.transcend.io https://cdn01.boxcdn.net code.gist.build;media-src blob: https: http: https://file.notion.so notion://file.notion.so https://*.mux.com;worker-src blob:;frame-src https: http: https://accounts.google.com renderer.gist.build code.gist.build",
|
||||
"X-DNS-Prefetch-Control",
|
||||
"off",
|
||||
"X-Frame-Options",
|
||||
"SAMEORIGIN",
|
||||
"Strict-Transport-Security",
|
||||
"max-age=5184000; includeSubDomains",
|
||||
"X-Download-Options",
|
||||
"noopen",
|
||||
"X-Content-Type-Options",
|
||||
"nosniff",
|
||||
"X-Permitted-Cross-Domain-Policies",
|
||||
"none",
|
||||
"Referrer-Policy",
|
||||
"strict-origin-when-cross-origin",
|
||||
"X-XSS-Protection",
|
||||
"0",
|
||||
"ETag",
|
||||
"W/\"109-LARZeHVPyOZD6oYu0o3lE/OaSIY\"",
|
||||
"Vary",
|
||||
"Accept-Encoding",
|
||||
"CF-Cache-Status",
|
||||
"DYNAMIC",
|
||||
"Set-Cookie",
|
||||
"notion_check_cookie_consent=true; Domain=www.notion.so; Path=/; Expires=Mon, 27 Feb 2023 17:03:48 GMT; Secure",
|
||||
"Set-Cookie",
|
||||
"__cf_bm=.LPcUVtRskZYeQnmoXm3JleuCDBhDy5xttc1bB0ZAhU-1677431028-0-AZgnltB964z4cce5vJuH+ZKp7AA28R96OldVDfor3Gmp8BNHTuPud15UN9TMND7J18fL9Jeu1QBOsPuTBwuINGc=; path=/; expires=Sun, 26-Feb-23 17:33:48 GMT; domain=.notion.com; HttpOnly; Secure; SameSite=None",
|
||||
"Server",
|
||||
"cloudflare"
|
||||
],
|
||||
"responseIsBinary": false
|
||||
}
|
||||
]
|
||||
@@ -0,0 +1,94 @@
|
||||
[
|
||||
{
|
||||
"scope": "https://api.notion.com:443",
|
||||
"method": "GET",
|
||||
"path": "/v1/users",
|
||||
"body": "",
|
||||
"status": 200,
|
||||
"response": {
|
||||
"object": "list",
|
||||
"results": [
|
||||
{
|
||||
"object": "user",
|
||||
"id": "cc18a80a-973f-42c4-8fed-a055f8ae31f4",
|
||||
"name": "Matt Aitken",
|
||||
"avatar_url": "https://s3-us-west-2.amazonaws.com/public.notion-static.com/0ccadce7-a4aa-4a69-92e6-2ac708593613/matt-wedding.jpg",
|
||||
"type": "person",
|
||||
"person": {
|
||||
"email": "matt@apihero.run"
|
||||
}
|
||||
},
|
||||
{
|
||||
"object": "user",
|
||||
"id": "bcd4bb6e-7cb4-4e04-8609-10744a579644",
|
||||
"name": "Trigger.dev (localhost)",
|
||||
"avatar_url": "https://s3-us-west-2.amazonaws.com/public.notion-static.com/b374368f-9f41-460a-bf8e-5e19f8fb0e07/td-square-logo_512.png",
|
||||
"type": "bot",
|
||||
"bot": {
|
||||
"owner": {
|
||||
"type": "user",
|
||||
"user": {
|
||||
"object": "user",
|
||||
"id": "cc18a80a-973f-42c4-8fed-a055f8ae31f4",
|
||||
"name": "Matt Aitken",
|
||||
"avatar_url": "https://s3-us-west-2.amazonaws.com/public.notion-static.com/0ccadce7-a4aa-4a69-92e6-2ac708593613/matt-wedding.jpg",
|
||||
"type": "person",
|
||||
"person": {
|
||||
"email": "matt@apihero.run"
|
||||
}
|
||||
}
|
||||
},
|
||||
"workspace_name": "Notion integration test workspace"
|
||||
}
|
||||
}
|
||||
],
|
||||
"next_cursor": null,
|
||||
"has_more": false,
|
||||
"type": "user",
|
||||
"user": {}
|
||||
},
|
||||
"rawHeaders": [
|
||||
"Date",
|
||||
"Sun, 26 Feb 2023 17:03:48 GMT",
|
||||
"Content-Type",
|
||||
"application/json; charset=utf-8",
|
||||
"Transfer-Encoding",
|
||||
"chunked",
|
||||
"Connection",
|
||||
"close",
|
||||
"Set-Cookie",
|
||||
"notion_browser_id=3f1b8498-f598-48f5-ae0e-909958b2d1a3; Domain=www.notion.so; Path=/; Expires=Mon, 26 Feb 2024 17:03:48 GMT; Secure",
|
||||
"Content-Security-Policy",
|
||||
"script-src 'self' 'unsafe-inline' 'unsafe-eval' https://gist.github.com https://apis.google.com https://www.google.com https://www.gstatic.com https://cdn.amplitude.com https://api.amplitude.com http://dev-embed.notion.co http://embed.notion.co https://widget.intercom.io https://js.intercomcdn.com https://static.zdassets.com https://api.smooch.io\t https://logs-01.loggly.com https://http-inputs-notion.splunkcloud.com https://cdn.segment.com https://analytics.pgncs.notion.so https://o324374.ingest.sentry.io https://checkout.stripe.com https://js.stripe.com https://embed.typeform.com https://admin.typeform.com https://public.profitwell.com https://static.profitwell.com js.sentry-cdn.com https://js.chilipiper.com https://platform.twitter.com https://cdn.syndication.twimg.com https://accounts.google.com https://www.googletagmanager.com https://www.googleadservices.com https://googleads.g.doubleclick.net https://api-v2.mutinyhq.io https://client-registry.mutinycdn.com https://client.mutinycdn.com https://user-data.mutinycdn.com https://cdn.metadata.io https://platformapi.metadata.io https://d2hrivdxn8ekm8.cloudfront.net https://d1lu3pmaz2ilpx.cloudfront.net https://dvqigh9b7wa32.cloudfront.net https://d330aiyvva2oww.cloudfront.net https://cdn.transcend.io https://cdn01.boxcdn.net https://cdn.sprig.com assets.customer.io code.gist.build;connect-src 'self' data: blob: https://msgstore.www.notion.so wss://msgstore.www.notion.so ws://localhost:* ws://127.0.0.1:* https://notion-emojis.s3-us-west-2.amazonaws.com https://s3-us-west-2.amazonaws.com https://s3.us-west-2.amazonaws.com https://notion-production-snapshots-2.s3.us-west-2.amazonaws.com https://cdn.amplitude.com https://api.amplitude.com https://www.notion.so https://api.embed.ly http://dev-embed.notion.co http://embed.notion.co https://js.intercomcdn.com https://api-iam.intercom.io https://uploads.intercomcdn.com wss://nexus-websocket-a.intercom.io https://ekr.zdassets.com https://ekr.zendesk.com\t https://makenotion.zendesk.com\t https://api.smooch.io\t wss://api.smooch.io\t https://logs-01.loggly.com https://http-inputs-notion.splunkcloud.com https://cdn.segment.com https://api.segment.io https://analytics.pgncs.notion.so https://api.pgncs.notion.so https://o324374.ingest.sentry.io https://checkout.stripe.com https://js.stripe.com https://cdn.contentful.com https://preview.contentful.com https://images.ctfassets.net https://www2.profitwell.com https://tracking.chilipiper.com https://api.chilipiper.com https://api.unsplash.com https://boards-api.greenhouse.io https://accounts.google.com https://oauth2.googleapis.com https://www.googletagmanager.com https://analytics.google.com https://www.googleadservices.com https://googleads.g.doubleclick.net https://region1.google-analytics.com https://region1.analytics.google.com https://www.google-analytics.com https://api-v2.mutinyhq.io https://client-registry.mutinycdn.com https://client.mutinycdn.com https://user-data.mutinycdn.com https://cdn.metadata.io https://platformapi.metadata.io https://d2hrivdxn8ekm8.cloudfront.net https://d1lu3pmaz2ilpx.cloudfront.net https://dvqigh9b7wa32.cloudfront.net https://d330aiyvva2oww.cloudfront.net https://cdn.transcend.io https://telemetry.transcend.io https://api.statuspage.io https://pgncd.notion.so https://api.statsig.com https://statsigapi.net https://exp.notion.so https://file.notion.so notion://file.notion.so https://api.box.com https://*.mux.com https://api.sprig.com https://storage.googleapis.com https://cdn.sprig.com https://cdn.userleap.com track.customer.io *.api.gist.build *.cloud.gist.build;font-src 'self' data: https://cdnjs.cloudflare.com https://js.intercomcdn.com https://cdn01.boxcdn.net;img-src 'self' data: blob: https: https://platform.twitter.com https://syndication.twitter.com https://pbs.twimg.com https://ton.twimg.com https://region1.google-analytics.com https://region1.analytics.google.com https://file.notion.so notion://file.notion.so https://*.mux.com track.customer.io;style-src 'self' 'unsafe-inline' https://cdnjs.cloudflare.com https://github.githubassets.com https://js.chilipiper.com https://platform.twitter.com https://ton.twimg.com https://accounts.google.com https://cdn.transcend.io https://cdn01.boxcdn.net code.gist.build;media-src blob: https: http: https://file.notion.so notion://file.notion.so https://*.mux.com;worker-src blob:;frame-src https: http: https://accounts.google.com renderer.gist.build code.gist.build",
|
||||
"X-DNS-Prefetch-Control",
|
||||
"off",
|
||||
"X-Frame-Options",
|
||||
"SAMEORIGIN",
|
||||
"Strict-Transport-Security",
|
||||
"max-age=5184000; includeSubDomains",
|
||||
"X-Download-Options",
|
||||
"noopen",
|
||||
"X-Content-Type-Options",
|
||||
"nosniff",
|
||||
"X-Permitted-Cross-Domain-Policies",
|
||||
"none",
|
||||
"Referrer-Policy",
|
||||
"strict-origin-when-cross-origin",
|
||||
"X-XSS-Protection",
|
||||
"0",
|
||||
"ETag",
|
||||
"W/\"3bc-ykFfGm633jdplPzsTxjZ4jd6FvI\"",
|
||||
"Vary",
|
||||
"Accept-Encoding",
|
||||
"CF-Cache-Status",
|
||||
"DYNAMIC",
|
||||
"Set-Cookie",
|
||||
"notion_check_cookie_consent=true; Domain=www.notion.so; Path=/; Expires=Mon, 27 Feb 2023 17:03:48 GMT; Secure",
|
||||
"Set-Cookie",
|
||||
"__cf_bm=JUbz0XQ9i6zPhxS0oIlWs64OPfsdvZRqasIXF2JnDbQ-1677431028-0-AVLucbFsDItX1PIHDRVIsLNIprkWZAJwGX7lOZsK48xoMeUPs3gFdaJEh1CXf5WYt4q62YwDMhlsHcPlW0kc7iA=; path=/; expires=Sun, 26-Feb-23 17:33:48 GMT; domain=.notion.com; HttpOnly; Secure; SameSite=None",
|
||||
"Server",
|
||||
"cloudflare"
|
||||
],
|
||||
"responseIsBinary": false
|
||||
}
|
||||
]
|
||||
@@ -0,0 +1,523 @@
|
||||
[
|
||||
{
|
||||
"scope": "https://api.notion.com:443",
|
||||
"method": "POST",
|
||||
"path": "/v1/databases/0fadc732-4472-418c-83dc-04454332cb52/query",
|
||||
"body": {},
|
||||
"status": 200,
|
||||
"response": {
|
||||
"object": "list",
|
||||
"results": [
|
||||
{
|
||||
"object": "page",
|
||||
"id": "09b0be23-f79f-48e4-a24e-be483decd15b",
|
||||
"created_time": "2023-02-24T19:07:00.000Z",
|
||||
"last_edited_time": "2023-02-24T19:07:00.000Z",
|
||||
"created_by": {
|
||||
"object": "user",
|
||||
"id": "cc18a80a-973f-42c4-8fed-a055f8ae31f4"
|
||||
},
|
||||
"last_edited_by": {
|
||||
"object": "user",
|
||||
"id": "cc18a80a-973f-42c4-8fed-a055f8ae31f4"
|
||||
},
|
||||
"cover": null,
|
||||
"icon": {
|
||||
"type": "emoji",
|
||||
"emoji": "🎂"
|
||||
},
|
||||
"parent": {
|
||||
"type": "database_id",
|
||||
"database_id": "0fadc732-4472-418c-83dc-04454332cb52"
|
||||
},
|
||||
"archived": false,
|
||||
"properties": {
|
||||
"Tags": {
|
||||
"id": "!'(w",
|
||||
"type": "multi_select",
|
||||
"multi_select": [
|
||||
{
|
||||
"id": "7973659c-e670-44c5-95bd-ee8bea4410fe",
|
||||
"name": "Planning",
|
||||
"color": "orange"
|
||||
}
|
||||
]
|
||||
},
|
||||
"Created": {
|
||||
"id": "%7D%25j%7B",
|
||||
"type": "created_time",
|
||||
"created_time": "2023-02-24T19:07:00.000Z"
|
||||
},
|
||||
"Name": {
|
||||
"id": "title",
|
||||
"type": "title",
|
||||
"title": [
|
||||
{
|
||||
"type": "text",
|
||||
"text": {
|
||||
"content": "28th Birthday",
|
||||
"link": null
|
||||
},
|
||||
"annotations": {
|
||||
"bold": false,
|
||||
"italic": false,
|
||||
"strikethrough": false,
|
||||
"underline": false,
|
||||
"code": false,
|
||||
"color": "default"
|
||||
},
|
||||
"plain_text": "28th Birthday",
|
||||
"href": null
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
"url": "https://www.notion.so/28th-Birthday-09b0be23f79f48e4a24ebe483decd15b"
|
||||
},
|
||||
{
|
||||
"object": "page",
|
||||
"id": "1e26b51f-de7a-4f4f-a491-4217636b232e",
|
||||
"created_time": "2023-02-24T19:07:00.000Z",
|
||||
"last_edited_time": "2023-02-24T19:07:00.000Z",
|
||||
"created_by": {
|
||||
"object": "user",
|
||||
"id": "cc18a80a-973f-42c4-8fed-a055f8ae31f4"
|
||||
},
|
||||
"last_edited_by": {
|
||||
"object": "user",
|
||||
"id": "cc18a80a-973f-42c4-8fed-a055f8ae31f4"
|
||||
},
|
||||
"cover": null,
|
||||
"icon": {
|
||||
"type": "emoji",
|
||||
"emoji": "🥥"
|
||||
},
|
||||
"parent": {
|
||||
"type": "database_id",
|
||||
"database_id": "0fadc732-4472-418c-83dc-04454332cb52"
|
||||
},
|
||||
"archived": false,
|
||||
"properties": {
|
||||
"Tags": {
|
||||
"id": "!'(w",
|
||||
"type": "multi_select",
|
||||
"multi_select": [
|
||||
{
|
||||
"id": "00a58cba-c800-40cd-a8f1-6e42527b0a29",
|
||||
"name": "Special Event",
|
||||
"color": "yellow"
|
||||
}
|
||||
]
|
||||
},
|
||||
"Created": {
|
||||
"id": "%7D%25j%7B",
|
||||
"type": "created_time",
|
||||
"created_time": "2023-02-24T19:07:00.000Z"
|
||||
},
|
||||
"Name": {
|
||||
"id": "title",
|
||||
"type": "title",
|
||||
"title": [
|
||||
{
|
||||
"type": "text",
|
||||
"text": {
|
||||
"content": "Hawaii Vacation",
|
||||
"link": null
|
||||
},
|
||||
"annotations": {
|
||||
"bold": false,
|
||||
"italic": false,
|
||||
"strikethrough": false,
|
||||
"underline": false,
|
||||
"code": false,
|
||||
"color": "default"
|
||||
},
|
||||
"plain_text": "Hawaii Vacation",
|
||||
"href": null
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
"url": "https://www.notion.so/Hawaii-Vacation-1e26b51fde7a4f4fa4914217636b232e"
|
||||
},
|
||||
{
|
||||
"object": "page",
|
||||
"id": "2726fedf-6d01-461a-990e-5238be7b7741",
|
||||
"created_time": "2023-02-24T19:07:00.000Z",
|
||||
"last_edited_time": "2023-02-24T19:07:00.000Z",
|
||||
"created_by": {
|
||||
"object": "user",
|
||||
"id": "cc18a80a-973f-42c4-8fed-a055f8ae31f4"
|
||||
},
|
||||
"last_edited_by": {
|
||||
"object": "user",
|
||||
"id": "cc18a80a-973f-42c4-8fed-a055f8ae31f4"
|
||||
},
|
||||
"cover": null,
|
||||
"icon": {
|
||||
"type": "emoji",
|
||||
"emoji": "📋"
|
||||
},
|
||||
"parent": {
|
||||
"type": "database_id",
|
||||
"database_id": "0fadc732-4472-418c-83dc-04454332cb52"
|
||||
},
|
||||
"archived": false,
|
||||
"properties": {
|
||||
"Tags": {
|
||||
"id": "!'(w",
|
||||
"type": "multi_select",
|
||||
"multi_select": [
|
||||
{
|
||||
"id": "f4cf83a1-4b72-494e-bbc7-4a3c5cbaca4e",
|
||||
"name": "Work",
|
||||
"color": "blue"
|
||||
}
|
||||
]
|
||||
},
|
||||
"Created": {
|
||||
"id": "%7D%25j%7B",
|
||||
"type": "created_time",
|
||||
"created_time": "2023-02-24T19:07:00.000Z"
|
||||
},
|
||||
"Name": {
|
||||
"id": "title",
|
||||
"type": "title",
|
||||
"title": [
|
||||
{
|
||||
"type": "text",
|
||||
"text": {
|
||||
"content": "Job Search - September",
|
||||
"link": null
|
||||
},
|
||||
"annotations": {
|
||||
"bold": false,
|
||||
"italic": false,
|
||||
"strikethrough": false,
|
||||
"underline": false,
|
||||
"code": false,
|
||||
"color": "default"
|
||||
},
|
||||
"plain_text": "Job Search - September",
|
||||
"href": null
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
"url": "https://www.notion.so/Job-Search-September-2726fedf6d01461a990e5238be7b7741"
|
||||
},
|
||||
{
|
||||
"object": "page",
|
||||
"id": "527fa387-5b64-4eb9-a60e-5382a2fc483b",
|
||||
"created_time": "2023-02-24T19:07:00.000Z",
|
||||
"last_edited_time": "2023-02-24T19:07:00.000Z",
|
||||
"created_by": {
|
||||
"object": "user",
|
||||
"id": "cc18a80a-973f-42c4-8fed-a055f8ae31f4"
|
||||
},
|
||||
"last_edited_by": {
|
||||
"object": "user",
|
||||
"id": "cc18a80a-973f-42c4-8fed-a055f8ae31f4"
|
||||
},
|
||||
"cover": null,
|
||||
"icon": {
|
||||
"type": "emoji",
|
||||
"emoji": "✨"
|
||||
},
|
||||
"parent": {
|
||||
"type": "database_id",
|
||||
"database_id": "0fadc732-4472-418c-83dc-04454332cb52"
|
||||
},
|
||||
"archived": false,
|
||||
"properties": {
|
||||
"Tags": {
|
||||
"id": "!'(w",
|
||||
"type": "multi_select",
|
||||
"multi_select": [
|
||||
{
|
||||
"id": "4322f3ac-635f-4d2f-808f-22d639bc393b",
|
||||
"name": "Daily",
|
||||
"color": "purple"
|
||||
}
|
||||
]
|
||||
},
|
||||
"Created": {
|
||||
"id": "%7D%25j%7B",
|
||||
"type": "created_time",
|
||||
"created_time": "2023-02-24T19:07:00.000Z"
|
||||
},
|
||||
"Name": {
|
||||
"id": "title",
|
||||
"type": "title",
|
||||
"title": [
|
||||
{
|
||||
"type": "text",
|
||||
"text": {
|
||||
"content": "So much to be grateful for",
|
||||
"link": null
|
||||
},
|
||||
"annotations": {
|
||||
"bold": false,
|
||||
"italic": false,
|
||||
"strikethrough": false,
|
||||
"underline": false,
|
||||
"code": false,
|
||||
"color": "default"
|
||||
},
|
||||
"plain_text": "So much to be grateful for",
|
||||
"href": null
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
"url": "https://www.notion.so/So-much-to-be-grateful-for-527fa3875b644eb9a60e5382a2fc483b"
|
||||
},
|
||||
{
|
||||
"object": "page",
|
||||
"id": "5c2a75da-1b9c-4cbb-9f2d-fc258c2ee77e",
|
||||
"created_time": "2023-02-24T19:07:00.000Z",
|
||||
"last_edited_time": "2023-02-24T19:07:00.000Z",
|
||||
"created_by": {
|
||||
"object": "user",
|
||||
"id": "cc18a80a-973f-42c4-8fed-a055f8ae31f4"
|
||||
},
|
||||
"last_edited_by": {
|
||||
"object": "user",
|
||||
"id": "cc18a80a-973f-42c4-8fed-a055f8ae31f4"
|
||||
},
|
||||
"cover": null,
|
||||
"icon": {
|
||||
"type": "emoji",
|
||||
"emoji": "🌻"
|
||||
},
|
||||
"parent": {
|
||||
"type": "database_id",
|
||||
"database_id": "0fadc732-4472-418c-83dc-04454332cb52"
|
||||
},
|
||||
"archived": false,
|
||||
"properties": {
|
||||
"Tags": {
|
||||
"id": "!'(w",
|
||||
"type": "multi_select",
|
||||
"multi_select": [
|
||||
{
|
||||
"id": "4322f3ac-635f-4d2f-808f-22d639bc393b",
|
||||
"name": "Daily",
|
||||
"color": "purple"
|
||||
}
|
||||
]
|
||||
},
|
||||
"Created": {
|
||||
"id": "%7D%25j%7B",
|
||||
"type": "created_time",
|
||||
"created_time": "2023-02-24T19:07:00.000Z"
|
||||
},
|
||||
"Name": {
|
||||
"id": "title",
|
||||
"type": "title",
|
||||
"title": [
|
||||
{
|
||||
"type": "text",
|
||||
"text": {
|
||||
"content": "Just another day",
|
||||
"link": null
|
||||
},
|
||||
"annotations": {
|
||||
"bold": false,
|
||||
"italic": false,
|
||||
"strikethrough": false,
|
||||
"underline": false,
|
||||
"code": false,
|
||||
"color": "default"
|
||||
},
|
||||
"plain_text": "Just another day",
|
||||
"href": null
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
"url": "https://www.notion.so/Just-another-day-5c2a75da1b9c4cbb9f2dfc258c2ee77e"
|
||||
},
|
||||
{
|
||||
"object": "page",
|
||||
"id": "a6d6cce8-97f2-42b1-9ca9-13496014741a",
|
||||
"created_time": "2023-02-24T19:07:00.000Z",
|
||||
"last_edited_time": "2023-02-24T19:07:00.000Z",
|
||||
"created_by": {
|
||||
"object": "user",
|
||||
"id": "cc18a80a-973f-42c4-8fed-a055f8ae31f4"
|
||||
},
|
||||
"last_edited_by": {
|
||||
"object": "user",
|
||||
"id": "cc18a80a-973f-42c4-8fed-a055f8ae31f4"
|
||||
},
|
||||
"cover": null,
|
||||
"icon": {
|
||||
"type": "emoji",
|
||||
"emoji": "🍸"
|
||||
},
|
||||
"parent": {
|
||||
"type": "database_id",
|
||||
"database_id": "0fadc732-4472-418c-83dc-04454332cb52"
|
||||
},
|
||||
"archived": false,
|
||||
"properties": {
|
||||
"Tags": {
|
||||
"id": "!'(w",
|
||||
"type": "multi_select",
|
||||
"multi_select": [
|
||||
{
|
||||
"id": "b28c7f82-f6e4-4a72-a790-78585e7ead7e",
|
||||
"name": "Personal",
|
||||
"color": "red"
|
||||
}
|
||||
]
|
||||
},
|
||||
"Created": {
|
||||
"id": "%7D%25j%7B",
|
||||
"type": "created_time",
|
||||
"created_time": "2023-02-24T19:07:00.000Z"
|
||||
},
|
||||
"Name": {
|
||||
"id": "title",
|
||||
"type": "title",
|
||||
"title": [
|
||||
{
|
||||
"type": "text",
|
||||
"text": {
|
||||
"content": "Date with Stewart",
|
||||
"link": null
|
||||
},
|
||||
"annotations": {
|
||||
"bold": false,
|
||||
"italic": false,
|
||||
"strikethrough": false,
|
||||
"underline": false,
|
||||
"code": false,
|
||||
"color": "default"
|
||||
},
|
||||
"plain_text": "Date with Stewart",
|
||||
"href": null
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
"url": "https://www.notion.so/Date-with-Stewart-a6d6cce897f242b19ca913496014741a"
|
||||
},
|
||||
{
|
||||
"object": "page",
|
||||
"id": "b02c0fe9-758e-4d4b-925e-4b5463459b8b",
|
||||
"created_time": "2023-02-24T19:07:00.000Z",
|
||||
"last_edited_time": "2023-02-24T19:07:00.000Z",
|
||||
"created_by": {
|
||||
"object": "user",
|
||||
"id": "cc18a80a-973f-42c4-8fed-a055f8ae31f4"
|
||||
},
|
||||
"last_edited_by": {
|
||||
"object": "user",
|
||||
"id": "cc18a80a-973f-42c4-8fed-a055f8ae31f4"
|
||||
},
|
||||
"cover": null,
|
||||
"icon": {
|
||||
"type": "emoji",
|
||||
"emoji": "💭"
|
||||
},
|
||||
"parent": {
|
||||
"type": "database_id",
|
||||
"database_id": "0fadc732-4472-418c-83dc-04454332cb52"
|
||||
},
|
||||
"archived": false,
|
||||
"properties": {
|
||||
"Tags": {
|
||||
"id": "!'(w",
|
||||
"type": "multi_select",
|
||||
"multi_select": [
|
||||
{
|
||||
"id": "4322f3ac-635f-4d2f-808f-22d639bc393b",
|
||||
"name": "Daily",
|
||||
"color": "purple"
|
||||
}
|
||||
]
|
||||
},
|
||||
"Created": {
|
||||
"id": "%7D%25j%7B",
|
||||
"type": "created_time",
|
||||
"created_time": "2023-02-24T19:07:00.000Z"
|
||||
},
|
||||
"Name": {
|
||||
"id": "title",
|
||||
"type": "title",
|
||||
"title": [
|
||||
{
|
||||
"type": "text",
|
||||
"text": {
|
||||
"content": "Daily reflection",
|
||||
"link": null
|
||||
},
|
||||
"annotations": {
|
||||
"bold": false,
|
||||
"italic": false,
|
||||
"strikethrough": false,
|
||||
"underline": false,
|
||||
"code": false,
|
||||
"color": "default"
|
||||
},
|
||||
"plain_text": "Daily reflection",
|
||||
"href": null
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
"url": "https://www.notion.so/Daily-reflection-b02c0fe9758e4d4b925e4b5463459b8b"
|
||||
}
|
||||
],
|
||||
"next_cursor": null,
|
||||
"has_more": false,
|
||||
"type": "page",
|
||||
"page": {}
|
||||
},
|
||||
"rawHeaders": [
|
||||
"Date",
|
||||
"Mon, 27 Feb 2023 11:58:47 GMT",
|
||||
"Content-Type",
|
||||
"application/json; charset=utf-8",
|
||||
"Transfer-Encoding",
|
||||
"chunked",
|
||||
"Connection",
|
||||
"close",
|
||||
"Set-Cookie",
|
||||
"notion_browser_id=b073f780-6c12-425e-964c-a024261062b8; Domain=www.notion.so; Path=/; Expires=Tue, 27 Feb 2024 11:58:47 GMT; Secure",
|
||||
"Content-Security-Policy",
|
||||
"script-src 'self' 'unsafe-inline' 'unsafe-eval' https://gist.github.com https://apis.google.com https://www.google.com https://www.gstatic.com https://cdn.amplitude.com https://api.amplitude.com http://dev-embed.notion.co http://embed.notion.co https://widget.intercom.io https://js.intercomcdn.com https://static.zdassets.com https://api.smooch.io\t https://logs-01.loggly.com https://http-inputs-notion.splunkcloud.com https://cdn.segment.com https://analytics.pgncs.notion.so https://o324374.ingest.sentry.io https://checkout.stripe.com https://js.stripe.com https://embed.typeform.com https://admin.typeform.com https://public.profitwell.com https://static.profitwell.com js.sentry-cdn.com https://js.chilipiper.com https://platform.twitter.com https://cdn.syndication.twimg.com https://accounts.google.com https://www.googletagmanager.com https://www.googleadservices.com https://googleads.g.doubleclick.net https://api-v2.mutinyhq.io https://client-registry.mutinycdn.com https://client.mutinycdn.com https://user-data.mutinycdn.com https://cdn.metadata.io https://platformapi.metadata.io https://d2hrivdxn8ekm8.cloudfront.net https://d1lu3pmaz2ilpx.cloudfront.net https://dvqigh9b7wa32.cloudfront.net https://d330aiyvva2oww.cloudfront.net https://cdn.transcend.io https://cdn01.boxcdn.net https://cdn.sprig.com assets.customer.io code.gist.build;connect-src 'self' data: blob: https://msgstore.www.notion.so wss://msgstore.www.notion.so ws://localhost:* ws://127.0.0.1:* https://notion-emojis.s3-us-west-2.amazonaws.com https://s3-us-west-2.amazonaws.com https://s3.us-west-2.amazonaws.com https://notion-production-snapshots-2.s3.us-west-2.amazonaws.com https://cdn.amplitude.com https://api.amplitude.com https://www.notion.so https://api.embed.ly http://dev-embed.notion.co http://embed.notion.co https://js.intercomcdn.com https://api-iam.intercom.io https://uploads.intercomcdn.com wss://nexus-websocket-a.intercom.io https://ekr.zdassets.com https://ekr.zendesk.com\t https://makenotion.zendesk.com\t https://api.smooch.io\t wss://api.smooch.io\t https://logs-01.loggly.com https://http-inputs-notion.splunkcloud.com https://cdn.segment.com https://api.segment.io https://analytics.pgncs.notion.so https://api.pgncs.notion.so https://o324374.ingest.sentry.io https://checkout.stripe.com https://js.stripe.com https://cdn.contentful.com https://preview.contentful.com https://images.ctfassets.net https://www2.profitwell.com https://tracking.chilipiper.com https://api.chilipiper.com https://api.unsplash.com https://boards-api.greenhouse.io https://accounts.google.com https://oauth2.googleapis.com https://www.googletagmanager.com https://analytics.google.com https://www.googleadservices.com https://googleads.g.doubleclick.net https://region1.google-analytics.com https://region1.analytics.google.com https://www.google-analytics.com https://api-v2.mutinyhq.io https://client-registry.mutinycdn.com https://client.mutinycdn.com https://user-data.mutinycdn.com https://cdn.metadata.io https://platformapi.metadata.io https://d2hrivdxn8ekm8.cloudfront.net https://d1lu3pmaz2ilpx.cloudfront.net https://dvqigh9b7wa32.cloudfront.net https://d330aiyvva2oww.cloudfront.net https://cdn.transcend.io https://telemetry.transcend.io https://api.statuspage.io https://pgncd.notion.so https://api.statsig.com https://statsigapi.net https://exp.notion.so https://file.notion.so notion://file.notion.so https://api.box.com https://*.mux.com https://api.sprig.com https://storage.googleapis.com https://cdn.sprig.com https://cdn.userleap.com track.customer.io *.api.gist.build *.cloud.gist.build;font-src 'self' data: https://cdnjs.cloudflare.com https://js.intercomcdn.com https://cdn01.boxcdn.net;img-src 'self' data: blob: https: https://platform.twitter.com https://syndication.twitter.com https://pbs.twimg.com https://ton.twimg.com https://region1.google-analytics.com https://region1.analytics.google.com https://file.notion.so notion://file.notion.so https://*.mux.com track.customer.io;style-src 'self' 'unsafe-inline' https://cdnjs.cloudflare.com https://github.githubassets.com https://js.chilipiper.com https://platform.twitter.com https://ton.twimg.com https://accounts.google.com https://cdn.transcend.io https://cdn01.boxcdn.net code.gist.build;media-src blob: https: http: https://file.notion.so notion://file.notion.so https://*.mux.com;worker-src blob:;frame-src https: http: https://accounts.google.com renderer.gist.build code.gist.build",
|
||||
"X-DNS-Prefetch-Control",
|
||||
"off",
|
||||
"X-Frame-Options",
|
||||
"SAMEORIGIN",
|
||||
"Strict-Transport-Security",
|
||||
"max-age=5184000; includeSubDomains",
|
||||
"X-Download-Options",
|
||||
"noopen",
|
||||
"X-Content-Type-Options",
|
||||
"nosniff",
|
||||
"X-Permitted-Cross-Domain-Policies",
|
||||
"none",
|
||||
"Referrer-Policy",
|
||||
"strict-origin-when-cross-origin",
|
||||
"X-XSS-Protection",
|
||||
"0",
|
||||
"ETag",
|
||||
"W/\"1d6c-SpQFVKKxcgW+bv9mDjNi7A5pUcY\"",
|
||||
"Vary",
|
||||
"Accept-Encoding",
|
||||
"CF-Cache-Status",
|
||||
"DYNAMIC",
|
||||
"Set-Cookie",
|
||||
"notion_check_cookie_consent=true; Domain=www.notion.so; Path=/; Expires=Tue, 28 Feb 2023 11:58:47 GMT; Secure",
|
||||
"Set-Cookie",
|
||||
"__cf_bm=cwWAubzSJCT1wYgrzxM1q.SqOSvuofy9GfmFsOA2gLc-1677499127-0-AegyUwVahKvgc2gyTcp71mVVrVZqv6QGBz1sjO8pGkrWTDiNjVfBddTR0woRBH4Xew/jAiiYdlZhArh/NJuiBvA=; path=/; expires=Mon, 27-Feb-23 12:28:47 GMT; domain=.notion.com; HttpOnly; Secure; SameSite=None",
|
||||
"Server",
|
||||
"cloudflare"
|
||||
],
|
||||
"responseIsBinary": false
|
||||
}
|
||||
]
|
||||
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,106 @@
|
||||
[
|
||||
{
|
||||
"scope": "https://api.notion.com:443",
|
||||
"method": "PATCH",
|
||||
"path": "/v1/blocks/2675c67d-392a-4b86-86f6-93de22c797bd",
|
||||
"body": {
|
||||
"paragraph": {
|
||||
"rich_text": [
|
||||
{
|
||||
"type": "text",
|
||||
"text": {
|
||||
"content": "This update comes from the Trigger.dev Notion integration test suite. 🎉"
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
"status": 200,
|
||||
"response": {
|
||||
"object": "block",
|
||||
"id": "2675c67d-392a-4b86-86f6-93de22c797bd",
|
||||
"parent": {
|
||||
"type": "page_id",
|
||||
"page_id": "b4609033-b45a-4fc6-8d15-f06920495ab1"
|
||||
},
|
||||
"created_time": "2023-02-24T19:07:00.000Z",
|
||||
"last_edited_time": "2023-02-27T11:16:00.000Z",
|
||||
"created_by": {
|
||||
"object": "user",
|
||||
"id": "cc18a80a-973f-42c4-8fed-a055f8ae31f4"
|
||||
},
|
||||
"last_edited_by": {
|
||||
"object": "user",
|
||||
"id": "bcd4bb6e-7cb4-4e04-8609-10744a579644"
|
||||
},
|
||||
"has_children": false,
|
||||
"archived": false,
|
||||
"type": "paragraph",
|
||||
"paragraph": {
|
||||
"rich_text": [
|
||||
{
|
||||
"type": "text",
|
||||
"text": {
|
||||
"content": "This update comes from the Trigger.dev Notion integration test suite. 🎉",
|
||||
"link": null
|
||||
},
|
||||
"annotations": {
|
||||
"bold": false,
|
||||
"italic": false,
|
||||
"strikethrough": false,
|
||||
"underline": false,
|
||||
"code": false,
|
||||
"color": "default"
|
||||
},
|
||||
"plain_text": "This update comes from the Trigger.dev Notion integration test suite. 🎉",
|
||||
"href": null
|
||||
}
|
||||
],
|
||||
"color": "gray"
|
||||
}
|
||||
},
|
||||
"rawHeaders": [
|
||||
"Date",
|
||||
"Mon, 27 Feb 2023 11:16:26 GMT",
|
||||
"Content-Type",
|
||||
"application/json; charset=utf-8",
|
||||
"Transfer-Encoding",
|
||||
"chunked",
|
||||
"Connection",
|
||||
"close",
|
||||
"Set-Cookie",
|
||||
"notion_browser_id=486e8f8b-ef53-45a3-ae00-f4ae81089073; Domain=www.notion.so; Path=/; Expires=Tue, 27 Feb 2024 11:16:25 GMT; Secure",
|
||||
"Content-Security-Policy",
|
||||
"script-src 'self' 'unsafe-inline' 'unsafe-eval' https://gist.github.com https://apis.google.com https://www.google.com https://www.gstatic.com https://cdn.amplitude.com https://api.amplitude.com http://dev-embed.notion.co http://embed.notion.co https://widget.intercom.io https://js.intercomcdn.com https://static.zdassets.com https://api.smooch.io\t https://logs-01.loggly.com https://http-inputs-notion.splunkcloud.com https://cdn.segment.com https://analytics.pgncs.notion.so https://o324374.ingest.sentry.io https://checkout.stripe.com https://js.stripe.com https://embed.typeform.com https://admin.typeform.com https://public.profitwell.com https://static.profitwell.com js.sentry-cdn.com https://js.chilipiper.com https://platform.twitter.com https://cdn.syndication.twimg.com https://accounts.google.com https://www.googletagmanager.com https://www.googleadservices.com https://googleads.g.doubleclick.net https://api-v2.mutinyhq.io https://client-registry.mutinycdn.com https://client.mutinycdn.com https://user-data.mutinycdn.com https://cdn.metadata.io https://platformapi.metadata.io https://d2hrivdxn8ekm8.cloudfront.net https://d1lu3pmaz2ilpx.cloudfront.net https://dvqigh9b7wa32.cloudfront.net https://d330aiyvva2oww.cloudfront.net https://cdn.transcend.io https://cdn01.boxcdn.net https://cdn.sprig.com assets.customer.io code.gist.build;connect-src 'self' data: blob: https://msgstore.www.notion.so wss://msgstore.www.notion.so ws://localhost:* ws://127.0.0.1:* https://notion-emojis.s3-us-west-2.amazonaws.com https://s3-us-west-2.amazonaws.com https://s3.us-west-2.amazonaws.com https://notion-production-snapshots-2.s3.us-west-2.amazonaws.com https://cdn.amplitude.com https://api.amplitude.com https://www.notion.so https://api.embed.ly http://dev-embed.notion.co http://embed.notion.co https://js.intercomcdn.com https://api-iam.intercom.io https://uploads.intercomcdn.com wss://nexus-websocket-a.intercom.io https://ekr.zdassets.com https://ekr.zendesk.com\t https://makenotion.zendesk.com\t https://api.smooch.io\t wss://api.smooch.io\t https://logs-01.loggly.com https://http-inputs-notion.splunkcloud.com https://cdn.segment.com https://api.segment.io https://analytics.pgncs.notion.so https://api.pgncs.notion.so https://o324374.ingest.sentry.io https://checkout.stripe.com https://js.stripe.com https://cdn.contentful.com https://preview.contentful.com https://images.ctfassets.net https://www2.profitwell.com https://tracking.chilipiper.com https://api.chilipiper.com https://api.unsplash.com https://boards-api.greenhouse.io https://accounts.google.com https://oauth2.googleapis.com https://www.googletagmanager.com https://analytics.google.com https://www.googleadservices.com https://googleads.g.doubleclick.net https://region1.google-analytics.com https://region1.analytics.google.com https://www.google-analytics.com https://api-v2.mutinyhq.io https://client-registry.mutinycdn.com https://client.mutinycdn.com https://user-data.mutinycdn.com https://cdn.metadata.io https://platformapi.metadata.io https://d2hrivdxn8ekm8.cloudfront.net https://d1lu3pmaz2ilpx.cloudfront.net https://dvqigh9b7wa32.cloudfront.net https://d330aiyvva2oww.cloudfront.net https://cdn.transcend.io https://telemetry.transcend.io https://api.statuspage.io https://pgncd.notion.so https://api.statsig.com https://statsigapi.net https://exp.notion.so https://file.notion.so notion://file.notion.so https://api.box.com https://*.mux.com https://api.sprig.com https://storage.googleapis.com https://cdn.sprig.com https://cdn.userleap.com track.customer.io *.api.gist.build *.cloud.gist.build;font-src 'self' data: https://cdnjs.cloudflare.com https://js.intercomcdn.com https://cdn01.boxcdn.net;img-src 'self' data: blob: https: https://platform.twitter.com https://syndication.twitter.com https://pbs.twimg.com https://ton.twimg.com https://region1.google-analytics.com https://region1.analytics.google.com https://file.notion.so notion://file.notion.so https://*.mux.com track.customer.io;style-src 'self' 'unsafe-inline' https://cdnjs.cloudflare.com https://github.githubassets.com https://js.chilipiper.com https://platform.twitter.com https://ton.twimg.com https://accounts.google.com https://cdn.transcend.io https://cdn01.boxcdn.net code.gist.build;media-src blob: https: http: https://file.notion.so notion://file.notion.so https://*.mux.com;worker-src blob:;frame-src https: http: https://accounts.google.com renderer.gist.build code.gist.build",
|
||||
"X-DNS-Prefetch-Control",
|
||||
"off",
|
||||
"X-Frame-Options",
|
||||
"SAMEORIGIN",
|
||||
"Strict-Transport-Security",
|
||||
"max-age=5184000; includeSubDomains",
|
||||
"X-Download-Options",
|
||||
"noopen",
|
||||
"X-Content-Type-Options",
|
||||
"nosniff",
|
||||
"X-Permitted-Cross-Domain-Policies",
|
||||
"none",
|
||||
"Referrer-Policy",
|
||||
"strict-origin-when-cross-origin",
|
||||
"X-XSS-Protection",
|
||||
"0",
|
||||
"ETag",
|
||||
"W/\"336-hVhtPA/lqL1IENJDtmp9GXLmBEA\"",
|
||||
"Vary",
|
||||
"Accept-Encoding",
|
||||
"CF-Cache-Status",
|
||||
"DYNAMIC",
|
||||
"Set-Cookie",
|
||||
"notion_check_cookie_consent=true; Domain=www.notion.so; Path=/; Expires=Tue, 28 Feb 2023 11:16:25 GMT; Secure",
|
||||
"Set-Cookie",
|
||||
"__cf_bm=OidhXOa8sHJ.9YAgTZh9Fw6Pv75DlQPlYX981oAiGFg-1677496586-0-AXc/acKhhqM1u1P4GSnmVUMPJ4lTqM/PcKOXZQLO7zjLeMyLSBjk7JP6w+ytOJ9ZWLYd+7xcZNEzp7jKCZDFtxk=; path=/; expires=Mon, 27-Feb-23 11:46:26 GMT; domain=.notion.com; HttpOnly; Secure; SameSite=None",
|
||||
"Server",
|
||||
"cloudflare"
|
||||
],
|
||||
"responseIsBinary": false
|
||||
}
|
||||
]
|
||||
@@ -0,0 +1,211 @@
|
||||
[
|
||||
{
|
||||
"scope": "https://api.notion.com:443",
|
||||
"method": "PATCH",
|
||||
"path": "/v1/databases/8db50793-ac53-496b-bbff-a74be0fb78b4",
|
||||
"body": {
|
||||
"title": [
|
||||
{
|
||||
"text": {
|
||||
"content": "Trigger.dev updated db title"
|
||||
}
|
||||
}
|
||||
],
|
||||
"description": [
|
||||
{
|
||||
"text": {
|
||||
"content": "This is an updated description"
|
||||
}
|
||||
}
|
||||
],
|
||||
"properties": {
|
||||
"+1": null,
|
||||
"Photo": {
|
||||
"url": {}
|
||||
},
|
||||
"Store availability": {
|
||||
"multi_select": {
|
||||
"options": [
|
||||
{
|
||||
"name": "Duc Loi Market"
|
||||
},
|
||||
{
|
||||
"name": "Rainbow Grocery"
|
||||
},
|
||||
{
|
||||
"name": "Gus'''s Community Market"
|
||||
},
|
||||
{
|
||||
"name": "The Good Life Grocery",
|
||||
"color": "orange"
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"status": 200,
|
||||
"response": {
|
||||
"object": "database",
|
||||
"id": "8db50793-ac53-496b-bbff-a74be0fb78b4",
|
||||
"cover": null,
|
||||
"icon": {
|
||||
"type": "emoji",
|
||||
"emoji": "📝"
|
||||
},
|
||||
"created_time": "2023-02-27T12:03:00.000Z",
|
||||
"created_by": {
|
||||
"object": "user",
|
||||
"id": "bcd4bb6e-7cb4-4e04-8609-10744a579644"
|
||||
},
|
||||
"last_edited_by": {
|
||||
"object": "user",
|
||||
"id": "bcd4bb6e-7cb4-4e04-8609-10744a579644"
|
||||
},
|
||||
"last_edited_time": "2023-02-27T12:48:00.000Z",
|
||||
"title": [
|
||||
{
|
||||
"type": "text",
|
||||
"text": {
|
||||
"content": "Trigger.dev updated db title",
|
||||
"link": null
|
||||
},
|
||||
"annotations": {
|
||||
"bold": false,
|
||||
"italic": false,
|
||||
"strikethrough": false,
|
||||
"underline": false,
|
||||
"code": false,
|
||||
"color": "default"
|
||||
},
|
||||
"plain_text": "Trigger.dev updated db title",
|
||||
"href": null
|
||||
}
|
||||
],
|
||||
"description": [
|
||||
{
|
||||
"type": "text",
|
||||
"text": {
|
||||
"content": "This is an updated description",
|
||||
"link": null
|
||||
},
|
||||
"annotations": {
|
||||
"bold": false,
|
||||
"italic": false,
|
||||
"strikethrough": false,
|
||||
"underline": false,
|
||||
"code": false,
|
||||
"color": "default"
|
||||
},
|
||||
"plain_text": "This is an updated description",
|
||||
"href": null
|
||||
}
|
||||
],
|
||||
"is_inline": false,
|
||||
"properties": {
|
||||
"Photo": {
|
||||
"id": "JvIM",
|
||||
"name": "Photo",
|
||||
"type": "url",
|
||||
"url": {}
|
||||
},
|
||||
"Store availability": {
|
||||
"id": "_TEG",
|
||||
"name": "Store availability",
|
||||
"type": "multi_select",
|
||||
"multi_select": {
|
||||
"options": [
|
||||
{
|
||||
"id": "b38859ad-7eb8-445a-8445-00344ea4c0b3",
|
||||
"name": "Duc Loi Market",
|
||||
"color": "default"
|
||||
},
|
||||
{
|
||||
"id": "fa7f8bd8-a8be-4804-9f53-868369e861ea",
|
||||
"name": "Rainbow Grocery",
|
||||
"color": "default"
|
||||
},
|
||||
{
|
||||
"id": "4b1eec41-5a4a-41e2-9a76-6d7482de838b",
|
||||
"name": "Gus'''s Community Market",
|
||||
"color": "default"
|
||||
},
|
||||
{
|
||||
"id": "029b153e-bce3-4e95-9788-80968a605248",
|
||||
"name": "The Good Life Grocery",
|
||||
"color": "orange"
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
"Description": {
|
||||
"id": "al%3E%3F",
|
||||
"name": "Description",
|
||||
"type": "rich_text",
|
||||
"rich_text": {}
|
||||
},
|
||||
"In stock": {
|
||||
"id": "q%60gF",
|
||||
"name": "In stock",
|
||||
"type": "checkbox",
|
||||
"checkbox": {}
|
||||
},
|
||||
"Name": {
|
||||
"id": "title",
|
||||
"name": "Name",
|
||||
"type": "title",
|
||||
"title": {}
|
||||
}
|
||||
},
|
||||
"parent": {
|
||||
"type": "page_id",
|
||||
"page_id": "b4609033-b45a-4fc6-8d15-f06920495ab1"
|
||||
},
|
||||
"url": "https://www.notion.so/8db50793ac53496bbbffa74be0fb78b4",
|
||||
"archived": false
|
||||
},
|
||||
"rawHeaders": [
|
||||
"Date",
|
||||
"Mon, 27 Feb 2023 12:48:06 GMT",
|
||||
"Content-Type",
|
||||
"application/json; charset=utf-8",
|
||||
"Transfer-Encoding",
|
||||
"chunked",
|
||||
"Connection",
|
||||
"close",
|
||||
"Set-Cookie",
|
||||
"notion_browser_id=f5110365-ef1e-4adc-9d18-2c2ab2334011; Domain=www.notion.so; Path=/; Expires=Tue, 27 Feb 2024 12:48:05 GMT; Secure",
|
||||
"Content-Security-Policy",
|
||||
"script-src 'self' 'unsafe-inline' 'unsafe-eval' https://gist.github.com https://apis.google.com https://www.google.com https://www.gstatic.com https://cdn.amplitude.com https://api.amplitude.com http://dev-embed.notion.co http://embed.notion.co https://widget.intercom.io https://js.intercomcdn.com https://static.zdassets.com https://api.smooch.io\t https://logs-01.loggly.com https://http-inputs-notion.splunkcloud.com https://cdn.segment.com https://analytics.pgncs.notion.so https://o324374.ingest.sentry.io https://checkout.stripe.com https://js.stripe.com https://embed.typeform.com https://admin.typeform.com https://public.profitwell.com https://static.profitwell.com js.sentry-cdn.com https://js.chilipiper.com https://platform.twitter.com https://cdn.syndication.twimg.com https://accounts.google.com https://www.googletagmanager.com https://www.googleadservices.com https://googleads.g.doubleclick.net https://api-v2.mutinyhq.io https://client-registry.mutinycdn.com https://client.mutinycdn.com https://user-data.mutinycdn.com https://cdn.metadata.io https://platformapi.metadata.io https://d2hrivdxn8ekm8.cloudfront.net https://d1lu3pmaz2ilpx.cloudfront.net https://dvqigh9b7wa32.cloudfront.net https://d330aiyvva2oww.cloudfront.net https://cdn.transcend.io https://cdn01.boxcdn.net https://cdn.sprig.com assets.customer.io code.gist.build;connect-src 'self' data: blob: https://msgstore.www.notion.so wss://msgstore.www.notion.so ws://localhost:* ws://127.0.0.1:* https://notion-emojis.s3-us-west-2.amazonaws.com https://s3-us-west-2.amazonaws.com https://s3.us-west-2.amazonaws.com https://notion-production-snapshots-2.s3.us-west-2.amazonaws.com https://cdn.amplitude.com https://api.amplitude.com https://www.notion.so https://api.embed.ly http://dev-embed.notion.co http://embed.notion.co https://js.intercomcdn.com https://api-iam.intercom.io https://uploads.intercomcdn.com wss://nexus-websocket-a.intercom.io https://ekr.zdassets.com https://ekr.zendesk.com\t https://makenotion.zendesk.com\t https://api.smooch.io\t wss://api.smooch.io\t https://logs-01.loggly.com https://http-inputs-notion.splunkcloud.com https://cdn.segment.com https://api.segment.io https://analytics.pgncs.notion.so https://api.pgncs.notion.so https://o324374.ingest.sentry.io https://checkout.stripe.com https://js.stripe.com https://cdn.contentful.com https://preview.contentful.com https://images.ctfassets.net https://www2.profitwell.com https://tracking.chilipiper.com https://api.chilipiper.com https://api.unsplash.com https://boards-api.greenhouse.io https://accounts.google.com https://oauth2.googleapis.com https://www.googletagmanager.com https://analytics.google.com https://www.googleadservices.com https://googleads.g.doubleclick.net https://region1.google-analytics.com https://region1.analytics.google.com https://www.google-analytics.com https://api-v2.mutinyhq.io https://client-registry.mutinycdn.com https://client.mutinycdn.com https://user-data.mutinycdn.com https://cdn.metadata.io https://platformapi.metadata.io https://d2hrivdxn8ekm8.cloudfront.net https://d1lu3pmaz2ilpx.cloudfront.net https://dvqigh9b7wa32.cloudfront.net https://d330aiyvva2oww.cloudfront.net https://cdn.transcend.io https://telemetry.transcend.io https://api.statuspage.io https://pgncd.notion.so https://api.statsig.com https://statsigapi.net https://exp.notion.so https://file.notion.so notion://file.notion.so https://api.box.com https://*.mux.com https://api.sprig.com https://storage.googleapis.com https://cdn.sprig.com https://cdn.userleap.com track.customer.io *.api.gist.build *.cloud.gist.build;font-src 'self' data: https://cdnjs.cloudflare.com https://js.intercomcdn.com https://cdn01.boxcdn.net;img-src 'self' data: blob: https: https://platform.twitter.com https://syndication.twitter.com https://pbs.twimg.com https://ton.twimg.com https://region1.google-analytics.com https://region1.analytics.google.com https://file.notion.so notion://file.notion.so https://*.mux.com track.customer.io;style-src 'self' 'unsafe-inline' https://cdnjs.cloudflare.com https://github.githubassets.com https://js.chilipiper.com https://platform.twitter.com https://ton.twimg.com https://accounts.google.com https://cdn.transcend.io https://cdn01.boxcdn.net code.gist.build;media-src blob: https: http: https://file.notion.so notion://file.notion.so https://*.mux.com;worker-src blob:;frame-src https: http: https://accounts.google.com renderer.gist.build code.gist.build",
|
||||
"X-DNS-Prefetch-Control",
|
||||
"off",
|
||||
"X-Frame-Options",
|
||||
"SAMEORIGIN",
|
||||
"Strict-Transport-Security",
|
||||
"max-age=5184000; includeSubDomains",
|
||||
"X-Download-Options",
|
||||
"noopen",
|
||||
"X-Content-Type-Options",
|
||||
"nosniff",
|
||||
"X-Permitted-Cross-Domain-Policies",
|
||||
"none",
|
||||
"Referrer-Policy",
|
||||
"strict-origin-when-cross-origin",
|
||||
"X-XSS-Protection",
|
||||
"0",
|
||||
"ETag",
|
||||
"W/\"735-KLx0Xyzef9XBSHzwld9artJGnuE\"",
|
||||
"Vary",
|
||||
"Accept-Encoding",
|
||||
"CF-Cache-Status",
|
||||
"DYNAMIC",
|
||||
"Set-Cookie",
|
||||
"notion_check_cookie_consent=true; Domain=www.notion.so; Path=/; Expires=Tue, 28 Feb 2023 12:48:05 GMT; Secure",
|
||||
"Set-Cookie",
|
||||
"__cf_bm=5Tc3lAQfIEVKIRFQmBPDpdDZg3Kb2Mc_nvEy5Bldkgk-1677502086-0-AXzYbrme7DAsjAZ8yjzmsEbiebZCkG9g/bYh4S81cKtKgkmsi2/btarTp3YkgikTIxy0ULUxVUWdQoY2uanFusk=; path=/; expires=Mon, 27-Feb-23 13:18:06 GMT; domain=.notion.com; HttpOnly; Secure; SameSite=None",
|
||||
"Server",
|
||||
"cloudflare"
|
||||
],
|
||||
"responseIsBinary": false
|
||||
}
|
||||
]
|
||||
@@ -0,0 +1,111 @@
|
||||
[
|
||||
{
|
||||
"scope": "https://api.notion.com:443",
|
||||
"method": "PATCH",
|
||||
"path": "/v1/pages/b4609033-b45a-4fc6-8d15-f06920495ab1",
|
||||
"body": {
|
||||
"icon": {
|
||||
"emoji": "🦸♀️"
|
||||
}
|
||||
},
|
||||
"status": 200,
|
||||
"response": {
|
||||
"object": "page",
|
||||
"id": "b4609033-b45a-4fc6-8d15-f06920495ab1",
|
||||
"created_time": "2023-02-24T19:07:00.000Z",
|
||||
"last_edited_time": "2023-02-27T09:19:00.000Z",
|
||||
"created_by": {
|
||||
"object": "user",
|
||||
"id": "cc18a80a-973f-42c4-8fed-a055f8ae31f4"
|
||||
},
|
||||
"last_edited_by": {
|
||||
"object": "user",
|
||||
"id": "bcd4bb6e-7cb4-4e04-8609-10744a579644"
|
||||
},
|
||||
"cover": {
|
||||
"type": "external",
|
||||
"external": {
|
||||
"url": "https://www.notion.so/images/page-cover/met_horace_pippin.jpg"
|
||||
}
|
||||
},
|
||||
"icon": {
|
||||
"type": "emoji",
|
||||
"emoji": "🦸♀️"
|
||||
},
|
||||
"parent": {
|
||||
"type": "workspace",
|
||||
"workspace": true
|
||||
},
|
||||
"archived": false,
|
||||
"properties": {
|
||||
"title": {
|
||||
"id": "title",
|
||||
"type": "title",
|
||||
"title": [
|
||||
{
|
||||
"type": "text",
|
||||
"text": {
|
||||
"content": "Personal Home",
|
||||
"link": null
|
||||
},
|
||||
"annotations": {
|
||||
"bold": false,
|
||||
"italic": false,
|
||||
"strikethrough": false,
|
||||
"underline": false,
|
||||
"code": false,
|
||||
"color": "default"
|
||||
},
|
||||
"plain_text": "Personal Home",
|
||||
"href": null
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
"url": "https://www.notion.so/Personal-Home-b4609033b45a4fc68d15f06920495ab1"
|
||||
},
|
||||
"rawHeaders": [
|
||||
"Date",
|
||||
"Mon, 27 Feb 2023 09:19:09 GMT",
|
||||
"Content-Type",
|
||||
"application/json; charset=utf-8",
|
||||
"Transfer-Encoding",
|
||||
"chunked",
|
||||
"Connection",
|
||||
"close",
|
||||
"Set-Cookie",
|
||||
"notion_browser_id=4df0d92c-a26b-46ef-b272-8f5ab412147d; Domain=www.notion.so; Path=/; Expires=Tue, 27 Feb 2024 09:19:09 GMT; Secure",
|
||||
"Content-Security-Policy",
|
||||
"script-src 'self' 'unsafe-inline' 'unsafe-eval' https://gist.github.com https://apis.google.com https://www.google.com https://www.gstatic.com https://cdn.amplitude.com https://api.amplitude.com http://dev-embed.notion.co http://embed.notion.co https://widget.intercom.io https://js.intercomcdn.com https://static.zdassets.com https://api.smooch.io\t https://logs-01.loggly.com https://http-inputs-notion.splunkcloud.com https://cdn.segment.com https://analytics.pgncs.notion.so https://o324374.ingest.sentry.io https://checkout.stripe.com https://js.stripe.com https://embed.typeform.com https://admin.typeform.com https://public.profitwell.com https://static.profitwell.com js.sentry-cdn.com https://js.chilipiper.com https://platform.twitter.com https://cdn.syndication.twimg.com https://accounts.google.com https://www.googletagmanager.com https://www.googleadservices.com https://googleads.g.doubleclick.net https://api-v2.mutinyhq.io https://client-registry.mutinycdn.com https://client.mutinycdn.com https://user-data.mutinycdn.com https://cdn.metadata.io https://platformapi.metadata.io https://d2hrivdxn8ekm8.cloudfront.net https://d1lu3pmaz2ilpx.cloudfront.net https://dvqigh9b7wa32.cloudfront.net https://d330aiyvva2oww.cloudfront.net https://cdn.transcend.io https://cdn01.boxcdn.net https://cdn.sprig.com assets.customer.io code.gist.build;connect-src 'self' data: blob: https://msgstore.www.notion.so wss://msgstore.www.notion.so ws://localhost:* ws://127.0.0.1:* https://notion-emojis.s3-us-west-2.amazonaws.com https://s3-us-west-2.amazonaws.com https://s3.us-west-2.amazonaws.com https://notion-production-snapshots-2.s3.us-west-2.amazonaws.com https://cdn.amplitude.com https://api.amplitude.com https://www.notion.so https://api.embed.ly http://dev-embed.notion.co http://embed.notion.co https://js.intercomcdn.com https://api-iam.intercom.io https://uploads.intercomcdn.com wss://nexus-websocket-a.intercom.io https://ekr.zdassets.com https://ekr.zendesk.com\t https://makenotion.zendesk.com\t https://api.smooch.io\t wss://api.smooch.io\t https://logs-01.loggly.com https://http-inputs-notion.splunkcloud.com https://cdn.segment.com https://api.segment.io https://analytics.pgncs.notion.so https://api.pgncs.notion.so https://o324374.ingest.sentry.io https://checkout.stripe.com https://js.stripe.com https://cdn.contentful.com https://preview.contentful.com https://images.ctfassets.net https://www2.profitwell.com https://tracking.chilipiper.com https://api.chilipiper.com https://api.unsplash.com https://boards-api.greenhouse.io https://accounts.google.com https://oauth2.googleapis.com https://www.googletagmanager.com https://analytics.google.com https://www.googleadservices.com https://googleads.g.doubleclick.net https://region1.google-analytics.com https://region1.analytics.google.com https://www.google-analytics.com https://api-v2.mutinyhq.io https://client-registry.mutinycdn.com https://client.mutinycdn.com https://user-data.mutinycdn.com https://cdn.metadata.io https://platformapi.metadata.io https://d2hrivdxn8ekm8.cloudfront.net https://d1lu3pmaz2ilpx.cloudfront.net https://dvqigh9b7wa32.cloudfront.net https://d330aiyvva2oww.cloudfront.net https://cdn.transcend.io https://telemetry.transcend.io https://api.statuspage.io https://pgncd.notion.so https://api.statsig.com https://statsigapi.net https://exp.notion.so https://file.notion.so notion://file.notion.so https://api.box.com https://*.mux.com https://api.sprig.com https://storage.googleapis.com https://cdn.sprig.com https://cdn.userleap.com track.customer.io *.api.gist.build *.cloud.gist.build;font-src 'self' data: https://cdnjs.cloudflare.com https://js.intercomcdn.com https://cdn01.boxcdn.net;img-src 'self' data: blob: https: https://platform.twitter.com https://syndication.twitter.com https://pbs.twimg.com https://ton.twimg.com https://region1.google-analytics.com https://region1.analytics.google.com https://file.notion.so notion://file.notion.so https://*.mux.com track.customer.io;style-src 'self' 'unsafe-inline' https://cdnjs.cloudflare.com https://github.githubassets.com https://js.chilipiper.com https://platform.twitter.com https://ton.twimg.com https://accounts.google.com https://cdn.transcend.io https://cdn01.boxcdn.net code.gist.build;media-src blob: https: http: https://file.notion.so notion://file.notion.so https://*.mux.com;worker-src blob:;frame-src https: http: https://accounts.google.com renderer.gist.build code.gist.build",
|
||||
"X-DNS-Prefetch-Control",
|
||||
"off",
|
||||
"X-Frame-Options",
|
||||
"SAMEORIGIN",
|
||||
"Strict-Transport-Security",
|
||||
"max-age=5184000; includeSubDomains",
|
||||
"X-Download-Options",
|
||||
"noopen",
|
||||
"X-Content-Type-Options",
|
||||
"nosniff",
|
||||
"X-Permitted-Cross-Domain-Policies",
|
||||
"none",
|
||||
"Referrer-Policy",
|
||||
"strict-origin-when-cross-origin",
|
||||
"X-XSS-Protection",
|
||||
"0",
|
||||
"ETag",
|
||||
"W/\"375-pnfsUIOn2SpGzML61kePXEPuNag\"",
|
||||
"Vary",
|
||||
"Accept-Encoding",
|
||||
"CF-Cache-Status",
|
||||
"DYNAMIC",
|
||||
"Set-Cookie",
|
||||
"notion_check_cookie_consent=true; Domain=www.notion.so; Path=/; Expires=Tue, 28 Feb 2023 09:19:09 GMT; Secure",
|
||||
"Set-Cookie",
|
||||
"__cf_bm=1BLTVHBW95WeTHRxGxJKr04euPqe7BD2TOQ8IfSBjI4-1677489549-0-AfqV/cu4hBSMEmapCSw220yP2VouKUsmSJ9VYAfjPjidTTEjq6nhTLrgAbbp3vcdzhzmrHmdJI0dzqmofxlvKq0=; path=/; expires=Mon, 27-Feb-23 09:49:09 GMT; domain=.notion.com; HttpOnly; Secure; SameSite=None",
|
||||
"Server",
|
||||
"cloudflare"
|
||||
],
|
||||
"responseIsBinary": false
|
||||
}
|
||||
]
|
||||
@@ -23,20 +23,20 @@ export function generateInputOutputSchemas(
|
||||
export function createInputSchema(
|
||||
spec: Action["spec"]["input"]
|
||||
): JSONSchema | undefined {
|
||||
let inputSchema: JSONSchema | undefined = spec.body;
|
||||
if (
|
||||
(spec.parameters === undefined || spec.parameters.length === 0) &&
|
||||
spec.body === undefined
|
||||
)
|
||||
return undefined;
|
||||
|
||||
const inputSchema: JSONSchema = {
|
||||
allOf: [],
|
||||
};
|
||||
|
||||
if (spec.parameters && spec.parameters.length > 0) {
|
||||
if (!inputSchema) {
|
||||
inputSchema = {
|
||||
type: "object",
|
||||
properties: {},
|
||||
};
|
||||
}
|
||||
|
||||
inputSchema = {
|
||||
const paramsSchema: JSONSchema = {
|
||||
type: "object",
|
||||
properties: {
|
||||
...inputSchema.properties,
|
||||
...Object.fromEntries(
|
||||
spec.parameters.map((p) => [
|
||||
p.name,
|
||||
@@ -45,10 +45,15 @@ export function createInputSchema(
|
||||
),
|
||||
},
|
||||
required: [
|
||||
...(inputSchema.required ?? []),
|
||||
...spec.parameters.filter((p) => p.required).map((p) => p.name),
|
||||
],
|
||||
};
|
||||
|
||||
inputSchema.allOf?.push(paramsSchema);
|
||||
}
|
||||
|
||||
if (spec.body) {
|
||||
inputSchema.allOf?.push(spec.body);
|
||||
}
|
||||
|
||||
return inputSchema;
|
||||
@@ -60,9 +65,10 @@ export function createSuccessfulOutputSchema(
|
||||
if (spec === undefined) return undefined;
|
||||
|
||||
//combine all "success" output schemas into a union
|
||||
const outputSuccessSchemas = Object.values(spec.responses).flatMap((s) =>
|
||||
s.flatMap((r) => (r.success ? r.schema : []))
|
||||
const outputSuccessSchemas = spec.responses.flatMap((r) =>
|
||||
r.success ? r.schema : []
|
||||
);
|
||||
|
||||
return outputSuccessSchemas.length === 1
|
||||
? outputSuccessSchemas[0]
|
||||
: createDiscriminatedUnionSchema(`Output`, outputSuccessSchemas);
|
||||
|
||||
@@ -1,5 +1,7 @@
|
||||
import { expect, test } from "vitest";
|
||||
import { getTypesFromSchema as generateTypesFromSchema } from "./generateTypes";
|
||||
import { promises as fs } from "fs";
|
||||
import { JSONSchema } from "core/schemas/types";
|
||||
|
||||
test("simple schema type generation", async () => {
|
||||
try {
|
||||
@@ -117,3 +119,56 @@ test("advanced schema type generation", async () => {
|
||||
expect(e).toEqual(null);
|
||||
}
|
||||
});
|
||||
|
||||
test("refs schema type generation", async () => {
|
||||
try {
|
||||
const schema: JSONSchema = {
|
||||
additionalProperties: false,
|
||||
definitions: {
|
||||
parent: {
|
||||
additionalProperties: false,
|
||||
properties: {
|
||||
email: {
|
||||
type: "string",
|
||||
},
|
||||
},
|
||||
type: "object",
|
||||
},
|
||||
},
|
||||
properties: {
|
||||
id: {
|
||||
type: "string",
|
||||
},
|
||||
parent: {
|
||||
$ref: "#/definitions/parent",
|
||||
},
|
||||
person: {
|
||||
$ref: "#/definitions/parent",
|
||||
},
|
||||
type: {
|
||||
const: "person",
|
||||
type: "string",
|
||||
},
|
||||
},
|
||||
required: ["type", "person", "id"],
|
||||
type: "object",
|
||||
};
|
||||
|
||||
const data = await generateTypesFromSchema(schema, "Input");
|
||||
expect(data).toMatchInlineSnapshot(`
|
||||
"export interface Input {
|
||||
id: string
|
||||
parent?: Parent
|
||||
person: Parent
|
||||
type: \\"person\\"
|
||||
}
|
||||
export interface Parent {
|
||||
email?: string
|
||||
}
|
||||
"
|
||||
`);
|
||||
} catch (e: any) {
|
||||
console.error(JSON.stringify(e.errors, null, 2));
|
||||
expect(e).toEqual(null);
|
||||
}
|
||||
});
|
||||
|
||||
@@ -1,15 +1,21 @@
|
||||
import { handleAction } from "api/v2/action";
|
||||
import { handleActionDisplay } from "api/v2/action/display";
|
||||
import { handleServices } from "api/v2/services";
|
||||
import * as Sentry from "@sentry/node";
|
||||
import dotenv from "dotenv";
|
||||
import express, { Express, NextFunction, Request, Response } from "express";
|
||||
import morgan from "morgan";
|
||||
|
||||
dotenv.config();
|
||||
|
||||
const app: Express = express();
|
||||
const port = process.env.PORT ?? 3006;
|
||||
|
||||
// The request handler must be the first middleware on the app
|
||||
Sentry.init({
|
||||
dsn: "https://bf96820b08004fa4b2e1506f2ac74a14@o4504419574087680.ingest.sentry.io/4504419607052288",
|
||||
});
|
||||
app.use(Sentry.Handlers.requestHandler());
|
||||
|
||||
app.use(express.json());
|
||||
app.use(morgan("combined"));
|
||||
|
||||
@@ -57,6 +63,21 @@ app.get("/api/v2/services", handleServices);
|
||||
app.post("/api/v2/:service/action/:action/display", handleActionDisplay);
|
||||
app.post("/api/v2/:service/action/:action", handleAction);
|
||||
|
||||
app.get("/debug-sentry", function mainHandler(req, res) {
|
||||
throw new Error("My first Sentry error!");
|
||||
});
|
||||
|
||||
// The error handler must be before any other error middleware and after all controllers
|
||||
app.use(Sentry.Handlers.errorHandler());
|
||||
|
||||
// Optional fallthrough error handler
|
||||
app.use(function onError(err: any, req: any, res: any, next: any) {
|
||||
// The error id is attached to `res.sentry` to be returned
|
||||
// and optionally displayed to the user for support.
|
||||
res.statusCode = 500;
|
||||
res.end(res.sentry + "\n");
|
||||
});
|
||||
|
||||
app.listen(port, () => {
|
||||
console.log(`⚡️[server]: Server is running at http://localhost:${port}`);
|
||||
});
|
||||
|
||||
@@ -16,6 +16,7 @@ import {
|
||||
} from "../common/schemas";
|
||||
|
||||
const errorResponse: EndpointSpecResponse = {
|
||||
matches: ({ statusCode }) => statusCode < 200 || statusCode >= 300,
|
||||
success: false,
|
||||
name: "Error",
|
||||
description: "Error response",
|
||||
@@ -125,41 +126,40 @@ export const listRecords: EndpointSpec = {
|
||||
}),
|
||||
},
|
||||
},
|
||||
responses: {
|
||||
200: [
|
||||
{
|
||||
success: true,
|
||||
name: "Success",
|
||||
description: "Typical success response",
|
||||
schema: makeObjectSchema("List records success body", {
|
||||
optionalProperties: {
|
||||
offset: makeStringSchema(
|
||||
"offset",
|
||||
"To fetch the next page of records, include offset from the previous request in the next request's parameters."
|
||||
),
|
||||
},
|
||||
requiredProperties: {
|
||||
records: makeArraySchema(
|
||||
"Records",
|
||||
makeObjectSchema("Record", {
|
||||
requiredProperties: {
|
||||
id: makeStringSchema("Record ID"),
|
||||
createdTime: makeStringSchema(
|
||||
"createdTime",
|
||||
`A date timestamp in the ISO format, eg:"2018-01-01T00:00:00.000Z"`
|
||||
),
|
||||
fields: makeObjectSchema("Fields", {
|
||||
additionalProperties: FieldSchema,
|
||||
}),
|
||||
},
|
||||
})
|
||||
),
|
||||
},
|
||||
}),
|
||||
},
|
||||
],
|
||||
default: [errorResponse],
|
||||
},
|
||||
responses: [
|
||||
{
|
||||
matches: ({ statusCode }) => statusCode === 200,
|
||||
success: true,
|
||||
name: "Success",
|
||||
description: "Typical success response",
|
||||
schema: makeObjectSchema("List records success body", {
|
||||
optionalProperties: {
|
||||
offset: makeStringSchema(
|
||||
"offset",
|
||||
"To fetch the next page of records, include offset from the previous request in the next request's parameters."
|
||||
),
|
||||
},
|
||||
requiredProperties: {
|
||||
records: makeArraySchema(
|
||||
"Records",
|
||||
makeObjectSchema("Record", {
|
||||
requiredProperties: {
|
||||
id: makeStringSchema("Record ID"),
|
||||
createdTime: makeStringSchema(
|
||||
"createdTime",
|
||||
`A date timestamp in the ISO format, eg:"2018-01-01T00:00:00.000Z"`
|
||||
),
|
||||
fields: makeObjectSchema("Fields", {
|
||||
additionalProperties: FieldSchema,
|
||||
}),
|
||||
},
|
||||
})
|
||||
),
|
||||
},
|
||||
}),
|
||||
},
|
||||
errorResponse,
|
||||
],
|
||||
};
|
||||
|
||||
export const getRecord: EndpointSpec = {
|
||||
@@ -188,28 +188,27 @@ export const getRecord: EndpointSpec = {
|
||||
"Content-Type": "application/json; charset=utf-8",
|
||||
},
|
||||
},
|
||||
responses: {
|
||||
200: [
|
||||
{
|
||||
success: true,
|
||||
name: "Success",
|
||||
description: "Typical success response",
|
||||
schema: makeObjectSchema("Successful response", {
|
||||
requiredProperties: {
|
||||
createdTime: makeStringSchema(
|
||||
"createdTime",
|
||||
"When the record was created"
|
||||
),
|
||||
fields: makeObjectSchema("Fields", {
|
||||
additionalProperties: FieldSchema,
|
||||
}),
|
||||
id: makeStringSchema("id", "The record id"),
|
||||
},
|
||||
}),
|
||||
},
|
||||
],
|
||||
default: [errorResponse],
|
||||
},
|
||||
responses: [
|
||||
{
|
||||
matches: ({ statusCode }) => statusCode === 200,
|
||||
success: true,
|
||||
name: "Success",
|
||||
description: "Typical success response",
|
||||
schema: makeObjectSchema("Successful response", {
|
||||
requiredProperties: {
|
||||
createdTime: makeStringSchema(
|
||||
"createdTime",
|
||||
"When the record was created"
|
||||
),
|
||||
fields: makeObjectSchema("Fields", {
|
||||
additionalProperties: FieldSchema,
|
||||
}),
|
||||
id: makeStringSchema("id", "The record id"),
|
||||
},
|
||||
}),
|
||||
},
|
||||
errorResponse,
|
||||
],
|
||||
};
|
||||
|
||||
export const updateRecords: EndpointSpec = {
|
||||
@@ -272,64 +271,63 @@ export const updateRecords: EndpointSpec = {
|
||||
}),
|
||||
},
|
||||
},
|
||||
responses: {
|
||||
200: [
|
||||
{
|
||||
success: true,
|
||||
name: "Success",
|
||||
description: "Typical success response",
|
||||
schema: makeAnyOf("Update/upsert records success body", [
|
||||
makeObjectSchema("Update response", {
|
||||
requiredProperties: {
|
||||
records: makeArraySchema(
|
||||
"Records",
|
||||
makeObjectSchema("Record", {
|
||||
requiredProperties: {
|
||||
id: makeStringSchema("Record ID"),
|
||||
createdTime: makeStringSchema(
|
||||
"createdTime",
|
||||
`A date timestamp in the ISO format, eg:"2018-01-01T00:00:00.000Z"`
|
||||
),
|
||||
fields: makeObjectSchema("Fields", {
|
||||
additionalProperties: FieldSchema,
|
||||
}),
|
||||
},
|
||||
})
|
||||
),
|
||||
},
|
||||
}),
|
||||
makeObjectSchema("Upsert response", {
|
||||
requiredProperties: {
|
||||
createdRecords: makeArraySchema(
|
||||
"Created records",
|
||||
makeStringSchema("Record ID")
|
||||
),
|
||||
updatedRecords: makeArraySchema(
|
||||
"Updated records",
|
||||
makeStringSchema("Record ID")
|
||||
),
|
||||
records: makeArraySchema(
|
||||
"Records",
|
||||
makeObjectSchema("Record", {
|
||||
requiredProperties: {
|
||||
id: makeStringSchema("Record ID"),
|
||||
createdTime: makeStringSchema(
|
||||
"createdTime",
|
||||
`A date timestamp in the ISO format, eg:"2018-01-01T00:00:00.000Z"`
|
||||
),
|
||||
fields: makeObjectSchema("Fields", {
|
||||
additionalProperties: FieldSchema,
|
||||
}),
|
||||
},
|
||||
})
|
||||
),
|
||||
},
|
||||
}),
|
||||
]),
|
||||
},
|
||||
],
|
||||
default: [errorResponse],
|
||||
},
|
||||
responses: [
|
||||
{
|
||||
matches: ({ statusCode }) => statusCode === 200,
|
||||
success: true,
|
||||
name: "Success",
|
||||
description: "Typical success response",
|
||||
schema: makeAnyOf("Update/upsert records success body", [
|
||||
makeObjectSchema("Update response", {
|
||||
requiredProperties: {
|
||||
records: makeArraySchema(
|
||||
"Records",
|
||||
makeObjectSchema("Record", {
|
||||
requiredProperties: {
|
||||
id: makeStringSchema("Record ID"),
|
||||
createdTime: makeStringSchema(
|
||||
"createdTime",
|
||||
`A date timestamp in the ISO format, eg:"2018-01-01T00:00:00.000Z"`
|
||||
),
|
||||
fields: makeObjectSchema("Fields", {
|
||||
additionalProperties: FieldSchema,
|
||||
}),
|
||||
},
|
||||
})
|
||||
),
|
||||
},
|
||||
}),
|
||||
makeObjectSchema("Upsert response", {
|
||||
requiredProperties: {
|
||||
createdRecords: makeArraySchema(
|
||||
"Created records",
|
||||
makeStringSchema("Record ID")
|
||||
),
|
||||
updatedRecords: makeArraySchema(
|
||||
"Updated records",
|
||||
makeStringSchema("Record ID")
|
||||
),
|
||||
records: makeArraySchema(
|
||||
"Records",
|
||||
makeObjectSchema("Record", {
|
||||
requiredProperties: {
|
||||
id: makeStringSchema("Record ID"),
|
||||
createdTime: makeStringSchema(
|
||||
"createdTime",
|
||||
`A date timestamp in the ISO format, eg:"2018-01-01T00:00:00.000Z"`
|
||||
),
|
||||
fields: makeObjectSchema("Fields", {
|
||||
additionalProperties: FieldSchema,
|
||||
}),
|
||||
},
|
||||
})
|
||||
),
|
||||
},
|
||||
}),
|
||||
]),
|
||||
},
|
||||
errorResponse,
|
||||
],
|
||||
};
|
||||
|
||||
export const updateRecord: EndpointSpec = {
|
||||
@@ -372,28 +370,27 @@ export const updateRecord: EndpointSpec = {
|
||||
}),
|
||||
},
|
||||
},
|
||||
responses: {
|
||||
200: [
|
||||
{
|
||||
success: true,
|
||||
name: "Success",
|
||||
description: "Typical success response",
|
||||
schema: makeObjectSchema("Update record success body", {
|
||||
requiredProperties: {
|
||||
id: makeStringSchema("Record ID"),
|
||||
createdTime: makeStringSchema(
|
||||
"createdTime",
|
||||
`A date timestamp in the ISO format, eg:"2018-01-01T00:00:00.000Z"`
|
||||
),
|
||||
fields: makeObjectSchema("Fields", {
|
||||
additionalProperties: FieldSchema,
|
||||
}),
|
||||
},
|
||||
}),
|
||||
},
|
||||
],
|
||||
default: [errorResponse],
|
||||
},
|
||||
responses: [
|
||||
{
|
||||
matches: ({ statusCode }) => statusCode === 200,
|
||||
success: true,
|
||||
name: "Success",
|
||||
description: "Typical success response",
|
||||
schema: makeObjectSchema("Update record success body", {
|
||||
requiredProperties: {
|
||||
id: makeStringSchema("Record ID"),
|
||||
createdTime: makeStringSchema(
|
||||
"createdTime",
|
||||
`A date timestamp in the ISO format, eg:"2018-01-01T00:00:00.000Z"`
|
||||
),
|
||||
fields: makeObjectSchema("Fields", {
|
||||
additionalProperties: FieldSchema,
|
||||
}),
|
||||
},
|
||||
}),
|
||||
},
|
||||
errorResponse,
|
||||
],
|
||||
};
|
||||
|
||||
export const createRecords: EndpointSpec = {
|
||||
@@ -443,49 +440,48 @@ export const createRecords: EndpointSpec = {
|
||||
}),
|
||||
},
|
||||
},
|
||||
responses: {
|
||||
200: [
|
||||
{
|
||||
success: true,
|
||||
name: "Success",
|
||||
description: "Typical success response",
|
||||
schema: makeAnyOf("Create records success body", [
|
||||
makeObjectSchema("Multiple records created response", {
|
||||
requiredProperties: {
|
||||
records: makeArraySchema(
|
||||
"Records",
|
||||
makeObjectSchema("Record", {
|
||||
requiredProperties: {
|
||||
id: makeStringSchema("Record ID"),
|
||||
createdTime: makeStringSchema(
|
||||
"createdTime",
|
||||
`A date timestamp in the ISO format, eg:"2018-01-01T00:00:00.000Z"`
|
||||
),
|
||||
fields: makeObjectSchema("Fields", {
|
||||
additionalProperties: FieldSchema,
|
||||
}),
|
||||
},
|
||||
})
|
||||
),
|
||||
},
|
||||
}),
|
||||
makeObjectSchema("Single record created response", {
|
||||
requiredProperties: {
|
||||
id: makeStringSchema("Record ID"),
|
||||
createdTime: makeStringSchema(
|
||||
"createdTime",
|
||||
`A date timestamp in the ISO format, eg:"2018-01-01T00:00:00.000Z"`
|
||||
),
|
||||
fields: makeObjectSchema("Fields", {
|
||||
additionalProperties: FieldSchema,
|
||||
}),
|
||||
},
|
||||
}),
|
||||
]),
|
||||
},
|
||||
],
|
||||
default: [errorResponse],
|
||||
},
|
||||
responses: [
|
||||
{
|
||||
matches: ({ statusCode }) => statusCode === 200,
|
||||
success: true,
|
||||
name: "Success",
|
||||
description: "Typical success response",
|
||||
schema: makeAnyOf("Create records success body", [
|
||||
makeObjectSchema("Multiple records created response", {
|
||||
requiredProperties: {
|
||||
records: makeArraySchema(
|
||||
"Records",
|
||||
makeObjectSchema("Record", {
|
||||
requiredProperties: {
|
||||
id: makeStringSchema("Record ID"),
|
||||
createdTime: makeStringSchema(
|
||||
"createdTime",
|
||||
`A date timestamp in the ISO format, eg:"2018-01-01T00:00:00.000Z"`
|
||||
),
|
||||
fields: makeObjectSchema("Fields", {
|
||||
additionalProperties: FieldSchema,
|
||||
}),
|
||||
},
|
||||
})
|
||||
),
|
||||
},
|
||||
}),
|
||||
makeObjectSchema("Single record created response", {
|
||||
requiredProperties: {
|
||||
id: makeStringSchema("Record ID"),
|
||||
createdTime: makeStringSchema(
|
||||
"createdTime",
|
||||
`A date timestamp in the ISO format, eg:"2018-01-01T00:00:00.000Z"`
|
||||
),
|
||||
fields: makeObjectSchema("Fields", {
|
||||
additionalProperties: FieldSchema,
|
||||
}),
|
||||
},
|
||||
}),
|
||||
]),
|
||||
},
|
||||
errorResponse,
|
||||
],
|
||||
};
|
||||
|
||||
export const deleteRecords: EndpointSpec = {
|
||||
@@ -525,35 +521,34 @@ export const deleteRecords: EndpointSpec = {
|
||||
"Content-Type": "application/json; charset=utf-8",
|
||||
},
|
||||
},
|
||||
responses: {
|
||||
200: [
|
||||
{
|
||||
success: true,
|
||||
name: "Success",
|
||||
description: "Typical success response",
|
||||
schema: makeObjectSchema("Delete records response", {
|
||||
requiredProperties: {
|
||||
records: makeArraySchema(
|
||||
"Records",
|
||||
makeObjectSchema("Deleted record", {
|
||||
requiredProperties: {
|
||||
id: makeStringSchema("Record ID"),
|
||||
deleted: makeBooleanSchema(
|
||||
"deleted",
|
||||
"Whether the record was deleted",
|
||||
{
|
||||
enum: true,
|
||||
}
|
||||
),
|
||||
},
|
||||
})
|
||||
),
|
||||
},
|
||||
}),
|
||||
},
|
||||
],
|
||||
default: [errorResponse],
|
||||
},
|
||||
responses: [
|
||||
{
|
||||
matches: ({ statusCode }) => statusCode === 200,
|
||||
success: true,
|
||||
name: "Success",
|
||||
description: "Typical success response",
|
||||
schema: makeObjectSchema("Delete records response", {
|
||||
requiredProperties: {
|
||||
records: makeArraySchema(
|
||||
"Records",
|
||||
makeObjectSchema("Deleted record", {
|
||||
requiredProperties: {
|
||||
id: makeStringSchema("Record ID"),
|
||||
deleted: makeBooleanSchema(
|
||||
"deleted",
|
||||
"Whether the record was deleted",
|
||||
{
|
||||
enum: true,
|
||||
}
|
||||
),
|
||||
},
|
||||
})
|
||||
),
|
||||
},
|
||||
}),
|
||||
},
|
||||
errorResponse,
|
||||
],
|
||||
};
|
||||
|
||||
export const deleteRecord: EndpointSpec = {
|
||||
@@ -581,26 +576,25 @@ export const deleteRecord: EndpointSpec = {
|
||||
"Content-Type": "application/json; charset=utf-8",
|
||||
},
|
||||
},
|
||||
responses: {
|
||||
200: [
|
||||
{
|
||||
success: true,
|
||||
name: "Success",
|
||||
description: "Typical success response",
|
||||
schema: makeObjectSchema("Delete records response", {
|
||||
requiredProperties: {
|
||||
id: makeStringSchema("Record ID"),
|
||||
deleted: makeBooleanSchema(
|
||||
"deleted",
|
||||
"Whether the record was deleted",
|
||||
{
|
||||
enum: true,
|
||||
}
|
||||
),
|
||||
},
|
||||
}),
|
||||
},
|
||||
],
|
||||
default: [errorResponse],
|
||||
},
|
||||
responses: [
|
||||
{
|
||||
matches: ({ statusCode }) => statusCode === 200,
|
||||
success: true,
|
||||
name: "Success",
|
||||
description: "Typical success response",
|
||||
schema: makeObjectSchema("Delete records response", {
|
||||
requiredProperties: {
|
||||
id: makeStringSchema("Record ID"),
|
||||
deleted: makeBooleanSchema(
|
||||
"deleted",
|
||||
"Whether the record was deleted",
|
||||
{
|
||||
enum: true,
|
||||
}
|
||||
),
|
||||
},
|
||||
}),
|
||||
},
|
||||
errorResponse,
|
||||
],
|
||||
};
|
||||
|
||||
@@ -1,10 +1,12 @@
|
||||
import { Catalog } from "core/catalog";
|
||||
import { airtable } from "./airtable";
|
||||
import { notion } from "./notion";
|
||||
import { sendgrid } from "./sendgrid";
|
||||
|
||||
export const catalog: Catalog = {
|
||||
services: {
|
||||
airtable,
|
||||
notion,
|
||||
sendgrid,
|
||||
},
|
||||
};
|
||||
|
||||
@@ -0,0 +1,26 @@
|
||||
import { makeSimpleActions } from "core/action/makeAction";
|
||||
import endpoints from "../endpoints/endpoints";
|
||||
|
||||
const actions = makeSimpleActions(
|
||||
endpoints,
|
||||
(specs) => {
|
||||
const paramsWithoutVersion = specs.input.parameters?.filter(
|
||||
(p) => p.name !== "Notion-Version"
|
||||
);
|
||||
return {
|
||||
input: {
|
||||
...specs.input,
|
||||
parameters: paramsWithoutVersion,
|
||||
},
|
||||
output: specs.output,
|
||||
};
|
||||
},
|
||||
(data) => {
|
||||
data.parameters = {
|
||||
...data.parameters,
|
||||
"Notion-Version": "2022-06-28",
|
||||
};
|
||||
return data;
|
||||
}
|
||||
);
|
||||
export default actions;
|
||||
@@ -0,0 +1,16 @@
|
||||
import { IntegrationAuthentication } from "core/authentication/types";
|
||||
|
||||
export const authentication: IntegrationAuthentication = {
|
||||
oauth: {
|
||||
type: "oauth2",
|
||||
placement: {
|
||||
in: "header",
|
||||
type: "bearer",
|
||||
key: "Authorization",
|
||||
},
|
||||
authorizationUrl: "https://api.notion.com/v1/oauth/authorize",
|
||||
tokenUrl: "https://api.notion.com/v1/oauth/token",
|
||||
flow: "accessCode",
|
||||
scopes: {},
|
||||
},
|
||||
};
|
||||
@@ -0,0 +1,8 @@
|
||||
import { makeEndpoints } from "core/endpoint/endpoint";
|
||||
import { authentication } from "../authentication";
|
||||
import * as specs from "./specs";
|
||||
|
||||
const baseUrl = "https://api.notion.com/v1";
|
||||
|
||||
const endpoints = makeEndpoints(baseUrl, authentication, specs);
|
||||
export default endpoints;
|
||||
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,59 @@
|
||||
import { JSONSchema } from "core/schemas/types";
|
||||
|
||||
export const IdRequest: JSONSchema = {
|
||||
type: ["string"],
|
||||
};
|
||||
|
||||
export const NeverRecord: JSONSchema = {
|
||||
type: "object",
|
||||
additionalProperties: {
|
||||
not: {},
|
||||
},
|
||||
};
|
||||
|
||||
export const EmptyObject: JSONSchema = NeverRecord;
|
||||
|
||||
export const StringRequest: JSONSchema = {
|
||||
type: "string",
|
||||
};
|
||||
|
||||
export const SelectColor: JSONSchema = {
|
||||
type: "string",
|
||||
enum: [
|
||||
"default",
|
||||
"gray",
|
||||
"brown",
|
||||
"orange",
|
||||
"yellow",
|
||||
"green",
|
||||
"blue",
|
||||
"purple",
|
||||
"pink",
|
||||
"red",
|
||||
],
|
||||
};
|
||||
|
||||
export const ApiColor: JSONSchema = {
|
||||
type: "string",
|
||||
enum: [
|
||||
"default",
|
||||
"gray",
|
||||
"brown",
|
||||
"orange",
|
||||
"yellow",
|
||||
"green",
|
||||
"blue",
|
||||
"purple",
|
||||
"pink",
|
||||
"red",
|
||||
"gray_background",
|
||||
"brown_background",
|
||||
"orange_background",
|
||||
"yellow_background",
|
||||
"green_background",
|
||||
"blue_background",
|
||||
"purple_background",
|
||||
"pink_background",
|
||||
"red_background",
|
||||
],
|
||||
};
|
||||
@@ -0,0 +1,243 @@
|
||||
import { JSONSchema } from "core/schemas/types";
|
||||
import { DatabasePropertyConfigResponse } from "./databasePropertyConfigs";
|
||||
import { EmojiRequest } from "./emoji";
|
||||
import { PartialUserObjectResponse } from "./person";
|
||||
import { TextRequest } from "./requests";
|
||||
import { RichTextItemResponse } from "./responses";
|
||||
|
||||
export const DatabasePropertyConfigResponseRecord: JSONSchema = {
|
||||
type: "object",
|
||||
additionalProperties: DatabasePropertyConfigResponse,
|
||||
};
|
||||
|
||||
export const PartialDatabaseObjectResponse: JSONSchema = {
|
||||
type: "object",
|
||||
properties: {
|
||||
object: {
|
||||
type: "string",
|
||||
const: "database",
|
||||
},
|
||||
id: {
|
||||
type: "string",
|
||||
},
|
||||
properties: DatabasePropertyConfigResponseRecord,
|
||||
},
|
||||
required: ["object", "id", "properties"],
|
||||
additionalProperties: false,
|
||||
};
|
||||
|
||||
export const DatabaseObjectResponse: JSONSchema = {
|
||||
type: "object",
|
||||
properties: {
|
||||
title: {
|
||||
type: "array",
|
||||
items: RichTextItemResponse,
|
||||
},
|
||||
description: {
|
||||
type: "array",
|
||||
items: RichTextItemResponse,
|
||||
},
|
||||
icon: {
|
||||
anyOf: [
|
||||
{
|
||||
type: "object",
|
||||
properties: {
|
||||
type: {
|
||||
type: "string",
|
||||
const: "emoji",
|
||||
},
|
||||
emoji: EmojiRequest,
|
||||
},
|
||||
required: ["type", "emoji"],
|
||||
additionalProperties: false,
|
||||
},
|
||||
{
|
||||
type: "null",
|
||||
},
|
||||
{
|
||||
type: "object",
|
||||
properties: {
|
||||
type: {
|
||||
type: "string",
|
||||
const: "external",
|
||||
},
|
||||
external: {
|
||||
type: "object",
|
||||
properties: {
|
||||
url: TextRequest,
|
||||
},
|
||||
required: ["url"],
|
||||
additionalProperties: false,
|
||||
},
|
||||
},
|
||||
required: ["type", "external"],
|
||||
additionalProperties: false,
|
||||
},
|
||||
{
|
||||
type: "object",
|
||||
properties: {
|
||||
type: {
|
||||
type: "string",
|
||||
const: "file",
|
||||
},
|
||||
file: {
|
||||
type: "object",
|
||||
properties: {
|
||||
url: {
|
||||
type: "string",
|
||||
},
|
||||
expiry_time: {
|
||||
type: "string",
|
||||
},
|
||||
},
|
||||
required: ["url", "expiry_time"],
|
||||
additionalProperties: false,
|
||||
},
|
||||
},
|
||||
required: ["type", "file"],
|
||||
additionalProperties: false,
|
||||
},
|
||||
],
|
||||
},
|
||||
cover: {
|
||||
anyOf: [
|
||||
{
|
||||
type: "object",
|
||||
properties: {
|
||||
type: {
|
||||
type: "string",
|
||||
const: "external",
|
||||
},
|
||||
external: {
|
||||
type: "object",
|
||||
properties: {
|
||||
url: TextRequest,
|
||||
},
|
||||
required: ["url"],
|
||||
additionalProperties: false,
|
||||
},
|
||||
},
|
||||
required: ["type", "external"],
|
||||
additionalProperties: false,
|
||||
},
|
||||
{
|
||||
type: "null",
|
||||
},
|
||||
{
|
||||
type: "object",
|
||||
properties: {
|
||||
type: {
|
||||
type: "string",
|
||||
const: "file",
|
||||
},
|
||||
file: {
|
||||
type: "object",
|
||||
properties: {
|
||||
url: {
|
||||
type: "string",
|
||||
},
|
||||
expiry_time: {
|
||||
type: "string",
|
||||
},
|
||||
},
|
||||
required: ["url", "expiry_time"],
|
||||
additionalProperties: false,
|
||||
},
|
||||
},
|
||||
required: ["type", "file"],
|
||||
additionalProperties: false,
|
||||
},
|
||||
],
|
||||
},
|
||||
properties: DatabasePropertyConfigResponseRecord,
|
||||
parent: {
|
||||
anyOf: [
|
||||
{
|
||||
type: "object",
|
||||
properties: {
|
||||
type: {
|
||||
type: "string",
|
||||
const: "page_id",
|
||||
},
|
||||
page_id: {
|
||||
type: "string",
|
||||
},
|
||||
},
|
||||
required: ["type", "page_id"],
|
||||
additionalProperties: false,
|
||||
},
|
||||
{
|
||||
type: "object",
|
||||
properties: {
|
||||
type: {
|
||||
type: "string",
|
||||
const: "workspace",
|
||||
},
|
||||
workspace: {
|
||||
type: "boolean",
|
||||
const: true,
|
||||
},
|
||||
},
|
||||
required: ["type", "workspace"],
|
||||
additionalProperties: false,
|
||||
},
|
||||
{
|
||||
type: "object",
|
||||
properties: {
|
||||
type: {
|
||||
type: "string",
|
||||
const: "block_id",
|
||||
},
|
||||
block_id: {
|
||||
type: "string",
|
||||
},
|
||||
},
|
||||
required: ["type", "block_id"],
|
||||
additionalProperties: false,
|
||||
},
|
||||
],
|
||||
},
|
||||
created_by: PartialUserObjectResponse,
|
||||
last_edited_by: PartialUserObjectResponse,
|
||||
is_inline: {
|
||||
type: "boolean",
|
||||
},
|
||||
object: {
|
||||
type: "string",
|
||||
const: "database",
|
||||
},
|
||||
id: {
|
||||
type: "string",
|
||||
},
|
||||
created_time: {
|
||||
type: "string",
|
||||
},
|
||||
last_edited_time: {
|
||||
type: "string",
|
||||
},
|
||||
archived: {
|
||||
type: "boolean",
|
||||
},
|
||||
url: {
|
||||
type: "string",
|
||||
},
|
||||
},
|
||||
required: [
|
||||
"title",
|
||||
"description",
|
||||
"icon",
|
||||
"cover",
|
||||
"properties",
|
||||
"parent",
|
||||
"created_by",
|
||||
"last_edited_by",
|
||||
"is_inline",
|
||||
"object",
|
||||
"id",
|
||||
"created_time",
|
||||
"last_edited_time",
|
||||
"archived",
|
||||
"url",
|
||||
],
|
||||
additionalProperties: false,
|
||||
};
|
||||
+599
@@ -0,0 +1,599 @@
|
||||
import { JSONSchema } from "core/schemas/types";
|
||||
import { EmptyObject, IdRequest, SelectColor, StringRequest } from "./common";
|
||||
import { RollupFunction } from "./functions";
|
||||
import { SelectPropertyResponse } from "./responses";
|
||||
|
||||
export const NumberFormat: JSONSchema = {
|
||||
type: "string",
|
||||
enum: [
|
||||
"number",
|
||||
"number_with_commas",
|
||||
"percent",
|
||||
"dollar",
|
||||
"canadian_dollar",
|
||||
"singapore_dollar",
|
||||
"euro",
|
||||
"pound",
|
||||
"yen",
|
||||
"ruble",
|
||||
"rupee",
|
||||
"won",
|
||||
"yuan",
|
||||
"real",
|
||||
"lira",
|
||||
"rupiah",
|
||||
"franc",
|
||||
"hong_kong_dollar",
|
||||
"new_zealand_dollar",
|
||||
"krona",
|
||||
"norwegian_krone",
|
||||
"mexican_peso",
|
||||
"rand",
|
||||
"new_taiwan_dollar",
|
||||
"danish_krone",
|
||||
"zloty",
|
||||
"baht",
|
||||
"forint",
|
||||
"koruna",
|
||||
"shekel",
|
||||
"chilean_peso",
|
||||
"philippine_peso",
|
||||
"dirham",
|
||||
"colombian_peso",
|
||||
"riyal",
|
||||
"ringgit",
|
||||
"leu",
|
||||
"argentine_peso",
|
||||
"uruguayan_peso",
|
||||
],
|
||||
};
|
||||
|
||||
export const NumberDatabasePropertyConfigResponse: JSONSchema = {
|
||||
type: "object",
|
||||
properties: {
|
||||
type: {
|
||||
type: "string",
|
||||
const: "number",
|
||||
},
|
||||
number: {
|
||||
type: "object",
|
||||
properties: {
|
||||
format: NumberFormat,
|
||||
},
|
||||
required: ["format"],
|
||||
additionalProperties: false,
|
||||
},
|
||||
id: {
|
||||
type: "string",
|
||||
},
|
||||
name: {
|
||||
type: "string",
|
||||
},
|
||||
},
|
||||
required: ["type", "number", "id", "name"],
|
||||
additionalProperties: false,
|
||||
};
|
||||
|
||||
export const FormulaDatabasePropertyConfigResponse: JSONSchema = {
|
||||
type: "object",
|
||||
properties: {
|
||||
type: {
|
||||
type: "string",
|
||||
const: "formula",
|
||||
},
|
||||
formula: {
|
||||
type: "object",
|
||||
properties: {
|
||||
expression: {
|
||||
type: "string",
|
||||
},
|
||||
},
|
||||
required: ["expression"],
|
||||
additionalProperties: false,
|
||||
},
|
||||
id: {
|
||||
type: "string",
|
||||
},
|
||||
name: {
|
||||
type: "string",
|
||||
},
|
||||
},
|
||||
required: ["type", "formula", "id", "name"],
|
||||
additionalProperties: false,
|
||||
};
|
||||
|
||||
export const SelectDatabasePropertyConfigResponse: JSONSchema = {
|
||||
type: "object",
|
||||
properties: {
|
||||
type: {
|
||||
type: "string",
|
||||
const: "select",
|
||||
},
|
||||
select: {
|
||||
type: "object",
|
||||
properties: {
|
||||
options: {
|
||||
type: "array",
|
||||
items: SelectPropertyResponse,
|
||||
},
|
||||
},
|
||||
required: ["options"],
|
||||
additionalProperties: false,
|
||||
},
|
||||
id: {
|
||||
type: "string",
|
||||
},
|
||||
name: {
|
||||
type: "string",
|
||||
},
|
||||
},
|
||||
required: ["type", "select", "id", "name"],
|
||||
additionalProperties: false,
|
||||
};
|
||||
|
||||
export const MultiSelectDatabasePropertyConfigResponse: JSONSchema = {
|
||||
type: "object",
|
||||
properties: {
|
||||
type: {
|
||||
type: "string",
|
||||
const: "multi_select",
|
||||
},
|
||||
multi_select: {
|
||||
type: "object",
|
||||
properties: {
|
||||
options: {
|
||||
type: "array",
|
||||
items: SelectPropertyResponse,
|
||||
},
|
||||
},
|
||||
required: ["options"],
|
||||
additionalProperties: false,
|
||||
},
|
||||
id: {
|
||||
type: "string",
|
||||
},
|
||||
name: {
|
||||
type: "string",
|
||||
},
|
||||
},
|
||||
required: ["type", "multi_select", "id", "name"],
|
||||
additionalProperties: false,
|
||||
};
|
||||
|
||||
export const StatusPropertyResponse: JSONSchema = {
|
||||
type: "object",
|
||||
properties: {
|
||||
id: StringRequest,
|
||||
name: StringRequest,
|
||||
color: SelectColor,
|
||||
},
|
||||
required: ["id", "name", "color"],
|
||||
additionalProperties: false,
|
||||
};
|
||||
|
||||
export const StatusDatabasePropertyConfigResponse: JSONSchema = {
|
||||
type: "object",
|
||||
properties: {
|
||||
type: {
|
||||
type: "string",
|
||||
const: "status",
|
||||
},
|
||||
status: {
|
||||
type: "object",
|
||||
properties: {
|
||||
options: {
|
||||
type: "array",
|
||||
items: StatusPropertyResponse,
|
||||
},
|
||||
groups: {
|
||||
type: "array",
|
||||
items: {
|
||||
type: "object",
|
||||
properties: {
|
||||
id: StringRequest,
|
||||
name: StringRequest,
|
||||
color: SelectColor,
|
||||
option_ids: {
|
||||
type: "array",
|
||||
items: {
|
||||
type: "string",
|
||||
},
|
||||
},
|
||||
},
|
||||
required: ["id", "name", "color", "option_ids"],
|
||||
additionalProperties: false,
|
||||
},
|
||||
},
|
||||
},
|
||||
required: ["options", "groups"],
|
||||
additionalProperties: false,
|
||||
},
|
||||
id: {
|
||||
type: "string",
|
||||
},
|
||||
name: {
|
||||
type: "string",
|
||||
},
|
||||
},
|
||||
required: ["type", "status", "id", "name"],
|
||||
additionalProperties: false,
|
||||
};
|
||||
|
||||
export const SinglePropertyDatabasePropertyRelationConfigResponse: JSONSchema =
|
||||
{
|
||||
type: "object",
|
||||
properties: {
|
||||
type: {
|
||||
type: "string",
|
||||
const: "single_property",
|
||||
},
|
||||
single_property: EmptyObject,
|
||||
database_id: IdRequest,
|
||||
},
|
||||
required: ["type", "single_property", "database_id"],
|
||||
additionalProperties: false,
|
||||
};
|
||||
|
||||
export const DualPropertyDatabasePropertyRelationConfigResponse: JSONSchema = {
|
||||
type: "object",
|
||||
properties: {
|
||||
type: {
|
||||
type: "string",
|
||||
const: "dual_property",
|
||||
},
|
||||
dual_property: {
|
||||
type: "object",
|
||||
properties: {
|
||||
synced_property_id: StringRequest,
|
||||
synced_property_name: StringRequest,
|
||||
},
|
||||
required: ["synced_property_id", "synced_property_name"],
|
||||
additionalProperties: false,
|
||||
},
|
||||
database_id: IdRequest,
|
||||
},
|
||||
required: ["type", "dual_property", "database_id"],
|
||||
additionalProperties: false,
|
||||
};
|
||||
|
||||
export const DatabasePropertyRelationConfigResponse: JSONSchema = {
|
||||
anyOf: [
|
||||
SinglePropertyDatabasePropertyRelationConfigResponse,
|
||||
DualPropertyDatabasePropertyRelationConfigResponse,
|
||||
],
|
||||
};
|
||||
|
||||
export const RelationDatabasePropertyConfigResponse: JSONSchema = {
|
||||
type: "object",
|
||||
properties: {
|
||||
type: {
|
||||
type: "string",
|
||||
const: "relation",
|
||||
},
|
||||
relation: DatabasePropertyRelationConfigResponse,
|
||||
id: {
|
||||
type: "string",
|
||||
},
|
||||
name: {
|
||||
type: "string",
|
||||
},
|
||||
},
|
||||
required: ["type", "relation", "id", "name"],
|
||||
additionalProperties: false,
|
||||
};
|
||||
|
||||
export const RollupDatabasePropertyConfigResponse: JSONSchema = {
|
||||
type: "object",
|
||||
properties: {
|
||||
type: {
|
||||
type: "string",
|
||||
const: "rollup",
|
||||
},
|
||||
rollup: {
|
||||
type: "object",
|
||||
properties: {
|
||||
rollup_property_name: {
|
||||
type: "string",
|
||||
},
|
||||
relation_property_name: {
|
||||
type: "string",
|
||||
},
|
||||
rollup_property_id: {
|
||||
type: "string",
|
||||
},
|
||||
relation_property_id: {
|
||||
type: "string",
|
||||
},
|
||||
function: RollupFunction,
|
||||
},
|
||||
required: [
|
||||
"rollup_property_name",
|
||||
"relation_property_name",
|
||||
"rollup_property_id",
|
||||
"relation_property_id",
|
||||
"function",
|
||||
],
|
||||
additionalProperties: false,
|
||||
},
|
||||
id: {
|
||||
type: "string",
|
||||
},
|
||||
name: {
|
||||
type: "string",
|
||||
},
|
||||
},
|
||||
required: ["type", "rollup", "id", "name"],
|
||||
additionalProperties: false,
|
||||
};
|
||||
|
||||
export const TitleDatabasePropertyConfigResponse: JSONSchema = {
|
||||
type: "object",
|
||||
properties: {
|
||||
type: {
|
||||
type: "string",
|
||||
const: "title",
|
||||
},
|
||||
title: EmptyObject,
|
||||
id: {
|
||||
type: "string",
|
||||
},
|
||||
name: {
|
||||
type: "string",
|
||||
},
|
||||
},
|
||||
required: ["type", "title", "id", "name"],
|
||||
additionalProperties: false,
|
||||
};
|
||||
|
||||
export const RichTextDatabasePropertyConfigResponse: JSONSchema = {
|
||||
type: "object",
|
||||
properties: {
|
||||
type: {
|
||||
type: "string",
|
||||
const: "rich_text",
|
||||
},
|
||||
rich_text: EmptyObject,
|
||||
id: {
|
||||
type: "string",
|
||||
},
|
||||
name: {
|
||||
type: "string",
|
||||
},
|
||||
},
|
||||
required: ["type", "rich_text", "id", "name"],
|
||||
additionalProperties: false,
|
||||
};
|
||||
|
||||
export const UrlDatabasePropertyConfigResponse: JSONSchema = {
|
||||
type: "object",
|
||||
properties: {
|
||||
type: {
|
||||
type: "string",
|
||||
const: "url",
|
||||
},
|
||||
url: EmptyObject,
|
||||
id: {
|
||||
type: "string",
|
||||
},
|
||||
name: {
|
||||
type: "string",
|
||||
},
|
||||
},
|
||||
required: ["type", "url", "id", "name"],
|
||||
additionalProperties: false,
|
||||
};
|
||||
|
||||
export const PeopleDatabasePropertyConfigResponse: JSONSchema = {
|
||||
type: "object",
|
||||
properties: {
|
||||
type: {
|
||||
type: "string",
|
||||
const: "people",
|
||||
},
|
||||
people: EmptyObject,
|
||||
id: {
|
||||
type: "string",
|
||||
},
|
||||
name: {
|
||||
type: "string",
|
||||
},
|
||||
},
|
||||
required: ["type", "people", "id", "name"],
|
||||
additionalProperties: false,
|
||||
};
|
||||
|
||||
export const FilesDatabasePropertyConfigResponse: JSONSchema = {
|
||||
type: "object",
|
||||
properties: {
|
||||
type: {
|
||||
type: "string",
|
||||
const: "files",
|
||||
},
|
||||
files: EmptyObject,
|
||||
id: {
|
||||
type: "string",
|
||||
},
|
||||
name: {
|
||||
type: "string",
|
||||
},
|
||||
},
|
||||
required: ["type", "files", "id", "name"],
|
||||
additionalProperties: false,
|
||||
};
|
||||
|
||||
export const EmailDatabasePropertyConfigResponse: JSONSchema = {
|
||||
type: "object",
|
||||
properties: {
|
||||
type: {
|
||||
type: "string",
|
||||
const: "email",
|
||||
},
|
||||
email: EmptyObject,
|
||||
id: {
|
||||
type: "string",
|
||||
},
|
||||
name: {
|
||||
type: "string",
|
||||
},
|
||||
},
|
||||
required: ["type", "email", "id", "name"],
|
||||
additionalProperties: false,
|
||||
};
|
||||
|
||||
export const PhoneNumberDatabasePropertyConfigResponse: JSONSchema = {
|
||||
type: "object",
|
||||
properties: {
|
||||
type: {
|
||||
type: "string",
|
||||
const: "phone_number",
|
||||
},
|
||||
phone_number: EmptyObject,
|
||||
id: {
|
||||
type: "string",
|
||||
},
|
||||
name: {
|
||||
type: "string",
|
||||
},
|
||||
},
|
||||
required: ["type", "phone_number", "id", "name"],
|
||||
additionalProperties: false,
|
||||
};
|
||||
|
||||
export const DateDatabasePropertyConfigResponse: JSONSchema = {
|
||||
type: "object",
|
||||
properties: {
|
||||
type: {
|
||||
type: "string",
|
||||
const: "date",
|
||||
},
|
||||
date: EmptyObject,
|
||||
id: {
|
||||
type: "string",
|
||||
},
|
||||
name: {
|
||||
type: "string",
|
||||
},
|
||||
},
|
||||
required: ["type", "date", "id", "name"],
|
||||
additionalProperties: false,
|
||||
};
|
||||
|
||||
export const CheckboxDatabasePropertyConfigResponse: JSONSchema = {
|
||||
type: "object",
|
||||
properties: {
|
||||
type: {
|
||||
type: "string",
|
||||
const: "checkbox",
|
||||
},
|
||||
checkbox: EmptyObject,
|
||||
id: {
|
||||
type: "string",
|
||||
},
|
||||
name: {
|
||||
type: "string",
|
||||
},
|
||||
},
|
||||
required: ["type", "checkbox", "id", "name"],
|
||||
additionalProperties: false,
|
||||
};
|
||||
|
||||
export const CreatedByDatabasePropertyConfigResponse: JSONSchema = {
|
||||
type: "object",
|
||||
properties: {
|
||||
type: {
|
||||
type: "string",
|
||||
const: "created_by",
|
||||
},
|
||||
created_by: EmptyObject,
|
||||
id: {
|
||||
type: "string",
|
||||
},
|
||||
name: {
|
||||
type: "string",
|
||||
},
|
||||
},
|
||||
required: ["type", "created_by", "id", "name"],
|
||||
additionalProperties: false,
|
||||
};
|
||||
|
||||
export const CreatedTimeDatabasePropertyConfigResponse: JSONSchema = {
|
||||
type: "object",
|
||||
properties: {
|
||||
type: {
|
||||
type: "string",
|
||||
const: "created_time",
|
||||
},
|
||||
created_time: EmptyObject,
|
||||
id: {
|
||||
type: "string",
|
||||
},
|
||||
name: {
|
||||
type: "string",
|
||||
},
|
||||
},
|
||||
required: ["type", "created_time", "id", "name"],
|
||||
additionalProperties: false,
|
||||
};
|
||||
|
||||
export const LastEditedByDatabasePropertyConfigResponse: JSONSchema = {
|
||||
type: "object",
|
||||
properties: {
|
||||
type: {
|
||||
type: "string",
|
||||
const: "last_edited_by",
|
||||
},
|
||||
last_edited_by: EmptyObject,
|
||||
id: {
|
||||
type: "string",
|
||||
},
|
||||
name: {
|
||||
type: "string",
|
||||
},
|
||||
},
|
||||
required: ["type", "last_edited_by", "id", "name"],
|
||||
additionalProperties: false,
|
||||
};
|
||||
|
||||
export const LastEditedTimeDatabasePropertyConfigResponse: JSONSchema = {
|
||||
type: "object",
|
||||
properties: {
|
||||
type: {
|
||||
type: "string",
|
||||
const: "last_edited_time",
|
||||
},
|
||||
last_edited_time: EmptyObject,
|
||||
id: {
|
||||
type: "string",
|
||||
},
|
||||
name: {
|
||||
type: "string",
|
||||
},
|
||||
},
|
||||
required: ["type", "last_edited_time", "id", "name"],
|
||||
additionalProperties: false,
|
||||
};
|
||||
|
||||
export const DatabasePropertyConfigResponse: JSONSchema = {
|
||||
anyOf: [
|
||||
NumberDatabasePropertyConfigResponse,
|
||||
FormulaDatabasePropertyConfigResponse,
|
||||
SelectDatabasePropertyConfigResponse,
|
||||
MultiSelectDatabasePropertyConfigResponse,
|
||||
StatusDatabasePropertyConfigResponse,
|
||||
RelationDatabasePropertyConfigResponse,
|
||||
RollupDatabasePropertyConfigResponse,
|
||||
TitleDatabasePropertyConfigResponse,
|
||||
RichTextDatabasePropertyConfigResponse,
|
||||
UrlDatabasePropertyConfigResponse,
|
||||
PeopleDatabasePropertyConfigResponse,
|
||||
FilesDatabasePropertyConfigResponse,
|
||||
EmailDatabasePropertyConfigResponse,
|
||||
PhoneNumberDatabasePropertyConfigResponse,
|
||||
DateDatabasePropertyConfigResponse,
|
||||
CheckboxDatabasePropertyConfigResponse,
|
||||
CreatedByDatabasePropertyConfigResponse,
|
||||
CreatedTimeDatabasePropertyConfigResponse,
|
||||
LastEditedByDatabasePropertyConfigResponse,
|
||||
LastEditedTimeDatabasePropertyConfigResponse,
|
||||
],
|
||||
};
|
||||
@@ -0,0 +1,24 @@
|
||||
import { JSONSchema } from "core/schemas/types";
|
||||
import { TimeZoneRequest } from "./timezone";
|
||||
|
||||
export const DateRequest: JSONSchema = {
|
||||
type: "object",
|
||||
properties: {
|
||||
start: {
|
||||
type: "string",
|
||||
},
|
||||
end: {
|
||||
type: ["string", "null"],
|
||||
},
|
||||
time_zone: {
|
||||
anyOf: [
|
||||
TimeZoneRequest,
|
||||
{
|
||||
type: "null",
|
||||
},
|
||||
],
|
||||
},
|
||||
},
|
||||
required: ["start"],
|
||||
additionalProperties: false,
|
||||
};
|
||||
File diff suppressed because it is too large
Load Diff
+70
@@ -0,0 +1,70 @@
|
||||
import { JSONSchema } from "core/schemas/types";
|
||||
import { BlockObjectRequest } from "../blockRequests";
|
||||
import {
|
||||
PartialBlockObjectResponse,
|
||||
BlockObjectResponse,
|
||||
} from "../blockResponses";
|
||||
import { EmptyObject, IdRequest } from "../common";
|
||||
|
||||
export const AppendBlockChildrenPathParameters: JSONSchema = {
|
||||
type: "object",
|
||||
properties: {
|
||||
block_id: IdRequest,
|
||||
},
|
||||
required: ["block_id"],
|
||||
additionalProperties: false,
|
||||
};
|
||||
|
||||
export const AppendBlockChildrenBodyParameters: JSONSchema = {
|
||||
type: "object",
|
||||
properties: {
|
||||
children: {
|
||||
type: "array",
|
||||
items: BlockObjectRequest,
|
||||
},
|
||||
},
|
||||
required: ["children"],
|
||||
additionalProperties: false,
|
||||
};
|
||||
|
||||
export const AppendBlockChildrenParameters: JSONSchema = {
|
||||
type: "object",
|
||||
additionalProperties: false,
|
||||
properties: {
|
||||
children: {
|
||||
type: "array",
|
||||
items: BlockObjectRequest,
|
||||
},
|
||||
block_id: IdRequest,
|
||||
},
|
||||
required: ["block_id", "children"],
|
||||
};
|
||||
|
||||
export const AppendBlockChildrenResponse: JSONSchema = {
|
||||
type: "object",
|
||||
properties: {
|
||||
type: {
|
||||
type: "string",
|
||||
const: "block",
|
||||
},
|
||||
block: EmptyObject,
|
||||
object: {
|
||||
type: "string",
|
||||
const: "list",
|
||||
},
|
||||
next_cursor: {
|
||||
type: ["string", "null"],
|
||||
},
|
||||
has_more: {
|
||||
type: "boolean",
|
||||
},
|
||||
results: {
|
||||
type: "array",
|
||||
items: {
|
||||
anyOf: [PartialBlockObjectResponse, BlockObjectResponse],
|
||||
},
|
||||
},
|
||||
},
|
||||
required: ["type", "block", "object", "next_cursor", "has_more", "results"],
|
||||
additionalProperties: false,
|
||||
};
|
||||
+53
@@ -0,0 +1,53 @@
|
||||
import { JSONSchema } from "core/schemas/types";
|
||||
import { IdRequest } from "../common";
|
||||
import {
|
||||
CommentObjectResponse,
|
||||
PartialCommentObjectResponse,
|
||||
} from "../propertyItemResponses";
|
||||
import { RichTextItemRequest } from "../richTextItemRequest";
|
||||
|
||||
export const CreateCommentBodyParameters: JSONSchema = {
|
||||
anyOf: [
|
||||
{
|
||||
type: "object",
|
||||
properties: {
|
||||
parent: {
|
||||
type: "object",
|
||||
properties: {
|
||||
page_id: IdRequest,
|
||||
type: {
|
||||
type: "string",
|
||||
const: "page_id",
|
||||
},
|
||||
},
|
||||
required: ["page_id"],
|
||||
additionalProperties: false,
|
||||
},
|
||||
rich_text: {
|
||||
type: "array",
|
||||
items: RichTextItemRequest,
|
||||
},
|
||||
},
|
||||
required: ["parent", "rich_text"],
|
||||
additionalProperties: false,
|
||||
},
|
||||
{
|
||||
type: "object",
|
||||
properties: {
|
||||
discussion_id: IdRequest,
|
||||
rich_text: {
|
||||
type: "array",
|
||||
items: RichTextItemRequest,
|
||||
},
|
||||
},
|
||||
required: ["discussion_id", "rich_text"],
|
||||
additionalProperties: false,
|
||||
},
|
||||
],
|
||||
};
|
||||
|
||||
export const CreateCommentParameters: JSONSchema = CreateCommentBodyParameters;
|
||||
|
||||
export const CreateCommentResponse: JSONSchema = {
|
||||
anyOf: [CommentObjectResponse, PartialCommentObjectResponse],
|
||||
};
|
||||
+544
@@ -0,0 +1,544 @@
|
||||
import { JSONSchema } from "core/schemas/types";
|
||||
import {
|
||||
StringRequest,
|
||||
SelectColor,
|
||||
EmptyObject,
|
||||
IdRequest,
|
||||
NeverRecord,
|
||||
} from "../common";
|
||||
import {
|
||||
PartialDatabaseObjectResponse,
|
||||
DatabaseObjectResponse,
|
||||
} from "../database";
|
||||
import { NumberFormat } from "../databasePropertyConfigs";
|
||||
import { EmojiRequest } from "../emoji";
|
||||
import { RollupFunction } from "../functions";
|
||||
import { TextRequest } from "../requests";
|
||||
import { RichTextItemRequest } from "../richTextItemRequest";
|
||||
|
||||
export const CreateDatabaseBodyParametersProperties: JSONSchema = {
|
||||
type: "object",
|
||||
additionalProperties: {
|
||||
anyOf: [
|
||||
{
|
||||
type: "object",
|
||||
properties: {
|
||||
number: {
|
||||
type: "object",
|
||||
properties: {
|
||||
format: NumberFormat,
|
||||
},
|
||||
additionalProperties: false,
|
||||
},
|
||||
type: {
|
||||
type: "string",
|
||||
const: "number",
|
||||
},
|
||||
},
|
||||
required: ["number"],
|
||||
additionalProperties: false,
|
||||
},
|
||||
{
|
||||
type: "object",
|
||||
properties: {
|
||||
formula: {
|
||||
type: "object",
|
||||
properties: {
|
||||
expression: {
|
||||
type: "string",
|
||||
},
|
||||
},
|
||||
additionalProperties: false,
|
||||
},
|
||||
type: {
|
||||
type: "string",
|
||||
const: "formula",
|
||||
},
|
||||
},
|
||||
required: ["formula"],
|
||||
additionalProperties: false,
|
||||
},
|
||||
{
|
||||
type: "object",
|
||||
properties: {
|
||||
select: {
|
||||
type: "object",
|
||||
properties: {
|
||||
options: {
|
||||
type: "array",
|
||||
items: {
|
||||
type: "object",
|
||||
properties: {
|
||||
name: StringRequest,
|
||||
color: SelectColor,
|
||||
},
|
||||
required: ["name"],
|
||||
additionalProperties: false,
|
||||
},
|
||||
},
|
||||
},
|
||||
additionalProperties: false,
|
||||
},
|
||||
type: {
|
||||
type: "string",
|
||||
const: "select",
|
||||
},
|
||||
},
|
||||
required: ["select"],
|
||||
additionalProperties: false,
|
||||
},
|
||||
{
|
||||
type: "object",
|
||||
properties: {
|
||||
multi_select: {
|
||||
type: "object",
|
||||
properties: {
|
||||
options: {
|
||||
type: "array",
|
||||
items: {
|
||||
type: "object",
|
||||
properties: {
|
||||
name: StringRequest,
|
||||
color: SelectColor,
|
||||
},
|
||||
required: ["name"],
|
||||
additionalProperties: false,
|
||||
},
|
||||
},
|
||||
},
|
||||
additionalProperties: false,
|
||||
},
|
||||
type: {
|
||||
type: "string",
|
||||
const: "multi_select",
|
||||
},
|
||||
},
|
||||
required: ["multi_select"],
|
||||
additionalProperties: false,
|
||||
},
|
||||
{
|
||||
type: "object",
|
||||
properties: {
|
||||
status: EmptyObject,
|
||||
type: {
|
||||
type: "string",
|
||||
const: "status",
|
||||
},
|
||||
},
|
||||
required: ["status"],
|
||||
additionalProperties: false,
|
||||
},
|
||||
{
|
||||
type: "object",
|
||||
properties: {
|
||||
relation: {
|
||||
anyOf: [
|
||||
{
|
||||
type: "object",
|
||||
properties: {
|
||||
single_property: EmptyObject,
|
||||
database_id: IdRequest,
|
||||
type: {
|
||||
type: "string",
|
||||
const: "single_property",
|
||||
},
|
||||
},
|
||||
required: ["single_property", "database_id"],
|
||||
additionalProperties: false,
|
||||
},
|
||||
{
|
||||
type: "object",
|
||||
properties: {
|
||||
dual_property: NeverRecord,
|
||||
database_id: IdRequest,
|
||||
type: {
|
||||
type: "string",
|
||||
const: "dual_property",
|
||||
},
|
||||
},
|
||||
required: ["dual_property", "database_id"],
|
||||
additionalProperties: false,
|
||||
},
|
||||
],
|
||||
},
|
||||
type: {
|
||||
type: "string",
|
||||
const: "relation",
|
||||
},
|
||||
},
|
||||
required: ["relation"],
|
||||
additionalProperties: false,
|
||||
},
|
||||
{
|
||||
type: "object",
|
||||
properties: {
|
||||
rollup: {
|
||||
anyOf: [
|
||||
{
|
||||
type: "object",
|
||||
properties: {
|
||||
rollup_property_name: {
|
||||
type: "string",
|
||||
},
|
||||
relation_property_name: {
|
||||
type: "string",
|
||||
},
|
||||
function: RollupFunction,
|
||||
rollup_property_id: {
|
||||
type: "string",
|
||||
},
|
||||
relation_property_id: {
|
||||
type: "string",
|
||||
},
|
||||
},
|
||||
required: [
|
||||
"rollup_property_name",
|
||||
"relation_property_name",
|
||||
"function",
|
||||
],
|
||||
additionalProperties: false,
|
||||
},
|
||||
{
|
||||
type: "object",
|
||||
properties: {
|
||||
rollup_property_name: {
|
||||
type: "string",
|
||||
},
|
||||
relation_property_id: {
|
||||
type: "string",
|
||||
},
|
||||
function: RollupFunction,
|
||||
relation_property_name: {
|
||||
type: "string",
|
||||
},
|
||||
rollup_property_id: {
|
||||
type: "string",
|
||||
},
|
||||
},
|
||||
required: [
|
||||
"rollup_property_name",
|
||||
"relation_property_id",
|
||||
"function",
|
||||
],
|
||||
additionalProperties: false,
|
||||
},
|
||||
{
|
||||
type: "object",
|
||||
properties: {
|
||||
relation_property_name: {
|
||||
type: "string",
|
||||
},
|
||||
rollup_property_id: {
|
||||
type: "string",
|
||||
},
|
||||
function: RollupFunction,
|
||||
rollup_property_name: {
|
||||
type: "string",
|
||||
},
|
||||
relation_property_id: {
|
||||
type: "string",
|
||||
},
|
||||
},
|
||||
required: [
|
||||
"relation_property_name",
|
||||
"rollup_property_id",
|
||||
"function",
|
||||
],
|
||||
additionalProperties: false,
|
||||
},
|
||||
{
|
||||
type: "object",
|
||||
properties: {
|
||||
rollup_property_id: {
|
||||
type: "string",
|
||||
},
|
||||
relation_property_id: {
|
||||
type: "string",
|
||||
},
|
||||
function: RollupFunction,
|
||||
rollup_property_name: {
|
||||
type: "string",
|
||||
},
|
||||
relation_property_name: {
|
||||
type: "string",
|
||||
},
|
||||
},
|
||||
required: [
|
||||
"rollup_property_id",
|
||||
"relation_property_id",
|
||||
"function",
|
||||
],
|
||||
additionalProperties: false,
|
||||
},
|
||||
],
|
||||
},
|
||||
type: {
|
||||
type: "string",
|
||||
const: "rollup",
|
||||
},
|
||||
},
|
||||
required: ["rollup"],
|
||||
additionalProperties: false,
|
||||
},
|
||||
{
|
||||
type: "object",
|
||||
properties: {
|
||||
title: EmptyObject,
|
||||
type: {
|
||||
type: "string",
|
||||
const: "title",
|
||||
},
|
||||
},
|
||||
required: ["title"],
|
||||
additionalProperties: false,
|
||||
},
|
||||
{
|
||||
type: "object",
|
||||
properties: {
|
||||
rich_text: EmptyObject,
|
||||
type: {
|
||||
type: "string",
|
||||
const: "rich_text",
|
||||
},
|
||||
},
|
||||
required: ["rich_text"],
|
||||
additionalProperties: false,
|
||||
},
|
||||
{
|
||||
type: "object",
|
||||
properties: {
|
||||
url: EmptyObject,
|
||||
type: {
|
||||
type: "string",
|
||||
const: "url",
|
||||
},
|
||||
},
|
||||
required: ["url"],
|
||||
additionalProperties: false,
|
||||
},
|
||||
{
|
||||
type: "object",
|
||||
properties: {
|
||||
people: EmptyObject,
|
||||
type: {
|
||||
type: "string",
|
||||
const: "people",
|
||||
},
|
||||
},
|
||||
required: ["people"],
|
||||
additionalProperties: false,
|
||||
},
|
||||
{
|
||||
type: "object",
|
||||
properties: {
|
||||
files: EmptyObject,
|
||||
type: {
|
||||
type: "string",
|
||||
const: "files",
|
||||
},
|
||||
},
|
||||
required: ["files"],
|
||||
additionalProperties: false,
|
||||
},
|
||||
{
|
||||
type: "object",
|
||||
properties: {
|
||||
email: EmptyObject,
|
||||
type: {
|
||||
type: "string",
|
||||
const: "email",
|
||||
},
|
||||
},
|
||||
required: ["email"],
|
||||
additionalProperties: false,
|
||||
},
|
||||
{
|
||||
type: "object",
|
||||
properties: {
|
||||
phone_number: EmptyObject,
|
||||
type: {
|
||||
type: "string",
|
||||
const: "phone_number",
|
||||
},
|
||||
},
|
||||
required: ["phone_number"],
|
||||
additionalProperties: false,
|
||||
},
|
||||
{
|
||||
type: "object",
|
||||
properties: {
|
||||
date: EmptyObject,
|
||||
type: {
|
||||
type: "string",
|
||||
const: "date",
|
||||
},
|
||||
},
|
||||
required: ["date"],
|
||||
additionalProperties: false,
|
||||
},
|
||||
{
|
||||
type: "object",
|
||||
properties: {
|
||||
checkbox: EmptyObject,
|
||||
type: {
|
||||
type: "string",
|
||||
const: "checkbox",
|
||||
},
|
||||
},
|
||||
required: ["checkbox"],
|
||||
additionalProperties: false,
|
||||
},
|
||||
{
|
||||
type: "object",
|
||||
properties: {
|
||||
created_by: EmptyObject,
|
||||
type: {
|
||||
type: "string",
|
||||
const: "created_by",
|
||||
},
|
||||
},
|
||||
required: ["created_by"],
|
||||
additionalProperties: false,
|
||||
},
|
||||
{
|
||||
type: "object",
|
||||
properties: {
|
||||
created_time: EmptyObject,
|
||||
type: {
|
||||
type: "string",
|
||||
const: "created_time",
|
||||
},
|
||||
},
|
||||
required: ["created_time"],
|
||||
additionalProperties: false,
|
||||
},
|
||||
{
|
||||
type: "object",
|
||||
properties: {
|
||||
last_edited_by: EmptyObject,
|
||||
type: {
|
||||
type: "string",
|
||||
const: "last_edited_by",
|
||||
},
|
||||
},
|
||||
required: ["last_edited_by"],
|
||||
additionalProperties: false,
|
||||
},
|
||||
{
|
||||
type: "object",
|
||||
properties: {
|
||||
last_edited_time: EmptyObject,
|
||||
type: {
|
||||
type: "string",
|
||||
const: "last_edited_time",
|
||||
},
|
||||
},
|
||||
required: ["last_edited_time"],
|
||||
additionalProperties: false,
|
||||
},
|
||||
],
|
||||
},
|
||||
};
|
||||
|
||||
export const CreateDatabaseBodyParameters: JSONSchema = {
|
||||
type: "object",
|
||||
properties: {
|
||||
parent: {
|
||||
type: "object",
|
||||
properties: {
|
||||
page_id: IdRequest,
|
||||
type: {
|
||||
type: "string",
|
||||
const: "page_id",
|
||||
},
|
||||
},
|
||||
required: ["page_id"],
|
||||
additionalProperties: false,
|
||||
},
|
||||
properties: CreateDatabaseBodyParametersProperties,
|
||||
icon: {
|
||||
anyOf: [
|
||||
{
|
||||
type: "object",
|
||||
properties: {
|
||||
emoji: EmojiRequest,
|
||||
type: {
|
||||
type: "string",
|
||||
const: "emoji",
|
||||
},
|
||||
},
|
||||
required: ["emoji"],
|
||||
additionalProperties: false,
|
||||
},
|
||||
{
|
||||
type: "null",
|
||||
},
|
||||
{
|
||||
type: "object",
|
||||
properties: {
|
||||
external: {
|
||||
type: "object",
|
||||
properties: {
|
||||
url: TextRequest,
|
||||
},
|
||||
required: ["url"],
|
||||
additionalProperties: false,
|
||||
},
|
||||
type: {
|
||||
type: "string",
|
||||
const: "external",
|
||||
},
|
||||
},
|
||||
required: ["external"],
|
||||
additionalProperties: false,
|
||||
},
|
||||
],
|
||||
},
|
||||
cover: {
|
||||
anyOf: [
|
||||
{
|
||||
type: "object",
|
||||
properties: {
|
||||
external: {
|
||||
type: "object",
|
||||
properties: {
|
||||
url: TextRequest,
|
||||
},
|
||||
required: ["url"],
|
||||
additionalProperties: false,
|
||||
},
|
||||
type: {
|
||||
type: "string",
|
||||
const: "external",
|
||||
},
|
||||
},
|
||||
required: ["external"],
|
||||
additionalProperties: false,
|
||||
},
|
||||
{
|
||||
type: "null",
|
||||
},
|
||||
],
|
||||
},
|
||||
title: {
|
||||
type: "array",
|
||||
items: RichTextItemRequest,
|
||||
},
|
||||
description: {
|
||||
type: "array",
|
||||
items: RichTextItemRequest,
|
||||
},
|
||||
is_inline: {
|
||||
type: "boolean",
|
||||
},
|
||||
},
|
||||
required: ["parent", "properties"],
|
||||
additionalProperties: false,
|
||||
};
|
||||
|
||||
export const CreateDatabaseParameters: JSONSchema =
|
||||
CreateDatabaseBodyParameters;
|
||||
|
||||
export const CreateDatabaseResponse: JSONSchema = {
|
||||
anyOf: [PartialDatabaseObjectResponse, DatabaseObjectResponse],
|
||||
};
|
||||
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,21 @@
|
||||
import { JSONSchema } from "core/schemas/types";
|
||||
import {
|
||||
BlockObjectResponse,
|
||||
PartialBlockObjectResponse,
|
||||
} from "../blockResponses";
|
||||
import { IdRequest } from "../common";
|
||||
|
||||
export const DeleteBlockPathParameters: JSONSchema = {
|
||||
type: "object",
|
||||
properties: {
|
||||
block_id: IdRequest,
|
||||
},
|
||||
required: ["block_id"],
|
||||
additionalProperties: false,
|
||||
};
|
||||
|
||||
export const DeleteBlockParameters: JSONSchema = DeleteBlockPathParameters;
|
||||
|
||||
export const DeleteBlockResponse: JSONSchema = {
|
||||
anyOf: [PartialBlockObjectResponse, BlockObjectResponse],
|
||||
};
|
||||
@@ -0,0 +1,21 @@
|
||||
import { JSONSchema } from "core/schemas/types";
|
||||
import {
|
||||
BlockObjectResponse,
|
||||
PartialBlockObjectResponse,
|
||||
} from "../blockResponses";
|
||||
import { IdRequest } from "../common";
|
||||
|
||||
export const GetBlockPathParameters: JSONSchema = {
|
||||
type: "object",
|
||||
properties: {
|
||||
block_id: IdRequest,
|
||||
},
|
||||
required: ["block_id"],
|
||||
additionalProperties: false,
|
||||
};
|
||||
|
||||
export const GetBlockParameters: JSONSchema = GetBlockPathParameters;
|
||||
|
||||
export const GetBlockResponse: JSONSchema = {
|
||||
anyOf: [PartialBlockObjectResponse, BlockObjectResponse],
|
||||
};
|
||||
@@ -0,0 +1,21 @@
|
||||
import { JSONSchema } from "core/schemas/types";
|
||||
import { IdRequest } from "../common";
|
||||
import {
|
||||
DatabaseObjectResponse,
|
||||
PartialDatabaseObjectResponse,
|
||||
} from "../database";
|
||||
|
||||
export const GetDatabasePathParameters: JSONSchema = {
|
||||
type: "object",
|
||||
properties: {
|
||||
database_id: IdRequest,
|
||||
},
|
||||
required: ["database_id"],
|
||||
additionalProperties: false,
|
||||
};
|
||||
|
||||
export const GetDatabaseParameters: JSONSchema = GetDatabasePathParameters;
|
||||
|
||||
export const GetDatabaseResponse: JSONSchema = {
|
||||
anyOf: [PartialDatabaseObjectResponse, DatabaseObjectResponse],
|
||||
};
|
||||
@@ -0,0 +1,44 @@
|
||||
import { JSONSchema } from "core/schemas/types";
|
||||
import { IdRequest } from "../common";
|
||||
import { PageObjectResponse, PartialPageObjectResponse } from "../page";
|
||||
|
||||
export const GetPagePathParameters: JSONSchema = {
|
||||
type: "object",
|
||||
properties: {
|
||||
page_id: IdRequest,
|
||||
},
|
||||
required: ["page_id"],
|
||||
additionalProperties: false,
|
||||
};
|
||||
|
||||
export const GetPageQueryParameters: JSONSchema = {
|
||||
type: "object",
|
||||
properties: {
|
||||
filter_properties: {
|
||||
type: "array",
|
||||
items: {
|
||||
type: "string",
|
||||
},
|
||||
},
|
||||
},
|
||||
additionalProperties: false,
|
||||
};
|
||||
|
||||
export const GetPageParameters: JSONSchema = {
|
||||
type: "object",
|
||||
additionalProperties: false,
|
||||
properties: {
|
||||
filter_properties: {
|
||||
type: "array",
|
||||
items: {
|
||||
type: "string",
|
||||
},
|
||||
},
|
||||
page_id: IdRequest,
|
||||
},
|
||||
required: ["page_id"],
|
||||
};
|
||||
|
||||
export const GetPageResponse: JSONSchema = {
|
||||
anyOf: [PageObjectResponse, PartialPageObjectResponse],
|
||||
};
|
||||
+53
@@ -0,0 +1,53 @@
|
||||
import { JSONSchema } from "core/schemas/types";
|
||||
import { IdRequest } from "../common";
|
||||
import {
|
||||
PropertyItemListResponse,
|
||||
PropertyItemObjectResponse,
|
||||
} from "../propertyItemResponses";
|
||||
|
||||
export const GetPagePropertyPathParameters: JSONSchema = {
|
||||
type: "object",
|
||||
properties: {
|
||||
page_id: IdRequest,
|
||||
property_id: {
|
||||
type: "string",
|
||||
},
|
||||
},
|
||||
required: ["page_id", "property_id"],
|
||||
additionalProperties: false,
|
||||
};
|
||||
|
||||
export const GetPagePropertyQueryParameters: JSONSchema = {
|
||||
type: "object",
|
||||
properties: {
|
||||
start_cursor: {
|
||||
type: "string",
|
||||
},
|
||||
page_size: {
|
||||
type: "number",
|
||||
},
|
||||
},
|
||||
additionalProperties: false,
|
||||
};
|
||||
|
||||
export const GetPagePropertyParameters: JSONSchema = {
|
||||
type: "object",
|
||||
additionalProperties: false,
|
||||
properties: {
|
||||
start_cursor: {
|
||||
type: "string",
|
||||
},
|
||||
page_size: {
|
||||
type: "number",
|
||||
},
|
||||
page_id: IdRequest,
|
||||
property_id: {
|
||||
type: "string",
|
||||
},
|
||||
},
|
||||
required: ["page_id", "property_id"],
|
||||
};
|
||||
|
||||
export const GetPagePropertyResponse: JSONSchema = {
|
||||
anyOf: [PropertyItemObjectResponse, PropertyItemListResponse],
|
||||
};
|
||||
@@ -0,0 +1,16 @@
|
||||
import { JSONSchema } from "core/schemas/types";
|
||||
import { IdRequest } from "../common";
|
||||
import { UserObjectResponse } from "../person";
|
||||
|
||||
export const GetUserPathParameters: JSONSchema = {
|
||||
type: "object",
|
||||
properties: {
|
||||
user_id: IdRequest,
|
||||
},
|
||||
required: ["user_id"],
|
||||
additionalProperties: false,
|
||||
};
|
||||
|
||||
export const GetUserParameters: JSONSchema = GetUserPathParameters;
|
||||
|
||||
export const GetUserResponse: JSONSchema = UserObjectResponse;
|
||||
+72
@@ -0,0 +1,72 @@
|
||||
import { JSONSchema } from "core/schemas/types";
|
||||
import {
|
||||
BlockObjectResponse,
|
||||
PartialBlockObjectResponse,
|
||||
} from "../blockResponses";
|
||||
import { EmptyObject, IdRequest } from "../common";
|
||||
|
||||
export const ListBlockChildrenPathParameters: JSONSchema = {
|
||||
type: "object",
|
||||
properties: {
|
||||
block_id: IdRequest,
|
||||
},
|
||||
required: ["block_id"],
|
||||
additionalProperties: false,
|
||||
};
|
||||
|
||||
export const ListBlockChildrenQueryParameters: JSONSchema = {
|
||||
type: "object",
|
||||
properties: {
|
||||
start_cursor: {
|
||||
type: "string",
|
||||
},
|
||||
page_size: {
|
||||
type: "number",
|
||||
},
|
||||
},
|
||||
additionalProperties: false,
|
||||
};
|
||||
|
||||
export const ListBlockChildrenParameters: JSONSchema = {
|
||||
type: "object",
|
||||
additionalProperties: false,
|
||||
properties: {
|
||||
start_cursor: {
|
||||
type: "string",
|
||||
},
|
||||
page_size: {
|
||||
type: "number",
|
||||
},
|
||||
block_id: IdRequest,
|
||||
},
|
||||
required: ["block_id"],
|
||||
};
|
||||
|
||||
export const ListBlockChildrenResponse: JSONSchema = {
|
||||
type: "object",
|
||||
properties: {
|
||||
type: {
|
||||
type: "string",
|
||||
const: "block",
|
||||
},
|
||||
block: EmptyObject,
|
||||
object: {
|
||||
type: "string",
|
||||
const: "list",
|
||||
},
|
||||
next_cursor: {
|
||||
type: ["string", "null"],
|
||||
},
|
||||
has_more: {
|
||||
type: "boolean",
|
||||
},
|
||||
results: {
|
||||
type: "array",
|
||||
items: {
|
||||
anyOf: [PartialBlockObjectResponse, BlockObjectResponse],
|
||||
},
|
||||
},
|
||||
},
|
||||
required: ["type", "block", "object", "next_cursor", "has_more", "results"],
|
||||
additionalProperties: false,
|
||||
};
|
||||
@@ -0,0 +1,47 @@
|
||||
import { JSONSchema } from "core/schemas/types";
|
||||
import { EmptyObject, IdRequest } from "../common";
|
||||
import { CommentObjectResponse } from "../propertyItemResponses";
|
||||
|
||||
export const ListCommentsQueryParameters: JSONSchema = {
|
||||
type: "object",
|
||||
properties: {
|
||||
block_id: IdRequest,
|
||||
start_cursor: {
|
||||
type: "string",
|
||||
},
|
||||
page_size: {
|
||||
type: "number",
|
||||
},
|
||||
},
|
||||
required: ["block_id"],
|
||||
additionalProperties: false,
|
||||
};
|
||||
|
||||
export const ListCommentsParameters: JSONSchema = ListCommentsQueryParameters;
|
||||
|
||||
export const ListCommentsResponse: JSONSchema = {
|
||||
type: "object",
|
||||
properties: {
|
||||
type: {
|
||||
type: "string",
|
||||
const: "comment",
|
||||
},
|
||||
comment: EmptyObject,
|
||||
object: {
|
||||
type: "string",
|
||||
const: "list",
|
||||
},
|
||||
next_cursor: {
|
||||
type: ["string", "null"],
|
||||
},
|
||||
has_more: {
|
||||
type: "boolean",
|
||||
},
|
||||
results: {
|
||||
type: "array",
|
||||
items: CommentObjectResponse,
|
||||
},
|
||||
},
|
||||
required: ["type", "comment", "object", "next_cursor", "has_more", "results"],
|
||||
additionalProperties: false,
|
||||
};
|
||||
+57
@@ -0,0 +1,57 @@
|
||||
import { JSONSchema } from "core/schemas/types";
|
||||
import { EmptyObject } from "../common";
|
||||
import {
|
||||
DatabaseObjectResponse,
|
||||
PartialDatabaseObjectResponse,
|
||||
} from "../database";
|
||||
|
||||
export const ListDatabasesQueryParameters: JSONSchema = {
|
||||
type: "object",
|
||||
properties: {
|
||||
start_cursor: {
|
||||
type: "string",
|
||||
},
|
||||
page_size: {
|
||||
type: "number",
|
||||
},
|
||||
},
|
||||
additionalProperties: false,
|
||||
};
|
||||
|
||||
export const ListDatabasesParameters: JSONSchema = ListDatabasesQueryParameters;
|
||||
|
||||
export const ListDatabasesResponse: JSONSchema = {
|
||||
type: "object",
|
||||
properties: {
|
||||
type: {
|
||||
type: "string",
|
||||
const: "database",
|
||||
},
|
||||
database: EmptyObject,
|
||||
object: {
|
||||
type: "string",
|
||||
const: "list",
|
||||
},
|
||||
next_cursor: {
|
||||
type: ["string", "null"],
|
||||
},
|
||||
has_more: {
|
||||
type: "boolean",
|
||||
},
|
||||
results: {
|
||||
type: "array",
|
||||
items: {
|
||||
anyOf: [PartialDatabaseObjectResponse, DatabaseObjectResponse],
|
||||
},
|
||||
},
|
||||
},
|
||||
required: [
|
||||
"type",
|
||||
"database",
|
||||
"object",
|
||||
"next_cursor",
|
||||
"has_more",
|
||||
"results",
|
||||
],
|
||||
additionalProperties: false,
|
||||
};
|
||||
@@ -0,0 +1,45 @@
|
||||
import { JSONSchema } from "core/schemas/types";
|
||||
import { EmptyObject } from "../common";
|
||||
import { UserObjectResponse } from "../person";
|
||||
|
||||
export const ListUsersQueryParameters: JSONSchema = {
|
||||
type: "object",
|
||||
properties: {
|
||||
start_cursor: {
|
||||
type: "string",
|
||||
},
|
||||
page_size: {
|
||||
type: "number",
|
||||
},
|
||||
},
|
||||
additionalProperties: false,
|
||||
};
|
||||
|
||||
export const ListUsersParameters: JSONSchema = ListUsersQueryParameters;
|
||||
|
||||
export const ListUsersResponse: JSONSchema = {
|
||||
type: "object",
|
||||
properties: {
|
||||
type: {
|
||||
type: "string",
|
||||
const: "user",
|
||||
},
|
||||
user: EmptyObject,
|
||||
object: {
|
||||
type: "string",
|
||||
const: "list",
|
||||
},
|
||||
next_cursor: {
|
||||
type: ["string", "null"],
|
||||
},
|
||||
has_more: {
|
||||
type: "boolean",
|
||||
},
|
||||
results: {
|
||||
type: "array",
|
||||
items: UserObjectResponse,
|
||||
},
|
||||
},
|
||||
required: ["type", "user", "object", "next_cursor", "has_more", "results"],
|
||||
additionalProperties: false,
|
||||
};
|
||||
@@ -0,0 +1,8 @@
|
||||
import { JSONSchema } from "core/schemas/types";
|
||||
import { NeverRecord } from "../common";
|
||||
import { BotUserObjectResponse, PersonUserObjectResponse } from "../person";
|
||||
|
||||
export const GetSelfParameters: JSONSchema = NeverRecord;
|
||||
export const GetSelfResponse: JSONSchema = {
|
||||
anyOf: [PersonUserObjectResponse, BotUserObjectResponse],
|
||||
};
|
||||
+341
@@ -0,0 +1,341 @@
|
||||
import { JSONSchema } from "core/schemas/types";
|
||||
import { EmptyObject, IdRequest } from "../common";
|
||||
import {
|
||||
PropertyFilter,
|
||||
TimestampCreatedTimeFilter,
|
||||
TimestampLastEditedTimeFilter,
|
||||
} from "../filters";
|
||||
import { PageObjectResponse, PartialPageObjectResponse } from "../page";
|
||||
|
||||
export const QueryDatabasePathParameters: JSONSchema = {
|
||||
type: "object",
|
||||
properties: {
|
||||
database_id: IdRequest,
|
||||
},
|
||||
required: ["database_id"],
|
||||
additionalProperties: false,
|
||||
};
|
||||
|
||||
export const QueryDatabaseQueryParameters: JSONSchema = {
|
||||
type: "object",
|
||||
properties: {
|
||||
filter_properties: {
|
||||
type: "array",
|
||||
items: {
|
||||
type: "string",
|
||||
},
|
||||
},
|
||||
},
|
||||
additionalProperties: false,
|
||||
};
|
||||
|
||||
export const QueryDatabaseBodyParameters: JSONSchema = {
|
||||
type: "object",
|
||||
properties: {
|
||||
sorts: {
|
||||
type: "array",
|
||||
items: {
|
||||
anyOf: [
|
||||
{
|
||||
type: "object",
|
||||
properties: {
|
||||
property: {
|
||||
type: "string",
|
||||
},
|
||||
direction: {
|
||||
type: "string",
|
||||
enum: ["ascending", "descending"],
|
||||
},
|
||||
},
|
||||
required: ["property", "direction"],
|
||||
additionalProperties: false,
|
||||
},
|
||||
{
|
||||
type: "object",
|
||||
properties: {
|
||||
timestamp: {
|
||||
type: "string",
|
||||
enum: ["created_time", "last_edited_time"],
|
||||
},
|
||||
direction: {
|
||||
type: "string",
|
||||
enum: ["ascending", "descending"],
|
||||
},
|
||||
},
|
||||
required: ["timestamp", "direction"],
|
||||
additionalProperties: false,
|
||||
},
|
||||
],
|
||||
},
|
||||
},
|
||||
filter: {
|
||||
anyOf: [
|
||||
{
|
||||
type: "object",
|
||||
properties: {
|
||||
or: {
|
||||
type: "array",
|
||||
items: {
|
||||
anyOf: [
|
||||
PropertyFilter,
|
||||
TimestampCreatedTimeFilter,
|
||||
TimestampLastEditedTimeFilter,
|
||||
{
|
||||
type: "object",
|
||||
properties: {
|
||||
or: {
|
||||
type: "array",
|
||||
items: PropertyFilter,
|
||||
},
|
||||
},
|
||||
required: ["or"],
|
||||
additionalProperties: false,
|
||||
},
|
||||
{
|
||||
type: "object",
|
||||
properties: {
|
||||
and: {
|
||||
type: "array",
|
||||
items: PropertyFilter,
|
||||
},
|
||||
},
|
||||
required: ["and"],
|
||||
additionalProperties: false,
|
||||
},
|
||||
],
|
||||
},
|
||||
},
|
||||
},
|
||||
required: ["or"],
|
||||
additionalProperties: false,
|
||||
},
|
||||
{
|
||||
type: "object",
|
||||
properties: {
|
||||
and: {
|
||||
type: "array",
|
||||
items: {
|
||||
anyOf: [
|
||||
PropertyFilter,
|
||||
TimestampCreatedTimeFilter,
|
||||
TimestampLastEditedTimeFilter,
|
||||
{
|
||||
type: "object",
|
||||
properties: {
|
||||
or: {
|
||||
type: "array",
|
||||
items: PropertyFilter,
|
||||
},
|
||||
},
|
||||
required: ["or"],
|
||||
additionalProperties: false,
|
||||
},
|
||||
{
|
||||
type: "object",
|
||||
properties: {
|
||||
and: {
|
||||
type: "array",
|
||||
items: PropertyFilter,
|
||||
},
|
||||
},
|
||||
required: ["and"],
|
||||
additionalProperties: false,
|
||||
},
|
||||
],
|
||||
},
|
||||
},
|
||||
},
|
||||
required: ["and"],
|
||||
additionalProperties: false,
|
||||
},
|
||||
PropertyFilter,
|
||||
TimestampCreatedTimeFilter,
|
||||
TimestampLastEditedTimeFilter,
|
||||
],
|
||||
},
|
||||
start_cursor: {
|
||||
type: "string",
|
||||
},
|
||||
page_size: {
|
||||
type: "number",
|
||||
},
|
||||
archived: {
|
||||
type: "boolean",
|
||||
},
|
||||
},
|
||||
additionalProperties: false,
|
||||
};
|
||||
|
||||
export const QueryDatabaseParameters: JSONSchema = {
|
||||
type: "object",
|
||||
additionalProperties: false,
|
||||
properties: {
|
||||
sorts: {
|
||||
type: "array",
|
||||
items: {
|
||||
anyOf: [
|
||||
{
|
||||
type: "object",
|
||||
properties: {
|
||||
property: {
|
||||
type: "string",
|
||||
},
|
||||
direction: {
|
||||
type: "string",
|
||||
enum: ["ascending", "descending"],
|
||||
},
|
||||
},
|
||||
required: ["property", "direction"],
|
||||
additionalProperties: false,
|
||||
},
|
||||
{
|
||||
type: "object",
|
||||
properties: {
|
||||
timestamp: {
|
||||
type: "string",
|
||||
enum: ["created_time", "last_edited_time"],
|
||||
},
|
||||
direction: {
|
||||
type: "string",
|
||||
enum: ["ascending", "descending"],
|
||||
},
|
||||
},
|
||||
required: ["timestamp", "direction"],
|
||||
additionalProperties: false,
|
||||
},
|
||||
],
|
||||
},
|
||||
},
|
||||
filter: {
|
||||
anyOf: [
|
||||
{
|
||||
type: "object",
|
||||
properties: {
|
||||
or: {
|
||||
type: "array",
|
||||
items: {
|
||||
anyOf: [
|
||||
PropertyFilter,
|
||||
TimestampCreatedTimeFilter,
|
||||
TimestampLastEditedTimeFilter,
|
||||
{
|
||||
type: "object",
|
||||
properties: {
|
||||
or: {
|
||||
type: "array",
|
||||
items: PropertyFilter,
|
||||
},
|
||||
},
|
||||
required: ["or"],
|
||||
additionalProperties: false,
|
||||
},
|
||||
{
|
||||
type: "object",
|
||||
properties: {
|
||||
and: {
|
||||
type: "array",
|
||||
items: PropertyFilter,
|
||||
},
|
||||
},
|
||||
required: ["and"],
|
||||
additionalProperties: false,
|
||||
},
|
||||
],
|
||||
},
|
||||
},
|
||||
},
|
||||
required: ["or"],
|
||||
additionalProperties: false,
|
||||
},
|
||||
{
|
||||
type: "object",
|
||||
properties: {
|
||||
and: {
|
||||
type: "array",
|
||||
items: {
|
||||
anyOf: [
|
||||
PropertyFilter,
|
||||
TimestampCreatedTimeFilter,
|
||||
TimestampLastEditedTimeFilter,
|
||||
{
|
||||
type: "object",
|
||||
properties: {
|
||||
or: {
|
||||
type: "array",
|
||||
items: PropertyFilter,
|
||||
},
|
||||
},
|
||||
required: ["or"],
|
||||
additionalProperties: false,
|
||||
},
|
||||
{
|
||||
type: "object",
|
||||
properties: {
|
||||
and: {
|
||||
type: "array",
|
||||
items: PropertyFilter,
|
||||
},
|
||||
},
|
||||
required: ["and"],
|
||||
additionalProperties: false,
|
||||
},
|
||||
],
|
||||
},
|
||||
},
|
||||
},
|
||||
required: ["and"],
|
||||
additionalProperties: false,
|
||||
},
|
||||
PropertyFilter,
|
||||
TimestampCreatedTimeFilter,
|
||||
TimestampLastEditedTimeFilter,
|
||||
],
|
||||
},
|
||||
start_cursor: {
|
||||
type: "string",
|
||||
},
|
||||
page_size: {
|
||||
type: "number",
|
||||
},
|
||||
archived: {
|
||||
type: "boolean",
|
||||
},
|
||||
filter_properties: {
|
||||
type: "array",
|
||||
items: {
|
||||
type: "string",
|
||||
},
|
||||
},
|
||||
database_id: IdRequest,
|
||||
},
|
||||
required: ["database_id"],
|
||||
};
|
||||
|
||||
export const QueryDatabaseResponse: JSONSchema = {
|
||||
type: "object",
|
||||
properties: {
|
||||
type: {
|
||||
type: "string",
|
||||
const: "page",
|
||||
},
|
||||
page: EmptyObject,
|
||||
object: {
|
||||
type: "string",
|
||||
const: "list",
|
||||
},
|
||||
next_cursor: {
|
||||
type: ["string", "null"],
|
||||
},
|
||||
has_more: {
|
||||
type: "boolean",
|
||||
},
|
||||
results: {
|
||||
type: "array",
|
||||
items: {
|
||||
anyOf: [PageObjectResponse, PartialPageObjectResponse],
|
||||
},
|
||||
},
|
||||
},
|
||||
required: ["type", "page", "object", "next_cursor", "has_more", "results"],
|
||||
additionalProperties: false,
|
||||
};
|
||||
@@ -0,0 +1,96 @@
|
||||
import { JSONSchema } from "core/schemas/types";
|
||||
import { EmptyObject } from "../common";
|
||||
import {
|
||||
DatabaseObjectResponse,
|
||||
PartialDatabaseObjectResponse,
|
||||
} from "../database";
|
||||
import { PageObjectResponse, PartialPageObjectResponse } from "../page";
|
||||
|
||||
export const SearchBodyParameters: JSONSchema = {
|
||||
type: "object",
|
||||
properties: {
|
||||
sort: {
|
||||
type: "object",
|
||||
properties: {
|
||||
timestamp: {
|
||||
type: "string",
|
||||
const: "last_edited_time",
|
||||
},
|
||||
direction: {
|
||||
type: "string",
|
||||
enum: ["ascending", "descending"],
|
||||
},
|
||||
},
|
||||
required: ["timestamp", "direction"],
|
||||
additionalProperties: false,
|
||||
},
|
||||
query: {
|
||||
type: "string",
|
||||
},
|
||||
start_cursor: {
|
||||
type: "string",
|
||||
},
|
||||
page_size: {
|
||||
type: "number",
|
||||
},
|
||||
filter: {
|
||||
type: "object",
|
||||
properties: {
|
||||
property: {
|
||||
type: "string",
|
||||
const: "object",
|
||||
},
|
||||
value: {
|
||||
type: "string",
|
||||
enum: ["page", "database"],
|
||||
},
|
||||
},
|
||||
required: ["property", "value"],
|
||||
additionalProperties: false,
|
||||
},
|
||||
},
|
||||
additionalProperties: false,
|
||||
};
|
||||
|
||||
export const SearchParameters: JSONSchema = SearchBodyParameters;
|
||||
|
||||
export const SearchResponse: JSONSchema = {
|
||||
type: "object",
|
||||
properties: {
|
||||
type: {
|
||||
type: "string",
|
||||
const: "page_or_database",
|
||||
},
|
||||
page_or_database: EmptyObject,
|
||||
object: {
|
||||
type: "string",
|
||||
const: "list",
|
||||
},
|
||||
next_cursor: {
|
||||
type: ["string", "null"],
|
||||
},
|
||||
has_more: {
|
||||
type: "boolean",
|
||||
},
|
||||
results: {
|
||||
type: "array",
|
||||
items: {
|
||||
anyOf: [
|
||||
PageObjectResponse,
|
||||
PartialPageObjectResponse,
|
||||
PartialDatabaseObjectResponse,
|
||||
DatabaseObjectResponse,
|
||||
],
|
||||
},
|
||||
},
|
||||
},
|
||||
required: [
|
||||
"type",
|
||||
"page_or_database",
|
||||
"object",
|
||||
"next_cursor",
|
||||
"has_more",
|
||||
"results",
|
||||
],
|
||||
additionalProperties: false,
|
||||
};
|
||||
+1672
File diff suppressed because it is too large
Load Diff
+731
@@ -0,0 +1,731 @@
|
||||
import { JSONSchema } from "core/schemas/types";
|
||||
import {
|
||||
EmptyObject,
|
||||
IdRequest,
|
||||
NeverRecord,
|
||||
SelectColor,
|
||||
StringRequest,
|
||||
} from "../common";
|
||||
import {
|
||||
DatabaseObjectResponse,
|
||||
PartialDatabaseObjectResponse,
|
||||
} from "../database";
|
||||
import { NumberFormat } from "../databasePropertyConfigs";
|
||||
import { EmojiRequest } from "../emoji";
|
||||
import { RollupFunction } from "../functions";
|
||||
import { TextRequest } from "../requests";
|
||||
import { RichTextItemRequest } from "../richTextItemRequest";
|
||||
|
||||
export const UpdateDatabasePathParameters: JSONSchema = {
|
||||
type: "object",
|
||||
properties: {
|
||||
database_id: IdRequest,
|
||||
},
|
||||
required: ["database_id"],
|
||||
additionalProperties: false,
|
||||
};
|
||||
|
||||
export const UpdateDatabaseParametersProperties: JSONSchema = {
|
||||
type: "object",
|
||||
additionalProperties: {
|
||||
anyOf: [
|
||||
{
|
||||
type: "object",
|
||||
properties: {
|
||||
number: {
|
||||
type: "object",
|
||||
properties: {
|
||||
format: NumberFormat,
|
||||
},
|
||||
additionalProperties: false,
|
||||
},
|
||||
type: {
|
||||
type: "string",
|
||||
const: "number",
|
||||
},
|
||||
name: {
|
||||
type: "string",
|
||||
},
|
||||
},
|
||||
required: ["number"],
|
||||
additionalProperties: false,
|
||||
},
|
||||
{
|
||||
type: "null",
|
||||
},
|
||||
{
|
||||
type: "object",
|
||||
properties: {
|
||||
formula: {
|
||||
type: "object",
|
||||
properties: {
|
||||
expression: {
|
||||
type: "string",
|
||||
},
|
||||
},
|
||||
additionalProperties: false,
|
||||
},
|
||||
type: {
|
||||
type: "string",
|
||||
const: "formula",
|
||||
},
|
||||
name: {
|
||||
type: "string",
|
||||
},
|
||||
},
|
||||
required: ["formula"],
|
||||
additionalProperties: false,
|
||||
},
|
||||
{
|
||||
type: "object",
|
||||
properties: {
|
||||
select: {
|
||||
type: "object",
|
||||
properties: {
|
||||
options: {
|
||||
type: "array",
|
||||
items: {
|
||||
anyOf: [
|
||||
{
|
||||
type: "object",
|
||||
properties: {
|
||||
id: StringRequest,
|
||||
name: StringRequest,
|
||||
color: SelectColor,
|
||||
},
|
||||
required: ["id"],
|
||||
additionalProperties: false,
|
||||
},
|
||||
{
|
||||
type: "object",
|
||||
properties: {
|
||||
name: StringRequest,
|
||||
id: StringRequest,
|
||||
color: SelectColor,
|
||||
},
|
||||
required: ["name"],
|
||||
additionalProperties: false,
|
||||
},
|
||||
],
|
||||
},
|
||||
},
|
||||
},
|
||||
additionalProperties: false,
|
||||
},
|
||||
type: {
|
||||
type: "string",
|
||||
const: "select",
|
||||
},
|
||||
name: {
|
||||
type: "string",
|
||||
},
|
||||
},
|
||||
required: ["select"],
|
||||
additionalProperties: false,
|
||||
},
|
||||
{
|
||||
type: "object",
|
||||
properties: {
|
||||
multi_select: {
|
||||
type: "object",
|
||||
properties: {
|
||||
options: {
|
||||
type: "array",
|
||||
items: {
|
||||
anyOf: [
|
||||
{
|
||||
type: "object",
|
||||
properties: {
|
||||
id: StringRequest,
|
||||
name: StringRequest,
|
||||
color: SelectColor,
|
||||
},
|
||||
required: ["id"],
|
||||
additionalProperties: false,
|
||||
},
|
||||
{
|
||||
type: "object",
|
||||
properties: {
|
||||
name: StringRequest,
|
||||
id: StringRequest,
|
||||
color: SelectColor,
|
||||
},
|
||||
required: ["name"],
|
||||
additionalProperties: false,
|
||||
},
|
||||
],
|
||||
},
|
||||
},
|
||||
},
|
||||
additionalProperties: false,
|
||||
},
|
||||
type: {
|
||||
type: "string",
|
||||
const: "multi_select",
|
||||
},
|
||||
name: {
|
||||
type: "string",
|
||||
},
|
||||
},
|
||||
required: ["multi_select"],
|
||||
additionalProperties: false,
|
||||
},
|
||||
{
|
||||
type: "object",
|
||||
properties: {
|
||||
status: EmptyObject,
|
||||
type: {
|
||||
type: "string",
|
||||
const: "status",
|
||||
},
|
||||
name: {
|
||||
type: "string",
|
||||
},
|
||||
},
|
||||
required: ["status"],
|
||||
additionalProperties: false,
|
||||
},
|
||||
{
|
||||
type: "object",
|
||||
properties: {
|
||||
relation: {
|
||||
anyOf: [
|
||||
{
|
||||
type: "object",
|
||||
properties: {
|
||||
single_property: EmptyObject,
|
||||
database_id: IdRequest,
|
||||
type: {
|
||||
type: "string",
|
||||
const: "single_property",
|
||||
},
|
||||
},
|
||||
required: ["single_property", "database_id"],
|
||||
additionalProperties: false,
|
||||
},
|
||||
{
|
||||
type: "object",
|
||||
properties: {
|
||||
dual_property: NeverRecord,
|
||||
database_id: IdRequest,
|
||||
type: {
|
||||
type: "string",
|
||||
const: "dual_property",
|
||||
},
|
||||
},
|
||||
required: ["dual_property", "database_id"],
|
||||
additionalProperties: false,
|
||||
},
|
||||
],
|
||||
},
|
||||
type: {
|
||||
type: "string",
|
||||
const: "relation",
|
||||
},
|
||||
name: {
|
||||
type: "string",
|
||||
},
|
||||
},
|
||||
required: ["relation"],
|
||||
additionalProperties: false,
|
||||
},
|
||||
{
|
||||
type: "object",
|
||||
properties: {
|
||||
rollup: {
|
||||
anyOf: [
|
||||
{
|
||||
type: "object",
|
||||
properties: {
|
||||
rollup_property_name: {
|
||||
type: "string",
|
||||
},
|
||||
relation_property_name: {
|
||||
type: "string",
|
||||
},
|
||||
function: RollupFunction,
|
||||
rollup_property_id: {
|
||||
type: "string",
|
||||
},
|
||||
relation_property_id: {
|
||||
type: "string",
|
||||
},
|
||||
},
|
||||
required: [
|
||||
"rollup_property_name",
|
||||
"relation_property_name",
|
||||
"function",
|
||||
],
|
||||
additionalProperties: false,
|
||||
},
|
||||
{
|
||||
type: "object",
|
||||
properties: {
|
||||
rollup_property_name: {
|
||||
type: "string",
|
||||
},
|
||||
relation_property_id: {
|
||||
type: "string",
|
||||
},
|
||||
function: RollupFunction,
|
||||
relation_property_name: {
|
||||
type: "string",
|
||||
},
|
||||
rollup_property_id: {
|
||||
type: "string",
|
||||
},
|
||||
},
|
||||
required: [
|
||||
"rollup_property_name",
|
||||
"relation_property_id",
|
||||
"function",
|
||||
],
|
||||
additionalProperties: false,
|
||||
},
|
||||
{
|
||||
type: "object",
|
||||
properties: {
|
||||
relation_property_name: {
|
||||
type: "string",
|
||||
},
|
||||
rollup_property_id: {
|
||||
type: "string",
|
||||
},
|
||||
function: RollupFunction,
|
||||
rollup_property_name: {
|
||||
type: "string",
|
||||
},
|
||||
relation_property_id: {
|
||||
type: "string",
|
||||
},
|
||||
},
|
||||
required: [
|
||||
"relation_property_name",
|
||||
"rollup_property_id",
|
||||
"function",
|
||||
],
|
||||
additionalProperties: false,
|
||||
},
|
||||
{
|
||||
type: "object",
|
||||
properties: {
|
||||
rollup_property_id: {
|
||||
type: "string",
|
||||
},
|
||||
relation_property_id: {
|
||||
type: "string",
|
||||
},
|
||||
function: RollupFunction,
|
||||
rollup_property_name: {
|
||||
type: "string",
|
||||
},
|
||||
relation_property_name: {
|
||||
type: "string",
|
||||
},
|
||||
},
|
||||
required: [
|
||||
"rollup_property_id",
|
||||
"relation_property_id",
|
||||
"function",
|
||||
],
|
||||
additionalProperties: false,
|
||||
},
|
||||
],
|
||||
},
|
||||
type: {
|
||||
type: "string",
|
||||
const: "rollup",
|
||||
},
|
||||
name: {
|
||||
type: "string",
|
||||
},
|
||||
},
|
||||
required: ["rollup"],
|
||||
additionalProperties: false,
|
||||
},
|
||||
{
|
||||
type: "object",
|
||||
properties: {
|
||||
title: EmptyObject,
|
||||
type: {
|
||||
type: "string",
|
||||
const: "title",
|
||||
},
|
||||
name: {
|
||||
type: "string",
|
||||
},
|
||||
},
|
||||
required: ["title"],
|
||||
additionalProperties: false,
|
||||
},
|
||||
{
|
||||
type: "object",
|
||||
properties: {
|
||||
rich_text: EmptyObject,
|
||||
type: {
|
||||
type: "string",
|
||||
const: "rich_text",
|
||||
},
|
||||
name: {
|
||||
type: "string",
|
||||
},
|
||||
},
|
||||
required: ["rich_text"],
|
||||
additionalProperties: false,
|
||||
},
|
||||
{
|
||||
type: "object",
|
||||
properties: {
|
||||
url: EmptyObject,
|
||||
type: {
|
||||
type: "string",
|
||||
const: "url",
|
||||
},
|
||||
name: {
|
||||
type: "string",
|
||||
},
|
||||
},
|
||||
required: ["url"],
|
||||
additionalProperties: false,
|
||||
},
|
||||
{
|
||||
type: "object",
|
||||
properties: {
|
||||
people: EmptyObject,
|
||||
type: {
|
||||
type: "string",
|
||||
const: "people",
|
||||
},
|
||||
name: {
|
||||
type: "string",
|
||||
},
|
||||
},
|
||||
required: ["people"],
|
||||
additionalProperties: false,
|
||||
},
|
||||
{
|
||||
type: "object",
|
||||
properties: {
|
||||
files: EmptyObject,
|
||||
type: {
|
||||
type: "string",
|
||||
const: "files",
|
||||
},
|
||||
name: {
|
||||
type: "string",
|
||||
},
|
||||
},
|
||||
required: ["files"],
|
||||
additionalProperties: false,
|
||||
},
|
||||
{
|
||||
type: "object",
|
||||
properties: {
|
||||
email: EmptyObject,
|
||||
type: {
|
||||
type: "string",
|
||||
const: "email",
|
||||
},
|
||||
name: {
|
||||
type: "string",
|
||||
},
|
||||
},
|
||||
required: ["email"],
|
||||
additionalProperties: false,
|
||||
},
|
||||
{
|
||||
type: "object",
|
||||
properties: {
|
||||
phone_number: EmptyObject,
|
||||
type: {
|
||||
type: "string",
|
||||
const: "phone_number",
|
||||
},
|
||||
name: {
|
||||
type: "string",
|
||||
},
|
||||
},
|
||||
required: ["phone_number"],
|
||||
additionalProperties: false,
|
||||
},
|
||||
{
|
||||
type: "object",
|
||||
properties: {
|
||||
date: EmptyObject,
|
||||
type: {
|
||||
type: "string",
|
||||
const: "date",
|
||||
},
|
||||
name: {
|
||||
type: "string",
|
||||
},
|
||||
},
|
||||
required: ["date"],
|
||||
additionalProperties: false,
|
||||
},
|
||||
{
|
||||
type: "object",
|
||||
properties: {
|
||||
checkbox: EmptyObject,
|
||||
type: {
|
||||
type: "string",
|
||||
const: "checkbox",
|
||||
},
|
||||
name: {
|
||||
type: "string",
|
||||
},
|
||||
},
|
||||
required: ["checkbox"],
|
||||
additionalProperties: false,
|
||||
},
|
||||
{
|
||||
type: "object",
|
||||
properties: {
|
||||
created_by: EmptyObject,
|
||||
type: {
|
||||
type: "string",
|
||||
const: "created_by",
|
||||
},
|
||||
name: {
|
||||
type: "string",
|
||||
},
|
||||
},
|
||||
required: ["created_by"],
|
||||
additionalProperties: false,
|
||||
},
|
||||
{
|
||||
type: "object",
|
||||
properties: {
|
||||
created_time: EmptyObject,
|
||||
type: {
|
||||
type: "string",
|
||||
const: "created_time",
|
||||
},
|
||||
name: {
|
||||
type: "string",
|
||||
},
|
||||
},
|
||||
required: ["created_time"],
|
||||
additionalProperties: false,
|
||||
},
|
||||
{
|
||||
type: "object",
|
||||
properties: {
|
||||
last_edited_by: EmptyObject,
|
||||
type: {
|
||||
type: "string",
|
||||
const: "last_edited_by",
|
||||
},
|
||||
name: {
|
||||
type: "string",
|
||||
},
|
||||
},
|
||||
required: ["last_edited_by"],
|
||||
additionalProperties: false,
|
||||
},
|
||||
{
|
||||
type: "object",
|
||||
properties: {
|
||||
last_edited_time: EmptyObject,
|
||||
type: {
|
||||
type: "string",
|
||||
const: "last_edited_time",
|
||||
},
|
||||
name: {
|
||||
type: "string",
|
||||
},
|
||||
},
|
||||
required: ["last_edited_time"],
|
||||
additionalProperties: false,
|
||||
},
|
||||
{
|
||||
type: "object",
|
||||
properties: {
|
||||
name: {
|
||||
type: "string",
|
||||
},
|
||||
},
|
||||
required: ["name"],
|
||||
additionalProperties: false,
|
||||
},
|
||||
],
|
||||
},
|
||||
};
|
||||
|
||||
export const UpdateDatabaseBodyParameters: JSONSchema = {
|
||||
type: "object",
|
||||
properties: {
|
||||
title: {
|
||||
type: "array",
|
||||
items: RichTextItemRequest,
|
||||
},
|
||||
description: {
|
||||
type: "array",
|
||||
items: RichTextItemRequest,
|
||||
},
|
||||
icon: {
|
||||
anyOf: [
|
||||
{
|
||||
type: "object",
|
||||
properties: {
|
||||
emoji: EmojiRequest,
|
||||
type: {
|
||||
type: "string",
|
||||
const: "emoji",
|
||||
},
|
||||
},
|
||||
required: ["emoji"],
|
||||
additionalProperties: false,
|
||||
},
|
||||
{
|
||||
type: "null",
|
||||
},
|
||||
{
|
||||
type: "object",
|
||||
properties: {
|
||||
external: {
|
||||
type: "object",
|
||||
properties: {
|
||||
url: TextRequest,
|
||||
},
|
||||
required: ["url"],
|
||||
additionalProperties: false,
|
||||
},
|
||||
type: {
|
||||
type: "string",
|
||||
const: "external",
|
||||
},
|
||||
},
|
||||
required: ["external"],
|
||||
additionalProperties: false,
|
||||
},
|
||||
],
|
||||
},
|
||||
cover: {
|
||||
anyOf: [
|
||||
{
|
||||
type: "object",
|
||||
properties: {
|
||||
external: {
|
||||
type: "object",
|
||||
properties: {
|
||||
url: TextRequest,
|
||||
},
|
||||
required: ["url"],
|
||||
additionalProperties: false,
|
||||
},
|
||||
type: {
|
||||
type: "string",
|
||||
const: "external",
|
||||
},
|
||||
},
|
||||
required: ["external"],
|
||||
additionalProperties: false,
|
||||
},
|
||||
{
|
||||
type: "null",
|
||||
},
|
||||
],
|
||||
},
|
||||
properties: UpdateDatabaseParametersProperties,
|
||||
is_inline: {
|
||||
type: "boolean",
|
||||
},
|
||||
archived: {
|
||||
type: "boolean",
|
||||
},
|
||||
},
|
||||
additionalProperties: false,
|
||||
};
|
||||
|
||||
export const UpdateDatabaseParameters: JSONSchema = {
|
||||
type: "object",
|
||||
additionalProperties: false,
|
||||
properties: {
|
||||
title: {
|
||||
type: "array",
|
||||
items: RichTextItemRequest,
|
||||
},
|
||||
description: {
|
||||
type: "array",
|
||||
items: RichTextItemRequest,
|
||||
},
|
||||
icon: {
|
||||
anyOf: [
|
||||
{
|
||||
type: "object",
|
||||
properties: {
|
||||
emoji: EmojiRequest,
|
||||
type: {
|
||||
type: "string",
|
||||
const: "emoji",
|
||||
},
|
||||
},
|
||||
required: ["emoji"],
|
||||
additionalProperties: false,
|
||||
},
|
||||
{
|
||||
type: "null",
|
||||
},
|
||||
{
|
||||
type: "object",
|
||||
properties: {
|
||||
external: {
|
||||
type: "object",
|
||||
properties: {
|
||||
url: TextRequest,
|
||||
},
|
||||
required: ["url"],
|
||||
additionalProperties: false,
|
||||
},
|
||||
type: {
|
||||
type: "string",
|
||||
const: "external",
|
||||
},
|
||||
},
|
||||
required: ["external"],
|
||||
additionalProperties: false,
|
||||
},
|
||||
],
|
||||
},
|
||||
cover: {
|
||||
anyOf: [
|
||||
{
|
||||
type: "object",
|
||||
properties: {
|
||||
external: {
|
||||
type: "object",
|
||||
properties: {
|
||||
url: TextRequest,
|
||||
},
|
||||
required: ["url"],
|
||||
additionalProperties: false,
|
||||
},
|
||||
type: {
|
||||
type: "string",
|
||||
const: "external",
|
||||
},
|
||||
},
|
||||
required: ["external"],
|
||||
additionalProperties: false,
|
||||
},
|
||||
{
|
||||
type: "null",
|
||||
},
|
||||
],
|
||||
},
|
||||
properties: UpdateDatabaseParametersProperties,
|
||||
is_inline: {
|
||||
type: "boolean",
|
||||
},
|
||||
archived: {
|
||||
type: "boolean",
|
||||
},
|
||||
database_id: IdRequest,
|
||||
},
|
||||
required: ["database_id"],
|
||||
};
|
||||
|
||||
export const UpdateDatabaseResponse: JSONSchema = {
|
||||
anyOf: [PartialDatabaseObjectResponse, DatabaseObjectResponse],
|
||||
};
|
||||
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,918 @@
|
||||
import { JSONSchema } from "core/schemas/types";
|
||||
import { EmptyObject, IdRequest } from "./common";
|
||||
|
||||
export const ExistencePropertyFilter: JSONSchema = {
|
||||
anyOf: [
|
||||
{
|
||||
type: "object",
|
||||
properties: {
|
||||
is_empty: {
|
||||
type: "boolean",
|
||||
const: true,
|
||||
},
|
||||
},
|
||||
required: ["is_empty"],
|
||||
additionalProperties: false,
|
||||
},
|
||||
{
|
||||
type: "object",
|
||||
properties: {
|
||||
is_not_empty: {
|
||||
type: "boolean",
|
||||
const: true,
|
||||
},
|
||||
},
|
||||
required: ["is_not_empty"],
|
||||
additionalProperties: false,
|
||||
},
|
||||
],
|
||||
};
|
||||
|
||||
export const TextPropertyFilter: JSONSchema = {
|
||||
anyOf: [
|
||||
{
|
||||
type: "object",
|
||||
properties: {
|
||||
equals: {
|
||||
type: "string",
|
||||
},
|
||||
},
|
||||
required: ["equals"],
|
||||
additionalProperties: false,
|
||||
},
|
||||
{
|
||||
type: "object",
|
||||
properties: {
|
||||
does_not_equal: {
|
||||
type: "string",
|
||||
},
|
||||
},
|
||||
required: ["does_not_equal"],
|
||||
additionalProperties: false,
|
||||
},
|
||||
{
|
||||
type: "object",
|
||||
properties: {
|
||||
contains: {
|
||||
type: "string",
|
||||
},
|
||||
},
|
||||
required: ["contains"],
|
||||
additionalProperties: false,
|
||||
},
|
||||
{
|
||||
type: "object",
|
||||
properties: {
|
||||
does_not_contain: {
|
||||
type: "string",
|
||||
},
|
||||
},
|
||||
required: ["does_not_contain"],
|
||||
additionalProperties: false,
|
||||
},
|
||||
{
|
||||
type: "object",
|
||||
properties: {
|
||||
starts_with: {
|
||||
type: "string",
|
||||
},
|
||||
},
|
||||
required: ["starts_with"],
|
||||
additionalProperties: false,
|
||||
},
|
||||
{
|
||||
type: "object",
|
||||
properties: {
|
||||
ends_with: {
|
||||
type: "string",
|
||||
},
|
||||
},
|
||||
required: ["ends_with"],
|
||||
additionalProperties: false,
|
||||
},
|
||||
ExistencePropertyFilter,
|
||||
],
|
||||
};
|
||||
|
||||
export const NumberPropertyFilter: JSONSchema = {
|
||||
anyOf: [
|
||||
{
|
||||
type: "object",
|
||||
properties: {
|
||||
equals: {
|
||||
type: "number",
|
||||
},
|
||||
},
|
||||
required: ["equals"],
|
||||
additionalProperties: false,
|
||||
},
|
||||
{
|
||||
type: "object",
|
||||
properties: {
|
||||
does_not_equal: {
|
||||
type: "number",
|
||||
},
|
||||
},
|
||||
required: ["does_not_equal"],
|
||||
additionalProperties: false,
|
||||
},
|
||||
{
|
||||
type: "object",
|
||||
properties: {
|
||||
greater_than: {
|
||||
type: "number",
|
||||
},
|
||||
},
|
||||
required: ["greater_than"],
|
||||
additionalProperties: false,
|
||||
},
|
||||
{
|
||||
type: "object",
|
||||
properties: {
|
||||
less_than: {
|
||||
type: "number",
|
||||
},
|
||||
},
|
||||
required: ["less_than"],
|
||||
additionalProperties: false,
|
||||
},
|
||||
{
|
||||
type: "object",
|
||||
properties: {
|
||||
greater_than_or_equal_to: {
|
||||
type: "number",
|
||||
},
|
||||
},
|
||||
required: ["greater_than_or_equal_to"],
|
||||
additionalProperties: false,
|
||||
},
|
||||
{
|
||||
type: "object",
|
||||
properties: {
|
||||
less_than_or_equal_to: {
|
||||
type: "number",
|
||||
},
|
||||
},
|
||||
required: ["less_than_or_equal_to"],
|
||||
additionalProperties: false,
|
||||
},
|
||||
ExistencePropertyFilter,
|
||||
],
|
||||
};
|
||||
|
||||
export const CheckboxPropertyFilter: JSONSchema = {
|
||||
anyOf: [
|
||||
{
|
||||
type: "object",
|
||||
properties: {
|
||||
equals: {
|
||||
type: "boolean",
|
||||
},
|
||||
},
|
||||
required: ["equals"],
|
||||
additionalProperties: false,
|
||||
},
|
||||
{
|
||||
type: "object",
|
||||
properties: {
|
||||
does_not_equal: {
|
||||
type: "boolean",
|
||||
},
|
||||
},
|
||||
required: ["does_not_equal"],
|
||||
additionalProperties: false,
|
||||
},
|
||||
],
|
||||
};
|
||||
|
||||
export const SelectPropertyFilter: JSONSchema = {
|
||||
anyOf: [
|
||||
{
|
||||
type: "object",
|
||||
properties: {
|
||||
equals: {
|
||||
type: "string",
|
||||
},
|
||||
},
|
||||
required: ["equals"],
|
||||
additionalProperties: false,
|
||||
},
|
||||
{
|
||||
type: "object",
|
||||
properties: {
|
||||
does_not_equal: {
|
||||
type: "string",
|
||||
},
|
||||
},
|
||||
required: ["does_not_equal"],
|
||||
additionalProperties: false,
|
||||
},
|
||||
ExistencePropertyFilter,
|
||||
],
|
||||
};
|
||||
|
||||
export const MultiSelectPropertyFilter: JSONSchema = {
|
||||
anyOf: [
|
||||
{
|
||||
type: "object",
|
||||
properties: {
|
||||
contains: {
|
||||
type: "string",
|
||||
},
|
||||
},
|
||||
required: ["contains"],
|
||||
additionalProperties: false,
|
||||
},
|
||||
{
|
||||
type: "object",
|
||||
properties: {
|
||||
does_not_contain: {
|
||||
type: "string",
|
||||
},
|
||||
},
|
||||
required: ["does_not_contain"],
|
||||
additionalProperties: false,
|
||||
},
|
||||
ExistencePropertyFilter,
|
||||
],
|
||||
};
|
||||
|
||||
export const StatusPropertyFilter: JSONSchema = {
|
||||
anyOf: [
|
||||
{
|
||||
type: "object",
|
||||
properties: {
|
||||
equals: {
|
||||
type: "string",
|
||||
},
|
||||
},
|
||||
required: ["equals"],
|
||||
additionalProperties: false,
|
||||
},
|
||||
{
|
||||
type: "object",
|
||||
properties: {
|
||||
does_not_equal: {
|
||||
type: "string",
|
||||
},
|
||||
},
|
||||
required: ["does_not_equal"],
|
||||
additionalProperties: false,
|
||||
},
|
||||
ExistencePropertyFilter,
|
||||
],
|
||||
};
|
||||
|
||||
export const DatePropertyFilter: JSONSchema = {
|
||||
anyOf: [
|
||||
{
|
||||
type: "object",
|
||||
properties: {
|
||||
equals: {
|
||||
type: "string",
|
||||
},
|
||||
},
|
||||
required: ["equals"],
|
||||
additionalProperties: false,
|
||||
},
|
||||
{
|
||||
type: "object",
|
||||
properties: {
|
||||
before: {
|
||||
type: "string",
|
||||
},
|
||||
},
|
||||
required: ["before"],
|
||||
additionalProperties: false,
|
||||
},
|
||||
{
|
||||
type: "object",
|
||||
properties: {
|
||||
after: {
|
||||
type: "string",
|
||||
},
|
||||
},
|
||||
required: ["after"],
|
||||
additionalProperties: false,
|
||||
},
|
||||
{
|
||||
type: "object",
|
||||
properties: {
|
||||
on_or_before: {
|
||||
type: "string",
|
||||
},
|
||||
},
|
||||
required: ["on_or_before"],
|
||||
additionalProperties: false,
|
||||
},
|
||||
{
|
||||
type: "object",
|
||||
properties: {
|
||||
on_or_after: {
|
||||
type: "string",
|
||||
},
|
||||
},
|
||||
required: ["on_or_after"],
|
||||
additionalProperties: false,
|
||||
},
|
||||
{
|
||||
type: "object",
|
||||
properties: {
|
||||
this_week: EmptyObject,
|
||||
},
|
||||
required: ["this_week"],
|
||||
additionalProperties: false,
|
||||
},
|
||||
{
|
||||
type: "object",
|
||||
properties: {
|
||||
past_week: EmptyObject,
|
||||
},
|
||||
required: ["past_week"],
|
||||
additionalProperties: false,
|
||||
},
|
||||
{
|
||||
type: "object",
|
||||
properties: {
|
||||
past_month: EmptyObject,
|
||||
},
|
||||
required: ["past_month"],
|
||||
additionalProperties: false,
|
||||
},
|
||||
{
|
||||
type: "object",
|
||||
properties: {
|
||||
past_year: EmptyObject,
|
||||
},
|
||||
required: ["past_year"],
|
||||
additionalProperties: false,
|
||||
},
|
||||
{
|
||||
type: "object",
|
||||
properties: {
|
||||
next_week: EmptyObject,
|
||||
},
|
||||
required: ["next_week"],
|
||||
additionalProperties: false,
|
||||
},
|
||||
{
|
||||
type: "object",
|
||||
properties: {
|
||||
next_month: EmptyObject,
|
||||
},
|
||||
required: ["next_month"],
|
||||
additionalProperties: false,
|
||||
},
|
||||
{
|
||||
type: "object",
|
||||
properties: {
|
||||
next_year: EmptyObject,
|
||||
},
|
||||
required: ["next_year"],
|
||||
additionalProperties: false,
|
||||
},
|
||||
ExistencePropertyFilter,
|
||||
],
|
||||
};
|
||||
|
||||
export const PeoplePropertyFilter: JSONSchema = {
|
||||
anyOf: [
|
||||
{
|
||||
type: "object",
|
||||
properties: {
|
||||
contains: IdRequest,
|
||||
},
|
||||
required: ["contains"],
|
||||
additionalProperties: false,
|
||||
},
|
||||
{
|
||||
type: "object",
|
||||
properties: {
|
||||
does_not_contain: IdRequest,
|
||||
},
|
||||
required: ["does_not_contain"],
|
||||
additionalProperties: false,
|
||||
},
|
||||
ExistencePropertyFilter,
|
||||
],
|
||||
};
|
||||
|
||||
export const RelationPropertyFilter: JSONSchema = {
|
||||
anyOf: [
|
||||
{
|
||||
type: "object",
|
||||
properties: {
|
||||
contains: IdRequest,
|
||||
},
|
||||
required: ["contains"],
|
||||
additionalProperties: false,
|
||||
},
|
||||
{
|
||||
type: "object",
|
||||
properties: {
|
||||
does_not_contain: IdRequest,
|
||||
},
|
||||
required: ["does_not_contain"],
|
||||
additionalProperties: false,
|
||||
},
|
||||
ExistencePropertyFilter,
|
||||
],
|
||||
};
|
||||
|
||||
export const FormulaPropertyFilter: JSONSchema = {
|
||||
anyOf: [
|
||||
{
|
||||
type: "object",
|
||||
properties: {
|
||||
string: TextPropertyFilter,
|
||||
},
|
||||
required: ["string"],
|
||||
additionalProperties: false,
|
||||
},
|
||||
{
|
||||
type: "object",
|
||||
properties: {
|
||||
checkbox: CheckboxPropertyFilter,
|
||||
},
|
||||
required: ["checkbox"],
|
||||
additionalProperties: false,
|
||||
},
|
||||
{
|
||||
type: "object",
|
||||
properties: {
|
||||
number: NumberPropertyFilter,
|
||||
},
|
||||
required: ["number"],
|
||||
additionalProperties: false,
|
||||
},
|
||||
{
|
||||
type: "object",
|
||||
properties: {
|
||||
date: DatePropertyFilter,
|
||||
},
|
||||
required: ["date"],
|
||||
additionalProperties: false,
|
||||
},
|
||||
],
|
||||
};
|
||||
|
||||
export const RollupSubfilterPropertyFilter: JSONSchema = {
|
||||
anyOf: [
|
||||
{
|
||||
type: "object",
|
||||
properties: {
|
||||
rich_text: TextPropertyFilter,
|
||||
},
|
||||
required: ["rich_text"],
|
||||
additionalProperties: false,
|
||||
},
|
||||
{
|
||||
type: "object",
|
||||
properties: {
|
||||
number: NumberPropertyFilter,
|
||||
},
|
||||
required: ["number"],
|
||||
additionalProperties: false,
|
||||
},
|
||||
{
|
||||
type: "object",
|
||||
properties: {
|
||||
checkbox: CheckboxPropertyFilter,
|
||||
},
|
||||
required: ["checkbox"],
|
||||
additionalProperties: false,
|
||||
},
|
||||
{
|
||||
type: "object",
|
||||
properties: {
|
||||
select: SelectPropertyFilter,
|
||||
},
|
||||
required: ["select"],
|
||||
additionalProperties: false,
|
||||
},
|
||||
{
|
||||
type: "object",
|
||||
properties: {
|
||||
multi_select: MultiSelectPropertyFilter,
|
||||
},
|
||||
required: ["multi_select"],
|
||||
additionalProperties: false,
|
||||
},
|
||||
{
|
||||
type: "object",
|
||||
properties: {
|
||||
relation: RelationPropertyFilter,
|
||||
},
|
||||
required: ["relation"],
|
||||
additionalProperties: false,
|
||||
},
|
||||
{
|
||||
type: "object",
|
||||
properties: {
|
||||
date: DatePropertyFilter,
|
||||
},
|
||||
required: ["date"],
|
||||
additionalProperties: false,
|
||||
},
|
||||
{
|
||||
type: "object",
|
||||
properties: {
|
||||
people: PeoplePropertyFilter,
|
||||
},
|
||||
required: ["people"],
|
||||
additionalProperties: false,
|
||||
},
|
||||
{
|
||||
type: "object",
|
||||
properties: {
|
||||
files: ExistencePropertyFilter,
|
||||
},
|
||||
required: ["files"],
|
||||
additionalProperties: false,
|
||||
},
|
||||
],
|
||||
};
|
||||
|
||||
export const RollupPropertyFilter: JSONSchema = {
|
||||
anyOf: [
|
||||
{
|
||||
type: "object",
|
||||
properties: {
|
||||
any: RollupSubfilterPropertyFilter,
|
||||
},
|
||||
required: ["any"],
|
||||
additionalProperties: false,
|
||||
},
|
||||
{
|
||||
type: "object",
|
||||
properties: {
|
||||
none: RollupSubfilterPropertyFilter,
|
||||
},
|
||||
required: ["none"],
|
||||
additionalProperties: false,
|
||||
},
|
||||
{
|
||||
type: "object",
|
||||
properties: {
|
||||
every: RollupSubfilterPropertyFilter,
|
||||
},
|
||||
required: ["every"],
|
||||
additionalProperties: false,
|
||||
},
|
||||
{
|
||||
type: "object",
|
||||
properties: {
|
||||
date: DatePropertyFilter,
|
||||
},
|
||||
required: ["date"],
|
||||
additionalProperties: false,
|
||||
},
|
||||
{
|
||||
type: "object",
|
||||
properties: {
|
||||
number: NumberPropertyFilter,
|
||||
},
|
||||
required: ["number"],
|
||||
additionalProperties: false,
|
||||
},
|
||||
],
|
||||
};
|
||||
|
||||
export const PropertyFilter: JSONSchema = {
|
||||
anyOf: [
|
||||
{
|
||||
type: "object",
|
||||
properties: {
|
||||
title: TextPropertyFilter,
|
||||
property: {
|
||||
type: "string",
|
||||
},
|
||||
type: {
|
||||
type: "string",
|
||||
const: "title",
|
||||
},
|
||||
},
|
||||
required: ["title", "property"],
|
||||
additionalProperties: false,
|
||||
},
|
||||
{
|
||||
type: "object",
|
||||
properties: {
|
||||
rich_text: TextPropertyFilter,
|
||||
property: {
|
||||
type: "string",
|
||||
},
|
||||
type: {
|
||||
type: "string",
|
||||
const: "rich_text",
|
||||
},
|
||||
},
|
||||
required: ["rich_text", "property"],
|
||||
additionalProperties: false,
|
||||
},
|
||||
{
|
||||
type: "object",
|
||||
properties: {
|
||||
number: NumberPropertyFilter,
|
||||
property: {
|
||||
type: "string",
|
||||
},
|
||||
type: {
|
||||
type: "string",
|
||||
const: "number",
|
||||
},
|
||||
},
|
||||
required: ["number", "property"],
|
||||
additionalProperties: false,
|
||||
},
|
||||
{
|
||||
type: "object",
|
||||
properties: {
|
||||
checkbox: CheckboxPropertyFilter,
|
||||
property: {
|
||||
type: "string",
|
||||
},
|
||||
type: {
|
||||
type: "string",
|
||||
const: "checkbox",
|
||||
},
|
||||
},
|
||||
required: ["checkbox", "property"],
|
||||
additionalProperties: false,
|
||||
},
|
||||
{
|
||||
type: "object",
|
||||
properties: {
|
||||
select: SelectPropertyFilter,
|
||||
property: {
|
||||
type: "string",
|
||||
},
|
||||
type: {
|
||||
type: "string",
|
||||
const: "select",
|
||||
},
|
||||
},
|
||||
required: ["select", "property"],
|
||||
additionalProperties: false,
|
||||
},
|
||||
{
|
||||
type: "object",
|
||||
properties: {
|
||||
multi_select: MultiSelectPropertyFilter,
|
||||
property: {
|
||||
type: "string",
|
||||
},
|
||||
type: {
|
||||
type: "string",
|
||||
const: "multi_select",
|
||||
},
|
||||
},
|
||||
required: ["multi_select", "property"],
|
||||
additionalProperties: false,
|
||||
},
|
||||
{
|
||||
type: "object",
|
||||
properties: {
|
||||
status: StatusPropertyFilter,
|
||||
property: {
|
||||
type: "string",
|
||||
},
|
||||
type: {
|
||||
type: "string",
|
||||
const: "status",
|
||||
},
|
||||
},
|
||||
required: ["status", "property"],
|
||||
additionalProperties: false,
|
||||
},
|
||||
{
|
||||
type: "object",
|
||||
properties: {
|
||||
date: DatePropertyFilter,
|
||||
property: {
|
||||
type: "string",
|
||||
},
|
||||
type: {
|
||||
type: "string",
|
||||
const: "date",
|
||||
},
|
||||
},
|
||||
required: ["date", "property"],
|
||||
additionalProperties: false,
|
||||
},
|
||||
{
|
||||
type: "object",
|
||||
properties: {
|
||||
people: PeoplePropertyFilter,
|
||||
property: {
|
||||
type: "string",
|
||||
},
|
||||
type: {
|
||||
type: "string",
|
||||
const: "people",
|
||||
},
|
||||
},
|
||||
required: ["people", "property"],
|
||||
additionalProperties: false,
|
||||
},
|
||||
{
|
||||
type: "object",
|
||||
properties: {
|
||||
files: ExistencePropertyFilter,
|
||||
property: {
|
||||
type: "string",
|
||||
},
|
||||
type: {
|
||||
type: "string",
|
||||
const: "files",
|
||||
},
|
||||
},
|
||||
required: ["files", "property"],
|
||||
additionalProperties: false,
|
||||
},
|
||||
{
|
||||
type: "object",
|
||||
properties: {
|
||||
url: TextPropertyFilter,
|
||||
property: {
|
||||
type: "string",
|
||||
},
|
||||
type: {
|
||||
type: "string",
|
||||
const: "url",
|
||||
},
|
||||
},
|
||||
required: ["url", "property"],
|
||||
additionalProperties: false,
|
||||
},
|
||||
{
|
||||
type: "object",
|
||||
properties: {
|
||||
email: TextPropertyFilter,
|
||||
property: {
|
||||
type: "string",
|
||||
},
|
||||
type: {
|
||||
type: "string",
|
||||
const: "email",
|
||||
},
|
||||
},
|
||||
required: ["email", "property"],
|
||||
additionalProperties: false,
|
||||
},
|
||||
{
|
||||
type: "object",
|
||||
properties: {
|
||||
phone_number: TextPropertyFilter,
|
||||
property: {
|
||||
type: "string",
|
||||
},
|
||||
type: {
|
||||
type: "string",
|
||||
const: "phone_number",
|
||||
},
|
||||
},
|
||||
required: ["phone_number", "property"],
|
||||
additionalProperties: false,
|
||||
},
|
||||
{
|
||||
type: "object",
|
||||
properties: {
|
||||
relation: RelationPropertyFilter,
|
||||
property: {
|
||||
type: "string",
|
||||
},
|
||||
type: {
|
||||
type: "string",
|
||||
const: "relation",
|
||||
},
|
||||
},
|
||||
required: ["relation", "property"],
|
||||
additionalProperties: false,
|
||||
},
|
||||
{
|
||||
type: "object",
|
||||
properties: {
|
||||
created_by: PeoplePropertyFilter,
|
||||
property: {
|
||||
type: "string",
|
||||
},
|
||||
type: {
|
||||
type: "string",
|
||||
const: "created_by",
|
||||
},
|
||||
},
|
||||
required: ["created_by", "property"],
|
||||
additionalProperties: false,
|
||||
},
|
||||
{
|
||||
type: "object",
|
||||
properties: {
|
||||
created_time: DatePropertyFilter,
|
||||
property: {
|
||||
type: "string",
|
||||
},
|
||||
type: {
|
||||
type: "string",
|
||||
const: "created_time",
|
||||
},
|
||||
},
|
||||
required: ["created_time", "property"],
|
||||
additionalProperties: false,
|
||||
},
|
||||
{
|
||||
type: "object",
|
||||
properties: {
|
||||
last_edited_by: PeoplePropertyFilter,
|
||||
property: {
|
||||
type: "string",
|
||||
},
|
||||
type: {
|
||||
type: "string",
|
||||
const: "last_edited_by",
|
||||
},
|
||||
},
|
||||
required: ["last_edited_by", "property"],
|
||||
additionalProperties: false,
|
||||
},
|
||||
{
|
||||
type: "object",
|
||||
properties: {
|
||||
last_edited_time: DatePropertyFilter,
|
||||
property: {
|
||||
type: "string",
|
||||
},
|
||||
type: {
|
||||
type: "string",
|
||||
const: "last_edited_time",
|
||||
},
|
||||
},
|
||||
required: ["last_edited_time", "property"],
|
||||
additionalProperties: false,
|
||||
},
|
||||
{
|
||||
type: "object",
|
||||
properties: {
|
||||
formula: FormulaPropertyFilter,
|
||||
property: {
|
||||
type: "string",
|
||||
},
|
||||
type: {
|
||||
type: "string",
|
||||
const: "formula",
|
||||
},
|
||||
},
|
||||
required: ["formula", "property"],
|
||||
additionalProperties: false,
|
||||
},
|
||||
{
|
||||
type: "object",
|
||||
properties: {
|
||||
rollup: RollupPropertyFilter,
|
||||
property: {
|
||||
type: "string",
|
||||
},
|
||||
type: {
|
||||
type: "string",
|
||||
const: "rollup",
|
||||
},
|
||||
},
|
||||
required: ["rollup", "property"],
|
||||
additionalProperties: false,
|
||||
},
|
||||
],
|
||||
};
|
||||
|
||||
export const TimestampCreatedTimeFilter: JSONSchema = {
|
||||
type: "object",
|
||||
properties: {
|
||||
created_time: DatePropertyFilter,
|
||||
timestamp: {
|
||||
type: "string",
|
||||
const: "created_time",
|
||||
},
|
||||
type: {
|
||||
type: "string",
|
||||
const: "created_time",
|
||||
},
|
||||
},
|
||||
required: ["created_time", "timestamp"],
|
||||
additionalProperties: false,
|
||||
};
|
||||
|
||||
export const TimestampLastEditedTimeFilter: JSONSchema = {
|
||||
type: "object",
|
||||
properties: {
|
||||
last_edited_time: DatePropertyFilter,
|
||||
timestamp: {
|
||||
type: "string",
|
||||
const: "last_edited_time",
|
||||
},
|
||||
type: {
|
||||
type: "string",
|
||||
const: "last_edited_time",
|
||||
},
|
||||
},
|
||||
required: ["last_edited_time", "timestamp"],
|
||||
additionalProperties: false,
|
||||
};
|
||||
@@ -0,0 +1,31 @@
|
||||
import { JSONSchema } from "core/schemas/types";
|
||||
|
||||
export const RollupFunction: JSONSchema = {
|
||||
type: "string",
|
||||
enum: [
|
||||
"count",
|
||||
"count_values",
|
||||
"empty",
|
||||
"not_empty",
|
||||
"unique",
|
||||
"show_unique",
|
||||
"percent_empty",
|
||||
"percent_not_empty",
|
||||
"sum",
|
||||
"average",
|
||||
"median",
|
||||
"min",
|
||||
"max",
|
||||
"range",
|
||||
"earliest_date",
|
||||
"latest_date",
|
||||
"date_range",
|
||||
"checked",
|
||||
"unchecked",
|
||||
"percent_checked",
|
||||
"percent_unchecked",
|
||||
"count_per_group",
|
||||
"percent_per_group",
|
||||
"show_original",
|
||||
],
|
||||
};
|
||||
@@ -0,0 +1,798 @@
|
||||
import { JSONSchema } from "core/schemas/types";
|
||||
import { StringRequest } from "./common";
|
||||
import { EmojiRequest } from "./emoji";
|
||||
import { RollupFunction } from "./functions";
|
||||
import { PartialUserObjectResponse, UserObjectResponse } from "./person";
|
||||
import { TextRequest } from "./requests";
|
||||
import {
|
||||
DateResponse,
|
||||
FormulaPropertyResponse,
|
||||
RichTextItemResponse,
|
||||
SelectPropertyResponse,
|
||||
} from "./responses";
|
||||
|
||||
export const PageObjectResponseProperties: JSONSchema = {
|
||||
type: "object",
|
||||
additionalProperties: {
|
||||
anyOf: [
|
||||
{
|
||||
type: "object",
|
||||
properties: {
|
||||
type: {
|
||||
type: "string",
|
||||
const: "number",
|
||||
},
|
||||
number: {
|
||||
type: ["number", "null"],
|
||||
},
|
||||
id: {
|
||||
type: "string",
|
||||
},
|
||||
},
|
||||
required: ["type", "number", "id"],
|
||||
additionalProperties: false,
|
||||
},
|
||||
{
|
||||
type: "object",
|
||||
properties: {
|
||||
type: {
|
||||
type: "string",
|
||||
const: "url",
|
||||
},
|
||||
url: {
|
||||
type: ["string", "null"],
|
||||
},
|
||||
id: {
|
||||
type: "string",
|
||||
},
|
||||
},
|
||||
required: ["type", "url", "id"],
|
||||
additionalProperties: false,
|
||||
},
|
||||
{
|
||||
type: "object",
|
||||
properties: {
|
||||
type: {
|
||||
type: "string",
|
||||
const: "select",
|
||||
},
|
||||
select: {
|
||||
anyOf: [
|
||||
SelectPropertyResponse,
|
||||
{
|
||||
type: "null",
|
||||
},
|
||||
],
|
||||
},
|
||||
id: {
|
||||
type: "string",
|
||||
},
|
||||
},
|
||||
required: ["type", "select", "id"],
|
||||
additionalProperties: false,
|
||||
},
|
||||
{
|
||||
type: "object",
|
||||
properties: {
|
||||
type: {
|
||||
type: "string",
|
||||
const: "multi_select",
|
||||
},
|
||||
multi_select: {
|
||||
type: "array",
|
||||
items: SelectPropertyResponse,
|
||||
},
|
||||
id: {
|
||||
type: "string",
|
||||
},
|
||||
},
|
||||
required: ["type", "multi_select", "id"],
|
||||
additionalProperties: false,
|
||||
},
|
||||
{
|
||||
type: "object",
|
||||
properties: {
|
||||
type: {
|
||||
type: "string",
|
||||
const: "status",
|
||||
},
|
||||
status: {
|
||||
anyOf: [
|
||||
SelectPropertyResponse,
|
||||
{
|
||||
type: "null",
|
||||
},
|
||||
],
|
||||
},
|
||||
id: {
|
||||
type: "string",
|
||||
},
|
||||
},
|
||||
required: ["type", "status", "id"],
|
||||
additionalProperties: false,
|
||||
},
|
||||
{
|
||||
type: "object",
|
||||
properties: {
|
||||
type: {
|
||||
type: "string",
|
||||
const: "date",
|
||||
},
|
||||
date: {
|
||||
anyOf: [
|
||||
DateResponse,
|
||||
{
|
||||
type: "null",
|
||||
},
|
||||
],
|
||||
},
|
||||
id: {
|
||||
type: "string",
|
||||
},
|
||||
},
|
||||
required: ["type", "date", "id"],
|
||||
additionalProperties: false,
|
||||
},
|
||||
{
|
||||
type: "object",
|
||||
properties: {
|
||||
type: {
|
||||
type: "string",
|
||||
const: "email",
|
||||
},
|
||||
email: {
|
||||
type: ["string", "null"],
|
||||
},
|
||||
id: {
|
||||
type: "string",
|
||||
},
|
||||
},
|
||||
required: ["type", "email", "id"],
|
||||
additionalProperties: false,
|
||||
},
|
||||
{
|
||||
type: "object",
|
||||
properties: {
|
||||
type: {
|
||||
type: "string",
|
||||
const: "phone_number",
|
||||
},
|
||||
phone_number: {
|
||||
type: ["string", "null"],
|
||||
},
|
||||
id: {
|
||||
type: "string",
|
||||
},
|
||||
},
|
||||
required: ["type", "phone_number", "id"],
|
||||
additionalProperties: false,
|
||||
},
|
||||
{
|
||||
type: "object",
|
||||
properties: {
|
||||
type: {
|
||||
type: "string",
|
||||
const: "checkbox",
|
||||
},
|
||||
checkbox: {
|
||||
type: "boolean",
|
||||
},
|
||||
id: {
|
||||
type: "string",
|
||||
},
|
||||
},
|
||||
required: ["type", "checkbox", "id"],
|
||||
additionalProperties: false,
|
||||
},
|
||||
{
|
||||
type: "object",
|
||||
properties: {
|
||||
type: {
|
||||
type: "string",
|
||||
const: "files",
|
||||
},
|
||||
files: {
|
||||
type: "array",
|
||||
items: {
|
||||
anyOf: [
|
||||
{
|
||||
type: "object",
|
||||
properties: {
|
||||
file: {
|
||||
type: "object",
|
||||
properties: {
|
||||
url: {
|
||||
type: "string",
|
||||
},
|
||||
expiry_time: {
|
||||
type: "string",
|
||||
},
|
||||
},
|
||||
required: ["url", "expiry_time"],
|
||||
additionalProperties: false,
|
||||
},
|
||||
name: StringRequest,
|
||||
type: {
|
||||
type: "string",
|
||||
const: "file",
|
||||
},
|
||||
},
|
||||
required: ["file", "name"],
|
||||
additionalProperties: false,
|
||||
},
|
||||
{
|
||||
type: "object",
|
||||
properties: {
|
||||
external: {
|
||||
type: "object",
|
||||
properties: {
|
||||
url: TextRequest,
|
||||
},
|
||||
required: ["url"],
|
||||
additionalProperties: false,
|
||||
},
|
||||
name: StringRequest,
|
||||
type: {
|
||||
type: "string",
|
||||
const: "external",
|
||||
},
|
||||
},
|
||||
required: ["external", "name"],
|
||||
additionalProperties: false,
|
||||
},
|
||||
],
|
||||
},
|
||||
},
|
||||
id: {
|
||||
type: "string",
|
||||
},
|
||||
},
|
||||
required: ["type", "files", "id"],
|
||||
additionalProperties: false,
|
||||
},
|
||||
{
|
||||
type: "object",
|
||||
properties: {
|
||||
type: {
|
||||
type: "string",
|
||||
const: "created_by",
|
||||
},
|
||||
created_by: {
|
||||
anyOf: [PartialUserObjectResponse, UserObjectResponse],
|
||||
},
|
||||
id: {
|
||||
type: "string",
|
||||
},
|
||||
},
|
||||
required: ["type", "created_by", "id"],
|
||||
additionalProperties: false,
|
||||
},
|
||||
{
|
||||
type: "object",
|
||||
properties: {
|
||||
type: {
|
||||
type: "string",
|
||||
const: "created_time",
|
||||
},
|
||||
created_time: {
|
||||
type: "string",
|
||||
},
|
||||
id: {
|
||||
type: "string",
|
||||
},
|
||||
},
|
||||
required: ["type", "created_time", "id"],
|
||||
additionalProperties: false,
|
||||
},
|
||||
{
|
||||
type: "object",
|
||||
properties: {
|
||||
type: {
|
||||
type: "string",
|
||||
const: "last_edited_by",
|
||||
},
|
||||
last_edited_by: {
|
||||
anyOf: [PartialUserObjectResponse, UserObjectResponse],
|
||||
},
|
||||
id: {
|
||||
type: "string",
|
||||
},
|
||||
},
|
||||
required: ["type", "last_edited_by", "id"],
|
||||
additionalProperties: false,
|
||||
},
|
||||
{
|
||||
type: "object",
|
||||
properties: {
|
||||
type: {
|
||||
type: "string",
|
||||
const: "last_edited_time",
|
||||
},
|
||||
last_edited_time: {
|
||||
type: "string",
|
||||
},
|
||||
id: {
|
||||
type: "string",
|
||||
},
|
||||
},
|
||||
required: ["type", "last_edited_time", "id"],
|
||||
additionalProperties: false,
|
||||
},
|
||||
{
|
||||
type: "object",
|
||||
properties: {
|
||||
type: {
|
||||
type: "string",
|
||||
const: "formula",
|
||||
},
|
||||
formula: FormulaPropertyResponse,
|
||||
id: {
|
||||
type: "string",
|
||||
},
|
||||
},
|
||||
required: ["type", "formula", "id"],
|
||||
additionalProperties: false,
|
||||
},
|
||||
{
|
||||
type: "object",
|
||||
properties: {
|
||||
type: {
|
||||
type: "string",
|
||||
const: "title",
|
||||
},
|
||||
title: {
|
||||
type: "array",
|
||||
items: RichTextItemResponse,
|
||||
},
|
||||
id: {
|
||||
type: "string",
|
||||
},
|
||||
},
|
||||
required: ["type", "title", "id"],
|
||||
additionalProperties: false,
|
||||
},
|
||||
{
|
||||
type: "object",
|
||||
properties: {
|
||||
type: {
|
||||
type: "string",
|
||||
const: "rich_text",
|
||||
},
|
||||
rich_text: {
|
||||
type: "array",
|
||||
items: RichTextItemResponse,
|
||||
},
|
||||
id: {
|
||||
type: "string",
|
||||
},
|
||||
},
|
||||
required: ["type", "rich_text", "id"],
|
||||
additionalProperties: false,
|
||||
},
|
||||
{
|
||||
type: "object",
|
||||
properties: {
|
||||
type: {
|
||||
type: "string",
|
||||
const: "people",
|
||||
},
|
||||
people: {
|
||||
type: "array",
|
||||
items: {
|
||||
anyOf: [PartialUserObjectResponse, UserObjectResponse],
|
||||
},
|
||||
},
|
||||
id: {
|
||||
type: "string",
|
||||
},
|
||||
},
|
||||
required: ["type", "people", "id"],
|
||||
additionalProperties: false,
|
||||
},
|
||||
{
|
||||
type: "object",
|
||||
properties: {
|
||||
type: {
|
||||
type: "string",
|
||||
const: "relation",
|
||||
},
|
||||
relation: {
|
||||
type: "array",
|
||||
items: {
|
||||
type: "object",
|
||||
properties: {
|
||||
id: {
|
||||
type: "string",
|
||||
},
|
||||
},
|
||||
required: ["id"],
|
||||
additionalProperties: false,
|
||||
},
|
||||
},
|
||||
id: {
|
||||
type: "string",
|
||||
},
|
||||
},
|
||||
required: ["type", "relation", "id"],
|
||||
additionalProperties: false,
|
||||
},
|
||||
{
|
||||
type: "object",
|
||||
properties: {
|
||||
type: {
|
||||
type: "string",
|
||||
const: "rollup",
|
||||
},
|
||||
rollup: {
|
||||
anyOf: [
|
||||
{
|
||||
type: "object",
|
||||
properties: {
|
||||
type: {
|
||||
type: "string",
|
||||
const: "number",
|
||||
},
|
||||
number: {
|
||||
type: ["number", "null"],
|
||||
},
|
||||
function: RollupFunction,
|
||||
},
|
||||
required: ["type", "number", "function"],
|
||||
additionalProperties: false,
|
||||
},
|
||||
{
|
||||
type: "object",
|
||||
properties: {
|
||||
type: {
|
||||
type: "string",
|
||||
const: "date",
|
||||
},
|
||||
date: {
|
||||
anyOf: [
|
||||
DateResponse,
|
||||
{
|
||||
type: "null",
|
||||
},
|
||||
],
|
||||
},
|
||||
function: RollupFunction,
|
||||
},
|
||||
required: ["type", "date", "function"],
|
||||
additionalProperties: false,
|
||||
},
|
||||
{
|
||||
type: "object",
|
||||
properties: {
|
||||
type: {
|
||||
type: "string",
|
||||
const: "array",
|
||||
},
|
||||
array: {
|
||||
type: "array",
|
||||
items: {
|
||||
anyOf: [
|
||||
{
|
||||
type: "object",
|
||||
properties: {
|
||||
type: {
|
||||
type: "string",
|
||||
const: "title",
|
||||
},
|
||||
title: {
|
||||
type: "array",
|
||||
items: RichTextItemResponse,
|
||||
},
|
||||
},
|
||||
required: ["type", "title"],
|
||||
additionalProperties: false,
|
||||
},
|
||||
{
|
||||
type: "object",
|
||||
properties: {
|
||||
type: {
|
||||
type: "string",
|
||||
const: "rich_text",
|
||||
},
|
||||
rich_text: {
|
||||
type: "array",
|
||||
items: RichTextItemResponse,
|
||||
},
|
||||
},
|
||||
required: ["type", "rich_text"],
|
||||
additionalProperties: false,
|
||||
},
|
||||
{
|
||||
type: "object",
|
||||
properties: {
|
||||
type: {
|
||||
type: "string",
|
||||
const: "people",
|
||||
},
|
||||
people: {
|
||||
type: "array",
|
||||
items: {
|
||||
anyOf: [
|
||||
PartialUserObjectResponse,
|
||||
UserObjectResponse,
|
||||
],
|
||||
},
|
||||
},
|
||||
},
|
||||
required: ["type", "people"],
|
||||
additionalProperties: false,
|
||||
},
|
||||
{
|
||||
type: "object",
|
||||
properties: {
|
||||
type: {
|
||||
type: "string",
|
||||
const: "relation",
|
||||
},
|
||||
relation: {
|
||||
type: "array",
|
||||
items: {
|
||||
type: "object",
|
||||
properties: {
|
||||
id: {
|
||||
type: "string",
|
||||
},
|
||||
},
|
||||
required: ["id"],
|
||||
additionalProperties: false,
|
||||
},
|
||||
},
|
||||
},
|
||||
required: ["type", "relation"],
|
||||
additionalProperties: false,
|
||||
},
|
||||
],
|
||||
},
|
||||
},
|
||||
function: RollupFunction,
|
||||
},
|
||||
required: ["type", "array", "function"],
|
||||
additionalProperties: false,
|
||||
},
|
||||
],
|
||||
},
|
||||
id: {
|
||||
type: "string",
|
||||
},
|
||||
},
|
||||
required: ["type", "rollup", "id"],
|
||||
additionalProperties: false,
|
||||
},
|
||||
],
|
||||
},
|
||||
};
|
||||
|
||||
export const PageObjectResponse: JSONSchema = {
|
||||
type: "object",
|
||||
properties: {
|
||||
parent: {
|
||||
anyOf: [
|
||||
{
|
||||
type: "object",
|
||||
properties: {
|
||||
type: {
|
||||
type: "string",
|
||||
const: "database_id",
|
||||
},
|
||||
database_id: {
|
||||
type: "string",
|
||||
},
|
||||
},
|
||||
required: ["type", "database_id"],
|
||||
additionalProperties: false,
|
||||
},
|
||||
{
|
||||
type: "object",
|
||||
properties: {
|
||||
type: {
|
||||
type: "string",
|
||||
const: "page_id",
|
||||
},
|
||||
page_id: {
|
||||
type: "string",
|
||||
},
|
||||
},
|
||||
required: ["type", "page_id"],
|
||||
additionalProperties: false,
|
||||
},
|
||||
{
|
||||
type: "object",
|
||||
properties: {
|
||||
type: {
|
||||
type: "string",
|
||||
const: "block_id",
|
||||
},
|
||||
block_id: {
|
||||
type: "string",
|
||||
},
|
||||
},
|
||||
required: ["type", "block_id"],
|
||||
additionalProperties: false,
|
||||
},
|
||||
{
|
||||
type: "object",
|
||||
properties: {
|
||||
type: {
|
||||
type: "string",
|
||||
const: "workspace",
|
||||
},
|
||||
workspace: {
|
||||
type: "boolean",
|
||||
const: true,
|
||||
},
|
||||
},
|
||||
required: ["type", "workspace"],
|
||||
additionalProperties: false,
|
||||
},
|
||||
],
|
||||
},
|
||||
properties: PageObjectResponseProperties,
|
||||
icon: {
|
||||
anyOf: [
|
||||
{
|
||||
type: "object",
|
||||
properties: {
|
||||
type: {
|
||||
type: "string",
|
||||
const: "emoji",
|
||||
},
|
||||
emoji: EmojiRequest,
|
||||
},
|
||||
required: ["type", "emoji"],
|
||||
additionalProperties: false,
|
||||
},
|
||||
{
|
||||
type: "null",
|
||||
},
|
||||
{
|
||||
type: "object",
|
||||
properties: {
|
||||
type: {
|
||||
type: "string",
|
||||
const: "external",
|
||||
},
|
||||
external: {
|
||||
type: "object",
|
||||
properties: {
|
||||
url: TextRequest,
|
||||
},
|
||||
required: ["url"],
|
||||
additionalProperties: false,
|
||||
},
|
||||
},
|
||||
required: ["type", "external"],
|
||||
additionalProperties: false,
|
||||
},
|
||||
{
|
||||
type: "object",
|
||||
properties: {
|
||||
type: {
|
||||
type: "string",
|
||||
const: "file",
|
||||
},
|
||||
file: {
|
||||
type: "object",
|
||||
properties: {
|
||||
url: {
|
||||
type: "string",
|
||||
},
|
||||
expiry_time: {
|
||||
type: "string",
|
||||
},
|
||||
},
|
||||
required: ["url", "expiry_time"],
|
||||
additionalProperties: false,
|
||||
},
|
||||
},
|
||||
required: ["type", "file"],
|
||||
additionalProperties: false,
|
||||
},
|
||||
],
|
||||
},
|
||||
cover: {
|
||||
anyOf: [
|
||||
{
|
||||
type: "object",
|
||||
properties: {
|
||||
type: {
|
||||
type: "string",
|
||||
const: "external",
|
||||
},
|
||||
external: {
|
||||
type: "object",
|
||||
properties: {
|
||||
url: TextRequest,
|
||||
},
|
||||
required: ["url"],
|
||||
additionalProperties: false,
|
||||
},
|
||||
},
|
||||
required: ["type", "external"],
|
||||
additionalProperties: false,
|
||||
},
|
||||
{
|
||||
type: "null",
|
||||
},
|
||||
{
|
||||
type: "object",
|
||||
properties: {
|
||||
type: {
|
||||
type: "string",
|
||||
const: "file",
|
||||
},
|
||||
file: {
|
||||
type: "object",
|
||||
properties: {
|
||||
url: {
|
||||
type: "string",
|
||||
},
|
||||
expiry_time: {
|
||||
type: "string",
|
||||
},
|
||||
},
|
||||
required: ["url", "expiry_time"],
|
||||
additionalProperties: false,
|
||||
},
|
||||
},
|
||||
required: ["type", "file"],
|
||||
additionalProperties: false,
|
||||
},
|
||||
],
|
||||
},
|
||||
created_by: PartialUserObjectResponse,
|
||||
last_edited_by: PartialUserObjectResponse,
|
||||
object: {
|
||||
type: "string",
|
||||
const: "page",
|
||||
},
|
||||
id: {
|
||||
type: "string",
|
||||
},
|
||||
created_time: {
|
||||
type: "string",
|
||||
},
|
||||
last_edited_time: {
|
||||
type: "string",
|
||||
},
|
||||
archived: {
|
||||
type: "boolean",
|
||||
},
|
||||
url: {
|
||||
type: "string",
|
||||
},
|
||||
},
|
||||
required: [
|
||||
"parent",
|
||||
"properties",
|
||||
"icon",
|
||||
"cover",
|
||||
"created_by",
|
||||
"last_edited_by",
|
||||
"object",
|
||||
"id",
|
||||
"created_time",
|
||||
"last_edited_time",
|
||||
"archived",
|
||||
"url",
|
||||
],
|
||||
additionalProperties: false,
|
||||
};
|
||||
|
||||
export const PartialPageObjectResponse: JSONSchema = {
|
||||
type: "object",
|
||||
properties: {
|
||||
object: {
|
||||
type: "string",
|
||||
const: "page",
|
||||
},
|
||||
id: {
|
||||
type: "string",
|
||||
},
|
||||
},
|
||||
required: ["object", "id"],
|
||||
additionalProperties: false,
|
||||
};
|
||||
@@ -0,0 +1,63 @@
|
||||
import { EndpointSpecParameter } from "core/endpoint/types";
|
||||
|
||||
export const VersionHeaderParam: EndpointSpecParameter = {
|
||||
name: "Notion-Version",
|
||||
in: "header",
|
||||
description:
|
||||
"The Notion API is versioned. Our API versions are named for the date the version is released, for example, 2022-06-28",
|
||||
schema: {
|
||||
type: "string",
|
||||
},
|
||||
required: true,
|
||||
};
|
||||
|
||||
export const StartCursorParam: EndpointSpecParameter = {
|
||||
name: "start_cursor",
|
||||
in: "query",
|
||||
description:
|
||||
"The cursor to start from. If not provided, the default is to start from the beginning of the list.",
|
||||
schema: {
|
||||
type: "string",
|
||||
},
|
||||
required: false,
|
||||
};
|
||||
|
||||
export const PageSizeParam: EndpointSpecParameter = {
|
||||
name: "page_size",
|
||||
in: "query",
|
||||
description: "The number of results to return. The maximum is 100.",
|
||||
schema: {
|
||||
type: "integer",
|
||||
},
|
||||
required: false,
|
||||
};
|
||||
|
||||
export const PageIdParam: EndpointSpecParameter = {
|
||||
name: "page_id",
|
||||
in: "path",
|
||||
description: "ID of the page",
|
||||
schema: {
|
||||
type: "string",
|
||||
},
|
||||
required: true,
|
||||
};
|
||||
|
||||
export const BlockIdParam: EndpointSpecParameter = {
|
||||
name: "block_id",
|
||||
in: "path",
|
||||
description: "ID of the block",
|
||||
schema: {
|
||||
type: "string",
|
||||
},
|
||||
required: true,
|
||||
};
|
||||
|
||||
export const DatabaseIdParam: EndpointSpecParameter = {
|
||||
name: "database_id",
|
||||
in: "path",
|
||||
description: "ID of the database",
|
||||
schema: {
|
||||
type: "string",
|
||||
},
|
||||
required: true,
|
||||
};
|
||||
@@ -0,0 +1,163 @@
|
||||
import { JSONSchema } from "core/schemas/types";
|
||||
import { EmptyObject, IdRequest } from "./common";
|
||||
|
||||
export const PersonUserObjectResponse: JSONSchema = {
|
||||
type: "object",
|
||||
properties: {
|
||||
type: {
|
||||
type: "string",
|
||||
const: "person",
|
||||
},
|
||||
person: {
|
||||
type: "object",
|
||||
properties: {
|
||||
email: {
|
||||
type: "string",
|
||||
},
|
||||
},
|
||||
additionalProperties: false,
|
||||
},
|
||||
name: {
|
||||
type: ["string", "null"],
|
||||
},
|
||||
avatar_url: {
|
||||
type: ["string", "null"],
|
||||
},
|
||||
id: IdRequest,
|
||||
object: {
|
||||
type: "string",
|
||||
const: "user",
|
||||
},
|
||||
},
|
||||
required: ["type", "person", "name", "avatar_url", "id", "object"],
|
||||
additionalProperties: false,
|
||||
};
|
||||
|
||||
export const PartialUserObjectResponse: JSONSchema = {
|
||||
type: "object",
|
||||
properties: {
|
||||
id: IdRequest,
|
||||
object: {
|
||||
type: "string",
|
||||
const: "user",
|
||||
},
|
||||
},
|
||||
required: ["id", "object"],
|
||||
additionalProperties: false,
|
||||
};
|
||||
|
||||
export const BotUserObjectResponse: JSONSchema = {
|
||||
type: "object",
|
||||
properties: {
|
||||
type: {
|
||||
type: "string",
|
||||
const: "bot",
|
||||
},
|
||||
bot: {
|
||||
anyOf: [
|
||||
EmptyObject,
|
||||
{
|
||||
type: "object",
|
||||
properties: {
|
||||
owner: {
|
||||
anyOf: [
|
||||
{
|
||||
type: "object",
|
||||
properties: {
|
||||
type: {
|
||||
type: "string",
|
||||
const: "user",
|
||||
},
|
||||
user: {
|
||||
anyOf: [
|
||||
{
|
||||
type: "object",
|
||||
properties: {
|
||||
type: {
|
||||
type: "string",
|
||||
const: "person",
|
||||
},
|
||||
person: {
|
||||
type: "object",
|
||||
properties: {
|
||||
email: {
|
||||
type: "string",
|
||||
},
|
||||
},
|
||||
required: ["email"],
|
||||
additionalProperties: false,
|
||||
},
|
||||
name: {
|
||||
type: ["string", "null"],
|
||||
},
|
||||
avatar_url: {
|
||||
type: ["string", "null"],
|
||||
},
|
||||
id: IdRequest,
|
||||
object: {
|
||||
type: "string",
|
||||
const: "user",
|
||||
},
|
||||
},
|
||||
required: [
|
||||
"type",
|
||||
"person",
|
||||
"name",
|
||||
"avatar_url",
|
||||
"id",
|
||||
"object",
|
||||
],
|
||||
additionalProperties: false,
|
||||
},
|
||||
PartialUserObjectResponse,
|
||||
],
|
||||
},
|
||||
},
|
||||
required: ["type", "user"],
|
||||
additionalProperties: false,
|
||||
},
|
||||
{
|
||||
type: "object",
|
||||
properties: {
|
||||
type: {
|
||||
type: "string",
|
||||
const: "workspace",
|
||||
},
|
||||
workspace: {
|
||||
type: "boolean",
|
||||
const: true,
|
||||
},
|
||||
},
|
||||
required: ["type", "workspace"],
|
||||
additionalProperties: false,
|
||||
},
|
||||
],
|
||||
},
|
||||
workspace_name: {
|
||||
type: ["string", "null"],
|
||||
},
|
||||
},
|
||||
required: ["owner", "workspace_name"],
|
||||
additionalProperties: false,
|
||||
},
|
||||
],
|
||||
},
|
||||
name: {
|
||||
type: ["string", "null"],
|
||||
},
|
||||
avatar_url: {
|
||||
type: ["string", "null"],
|
||||
},
|
||||
id: IdRequest,
|
||||
object: {
|
||||
type: "string",
|
||||
const: "user",
|
||||
},
|
||||
},
|
||||
required: ["type", "bot", "name", "avatar_url", "id", "object"],
|
||||
additionalProperties: false,
|
||||
};
|
||||
|
||||
export const UserObjectResponse: JSONSchema = {
|
||||
anyOf: [PersonUserObjectResponse, BotUserObjectResponse],
|
||||
};
|
||||
@@ -0,0 +1,911 @@
|
||||
import { JSONSchema } from "core/schemas/types";
|
||||
import { EmptyObject, IdRequest, StringRequest } from "./common";
|
||||
import { RollupFunction } from "./functions";
|
||||
import { PartialUserObjectResponse, UserObjectResponse } from "./person";
|
||||
import { TextRequest } from "./requests";
|
||||
import {
|
||||
DateResponse,
|
||||
FormulaPropertyResponse,
|
||||
RichTextItemResponse,
|
||||
SelectPropertyResponse,
|
||||
} from "./responses";
|
||||
|
||||
export const NumberPropertyItemObjectResponse: JSONSchema = {
|
||||
type: "object",
|
||||
properties: {
|
||||
type: {
|
||||
type: "string",
|
||||
const: "number",
|
||||
},
|
||||
number: {
|
||||
type: ["number", "null"],
|
||||
},
|
||||
object: {
|
||||
type: "string",
|
||||
const: "property_item",
|
||||
},
|
||||
id: {
|
||||
type: "string",
|
||||
},
|
||||
},
|
||||
required: ["type", "number", "object", "id"],
|
||||
additionalProperties: false,
|
||||
};
|
||||
|
||||
export const UrlPropertyItemObjectResponse: JSONSchema = {
|
||||
type: "object",
|
||||
properties: {
|
||||
type: {
|
||||
type: "string",
|
||||
const: "url",
|
||||
},
|
||||
url: {
|
||||
type: ["string", "null"],
|
||||
},
|
||||
object: {
|
||||
type: "string",
|
||||
const: "property_item",
|
||||
},
|
||||
id: {
|
||||
type: "string",
|
||||
},
|
||||
},
|
||||
required: ["type", "url", "object", "id"],
|
||||
additionalProperties: false,
|
||||
};
|
||||
|
||||
export const SelectPropertyItemObjectResponse: JSONSchema = {
|
||||
type: "object",
|
||||
properties: {
|
||||
type: {
|
||||
type: "string",
|
||||
const: "select",
|
||||
},
|
||||
select: {
|
||||
anyOf: [
|
||||
SelectPropertyResponse,
|
||||
{
|
||||
type: "null",
|
||||
},
|
||||
],
|
||||
},
|
||||
object: {
|
||||
type: "string",
|
||||
const: "property_item",
|
||||
},
|
||||
id: {
|
||||
type: "string",
|
||||
},
|
||||
},
|
||||
required: ["type", "select", "object", "id"],
|
||||
additionalProperties: false,
|
||||
};
|
||||
|
||||
export const MultiSelectPropertyItemObjectResponse: JSONSchema = {
|
||||
type: "object",
|
||||
properties: {
|
||||
type: {
|
||||
type: "string",
|
||||
const: "multi_select",
|
||||
},
|
||||
multi_select: {
|
||||
type: "array",
|
||||
items: SelectPropertyResponse,
|
||||
},
|
||||
object: {
|
||||
type: "string",
|
||||
const: "property_item",
|
||||
},
|
||||
id: {
|
||||
type: "string",
|
||||
},
|
||||
},
|
||||
required: ["type", "multi_select", "object", "id"],
|
||||
additionalProperties: false,
|
||||
};
|
||||
|
||||
export const StatusPropertyItemObjectResponse: JSONSchema = {
|
||||
type: "object",
|
||||
properties: {
|
||||
type: {
|
||||
type: "string",
|
||||
const: "status",
|
||||
},
|
||||
status: {
|
||||
anyOf: [
|
||||
SelectPropertyResponse,
|
||||
{
|
||||
type: "null",
|
||||
},
|
||||
],
|
||||
},
|
||||
object: {
|
||||
type: "string",
|
||||
const: "property_item",
|
||||
},
|
||||
id: {
|
||||
type: "string",
|
||||
},
|
||||
},
|
||||
required: ["type", "status", "object", "id"],
|
||||
additionalProperties: false,
|
||||
};
|
||||
|
||||
export const DatePropertyItemObjectResponse: JSONSchema = {
|
||||
type: "object",
|
||||
properties: {
|
||||
type: {
|
||||
type: "string",
|
||||
const: "date",
|
||||
},
|
||||
date: {
|
||||
anyOf: [
|
||||
DateResponse,
|
||||
{
|
||||
type: "null",
|
||||
},
|
||||
],
|
||||
},
|
||||
object: {
|
||||
type: "string",
|
||||
const: "property_item",
|
||||
},
|
||||
id: {
|
||||
type: "string",
|
||||
},
|
||||
},
|
||||
required: ["type", "date", "object", "id"],
|
||||
additionalProperties: false,
|
||||
};
|
||||
|
||||
export const EmailPropertyItemObjectResponse: JSONSchema = {
|
||||
type: "object",
|
||||
properties: {
|
||||
type: {
|
||||
type: "string",
|
||||
const: "email",
|
||||
},
|
||||
email: {
|
||||
type: ["string", "null"],
|
||||
},
|
||||
object: {
|
||||
type: "string",
|
||||
const: "property_item",
|
||||
},
|
||||
id: {
|
||||
type: "string",
|
||||
},
|
||||
},
|
||||
required: ["type", "email", "object", "id"],
|
||||
additionalProperties: false,
|
||||
};
|
||||
|
||||
export const PhoneNumberPropertyItemObjectResponse: JSONSchema = {
|
||||
type: "object",
|
||||
properties: {
|
||||
type: {
|
||||
type: "string",
|
||||
const: "phone_number",
|
||||
},
|
||||
phone_number: {
|
||||
type: ["string", "null"],
|
||||
},
|
||||
object: {
|
||||
type: "string",
|
||||
const: "property_item",
|
||||
},
|
||||
id: {
|
||||
type: "string",
|
||||
},
|
||||
},
|
||||
required: ["type", "phone_number", "object", "id"],
|
||||
additionalProperties: false,
|
||||
};
|
||||
|
||||
export const CheckboxPropertyItemObjectResponse: JSONSchema = {
|
||||
type: "object",
|
||||
properties: {
|
||||
type: {
|
||||
type: "string",
|
||||
const: "checkbox",
|
||||
},
|
||||
checkbox: {
|
||||
type: "boolean",
|
||||
},
|
||||
object: {
|
||||
type: "string",
|
||||
const: "property_item",
|
||||
},
|
||||
id: {
|
||||
type: "string",
|
||||
},
|
||||
},
|
||||
required: ["type", "checkbox", "object", "id"],
|
||||
additionalProperties: false,
|
||||
};
|
||||
|
||||
export const FilesPropertyItemObjectResponse: JSONSchema = {
|
||||
type: "object",
|
||||
properties: {
|
||||
type: {
|
||||
type: "string",
|
||||
const: "files",
|
||||
},
|
||||
files: {
|
||||
type: "array",
|
||||
items: {
|
||||
anyOf: [
|
||||
{
|
||||
type: "object",
|
||||
properties: {
|
||||
file: {
|
||||
type: "object",
|
||||
properties: {
|
||||
url: {
|
||||
type: "string",
|
||||
},
|
||||
expiry_time: {
|
||||
type: "string",
|
||||
},
|
||||
},
|
||||
required: ["url", "expiry_time"],
|
||||
additionalProperties: false,
|
||||
},
|
||||
name: StringRequest,
|
||||
type: {
|
||||
type: "string",
|
||||
const: "file",
|
||||
},
|
||||
},
|
||||
required: ["file", "name"],
|
||||
additionalProperties: false,
|
||||
},
|
||||
{
|
||||
type: "object",
|
||||
properties: {
|
||||
external: {
|
||||
type: "object",
|
||||
properties: {
|
||||
url: TextRequest,
|
||||
},
|
||||
required: ["url"],
|
||||
additionalProperties: false,
|
||||
},
|
||||
name: StringRequest,
|
||||
type: {
|
||||
type: "string",
|
||||
const: "external",
|
||||
},
|
||||
},
|
||||
required: ["external", "name"],
|
||||
additionalProperties: false,
|
||||
},
|
||||
],
|
||||
},
|
||||
},
|
||||
object: {
|
||||
type: "string",
|
||||
const: "property_item",
|
||||
},
|
||||
id: {
|
||||
type: "string",
|
||||
},
|
||||
},
|
||||
required: ["type", "files", "object", "id"],
|
||||
additionalProperties: false,
|
||||
};
|
||||
|
||||
export const CreatedByPropertyItemObjectResponse: JSONSchema = {
|
||||
type: "object",
|
||||
properties: {
|
||||
type: {
|
||||
type: "string",
|
||||
const: "created_by",
|
||||
},
|
||||
created_by: {
|
||||
anyOf: [PartialUserObjectResponse, UserObjectResponse],
|
||||
},
|
||||
object: {
|
||||
type: "string",
|
||||
const: "property_item",
|
||||
},
|
||||
id: {
|
||||
type: "string",
|
||||
},
|
||||
},
|
||||
required: ["type", "created_by", "object", "id"],
|
||||
additionalProperties: false,
|
||||
};
|
||||
|
||||
export const CreatedTimePropertyItemObjectResponse: JSONSchema = {
|
||||
type: "object",
|
||||
properties: {
|
||||
type: {
|
||||
type: "string",
|
||||
const: "created_time",
|
||||
},
|
||||
created_time: {
|
||||
type: "string",
|
||||
},
|
||||
object: {
|
||||
type: "string",
|
||||
const: "property_item",
|
||||
},
|
||||
id: {
|
||||
type: "string",
|
||||
},
|
||||
},
|
||||
required: ["type", "created_time", "object", "id"],
|
||||
additionalProperties: false,
|
||||
};
|
||||
|
||||
export const LastEditedByPropertyItemObjectResponse: JSONSchema = {
|
||||
type: "object",
|
||||
properties: {
|
||||
type: {
|
||||
type: "string",
|
||||
const: "last_edited_by",
|
||||
},
|
||||
last_edited_by: {
|
||||
anyOf: [PartialUserObjectResponse, UserObjectResponse],
|
||||
},
|
||||
object: {
|
||||
type: "string",
|
||||
const: "property_item",
|
||||
},
|
||||
id: {
|
||||
type: "string",
|
||||
},
|
||||
},
|
||||
required: ["type", "last_edited_by", "object", "id"],
|
||||
additionalProperties: false,
|
||||
};
|
||||
|
||||
export const LastEditedTimePropertyItemObjectResponse: JSONSchema = {
|
||||
type: "object",
|
||||
properties: {
|
||||
type: {
|
||||
type: "string",
|
||||
const: "last_edited_time",
|
||||
},
|
||||
last_edited_time: {
|
||||
type: "string",
|
||||
},
|
||||
object: {
|
||||
type: "string",
|
||||
const: "property_item",
|
||||
},
|
||||
id: {
|
||||
type: "string",
|
||||
},
|
||||
},
|
||||
required: ["type", "last_edited_time", "object", "id"],
|
||||
additionalProperties: false,
|
||||
};
|
||||
|
||||
export const FormulaPropertyItemObjectResponse: JSONSchema = {
|
||||
type: "object",
|
||||
properties: {
|
||||
type: {
|
||||
type: "string",
|
||||
const: "formula",
|
||||
},
|
||||
formula: FormulaPropertyResponse,
|
||||
object: {
|
||||
type: "string",
|
||||
const: "property_item",
|
||||
},
|
||||
id: {
|
||||
type: "string",
|
||||
},
|
||||
},
|
||||
required: ["type", "formula", "object", "id"],
|
||||
additionalProperties: false,
|
||||
};
|
||||
|
||||
export const TitlePropertyItemObjectResponse: JSONSchema = {
|
||||
type: "object",
|
||||
properties: {
|
||||
type: {
|
||||
type: "string",
|
||||
const: "title",
|
||||
},
|
||||
title: RichTextItemResponse,
|
||||
object: {
|
||||
type: "string",
|
||||
const: "property_item",
|
||||
},
|
||||
id: {
|
||||
type: "string",
|
||||
},
|
||||
},
|
||||
required: ["type", "title", "object", "id"],
|
||||
additionalProperties: false,
|
||||
};
|
||||
|
||||
export const RichTextPropertyItemObjectResponse: JSONSchema = {
|
||||
type: "object",
|
||||
properties: {
|
||||
type: {
|
||||
type: "string",
|
||||
const: "rich_text",
|
||||
},
|
||||
rich_text: RichTextItemResponse,
|
||||
object: {
|
||||
type: "string",
|
||||
const: "property_item",
|
||||
},
|
||||
id: {
|
||||
type: "string",
|
||||
},
|
||||
},
|
||||
required: ["type", "rich_text", "object", "id"],
|
||||
additionalProperties: false,
|
||||
};
|
||||
|
||||
export const PeoplePropertyItemObjectResponse: JSONSchema = {
|
||||
type: "object",
|
||||
properties: {
|
||||
type: {
|
||||
type: "string",
|
||||
const: "people",
|
||||
},
|
||||
people: {
|
||||
anyOf: [PartialUserObjectResponse, UserObjectResponse],
|
||||
},
|
||||
object: {
|
||||
type: "string",
|
||||
const: "property_item",
|
||||
},
|
||||
id: {
|
||||
type: "string",
|
||||
},
|
||||
},
|
||||
required: ["type", "people", "object", "id"],
|
||||
additionalProperties: false,
|
||||
};
|
||||
|
||||
export const RelationPropertyItemObjectResponse: JSONSchema = {
|
||||
type: "object",
|
||||
properties: {
|
||||
type: {
|
||||
type: "string",
|
||||
const: "relation",
|
||||
},
|
||||
relation: {
|
||||
type: "object",
|
||||
properties: {
|
||||
id: {
|
||||
type: "string",
|
||||
},
|
||||
},
|
||||
required: ["id"],
|
||||
additionalProperties: false,
|
||||
},
|
||||
object: {
|
||||
type: "string",
|
||||
const: "property_item",
|
||||
},
|
||||
id: {
|
||||
type: "string",
|
||||
},
|
||||
},
|
||||
required: ["type", "relation", "object", "id"],
|
||||
additionalProperties: false,
|
||||
};
|
||||
|
||||
export const RollupPropertyItemObjectResponse: JSONSchema = {
|
||||
type: "object",
|
||||
properties: {
|
||||
type: {
|
||||
type: "string",
|
||||
const: "rollup",
|
||||
},
|
||||
rollup: {
|
||||
anyOf: [
|
||||
{
|
||||
type: "object",
|
||||
properties: {
|
||||
type: {
|
||||
type: "string",
|
||||
const: "number",
|
||||
},
|
||||
number: {
|
||||
type: ["number", "null"],
|
||||
},
|
||||
function: RollupFunction,
|
||||
},
|
||||
required: ["type", "number", "function"],
|
||||
additionalProperties: false,
|
||||
},
|
||||
{
|
||||
type: "object",
|
||||
properties: {
|
||||
type: {
|
||||
type: "string",
|
||||
const: "date",
|
||||
},
|
||||
date: {
|
||||
anyOf: [
|
||||
DateResponse,
|
||||
{
|
||||
type: "null",
|
||||
},
|
||||
],
|
||||
},
|
||||
function: RollupFunction,
|
||||
},
|
||||
required: ["type", "date", "function"],
|
||||
additionalProperties: false,
|
||||
},
|
||||
{
|
||||
type: "object",
|
||||
properties: {
|
||||
type: {
|
||||
type: "string",
|
||||
const: "array",
|
||||
},
|
||||
array: {
|
||||
type: "array",
|
||||
items: EmptyObject,
|
||||
},
|
||||
function: RollupFunction,
|
||||
},
|
||||
required: ["type", "array", "function"],
|
||||
additionalProperties: false,
|
||||
},
|
||||
{
|
||||
type: "object",
|
||||
properties: {
|
||||
type: {
|
||||
type: "string",
|
||||
const: "unsupported",
|
||||
},
|
||||
unsupported: EmptyObject,
|
||||
function: RollupFunction,
|
||||
},
|
||||
required: ["type", "unsupported", "function"],
|
||||
additionalProperties: false,
|
||||
},
|
||||
{
|
||||
type: "object",
|
||||
properties: {
|
||||
type: {
|
||||
type: "string",
|
||||
const: "incomplete",
|
||||
},
|
||||
incomplete: EmptyObject,
|
||||
function: RollupFunction,
|
||||
},
|
||||
required: ["type", "incomplete", "function"],
|
||||
additionalProperties: false,
|
||||
},
|
||||
],
|
||||
},
|
||||
object: {
|
||||
type: "string",
|
||||
const: "property_item",
|
||||
},
|
||||
id: {
|
||||
type: "string",
|
||||
},
|
||||
},
|
||||
required: ["type", "rollup", "object", "id"],
|
||||
additionalProperties: false,
|
||||
};
|
||||
|
||||
export const PropertyItemObjectResponse: JSONSchema = {
|
||||
anyOf: [
|
||||
NumberPropertyItemObjectResponse,
|
||||
UrlPropertyItemObjectResponse,
|
||||
SelectPropertyItemObjectResponse,
|
||||
MultiSelectPropertyItemObjectResponse,
|
||||
StatusPropertyItemObjectResponse,
|
||||
DatePropertyItemObjectResponse,
|
||||
EmailPropertyItemObjectResponse,
|
||||
PhoneNumberPropertyItemObjectResponse,
|
||||
CheckboxPropertyItemObjectResponse,
|
||||
FilesPropertyItemObjectResponse,
|
||||
CreatedByPropertyItemObjectResponse,
|
||||
CreatedTimePropertyItemObjectResponse,
|
||||
LastEditedByPropertyItemObjectResponse,
|
||||
LastEditedTimePropertyItemObjectResponse,
|
||||
FormulaPropertyItemObjectResponse,
|
||||
TitlePropertyItemObjectResponse,
|
||||
RichTextPropertyItemObjectResponse,
|
||||
PeoplePropertyItemObjectResponse,
|
||||
RelationPropertyItemObjectResponse,
|
||||
RollupPropertyItemObjectResponse,
|
||||
],
|
||||
};
|
||||
|
||||
export const CommentObjectResponse: JSONSchema = {
|
||||
type: "object",
|
||||
properties: {
|
||||
object: {
|
||||
type: "string",
|
||||
const: "comment",
|
||||
},
|
||||
id: {
|
||||
type: "string",
|
||||
},
|
||||
parent: {
|
||||
anyOf: [
|
||||
{
|
||||
type: "object",
|
||||
properties: {
|
||||
type: {
|
||||
type: "string",
|
||||
const: "page_id",
|
||||
},
|
||||
page_id: IdRequest,
|
||||
},
|
||||
required: ["type", "page_id"],
|
||||
additionalProperties: false,
|
||||
},
|
||||
{
|
||||
type: "object",
|
||||
properties: {
|
||||
type: {
|
||||
type: "string",
|
||||
const: "block_id",
|
||||
},
|
||||
block_id: IdRequest,
|
||||
},
|
||||
required: ["type", "block_id"],
|
||||
additionalProperties: false,
|
||||
},
|
||||
],
|
||||
},
|
||||
discussion_id: {
|
||||
type: "string",
|
||||
},
|
||||
rich_text: {
|
||||
type: "array",
|
||||
items: RichTextItemResponse,
|
||||
},
|
||||
created_by: PartialUserObjectResponse,
|
||||
created_time: {
|
||||
type: "string",
|
||||
},
|
||||
last_edited_time: {
|
||||
type: "string",
|
||||
},
|
||||
},
|
||||
required: [
|
||||
"object",
|
||||
"id",
|
||||
"parent",
|
||||
"discussion_id",
|
||||
"rich_text",
|
||||
"created_by",
|
||||
"created_time",
|
||||
"last_edited_time",
|
||||
],
|
||||
additionalProperties: false,
|
||||
};
|
||||
|
||||
export const PartialCommentObjectResponse: JSONSchema = {
|
||||
type: "object",
|
||||
properties: {
|
||||
object: {
|
||||
type: "string",
|
||||
const: "comment",
|
||||
},
|
||||
id: {
|
||||
type: "string",
|
||||
},
|
||||
},
|
||||
required: ["object", "id"],
|
||||
additionalProperties: false,
|
||||
};
|
||||
|
||||
export const PropertyItemPropertyItemListResponse: JSONSchema = {
|
||||
type: "object",
|
||||
properties: {
|
||||
type: {
|
||||
type: "string",
|
||||
const: "property_item",
|
||||
},
|
||||
property_item: {
|
||||
anyOf: [
|
||||
{
|
||||
type: "object",
|
||||
properties: {
|
||||
type: {
|
||||
type: "string",
|
||||
const: "title",
|
||||
},
|
||||
title: EmptyObject,
|
||||
next_url: {
|
||||
type: ["string", "null"],
|
||||
},
|
||||
id: {
|
||||
type: "string",
|
||||
},
|
||||
},
|
||||
required: ["type", "title", "next_url", "id"],
|
||||
additionalProperties: false,
|
||||
},
|
||||
{
|
||||
type: "object",
|
||||
properties: {
|
||||
type: {
|
||||
type: "string",
|
||||
const: "rich_text",
|
||||
},
|
||||
rich_text: EmptyObject,
|
||||
next_url: {
|
||||
type: ["string", "null"],
|
||||
},
|
||||
id: {
|
||||
type: "string",
|
||||
},
|
||||
},
|
||||
required: ["type", "rich_text", "next_url", "id"],
|
||||
additionalProperties: false,
|
||||
},
|
||||
{
|
||||
type: "object",
|
||||
properties: {
|
||||
type: {
|
||||
type: "string",
|
||||
const: "people",
|
||||
},
|
||||
people: EmptyObject,
|
||||
next_url: {
|
||||
type: ["string", "null"],
|
||||
},
|
||||
id: {
|
||||
type: "string",
|
||||
},
|
||||
},
|
||||
required: ["type", "people", "next_url", "id"],
|
||||
additionalProperties: false,
|
||||
},
|
||||
{
|
||||
type: "object",
|
||||
properties: {
|
||||
type: {
|
||||
type: "string",
|
||||
const: "relation",
|
||||
},
|
||||
relation: EmptyObject,
|
||||
next_url: {
|
||||
type: ["string", "null"],
|
||||
},
|
||||
id: {
|
||||
type: "string",
|
||||
},
|
||||
},
|
||||
required: ["type", "relation", "next_url", "id"],
|
||||
additionalProperties: false,
|
||||
},
|
||||
{
|
||||
type: "object",
|
||||
properties: {
|
||||
type: {
|
||||
type: "string",
|
||||
const: "rollup",
|
||||
},
|
||||
rollup: {
|
||||
anyOf: [
|
||||
{
|
||||
type: "object",
|
||||
properties: {
|
||||
type: {
|
||||
type: "string",
|
||||
const: "number",
|
||||
},
|
||||
number: {
|
||||
type: ["number", "null"],
|
||||
},
|
||||
function: RollupFunction,
|
||||
},
|
||||
required: ["type", "number", "function"],
|
||||
additionalProperties: false,
|
||||
},
|
||||
{
|
||||
type: "object",
|
||||
properties: {
|
||||
type: {
|
||||
type: "string",
|
||||
const: "date",
|
||||
},
|
||||
date: {
|
||||
anyOf: [
|
||||
DateResponse,
|
||||
{
|
||||
type: "null",
|
||||
},
|
||||
],
|
||||
},
|
||||
function: RollupFunction,
|
||||
},
|
||||
required: ["type", "date", "function"],
|
||||
additionalProperties: false,
|
||||
},
|
||||
{
|
||||
type: "object",
|
||||
properties: {
|
||||
type: {
|
||||
type: "string",
|
||||
const: "array",
|
||||
},
|
||||
array: {
|
||||
type: "array",
|
||||
items: EmptyObject,
|
||||
},
|
||||
function: RollupFunction,
|
||||
},
|
||||
required: ["type", "array", "function"],
|
||||
additionalProperties: false,
|
||||
},
|
||||
{
|
||||
type: "object",
|
||||
properties: {
|
||||
type: {
|
||||
type: "string",
|
||||
const: "unsupported",
|
||||
},
|
||||
unsupported: EmptyObject,
|
||||
function: RollupFunction,
|
||||
},
|
||||
required: ["type", "unsupported", "function"],
|
||||
additionalProperties: false,
|
||||
},
|
||||
{
|
||||
type: "object",
|
||||
properties: {
|
||||
type: {
|
||||
type: "string",
|
||||
const: "incomplete",
|
||||
},
|
||||
incomplete: EmptyObject,
|
||||
function: RollupFunction,
|
||||
},
|
||||
required: ["type", "incomplete", "function"],
|
||||
additionalProperties: false,
|
||||
},
|
||||
],
|
||||
},
|
||||
next_url: {
|
||||
type: ["string", "null"],
|
||||
},
|
||||
id: {
|
||||
type: "string",
|
||||
},
|
||||
},
|
||||
required: ["type", "rollup", "next_url", "id"],
|
||||
additionalProperties: false,
|
||||
},
|
||||
],
|
||||
},
|
||||
object: {
|
||||
type: "string",
|
||||
const: "list",
|
||||
},
|
||||
next_cursor: {
|
||||
type: ["string", "null"],
|
||||
},
|
||||
has_more: {
|
||||
type: "boolean",
|
||||
},
|
||||
results: {
|
||||
type: "array",
|
||||
items: PropertyItemObjectResponse,
|
||||
},
|
||||
},
|
||||
required: [
|
||||
"type",
|
||||
"property_item",
|
||||
"object",
|
||||
"next_cursor",
|
||||
"has_more",
|
||||
"results",
|
||||
],
|
||||
additionalProperties: false,
|
||||
};
|
||||
|
||||
export const PropertyItemListResponse: JSONSchema =
|
||||
PropertyItemPropertyItemListResponse;
|
||||
@@ -0,0 +1,5 @@
|
||||
import { JSONSchema } from "core/schemas/types";
|
||||
|
||||
export const TextRequest: JSONSchema = {
|
||||
type: "string",
|
||||
};
|
||||
@@ -0,0 +1,397 @@
|
||||
import { JSONSchema } from "core/schemas/types";
|
||||
import { IdRequest, SelectColor, StringRequest } from "./common";
|
||||
import { PartialUserObjectResponse, UserObjectResponse } from "./person";
|
||||
import { TextRequest } from "./requests";
|
||||
import { TimeZoneRequest } from "./timezone";
|
||||
|
||||
export const SelectPropertyResponse: JSONSchema = {
|
||||
type: "object",
|
||||
properties: {
|
||||
id: StringRequest,
|
||||
name: StringRequest,
|
||||
color: SelectColor,
|
||||
},
|
||||
required: ["id", "name", "color"],
|
||||
additionalProperties: false,
|
||||
};
|
||||
|
||||
export const DateResponse: JSONSchema = {
|
||||
type: "object",
|
||||
properties: {
|
||||
start: {
|
||||
type: "string",
|
||||
},
|
||||
end: {
|
||||
type: ["string", "null"],
|
||||
},
|
||||
time_zone: {
|
||||
anyOf: [
|
||||
TimeZoneRequest,
|
||||
{
|
||||
type: "null",
|
||||
},
|
||||
],
|
||||
},
|
||||
},
|
||||
required: ["start", "end", "time_zone"],
|
||||
additionalProperties: false,
|
||||
};
|
||||
|
||||
export const StringFormulaPropertyResponse: JSONSchema = {
|
||||
type: "object",
|
||||
properties: {
|
||||
type: {
|
||||
type: "string",
|
||||
const: "string",
|
||||
},
|
||||
string: {
|
||||
type: ["string", "null"],
|
||||
},
|
||||
},
|
||||
required: ["type", "string"],
|
||||
additionalProperties: false,
|
||||
};
|
||||
|
||||
export const DateFormulaPropertyResponse: JSONSchema = {
|
||||
type: "object",
|
||||
properties: {
|
||||
type: {
|
||||
type: "string",
|
||||
const: "date",
|
||||
},
|
||||
date: {
|
||||
anyOf: [
|
||||
DateResponse,
|
||||
{
|
||||
type: "null",
|
||||
},
|
||||
],
|
||||
},
|
||||
},
|
||||
required: ["type", "date"],
|
||||
additionalProperties: false,
|
||||
};
|
||||
|
||||
export const NumberFormulaPropertyResponse: JSONSchema = {
|
||||
type: "object",
|
||||
properties: {
|
||||
type: {
|
||||
type: "string",
|
||||
const: "number",
|
||||
},
|
||||
number: {
|
||||
type: ["number", "null"],
|
||||
},
|
||||
},
|
||||
required: ["type", "number"],
|
||||
additionalProperties: false,
|
||||
};
|
||||
|
||||
export const BooleanFormulaPropertyResponse: JSONSchema = {
|
||||
type: "object",
|
||||
properties: {
|
||||
type: {
|
||||
type: "string",
|
||||
const: "boolean",
|
||||
},
|
||||
boolean: {
|
||||
type: ["boolean", "null"],
|
||||
},
|
||||
},
|
||||
required: ["type", "boolean"],
|
||||
additionalProperties: false,
|
||||
};
|
||||
|
||||
export const FormulaPropertyResponse: JSONSchema = {
|
||||
anyOf: [
|
||||
StringFormulaPropertyResponse,
|
||||
DateFormulaPropertyResponse,
|
||||
NumberFormulaPropertyResponse,
|
||||
BooleanFormulaPropertyResponse,
|
||||
],
|
||||
};
|
||||
|
||||
export const AnnotationResponse: JSONSchema = {
|
||||
type: "object",
|
||||
properties: {
|
||||
bold: {
|
||||
type: "boolean",
|
||||
},
|
||||
italic: {
|
||||
type: "boolean",
|
||||
},
|
||||
strikethrough: {
|
||||
type: "boolean",
|
||||
},
|
||||
underline: {
|
||||
type: "boolean",
|
||||
},
|
||||
code: {
|
||||
type: "boolean",
|
||||
},
|
||||
color: {
|
||||
type: "string",
|
||||
enum: [
|
||||
"default",
|
||||
"gray",
|
||||
"brown",
|
||||
"orange",
|
||||
"yellow",
|
||||
"green",
|
||||
"blue",
|
||||
"purple",
|
||||
"pink",
|
||||
"red",
|
||||
"gray_background",
|
||||
"brown_background",
|
||||
"orange_background",
|
||||
"yellow_background",
|
||||
"green_background",
|
||||
"blue_background",
|
||||
"purple_background",
|
||||
"pink_background",
|
||||
"red_background",
|
||||
],
|
||||
},
|
||||
},
|
||||
required: ["bold", "italic", "strikethrough", "underline", "code", "color"],
|
||||
additionalProperties: false,
|
||||
};
|
||||
|
||||
export const TextRichTextItemResponse: JSONSchema = {
|
||||
type: "object",
|
||||
properties: {
|
||||
type: {
|
||||
type: "string",
|
||||
const: "text",
|
||||
},
|
||||
text: {
|
||||
type: "object",
|
||||
properties: {
|
||||
content: {
|
||||
type: "string",
|
||||
},
|
||||
link: {
|
||||
anyOf: [
|
||||
{
|
||||
type: "object",
|
||||
properties: {
|
||||
url: TextRequest,
|
||||
},
|
||||
required: ["url"],
|
||||
additionalProperties: false,
|
||||
},
|
||||
{
|
||||
type: "null",
|
||||
},
|
||||
],
|
||||
},
|
||||
},
|
||||
required: ["content", "link"],
|
||||
additionalProperties: false,
|
||||
},
|
||||
annotations: AnnotationResponse,
|
||||
plain_text: {
|
||||
type: "string",
|
||||
},
|
||||
href: {
|
||||
type: ["string", "null"],
|
||||
},
|
||||
},
|
||||
required: ["type", "text", "annotations", "plain_text", "href"],
|
||||
additionalProperties: false,
|
||||
};
|
||||
|
||||
export const LinkPreviewMentionResponse: JSONSchema = {
|
||||
type: "object",
|
||||
properties: {
|
||||
url: TextRequest,
|
||||
},
|
||||
required: ["url"],
|
||||
additionalProperties: false,
|
||||
};
|
||||
|
||||
export const TemplateMentionDateTemplateMentionResponse: JSONSchema = {
|
||||
type: "object",
|
||||
properties: {
|
||||
type: {
|
||||
type: "string",
|
||||
const: "template_mention_date",
|
||||
},
|
||||
template_mention_date: {
|
||||
type: "string",
|
||||
enum: ["today", "now"],
|
||||
},
|
||||
},
|
||||
required: ["type", "template_mention_date"],
|
||||
additionalProperties: false,
|
||||
};
|
||||
|
||||
export const TemplateMentionUserTemplateMentionResponse: JSONSchema = {
|
||||
type: "object",
|
||||
properties: {
|
||||
type: {
|
||||
type: "string",
|
||||
const: "template_mention_user",
|
||||
},
|
||||
template_mention_user: {
|
||||
type: "string",
|
||||
const: "me",
|
||||
},
|
||||
},
|
||||
required: ["type", "template_mention_user"],
|
||||
additionalProperties: false,
|
||||
};
|
||||
|
||||
export const TemplateMentionResponse: JSONSchema = {
|
||||
anyOf: [
|
||||
TemplateMentionDateTemplateMentionResponse,
|
||||
TemplateMentionUserTemplateMentionResponse,
|
||||
],
|
||||
};
|
||||
|
||||
export const MentionRichTextItemResponse: JSONSchema = {
|
||||
type: "object",
|
||||
properties: {
|
||||
type: {
|
||||
type: "string",
|
||||
const: "mention",
|
||||
},
|
||||
mention: {
|
||||
anyOf: [
|
||||
{
|
||||
type: "object",
|
||||
properties: {
|
||||
type: {
|
||||
type: "string",
|
||||
const: "user",
|
||||
},
|
||||
user: {
|
||||
anyOf: [PartialUserObjectResponse, UserObjectResponse],
|
||||
},
|
||||
},
|
||||
required: ["type", "user"],
|
||||
additionalProperties: false,
|
||||
},
|
||||
{
|
||||
type: "object",
|
||||
properties: {
|
||||
type: {
|
||||
type: "string",
|
||||
const: "date",
|
||||
},
|
||||
date: DateResponse,
|
||||
},
|
||||
required: ["type", "date"],
|
||||
additionalProperties: false,
|
||||
},
|
||||
{
|
||||
type: "object",
|
||||
properties: {
|
||||
type: {
|
||||
type: "string",
|
||||
const: "link_preview",
|
||||
},
|
||||
link_preview: LinkPreviewMentionResponse,
|
||||
},
|
||||
required: ["type", "link_preview"],
|
||||
additionalProperties: false,
|
||||
},
|
||||
{
|
||||
type: "object",
|
||||
properties: {
|
||||
type: {
|
||||
type: "string",
|
||||
const: "template_mention",
|
||||
},
|
||||
template_mention: TemplateMentionResponse,
|
||||
},
|
||||
required: ["type", "template_mention"],
|
||||
additionalProperties: false,
|
||||
},
|
||||
{
|
||||
type: "object",
|
||||
properties: {
|
||||
type: {
|
||||
type: "string",
|
||||
const: "page",
|
||||
},
|
||||
page: {
|
||||
type: "object",
|
||||
properties: {
|
||||
id: IdRequest,
|
||||
},
|
||||
required: ["id"],
|
||||
additionalProperties: false,
|
||||
},
|
||||
},
|
||||
required: ["type", "page"],
|
||||
additionalProperties: false,
|
||||
},
|
||||
{
|
||||
type: "object",
|
||||
properties: {
|
||||
type: {
|
||||
type: "string",
|
||||
const: "database",
|
||||
},
|
||||
database: {
|
||||
type: "object",
|
||||
properties: {
|
||||
id: IdRequest,
|
||||
},
|
||||
required: ["id"],
|
||||
additionalProperties: false,
|
||||
},
|
||||
},
|
||||
required: ["type", "database"],
|
||||
additionalProperties: false,
|
||||
},
|
||||
],
|
||||
},
|
||||
annotations: AnnotationResponse,
|
||||
plain_text: {
|
||||
type: "string",
|
||||
},
|
||||
href: {
|
||||
type: ["string", "null"],
|
||||
},
|
||||
},
|
||||
required: ["type", "mention", "annotations", "plain_text", "href"],
|
||||
additionalProperties: false,
|
||||
};
|
||||
|
||||
export const EquationRichTextItemResponse: JSONSchema = {
|
||||
type: "object",
|
||||
properties: {
|
||||
type: {
|
||||
type: "string",
|
||||
const: "equation",
|
||||
},
|
||||
equation: {
|
||||
type: "object",
|
||||
properties: {
|
||||
expression: TextRequest,
|
||||
},
|
||||
required: ["expression"],
|
||||
additionalProperties: false,
|
||||
},
|
||||
annotations: AnnotationResponse,
|
||||
plain_text: {
|
||||
type: "string",
|
||||
},
|
||||
href: {
|
||||
type: ["string", "null"],
|
||||
},
|
||||
},
|
||||
required: ["type", "equation", "annotations", "plain_text", "href"],
|
||||
additionalProperties: false,
|
||||
};
|
||||
|
||||
export const RichTextItemResponse: JSONSchema = {
|
||||
anyOf: [
|
||||
TextRichTextItemResponse,
|
||||
MentionRichTextItemResponse,
|
||||
EquationRichTextItemResponse,
|
||||
],
|
||||
};
|
||||
@@ -0,0 +1,414 @@
|
||||
import { JSONSchema } from "core/schemas/types";
|
||||
import { EmptyObject, IdRequest } from "./common";
|
||||
import { DateRequest } from "./dateRequest";
|
||||
import { PartialUserObjectResponse } from "./person";
|
||||
import { TextRequest } from "./requests";
|
||||
|
||||
export const RichTextItemRequest: JSONSchema = {
|
||||
anyOf: [
|
||||
{
|
||||
type: "object",
|
||||
properties: {
|
||||
text: {
|
||||
type: "object",
|
||||
properties: {
|
||||
content: {
|
||||
type: "string",
|
||||
},
|
||||
link: {
|
||||
anyOf: [
|
||||
{
|
||||
type: "object",
|
||||
properties: {
|
||||
url: TextRequest,
|
||||
},
|
||||
required: ["url"],
|
||||
additionalProperties: false,
|
||||
},
|
||||
{
|
||||
type: "null",
|
||||
},
|
||||
],
|
||||
},
|
||||
},
|
||||
required: ["content"],
|
||||
additionalProperties: false,
|
||||
},
|
||||
type: {
|
||||
type: "string",
|
||||
const: "text",
|
||||
},
|
||||
annotations: {
|
||||
type: "object",
|
||||
properties: {
|
||||
bold: {
|
||||
type: "boolean",
|
||||
},
|
||||
italic: {
|
||||
type: "boolean",
|
||||
},
|
||||
strikethrough: {
|
||||
type: "boolean",
|
||||
},
|
||||
underline: {
|
||||
type: "boolean",
|
||||
},
|
||||
code: {
|
||||
type: "boolean",
|
||||
},
|
||||
color: {
|
||||
type: "string",
|
||||
enum: [
|
||||
"default",
|
||||
"gray",
|
||||
"brown",
|
||||
"orange",
|
||||
"yellow",
|
||||
"green",
|
||||
"blue",
|
||||
"purple",
|
||||
"pink",
|
||||
"red",
|
||||
"gray_background",
|
||||
"brown_background",
|
||||
"orange_background",
|
||||
"yellow_background",
|
||||
"green_background",
|
||||
"blue_background",
|
||||
"purple_background",
|
||||
"pink_background",
|
||||
"red_background",
|
||||
],
|
||||
},
|
||||
},
|
||||
additionalProperties: false,
|
||||
},
|
||||
},
|
||||
required: ["text"],
|
||||
additionalProperties: false,
|
||||
},
|
||||
{
|
||||
type: "object",
|
||||
properties: {
|
||||
mention: {
|
||||
anyOf: [
|
||||
{
|
||||
type: "object",
|
||||
properties: {
|
||||
user: {
|
||||
anyOf: [
|
||||
{
|
||||
type: "object",
|
||||
properties: {
|
||||
id: IdRequest,
|
||||
},
|
||||
required: ["id"],
|
||||
additionalProperties: false,
|
||||
},
|
||||
{
|
||||
type: "object",
|
||||
properties: {
|
||||
person: {
|
||||
type: "object",
|
||||
properties: {
|
||||
email: {
|
||||
type: "string",
|
||||
},
|
||||
},
|
||||
additionalProperties: false,
|
||||
},
|
||||
id: IdRequest,
|
||||
type: {
|
||||
type: "string",
|
||||
const: "person",
|
||||
},
|
||||
name: {
|
||||
type: ["string", "null"],
|
||||
},
|
||||
avatar_url: {
|
||||
type: ["string", "null"],
|
||||
},
|
||||
object: {
|
||||
type: "string",
|
||||
const: "user",
|
||||
},
|
||||
},
|
||||
required: ["person", "id"],
|
||||
additionalProperties: false,
|
||||
},
|
||||
{
|
||||
type: "object",
|
||||
properties: {
|
||||
bot: {
|
||||
anyOf: [
|
||||
EmptyObject,
|
||||
{
|
||||
type: "object",
|
||||
properties: {
|
||||
owner: {
|
||||
anyOf: [
|
||||
{
|
||||
type: "object",
|
||||
properties: {
|
||||
type: {
|
||||
type: "string",
|
||||
const: "user",
|
||||
},
|
||||
user: {
|
||||
anyOf: [
|
||||
{
|
||||
type: "object",
|
||||
properties: {
|
||||
type: {
|
||||
type: "string",
|
||||
const: "person",
|
||||
},
|
||||
person: {
|
||||
type: "object",
|
||||
properties: {
|
||||
email: {
|
||||
type: "string",
|
||||
},
|
||||
},
|
||||
required: ["email"],
|
||||
additionalProperties: false,
|
||||
},
|
||||
name: {
|
||||
type: ["string", "null"],
|
||||
},
|
||||
avatar_url: {
|
||||
type: ["string", "null"],
|
||||
},
|
||||
id: IdRequest,
|
||||
object: {
|
||||
type: "string",
|
||||
const: "user",
|
||||
},
|
||||
},
|
||||
required: [
|
||||
"type",
|
||||
"person",
|
||||
"name",
|
||||
"avatar_url",
|
||||
"id",
|
||||
"object",
|
||||
],
|
||||
additionalProperties: false,
|
||||
},
|
||||
PartialUserObjectResponse,
|
||||
],
|
||||
},
|
||||
},
|
||||
required: ["type", "user"],
|
||||
additionalProperties: false,
|
||||
},
|
||||
{
|
||||
type: "object",
|
||||
properties: {
|
||||
type: {
|
||||
type: "string",
|
||||
const: "workspace",
|
||||
},
|
||||
workspace: {
|
||||
type: "boolean",
|
||||
const: true,
|
||||
},
|
||||
},
|
||||
required: ["type", "workspace"],
|
||||
additionalProperties: false,
|
||||
},
|
||||
],
|
||||
},
|
||||
workspace_name: {
|
||||
type: ["string", "null"],
|
||||
},
|
||||
},
|
||||
required: ["owner", "workspace_name"],
|
||||
additionalProperties: false,
|
||||
},
|
||||
],
|
||||
},
|
||||
id: IdRequest,
|
||||
type: {
|
||||
type: "string",
|
||||
const: "bot",
|
||||
},
|
||||
name: {
|
||||
type: ["string", "null"],
|
||||
},
|
||||
avatar_url: {
|
||||
type: ["string", "null"],
|
||||
},
|
||||
object: {
|
||||
type: "string",
|
||||
const: "user",
|
||||
},
|
||||
},
|
||||
required: ["bot", "id"],
|
||||
additionalProperties: false,
|
||||
},
|
||||
],
|
||||
},
|
||||
},
|
||||
required: ["user"],
|
||||
additionalProperties: false,
|
||||
},
|
||||
{
|
||||
type: "object",
|
||||
properties: {
|
||||
date: DateRequest,
|
||||
},
|
||||
required: ["date"],
|
||||
additionalProperties: false,
|
||||
},
|
||||
{
|
||||
type: "object",
|
||||
properties: {
|
||||
page: {
|
||||
type: "object",
|
||||
properties: {
|
||||
id: IdRequest,
|
||||
},
|
||||
required: ["id"],
|
||||
additionalProperties: false,
|
||||
},
|
||||
},
|
||||
required: ["page"],
|
||||
additionalProperties: false,
|
||||
},
|
||||
{
|
||||
type: "object",
|
||||
properties: {
|
||||
database: {
|
||||
type: "object",
|
||||
properties: {
|
||||
id: IdRequest,
|
||||
},
|
||||
required: ["id"],
|
||||
additionalProperties: false,
|
||||
},
|
||||
},
|
||||
required: ["database"],
|
||||
additionalProperties: false,
|
||||
},
|
||||
],
|
||||
},
|
||||
type: {
|
||||
type: "string",
|
||||
const: "mention",
|
||||
},
|
||||
annotations: {
|
||||
type: "object",
|
||||
properties: {
|
||||
bold: {
|
||||
type: "boolean",
|
||||
},
|
||||
italic: {
|
||||
type: "boolean",
|
||||
},
|
||||
strikethrough: {
|
||||
type: "boolean",
|
||||
},
|
||||
underline: {
|
||||
type: "boolean",
|
||||
},
|
||||
code: {
|
||||
type: "boolean",
|
||||
},
|
||||
color: {
|
||||
type: "string",
|
||||
enum: [
|
||||
"default",
|
||||
"gray",
|
||||
"brown",
|
||||
"orange",
|
||||
"yellow",
|
||||
"green",
|
||||
"blue",
|
||||
"purple",
|
||||
"pink",
|
||||
"red",
|
||||
"gray_background",
|
||||
"brown_background",
|
||||
"orange_background",
|
||||
"yellow_background",
|
||||
"green_background",
|
||||
"blue_background",
|
||||
"purple_background",
|
||||
"pink_background",
|
||||
"red_background",
|
||||
],
|
||||
},
|
||||
},
|
||||
additionalProperties: false,
|
||||
},
|
||||
},
|
||||
required: ["mention"],
|
||||
additionalProperties: false,
|
||||
},
|
||||
{
|
||||
type: "object",
|
||||
properties: {
|
||||
equation: {
|
||||
type: "object",
|
||||
properties: {
|
||||
expression: TextRequest,
|
||||
},
|
||||
required: ["expression"],
|
||||
additionalProperties: false,
|
||||
},
|
||||
type: {
|
||||
type: "string",
|
||||
const: "equation",
|
||||
},
|
||||
annotations: {
|
||||
type: "object",
|
||||
properties: {
|
||||
bold: {
|
||||
type: "boolean",
|
||||
},
|
||||
italic: {
|
||||
type: "boolean",
|
||||
},
|
||||
strikethrough: {
|
||||
type: "boolean",
|
||||
},
|
||||
underline: {
|
||||
type: "boolean",
|
||||
},
|
||||
code: {
|
||||
type: "boolean",
|
||||
},
|
||||
color: {
|
||||
type: "string",
|
||||
enum: [
|
||||
"default",
|
||||
"gray",
|
||||
"brown",
|
||||
"orange",
|
||||
"yellow",
|
||||
"green",
|
||||
"blue",
|
||||
"purple",
|
||||
"pink",
|
||||
"red",
|
||||
"gray_background",
|
||||
"brown_background",
|
||||
"orange_background",
|
||||
"yellow_background",
|
||||
"green_background",
|
||||
"blue_background",
|
||||
"purple_background",
|
||||
"pink_background",
|
||||
"red_background",
|
||||
],
|
||||
},
|
||||
},
|
||||
additionalProperties: false,
|
||||
},
|
||||
},
|
||||
required: ["equation"],
|
||||
additionalProperties: false,
|
||||
},
|
||||
],
|
||||
};
|
||||
@@ -0,0 +1,600 @@
|
||||
import { JSONSchema } from "core/schemas/types";
|
||||
|
||||
export const TimeZoneRequest: JSONSchema = {
|
||||
type: "string",
|
||||
enum: [
|
||||
"Africa/Abidjan",
|
||||
"Africa/Accra",
|
||||
"Africa/Addis_Ababa",
|
||||
"Africa/Algiers",
|
||||
"Africa/Asmara",
|
||||
"Africa/Asmera",
|
||||
"Africa/Bamako",
|
||||
"Africa/Bangui",
|
||||
"Africa/Banjul",
|
||||
"Africa/Bissau",
|
||||
"Africa/Blantyre",
|
||||
"Africa/Brazzaville",
|
||||
"Africa/Bujumbura",
|
||||
"Africa/Cairo",
|
||||
"Africa/Casablanca",
|
||||
"Africa/Ceuta",
|
||||
"Africa/Conakry",
|
||||
"Africa/Dakar",
|
||||
"Africa/Dar_es_Salaam",
|
||||
"Africa/Djibouti",
|
||||
"Africa/Douala",
|
||||
"Africa/El_Aaiun",
|
||||
"Africa/Freetown",
|
||||
"Africa/Gaborone",
|
||||
"Africa/Harare",
|
||||
"Africa/Johannesburg",
|
||||
"Africa/Juba",
|
||||
"Africa/Kampala",
|
||||
"Africa/Khartoum",
|
||||
"Africa/Kigali",
|
||||
"Africa/Kinshasa",
|
||||
"Africa/Lagos",
|
||||
"Africa/Libreville",
|
||||
"Africa/Lome",
|
||||
"Africa/Luanda",
|
||||
"Africa/Lubumbashi",
|
||||
"Africa/Lusaka",
|
||||
"Africa/Malabo",
|
||||
"Africa/Maputo",
|
||||
"Africa/Maseru",
|
||||
"Africa/Mbabane",
|
||||
"Africa/Mogadishu",
|
||||
"Africa/Monrovia",
|
||||
"Africa/Nairobi",
|
||||
"Africa/Ndjamena",
|
||||
"Africa/Niamey",
|
||||
"Africa/Nouakchott",
|
||||
"Africa/Ouagadougou",
|
||||
"Africa/Porto-Novo",
|
||||
"Africa/Sao_Tome",
|
||||
"Africa/Timbuktu",
|
||||
"Africa/Tripoli",
|
||||
"Africa/Tunis",
|
||||
"Africa/Windhoek",
|
||||
"America/Adak",
|
||||
"America/Anchorage",
|
||||
"America/Anguilla",
|
||||
"America/Antigua",
|
||||
"America/Araguaina",
|
||||
"America/Argentina/Buenos_Aires",
|
||||
"America/Argentina/Catamarca",
|
||||
"America/Argentina/ComodRivadavia",
|
||||
"America/Argentina/Cordoba",
|
||||
"America/Argentina/Jujuy",
|
||||
"America/Argentina/La_Rioja",
|
||||
"America/Argentina/Mendoza",
|
||||
"America/Argentina/Rio_Gallegos",
|
||||
"America/Argentina/Salta",
|
||||
"America/Argentina/San_Juan",
|
||||
"America/Argentina/San_Luis",
|
||||
"America/Argentina/Tucuman",
|
||||
"America/Argentina/Ushuaia",
|
||||
"America/Aruba",
|
||||
"America/Asuncion",
|
||||
"America/Atikokan",
|
||||
"America/Atka",
|
||||
"America/Bahia",
|
||||
"America/Bahia_Banderas",
|
||||
"America/Barbados",
|
||||
"America/Belem",
|
||||
"America/Belize",
|
||||
"America/Blanc-Sablon",
|
||||
"America/Boa_Vista",
|
||||
"America/Bogota",
|
||||
"America/Boise",
|
||||
"America/Buenos_Aires",
|
||||
"America/Cambridge_Bay",
|
||||
"America/Campo_Grande",
|
||||
"America/Cancun",
|
||||
"America/Caracas",
|
||||
"America/Catamarca",
|
||||
"America/Cayenne",
|
||||
"America/Cayman",
|
||||
"America/Chicago",
|
||||
"America/Chihuahua",
|
||||
"America/Coral_Harbour",
|
||||
"America/Cordoba",
|
||||
"America/Costa_Rica",
|
||||
"America/Creston",
|
||||
"America/Cuiaba",
|
||||
"America/Curacao",
|
||||
"America/Danmarkshavn",
|
||||
"America/Dawson",
|
||||
"America/Dawson_Creek",
|
||||
"America/Denver",
|
||||
"America/Detroit",
|
||||
"America/Dominica",
|
||||
"America/Edmonton",
|
||||
"America/Eirunepe",
|
||||
"America/El_Salvador",
|
||||
"America/Ensenada",
|
||||
"America/Fort_Nelson",
|
||||
"America/Fort_Wayne",
|
||||
"America/Fortaleza",
|
||||
"America/Glace_Bay",
|
||||
"America/Godthab",
|
||||
"America/Goose_Bay",
|
||||
"America/Grand_Turk",
|
||||
"America/Grenada",
|
||||
"America/Guadeloupe",
|
||||
"America/Guatemala",
|
||||
"America/Guayaquil",
|
||||
"America/Guyana",
|
||||
"America/Halifax",
|
||||
"America/Havana",
|
||||
"America/Hermosillo",
|
||||
"America/Indiana/Indianapolis",
|
||||
"America/Indiana/Knox",
|
||||
"America/Indiana/Marengo",
|
||||
"America/Indiana/Petersburg",
|
||||
"America/Indiana/Tell_City",
|
||||
"America/Indiana/Vevay",
|
||||
"America/Indiana/Vincennes",
|
||||
"America/Indiana/Winamac",
|
||||
"America/Indianapolis",
|
||||
"America/Inuvik",
|
||||
"America/Iqaluit",
|
||||
"America/Jamaica",
|
||||
"America/Jujuy",
|
||||
"America/Juneau",
|
||||
"America/Kentucky/Louisville",
|
||||
"America/Kentucky/Monticello",
|
||||
"America/Knox_IN",
|
||||
"America/Kralendijk",
|
||||
"America/La_Paz",
|
||||
"America/Lima",
|
||||
"America/Los_Angeles",
|
||||
"America/Louisville",
|
||||
"America/Lower_Princes",
|
||||
"America/Maceio",
|
||||
"America/Managua",
|
||||
"America/Manaus",
|
||||
"America/Marigot",
|
||||
"America/Martinique",
|
||||
"America/Matamoros",
|
||||
"America/Mazatlan",
|
||||
"America/Mendoza",
|
||||
"America/Menominee",
|
||||
"America/Merida",
|
||||
"America/Metlakatla",
|
||||
"America/Mexico_City",
|
||||
"America/Miquelon",
|
||||
"America/Moncton",
|
||||
"America/Monterrey",
|
||||
"America/Montevideo",
|
||||
"America/Montreal",
|
||||
"America/Montserrat",
|
||||
"America/Nassau",
|
||||
"America/New_York",
|
||||
"America/Nipigon",
|
||||
"America/Nome",
|
||||
"America/Noronha",
|
||||
"America/North_Dakota/Beulah",
|
||||
"America/North_Dakota/Center",
|
||||
"America/North_Dakota/New_Salem",
|
||||
"America/Ojinaga",
|
||||
"America/Panama",
|
||||
"America/Pangnirtung",
|
||||
"America/Paramaribo",
|
||||
"America/Phoenix",
|
||||
"America/Port-au-Prince",
|
||||
"America/Port_of_Spain",
|
||||
"America/Porto_Acre",
|
||||
"America/Porto_Velho",
|
||||
"America/Puerto_Rico",
|
||||
"America/Punta_Arenas",
|
||||
"America/Rainy_River",
|
||||
"America/Rankin_Inlet",
|
||||
"America/Recife",
|
||||
"America/Regina",
|
||||
"America/Resolute",
|
||||
"America/Rio_Branco",
|
||||
"America/Rosario",
|
||||
"America/Santa_Isabel",
|
||||
"America/Santarem",
|
||||
"America/Santiago",
|
||||
"America/Santo_Domingo",
|
||||
"America/Sao_Paulo",
|
||||
"America/Scoresbysund",
|
||||
"America/Shiprock",
|
||||
"America/Sitka",
|
||||
"America/St_Barthelemy",
|
||||
"America/St_Johns",
|
||||
"America/St_Kitts",
|
||||
"America/St_Lucia",
|
||||
"America/St_Thomas",
|
||||
"America/St_Vincent",
|
||||
"America/Swift_Current",
|
||||
"America/Tegucigalpa",
|
||||
"America/Thule",
|
||||
"America/Thunder_Bay",
|
||||
"America/Tijuana",
|
||||
"America/Toronto",
|
||||
"America/Tortola",
|
||||
"America/Vancouver",
|
||||
"America/Virgin",
|
||||
"America/Whitehorse",
|
||||
"America/Winnipeg",
|
||||
"America/Yakutat",
|
||||
"America/Yellowknife",
|
||||
"Antarctica/Casey",
|
||||
"Antarctica/Davis",
|
||||
"Antarctica/DumontDUrville",
|
||||
"Antarctica/Macquarie",
|
||||
"Antarctica/Mawson",
|
||||
"Antarctica/McMurdo",
|
||||
"Antarctica/Palmer",
|
||||
"Antarctica/Rothera",
|
||||
"Antarctica/South_Pole",
|
||||
"Antarctica/Syowa",
|
||||
"Antarctica/Troll",
|
||||
"Antarctica/Vostok",
|
||||
"Arctic/Longyearbyen",
|
||||
"Asia/Aden",
|
||||
"Asia/Almaty",
|
||||
"Asia/Amman",
|
||||
"Asia/Anadyr",
|
||||
"Asia/Aqtau",
|
||||
"Asia/Aqtobe",
|
||||
"Asia/Ashgabat",
|
||||
"Asia/Ashkhabad",
|
||||
"Asia/Atyrau",
|
||||
"Asia/Baghdad",
|
||||
"Asia/Bahrain",
|
||||
"Asia/Baku",
|
||||
"Asia/Bangkok",
|
||||
"Asia/Barnaul",
|
||||
"Asia/Beirut",
|
||||
"Asia/Bishkek",
|
||||
"Asia/Brunei",
|
||||
"Asia/Calcutta",
|
||||
"Asia/Chita",
|
||||
"Asia/Choibalsan",
|
||||
"Asia/Chongqing",
|
||||
"Asia/Chungking",
|
||||
"Asia/Colombo",
|
||||
"Asia/Dacca",
|
||||
"Asia/Damascus",
|
||||
"Asia/Dhaka",
|
||||
"Asia/Dili",
|
||||
"Asia/Dubai",
|
||||
"Asia/Dushanbe",
|
||||
"Asia/Famagusta",
|
||||
"Asia/Gaza",
|
||||
"Asia/Harbin",
|
||||
"Asia/Hebron",
|
||||
"Asia/Ho_Chi_Minh",
|
||||
"Asia/Hong_Kong",
|
||||
"Asia/Hovd",
|
||||
"Asia/Irkutsk",
|
||||
"Asia/Istanbul",
|
||||
"Asia/Jakarta",
|
||||
"Asia/Jayapura",
|
||||
"Asia/Jerusalem",
|
||||
"Asia/Kabul",
|
||||
"Asia/Kamchatka",
|
||||
"Asia/Karachi",
|
||||
"Asia/Kashgar",
|
||||
"Asia/Kathmandu",
|
||||
"Asia/Katmandu",
|
||||
"Asia/Khandyga",
|
||||
"Asia/Kolkata",
|
||||
"Asia/Krasnoyarsk",
|
||||
"Asia/Kuala_Lumpur",
|
||||
"Asia/Kuching",
|
||||
"Asia/Kuwait",
|
||||
"Asia/Macao",
|
||||
"Asia/Macau",
|
||||
"Asia/Magadan",
|
||||
"Asia/Makassar",
|
||||
"Asia/Manila",
|
||||
"Asia/Muscat",
|
||||
"Asia/Nicosia",
|
||||
"Asia/Novokuznetsk",
|
||||
"Asia/Novosibirsk",
|
||||
"Asia/Omsk",
|
||||
"Asia/Oral",
|
||||
"Asia/Phnom_Penh",
|
||||
"Asia/Pontianak",
|
||||
"Asia/Pyongyang",
|
||||
"Asia/Qatar",
|
||||
"Asia/Qostanay",
|
||||
"Asia/Qyzylorda",
|
||||
"Asia/Rangoon",
|
||||
"Asia/Riyadh",
|
||||
"Asia/Saigon",
|
||||
"Asia/Sakhalin",
|
||||
"Asia/Samarkand",
|
||||
"Asia/Seoul",
|
||||
"Asia/Shanghai",
|
||||
"Asia/Singapore",
|
||||
"Asia/Srednekolymsk",
|
||||
"Asia/Taipei",
|
||||
"Asia/Tashkent",
|
||||
"Asia/Tbilisi",
|
||||
"Asia/Tehran",
|
||||
"Asia/Tel_Aviv",
|
||||
"Asia/Thimbu",
|
||||
"Asia/Thimphu",
|
||||
"Asia/Tokyo",
|
||||
"Asia/Tomsk",
|
||||
"Asia/Ujung_Pandang",
|
||||
"Asia/Ulaanbaatar",
|
||||
"Asia/Ulan_Bator",
|
||||
"Asia/Urumqi",
|
||||
"Asia/Ust-Nera",
|
||||
"Asia/Vientiane",
|
||||
"Asia/Vladivostok",
|
||||
"Asia/Yakutsk",
|
||||
"Asia/Yangon",
|
||||
"Asia/Yekaterinburg",
|
||||
"Asia/Yerevan",
|
||||
"Atlantic/Azores",
|
||||
"Atlantic/Bermuda",
|
||||
"Atlantic/Canary",
|
||||
"Atlantic/Cape_Verde",
|
||||
"Atlantic/Faeroe",
|
||||
"Atlantic/Faroe",
|
||||
"Atlantic/Jan_Mayen",
|
||||
"Atlantic/Madeira",
|
||||
"Atlantic/Reykjavik",
|
||||
"Atlantic/South_Georgia",
|
||||
"Atlantic/St_Helena",
|
||||
"Atlantic/Stanley",
|
||||
"Australia/ACT",
|
||||
"Australia/Adelaide",
|
||||
"Australia/Brisbane",
|
||||
"Australia/Broken_Hill",
|
||||
"Australia/Canberra",
|
||||
"Australia/Currie",
|
||||
"Australia/Darwin",
|
||||
"Australia/Eucla",
|
||||
"Australia/Hobart",
|
||||
"Australia/LHI",
|
||||
"Australia/Lindeman",
|
||||
"Australia/Lord_Howe",
|
||||
"Australia/Melbourne",
|
||||
"Australia/NSW",
|
||||
"Australia/North",
|
||||
"Australia/Perth",
|
||||
"Australia/Queensland",
|
||||
"Australia/South",
|
||||
"Australia/Sydney",
|
||||
"Australia/Tasmania",
|
||||
"Australia/Victoria",
|
||||
"Australia/West",
|
||||
"Australia/Yancowinna",
|
||||
"Brazil/Acre",
|
||||
"Brazil/DeNoronha",
|
||||
"Brazil/East",
|
||||
"Brazil/West",
|
||||
"CET",
|
||||
"CST6CDT",
|
||||
"Canada/Atlantic",
|
||||
"Canada/Central",
|
||||
"Canada/Eastern",
|
||||
"Canada/Mountain",
|
||||
"Canada/Newfoundland",
|
||||
"Canada/Pacific",
|
||||
"Canada/Saskatchewan",
|
||||
"Canada/Yukon",
|
||||
"Chile/Continental",
|
||||
"Chile/EasterIsland",
|
||||
"Cuba",
|
||||
"EET",
|
||||
"EST",
|
||||
"EST5EDT",
|
||||
"Egypt",
|
||||
"Eire",
|
||||
"Etc/GMT",
|
||||
"Etc/GMT+0",
|
||||
"Etc/GMT+1",
|
||||
"Etc/GMT+10",
|
||||
"Etc/GMT+11",
|
||||
"Etc/GMT+12",
|
||||
"Etc/GMT+2",
|
||||
"Etc/GMT+3",
|
||||
"Etc/GMT+4",
|
||||
"Etc/GMT+5",
|
||||
"Etc/GMT+6",
|
||||
"Etc/GMT+7",
|
||||
"Etc/GMT+8",
|
||||
"Etc/GMT+9",
|
||||
"Etc/GMT-0",
|
||||
"Etc/GMT-1",
|
||||
"Etc/GMT-10",
|
||||
"Etc/GMT-11",
|
||||
"Etc/GMT-12",
|
||||
"Etc/GMT-13",
|
||||
"Etc/GMT-14",
|
||||
"Etc/GMT-2",
|
||||
"Etc/GMT-3",
|
||||
"Etc/GMT-4",
|
||||
"Etc/GMT-5",
|
||||
"Etc/GMT-6",
|
||||
"Etc/GMT-7",
|
||||
"Etc/GMT-8",
|
||||
"Etc/GMT-9",
|
||||
"Etc/GMT0",
|
||||
"Etc/Greenwich",
|
||||
"Etc/UCT",
|
||||
"Etc/UTC",
|
||||
"Etc/Universal",
|
||||
"Etc/Zulu",
|
||||
"Europe/Amsterdam",
|
||||
"Europe/Andorra",
|
||||
"Europe/Astrakhan",
|
||||
"Europe/Athens",
|
||||
"Europe/Belfast",
|
||||
"Europe/Belgrade",
|
||||
"Europe/Berlin",
|
||||
"Europe/Bratislava",
|
||||
"Europe/Brussels",
|
||||
"Europe/Bucharest",
|
||||
"Europe/Budapest",
|
||||
"Europe/Busingen",
|
||||
"Europe/Chisinau",
|
||||
"Europe/Copenhagen",
|
||||
"Europe/Dublin",
|
||||
"Europe/Gibraltar",
|
||||
"Europe/Guernsey",
|
||||
"Europe/Helsinki",
|
||||
"Europe/Isle_of_Man",
|
||||
"Europe/Istanbul",
|
||||
"Europe/Jersey",
|
||||
"Europe/Kaliningrad",
|
||||
"Europe/Kiev",
|
||||
"Europe/Kirov",
|
||||
"Europe/Lisbon",
|
||||
"Europe/Ljubljana",
|
||||
"Europe/London",
|
||||
"Europe/Luxembourg",
|
||||
"Europe/Madrid",
|
||||
"Europe/Malta",
|
||||
"Europe/Mariehamn",
|
||||
"Europe/Minsk",
|
||||
"Europe/Monaco",
|
||||
"Europe/Moscow",
|
||||
"Europe/Nicosia",
|
||||
"Europe/Oslo",
|
||||
"Europe/Paris",
|
||||
"Europe/Podgorica",
|
||||
"Europe/Prague",
|
||||
"Europe/Riga",
|
||||
"Europe/Rome",
|
||||
"Europe/Samara",
|
||||
"Europe/San_Marino",
|
||||
"Europe/Sarajevo",
|
||||
"Europe/Saratov",
|
||||
"Europe/Simferopol",
|
||||
"Europe/Skopje",
|
||||
"Europe/Sofia",
|
||||
"Europe/Stockholm",
|
||||
"Europe/Tallinn",
|
||||
"Europe/Tirane",
|
||||
"Europe/Tiraspol",
|
||||
"Europe/Ulyanovsk",
|
||||
"Europe/Uzhgorod",
|
||||
"Europe/Vaduz",
|
||||
"Europe/Vatican",
|
||||
"Europe/Vienna",
|
||||
"Europe/Vilnius",
|
||||
"Europe/Volgograd",
|
||||
"Europe/Warsaw",
|
||||
"Europe/Zagreb",
|
||||
"Europe/Zaporozhye",
|
||||
"Europe/Zurich",
|
||||
"GB",
|
||||
"GB-Eire",
|
||||
"GMT",
|
||||
"GMT+0",
|
||||
"GMT-0",
|
||||
"GMT0",
|
||||
"Greenwich",
|
||||
"HST",
|
||||
"Hongkong",
|
||||
"Iceland",
|
||||
"Indian/Antananarivo",
|
||||
"Indian/Chagos",
|
||||
"Indian/Christmas",
|
||||
"Indian/Cocos",
|
||||
"Indian/Comoro",
|
||||
"Indian/Kerguelen",
|
||||
"Indian/Mahe",
|
||||
"Indian/Maldives",
|
||||
"Indian/Mauritius",
|
||||
"Indian/Mayotte",
|
||||
"Indian/Reunion",
|
||||
"Iran",
|
||||
"Israel",
|
||||
"Jamaica",
|
||||
"Japan",
|
||||
"Kwajalein",
|
||||
"Libya",
|
||||
"MET",
|
||||
"MST",
|
||||
"MST7MDT",
|
||||
"Mexico/BajaNorte",
|
||||
"Mexico/BajaSur",
|
||||
"Mexico/General",
|
||||
"NZ",
|
||||
"NZ-CHAT",
|
||||
"Navajo",
|
||||
"PRC",
|
||||
"PST8PDT",
|
||||
"Pacific/Apia",
|
||||
"Pacific/Auckland",
|
||||
"Pacific/Bougainville",
|
||||
"Pacific/Chatham",
|
||||
"Pacific/Chuuk",
|
||||
"Pacific/Easter",
|
||||
"Pacific/Efate",
|
||||
"Pacific/Enderbury",
|
||||
"Pacific/Fakaofo",
|
||||
"Pacific/Fiji",
|
||||
"Pacific/Funafuti",
|
||||
"Pacific/Galapagos",
|
||||
"Pacific/Gambier",
|
||||
"Pacific/Guadalcanal",
|
||||
"Pacific/Guam",
|
||||
"Pacific/Honolulu",
|
||||
"Pacific/Johnston",
|
||||
"Pacific/Kiritimati",
|
||||
"Pacific/Kosrae",
|
||||
"Pacific/Kwajalein",
|
||||
"Pacific/Majuro",
|
||||
"Pacific/Marquesas",
|
||||
"Pacific/Midway",
|
||||
"Pacific/Nauru",
|
||||
"Pacific/Niue",
|
||||
"Pacific/Norfolk",
|
||||
"Pacific/Noumea",
|
||||
"Pacific/Pago_Pago",
|
||||
"Pacific/Palau",
|
||||
"Pacific/Pitcairn",
|
||||
"Pacific/Pohnpei",
|
||||
"Pacific/Ponape",
|
||||
"Pacific/Port_Moresby",
|
||||
"Pacific/Rarotonga",
|
||||
"Pacific/Saipan",
|
||||
"Pacific/Samoa",
|
||||
"Pacific/Tahiti",
|
||||
"Pacific/Tarawa",
|
||||
"Pacific/Tongatapu",
|
||||
"Pacific/Truk",
|
||||
"Pacific/Wake",
|
||||
"Pacific/Wallis",
|
||||
"Pacific/Yap",
|
||||
"Poland",
|
||||
"Portugal",
|
||||
"ROC",
|
||||
"ROK",
|
||||
"Singapore",
|
||||
"Turkey",
|
||||
"UCT",
|
||||
"US/Alaska",
|
||||
"US/Aleutian",
|
||||
"US/Arizona",
|
||||
"US/Central",
|
||||
"US/East-Indiana",
|
||||
"US/Eastern",
|
||||
"US/Hawaii",
|
||||
"US/Indiana-Starke",
|
||||
"US/Michigan",
|
||||
"US/Mountain",
|
||||
"US/Pacific",
|
||||
"US/Pacific-New",
|
||||
"US/Samoa",
|
||||
"UTC",
|
||||
"Universal",
|
||||
"W-SU",
|
||||
"WET",
|
||||
"Zulu",
|
||||
],
|
||||
};
|
||||
@@ -0,0 +1,759 @@
|
||||
import { EndpointSpec, EndpointSpecResponse } from "core/endpoint/types";
|
||||
import {
|
||||
AppendBlockChildrenBodyParameters,
|
||||
AppendBlockChildrenResponse,
|
||||
} from "./schemas/endpoints/appendBlockChildren";
|
||||
import {
|
||||
CreateCommentBodyParameters,
|
||||
CreateCommentResponse,
|
||||
} from "./schemas/endpoints/createComment";
|
||||
import {
|
||||
CreateDatabaseBodyParameters,
|
||||
CreateDatabaseResponse,
|
||||
} from "./schemas/endpoints/createDatabase";
|
||||
import {
|
||||
CreatePageParameters,
|
||||
CreatePageResponse,
|
||||
} from "./schemas/endpoints/createPage";
|
||||
import { DeleteBlockResponse } from "./schemas/endpoints/deleteBlock";
|
||||
import { GetBlockResponse } from "./schemas/endpoints/getBlock";
|
||||
import { GetDatabaseResponse } from "./schemas/endpoints/getDatabase";
|
||||
import { GetPageResponse } from "./schemas/endpoints/getPage";
|
||||
import { GetUserResponse } from "./schemas/endpoints/getUser";
|
||||
import { ListBlockChildrenResponse } from "./schemas/endpoints/listBlockChildren";
|
||||
import { ListCommentsResponse } from "./schemas/endpoints/listComments";
|
||||
import { ListUsersResponse } from "./schemas/endpoints/listUsers";
|
||||
import { GetSelfResponse } from "./schemas/endpoints/me";
|
||||
import {
|
||||
QueryDatabaseBodyParameters,
|
||||
QueryDatabaseQueryParameters,
|
||||
QueryDatabaseResponse,
|
||||
} from "./schemas/endpoints/queryDatabase";
|
||||
import { SearchParameters, SearchResponse } from "./schemas/endpoints/search";
|
||||
import {
|
||||
UpdateBlockBodyParameters,
|
||||
UpdateBlockResponse,
|
||||
} from "./schemas/endpoints/updateBlock";
|
||||
import {
|
||||
UpdateDatabaseBodyParameters,
|
||||
UpdateDatabaseResponse,
|
||||
} from "./schemas/endpoints/updateDatabase";
|
||||
import {
|
||||
UpdatePageBodyParameters,
|
||||
UpdatePageResponse,
|
||||
} from "./schemas/endpoints/updatePage";
|
||||
import {
|
||||
BlockIdParam,
|
||||
DatabaseIdParam,
|
||||
PageIdParam,
|
||||
PageSizeParam,
|
||||
StartCursorParam,
|
||||
VersionHeaderParam,
|
||||
} from "./schemas/params";
|
||||
|
||||
const errorResponse: EndpointSpecResponse = {
|
||||
matches: ({ statusCode }) => statusCode < 200 || statusCode >= 300,
|
||||
success: false,
|
||||
name: "Error",
|
||||
description: "Error response",
|
||||
schema: {},
|
||||
};
|
||||
|
||||
export const getUser: EndpointSpec = {
|
||||
path: "/users/{user_id}",
|
||||
method: "GET",
|
||||
metadata: {
|
||||
name: "getUser",
|
||||
description: `Get a user's information`,
|
||||
displayProperties: {
|
||||
title: "Get user info for user id ${parameters.user_id}",
|
||||
},
|
||||
externalDocs: {
|
||||
description: "API method documentation",
|
||||
url: "https://developers.notion.com/reference/get-user",
|
||||
},
|
||||
tags: ["users"],
|
||||
},
|
||||
security: {
|
||||
oauth: [],
|
||||
},
|
||||
parameters: [
|
||||
{
|
||||
name: "user_id",
|
||||
in: "path",
|
||||
description: "ID of the user you would like info about",
|
||||
schema: {
|
||||
type: "string",
|
||||
},
|
||||
required: true,
|
||||
},
|
||||
VersionHeaderParam,
|
||||
],
|
||||
request: {},
|
||||
responses: [
|
||||
{
|
||||
matches: ({ statusCode }) => statusCode >= 200 && statusCode < 300,
|
||||
success: true,
|
||||
name: "Success",
|
||||
description: "Typical success response",
|
||||
schema: GetUserResponse,
|
||||
},
|
||||
errorResponse,
|
||||
],
|
||||
};
|
||||
|
||||
export const listUsers: EndpointSpec = {
|
||||
path: "/users",
|
||||
method: "GET",
|
||||
metadata: {
|
||||
name: "listUsers",
|
||||
description: `Returns a paginated list of Users for the workspace. The response may contain fewer than page_size of results.`,
|
||||
displayProperties: {
|
||||
title: "List users",
|
||||
},
|
||||
externalDocs: {
|
||||
description: "API method documentation",
|
||||
url: "https://developers.notion.com/reference/get-users",
|
||||
},
|
||||
tags: ["users"],
|
||||
},
|
||||
security: {
|
||||
oauth: [],
|
||||
},
|
||||
parameters: [VersionHeaderParam, StartCursorParam, PageSizeParam],
|
||||
request: {},
|
||||
responses: [
|
||||
{
|
||||
matches: ({ statusCode }) => statusCode >= 200 && statusCode < 300,
|
||||
success: true,
|
||||
name: "Success",
|
||||
description: "Typical success response",
|
||||
schema: ListUsersResponse,
|
||||
},
|
||||
errorResponse,
|
||||
],
|
||||
};
|
||||
|
||||
export const getBotInfo: EndpointSpec = {
|
||||
path: "/users/me",
|
||||
method: "GET",
|
||||
metadata: {
|
||||
name: "getBotInfo",
|
||||
description: `Get's the bots info`,
|
||||
displayProperties: {
|
||||
title: "Get the bot's info",
|
||||
},
|
||||
externalDocs: {
|
||||
description: "API method documentation",
|
||||
url: "https://developers.notion.com/reference/get-self",
|
||||
},
|
||||
tags: ["users"],
|
||||
},
|
||||
security: {
|
||||
oauth: [],
|
||||
},
|
||||
parameters: [VersionHeaderParam],
|
||||
request: {},
|
||||
responses: [
|
||||
{
|
||||
matches: ({ statusCode }) => statusCode >= 200 && statusCode < 300,
|
||||
success: true,
|
||||
name: "Success",
|
||||
description: "Typical success response",
|
||||
schema: GetSelfResponse,
|
||||
},
|
||||
errorResponse,
|
||||
],
|
||||
};
|
||||
|
||||
export const getPage: EndpointSpec = {
|
||||
path: "/pages/{page_id}",
|
||||
method: "GET",
|
||||
metadata: {
|
||||
name: "getPage",
|
||||
description: `Retrieves a Page object using the ID specified.`,
|
||||
displayProperties: {
|
||||
title: "Get the page info for page id ${parameters.page_id}",
|
||||
},
|
||||
externalDocs: {
|
||||
description: "API method documentation",
|
||||
url: "https://developers.notion.com/reference/retrieve-a-page",
|
||||
},
|
||||
tags: ["pages"],
|
||||
},
|
||||
security: {
|
||||
oauth: [],
|
||||
},
|
||||
parameters: [
|
||||
PageIdParam,
|
||||
VersionHeaderParam,
|
||||
{
|
||||
name: "filter_properties",
|
||||
in: "query",
|
||||
description: "The properties to filter by",
|
||||
schema: {
|
||||
type: "array",
|
||||
items: {
|
||||
description: "The property to filter by",
|
||||
type: "string",
|
||||
},
|
||||
},
|
||||
required: false,
|
||||
},
|
||||
],
|
||||
request: {},
|
||||
responses: [
|
||||
{
|
||||
matches: ({ statusCode }) => statusCode >= 200 && statusCode < 300,
|
||||
success: true,
|
||||
name: "Success",
|
||||
description: "Typical success response",
|
||||
schema: GetPageResponse,
|
||||
},
|
||||
errorResponse,
|
||||
],
|
||||
};
|
||||
|
||||
export const createPage: EndpointSpec = {
|
||||
path: "/pages",
|
||||
method: "POST",
|
||||
metadata: {
|
||||
name: "createPage",
|
||||
description:
|
||||
"Creates a new page that is a child of an existing page or database. If the parent is a page then `title` is the only valid property. If the parent is a database then the `properties` must match the parent database's properties.",
|
||||
displayProperties: {
|
||||
title: "Create a page",
|
||||
},
|
||||
externalDocs: {
|
||||
description: "API method documentation",
|
||||
url: "https://developers.notion.com/reference/post-page",
|
||||
},
|
||||
tags: ["pages"],
|
||||
},
|
||||
security: {
|
||||
oauth: [],
|
||||
},
|
||||
parameters: [VersionHeaderParam],
|
||||
request: {
|
||||
headers: {
|
||||
"Content-Type": "application/json",
|
||||
},
|
||||
body: {
|
||||
schema: CreatePageParameters,
|
||||
},
|
||||
},
|
||||
responses: [
|
||||
{
|
||||
matches: ({ statusCode }) => statusCode >= 200 && statusCode < 300,
|
||||
success: true,
|
||||
name: "Success",
|
||||
description: "Typical success response",
|
||||
schema: CreatePageResponse,
|
||||
},
|
||||
errorResponse,
|
||||
],
|
||||
};
|
||||
|
||||
export const updatePage: EndpointSpec = {
|
||||
path: "/pages/{page_id}",
|
||||
method: "PATCH",
|
||||
metadata: {
|
||||
name: "updatePage",
|
||||
description:
|
||||
"Update a page icon, cover or archived status. You can update a database page's properties but the properties must match the parent database schema.",
|
||||
displayProperties: {
|
||||
title: "Update page ${parameters.page_id}",
|
||||
},
|
||||
externalDocs: {
|
||||
description: "API method documentation",
|
||||
url: "https://developers.notion.com/reference/patch-page",
|
||||
},
|
||||
tags: ["pages"],
|
||||
},
|
||||
security: {
|
||||
oauth: [],
|
||||
},
|
||||
parameters: [PageIdParam, VersionHeaderParam],
|
||||
request: {
|
||||
headers: {
|
||||
"Content-Type": "application/json",
|
||||
},
|
||||
body: {
|
||||
schema: UpdatePageBodyParameters,
|
||||
},
|
||||
},
|
||||
responses: [
|
||||
{
|
||||
matches: ({ statusCode }) => statusCode >= 200 && statusCode < 300,
|
||||
success: true,
|
||||
name: "Success",
|
||||
description: "Typical success response",
|
||||
schema: UpdatePageResponse,
|
||||
},
|
||||
errorResponse,
|
||||
],
|
||||
};
|
||||
|
||||
export const getBlock: EndpointSpec = {
|
||||
path: "/blocks/{block_id}",
|
||||
method: "GET",
|
||||
metadata: {
|
||||
name: "getBlock",
|
||||
description: `Retrieves a Block object using the ID specified. If a block contains the key has_children: true, use the Retrieve block children endpoint to get the list of children`,
|
||||
displayProperties: {
|
||||
title: "Get block for block id ${parameters.block_id}",
|
||||
},
|
||||
externalDocs: {
|
||||
description: "API method documentation",
|
||||
url: "https://developers.notion.com/reference/retrieve-a-block",
|
||||
},
|
||||
tags: ["blocks"],
|
||||
},
|
||||
security: {
|
||||
oauth: [],
|
||||
},
|
||||
parameters: [BlockIdParam, VersionHeaderParam],
|
||||
request: {},
|
||||
responses: [
|
||||
{
|
||||
matches: ({ statusCode }) => statusCode >= 200 && statusCode < 300,
|
||||
success: true,
|
||||
name: "Success",
|
||||
description: "Typical success response",
|
||||
schema: GetBlockResponse,
|
||||
},
|
||||
errorResponse,
|
||||
],
|
||||
};
|
||||
|
||||
export const updateBlock: EndpointSpec = {
|
||||
path: "/blocks/{block_id}",
|
||||
method: "PATCH",
|
||||
metadata: {
|
||||
name: "updateBlock",
|
||||
description:
|
||||
"Update a block Updates the content for the specified block_id based on the block type. Supported fields based on the block object type.",
|
||||
displayProperties: {
|
||||
title: "Update block ${parameters.block_id}",
|
||||
},
|
||||
externalDocs: {
|
||||
description: "API method documentation",
|
||||
url: "https://developers.notion.com/reference/update-a-block",
|
||||
},
|
||||
tags: ["blocks"],
|
||||
},
|
||||
security: {
|
||||
oauth: [],
|
||||
},
|
||||
parameters: [BlockIdParam, VersionHeaderParam],
|
||||
request: {
|
||||
headers: {
|
||||
"Content-Type": "application/json",
|
||||
},
|
||||
body: {
|
||||
schema: UpdateBlockBodyParameters,
|
||||
},
|
||||
},
|
||||
responses: [
|
||||
{
|
||||
matches: ({ statusCode }) => statusCode >= 200 && statusCode < 300,
|
||||
success: true,
|
||||
name: "Success",
|
||||
description: "Typical success response",
|
||||
schema: UpdateBlockResponse,
|
||||
},
|
||||
errorResponse,
|
||||
],
|
||||
};
|
||||
|
||||
export const getBlockChildren: EndpointSpec = {
|
||||
path: "/blocks/{block_id}/children",
|
||||
method: "GET",
|
||||
metadata: {
|
||||
name: "getBlockChildren",
|
||||
description: `Returns a paginated array of child block objects contained in the block using the ID specified. In order to receive a complete representation of a block, you may need to recursively retrieve the block children of child blocks.`,
|
||||
displayProperties: {
|
||||
title: "Get block children for block id ${parameters.block_id}",
|
||||
},
|
||||
externalDocs: {
|
||||
description: "API method documentation",
|
||||
url: "https://developers.notion.com/reference/get-block-children",
|
||||
},
|
||||
tags: ["blocks"],
|
||||
},
|
||||
security: {
|
||||
oauth: [],
|
||||
},
|
||||
parameters: [
|
||||
BlockIdParam,
|
||||
VersionHeaderParam,
|
||||
StartCursorParam,
|
||||
PageSizeParam,
|
||||
],
|
||||
request: {},
|
||||
responses: [
|
||||
{
|
||||
matches: ({ statusCode }) => statusCode >= 200 && statusCode < 300,
|
||||
success: true,
|
||||
name: "Success",
|
||||
description: "Typical success response",
|
||||
schema: ListBlockChildrenResponse,
|
||||
},
|
||||
errorResponse,
|
||||
],
|
||||
};
|
||||
|
||||
export const appendBlockChildren: EndpointSpec = {
|
||||
path: "/blocks/{block_id}/children",
|
||||
method: "PATCH",
|
||||
metadata: {
|
||||
name: "appendBlockChildren",
|
||||
description: `Creates and appends new children blocks to the parent block_id specified. Returns a paginated list of newly created first level children block objects.`,
|
||||
displayProperties: {
|
||||
title: "Append new blocks to parent block id ${parameters.block_id}",
|
||||
},
|
||||
externalDocs: {
|
||||
description: "API method documentation",
|
||||
url: "https://developers.notion.com/reference/patch-block-children",
|
||||
},
|
||||
tags: ["blocks"],
|
||||
},
|
||||
security: {
|
||||
oauth: [],
|
||||
},
|
||||
parameters: [BlockIdParam, VersionHeaderParam],
|
||||
request: {
|
||||
headers: {
|
||||
"Content-Type": "application/json",
|
||||
},
|
||||
body: {
|
||||
schema: AppendBlockChildrenBodyParameters,
|
||||
},
|
||||
},
|
||||
responses: [
|
||||
{
|
||||
matches: ({ statusCode }) => statusCode >= 200 && statusCode < 300,
|
||||
success: true,
|
||||
name: "Success",
|
||||
description: "Typical success response",
|
||||
schema: AppendBlockChildrenResponse,
|
||||
},
|
||||
errorResponse,
|
||||
],
|
||||
};
|
||||
|
||||
export const deleteBlock: EndpointSpec = {
|
||||
path: "/blocks/{block_id}",
|
||||
method: "DELETE",
|
||||
metadata: {
|
||||
name: "deleteBlock",
|
||||
description: `Sets a Block object, including page blocks, to archived: true using the ID specified. Note: in the Notion UI application, this moves the block to the "Trash" where it can still be accessed and restored.\n\nTo restore the block with the API, use the Update a block or Update page respectively.`,
|
||||
displayProperties: {
|
||||
title: "Delete block with block id ${parameters.block_id}",
|
||||
},
|
||||
externalDocs: {
|
||||
description: "API method documentation",
|
||||
url: "https://developers.notion.com/reference/delete-a-block",
|
||||
},
|
||||
tags: ["blocks"],
|
||||
},
|
||||
security: {
|
||||
oauth: [],
|
||||
},
|
||||
parameters: [BlockIdParam, VersionHeaderParam],
|
||||
request: {},
|
||||
responses: [
|
||||
{
|
||||
matches: ({ statusCode }) => statusCode >= 200 && statusCode < 300,
|
||||
success: true,
|
||||
name: "Success",
|
||||
description: "Typical success response",
|
||||
schema: DeleteBlockResponse,
|
||||
},
|
||||
errorResponse,
|
||||
],
|
||||
};
|
||||
|
||||
export const getDatabase: EndpointSpec = {
|
||||
path: "/databases/{database_id}",
|
||||
method: "GET",
|
||||
metadata: {
|
||||
name: "getDatabase",
|
||||
description: `Retrieves a Database object using the ID specified.\n\nNote that this won't get "Linked databases" (they have a ↗ next to the database title) – you need the source database id.`,
|
||||
displayProperties: {
|
||||
title: "Get database with id ${parameters.database_id}",
|
||||
},
|
||||
externalDocs: {
|
||||
description: "API method documentation",
|
||||
url: "https://developers.notion.com/reference/retrieve-a-database",
|
||||
},
|
||||
tags: ["database"],
|
||||
},
|
||||
security: {
|
||||
oauth: [],
|
||||
},
|
||||
parameters: [DatabaseIdParam, VersionHeaderParam],
|
||||
request: {},
|
||||
responses: [
|
||||
{
|
||||
matches: ({ statusCode }) => statusCode >= 200 && statusCode < 300,
|
||||
success: true,
|
||||
name: "Success",
|
||||
description: "Typical success response",
|
||||
schema: GetDatabaseResponse,
|
||||
},
|
||||
errorResponse,
|
||||
],
|
||||
};
|
||||
|
||||
export const queryDatabase: EndpointSpec = {
|
||||
path: "/databases/{database_id}/query",
|
||||
method: "POST",
|
||||
metadata: {
|
||||
name: "queryDatabase",
|
||||
description: `Gets a list of Pages contained in the database, filtered and ordered according to the filter conditions and sort criteria provided in the request. The response may contain fewer than page_size of results.`,
|
||||
displayProperties: {
|
||||
title: "Query database with id ${parameters.database_id}",
|
||||
},
|
||||
externalDocs: {
|
||||
description: "API method documentation",
|
||||
url: "https://developers.notion.com/reference/post-database-query",
|
||||
},
|
||||
tags: ["database"],
|
||||
},
|
||||
security: {
|
||||
oauth: [],
|
||||
},
|
||||
parameters: [
|
||||
DatabaseIdParam,
|
||||
VersionHeaderParam,
|
||||
{
|
||||
name: "filter_properties",
|
||||
in: "query",
|
||||
description:
|
||||
"The list of database properties you want to receive back in the responses – you need to provide ids",
|
||||
schema: {
|
||||
type: "array",
|
||||
items: {
|
||||
type: "string",
|
||||
},
|
||||
},
|
||||
},
|
||||
],
|
||||
request: {
|
||||
headers: {
|
||||
"Content-Type": "application/json",
|
||||
},
|
||||
body: {
|
||||
schema: QueryDatabaseBodyParameters,
|
||||
},
|
||||
},
|
||||
responses: [
|
||||
{
|
||||
matches: ({ statusCode }) => statusCode >= 200 && statusCode < 300,
|
||||
success: true,
|
||||
name: "Success",
|
||||
description: "Typical success response",
|
||||
schema: QueryDatabaseResponse,
|
||||
},
|
||||
errorResponse,
|
||||
],
|
||||
};
|
||||
|
||||
export const createDatabase: EndpointSpec = {
|
||||
path: "/databases",
|
||||
method: "POST",
|
||||
metadata: {
|
||||
name: "createDatabase",
|
||||
description: `Creates a database as a subpage in the specified parent page, with the specified properties schema.`,
|
||||
displayProperties: {
|
||||
title: "Create database",
|
||||
},
|
||||
externalDocs: {
|
||||
description: "API method documentation",
|
||||
url: "https://developers.notion.com/reference/create-a-database",
|
||||
},
|
||||
tags: ["database"],
|
||||
},
|
||||
security: {
|
||||
oauth: [],
|
||||
},
|
||||
parameters: [VersionHeaderParam],
|
||||
request: {
|
||||
headers: {
|
||||
"Content-Type": "application/json",
|
||||
},
|
||||
body: {
|
||||
schema: CreateDatabaseBodyParameters,
|
||||
},
|
||||
},
|
||||
responses: [
|
||||
{
|
||||
matches: ({ statusCode }) => statusCode >= 200 && statusCode < 300,
|
||||
success: true,
|
||||
name: "Success",
|
||||
description: "Typical success response",
|
||||
schema: CreateDatabaseResponse,
|
||||
},
|
||||
errorResponse,
|
||||
],
|
||||
};
|
||||
|
||||
export const updateDatabase: EndpointSpec = {
|
||||
path: "/databases/{database_id}",
|
||||
method: "PATCH",
|
||||
metadata: {
|
||||
name: "updateDatabase",
|
||||
description: `Update the title, description, or properties of a specified database. Sending a request with a properties body param changes the columns of a database. To update a row rather than a column, query the Update page endpoint. To add a new row to a database, call Create a page.`,
|
||||
displayProperties: {
|
||||
title: "Update database with id ${parameters.database_id}",
|
||||
},
|
||||
externalDocs: {
|
||||
description: "API method documentation",
|
||||
url: "https://developers.notion.com/reference/update-a-database",
|
||||
},
|
||||
tags: ["database"],
|
||||
},
|
||||
security: {
|
||||
oauth: [],
|
||||
},
|
||||
parameters: [DatabaseIdParam, VersionHeaderParam],
|
||||
request: {
|
||||
headers: {
|
||||
"Content-Type": "application/json",
|
||||
},
|
||||
body: {
|
||||
schema: UpdateDatabaseBodyParameters,
|
||||
},
|
||||
},
|
||||
responses: [
|
||||
{
|
||||
matches: ({ statusCode }) => statusCode >= 200 && statusCode < 300,
|
||||
success: true,
|
||||
name: "Success",
|
||||
description: "Typical success response",
|
||||
schema: UpdateDatabaseResponse,
|
||||
},
|
||||
errorResponse,
|
||||
],
|
||||
};
|
||||
|
||||
export const getComments: EndpointSpec = {
|
||||
path: "/comments",
|
||||
method: "GET",
|
||||
metadata: {
|
||||
name: "getComments",
|
||||
description: `Retrieves a list of un-resolved Comment objects from a page or block.`,
|
||||
displayProperties: {
|
||||
title: "Get comments for block id ${parameters.block_id}",
|
||||
},
|
||||
externalDocs: {
|
||||
description: "API method documentation",
|
||||
url: "https://developers.notion.com/reference/retrieve-a-comment",
|
||||
},
|
||||
tags: ["comments"],
|
||||
},
|
||||
security: {
|
||||
oauth: [],
|
||||
},
|
||||
parameters: [
|
||||
{
|
||||
name: "block_id",
|
||||
in: "query",
|
||||
description: "ID of the block",
|
||||
schema: {
|
||||
type: "string",
|
||||
},
|
||||
required: true,
|
||||
},
|
||||
StartCursorParam,
|
||||
PageSizeParam,
|
||||
VersionHeaderParam,
|
||||
],
|
||||
request: {},
|
||||
responses: [
|
||||
{
|
||||
matches: ({ statusCode }) => statusCode >= 200 && statusCode < 300,
|
||||
success: true,
|
||||
name: "Success",
|
||||
description: "Typical success response",
|
||||
schema: ListCommentsResponse,
|
||||
},
|
||||
errorResponse,
|
||||
],
|
||||
};
|
||||
|
||||
export const createComment: EndpointSpec = {
|
||||
path: "/comments",
|
||||
method: "POST",
|
||||
metadata: {
|
||||
name: "createComment",
|
||||
description: `Creates a comment in a page or existing discussion thread. There are two locations you can add a new comment to:\n1. A page\n2.An existing discussion thread\n If the intention is to add a new comment to a page, a parent object must be provided in the body params. Alternatively, if a new comment is being added to an existing discussion thread, the discussion_id string must be provided in the body params. Exactly one of these parameters must be provided.`,
|
||||
displayProperties: {
|
||||
title: "Create comment",
|
||||
},
|
||||
externalDocs: {
|
||||
description: "API method documentation",
|
||||
url: "https://developers.notion.com/reference/create-a-comment",
|
||||
},
|
||||
tags: ["comments"],
|
||||
},
|
||||
security: {
|
||||
oauth: [],
|
||||
},
|
||||
parameters: [VersionHeaderParam],
|
||||
request: {
|
||||
headers: {
|
||||
"Content-Type": "application/json",
|
||||
},
|
||||
body: {
|
||||
schema: CreateCommentBodyParameters,
|
||||
},
|
||||
},
|
||||
responses: [
|
||||
{
|
||||
matches: ({ statusCode }) => statusCode >= 200 && statusCode < 300,
|
||||
success: true,
|
||||
name: "Success",
|
||||
description: "Typical success response",
|
||||
schema: CreateCommentResponse,
|
||||
},
|
||||
errorResponse,
|
||||
],
|
||||
};
|
||||
|
||||
export const search: EndpointSpec = {
|
||||
path: "/search",
|
||||
method: "POST",
|
||||
metadata: {
|
||||
name: "search",
|
||||
description: `Searches all original pages, databases, and child pages/databases that are shared with the integration. It will not return linked databases, since these duplicate their source databases.`,
|
||||
displayProperties: {
|
||||
title: "Search for ${body.query}",
|
||||
},
|
||||
externalDocs: {
|
||||
description: "API method documentation",
|
||||
url: "https://developers.notion.com/reference/post-search",
|
||||
},
|
||||
tags: ["search"],
|
||||
},
|
||||
security: {
|
||||
oauth: [],
|
||||
},
|
||||
parameters: [VersionHeaderParam],
|
||||
request: {
|
||||
body: {
|
||||
schema: SearchParameters,
|
||||
},
|
||||
},
|
||||
responses: [
|
||||
{
|
||||
matches: ({ statusCode }) => statusCode >= 200 && statusCode < 300,
|
||||
success: true,
|
||||
name: "Success",
|
||||
description: "Typical success response",
|
||||
schema: SearchResponse,
|
||||
},
|
||||
errorResponse,
|
||||
],
|
||||
};
|
||||
@@ -0,0 +1,14 @@
|
||||
import { Service } from "core/service/types";
|
||||
import { authentication } from "./authentication";
|
||||
import actions from "./actions/actions";
|
||||
|
||||
export const notion: Service = {
|
||||
name: "Notion",
|
||||
service: "notion",
|
||||
version: "0.1.22",
|
||||
baseUrl: "https://api.notion.com",
|
||||
live: true,
|
||||
authentication,
|
||||
actions,
|
||||
retryableStatusCodes: [408, 429, 500, 502, 503, 504],
|
||||
};
|
||||
@@ -0,0 +1,568 @@
|
||||
import { startNock, stopNock } from "testing/nock";
|
||||
import { describe, expect, test } from "vitest";
|
||||
import endpoints from "../endpoints/endpoints";
|
||||
const authToken = () => process.env.NOTION_API_KEY ?? "";
|
||||
|
||||
const notionVersion = "2022-06-28";
|
||||
|
||||
describe("notion.endpoints", async () => {
|
||||
test("getUser", async () => {
|
||||
const accessToken = authToken();
|
||||
|
||||
const nockDone = await startNock("notion.getUser");
|
||||
const data = await endpoints.getUser.request({
|
||||
parameters: {
|
||||
user_id: "cc18a80a-973f-42c4-8fed-a055f8ae31f4",
|
||||
"Notion-Version": notionVersion,
|
||||
},
|
||||
credentials: {
|
||||
type: "oauth2",
|
||||
name: "oauth",
|
||||
accessToken,
|
||||
scopes: [""],
|
||||
},
|
||||
});
|
||||
|
||||
expect(data.status).toEqual(200);
|
||||
expect(data.success).toEqual(true);
|
||||
expect(data.body).not.toBeNull();
|
||||
stopNock(nockDone);
|
||||
});
|
||||
|
||||
test("listUsers (first page)", async () => {
|
||||
const accessToken = authToken();
|
||||
|
||||
const nockDone = await startNock("notion.listUsers.firstPage");
|
||||
const data = await endpoints.listUsers.request({
|
||||
parameters: {
|
||||
"Notion-Version": notionVersion,
|
||||
},
|
||||
credentials: {
|
||||
type: "oauth2",
|
||||
name: "oauth",
|
||||
accessToken,
|
||||
scopes: [""],
|
||||
},
|
||||
});
|
||||
|
||||
expect(data.status).toEqual(200);
|
||||
expect(data.success).toEqual(true);
|
||||
expect(data.body).not.toBeNull();
|
||||
stopNock(nockDone);
|
||||
});
|
||||
|
||||
test("getBotInfo", async () => {
|
||||
const accessToken = authToken();
|
||||
|
||||
const nockDone = await startNock("notion.getBotInfo");
|
||||
const data = await endpoints.getBotInfo.request({
|
||||
parameters: {
|
||||
"Notion-Version": notionVersion,
|
||||
},
|
||||
credentials: {
|
||||
type: "oauth2",
|
||||
name: "oauth",
|
||||
accessToken,
|
||||
scopes: [""],
|
||||
},
|
||||
});
|
||||
|
||||
expect(data.status).toEqual(200);
|
||||
expect(data.success).toEqual(true);
|
||||
expect(data.body).not.toBeNull();
|
||||
stopNock(nockDone);
|
||||
});
|
||||
|
||||
test("getPage", async () => {
|
||||
const accessToken = authToken();
|
||||
|
||||
const nockDone = await startNock("notion.getPage");
|
||||
const data = await endpoints.getPage.request({
|
||||
parameters: {
|
||||
"Notion-Version": notionVersion,
|
||||
page_id: "b4609033-b45a-4fc6-8d15-f06920495ab1",
|
||||
},
|
||||
credentials: {
|
||||
type: "oauth2",
|
||||
name: "oauth",
|
||||
accessToken,
|
||||
scopes: [""],
|
||||
},
|
||||
});
|
||||
|
||||
expect(data.status).toEqual(200);
|
||||
expect(data.success).toEqual(true);
|
||||
expect(data.body).not.toBeNull();
|
||||
stopNock(nockDone);
|
||||
});
|
||||
|
||||
test("createPage (page parent)", async () => {
|
||||
const accessToken = authToken();
|
||||
|
||||
const nockDone = await startNock("notion.createPage.pageParent");
|
||||
const data = await endpoints.createPage.request({
|
||||
parameters: {
|
||||
"Notion-Version": notionVersion,
|
||||
},
|
||||
body: {
|
||||
parent: {
|
||||
type: "page_id",
|
||||
page_id: "b4609033-b45a-4fc6-8d15-f06920495ab1",
|
||||
},
|
||||
properties: {
|
||||
title: {
|
||||
title: [
|
||||
{
|
||||
type: "text",
|
||||
text: {
|
||||
content: "Test page",
|
||||
},
|
||||
},
|
||||
],
|
||||
},
|
||||
},
|
||||
},
|
||||
credentials: {
|
||||
type: "oauth2",
|
||||
name: "oauth",
|
||||
accessToken,
|
||||
scopes: [""],
|
||||
},
|
||||
});
|
||||
|
||||
expect(data.status).toEqual(200);
|
||||
expect(data.success).toEqual(true);
|
||||
expect(data.body).not.toBeNull();
|
||||
stopNock(nockDone);
|
||||
});
|
||||
|
||||
test("updatePage (page parent)", async () => {
|
||||
const accessToken = authToken();
|
||||
|
||||
const nockDone = await startNock("notion.updatePage.pageParent");
|
||||
const data = await endpoints.updatePage.request({
|
||||
parameters: {
|
||||
page_id: "b4609033-b45a-4fc6-8d15-f06920495ab1",
|
||||
"Notion-Version": notionVersion,
|
||||
},
|
||||
body: {
|
||||
icon: {
|
||||
emoji: "🦸♀️",
|
||||
},
|
||||
},
|
||||
credentials: {
|
||||
type: "oauth2",
|
||||
name: "oauth",
|
||||
accessToken,
|
||||
scopes: [""],
|
||||
},
|
||||
});
|
||||
|
||||
expect(data.status).toEqual(200);
|
||||
expect(data.success).toEqual(true);
|
||||
expect(data.body).not.toBeNull();
|
||||
stopNock(nockDone);
|
||||
});
|
||||
|
||||
test("getBlock", async () => {
|
||||
const accessToken = authToken();
|
||||
|
||||
const nockDone = await startNock("notion.getBlock");
|
||||
const data = await endpoints.getBlock.request({
|
||||
parameters: {
|
||||
block_id: "b4609033-b45a-4fc6-8d15-f06920495ab1",
|
||||
"Notion-Version": notionVersion,
|
||||
},
|
||||
credentials: {
|
||||
type: "oauth2",
|
||||
name: "oauth",
|
||||
accessToken,
|
||||
scopes: [""],
|
||||
},
|
||||
});
|
||||
|
||||
expect(data.status).toEqual(200);
|
||||
expect(data.success).toEqual(true);
|
||||
expect(data.body).not.toBeNull();
|
||||
stopNock(nockDone);
|
||||
});
|
||||
|
||||
test("getBlockChildren", async () => {
|
||||
const accessToken = authToken();
|
||||
|
||||
const nockDone = await startNock("notion.getBlockChildren");
|
||||
const data = await endpoints.getBlockChildren.request({
|
||||
parameters: {
|
||||
block_id: "b4609033-b45a-4fc6-8d15-f06920495ab1",
|
||||
"Notion-Version": notionVersion,
|
||||
},
|
||||
credentials: {
|
||||
type: "oauth2",
|
||||
name: "oauth",
|
||||
accessToken,
|
||||
scopes: [""],
|
||||
},
|
||||
});
|
||||
|
||||
expect(data.status).toEqual(200);
|
||||
expect(data.success).toEqual(true);
|
||||
expect(data.body).not.toBeNull();
|
||||
stopNock(nockDone);
|
||||
});
|
||||
|
||||
test("updateBlock", async () => {
|
||||
const accessToken = authToken();
|
||||
|
||||
const nockDone = await startNock("notion.updateBlock");
|
||||
const data = await endpoints.updateBlock.request({
|
||||
parameters: {
|
||||
block_id: "2675c67d-392a-4b86-86f6-93de22c797bd",
|
||||
"Notion-Version": notionVersion,
|
||||
},
|
||||
body: {
|
||||
paragraph: {
|
||||
rich_text: [
|
||||
{
|
||||
type: "text",
|
||||
text: {
|
||||
content:
|
||||
"This update comes from the Trigger.dev Notion integration test suite. 🎉",
|
||||
},
|
||||
},
|
||||
],
|
||||
},
|
||||
},
|
||||
credentials: {
|
||||
type: "oauth2",
|
||||
name: "oauth",
|
||||
accessToken,
|
||||
scopes: [""],
|
||||
},
|
||||
});
|
||||
|
||||
expect(data.status).toEqual(200);
|
||||
expect(data.success).toEqual(true);
|
||||
expect(data.body).not.toBeNull();
|
||||
stopNock(nockDone);
|
||||
});
|
||||
|
||||
test("appendBlockChildren", async () => {
|
||||
const accessToken = authToken();
|
||||
|
||||
const nockDone = await startNock("notion.appendBlockChildren");
|
||||
const data = await endpoints.appendBlockChildren.request({
|
||||
parameters: {
|
||||
block_id: "b4609033-b45a-4fc6-8d15-f06920495ab1",
|
||||
"Notion-Version": notionVersion,
|
||||
},
|
||||
body: {
|
||||
children: [
|
||||
{
|
||||
heading_1: {
|
||||
rich_text: [
|
||||
{
|
||||
type: "text",
|
||||
text: {
|
||||
content:
|
||||
"This new title is appended using appendBlockChildren()",
|
||||
},
|
||||
},
|
||||
],
|
||||
},
|
||||
},
|
||||
],
|
||||
},
|
||||
credentials: {
|
||||
type: "oauth2",
|
||||
name: "oauth",
|
||||
accessToken,
|
||||
scopes: [""],
|
||||
},
|
||||
});
|
||||
|
||||
expect(data.status).toEqual(200);
|
||||
expect(data.success).toEqual(true);
|
||||
expect(data.body).not.toBeNull();
|
||||
stopNock(nockDone);
|
||||
});
|
||||
|
||||
test("deleteBlock", async () => {
|
||||
const accessToken = authToken();
|
||||
|
||||
const nockDone = await startNock("notion.deleteBlock");
|
||||
const data = await endpoints.deleteBlock.request({
|
||||
parameters: {
|
||||
block_id: "4c946f30-ebc2-4eed-bfbc-094226ae9659",
|
||||
"Notion-Version": notionVersion,
|
||||
},
|
||||
credentials: {
|
||||
type: "oauth2",
|
||||
name: "oauth",
|
||||
accessToken,
|
||||
scopes: [""],
|
||||
},
|
||||
});
|
||||
|
||||
expect(data.status).toEqual(200);
|
||||
expect(data.success).toEqual(true);
|
||||
expect(data.body).not.toBeNull();
|
||||
stopNock(nockDone);
|
||||
});
|
||||
|
||||
test("getDatabase", async () => {
|
||||
const accessToken = authToken();
|
||||
|
||||
const nockDone = await startNock("notion.getDatabase");
|
||||
const data = await endpoints.getDatabase.request({
|
||||
parameters: {
|
||||
database_id: "0fadc732-4472-418c-83dc-04454332cb52",
|
||||
"Notion-Version": notionVersion,
|
||||
},
|
||||
credentials: {
|
||||
type: "oauth2",
|
||||
name: "oauth",
|
||||
accessToken,
|
||||
scopes: [""],
|
||||
},
|
||||
});
|
||||
|
||||
expect(data.status).toEqual(200);
|
||||
expect(data.success).toEqual(true);
|
||||
expect(data.body).not.toBeNull();
|
||||
stopNock(nockDone);
|
||||
});
|
||||
|
||||
test("queryDatabase", async () => {
|
||||
const accessToken = authToken();
|
||||
|
||||
const nockDone = await startNock("notion.queryDatabase");
|
||||
const data = await endpoints.queryDatabase.request({
|
||||
parameters: {
|
||||
database_id: "0fadc732-4472-418c-83dc-04454332cb52",
|
||||
"Notion-Version": notionVersion,
|
||||
},
|
||||
body: {},
|
||||
credentials: {
|
||||
type: "oauth2",
|
||||
name: "oauth",
|
||||
accessToken,
|
||||
scopes: [""],
|
||||
},
|
||||
});
|
||||
|
||||
expect(data.status).toEqual(200);
|
||||
expect(data.success).toEqual(true);
|
||||
expect(data.body).not.toBeNull();
|
||||
stopNock(nockDone);
|
||||
});
|
||||
|
||||
test("createDatabase", async () => {
|
||||
const accessToken = authToken();
|
||||
|
||||
const nockDone = await startNock("notion.createDatabase");
|
||||
const data = await endpoints.createDatabase.request({
|
||||
parameters: {
|
||||
"Notion-Version": notionVersion,
|
||||
},
|
||||
body: {
|
||||
parent: {
|
||||
type: "page_id",
|
||||
page_id: "b4609033-b45a-4fc6-8d15-f06920495ab1",
|
||||
},
|
||||
icon: {
|
||||
type: "emoji",
|
||||
emoji: "📝",
|
||||
},
|
||||
title: [
|
||||
{
|
||||
type: "text",
|
||||
text: {
|
||||
content: "Trigger.dev created db",
|
||||
link: null,
|
||||
},
|
||||
},
|
||||
],
|
||||
properties: {
|
||||
Name: {
|
||||
title: {},
|
||||
},
|
||||
Description: {
|
||||
rich_text: {},
|
||||
},
|
||||
"In stock": {
|
||||
checkbox: {},
|
||||
},
|
||||
"+1": {
|
||||
people: {},
|
||||
},
|
||||
Photo: {
|
||||
files: {},
|
||||
},
|
||||
},
|
||||
},
|
||||
credentials: {
|
||||
type: "oauth2",
|
||||
name: "oauth",
|
||||
accessToken,
|
||||
scopes: [""],
|
||||
},
|
||||
});
|
||||
|
||||
expect(data.status).toEqual(200);
|
||||
expect(data.success).toEqual(true);
|
||||
expect(data.body).not.toBeNull();
|
||||
stopNock(nockDone);
|
||||
});
|
||||
|
||||
test("updateDatabase", async () => {
|
||||
const accessToken = authToken();
|
||||
|
||||
const nockDone = await startNock("notion.updateDatabase");
|
||||
const data = await endpoints.updateDatabase.request({
|
||||
parameters: {
|
||||
"Notion-Version": notionVersion,
|
||||
database_id: "8db50793-ac53-496b-bbff-a74be0fb78b4",
|
||||
},
|
||||
body: {
|
||||
title: [
|
||||
{
|
||||
text: {
|
||||
content: "Trigger.dev updated db title",
|
||||
},
|
||||
},
|
||||
],
|
||||
description: [
|
||||
{
|
||||
text: {
|
||||
content: "This is an updated description",
|
||||
},
|
||||
},
|
||||
],
|
||||
properties: {
|
||||
"+1": null,
|
||||
Photo: {
|
||||
url: {},
|
||||
},
|
||||
"Store availability": {
|
||||
multi_select: {
|
||||
options: [
|
||||
{
|
||||
name: "Duc Loi Market",
|
||||
},
|
||||
{
|
||||
name: "Rainbow Grocery",
|
||||
},
|
||||
{
|
||||
name: "Gus'''s Community Market",
|
||||
},
|
||||
{
|
||||
name: "The Good Life Grocery",
|
||||
color: "orange",
|
||||
},
|
||||
],
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
credentials: {
|
||||
type: "oauth2",
|
||||
name: "oauth",
|
||||
accessToken,
|
||||
scopes: [""],
|
||||
},
|
||||
});
|
||||
|
||||
expect(data.status).toEqual(200);
|
||||
expect(data.success).toEqual(true);
|
||||
expect(data.body).not.toBeNull();
|
||||
stopNock(nockDone);
|
||||
});
|
||||
|
||||
test("getComments", async () => {
|
||||
const accessToken = authToken();
|
||||
|
||||
const nockDone = await startNock("notion.getComments");
|
||||
const data = await endpoints.getComments.request({
|
||||
parameters: {
|
||||
block_id: "b4609033-b45a-4fc6-8d15-f06920495ab1",
|
||||
"Notion-Version": notionVersion,
|
||||
},
|
||||
credentials: {
|
||||
type: "oauth2",
|
||||
name: "oauth",
|
||||
accessToken,
|
||||
scopes: [""],
|
||||
},
|
||||
});
|
||||
|
||||
expect(data.status).toEqual(200);
|
||||
expect(data.success).toEqual(true);
|
||||
expect(data.body).not.toBeNull();
|
||||
stopNock(nockDone);
|
||||
});
|
||||
|
||||
test("createComment", async () => {
|
||||
const accessToken = authToken();
|
||||
|
||||
const nockDone = await startNock("notion.createComment");
|
||||
const data = await endpoints.createComment.request({
|
||||
parameters: {
|
||||
"Notion-Version": notionVersion,
|
||||
},
|
||||
body: {
|
||||
parent: {
|
||||
type: "page_id",
|
||||
page_id: "b4609033-b45a-4fc6-8d15-f06920495ab1",
|
||||
},
|
||||
rich_text: [
|
||||
{
|
||||
text: {
|
||||
content: "Hello world",
|
||||
},
|
||||
},
|
||||
],
|
||||
},
|
||||
credentials: {
|
||||
type: "oauth2",
|
||||
name: "oauth",
|
||||
accessToken,
|
||||
scopes: [""],
|
||||
},
|
||||
});
|
||||
|
||||
expect(data.status).toEqual(200);
|
||||
expect(data.success).toEqual(true);
|
||||
expect(data.body).not.toBeNull();
|
||||
stopNock(nockDone);
|
||||
});
|
||||
|
||||
test("search (only pages)", async () => {
|
||||
const accessToken = authToken();
|
||||
|
||||
const nockDone = await startNock("notion.search.pages");
|
||||
const data = await endpoints.search.request({
|
||||
parameters: {
|
||||
"Notion-Version": notionVersion,
|
||||
},
|
||||
body: {
|
||||
query: "Notion test page",
|
||||
page_size: 1,
|
||||
filter: {
|
||||
property: "object",
|
||||
value: "page",
|
||||
},
|
||||
},
|
||||
credentials: {
|
||||
type: "oauth2",
|
||||
name: "oauth",
|
||||
accessToken,
|
||||
scopes: [""],
|
||||
},
|
||||
});
|
||||
|
||||
expect(data.status).toEqual(200);
|
||||
expect(data.success).toEqual(true);
|
||||
expect(data.body).not.toBeNull();
|
||||
stopNock(nockDone);
|
||||
});
|
||||
});
|
||||
@@ -1,4 +1,4 @@
|
||||
import { EndpointSpec } from "core/endpoint/types";
|
||||
import { EndpointSpec, EndpointSpecResponse } from "core/endpoint/types";
|
||||
import {
|
||||
CCBCCEmailObjectSchema,
|
||||
ContactRequestSchema,
|
||||
@@ -8,14 +8,17 @@ import {
|
||||
ToEmailArraySchema,
|
||||
} from "../common/schemas";
|
||||
|
||||
const defaultResponses = [
|
||||
const defaultResponses: EndpointSpecResponse[] = [
|
||||
{
|
||||
matches: ({ statusCode, body }) =>
|
||||
(statusCode < 200 || statusCode >= 300) && body != null,
|
||||
success: false,
|
||||
name: "Error",
|
||||
description: "error response",
|
||||
schema: ErrorSchema,
|
||||
},
|
||||
{
|
||||
matches: ({ statusCode }) => statusCode < 200 || statusCode >= 300,
|
||||
success: false,
|
||||
name: "Error",
|
||||
description: "No body error response",
|
||||
@@ -454,17 +457,16 @@ export const mailSend: EndpointSpec = {
|
||||
},
|
||||
},
|
||||
},
|
||||
responses: {
|
||||
"20x": [
|
||||
{
|
||||
success: true,
|
||||
name: "Success",
|
||||
description: "Successful response",
|
||||
schema: undefined,
|
||||
},
|
||||
],
|
||||
default: defaultResponses,
|
||||
},
|
||||
responses: [
|
||||
{
|
||||
matches: ({ statusCode }) => statusCode >= 200 && statusCode < 300,
|
||||
success: true,
|
||||
name: "Success",
|
||||
description: "Successful response",
|
||||
schema: undefined,
|
||||
},
|
||||
...defaultResponses,
|
||||
],
|
||||
};
|
||||
|
||||
export const marketingContacts: EndpointSpec = {
|
||||
@@ -517,24 +519,23 @@ export const marketingContacts: EndpointSpec = {
|
||||
},
|
||||
},
|
||||
},
|
||||
responses: {
|
||||
"20x": [
|
||||
{
|
||||
success: true,
|
||||
name: "Success",
|
||||
description: "Successful response",
|
||||
schema: {
|
||||
type: "object",
|
||||
properties: {
|
||||
job_id: {
|
||||
type: "string",
|
||||
description:
|
||||
'Indicates that the contacts are queued for processing. Check the job status with the "Import Contacts Status" endpoint.',
|
||||
},
|
||||
responses: [
|
||||
{
|
||||
matches: ({ statusCode }) => statusCode >= 200 && statusCode < 300,
|
||||
success: true,
|
||||
name: "Success",
|
||||
description: "Successful response",
|
||||
schema: {
|
||||
type: "object",
|
||||
properties: {
|
||||
job_id: {
|
||||
type: "string",
|
||||
description:
|
||||
'Indicates that the contacts are queued for processing. Check the job status with the "Import Contacts Status" endpoint.',
|
||||
},
|
||||
},
|
||||
},
|
||||
],
|
||||
default: defaultResponses,
|
||||
},
|
||||
},
|
||||
...defaultResponses,
|
||||
],
|
||||
};
|
||||
|
||||
@@ -3,6 +3,7 @@ import { schemaFromOpenApiSpecV2 } from "core/schemas/openApi";
|
||||
import { spec } from "./schemas/spec";
|
||||
|
||||
const errorResponse: EndpointSpecResponse = {
|
||||
matches: ({ statusCode, body }) => statusCode !== 200 || !body.ok,
|
||||
success: false,
|
||||
name: "Error",
|
||||
description: "200 error response",
|
||||
@@ -126,95 +127,73 @@ export const chatPostMessage: EndpointSpec = {
|
||||
},
|
||||
},
|
||||
},
|
||||
responses: {
|
||||
200: [
|
||||
{
|
||||
success: true,
|
||||
name: "Success",
|
||||
description: "Typical success response",
|
||||
schema: {
|
||||
type: "object",
|
||||
properties: {
|
||||
channel: {
|
||||
description: "Channel ID where the message was posted",
|
||||
type: "string",
|
||||
},
|
||||
message: {
|
||||
type: "object",
|
||||
properties: {
|
||||
attachments: {
|
||||
type: "array",
|
||||
items: {
|
||||
type: "object",
|
||||
properties: {
|
||||
fallback: {
|
||||
type: "string",
|
||||
},
|
||||
id: {
|
||||
type: "number",
|
||||
},
|
||||
text: {
|
||||
type: "string",
|
||||
},
|
||||
responses: [
|
||||
{
|
||||
matches: ({ statusCode, body }) => statusCode === 200 && body.ok,
|
||||
success: true,
|
||||
name: "Success",
|
||||
description: "Typical success response",
|
||||
schema: {
|
||||
type: "object",
|
||||
properties: {
|
||||
channel: {
|
||||
description: "Channel ID where the message was posted",
|
||||
type: "string",
|
||||
},
|
||||
message: {
|
||||
type: "object",
|
||||
properties: {
|
||||
attachments: {
|
||||
type: "array",
|
||||
items: {
|
||||
type: "object",
|
||||
properties: {
|
||||
fallback: {
|
||||
type: "string",
|
||||
},
|
||||
id: {
|
||||
type: "number",
|
||||
},
|
||||
text: {
|
||||
type: "string",
|
||||
},
|
||||
required: ["fallback", "id", "text"],
|
||||
},
|
||||
},
|
||||
bot_id: {
|
||||
type: "string",
|
||||
},
|
||||
subtype: {
|
||||
type: "string",
|
||||
},
|
||||
text: {
|
||||
type: "string",
|
||||
},
|
||||
ts: {
|
||||
type: "string",
|
||||
},
|
||||
type: {
|
||||
type: "string",
|
||||
},
|
||||
user: {
|
||||
type: "string",
|
||||
required: ["fallback", "id", "text"],
|
||||
},
|
||||
},
|
||||
required: ["bot_id", "text", "ts", "type"],
|
||||
},
|
||||
ok: {
|
||||
type: "boolean",
|
||||
},
|
||||
ts: {
|
||||
type: "string",
|
||||
bot_id: {
|
||||
type: "string",
|
||||
},
|
||||
subtype: {
|
||||
type: "string",
|
||||
},
|
||||
text: {
|
||||
type: "string",
|
||||
},
|
||||
ts: {
|
||||
type: "string",
|
||||
},
|
||||
type: {
|
||||
type: "string",
|
||||
},
|
||||
user: {
|
||||
type: "string",
|
||||
},
|
||||
},
|
||||
required: ["bot_id", "text", "ts", "type"],
|
||||
},
|
||||
required: ["channel", "message", "ok", "ts"],
|
||||
},
|
||||
},
|
||||
errorResponse,
|
||||
],
|
||||
default: [
|
||||
{
|
||||
success: false,
|
||||
name: "Error",
|
||||
description:
|
||||
"Typical error response if too many attachments are included",
|
||||
schema: {
|
||||
description: "Schema for error response chat.postMessage method",
|
||||
type: "object",
|
||||
properties: {
|
||||
error: {
|
||||
type: "string",
|
||||
},
|
||||
ok: {
|
||||
type: "boolean",
|
||||
},
|
||||
ok: {
|
||||
type: "boolean",
|
||||
},
|
||||
ts: {
|
||||
type: "string",
|
||||
},
|
||||
required: ["error", "ok"],
|
||||
},
|
||||
required: ["channel", "message", "ok", "ts"],
|
||||
},
|
||||
],
|
||||
},
|
||||
},
|
||||
errorResponse,
|
||||
],
|
||||
};
|
||||
|
||||
export const conversationsList: EndpointSpec = {
|
||||
@@ -273,29 +252,27 @@ export const conversationsList: EndpointSpec = {
|
||||
},
|
||||
],
|
||||
request: {},
|
||||
responses: {
|
||||
200: [
|
||||
{
|
||||
success: true,
|
||||
name: "Success",
|
||||
schema: schemaFromOpenApiSpecV2(
|
||||
spec,
|
||||
"/paths//conversations.list/get/responses/200/schema"
|
||||
),
|
||||
},
|
||||
errorResponse,
|
||||
],
|
||||
default: [
|
||||
{
|
||||
success: false,
|
||||
name: "Error",
|
||||
schema: schemaFromOpenApiSpecV2(
|
||||
spec,
|
||||
"/paths//conversations.list/get/responses/default/schema"
|
||||
),
|
||||
},
|
||||
],
|
||||
},
|
||||
responses: [
|
||||
{
|
||||
matches: ({ statusCode, body }) => statusCode === 200 && body.ok,
|
||||
success: true,
|
||||
name: "Success",
|
||||
schema: schemaFromOpenApiSpecV2(
|
||||
spec,
|
||||
"/paths//conversations.list/get/responses/200/schema"
|
||||
),
|
||||
},
|
||||
errorResponse,
|
||||
{
|
||||
matches: () => true,
|
||||
success: false,
|
||||
name: "Error",
|
||||
schema: schemaFromOpenApiSpecV2(
|
||||
spec,
|
||||
"/paths//conversations.list/get/responses/default/schema"
|
||||
),
|
||||
},
|
||||
],
|
||||
};
|
||||
|
||||
export const conversationsJoin: EndpointSpec = {
|
||||
@@ -333,27 +310,25 @@ export const conversationsJoin: EndpointSpec = {
|
||||
},
|
||||
},
|
||||
},
|
||||
responses: {
|
||||
200: [
|
||||
{
|
||||
success: true,
|
||||
name: "Success",
|
||||
schema: schemaFromOpenApiSpecV2(
|
||||
spec,
|
||||
"/paths//conversations.join/post/responses/200/schema"
|
||||
),
|
||||
},
|
||||
errorResponse,
|
||||
],
|
||||
default: [
|
||||
{
|
||||
success: false,
|
||||
name: "Error",
|
||||
schema: schemaFromOpenApiSpecV2(
|
||||
spec,
|
||||
"/paths//conversations.join/post/responses/default/schema"
|
||||
),
|
||||
},
|
||||
],
|
||||
},
|
||||
responses: [
|
||||
{
|
||||
matches: ({ statusCode, body }) => statusCode === 200 && body.ok,
|
||||
success: true,
|
||||
name: "Success",
|
||||
schema: schemaFromOpenApiSpecV2(
|
||||
spec,
|
||||
"/paths//conversations.join/post/responses/200/schema"
|
||||
),
|
||||
},
|
||||
errorResponse,
|
||||
{
|
||||
matches: () => true,
|
||||
success: false,
|
||||
name: "Error",
|
||||
schema: schemaFromOpenApiSpecV2(
|
||||
spec,
|
||||
"/paths//conversations.join/post/responses/default/schema"
|
||||
),
|
||||
},
|
||||
],
|
||||
};
|
||||
|
||||
@@ -0,0 +1,122 @@
|
||||
import { Command } from "commander";
|
||||
import { promises as fs } from "node:fs";
|
||||
import * as tsj from "ts-json-schema-generator";
|
||||
import $RefParser from "@apidevtools/json-schema-ref-parser";
|
||||
type JSONSchema7Definition = NonNullable<tsj.Schema["definitions"]>[number];
|
||||
|
||||
const program = new Command();
|
||||
|
||||
program
|
||||
.command("convert")
|
||||
.description("Convert the TypeScript file to a schema file")
|
||||
.argument("<original_file_path>", "The file path to TypeScript file")
|
||||
.option("-t, --type <type>", "The single type to generate")
|
||||
.option(
|
||||
"-m, --mode <mode>",
|
||||
"The mode to use: typescript or jsonschema. Default is typescript"
|
||||
)
|
||||
.action(
|
||||
async (
|
||||
original_file_path: string,
|
||||
options: {
|
||||
type?: string;
|
||||
mode?: "typescript" | "jsonschema";
|
||||
}
|
||||
) => {
|
||||
//get original file path minus the extension
|
||||
const originalFilePathMinusExtension = original_file_path.replace(
|
||||
".ts",
|
||||
""
|
||||
);
|
||||
|
||||
try {
|
||||
const config: tsj.Config = {
|
||||
path: original_file_path,
|
||||
expose: "all",
|
||||
jsDoc: "extended",
|
||||
type: options.type ?? "*",
|
||||
skipTypeCheck: true,
|
||||
};
|
||||
|
||||
const schema = tsj.createGenerator(config).createSchema(config.type);
|
||||
|
||||
if (options.mode === undefined || options.mode === "typescript") {
|
||||
const $refs = await getRefs(schema);
|
||||
const refsFileName = `${originalFilePathMinusExtension}_refs.ts`;
|
||||
await fs.writeFile(refsFileName, JSON.stringify($refs));
|
||||
console.log("Successfully created $Refs file", refsFileName);
|
||||
|
||||
//output each definition as an exported const
|
||||
let typescriptFileText = `import { JSONSchema } from "core/schemas/types";\n\n`;
|
||||
|
||||
if (!schema.definitions) {
|
||||
throw new Error("No definitions found");
|
||||
}
|
||||
|
||||
//replace $refs with pointing at other consts
|
||||
|
||||
//loop through each definition and change $refs to point to the Schema instead
|
||||
Object.entries(schema.definitions).forEach(([name, definition]) => {
|
||||
const schemaName = schemaFriendlyName(name);
|
||||
let text = `export const ${schemaName}: JSONSchema = ${JSON.stringify(
|
||||
definition,
|
||||
null,
|
||||
2
|
||||
)};\n\n`;
|
||||
|
||||
//look for { $ref: "#/definitions/MyTypeName" } and replace with MyTypeNameSchema
|
||||
text = text.replace(
|
||||
/\{\s*"\$ref":\s*"#\/definitions\/([a-zA-Z0-9%()-|]+)"\s*\}/g,
|
||||
(match: string, name: string) => {
|
||||
return schemaFriendlyName(name);
|
||||
}
|
||||
);
|
||||
typescriptFileText += text;
|
||||
});
|
||||
|
||||
const tsFileName = `${originalFilePathMinusExtension}_schemas.ts`;
|
||||
await fs.writeFile(tsFileName, typescriptFileText);
|
||||
console.log("Successfully created JSON Schema file", tsFileName);
|
||||
} else {
|
||||
const jsonSchemaFilePath = `${original_file_path}.json`;
|
||||
await fs.writeFile(
|
||||
jsonSchemaFilePath,
|
||||
JSON.stringify(schema, null, 2)
|
||||
);
|
||||
|
||||
console.log(
|
||||
"Successfully created JSON Schema file",
|
||||
jsonSchemaFilePath
|
||||
);
|
||||
}
|
||||
} catch (e) {
|
||||
console.error(e);
|
||||
}
|
||||
}
|
||||
);
|
||||
|
||||
function schemaFriendlyName(name: string) {
|
||||
//look for Record<string, whatever> and replace with RecordStringWhatever
|
||||
name = decodeURIComponent(name);
|
||||
//replace any funky characters
|
||||
name = name.replace(
|
||||
/Record<string,\s*([a-zA-Z%()-|]+)>/g,
|
||||
(match: string, n: string) => {
|
||||
return `${n.replace(/[-()%|]/g, "")}Record`;
|
||||
}
|
||||
);
|
||||
|
||||
return `${capitalizeFirstLetter(name)}`;
|
||||
}
|
||||
|
||||
//Capitalize the first letter of a string
|
||||
function capitalizeFirstLetter(string: string) {
|
||||
return string.charAt(0).toUpperCase() + string.slice(1);
|
||||
}
|
||||
|
||||
async function getRefs(schema: tsj.Schema) {
|
||||
const $refs = await $RefParser.resolve(schema);
|
||||
return $refs;
|
||||
}
|
||||
|
||||
program.parseAsync(process.argv);
|
||||
@@ -1,16 +1,36 @@
|
||||
import { Command } from "commander";
|
||||
import { catalog } from "integrations/catalog";
|
||||
import { generateService } from "./generateService";
|
||||
|
||||
export async function generate() {
|
||||
console.log("Generating SDKs...");
|
||||
const program = new Command();
|
||||
|
||||
const allSdks = Object.values(catalog.services).map((service) => {
|
||||
return generateService(service);
|
||||
program
|
||||
.command("generate")
|
||||
.description("Generate API SDK(s)")
|
||||
.option(
|
||||
"-in, --integrations <integrations>",
|
||||
"Comma-separated list of integrations"
|
||||
)
|
||||
.action(async (options: { integrations?: string }) => {
|
||||
let integrationNames: string[] = [];
|
||||
if (options.integrations) {
|
||||
integrationNames = options.integrations.split(",").map((i) => i.trim());
|
||||
} else {
|
||||
integrationNames = Object.values(catalog.services).map((s) => s.service);
|
||||
}
|
||||
|
||||
console.log(`Generating SDKs... ${integrationNames.join(", ")}`);
|
||||
|
||||
for (let index = 0; index < integrationNames.length; index++) {
|
||||
const integrationName = integrationNames[index];
|
||||
const service = catalog.services[integrationName];
|
||||
if (!service) {
|
||||
throw new Error(`Could not find integration ${integrationName}`);
|
||||
}
|
||||
await generateService(service);
|
||||
}
|
||||
|
||||
console.log(`Generated ${integrationNames.length} SDKs`);
|
||||
});
|
||||
|
||||
await Promise.all(allSdks);
|
||||
|
||||
console.log(`Generated ${allSdks.length} SDKs`);
|
||||
}
|
||||
|
||||
generate();
|
||||
program.parseAsync(process.argv);
|
||||
|
||||
@@ -117,6 +117,23 @@ function generateDocSchema(
|
||||
|
||||
let description = createDescription(schema);
|
||||
|
||||
if (schema.allOf) {
|
||||
const docSchemas = schema.allOf.flatMap((s) => {
|
||||
const genSchema = generateDocSchema(key, required, s, expanded);
|
||||
return genSchema ? [genSchema] : [];
|
||||
});
|
||||
|
||||
return {
|
||||
path: key,
|
||||
required,
|
||||
types: new Set(docSchemas.flatMap((s) => Array.from(s.types))),
|
||||
description,
|
||||
children: docSchemas.flatMap((s) => s.children ?? []),
|
||||
childrenCollectionName: "properties",
|
||||
childrenExpanded: expanded,
|
||||
};
|
||||
}
|
||||
|
||||
if (schema.oneOf) {
|
||||
const oneOfTypes = schema.oneOf
|
||||
.map((v) => {
|
||||
|
||||
@@ -10,6 +10,7 @@ import { JSONSchema } from "core/schemas/types";
|
||||
import { FunctionData } from "./types";
|
||||
import { generateDocs } from "./generateDocs";
|
||||
import { TitleCaseWithSpaces, toFriendlyTypeName } from "./utilities";
|
||||
import { AutoReffer } from "core/schemas/autoReffer";
|
||||
|
||||
const appDir = process.cwd();
|
||||
|
||||
@@ -159,10 +160,10 @@ export async function ${action.name}(
|
||||
${
|
||||
schemas.input
|
||||
? `/** The params for this call */
|
||||
params: ${schemas.input.title}`
|
||||
params: Prettify<${schemas.input.title}>`
|
||||
: ""
|
||||
}
|
||||
): Promise<${schemas.output?.title ?? "void"}> {
|
||||
): Promise<Prettify<${schemas.output?.title ?? "void"}>> {
|
||||
const run = getTriggerRun();
|
||||
|
||||
if (!run) {
|
||||
@@ -173,7 +174,7 @@ export async function ${action.name}(
|
||||
version: "2",
|
||||
service: "${service.service}",
|
||||
endpoint: "${action.name}",
|
||||
params,
|
||||
${schemas.input ? "params," : "params: undefined,"}
|
||||
});
|
||||
|
||||
return output;
|
||||
@@ -206,15 +207,31 @@ async function createFunctionsAndTypesFiles(
|
||||
.filter(Boolean) as JSONSchema[];
|
||||
|
||||
const combinedSchema: JSONSchema = makeAnyOf(
|
||||
`${toFriendlyTypeName(service.service)}Types}`,
|
||||
`${toFriendlyTypeName(service.service)}Types`,
|
||||
typeSchemas
|
||||
);
|
||||
|
||||
const allTypes = await getTypesFromSchema(
|
||||
combinedSchema,
|
||||
const reffer = new AutoReffer(combinedSchema, {
|
||||
refIfMoreThan: 4,
|
||||
});
|
||||
const optimizedSchema = reffer.optimize();
|
||||
|
||||
//uncomment to write intermediate optimized schema to disk
|
||||
await fs.mkdir(basePath, { recursive: true });
|
||||
await fs.writeFile(
|
||||
`${basePath}/schema-optimized.json`,
|
||||
JSON.stringify(optimizedSchema, null, 2)
|
||||
);
|
||||
|
||||
let allTypes = await getTypesFromSchema(
|
||||
optimizedSchema,
|
||||
`${service.service}Types`
|
||||
);
|
||||
|
||||
allTypes += `\nexport type Prettify<T> = {
|
||||
[K in keyof T]: T[K];
|
||||
} & {};`;
|
||||
|
||||
const typesFile = project.createSourceFile(
|
||||
`${basePath}/src/types.ts`,
|
||||
allTypes,
|
||||
@@ -229,7 +246,7 @@ async function createFunctionsAndTypesFiles(
|
||||
`import { getTriggerRun } from "@trigger.dev/sdk";
|
||||
import { ${typeSchemas
|
||||
.map((t) => t && t.title)
|
||||
.join(", ")} } from "./types";
|
||||
.join(", ")}, Prettify } from "./types";
|
||||
${Object.values(functionsData)
|
||||
.map((f) => f.functionCode)
|
||||
.join("")}`,
|
||||
|
||||
@@ -1,64 +1,192 @@
|
||||
<svg width="751" height="131" viewBox="0 0 751 131" fill="none" xmlns="http://www.w3.org/2000/svg">
|
||||
<path d="M195.022 16.2694H135.445H137.799V32.5133H157.858V102.411H174.84V32.5133H195.022V16.2694Z" fill="url(#paint0_linear_228_1439)"/>
|
||||
<path d="M211.265 51.4645V40.8814H195.391V102.411H211.265V73C211.265 60.0787 221.726 56.3868 229.971 57.3713V39.6508C222.218 39.6508 214.465 43.0964 211.265 51.4645Z" fill="url(#paint1_linear_228_1439)"/>
|
||||
<path d="M246.954 33.4978C252.368 33.4978 256.799 29.0676 256.799 23.7761C256.799 18.4845 252.368 13.9313 246.954 13.9313C241.662 13.9313 237.232 18.4845 237.232 23.7761C237.232 29.0676 241.662 33.4978 246.954 33.4978ZM239.078 102.411H254.953V40.8814H239.078V102.411Z" fill="url(#paint2_linear_228_1439)"/>
|
||||
<path d="M315.253 40.8814V48.5111C310.946 42.7273 304.301 39.1586 295.563 39.1586C278.089 39.1586 264.922 53.4335 264.922 70.6618C264.922 88.0133 278.089 102.165 295.563 102.165C304.301 102.165 310.946 98.5964 315.253 92.8126V99.4579C315.253 109.18 309.1 114.594 299.132 114.594C289.657 114.594 285.596 110.779 283.011 105.98L269.475 113.733C274.889 123.701 285.473 128.746 298.64 128.746C314.884 128.746 330.759 119.64 330.759 99.4579V40.8814H315.253ZM298.025 87.5211C288.057 87.5211 280.796 80.5066 280.796 70.6618C280.796 60.9401 288.057 53.9257 298.025 53.9257C307.992 53.9257 315.253 60.9401 315.253 70.6618C315.253 80.5066 307.992 87.5211 298.025 87.5211Z" fill="url(#paint3_linear_228_1439)"/>
|
||||
<path d="M390.936 40.8814V48.5111C386.629 42.7273 379.983 39.1586 371.246 39.1586C353.772 39.1586 340.604 53.4335 340.604 70.6618C340.604 88.0133 353.772 102.165 371.246 102.165C379.983 102.165 386.629 98.5964 390.936 92.8126V99.4579C390.936 109.18 384.783 114.594 374.815 114.594C365.339 114.594 361.278 110.779 358.694 105.98L345.157 113.733C350.572 123.701 361.155 128.746 374.323 128.746C390.566 128.746 406.441 119.64 406.441 99.4579V40.8814H390.936ZM373.707 87.5211C363.74 87.5211 356.479 80.5066 356.479 70.6618C356.479 60.9401 363.74 53.9257 373.707 53.9257C383.675 53.9257 390.936 60.9401 390.936 70.6618C390.936 80.5066 383.675 87.5211 373.707 87.5211Z" fill="url(#paint4_linear_228_1439)"/>
|
||||
<path d="M432.9 78.1685H479.294C479.663 76.0765 479.909 73.9845 479.909 71.6464C479.909 53.5566 466.988 39.1586 448.775 39.1586C429.454 39.1586 416.287 53.3105 416.287 71.6464C416.287 89.9822 429.331 104.134 450.005 104.134C461.819 104.134 471.049 99.3348 476.832 90.9667L464.034 83.5832C461.327 87.1519 456.404 89.7361 450.251 89.7361C441.883 89.7361 435.115 86.2904 432.9 78.1685ZM432.654 65.8625C434.5 57.9867 440.284 53.4335 448.775 53.4335C455.42 53.4335 462.065 57.0022 464.034 65.8625H432.654Z" fill="url(#paint5_linear_228_1439)"/>
|
||||
<path d="M505.199 51.4645V40.8814H489.324V102.411H505.199V73C505.199 60.0787 515.659 56.3868 523.904 57.3713V39.6508C516.151 39.6508 508.398 43.0964 505.199 51.4645Z" fill="url(#paint6_linear_228_1439)"/>
|
||||
<path d="M529.934 104.011C535.717 104.011 540.394 99.3347 540.394 93.5509C540.394 87.7671 535.717 83.0909 529.934 83.0909C524.15 83.0909 519.474 87.7671 519.474 93.5509C519.474 99.3347 524.15 104.011 529.934 104.011Z" fill="url(#paint7_linear_228_1439)"/>
|
||||
<path d="M596.632 16.2694V48.1419C592.202 42.4811 585.68 39.1586 576.696 39.1586C560.206 39.1586 546.67 53.3104 546.67 71.6463C546.67 89.9822 560.206 104.134 576.696 104.134C585.68 104.134 592.202 100.811 596.632 95.1507V102.411H612.507V16.2694L596.632 16.2694ZM579.65 88.9977C569.805 88.9977 562.544 81.9833 562.544 71.6463C562.544 61.3093 569.805 54.2948 579.65 54.2948C589.371 54.2948 596.632 61.3093 596.632 71.6463C596.632 81.9833 589.371 88.9977 579.65 88.9977Z" fill="url(#paint8_linear_228_1439)"/>
|
||||
<path d="M637.98 78.1685H684.374C684.743 76.0765 684.989 73.9845 684.989 71.6464C684.989 53.5566 672.068 39.1586 653.855 39.1586C634.534 39.1586 621.367 53.3105 621.367 71.6464C621.367 89.9823 634.411 104.134 655.085 104.134C666.899 104.134 676.129 99.3348 681.912 90.9667L669.114 83.5832C666.407 87.1519 661.484 89.7362 655.331 89.7362C646.963 89.7362 640.195 86.2905 637.98 78.1685ZM637.734 65.8625C639.58 57.9867 645.364 53.4335 653.855 53.4335C660.5 53.4335 667.145 57.0022 669.114 65.8625H637.734Z" fill="url(#paint9_linear_228_1439)"/>
|
||||
<path d="M732.859 40.8814L717.846 83.9523L702.956 40.8814H685.481L708.863 102.411H726.952L750.334 40.8814H732.859Z" fill="url(#paint10_linear_228_1439)"/>
|
||||
<path fill-rule="evenodd" clip-rule="evenodd" d="M35.664 42.3995L59.4114 1.26865L118.264 103.206H0.558823L24.3062 62.0734L41.1046 71.7723L34.157 83.8065H84.6658L59.4114 40.0656L52.4638 52.0998L35.664 42.3995Z" fill="url(#paint11_linear_228_1439)"/>
|
||||
<defs>
|
||||
<linearGradient id="paint0_linear_228_1439" x1="329.675" y1="150.096" x2="329.675" y2="13.9313" gradientUnits="userSpaceOnUse">
|
||||
<stop stop-color="#41FF54"/>
|
||||
<stop offset="1" stop-color="#E7FF52"/>
|
||||
</linearGradient>
|
||||
<linearGradient id="paint1_linear_228_1439" x1="329.675" y1="150.096" x2="329.675" y2="13.9313" gradientUnits="userSpaceOnUse">
|
||||
<stop stop-color="#41FF54"/>
|
||||
<stop offset="1" stop-color="#E7FF52"/>
|
||||
</linearGradient>
|
||||
<linearGradient id="paint2_linear_228_1439" x1="329.675" y1="150.096" x2="329.675" y2="13.9313" gradientUnits="userSpaceOnUse">
|
||||
<stop stop-color="#41FF54"/>
|
||||
<stop offset="1" stop-color="#E7FF52"/>
|
||||
</linearGradient>
|
||||
<linearGradient id="paint3_linear_228_1439" x1="329.675" y1="150.096" x2="329.675" y2="13.9313" gradientUnits="userSpaceOnUse">
|
||||
<stop stop-color="#41FF54"/>
|
||||
<stop offset="1" stop-color="#E7FF52"/>
|
||||
</linearGradient>
|
||||
<linearGradient id="paint4_linear_228_1439" x1="329.675" y1="150.096" x2="329.675" y2="13.9313" gradientUnits="userSpaceOnUse">
|
||||
<stop stop-color="#41FF54"/>
|
||||
<stop offset="1" stop-color="#E7FF52"/>
|
||||
</linearGradient>
|
||||
<linearGradient id="paint5_linear_228_1439" x1="329.675" y1="150.096" x2="329.675" y2="13.9313" gradientUnits="userSpaceOnUse">
|
||||
<stop stop-color="#41FF54"/>
|
||||
<stop offset="1" stop-color="#E7FF52"/>
|
||||
</linearGradient>
|
||||
<linearGradient id="paint6_linear_228_1439" x1="329.675" y1="150.096" x2="329.675" y2="13.9313" gradientUnits="userSpaceOnUse">
|
||||
<stop stop-color="#41FF54"/>
|
||||
<stop offset="1" stop-color="#E7FF52"/>
|
||||
</linearGradient>
|
||||
<linearGradient id="paint7_linear_228_1439" x1="634.904" y1="139.733" x2="651.44" y2="25.9754" gradientUnits="userSpaceOnUse">
|
||||
<stop stop-color="#2563EB"/>
|
||||
<stop offset="1" stop-color="#A855F7"/>
|
||||
</linearGradient>
|
||||
<linearGradient id="paint8_linear_228_1439" x1="634.904" y1="139.733" x2="651.44" y2="25.9754" gradientUnits="userSpaceOnUse">
|
||||
<stop stop-color="#2563EB"/>
|
||||
<stop offset="1" stop-color="#A855F7"/>
|
||||
</linearGradient>
|
||||
<linearGradient id="paint9_linear_228_1439" x1="634.904" y1="139.733" x2="651.44" y2="25.9754" gradientUnits="userSpaceOnUse">
|
||||
<stop stop-color="#2563EB"/>
|
||||
<stop offset="1" stop-color="#A855F7"/>
|
||||
</linearGradient>
|
||||
<linearGradient id="paint10_linear_228_1439" x1="634.904" y1="139.733" x2="651.44" y2="25.9754" gradientUnits="userSpaceOnUse">
|
||||
<stop stop-color="#2563EB"/>
|
||||
<stop offset="1" stop-color="#A855F7"/>
|
||||
</linearGradient>
|
||||
<linearGradient id="paint11_linear_228_1439" x1="95.8594" y1="103.206" x2="94.7605" y2="31.2414" gradientUnits="userSpaceOnUse">
|
||||
<stop stop-color="#41FF54"/>
|
||||
<stop offset="1" stop-color="#E7FF52"/>
|
||||
</linearGradient>
|
||||
</defs>
|
||||
</svg>
|
||||
<svg
|
||||
xmlns="http://www.w3.org/2000/svg"
|
||||
width="751"
|
||||
height="131"
|
||||
fill="none"
|
||||
viewBox="0 0 751 131"
|
||||
>
|
||||
<path
|
||||
fill="url(#paint0_linear_228_1439)"
|
||||
d="M195.022 16.27h-59.577 2.354v16.243h20.059v69.898h16.982V32.513h20.182V16.27z"
|
||||
></path>
|
||||
<path
|
||||
fill="url(#paint1_linear_228_1439)"
|
||||
d="M211.265 51.465V40.88h-15.874v61.53h15.874V73c0-12.921 10.461-16.613 18.706-15.629v-17.72c-7.753 0-15.506 3.445-18.706 11.813z"
|
||||
></path>
|
||||
<path
|
||||
fill="url(#paint2_linear_228_1439)"
|
||||
d="M246.954 33.498c5.414 0 9.845-4.43 9.845-9.722 0-5.291-4.431-9.845-9.845-9.845-5.292 0-9.722 4.554-9.722 9.845 0 5.292 4.43 9.722 9.722 9.722zm-7.876 68.913h15.875v-61.53h-15.875v61.53z"
|
||||
></path>
|
||||
<path
|
||||
fill="url(#paint3_linear_228_1439)"
|
||||
d="M315.253 40.881v7.63c-4.307-5.784-10.952-9.352-19.69-9.352-17.474 0-30.641 14.275-30.641 31.503 0 17.351 13.167 31.503 30.641 31.503 8.738 0 15.383-3.569 19.69-9.352v6.645c0 9.722-6.153 15.136-16.121 15.136-9.475 0-13.536-3.815-16.121-8.614l-13.536 7.753c5.414 9.968 15.998 15.013 29.165 15.013 16.244 0 32.119-9.106 32.119-29.288V40.88h-15.506zm-17.228 46.64c-9.968 0-17.229-7.014-17.229-16.86 0-9.72 7.261-16.735 17.229-16.735 9.967 0 17.228 7.014 17.228 16.736 0 9.845-7.261 16.86-17.228 16.86z"
|
||||
></path>
|
||||
<path
|
||||
fill="url(#paint4_linear_228_1439)"
|
||||
d="M390.936 40.881v7.63c-4.307-5.784-10.953-9.352-19.69-9.352-17.474 0-30.642 14.275-30.642 31.503 0 17.351 13.168 31.503 30.642 31.503 8.737 0 15.383-3.569 19.69-9.352v6.645c0 9.722-6.153 15.136-16.121 15.136-9.476 0-13.537-3.815-16.121-8.614l-13.537 7.753c5.415 9.968 15.998 15.013 29.166 15.013 16.243 0 32.118-9.106 32.118-29.288V40.88h-15.505zm-17.229 46.64c-9.967 0-17.228-7.014-17.228-16.86 0-9.72 7.261-16.735 17.228-16.735 9.968 0 17.229 7.014 17.229 16.736 0 9.845-7.261 16.86-17.229 16.86z"
|
||||
></path>
|
||||
<path
|
||||
fill="url(#paint5_linear_228_1439)"
|
||||
d="M432.9 78.168h46.394c.369-2.092.615-4.184.615-6.522 0-18.09-12.921-32.487-31.134-32.487-19.321 0-32.488 14.151-32.488 32.487 0 18.336 13.044 32.488 33.718 32.488 11.814 0 21.044-4.8 26.827-13.167l-12.798-7.384c-2.707 3.569-7.63 6.153-13.783 6.153-8.368 0-15.136-3.446-17.351-11.568zm-.246-12.306c1.846-7.875 7.63-12.428 16.121-12.428 6.645 0 13.29 3.568 15.259 12.428h-31.38z"
|
||||
></path>
|
||||
<path
|
||||
fill="url(#paint6_linear_228_1439)"
|
||||
d="M505.199 51.465V40.88h-15.875v61.53h15.875V73c0-12.921 10.46-16.613 18.705-15.629v-17.72c-7.753 0-15.506 3.445-18.705 11.813z"
|
||||
></path>
|
||||
<path
|
||||
fill="url(#paint7_linear_228_1439)"
|
||||
d="M529.934 104.011c5.783 0 10.46-4.676 10.46-10.46 0-5.784-4.677-10.46-10.46-10.46a10.451 10.451 0 00-10.46 10.46c0 5.784 4.676 10.46 10.46 10.46z"
|
||||
></path>
|
||||
<path
|
||||
fill="url(#paint8_linear_228_1439)"
|
||||
d="M596.632 16.27v31.872c-4.43-5.66-10.952-8.983-19.936-8.983-16.49 0-30.026 14.151-30.026 32.487 0 18.336 13.536 32.488 30.026 32.488 8.984 0 15.506-3.323 19.936-8.983v7.26h15.875V16.269h-15.875zM579.65 88.997c-9.845 0-17.106-7.015-17.106-17.352s7.261-17.351 17.106-17.351c9.721 0 16.982 7.014 16.982 17.351s-7.261 17.352-16.982 17.352z"
|
||||
></path>
|
||||
<path
|
||||
fill="url(#paint9_linear_228_1439)"
|
||||
d="M637.98 78.168h46.394c.369-2.092.615-4.184.615-6.522 0-18.09-12.921-32.487-31.134-32.487-19.321 0-32.488 14.151-32.488 32.487 0 18.336 13.044 32.488 33.718 32.488 11.814 0 21.044-4.8 26.827-13.167l-12.798-7.384c-2.707 3.569-7.63 6.153-13.783 6.153-8.368 0-15.136-3.446-17.351-11.568zm-.246-12.306c1.846-7.875 7.63-12.428 16.121-12.428 6.645 0 13.29 3.568 15.259 12.428h-31.38z"
|
||||
></path>
|
||||
<path
|
||||
fill="url(#paint10_linear_228_1439)"
|
||||
d="M732.859 40.881l-15.013 43.071-14.89-43.07h-17.475l23.382 61.529h18.089l23.382-61.53h-17.475z"
|
||||
></path>
|
||||
<path
|
||||
fill="url(#paint11_linear_228_1439)"
|
||||
fillRule="evenodd"
|
||||
d="M35.664 42.4L59.411 1.269l58.853 101.937H.559l23.747-41.133 16.799 9.7-6.948 12.034h50.509L59.41 40.066 52.464 52.1l-16.8-9.7z"
|
||||
clipRule="evenodd"
|
||||
></path>
|
||||
<defs>
|
||||
<linearGradient
|
||||
id="paint0_linear_228_1439"
|
||||
x1="329.675"
|
||||
x2="329.675"
|
||||
y1="150.096"
|
||||
y2="13.931"
|
||||
gradientUnits="userSpaceOnUse"
|
||||
>
|
||||
<stop stopColor="#41FF54"></stop>
|
||||
<stop offset="1" stopColor="#E7FF52"></stop>
|
||||
</linearGradient>
|
||||
<linearGradient
|
||||
id="paint1_linear_228_1439"
|
||||
x1="329.675"
|
||||
x2="329.675"
|
||||
y1="150.096"
|
||||
y2="13.931"
|
||||
gradientUnits="userSpaceOnUse"
|
||||
>
|
||||
<stop stopColor="#41FF54"></stop>
|
||||
<stop offset="1" stopColor="#E7FF52"></stop>
|
||||
</linearGradient>
|
||||
<linearGradient
|
||||
id="paint2_linear_228_1439"
|
||||
x1="329.675"
|
||||
x2="329.675"
|
||||
y1="150.096"
|
||||
y2="13.931"
|
||||
gradientUnits="userSpaceOnUse"
|
||||
>
|
||||
<stop stopColor="#41FF54"></stop>
|
||||
<stop offset="1" stopColor="#E7FF52"></stop>
|
||||
</linearGradient>
|
||||
<linearGradient
|
||||
id="paint3_linear_228_1439"
|
||||
x1="329.675"
|
||||
x2="329.675"
|
||||
y1="150.096"
|
||||
y2="13.931"
|
||||
gradientUnits="userSpaceOnUse"
|
||||
>
|
||||
<stop stopColor="#41FF54"></stop>
|
||||
<stop offset="1" stopColor="#E7FF52"></stop>
|
||||
</linearGradient>
|
||||
<linearGradient
|
||||
id="paint4_linear_228_1439"
|
||||
x1="329.675"
|
||||
x2="329.675"
|
||||
y1="150.096"
|
||||
y2="13.931"
|
||||
gradientUnits="userSpaceOnUse"
|
||||
>
|
||||
<stop stopColor="#41FF54"></stop>
|
||||
<stop offset="1" stopColor="#E7FF52"></stop>
|
||||
</linearGradient>
|
||||
<linearGradient
|
||||
id="paint5_linear_228_1439"
|
||||
x1="329.675"
|
||||
x2="329.675"
|
||||
y1="150.096"
|
||||
y2="13.931"
|
||||
gradientUnits="userSpaceOnUse"
|
||||
>
|
||||
<stop stopColor="#41FF54"></stop>
|
||||
<stop offset="1" stopColor="#E7FF52"></stop>
|
||||
</linearGradient>
|
||||
<linearGradient
|
||||
id="paint6_linear_228_1439"
|
||||
x1="329.675"
|
||||
x2="329.675"
|
||||
y1="150.096"
|
||||
y2="13.931"
|
||||
gradientUnits="userSpaceOnUse"
|
||||
>
|
||||
<stop stopColor="#41FF54"></stop>
|
||||
<stop offset="1" stopColor="#E7FF52"></stop>
|
||||
</linearGradient>
|
||||
<linearGradient
|
||||
id="paint7_linear_228_1439"
|
||||
x1="634.904"
|
||||
x2="651.44"
|
||||
y1="139.733"
|
||||
y2="25.975"
|
||||
gradientUnits="userSpaceOnUse"
|
||||
>
|
||||
<stop stopColor="#2563EB"></stop>
|
||||
<stop offset="1" stopColor="#A855F7"></stop>
|
||||
</linearGradient>
|
||||
<linearGradient
|
||||
id="paint8_linear_228_1439"
|
||||
x1="634.904"
|
||||
x2="651.44"
|
||||
y1="139.733"
|
||||
y2="25.975"
|
||||
gradientUnits="userSpaceOnUse"
|
||||
>
|
||||
<stop stopColor="#2563EB"></stop>
|
||||
<stop offset="1" stopColor="#A855F7"></stop>
|
||||
</linearGradient>
|
||||
<linearGradient
|
||||
id="paint9_linear_228_1439"
|
||||
x1="634.904"
|
||||
x2="651.44"
|
||||
y1="139.733"
|
||||
y2="25.975"
|
||||
gradientUnits="userSpaceOnUse"
|
||||
>
|
||||
<stop stopColor="#2563EB"></stop>
|
||||
<stop offset="1" stopColor="#A855F7"></stop>
|
||||
</linearGradient>
|
||||
<linearGradient
|
||||
id="paint10_linear_228_1439"
|
||||
x1="634.904"
|
||||
x2="651.44"
|
||||
y1="139.733"
|
||||
y2="25.975"
|
||||
gradientUnits="userSpaceOnUse"
|
||||
>
|
||||
<stop stopColor="#2563EB"></stop>
|
||||
<stop offset="1" stopColor="#A855F7"></stop>
|
||||
</linearGradient>
|
||||
<linearGradient
|
||||
id="paint11_linear_228_1439"
|
||||
x1="95.859"
|
||||
x2="94.76"
|
||||
y1="103.206"
|
||||
y2="31.241"
|
||||
gradientUnits="userSpaceOnUse"
|
||||
>
|
||||
<stop stopColor="#41FF54"></stop>
|
||||
<stop offset="1" stopColor="#E7FF52"></stop>
|
||||
</linearGradient>
|
||||
</defs>
|
||||
</svg>
|
||||
|
Before Width: | Height: | Size: 7.0 KiB After Width: | Height: | Size: 7.2 KiB |
Binary file not shown.
|
After Width: | Height: | Size: 85 KiB |
Binary file not shown.
|
After Width: | Height: | Size: 5.5 KiB |
@@ -1,8 +1,15 @@
|
||||
import { CheckIcon, ClipboardIcon } from "@heroicons/react/24/outline";
|
||||
import {
|
||||
CheckIcon,
|
||||
ClipboardIcon,
|
||||
EyeIcon,
|
||||
EyeSlashIcon,
|
||||
KeyIcon,
|
||||
} from "@heroicons/react/24/outline";
|
||||
import classNames from "classnames";
|
||||
import { useCallback, useState } from "react";
|
||||
import { EnvironmentIcon } from "~/routes/resources/environment";
|
||||
import { CopyText } from "./CopyText";
|
||||
import { TertiaryButton } from "./primitives/Buttons";
|
||||
import { Body } from "./primitives/text/Body";
|
||||
|
||||
const variantStyle = {
|
||||
slate:
|
||||
@@ -63,9 +70,9 @@ export function CopyTextButton({
|
||||
|
||||
const panelVariantStyle = {
|
||||
primary:
|
||||
"truncate text-indigo-300 bg-indigo-700/50 pl-3.5 pr-2 py-3 rounded border border-indigo-600 flex items-center justify-between gap-2 hover:cursor-pointer hover:bg-indigo-600/50 hover:border-indigo-600 transition",
|
||||
"truncate text-indigo-100 bg-indigo-700/50 pl-3.5 pr-2 py-3 rounded border border-indigo-600 flex items-center justify-between gap-2 hover:cursor-pointer hover:bg-indigo-600/50 hover:border-indigo-600 transition",
|
||||
slate:
|
||||
"flex w-full items-center justify-between gap-2 truncate rounded bg-slate-850 py-2 pl-2.5 pr-1 transition hover:cursor-pointer hover:bg-slate-800 hover:text-slate-300",
|
||||
"flex w-full items-center justify-between gap-2 truncate rounded bg-slate-850 py-2 pl-2.5 pr-1 transition hover:cursor-pointer hover:bg-slate-850/70 hover:text-slate-300",
|
||||
text: "flex w-full items-center justify-between gap-2 truncate rounded bg-transparent py-2 pl-2.5 pr-1 transition hover:cursor-pointer hover:border-slate-700/50 hover:bg-slate-700/50",
|
||||
};
|
||||
|
||||
@@ -105,3 +112,116 @@ export function CopyTextPanel({
|
||||
</CopyText>
|
||||
);
|
||||
}
|
||||
|
||||
export type CopyTextSideMenuProps = {
|
||||
value: string;
|
||||
text?: string;
|
||||
className?: string;
|
||||
};
|
||||
|
||||
export function CopyTextSideMenu({
|
||||
value,
|
||||
text,
|
||||
className,
|
||||
}: CopyTextPanelProps) {
|
||||
const [copied, setCopied] = useState(false);
|
||||
const [isShowingKeys, setIsShowingKeys] = useState(false);
|
||||
const onCopied = useCallback(() => {
|
||||
setCopied(true);
|
||||
setTimeout(() => {
|
||||
setCopied(false);
|
||||
}, 1500);
|
||||
}, [setCopied]);
|
||||
return (
|
||||
<CopyText
|
||||
value={value}
|
||||
onCopied={onCopied}
|
||||
className={classNames(className, "w-full")}
|
||||
>
|
||||
{copied ? (
|
||||
<div className={classNames(copyTextSideMenuStyles)}>
|
||||
{isShowingKeys ? (
|
||||
<span className="truncate font-mono text-sm text-green-500 transition">
|
||||
{value}
|
||||
</span>
|
||||
) : (
|
||||
<div className="flex items-center gap-2 truncate">
|
||||
<KeyIcon className="h-6 w-6 min-w-[1.5rem] text-green-500" />
|
||||
<Body className="truncate text-green-500">
|
||||
{text ?? value} copied
|
||||
</Body>
|
||||
</div>
|
||||
)}
|
||||
<div className="flex items-center gap-1">
|
||||
<div className="flex items-center rounded p-1.5 opacity-0 transition hover:bg-slate-800 group-hover:opacity-100">
|
||||
{!isShowingKeys ? (
|
||||
<TertiaryButton
|
||||
onClick={(e) => {
|
||||
e.stopPropagation();
|
||||
setIsShowingKeys(true);
|
||||
}}
|
||||
className="group transition"
|
||||
>
|
||||
<EyeIcon className="h-4 w-4 text-slate-500 transition group-hover:text-slate-400" />
|
||||
</TertiaryButton>
|
||||
) : (
|
||||
<TertiaryButton
|
||||
onClick={(e) => {
|
||||
e.stopPropagation();
|
||||
setIsShowingKeys(false);
|
||||
}}
|
||||
className="group transition"
|
||||
>
|
||||
<EyeSlashIcon className="h-4 w-4 text-slate-500 transition group-hover:text-slate-400" />
|
||||
</TertiaryButton>
|
||||
)}
|
||||
</div>
|
||||
<CheckIcon className="h-4 w-4 text-green-500" />
|
||||
</div>
|
||||
</div>
|
||||
) : (
|
||||
<div className={classNames(copyTextSideMenuStyles)}>
|
||||
<div className="flex items-center gap-2 truncate">
|
||||
{isShowingKeys ? (
|
||||
<span className="truncate font-mono text-sm">{value}</span>
|
||||
) : (
|
||||
<div className="flex items-center gap-2 truncate">
|
||||
<KeyIcon className="h-6 w-6 min-w-[1.5rem]" />
|
||||
<Body className="truncate">{text ?? value}</Body>
|
||||
</div>
|
||||
)}
|
||||
</div>
|
||||
<div className="flex items-center gap-1">
|
||||
<div className="flex items-center rounded p-1.5 opacity-0 transition hover:bg-slate-800 group-hover:opacity-100">
|
||||
{!isShowingKeys ? (
|
||||
<TertiaryButton
|
||||
onClick={(e) => {
|
||||
e.stopPropagation();
|
||||
setIsShowingKeys(true);
|
||||
}}
|
||||
className="group transition"
|
||||
>
|
||||
<EyeIcon className="h-4 w-4 text-slate-400 transition group-hover:text-slate-300" />
|
||||
</TertiaryButton>
|
||||
) : (
|
||||
<TertiaryButton
|
||||
onClick={(e) => {
|
||||
e.stopPropagation();
|
||||
setIsShowingKeys(false);
|
||||
}}
|
||||
className="group transition"
|
||||
>
|
||||
<EyeSlashIcon className="h-4 w-4 text-slate-400 transition group-hover:text-slate-300" />
|
||||
</TertiaryButton>
|
||||
)}
|
||||
</div>
|
||||
<ClipboardIcon className="h-4 w-4" />
|
||||
</div>
|
||||
</div>
|
||||
)}
|
||||
</CopyText>
|
||||
);
|
||||
}
|
||||
|
||||
const copyTextSideMenuStyles =
|
||||
"group flex w-full items-center text-slate-300 justify-between truncate rounded py-1.5 pl-3 pr-2.5 transition hover:cursor-pointer hover:bg-slate-850";
|
||||
|
||||
@@ -0,0 +1,38 @@
|
||||
import classNames from "classnames";
|
||||
import { useCurrentEnvironment } from "~/routes/__app/orgs/$organizationSlug/__org/workflows/$workflowSlug";
|
||||
import { Body } from "./primitives/text/Body";
|
||||
|
||||
export function EnvironmentBanner() {
|
||||
const environment = useCurrentEnvironment();
|
||||
|
||||
return (
|
||||
<>
|
||||
<div
|
||||
className={classNames(
|
||||
environment.slug === "live"
|
||||
? `border-liveEnv-500`
|
||||
: `border-devEnv-500`,
|
||||
"group absolute top-[3.6rem] left-0 z-50 w-full border-t-2 bg-transparent"
|
||||
)}
|
||||
>
|
||||
<div className="absolute top-0 flex w-full items-center justify-center uppercase">
|
||||
{environment.slug === "live" ? (
|
||||
<Body
|
||||
size="extra-small"
|
||||
className="rounded-b bg-liveEnv-500 px-2 py-0.5 font-semibold tracking-wide text-liveEnv-900"
|
||||
>
|
||||
Live
|
||||
</Body>
|
||||
) : (
|
||||
<Body
|
||||
size="extra-small"
|
||||
className="rounded-b bg-devEnv-500 px-1.5 py-0.5 font-semibold tracking-wide text-devEnv-900"
|
||||
>
|
||||
Development
|
||||
</Body>
|
||||
)}
|
||||
</div>
|
||||
</div>
|
||||
</>
|
||||
);
|
||||
}
|
||||
@@ -0,0 +1,112 @@
|
||||
import { useState } from "react";
|
||||
import { Switch } from "@headlessui/react";
|
||||
import { Body } from "./primitives/text/Body";
|
||||
import { PowerIcon } from "@heroicons/react/24/outline";
|
||||
import { useCurrentEnvironment } from "~/routes/__app/orgs/$organizationSlug/__org/workflows/$workflowSlug";
|
||||
|
||||
function classNames(...classes: string[]) {
|
||||
return classes.filter(Boolean).join(" ");
|
||||
}
|
||||
|
||||
export default function EnvironmentSwitch() {
|
||||
const environment = useCurrentEnvironment();
|
||||
const [enabled, setEnabled] = useState(false);
|
||||
|
||||
const highlightColorClass = enabled
|
||||
? environment.slug === "live"
|
||||
? "bg-liveEnv-500"
|
||||
: "bg-devEnv-500"
|
||||
: "bg-slate-800";
|
||||
|
||||
return (
|
||||
<div className="group ">
|
||||
<div className="mb-4 flex items-center justify-between pl-3 pr-2.5">
|
||||
<div className="flex items-center gap-2">
|
||||
<PowerIcon
|
||||
className={classNames(
|
||||
enabled ? "text-slate-300" : "text-slate-500",
|
||||
"h-6 w-6 transition"
|
||||
)}
|
||||
/>
|
||||
<Body
|
||||
className={classNames(
|
||||
enabled ? "text-slate-300" : "text-slate-500",
|
||||
"transition"
|
||||
)}
|
||||
>
|
||||
Enabled in {environment.slug === "live" ? "Live" : "Dev"}
|
||||
</Body>
|
||||
</div>
|
||||
<Switch
|
||||
checked={enabled}
|
||||
onChange={setEnabled}
|
||||
className={classNames(
|
||||
highlightColorClass,
|
||||
"relative inline-flex h-6 w-11 flex-shrink-0 cursor-pointer rounded-full border-2 border-transparent transition-colors duration-200 ease-in-out focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-indigo-600 focus-visible:ring-offset-2"
|
||||
)}
|
||||
>
|
||||
<span className="sr-only">Toggle enable in Live</span>
|
||||
<span
|
||||
className={classNames(
|
||||
enabled ? "translate-x-5" : "translate-x-0",
|
||||
"pointer-events-none relative inline-block h-5 w-5 transform rounded-full bg-white shadow ring-0 transition duration-200 ease-in-out"
|
||||
)}
|
||||
>
|
||||
<span
|
||||
className={classNames(
|
||||
enabled
|
||||
? "opacity-0 duration-100 ease-out"
|
||||
: "opacity-100 duration-200 ease-in",
|
||||
"absolute inset-0 flex h-full w-full items-center justify-center transition-opacity"
|
||||
)}
|
||||
aria-hidden="true"
|
||||
>
|
||||
<svg
|
||||
className="h-3 w-3 text-gray-400"
|
||||
fill="none"
|
||||
viewBox="0 0 12 12"
|
||||
>
|
||||
<path
|
||||
d="M4 8l2-2m0 0l2-2M6 6L4 4m2 2l2 2"
|
||||
stroke="currentColor"
|
||||
strokeWidth={2}
|
||||
strokeLinecap="round"
|
||||
strokeLinejoin="round"
|
||||
/>
|
||||
</svg>
|
||||
</span>
|
||||
<span
|
||||
className={classNames(
|
||||
enabled
|
||||
? "opacity-100 duration-200 ease-in"
|
||||
: "opacity-0 duration-100 ease-out",
|
||||
"absolute inset-0 flex h-full w-full items-center justify-center transition-opacity"
|
||||
)}
|
||||
aria-hidden="true"
|
||||
>
|
||||
<svg
|
||||
className={classNames(
|
||||
"h-3 w-3",
|
||||
environment.slug === "live"
|
||||
? "text-liveEnv-500"
|
||||
: "text-devEnv-500"
|
||||
)}
|
||||
fill="currentColor"
|
||||
viewBox="0 0 12 12"
|
||||
>
|
||||
<path d="M3.707 5.293a1 1 0 00-1.414 1.414l1.414-1.414zM5 8l-.707.707a1 1 0 001.414 0L5 8zm4.707-3.293a1 1 0 00-1.414-1.414l1.414 1.414zm-7.414 2l2 2 1.414-1.414-2-2-1.414 1.414zm3.414 2l4-4-1.414-1.414-4 4 1.414 1.414z" />
|
||||
</svg>
|
||||
</span>
|
||||
</span>
|
||||
</Switch>
|
||||
</div>
|
||||
<div className="relative rounded border border-slate-800 bg-slate-900 py-2 px-3 opacity-0 transition duration-300 group-hover:opacity-100">
|
||||
<div className="absolute -top-2 right-6 h-4 w-4 rotate-45 border-t border-l border-slate-800 bg-slate-900" />
|
||||
<Body size="small" className="text-slate-500">
|
||||
This Workflow is {enabled === true ? "enabled" : "disabled"} in the{" "}
|
||||
{environment.slug === "live" ? "Live" : "Development"} environment.
|
||||
</Body>
|
||||
</div>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
@@ -8,7 +8,7 @@ export function ImpersonationBanner({
|
||||
impersonationId: string;
|
||||
}) {
|
||||
return (
|
||||
<div className="grid grid-cols-3 items-center bg-gradient-to-r from-amber-500 via-amber-400 to-amber-500 px-4 text-center">
|
||||
<div className="grid h-8 grid-cols-3 items-center bg-gradient-to-r from-amber-500 via-amber-400 to-amber-500 px-4 text-center">
|
||||
<span></span>
|
||||
<Body size="small" className="text-slate-800">
|
||||
You are impersonating{" "}
|
||||
@@ -22,7 +22,7 @@ export function ImpersonationBanner({
|
||||
>
|
||||
<TertiaryButton
|
||||
type="submit"
|
||||
className="text-slate-700 hover:!text-slate-900"
|
||||
className="!text-slate-700 transition hover:!text-slate-900"
|
||||
>
|
||||
Stop impersonating
|
||||
</TertiaryButton>
|
||||
|
||||
@@ -0,0 +1,59 @@
|
||||
import { useLocales } from "./LocaleProvider";
|
||||
|
||||
type IntlDateProps = {
|
||||
date: Date | string;
|
||||
timeZone?: string;
|
||||
};
|
||||
|
||||
export const IntlDate = ({ date, timeZone }: IntlDateProps) => {
|
||||
const realDate = typeof date === "string" ? new Date(date) : date;
|
||||
|
||||
const locales = useLocales();
|
||||
const isoString = realDate.toISOString();
|
||||
const formattedDate = new Intl.DateTimeFormat(locales, {
|
||||
year: "numeric",
|
||||
month: "short",
|
||||
day: "numeric",
|
||||
timeZone,
|
||||
}).format(realDate);
|
||||
|
||||
const formattedTime = new Intl.DateTimeFormat(locales, {
|
||||
hour: "numeric",
|
||||
minute: "numeric",
|
||||
timeZone,
|
||||
}).format(realDate);
|
||||
|
||||
return (
|
||||
<time dateTime={isoString}>
|
||||
{formattedDate} at {formattedTime}
|
||||
</time>
|
||||
);
|
||||
};
|
||||
|
||||
export const LogDate = ({ date, timeZone }: IntlDateProps) => {
|
||||
const realDate = typeof date === "string" ? new Date(date) : date;
|
||||
|
||||
const locales = useLocales();
|
||||
const isoString = realDate.toISOString();
|
||||
const formattedDate = new Intl.DateTimeFormat(locales, {
|
||||
month: "short",
|
||||
day: "2-digit",
|
||||
timeZone,
|
||||
}).format(realDate);
|
||||
|
||||
const formattedTime = new Intl.DateTimeFormat(locales, {
|
||||
hour: "numeric",
|
||||
minute: "2-digit",
|
||||
second: "2-digit",
|
||||
hour12: false,
|
||||
timeZone,
|
||||
}).format(realDate);
|
||||
|
||||
const milliseconds = `00${realDate.getMilliseconds()}`.slice(-3);
|
||||
|
||||
return (
|
||||
<time dateTime={isoString}>
|
||||
{formattedDate} {formattedTime}.{milliseconds}
|
||||
</time>
|
||||
);
|
||||
};
|
||||
@@ -0,0 +1,32 @@
|
||||
import type { ReactNode } from "react";
|
||||
import { useContext } from "react";
|
||||
import { createContext } from "react";
|
||||
|
||||
type LocaleContext = {
|
||||
locales: string[];
|
||||
};
|
||||
|
||||
type LocaleContextProviderProps = {
|
||||
locales: string[];
|
||||
children: ReactNode;
|
||||
};
|
||||
|
||||
const Context = createContext<LocaleContext | null>(null);
|
||||
|
||||
export const LocaleContextProvider = ({
|
||||
locales,
|
||||
children,
|
||||
}: LocaleContextProviderProps) => {
|
||||
const value = { locales };
|
||||
|
||||
return <Context.Provider value={value}>{children}</Context.Provider>;
|
||||
};
|
||||
|
||||
const throwIfNoProvider = () => {
|
||||
throw new Error("Please wrap your application in a LocaleContextProvider.");
|
||||
};
|
||||
|
||||
export const useLocales = () => {
|
||||
const { locales } = useContext(Context) ?? throwIfNoProvider();
|
||||
return locales;
|
||||
};
|
||||
@@ -0,0 +1,32 @@
|
||||
export function LogoIcon({ className }: { className?: string }) {
|
||||
return (
|
||||
<svg
|
||||
width="321"
|
||||
height="282"
|
||||
viewBox="0 0 321 282"
|
||||
fill="none"
|
||||
xmlns="http://www.w3.org/2000/svg"
|
||||
className={className}
|
||||
>
|
||||
<path
|
||||
fillRule="evenodd"
|
||||
clipRule="evenodd"
|
||||
d="M96.1017 113.4L160.679 4.57764e-05L320.718 281.045H0.638916L65.2159 167.642L110.896 194.382L92.0035 227.561H229.354L160.679 106.965L141.786 140.144L96.1017 113.4Z"
|
||||
fill="url(#paint0_linear_465_1663)"
|
||||
/>
|
||||
<defs>
|
||||
<linearGradient
|
||||
id="paint0_linear_465_1663"
|
||||
x1="320.718"
|
||||
y1="140.687"
|
||||
x2="0.638918"
|
||||
y2="140.687"
|
||||
gradientUnits="userSpaceOnUse"
|
||||
>
|
||||
<stop stopColor="#41FF54" />
|
||||
<stop offset="1" stopColor="#E7FF52" />
|
||||
</linearGradient>
|
||||
</defs>
|
||||
</svg>
|
||||
);
|
||||
}
|
||||
@@ -0,0 +1,23 @@
|
||||
import { TertiaryA } from "./primitives/Buttons";
|
||||
import { Body } from "./primitives/text/Body";
|
||||
import productHuntLogo from "../assets/images/producthunt.png";
|
||||
import { ArrowRightIcon } from "@heroicons/react/20/solid";
|
||||
|
||||
export function ProductHuntBanner() {
|
||||
return (
|
||||
<div className="flex h-8 items-center justify-center gap-2 bg-[#ff6154]">
|
||||
<Body size="small" className="text-white">
|
||||
We're live on{" "}
|
||||
</Body>
|
||||
<img src={productHuntLogo} alt="Product Hunt" className="h-6 w-[122px]" />
|
||||
<ArrowRightIcon className="h-4 w-4 text-white" />
|
||||
<TertiaryA
|
||||
href="https://www.producthunt.com/posts/trigger-dev"
|
||||
target="_blank"
|
||||
className="!text-white underline underline-offset-2 transition hover:decoration-slate-100 hover:decoration-2"
|
||||
>
|
||||
Vote for us today only!
|
||||
</TertiaryA>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
@@ -1,4 +1,4 @@
|
||||
import Pizzly from "@nangohq/pizzly-frontend";
|
||||
import Nango from "@nangohq/frontend";
|
||||
import { useFetcher } from "@remix-run/react";
|
||||
import type { ServiceMetadata } from "@trigger.dev/integration-sdk";
|
||||
import { useCallback, useEffect } from "react";
|
||||
@@ -71,7 +71,7 @@ export function useCreateConnection(sourceId?: string, serviceId?: string) {
|
||||
serviceId?: string;
|
||||
}) => {
|
||||
try {
|
||||
const pizzly = new Pizzly(pizzlyHost);
|
||||
const pizzly = new Nango({ host: pizzlyHost });
|
||||
await pizzly.auth(service, connectionId);
|
||||
|
||||
let completeData: UpdateRequest = {
|
||||
@@ -98,7 +98,11 @@ export function useCreateConnection(sourceId?: string, serviceId?: string) {
|
||||
});
|
||||
} catch (error: any) {
|
||||
console.error(
|
||||
`There was an error in the OAuth flow for integration "${error.providerConfigKey}" and connection-id "${error.connectionId}": ${error.error.type} - ${error.error.message}`,
|
||||
`There was an error in the OAuth flow for integration "${
|
||||
error.providerConfigKey
|
||||
}" and connection-id "${error.connectionId}": ${JSON.stringify(
|
||||
error
|
||||
)}`,
|
||||
error
|
||||
);
|
||||
}
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user