@ankhorage/contracts 22.3.0 → 22.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.
- package/CHANGELOG.md +12 -0
- package/README.md +1 -1
- package/dist/structure/generated.d.ts +76 -2
- package/dist/structure/generated.d.ts.map +1 -1
- package/dist/structure/generated.js +80 -2
- package/dist/structure/generated.js.map +1 -1
- package/package.json +9 -1
- package/src/authFlowStructure.test.ts +38 -0
- package/src/authSignInStructure.test.ts +18 -0
- package/src/contracts.test.ts +8 -0
- package/src/structure/generated.ts +80 -2
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,17 @@
|
|
|
1
1
|
# @ankhorage/contracts
|
|
2
2
|
|
|
3
|
+
## 22.5.0
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- a55ea34: Publish the canonical auth sign-in structure root with ordered identifier semantics for Studio authoring.
|
|
8
|
+
|
|
9
|
+
## 22.4.0
|
|
10
|
+
|
|
11
|
+
### Minor Changes
|
|
12
|
+
|
|
13
|
+
- d31c482: Publish the canonical auth-flow structure descriptor root for descriptor-driven Studio route authoring.
|
|
14
|
+
|
|
3
15
|
## 22.3.0
|
|
4
16
|
|
|
5
17
|
### Minor Changes
|
package/README.md
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
|
|
4
4
|
# @ankhorage/contracts
|
|
5
5
|
|
|
6
|
-
         
|
|
7
7
|
|
|
8
8
|
Serializable app, action, theme, auth, and secret-store contracts for Ankhorage.
|
|
9
9
|
|
|
@@ -1,14 +1,88 @@
|
|
|
1
1
|
export declare const STRUCTURE_DESCRIPTOR_COMPILER_VERSION = "6.0.3";
|
|
2
|
-
export declare const STRUCTURE_DESCRIPTOR_FINGERPRINT = "sha256:
|
|
2
|
+
export declare const STRUCTURE_DESCRIPTOR_FINGERPRINT = "sha256:f3ed1188a305565c10c9c2a3e5366ab12d3a78263cd636e776488bb11d11c3c5";
|
|
3
3
|
export declare const STRUCTURE_DESCRIPTOR: {
|
|
4
4
|
readonly protocolVersion: 1;
|
|
5
5
|
readonly packageName: "@ankhorage/contracts";
|
|
6
|
-
readonly packageVersion: "22.
|
|
6
|
+
readonly packageVersion: "22.4.0";
|
|
7
7
|
readonly roots: {
|
|
8
|
+
readonly "auth-flow": "AuthFlowConfig";
|
|
9
|
+
readonly "auth-sign-in": "AuthSignInSpec";
|
|
8
10
|
readonly "screen-metadata": "ScreenMetadataSpec";
|
|
9
11
|
readonly "screen-requirements": "ScreenRequirements";
|
|
10
12
|
};
|
|
11
13
|
readonly descriptors: {
|
|
14
|
+
readonly AuthFlowConfig: {
|
|
15
|
+
readonly id: "AuthFlowConfig";
|
|
16
|
+
readonly descriptor: {
|
|
17
|
+
readonly kind: "object";
|
|
18
|
+
readonly fields: {
|
|
19
|
+
readonly forgotPasswordRoute: {
|
|
20
|
+
readonly value: {
|
|
21
|
+
readonly kind: "scalar";
|
|
22
|
+
readonly type: "string";
|
|
23
|
+
};
|
|
24
|
+
readonly optional: true;
|
|
25
|
+
};
|
|
26
|
+
readonly otpRoute: {
|
|
27
|
+
readonly value: {
|
|
28
|
+
readonly kind: "scalar";
|
|
29
|
+
readonly type: "string";
|
|
30
|
+
};
|
|
31
|
+
readonly optional: true;
|
|
32
|
+
};
|
|
33
|
+
readonly postSignInRoute: {
|
|
34
|
+
readonly value: {
|
|
35
|
+
readonly kind: "scalar";
|
|
36
|
+
readonly type: "string";
|
|
37
|
+
};
|
|
38
|
+
};
|
|
39
|
+
readonly signInRoute: {
|
|
40
|
+
readonly value: {
|
|
41
|
+
readonly kind: "scalar";
|
|
42
|
+
readonly type: "string";
|
|
43
|
+
};
|
|
44
|
+
};
|
|
45
|
+
readonly signOutRoute: {
|
|
46
|
+
readonly value: {
|
|
47
|
+
readonly kind: "scalar";
|
|
48
|
+
readonly type: "string";
|
|
49
|
+
};
|
|
50
|
+
readonly optional: true;
|
|
51
|
+
};
|
|
52
|
+
readonly signUpRoute: {
|
|
53
|
+
readonly value: {
|
|
54
|
+
readonly kind: "scalar";
|
|
55
|
+
readonly type: "string";
|
|
56
|
+
};
|
|
57
|
+
readonly optional: true;
|
|
58
|
+
};
|
|
59
|
+
readonly unauthorizedRoute: {
|
|
60
|
+
readonly value: {
|
|
61
|
+
readonly kind: "scalar";
|
|
62
|
+
readonly type: "string";
|
|
63
|
+
};
|
|
64
|
+
readonly optional: true;
|
|
65
|
+
};
|
|
66
|
+
};
|
|
67
|
+
};
|
|
68
|
+
};
|
|
69
|
+
readonly AuthSignInSpec: {
|
|
70
|
+
readonly id: "AuthSignInSpec";
|
|
71
|
+
readonly descriptor: {
|
|
72
|
+
readonly kind: "object";
|
|
73
|
+
readonly fields: {
|
|
74
|
+
readonly identifiers: {
|
|
75
|
+
readonly value: {
|
|
76
|
+
readonly kind: "ordered-list";
|
|
77
|
+
readonly item: {
|
|
78
|
+
readonly kind: "enum";
|
|
79
|
+
readonly values: readonly ["email", "phone", "username"];
|
|
80
|
+
};
|
|
81
|
+
};
|
|
82
|
+
};
|
|
83
|
+
};
|
|
84
|
+
};
|
|
85
|
+
};
|
|
12
86
|
readonly ScreenMetadataSpec: {
|
|
13
87
|
readonly id: "ScreenMetadataSpec";
|
|
14
88
|
readonly descriptor: {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"generated.d.ts","sourceRoot":"","sources":["../../src/structure/generated.ts"],"names":[],"mappings":"AAGA,eAAO,MAAM,qCAAqC,UAAU,CAAC;AAC7D,eAAO,MAAM,gCAAgC,4EAA4E,CAAC;AAE1H,eAAO,MAAM,oBAAoB
|
|
1
|
+
{"version":3,"file":"generated.d.ts","sourceRoot":"","sources":["../../src/structure/generated.ts"],"names":[],"mappings":"AAGA,eAAO,MAAM,qCAAqC,UAAU,CAAC;AAC7D,eAAO,MAAM,gCAAgC,4EAA4E,CAAC;AAE1H,eAAO,MAAM,oBAAoB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAwKe,CAAC"}
|
|
@@ -1,14 +1,92 @@
|
|
|
1
1
|
export const STRUCTURE_DESCRIPTOR_COMPILER_VERSION = '6.0.3';
|
|
2
|
-
export const STRUCTURE_DESCRIPTOR_FINGERPRINT = 'sha256:
|
|
2
|
+
export const STRUCTURE_DESCRIPTOR_FINGERPRINT = 'sha256:f3ed1188a305565c10c9c2a3e5366ab12d3a78263cd636e776488bb11d11c3c5';
|
|
3
3
|
export const STRUCTURE_DESCRIPTOR = {
|
|
4
4
|
"protocolVersion": 1,
|
|
5
5
|
"packageName": "@ankhorage/contracts",
|
|
6
|
-
"packageVersion": "22.
|
|
6
|
+
"packageVersion": "22.4.0",
|
|
7
7
|
"roots": {
|
|
8
|
+
"auth-flow": "AuthFlowConfig",
|
|
9
|
+
"auth-sign-in": "AuthSignInSpec",
|
|
8
10
|
"screen-metadata": "ScreenMetadataSpec",
|
|
9
11
|
"screen-requirements": "ScreenRequirements"
|
|
10
12
|
},
|
|
11
13
|
"descriptors": {
|
|
14
|
+
"AuthFlowConfig": {
|
|
15
|
+
"id": "AuthFlowConfig",
|
|
16
|
+
"descriptor": {
|
|
17
|
+
"kind": "object",
|
|
18
|
+
"fields": {
|
|
19
|
+
"forgotPasswordRoute": {
|
|
20
|
+
"value": {
|
|
21
|
+
"kind": "scalar",
|
|
22
|
+
"type": "string"
|
|
23
|
+
},
|
|
24
|
+
"optional": true
|
|
25
|
+
},
|
|
26
|
+
"otpRoute": {
|
|
27
|
+
"value": {
|
|
28
|
+
"kind": "scalar",
|
|
29
|
+
"type": "string"
|
|
30
|
+
},
|
|
31
|
+
"optional": true
|
|
32
|
+
},
|
|
33
|
+
"postSignInRoute": {
|
|
34
|
+
"value": {
|
|
35
|
+
"kind": "scalar",
|
|
36
|
+
"type": "string"
|
|
37
|
+
}
|
|
38
|
+
},
|
|
39
|
+
"signInRoute": {
|
|
40
|
+
"value": {
|
|
41
|
+
"kind": "scalar",
|
|
42
|
+
"type": "string"
|
|
43
|
+
}
|
|
44
|
+
},
|
|
45
|
+
"signOutRoute": {
|
|
46
|
+
"value": {
|
|
47
|
+
"kind": "scalar",
|
|
48
|
+
"type": "string"
|
|
49
|
+
},
|
|
50
|
+
"optional": true
|
|
51
|
+
},
|
|
52
|
+
"signUpRoute": {
|
|
53
|
+
"value": {
|
|
54
|
+
"kind": "scalar",
|
|
55
|
+
"type": "string"
|
|
56
|
+
},
|
|
57
|
+
"optional": true
|
|
58
|
+
},
|
|
59
|
+
"unauthorizedRoute": {
|
|
60
|
+
"value": {
|
|
61
|
+
"kind": "scalar",
|
|
62
|
+
"type": "string"
|
|
63
|
+
},
|
|
64
|
+
"optional": true
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
},
|
|
69
|
+
"AuthSignInSpec": {
|
|
70
|
+
"id": "AuthSignInSpec",
|
|
71
|
+
"descriptor": {
|
|
72
|
+
"kind": "object",
|
|
73
|
+
"fields": {
|
|
74
|
+
"identifiers": {
|
|
75
|
+
"value": {
|
|
76
|
+
"kind": "ordered-list",
|
|
77
|
+
"item": {
|
|
78
|
+
"kind": "enum",
|
|
79
|
+
"values": [
|
|
80
|
+
"email",
|
|
81
|
+
"phone",
|
|
82
|
+
"username"
|
|
83
|
+
]
|
|
84
|
+
}
|
|
85
|
+
}
|
|
86
|
+
}
|
|
87
|
+
}
|
|
88
|
+
}
|
|
89
|
+
},
|
|
12
90
|
"ScreenMetadataSpec": {
|
|
13
91
|
"id": "ScreenMetadataSpec",
|
|
14
92
|
"descriptor": {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"generated.js","sourceRoot":"","sources":["../../src/structure/generated.ts"],"names":[],"mappings":"AAGA,MAAM,CAAC,MAAM,qCAAqC,GAAG,OAAO,CAAC;AAC7D,MAAM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oBACD,aAAa,EAAE;wBACb,OAAO,EAAE;4BACP,MAAM,EAAE,KAAK;4BACb,QAAQ,EAAE;gCACR,MAAM,EAAE,MAAM;gCACd,QAAQ,EAAE;oCACR,QAAQ;oCACR,WAAW;oCACX,oBAAoB;oCACpB,oBAAoB;oCACpB,cAAc;oCACd,mBAAmB;oCACnB,YAAY;oCACZ,eAAe;iCAChB;6BACF;yBACF;wBACD,UAAU,EAAE,IAAI;qBACjB;iBACF;aACF;SACF;KACF;CAC6C,CAAC","sourcesContent":["/* This file is generated by @ankhorage/devtools. Do not edit manually. */\nimport type { StructureDescriptorDocument } from '@ankhorage/contracts/structure';\n\nexport const STRUCTURE_DESCRIPTOR_COMPILER_VERSION = '6.0.3';\nexport const STRUCTURE_DESCRIPTOR_FINGERPRINT = 'sha256:
|
|
1
|
+
{"version":3,"file":"generated.js","sourceRoot":"","sources":["../../src/structure/generated.ts"],"names":[],"mappings":"AAGA,MAAM,CAAC,MAAM,qCAAqC,GAAG,OAAO,CAAC;AAC7D,MAAM,CAAC,MAAM,gCAAgC,GAAG,yEAAyE,CAAC;AAE1H,MAAM,CAAC,MAAM,oBAAoB,GAAG;IAClC,iBAAiB,EAAE,CAAC;IACpB,aAAa,EAAE,sBAAsB;IACrC,gBAAgB,EAAE,QAAQ;IAC1B,OAAO,EAAE;QACP,WAAW,EAAE,gBAAgB;QAC7B,cAAc,EAAE,gBAAgB;QAChC,iBAAiB,EAAE,oBAAoB;QACvC,qBAAqB,EAAE,oBAAoB;KAC5C;IACD,aAAa,EAAE;QACb,gBAAgB,EAAE;YAChB,IAAI,EAAE,gBAAgB;YACtB,YAAY,EAAE;gBACZ,MAAM,EAAE,QAAQ;gBAChB,QAAQ,EAAE;oBACR,qBAAqB,EAAE;wBACrB,OAAO,EAAE;4BACP,MAAM,EAAE,QAAQ;4BAChB,MAAM,EAAE,QAAQ;yBACjB;wBACD,UAAU,EAAE,IAAI;qBACjB;oBACD,UAAU,EAAE;wBACV,OAAO,EAAE;4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;qBACjB;oBACD,IAAI,EAAE;wBACJ,OAAO,EAAE;4BACP,MAAM,EAAE,QAAQ;4BAChB,MAAM,EAAE,QAAQ;yBACjB;qBACF;oBACD,MAAM,EAAE;wBACN,OAAO,EAAE;4BACP,MAAM,EAAE,QAAQ;4BAChB,MAAM,EAAE,QAAQ;yBACjB;qBACF;oBACD,OAAO,EAAE;wBACP,OAAO,EAAE;4BACP,MAAM,EAAE,QAAQ;4BAChB,MAAM,EAAE,QAAQ;yBACjB;wBACD,UAAU,EAAE,IAAI;qBACjB;iBACF;aACF;SACF;QACD,oBAAoB,EAAE;YACpB,IAAI,EAAE,oBAAoB;YAC1B,YAAY,EAAE;gBACZ,MAAM,EAAE,QAAQ;gBAChB,QAAQ,EAAE;oBACR,cAAc,EAAE;wBACd,OAAO,EAAE;4BACP,MAAM,EAAE,KAAK;4BACb,QAAQ,EAAE;gCACR,MAAM,EAAE,MAAM;gCACd,QAAQ,EAAE;oCACR,gBAAgB;oCAChB,eAAe;oCACf,WAAW;oCACX,aAAa;oCACb,YAAY;oCACZ,UAAU;oCACV,aAAa;oCACb,eAAe;iCAChB;6BACF;yBACF;wBACD,UAAU,EAAE,IAAI;qBACjB;oBACD,aAAa,EAAE;wBACb,OAAO,EAAE;4BACP,MAAM,EAAE,KAAK;4BACb,QAAQ,EAAE;gCACR,MAAM,EAAE,MAAM;gCACd,QAAQ,EAAE;oCACR,QAAQ;oCACR,WAAW;oCACX,oBAAoB;oCACpB,oBAAoB;oCACpB,cAAc;oCACd,mBAAmB;oCACnB,YAAY;oCACZ,eAAe;iCAChB;6BACF;yBACF;wBACD,UAAU,EAAE,IAAI;qBACjB;iBACF;aACF;SACF;KACF;CAC6C,CAAC","sourcesContent":["/* This file is generated by @ankhorage/devtools. Do not edit manually. */\nimport type { StructureDescriptorDocument } from '@ankhorage/contracts/structure';\n\nexport const STRUCTURE_DESCRIPTOR_COMPILER_VERSION = '6.0.3';\nexport const STRUCTURE_DESCRIPTOR_FINGERPRINT = 'sha256:f3ed1188a305565c10c9c2a3e5366ab12d3a78263cd636e776488bb11d11c3c5';\n\nexport const STRUCTURE_DESCRIPTOR = {\n \"protocolVersion\": 1,\n \"packageName\": \"@ankhorage/contracts\",\n \"packageVersion\": \"22.4.0\",\n \"roots\": {\n \"auth-flow\": \"AuthFlowConfig\",\n \"auth-sign-in\": \"AuthSignInSpec\",\n \"screen-metadata\": \"ScreenMetadataSpec\",\n \"screen-requirements\": \"ScreenRequirements\"\n },\n \"descriptors\": {\n \"AuthFlowConfig\": {\n \"id\": \"AuthFlowConfig\",\n \"descriptor\": {\n \"kind\": \"object\",\n \"fields\": {\n \"forgotPasswordRoute\": {\n \"value\": {\n \"kind\": \"scalar\",\n \"type\": \"string\"\n },\n \"optional\": true\n },\n \"otpRoute\": {\n \"value\": {\n \"kind\": \"scalar\",\n \"type\": \"string\"\n },\n \"optional\": true\n },\n \"postSignInRoute\": {\n \"value\": {\n \"kind\": \"scalar\",\n \"type\": \"string\"\n }\n },\n \"signInRoute\": {\n \"value\": {\n \"kind\": \"scalar\",\n \"type\": \"string\"\n }\n },\n \"signOutRoute\": {\n \"value\": {\n \"kind\": \"scalar\",\n \"type\": \"string\"\n },\n \"optional\": true\n },\n \"signUpRoute\": {\n \"value\": {\n \"kind\": \"scalar\",\n \"type\": \"string\"\n },\n \"optional\": true\n },\n \"unauthorizedRoute\": {\n \"value\": {\n \"kind\": \"scalar\",\n \"type\": \"string\"\n },\n \"optional\": true\n }\n }\n }\n },\n \"AuthSignInSpec\": {\n \"id\": \"AuthSignInSpec\",\n \"descriptor\": {\n \"kind\": \"object\",\n \"fields\": {\n \"identifiers\": {\n \"value\": {\n \"kind\": \"ordered-list\",\n \"item\": {\n \"kind\": \"enum\",\n \"values\": [\n \"email\",\n \"phone\",\n \"username\"\n ]\n }\n }\n }\n }\n }\n },\n \"ScreenMetadataSpec\": {\n \"id\": \"ScreenMetadataSpec\",\n \"descriptor\": {\n \"kind\": \"object\",\n \"fields\": {\n \"description\": {\n \"value\": {\n \"kind\": \"scalar\",\n \"type\": \"string\"\n },\n \"optional\": true\n },\n \"id\": {\n \"value\": {\n \"kind\": \"scalar\",\n \"type\": \"string\"\n }\n },\n \"name\": {\n \"value\": {\n \"kind\": \"scalar\",\n \"type\": \"string\"\n }\n },\n \"title\": {\n \"value\": {\n \"kind\": \"scalar\",\n \"type\": \"string\"\n },\n \"optional\": true\n }\n }\n }\n },\n \"ScreenRequirements\": {\n \"id\": \"ScreenRequirements\",\n \"descriptor\": {\n \"kind\": \"object\",\n \"fields\": {\n \"capabilities\": {\n \"value\": {\n \"kind\": \"set\",\n \"member\": {\n \"kind\": \"enum\",\n \"values\": [\n \"barcodeScanner\",\n \"cameraPreview\",\n \"clipboard\",\n \"ebookReader\",\n \"filePicker\",\n \"location\",\n \"mediaPicker\",\n \"notifications\"\n ]\n }\n },\n \"optional\": true\n },\n \"permissions\": {\n \"value\": {\n \"kind\": \"set\",\n \"member\": {\n \"kind\": \"enum\",\n \"values\": [\n \"camera\",\n \"clipboard\",\n \"locationBackground\",\n \"locationForeground\",\n \"mediaLibrary\",\n \"mediaLibraryWrite\",\n \"microphone\",\n \"notifications\"\n ]\n }\n },\n \"optional\": true\n }\n }\n }\n }\n }\n} as const satisfies StructureDescriptorDocument;\n"]}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ankhorage/contracts",
|
|
3
|
-
"version": "22.
|
|
3
|
+
"version": "22.5.0",
|
|
4
4
|
"main": "./dist/index.js",
|
|
5
5
|
"ankh": {
|
|
6
6
|
"category": "contracts",
|
|
@@ -11,6 +11,14 @@
|
|
|
11
11
|
"structure": {
|
|
12
12
|
"output": "src/structure/generated.ts",
|
|
13
13
|
"roots": {
|
|
14
|
+
"auth-flow": {
|
|
15
|
+
"source": "src/auth.ts",
|
|
16
|
+
"export": "AuthFlowConfig"
|
|
17
|
+
},
|
|
18
|
+
"auth-sign-in": {
|
|
19
|
+
"source": "src/types.ts",
|
|
20
|
+
"export": "AuthSignInSpec"
|
|
21
|
+
},
|
|
14
22
|
"screen-metadata": {
|
|
15
23
|
"source": "src/types.ts",
|
|
16
24
|
"export": "ScreenMetadataSpec"
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import { expect, test } from 'bun:test';
|
|
2
|
+
|
|
3
|
+
import { STRUCTURE_DESCRIPTOR } from './structure';
|
|
4
|
+
|
|
5
|
+
test('publishes AuthFlowConfig route semantics from the generated owner document', () => {
|
|
6
|
+
expect(STRUCTURE_DESCRIPTOR.roots['auth-flow']).toBe('AuthFlowConfig');
|
|
7
|
+
expect(STRUCTURE_DESCRIPTOR.descriptors.AuthFlowConfig.descriptor).toEqual({
|
|
8
|
+
kind: 'object',
|
|
9
|
+
fields: {
|
|
10
|
+
forgotPasswordRoute: {
|
|
11
|
+
value: { kind: 'scalar', type: 'string' },
|
|
12
|
+
optional: true,
|
|
13
|
+
},
|
|
14
|
+
otpRoute: {
|
|
15
|
+
value: { kind: 'scalar', type: 'string' },
|
|
16
|
+
optional: true,
|
|
17
|
+
},
|
|
18
|
+
postSignInRoute: {
|
|
19
|
+
value: { kind: 'scalar', type: 'string' },
|
|
20
|
+
},
|
|
21
|
+
signInRoute: {
|
|
22
|
+
value: { kind: 'scalar', type: 'string' },
|
|
23
|
+
},
|
|
24
|
+
signOutRoute: {
|
|
25
|
+
value: { kind: 'scalar', type: 'string' },
|
|
26
|
+
optional: true,
|
|
27
|
+
},
|
|
28
|
+
signUpRoute: {
|
|
29
|
+
value: { kind: 'scalar', type: 'string' },
|
|
30
|
+
optional: true,
|
|
31
|
+
},
|
|
32
|
+
unauthorizedRoute: {
|
|
33
|
+
value: { kind: 'scalar', type: 'string' },
|
|
34
|
+
optional: true,
|
|
35
|
+
},
|
|
36
|
+
},
|
|
37
|
+
});
|
|
38
|
+
});
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { expect, test } from 'bun:test';
|
|
2
|
+
|
|
3
|
+
import { STRUCTURE_DESCRIPTOR } from './structure';
|
|
4
|
+
|
|
5
|
+
test('publishes AuthSignInSpec ordered identifier semantics from the generated owner document', () => {
|
|
6
|
+
expect(STRUCTURE_DESCRIPTOR.roots['auth-sign-in']).toBe('AuthSignInSpec');
|
|
7
|
+
expect(STRUCTURE_DESCRIPTOR.descriptors.AuthSignInSpec.descriptor).toEqual({
|
|
8
|
+
kind: 'object',
|
|
9
|
+
fields: {
|
|
10
|
+
identifiers: {
|
|
11
|
+
value: {
|
|
12
|
+
kind: 'ordered-list',
|
|
13
|
+
item: { kind: 'enum', values: ['email', 'phone', 'username'] },
|
|
14
|
+
},
|
|
15
|
+
},
|
|
16
|
+
},
|
|
17
|
+
});
|
|
18
|
+
});
|
package/src/contracts.test.ts
CHANGED
|
@@ -62,6 +62,14 @@ describe('contracts', () => {
|
|
|
62
62
|
structure: {
|
|
63
63
|
output: 'src/structure/generated.ts',
|
|
64
64
|
roots: {
|
|
65
|
+
'auth-flow': {
|
|
66
|
+
source: 'src/auth.ts',
|
|
67
|
+
export: 'AuthFlowConfig',
|
|
68
|
+
},
|
|
69
|
+
'auth-sign-in': {
|
|
70
|
+
source: 'src/types.ts',
|
|
71
|
+
export: 'AuthSignInSpec',
|
|
72
|
+
},
|
|
65
73
|
'screen-metadata': {
|
|
66
74
|
source: 'src/types.ts',
|
|
67
75
|
export: 'ScreenMetadataSpec',
|
|
@@ -2,17 +2,95 @@
|
|
|
2
2
|
import type { StructureDescriptorDocument } from '@ankhorage/contracts/structure';
|
|
3
3
|
|
|
4
4
|
export const STRUCTURE_DESCRIPTOR_COMPILER_VERSION = '6.0.3';
|
|
5
|
-
export const STRUCTURE_DESCRIPTOR_FINGERPRINT = 'sha256:
|
|
5
|
+
export const STRUCTURE_DESCRIPTOR_FINGERPRINT = 'sha256:8b359ab8886ccde511b1558caf92e99917aaee30860c5130b511595d491614e4';
|
|
6
6
|
|
|
7
7
|
export const STRUCTURE_DESCRIPTOR = {
|
|
8
8
|
"protocolVersion": 1,
|
|
9
9
|
"packageName": "@ankhorage/contracts",
|
|
10
|
-
"packageVersion": "22.
|
|
10
|
+
"packageVersion": "22.5.0",
|
|
11
11
|
"roots": {
|
|
12
|
+
"auth-flow": "AuthFlowConfig",
|
|
13
|
+
"auth-sign-in": "AuthSignInSpec",
|
|
12
14
|
"screen-metadata": "ScreenMetadataSpec",
|
|
13
15
|
"screen-requirements": "ScreenRequirements"
|
|
14
16
|
},
|
|
15
17
|
"descriptors": {
|
|
18
|
+
"AuthFlowConfig": {
|
|
19
|
+
"id": "AuthFlowConfig",
|
|
20
|
+
"descriptor": {
|
|
21
|
+
"kind": "object",
|
|
22
|
+
"fields": {
|
|
23
|
+
"forgotPasswordRoute": {
|
|
24
|
+
"value": {
|
|
25
|
+
"kind": "scalar",
|
|
26
|
+
"type": "string"
|
|
27
|
+
},
|
|
28
|
+
"optional": true
|
|
29
|
+
},
|
|
30
|
+
"otpRoute": {
|
|
31
|
+
"value": {
|
|
32
|
+
"kind": "scalar",
|
|
33
|
+
"type": "string"
|
|
34
|
+
},
|
|
35
|
+
"optional": true
|
|
36
|
+
},
|
|
37
|
+
"postSignInRoute": {
|
|
38
|
+
"value": {
|
|
39
|
+
"kind": "scalar",
|
|
40
|
+
"type": "string"
|
|
41
|
+
}
|
|
42
|
+
},
|
|
43
|
+
"signInRoute": {
|
|
44
|
+
"value": {
|
|
45
|
+
"kind": "scalar",
|
|
46
|
+
"type": "string"
|
|
47
|
+
}
|
|
48
|
+
},
|
|
49
|
+
"signOutRoute": {
|
|
50
|
+
"value": {
|
|
51
|
+
"kind": "scalar",
|
|
52
|
+
"type": "string"
|
|
53
|
+
},
|
|
54
|
+
"optional": true
|
|
55
|
+
},
|
|
56
|
+
"signUpRoute": {
|
|
57
|
+
"value": {
|
|
58
|
+
"kind": "scalar",
|
|
59
|
+
"type": "string"
|
|
60
|
+
},
|
|
61
|
+
"optional": true
|
|
62
|
+
},
|
|
63
|
+
"unauthorizedRoute": {
|
|
64
|
+
"value": {
|
|
65
|
+
"kind": "scalar",
|
|
66
|
+
"type": "string"
|
|
67
|
+
},
|
|
68
|
+
"optional": true
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
},
|
|
73
|
+
"AuthSignInSpec": {
|
|
74
|
+
"id": "AuthSignInSpec",
|
|
75
|
+
"descriptor": {
|
|
76
|
+
"kind": "object",
|
|
77
|
+
"fields": {
|
|
78
|
+
"identifiers": {
|
|
79
|
+
"value": {
|
|
80
|
+
"kind": "ordered-list",
|
|
81
|
+
"item": {
|
|
82
|
+
"kind": "enum",
|
|
83
|
+
"values": [
|
|
84
|
+
"email",
|
|
85
|
+
"phone",
|
|
86
|
+
"username"
|
|
87
|
+
]
|
|
88
|
+
}
|
|
89
|
+
}
|
|
90
|
+
}
|
|
91
|
+
}
|
|
92
|
+
}
|
|
93
|
+
},
|
|
16
94
|
"ScreenMetadataSpec": {
|
|
17
95
|
"id": "ScreenMetadataSpec",
|
|
18
96
|
"descriptor": {
|