nucleus-core-ts 0.10.147 → 0.10.151
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/LICENSE +48 -48
- package/dist/.build-ok +1 -1
- package/dist/fe/components/AuthorizationPage/labels.js +13 -13
- package/dist/fe/components/Captcha/labels.js +17 -17
- package/dist/fe/components/ChatPanel/helpers.js +17 -17
- package/dist/fe/components/ChatPanel/labels.js +16 -16
- package/dist/fe/components/DataTable/labels.js +16 -16
- package/dist/fe/components/DevicesPage/components/DeviceCard.js +15 -15
- package/dist/fe/components/DevicesPage/components/DevicesPage.js +9 -9
- package/dist/fe/components/DevicesPage/labels.js +12 -12
- package/dist/fe/components/ForgotPasswordPage/labels.js +8 -8
- package/dist/fe/components/FormBuilder/components/FormField.js +5 -5
- package/dist/fe/components/FormBuilder/utils/fieldMapping.js +9 -9
- package/dist/fe/components/IntegrationsPage/components/ConnectionAuthFields.js +8 -8
- package/dist/fe/components/IntegrationsPage/components/ConnectionBasicFields.js +3 -3
- package/dist/fe/components/IntegrationsPage/components/ConnectionExport.js +23 -23
- package/dist/fe/components/IntegrationsPage/components/ConnectionForm.js +22 -22
- package/dist/fe/components/IntegrationsPage/components/ConnectionList.js +7 -7
- package/dist/fe/components/IntegrationsPage/components/ConnectionOauthFields.js +6 -6
- package/dist/fe/components/IntegrationsPage/components/ConnectionSettingsTab.js +24 -24
- package/dist/fe/components/IntegrationsPage/components/ConnectionSwitcher.js +19 -19
- package/dist/fe/components/IntegrationsPage/components/ConnectionTabs.js +15 -15
- package/dist/fe/components/IntegrationsPage/components/ConnectionTest.js +21 -21
- package/dist/fe/components/IntegrationsPage/components/ConnectionTransfer.js +18 -18
- package/dist/fe/components/IntegrationsPage/components/CredentialFields.js +19 -19
- package/dist/fe/components/IntegrationsPage/components/CredentialSlotRow.js +8 -8
- package/dist/fe/components/IntegrationsPage/components/EndpointForm.js +7 -7
- package/dist/fe/components/IntegrationsPage/components/EndpointFormFields.js +12 -12
- package/dist/fe/components/IntegrationsPage/components/EndpointList.js +7 -7
- package/dist/fe/components/IntegrationsPage/components/EndpointSample.js +36 -36
- package/dist/fe/components/IntegrationsPage/components/EndpointsTab.js +29 -29
- package/dist/fe/components/IntegrationsPage/components/FieldMappingRow.js +7 -7
- package/dist/fe/components/IntegrationsPage/components/FieldMappingRows.js +6 -6
- package/dist/fe/components/IntegrationsPage/components/IntegrationsPage.js +60 -60
- package/dist/fe/components/IntegrationsPage/components/MappingAccountFields.js +15 -15
- package/dist/fe/components/IntegrationsPage/components/MappingEditor.js +9 -9
- package/dist/fe/components/IntegrationsPage/components/MappingList.js +23 -23
- package/dist/fe/components/IntegrationsPage/components/MappingPasswordField.js +12 -12
- package/dist/fe/components/IntegrationsPage/components/MappingScheduleFields.js +23 -23
- package/dist/fe/components/IntegrationsPage/components/MappingWriteModeFields.js +31 -31
- package/dist/fe/components/IntegrationsPage/components/MappingsTab.js +56 -56
- package/dist/fe/components/IntegrationsPage/components/PaginationFields.js +11 -11
- package/dist/fe/components/IntegrationsPage/components/ParamBindingRows.js +15 -15
- package/dist/fe/components/IntegrationsPage/components/Primitives.js +28 -28
- package/dist/fe/components/IntegrationsPage/components/ReferenceCheckRows.js +9 -9
- package/dist/fe/components/IntegrationsPage/components/RunConfirmStep.js +6 -6
- package/dist/fe/components/IntegrationsPage/components/RunHistory.js +6 -6
- package/dist/fe/components/IntegrationsPage/components/RunHistoryRow.js +9 -9
- package/dist/fe/components/IntegrationsPage/components/RunPanel.js +40 -40
- package/dist/fe/components/IntegrationsPage/components/RunPasswordField.js +18 -18
- package/dist/fe/components/IntegrationsPage/components/RunPlanIssues.js +6 -6
- package/dist/fe/components/IntegrationsPage/components/RunPlanReferences.js +12 -12
- package/dist/fe/components/IntegrationsPage/components/RunPlanSuggestions.js +11 -11
- package/dist/fe/components/IntegrationsPage/components/RunPlanSummary.js +6 -6
- package/dist/fe/components/IntegrationsPage/components/RunProgressBar.js +6 -6
- package/dist/fe/components/IntegrationsPage/components/RunRevertConflicts.js +6 -6
- package/dist/fe/components/IntegrationsPage/components/Skeletons.js +7 -7
- package/dist/fe/components/IntegrationsPage/components/authOptions.js +4 -4
- package/dist/fe/components/IntegrationsPage/components/connectionDraft.js +27 -27
- package/dist/fe/components/IntegrationsPage/components/credentialSlots.js +25 -25
- package/dist/fe/components/IntegrationsPage/components/deleteIsConfirmed.js +9 -9
- package/dist/fe/components/IntegrationsPage/components/fieldMappingOptions.js +4 -4
- package/dist/fe/components/IntegrationsPage/components/formSupport.js +34 -34
- package/dist/fe/components/IntegrationsPage/components/jsonArray.js +14 -14
- package/dist/fe/components/IntegrationsPage/components/jsonObjectField.js +15 -15
- package/dist/fe/components/IntegrationsPage/components/mappingDraft.js +10 -10
- package/dist/fe/components/IntegrationsPage/components/mappingStaleness.js +22 -22
- package/dist/fe/components/IntegrationsPage/components/nextRuns.js +8 -8
- package/dist/fe/components/IntegrationsPage/components/passwordIsNeeded.js +13 -13
- package/dist/fe/components/IntegrationsPage/components/pathParams.js +6 -6
- package/dist/fe/components/IntegrationsPage/components/runFormat.js +18 -18
- package/dist/fe/components/IntegrationsPage/components/settleOwnership.js +18 -18
- package/dist/fe/components/IntegrationsPage/components/useInfiniteList.js +8 -8
- package/dist/fe/components/IntegrationsPage/store/index.js +20 -20
- package/dist/fe/components/IntegrationsPage/store/upsertInto.js +12 -12
- package/dist/fe/components/IntegrationsPage/text/context.js +6 -6
- package/dist/fe/components/IntegrationsPage/text/index.js +18 -18
- package/dist/fe/components/IntegrationsPage/theme/index.js +29 -29
- package/dist/fe/components/IntegrationsPage/types/records.js +10 -10
- package/dist/fe/components/IntegrationsPage/types/results.js +3 -3
- package/dist/fe/components/NotificationCenter/labels.js +17 -17
- package/dist/fe/components/ProfilePage/labels.js +10 -10
- package/dist/fe/components/ResetPasswordPage/labels.js +4 -4
- package/dist/fe/components/SetPasswordPage/labels.js +11 -11
- package/dist/fe/components/UsersPage/labels.js +14 -14
- package/dist/fe/utils/columnUtils.js +24 -24
- package/dist/fe/utils/searchFold.js +36 -36
- package/dist/index.js +6 -6
- package/dist/server.js +6 -6
- package/dist/src/Client/Proxy/authz.js +4 -4
- package/dist/src/Client/Proxy/httpProxy.js +136 -136
- package/dist/src/Client/Proxy/largeBody.js +29 -29
- package/dist/src/Client/Proxy/utils.js +32 -32
- package/dist/src/Client/Proxy/wsProxy.js +59 -59
- package/dist/src/Managers/Redis/index.d.ts +14 -0
- package/dist/src/Nucleus/routes/auth/admin/impersonationStore.d.ts +3 -4
- package/dist/src/Nucleus/routes/auth/refresh/issuedPair.d.ts +67 -0
- package/dist/src/Nucleus/routes/auth/refresh/recordIssued.d.ts +15 -6
- package/dist/src/Nucleus/routes/auth/refresh/refreshChain.d.ts +56 -0
- package/dist/src/Services/Auth/SessionStore/utils.d.ts +2 -0
- package/dist/src/Shared/cron.js +71 -71
- package/dist/src/Shared/redactSecrets.js +156 -156
- package/dist/src/Shared/redaction/bare.js +61 -61
- package/dist/src/Shared/redaction/floor.js +48 -48
- package/dist/src/Shared/redaction/freeText.js +70 -70
- package/dist/src/Shared/redaction/json.js +30 -30
- package/dist/src/Shared/redaction/lists.js +23 -23
- package/dist/src/Shared/redaction/markers.js +28 -28
- package/dist/src/Shared/redaction/names.js +49 -49
- package/dist/src/Shared/redaction/pairs.js +54 -54
- package/dist/src/Shared/redaction/secretString.js +29 -29
- package/dist/src/Shared/redaction/structured.js +52 -52
- package/dist/src/Shared/redaction/walk.js +25 -25
- package/infra/scripts/generate-project.ts +766 -766
- package/infra/templates/README.md +57 -57
- package/infra/templates/backend/.dockerignore +9 -9
- package/infra/templates/backend/.env.example +15 -15
- package/infra/templates/backend/README.md +28 -28
- package/infra/templates/backend/azure-pipelines.yml +135 -135
- package/infra/templates/backend/k8s/Dockerfile +31 -31
- package/infra/templates/backend/k8s/configmap.yaml +26 -26
- package/infra/templates/backend/k8s/deployment.yaml +85 -85
- package/infra/templates/backend/k8s/pvc.yaml +12 -12
- package/infra/templates/backend/k8s/service.yaml +13 -13
- package/infra/templates/backend/tsconfig.json +22 -22
- package/infra/templates/frontend/.dockerignore +10 -10
- package/infra/templates/frontend/.env.example +8 -8
- package/infra/templates/frontend/.env.local.example +10 -10
- package/infra/templates/frontend/README.md +69 -69
- package/infra/templates/frontend/app/[tablename]/page.tsx +37 -37
- package/infra/templates/frontend/app/_components/AuthWrapper/index.tsx +63 -63
- package/infra/templates/frontend/app/authorization/page.tsx +43 -43
- package/infra/templates/frontend/app/change-password/page.tsx +23 -23
- package/infra/templates/frontend/app/devices/page.tsx +127 -127
- package/infra/templates/frontend/app/forgot-password/page.tsx +20 -20
- package/infra/templates/frontend/app/globals.css +28 -28
- package/infra/templates/frontend/app/layout.tsx +35 -35
- package/infra/templates/frontend/app/login/page.tsx +33 -33
- package/infra/templates/frontend/app/page.tsx +565 -565
- package/infra/templates/frontend/app/profile/page.tsx +92 -92
- package/infra/templates/frontend/app/register/page.tsx +27 -27
- package/infra/templates/frontend/app/reset-password/page.tsx +60 -60
- package/infra/templates/frontend/app/set-password/page.tsx +43 -43
- package/infra/templates/frontend/app/ui-docs/page.tsx +52 -52
- package/infra/templates/frontend/app/users/page.tsx +52 -52
- package/infra/templates/frontend/app/verify-email/page.tsx +41 -41
- package/infra/templates/frontend/app/verify-magic-link/page.tsx +46 -46
- package/infra/templates/frontend/azure-pipelines.yml +137 -137
- package/infra/templates/frontend/code-and-design-principles.md +438 -438
- package/infra/templates/frontend/k8s/Dockerfile +50 -50
- package/infra/templates/frontend/k8s/configmap.yaml +18 -18
- package/infra/templates/frontend/k8s/deployment.yaml +72 -72
- package/infra/templates/frontend/k8s/ingress.yaml +36 -36
- package/infra/templates/frontend/k8s/service.yaml +14 -14
- package/infra/templates/frontend/lib/api/endpoints.ts +37 -37
- package/infra/templates/frontend/lib/api/factory.ts +44 -44
- package/infra/templates/frontend/lib/api/hook.ts +10 -10
- package/infra/templates/frontend/next.config.ts +19 -19
- package/infra/templates/frontend/package.json +34 -34
- package/infra/templates/frontend/postcss.config.mjs +5 -5
- package/infra/templates/frontend/server.ts +114 -114
- package/infra/templates/frontend/tsconfig.json +23 -23
- package/package.json +1 -1
- package/public/components/CTA.tsx +25 -25
- package/public/components/Capabilities.tsx +67 -67
- package/public/components/Features.tsx +107 -107
- package/public/components/Footer.tsx +58 -58
- package/public/components/Hero.tsx +51 -51
- package/public/components/Managers.tsx +55 -55
- package/public/components/Nav.tsx +91 -91
- package/public/components/Stack.tsx +36 -36
- package/public/components/docs/Docs.tsx +60 -60
- package/public/components/docs/DocsContent.tsx +176 -176
- package/public/components/docs/DocsRightSidebar.tsx +53 -53
- package/public/components/docs/DocsSidebar.tsx +54 -54
- package/public/components/docs/content/authentication.ts +836 -836
- package/public/components/docs/content/authorization.ts +268 -268
- package/public/components/docs/content/backupRestore.ts +173 -173
- package/public/components/docs/content/clientModule.ts +287 -287
- package/public/components/docs/content/entityCrud.ts +682 -682
- package/public/components/docs/content/monitoring.ts +313 -313
- package/public/components/docs/content/multiTenant.ts +269 -269
- package/public/components/docs/content/oauthApiKeys.ts +325 -325
- package/public/components/docs/content/pubsub.ts +131 -131
- package/public/components/docs/content/storageCdn.ts +171 -171
- package/public/components/docs/content/verification.ts +289 -289
- package/public/components/docs/docsData.ts +113 -113
- package/public/components/docs/index.ts +6 -6
- package/public/components/index.ts +9 -9
- package/public/docs.css +629 -629
- package/public/index.html +81 -81
- package/public/index.tsx +42 -42
- package/public/store.ts +76 -76
- package/public/styles.css +858 -858
- package/schemas/config.nucleus.json +2651 -2651
- package/scripts/audit-purge-noise.ts +120 -120
- package/scripts/build.ts +582 -582
- package/scripts/generate-system-tables-types.ts +18 -18
- package/scripts/generate-types-schema.test.ts +73 -73
- package/scripts/generate-types-schema.ts +1284 -1284
- package/scripts/packagedScripts.test.ts +87 -87
- package/scripts/publish.ts +276 -276
- package/scripts/skillCitations.test.ts +107 -107
- package/scripts/verify-publishable.ts +40 -40
|
@@ -1,50 +1,50 @@
|
|
|
1
|
-
FROM oven/bun:1.3.10-alpine AS base
|
|
2
|
-
WORKDIR /app
|
|
3
|
-
|
|
4
|
-
FROM base AS deps
|
|
5
|
-
COPY package.json bun.lock* ./
|
|
6
|
-
RUN bun install
|
|
7
|
-
|
|
8
|
-
FROM base AS builder
|
|
9
|
-
WORKDIR /app
|
|
10
|
-
COPY --from=deps /app/node_modules ./node_modules
|
|
11
|
-
COPY . .
|
|
12
|
-
|
|
13
|
-
ENV NEXT_TELEMETRY_DISABLED=1
|
|
14
|
-
ENV NODE_ENV=production
|
|
15
|
-
|
|
16
|
-
# Build-time env vars (injected via --build-arg in pipeline, no NEXT_PUBLIC_ — server-side only)
|
|
17
|
-
ARG API_BASE_URL
|
|
18
|
-
ARG BACKEND_API_URL
|
|
19
|
-
ARG ALLOWED_ORIGINS
|
|
20
|
-
|
|
21
|
-
ENV API_BASE_URL=$API_BASE_URL
|
|
22
|
-
ENV BACKEND_API_URL=$BACKEND_API_URL
|
|
23
|
-
ENV ALLOWED_ORIGINS=$ALLOWED_ORIGINS
|
|
24
|
-
|
|
25
|
-
RUN bun run build
|
|
26
|
-
|
|
27
|
-
FROM base AS runner
|
|
28
|
-
WORKDIR /app
|
|
29
|
-
|
|
30
|
-
ENV NODE_ENV=production
|
|
31
|
-
ENV NEXT_TELEMETRY_DISABLED=1
|
|
32
|
-
ENV PORT=3000
|
|
33
|
-
ENV HOSTNAME=0.0.0.0
|
|
34
|
-
|
|
35
|
-
RUN addgroup --system --gid 1001 nodejs && \
|
|
36
|
-
adduser --system --uid 1001 --ingroup nodejs nextjs
|
|
37
|
-
|
|
38
|
-
# Next.js standalone output
|
|
39
|
-
COPY --from=builder --chown=nextjs:nodejs /app/.next/standalone ./
|
|
40
|
-
COPY --from=builder --chown=nextjs:nodejs /app/.next/static ./.next/static
|
|
41
|
-
COPY --from=builder --chown=nextjs:nodejs /app/public ./public
|
|
42
|
-
|
|
43
|
-
USER nextjs
|
|
44
|
-
|
|
45
|
-
EXPOSE 3000
|
|
46
|
-
|
|
47
|
-
HEALTHCHECK --interval=30s --timeout=5s --start-period=15s --retries=3 \
|
|
48
|
-
CMD node --eval "fetch('http://localhost:3000/').then(r => process.exit(r.ok ? 0 : 1)).catch(() => process.exit(1))"
|
|
49
|
-
|
|
50
|
-
CMD ["node", "server.js"]
|
|
1
|
+
FROM oven/bun:1.3.10-alpine AS base
|
|
2
|
+
WORKDIR /app
|
|
3
|
+
|
|
4
|
+
FROM base AS deps
|
|
5
|
+
COPY package.json bun.lock* ./
|
|
6
|
+
RUN bun install
|
|
7
|
+
|
|
8
|
+
FROM base AS builder
|
|
9
|
+
WORKDIR /app
|
|
10
|
+
COPY --from=deps /app/node_modules ./node_modules
|
|
11
|
+
COPY . .
|
|
12
|
+
|
|
13
|
+
ENV NEXT_TELEMETRY_DISABLED=1
|
|
14
|
+
ENV NODE_ENV=production
|
|
15
|
+
|
|
16
|
+
# Build-time env vars (injected via --build-arg in pipeline, no NEXT_PUBLIC_ — server-side only)
|
|
17
|
+
ARG API_BASE_URL
|
|
18
|
+
ARG BACKEND_API_URL
|
|
19
|
+
ARG ALLOWED_ORIGINS
|
|
20
|
+
|
|
21
|
+
ENV API_BASE_URL=$API_BASE_URL
|
|
22
|
+
ENV BACKEND_API_URL=$BACKEND_API_URL
|
|
23
|
+
ENV ALLOWED_ORIGINS=$ALLOWED_ORIGINS
|
|
24
|
+
|
|
25
|
+
RUN bun run build
|
|
26
|
+
|
|
27
|
+
FROM base AS runner
|
|
28
|
+
WORKDIR /app
|
|
29
|
+
|
|
30
|
+
ENV NODE_ENV=production
|
|
31
|
+
ENV NEXT_TELEMETRY_DISABLED=1
|
|
32
|
+
ENV PORT=3000
|
|
33
|
+
ENV HOSTNAME=0.0.0.0
|
|
34
|
+
|
|
35
|
+
RUN addgroup --system --gid 1001 nodejs && \
|
|
36
|
+
adduser --system --uid 1001 --ingroup nodejs nextjs
|
|
37
|
+
|
|
38
|
+
# Next.js standalone output
|
|
39
|
+
COPY --from=builder --chown=nextjs:nodejs /app/.next/standalone ./
|
|
40
|
+
COPY --from=builder --chown=nextjs:nodejs /app/.next/static ./.next/static
|
|
41
|
+
COPY --from=builder --chown=nextjs:nodejs /app/public ./public
|
|
42
|
+
|
|
43
|
+
USER nextjs
|
|
44
|
+
|
|
45
|
+
EXPOSE 3000
|
|
46
|
+
|
|
47
|
+
HEALTHCHECK --interval=30s --timeout=5s --start-period=15s --retries=3 \
|
|
48
|
+
CMD node --eval "fetch('http://localhost:3000/').then(r => process.exit(r.ok ? 0 : 1)).catch(() => process.exit(1))"
|
|
49
|
+
|
|
50
|
+
CMD ["node", "server.js"]
|
|
@@ -1,18 +1,18 @@
|
|
|
1
|
-
apiVersion: v1
|
|
2
|
-
kind: ConfigMap
|
|
3
|
-
metadata:
|
|
4
|
-
name: {{PROJECT_NAME}}-configmap
|
|
5
|
-
namespace: {{NAMESPACE}}
|
|
6
|
-
data:
|
|
7
|
-
HOSTNAME: '0.0.0.0'
|
|
8
|
-
APP_PORT: '3000'
|
|
9
|
-
|
|
10
|
-
# Backend API URL (internal K8s service address)
|
|
11
|
-
API_BASE_URL: 'http://{{API_SERVICE_NAME}}-service.{{NAMESPACE}}.svc.cluster.local:3000'
|
|
12
|
-
BACKEND_API_URL: 'http://{{API_SERVICE_NAME}}-service.{{NAMESPACE}}.svc.cluster.local:3000'
|
|
13
|
-
|
|
14
|
-
# Allowed origins for CORS
|
|
15
|
-
ALLOWED_ORIGINS: '{{DOMAIN}}'
|
|
16
|
-
|
|
17
|
-
# Cookie domain
|
|
18
|
-
COOKIE_DOMAIN: '.{{DOMAIN}}'
|
|
1
|
+
apiVersion: v1
|
|
2
|
+
kind: ConfigMap
|
|
3
|
+
metadata:
|
|
4
|
+
name: {{PROJECT_NAME}}-configmap
|
|
5
|
+
namespace: {{NAMESPACE}}
|
|
6
|
+
data:
|
|
7
|
+
HOSTNAME: '0.0.0.0'
|
|
8
|
+
APP_PORT: '3000'
|
|
9
|
+
|
|
10
|
+
# Backend API URL (internal K8s service address)
|
|
11
|
+
API_BASE_URL: 'http://{{API_SERVICE_NAME}}-service.{{NAMESPACE}}.svc.cluster.local:3000'
|
|
12
|
+
BACKEND_API_URL: 'http://{{API_SERVICE_NAME}}-service.{{NAMESPACE}}.svc.cluster.local:3000'
|
|
13
|
+
|
|
14
|
+
# Allowed origins for CORS
|
|
15
|
+
ALLOWED_ORIGINS: '{{DOMAIN}}'
|
|
16
|
+
|
|
17
|
+
# Cookie domain
|
|
18
|
+
COOKIE_DOMAIN: '.{{DOMAIN}}'
|
|
@@ -1,72 +1,72 @@
|
|
|
1
|
-
apiVersion: apps/v1
|
|
2
|
-
kind: Deployment
|
|
3
|
-
metadata:
|
|
4
|
-
name: {{PROJECT_NAME}}-deployment
|
|
5
|
-
namespace: {{NAMESPACE}}
|
|
6
|
-
spec:
|
|
7
|
-
replicas: 1
|
|
8
|
-
selector:
|
|
9
|
-
matchLabels:
|
|
10
|
-
app: {{PROJECT_NAME}}
|
|
11
|
-
template:
|
|
12
|
-
metadata:
|
|
13
|
-
labels:
|
|
14
|
-
app: {{PROJECT_NAME}}
|
|
15
|
-
spec:
|
|
16
|
-
securityContext:
|
|
17
|
-
runAsUser: 1001
|
|
18
|
-
runAsGroup: 1001
|
|
19
|
-
fsGroup: 1001
|
|
20
|
-
runAsNonRoot: true
|
|
21
|
-
containers:
|
|
22
|
-
- name: {{PROJECT_NAME}}
|
|
23
|
-
image: {{ACR_REGISTRY}}/{{PROJECT_NAME}}:latest
|
|
24
|
-
imagePullPolicy: Always
|
|
25
|
-
ports:
|
|
26
|
-
- containerPort: 3000
|
|
27
|
-
protocol: TCP
|
|
28
|
-
securityContext:
|
|
29
|
-
readOnlyRootFilesystem: true
|
|
30
|
-
allowPrivilegeEscalation: false
|
|
31
|
-
capabilities:
|
|
32
|
-
drop:
|
|
33
|
-
- ALL
|
|
34
|
-
envFrom:
|
|
35
|
-
- configMapRef:
|
|
36
|
-
name: {{PROJECT_NAME}}-configmap
|
|
37
|
-
- secretRef:
|
|
38
|
-
name: {{PROJECT_NAME}}-secrets
|
|
39
|
-
resources:
|
|
40
|
-
requests:
|
|
41
|
-
memory: "512Mi"
|
|
42
|
-
cpu: "200m"
|
|
43
|
-
limits:
|
|
44
|
-
memory: "1Gi"
|
|
45
|
-
cpu: "1000m"
|
|
46
|
-
livenessProbe:
|
|
47
|
-
httpGet:
|
|
48
|
-
path: /
|
|
49
|
-
port: 3000
|
|
50
|
-
initialDelaySeconds: 30
|
|
51
|
-
periodSeconds: 10
|
|
52
|
-
timeoutSeconds: 5
|
|
53
|
-
failureThreshold: 3
|
|
54
|
-
readinessProbe:
|
|
55
|
-
httpGet:
|
|
56
|
-
path: /
|
|
57
|
-
port: 3000
|
|
58
|
-
initialDelaySeconds: 10
|
|
59
|
-
periodSeconds: 5
|
|
60
|
-
timeoutSeconds: 3
|
|
61
|
-
failureThreshold: 3
|
|
62
|
-
volumeMounts:
|
|
63
|
-
- name: tmp
|
|
64
|
-
mountPath: /tmp
|
|
65
|
-
- name: nextjs-cache
|
|
66
|
-
mountPath: /app/.next/cache
|
|
67
|
-
command: ["node", "server.js"]
|
|
68
|
-
volumes:
|
|
69
|
-
- name: tmp
|
|
70
|
-
emptyDir: {}
|
|
71
|
-
- name: nextjs-cache
|
|
72
|
-
emptyDir: {}
|
|
1
|
+
apiVersion: apps/v1
|
|
2
|
+
kind: Deployment
|
|
3
|
+
metadata:
|
|
4
|
+
name: {{PROJECT_NAME}}-deployment
|
|
5
|
+
namespace: {{NAMESPACE}}
|
|
6
|
+
spec:
|
|
7
|
+
replicas: 1
|
|
8
|
+
selector:
|
|
9
|
+
matchLabels:
|
|
10
|
+
app: {{PROJECT_NAME}}
|
|
11
|
+
template:
|
|
12
|
+
metadata:
|
|
13
|
+
labels:
|
|
14
|
+
app: {{PROJECT_NAME}}
|
|
15
|
+
spec:
|
|
16
|
+
securityContext:
|
|
17
|
+
runAsUser: 1001
|
|
18
|
+
runAsGroup: 1001
|
|
19
|
+
fsGroup: 1001
|
|
20
|
+
runAsNonRoot: true
|
|
21
|
+
containers:
|
|
22
|
+
- name: {{PROJECT_NAME}}
|
|
23
|
+
image: {{ACR_REGISTRY}}/{{PROJECT_NAME}}:latest
|
|
24
|
+
imagePullPolicy: Always
|
|
25
|
+
ports:
|
|
26
|
+
- containerPort: 3000
|
|
27
|
+
protocol: TCP
|
|
28
|
+
securityContext:
|
|
29
|
+
readOnlyRootFilesystem: true
|
|
30
|
+
allowPrivilegeEscalation: false
|
|
31
|
+
capabilities:
|
|
32
|
+
drop:
|
|
33
|
+
- ALL
|
|
34
|
+
envFrom:
|
|
35
|
+
- configMapRef:
|
|
36
|
+
name: {{PROJECT_NAME}}-configmap
|
|
37
|
+
- secretRef:
|
|
38
|
+
name: {{PROJECT_NAME}}-secrets
|
|
39
|
+
resources:
|
|
40
|
+
requests:
|
|
41
|
+
memory: "512Mi"
|
|
42
|
+
cpu: "200m"
|
|
43
|
+
limits:
|
|
44
|
+
memory: "1Gi"
|
|
45
|
+
cpu: "1000m"
|
|
46
|
+
livenessProbe:
|
|
47
|
+
httpGet:
|
|
48
|
+
path: /
|
|
49
|
+
port: 3000
|
|
50
|
+
initialDelaySeconds: 30
|
|
51
|
+
periodSeconds: 10
|
|
52
|
+
timeoutSeconds: 5
|
|
53
|
+
failureThreshold: 3
|
|
54
|
+
readinessProbe:
|
|
55
|
+
httpGet:
|
|
56
|
+
path: /
|
|
57
|
+
port: 3000
|
|
58
|
+
initialDelaySeconds: 10
|
|
59
|
+
periodSeconds: 5
|
|
60
|
+
timeoutSeconds: 3
|
|
61
|
+
failureThreshold: 3
|
|
62
|
+
volumeMounts:
|
|
63
|
+
- name: tmp
|
|
64
|
+
mountPath: /tmp
|
|
65
|
+
- name: nextjs-cache
|
|
66
|
+
mountPath: /app/.next/cache
|
|
67
|
+
command: ["node", "server.js"]
|
|
68
|
+
volumes:
|
|
69
|
+
- name: tmp
|
|
70
|
+
emptyDir: {}
|
|
71
|
+
- name: nextjs-cache
|
|
72
|
+
emptyDir: {}
|
|
@@ -1,36 +1,36 @@
|
|
|
1
|
-
apiVersion: networking.k8s.io/v1
|
|
2
|
-
kind: Ingress
|
|
3
|
-
metadata:
|
|
4
|
-
name: {{PROJECT_NAME}}-ingress
|
|
5
|
-
namespace: {{NAMESPACE}}
|
|
6
|
-
annotations:
|
|
7
|
-
nginx.ingress.kubernetes.io/cors-allow-methods: 'PUT, GET, POST, DELETE, PATCH, OPTIONS'
|
|
8
|
-
nginx.ingress.kubernetes.io/cors-allow-origin: 'https://{{DOMAIN}}'
|
|
9
|
-
nginx.ingress.kubernetes.io/cors-allow-headers: 'DNT,Keep-Alive,User-Agent,X-Requested-With,If-Modified-Since,Cache-Control,Content-Type,Range,Authorization,Cookie'
|
|
10
|
-
nginx.ingress.kubernetes.io/cors-allow-credentials: 'true'
|
|
11
|
-
nginx.ingress.kubernetes.io/enable-cors: 'true'
|
|
12
|
-
nginx.ingress.kubernetes.io/proxy-body-size: '50m'
|
|
13
|
-
nginx.ingress.kubernetes.io/proxy-connect-timeout: '300'
|
|
14
|
-
nginx.ingress.kubernetes.io/proxy-read-timeout: '300'
|
|
15
|
-
nginx.ingress.kubernetes.io/proxy-send-timeout: '300'
|
|
16
|
-
nginx.ingress.kubernetes.io/ssl-redirect: 'true'
|
|
17
|
-
# SSE Streaming support
|
|
18
|
-
nginx.ingress.kubernetes.io/proxy-buffering: 'off'
|
|
19
|
-
nginx.ingress.kubernetes.io/proxy-request-buffering: 'off'
|
|
20
|
-
spec:
|
|
21
|
-
ingressClassName: nginx
|
|
22
|
-
tls:
|
|
23
|
-
- hosts:
|
|
24
|
-
- {{DOMAIN}}
|
|
25
|
-
secretName: {{PROJECT_NAME}}-tls
|
|
26
|
-
rules:
|
|
27
|
-
- host: {{DOMAIN}}
|
|
28
|
-
http:
|
|
29
|
-
paths:
|
|
30
|
-
- path: /
|
|
31
|
-
pathType: Prefix
|
|
32
|
-
backend:
|
|
33
|
-
service:
|
|
34
|
-
name: {{PROJECT_NAME}}-service
|
|
35
|
-
port:
|
|
36
|
-
number: 3000
|
|
1
|
+
apiVersion: networking.k8s.io/v1
|
|
2
|
+
kind: Ingress
|
|
3
|
+
metadata:
|
|
4
|
+
name: {{PROJECT_NAME}}-ingress
|
|
5
|
+
namespace: {{NAMESPACE}}
|
|
6
|
+
annotations:
|
|
7
|
+
nginx.ingress.kubernetes.io/cors-allow-methods: 'PUT, GET, POST, DELETE, PATCH, OPTIONS'
|
|
8
|
+
nginx.ingress.kubernetes.io/cors-allow-origin: 'https://{{DOMAIN}}'
|
|
9
|
+
nginx.ingress.kubernetes.io/cors-allow-headers: 'DNT,Keep-Alive,User-Agent,X-Requested-With,If-Modified-Since,Cache-Control,Content-Type,Range,Authorization,Cookie'
|
|
10
|
+
nginx.ingress.kubernetes.io/cors-allow-credentials: 'true'
|
|
11
|
+
nginx.ingress.kubernetes.io/enable-cors: 'true'
|
|
12
|
+
nginx.ingress.kubernetes.io/proxy-body-size: '50m'
|
|
13
|
+
nginx.ingress.kubernetes.io/proxy-connect-timeout: '300'
|
|
14
|
+
nginx.ingress.kubernetes.io/proxy-read-timeout: '300'
|
|
15
|
+
nginx.ingress.kubernetes.io/proxy-send-timeout: '300'
|
|
16
|
+
nginx.ingress.kubernetes.io/ssl-redirect: 'true'
|
|
17
|
+
# SSE Streaming support
|
|
18
|
+
nginx.ingress.kubernetes.io/proxy-buffering: 'off'
|
|
19
|
+
nginx.ingress.kubernetes.io/proxy-request-buffering: 'off'
|
|
20
|
+
spec:
|
|
21
|
+
ingressClassName: nginx
|
|
22
|
+
tls:
|
|
23
|
+
- hosts:
|
|
24
|
+
- {{DOMAIN}}
|
|
25
|
+
secretName: {{PROJECT_NAME}}-tls
|
|
26
|
+
rules:
|
|
27
|
+
- host: {{DOMAIN}}
|
|
28
|
+
http:
|
|
29
|
+
paths:
|
|
30
|
+
- path: /
|
|
31
|
+
pathType: Prefix
|
|
32
|
+
backend:
|
|
33
|
+
service:
|
|
34
|
+
name: {{PROJECT_NAME}}-service
|
|
35
|
+
port:
|
|
36
|
+
number: 3000
|
|
@@ -1,14 +1,14 @@
|
|
|
1
|
-
apiVersion: v1
|
|
2
|
-
kind: Service
|
|
3
|
-
metadata:
|
|
4
|
-
name: {{PROJECT_NAME}}-service
|
|
5
|
-
namespace: {{NAMESPACE}}
|
|
6
|
-
spec:
|
|
7
|
-
ports:
|
|
8
|
-
- name: nextjs
|
|
9
|
-
protocol: TCP
|
|
10
|
-
port: 3000
|
|
11
|
-
targetPort: 3000
|
|
12
|
-
selector:
|
|
13
|
-
app: {{PROJECT_NAME}}
|
|
14
|
-
type: ClusterIP
|
|
1
|
+
apiVersion: v1
|
|
2
|
+
kind: Service
|
|
3
|
+
metadata:
|
|
4
|
+
name: {{PROJECT_NAME}}-service
|
|
5
|
+
namespace: {{NAMESPACE}}
|
|
6
|
+
spec:
|
|
7
|
+
ports:
|
|
8
|
+
- name: nextjs
|
|
9
|
+
protocol: TCP
|
|
10
|
+
port: 3000
|
|
11
|
+
targetPort: 3000
|
|
12
|
+
selector:
|
|
13
|
+
app: {{PROJECT_NAME}}
|
|
14
|
+
type: ClusterIP
|
|
@@ -1,37 +1,37 @@
|
|
|
1
|
-
import {
|
|
2
|
-
type AllGeneratedEndpointsWithEntityTypes,
|
|
3
|
-
type EndpointDefinition,
|
|
4
|
-
generateAllEndpoints,
|
|
5
|
-
type InferEntity,
|
|
6
|
-
} from 'nucleus-core-ts/client'
|
|
7
|
-
import { config } from './config'
|
|
8
|
-
|
|
9
|
-
type Entities = typeof config.entities
|
|
10
|
-
|
|
11
|
-
export type Entity<TName extends string> = InferEntity<Entities, TName>
|
|
12
|
-
|
|
13
|
-
const extraEndpoints = {
|
|
14
|
-
// Never add endpoint from nucleus core, this endpoints must be 3rd party urls for expanding usage of generic api calls
|
|
15
|
-
GET_WEATHER: {
|
|
16
|
-
method: 'GET' as const,
|
|
17
|
-
path: 'https://api.openweathermap.org/data/2.5/weather',
|
|
18
|
-
isPublic: true,
|
|
19
|
-
_payload: undefined as { city: string; units?: string } | undefined,
|
|
20
|
-
_success: undefined as
|
|
21
|
-
| { main: { temp: number }; weather: { description: string }[] }
|
|
22
|
-
| undefined,
|
|
23
|
-
_error: undefined as { message: string } | undefined,
|
|
24
|
-
},
|
|
25
|
-
} satisfies Record<string, EndpointDefinition>
|
|
26
|
-
|
|
27
|
-
type ExtraEndpointsType = typeof extraEndpoints
|
|
28
|
-
|
|
29
|
-
export type AllEndpoints = AllGeneratedEndpointsWithEntityTypes<
|
|
30
|
-
typeof config.entities,
|
|
31
|
-
ExtraEndpointsType
|
|
32
|
-
>
|
|
33
|
-
|
|
34
|
-
export const endpoints = generateAllEndpoints(
|
|
35
|
-
config as unknown as Parameters<typeof generateAllEndpoints>[0],
|
|
36
|
-
extraEndpoints
|
|
37
|
-
) as AllEndpoints
|
|
1
|
+
import {
|
|
2
|
+
type AllGeneratedEndpointsWithEntityTypes,
|
|
3
|
+
type EndpointDefinition,
|
|
4
|
+
generateAllEndpoints,
|
|
5
|
+
type InferEntity,
|
|
6
|
+
} from 'nucleus-core-ts/client'
|
|
7
|
+
import { config } from './config'
|
|
8
|
+
|
|
9
|
+
type Entities = typeof config.entities
|
|
10
|
+
|
|
11
|
+
export type Entity<TName extends string> = InferEntity<Entities, TName>
|
|
12
|
+
|
|
13
|
+
const extraEndpoints = {
|
|
14
|
+
// Never add endpoint from nucleus core, this endpoints must be 3rd party urls for expanding usage of generic api calls
|
|
15
|
+
GET_WEATHER: {
|
|
16
|
+
method: 'GET' as const,
|
|
17
|
+
path: 'https://api.openweathermap.org/data/2.5/weather',
|
|
18
|
+
isPublic: true,
|
|
19
|
+
_payload: undefined as { city: string; units?: string } | undefined,
|
|
20
|
+
_success: undefined as
|
|
21
|
+
| { main: { temp: number }; weather: { description: string }[] }
|
|
22
|
+
| undefined,
|
|
23
|
+
_error: undefined as { message: string } | undefined,
|
|
24
|
+
},
|
|
25
|
+
} satisfies Record<string, EndpointDefinition>
|
|
26
|
+
|
|
27
|
+
type ExtraEndpointsType = typeof extraEndpoints
|
|
28
|
+
|
|
29
|
+
export type AllEndpoints = AllGeneratedEndpointsWithEntityTypes<
|
|
30
|
+
typeof config.entities,
|
|
31
|
+
ExtraEndpointsType
|
|
32
|
+
>
|
|
33
|
+
|
|
34
|
+
export const endpoints = generateAllEndpoints(
|
|
35
|
+
config as unknown as Parameters<typeof generateAllEndpoints>[0],
|
|
36
|
+
extraEndpoints
|
|
37
|
+
) as AllEndpoints
|
|
@@ -1,44 +1,44 @@
|
|
|
1
|
-
'use server'
|
|
2
|
-
|
|
3
|
-
import { cookies, headers } from 'next/headers'
|
|
4
|
-
import { type CookieStore, createServerFactory, type HeadersStore } from 'nucleus-core-ts/client'
|
|
5
|
-
import { type AllEndpoints, endpoints } from './endpoints'
|
|
6
|
-
|
|
7
|
-
async function getCookieStore(): Promise<CookieStore> {
|
|
8
|
-
const cookieStore = await cookies()
|
|
9
|
-
return {
|
|
10
|
-
get: (name) => cookieStore.get(name),
|
|
11
|
-
set: (name, value, options) => cookieStore.set(name, value, options as never),
|
|
12
|
-
delete: (name) => cookieStore.delete(name),
|
|
13
|
-
}
|
|
14
|
-
}
|
|
15
|
-
|
|
16
|
-
async function getHeadersStore(): Promise<HeadersStore> {
|
|
17
|
-
const headersList = await headers()
|
|
18
|
-
|
|
19
|
-
// Debug: log all headers
|
|
20
|
-
const allHeaders: Record<string, string> = {}
|
|
21
|
-
headersList.forEach((value, key) => {
|
|
22
|
-
allHeaders[key] = value
|
|
23
|
-
})
|
|
24
|
-
|
|
25
|
-
return {
|
|
26
|
-
get: (name) => headersList.get(name),
|
|
27
|
-
forEach: (cb) => headersList.forEach(cb),
|
|
28
|
-
}
|
|
29
|
-
}
|
|
30
|
-
|
|
31
|
-
export const apiFactory = createServerFactory<AllEndpoints>(
|
|
32
|
-
endpoints,
|
|
33
|
-
{
|
|
34
|
-
baseUrl: process.env.API_BASE_URL || 'http://localhost:3001',
|
|
35
|
-
tokenNames: {
|
|
36
|
-
accessToken: 'access_token',
|
|
37
|
-
refreshToken: 'refresh_token',
|
|
38
|
-
sessionToken: 'session_token',
|
|
39
|
-
},
|
|
40
|
-
debug: true,
|
|
41
|
-
},
|
|
42
|
-
getCookieStore,
|
|
43
|
-
getHeadersStore
|
|
44
|
-
)
|
|
1
|
+
'use server'
|
|
2
|
+
|
|
3
|
+
import { cookies, headers } from 'next/headers'
|
|
4
|
+
import { type CookieStore, createServerFactory, type HeadersStore } from 'nucleus-core-ts/client'
|
|
5
|
+
import { type AllEndpoints, endpoints } from './endpoints'
|
|
6
|
+
|
|
7
|
+
async function getCookieStore(): Promise<CookieStore> {
|
|
8
|
+
const cookieStore = await cookies()
|
|
9
|
+
return {
|
|
10
|
+
get: (name) => cookieStore.get(name),
|
|
11
|
+
set: (name, value, options) => cookieStore.set(name, value, options as never),
|
|
12
|
+
delete: (name) => cookieStore.delete(name),
|
|
13
|
+
}
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
async function getHeadersStore(): Promise<HeadersStore> {
|
|
17
|
+
const headersList = await headers()
|
|
18
|
+
|
|
19
|
+
// Debug: log all headers
|
|
20
|
+
const allHeaders: Record<string, string> = {}
|
|
21
|
+
headersList.forEach((value, key) => {
|
|
22
|
+
allHeaders[key] = value
|
|
23
|
+
})
|
|
24
|
+
|
|
25
|
+
return {
|
|
26
|
+
get: (name) => headersList.get(name),
|
|
27
|
+
forEach: (cb) => headersList.forEach(cb),
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
export const apiFactory = createServerFactory<AllEndpoints>(
|
|
32
|
+
endpoints,
|
|
33
|
+
{
|
|
34
|
+
baseUrl: process.env.API_BASE_URL || 'http://localhost:3001',
|
|
35
|
+
tokenNames: {
|
|
36
|
+
accessToken: 'access_token',
|
|
37
|
+
refreshToken: 'refresh_token',
|
|
38
|
+
sessionToken: 'session_token',
|
|
39
|
+
},
|
|
40
|
+
debug: true,
|
|
41
|
+
},
|
|
42
|
+
getCookieStore,
|
|
43
|
+
getHeadersStore
|
|
44
|
+
)
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
'use client'
|
|
2
|
-
|
|
3
|
-
import { createApiHook, type EndpointActions } from 'nucleus-core-ts/client'
|
|
4
|
-
import { type AllEndpoints, endpoints } from './endpoints'
|
|
5
|
-
import { apiFactory } from './factory'
|
|
6
|
-
|
|
7
|
-
export const useApiActions: () => EndpointActions<AllEndpoints> = createApiHook<AllEndpoints>(
|
|
8
|
-
endpoints,
|
|
9
|
-
apiFactory
|
|
10
|
-
)
|
|
1
|
+
'use client'
|
|
2
|
+
|
|
3
|
+
import { createApiHook, type EndpointActions } from 'nucleus-core-ts/client'
|
|
4
|
+
import { type AllEndpoints, endpoints } from './endpoints'
|
|
5
|
+
import { apiFactory } from './factory'
|
|
6
|
+
|
|
7
|
+
export const useApiActions: () => EndpointActions<AllEndpoints> = createApiHook<AllEndpoints>(
|
|
8
|
+
endpoints,
|
|
9
|
+
apiFactory
|
|
10
|
+
)
|
|
@@ -1,19 +1,19 @@
|
|
|
1
|
-
import type { NextConfig } from 'next'
|
|
2
|
-
|
|
3
|
-
const nextConfig: NextConfig = {
|
|
4
|
-
output: 'standalone',
|
|
5
|
-
logging: {
|
|
6
|
-
browserToTerminal: true,
|
|
7
|
-
},
|
|
8
|
-
async rewrites() {
|
|
9
|
-
const apiUrl = process.env.API_BASE_URL || 'http://localhost:9000'
|
|
10
|
-
return [
|
|
11
|
-
{
|
|
12
|
-
source: '/cdn/:path*',
|
|
13
|
-
destination: `${apiUrl}/cdn/:path*`,
|
|
14
|
-
},
|
|
15
|
-
]
|
|
16
|
-
},
|
|
17
|
-
}
|
|
18
|
-
|
|
19
|
-
export default nextConfig
|
|
1
|
+
import type { NextConfig } from 'next'
|
|
2
|
+
|
|
3
|
+
const nextConfig: NextConfig = {
|
|
4
|
+
output: 'standalone',
|
|
5
|
+
logging: {
|
|
6
|
+
browserToTerminal: true,
|
|
7
|
+
},
|
|
8
|
+
async rewrites() {
|
|
9
|
+
const apiUrl = process.env.API_BASE_URL || 'http://localhost:9000'
|
|
10
|
+
return [
|
|
11
|
+
{
|
|
12
|
+
source: '/cdn/:path*',
|
|
13
|
+
destination: `${apiUrl}/cdn/:path*`,
|
|
14
|
+
},
|
|
15
|
+
]
|
|
16
|
+
},
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
export default nextConfig
|