@lowdefy/operators-js 0.0.0-experimental-20260720072521 → 0.0.0-experimental-20260720135014
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/operators/build/env.js +1 -1
- package/dist/operators/shared/app.js +2 -12
- package/dist/operatorsBuild.js +0 -4
- package/dist/operatorsClient.js +0 -1
- package/dist/operatorsServer.js +0 -1
- package/dist/schemas.js +0 -2
- package/dist/types.js +1 -3
- package/package.json +6 -7
- package/dist/operators/build/authConfig.js +0 -53
- package/dist/operators/build/authConfig.schema.js +0 -34
- package/dist/operators/client/websocket.js +0 -39
- package/dist/operators/server/organization.js +0 -39
- package/dist/operators/server/organization.schema.js +0 -59
|
@@ -13,24 +13,14 @@
|
|
|
13
13
|
See the License for the specific language governing permissions and
|
|
14
14
|
limitations under the License.
|
|
15
15
|
*/ import { getFromObject } from '@lowdefy/operators';
|
|
16
|
-
import { ConfigError } from '@lowdefy/errors';
|
|
17
|
-
import { type } from '@lowdefy/helpers';
|
|
18
16
|
function _app({ arrayIndices, location, lowdefyApp, params }) {
|
|
19
|
-
|
|
17
|
+
return getFromObject({
|
|
20
18
|
arrayIndices,
|
|
21
19
|
location,
|
|
22
20
|
object: lowdefyApp,
|
|
23
21
|
operator: '_app',
|
|
24
22
|
params
|
|
25
23
|
});
|
|
26
|
-
if (params === 'slug' && type.isNone(value)) {
|
|
27
|
-
throw new ConfigError('`slug` is required on the app but is not set. Declare `slug` in `lowdefy.yaml`.', {
|
|
28
|
-
received: {
|
|
29
|
-
slug: value
|
|
30
|
-
}
|
|
31
|
-
});
|
|
32
|
-
}
|
|
33
|
-
return value;
|
|
34
24
|
}
|
|
35
|
-
_app.dynamic =
|
|
25
|
+
_app.dynamic = true;
|
|
36
26
|
export default _app;
|
package/dist/operatorsBuild.js
CHANGED
|
@@ -13,7 +13,6 @@
|
|
|
13
13
|
See the License for the specific language governing permissions and
|
|
14
14
|
limitations under the License.
|
|
15
15
|
*/ import _and from './operators/shared/and.js';
|
|
16
|
-
import _app from './operators/shared/app.js';
|
|
17
16
|
import _args from './operators/shared/args.js';
|
|
18
17
|
import _array from './operators/shared/array.js';
|
|
19
18
|
import _boolean from './operators/shared/boolean.js';
|
|
@@ -49,14 +48,11 @@ import _type from './operators/shared/type.js';
|
|
|
49
48
|
import _uri from './operators/shared/uri.js';
|
|
50
49
|
import _base64 from './operators/server/base64.js';
|
|
51
50
|
import _hash from './operators/server/hash.js';
|
|
52
|
-
import _authConfig from './operators/build/authConfig.js';
|
|
53
51
|
import _env from './operators/build/env.js';
|
|
54
52
|
export default {
|
|
55
53
|
_and,
|
|
56
|
-
_app,
|
|
57
54
|
_args,
|
|
58
55
|
_array,
|
|
59
|
-
_authConfig,
|
|
60
56
|
_base64,
|
|
61
57
|
_boolean,
|
|
62
58
|
_date,
|
package/dist/operatorsClient.js
CHANGED
|
@@ -67,4 +67,3 @@ export { default as _request_details } from './operators/client/request_details.
|
|
|
67
67
|
export { default as _request } from './operators/client/request.js';
|
|
68
68
|
export { default as _theme } from './operators/client/theme.js';
|
|
69
69
|
export { default as _url_query } from './operators/client/url_query.js';
|
|
70
|
-
export { default as _websocket } from './operators/client/websocket.js';
|
package/dist/operatorsServer.js
CHANGED
|
@@ -55,7 +55,6 @@ export { default as _base64 } from './operators/server/base64.js';
|
|
|
55
55
|
export { default as _hash } from './operators/server/hash.js';
|
|
56
56
|
export { default as _item } from './operators/server/item.js';
|
|
57
57
|
export { default as _js } from './operators/server/js.js';
|
|
58
|
-
export { default as _organization } from './operators/server/organization.js';
|
|
59
58
|
export { default as _payload } from './operators/server/payload.js';
|
|
60
59
|
export { default as _secret } from './operators/server/secret.js';
|
|
61
60
|
export { default as _step } from './operators/server/step.js';
|
package/dist/schemas.js
CHANGED
|
@@ -71,10 +71,8 @@ export { default as _url_query } from './operators/client/url_query.schema.js';
|
|
|
71
71
|
// Server operators
|
|
72
72
|
export { default as _hash } from './operators/server/hash.schema.js';
|
|
73
73
|
export { default as _item } from './operators/server/item.schema.js';
|
|
74
|
-
export { default as _organization } from './operators/server/organization.schema.js';
|
|
75
74
|
export { default as _payload } from './operators/server/payload.schema.js';
|
|
76
75
|
export { default as _secret } from './operators/server/secret.schema.js';
|
|
77
76
|
export { default as _step } from './operators/server/step.schema.js';
|
|
78
77
|
// Build operators
|
|
79
|
-
export { default as _authConfig } from './operators/build/authConfig.schema.js';
|
|
80
78
|
export { default as _env } from './operators/build/env.schema.js';
|
package/dist/types.js
CHANGED
|
@@ -69,8 +69,7 @@
|
|
|
69
69
|
'_type',
|
|
70
70
|
'_uri',
|
|
71
71
|
'_url_query',
|
|
72
|
-
'_user'
|
|
73
|
-
'_websocket'
|
|
72
|
+
'_user'
|
|
74
73
|
],
|
|
75
74
|
server: [
|
|
76
75
|
'_and',
|
|
@@ -104,7 +103,6 @@
|
|
|
104
103
|
'_object',
|
|
105
104
|
'_operator',
|
|
106
105
|
'_or',
|
|
107
|
-
'_organization',
|
|
108
106
|
'_payload',
|
|
109
107
|
'_product',
|
|
110
108
|
'_random',
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@lowdefy/operators-js",
|
|
3
|
-
"version": "0.0.0-experimental-
|
|
3
|
+
"version": "0.0.0-experimental-20260720135014",
|
|
4
4
|
"license": "Apache-2.0",
|
|
5
5
|
"description": "",
|
|
6
6
|
"homepage": "https://lowdefy.com",
|
|
@@ -43,16 +43,15 @@
|
|
|
43
43
|
"dist/*"
|
|
44
44
|
],
|
|
45
45
|
"dependencies": {
|
|
46
|
-
"@lowdefy/
|
|
47
|
-
"@lowdefy/
|
|
48
|
-
"@lowdefy/operators": "0.0.0-experimental-20260720072521",
|
|
46
|
+
"@lowdefy/helpers": "0.0.0-experimental-20260720135014",
|
|
47
|
+
"@lowdefy/operators": "0.0.0-experimental-20260720135014",
|
|
49
48
|
"intl-messageformat": "11.2.7"
|
|
50
49
|
},
|
|
51
50
|
"devDependencies": {
|
|
52
51
|
"@jest/globals": "28.1.3",
|
|
53
|
-
"@lowdefy/node-utils": "0.0.0-experimental-
|
|
54
|
-
"@swc/cli": "0.8.
|
|
55
|
-
"@swc/core": "1.15.
|
|
52
|
+
"@lowdefy/node-utils": "0.0.0-experimental-20260720135014",
|
|
53
|
+
"@swc/cli": "0.8.0",
|
|
54
|
+
"@swc/core": "1.15.18",
|
|
56
55
|
"@swc/jest": "0.2.39",
|
|
57
56
|
"jest": "28.1.3",
|
|
58
57
|
"jest-environment-jsdom": "28.1.3"
|
|
@@ -1,53 +0,0 @@
|
|
|
1
|
-
/*
|
|
2
|
-
Copyright 2020-2026 Lowdefy, Inc
|
|
3
|
-
|
|
4
|
-
Licensed under the Apache License, Version 2.0 (the "License");
|
|
5
|
-
you may not use this file except in compliance with the License.
|
|
6
|
-
You may obtain a copy of the License at
|
|
7
|
-
|
|
8
|
-
http://www.apache.org/licenses/LICENSE-2.0
|
|
9
|
-
|
|
10
|
-
Unless required by applicable law or agreed to in writing, software
|
|
11
|
-
distributed under the License is distributed on an "AS IS" BASIS,
|
|
12
|
-
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
13
|
-
See the License for the specific language governing permissions and
|
|
14
|
-
limitations under the License.
|
|
15
|
-
*/ import { get, type } from '@lowdefy/helpers';
|
|
16
|
-
// The curated catalog of readable projection paths. Extending it is a
|
|
17
|
-
// deliberate addition to this list — never a fall-through.
|
|
18
|
-
const readablePaths = [
|
|
19
|
-
'emailAndPassword.enabled',
|
|
20
|
-
'magicLink.enabled',
|
|
21
|
-
'twoFactor.enabled',
|
|
22
|
-
'passkey.enabled',
|
|
23
|
-
'phoneNumber.enabled',
|
|
24
|
-
'phoneNumber.signUpOnVerification',
|
|
25
|
-
'captcha.enabled',
|
|
26
|
-
'captcha.provider',
|
|
27
|
-
'captcha.siteKey',
|
|
28
|
-
'providers',
|
|
29
|
-
'organizations.signup',
|
|
30
|
-
'roles'
|
|
31
|
-
];
|
|
32
|
-
// Build-only operator, addressed as { _build.authConfig: '<path>' }. Reads the
|
|
33
|
-
// auth config projection the build computes in a scoped pre-pass before
|
|
34
|
-
// buildRefs. It deliberately has no runtime sibling — none of this data ships
|
|
35
|
-
// to the client or server at runtime.
|
|
36
|
-
function _authConfig({ authConfig, params }) {
|
|
37
|
-
if (type.isUndefined(authConfig)) {
|
|
38
|
-
// The projection is threaded everywhere except while the auth: block
|
|
39
|
-
// itself resolves — the self-reference rule.
|
|
40
|
-
throw new Error('_build.authConfig cannot be used inside the auth block — the auth config projection is not available while the auth block resolves.');
|
|
41
|
-
}
|
|
42
|
-
if (!readablePaths.includes(params)) {
|
|
43
|
-
throw new Error(`_build.authConfig received an unreadable path ${JSON.stringify(params)}. Readable paths are: ${readablePaths.map((path)=>`"${path}"`).join(', ')}.`);
|
|
44
|
-
}
|
|
45
|
-
return get(authConfig, params, {
|
|
46
|
-
copy: true
|
|
47
|
-
});
|
|
48
|
-
}
|
|
49
|
-
// dynamic true keeps the bare _authConfig spelling out of build-time static
|
|
50
|
-
// evaluation — the only supported address is the explicit _build.authConfig,
|
|
51
|
-
// which evaluates regardless of dynamic (matching _build.app).
|
|
52
|
-
_authConfig.dynamic = true;
|
|
53
|
-
export default _authConfig;
|
|
@@ -1,34 +0,0 @@
|
|
|
1
|
-
/*
|
|
2
|
-
Copyright 2020-2026 Lowdefy, Inc
|
|
3
|
-
|
|
4
|
-
Licensed under the Apache License, Version 2.0 (the "License");
|
|
5
|
-
you may not use this file except in compliance with the License.
|
|
6
|
-
You may obtain a copy of the License at
|
|
7
|
-
|
|
8
|
-
http://www.apache.org/licenses/LICENSE-2.0
|
|
9
|
-
|
|
10
|
-
Unless required by applicable law or agreed to in writing, software
|
|
11
|
-
distributed under the License is distributed on an "AS IS" BASIS,
|
|
12
|
-
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
13
|
-
See the License for the specific language governing permissions and
|
|
14
|
-
limitations under the License.
|
|
15
|
-
*/ export default {
|
|
16
|
-
type: 'object',
|
|
17
|
-
params: {
|
|
18
|
-
type: 'string',
|
|
19
|
-
enum: [
|
|
20
|
-
'emailAndPassword.enabled',
|
|
21
|
-
'magicLink.enabled',
|
|
22
|
-
'twoFactor.enabled',
|
|
23
|
-
'passkey.enabled',
|
|
24
|
-
'phoneNumber.enabled',
|
|
25
|
-
'phoneNumber.signUpOnVerification',
|
|
26
|
-
'captcha.enabled',
|
|
27
|
-
'captcha.provider',
|
|
28
|
-
'captcha.siteKey',
|
|
29
|
-
'providers',
|
|
30
|
-
'organizations.signup'
|
|
31
|
-
],
|
|
32
|
-
description: 'Curated auth config projection path to read at build time.'
|
|
33
|
-
}
|
|
34
|
-
};
|
|
@@ -1,39 +0,0 @@
|
|
|
1
|
-
/*
|
|
2
|
-
Copyright 2020-2026 Lowdefy, Inc
|
|
3
|
-
|
|
4
|
-
Licensed under the Apache License, Version 2.0 (the "License");
|
|
5
|
-
you may not use this file except in compliance with the License.
|
|
6
|
-
You may obtain a copy of the License at
|
|
7
|
-
|
|
8
|
-
http://www.apache.org/licenses/LICENSE-2.0
|
|
9
|
-
|
|
10
|
-
Unless required by applicable law or agreed to in writing, software
|
|
11
|
-
distributed under the License is distributed on an "AS IS" BASIS,
|
|
12
|
-
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
13
|
-
See the License for the specific language governing permissions and
|
|
14
|
-
limitations under the License.
|
|
15
|
-
*/ import { applyArrayIndices, get, type } from '@lowdefy/helpers';
|
|
16
|
-
function _websocket({ arrayIndices, params, websockets }) {
|
|
17
|
-
if (!type.isString(params)) {
|
|
18
|
-
throw new Error(`_websocket accepts a string value.`);
|
|
19
|
-
}
|
|
20
|
-
if (type.isNone(websockets)) {
|
|
21
|
-
return null;
|
|
22
|
-
}
|
|
23
|
-
const splitKey = params.split('.');
|
|
24
|
-
const [websocketId, ...keyParts] = splitKey;
|
|
25
|
-
const channel = websockets[websocketId];
|
|
26
|
-
if (type.isNone(channel)) {
|
|
27
|
-
return null;
|
|
28
|
-
}
|
|
29
|
-
if (splitKey.length === 1) {
|
|
30
|
-
return channel;
|
|
31
|
-
}
|
|
32
|
-
const key = keyParts.reduce((acc, value)=>acc === '' ? value : acc.concat('.', value), '');
|
|
33
|
-
return get(channel, applyArrayIndices(arrayIndices, key), {
|
|
34
|
-
copy: true,
|
|
35
|
-
default: null
|
|
36
|
-
});
|
|
37
|
-
}
|
|
38
|
-
_websocket.dynamic = true;
|
|
39
|
-
export default _websocket;
|
|
@@ -1,39 +0,0 @@
|
|
|
1
|
-
/*
|
|
2
|
-
Copyright 2020-2026 Lowdefy, Inc
|
|
3
|
-
|
|
4
|
-
Licensed under the Apache License, Version 2.0 (the "License");
|
|
5
|
-
you may not use this file except in compliance with the License.
|
|
6
|
-
You may obtain a copy of the License at
|
|
7
|
-
|
|
8
|
-
http://www.apache.org/licenses/LICENSE-2.0
|
|
9
|
-
|
|
10
|
-
Unless required by applicable law or agreed to in writing, software
|
|
11
|
-
distributed under the License is distributed on an "AS IS" BASIS,
|
|
12
|
-
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
13
|
-
See the License for the specific language governing permissions and
|
|
14
|
-
limitations under the License.
|
|
15
|
-
*/ import { getFromObject } from '@lowdefy/operators';
|
|
16
|
-
import { type } from '@lowdefy/helpers';
|
|
17
|
-
// Reads the resolved pinned organization ({ id, slug, name }) the engine
|
|
18
|
-
// retained from the startup ensure-by-slug. Evaluated at request time like
|
|
19
|
-
// _secret / _payload - the org id is minted at creation and known only after
|
|
20
|
-
// startup, so no build-time operator or config var can carry it.
|
|
21
|
-
function _organization({ location, organization, params }) {
|
|
22
|
-
if (type.isNone(organization)) {
|
|
23
|
-
throw new Error('_organization requires auth organizations to be configured - no organizations state is available.');
|
|
24
|
-
}
|
|
25
|
-
if (organization.policy === 'tenant') {
|
|
26
|
-
throw new Error('_organization cannot resolve under the "tenant" organizations policy - there is no single pinned organization. Pass an explicit organization id instead.');
|
|
27
|
-
}
|
|
28
|
-
if (type.isNone(organization.pinned)) {
|
|
29
|
-
throw new Error('The pinned organization has not been resolved - the startup ensure has not completed or failed.');
|
|
30
|
-
}
|
|
31
|
-
return getFromObject({
|
|
32
|
-
location,
|
|
33
|
-
object: organization.pinned,
|
|
34
|
-
operator: '_organization',
|
|
35
|
-
params
|
|
36
|
-
});
|
|
37
|
-
}
|
|
38
|
-
_organization.dynamic = true;
|
|
39
|
-
export default _organization;
|
|
@@ -1,59 +0,0 @@
|
|
|
1
|
-
/*
|
|
2
|
-
Copyright 2020-2026 Lowdefy, Inc
|
|
3
|
-
|
|
4
|
-
Licensed under the Apache License, Version 2.0 (the "License");
|
|
5
|
-
you may not use this file except in compliance with the License.
|
|
6
|
-
You may obtain a copy of the License at
|
|
7
|
-
|
|
8
|
-
http://www.apache.org/licenses/LICENSE-2.0
|
|
9
|
-
|
|
10
|
-
Unless required by applicable law or agreed to in writing, software
|
|
11
|
-
distributed under the License is distributed on an "AS IS" BASIS,
|
|
12
|
-
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
13
|
-
See the License for the specific language governing permissions and
|
|
14
|
-
limitations under the License.
|
|
15
|
-
*/ export default {
|
|
16
|
-
type: 'object',
|
|
17
|
-
params: {
|
|
18
|
-
oneOf: [
|
|
19
|
-
{
|
|
20
|
-
type: 'string',
|
|
21
|
-
enum: [
|
|
22
|
-
'id',
|
|
23
|
-
'slug',
|
|
24
|
-
'name'
|
|
25
|
-
],
|
|
26
|
-
description: 'Field of the resolved pinned organization to return.'
|
|
27
|
-
},
|
|
28
|
-
{
|
|
29
|
-
type: 'boolean',
|
|
30
|
-
enum: [
|
|
31
|
-
true
|
|
32
|
-
],
|
|
33
|
-
description: 'Return the resolved pinned organization.'
|
|
34
|
-
},
|
|
35
|
-
{
|
|
36
|
-
type: 'object',
|
|
37
|
-
properties: {
|
|
38
|
-
key: {
|
|
39
|
-
type: 'string',
|
|
40
|
-
enum: [
|
|
41
|
-
'id',
|
|
42
|
-
'slug',
|
|
43
|
-
'name'
|
|
44
|
-
],
|
|
45
|
-
description: 'Field of the resolved pinned organization to return.'
|
|
46
|
-
},
|
|
47
|
-
default: {
|
|
48
|
-
description: 'Default value if key does not exist.'
|
|
49
|
-
},
|
|
50
|
-
all: {
|
|
51
|
-
type: 'boolean',
|
|
52
|
-
description: 'Return the resolved pinned organization.'
|
|
53
|
-
}
|
|
54
|
-
},
|
|
55
|
-
additionalProperties: false
|
|
56
|
-
}
|
|
57
|
-
]
|
|
58
|
-
}
|
|
59
|
-
};
|