@vostride/agent-qa-ids 0.3.4 → 0.3.5
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.cjs +4 -1
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +4 -1
- package/dist/index.js.map +1 -1
- package/package.json +2 -2
package/dist/index.cjs
CHANGED
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
|
|
2
|
+
!function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{},n=(new e.Error).stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="eab52f97-47d0-5f42-9058-41ee675bdc55")}catch(e){}}();
|
|
1
3
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
4
|
let id_agent = require("id-agent");
|
|
3
5
|
// src/persistent-id.ts
|
|
@@ -90,4 +92,5 @@ exports.isCanonicalSuiteId = isCanonicalSuiteId;
|
|
|
90
92
|
exports.isCanonicalTestId = isCanonicalTestId;
|
|
91
93
|
exports.isObservationId = isObservationId;
|
|
92
94
|
|
|
93
|
-
//# sourceMappingURL=index.cjs.map
|
|
95
|
+
//# sourceMappingURL=index.cjs.map
|
|
96
|
+
//# debugId=eab52f97-47d0-5f42-9058-41ee675bdc55
|
package/dist/index.cjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.cjs","
|
|
1
|
+
{"version":3,"file":"index.cjs","sources":["../src/persistent-id.ts"],"sourcesContent":["import { idAgent, parse } from 'id-agent'\n\nexport const CANONICAL_ID_WORDS = 10\n\nconst PREFIX = {\n test: 't',\n suite: 's',\n hook: 'h',\n observation: 'obs',\n run: 'r',\n} as const\n\ntype Prefix = (typeof PREFIX)[keyof typeof PREFIX]\nexport type EntityIdType = keyof typeof PREFIX\n\nexport const ENTITY_ID_TYPES = Object.keys(PREFIX) as EntityIdType[]\n\nexport interface EntityIdContract {\n type: EntityIdType\n prefix: Prefix\n prefixWithSeparator: `${Prefix}_`\n words: number\n examplePattern: string\n}\n\nfunction hasPrefixAndWordCount(value: string, prefix: Prefix, wordCount: number): boolean {\n const parsed = parse(value)\n return parsed?.prefix === prefix && parsed.wordCount === wordCount\n}\n\nfunction generateId(prefix: Prefix): string {\n return idAgent({ prefix, words: CANONICAL_ID_WORDS })\n}\n\nexport function generateTestId(): string {\n return generateId(PREFIX.test)\n}\n\nexport function generateSuiteId(): string {\n return generateId(PREFIX.suite)\n}\n\nexport function generateObservationId(): string {\n return generateId(PREFIX.observation)\n}\n\nexport function generateHookId(): string {\n return generateId(PREFIX.hook)\n}\n\nexport function generateRunId(): string {\n return generateId(PREFIX.run)\n}\n\nexport function generateCanonicalId(type: EntityIdType): string {\n return generateId(PREFIX[type])\n}\n\nexport function isCanonicalTestId(value: string): boolean {\n return hasPrefixAndWordCount(value, PREFIX.test, CANONICAL_ID_WORDS)\n}\n\nexport function isCanonicalSuiteId(value: string): boolean {\n return hasPrefixAndWordCount(value, PREFIX.suite, CANONICAL_ID_WORDS)\n}\n\nexport function isCanonicalHookId(value: string): boolean {\n return hasPrefixAndWordCount(value, PREFIX.hook, CANONICAL_ID_WORDS)\n}\n\nexport function isCanonicalObservationId(value: string): boolean {\n return hasPrefixAndWordCount(value, PREFIX.observation, CANONICAL_ID_WORDS)\n}\n\nexport function isCanonicalRunId(value: string): boolean {\n return hasPrefixAndWordCount(value, PREFIX.run, CANONICAL_ID_WORDS)\n}\n\nexport function isCanonicalId(type: EntityIdType, value: string): boolean {\n return hasPrefixAndWordCount(value, PREFIX[type], CANONICAL_ID_WORDS)\n}\n\nexport function isObservationId(value: string): boolean {\n return isCanonicalObservationId(value)\n}\n\nexport function getEntityIdContract(type: EntityIdType): EntityIdContract {\n const prefix = PREFIX[type]\n return {\n type,\n prefix,\n prefixWithSeparator: `${prefix}_`,\n words: CANONICAL_ID_WORDS,\n examplePattern: `${prefix}_word-word-word-word-word-word-word-word-word-word`,\n }\n}\n\nexport function getEntityIdContracts(): EntityIdContract[] {\n return ENTITY_ID_TYPES.map(type => getEntityIdContract(type))\n}\n"],"names":["parse","idAgent"],"mappings":";;;;;AAEA,MAAa,qBAAqB;AAElC,MAAM,SAAS;CACb,MAAM;CACN,OAAO;CACP,MAAM;CACN,aAAa;CACb,KAAK;AACP;AAKA,MAAa,kBAAkB,OAAO,KAAK,MAAM;AAUjD,SAAS,sBAAsB,OAAe,QAAgB,WAA4B;CACxF,MAAM,UAAA,GAASA,SAAAA,MAAAA,CAAM,KAAK;CAC1B,OAAO,QAAQ,WAAW,UAAU,OAAO,cAAc;AAC3D;AAEA,SAAS,WAAW,QAAwB;CAC1C,QAAA,GAAOC,SAAAA,QAAAA,CAAQ;EAAE;EAAQ,OAAA;CAA0B,CAAC;AACtD;AAEA,SAAgB,iBAAyB;CACvC,OAAO,WAAW,OAAO,IAAI;AAC/B;AAEA,SAAgB,kBAA0B;CACxC,OAAO,WAAW,OAAO,KAAK;AAChC;AAEA,SAAgB,wBAAgC;CAC9C,OAAO,WAAW,OAAO,WAAW;AACtC;AAEA,SAAgB,iBAAyB;CACvC,OAAO,WAAW,OAAO,IAAI;AAC/B;AAEA,SAAgB,gBAAwB;CACtC,OAAO,WAAW,OAAO,GAAG;AAC9B;AAEA,SAAgB,oBAAoB,MAA4B;CAC9D,OAAO,WAAW,OAAO,KAAK;AAChC;AAEA,SAAgB,kBAAkB,OAAwB;CACxD,OAAO,sBAAsB,OAAO,OAAO,MAAA,EAAwB;AACrE;AAEA,SAAgB,mBAAmB,OAAwB;CACzD,OAAO,sBAAsB,OAAO,OAAO,OAAA,EAAyB;AACtE;AAEA,SAAgB,kBAAkB,OAAwB;CACxD,OAAO,sBAAsB,OAAO,OAAO,MAAA,EAAwB;AACrE;AAEA,SAAgB,yBAAyB,OAAwB;CAC/D,OAAO,sBAAsB,OAAO,OAAO,aAAA,EAA+B;AAC5E;AAEA,SAAgB,iBAAiB,OAAwB;CACvD,OAAO,sBAAsB,OAAO,OAAO,KAAA,EAAuB;AACpE;AAEA,SAAgB,cAAc,MAAoB,OAAwB;CACxE,OAAO,sBAAsB,OAAO,OAAO,OAAA,EAAyB;AACtE;AAEA,SAAgB,gBAAgB,OAAwB;CACtD,OAAO,yBAAyB,KAAK;AACvC;AAEA,SAAgB,oBAAoB,MAAsC;CACxE,MAAM,SAAS,OAAO;CACtB,OAAO;EACL;EACA;EACA,qBAAqB,GAAG,OAAO;EAC/B,OAAA;EACA,gBAAgB,GAAG,OAAO;CAC5B;AACF;AAEA,SAAgB,uBAA2C;CACzD,OAAO,gBAAgB,KAAI,SAAQ,oBAAoB,IAAI,CAAC;AAC9D","debugId":"eab52f97-47d0-5f42-9058-41ee675bdc55"}
|
package/dist/index.js
CHANGED
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
|
|
2
|
+
!function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{},n=(new e.Error).stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="1dafd7ac-f95e-5b84-98c1-e7f2d83983ef")}catch(e){}}();
|
|
1
3
|
import { idAgent, parse } from "id-agent";
|
|
2
4
|
// src/persistent-id.ts
|
|
3
5
|
const CANONICAL_ID_WORDS = 10;
|
|
@@ -73,4 +75,5 @@ function getEntityIdContracts() {
|
|
|
73
75
|
}
|
|
74
76
|
export { CANONICAL_ID_WORDS, ENTITY_ID_TYPES, generateCanonicalId, generateHookId, generateObservationId, generateRunId, generateSuiteId, generateTestId, getEntityIdContract, getEntityIdContracts, isCanonicalHookId, isCanonicalId, isCanonicalObservationId, isCanonicalRunId, isCanonicalSuiteId, isCanonicalTestId, isObservationId };
|
|
75
77
|
|
|
76
|
-
//# sourceMappingURL=index.js.map
|
|
78
|
+
//# sourceMappingURL=index.js.map
|
|
79
|
+
//# debugId=1dafd7ac-f95e-5b84-98c1-e7f2d83983ef
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","
|
|
1
|
+
{"version":3,"file":"index.js","sources":["../src/persistent-id.ts"],"sourcesContent":["import { idAgent, parse } from 'id-agent'\n\nexport const CANONICAL_ID_WORDS = 10\n\nconst PREFIX = {\n test: 't',\n suite: 's',\n hook: 'h',\n observation: 'obs',\n run: 'r',\n} as const\n\ntype Prefix = (typeof PREFIX)[keyof typeof PREFIX]\nexport type EntityIdType = keyof typeof PREFIX\n\nexport const ENTITY_ID_TYPES = Object.keys(PREFIX) as EntityIdType[]\n\nexport interface EntityIdContract {\n type: EntityIdType\n prefix: Prefix\n prefixWithSeparator: `${Prefix}_`\n words: number\n examplePattern: string\n}\n\nfunction hasPrefixAndWordCount(value: string, prefix: Prefix, wordCount: number): boolean {\n const parsed = parse(value)\n return parsed?.prefix === prefix && parsed.wordCount === wordCount\n}\n\nfunction generateId(prefix: Prefix): string {\n return idAgent({ prefix, words: CANONICAL_ID_WORDS })\n}\n\nexport function generateTestId(): string {\n return generateId(PREFIX.test)\n}\n\nexport function generateSuiteId(): string {\n return generateId(PREFIX.suite)\n}\n\nexport function generateObservationId(): string {\n return generateId(PREFIX.observation)\n}\n\nexport function generateHookId(): string {\n return generateId(PREFIX.hook)\n}\n\nexport function generateRunId(): string {\n return generateId(PREFIX.run)\n}\n\nexport function generateCanonicalId(type: EntityIdType): string {\n return generateId(PREFIX[type])\n}\n\nexport function isCanonicalTestId(value: string): boolean {\n return hasPrefixAndWordCount(value, PREFIX.test, CANONICAL_ID_WORDS)\n}\n\nexport function isCanonicalSuiteId(value: string): boolean {\n return hasPrefixAndWordCount(value, PREFIX.suite, CANONICAL_ID_WORDS)\n}\n\nexport function isCanonicalHookId(value: string): boolean {\n return hasPrefixAndWordCount(value, PREFIX.hook, CANONICAL_ID_WORDS)\n}\n\nexport function isCanonicalObservationId(value: string): boolean {\n return hasPrefixAndWordCount(value, PREFIX.observation, CANONICAL_ID_WORDS)\n}\n\nexport function isCanonicalRunId(value: string): boolean {\n return hasPrefixAndWordCount(value, PREFIX.run, CANONICAL_ID_WORDS)\n}\n\nexport function isCanonicalId(type: EntityIdType, value: string): boolean {\n return hasPrefixAndWordCount(value, PREFIX[type], CANONICAL_ID_WORDS)\n}\n\nexport function isObservationId(value: string): boolean {\n return isCanonicalObservationId(value)\n}\n\nexport function getEntityIdContract(type: EntityIdType): EntityIdContract {\n const prefix = PREFIX[type]\n return {\n type,\n prefix,\n prefixWithSeparator: `${prefix}_`,\n words: CANONICAL_ID_WORDS,\n examplePattern: `${prefix}_word-word-word-word-word-word-word-word-word-word`,\n }\n}\n\nexport function getEntityIdContracts(): EntityIdContract[] {\n return ENTITY_ID_TYPES.map(type => getEntityIdContract(type))\n}\n"],"names":[],"mappings":";;;;AAEA,MAAa,qBAAqB;AAElC,MAAM,SAAS;CACb,MAAM;CACN,OAAO;CACP,MAAM;CACN,aAAa;CACb,KAAK;AACP;AAKA,MAAa,kBAAkB,OAAO,KAAK,MAAM;AAUjD,SAAS,sBAAsB,OAAe,QAAgB,WAA4B;CACxF,MAAM,SAAS,MAAM,KAAK;CAC1B,OAAO,QAAQ,WAAW,UAAU,OAAO,cAAc;AAC3D;AAEA,SAAS,WAAW,QAAwB;CAC1C,OAAO,QAAQ;EAAE;EAAQ,OAAA;CAA0B,CAAC;AACtD;AAEA,SAAgB,iBAAyB;CACvC,OAAO,WAAW,OAAO,IAAI;AAC/B;AAEA,SAAgB,kBAA0B;CACxC,OAAO,WAAW,OAAO,KAAK;AAChC;AAEA,SAAgB,wBAAgC;CAC9C,OAAO,WAAW,OAAO,WAAW;AACtC;AAEA,SAAgB,iBAAyB;CACvC,OAAO,WAAW,OAAO,IAAI;AAC/B;AAEA,SAAgB,gBAAwB;CACtC,OAAO,WAAW,OAAO,GAAG;AAC9B;AAEA,SAAgB,oBAAoB,MAA4B;CAC9D,OAAO,WAAW,OAAO,KAAK;AAChC;AAEA,SAAgB,kBAAkB,OAAwB;CACxD,OAAO,sBAAsB,OAAO,OAAO,MAAA,EAAwB;AACrE;AAEA,SAAgB,mBAAmB,OAAwB;CACzD,OAAO,sBAAsB,OAAO,OAAO,OAAA,EAAyB;AACtE;AAEA,SAAgB,kBAAkB,OAAwB;CACxD,OAAO,sBAAsB,OAAO,OAAO,MAAA,EAAwB;AACrE;AAEA,SAAgB,yBAAyB,OAAwB;CAC/D,OAAO,sBAAsB,OAAO,OAAO,aAAA,EAA+B;AAC5E;AAEA,SAAgB,iBAAiB,OAAwB;CACvD,OAAO,sBAAsB,OAAO,OAAO,KAAA,EAAuB;AACpE;AAEA,SAAgB,cAAc,MAAoB,OAAwB;CACxE,OAAO,sBAAsB,OAAO,OAAO,OAAA,EAAyB;AACtE;AAEA,SAAgB,gBAAgB,OAAwB;CACtD,OAAO,yBAAyB,KAAK;AACvC;AAEA,SAAgB,oBAAoB,MAAsC;CACxE,MAAM,SAAS,OAAO;CACtB,OAAO;EACL;EACA;EACA,qBAAqB,GAAG,OAAO;EAC/B,OAAA;EACA,gBAAgB,GAAG,OAAO;CAC5B;AACF;AAEA,SAAgB,uBAA2C;CACzD,OAAO,gBAAgB,KAAI,SAAQ,oBAAoB,IAAI,CAAC;AAC9D","debugId":"1dafd7ac-f95e-5b84-98c1-e7f2d83983ef"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@vostride/agent-qa-ids",
|
|
3
|
-
"version": "0.3.
|
|
3
|
+
"version": "0.3.5",
|
|
4
4
|
"private": false,
|
|
5
5
|
"description": "Canonical ID helpers for agent-qa tests, suites, hooks, and artifacts.",
|
|
6
6
|
"keywords": [
|
|
@@ -56,7 +56,7 @@
|
|
|
56
56
|
},
|
|
57
57
|
"devDependencies": {
|
|
58
58
|
"@types/node": "~24.19.2",
|
|
59
|
-
"@vostride/agent-qa-arch": "0.3.
|
|
59
|
+
"@vostride/agent-qa-arch": "0.3.5",
|
|
60
60
|
"tsdown": "~0.23.4",
|
|
61
61
|
"typescript": "~7.0.2",
|
|
62
62
|
"vitest": "~5.0.5"
|