@frogbotai/piece-notion 0.26.0 → 0.28.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/actions/comments.d.ts +9 -1
- package/dist/actions/comments.d.ts.map +1 -1
- package/dist/actions/comments.js +2 -2
- package/dist/actions/comments.js.map +1 -1
- package/dist/actions/core.d.ts +91 -10
- package/dist/actions/core.d.ts.map +1 -1
- package/dist/actions/core.js +9 -9
- package/dist/actions/core.js.map +1 -1
- package/dist/actions/customApiCall.d.ts +2 -2
- package/dist/actions/customApiCall.d.ts.map +1 -1
- package/dist/actions/customApiCall.js +2 -2
- package/dist/actions/customApiCall.js.map +1 -1
- package/dist/actions/read.d.ts +35 -8
- package/dist/actions/read.d.ts.map +1 -1
- package/dist/actions/read.js +6 -6
- package/dist/actions/read.js.map +1 -1
- package/dist/define.d.ts +114 -0
- package/dist/define.d.ts.map +1 -0
- package/dist/define.js +3 -0
- package/dist/define.js.map +1 -0
- package/dist/index.d.ts +151 -35
- package/dist/index.d.ts.map +1 -1
- package/dist/triggers/polling.d.ts +14 -14
- package/dist/triggers/polling.d.ts.map +1 -1
- package/dist/triggers/polling.js +13 -10
- package/dist/triggers/polling.js.map +1 -1
- package/package.json +4 -4
- package/dist/definitions.d.ts +0 -66
- package/dist/definitions.d.ts.map +0 -1
- package/dist/definitions.js +0 -7
- package/dist/definitions.js.map +0 -1
|
@@ -30,7 +30,7 @@ export declare const newDatabaseItem: {
|
|
|
30
30
|
schedule?: string;
|
|
31
31
|
run(args: import("frogbot/pieces").PieceRunArgs<{
|
|
32
32
|
databaseId: string;
|
|
33
|
-
},
|
|
33
|
+
}, Record<string, never>, {
|
|
34
34
|
request: ({ method, path, query, body, signal, }: {
|
|
35
35
|
method?: string;
|
|
36
36
|
path: string;
|
|
@@ -49,7 +49,7 @@ export declare const newDatabaseItem: {
|
|
|
49
49
|
id: string;
|
|
50
50
|
}[]>;
|
|
51
51
|
}> & {
|
|
52
|
-
cursor?:
|
|
52
|
+
cursor?: import("frogbot/pieces").PieceJSON | undefined;
|
|
53
53
|
}): Promise<{
|
|
54
54
|
events: {
|
|
55
55
|
[x: string]: unknown;
|
|
@@ -61,10 +61,10 @@ export declare const newDatabaseItem: {
|
|
|
61
61
|
url?: string | undefined;
|
|
62
62
|
properties?: Record<string, unknown> | undefined;
|
|
63
63
|
}[];
|
|
64
|
-
cursor?:
|
|
64
|
+
cursor?: import("frogbot/pieces").PieceJSON | undefined;
|
|
65
65
|
}>;
|
|
66
66
|
} & {
|
|
67
|
-
slug: "newDatabaseItem"
|
|
67
|
+
slug: "newDatabaseItem";
|
|
68
68
|
};
|
|
69
69
|
export declare const updatedDatabaseItem: {
|
|
70
70
|
slug: string;
|
|
@@ -97,7 +97,7 @@ export declare const updatedDatabaseItem: {
|
|
|
97
97
|
schedule?: string;
|
|
98
98
|
run(args: import("frogbot/pieces").PieceRunArgs<{
|
|
99
99
|
databaseId: string;
|
|
100
|
-
},
|
|
100
|
+
}, Record<string, never>, {
|
|
101
101
|
request: ({ method, path, query, body, signal, }: {
|
|
102
102
|
method?: string;
|
|
103
103
|
path: string;
|
|
@@ -116,7 +116,7 @@ export declare const updatedDatabaseItem: {
|
|
|
116
116
|
id: string;
|
|
117
117
|
}[]>;
|
|
118
118
|
}> & {
|
|
119
|
-
cursor?:
|
|
119
|
+
cursor?: import("frogbot/pieces").PieceJSON | undefined;
|
|
120
120
|
}): Promise<{
|
|
121
121
|
events: {
|
|
122
122
|
[x: string]: unknown;
|
|
@@ -128,10 +128,10 @@ export declare const updatedDatabaseItem: {
|
|
|
128
128
|
url?: string | undefined;
|
|
129
129
|
properties?: Record<string, unknown> | undefined;
|
|
130
130
|
}[];
|
|
131
|
-
cursor?:
|
|
131
|
+
cursor?: import("frogbot/pieces").PieceJSON | undefined;
|
|
132
132
|
}>;
|
|
133
133
|
} & {
|
|
134
|
-
slug: "
|
|
134
|
+
slug: "updatedDatabaseItem";
|
|
135
135
|
};
|
|
136
136
|
export declare const newComment: {
|
|
137
137
|
slug: string;
|
|
@@ -162,7 +162,7 @@ export declare const newComment: {
|
|
|
162
162
|
schedule?: string;
|
|
163
163
|
run(args: import("frogbot/pieces").PieceRunArgs<{
|
|
164
164
|
pageId: string;
|
|
165
|
-
},
|
|
165
|
+
}, Record<string, never>, {
|
|
166
166
|
request: ({ method, path, query, body, signal, }: {
|
|
167
167
|
method?: string;
|
|
168
168
|
path: string;
|
|
@@ -181,7 +181,7 @@ export declare const newComment: {
|
|
|
181
181
|
id: string;
|
|
182
182
|
}[]>;
|
|
183
183
|
}> & {
|
|
184
|
-
cursor?:
|
|
184
|
+
cursor?: import("frogbot/pieces").PieceJSON | undefined;
|
|
185
185
|
}): Promise<{
|
|
186
186
|
events: {
|
|
187
187
|
[x: string]: unknown;
|
|
@@ -192,7 +192,7 @@ export declare const newComment: {
|
|
|
192
192
|
discussion_id?: string | undefined;
|
|
193
193
|
rich_text?: unknown[] | undefined;
|
|
194
194
|
}[];
|
|
195
|
-
cursor?:
|
|
195
|
+
cursor?: import("frogbot/pieces").PieceJSON | undefined;
|
|
196
196
|
}>;
|
|
197
197
|
} & {
|
|
198
198
|
slug: "newComment";
|
|
@@ -224,7 +224,7 @@ export declare const updatedPage: {
|
|
|
224
224
|
} & {
|
|
225
225
|
type: "polling";
|
|
226
226
|
schedule?: string;
|
|
227
|
-
run(args: import("frogbot/pieces").PieceRunArgs<Record<string, never>,
|
|
227
|
+
run(args: import("frogbot/pieces").PieceRunArgs<Record<string, never>, Record<string, never>, {
|
|
228
228
|
request: ({ method, path, query, body, signal, }: {
|
|
229
229
|
method?: string;
|
|
230
230
|
path: string;
|
|
@@ -243,7 +243,7 @@ export declare const updatedPage: {
|
|
|
243
243
|
id: string;
|
|
244
244
|
}[]>;
|
|
245
245
|
}> & {
|
|
246
|
-
cursor?:
|
|
246
|
+
cursor?: import("frogbot/pieces").PieceJSON | undefined;
|
|
247
247
|
}): Promise<{
|
|
248
248
|
events: {
|
|
249
249
|
[x: string]: unknown;
|
|
@@ -255,7 +255,7 @@ export declare const updatedPage: {
|
|
|
255
255
|
url?: string | undefined;
|
|
256
256
|
properties?: Record<string, unknown> | undefined;
|
|
257
257
|
}[];
|
|
258
|
-
cursor?:
|
|
258
|
+
cursor?: import("frogbot/pieces").PieceJSON | undefined;
|
|
259
259
|
}>;
|
|
260
260
|
} & {
|
|
261
261
|
slug: "updatedPage";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"polling.d.ts","sourceRoot":"","sources":["../../src/triggers/polling.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;
|
|
1
|
+
{"version":3,"file":"polling.d.ts","sourceRoot":"","sources":["../../src/triggers/polling.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAiDxB,eAAO,MAAM,eAAe;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;kBAnCxB,CAAD;;iBACQ,CAAC;gBACR,CAAA;kBACA,CAAF;;;;gBAoCW,CAAC;iBACc,CAAC;kBAE3B,CAAA;;;;;;;;;;;;;;;;;;;;;;;CAP+E,CAAC;AAClF,eAAO,MAAM,mBAAmB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;kBApC5B,CAAD;;iBACQ,CAAC;gBACR,CAAA;kBACA,CAAF;;;;gBAoCW,CAAC;iBACc,CAAC;kBAE3B,CAAA;;;;;;;;;;;;;;;;;;;;;;;CAN2F,CAAC;AAE9F,eAAO,MAAM,UAAU;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;kBAtCnB,CAAD;;iBACQ,CAAC;gBACR,CAAA;kBACA,CAAF;;;;gBAoCW,CAAC;iBACc,CAAC;kBAE3B,CAAA;;;;;;;;;;;;;;;;;;;;;;CA4BA,CAAC;AAEH,eAAO,MAAM,WAAW;;;;;;;;;;;;;;;;;;;;;;;;;;;;;kBAxEpB,CAAD;;iBACQ,CAAC;gBACR,CAAA;kBACA,CAAF;;;;gBAoCW,CAAC;iBACc,CAAC;kBAE3B,CAAA;;;;;;;;;;;;;;;;;;;;;;;CAoEA,CAAC"}
|
package/dist/triggers/polling.js
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
2
|
import { notionId } from '../config.js';
|
|
3
|
-
import {
|
|
3
|
+
import { definePollingTrigger } from '../define.js';
|
|
4
4
|
import { notionComment, notionPage } from '../schemas.js';
|
|
5
5
|
function databaseTrigger(slug, timestamp) {
|
|
6
|
-
return
|
|
6
|
+
return definePollingTrigger({
|
|
7
7
|
slug,
|
|
8
8
|
description: `Emit ${timestamp === 'created_time' ? 'new' : 'updated'} database items.`,
|
|
9
9
|
type: 'polling',
|
|
@@ -12,9 +12,10 @@ function databaseTrigger(slug, timestamp) {
|
|
|
12
12
|
output: notionPage,
|
|
13
13
|
sample: { object: 'page', id: 'example' },
|
|
14
14
|
async run({ client, input, cursor, req }) {
|
|
15
|
+
const since = typeof cursor === 'number' ? cursor : undefined;
|
|
15
16
|
const now = Date.now();
|
|
16
|
-
const filter =
|
|
17
|
-
? { timestamp, [timestamp]: { on_or_after: new Date(
|
|
17
|
+
const filter = since
|
|
18
|
+
? { timestamp, [timestamp]: { on_or_after: new Date(since).toISOString() } }
|
|
18
19
|
: undefined;
|
|
19
20
|
const pages = z.array(notionPage).parse(await client.listAll({
|
|
20
21
|
path: `/databases/${input.databaseId}/query`,
|
|
@@ -24,7 +25,7 @@ function databaseTrigger(slug, timestamp) {
|
|
|
24
25
|
const seen = new Set();
|
|
25
26
|
const events = pages.filter((page) => {
|
|
26
27
|
const time = page[timestamp];
|
|
27
|
-
if (seen.has(page.id) || (
|
|
28
|
+
if (seen.has(page.id) || (since && (time === undefined || Date.parse(time) <= since))) {
|
|
28
29
|
return false;
|
|
29
30
|
}
|
|
30
31
|
seen.add(page.id);
|
|
@@ -36,7 +37,7 @@ function databaseTrigger(slug, timestamp) {
|
|
|
36
37
|
}
|
|
37
38
|
export const newDatabaseItem = databaseTrigger('newDatabaseItem', 'created_time');
|
|
38
39
|
export const updatedDatabaseItem = databaseTrigger('updatedDatabaseItem', 'last_edited_time');
|
|
39
|
-
export const newComment =
|
|
40
|
+
export const newComment = definePollingTrigger({
|
|
40
41
|
slug: 'newComment',
|
|
41
42
|
description: 'Emit comments added to a page.',
|
|
42
43
|
type: 'polling',
|
|
@@ -45,6 +46,7 @@ export const newComment = defineNotionTrigger({
|
|
|
45
46
|
output: notionComment,
|
|
46
47
|
sample: { object: 'comment', id: 'example', created_time: '2026-01-01T00:00:00.000Z' },
|
|
47
48
|
async run({ client, input, cursor, req }) {
|
|
49
|
+
const since = typeof cursor === 'number' ? cursor : undefined;
|
|
48
50
|
const now = Date.now();
|
|
49
51
|
const comments = z.array(notionComment).parse(await client.listAll({
|
|
50
52
|
path: '/comments',
|
|
@@ -53,7 +55,7 @@ export const newComment = defineNotionTrigger({
|
|
|
53
55
|
}));
|
|
54
56
|
const seen = new Set();
|
|
55
57
|
const events = comments.filter((comment) => {
|
|
56
|
-
if (seen.has(comment.id) || (
|
|
58
|
+
if (seen.has(comment.id) || (since && Date.parse(comment.created_time) <= since)) {
|
|
57
59
|
return false;
|
|
58
60
|
}
|
|
59
61
|
seen.add(comment.id);
|
|
@@ -62,7 +64,7 @@ export const newComment = defineNotionTrigger({
|
|
|
62
64
|
return { events, cursor: now };
|
|
63
65
|
},
|
|
64
66
|
});
|
|
65
|
-
export const updatedPage =
|
|
67
|
+
export const updatedPage = definePollingTrigger({
|
|
66
68
|
slug: 'updatedPage',
|
|
67
69
|
description: 'Emit updated workspace pages.',
|
|
68
70
|
type: 'polling',
|
|
@@ -71,6 +73,7 @@ export const updatedPage = defineNotionTrigger({
|
|
|
71
73
|
output: notionPage,
|
|
72
74
|
sample: { object: 'page', id: 'example' },
|
|
73
75
|
async run({ client, cursor, req }) {
|
|
76
|
+
const since = typeof cursor === 'number' ? cursor : undefined;
|
|
74
77
|
const now = Date.now();
|
|
75
78
|
const pages = z.array(notionPage).parse(await client.listAll({
|
|
76
79
|
path: '/search',
|
|
@@ -83,8 +86,8 @@ export const updatedPage = defineNotionTrigger({
|
|
|
83
86
|
const seen = new Set();
|
|
84
87
|
const events = pages.filter((page) => {
|
|
85
88
|
if (seen.has(page.id) ||
|
|
86
|
-
(
|
|
87
|
-
(page.last_edited_time === undefined || Date.parse(page.last_edited_time) <=
|
|
89
|
+
(since &&
|
|
90
|
+
(page.last_edited_time === undefined || Date.parse(page.last_edited_time) <= since))) {
|
|
88
91
|
return false;
|
|
89
92
|
}
|
|
90
93
|
seen.add(page.id);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"polling.js","sourceRoot":"","sources":["../../src/triggers/polling.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,OAAO,EAAE,QAAQ,EAAE,MAAM,cAAc,CAAC;AACxC,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"polling.js","sourceRoot":"","sources":["../../src/triggers/polling.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,OAAO,EAAE,QAAQ,EAAE,MAAM,cAAc,CAAC;AACxC,OAAO,EAAE,oBAAoB,EAAE,MAAM,cAAc,CAAC;AACpD,OAAO,EAAE,aAAa,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAE1D,SAAS,eAAe,CACtB,IAAW,EACX,SAA8C;IAE9C,OAAO,oBAAoB,CAAC;QAC1B,IAAI;QACJ,WAAW,EAAE,QAAQ,SAAS,KAAK,cAAc,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,SAAS,kBAAkB;QACvF,IAAI,EAAE,SAAS;QACf,QAAQ,EAAE,aAAa;QACvB,KAAK,EAAE,CAAC,CAAC,MAAM,CAAC,EAAE,UAAU,EAAE,QAAQ,EAAE,CAAC;QACzC,MAAM,EAAE,UAAU;QAClB,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,MAAM,EAAE,EAAE,QAAQ,EAAE,QAAQ,EAAE,KAAK,EAAE,MAAM,EAAE;gBAC7C,IAAI,EAAE,EAAE,SAAS,EAAE,kBAAkB,EAAE,SAAS,EAAE,YAAY,EAAE;aACjE;YACD,MAAM,EAAE,GAAG,CAAC,MAAM,IAAI,SAAS;SAChC,CAAC,CACH,CAAC;QACF,MAAM,IAAI,GAAG,IAAI,GAAG,EAAU,CAAC;QAC/B,MAAM,MAAM,GAAG,KAAK,CAAC,MAAM,CAAC,CAAC,IAAI,EAAE,EAAE;YACnC,IACE,IAAI,CAAC,GAAG,CAAC,IAAI,CAAC,EAAE,CAAC;gBACjB,CAAC,KAAK;oBACJ,CAAC,IAAI,CAAC,gBAAgB,KAAK,SAAS,IAAI,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,gBAAgB,CAAC,IAAI,KAAK,CAAC,CAAC,EACtF,CAAC;gBACD,OAAO,KAAK,CAAC;YACf,CAAC;YAED,IAAI,CAAC,GAAG,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;YAElB,OAAO,IAAI,CAAC;QACd,CAAC,CAAC,CAAC;QAEH,OAAO,EAAE,MAAM,EAAE,MAAM,EAAE,GAAG,EAAE,CAAC;IACjC,CAAC;CACF,CAAC,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@frogbotai/piece-notion",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.28.0",
|
|
4
4
|
"description": "notion tools for FrogBot.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"author": "Colby Gilbert",
|
|
@@ -22,17 +22,17 @@
|
|
|
22
22
|
"zod": "4.1.5"
|
|
23
23
|
},
|
|
24
24
|
"peerDependencies": {
|
|
25
|
-
"frogbot": "0.
|
|
25
|
+
"frogbot": "0.28.0"
|
|
26
26
|
},
|
|
27
27
|
"devDependencies": {
|
|
28
28
|
"typescript": "5.6.2",
|
|
29
|
-
"frogbot": "0.
|
|
29
|
+
"frogbot": "0.28.0"
|
|
30
30
|
},
|
|
31
31
|
"publishConfig": {
|
|
32
32
|
"access": "public"
|
|
33
33
|
},
|
|
34
34
|
"scripts": {
|
|
35
|
-
"build": "tsc -p tsconfig.json",
|
|
35
|
+
"build": "rm -rf dist && tsc -p tsconfig.json",
|
|
36
36
|
"clean": "rm -rf dist",
|
|
37
37
|
"typecheck": "tsc --noEmit"
|
|
38
38
|
}
|
package/dist/definitions.d.ts
DELETED
|
@@ -1,66 +0,0 @@
|
|
|
1
|
-
import type { PieceActionDefinition, PiecePollingTrigger } from 'frogbot/pieces';
|
|
2
|
-
import type { z } from 'zod';
|
|
3
|
-
import type { NotionClient } from './client.js';
|
|
4
|
-
export declare function defineNotionAction<const TSlug extends string, TInput extends z.ZodType, TOutput extends z.ZodType>(definition: PieceActionDefinition<TInput, TOutput, object, NotionClient> & {
|
|
5
|
-
slug: TSlug;
|
|
6
|
-
}): PieceActionDefinition<TInput, TOutput, object, {
|
|
7
|
-
request: ({ method, path, query, body, signal, }: {
|
|
8
|
-
method?: string;
|
|
9
|
-
path: string;
|
|
10
|
-
query?: Record<string, string | number | boolean | undefined>;
|
|
11
|
-
body?: unknown;
|
|
12
|
-
signal?: AbortSignal;
|
|
13
|
-
}) => Promise<unknown>;
|
|
14
|
-
listAll: ({ path, body, query, signal, }: {
|
|
15
|
-
path: string;
|
|
16
|
-
body?: Record<string, unknown>;
|
|
17
|
-
query?: Record<string, string | number | boolean | undefined>;
|
|
18
|
-
signal?: AbortSignal;
|
|
19
|
-
}) => Promise<{
|
|
20
|
-
[x: string]: unknown;
|
|
21
|
-
object: string;
|
|
22
|
-
id: string;
|
|
23
|
-
}[]>;
|
|
24
|
-
}> & {
|
|
25
|
-
slug: TSlug;
|
|
26
|
-
};
|
|
27
|
-
export declare function defineNotionTrigger<const TSlug extends string, TInput extends z.ZodType, TOutput extends z.ZodType>(definition: PiecePollingTrigger<TInput, TOutput, object, NotionClient, number> & {
|
|
28
|
-
slug: TSlug;
|
|
29
|
-
}): {
|
|
30
|
-
slug: string;
|
|
31
|
-
label?: string;
|
|
32
|
-
description: string;
|
|
33
|
-
input: TInput;
|
|
34
|
-
output?: TOutput | undefined;
|
|
35
|
-
sample?: (TOutput extends z.ZodType<unknown, unknown, z.core.$ZodTypeInternals<unknown, unknown>> ? z.core.output<TOutput> : import("frogbot/pieces").PieceJSON) | undefined;
|
|
36
|
-
} & {
|
|
37
|
-
type: "polling";
|
|
38
|
-
schedule?: string;
|
|
39
|
-
run(args: import("frogbot/pieces").PieceRunArgs<z.core.output<TInput>, object, {
|
|
40
|
-
request: ({ method, path, query, body, signal, }: {
|
|
41
|
-
method?: string;
|
|
42
|
-
path: string;
|
|
43
|
-
query?: Record<string, string | number | boolean | undefined>;
|
|
44
|
-
body?: unknown;
|
|
45
|
-
signal?: AbortSignal;
|
|
46
|
-
}) => Promise<unknown>;
|
|
47
|
-
listAll: ({ path, body, query, signal, }: {
|
|
48
|
-
path: string;
|
|
49
|
-
body?: Record<string, unknown>;
|
|
50
|
-
query?: Record<string, string | number | boolean | undefined>;
|
|
51
|
-
signal?: AbortSignal;
|
|
52
|
-
}) => Promise<{
|
|
53
|
-
[x: string]: unknown;
|
|
54
|
-
object: string;
|
|
55
|
-
id: string;
|
|
56
|
-
}[]>;
|
|
57
|
-
}> & {
|
|
58
|
-
cursor?: number | undefined;
|
|
59
|
-
}): Promise<{
|
|
60
|
-
events: (TOutput extends z.ZodType<unknown, unknown, z.core.$ZodTypeInternals<unknown, unknown>> ? z.core.output<TOutput> : import("frogbot/pieces").PieceJSON)[];
|
|
61
|
-
cursor?: number | undefined;
|
|
62
|
-
}>;
|
|
63
|
-
} & {
|
|
64
|
-
slug: TSlug;
|
|
65
|
-
};
|
|
66
|
-
//# sourceMappingURL=definitions.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"definitions.d.ts","sourceRoot":"","sources":["../src/definitions.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,qBAAqB,EAAE,mBAAmB,EAAE,MAAM,gBAAgB,CAAC;AACjF,OAAO,KAAK,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAE7B,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAEhD,wBAAgB,kBAAkB,CAChC,KAAK,CAAC,KAAK,SAAS,MAAM,EAC1B,MAAM,SAAS,CAAC,CAAC,OAAO,EACxB,OAAO,SAAS,CAAC,CAAC,OAAO,EACzB,UAAU,EAAE,qBAAqB,CAAC,MAAM,EAAE,OAAO,EAAE,MAAM,EAAE,YAAY,CAAC,GAAG;IAAE,IAAI,EAAE,KAAK,CAAA;CAAE;;cAK1E,CAAC;;aACO,CAAC;YAGtB,CAAC;cAAqB,CAAC;;;;YAI2jC,CAAC;aAAoC,CAAC;cAAwC,CAAC;;;;;;;UAbjlC,KAAK;EAEzF;AAED,wBAAgB,mBAAmB,CACjC,KAAK,CAAC,KAAK,SAAS,MAAM,EAC1B,MAAM,SAAS,CAAC,CAAC,OAAO,EACxB,OAAO,SAAS,CAAC,CAAC,OAAO,EAEzB,UAAU,EAAE,mBAAmB,CAAC,MAAM,EAAE,OAAO,EAAE,MAAM,EAAE,YAAY,EAAE,MAAM,CAAC,GAAG;IAAE,IAAI,EAAE,KAAK,CAAA;CAAE;;;;;;;;;;;;kBAJhF,CAAC;;iBACO,CAAC;gBAGtB,CAAC;kBAAqB,CAAC;;;;gBAI2jC,CAAC;iBAAoC,CAAC;kBAAwC,CAAC;;;;;;;;;;;;;UAJ3kC,KAAK;EAG/F"}
|
package/dist/definitions.js
DELETED
package/dist/definitions.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"definitions.js","sourceRoot":"","sources":["../src/definitions.ts"],"names":[],"mappings":"AAKA,MAAM,UAAU,kBAAkB,CAIhC,UAA0F;IAC1F,OAAO,UAAU,CAAC;AACpB,CAAC;AAED,MAAM,UAAU,mBAAmB,CAKjC,UAAgG;IAEhG,OAAO,UAAU,CAAC;AACpB,CAAC"}
|