@plitzi/sdk-shared 0.38.20 → 0.38.22
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/CHANGELOG.md +133 -0
- package/dist/actions/access.d.ts +5 -0
- package/dist/actions/access.mjs +11 -2
- package/dist/actions/index.d.ts +2 -1
- package/dist/actions/index.mjs +10 -9
- package/dist/actions/jobs.d.ts +10 -0
- package/dist/actions/jobs.mjs +17 -0
- package/dist/actions/validateDocument.mjs +56 -56
- package/dist/dataSource/globalSources.d.ts +1 -1
- package/dist/navigation/routes.mjs +38 -37
- package/dist/network/graphql/builder/Mutations/Space/jobs/SpaceControlJobMutation.d.ts +5 -0
- package/dist/network/graphql/builder/Mutations/Space/jobs/SpaceControlJobMutation.mjs +4 -0
- package/dist/network/graphql/builder/Mutations/index.d.ts +2 -0
- package/dist/network/graphql/builder/Mutations/index.mjs +70 -68
- package/dist/network/graphql/builder/Queries/Space/SpaceDeploymentsQuery.d.ts +1 -1
- package/dist/network/graphql/builder/Queries/Space/SpaceDeploymentsQuery.mjs +1 -1
- package/dist/network/graphql/builder/Queries/Space/SpaceJobsQuery.d.ts +10 -0
- package/dist/network/graphql/builder/Queries/Space/SpaceJobsQuery.mjs +4 -0
- package/dist/network/graphql/builder/Queries/index.d.ts +2 -0
- package/dist/network/graphql/builder/Queries/index.mjs +16 -14
- package/dist/realtime/index.d.ts +1 -1
- package/dist/realtime/index.mjs +4 -4
- package/dist/realtime/topics.d.ts +5 -0
- package/dist/realtime/topics.mjs +11 -11
- package/dist/schema/index.d.ts +1 -0
- package/dist/schema/index.mjs +12 -11
- package/dist/schema/pageAccess.d.ts +41 -0
- package/dist/schema/pageAccess.mjs +54 -0
- package/dist/store/storeHooks.d.ts +33 -33
- package/dist/types/ActionTypes.d.ts +0 -204
- package/dist/types/FunctionTypes.d.ts +41 -0
- package/dist/types/JobTypes.d.ts +327 -0
- package/dist/types/JobTypes.mjs +0 -0
- package/dist/types/ServerTypes.d.ts +17 -3
- package/dist/types/SpaceTypes.d.ts +5 -0
- package/dist/types/index.d.ts +1 -0
- package/package.json +1 -1
- package/vite.config.ts +9 -7
- package/dist/helpers/twigWrapper/bench.bench.d.ts +0 -1
|
@@ -47,53 +47,54 @@ import G from "./Space/functions/SpaceInstallTemplateFunctionsMutation.mjs";
|
|
|
47
47
|
import K from "./Space/functions/SpaceRemoveFunctionsMutation.mjs";
|
|
48
48
|
import q from "./Space/functions/SpaceSaveFunctionsMutation.mjs";
|
|
49
49
|
import J from "./Space/functions/SpaceTryFunctionMutation.mjs";
|
|
50
|
-
import Y from "./Space/
|
|
51
|
-
import X from "./Space/pages/
|
|
52
|
-
import Z from "./Space/pages/
|
|
53
|
-
import Q from "./Space/pages/
|
|
54
|
-
import $ from "./Space/
|
|
55
|
-
import ee from "./Space/resources/
|
|
56
|
-
import te from "./Space/resources/
|
|
57
|
-
import ne from "./Space/
|
|
58
|
-
import re from "./Space/runtime/
|
|
59
|
-
import ie from "./Space/runtime/
|
|
60
|
-
import ae from "./Space/runtime/
|
|
61
|
-
import oe from "./Space/runtime/
|
|
62
|
-
import se from "./Space/runtime/
|
|
63
|
-
import ce from "./Space/
|
|
64
|
-
import le from "./Space/variables/
|
|
65
|
-
import ue from "./Space/variables/
|
|
66
|
-
import de from "./Space/
|
|
67
|
-
import fe from "./Space/visitors/
|
|
68
|
-
import pe from "./
|
|
69
|
-
import me from "./Style/
|
|
70
|
-
import he from "./Style/
|
|
71
|
-
import ge from "./Style/fonts/
|
|
72
|
-
import _e from "./Style/fonts/
|
|
73
|
-
import ve from "./Style/
|
|
74
|
-
import ye from "./Style/selectorVariables/
|
|
75
|
-
import be from "./Style/selectorVariables/
|
|
76
|
-
import xe from "./Style/
|
|
77
|
-
import Se from "./Style/selectors/
|
|
78
|
-
import Ce from "./Style/selectors/
|
|
79
|
-
import we from "./Style/selectors/
|
|
80
|
-
import Te from "./Style/
|
|
81
|
-
import Ee from "./Style/variables/
|
|
82
|
-
import De from "./Style/variables/
|
|
50
|
+
import Y from "./Space/jobs/SpaceControlJobMutation.mjs";
|
|
51
|
+
import X from "./Space/pages/SpaceAddPageMutation.mjs";
|
|
52
|
+
import Z from "./Space/pages/SpaceHomePageMutation.mjs";
|
|
53
|
+
import Q from "./Space/pages/SpaceRemovePageMutation.mjs";
|
|
54
|
+
import $ from "./Space/pages/SpaceUpdatePageMutation.mjs";
|
|
55
|
+
import ee from "./Space/resources/SpaceAddResourceMutation.mjs";
|
|
56
|
+
import te from "./Space/resources/SpaceMoveResourceMutation.mjs";
|
|
57
|
+
import ne from "./Space/resources/SpaceRemoveResourceMutation.mjs";
|
|
58
|
+
import re from "./Space/runtime/SpaceRemoveRuntimeMutation.mjs";
|
|
59
|
+
import ie from "./Space/runtime/SpaceRemoveRuntimeVariableMutation.mjs";
|
|
60
|
+
import ae from "./Space/runtime/SpaceSetRuntimeSizeMutation.mjs";
|
|
61
|
+
import oe from "./Space/runtime/SpaceSetRuntimeVariableMutation.mjs";
|
|
62
|
+
import se from "./Space/runtime/SpaceStartRuntimeMutation.mjs";
|
|
63
|
+
import ce from "./Space/runtime/SpaceStopRuntimeMutation.mjs";
|
|
64
|
+
import le from "./Space/variables/SpaceAddVariableMutation.mjs";
|
|
65
|
+
import ue from "./Space/variables/SpaceRemoveVariableMutation.mjs";
|
|
66
|
+
import de from "./Space/variables/SpaceUpdateVariableMutation.mjs";
|
|
67
|
+
import fe from "./Space/visitors/SpaceAddVisitorMutation.mjs";
|
|
68
|
+
import pe from "./Space/visitors/SpaceRemoveVisitorMutation.mjs";
|
|
69
|
+
import me from "./Style/StyleUpdateMutation.mjs";
|
|
70
|
+
import he from "./Style/StyleUpdateSettingsMutation.mjs";
|
|
71
|
+
import ge from "./Style/fonts/StyleAddFontMutation.mjs";
|
|
72
|
+
import _e from "./Style/fonts/StyleRemoveFontMutation.mjs";
|
|
73
|
+
import ve from "./Style/fonts/StyleUpdateFontMutation.mjs";
|
|
74
|
+
import ye from "./Style/selectorVariables/StyleAddSelectorVariableMutation.mjs";
|
|
75
|
+
import be from "./Style/selectorVariables/StyleRemoveSelectorVariableMutation.mjs";
|
|
76
|
+
import xe from "./Style/selectorVariables/StyleUpdateSelectorVariableMutation.mjs";
|
|
77
|
+
import Se from "./Style/selectors/StyleAddSelectorMutation.mjs";
|
|
78
|
+
import Ce from "./Style/selectors/StyleRemoveSelectorMutation.mjs";
|
|
79
|
+
import we from "./Style/selectors/StyleRemoveSelectorsMutation.mjs";
|
|
80
|
+
import Te from "./Style/selectors/StyleUpdateSelectorMutation.mjs";
|
|
81
|
+
import Ee from "./Style/variables/StyleAddVariableMutation.mjs";
|
|
82
|
+
import De from "./Style/variables/StyleRemoveVariableMutation.mjs";
|
|
83
|
+
import Oe from "./Style/variables/StyleUpdateVariableMutation.mjs";
|
|
83
84
|
//#region src/network/graphql/builder/Mutations/index.ts
|
|
84
|
-
var
|
|
85
|
+
var ke = {
|
|
85
86
|
SpaceUpdate: p,
|
|
86
87
|
SpaceUpdateSchema: h,
|
|
87
|
-
SpaceAddPage:
|
|
88
|
-
SpaceHomePage:
|
|
89
|
-
SpaceUpdatePage:
|
|
90
|
-
SpaceRemovePage:
|
|
88
|
+
SpaceAddPage: X,
|
|
89
|
+
SpaceHomePage: Z,
|
|
90
|
+
SpaceUpdatePage: $,
|
|
91
|
+
SpaceRemovePage: Q,
|
|
91
92
|
SpaceAddPageFolder: H,
|
|
92
93
|
SpaceUpdatePageFolder: W,
|
|
93
94
|
SpaceRemovePageFolder: U,
|
|
94
|
-
SpaceAddVariable:
|
|
95
|
-
SpaceUpdateVariable:
|
|
96
|
-
SpaceRemoveVariable:
|
|
95
|
+
SpaceAddVariable: le,
|
|
96
|
+
SpaceUpdateVariable: de,
|
|
97
|
+
SpaceRemoveVariable: ue,
|
|
97
98
|
SpaceSetFlag: V,
|
|
98
99
|
SpaceRemoveFlag: B,
|
|
99
100
|
SpaceAddElement: e,
|
|
@@ -111,9 +112,9 @@ var Oe = {
|
|
|
111
112
|
SpaceAddPlugin: t,
|
|
112
113
|
SpaceUpdatePlugin: m,
|
|
113
114
|
SpaceRemovePlugin: l,
|
|
114
|
-
SpaceAddResource:
|
|
115
|
-
SpaceMoveResource:
|
|
116
|
-
SpaceRemoveResource:
|
|
115
|
+
SpaceAddResource: ee,
|
|
116
|
+
SpaceMoveResource: te,
|
|
117
|
+
SpaceRemoveResource: ne,
|
|
117
118
|
SpaceAddCdn: S,
|
|
118
119
|
SpaceUpdateCdn: D,
|
|
119
120
|
SpaceSetCdnCredential: T,
|
|
@@ -130,40 +131,41 @@ var Oe = {
|
|
|
130
131
|
SpaceRemoveFunctions: K,
|
|
131
132
|
SpaceInstallTemplateFunctions: G,
|
|
132
133
|
SpaceTryFunction: J,
|
|
134
|
+
SpaceControlJob: Y,
|
|
133
135
|
SpaceAddConnector: M,
|
|
134
136
|
SpaceUpdateConnector: P,
|
|
135
137
|
SpaceRemoveConnector: N,
|
|
136
138
|
SpaceAddCredential: F,
|
|
137
139
|
SpaceUpdateCredential: L,
|
|
138
140
|
SpaceRemoveCredential: I,
|
|
139
|
-
SpaceAddVisitor:
|
|
140
|
-
SpaceRemoveVisitor:
|
|
141
|
-
SpaceSetRuntimeVariable:
|
|
142
|
-
SpaceSetRuntimeSize:
|
|
143
|
-
SpaceStartRuntime:
|
|
144
|
-
SpaceStopRuntime:
|
|
145
|
-
SpaceRemoveRuntimeVariable:
|
|
146
|
-
SpaceRemoveRuntime:
|
|
141
|
+
SpaceAddVisitor: fe,
|
|
142
|
+
SpaceRemoveVisitor: pe,
|
|
143
|
+
SpaceSetRuntimeVariable: oe,
|
|
144
|
+
SpaceSetRuntimeSize: ae,
|
|
145
|
+
SpaceStartRuntime: se,
|
|
146
|
+
SpaceStopRuntime: ce,
|
|
147
|
+
SpaceRemoveRuntimeVariable: ie,
|
|
148
|
+
SpaceRemoveRuntime: re,
|
|
147
149
|
SpacePublish: s,
|
|
148
150
|
SpacePublishFlags: z,
|
|
149
151
|
SpaceFixIssues: a,
|
|
150
152
|
SpaceDeploy: i,
|
|
151
153
|
SpaceUpdateSettings: g,
|
|
152
|
-
StyleAddSelector:
|
|
153
|
-
StyleUpdateSelector:
|
|
154
|
-
StyleRemoveSelector:
|
|
155
|
-
StyleRemoveSelectors:
|
|
156
|
-
StyleAddSelectorVariable:
|
|
157
|
-
StyleUpdateSelectorVariable:
|
|
158
|
-
StyleRemoveSelectorVariable:
|
|
159
|
-
StyleAddFont:
|
|
160
|
-
StyleUpdateFont:
|
|
161
|
-
StyleRemoveFont:
|
|
162
|
-
StyleAddVariable:
|
|
163
|
-
StyleUpdateVariable:
|
|
164
|
-
StyleRemoveVariable:
|
|
165
|
-
StyleUpdate:
|
|
166
|
-
StyleUpdateSettings:
|
|
154
|
+
StyleAddSelector: Se,
|
|
155
|
+
StyleUpdateSelector: Te,
|
|
156
|
+
StyleRemoveSelector: Ce,
|
|
157
|
+
StyleRemoveSelectors: we,
|
|
158
|
+
StyleAddSelectorVariable: ye,
|
|
159
|
+
StyleUpdateSelectorVariable: xe,
|
|
160
|
+
StyleRemoveSelectorVariable: be,
|
|
161
|
+
StyleAddFont: ge,
|
|
162
|
+
StyleUpdateFont: ve,
|
|
163
|
+
StyleRemoveFont: _e,
|
|
164
|
+
StyleAddVariable: Ee,
|
|
165
|
+
StyleUpdateVariable: Oe,
|
|
166
|
+
StyleRemoveVariable: De,
|
|
167
|
+
StyleUpdate: me,
|
|
168
|
+
StyleUpdateSettings: he
|
|
167
169
|
};
|
|
168
170
|
//#endregion
|
|
169
|
-
export {
|
|
171
|
+
export { ke as default };
|
|
@@ -5,5 +5,5 @@ export type TSpaceDeploymentsQuery = {
|
|
|
5
5
|
pageInfo: PageInfo;
|
|
6
6
|
};
|
|
7
7
|
};
|
|
8
|
-
declare const SpaceDeploymentsQuery = "\n query SpaceDeploymentsQuery($filter: DeploymentInput, $page: Int, $pageSize: Int, $offset: Int) {\n SpaceDeployments(filter: $filter, page: $page, pageSize: $pageSize, offset: $offset) {\n edges {\n id\n environment\n revision\n domain\n isVerified\n default\n credential {\n identifier\n provider\n }\n createdAt\n updatedAt\n }\n pageInfo {\n hasPrevPage\n hasNextPage\n from\n to\n total\n }\n }\n }\n";
|
|
8
|
+
declare const SpaceDeploymentsQuery = "\n query SpaceDeploymentsQuery($filter: DeploymentInput, $page: Int, $pageSize: Int, $offset: Int) {\n SpaceDeployments(filter: $filter, page: $page, pageSize: $pageSize, offset: $offset) {\n edges {\n id\n environment\n revision\n domain\n isVerified\n default\n provider\n credential {\n identifier\n provider\n }\n createdAt\n updatedAt\n }\n pageInfo {\n hasPrevPage\n hasNextPage\n from\n to\n total\n }\n }\n }\n";
|
|
9
9
|
export default SpaceDeploymentsQuery;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
//#region src/network/graphql/builder/Queries/Space/SpaceDeploymentsQuery.ts
|
|
2
|
-
var e = "\n query SpaceDeploymentsQuery($filter: DeploymentInput, $page: Int, $pageSize: Int, $offset: Int) {\n SpaceDeployments(filter: $filter, page: $page, pageSize: $pageSize, offset: $offset) {\n edges {\n id\n environment\n revision\n domain\n isVerified\n default\n credential {\n identifier\n provider\n }\n createdAt\n updatedAt\n }\n pageInfo {\n hasPrevPage\n hasNextPage\n from\n to\n total\n }\n }\n }\n";
|
|
2
|
+
var e = "\n query SpaceDeploymentsQuery($filter: DeploymentInput, $page: Int, $pageSize: Int, $offset: Int) {\n SpaceDeployments(filter: $filter, page: $page, pageSize: $pageSize, offset: $offset) {\n edges {\n id\n environment\n revision\n domain\n isVerified\n default\n provider\n credential {\n identifier\n provider\n }\n createdAt\n updatedAt\n }\n pageInfo {\n hasPrevPage\n hasNextPage\n from\n to\n total\n }\n }\n }\n";
|
|
3
3
|
//#endregion
|
|
4
4
|
export { e as default };
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { PageInfo, SpaceJob } from '../../../../../types';
|
|
2
|
+
export type TSpaceJobsQuery = {
|
|
3
|
+
SpaceJobs: {
|
|
4
|
+
edges: SpaceJob[];
|
|
5
|
+
pageInfo: PageInfo;
|
|
6
|
+
};
|
|
7
|
+
};
|
|
8
|
+
/** The space's queue, most recently touched first: its actions' queued runs and its functions' jobs. */
|
|
9
|
+
declare const SpaceJobsQuery = "\n query SpaceJobsQuery($kind: String, $name: String, $status: String, $page: Int, $pageSize: Int) {\n SpaceJobs(kind: $kind, name: $name, status: $status, page: $page, pageSize: $pageSize) {\n edges {\n id\n environment\n kind\n name\n trigger\n startedBy\n status\n progress\n step\n error\n attempts\n maxAttempts\n activeMs\n pauseRequested\n cancelRequested\n key\n missed\n dueAt\n createdAt\n updatedAt\n }\n pageInfo {\n hasPrevPage\n hasNextPage\n from\n to\n total\n }\n }\n }\n";
|
|
10
|
+
export default SpaceJobsQuery;
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
//#region src/network/graphql/builder/Queries/Space/SpaceJobsQuery.ts
|
|
2
|
+
var e = "\n query SpaceJobsQuery($kind: String, $name: String, $status: String, $page: Int, $pageSize: Int) {\n SpaceJobs(kind: $kind, name: $name, status: $status, page: $page, pageSize: $pageSize) {\n edges {\n id\n environment\n kind\n name\n trigger\n startedBy\n status\n progress\n step\n error\n attempts\n maxAttempts\n activeMs\n pauseRequested\n cancelRequested\n key\n missed\n dueAt\n createdAt\n updatedAt\n }\n pageInfo {\n hasPrevPage\n hasNextPage\n from\n to\n total\n }\n }\n }\n";
|
|
3
|
+
//#endregion
|
|
4
|
+
export { e as default };
|
|
@@ -11,6 +11,7 @@ import { TSpaceDataQuery } from './Space/SpaceDataQuery';
|
|
|
11
11
|
import { TSpaceDeploymentsQuery } from './Space/SpaceDeploymentsQuery';
|
|
12
12
|
import { TSpaceFunctionsQuery } from './Space/SpaceFunctionsQuery';
|
|
13
13
|
import { TSpaceIssuesQuery } from './Space/SpaceIssuesQuery';
|
|
14
|
+
import { TSpaceJobsQuery } from './Space/SpaceJobsQuery';
|
|
14
15
|
import { TSpaceLatestRevisionQuery } from './Space/SpaceLatestRevisionQuery';
|
|
15
16
|
import { TSpaceQuotaQuery } from './Space/SpaceQuotaQuery';
|
|
16
17
|
import { TSpaceResourcesQuery } from './Space/SpaceResourcesQuery';
|
|
@@ -35,6 +36,7 @@ export type BuilderQueriesMap = {
|
|
|
35
36
|
SpaceActionTasks: TSpaceActionTasksQuery;
|
|
36
37
|
SpaceData: TSpaceDataQuery;
|
|
37
38
|
SpaceFunctions: TSpaceFunctionsQuery;
|
|
39
|
+
SpaceJobs: TSpaceJobsQuery;
|
|
38
40
|
SpaceConnectors: TSpaceConnectorsQuery;
|
|
39
41
|
SpaceCredentials: TSpaceCredentialsQuery;
|
|
40
42
|
SpaceVersionContents: TSpaceVersionContentsQuery;
|
|
@@ -11,20 +11,21 @@ import l from "./Space/SpaceDataQuery.mjs";
|
|
|
11
11
|
import u from "./Space/SpaceDeploymentsQuery.mjs";
|
|
12
12
|
import d from "./Space/SpaceFunctionsQuery.mjs";
|
|
13
13
|
import f from "./Space/SpaceIssuesQuery.mjs";
|
|
14
|
-
import p from "./Space/
|
|
15
|
-
import m from "./Space/
|
|
16
|
-
import h from "./Space/
|
|
17
|
-
import g from "./Space/
|
|
18
|
-
import _ from "./Space/
|
|
19
|
-
import v from "./Space/
|
|
14
|
+
import p from "./Space/SpaceJobsQuery.mjs";
|
|
15
|
+
import m from "./Space/SpaceLatestRevisionQuery.mjs";
|
|
16
|
+
import h from "./Space/SpaceQuotaQuery.mjs";
|
|
17
|
+
import g from "./Space/SpaceResourcesQuery.mjs";
|
|
18
|
+
import _ from "./Space/SpaceRuntimeQuery.mjs";
|
|
19
|
+
import v from "./Space/SpaceVersionContentsQuery.mjs";
|
|
20
|
+
import y from "./Space/SpaceVisitorsQuery.mjs";
|
|
20
21
|
//#region src/network/graphql/builder/Queries/index.ts
|
|
21
|
-
var
|
|
22
|
+
var b = {
|
|
22
23
|
Init: e,
|
|
23
|
-
SpaceLatestRevision:
|
|
24
|
-
SpaceQuota:
|
|
24
|
+
SpaceLatestRevision: m,
|
|
25
|
+
SpaceQuota: h,
|
|
25
26
|
SpaceIssues: f,
|
|
26
27
|
SpaceChanges: a,
|
|
27
|
-
SpaceResources:
|
|
28
|
+
SpaceResources: g,
|
|
28
29
|
SpaceDeployments: u,
|
|
29
30
|
SpaceCdns: i,
|
|
30
31
|
SpaceActions: r,
|
|
@@ -33,11 +34,12 @@ var y = {
|
|
|
33
34
|
SpaceActionTasks: n,
|
|
34
35
|
SpaceData: l,
|
|
35
36
|
SpaceFunctions: d,
|
|
37
|
+
SpaceJobs: p,
|
|
36
38
|
SpaceConnectors: s,
|
|
37
39
|
SpaceCredentials: c,
|
|
38
|
-
SpaceVersionContents:
|
|
39
|
-
SpaceVisitors:
|
|
40
|
-
SpaceRuntime:
|
|
40
|
+
SpaceVersionContents: v,
|
|
41
|
+
SpaceVisitors: y,
|
|
42
|
+
SpaceRuntime: _
|
|
41
43
|
};
|
|
42
44
|
//#endregion
|
|
43
|
-
export {
|
|
45
|
+
export { b as default };
|
package/dist/realtime/index.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
export { createRealtimeClient, realtimeClientFor } from './client';
|
|
2
2
|
export { trackPresence } from './presence';
|
|
3
|
-
export { JOIN_TYPE, LEAVE_TYPE, OBSERVER_COOKIE_NAME, PRESENCE_TYPE, REVOKED_TYPE, channelLimits, channelProblems, isValidTopic, matchChannel } from './topics';
|
|
3
|
+
export { JOIN_TYPE, LEAVE_TYPE, JOB_TYPE, OBSERVER_COOKIE_NAME, PRESENCE_TYPE, REVOKED_TYPE, channelLimits, channelProblems, isValidTopic, jobOfTopic, jobTopic, matchChannel } from './topics';
|
|
4
4
|
export type { RealtimeClient, RealtimeClientOptions, RealtimeStatus } from './client';
|
|
5
5
|
export type { PresenceListeners, PresenceTracker, RealtimeMember } from './presence';
|
|
6
6
|
export type { ChannelMatch } from './topics';
|
package/dist/realtime/index.mjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { createRealtimeClient as
|
|
3
|
-
import { trackPresence as
|
|
4
|
-
export { e as
|
|
1
|
+
import { JOB_TYPE as e, JOIN_TYPE as t, LEAVE_TYPE as n, OBSERVER_COOKIE_NAME as r, PRESENCE_TYPE as i, REVOKED_TYPE as a, channelLimits as o, channelProblems as s, isValidTopic as c, jobOfTopic as l, jobTopic as u, matchChannel as d } from "./topics.mjs";
|
|
2
|
+
import { createRealtimeClient as f, realtimeClientFor as p } from "./client.mjs";
|
|
3
|
+
import { trackPresence as m } from "./presence.mjs";
|
|
4
|
+
export { e as JOB_TYPE, t as JOIN_TYPE, n as LEAVE_TYPE, r as OBSERVER_COOKIE_NAME, i as PRESENCE_TYPE, a as REVOKED_TYPE, o as channelLimits, s as channelProblems, f as createRealtimeClient, c as isValidTopic, l as jobOfTopic, u as jobTopic, d as matchChannel, p as realtimeClientFor, m as trackPresence };
|
|
@@ -1,5 +1,10 @@
|
|
|
1
1
|
import { ChannelDeclaration, ChannelDeclarations } from '../types/RealtimeTypes';
|
|
2
2
|
export declare const isValidTopic: (topic: string) => boolean;
|
|
3
|
+
export declare const jobTopic: (jobId: string) => string;
|
|
4
|
+
/** The job a topic is about, or `undefined` when it is not a job's. */
|
|
5
|
+
export declare const jobOfTopic: (topic: string) => string | undefined;
|
|
6
|
+
/** The type every message on a job's topic carries: the job as it is now (`FunctionJobView`). */
|
|
7
|
+
export declare const JOB_TYPE = "job";
|
|
3
8
|
export type ChannelMatch = {
|
|
4
9
|
pattern: string;
|
|
5
10
|
declaration: ChannelDeclaration;
|
package/dist/realtime/topics.mjs
CHANGED
|
@@ -1,26 +1,26 @@
|
|
|
1
1
|
import { isRecord as e } from "../helpers/isRecord.mjs";
|
|
2
2
|
//#region src/realtime/topics.ts
|
|
3
|
-
var t = /^[A-Za-z0-9:_.-]{1,128}$/, n = "[A-Za-z0-9_.-]{1,64}", r = (e) => t.test(e), i = (e) => RegExp(`^${e.split(/(\{[A-Za-z0-9_]+\})/).map((e) => /^\{[A-Za-z0-9_]+\}$/.test(e) ? n : e.replace(/[.*+?^${}()|[\]\\]/g, "\\$&")).join("")}$`),
|
|
3
|
+
var t = /^[A-Za-z0-9:_.-]{1,128}$/, n = "[A-Za-z0-9_.-]{1,64}", r = (e) => t.test(e), i = /^\$job:([A-Za-z0-9:_.-]{1,128})$/, a = (e) => `$job:${e}`, o = (e) => i.exec(e)?.[1], s = "job", c = (e) => RegExp(`^${e.split(/(\{[A-Za-z0-9_]+\})/).map((e) => /^\{[A-Za-z0-9_]+\}$/.test(e) ? n : e.replace(/[.*+?^${}()|[\]\\]/g, "\\$&")).join("")}$`), l = (e, t) => {
|
|
4
4
|
if (!t || !r(e)) return;
|
|
5
|
-
let n = Object.keys(t).find((t) =>
|
|
5
|
+
let n = Object.keys(t).find((t) => c(t).test(e));
|
|
6
6
|
return n === void 0 ? void 0 : {
|
|
7
7
|
pattern: n,
|
|
8
8
|
declaration: t[n]
|
|
9
9
|
};
|
|
10
|
-
},
|
|
10
|
+
}, u = /^(?=.)[A-Za-z0-9:_.-]*(\{[A-Za-z0-9_]+\}[A-Za-z0-9:_.-]*)*$/, d = /* @__PURE__ */ new Set([
|
|
11
11
|
"public",
|
|
12
12
|
"session",
|
|
13
13
|
"role"
|
|
14
|
-
]),
|
|
14
|
+
]), f = (t, n) => {
|
|
15
15
|
let r = [];
|
|
16
|
-
if (
|
|
17
|
-
let { access: i, publish: a, presence:
|
|
18
|
-
typeof p != "string" || !
|
|
19
|
-
for (let [e, t] of [["maxMessageBytes",
|
|
16
|
+
if (u.test(t) || r.push("a pattern is letters, digits and `:_.-`, with `{name}` for the part a page fills in — `board:{id}`"), !e(n)) return [...r, "a channel is an object: `{ access: { mode: \"public\" } }`"];
|
|
17
|
+
let { access: i, publish: a, presence: o, grant: s, retain: c, maxMessageBytes: l, messagesPerSecond: f } = n, p = e(i) ? i.mode : void 0;
|
|
18
|
+
typeof p != "string" || !d.has(p) ? r.push("`access` is { mode: \"public\" }, { mode: \"session\" } or { mode: \"role\", permissions: […] }") : p === "role" && !(e(i) && Array.isArray(i.permissions) && i.permissions.every((e) => typeof e == "string")) && r.push("`access: { mode: \"role\" }` names the permissions it needs: `permissions: [\"boardEdit\"]`"), a !== void 0 && a !== "clients" && a !== "server" && r.push("`publish` is \"clients\" (pages send) or \"server\" (only a flow's realtime.publish)"), o !== void 0 && typeof o != "boolean" && r.push("`presence` is true or false"), s !== void 0 && typeof s != "boolean" && r.push("`grant` is true (a page needs a grant from `realtime.grant` to open a topic) or false"), c !== void 0 && typeof c != "boolean" ? r.push("`retain` is true (the server keeps the latest message of each type for pages that join) or false") : c === !0 && a !== "server" && r.push("`retain: true` keeps what the server says, so only the server may speak: add `publish: \"server\"` — a page changes it through an action");
|
|
19
|
+
for (let [e, t] of [["maxMessageBytes", l], ["messagesPerSecond", f]]) t !== void 0 && (typeof t != "number" || !Number.isInteger(t) || t <= 0) && r.push(`\`${e}\` is a whole number above zero`);
|
|
20
20
|
return r;
|
|
21
|
-
},
|
|
21
|
+
}, p = (e) => ({
|
|
22
22
|
maxMessageBytes: e.maxMessageBytes ?? 4096,
|
|
23
23
|
messagesPerSecond: e.messagesPerSecond ?? 30
|
|
24
|
-
}),
|
|
24
|
+
}), m = "$presence", h = "$leave", g = "$join", _ = "$revoked", v = "plitzi-observer";
|
|
25
25
|
//#endregion
|
|
26
|
-
export {
|
|
26
|
+
export { s as JOB_TYPE, g as JOIN_TYPE, h as LEAVE_TYPE, v as OBSERVER_COOKIE_NAME, m as PRESENCE_TYPE, _ as REVOKED_TYPE, p as channelLimits, f as channelProblems, r as isValidTopic, o as jobOfTopic, a as jobTopic, l as matchChannel };
|
package/dist/schema/index.d.ts
CHANGED
package/dist/schema/index.mjs
CHANGED
|
@@ -1,11 +1,12 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
11
|
-
|
|
1
|
+
import { WITHHELD_ATTRIBUTE as e, mayReceive as t, pageAccessOf as n, pageAccessRefusal as r, pageWithheldOf as i, withholdPages as a } from "./pageAccess.mjs";
|
|
2
|
+
import { elementFromWire as o, schemaFromWire as s, schemaToWire as c } from "./wire.mjs";
|
|
3
|
+
import { ANCHOR_PATTERN as l, anchorOf as u, isAnchor as d, uniqueAnchor as f } from "./anchor.mjs";
|
|
4
|
+
import { COMPONENT_PROPS_SOURCE as p, EMPTY_SCHEMA as m, VARIABLE_REGEX as h } from "./schemaConstants.mjs";
|
|
5
|
+
import { findLayoutCycle as g, resolveLayoutChain as _ } from "./layoutChain.mjs";
|
|
6
|
+
import { collectServerElements as v, hasServerElements as y, notFoundProvider as b, pageNotFound as x, pageSeoText as S, pageServerContext as C } from "./serverElements.mjs";
|
|
7
|
+
import { isSnippet as w } from "./snippet.mjs";
|
|
8
|
+
import { MOTION_DEFAULT_DURATION as T, MOTION_ENTERS as E, MOTION_ENTER_EASING as D, MOTION_ENTER_FRAMES as O, MOTION_ENTER_FROM as k, MOTION_LOOPS as A, MOTION_LOOP_FRAMES as j, MOTION_MAX_MS as M, MOTION_PLAY_CSS as N, MOTION_SEEN_ATTRIBUTE as P, MOTION_SEEN_CSS as F, MOTION_STILL_CSS as I, MOTION_TRIGGERS as L, MOTION_VIEW_SELECTOR as R, MOVING_SELECTOR as z, isMotion as B, isMotionAnimation as V, motionAttributes as H, motionProblems as U } from "./motion.mjs";
|
|
9
|
+
import { revealOnView as W } from "./motionReveal.mjs";
|
|
10
|
+
import { pageElementTypes as G } from "./pageElements.mjs";
|
|
11
|
+
import { headingText as K, markdownHeadings as q } from "./markdownHeadings.mjs";
|
|
12
|
+
export { l as ANCHOR_PATTERN, p as COMPONENT_PROPS_SOURCE, m as EMPTY_SCHEMA, T as MOTION_DEFAULT_DURATION, E as MOTION_ENTERS, D as MOTION_ENTER_EASING, O as MOTION_ENTER_FRAMES, k as MOTION_ENTER_FROM, A as MOTION_LOOPS, j as MOTION_LOOP_FRAMES, M as MOTION_MAX_MS, N as MOTION_PLAY_CSS, P as MOTION_SEEN_ATTRIBUTE, F as MOTION_SEEN_CSS, I as MOTION_STILL_CSS, L as MOTION_TRIGGERS, R as MOTION_VIEW_SELECTOR, z as MOVING_SELECTOR, h as VARIABLE_REGEX, e as WITHHELD_ATTRIBUTE, u as anchorOf, v as collectServerElements, o as elementFromWire, g as findLayoutCycle, y as hasServerElements, K as headingText, d as isAnchor, B as isMotion, V as isMotionAnimation, w as isSnippet, q as markdownHeadings, t as mayReceive, H as motionAttributes, U as motionProblems, b as notFoundProvider, n as pageAccessOf, r as pageAccessRefusal, G as pageElementTypes, x as pageNotFound, S as pageSeoText, C as pageServerContext, i as pageWithheldOf, _ as resolveLayoutChain, W as revealOnView, s as schemaFromWire, c as schemaToWire, f as uniqueAnchor, a as withholdPages };
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import { AccessCaller } from '../actions/access';
|
|
2
|
+
import { Schema } from '../types';
|
|
3
|
+
/**
|
|
4
|
+
* Who may see a page, as the page declares it: the permissions a visitor must hold, all of them. A page that says none
|
|
5
|
+
* is anybody's — `accessLevel` still decides signed in or out — and one that says some is for a signed-in visitor who
|
|
6
|
+
* holds every one: for a platform space, the account's permissions; for any other, those of the visitor roles the space
|
|
7
|
+
* declares and gives them.
|
|
8
|
+
*
|
|
9
|
+
* It is the server that keeps a page to the people it is for. A page a visitor may not see is answered with its refusal
|
|
10
|
+
* and never its content: the content is taken out of the space the browser is sent (`withholdPages`), because a page
|
|
11
|
+
* merely hidden in the browser was still sent to it.
|
|
12
|
+
*/
|
|
13
|
+
export type PageAccess = {
|
|
14
|
+
permissions: string[];
|
|
15
|
+
};
|
|
16
|
+
/** A page's access, when its attributes declare one — at least one permission, each a name — or nothing. */
|
|
17
|
+
export declare const pageAccessOf: (attributes: Record<string, unknown> | undefined) => PageAccess | undefined;
|
|
18
|
+
/** Why this visitor may not see a page that declares `access`, or nothing when they may — or when it declares none. */
|
|
19
|
+
export declare const pageAccessRefusal: (access: PageAccess | undefined, caller: AccessCaller) => "unauthenticated" | "forbidden" | undefined;
|
|
20
|
+
/** The attribute a withheld page carries in the space the browser is sent: why it was withheld. */
|
|
21
|
+
export declare const WITHHELD_ATTRIBUTE = "withheld";
|
|
22
|
+
export type PageWithheld = 'unauthenticated' | 'forbidden';
|
|
23
|
+
/** Why a page of the space this browser was sent has no content, or nothing when it has its own. */
|
|
24
|
+
export declare const pageWithheldOf: (attributes: Record<string, unknown> | undefined) => PageWithheld | undefined;
|
|
25
|
+
/** The space as one visitor may be sent it, and the accesses of the protected pages it still holds whole. */
|
|
26
|
+
export type WithheldSchema = {
|
|
27
|
+
schema: Schema;
|
|
28
|
+
withheld: string[];
|
|
29
|
+
kept: PageAccess[];
|
|
30
|
+
};
|
|
31
|
+
/**
|
|
32
|
+
* The space with every page this visitor may not see emptied: its elements gone from `flat`, its `items` empty, and
|
|
33
|
+
* `withheld` on it saying why — so the page still routes, and draws its refusal rather than its content. What the
|
|
34
|
+
* visitor may see is left exactly as it was, and a space with no protected page is answered as it came, untouched.
|
|
35
|
+
*
|
|
36
|
+
* `kept` names the accesses of the protected pages left whole, so whoever caches the result can tell which visitors it
|
|
37
|
+
* may be handed to.
|
|
38
|
+
*/
|
|
39
|
+
export declare const withholdPages: (schema: Schema, caller: AccessCaller) => WithheldSchema;
|
|
40
|
+
/** Whether a visitor may be handed a space that holds these protected pages whole: they may see every one of them. */
|
|
41
|
+
export declare const mayReceive: (kept: readonly PageAccess[], caller: AccessCaller) => boolean;
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
import { accessRefusal as e } from "../actions/access.mjs";
|
|
2
|
+
//#region src/schema/pageAccess.ts
|
|
3
|
+
var t = (e) => {
|
|
4
|
+
let t = e?.access;
|
|
5
|
+
if (typeof t != "object" || !t || !("permissions" in t)) return;
|
|
6
|
+
let { permissions: n } = t;
|
|
7
|
+
if (!Array.isArray(n)) return;
|
|
8
|
+
let r = n.filter((e) => typeof e == "string" && e !== "");
|
|
9
|
+
return r.length > 0 ? { permissions: r } : void 0;
|
|
10
|
+
}, n = (t, n) => t ? e({
|
|
11
|
+
mode: "role",
|
|
12
|
+
permissions: t.permissions
|
|
13
|
+
}, n) : void 0, r = "withheld", i = (e) => {
|
|
14
|
+
let t = e?.[r];
|
|
15
|
+
return t === "unauthenticated" || t === "forbidden" ? t : void 0;
|
|
16
|
+
}, a = (e, i) => {
|
|
17
|
+
let a = /* @__PURE__ */ new Map(), o = [];
|
|
18
|
+
for (let r of e.pages) {
|
|
19
|
+
let s = t(e.flat[r]?.attributes);
|
|
20
|
+
if (!s) continue;
|
|
21
|
+
let c = n(s, i);
|
|
22
|
+
c ? a.set(r, c) : o.push(s);
|
|
23
|
+
}
|
|
24
|
+
if (a.size === 0) return {
|
|
25
|
+
schema: e,
|
|
26
|
+
withheld: [],
|
|
27
|
+
kept: o
|
|
28
|
+
};
|
|
29
|
+
let s = {};
|
|
30
|
+
for (let [t, n] of Object.entries(e.flat)) {
|
|
31
|
+
let e = a.get(t);
|
|
32
|
+
e ? s[t] = {
|
|
33
|
+
...n,
|
|
34
|
+
attributes: {
|
|
35
|
+
...n.attributes,
|
|
36
|
+
[r]: e
|
|
37
|
+
},
|
|
38
|
+
definition: {
|
|
39
|
+
...n.definition,
|
|
40
|
+
items: []
|
|
41
|
+
}
|
|
42
|
+
} : t !== n.definition.rootId && a.has(n.definition.rootId) || (s[t] = n);
|
|
43
|
+
}
|
|
44
|
+
return {
|
|
45
|
+
schema: {
|
|
46
|
+
...e,
|
|
47
|
+
flat: s
|
|
48
|
+
},
|
|
49
|
+
withheld: [...a.keys()],
|
|
50
|
+
kept: o
|
|
51
|
+
};
|
|
52
|
+
}, o = (e, t) => e.every((e) => n(e, t) === void 0);
|
|
53
|
+
//#endregion
|
|
54
|
+
export { r as WITHHELD_ATTRIBUTE, o as mayReceive, t as pageAccessOf, n as pageAccessRefusal, i as pageWithheldOf, a as withholdPages };
|