@contentstack/datasync-manager 1.2.4 → 2.0.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 (76) hide show
  1. package/LICENSE +1 -1
  2. package/dist/api.js +16 -10
  3. package/dist/config.js +1 -0
  4. package/dist/core/index.js +33 -26
  5. package/dist/core/inet.js +10 -7
  6. package/dist/core/plugins.js +6 -5
  7. package/dist/core/process.js +7 -6
  8. package/dist/core/q.js +22 -16
  9. package/dist/core/token-management.js +23 -20
  10. package/dist/index.js +48 -37
  11. package/dist/util/build-paths.js +15 -14
  12. package/dist/util/fs.js +19 -15
  13. package/dist/util/index.js +53 -43
  14. package/dist/util/logger.js +3 -2
  15. package/dist/util/promise.map.js +3 -2
  16. package/dist/util/series.js +3 -2
  17. package/dist/util/unprocessible.js +14 -12
  18. package/dist/util/validations.js +34 -24
  19. package/package.json +8 -2
  20. package/.github/ISSUE_TEMPLATE/bug_report.md +0 -31
  21. package/.github/ISSUE_TEMPLATE/feature_request.md +0 -20
  22. package/.github/workflows/codeql-analysis.yml +0 -68
  23. package/.github/workflows/jira.yml +0 -28
  24. package/.github/workflows/release.yml +0 -53
  25. package/.github/workflows/sast-scan.yml +0 -11
  26. package/.github/workflows/sca-scan.yml +0 -15
  27. package/.github/workflows/secrets-scan.yml +0 -11
  28. package/.releaserc +0 -9
  29. package/.talismanrc +0 -4
  30. package/CODEOWNERS +0 -1
  31. package/SECURITY.md +0 -27
  32. package/example/config.js +0 -60
  33. package/example/index.js +0 -30
  34. package/test/api.ts +0 -152
  35. package/test/core/filteredItems.ts +0 -58
  36. package/test/core/index.ts +0 -18
  37. package/test/core/inet.ts +0 -23
  38. package/test/core/q.ts +0 -42
  39. package/test/core/sync.ts +0 -19
  40. package/test/core/token-management.ts +0 -40
  41. package/test/dummy/api-responses/404.ts +0 -3
  42. package/test/dummy/api-responses/content-type.ts +0 -30
  43. package/test/dummy/api-responses/delete-asset.ts +0 -9
  44. package/test/dummy/api-responses/delete-content-type.ts +0 -6
  45. package/test/dummy/api-responses/delete-entry.ts +0 -9
  46. package/test/dummy/api-responses/delete.ts +0 -32
  47. package/test/dummy/api-responses/empty.ts +0 -7
  48. package/test/dummy/api-responses/entries.ts +0 -31
  49. package/test/dummy/api-responses/filter-items.ts +0 -32
  50. package/test/dummy/api-responses/global-field.ts +0 -175
  51. package/test/dummy/api-responses/markdown-content-type.ts +0 -202
  52. package/test/dummy/api-responses/markdown-entries.ts +0 -56
  53. package/test/dummy/api-responses/mixed.ts +0 -77
  54. package/test/dummy/api-responses/publish-asset.ts +0 -14
  55. package/test/dummy/api-responses/publish-entry.ts +0 -14
  56. package/test/dummy/api-responses/publish.ts +0 -35
  57. package/test/dummy/api-responses/references-content-type-2.ts +0 -240
  58. package/test/dummy/api-responses/references-content-type.ts +0 -272
  59. package/test/dummy/api-responses/references-entries.ts +0 -156
  60. package/test/dummy/api-responses/unpublish-asset.ts +0 -9
  61. package/test/dummy/api-responses/unpublish-entry.ts +0 -9
  62. package/test/dummy/api-responses/unpublish.ts +0 -26
  63. package/test/dummy/config.ts +0 -34
  64. package/test/dummy/connector-listener-instances.ts +0 -69
  65. package/test/dummy/filter-items.ts +0 -32
  66. package/test/dummy/plugins/myplugin1/index.js +0 -20
  67. package/test/dummy/plugins/myplugin2/index.js +0 -20
  68. package/test/dummy/references-content-type.ts +0 -340
  69. package/test/dummy/references-entry-expected.ts +0 -161
  70. package/test/dummy/references-entry.ts +0 -95
  71. package/test/index.ts +0 -330
  72. package/test/util/fs.ts +0 -92
  73. package/test/util/index.ts +0 -157
  74. package/test/util/log-save-filtered-items.ts +0 -42
  75. package/test/util/validations.ts +0 -158
  76. package/tslint.json +0 -53
@@ -1,175 +0,0 @@
1
- export const response = {
2
- "content_type": {
3
- "created_at": "2019-09-06T12:48:55.523Z",
4
- "updated_at": "2019-09-10T05:40:56.137Z",
5
- "title": "test",
6
- "uid": "test",
7
- "_version": 10,
8
- "inbuilt_class": false,
9
- "schema": [
10
- {
11
- "display_name": "Title",
12
- "uid": "title",
13
- "data_type": "text",
14
- "mandatory": true,
15
- "unique": true,
16
- "field_metadata": {
17
- "_default": true,
18
- "version": 3
19
- },
20
- "multiple": false,
21
- "non_localizable": false
22
- },
23
- {
24
- "display_name": "URL",
25
- "uid": "url",
26
- "data_type": "text",
27
- "mandatory": false,
28
- "field_metadata": {
29
- "_default": true,
30
- "version": 3
31
- },
32
- "multiple": false,
33
- "unique": false,
34
- "non_localizable": false
35
- },
36
- {
37
- "data_type": "text",
38
- "display_name": "Rich text editor",
39
- "uid": "description",
40
- "field_metadata": {
41
- "allow_rich_text": true,
42
- "description": "",
43
- "multiline": false,
44
- "rich_text_type": "advanced",
45
- "options": [],
46
- "version": 3
47
- },
48
- "multiple": false,
49
- "mandatory": false,
50
- "unique": false,
51
- "non_localizable": false
52
- },
53
- {
54
- "data_type": "text",
55
- "display_name": "Rich text editor",
56
- "uid": "rich_text_editor",
57
- "field_metadata": {
58
- "allow_rich_text": true,
59
- "description": "",
60
- "multiline": false,
61
- "rich_text_type": "advanced",
62
- "options": [],
63
- "version": 3
64
- },
65
- "multiple": false,
66
- "mandatory": false,
67
- "unique": false,
68
- "non_localizable": false
69
- },
70
- {
71
- "data_type": "global_field",
72
- "display_name": "Global Field",
73
- "reference_to": "blt981fee3f999f3c12",
74
- "field_metadata": {
75
- "description": ""
76
- },
77
- "uid": "global_field",
78
- "multiple": true,
79
- "max_instance": 50,
80
- "mandatory": false,
81
- "unique": false,
82
- "non_localizable": false,
83
- "schema": [
84
- {
85
- "display_name": "Name",
86
- "uid": "name",
87
- "data_type": "text",
88
- "multiple": false,
89
- "mandatory": false,
90
- "unique": false,
91
- "non_localizable": false,
92
- "indexed": false,
93
- "inbuilt_model": false
94
- },
95
- {
96
- "data_type": "text",
97
- "display_name": "Rich text editor",
98
- "uid": "description",
99
- "field_metadata": {
100
- "allow_rich_text": true,
101
- "description": "",
102
- "multiline": false,
103
- "rich_text_type": "advanced",
104
- "options": [],
105
- "version": 3
106
- },
107
- "multiple": false,
108
- "mandatory": false,
109
- "unique": false,
110
- "non_localizable": false,
111
- "indexed": false,
112
- "inbuilt_model": false
113
- },
114
- {
115
- "data_type": "file",
116
- "display_name": "File",
117
- "uid": "file_di",
118
- "extensions": [],
119
- "field_metadata": {
120
- "description": "",
121
- "rich_text_type": "standard"
122
- },
123
- "multiple": true,
124
- "mandatory": false,
125
- "unique": false,
126
- "non_localizable": false,
127
- "indexed": false,
128
- "inbuilt_model": false
129
- }
130
- ]
131
- },
132
- {
133
- "data_type": "file",
134
- "display_name": "File",
135
- "uid": "file_dinesh",
136
- "extensions": [],
137
- "field_metadata": {
138
- "description": "",
139
- "rich_text_type": "standard"
140
- },
141
- "multiple": false,
142
- "mandatory": false,
143
- "unique": false,
144
- "non_localizable": false
145
- },
146
- {
147
- "data_type": "group",
148
- "display_name": "Group",
149
- "field_metadata": {},
150
- "schema": [
151
- {
152
- "data_type": "file",
153
- "display_name": "File",
154
- "uid": "file",
155
- "extensions": [],
156
- "field_metadata": {
157
- "description": "",
158
- "rich_text_type": "standard"
159
- },
160
- "multiple": true,
161
- "mandatory": false,
162
- "unique": false,
163
- "non_localizable": false
164
- }
165
- ],
166
- "uid": "group",
167
- "multiple": false,
168
- "mandatory": false,
169
- "unique": false,
170
- "non_localizable": false
171
- }
172
- ]
173
- }
174
-
175
- }
@@ -1,202 +0,0 @@
1
- export const contentType = {
2
- content_type: {
3
- created_at: '2019-07-12T17:34:15.060Z',
4
- updated_at: '2019-07-14T14:18:53.278Z',
5
- // tslint:disable-next-line: object-literal-sort-keys
6
- title: 'Sample Three',
7
- uid: 'sample_three',
8
- _version: 3,
9
- inbuilt_class: false,
10
- schema: [
11
- {
12
- display_name: 'Title',
13
- uid: 'title',
14
- // tslint:disable-next-line: object-literal-sort-keys
15
- data_type: 'text',
16
- mandatory: true,
17
- unique: true,
18
- field_metadata: {
19
- _default: true,
20
- version: 3,
21
- },
22
- non_localizable: false,
23
- multiple: false,
24
- },
25
- {
26
- display_name: 'URL',
27
- uid: 'url',
28
- // tslint:disable-next-line: object-literal-sort-keys
29
- data_type: 'text',
30
- mandatory: false,
31
- field_metadata: {
32
- _default: true,
33
- version: 3,
34
- },
35
- non_localizable: false,
36
- multiple: false,
37
- unique: false,
38
- },
39
- {
40
- data_type: 'file',
41
- display_name: 'File',
42
- uid: 'file',
43
- // tslint:disable-next-line: object-literal-sort-keys
44
- extensions: [],
45
- field_metadata: {
46
- description: '',
47
- rich_text_type: 'standard',
48
- },
49
- reference_to: [],
50
- non_localizable: false,
51
- multiple: false,
52
- mandatory: false,
53
- unique: false,
54
- },
55
- {
56
- data_type: 'text',
57
- display_name: 'Rich text editor',
58
- uid: 'rich_text_editor',
59
- // tslint:disable-next-line: object-literal-sort-keys
60
- field_metadata: {
61
- allow_rich_text: true,
62
- description: '',
63
- multiline: false,
64
- rich_text_type: 'advanced',
65
- // tslint:disable-next-line: object-literal-sort-keys
66
- options: [],
67
- version: 3,
68
- },
69
- reference_to: [],
70
- non_localizable: false,
71
- multiple: false,
72
- mandatory: false,
73
- unique: false,
74
- },
75
- {
76
- data_type: 'group',
77
- display_name: 'Group',
78
- field_metadata: {},
79
- schema: [
80
- {
81
- data_type: 'text',
82
- display_name: 'Rich text editor',
83
- uid: 'rich_text_editor',
84
- // tslint:disable-next-line: object-literal-sort-keys
85
- field_metadata: {
86
- allow_rich_text: true,
87
- description: '',
88
- multiline: false,
89
- rich_text_type: 'advanced',
90
- // tslint:disable-next-line: object-literal-sort-keys
91
- options: [],
92
- version: 3,
93
- },
94
- reference_to: [],
95
- non_localizable: false,
96
- multiple: false,
97
- mandatory: false,
98
- unique: false,
99
- },
100
- ],
101
- uid: 'group',
102
- // tslint:disable-next-line: object-literal-sort-keys
103
- reference_to: [],
104
- multiple: true,
105
- non_localizable: false,
106
- mandatory: false,
107
- unique: false,
108
- },
109
- {
110
- data_type: 'blocks',
111
- display_name: 'Modular Blocks',
112
- // tslint:disable-next-line: object-literal-sort-keys
113
- blocks: [
114
- {
115
- title: 'Block One',
116
- uid: 'block_one',
117
- // tslint:disable-next-line: object-literal-sort-keys
118
- schema: [
119
- {
120
- data_type: 'text',
121
- display_name: 'Markdown',
122
- uid: 'markdown',
123
- // tslint:disable-next-line: object-literal-sort-keys
124
- field_metadata: {
125
- description: '',
126
- markdown: true,
127
- version: 3,
128
- },
129
- reference_to: [],
130
- multiple: true,
131
- non_localizable: false,
132
- mandatory: false,
133
- unique: false,
134
- },
135
- {
136
- data_type: 'text',
137
- display_name: 'Rich text editor',
138
- uid: 'rich_text_editor',
139
- // tslint:disable-next-line: object-literal-sort-keys
140
- field_metadata: {
141
- allow_rich_text: true,
142
- description: '',
143
- multiline: false,
144
- rich_text_type: 'advanced',
145
- // tslint:disable-next-line: object-literal-sort-keys
146
- options: [],
147
- version: 3,
148
- },
149
- reference_to: [],
150
- multiple: true,
151
- non_localizable: false,
152
- mandatory: false,
153
- unique: false,
154
- },
155
- ],
156
- },
157
- ],
158
- multiple: true,
159
- uid: 'modular_blocks',
160
- field_metadata: {},
161
- reference_to: [],
162
- non_localizable: false,
163
- mandatory: false,
164
- unique: false,
165
- },
166
- ],
167
- last_activity: {
168
- environments: [
169
- {
170
- uid: 'blt2e69b1b65d17bc6f',
171
- // tslint:disable-next-line: object-literal-sort-keys
172
- details: [
173
- {
174
- locale: 'en-us',
175
- time: '2019-07-14T14:19:45.218Z',
176
- },
177
- ],
178
- },
179
- ],
180
- },
181
- maintain_revisions: true,
182
- description: 'Haz RTE and Assets',
183
- options: {
184
- is_page: true,
185
- singleton: false,
186
- title: 'title',
187
- // tslint:disable-next-line: object-literal-sort-keys
188
- sub_title: [],
189
- url_pattern: '/:title',
190
- url_prefix: '/',
191
- },
192
- abilities: {
193
- get_one_object: true,
194
- // tslint:disable-next-line: object-literal-sort-keys
195
- get_all_objects: true,
196
- create_object: true,
197
- update_object: true,
198
- delete_object: true,
199
- delete_all_objects: true,
200
- },
201
- },
202
- }
@@ -1,56 +0,0 @@
1
- export const response = {
2
- items: [{
3
- type: 'entry_published',
4
- // tslint:disable-next-line: object-literal-sort-keys
5
- event_at: '2019-07-14T14:19:45.218Z',
6
- content_type_uid: 'sample_three',
7
- data: {
8
- locale: 'en-us',
9
- title: 'Sample 3. One',
10
- url: '/sample-3-one',
11
- // tslint:disable-next-line: object-literal-sort-keys
12
- file: 'blt0fe00a5122e87aba',
13
- // tslint:disable-next-line: max-line-length
14
- rich_text_editor: '<img data-image="lsjgbuaav0k6" src="https://images.contentstack.io/v3/assets/blt201f6a86befeb0a2/blt0fe00a5122e87aba/5d25cd501d2c530d6012c8d0/tumblr.png" data-sys-asset-uid="blt0fe00a5122e87aba" alt="tumblr.png">',
15
- tags: [],
16
- uid: 'blt5ff4abd3822b823e',
17
- created_by: 'blta8c6c505f1e82dda',
18
- updated_by: 'blta8c6c505f1e82dda',
19
- created_at: '2019-07-12T17:35:10.477Z',
20
- updated_at: '2019-07-14T14:19:43.140Z',
21
- _version: 2,
22
- _in_progress: false,
23
- group: [{
24
- // tslint:disable-next-line: max-line-length
25
- rich_text_editor: '<img data-image="p25unekg42ax" src="https://images.contentstack.io/v3/assets/blt201f6a86befeb0a2/blt0fe00a5122e87aba/5d25cd501d2c530d6012c8d0/tumblr.png" data-sys-asset-uid="blt0fe00a5122e87aba" alt="tumblr.png">',
26
- },
27
- {
28
- // tslint:disable-next-line: max-line-length
29
- rich_text_editor: '<img data-image="tmali4xtmscf" src="https://images.contentstack.io/v3/assets/blt201f6a86befeb0a2/blt0fe00a5122e87aba/5d25cd501d2c530d6012c8d0/tumblr.png" data-sys-asset-uid="blt0fe00a5122e87aba" alt="tumblr.png">',
30
- },
31
- ],
32
- modular_blocks: [{
33
- block_one: {
34
- markdown: [
35
- // tslint:disable-next-line: max-line-length
36
- '![enter image description here][1]\n\n\n [1]: https://images.contentstack.io/v3/assets/blt201f6a86befeb0a2/blt0fe00a5122e87aba/5d25cd501d2c530d6012c8d0/tumblr.png',
37
- ],
38
- rich_text_editor: [
39
- // tslint:disable-next-line: max-line-length
40
- '<img data-image="ti7ae0uon7u9" src="https://images.contentstack.io/v3/assets/blt201f6a86befeb0a2/blt0fe00a5122e87aba/5d25cd501d2c530d6012c8d0/tumblr.png" data-sys-asset-uid="blt0fe00a5122e87aba" alt="tumblr.png">',
41
- ],
42
- },
43
- }, ],
44
- publish_details: {
45
- environment: 'blt2e69b1b65d17bc6f',
46
- locale: 'en-us',
47
- time: '2019-07-14T14:19:45.218Z',
48
- user: 'blta8c6c505f1e82dda',
49
- },
50
- },
51
- }],
52
- limit: 100,
53
- skip: 0,
54
- sync_token: 'dummy_rte_token',
55
- total_count: 1,
56
- }
@@ -1,77 +0,0 @@
1
- export const response = {
2
- items: [
3
- {
4
- content_type_uid: 'authors',
5
- data: {
6
- locale: 'es-es',
7
- publish_details: {
8
- locale: 'es-es',
9
- time: '2019-01-04T20:37:11.052Z',
10
- },
11
- title: 'Test Global Search',
12
- uid: 'blt862233378d02b304',
13
- },
14
- event_at: '2019-01-04T20:37:11.052Z',
15
- type: 'entry_published',
16
- },
17
- {
18
- content_type_uid: 'sys_assets',
19
- data: {
20
- publish_details: {
21
- locale: 'es-es',
22
- time: '2019-01-02T13:42:58.721Z',
23
- },
24
- title: 'medium.png',
25
- uid: 'blt2a94dd7005d1229c',
26
- },
27
- event_at: '2019-01-04T20:37:11.052Z',
28
- type: 'asset_published',
29
- },
30
- {
31
- content_type_uid: 'del',
32
- data: {},
33
- event_at: '2019-01-08T15:21:10.552Z',
34
- type: 'content_type_deleted',
35
- },
36
- {
37
- content_type_uid: 'a',
38
- data: {
39
- locale: 'es-es',
40
- uid: 'blt6aa83e702326fc65',
41
- },
42
- event_at: '2019-01-08T15:20:17.873Z',
43
- type: 'entry_deleted',
44
- },
45
- {
46
- content_type_uid: 'sys_assets',
47
- data: {
48
- locale: 'es-es',
49
- uid: 'blt39193a579518bb10',
50
- },
51
- event_at: '2019-01-08T15:19:53.844Z',
52
- type: 'asset_deleted',
53
- },
54
- {
55
- content_type_uid: 'authors',
56
- data: {
57
- locale: 'es-es',
58
- uid: 'blt1e5bcf16685e2505',
59
- },
60
- event_at: '2019-01-07T13:42:00.625Z',
61
- type: 'entry_unpublished',
62
- },
63
- {
64
- content_type_uid: 'sys_assets',
65
- data: {
66
- locale: 'es-es',
67
- uid: 'blt2a94dd7005d1229c',
68
- },
69
- event_at: '2019-01-07T13:41:50.462Z',
70
- type: 'asset_unpublished',
71
- },
72
- ],
73
- limit: 100,
74
- skip: 0,
75
- sync_token: 'mixed-token',
76
- total_count: 7,
77
- }
@@ -1,14 +0,0 @@
1
- export const item = {
2
- content_type_uid: 'sys_assets',
3
- data: {
4
- publish_details: {
5
- locale: 'es-es',
6
- time: '2019-01-02T13:42:58.721Z',
7
- },
8
- title: 'medium.png',
9
- uid: 'blt2a94dd7005d1229c',
10
- url: '/sample-url'
11
- },
12
- event_at: '2019-01-04T20:37:11.052Z',
13
- type: 'asset_published',
14
- }
@@ -1,14 +0,0 @@
1
- export const item = {
2
- content_type_uid: 'authors',
3
- data: {
4
- locale: 'es-es',
5
- publish_details: {
6
- locale: 'es-es',
7
- time: '2019-01-04T20:37:11.052Z',
8
- },
9
- title: 'Test Global Search',
10
- uid: 'blt862233378d02b304',
11
- },
12
- event_at: '2019-01-04T20:37:11.052Z',
13
- type: 'entry_published',
14
- }
@@ -1,35 +0,0 @@
1
- export const response = {
2
- items: [
3
- {
4
- content_type_uid: 'authors',
5
- data: {
6
- locale: 'es-es',
7
- publish_details: {
8
- locale: 'es-es',
9
- time: '2019-01-04T20:37:11.052Z',
10
- },
11
- title: 'Test Global Search',
12
- uid: 'blt862233378d02b304',
13
- },
14
- event_at: '2019-01-04T20:37:11.052Z',
15
- type: 'entry_published',
16
- },
17
- {
18
- content_type_uid: 'sys_assets',
19
- data: {
20
- publish_details: {
21
- locale: 'es-es',
22
- time: '2019-01-02T13:42:58.721Z',
23
- },
24
- title: 'medium.png',
25
- uid: 'blt2a94dd7005d1229c',
26
- },
27
- event_at: '2019-01-04T20:37:11.052Z',
28
- type: 'asset_published',
29
- },
30
- ],
31
- limit: 100,
32
- pagination_token: 'publish-token',
33
- skip: 0,
34
- total_count: 2,
35
- }