@plitzi/sdk-shared 0.39.3 → 0.39.6

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.
Files changed (104) hide show
  1. package/CHANGELOG.md +18 -0
  2. package/dist/clients/index.d.ts +60 -0
  3. package/dist/clients/index.mjs +47 -0
  4. package/dist/conditions/types.d.ts +1 -1
  5. package/dist/credentials/index.d.ts +4 -0
  6. package/dist/credentials/index.mjs +3 -0
  7. package/dist/credentials/kinds.d.ts +54 -0
  8. package/dist/credentials/kinds.mjs +326 -0
  9. package/dist/credentials/problems.d.ts +14 -0
  10. package/dist/credentials/problems.mjs +43 -0
  11. package/dist/csrf/csrf.d.ts +36 -0
  12. package/dist/csrf/csrf.mjs +62 -0
  13. package/dist/csrf/index.d.ts +2 -0
  14. package/dist/csrf/index.mjs +1 -0
  15. package/dist/helpers/deepEqual/deepEqual.mjs +3 -2
  16. package/dist/helpers/lodash/cloneDeep.d.ts +3 -3
  17. package/dist/helpers/lodash/cloneDeep.mjs +24 -27
  18. package/dist/helpers/lodash/has.d.ts +2 -1
  19. package/dist/helpers/lodash/has.mjs +8 -8
  20. package/dist/helpers/lodash/index.d.ts +1 -1
  21. package/dist/helpers/lodash/omit.mjs +2 -2
  22. package/dist/helpers/twigWrapper/charClass.mjs +21 -16
  23. package/dist/helpers/twigWrapper/filters/arrays.mjs +43 -42
  24. package/dist/helpers/twigWrapper/filters/filters.mjs +3 -3
  25. package/dist/helpers/twigWrapper/filters/index.mjs +4 -4
  26. package/dist/helpers/twigWrapper/filters/misc.mjs +14 -13
  27. package/dist/helpers/twigWrapper/filters/objects.mjs +50 -49
  28. package/dist/helpers/twigWrapper/filters/strings.mjs +41 -40
  29. package/dist/helpers/twigWrapper/filters/types.d.ts +4 -0
  30. package/dist/helpers/twigWrapper/filters/types.mjs +2 -2
  31. package/dist/hooks/index.d.ts +2 -1
  32. package/dist/hooks/index.mjs +3 -2
  33. package/dist/hooks/usePrePaint.d.ts +12 -0
  34. package/dist/hooks/usePrePaint.mjs +8 -0
  35. package/dist/navigation/index.d.ts +2 -1
  36. package/dist/navigation/index.mjs +4 -3
  37. package/dist/navigation/notFoundPages.d.ts +25 -0
  38. package/dist/navigation/notFoundPages.mjs +11 -0
  39. package/dist/navigation/routes.d.ts +2 -0
  40. package/dist/navigation/routes.mjs +2 -1
  41. package/dist/navigation/sitemap.d.ts +8 -0
  42. package/dist/navigation/sitemap.mjs +7 -4
  43. package/dist/network/graphql/builder/Mutations/Space/SpaceCancelDeployMutation.d.ts +7 -0
  44. package/dist/network/graphql/builder/Mutations/Space/SpaceCancelDeployMutation.mjs +3 -0
  45. package/dist/network/graphql/builder/Mutations/Space/SpaceCancelScheduledPublishMutation.d.ts +6 -0
  46. package/dist/network/graphql/builder/Mutations/Space/SpaceCancelScheduledPublishMutation.mjs +3 -0
  47. package/dist/network/graphql/builder/Mutations/Space/SpaceDeployMutation.d.ts +1 -1
  48. package/dist/network/graphql/builder/Mutations/Space/SpaceDeployMutation.mjs +1 -1
  49. package/dist/network/graphql/builder/Mutations/Space/SpaceRedeployMutation.d.ts +5 -0
  50. package/dist/network/graphql/builder/Mutations/Space/SpaceRedeployMutation.mjs +3 -0
  51. package/dist/network/graphql/builder/Mutations/Space/SpaceRollbackMutation.d.ts +5 -0
  52. package/dist/network/graphql/builder/Mutations/Space/SpaceRollbackMutation.mjs +3 -0
  53. package/dist/network/graphql/builder/Mutations/Space/SpaceSchedulePublishMutation.d.ts +5 -0
  54. package/dist/network/graphql/builder/Mutations/Space/SpaceSchedulePublishMutation.mjs +3 -0
  55. package/dist/network/graphql/builder/Mutations/Space/SpaceSetTargetMutation.d.ts +10 -0
  56. package/dist/network/graphql/builder/Mutations/Space/SpaceSetTargetMutation.mjs +3 -0
  57. package/dist/network/graphql/builder/Mutations/Space/SpaceTargetAutomationMutation.d.ts +11 -0
  58. package/dist/network/graphql/builder/Mutations/Space/SpaceTargetAutomationMutation.mjs +3 -0
  59. package/dist/network/graphql/builder/Mutations/index.d.ts +14 -0
  60. package/dist/network/graphql/builder/Mutations/index.mjs +88 -74
  61. package/dist/network/graphql/builder/Queries/Space/SpaceDeployDetailQuery.d.ts +7 -0
  62. package/dist/network/graphql/builder/Queries/Space/SpaceDeployDetailQuery.mjs +3 -0
  63. package/dist/network/graphql/builder/Queries/Space/SpacePublishCheckQuery.d.ts +7 -0
  64. package/dist/network/graphql/builder/Queries/Space/SpacePublishCheckQuery.mjs +3 -0
  65. package/dist/network/graphql/builder/Queries/Space/SpaceReleasesQuery.d.ts +7 -0
  66. package/dist/network/graphql/builder/Queries/Space/SpaceReleasesQuery.mjs +3 -0
  67. package/dist/network/graphql/builder/Queries/Space/SpaceScheduledPublishesQuery.d.ts +7 -0
  68. package/dist/network/graphql/builder/Queries/Space/SpaceScheduledPublishesQuery.mjs +3 -0
  69. package/dist/network/graphql/builder/Queries/Space/SpaceSnapshotsQuery.d.ts +7 -0
  70. package/dist/network/graphql/builder/Queries/Space/SpaceSnapshotsQuery.mjs +3 -0
  71. package/dist/network/graphql/builder/Queries/Space/SpaceTargetsQuery.d.ts +7 -0
  72. package/dist/network/graphql/builder/Queries/Space/SpaceTargetsQuery.mjs +3 -0
  73. package/dist/network/graphql/builder/Queries/Space/SpaceVersionChangesQuery.d.ts +7 -0
  74. package/dist/network/graphql/builder/Queries/Space/SpaceVersionChangesQuery.mjs +3 -0
  75. package/dist/network/graphql/builder/Queries/index.d.ts +14 -0
  76. package/dist/network/graphql/builder/Queries/index.mjs +38 -24
  77. package/dist/react/index.d.ts +1 -1
  78. package/dist/refusals/index.d.ts +112 -0
  79. package/dist/refusals/index.mjs +94 -0
  80. package/dist/schema/aiCrawlers.d.ts +25 -0
  81. package/dist/schema/aiCrawlers.mjs +34 -0
  82. package/dist/schema/documentParts.d.ts +45 -0
  83. package/dist/schema/documentParts.mjs +73 -0
  84. package/dist/schema/index.d.ts +3 -0
  85. package/dist/schema/index.mjs +21 -18
  86. package/dist/schema/pageAccess.d.ts +6 -0
  87. package/dist/schema/pageAccess.mjs +23 -23
  88. package/dist/schema/plitziMark.d.ts +9 -0
  89. package/dist/schema/plitziMark.mjs +3 -0
  90. package/dist/schema/schemaSettings.d.ts +1 -1
  91. package/dist/schema/schemaSettings.mjs +1 -1
  92. package/dist/schema/serverElements.d.ts +5 -0
  93. package/dist/store/runtimeStatePersist.mjs +10 -10
  94. package/dist/store/storeHooks.d.ts +45 -45
  95. package/dist/style/runtimeStyle.d.ts +5 -2
  96. package/dist/style/runtimeStyle.mjs +1 -1
  97. package/dist/types/ActionTypes.d.ts +2 -0
  98. package/dist/types/AuthTypes.d.ts +5 -0
  99. package/dist/types/SchemaTypes.d.ts +31 -4
  100. package/dist/types/ServerTypes.d.ts +6 -0
  101. package/dist/types/SpaceTypes.d.ts +277 -6
  102. package/dist/types/StoreTypes.d.ts +11 -0
  103. package/eslint.config.mjs +123 -100
  104. package/package.json +9 -13
package/eslint.config.mjs CHANGED
@@ -9,106 +9,129 @@ import storybook from 'eslint-plugin-storybook';
9
9
  import importEslint from 'eslint-plugin-import';
10
10
  import { globalIgnores } from 'eslint/config';
11
11
 
12
- export default tsEslint.config({
13
- extends: [js.configs.recommended, ...tsEslint.configs.strictTypeChecked, globalIgnores(['**/*.js'])],
14
- files: ['**/*.{ts,tsx}'],
15
- ignores: ['node_modules', 'node_modules/*', './node_modules/**', '**/node_modules/**', 'dist', 'coverage', '.yarn/*'],
16
- languageOptions: {
17
- ecmaVersion: 2023,
18
- globals: globals.browser,
19
- parserOptions: {
20
- projectService: {
21
- allowDefaultProject: ['.storybook/*.ts', '.storybook/*.tsx'],
22
- defaultProject: './tsconfig.json'
23
- },
24
- tsconfigRootDir: import.meta.dirname
25
- }
26
- },
27
- plugins: {
28
- import: importEslint,
29
- 'react-hooks': reactHooks,
30
- 'react-refresh': reactRefresh,
31
- react,
32
- prettier,
33
- jsxRuntime: react.configs.flat['jsx-runtime'],
34
- storybook
35
- },
36
- rules: {
37
- ...reactHooks.configs.recommended.rules,
38
- // One rule evaluator for every reader: sdk-shared's (`@plitzi/sdk-shared/conditions`). plitzi-ui keeps a copy of its
39
- // own, which Plitzi never reads, so the builder's preview and the server cannot decide a condition two ways.
40
- '@typescript-eslint/no-restricted-imports': [
41
- 'error',
42
- {
43
- paths: [
44
- {
45
- name: '@plitzi/plitzi-ui/QueryBuilder/evaluator',
46
- message: 'Evaluate a condition with `evaluateRuleGroup` from `@plitzi/sdk-shared/conditions`.'
47
- },
48
- {
49
- name: '@plitzi/plitzi-ui/QueryBuilder',
50
- importNames: ['QueryBuilderEvaluator'],
51
- message: 'Evaluate a condition with `evaluateRuleGroup` from `@plitzi/sdk-shared/conditions`.'
52
- },
53
- {
54
- name: '@plitzi/plitzi-ui/QueryBuilder/helpers',
55
- importNames: ['QueryBuilderEvaluator'],
56
- message: 'Evaluate a condition with `evaluateRuleGroup` from `@plitzi/sdk-shared/conditions`.'
57
- }
58
- ]
59
- }
12
+ export default tsEslint.config(
13
+ {
14
+ extends: [js.configs.recommended, ...tsEslint.configs.strictTypeChecked, globalIgnores(['**/*.js'])],
15
+ files: ['**/*.{ts,tsx}'],
16
+ ignores: [
17
+ 'node_modules',
18
+ 'node_modules/*',
19
+ './node_modules/**',
20
+ '**/node_modules/**',
21
+ 'dist',
22
+ 'coverage',
23
+ '.yarn/*'
60
24
  ],
61
- 'no-useless-assignment': 'off',
62
- '@typescript-eslint/no-deprecated': 'off',
63
- '@typescript-eslint/no-useless-default-assignment': 'off',
64
- '@typescript-eslint/consistent-type-imports': [
65
- 'warn',
66
- {
67
- disallowTypeAnnotations: false,
68
- fixStyle: 'separate-type-imports',
69
- prefer: 'type-imports'
25
+ languageOptions: {
26
+ ecmaVersion: 2023,
27
+ globals: globals.browser,
28
+ parserOptions: {
29
+ projectService: {
30
+ allowDefaultProject: ['.storybook/*.ts', '.storybook/*.tsx'],
31
+ defaultProject: './tsconfig.json'
32
+ },
33
+ tsconfigRootDir: import.meta.dirname
70
34
  }
71
- ],
72
- '@typescript-eslint/no-unnecessary-type-arguments': 'off',
73
- '@typescript-eslint/no-misused-promises': ['error', { checksVoidReturn: { attributes: false, arguments: false } }],
74
- '@typescript-eslint/no-confusing-void-expression': 'off', // ['error', { ignoreArrowShorthand: true, ignoreVoidOperator: true }],
75
- 'react-refresh/only-export-components': ['warn', { allowConstantExport: true }],
76
- 'no-var': 'error',
77
- // A file is read whole — by a person, and by an agent before it changes it: past this, it is split by what changes
78
- // together. A project's own files are held to the same idea by `plitzi lint` (`file-too-long`, `MAX_LINES`).
79
- 'max-lines': ['error', { max: 600, skipBlankLines: true, skipComments: true }],
80
- curly: 'error',
81
- // indent: ['warn', 2],
82
- 'linebreak-style': ['error', 'unix'],
83
- 'prefer-const': ['error', { destructuring: 'any', ignoreReadBeforeAssign: false }],
84
- // semi: ['warn', 'never'],
85
- 'react/jsx-key': ['warn', { checkFragmentShorthand: true }],
86
- 'react-hooks/refs': 'off', // @todo: review later
87
- 'react-hooks/immutability': 'off', // @todo: review later
88
- 'react-hooks/set-state-in-effect': 'off', // @todo: review later
89
- 'react-hooks/preserve-manual-memoization': 'off', // @todo: review later
90
- // sdk-elements' memos that the page server, which draws once, makes as values (`Element/hooks/drawnMemo.ts`).
91
- 'react-hooks/exhaustive-deps': ['warn', { additionalHooks: '(useDrawnMemo|useDrawnCallback)' }],
92
- 'prettier/prettier': ['warn', { trailingComma: 'none' }],
93
- '@typescript-eslint/restrict-template-expressions': ['error', { allowNumber: true }],
94
- // Destructuring a key out so the rest carries everything else is how a field is dropped from an object here.
95
- '@typescript-eslint/no-unused-vars': ['error', { ignoreRestSiblings: true }],
96
- 'import/order': [
97
- 'error',
98
- {
99
- groups: ['builtin', 'external', 'internal', ['parent', 'sibling', 'index'], 'type'],
100
- pathGroups: [
101
- { pattern: '@plitzi/+(sdk-*|nexus)/**', group: 'internal' },
102
- { pattern: '@plitzi/+(sdk-*|nexus)', group: 'internal' }
103
- // { pattern: '@icons/**', group: 'internal' },
104
- // { pattern: '@components/**', group: 'internal' },
105
- // { pattern: '@hooks/**', group: 'internal' },
106
- // { pattern: '@/**', group: 'internal' } // , position: 'before'
107
- ],
108
- pathGroupsExcludedImportTypes: ['type'],
109
- alphabetize: { order: 'asc', caseInsensitive: true },
110
- 'newlines-between': 'always'
111
- }
112
- ]
35
+ },
36
+ plugins: {
37
+ import: importEslint,
38
+ 'react-hooks': reactHooks,
39
+ 'react-refresh': reactRefresh,
40
+ react,
41
+ prettier,
42
+ jsxRuntime: react.configs.flat['jsx-runtime'],
43
+ storybook
44
+ },
45
+ rules: {
46
+ ...reactHooks.configs.recommended.rules,
47
+ // One rule evaluator for every reader: sdk-shared's (`@plitzi/sdk-shared/conditions`). plitzi-ui keeps a copy of its
48
+ // own, which Plitzi never reads, so the builder's preview and the server cannot decide a condition two ways.
49
+ '@typescript-eslint/no-restricted-imports': [
50
+ 'error',
51
+ {
52
+ paths: [
53
+ {
54
+ name: '@plitzi/plitzi-ui/QueryBuilder/evaluator',
55
+ message: 'Evaluate a condition with `evaluateRuleGroup` from `@plitzi/sdk-shared/conditions`.'
56
+ },
57
+ {
58
+ name: '@plitzi/plitzi-ui/QueryBuilder',
59
+ importNames: ['QueryBuilderEvaluator'],
60
+ message: 'Evaluate a condition with `evaluateRuleGroup` from `@plitzi/sdk-shared/conditions`.'
61
+ },
62
+ {
63
+ name: '@plitzi/plitzi-ui/QueryBuilder/helpers',
64
+ importNames: ['QueryBuilderEvaluator'],
65
+ message: 'Evaluate a condition with `evaluateRuleGroup` from `@plitzi/sdk-shared/conditions`.'
66
+ }
67
+ ]
68
+ }
69
+ ],
70
+ 'no-useless-assignment': 'off',
71
+ '@typescript-eslint/no-deprecated': 'off',
72
+ '@typescript-eslint/no-useless-default-assignment': 'off',
73
+ '@typescript-eslint/consistent-type-imports': [
74
+ 'warn',
75
+ {
76
+ disallowTypeAnnotations: false,
77
+ fixStyle: 'separate-type-imports',
78
+ prefer: 'type-imports'
79
+ }
80
+ ],
81
+ '@typescript-eslint/no-unnecessary-type-arguments': 'off',
82
+ '@typescript-eslint/no-misused-promises': [
83
+ 'error',
84
+ { checksVoidReturn: { attributes: false, arguments: false } }
85
+ ],
86
+ '@typescript-eslint/no-confusing-void-expression': 'off', // ['error', { ignoreArrowShorthand: true, ignoreVoidOperator: true }],
87
+ 'react-refresh/only-export-components': ['warn', { allowConstantExport: true }],
88
+ 'no-var': 'error',
89
+ // A file is read whole — by a person, and by an agent before it changes it: past this, it is split by what changes
90
+ // together. A project's own files are held to the same idea by `plitzi lint` (`file-too-long`, `MAX_LINES`).
91
+ 'max-lines': ['error', { max: 600, skipBlankLines: true, skipComments: true }],
92
+ curly: 'error',
93
+ // indent: ['warn', 2],
94
+ 'linebreak-style': ['error', 'unix'],
95
+ 'prefer-const': ['error', { destructuring: 'any', ignoreReadBeforeAssign: false }],
96
+ // semi: ['warn', 'never'],
97
+ 'react/jsx-key': ['warn', { checkFragmentShorthand: true }],
98
+ 'react-hooks/refs': 'off', // @todo: review later
99
+ 'react-hooks/immutability': 'off', // @todo: review later
100
+ 'react-hooks/set-state-in-effect': 'off', // @todo: review later
101
+ 'react-hooks/preserve-manual-memoization': 'off', // @todo: review later
102
+ // sdk-elements' memos that the page server, which draws once, makes as values (`Element/hooks/drawnMemo.ts`).
103
+ 'react-hooks/exhaustive-deps': ['warn', { additionalHooks: '(useDrawnMemo|useDrawnCallback)' }],
104
+ 'prettier/prettier': ['warn', { trailingComma: 'none' }],
105
+ '@typescript-eslint/restrict-template-expressions': ['error', { allowNumber: true }],
106
+ // Destructuring a key out so the rest carries everything else is how a field is dropped from an object here.
107
+ '@typescript-eslint/no-unused-vars': ['error', { ignoreRestSiblings: true }],
108
+ 'import/order': [
109
+ 'error',
110
+ {
111
+ groups: ['builtin', 'external', 'internal', ['parent', 'sibling', 'index'], 'type'],
112
+ pathGroups: [
113
+ { pattern: '@plitzi/+(sdk-*|nexus)/**', group: 'internal' },
114
+ { pattern: '@plitzi/+(sdk-*|nexus)', group: 'internal' }
115
+ // { pattern: '@icons/**', group: 'internal' },
116
+ // { pattern: '@components/**', group: 'internal' },
117
+ // { pattern: '@hooks/**', group: 'internal' },
118
+ // { pattern: '@/**', group: 'internal' } // , position: 'before'
119
+ ],
120
+ pathGroupsExcludedImportTypes: ['type'],
121
+ alphabetize: { order: 'asc', caseInsensitive: true },
122
+ 'newlines-between': 'always'
123
+ }
124
+ ]
125
+ }
126
+ },
127
+ /**
128
+ * Where a file exports more than components on purpose, and Fast Refresh reloads it whole: an element's file exports
129
+ * its component and what declares it (its definition, its settings), read together by the registry; a model's form
130
+ * exports the form and its schema; an entry point and an MCP app's view export what their bundle is. Said here once,
131
+ * per folder, instead of a comment in each file.
132
+ */
133
+ {
134
+ files: ['src/index.tsx', 'src/**/elements/**/*.tsx', 'src/**/[mM]odels/**/*.tsx', 'src/**/apps/*/view/index.tsx'],
135
+ rules: { 'react-refresh/only-export-components': 'off' }
113
136
  }
114
- });
137
+ );
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@plitzi/sdk-shared",
3
- "version": "0.39.3",
3
+ "version": "0.39.6",
4
4
  "license": "AGPL-3.0",
5
5
  "files": [
6
6
  "dist",
@@ -35,19 +35,18 @@
35
35
  "build:prod": "vite build"
36
36
  },
37
37
  "dependencies": {
38
+ "@plitzi/nexus": "^1.5.1",
38
39
  "date-fns": "^4.4.0",
39
40
  "zod": "^4.6.7"
40
41
  },
41
42
  "peerDependencies": {
42
43
  "@apollo/client": "^4.3.1",
43
- "@plitzi/nexus": "^1.4.0",
44
44
  "react": "^19",
45
45
  "react-dom": "^19"
46
46
  },
47
47
  "devDependencies": {
48
- "@apollo/client": "^4.3.7",
48
+ "@apollo/client": "^4.3.8",
49
49
  "@eslint/js": "^10.0.1",
50
- "@plitzi/nexus": "^1.4.0",
51
50
  "@testing-library/dom": "^10.4.2",
52
51
  "@testing-library/react": "^16.3.3",
53
52
  "@types/react": "^19.3.0",
@@ -61,18 +60,18 @@
61
60
  "eslint-plugin-prettier": "^5.5.7",
62
61
  "eslint-plugin-react": "^7.37.5",
63
62
  "eslint-plugin-react-hooks": "^7.1.1",
64
- "eslint-plugin-react-refresh": "^0.5.7",
65
- "eslint-plugin-storybook": "^10.6.6",
63
+ "eslint-plugin-react-refresh": "^0.5.8",
64
+ "eslint-plugin-storybook": "^10.6.7",
66
65
  "globals": "^17.14.0",
67
- "jsdom": "^31.0.0",
66
+ "jsdom": "^31.0.1",
68
67
  "lodash": "^4.18.1",
69
- "prettier": "^3.9.10",
68
+ "prettier": "^3.10.1",
70
69
  "react": "^19.3.1",
71
70
  "react-dom": "^19.3.1",
72
71
  "tailwindcss": "^4.3.5",
73
72
  "typescript": "^6.0.3",
74
- "typescript-eslint": "^8.72.2",
75
- "vite": "^8.3.7",
73
+ "typescript-eslint": "^8.73.0",
74
+ "vite": "^8.3.8",
76
75
  "vite-plugin-dts": "^5.1.2",
77
76
  "vitest": "^5.1.0",
78
77
  "vitest-fetch-mock": "^0.4.5"
@@ -81,9 +80,6 @@
81
80
  "@apollo/client": {
82
81
  "optional": true
83
82
  },
84
- "@plitzi/nexus": {
85
- "optional": true
86
- },
87
83
  "react": {
88
84
  "optional": true
89
85
  },