musora-content-services 2.122.0 → 2.122.3
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/.coderabbit.yaml +0 -0
- package/.editorconfig +0 -0
- package/.github/pull_request_template.md +0 -0
- package/.github/workflows/conventional-commits.yaml +0 -0
- package/.github/workflows/docs.js.yml +0 -0
- package/.github/workflows/node.js.yml +0 -0
- package/.prettierignore +0 -0
- package/.prettierrc +0 -0
- package/CHANGELOG.md +19 -0
- package/CLAUDE.md +0 -0
- package/README.md +0 -0
- package/babel.config.cjs +0 -0
- package/jest.config.js +0 -0
- package/jsdoc.json +0 -0
- package/package.json +1 -1
- package/src/constants/award-assets.js +0 -0
- package/src/constants/membership-permissions.ts +0 -0
- package/src/contentTypeConfig.js +4 -3
- package/src/filterBuilder.js +0 -0
- package/src/index.d.ts +0 -0
- package/src/index.js +0 -0
- package/src/infrastructure/http/HttpClient.ts +0 -0
- package/src/infrastructure/http/executors/FetchRequestExecutor.ts +0 -0
- package/src/infrastructure/http/index.ts +0 -0
- package/src/infrastructure/http/interfaces/HeaderProvider.ts +0 -0
- package/src/infrastructure/http/interfaces/HttpError.ts +0 -0
- package/src/infrastructure/http/interfaces/NetworkError.ts +0 -0
- package/src/infrastructure/http/interfaces/RequestExecutor.ts +0 -0
- package/src/infrastructure/http/interfaces/RequestOptions.ts +0 -0
- package/src/infrastructure/http/providers/DefaultHeaderProvider.ts +0 -0
- package/src/lib/ads/monoid.ts +0 -0
- package/src/lib/ads/semigroup.ts +0 -0
- package/src/lib/brands.ts +0 -0
- package/src/lib/lastUpdated.js +0 -0
- package/src/lib/sanity/filter.ts +0 -0
- package/src/lib/sanity/query.ts +0 -0
- package/src/services/api/types.js +0 -0
- package/src/services/api/types.ts +0 -0
- package/src/services/awards/award-callbacks.js +0 -0
- package/src/services/awards/award-query.js +0 -0
- package/src/services/awards/internal/.indexignore +0 -0
- package/src/services/awards/internal/award-definitions.js +0 -0
- package/src/services/awards/internal/award-events.js +0 -0
- package/src/services/awards/internal/award-manager.js +0 -0
- package/src/services/awards/internal/certificate-builder.js +0 -0
- package/src/services/awards/internal/completion-data-generator.js +0 -0
- package/src/services/awards/internal/content-progress-observer.js +0 -0
- package/src/services/awards/internal/image-utils.js +0 -0
- package/src/services/awards/internal/message-generator.js +0 -0
- package/src/services/awards/internal/types.js +0 -0
- package/src/services/awards/types.d.ts +0 -0
- package/src/services/awards/types.js +0 -0
- package/src/services/config.js +0 -0
- package/src/services/content/artist.ts +0 -0
- package/src/services/content/content.ts +0 -0
- package/src/services/content/genre.ts +0 -0
- package/src/services/content/instructor.ts +0 -0
- package/src/services/content-org/content-org.js +0 -0
- package/src/services/content-org/guided-courses.ts +0 -0
- package/src/services/content-org/learning-paths.ts +64 -48
- package/src/services/content-org/playlists-types.js +0 -0
- package/src/services/content-org/playlists.js +0 -0
- package/src/services/content.js +0 -0
- package/src/services/contentAggregator.js +0 -0
- package/src/services/contentLikes.js +0 -0
- package/src/services/contentProgress.js +20 -10
- package/src/services/dataContext.js +0 -0
- package/src/services/dateUtils.js +0 -0
- package/src/services/eventsAPI.js +0 -0
- package/src/services/forums/categories.ts +0 -0
- package/src/services/forums/forums.ts +0 -0
- package/src/services/forums/posts.ts +0 -0
- package/src/services/forums/threads.ts +0 -0
- package/src/services/forums/types.ts +0 -0
- package/src/services/gamification/awards.ts +0 -0
- package/src/services/gamification/gamification.js +0 -0
- package/src/services/imageSRCBuilder.js +0 -0
- package/src/services/imageSRCVerify.js +0 -0
- package/src/services/liveTesting.ts +0 -0
- package/src/services/permissions/PermissionsAdapter.ts +0 -0
- package/src/services/permissions/PermissionsAdapterFactory.ts +0 -0
- package/src/services/permissions/PermissionsV1Adapter.ts +0 -0
- package/src/services/permissions/PermissionsV2Adapter.ts +0 -0
- package/src/services/permissions/README.md +0 -0
- package/src/services/permissions/index.ts +0 -0
- package/src/services/progress-events.js +0 -0
- package/src/services/progress-row/base.js +7 -3
- package/src/services/progress-row/rows/.indexignore +0 -0
- package/src/services/progress-row/rows/content-card.js +0 -0
- package/src/services/progress-row/rows/method-card.js +1 -1
- package/src/services/progress-row/rows/playlist-card.js +0 -0
- package/src/services/railcontent.js +0 -0
- package/src/services/recommendations.js +0 -0
- package/src/services/reporting/README.md +0 -0
- package/src/services/reporting/reporting.ts +0 -0
- package/src/services/reporting/types.ts +0 -0
- package/src/services/sanity.js +1 -1
- package/src/services/sentry/.indexignore +0 -0
- package/src/services/sentry/index.ts +0 -0
- package/src/services/sync/.indexignore +0 -0
- package/src/services/sync/adapters/factory.ts +0 -0
- package/src/services/sync/adapters/lokijs.ts +0 -0
- package/src/services/sync/adapters/sqlite.ts +0 -0
- package/src/services/sync/context/index.ts +0 -0
- package/src/services/sync/context/providers/base.ts +0 -0
- package/src/services/sync/context/providers/connectivity.ts +0 -0
- package/src/services/sync/context/providers/durability.ts +0 -0
- package/src/services/sync/context/providers/index.ts +0 -0
- package/src/services/sync/context/providers/session.ts +0 -0
- package/src/services/sync/context/providers/tabs.ts +0 -0
- package/src/services/sync/context/providers/visibility.ts +0 -0
- package/src/services/sync/database/factory.ts +0 -0
- package/src/services/sync/effects/index.ts +0 -0
- package/src/services/sync/effects/logout-warning.ts +0 -0
- package/src/services/sync/errors/boundary.ts +0 -0
- package/src/services/sync/errors/index.ts +0 -0
- package/src/services/sync/errors/validators.ts +0 -0
- package/src/services/sync/fetch.ts +0 -0
- package/src/services/sync/index.ts +0 -0
- package/src/services/sync/manager.ts +0 -0
- package/src/services/sync/models/Base.ts +0 -0
- package/src/services/sync/models/ContentLike.ts +0 -0
- package/src/services/sync/models/ContentProgress.ts +0 -0
- package/src/services/sync/models/Practice.ts +0 -0
- package/src/services/sync/models/PracticeDayNote.ts +0 -0
- package/src/services/sync/models/UserAwardProgress.ts +0 -0
- package/src/services/sync/models/index.ts +0 -0
- package/src/services/sync/repositories/base.ts +2 -16
- package/src/services/sync/repositories/content-likes.ts +0 -0
- package/src/services/sync/repositories/content-progress.ts +7 -4
- package/src/services/sync/repositories/index.ts +0 -0
- package/src/services/sync/repositories/practice-day-notes.ts +0 -0
- package/src/services/sync/repositories/practices.ts +0 -0
- package/src/services/sync/repositories/user-award-progress.ts +0 -0
- package/src/services/sync/repository-proxy.ts +0 -0
- package/src/services/sync/resolver.ts +0 -0
- package/src/services/sync/retry.ts +0 -0
- package/src/services/sync/run-scope.ts +0 -0
- package/src/services/sync/schema/index.ts +0 -0
- package/src/services/sync/serializers/index.ts +0 -0
- package/src/services/sync/serializers/model.ts +0 -0
- package/src/services/sync/serializers/raw.ts +0 -0
- package/src/services/sync/store/index.ts +4 -2
- package/src/services/sync/store/push-coalescer.ts +0 -0
- package/src/services/sync/store-configs.ts +0 -0
- package/src/services/sync/strategies/base.ts +0 -0
- package/src/services/sync/strategies/index.ts +0 -0
- package/src/services/sync/strategies/initial.ts +0 -0
- package/src/services/sync/strategies/polling.ts +0 -0
- package/src/services/sync/telemetry/flood-prevention.ts +0 -0
- package/src/services/sync/telemetry/index.ts +0 -0
- package/src/services/sync/telemetry/sampling.ts +0 -0
- package/src/services/sync/utils/event-emitter.ts +0 -0
- package/src/services/sync/utils/index.ts +0 -0
- package/src/services/sync/utils/throttle.ts +0 -0
- package/src/services/sync/utils/timers.ts +0 -0
- package/src/services/types.js +0 -0
- package/src/services/urlBuilder.ts +0 -0
- package/src/services/user/chat.js +0 -0
- package/src/services/user/interests.js +0 -0
- package/src/services/user/management.js +0 -0
- package/src/services/user/memberships.ts +0 -0
- package/src/services/user/notifications.js +0 -0
- package/src/services/user/onboarding.ts +0 -0
- package/src/services/user/payments.ts +0 -0
- package/src/services/user/permissions.js +0 -0
- package/src/services/user/profile.js +0 -0
- package/src/services/user/sessions.js +0 -0
- package/src/services/user/types.d.ts +0 -0
- package/src/services/user/types.js +0 -0
- package/src/services/user/user-management-system.js +0 -0
- package/src/services/userActivity.js +0 -0
- package/test/HttpClient.test.js +0 -0
- package/test/awards/award-alacarte-observer.test.js +0 -0
- package/test/awards/award-auto-refresh.test.js +0 -0
- package/test/awards/award-calculations.test.js +0 -0
- package/test/awards/award-certificate-display.test.js +0 -0
- package/test/awards/award-collection-edge-cases.test.js +0 -0
- package/test/awards/award-collection-filtering.test.js +0 -0
- package/test/awards/award-completion-flow.test.js +0 -0
- package/test/awards/award-exclusion-handling.test.js +0 -0
- package/test/awards/award-multi-lesson.test.js +0 -0
- package/test/awards/award-observer-integration.test.js +0 -0
- package/test/awards/award-query-messages.test.js +0 -0
- package/test/awards/award-user-collection.test.js +0 -0
- package/test/awards/duplicate-prevention.test.js +0 -0
- package/test/awards/helpers/completion-mock.js +0 -0
- package/test/awards/helpers/index.js +0 -0
- package/test/awards/helpers/mock-setup.js +0 -0
- package/test/awards/helpers/progress-emitter.js +0 -0
- package/test/awards/message-generator.test.js +0 -0
- package/test/content.test.js +0 -0
- package/test/contentLikes.test.js +0 -0
- package/test/contentProgress.test.js +0 -0
- package/test/dataContext.test.js +0 -0
- package/test/forum.test.js +0 -0
- package/test/imageSRCBuilder.test.js +0 -0
- package/test/imageSRCVerify.test.js +0 -0
- package/test/initializeTests.js +0 -0
- package/test/learningPaths.test.js +0 -0
- package/test/lib/__snapshots__/filter.test.ts.snap +0 -0
- package/test/lib/filter.test.ts +0 -0
- package/test/lib/lastUpdated.test.js +0 -0
- package/test/lib/query.test.ts +0 -0
- package/test/live/contentProgressLive.test.js +0 -0
- package/test/live/railcontentLive.test.js +0 -0
- package/test/localStorageMock.js +0 -0
- package/test/log.js +0 -0
- package/test/mockData/award-definitions.js +0 -0
- package/test/mockData/mockData_fetchByRailContentIds_one_content.json +0 -0
- package/test/mockData/mockData_progress_content.json +0 -0
- package/test/mockData/mockData_sanity_progress_content.json +0 -0
- package/test/mockData/mockData_user_practices.json +0 -0
- package/test/notifications.test.js +0 -0
- package/test/progressRows.test.js +0 -0
- package/test/sanityQueryService.test.js +0 -0
- package/test/streakMessage.test.js +0 -0
- package/test/sync/adapter.ts +0 -0
- package/test/sync/initialize-sync-manager.js +0 -0
- package/test/sync/models/award-database-integration.test.js +0 -0
- package/test/user/permissions.test.js +0 -0
- package/test/userActivity.test.js +0 -0
- package/tools/generate-index.cjs +0 -0
- package/.claude/settings.local.json +0 -16
- package/.yarnrc.yml +0 -1
- package/check_content.js +0 -30
- package/check_content.mjs +0 -32
- package/test/logout.test.js +0 -199
- package/test/reporting.test.js +0 -132
- package/test_owned_navigate.js +0 -74
- package/tsconfig.json +0 -17
package/src/services/sanity.js
CHANGED
|
@@ -1192,7 +1192,7 @@ export async function fetchLiveEvent(brand, forcedContentId = null) {
|
|
|
1192
1192
|
forcedContentId !== null
|
|
1193
1193
|
? `railcontent_id == ${forcedContentId}`
|
|
1194
1194
|
: `status == 'scheduled'
|
|
1195
|
-
&& brand == '${brand}'
|
|
1195
|
+
&& (brand == '${brand}' || live_global_event == true)
|
|
1196
1196
|
&& defined(live_event_start_time)
|
|
1197
1197
|
&& live_event_start_time <= '${getSanityDate(startDateTemp, false)}'
|
|
1198
1198
|
&& live_event_end_time >= '${getSanityDate(endDateTemp, false)}'`
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
@@ -100,13 +100,6 @@ export default class SyncRepository<TModel extends BaseModel> {
|
|
|
100
100
|
)
|
|
101
101
|
}
|
|
102
102
|
|
|
103
|
-
protected async upsertOneTentative(id: RecordId, builder: (record: TModel) => void) {
|
|
104
|
-
return this.store.telemetry.trace(
|
|
105
|
-
{ name: `upsertOneTentative:${this.store.model.table}`, op: 'upsert', attributes: { ...this.context.session.toJSON() } },
|
|
106
|
-
(span) => this._respondToWrite(() => this.store.upsertOneTentative(id, builder, span), span)
|
|
107
|
-
)
|
|
108
|
-
}
|
|
109
|
-
|
|
110
103
|
protected async upsertSome(builders: Record<RecordId, (record: TModel) => void>, { skipPush = false } = {}) {
|
|
111
104
|
return this.store.telemetry.trace(
|
|
112
105
|
{ name: `upsertSome:${this.store.model.table}`, op: 'upsert', attributes: { ...this.context.session.toJSON() } },
|
|
@@ -114,13 +107,6 @@ export default class SyncRepository<TModel extends BaseModel> {
|
|
|
114
107
|
)
|
|
115
108
|
}
|
|
116
109
|
|
|
117
|
-
protected async upsertSomeTentative(builders: Record<RecordId, (record: TModel) => void>, { skipPush = false } = {}) {
|
|
118
|
-
return this.store.telemetry.trace(
|
|
119
|
-
{ name: `upsertSomeTentative:${this.store.model.table}`, op: 'upsert', attributes: { ...this.context.session.toJSON() } },
|
|
120
|
-
(span) => this._respondToWrite(() => this.store.upsertSomeTentative(builders, span, {skipPush}), span)
|
|
121
|
-
)
|
|
122
|
-
}
|
|
123
|
-
|
|
124
110
|
protected async deleteOne(id: RecordId, { skipPush = false } = {}) {
|
|
125
111
|
return this.store.telemetry.trace(
|
|
126
112
|
{ name: `delete:${this.store.model.table}`, op: 'delete', attributes: { ...this.context.session.toJSON() } },
|
|
@@ -128,10 +114,10 @@ export default class SyncRepository<TModel extends BaseModel> {
|
|
|
128
114
|
)
|
|
129
115
|
}
|
|
130
116
|
|
|
131
|
-
protected async deleteSome(ids: RecordId[]) {
|
|
117
|
+
protected async deleteSome(ids: RecordId[], { skipPush = false } = {}) {
|
|
132
118
|
return this.store.telemetry.trace(
|
|
133
119
|
{ name: `deleteSome:${this.store.model.table}`, op: 'delete', attributes: { ...this.context.session.toJSON() } },
|
|
134
|
-
(span) => this._respondToWriteIds(() => this.store.deleteSome(ids, span), span)
|
|
120
|
+
(span) => this._respondToWriteIds(() => this.store.deleteSome(ids, span, {skipPush}), span)
|
|
135
121
|
)
|
|
136
122
|
}
|
|
137
123
|
|
|
File without changes
|
|
@@ -187,7 +187,7 @@ export default class ProgressRepository extends SyncRepository<ContentProgress>
|
|
|
187
187
|
recordProgressMany(
|
|
188
188
|
contentProgresses: Record<string, number>, // Accept plain object
|
|
189
189
|
collection: CollectionParameter | null,
|
|
190
|
-
{
|
|
190
|
+
{ skipPush = false, fromLearningPath = false }: { skipPush?: boolean; fromLearningPath?: boolean } = {}
|
|
191
191
|
) {
|
|
192
192
|
if (collection?.type === COLLECTION_TYPE.LEARNING_PATH) {
|
|
193
193
|
fromLearningPath = true
|
|
@@ -209,9 +209,7 @@ export default class ProgressRepository extends SyncRepository<ContentProgress>
|
|
|
209
209
|
},
|
|
210
210
|
])
|
|
211
211
|
)
|
|
212
|
-
return
|
|
213
|
-
? this.upsertSomeTentative(data, { skipPush })
|
|
214
|
-
: this.upsertSome(data, { skipPush })
|
|
212
|
+
return this.upsertSome(data, { skipPush })
|
|
215
213
|
|
|
216
214
|
//todo add event emitting for bulk updates?
|
|
217
215
|
}
|
|
@@ -220,6 +218,11 @@ export default class ProgressRepository extends SyncRepository<ContentProgress>
|
|
|
220
218
|
return this.deleteOne(ProgressRepository.generateId(contentId, collection), { skipPush })
|
|
221
219
|
}
|
|
222
220
|
|
|
221
|
+
eraseProgressMany(contentIds: number[], collection: CollectionParameter | null, {skipPush = false} = {}) {
|
|
222
|
+
const ids = contentIds.map((id) => ProgressRepository.generateId(id, collection))
|
|
223
|
+
return this.deleteSome(ids, { skipPush })
|
|
224
|
+
}
|
|
225
|
+
|
|
223
226
|
private static generateId(
|
|
224
227
|
contentId: number,
|
|
225
228
|
collection: CollectionParameter | null
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
@@ -354,7 +354,7 @@ export default class SyncStore<TModel extends BaseModel = BaseModel> {
|
|
|
354
354
|
})
|
|
355
355
|
}
|
|
356
356
|
|
|
357
|
-
async deleteSome(ids: RecordId[], span?: Span) {
|
|
357
|
+
async deleteSome(ids: RecordId[], span?: Span, { skipPush = false } = {}) {
|
|
358
358
|
return this.runScope.abortable(async () => {
|
|
359
359
|
await this.telemeterizedWrite(span, async writer => {
|
|
360
360
|
const existing = await this.queryRecords(Q.where('id', Q.oneOf(ids)))
|
|
@@ -364,7 +364,9 @@ export default class SyncStore<TModel extends BaseModel = BaseModel> {
|
|
|
364
364
|
|
|
365
365
|
this.emit('deleted', ids)
|
|
366
366
|
|
|
367
|
-
|
|
367
|
+
if (!skipPush) {
|
|
368
|
+
this.pushUnsyncedWithRetry(span)
|
|
369
|
+
}
|
|
368
370
|
await this.ensurePersistence()
|
|
369
371
|
|
|
370
372
|
return ids
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
package/src/services/types.js
CHANGED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
package/test/HttpClient.test.js
CHANGED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
package/test/content.test.js
CHANGED
|
File without changes
|
|
File without changes
|
|
File without changes
|
package/test/dataContext.test.js
CHANGED
|
File without changes
|
package/test/forum.test.js
CHANGED
|
File without changes
|
|
File without changes
|
|
File without changes
|
package/test/initializeTests.js
CHANGED
|
File without changes
|
|
File without changes
|
|
File without changes
|
package/test/lib/filter.test.ts
CHANGED
|
File without changes
|
|
File without changes
|
package/test/lib/query.test.ts
CHANGED
|
File without changes
|
|
File without changes
|
|
File without changes
|
package/test/localStorageMock.js
CHANGED
|
File without changes
|
package/test/log.js
CHANGED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
package/test/sync/adapter.ts
CHANGED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
package/tools/generate-index.cjs
CHANGED
|
File without changes
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"permissions": {
|
|
3
|
-
"allow": [
|
|
4
|
-
"Read(//app/musora-platform-backend/**)",
|
|
5
|
-
"Read(//app/musora-platform-frontend/**)",
|
|
6
|
-
"Bash(find:*)",
|
|
7
|
-
"Bash(sed:*)",
|
|
8
|
-
"Read(//app/**)",
|
|
9
|
-
"Bash(cat:*)",
|
|
10
|
-
"Bash(docker exec:*)",
|
|
11
|
-
"Bash(npm config:*)"
|
|
12
|
-
],
|
|
13
|
-
"deny": [],
|
|
14
|
-
"ask": []
|
|
15
|
-
}
|
|
16
|
-
}
|
package/.yarnrc.yml
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
nodeLinker: node-modules
|
package/check_content.js
DELETED
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
const { initializeService } = require('./src/services/config.js');
|
|
2
|
-
const { fetchByRailContentIds } = require('./src/services/sanity.js');
|
|
3
|
-
require('dotenv/config');
|
|
4
|
-
|
|
5
|
-
async function checkContent() {
|
|
6
|
-
initializeService({
|
|
7
|
-
sanityConfig: {
|
|
8
|
-
token: process.env.SANITY_TOKEN,
|
|
9
|
-
projectId: process.env.SANITY_PROJECT_ID,
|
|
10
|
-
dataset: process.env.SANITY_DATASET,
|
|
11
|
-
version: process.env.SANITY_VERSION || '2021-06-07',
|
|
12
|
-
},
|
|
13
|
-
railcontentConfig: {
|
|
14
|
-
token: process.env.RAILCONTENT_TOKEN,
|
|
15
|
-
userId: process.env.RAILCONTENT_USER_ID,
|
|
16
|
-
baseUrl: process.env.RAILCONTENT_BASE_URL,
|
|
17
|
-
authToken: process.env.RAILCONTENT_AUTH_TOKEN,
|
|
18
|
-
},
|
|
19
|
-
baseUrl: process.env.RAILCONTENT_BASE_URL,
|
|
20
|
-
localStorage: null,
|
|
21
|
-
isMA: false,
|
|
22
|
-
});
|
|
23
|
-
|
|
24
|
-
console.log('Checking railcontent_id: 421814');
|
|
25
|
-
const contents = await fetchByRailContentIds([421814]);
|
|
26
|
-
console.log('Results:', JSON.stringify(contents, null, 2));
|
|
27
|
-
console.log('Found:', contents.length, 'items');
|
|
28
|
-
}
|
|
29
|
-
|
|
30
|
-
checkContent().catch(console.error);
|
package/check_content.mjs
DELETED
|
@@ -1,32 +0,0 @@
|
|
|
1
|
-
import { initializeService } from './src/services/config.js';
|
|
2
|
-
import { fetchByRailContentIds } from './src/services/sanity.js';
|
|
3
|
-
import dotenv from 'dotenv';
|
|
4
|
-
|
|
5
|
-
dotenv.config();
|
|
6
|
-
|
|
7
|
-
async function checkContent() {
|
|
8
|
-
initializeService({
|
|
9
|
-
sanityConfig: {
|
|
10
|
-
token: process.env.SANITY_TOKEN,
|
|
11
|
-
projectId: process.env.SANITY_PROJECT_ID,
|
|
12
|
-
dataset: process.env.SANITY_DATASET,
|
|
13
|
-
version: process.env.SANITY_VERSION || '2021-06-07',
|
|
14
|
-
},
|
|
15
|
-
railcontentConfig: {
|
|
16
|
-
token: process.env.RAILCONTENT_TOKEN,
|
|
17
|
-
userId: process.env.RAILCONTENT_USER_ID,
|
|
18
|
-
baseUrl: process.env.RAILCONTENT_BASE_URL,
|
|
19
|
-
authToken: process.env.RAILCONTENT_AUTH_TOKEN,
|
|
20
|
-
},
|
|
21
|
-
baseUrl: process.env.RAILCONTENT_BASE_URL,
|
|
22
|
-
localStorage: null,
|
|
23
|
-
isMA: false,
|
|
24
|
-
});
|
|
25
|
-
|
|
26
|
-
console.log('Checking railcontent_id: 421814');
|
|
27
|
-
const contents = await fetchByRailContentIds([421814]);
|
|
28
|
-
console.log('Results:', JSON.stringify(contents, null, 2));
|
|
29
|
-
console.log('Found:', contents.length, 'items');
|
|
30
|
-
}
|
|
31
|
-
|
|
32
|
-
checkContent().catch(console.error);
|