@access-dlsu/leapify 0.260507.1 → 0.260507.5
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/app.d.ts.map +1 -1
- package/dist/auth/auth.d.ts.map +1 -1
- package/dist/auth/middleware.d.ts.map +1 -1
- package/dist/{chunk-ANNHE3PZ.js → chunk-5YYVBPAE.js} +21 -5
- package/dist/chunk-5YYVBPAE.js.map +1 -0
- package/dist/{chunk-QARF2YFF.cjs → chunk-LVKPYSXI.cjs} +21 -5
- package/dist/chunk-LVKPYSXI.cjs.map +1 -0
- package/dist/{chunk-63CUZGSZ.js → chunk-OZ6HZKR5.js} +21 -5
- package/dist/chunk-OZ6HZKR5.js.map +1 -0
- package/dist/{chunk-YFJBE3AU.cjs → chunk-S5DBMZVP.cjs} +21 -5
- package/dist/chunk-S5DBMZVP.cjs.map +1 -0
- package/dist/client/auth.d.ts +1 -13
- package/dist/client/auth.d.ts.map +1 -1
- package/dist/client/index.cjs +25 -25
- package/dist/client/index.cjs.map +1 -1
- package/dist/client/index.d.ts +17 -17
- package/dist/client/index.d.ts.map +1 -1
- package/dist/client/index.js +25 -25
- package/dist/client/index.js.map +1 -1
- package/dist/client/types.d.ts +4 -2
- package/dist/client/types.d.ts.map +1 -1
- package/dist/db/migrate.d.ts.map +1 -1
- package/dist/db/schema/{events.d.ts → classes.d.ts} +3 -3
- package/dist/db/schema/classes.d.ts.map +1 -0
- package/dist/db/schema/index.d.ts +1 -1
- package/dist/db/schema/index.d.ts.map +1 -1
- package/dist/db/schema/site-config.d.ts +83 -0
- package/dist/db/schema/site-config.d.ts.map +1 -1
- package/dist/index.cjs +679 -59
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.ts +2 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +655 -40
- package/dist/index.js.map +1 -1
- package/dist/lib/middleware/cors.d.ts.map +1 -1
- package/dist/lib/middleware/pow-challenge.cjs +6 -6
- package/dist/lib/middleware/pow-challenge.d.ts.map +1 -1
- package/dist/lib/middleware/pow-challenge.js +1 -1
- package/dist/routes/classes.d.ts +4 -0
- package/dist/routes/classes.d.ts.map +1 -0
- package/dist/routes/contentful-sync.d.ts +4 -0
- package/dist/routes/contentful-sync.d.ts.map +1 -0
- package/dist/services/snapshot.d.ts +1 -1
- package/dist/services/snapshot.d.ts.map +1 -1
- package/dist/types.d.ts +19 -0
- package/dist/types.d.ts.map +1 -1
- package/dist/worker-handler.d.ts.map +1 -1
- package/dist/worker.js +662 -39
- package/dist/worker.js.map +1 -1
- package/package.json +153 -153
- package/dist/chunk-63CUZGSZ.js.map +0 -1
- package/dist/chunk-ANNHE3PZ.js.map +0 -1
- package/dist/chunk-QARF2YFF.cjs.map +0 -1
- package/dist/chunk-YFJBE3AU.cjs.map +0 -1
- package/dist/db/schema/events.d.ts.map +0 -1
- package/dist/routes/events.d.ts +0 -4
- package/dist/routes/events.d.ts.map +0 -1
package/dist/client/index.d.ts
CHANGED
|
@@ -14,7 +14,7 @@
|
|
|
14
14
|
*
|
|
15
15
|
* const events = await api.getEvents()
|
|
16
16
|
*/
|
|
17
|
-
export type { LeapEvent, SlotInfo, UserProfile, BookmarkEntry, Faq, Theme, Organization, SiteConfig, ToggleBookmarkResult, LeapifyErrorBody, UserRole, EventStatus, CreateEventBody, CreateFaqBody, SnapshotResult, HealthResponse, RuntimeConfig, } from "./types";
|
|
17
|
+
export type { LeapEvent, SlotInfo, UserProfile, BookmarkEntry, Faq, Theme, Organization, SiteConfig, ToggleBookmarkResult, LeapifyErrorBody, UserRole, EventStatus, CreateEventBody, CreateFaqBody, SnapshotResult, HealthResponse, RuntimeConfig, CmsMode, } from "./types";
|
|
18
18
|
export { createLeapifyAuthClient, signInWithGoogleRedirect, syncCookieSessionToStorage, getLeapifyToken, signOut, } from "./auth";
|
|
19
19
|
export type { LeapifyAuthClient } from "./auth";
|
|
20
20
|
export { solvePowChallenge } from "./pow";
|
|
@@ -90,46 +90,46 @@ export declare function createLeapifyClient(baseUrl: string, getToken?: GetToken
|
|
|
90
90
|
value: unknown;
|
|
91
91
|
}>;
|
|
92
92
|
/**
|
|
93
|
-
* GET /api/
|
|
94
|
-
* Returns all published
|
|
93
|
+
* GET /api/classes
|
|
94
|
+
* Returns all published classes. Response is ETag-cached for 7 days.
|
|
95
95
|
*/
|
|
96
96
|
getEvents(): Promise<LeapEvent[]>;
|
|
97
97
|
/**
|
|
98
|
-
* GET /api/
|
|
99
|
-
* Returns all
|
|
98
|
+
* GET /api/classes/admin — admin only.
|
|
99
|
+
* Returns all classes regardless of status.
|
|
100
100
|
*/
|
|
101
101
|
getAdminEvents(): Promise<LeapEvent[]>;
|
|
102
102
|
/**
|
|
103
|
-
* POST /api/
|
|
104
|
-
* Batch publish queued
|
|
103
|
+
* POST /api/classes/admin/publish — admin only.
|
|
104
|
+
* Batch publish queued classes immediately or schedule them for later.
|
|
105
105
|
*/
|
|
106
106
|
batchPublish(ids: string[], releaseAt?: number): Promise<{
|
|
107
107
|
updated: number;
|
|
108
108
|
}>;
|
|
109
109
|
/**
|
|
110
|
-
* GET /api/
|
|
111
|
-
* Returns a single published
|
|
110
|
+
* GET /api/classes/:slug
|
|
111
|
+
* Returns a single published class by slug.
|
|
112
112
|
*/
|
|
113
113
|
getEvent(slug: string): Promise<LeapEvent>;
|
|
114
114
|
/**
|
|
115
|
-
* GET /api/
|
|
115
|
+
* GET /api/classes/:slug/slots
|
|
116
116
|
* Returns real-time slot availability. CF edge caches this for 5 seconds.
|
|
117
|
-
* Poll every 8–10 seconds on
|
|
117
|
+
* Poll every 8–10 seconds on class detail pages.
|
|
118
118
|
*/
|
|
119
119
|
getSlots(slug: string): Promise<SlotInfo>;
|
|
120
120
|
/**
|
|
121
|
-
* POST /api/
|
|
122
|
-
* Creates a new
|
|
121
|
+
* POST /api/classes — admin only.
|
|
122
|
+
* Creates a new class. Auto-generates slug from title.
|
|
123
123
|
*/
|
|
124
124
|
createEvent(data: CreateEventBody): Promise<LeapEvent>;
|
|
125
125
|
/**
|
|
126
|
-
* PATCH /api/
|
|
127
|
-
* Updates an existing
|
|
126
|
+
* PATCH /api/classes/:slug — admin only.
|
|
127
|
+
* Updates an existing class by slug.
|
|
128
128
|
*/
|
|
129
129
|
updateEvent(slug: string, data: Partial<CreateEventBody>): Promise<LeapEvent>;
|
|
130
130
|
/**
|
|
131
|
-
* DELETE /api/
|
|
132
|
-
* Deletes
|
|
131
|
+
* DELETE /api/classes/:slug — admin only.
|
|
132
|
+
* Deletes a class.
|
|
133
133
|
*/
|
|
134
134
|
deleteEvent(slug: string): Promise<void>;
|
|
135
135
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/client/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAEH,YAAY,EACV,SAAS,EACT,QAAQ,EACR,WAAW,EACX,aAAa,EACb,GAAG,EACH,KAAK,EACL,YAAY,EACZ,UAAU,EACV,oBAAoB,EACpB,gBAAgB,EAChB,QAAQ,EACR,WAAW,EACX,eAAe,EACf,aAAa,EACb,cAAc,EACd,cAAc,EACd,aAAa,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/client/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAEH,YAAY,EACV,SAAS,EACT,QAAQ,EACR,WAAW,EACX,aAAa,EACb,GAAG,EACH,KAAK,EACL,YAAY,EACZ,UAAU,EACV,oBAAoB,EACpB,gBAAgB,EAChB,QAAQ,EACR,WAAW,EACX,eAAe,EACf,aAAa,EACb,cAAc,EACd,cAAc,EACd,aAAa,EACb,OAAO,GACR,MAAM,SAAS,CAAC;AAEjB,OAAO,EACL,uBAAuB,EACvB,wBAAwB,EACxB,0BAA0B,EAC1B,eAAe,EACf,OAAO,GACR,MAAM,QAAQ,CAAC;AAChB,YAAY,EAAE,iBAAiB,EAAE,MAAM,QAAQ,CAAC;AAEhD,OA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W,CAAC;IAI9D;;;OAGG;6BACsB,MAAM,QAAQ,MAAM,GAAG,OAAO,CAAC,WAAW,CAAC;IAMpE;;;;OAIG;oBACa,OAAO,CAAC,aAAa,EAAE,CAAC;IAIxC;;;;OAIG;4BACqB,MAAM,GAAG,OAAO,CAAC,oBAAoB,CAAC;IAM9D;;;OAGG;4BACqB,MAAM,GAAG,OAAO,CAAC,oBAAoB,CAAC;IAQ9D;;;;OAIG;eACQ,OAAO,CAAC,GAAG,EAAE,CAAC;IAIzB;;;OAGG;oBACa,aAAa,GAAG,OAAO,CAAC,GAAG,CAAC;IAI5C;;;OAGG;kBACW,MAAM,QAAQ,OAAO,CAAC,aAAa,CAAC,GAAG,OAAO,CAAC,GAAG,CAAC;IAIjE;;;OAGG;kBACW,MAAM,GAAG,OAAO,CAAC;QAAE,OAAO,EAAE,OAAO,CAAA;KAAE,CAAC;IAMpD;;;;OAIG;sBACe,IAAI,GAAG,IAAI,GAAG,OAAO,CAAC;QACtC,GAAG,EAAE,MAAM,CAAC;QACZ,GAAG,EAAE,MAAM,CAAC;QACZ,IAAI,EAAE,MAAM,CAAC;QACb,WAAW,EAAE,MAAM,CAAC;KACrB,CAAC;IAQF;;;OAGG;mBACY,OAAO,CAAC,cAAc,CAAC;IAMtC;;;OAGG;mBACY,OAAO,CAAC,cAAc,CAAC;EAIzC;AAED,MAAM,MAAM,aAAa,GAAG,UAAU,CAAC,OAAO,mBAAmB,CAAC,CAAC"}
|
package/dist/client/index.js
CHANGED
|
@@ -847,7 +847,7 @@ async function solvePowChallenge(baseUrl) {
|
|
|
847
847
|
const base = baseUrl?.replace(/\/$/, "") ?? "";
|
|
848
848
|
let html;
|
|
849
849
|
try {
|
|
850
|
-
const res = await fetch(`${base}/api/
|
|
850
|
+
const res = await fetch(`${base}/api/classes`, { credentials: "include" });
|
|
851
851
|
const ct = res.headers.get("content-type") || "";
|
|
852
852
|
if (!ct.includes("text/html")) {
|
|
853
853
|
return false;
|
|
@@ -1008,61 +1008,61 @@ function createLeapifyClient(baseUrl, getToken) {
|
|
|
1008
1008
|
},
|
|
1009
1009
|
// ── Events ─────────────────────────────────────────────────────────────
|
|
1010
1010
|
/**
|
|
1011
|
-
* GET /api/
|
|
1012
|
-
* Returns all published
|
|
1011
|
+
* GET /api/classes
|
|
1012
|
+
* Returns all published classes. Response is ETag-cached for 7 days.
|
|
1013
1013
|
*/
|
|
1014
1014
|
getEvents() {
|
|
1015
|
-
return get("/api/
|
|
1015
|
+
return get("/api/classes");
|
|
1016
1016
|
},
|
|
1017
1017
|
/**
|
|
1018
|
-
* GET /api/
|
|
1019
|
-
* Returns all
|
|
1018
|
+
* GET /api/classes/admin — admin only.
|
|
1019
|
+
* Returns all classes regardless of status.
|
|
1020
1020
|
*/
|
|
1021
1021
|
getAdminEvents() {
|
|
1022
|
-
return get("/api/
|
|
1022
|
+
return get("/api/classes/admin");
|
|
1023
1023
|
},
|
|
1024
1024
|
/**
|
|
1025
|
-
* POST /api/
|
|
1026
|
-
* Batch publish queued
|
|
1025
|
+
* POST /api/classes/admin/publish — admin only.
|
|
1026
|
+
* Batch publish queued classes immediately or schedule them for later.
|
|
1027
1027
|
*/
|
|
1028
1028
|
batchPublish(ids, releaseAt) {
|
|
1029
|
-
return post("/api/
|
|
1029
|
+
return post("/api/classes/admin/publish", { ids, releaseAt });
|
|
1030
1030
|
},
|
|
1031
1031
|
/**
|
|
1032
|
-
* GET /api/
|
|
1033
|
-
* Returns a single published
|
|
1032
|
+
* GET /api/classes/:slug
|
|
1033
|
+
* Returns a single published class by slug.
|
|
1034
1034
|
*/
|
|
1035
1035
|
getEvent(slug) {
|
|
1036
|
-
return get(`/api/
|
|
1036
|
+
return get(`/api/classes/${encodeURIComponent(slug)}`);
|
|
1037
1037
|
},
|
|
1038
1038
|
/**
|
|
1039
|
-
* GET /api/
|
|
1039
|
+
* GET /api/classes/:slug/slots
|
|
1040
1040
|
* Returns real-time slot availability. CF edge caches this for 5 seconds.
|
|
1041
|
-
* Poll every 8–10 seconds on
|
|
1041
|
+
* Poll every 8–10 seconds on class detail pages.
|
|
1042
1042
|
*/
|
|
1043
1043
|
getSlots(slug) {
|
|
1044
|
-
return get(`/api/
|
|
1044
|
+
return get(`/api/classes/${encodeURIComponent(slug)}/slots`);
|
|
1045
1045
|
},
|
|
1046
1046
|
/**
|
|
1047
|
-
* POST /api/
|
|
1048
|
-
* Creates a new
|
|
1047
|
+
* POST /api/classes — admin only.
|
|
1048
|
+
* Creates a new class. Auto-generates slug from title.
|
|
1049
1049
|
*/
|
|
1050
1050
|
createEvent(data) {
|
|
1051
|
-
return post("/api/
|
|
1051
|
+
return post("/api/classes", data);
|
|
1052
1052
|
},
|
|
1053
1053
|
/**
|
|
1054
|
-
* PATCH /api/
|
|
1055
|
-
* Updates an existing
|
|
1054
|
+
* PATCH /api/classes/:slug — admin only.
|
|
1055
|
+
* Updates an existing class by slug.
|
|
1056
1056
|
*/
|
|
1057
1057
|
updateEvent(slug, data) {
|
|
1058
|
-
return patch(`/api/
|
|
1058
|
+
return patch(`/api/classes/${encodeURIComponent(slug)}`, data);
|
|
1059
1059
|
},
|
|
1060
1060
|
/**
|
|
1061
|
-
* DELETE /api/
|
|
1062
|
-
* Deletes
|
|
1061
|
+
* DELETE /api/classes/:slug — admin only.
|
|
1062
|
+
* Deletes a class.
|
|
1063
1063
|
*/
|
|
1064
1064
|
deleteEvent(slug) {
|
|
1065
|
-
return del(`/api/
|
|
1065
|
+
return del(`/api/classes/${encodeURIComponent(slug)}`);
|
|
1066
1066
|
},
|
|
1067
1067
|
// ── Themes ─────────────────────────────────────────────────────────────
|
|
1068
1068
|
/**
|