@runnerpro/backend 1.1.0 → 1.1.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/lib/cjs/notion/index.js
CHANGED
|
@@ -11,8 +11,16 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
11
11
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
12
|
exports.NOTION_DATABASES_ID = exports.notionAddPage = exports.notionGetDatabase = exports.notionGetUsers = void 0;
|
|
13
13
|
const client_1 = require("@notionhq/client");
|
|
14
|
+
/*
|
|
15
|
+
Obtener ID de una BBDD de Notion
|
|
16
|
+
1º Ir al link de la base de datos (no a la página, si no a la BBDD directamente)
|
|
17
|
+
2º Coger el ID de la url -> notion.so/ID?v=VERSION
|
|
18
|
+
3º Separar el ID en - con en los mimos lugares que las otras BBDD
|
|
19
|
+
4º Arriba a la derecha en los 3 puntos horizontales -> Conexiones -> Conectar con API (logo de RunnerPro)
|
|
20
|
+
*/
|
|
14
21
|
const NOTION_DATABASES_ID = {
|
|
15
22
|
REGISTRADOS_PRUEBA_7_DIAS: '25732354-92bd-4bb5-8937-0ad583b795ab',
|
|
23
|
+
OBSERVAR_CLIENTE: '47fc4035-7028-41c2-8b81-8e91d44a989b',
|
|
16
24
|
};
|
|
17
25
|
exports.NOTION_DATABASES_ID = NOTION_DATABASES_ID;
|
|
18
26
|
const getNotionDatabaseProperties = (databaseId) => __awaiter(void 0, void 0, void 0, function* () {
|
|
@@ -37,6 +45,8 @@ const notionGetDatabase = (databaseId) => {
|
|
|
37
45
|
};
|
|
38
46
|
exports.notionGetDatabase = notionGetDatabase;
|
|
39
47
|
const notionAddPage = (databaseId, values) => __awaiter(void 0, void 0, void 0, function* () {
|
|
48
|
+
if (['DEV', 'SBX'].includes(process.env.NODE_ENV || ''))
|
|
49
|
+
return;
|
|
40
50
|
const properties = yield getNotionDatabaseProperties(databaseId);
|
|
41
51
|
// Transform values into properties format
|
|
42
52
|
const propertiesValues = {};
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
declare const NOTION_DATABASES_ID: {
|
|
2
2
|
REGISTRADOS_PRUEBA_7_DIAS: string;
|
|
3
|
+
OBSERVAR_CLIENTE: string;
|
|
3
4
|
};
|
|
4
5
|
declare const notionGetUsers: () => Promise<import("@notionhq/client/build/src/api-endpoints").ListUsersResponse>;
|
|
5
6
|
declare const notionGetDatabase: (databaseId: any) => Promise<(import("@notionhq/client/build/src/api-endpoints").PartialDatabaseObjectResponse | import("@notionhq/client/build/src/api-endpoints").DatabaseObjectResponse | import("@notionhq/client/build/src/api-endpoints").PageObjectResponse | import("@notionhq/client/build/src/api-endpoints").PartialPageObjectResponse)[]>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/notion/index.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/notion/index.ts"],"names":[],"mappings":"AASA,QAAA,MAAM,mBAAmB;;;CAGxB,CAAC;AAcF,QAAA,MAAM,cAAc,qFAEnB,CAAC;AAEF,QAAA,MAAM,iBAAiB,uVAMtB,CAAC;AAEF,QAAA,MAAM,aAAa,kHA0ClB,CAAC;AAEF,OAAO,EAAE,cAAc,EAAE,iBAAiB,EAAE,aAAa,EAAE,mBAAmB,EAAE,CAAC"}
|