@nexia/sdk 0.5.0

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 (49) hide show
  1. package/dist/app-availability.d.ts +18 -0
  2. package/dist/app-availability.js +29 -0
  3. package/dist/approval.d.ts +180 -0
  4. package/dist/approval.js +9 -0
  5. package/dist/context.d.ts +49 -0
  6. package/dist/context.js +1 -0
  7. package/dist/data-migration.d.ts +123 -0
  8. package/dist/data-migration.js +70 -0
  9. package/dist/fixtures/approval-contract-negative.d.ts +1 -0
  10. package/dist/fixtures/approval-contract-negative.js +8 -0
  11. package/dist/handoff-result.d.ts +6 -0
  12. package/dist/handoff-result.js +17 -0
  13. package/dist/host.d.ts +602 -0
  14. package/dist/host.js +803 -0
  15. package/dist/index.d.ts +42 -0
  16. package/dist/index.js +21 -0
  17. package/dist/number.d.ts +2 -0
  18. package/dist/number.js +9 -0
  19. package/dist/organization-target.d.ts +101 -0
  20. package/dist/organization-target.js +105 -0
  21. package/dist/permissions.d.ts +3 -0
  22. package/dist/permissions.js +12 -0
  23. package/dist/platform.d.ts +378 -0
  24. package/dist/platform.js +114 -0
  25. package/dist/process.d.ts +98 -0
  26. package/dist/process.js +10 -0
  27. package/dist/resource-composition.d.ts +104 -0
  28. package/dist/resource-composition.js +576 -0
  29. package/dist/resource-create-destination.d.ts +17 -0
  30. package/dist/resource-create-destination.js +1 -0
  31. package/dist/resource-reference.d.ts +122 -0
  32. package/dist/resource-reference.js +203 -0
  33. package/dist/resources/resource-information.d.ts +128 -0
  34. package/dist/resources/resource-information.js +12 -0
  35. package/dist/resources/resource-list.d.ts +23 -0
  36. package/dist/resources/resource-list.js +1 -0
  37. package/dist/resources/resource-projections.d.ts +311 -0
  38. package/dist/resources/resource-projections.js +1 -0
  39. package/dist/resources/resource-transfer.d.ts +208 -0
  40. package/dist/resources/resource-transfer.js +1 -0
  41. package/dist/shell.d.ts +1297 -0
  42. package/dist/shell.js +1 -0
  43. package/dist/signature.d.ts +489 -0
  44. package/dist/signature.js +171 -0
  45. package/dist/spreadsheet.d.ts +42 -0
  46. package/dist/spreadsheet.js +15 -0
  47. package/dist/testing.d.ts +16 -0
  48. package/dist/testing.js +17 -0
  49. package/package.json +53 -0
@@ -0,0 +1,42 @@
1
+ /** JSON snapshot owned by the Core spreadsheet engine. Keep unknown fields on round trips. */
2
+ export interface SpreadsheetWorkbook {
3
+ id: string;
4
+ name: string;
5
+ sheetOrder: string[];
6
+ sheets: Record<string, SpreadsheetWorksheet>;
7
+ [key: string]: unknown;
8
+ }
9
+ export interface SpreadsheetWorksheet {
10
+ id: string;
11
+ name: string;
12
+ rowCount: number;
13
+ columnCount: number;
14
+ cellData: Record<string, Record<string, SpreadsheetCell>>;
15
+ [key: string]: unknown;
16
+ }
17
+ /** A formula is explicit; a string beginning with '=' remains literal text. */
18
+ export interface SpreadsheetCell {
19
+ v?: string | number | boolean | null;
20
+ f?: string | null;
21
+ [key: string]: unknown;
22
+ }
23
+ export interface NxSpreadsheetEditorProps {
24
+ /** Same document ID must keep its meaning for the lifetime of the editor. */
25
+ value: SpreadsheetWorkbook;
26
+ onChange: (value: SpreadsheetWorkbook) => void;
27
+ ariaLabel: string;
28
+ readOnly?: boolean;
29
+ className?: string;
30
+ dropdowns?: Array<{
31
+ column: number;
32
+ startRow: number;
33
+ rowCount: number;
34
+ values: string[];
35
+ }>;
36
+ focusCell?: {
37
+ row: number;
38
+ column: number;
39
+ };
40
+ }
41
+ /** Build a draft without creating any server record or importing business data. */
42
+ export declare function createSpreadsheetWorkbook(id: string, name: string, rows?: readonly (readonly (string | number | boolean | null)[])[]): SpreadsheetWorkbook;
@@ -0,0 +1,15 @@
1
+ /** Build a draft without creating any server record or importing business data. */
2
+ export function createSpreadsheetWorkbook(id, name, rows = []) {
3
+ const cellData = {};
4
+ rows.forEach((row, r) => {
5
+ cellData[r] = {};
6
+ row.forEach((v, c) => { cellData[r][c] = { v, t: typeof v === 'number' ? 2 : typeof v === 'boolean' ? 3 : 1 }; });
7
+ });
8
+ return {
9
+ id, name, sheetOrder: ['sheet1'],
10
+ sheets: { sheet1: {
11
+ id: 'sheet1', name, rowCount: Math.max(100, rows.length),
12
+ columnCount: rows.reduce((width, row) => Math.max(width, row.length), 26), cellData,
13
+ } },
14
+ };
15
+ }
@@ -0,0 +1,16 @@
1
+ export interface NexiaAppFrontendTestHostBindings {
2
+ i18n: {
3
+ changeLanguage: (language: string) => unknown;
4
+ };
5
+ server: {
6
+ use: (...handlers: unknown[]) => void;
7
+ };
8
+ }
9
+ /** Core test setup installs its i18n and request-interception harness here. */
10
+ export declare function configureNexiaAppFrontendTestHost(bindings: NexiaAppFrontendTestHostBindings): void;
11
+ export declare const appTestI18n: {
12
+ changeLanguage: (language: string) => unknown;
13
+ };
14
+ export declare const appTestServer: {
15
+ use: (...handlers: unknown[]) => void;
16
+ };
@@ -0,0 +1,17 @@
1
+ let activeTestHost = null;
2
+ /** Core test setup installs its i18n and request-interception harness here. */
3
+ export function configureNexiaAppFrontendTestHost(bindings) {
4
+ activeTestHost = bindings;
5
+ }
6
+ function testHost() {
7
+ if (activeTestHost === null) {
8
+ throw new Error('Nexia App frontend test host is not configured. Core test setup must configure it before App specs run.');
9
+ }
10
+ return activeTestHost;
11
+ }
12
+ export const appTestI18n = {
13
+ changeLanguage: (language) => testHost().i18n.changeLanguage(language),
14
+ };
15
+ export const appTestServer = {
16
+ use: (...handlers) => testHost().server.use(...handlers),
17
+ };
package/package.json ADDED
@@ -0,0 +1,53 @@
1
+ {
2
+ "name": "@nexia/sdk",
3
+ "version": "0.5.0",
4
+ "description": "Frontend contracts for Nexia App Packages",
5
+ "license": "UNLICENSED",
6
+ "type": "module",
7
+ "files": [
8
+ "dist"
9
+ ],
10
+ "main": "./dist/index.js",
11
+ "types": "./dist/index.d.ts",
12
+ "exports": {
13
+ ".": {
14
+ "development": "./dist/index.js",
15
+ "types": "./dist/index.d.ts",
16
+ "import": "./dist/index.js"
17
+ },
18
+ "./host": {
19
+ "development": "./dist/host.js",
20
+ "types": "./dist/host.d.ts",
21
+ "import": "./dist/host.js"
22
+ },
23
+ "./testing": {
24
+ "development": "./dist/testing.js",
25
+ "types": "./dist/testing.d.ts",
26
+ "import": "./dist/testing.js"
27
+ }
28
+ },
29
+ "sideEffects": false,
30
+ "peerDependencies": {
31
+ "@tanstack/react-query": "^5.99.0",
32
+ "axios": "^1.11.0",
33
+ "react": "^19.1.0"
34
+ },
35
+ "devDependencies": {
36
+ "@tanstack/react-query": "^5.99.0",
37
+ "@types/react": "^19.1.0",
38
+ "axios": "^1.11.0",
39
+ "react": "^19.1.0",
40
+ "typescript": "^5.8.3"
41
+ },
42
+ "publishConfig": {
43
+ "registry": "https://npm.pkg.github.com"
44
+ },
45
+ "scripts": {
46
+ "build": "node scripts/build.mjs",
47
+ "test": "npm run build && node tests/WireValuesTest.mjs && node tests/ResourceCompositionFrontendContractsTest.mjs && node scripts/organization-target-contract.mjs",
48
+ "test:wire-values": "node tests/WireValuesTest.mjs",
49
+ "typecheck": "tsc -p tsconfig.json --noEmit",
50
+ "test:resource-composition": "pnpm run build && node tests/ResourceCompositionFrontendContractsTest.mjs",
51
+ "test:organization-target": "pnpm run build && node scripts/organization-target-contract.mjs"
52
+ }
53
+ }