@nx-ddd/notion 19.0.0-preview.9 → 19.1.1

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.
Files changed (55) hide show
  1. package/fesm2022/nx-ddd-notion.mjs +540 -0
  2. package/fesm2022/nx-ddd-notion.mjs.map +1 -0
  3. package/index.d.ts +593 -6
  4. package/package.json +18 -12
  5. package/README.md +0 -11
  6. package/_testing/entity.d.ts +0 -20
  7. package/_testing/entity.js +0 -44
  8. package/_testing/entity.js.map +0 -1
  9. package/_testing/index.d.ts +0 -1
  10. package/_testing/index.js +0 -5
  11. package/_testing/index.js.map +0 -1
  12. package/converter/converter.d.ts +0 -7
  13. package/converter/converter.js +0 -37
  14. package/converter/converter.js.map +0 -1
  15. package/converter/index.d.ts +0 -1
  16. package/converter/index.js +0 -5
  17. package/converter/index.js.map +0 -1
  18. package/decorators/decorators.d.ts +0 -50
  19. package/decorators/decorators.js +0 -58
  20. package/decorators/decorators.js.map +0 -1
  21. package/decorators/index.d.ts +0 -1
  22. package/decorators/index.js +0 -5
  23. package/decorators/index.js.map +0 -1
  24. package/index.js +0 -10
  25. package/index.js.map +0 -1
  26. package/notion/index.d.ts +0 -1
  27. package/notion/index.js +0 -5
  28. package/notion/index.js.map +0 -1
  29. package/notion/notion.service.d.ts +0 -8
  30. package/notion/notion.service.impl.d.ts +0 -30
  31. package/notion/notion.service.impl.js +0 -142
  32. package/notion/notion.service.impl.js.map +0 -1
  33. package/notion/notion.service.js +0 -12
  34. package/notion/notion.service.js.map +0 -1
  35. package/query/index.d.ts +0 -1
  36. package/query/index.js +0 -5
  37. package/query/index.js.map +0 -1
  38. package/query/query.d.ts +0 -168
  39. package/query/query.js +0 -122
  40. package/query/query.js.map +0 -1
  41. package/query-builder/index.d.ts +0 -1
  42. package/query-builder/index.js +0 -5
  43. package/query-builder/index.js.map +0 -1
  44. package/query-builder/query-builder.d.ts +0 -27
  45. package/query-builder/query-builder.js +0 -30
  46. package/query-builder/query-builder.js.map +0 -1
  47. package/repository/index.d.ts +0 -1
  48. package/repository/index.js +0 -5
  49. package/repository/index.js.map +0 -1
  50. package/repository/repository.d.ts +0 -48
  51. package/repository/repository.js +0 -112
  52. package/repository/repository.js.map +0 -1
  53. package/utils.d.ts +0 -252
  54. package/utils.js +0 -184
  55. package/utils.js.map +0 -1
package/index.d.ts CHANGED
@@ -1,6 +1,593 @@
1
- export * from './converter';
2
- export * from './decorators';
3
- export * from './query';
4
- export * from './query-builder';
5
- export * from './repository';
6
- export * from './utils';
1
+ import * as _notionhq_client_build_src_api_endpoints from '@notionhq/client/build/src/api-endpoints';
2
+ import { PageObjectResponse, PartialPageObjectResponse, PartialDatabaseObjectResponse, DatabaseObjectResponse } from '@notionhq/client/build/src/api-endpoints';
3
+ import { Type, Entity, Repository } from '@nx-ddd/common/domain';
4
+ import * as i0 from '@angular/core';
5
+ import { InjectionToken } from '@angular/core';
6
+ import { Client } from '@notionhq/client';
7
+ import { Observable } from 'rxjs';
8
+ import dayjs from 'dayjs';
9
+
10
+ declare class NotionHelper {
11
+ static fromNotion<E>(page: PageObjectResponse | PartialPageObjectResponse | PartialDatabaseObjectResponse | DatabaseObjectResponse, Entity: Type<E>): E;
12
+ static toNotion<E>(entity: Partial<E>, Entity: Type<E>): object;
13
+ }
14
+ declare abstract class NotionConverter<E> {
15
+ protected abstract Entity: any;
16
+ fromNotion(page: PageObjectResponse | PartialPageObjectResponse | PartialDatabaseObjectResponse | DatabaseObjectResponse): E;
17
+ toNotion(entity: Partial<E>): object;
18
+ }
19
+ declare function createConverter<E = any>(Entity: any): NotionConverter<E>;
20
+
21
+ declare const NOTION_ANNOTATIONS = "notion_annotations";
22
+ type NotionFieldType = 'title' | 'url' | 'rich_text' | 'relation' | 'status' | 'formula' | 'rollup' | 'timestamp' | 'number' | 'created_time' | 'last_edited_time' | 'date' | 'select' | 'phone_number' | 'email' | 'checkbox' | 'created_by' | 'files' | 'last_edited_by' | 'multi_select' | 'people' | 'unique_id';
23
+ interface NotionAnnotation<T extends object = undefined> {
24
+ type: NotionFieldType;
25
+ fieldName: string;
26
+ propName: string;
27
+ options?: T;
28
+ }
29
+ declare const Title: (name?: string, options?: undefined) => (target: any, propName: string) => void;
30
+ declare const Url: (name?: string, options?: undefined) => (target: any, propName: string) => void;
31
+ declare const RichText: (name?: string, options?: undefined) => (target: any, propName: string) => void;
32
+ declare const Relation: (name?: string, options?: Partial<{
33
+ multi: boolean;
34
+ }>) => (target: any, propName: string) => void;
35
+ declare const Status: (name?: string, options?: undefined) => (target: any, propName: string) => void;
36
+ declare const Formula: (name?: string, options?: undefined) => (target: any, propName: string) => void;
37
+ declare const Rollup: (name?: string, options?: Partial<{
38
+ multi: boolean;
39
+ }>) => (target: any, propName: string) => void;
40
+ declare const Timestamp: (name?: string, options?: undefined) => (target: any, propName: string) => void;
41
+ declare const Number: (name?: string, options?: undefined) => (target: any, propName: string) => void;
42
+ declare const CreatedTime: (name?: string, options?: undefined) => (target: any, propName: string) => void;
43
+ declare const LastEditedTime: (name?: string, options?: undefined) => (target: any, propName: string) => void;
44
+ declare const Date$1: (name?: string, options?: undefined) => (target: any, propName: string) => void;
45
+ declare const Select: (name?: string, options?: undefined) => (target: any, propName: string) => void;
46
+ declare const PhoneNumber: (name?: string, options?: undefined) => (target: any, propName: string) => void;
47
+ declare const Email: (name?: string, options?: undefined) => (target: any, propName: string) => void;
48
+ declare const UniqueID: (name?: string, options?: undefined) => (target: any, propName: string) => void;
49
+ declare const Notion: {
50
+ Title: (name?: string, options?: undefined) => (target: any, propName: string) => void;
51
+ Url: (name?: string, options?: undefined) => (target: any, propName: string) => void;
52
+ RichText: (name?: string, options?: undefined) => (target: any, propName: string) => void;
53
+ Relation: (name?: string, options?: Partial<{
54
+ multi: boolean;
55
+ }>) => (target: any, propName: string) => void;
56
+ Status: (name?: string, options?: undefined) => (target: any, propName: string) => void;
57
+ Formula: (name?: string, options?: undefined) => (target: any, propName: string) => void;
58
+ Rollup: (name?: string, options?: Partial<{
59
+ multi: boolean;
60
+ }>) => (target: any, propName: string) => void;
61
+ Timestamp: (name?: string, options?: undefined) => (target: any, propName: string) => void;
62
+ Number: (name?: string, options?: undefined) => (target: any, propName: string) => void;
63
+ CreatedTime: (name?: string, options?: undefined) => (target: any, propName: string) => void;
64
+ LastEditedTime: (name?: string, options?: undefined) => (target: any, propName: string) => void;
65
+ Date: (name?: string, options?: undefined) => (target: any, propName: string) => void;
66
+ Select: (name?: string, options?: undefined) => (target: any, propName: string) => void;
67
+ PhoneNumber: (name?: string, options?: undefined) => (target: any, propName: string) => void;
68
+ Email: (name?: string, options?: undefined) => (target: any, propName: string) => void;
69
+ UniqueID: (name?: string, options?: undefined) => (target: any, propName: string) => void;
70
+ };
71
+
72
+ declare class NotionService {
73
+ private config;
74
+ private notionClient;
75
+ private cache;
76
+ retrievePage(pageId: string): Promise<_notionhq_client_build_src_api_endpoints.GetPageResponse>;
77
+ updatePage(pageId: string, properties: any): Promise<_notionhq_client_build_src_api_endpoints.UpdatePageResponse>;
78
+ deletePage(pageId: string): Promise<void>;
79
+ retrieveDatabase(databaseId: string): Promise<_notionhq_client_build_src_api_endpoints.GetDatabaseResponse>;
80
+ updateDatabase(databaseId: string, properties: any): Promise<_notionhq_client_build_src_api_endpoints.UpdateDatabaseResponse>;
81
+ retrieveBlock(blockId: string): Promise<_notionhq_client_build_src_api_endpoints.GetBlockResponse>;
82
+ search(params: Parameters<typeof this$1.notionClient.search>[0]): Promise<_notionhq_client_build_src_api_endpoints.SearchResponse>;
83
+ queryDatabase(databaseId: string, filter?: any): Promise<(_notionhq_client_build_src_api_endpoints.PageObjectResponse | _notionhq_client_build_src_api_endpoints.PartialPageObjectResponse | _notionhq_client_build_src_api_endpoints.PartialDatabaseObjectResponse | _notionhq_client_build_src_api_endpoints.DatabaseObjectResponse)[]>;
84
+ static ɵfac: i0.ɵɵFactoryDeclaration<NotionService, never>;
85
+ static ɵprov: i0.ɵɵInjectableDeclaration<NotionService>;
86
+ }
87
+
88
+ interface NotionConfig {
89
+ token: string;
90
+ }
91
+ declare const NOTION_SERVICE: InjectionToken<NotionService>;
92
+ declare const NOTION_CONFIG: InjectionToken<NotionConfig>;
93
+ declare function injectNotion(): NotionService;
94
+
95
+ type Evaluation = '==' | '>' | '>=' | '<' | '<=' | '!=' | 'in';
96
+ declare class N {
97
+ static RollupPropQuery(property: string, evaluation: Evaluation, value: string | number): {
98
+ property: string;
99
+ rollup: {
100
+ every: {
101
+ rich_text: {
102
+ equals: string | number;
103
+ };
104
+ };
105
+ };
106
+ };
107
+ static FormulaQuery(property: string, evaluation: Evaluation, value: string | number): {
108
+ property: string;
109
+ formula: {};
110
+ };
111
+ static LastEditedTime(property: string, evaluation: Evaluation, value: string | number): {
112
+ timestamp: string;
113
+ last_edited_time: {
114
+ [x: string]: string | number;
115
+ };
116
+ };
117
+ static Timestamp(property: string, evaluation: Evaluation, value: string): {
118
+ property: string;
119
+ timestamp: {
120
+ [x: string]: string;
121
+ };
122
+ };
123
+ static Status(property: string, evaluation: Evaluation, value: string): {
124
+ property: string;
125
+ status: {
126
+ [x: string]: string;
127
+ };
128
+ };
129
+ static Relation(property: string, evaluation: Evaluation, value: string): {
130
+ property: string;
131
+ relation: {
132
+ [x: string]: string;
133
+ };
134
+ };
135
+ }
136
+ declare abstract class NotionBaseQuery {
137
+ type: 'and' | 'or' | 'filter' | 'sort';
138
+ abstract build(): any;
139
+ }
140
+ declare class NotionFilter extends NotionBaseQuery {
141
+ propertyType: any;
142
+ propertyName: string;
143
+ evaluation: Evaluation;
144
+ value: string | number;
145
+ readonly type: "filter";
146
+ constructor(propertyType: any, propertyName: string, evaluation: Evaluation, value: string | number);
147
+ build(): {
148
+ property: string;
149
+ rollup: {
150
+ every: {
151
+ rich_text: {
152
+ equals: string | number;
153
+ };
154
+ };
155
+ };
156
+ } | {
157
+ property: string;
158
+ formula: {};
159
+ } | {
160
+ timestamp: string;
161
+ last_edited_time: {
162
+ [x: string]: string | number;
163
+ };
164
+ } | {
165
+ property: string;
166
+ status: {
167
+ [x: string]: string;
168
+ };
169
+ } | {
170
+ property: string;
171
+ relation: {
172
+ [x: string]: string;
173
+ };
174
+ };
175
+ }
176
+ declare class NotionSort extends NotionBaseQuery {
177
+ property: string;
178
+ direction: 'asc' | 'desc';
179
+ readonly type: "sort";
180
+ constructor(property: string, direction?: 'asc' | 'desc');
181
+ build(): {
182
+ property: string;
183
+ direction: string;
184
+ };
185
+ }
186
+ declare class NotionAnd extends NotionBaseQuery {
187
+ readonly type: "and";
188
+ arr: NotionFilter[];
189
+ constructor(...filters: NotionFilter[]);
190
+ build(): {
191
+ and: ({
192
+ property: string;
193
+ rollup: {
194
+ every: {
195
+ rich_text: {
196
+ equals: string | number;
197
+ };
198
+ };
199
+ };
200
+ } | {
201
+ property: string;
202
+ formula: {};
203
+ } | {
204
+ timestamp: string;
205
+ last_edited_time: {
206
+ [x: string]: string | number;
207
+ };
208
+ } | {
209
+ property: string;
210
+ status: {
211
+ [x: string]: string;
212
+ };
213
+ } | {
214
+ property: string;
215
+ relation: {
216
+ [x: string]: string;
217
+ };
218
+ })[];
219
+ };
220
+ }
221
+ declare class NotionOr extends NotionBaseQuery {
222
+ readonly type: "or";
223
+ arr: NotionFilter[];
224
+ constructor(...filters: NotionFilter[]);
225
+ build(): {
226
+ or: ({
227
+ property: string;
228
+ rollup: {
229
+ every: {
230
+ rich_text: {
231
+ equals: string | number;
232
+ };
233
+ };
234
+ };
235
+ } | {
236
+ property: string;
237
+ formula: {};
238
+ } | {
239
+ timestamp: string;
240
+ last_edited_time: {
241
+ [x: string]: string | number;
242
+ };
243
+ } | {
244
+ property: string;
245
+ status: {
246
+ [x: string]: string;
247
+ };
248
+ } | {
249
+ property: string;
250
+ relation: {
251
+ [x: string]: string;
252
+ };
253
+ })[];
254
+ };
255
+ }
256
+ declare const Query: <E = any>(Entity: E) => {
257
+ Filter: (_propName: string, evaluation: Evaluation, value: string | number) => NotionFilter;
258
+ OrderBy: (_propName: string, direction: "asc" | "desc") => NotionSort;
259
+ And: (...args: NotionFilter[]) => NotionAnd;
260
+ Or: (...args: NotionFilter[]) => NotionOr;
261
+ };
262
+
263
+ declare class NotionQueryBuilder {
264
+ constructor();
265
+ build(filterQuery?: NotionBaseQuery, sortQuery?: NotionBaseQuery): {
266
+ sorts: any[];
267
+ filter: any;
268
+ } | {
269
+ sorts?: undefined;
270
+ filter: any;
271
+ } | {
272
+ sorts: any[];
273
+ filter?: undefined;
274
+ } | {
275
+ sorts?: undefined;
276
+ filter?: undefined;
277
+ };
278
+ protected buildSortQuery(query: NotionBaseQuery): {
279
+ sorts: any[];
280
+ } | {
281
+ sorts?: undefined;
282
+ };
283
+ protected buildFilterQuery(query: NotionBaseQuery): {
284
+ filter: any;
285
+ } | {
286
+ filter?: undefined;
287
+ };
288
+ }
289
+
290
+ declare const NOTION_ACCESS_TOKEN: InjectionToken<string>;
291
+ declare const NOTION_DATABASE_ID: InjectionToken<unknown>;
292
+ declare function provideNotionConfig(config: {
293
+ accessToken: string;
294
+ }): {
295
+ provide: InjectionToken<string>;
296
+ useValue: string;
297
+ };
298
+ declare abstract class NotionRepository<E extends Entity> extends Repository<E> {
299
+ protected abstract databaseId: string;
300
+ protected abstract converter: NotionConverter<E>;
301
+ protected token: string;
302
+ protected client: Client;
303
+ protected queryBuilder: NotionQueryBuilder;
304
+ protected get parent(): {
305
+ type: 'database_id';
306
+ database_id: string;
307
+ };
308
+ query(filterQuery?: NotionBaseQuery, sortQuery?: NotionBaseQuery, startCursor?: string, pageSize?: number): Promise<{
309
+ results: E[];
310
+ nextCursor: string;
311
+ hasMore: boolean;
312
+ }>;
313
+ queryV2(args?: any): Promise<{
314
+ results: E[];
315
+ nextCursor: string;
316
+ hasMore: boolean;
317
+ }>;
318
+ list({ batchSize, }?: {
319
+ batchSize?: number;
320
+ }): Promise<E[]>;
321
+ listChanges(): Observable<E[]>;
322
+ get({ id }: {
323
+ id: string;
324
+ }): Promise<E>;
325
+ create(entity: Omit<E, 'id' | 'createdAt' | 'updatedAt'> & Partial<Pick<E, 'id'>>): Promise<E>;
326
+ createMany(data: Omit<E, 'id' | 'createdAt' | 'updatedAt'>[]): Promise<E[]>;
327
+ update(entity: Partial<E>): Promise<void>;
328
+ save(data: Partial<E>): Promise<boolean | [E, boolean]>;
329
+ saveMany(entities: E[]): Promise<void>;
330
+ updateMany(data: Partial<E>[]): Promise<void>;
331
+ delete({ id }: {
332
+ id: string;
333
+ }): Promise<void>;
334
+ deleteMany(params: {
335
+ id: string;
336
+ }[]): Promise<number>;
337
+ deleteAll(): Promise<void>;
338
+ static ɵfac: i0.ɵɵFactoryDeclaration<NotionRepository<any>, never>;
339
+ static ɵprov: i0.ɵɵInjectableDeclaration<NotionRepository<any>>;
340
+ }
341
+
342
+ type NotionText = {
343
+ type: 'text';
344
+ text: {
345
+ content: string;
346
+ };
347
+ plain_text: string;
348
+ };
349
+ type NotionArray = {
350
+ type: 'array';
351
+ array: (NotionRichText[] | NotionNumber[]);
352
+ function: 'show_original';
353
+ };
354
+ type NotionTitle = {
355
+ type: 'title';
356
+ title: {
357
+ text: {
358
+ content: string;
359
+ };
360
+ }[];
361
+ };
362
+ type NotionUrl = {
363
+ id: string;
364
+ type: 'url';
365
+ url: string | null;
366
+ };
367
+ type NotionRichText = {
368
+ id: string;
369
+ type: 'rich_text';
370
+ rich_text: NotionText[];
371
+ };
372
+ type NotionNumber = {
373
+ id: string;
374
+ type: 'number';
375
+ number: number;
376
+ };
377
+ type NotionRelation = {
378
+ id: string;
379
+ type: 'relation';
380
+ relation: {
381
+ id: string;
382
+ }[];
383
+ has_more: boolean;
384
+ };
385
+ type NotionStatus = {
386
+ id: string;
387
+ type: 'status';
388
+ status: {
389
+ id: string;
390
+ name: string;
391
+ color: string;
392
+ };
393
+ };
394
+ type NotionFormula = {
395
+ id: string;
396
+ type: 'formula';
397
+ formula: {
398
+ type: 'string';
399
+ string: string;
400
+ } | {
401
+ type: 'number';
402
+ number: number;
403
+ } | {
404
+ type: 'date';
405
+ date: {
406
+ start: string;
407
+ end: string;
408
+ time_zone: null;
409
+ };
410
+ };
411
+ };
412
+ type NotionRollup = {
413
+ id: string;
414
+ type: 'rollup';
415
+ rollup: NotionArray | NotionNumber;
416
+ };
417
+ type NotionCreatedTime = {
418
+ id: string;
419
+ type: 'created_time';
420
+ created_time: string;
421
+ };
422
+ type NotionLastEditedTime = {
423
+ id: string;
424
+ type: 'last_edited_time';
425
+ last_edited_time: string;
426
+ };
427
+ type NotionDate = {
428
+ id: string;
429
+ type: 'date';
430
+ date: any;
431
+ };
432
+ type NotionSelect = {
433
+ id: string;
434
+ type: 'select';
435
+ select: {
436
+ id: string;
437
+ name: string;
438
+ color: string;
439
+ };
440
+ };
441
+ type NotionPhoneNumber = {
442
+ id: string;
443
+ type: 'phone_number';
444
+ phone_number: string;
445
+ };
446
+ type NotionEmail = {
447
+ id: string;
448
+ type: 'email';
449
+ email: string;
450
+ };
451
+ type NotionID = {
452
+ id: string;
453
+ type: 'unique_id';
454
+ unique_id: {
455
+ prefix: string | null;
456
+ number: number;
457
+ };
458
+ };
459
+ type NotionValue = NotionTitle | NotionUrl | NotionRichText | NotionNumber | NotionRelation | NotionStatus | NotionFormula | NotionRollup | NotionCreatedTime | NotionLastEditedTime | NotionDate | NotionSelect | NotionPhoneNumber | NotionEmail | NotionID;
460
+ declare class NotionUtils {
461
+ static toNotionValue(value: any, annotation: NotionAnnotation): void | {
462
+ type: string;
463
+ title: {
464
+ text: {
465
+ content: string;
466
+ };
467
+ }[];
468
+ } | {
469
+ type: string;
470
+ status: {
471
+ name: string;
472
+ };
473
+ } | {
474
+ type: string;
475
+ relation: {
476
+ id: string;
477
+ }[];
478
+ } | {
479
+ type: string;
480
+ rich_text: {
481
+ text: {
482
+ content: string;
483
+ };
484
+ }[];
485
+ } | {
486
+ type: string;
487
+ url: string;
488
+ } | {
489
+ type: string;
490
+ date: {
491
+ start: string;
492
+ };
493
+ } | {
494
+ type: string;
495
+ select: {
496
+ name: string;
497
+ };
498
+ } | {
499
+ type: string;
500
+ number: number;
501
+ } | {
502
+ type: string;
503
+ phone_number: string;
504
+ } | {
505
+ type: string;
506
+ email: string;
507
+ };
508
+ static toNotionTitle(value: string): {
509
+ type: string;
510
+ title: {
511
+ text: {
512
+ content: string;
513
+ };
514
+ }[];
515
+ };
516
+ static toNotionStatus(value: string): {
517
+ type: string;
518
+ status: {
519
+ name: string;
520
+ };
521
+ };
522
+ static toNotionRelationMulti(ids: string[]): {
523
+ type: string;
524
+ relation: {
525
+ id: string;
526
+ }[];
527
+ };
528
+ static toNotionRelation(value: string): {
529
+ type: string;
530
+ relation: {
531
+ id: string;
532
+ }[];
533
+ };
534
+ static toNotionRichText(text?: string): {
535
+ type: string;
536
+ rich_text: {
537
+ text: {
538
+ content: string;
539
+ };
540
+ }[];
541
+ };
542
+ static toNotionFormula(value: string): void;
543
+ static toNotionRollup(value: string): void;
544
+ static toNotionUrl(value: string): {
545
+ type: string;
546
+ url: string;
547
+ };
548
+ static toNotionDate(value: Date): {
549
+ type: string;
550
+ date: {
551
+ start: string;
552
+ };
553
+ };
554
+ static toNotionSelect(value: string): {
555
+ type: string;
556
+ select: {
557
+ name: string;
558
+ };
559
+ };
560
+ static toNotionPhoneNumber(value: string): {
561
+ type: string;
562
+ phone_number: string;
563
+ };
564
+ static toNotionNumber(value: number): {
565
+ type: string;
566
+ number: number;
567
+ };
568
+ static toNotionEmail(value: string): {
569
+ type: string;
570
+ email: string;
571
+ };
572
+ static fromNotionValue(value: NotionValue, annotation: NotionAnnotation): string | number | string[] | Date | dayjs.Dayjs | number[];
573
+ static fromNotionTitle(notionTitle: NotionTitle): string;
574
+ static fromNotionUrl(notionUrl: NotionUrl): string | null;
575
+ static fromNotionRichText(notionRichText: NotionRichText): string | null;
576
+ static fromNotionRelation(notionRelation: NotionRelation): string | null;
577
+ static fromNotionRelationMulti(notionRelation: NotionRelation): string[];
578
+ static fromNotionStatus(notionStatus: NotionStatus): string | null;
579
+ static fromNotionFormula(notionFormula: NotionFormula): string | number | Date;
580
+ static fromNotionRollup(notionRollup: NotionRollup): string | number;
581
+ static fromNotionRollupMulti(notionRollup: NotionRollup): string[] | number[];
582
+ static fromNotionCreatedTime(notionCreatedTime: NotionCreatedTime): dayjs.Dayjs;
583
+ static fromNotionLastEditedTime(notionLastEditedTime: NotionLastEditedTime): dayjs.Dayjs;
584
+ static fromNotionDate(notionDate: NotionDate): Date | null;
585
+ static fromNotionNumber(notionNumber: NotionNumber): number;
586
+ static fromNotionSelect(notionSelect: NotionSelect): string;
587
+ static fromNotionPhoneNumber(notionPhoneNumber: NotionPhoneNumber): string;
588
+ static fromNotionEmail(notionEmail: NotionEmail): string;
589
+ static fromNotionUniqueID(value: NotionID): number;
590
+ }
591
+
592
+ export { CreatedTime, Date$1 as Date, Email, Formula, LastEditedTime, N, NOTION_ACCESS_TOKEN, NOTION_ANNOTATIONS, NOTION_CONFIG, NOTION_DATABASE_ID, NOTION_SERVICE, Notion, NotionAnd, NotionBaseQuery, NotionConverter, NotionFilter, NotionHelper, NotionOr, NotionQueryBuilder, NotionRepository, NotionSort, NotionUtils, Number, PhoneNumber, Query, Relation, RichText, Rollup, Select, Status, Timestamp, Title, UniqueID, Url, createConverter, injectNotion, provideNotionConfig };
593
+ export type { NotionAnnotation, NotionConfig, NotionCreatedTime, NotionDate, NotionEmail, NotionFieldType, NotionFormula, NotionID, NotionLastEditedTime, NotionNumber, NotionPhoneNumber, NotionRelation, NotionRichText, NotionRollup, NotionSelect, NotionStatus, NotionTitle, NotionUrl, NotionValue };
package/package.json CHANGED
@@ -1,23 +1,29 @@
1
1
  {
2
2
  "name": "@nx-ddd/notion",
3
- "version": "19.0.0-preview.9",
4
- "main": "./index.js",
5
- "types": "./index.d.ts",
6
- "homepage": "https://github.com/xx-machina/plaform/tree/main/packages/@nx-ddd/notion",
7
- "repository": {
8
- "type": "git",
9
- "url": "https://github.com/xx-machina/plaform.git"
10
- },
3
+ "version": "19.1.1",
4
+ "license": "MIT",
11
5
  "peerDependencies": {
12
6
  "@notionhq/client": "^2.2.2",
13
- "@nx-ddd/common": "19.0.0-preview.9",
7
+ "@nx-ddd/common": "19.1.1",
14
8
  "dayjs": "1.11.13",
15
9
  "lodash-es": "^4.17.15",
16
- "tslib": "^2.3.0",
17
10
  "@angular/core": "19.1.4",
18
11
  "node-localstorage": "^3.0.5",
19
12
  "crypto-js": "4.2.0"
20
13
  },
21
- "dependencies": {},
22
- "type": "commonjs"
14
+ "dependencies": {
15
+ "tslib": "^2.3.0"
16
+ },
17
+ "module": "fesm2022/nx-ddd-notion.mjs",
18
+ "typings": "index.d.ts",
19
+ "exports": {
20
+ "./package.json": {
21
+ "default": "./package.json"
22
+ },
23
+ ".": {
24
+ "types": "./index.d.ts",
25
+ "default": "./fesm2022/nx-ddd-notion.mjs"
26
+ }
27
+ },
28
+ "sideEffects": false
23
29
  }
package/README.md DELETED
@@ -1,11 +0,0 @@
1
- # notion
2
-
3
- This library was generated with [Nx](https://nx.dev).
4
-
5
- ## Running unit tests
6
-
7
- Run `nx test notion` to execute the unit tests via [Jest](https://jestjs.io).
8
-
9
- ## Running lint
10
-
11
- Run `nx lint notion` to execute the lint via [ESLint](https://eslint.org/).
@@ -1,20 +0,0 @@
1
- import { NotionConverter } from '../converter';
2
- export declare class Entity {
3
- title: string;
4
- status: string;
5
- firstSelectionIds: string[];
6
- discordFirstSelectionMessage: string;
7
- discordSecondSelectionMessage: string;
8
- discordChannelId: string;
9
- static from(obj: Partial<Entity>): Entity & {
10
- title?: string;
11
- status?: string;
12
- firstSelectionIds?: string[];
13
- discordFirstSelectionMessage?: string;
14
- discordSecondSelectionMessage?: string;
15
- discordChannelId?: string;
16
- };
17
- }
18
- export declare class EntityConverter extends NotionConverter<Entity> {
19
- protected Entity: typeof Entity;
20
- }