sanity-plugin-workflow 2.0.2 → 2.1.1
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/index.d.ts +8 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +314 -249
- package/dist/index.js.map +1 -1
- package/package.json +3 -3
package/dist/index.d.ts
CHANGED
|
@@ -8,10 +8,17 @@ type State = {
|
|
|
8
8
|
requireValidation?: boolean;
|
|
9
9
|
color?: 'primary' | 'success' | 'warning' | 'danger';
|
|
10
10
|
};
|
|
11
|
+
type StateCheck<Id, States> = {
|
|
12
|
+
id: Id;
|
|
13
|
+
transitions?: States extends {
|
|
14
|
+
id: infer Id2;
|
|
15
|
+
}[] ? Id2[] : never;
|
|
16
|
+
} & State;
|
|
11
17
|
type WorkflowConfig = {
|
|
12
18
|
schemaTypes: string[];
|
|
13
19
|
states?: State[];
|
|
14
20
|
};
|
|
21
|
+
declare function defineStates<Id extends string, States extends StateCheck<Id, States>[]>(states: States): States;
|
|
15
22
|
declare const workflow: Plugin<WorkflowConfig>;
|
|
16
|
-
export { workflow };
|
|
23
|
+
export { defineStates, workflow };
|
|
17
24
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","names":["SanityDocumentLike","State","StateCheck","Id","States","Id2","WorkflowConfig","defineStates","User","DragData","Metadata","KeyedMetadata","SanityDocumentWithMetadata","Plugin","WorkflowConfig","workflow"],"sources":["../src/types/index.d.ts","../src/
|
|
1
|
+
{"version":3,"file":"index.d.ts","names":["SanityDocumentLike","State","StateCheck","Id","States","Id2","WorkflowConfig","defineStates","User","DragData","Metadata","KeyedMetadata","SanityDocumentWithMetadata","Plugin","WorkflowConfig","workflow"],"sources":["../src/types/index.d.ts","../src/plugin.d.ts"],"sourcesContent":["import type { SanityDocumentLike } from 'sanity';\nexport type State = {\n id: string;\n transitions: string[];\n title: string;\n roles?: string[];\n requireAssignment?: boolean;\n requireValidation?: boolean;\n color?: 'primary' | 'success' | 'warning' | 'danger';\n};\nexport type StateCheck<Id, States> = {\n id: Id;\n transitions?: States extends {\n id: infer Id2;\n }[] ? Id2[] : never;\n} & State;\nexport type WorkflowConfig = {\n schemaTypes: string[];\n states?: State[];\n};\nexport declare function defineStates<Id extends string, States extends StateCheck<Id, States>[]>(states: States): States;\nexport type User = {\n createdAt: string;\n displayName: string;\n email: string;\n familyName: string;\n givenName: string;\n id: string;\n imageUrl: string;\n isCurrentUser: boolean;\n middleName: string;\n projectId: string;\n provider: string;\n sanityUserId: string;\n updatedAt: string;\n};\nexport type DragData = {\n documentId?: string;\n x?: number;\n y?: number;\n state?: string;\n};\nexport type Metadata = SanityDocumentLike & {\n _rev: string;\n assignees: string[];\n documentId: string;\n state: string;\n orderRank: string;\n};\nexport type KeyedMetadata = {\n [key: string]: Metadata;\n};\nexport type SanityDocumentWithMetadata = {\n _metadata: Metadata;\n _id: string;\n _type: string;\n _rev: string;\n _updatedAt: string;\n};\n//# sourceMappingURL=index.d.ts.map","import { type Plugin } from 'sanity';\nimport type { WorkflowConfig } from './types';\nexport declare const workflow: Plugin<WorkflowConfig>;\n//# sourceMappingURL=plugin.d.ts.map"],"mappings":";KACYC,KAAAA;EAAAA,EAAAA,EAAAA,MAAK;EASLC,WAAAA,EAAU,MAAAC,EAAAA;EACdA,KAAAA,EAAAA,MAAAA;EACUC,KAAAA,CAAAA,EAAAA,MAAAA,EAAAA;EAERC,iBAAAA,CAAAA,EAAAA,OAAAA;EACNJ,iBAAAA,CAAAA,EAAAA,OAAAA;EAAK,KAAA,CAAA,EAAA,SAAA,GAAA,SAAA,GAAA,SAAA,GAAA,QAAA;AACT,CAAA;AAIwBM,KAVZL,UAUwB,CAAA,EAAAC,EAAAA,MAAAC,CAAAA,GAAAA;EAA8CD,EAAAA,EAT1EA,EAS0EA;EAAIC,WAAAA,CAAAA,EARpEA,MAQoEA,SAAAA;IAAfF,EAAAA,EAAAA,KAAAA,IAAAA;EAAkCE,CAAAA,EAAAA,GAN/FC,GAM+FD,EAAAA,GAAAA,KAAAA;CAASA,GAL9GH,KAK8GG;AAAM,KAJ5GE,cAAAA,GAI4G;;EClBnGS,MAAAA,CAAAA,EDgBRd,KChBwC,EAAA;;iBDkB7BM,+CAA+CL,WAAWC,IAAIC,mBAAmBA,SAASA;AAnBtGH,cCCSc,QDDJ,ECCcF,MDDd,CCCqBC,cDDrB,CAAA"}
|