shortcutkit 0.7.0 → 1.0.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/README.md +88 -183
- package/dist/generated/actions.d.ts +17230 -1567
- package/dist/generated/params.d.ts +99 -83
- package/dist/index.d.ts +65 -29
- package/dist/index.js +3164 -248
- package/dist/values.d.ts +16 -5
- package/package.json +8 -4
package/dist/values.d.ts
CHANGED
|
@@ -1,8 +1,15 @@
|
|
|
1
1
|
import type { PlistValue } from "./plist.js";
|
|
2
|
-
|
|
2
|
+
/** The variable kinds a reference can name, as the engine spells them. */
|
|
3
|
+
export type VariableType = "ActionOutput" | "ExtensionInput" | "Variable" | "Clipboard" | "CurrentDate" | "Ask" | "DeviceDetails" | "CurrentApp";
|
|
4
|
+
/** A run-time reference. Each helper returns the narrow type (ref() an Attachment<"ActionOutput">), so a key the
|
|
5
|
+
* engine reads only some references for (PARAM_VARIABLE_TYPES) can say which at compile time. */
|
|
6
|
+
export type Attachment<T extends VariableType = VariableType> = {
|
|
3
7
|
WFSerializationType: "WFTextTokenAttachment";
|
|
4
|
-
Value:
|
|
8
|
+
Value: {
|
|
9
|
+
Type: T;
|
|
10
|
+
} & Record<string, PlistValue>;
|
|
5
11
|
};
|
|
12
|
+
export type AskAttachment = Attachment<"Ask">;
|
|
6
13
|
export type TokenString = {
|
|
7
14
|
WFSerializationType: "WFTextTokenString";
|
|
8
15
|
Value: {
|
|
@@ -10,10 +17,13 @@ export type TokenString = {
|
|
|
10
17
|
attachmentsByRange: Record<string, Record<string, PlistValue>>;
|
|
11
18
|
};
|
|
12
19
|
};
|
|
13
|
-
|
|
20
|
+
/** The subject of an If condition (`WFInput` on `is.workflow.actions.conditional`): an attachment wrapped as the app writes it. Not the variable-picker form, which is the bare attachment. */
|
|
21
|
+
export type ConditionSubject = {
|
|
14
22
|
Type: "Variable";
|
|
15
23
|
Variable: Attachment;
|
|
16
24
|
};
|
|
25
|
+
/** @deprecated Misnamed: this is the If-subject form. Variable-picker parameters take a bare `Attachment`. */
|
|
26
|
+
export type Picker = ConditionSubject;
|
|
17
27
|
export type DictionaryValue = {
|
|
18
28
|
WFSerializationType: "WFDictionaryFieldValue";
|
|
19
29
|
Value: {
|
|
@@ -45,7 +55,7 @@ export type FilterTemplateValue = {
|
|
|
45
55
|
}>;
|
|
46
56
|
};
|
|
47
57
|
};
|
|
48
|
-
export type Value = PlistValue | Attachment | TokenString |
|
|
58
|
+
export type Value = PlistValue | Attachment | TokenString | ConditionSubject | DictionaryValue | QuantityValue | FilterTemplateValue;
|
|
49
59
|
/** Keeps literal suggestions in editors while still accepting any string. */
|
|
50
60
|
export type Loose<T extends string> = T | (string & {});
|
|
51
61
|
export type BoolValue = boolean | Attachment;
|
|
@@ -53,7 +63,8 @@ export type NumberValue = number | Attachment;
|
|
|
53
63
|
export type StringValue = string | Attachment;
|
|
54
64
|
export type EnumValue<T extends string> = Loose<T> | Attachment;
|
|
55
65
|
export type TextValue = string | TokenString | Attachment;
|
|
56
|
-
export type PickerValue =
|
|
66
|
+
export type PickerValue = Attachment;
|
|
67
|
+
export type SubjectValue = ConditionSubject | Attachment;
|
|
57
68
|
export type PlainString = string;
|
|
58
69
|
export type PlainNumber = number;
|
|
59
70
|
export type AnyValue = Value;
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "shortcutkit",
|
|
3
|
-
"version": "0.
|
|
4
|
-
"description": "Build, validate and sign Apple Shortcuts files.
|
|
3
|
+
"version": "1.0.0",
|
|
4
|
+
"description": "Build, validate, and sign Apple Shortcuts files from TypeScript. All 434 built-in actions and 1,449 Apple app actions typed, extracted from the Shortcuts engine.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/index.js",
|
|
7
7
|
"types": "./dist/index.d.ts",
|
|
@@ -24,7 +24,8 @@
|
|
|
24
24
|
"demo": "bun run src/cli.ts demo",
|
|
25
25
|
"extract": "./tools/extract-builtin-actions.sh",
|
|
26
26
|
"diff-data": "python3 tools/diff-data.py",
|
|
27
|
-
"changelog": "python3 tools/diff-data.py --changelog"
|
|
27
|
+
"changelog": "python3 tools/diff-data.py --changelog",
|
|
28
|
+
"verify": "./test/verify/run.sh"
|
|
28
29
|
},
|
|
29
30
|
"devDependencies": {
|
|
30
31
|
"@types/bun": "^1.4",
|
|
@@ -34,9 +35,12 @@
|
|
|
34
35
|
"author": "frontboat",
|
|
35
36
|
"repository": {
|
|
36
37
|
"type": "git",
|
|
37
|
-
"url": "https://github.com/frontboat/shortcutkit"
|
|
38
|
+
"url": "git+https://github.com/frontboat/shortcutkit.git"
|
|
38
39
|
},
|
|
39
40
|
"homepage": "https://github.com/frontboat/shortcutkit#readme",
|
|
41
|
+
"bugs": {
|
|
42
|
+
"url": "https://github.com/frontboat/shortcutkit/issues"
|
|
43
|
+
},
|
|
40
44
|
"keywords": [
|
|
41
45
|
"apple",
|
|
42
46
|
"apple-shortcuts",
|