Compare commits
171 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 174954511e | |||
| 408bd6ddc8 | |||
| 1789d9d215 | |||
| f3ac17ad91 | |||
| 71d78805e7 | |||
| 3012771a21 | |||
| 5ec7198046 | |||
| 60cb8d54c4 | |||
| 9d7186eba5 | |||
| 5401fa1acb | |||
| 79f21fd94e | |||
| fa7ec12434 | |||
| c6a668a5f6 | |||
| dd786845b7 | |||
| fee24168aa | |||
| b344dfaaf8 | |||
| ce019c7b96 | |||
| 9a52afe1e2 | |||
| 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 | |||
| 313b7163e8 | |||
| b0e64937a0 | |||
| 3a2cf0ddb7 | |||
| 0f90ea9455 | |||
| 6d2217bd18 | |||
| 1579cdbfb2 | |||
| f1e81137b7 | |||
| 0f51328979 | |||
| aea812f621 | |||
| 45b2bea39f | |||
| 4f47d03114 | |||
| 618cca3304 | |||
| 4fe573b397 | |||
| d338b95e7e | |||
| 2d9bdb26d4 | |||
| b660a4c07f | |||
| 5706c3ab52 | |||
| e8c81cafb8 | |||
| a0d062c977 | |||
| 87a3bbee8e | |||
| 65aa6e4e4c | |||
| 0432a64357 | |||
| a5ff50f737 | |||
| 763dd8b55a | |||
| c2eea6c2b6 | |||
| 81bbae977f | |||
| 37bd8f4952 | |||
| 20d6c6fdfb | |||
| ebc45b7f8d | |||
| 77f146210a | |||
| 18cb9c6bec | |||
| dfd4966cb0 | |||
| d7384bf481 | |||
| 9e5c687174 | |||
| dcbb0f5287 | |||
| d64cfe5add | |||
| 1fa52f1c8c | |||
| f7dfc712b5 | |||
| 1cfb93ada9 | |||
| ea28f3dd47 | |||
| 2c563ce998 | |||
| 7437d9fbd6 | |||
| 7dd0102579 | |||
| 16c152ec26 | |||
| 01bc7df3e2 | |||
| 92d4008cc2 | |||
| 6d4f71d22c | |||
| 2770df644b | |||
| cc002ef707 | |||
| f552af517b | |||
| 8aff958bd3 | |||
| ad189b1f4b | |||
| 7bebf919e2 | |||
| e54ba7cbed | |||
| 4b6e21d6d4 | |||
| 21d70821de | |||
| a4d3f1b61c | |||
| 42e297474c | |||
| a40afd55d2 | |||
| 621254d0ab | |||
| 0ff568843d | |||
| 1d056b5328 | |||
| cf7c413c87 | |||
| ac87a634a3 | |||
| 1bc9bc9244 | |||
| 2fea9e5a6c | |||
| 2756bfe073 | |||
| 165ca9cb0f | |||
| c9e411be9b | |||
| ee4e181fc3 | |||
| f51f8f3ece | |||
| 840435284b | |||
| 12f4f3bc68 | |||
| 894a5dcb5d | |||
| d65ef5eb87 | |||
| 71007b5f60 | |||
| 3af9b63a9c | |||
| 0932ae7d89 | |||
| 43250c444e | |||
| 12056d888b | |||
| 63e004594c | |||
| ec3e98ca9f | |||
| 0ccc6d3729 | |||
| f3ffffd50b | |||
| e6550d156e | |||
| ae550df37d | |||
| 26ac1fa57c | |||
| 14031a8c6e | |||
| 719ef2a3a9 | |||
| e779cff42a | |||
| 0b3c3758a7 | |||
| ab351cbc8e | |||
| dd4fc8c262 | |||
| a55acb6296 | |||
| 4cae6fed63 | |||
| 28c70ab9d1 | |||
| 9d65a1a2c3 | |||
| fc3e85f93e | |||
| 8252f3ef86 | |||
| 7d78089275 | |||
| 5ae21f28c3 | |||
| c2d8934820 | |||
| 2edff18a59 | |||
| fc94c78109 | |||
| 77a99c226d | |||
| 50921f1307 | |||
| 160ab22f70 | |||
| 0cf3ebfae3 | |||
| 8767403a44 | |||
| 5f1ac75044 |
@@ -1,5 +0,0 @@
|
||||
---
|
||||
"@trigger.dev/sdk": patch
|
||||
---
|
||||
|
||||
Make the schema an optional param for customEvent and webhookEvent
|
||||
@@ -1,5 +0,0 @@
|
||||
---
|
||||
"create-trigger": minor
|
||||
---
|
||||
|
||||
Easily scaffold out standalone trigger.dev projects using create-trigger and our templates
|
||||
@@ -1,31 +0,0 @@
|
||||
{
|
||||
"mode": "pre",
|
||||
"tag": "next",
|
||||
"initialVersions": {
|
||||
"integrations": "1.0.0",
|
||||
"webapp": "1.0.0",
|
||||
"wss": "1.0.0",
|
||||
"@trigger.dev/airtable": "0.1.22",
|
||||
"@trigger.dev/sendgrid": "0.1.22",
|
||||
"@trigger.dev/github": "0.1.22",
|
||||
"@trigger.dev/resend": "0.1.22",
|
||||
"@trigger.dev/shopify": "0.1.22",
|
||||
"@trigger.dev/slack": "0.1.22",
|
||||
"@trigger.dev/whatsapp": "0.1.20",
|
||||
"@trigger.dev/common-schemas": "0.1.1",
|
||||
"create-trigger": "0.1.0",
|
||||
"emails": "1.0.0",
|
||||
"integration-catalog": "0.1.16",
|
||||
"@trigger.dev/integration-sdk": "0.1.17",
|
||||
"internal-bridge": "0.0.1",
|
||||
"internal-cli": "0.0.1",
|
||||
"internal-platform": "0.0.3",
|
||||
"internal-pulsar": "0.0.1",
|
||||
"@trigger.dev/sdk": "0.2.15"
|
||||
},
|
||||
"changesets": [
|
||||
"big-apples-reflect",
|
||||
"new-students-double",
|
||||
"ten-dancers-hang"
|
||||
]
|
||||
}
|
||||
@@ -1,5 +0,0 @@
|
||||
---
|
||||
"@trigger.dev/sdk": patch
|
||||
---
|
||||
|
||||
Added handly links to the dashboard in log feedback
|
||||
@@ -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`
|
||||
|
||||
@@ -9,16 +9,20 @@
|
||||
"start": "node dist/index.js",
|
||||
"dev": "concurrently \"tsup --watch\" \"nodemon -r dotenv/config -q 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("")}`,
|
||||
|
||||
Binary file not shown.
|
After Width: | Height: | Size: 5.5 KiB |
@@ -13,12 +13,17 @@ export function CopyText({
|
||||
className,
|
||||
onCopied,
|
||||
}: CopyTextProps) {
|
||||
const onClick = useCallback(() => {
|
||||
navigator.clipboard.writeText(value);
|
||||
if (onCopied) {
|
||||
onCopied();
|
||||
}
|
||||
}, [value, onCopied]);
|
||||
const onClick = useCallback(
|
||||
(event: React.MouseEvent<HTMLDivElement>) => {
|
||||
event.preventDefault();
|
||||
event.stopPropagation();
|
||||
navigator.clipboard.writeText(value);
|
||||
if (onCopied) {
|
||||
onCopied();
|
||||
}
|
||||
},
|
||||
[value, onCopied]
|
||||
);
|
||||
|
||||
return (
|
||||
<div onClick={onClick} className={`${className}`}>
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
import { CheckIcon, ClipboardIcon } from "@heroicons/react/24/outline";
|
||||
import classNames from "classnames";
|
||||
import { useCallback, useState } from "react";
|
||||
import { EnvironmentIcon } from "~/routes/resources/environment";
|
||||
import { CopyText } from "./CopyText";
|
||||
|
||||
const variantStyle = {
|
||||
@@ -16,6 +17,7 @@ const variantStyle = {
|
||||
|
||||
export type CopyTextButtonProps = {
|
||||
value: string;
|
||||
text?: string;
|
||||
className?: string;
|
||||
variant?: "slate" | "blue" | "darkTransparent" | "lightTransparent" | "text";
|
||||
};
|
||||
@@ -23,6 +25,7 @@ export type CopyTextButtonProps = {
|
||||
export function CopyTextButton({
|
||||
value,
|
||||
className,
|
||||
text,
|
||||
variant = "blue",
|
||||
}: CopyTextButtonProps) {
|
||||
const [copied, setCopied] = useState(false);
|
||||
@@ -58,7 +61,27 @@ export function CopyTextButton({
|
||||
);
|
||||
}
|
||||
|
||||
export function CopyTextPanel({ value, className }: CopyTextButtonProps) {
|
||||
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",
|
||||
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",
|
||||
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",
|
||||
};
|
||||
|
||||
export type CopyTextPanelProps = {
|
||||
value: string;
|
||||
text?: string;
|
||||
className?: string;
|
||||
variant?: "primary" | "slate" | "text";
|
||||
};
|
||||
|
||||
export function CopyTextPanel({
|
||||
value,
|
||||
text,
|
||||
className,
|
||||
variant = "primary",
|
||||
}: CopyTextPanelProps) {
|
||||
const [copied, setCopied] = useState(false);
|
||||
const onCopied = useCallback(() => {
|
||||
setCopied(true);
|
||||
@@ -67,21 +90,18 @@ export function CopyTextPanel({ value, className }: CopyTextButtonProps) {
|
||||
}, 1500);
|
||||
}, [setCopied]);
|
||||
return (
|
||||
<CopyText className={`${className}`} value={value} onCopied={onCopied}>
|
||||
<CopyText value={value} onCopied={onCopied} className="w-full">
|
||||
{copied ? (
|
||||
<div className={copyTextPanelStyles}>
|
||||
<span className="truncate font-mono text-sm">{value}</span>
|
||||
<div className={classNames(className, panelVariantStyle[variant])}>
|
||||
<span className="truncate font-mono text-sm">{text ?? value}</span>
|
||||
<CheckIcon className="h-5 w-5 min-w-[1.25rem] text-green-500" />
|
||||
</div>
|
||||
) : (
|
||||
<div className={copyTextPanelStyles}>
|
||||
<span className="truncate font-mono text-sm">{value}</span>
|
||||
<ClipboardIcon className="h-5 w-5 min-w-[1.25rem]" />
|
||||
<div className={classNames(className, panelVariantStyle[variant])}>
|
||||
<span className="truncate font-mono text-sm">{text ?? value}</span>
|
||||
<ClipboardIcon className="h-4 w-4 min-w-[1.25rem]" />
|
||||
</div>
|
||||
)}
|
||||
</CopyText>
|
||||
);
|
||||
}
|
||||
|
||||
const copyTextPanelStyles =
|
||||
"truncate bg-indigo-700/50 pl-3.5 pr-2 py-3 rounded border border-indigo-600 truncate flex items-center justify-between gap-2 hover:cursor-pointer hover:bg-indigo-600/50 hover:border-indigo-600 transition";
|
||||
|
||||
@@ -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 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
|
||||
);
|
||||
}
|
||||
|
||||
@@ -14,7 +14,7 @@ export function WorkflowConnections({
|
||||
connectionSlots,
|
||||
}: {
|
||||
className?: string;
|
||||
connectionSlots: ConnectionSlot[];
|
||||
connectionSlots: (ConnectionSlot & { type: "source" | "service" })[];
|
||||
}) {
|
||||
const organization = useCurrentOrganization();
|
||||
invariant(organization, "Organization not found");
|
||||
@@ -39,7 +39,7 @@ export function WorkflowConnections({
|
||||
{slot.integration?.name}
|
||||
</Header3>
|
||||
<ConnectionSelector
|
||||
type="service"
|
||||
type={slot.type}
|
||||
sourceServiceId={slot.id}
|
||||
organizationId={organization.id}
|
||||
integration={slot.integration}
|
||||
|
||||
@@ -10,7 +10,7 @@ export function AppLayout({
|
||||
}) {
|
||||
if (impersonationId) {
|
||||
return (
|
||||
<div className="grid h-full w-full grid-rows-[2rem_3rem_auto_2rem]">
|
||||
<div className="grid h-full w-full grid-rows-[2rem_2rem_3rem_auto_2rem]">
|
||||
<ImpersonationBanner impersonationId={impersonationId} />
|
||||
{children}
|
||||
</div>
|
||||
@@ -18,7 +18,7 @@ export function AppLayout({
|
||||
}
|
||||
|
||||
return (
|
||||
<div className="grid h-full w-full grid-rows-[3rem_auto_2rem]">
|
||||
<div className="grid h-full w-full grid-rows-[2rem_3rem_auto_2rem]">
|
||||
{children}
|
||||
</div>
|
||||
);
|
||||
@@ -26,7 +26,7 @@ export function AppLayout({
|
||||
|
||||
export function PublicAppLayout({ children }: { children: React.ReactNode }) {
|
||||
return (
|
||||
<div className="grid h-full w-full grid-rows-[5rem_auto_2rem]">
|
||||
<div className="grid h-full w-full grid-rows-[2rem_auto_auto_2rem]">
|
||||
{children}
|
||||
</div>
|
||||
);
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import classNames from "classnames";
|
||||
|
||||
const baseClasses = "px-12 py-10";
|
||||
const baseClasses = "px-4 py-4 md:px-8 md:py-6 lg:px-12 lg:py-10";
|
||||
|
||||
export function Container({
|
||||
children,
|
||||
|
||||
@@ -1,5 +1,10 @@
|
||||
import { Popover, Transition } from "@headlessui/react";
|
||||
import { BookmarkIcon, ChevronUpDownIcon } from "@heroicons/react/24/outline";
|
||||
import {
|
||||
BookmarkIcon,
|
||||
BuildingOffice2Icon,
|
||||
ChevronUpDownIcon,
|
||||
UserIcon,
|
||||
} from "@heroicons/react/24/outline";
|
||||
import { CheckIcon, PlusIcon } from "@heroicons/react/24/solid";
|
||||
import { Link } from "@remix-run/react";
|
||||
import classNames from "classnames";
|
||||
@@ -33,10 +38,10 @@ export function OrganizationMenu() {
|
||||
<Popover.Button
|
||||
className={`
|
||||
${open ? "" : "text-opacity-90"}
|
||||
inline-flex justify-between items-center rounded text-white bg-transparent pl-2.5 pr-2 py-2 text-sm hover:bg-slate-800 focus:outline-none`}
|
||||
inline-flex items-center justify-between rounded bg-transparent py-2 pl-2.5 pr-2 text-sm text-white hover:bg-slate-800 focus:outline-none`}
|
||||
>
|
||||
<BookmarkIcon
|
||||
className={`h-5 w-5 mr-2 ${dimmedClassNames}`}
|
||||
<BuildingOffice2Icon
|
||||
className={`mr-2 h-5 w-5 ${dimmedClassNames}`}
|
||||
aria-hidden="true"
|
||||
/>
|
||||
<span className="transition">
|
||||
@@ -67,9 +72,9 @@ export function OrganizationMenu() {
|
||||
leaveFrom="opacity-100 translate-y-0"
|
||||
leaveTo="opacity-0 translate-y-1"
|
||||
>
|
||||
<Popover.Panel className="absolute left-0 z-30 mt-3 w-screen min-w-max max-w-xs max-h-[70vh] translate-x-0 transform px-4 sm:px-0">
|
||||
<Popover.Panel className="absolute left-0 z-30 mt-3 max-h-[70vh] w-screen min-w-max max-w-xs translate-x-0 transform px-4 sm:px-0">
|
||||
<div className="overflow-hidden rounded-lg ring-1 ring-black ring-opacity-5">
|
||||
<div className="relative grid gap-y-1 py-1 bg-slate-700 grid-cols-1">
|
||||
<div className="relative grid grid-cols-1 gap-y-1 bg-slate-700 py-1">
|
||||
{organizations.map((organization) => {
|
||||
return (
|
||||
<Popover.Button
|
||||
@@ -77,16 +82,23 @@ export function OrganizationMenu() {
|
||||
as={Link}
|
||||
to={`/orgs/${organization.slug}`}
|
||||
className={classNames(
|
||||
"flex items-center justify-between gap-1.5 mx-1 px-3 py-2 text-white rounded hover:bg-slate-800 transition",
|
||||
"mx-1 flex items-center justify-between gap-1.5 rounded px-3 py-2 text-white transition hover:bg-slate-800",
|
||||
organization.slug === currentOrganization?.slug &&
|
||||
"!bg-slate-800"
|
||||
)}
|
||||
>
|
||||
<div className="flex items-center gap-2">
|
||||
<BookmarkIcon
|
||||
className="h-5 w-5 z-100"
|
||||
aria-hidden="true"
|
||||
/>
|
||||
{organization.title === "Personal Workspace" ? (
|
||||
<UserIcon
|
||||
className="z-100 h-5 w-5 text-slate-400"
|
||||
aria-hidden="true"
|
||||
/>
|
||||
) : (
|
||||
<BuildingOffice2Icon
|
||||
className="z-100 h-5 w-5 text-slate-400"
|
||||
aria-hidden="true"
|
||||
/>
|
||||
)}
|
||||
<span className="block truncate">
|
||||
{organization.title}
|
||||
</span>
|
||||
@@ -99,7 +111,7 @@ export function OrganizationMenu() {
|
||||
);
|
||||
})}
|
||||
<Popover.Button as={Link} to={`/orgs/new`}>
|
||||
<div className="flex items-center gap-2 mx-1 pl-2.5 py-2 rounded hover:bg-slate-800 transition">
|
||||
<div className="mx-1 flex items-center gap-2 rounded py-2 pl-2.5 transition hover:bg-slate-800">
|
||||
<PlusIcon
|
||||
className="h-5 w-5 text-green-500"
|
||||
aria-hidden="true"
|
||||
|
||||
@@ -1,29 +1,38 @@
|
||||
import {
|
||||
SquaresPlusIcon,
|
||||
EyeIcon,
|
||||
EyeSlashIcon,
|
||||
InformationCircleIcon,
|
||||
} from "@heroicons/react/20/solid";
|
||||
import {
|
||||
ArrowsRightLeftIcon,
|
||||
UsersIcon,
|
||||
ForwardIcon,
|
||||
ChevronLeftIcon,
|
||||
ArrowTopRightOnSquareIcon,
|
||||
PhoneArrowUpRightIcon,
|
||||
EnvelopeIcon,
|
||||
BeakerIcon,
|
||||
ClipboardDocumentCheckIcon,
|
||||
Squares2X2Icon,
|
||||
ChevronLeftIcon,
|
||||
Cog6ToothIcon,
|
||||
EnvelopeIcon,
|
||||
ForwardIcon,
|
||||
PhoneArrowUpRightIcon,
|
||||
PlusCircleIcon,
|
||||
Squares2X2Icon,
|
||||
SquaresPlusIcon,
|
||||
UsersIcon,
|
||||
} from "@heroicons/react/24/outline";
|
||||
import { Link, NavLink } from "@remix-run/react";
|
||||
import { useState } from "react";
|
||||
import invariant from "tiny-invariant";
|
||||
import { useCurrentEnvironment } from "~/hooks/useEnvironments";
|
||||
import {
|
||||
useCurrentOrganization,
|
||||
useOrganizations,
|
||||
} from "~/hooks/useOrganizations";
|
||||
import { useCurrentWorkflow } from "~/hooks/useWorkflows";
|
||||
import { EnvironmentIcon } from "~/routes/resources/environment";
|
||||
import { titleCase } from "~/utils";
|
||||
import { CopyTextPanel } from "../CopyTextButton";
|
||||
import { TertiaryA, TertiaryButton } from "../primitives/Buttons";
|
||||
import { Body } from "../primitives/text/Body";
|
||||
import { Header1 } from "../primitives/text/Headers";
|
||||
import invariant from "tiny-invariant";
|
||||
import { CopyText } from "../CopyText";
|
||||
import { useCurrentEnvironment } from "~/hooks/useEnvironments";
|
||||
import { Tooltip } from "../primitives/Tooltip";
|
||||
|
||||
export function SideMenuContainer({ children }: { children: React.ReactNode }) {
|
||||
return <div className="grid h-full grid-cols-[300px_2fr]">{children}</div>;
|
||||
@@ -160,6 +169,8 @@ function SideMenu({
|
||||
const organization = useCurrentOrganization();
|
||||
invariant(organization, "Organization must be defined");
|
||||
|
||||
const [isShowingKeys, setIsShowingKeys] = useState(false);
|
||||
|
||||
return (
|
||||
<div className="flex min-h-0 flex-1 flex-col border-r border-slate-800 bg-slate-950">
|
||||
<div className="flex flex-1 flex-col overflow-y-auto pb-4">
|
||||
@@ -199,36 +210,67 @@ function SideMenu({
|
||||
))}
|
||||
</div>
|
||||
<div className="flex flex-col gap-6">
|
||||
<ul className="ml-3 mr-2 flex flex-col gap-6">
|
||||
<ul className="ml-3 mr-2 flex flex-col gap-2">
|
||||
<li className="flex w-full items-center justify-between">
|
||||
<TertiaryA
|
||||
href="https://docs.trigger.dev/guides/environments"
|
||||
target="_blank"
|
||||
className="group flex items-center gap-1 transition"
|
||||
>
|
||||
<InformationCircleIcon className="h-4 w-4 text-slate-500 transition group-hover:text-slate-400" />
|
||||
<Body
|
||||
size="extra-small"
|
||||
className={`overflow-hidden text-slate-300 transition group-hover:text-slate-400 ${menuSmallTitleStyle}`}
|
||||
>
|
||||
API keys
|
||||
</Body>
|
||||
</TertiaryA>
|
||||
|
||||
{!isShowingKeys ? (
|
||||
<TertiaryButton
|
||||
onClick={() => setIsShowingKeys(true)}
|
||||
className="group mr-1.5 transition before:text-xs before:text-slate-400 hover:before:content-['Show_keys']"
|
||||
>
|
||||
<EyeIcon className="h-4 w-4 text-slate-500 transition group-hover:text-slate-400" />
|
||||
</TertiaryButton>
|
||||
) : (
|
||||
<TertiaryButton
|
||||
onClick={() => setIsShowingKeys(false)}
|
||||
className="group mr-1.5 transition before:text-xs before:text-slate-400 hover:before:content-['Hide_keys']"
|
||||
>
|
||||
<EyeSlashIcon className="h-4 w-4 text-slate-500 transition group-hover:text-slate-400" />
|
||||
</TertiaryButton>
|
||||
)}
|
||||
</li>
|
||||
{organization.environments.map((environment) => {
|
||||
return (
|
||||
<li
|
||||
<Tooltip
|
||||
key={environment.id}
|
||||
className="flex w-full flex-col justify-between gap-1.5"
|
||||
text={
|
||||
environment.slug === "live"
|
||||
? "Use in live / production"
|
||||
: "Use in dev / local"
|
||||
}
|
||||
>
|
||||
<div className="flex justify-between">
|
||||
<Body
|
||||
size="extra-small"
|
||||
className={`overflow-hidden text-slate-300 ${menuSmallTitleStyle}`}
|
||||
>
|
||||
{environment.slug} api key
|
||||
</Body>
|
||||
{/* <CopyTextButton
|
||||
variant="text"
|
||||
value={environment.apiKey}
|
||||
/> */}
|
||||
</div>
|
||||
<div className="relative select-all overflow-hidden rounded-sm border border-slate-800 p-1 pl-2 text-sm text-slate-400">
|
||||
<span className="pointer-events-none absolute right-7 top-0 block h-6 w-20 bg-gradient-to-r from-transparent to-slate-950"></span>
|
||||
<CopyText
|
||||
value={environment.apiKey}
|
||||
className="group absolute right-0 top-0 flex h-full w-7 items-center justify-center rounded-sm border-l border-slate-800 bg-slate-950 transition hover:cursor-pointer hover:bg-slate-900 active:bg-green-900"
|
||||
>
|
||||
<ClipboardDocumentCheckIcon className="h-5 w-5 group-active:text-green-500" />
|
||||
</CopyText>
|
||||
{environment.apiKey}
|
||||
</div>
|
||||
</li>
|
||||
<li className="flex w-full flex-col justify-between">
|
||||
<div className="relative flex items-center">
|
||||
<EnvironmentIcon
|
||||
slug={environment.slug}
|
||||
className="absolute top-4 left-2"
|
||||
/>
|
||||
<CopyTextPanel
|
||||
value={environment.apiKey}
|
||||
text={
|
||||
isShowingKeys
|
||||
? environment.apiKey
|
||||
: `${titleCase(environment.slug)}`
|
||||
}
|
||||
variant="slate"
|
||||
className="pl-6 text-slate-300 hover:text-slate-300"
|
||||
/>
|
||||
</div>
|
||||
</li>
|
||||
</Tooltip>
|
||||
);
|
||||
})}
|
||||
</ul>
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user