@ancha-labs/cli 0.4.40 → 0.4.42
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/lib/ancha.mjs +10332 -8963
- package/lib/assets/SKILL.md +4 -1
- package/lib/assets/agents-section.md +4 -1
- package/lib/assets/data/pellmont/pellmont-approved-merge.yaml +75 -0
- package/lib/assets/data/pellmont/pellmont-building-services.yaml +1704 -0
- package/lib/assets/data/pellmont/pellmont-duplicates.yaml +21 -0
- package/lib/assets/docs/cloud.md +26 -9
- package/lib/assets/docs/run.md +1 -1
- package/lib/assets/docs/scenes.md +17 -0
- package/lib/assets/docs/setup.md +4 -1
- package/lib/assets/harbor/companion.mjs +3338 -3116
- package/lib/assets/ui/app.js +27 -8
- package/lib/mcp-entry.mjs +370 -339
- package/lib/worker.mjs +4073 -3621
- package/lib/world-server.mjs +3120 -3089
- package/package.json +1 -1
package/lib/mcp-entry.mjs
CHANGED
|
@@ -11044,56 +11044,56 @@ var $ZodObjectJIT = /* @__PURE__ */ $constructor("$ZodObjectJIT", (inst, def) =>
|
|
|
11044
11044
|
const syms = normalized.symbolKeys;
|
|
11045
11045
|
const doc = new Doc(["payload", "ctx"], { shape, inst, memo: memo4, syms });
|
|
11046
11046
|
const parseStr = (k) => `shape[${k}]._zod.run({ value: input[${k}], issues: [] }, ctx)`;
|
|
11047
|
-
const prefixStr = (
|
|
11048
|
-
let ${
|
|
11049
|
-
for (let i = 0; i < ${
|
|
11050
|
-
const iss = ${
|
|
11047
|
+
const prefixStr = (id11, k) => `
|
|
11048
|
+
let ${id11}_ab = false;
|
|
11049
|
+
for (let i = 0; i < ${id11}.issues.length; i++) {
|
|
11050
|
+
const iss = ${id11}.issues[i];
|
|
11051
11051
|
iss.path = iss.path ? [${k}, ...iss.path] : [${k}];
|
|
11052
11052
|
payload.issues.push(iss);
|
|
11053
|
-
if (iss.continue !== true) ${
|
|
11053
|
+
if (iss.continue !== true) ${id11}_ab = true;
|
|
11054
11054
|
}
|
|
11055
|
-
if (${
|
|
11055
|
+
if (${id11}_ab && ctx && ctx.abortEarly) {
|
|
11056
11056
|
payload.value = newResult;
|
|
11057
11057
|
return payload;
|
|
11058
11058
|
}`;
|
|
11059
11059
|
doc.write(`const input = payload.value;`);
|
|
11060
|
-
const
|
|
11060
|
+
const ids2 = /* @__PURE__ */ Object.create(null);
|
|
11061
11061
|
let counter = 0;
|
|
11062
11062
|
for (const key2 of normalized.allKeys) {
|
|
11063
|
-
|
|
11063
|
+
ids2[key2] = `key_${counter++}`;
|
|
11064
11064
|
}
|
|
11065
11065
|
doc.write(memo4 ? `const newResult = memo.alloc(inst, payload, {}, ctx);` : `const newResult = {};`);
|
|
11066
11066
|
for (const key2 of normalized.allKeys) {
|
|
11067
11067
|
if (key2 === "__proto__")
|
|
11068
11068
|
continue;
|
|
11069
|
-
const
|
|
11069
|
+
const id11 = ids2[key2];
|
|
11070
11070
|
const k = typeof key2 === "symbol" ? `syms[${syms.indexOf(key2)}]` : esc(key2);
|
|
11071
11071
|
const isPresent = `${k} in input`;
|
|
11072
11072
|
const schema = shape[key2];
|
|
11073
11073
|
const optin = schema?._zod?.optin;
|
|
11074
11074
|
const isOptionalIn = optin !== void 0;
|
|
11075
11075
|
const isOptionalOut = schema?._zod?.optout === "optional";
|
|
11076
|
-
doc.write(`const ${
|
|
11076
|
+
doc.write(`const ${id11} = ${parseStr(k)};`);
|
|
11077
11077
|
if (isOptionalIn && isOptionalOut) {
|
|
11078
|
-
const assign = optin === "optional" ? `${
|
|
11078
|
+
const assign = optin === "optional" ? `${id11}_present` : `${id11}.value !== undefined || ${id11}_present`;
|
|
11079
11079
|
doc.write(`
|
|
11080
|
-
const ${
|
|
11081
|
-
if (!${
|
|
11082
|
-
if (${
|
|
11080
|
+
const ${id11}_present = ${isPresent};
|
|
11081
|
+
if (!${id11}.issues.length || ${id11}_present) {
|
|
11082
|
+
if (${id11}.issues.length) {${prefixStr(id11, k)}
|
|
11083
11083
|
}
|
|
11084
11084
|
|
|
11085
11085
|
if (${assign}) {
|
|
11086
|
-
newResult[${k}] = ${
|
|
11086
|
+
newResult[${k}] = ${id11}.value;
|
|
11087
11087
|
}
|
|
11088
11088
|
}
|
|
11089
11089
|
|
|
11090
11090
|
`);
|
|
11091
11091
|
} else if (!isOptionalIn) {
|
|
11092
11092
|
doc.write(`
|
|
11093
|
-
const ${
|
|
11094
|
-
if (${
|
|
11093
|
+
const ${id11}_present = ${isPresent};
|
|
11094
|
+
if (${id11}.issues.length) {${prefixStr(id11, k)}
|
|
11095
11095
|
}
|
|
11096
|
-
if (!${
|
|
11096
|
+
if (!${id11}_present && !${id11}.issues.length) {
|
|
11097
11097
|
payload.issues.push({
|
|
11098
11098
|
code: "invalid_type",
|
|
11099
11099
|
expected: "nonoptional",
|
|
@@ -11106,22 +11106,22 @@ var $ZodObjectJIT = /* @__PURE__ */ $constructor("$ZodObjectJIT", (inst, def) =>
|
|
|
11106
11106
|
}
|
|
11107
11107
|
}
|
|
11108
11108
|
|
|
11109
|
-
if (${
|
|
11110
|
-
newResult[${k}] = ${
|
|
11109
|
+
if (${id11}_present) {
|
|
11110
|
+
newResult[${k}] = ${id11}.value;
|
|
11111
11111
|
}
|
|
11112
11112
|
|
|
11113
11113
|
`);
|
|
11114
11114
|
} else {
|
|
11115
11115
|
doc.write(`
|
|
11116
|
-
if (${
|
|
11116
|
+
if (${id11}.issues.length) {${prefixStr(id11, k)}
|
|
11117
11117
|
}
|
|
11118
11118
|
`);
|
|
11119
11119
|
if (optin === "defaulted") {
|
|
11120
|
-
doc.write(`newResult[${k}] = ${
|
|
11120
|
+
doc.write(`newResult[${k}] = ${id11}.value;`);
|
|
11121
11121
|
} else {
|
|
11122
11122
|
doc.write(`
|
|
11123
|
-
if (${
|
|
11124
|
-
newResult[${k}] = ${
|
|
11123
|
+
if (${id11}.value !== undefined || ${isPresent}) {
|
|
11124
|
+
newResult[${k}] = ${id11}.value;
|
|
11125
11125
|
}
|
|
11126
11126
|
`);
|
|
11127
11127
|
}
|
|
@@ -23149,26 +23149,26 @@ function extractDefs(ctx, schema) {
|
|
|
23149
23149
|
return;
|
|
23150
23150
|
const idToSchema = /* @__PURE__ */ new Map();
|
|
23151
23151
|
for (const entry2 of ctx.seen.entries()) {
|
|
23152
|
-
const
|
|
23153
|
-
if (
|
|
23154
|
-
const existing = idToSchema.get(
|
|
23152
|
+
const id11 = ctx.metadataRegistry.get(entry2[0])?.id;
|
|
23153
|
+
if (id11) {
|
|
23154
|
+
const existing = idToSchema.get(id11);
|
|
23155
23155
|
if (existing && existing !== entry2[0]) {
|
|
23156
|
-
throw new Error(`Duplicate schema id "${
|
|
23156
|
+
throw new Error(`Duplicate schema id "${id11}" detected during JSON Schema conversion. Two different schemas cannot share the same id when converted together.`);
|
|
23157
23157
|
}
|
|
23158
|
-
idToSchema.set(
|
|
23158
|
+
idToSchema.set(id11, entry2[0]);
|
|
23159
23159
|
}
|
|
23160
23160
|
}
|
|
23161
23161
|
const makeURI = (entry2) => {
|
|
23162
23162
|
const defsSegment = ctx.target === "draft-2020-12" ? "$defs" : "definitions";
|
|
23163
23163
|
if (ctx.external) {
|
|
23164
23164
|
const externalId = ctx.external.registry.get(entry2[0])?.id;
|
|
23165
|
-
const uriGenerator = ctx.external.uri ?? ((
|
|
23165
|
+
const uriGenerator = ctx.external.uri ?? ((id12) => id12);
|
|
23166
23166
|
if (externalId) {
|
|
23167
23167
|
return { ref: uriGenerator(externalId) };
|
|
23168
23168
|
}
|
|
23169
|
-
const
|
|
23170
|
-
entry2[1].defId =
|
|
23171
|
-
return { defId:
|
|
23169
|
+
const id11 = entry2[1].defId ?? entry2[1].schema.id ?? `schema${ctx.counter++}`;
|
|
23170
|
+
entry2[1].defId = id11;
|
|
23171
|
+
return { defId: id11, ref: `${uriGenerator("__shared")}#/${defsSegment}/${encodeJSONPointerSegment(id11)}` };
|
|
23172
23172
|
}
|
|
23173
23173
|
const uriPrefix = `#`;
|
|
23174
23174
|
const defUriPrefix = `${uriPrefix}/${defsSegment}/`;
|
|
@@ -23216,8 +23216,8 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
23216
23216
|
continue;
|
|
23217
23217
|
}
|
|
23218
23218
|
}
|
|
23219
|
-
const
|
|
23220
|
-
if (
|
|
23219
|
+
const id11 = ctx.metadataRegistry.get(entry2[0])?.id;
|
|
23220
|
+
if (id11) {
|
|
23221
23221
|
extractToDef(entry2);
|
|
23222
23222
|
continue;
|
|
23223
23223
|
}
|
|
@@ -23450,10 +23450,10 @@ function finalize(ctx, schema) {
|
|
|
23450
23450
|
} else {
|
|
23451
23451
|
}
|
|
23452
23452
|
if (ctx.external?.uri) {
|
|
23453
|
-
const
|
|
23454
|
-
if (!
|
|
23453
|
+
const id11 = ctx.external.registry.get(schema)?.id;
|
|
23454
|
+
if (!id11)
|
|
23455
23455
|
throw new Error("Schema is missing an `id` property");
|
|
23456
|
-
result.$id = ctx.external.uri(
|
|
23456
|
+
result.$id = ctx.external.uri(id11);
|
|
23457
23457
|
}
|
|
23458
23458
|
assignProps(result, root.defId ? root.schema : root.def ?? root.schema);
|
|
23459
23459
|
const rootMetaId = ctx.metadataRegistry.get(schema)?.id;
|
|
@@ -24059,7 +24059,7 @@ function stringifyKeyNames(bySchema, json3, visited) {
|
|
|
24059
24059
|
const values2 = json3.enum ?? (json3.const !== void 0 ? [json3.const] : void 0);
|
|
24060
24060
|
if (!numericType && !values2?.some((v) => typeof v === "number"))
|
|
24061
24061
|
return json3;
|
|
24062
|
-
const { minimum, maximum, exclusiveMinimum, exclusiveMaximum, multipleOf, format, id:
|
|
24062
|
+
const { minimum, maximum, exclusiveMinimum, exclusiveMaximum, multipleOf, format, id: id11, ...rest } = json3;
|
|
24063
24063
|
if (rest.enum)
|
|
24064
24064
|
rest.enum = rest.enum.map((v) => typeof v === "number" ? String(v) : v);
|
|
24065
24065
|
else if (typeof rest.const === "number")
|
|
@@ -29210,8 +29210,8 @@ var REF_REWRITE_NAME_MAP_KEYS = /* @__PURE__ */ new Set([
|
|
|
29210
29210
|
"dependentSchemas",
|
|
29211
29211
|
"dependencies"
|
|
29212
29212
|
]);
|
|
29213
|
-
function establishesNewBase(
|
|
29214
|
-
return
|
|
29213
|
+
function establishesNewBase(id11) {
|
|
29214
|
+
return id11 !== void 0 && !(typeof id11 === "string" && id11.startsWith("#"));
|
|
29215
29215
|
}
|
|
29216
29216
|
function wrapOutputSchemaForLegacy(natural) {
|
|
29217
29217
|
const $schema = typeof natural["$schema"] === "string" ? natural["$schema"] : void 0;
|
|
@@ -34812,9 +34812,9 @@ var require_resolve = /* @__PURE__ */ __commonJSMin(((exports) => {
|
|
|
34812
34812
|
}
|
|
34813
34813
|
return count6;
|
|
34814
34814
|
}
|
|
34815
|
-
function getFullPath(resolver,
|
|
34816
|
-
if (normalize !== false)
|
|
34817
|
-
return _getFullPath(resolver, resolver.parse(
|
|
34815
|
+
function getFullPath(resolver, id11 = "", normalize) {
|
|
34816
|
+
if (normalize !== false) id11 = normalizeId(id11);
|
|
34817
|
+
return _getFullPath(resolver, resolver.parse(id11));
|
|
34818
34818
|
}
|
|
34819
34819
|
exports.getFullPath = getFullPath;
|
|
34820
34820
|
function _getFullPath(resolver, p2) {
|
|
@@ -34822,13 +34822,13 @@ var require_resolve = /* @__PURE__ */ __commonJSMin(((exports) => {
|
|
|
34822
34822
|
}
|
|
34823
34823
|
exports._getFullPath = _getFullPath;
|
|
34824
34824
|
const TRAILING_SLASH_HASH = /#\/?$/;
|
|
34825
|
-
function normalizeId(
|
|
34826
|
-
return
|
|
34825
|
+
function normalizeId(id11) {
|
|
34826
|
+
return id11 ? id11.replace(TRAILING_SLASH_HASH, "") : "";
|
|
34827
34827
|
}
|
|
34828
34828
|
exports.normalizeId = normalizeId;
|
|
34829
|
-
function resolveUrl(resolver, baseId,
|
|
34830
|
-
|
|
34831
|
-
return resolver.resolve(baseId,
|
|
34829
|
+
function resolveUrl(resolver, baseId, id11) {
|
|
34830
|
+
id11 = normalizeId(id11);
|
|
34831
|
+
return resolver.resolve(baseId, id11);
|
|
34832
34832
|
}
|
|
34833
34833
|
exports.resolveUrl = resolveUrl;
|
|
34834
34834
|
const ANCHOR = /^[a-z_][-a-z0-9._]*$/i;
|
|
@@ -35473,8 +35473,8 @@ var require_compile = /* @__PURE__ */ __commonJSMin(((exports) => {
|
|
|
35473
35473
|
const refPath = (0, resolve_1._getFullPath)(this.opts.uriResolver, p2);
|
|
35474
35474
|
let baseId = (0, resolve_1.getFullPath)(this.opts.uriResolver, root.baseId, void 0);
|
|
35475
35475
|
if (Object.keys(root.schema).length > 0 && refPath === baseId) return getJsonPointer.call(this, p2, root);
|
|
35476
|
-
const
|
|
35477
|
-
const schOrRef = this.refs[
|
|
35476
|
+
const id11 = (0, resolve_1.normalizeId)(refPath);
|
|
35477
|
+
const schOrRef = this.refs[id11] || this.schemas[id11];
|
|
35478
35478
|
if (typeof schOrRef == "string") {
|
|
35479
35479
|
const sch = resolveSchema.call(this, root, schOrRef);
|
|
35480
35480
|
if (typeof (sch === null || sch === void 0 ? void 0 : sch.schema) !== "object") return;
|
|
@@ -35482,7 +35482,7 @@ var require_compile = /* @__PURE__ */ __commonJSMin(((exports) => {
|
|
|
35482
35482
|
}
|
|
35483
35483
|
if (typeof (schOrRef === null || schOrRef === void 0 ? void 0 : schOrRef.schema) !== "object") return;
|
|
35484
35484
|
if (!schOrRef.validate) compileSchema.call(this, schOrRef);
|
|
35485
|
-
if (
|
|
35485
|
+
if (id11 === (0, resolve_1.normalizeId)(ref21)) {
|
|
35486
35486
|
const { schema } = schOrRef;
|
|
35487
35487
|
const { schemaId } = this.opts;
|
|
35488
35488
|
const schId = schema[schemaId];
|
|
@@ -36703,13 +36703,13 @@ var require_core$3 = /* @__PURE__ */ __commonJSMin(((exports) => {
|
|
|
36703
36703
|
for (const sch of schema) this.addSchema(sch, void 0, _meta, _validateSchema);
|
|
36704
36704
|
return this;
|
|
36705
36705
|
}
|
|
36706
|
-
let
|
|
36706
|
+
let id11;
|
|
36707
36707
|
if (typeof schema === "object") {
|
|
36708
36708
|
const { schemaId } = this.opts;
|
|
36709
|
-
|
|
36710
|
-
if (
|
|
36709
|
+
id11 = schema[schemaId];
|
|
36710
|
+
if (id11 !== void 0 && typeof id11 != "string") throw new Error(`schema ${schemaId} must be string`);
|
|
36711
36711
|
}
|
|
36712
|
-
key2 = (0, resolve_1.normalizeId)(key2 ||
|
|
36712
|
+
key2 = (0, resolve_1.normalizeId)(key2 || id11);
|
|
36713
36713
|
this._checkUnique(key2);
|
|
36714
36714
|
this.schemas[key2] = this._addSchema(schema, _meta, key2, _validateSchema, true);
|
|
36715
36715
|
return this;
|
|
@@ -36774,11 +36774,11 @@ var require_core$3 = /* @__PURE__ */ __commonJSMin(((exports) => {
|
|
|
36774
36774
|
case "object": {
|
|
36775
36775
|
const cacheKey = schemaKeyRef;
|
|
36776
36776
|
this._cache.delete(cacheKey);
|
|
36777
|
-
let
|
|
36778
|
-
if (
|
|
36779
|
-
|
|
36780
|
-
delete this.schemas[
|
|
36781
|
-
delete this.refs[
|
|
36777
|
+
let id11 = schemaKeyRef[this.opts.schemaId];
|
|
36778
|
+
if (id11) {
|
|
36779
|
+
id11 = (0, resolve_1.normalizeId)(id11);
|
|
36780
|
+
delete this.schemas[id11];
|
|
36781
|
+
delete this.refs[id11];
|
|
36782
36782
|
}
|
|
36783
36783
|
return this;
|
|
36784
36784
|
}
|
|
@@ -36870,14 +36870,14 @@ var require_core$3 = /* @__PURE__ */ __commonJSMin(((exports) => {
|
|
|
36870
36870
|
}
|
|
36871
36871
|
}
|
|
36872
36872
|
_addSchema(schema, meta3, baseId, validateSchema = this.opts.validateSchema, addSchema = this.opts.addUsedSchema) {
|
|
36873
|
-
let
|
|
36873
|
+
let id11;
|
|
36874
36874
|
const { schemaId } = this.opts;
|
|
36875
|
-
if (typeof schema == "object")
|
|
36875
|
+
if (typeof schema == "object") id11 = schema[schemaId];
|
|
36876
36876
|
else if (this.opts.jtd) throw new Error("schema must be object");
|
|
36877
36877
|
else if (typeof schema != "boolean") throw new Error("schema must be object or boolean");
|
|
36878
36878
|
let sch = this._cache.get(schema);
|
|
36879
36879
|
if (sch !== void 0) return sch;
|
|
36880
|
-
baseId = (0, resolve_1.normalizeId)(
|
|
36880
|
+
baseId = (0, resolve_1.normalizeId)(id11 || baseId);
|
|
36881
36881
|
const localRefs = resolve_1.getSchemaRefs.call(this, schema, baseId);
|
|
36882
36882
|
sch = new compile_1.SchemaEnv({
|
|
36883
36883
|
schema,
|
|
@@ -36894,8 +36894,8 @@ var require_core$3 = /* @__PURE__ */ __commonJSMin(((exports) => {
|
|
|
36894
36894
|
if (validateSchema) this.validateSchema(schema, true);
|
|
36895
36895
|
return sch;
|
|
36896
36896
|
}
|
|
36897
|
-
_checkUnique(
|
|
36898
|
-
if (this.schemas[
|
|
36897
|
+
_checkUnique(id11) {
|
|
36898
|
+
if (this.schemas[id11] || this.refs[id11]) throw new Error(`schema with key or id "${id11}" already exists`);
|
|
36899
36899
|
}
|
|
36900
36900
|
_compileSchemaEnv(sch) {
|
|
36901
36901
|
if (sch.meta) this._compileMetaSchema(sch);
|
|
@@ -41812,22 +41812,22 @@ var ProbeWindow = class ProbeWindow2 {
|
|
|
41812
41812
|
* never collide with Protocol's numeric ids (e.g. on a shared stdio pipe).
|
|
41813
41813
|
*/
|
|
41814
41814
|
async exchange(buildRequest, timeoutMs) {
|
|
41815
|
-
const
|
|
41815
|
+
const id11 = `server-discover-probe-${++this._probeCounter}`;
|
|
41816
41816
|
return new Promise((resolve) => {
|
|
41817
41817
|
let settled = false;
|
|
41818
41818
|
const settle2 = (reply2) => {
|
|
41819
41819
|
if (settled) return;
|
|
41820
41820
|
settled = true;
|
|
41821
41821
|
clearTimeout(timer);
|
|
41822
|
-
if (this._pending?.id ===
|
|
41822
|
+
if (this._pending?.id === id11) this._pending = void 0;
|
|
41823
41823
|
resolve(reply2);
|
|
41824
41824
|
};
|
|
41825
41825
|
const timer = setTimeout(() => settle2({ kind: "timeout" }), timeoutMs);
|
|
41826
41826
|
this._pending = {
|
|
41827
|
-
id:
|
|
41827
|
+
id: id11,
|
|
41828
41828
|
resolve: settle2
|
|
41829
41829
|
};
|
|
41830
|
-
this._transport.send(buildRequest(
|
|
41830
|
+
this._transport.send(buildRequest(id11)).catch((error62) => settle2({
|
|
41831
41831
|
kind: "send-error",
|
|
41832
41832
|
error: error62
|
|
41833
41833
|
}));
|
|
@@ -41877,10 +41877,10 @@ function disarmSpentCloseGuard(transport) {
|
|
|
41877
41877
|
pendingSpentCloseGuards.delete(transport);
|
|
41878
41878
|
disarm?.();
|
|
41879
41879
|
}
|
|
41880
|
-
function buildProbeRequest(
|
|
41880
|
+
function buildProbeRequest(id11, protocolVersion, clientInfo, capabilities) {
|
|
41881
41881
|
return {
|
|
41882
41882
|
jsonrpc: "2.0",
|
|
41883
|
-
id:
|
|
41883
|
+
id: id11,
|
|
41884
41884
|
method: "server/discover",
|
|
41885
41885
|
params: { _meta: codecForVersion(protocolVersion).outboundEnvelope({
|
|
41886
41886
|
protocolVersion,
|
|
@@ -41947,7 +41947,7 @@ async function negotiateEra(negotiation, deps) {
|
|
|
41947
41947
|
let correctiveUsed = false;
|
|
41948
41948
|
let timeoutRetriesRemaining = maxRetries;
|
|
41949
41949
|
for (; ; ) {
|
|
41950
|
-
const reply2 = await window.exchange((
|
|
41950
|
+
const reply2 = await window.exchange((id11) => buildProbeRequest(id11, requestedVersion, deps.clientInfo, deps.capabilities), timeoutMs);
|
|
41951
41951
|
if (reply2.kind === "timeout" && timeoutRetriesRemaining > 0) {
|
|
41952
41952
|
timeoutRetriesRemaining--;
|
|
41953
41953
|
continue;
|
|
@@ -43213,8 +43213,8 @@ var Client = class extends Protocol {
|
|
|
43213
43213
|
* through would surface as "unknown message ID" via `onerror`).
|
|
43214
43214
|
*/
|
|
43215
43215
|
_onresponse(response) {
|
|
43216
|
-
const
|
|
43217
|
-
const entry2 = typeof
|
|
43216
|
+
const id11 = response.id;
|
|
43217
|
+
const entry2 = typeof id11 === "string" ? this._listenState.get(id11) : void 0;
|
|
43218
43218
|
if (entry2 !== void 0) {
|
|
43219
43219
|
if (isJSONRPCErrorResponse(response)) entry2.settle({
|
|
43220
43220
|
cause: "remote",
|
|
@@ -43484,7 +43484,7 @@ function createParser(config2) {
|
|
|
43484
43484
|
"`config` must be an object, got a function instead. Did you mean `createParser({onEvent: fn})`?"
|
|
43485
43485
|
);
|
|
43486
43486
|
const { onEvent = noop, onError = noop, onRetry = noop, onComment, maxBufferSize } = config2, pendingFragments = [];
|
|
43487
|
-
let pendingFragmentsLength = 0, isFirstChunk = true,
|
|
43487
|
+
let pendingFragmentsLength = 0, isFirstChunk = true, id11, data = "", dataLines = 0, eventType, terminated = false;
|
|
43488
43488
|
function feed(chunk) {
|
|
43489
43489
|
if (terminated)
|
|
43490
43490
|
throw new Error(
|
|
@@ -43507,7 +43507,7 @@ function createParser(config2) {
|
|
|
43507
43507
|
trailing !== "" && (pendingFragments.push(trailing), pendingFragmentsLength = trailing.length), checkBufferSize();
|
|
43508
43508
|
}
|
|
43509
43509
|
function checkBufferSize() {
|
|
43510
|
-
maxBufferSize !== void 0 && (pendingFragmentsLength + data.length <= maxBufferSize || (terminated = true, pendingFragments.length = 0, pendingFragmentsLength = 0,
|
|
43510
|
+
maxBufferSize !== void 0 && (pendingFragmentsLength + data.length <= maxBufferSize || (terminated = true, pendingFragments.length = 0, pendingFragmentsLength = 0, id11 = void 0, data = "", dataLines = 0, eventType = void 0, onError(
|
|
43511
43511
|
new ParseError(`Buffered data exceeded max buffer size of ${maxBufferSize} characters`, {
|
|
43512
43512
|
type: "max-buffer-size-exceeded"
|
|
43513
43513
|
})
|
|
@@ -43520,7 +43520,7 @@ function createParser(config2) {
|
|
|
43520
43520
|
`, searchIndex);
|
|
43521
43521
|
for (; lfIndex !== -1; ) {
|
|
43522
43522
|
if (searchIndex === lfIndex) {
|
|
43523
|
-
dataLines > 0 && onEvent({ id:
|
|
43523
|
+
dataLines > 0 && onEvent({ id: id11, event: eventType, data }), id11 = void 0, data = "", dataLines = 0, eventType = void 0, searchIndex = lfIndex + 1, lfIndex = chunk.indexOf(`
|
|
43524
43524
|
`, searchIndex);
|
|
43525
43525
|
continue;
|
|
43526
43526
|
}
|
|
@@ -43528,7 +43528,7 @@ function createParser(config2) {
|
|
|
43528
43528
|
if (isDataPrefix(chunk, searchIndex, firstCharCode)) {
|
|
43529
43529
|
const valueStart = chunk.charCodeAt(searchIndex + 5) === SPACE ? searchIndex + 6 : searchIndex + 5, value3 = chunk.slice(valueStart, lfIndex);
|
|
43530
43530
|
if (dataLines === 0 && chunk.charCodeAt(lfIndex + 1) === LF) {
|
|
43531
|
-
onEvent({ id:
|
|
43531
|
+
onEvent({ id: id11, event: eventType, data: value3 }), id11 = void 0, data = "", eventType = void 0, searchIndex = lfIndex + 2, lfIndex = chunk.indexOf(`
|
|
43532
43532
|
`, searchIndex);
|
|
43533
43533
|
continue;
|
|
43534
43534
|
}
|
|
@@ -43571,7 +43571,7 @@ ${value22}`, dataLines++;
|
|
|
43571
43571
|
}
|
|
43572
43572
|
if (firstCharCode === 105 && chunk.charCodeAt(start + 1) === 100 && chunk.charCodeAt(start + 2) === 58) {
|
|
43573
43573
|
const value22 = chunk.slice(chunk.charCodeAt(start + 3) === SPACE ? start + 4 : start + 3, end);
|
|
43574
|
-
value22.includes("\0") || (
|
|
43574
|
+
value22.includes("\0") || (id11 = value22);
|
|
43575
43575
|
return;
|
|
43576
43576
|
}
|
|
43577
43577
|
if (firstCharCode === 58) {
|
|
@@ -43599,7 +43599,7 @@ ${value22}`, dataLines++;
|
|
|
43599
43599
|
${value3}`, dataLines++;
|
|
43600
43600
|
break;
|
|
43601
43601
|
case "id":
|
|
43602
|
-
value3.includes("\0") || (
|
|
43602
|
+
value3.includes("\0") || (id11 = value3);
|
|
43603
43603
|
break;
|
|
43604
43604
|
case "retry":
|
|
43605
43605
|
/^\d+$/.test(value3) ? onRetry(parseInt(value3, 10)) : onError(
|
|
@@ -43622,17 +43622,17 @@ ${value3}`, dataLines++;
|
|
|
43622
43622
|
}
|
|
43623
43623
|
function dispatchEvent() {
|
|
43624
43624
|
dataLines > 0 && onEvent({
|
|
43625
|
-
id:
|
|
43625
|
+
id: id11,
|
|
43626
43626
|
event: eventType,
|
|
43627
43627
|
data
|
|
43628
|
-
}),
|
|
43628
|
+
}), id11 = void 0, data = "", dataLines = 0, eventType = void 0;
|
|
43629
43629
|
}
|
|
43630
43630
|
function reset(options = {}) {
|
|
43631
43631
|
if (options.consume && pendingFragments.length > 0) {
|
|
43632
43632
|
const incompleteLine = pendingFragments.join("");
|
|
43633
43633
|
parseLine(incompleteLine, 0, incompleteLine.length);
|
|
43634
43634
|
}
|
|
43635
|
-
isFirstChunk = true,
|
|
43635
|
+
isFirstChunk = true, id11 = void 0, data = "", dataLines = 0, eventType = void 0, pendingFragments.length = 0, pendingFragmentsLength = 0, terminated = false;
|
|
43636
43636
|
}
|
|
43637
43637
|
return { feed, reset };
|
|
43638
43638
|
}
|
|
@@ -45517,8 +45517,8 @@ var REF_REWRITE_NAME_MAP_KEYS2 = /* @__PURE__ */ new Set([
|
|
|
45517
45517
|
"dependentSchemas",
|
|
45518
45518
|
"dependencies"
|
|
45519
45519
|
]);
|
|
45520
|
-
function establishesNewBase2(
|
|
45521
|
-
return
|
|
45520
|
+
function establishesNewBase2(id11) {
|
|
45521
|
+
return id11 !== void 0 && !(typeof id11 === "string" && id11.startsWith("#"));
|
|
45522
45522
|
}
|
|
45523
45523
|
function wrapOutputSchemaForLegacy2(natural) {
|
|
45524
45524
|
const $schema = typeof natural["$schema"] === "string" ? natural["$schema"] : void 0;
|
|
@@ -50784,9 +50784,9 @@ var require_resolve2 = /* @__PURE__ */ __commonJSMin2(((exports) => {
|
|
|
50784
50784
|
}
|
|
50785
50785
|
return count6;
|
|
50786
50786
|
}
|
|
50787
|
-
function getFullPath(resolver,
|
|
50788
|
-
if (normalize !== false)
|
|
50789
|
-
return _getFullPath(resolver, resolver.parse(
|
|
50787
|
+
function getFullPath(resolver, id11 = "", normalize) {
|
|
50788
|
+
if (normalize !== false) id11 = normalizeId(id11);
|
|
50789
|
+
return _getFullPath(resolver, resolver.parse(id11));
|
|
50790
50790
|
}
|
|
50791
50791
|
exports.getFullPath = getFullPath;
|
|
50792
50792
|
function _getFullPath(resolver, p2) {
|
|
@@ -50794,13 +50794,13 @@ var require_resolve2 = /* @__PURE__ */ __commonJSMin2(((exports) => {
|
|
|
50794
50794
|
}
|
|
50795
50795
|
exports._getFullPath = _getFullPath;
|
|
50796
50796
|
const TRAILING_SLASH_HASH = /#\/?$/;
|
|
50797
|
-
function normalizeId(
|
|
50798
|
-
return
|
|
50797
|
+
function normalizeId(id11) {
|
|
50798
|
+
return id11 ? id11.replace(TRAILING_SLASH_HASH, "") : "";
|
|
50799
50799
|
}
|
|
50800
50800
|
exports.normalizeId = normalizeId;
|
|
50801
|
-
function resolveUrl(resolver, baseId,
|
|
50802
|
-
|
|
50803
|
-
return resolver.resolve(baseId,
|
|
50801
|
+
function resolveUrl(resolver, baseId, id11) {
|
|
50802
|
+
id11 = normalizeId(id11);
|
|
50803
|
+
return resolver.resolve(baseId, id11);
|
|
50804
50804
|
}
|
|
50805
50805
|
exports.resolveUrl = resolveUrl;
|
|
50806
50806
|
const ANCHOR = /^[a-z_][-a-z0-9._]*$/i;
|
|
@@ -51445,8 +51445,8 @@ var require_compile2 = /* @__PURE__ */ __commonJSMin2(((exports) => {
|
|
|
51445
51445
|
const refPath = (0, resolve_1._getFullPath)(this.opts.uriResolver, p2);
|
|
51446
51446
|
let baseId = (0, resolve_1.getFullPath)(this.opts.uriResolver, root.baseId, void 0);
|
|
51447
51447
|
if (Object.keys(root.schema).length > 0 && refPath === baseId) return getJsonPointer.call(this, p2, root);
|
|
51448
|
-
const
|
|
51449
|
-
const schOrRef = this.refs[
|
|
51448
|
+
const id11 = (0, resolve_1.normalizeId)(refPath);
|
|
51449
|
+
const schOrRef = this.refs[id11] || this.schemas[id11];
|
|
51450
51450
|
if (typeof schOrRef == "string") {
|
|
51451
51451
|
const sch = resolveSchema.call(this, root, schOrRef);
|
|
51452
51452
|
if (typeof (sch === null || sch === void 0 ? void 0 : sch.schema) !== "object") return;
|
|
@@ -51454,7 +51454,7 @@ var require_compile2 = /* @__PURE__ */ __commonJSMin2(((exports) => {
|
|
|
51454
51454
|
}
|
|
51455
51455
|
if (typeof (schOrRef === null || schOrRef === void 0 ? void 0 : schOrRef.schema) !== "object") return;
|
|
51456
51456
|
if (!schOrRef.validate) compileSchema.call(this, schOrRef);
|
|
51457
|
-
if (
|
|
51457
|
+
if (id11 === (0, resolve_1.normalizeId)(ref21)) {
|
|
51458
51458
|
const { schema } = schOrRef;
|
|
51459
51459
|
const { schemaId } = this.opts;
|
|
51460
51460
|
const schId = schema[schemaId];
|
|
@@ -52675,13 +52675,13 @@ var require_core$32 = /* @__PURE__ */ __commonJSMin2(((exports) => {
|
|
|
52675
52675
|
for (const sch of schema) this.addSchema(sch, void 0, _meta, _validateSchema);
|
|
52676
52676
|
return this;
|
|
52677
52677
|
}
|
|
52678
|
-
let
|
|
52678
|
+
let id11;
|
|
52679
52679
|
if (typeof schema === "object") {
|
|
52680
52680
|
const { schemaId } = this.opts;
|
|
52681
|
-
|
|
52682
|
-
if (
|
|
52681
|
+
id11 = schema[schemaId];
|
|
52682
|
+
if (id11 !== void 0 && typeof id11 != "string") throw new Error(`schema ${schemaId} must be string`);
|
|
52683
52683
|
}
|
|
52684
|
-
key2 = (0, resolve_1.normalizeId)(key2 ||
|
|
52684
|
+
key2 = (0, resolve_1.normalizeId)(key2 || id11);
|
|
52685
52685
|
this._checkUnique(key2);
|
|
52686
52686
|
this.schemas[key2] = this._addSchema(schema, _meta, key2, _validateSchema, true);
|
|
52687
52687
|
return this;
|
|
@@ -52746,11 +52746,11 @@ var require_core$32 = /* @__PURE__ */ __commonJSMin2(((exports) => {
|
|
|
52746
52746
|
case "object": {
|
|
52747
52747
|
const cacheKey = schemaKeyRef;
|
|
52748
52748
|
this._cache.delete(cacheKey);
|
|
52749
|
-
let
|
|
52750
|
-
if (
|
|
52751
|
-
|
|
52752
|
-
delete this.schemas[
|
|
52753
|
-
delete this.refs[
|
|
52749
|
+
let id11 = schemaKeyRef[this.opts.schemaId];
|
|
52750
|
+
if (id11) {
|
|
52751
|
+
id11 = (0, resolve_1.normalizeId)(id11);
|
|
52752
|
+
delete this.schemas[id11];
|
|
52753
|
+
delete this.refs[id11];
|
|
52754
52754
|
}
|
|
52755
52755
|
return this;
|
|
52756
52756
|
}
|
|
@@ -52842,14 +52842,14 @@ var require_core$32 = /* @__PURE__ */ __commonJSMin2(((exports) => {
|
|
|
52842
52842
|
}
|
|
52843
52843
|
}
|
|
52844
52844
|
_addSchema(schema, meta3, baseId, validateSchema = this.opts.validateSchema, addSchema = this.opts.addUsedSchema) {
|
|
52845
|
-
let
|
|
52845
|
+
let id11;
|
|
52846
52846
|
const { schemaId } = this.opts;
|
|
52847
|
-
if (typeof schema == "object")
|
|
52847
|
+
if (typeof schema == "object") id11 = schema[schemaId];
|
|
52848
52848
|
else if (this.opts.jtd) throw new Error("schema must be object");
|
|
52849
52849
|
else if (typeof schema != "boolean") throw new Error("schema must be object or boolean");
|
|
52850
52850
|
let sch = this._cache.get(schema);
|
|
52851
52851
|
if (sch !== void 0) return sch;
|
|
52852
|
-
baseId = (0, resolve_1.normalizeId)(
|
|
52852
|
+
baseId = (0, resolve_1.normalizeId)(id11 || baseId);
|
|
52853
52853
|
const localRefs = resolve_1.getSchemaRefs.call(this, schema, baseId);
|
|
52854
52854
|
sch = new compile_1.SchemaEnv({
|
|
52855
52855
|
schema,
|
|
@@ -52866,8 +52866,8 @@ var require_core$32 = /* @__PURE__ */ __commonJSMin2(((exports) => {
|
|
|
52866
52866
|
if (validateSchema) this.validateSchema(schema, true);
|
|
52867
52867
|
return sch;
|
|
52868
52868
|
}
|
|
52869
|
-
_checkUnique(
|
|
52870
|
-
if (this.schemas[
|
|
52869
|
+
_checkUnique(id11) {
|
|
52870
|
+
if (this.schemas[id11] || this.refs[id11]) throw new Error(`schema with key or id "${id11}" already exists`);
|
|
52871
52871
|
}
|
|
52872
52872
|
_compileSchemaEnv(sch) {
|
|
52873
52873
|
if (sch.meta) this._compileMetaSchema(sch);
|
|
@@ -57049,7 +57049,7 @@ var Server = class extends Protocol2 {
|
|
|
57049
57049
|
if (hasPreviousToolUse) {
|
|
57050
57050
|
const toolUseIds = new Set(previousContent.filter((c) => c.type === "tool_use").map((c) => c.id));
|
|
57051
57051
|
const toolResultIds = new Set(lastContent.filter((c) => c.type === "tool_result").map((c) => c.toolUseId));
|
|
57052
|
-
if (toolUseIds.size !== toolResultIds.size || ![...toolUseIds].every((
|
|
57052
|
+
if (toolUseIds.size !== toolResultIds.size || ![...toolUseIds].every((id11) => toolResultIds.has(id11))) throw new ProtocolError3(ProtocolErrorCode2.InvalidParams, "ids of tool_result blocks and tool_use blocks from previous message do not match");
|
|
57053
57053
|
}
|
|
57054
57054
|
}
|
|
57055
57055
|
const hasTools = Boolean(params.tools || params.toolChoice);
|
|
@@ -57314,7 +57314,7 @@ var AnchaError = class extends Error {
|
|
|
57314
57314
|
};
|
|
57315
57315
|
|
|
57316
57316
|
// packages/core/src/agent-routes.ts
|
|
57317
|
-
var agentRoutesSchema = external_exports.strictObject({ quickbooks: external_exports.literal("composio").optional() });
|
|
57317
|
+
var agentRoutesSchema = external_exports.strictObject({ quickbooks: external_exports.literal("composio").optional(), netsuite: external_exports.literal("composio").optional() });
|
|
57318
57318
|
|
|
57319
57319
|
// packages/core/src/execution-support.ts
|
|
57320
57320
|
var all = { local: true, container: true, managed: true, "cloud-vm": true };
|
|
@@ -57348,6 +57348,8 @@ var EXECUTION_SUPPORT = {
|
|
|
57348
57348
|
"agent_input": sceneOnly,
|
|
57349
57349
|
"scene.timeout": sceneOnly,
|
|
57350
57350
|
"test.timeout": all,
|
|
57351
|
+
// A variant's provenance from `ancha test vary`: it runs wherever its file runs and is shown in results.
|
|
57352
|
+
"variant": sceneOnly,
|
|
57351
57353
|
"checks.state": all,
|
|
57352
57354
|
"checks.trace": all,
|
|
57353
57355
|
"checks.answer": all,
|
|
@@ -57550,6 +57552,33 @@ var toolCompletionSchema = external_exports.object({
|
|
|
57550
57552
|
capture: external_exports.enum(["full", "truncated", "unserializable"]).optional()
|
|
57551
57553
|
}).strict().refine((v) => v.ok ? !v.error && Object.hasOwn(v, "result") : v.error !== void 0 && !Object.hasOwn(v, "result"), "Completion needs a result or an error matching ok");
|
|
57552
57554
|
|
|
57555
|
+
// packages/core/src/test-variation/contract.ts
|
|
57556
|
+
var VARIANT_KINDS = ["amounts", "copies", "pages", "names"];
|
|
57557
|
+
|
|
57558
|
+
// packages/core/src/test-variation/schema.ts
|
|
57559
|
+
var id = external_exports.string().min(1);
|
|
57560
|
+
var ids = external_exports.array(id).min(1).refine((values2) => new Set(values2).size === values2.length, "record IDs must be unique");
|
|
57561
|
+
var entity = external_exports.enum(["Invoice", "Bill"]);
|
|
57562
|
+
var VariantRecipeSchema = external_exports.discriminatedUnion("op", [
|
|
57563
|
+
external_exports.strictObject({ op: external_exports.literal("duplicate_amount"), entity, ids, amount_minor: external_exports.number().int().positive().max(Number.MAX_SAFE_INTEGER) }),
|
|
57564
|
+
external_exports.strictObject({ op: external_exports.literal("extra_copy"), entity: external_exports.literal("Invoice"), source_id: id, new_id: id, document: id }),
|
|
57565
|
+
external_exports.strictObject({ op: external_exports.literal("page_padding"), entity, source_id: id, ids, document_prefix: id }),
|
|
57566
|
+
external_exports.strictObject({ op: external_exports.literal("rename_vendor"), ids, names: external_exports.array(id).min(1), domain: external_exports.string().regex(/^[a-z0-9-]+\.example$/) }),
|
|
57567
|
+
external_exports.strictObject({ op: external_exports.literal("renumber"), entity, ids, document: id })
|
|
57568
|
+
]);
|
|
57569
|
+
var digest = external_exports.string().regex(/^[a-f0-9]{64}$/);
|
|
57570
|
+
var VariantBlockSchema = external_exports.strictObject({
|
|
57571
|
+
version: external_exports.literal(1),
|
|
57572
|
+
parent: external_exports.strictObject({ id: external_exports.string().regex(/^[a-z0-9-]+$/), fingerprint: digest }),
|
|
57573
|
+
suite: digest,
|
|
57574
|
+
generator: external_exports.string().min(1),
|
|
57575
|
+
seed: external_exports.string().min(1),
|
|
57576
|
+
ordinal: external_exports.number().int().positive(),
|
|
57577
|
+
kind: external_exports.enum(VARIANT_KINDS),
|
|
57578
|
+
change: external_exports.string().min(1),
|
|
57579
|
+
recipe: VariantRecipeSchema
|
|
57580
|
+
});
|
|
57581
|
+
|
|
57553
57582
|
// packages/core/src/world/call-faults.ts
|
|
57554
57583
|
var offset = external_exports.string().refine((value3) => {
|
|
57555
57584
|
try {
|
|
@@ -57658,7 +57687,7 @@ function chatGPTAdsStarterSeed() {
|
|
|
57658
57687
|
}
|
|
57659
57688
|
|
|
57660
57689
|
// packages/core/src/tools/google-ads.ts
|
|
57661
|
-
var
|
|
57690
|
+
var id2 = external_exports.string().regex(/^[1-9]\d*$/).refine((v) => BigInt(v) <= 9223372036854775807n, "ID exceeds int64");
|
|
57662
57691
|
var customerId = external_exports.string().regex(/^\d{10}$/);
|
|
57663
57692
|
var micros = external_exports.string().regex(/^\d+$/).refine((v) => BigInt(v) <= 9223372036854775807n, "micros exceed int64");
|
|
57664
57693
|
var resource = (collection) => external_exports.string().regex(new RegExp(`^customers/\\d{10}/${collection}/[1-9]\\d*${["adGroupAds", "adGroupCriteria"].includes(collection) ? "~[1-9]\\d*" : ""}$`));
|
|
@@ -57677,16 +57706,16 @@ var GoogleCustomerSchema = external_exports.strictObject({ id: customerId, descr
|
|
|
57677
57706
|
}
|
|
57678
57707
|
}, "invalid time zone"), manager: external_exports.boolean(), testAccount: external_exports.boolean().default(false), parentId: customerId.optional() });
|
|
57679
57708
|
var GoogleBudgetInputSchema = external_exports.strictObject({ name: external_exports.string().min(1).max(255), amountMicros: micros.refine((v) => BigInt(v) > 0n, "budget must be positive"), deliveryMethod: external_exports.literal("STANDARD").default("STANDARD"), explicitlyShared: external_exports.boolean().default(false) });
|
|
57680
|
-
var GoogleBudgetSchema = GoogleBudgetInputSchema.extend({ id, resourceName: resource("campaignBudgets"), status: external_exports.enum(["ENABLED", "REMOVED"]).default("ENABLED") });
|
|
57709
|
+
var GoogleBudgetSchema = GoogleBudgetInputSchema.extend({ id: id2, resourceName: resource("campaignBudgets"), status: external_exports.enum(["ENABLED", "REMOVED"]).default("ENABLED") });
|
|
57681
57710
|
var GoogleCampaignInputSchema = external_exports.strictObject({ name: external_exports.string().min(1).max(255), status: status.default("ENABLED"), advertisingChannelType: external_exports.literal("SEARCH"), campaignBudget: resource("campaignBudgets"), manualCpc: external_exports.strictObject({ enhancedCpcEnabled: external_exports.boolean().optional() }), containsEuPoliticalAdvertising: external_exports.literal("DOES_NOT_CONTAIN_EU_POLITICAL_ADVERTISING"), startDateTime: dateTime.optional(), endDateTime: dateTime.optional() });
|
|
57682
|
-
var GoogleCampaignSchema = GoogleCampaignInputSchema.extend({ id, resourceName: resource("campaigns") });
|
|
57711
|
+
var GoogleCampaignSchema = GoogleCampaignInputSchema.extend({ id: id2, resourceName: resource("campaigns") });
|
|
57683
57712
|
var GoogleAdGroupInputSchema = external_exports.strictObject({ name: external_exports.string().min(1), campaign: resource("campaigns"), status: status.default("ENABLED"), type: external_exports.literal("SEARCH_STANDARD").default("SEARCH_STANDARD"), cpcBidMicros: micros.optional() });
|
|
57684
|
-
var GoogleAdGroupSchema = GoogleAdGroupInputSchema.extend({ id, resourceName: resource("adGroups") });
|
|
57713
|
+
var GoogleAdGroupSchema = GoogleAdGroupInputSchema.extend({ id: id2, resourceName: resource("adGroups") });
|
|
57685
57714
|
var textAsset = external_exports.strictObject({ text: external_exports.string().min(1) });
|
|
57686
57715
|
var GoogleAdInputSchema = external_exports.strictObject({ adGroup: resource("adGroups"), status: status.default("ENABLED"), ad: external_exports.strictObject({ finalUrls: external_exports.array(url2).min(1).max(10), responsiveSearchAd: external_exports.strictObject({ headlines: external_exports.array(textAsset.extend({ text: external_exports.string().min(1).max(30) })).min(3).max(15), descriptions: external_exports.array(textAsset.extend({ text: external_exports.string().min(1).max(90) })).min(2).max(4), path1: external_exports.string().max(15).optional(), path2: external_exports.string().max(15).optional() }) }) });
|
|
57687
|
-
var GoogleAdSchema = GoogleAdInputSchema.extend({ resourceName: resource("adGroupAds"), ad: GoogleAdInputSchema.shape.ad.extend({ id, resourceName: resource("ads"), type: external_exports.literal("RESPONSIVE_SEARCH_AD") }), policySummary: external_exports.strictObject({ reviewStatus: external_exports.enum(["REVIEW_IN_PROGRESS", "REVIEWED"]), approvalStatus: external_exports.enum(["APPROVED", "DISAPPROVED", "UNKNOWN"]) }) });
|
|
57716
|
+
var GoogleAdSchema = GoogleAdInputSchema.extend({ resourceName: resource("adGroupAds"), ad: GoogleAdInputSchema.shape.ad.extend({ id: id2, resourceName: resource("ads"), type: external_exports.literal("RESPONSIVE_SEARCH_AD") }), policySummary: external_exports.strictObject({ reviewStatus: external_exports.enum(["REVIEW_IN_PROGRESS", "REVIEWED"]), approvalStatus: external_exports.enum(["APPROVED", "DISAPPROVED", "UNKNOWN"]) }) });
|
|
57688
57717
|
var GoogleCriterionInputSchema = external_exports.strictObject({ adGroup: resource("adGroups"), status: status.default("ENABLED"), negative: external_exports.boolean().default(false), keyword: external_exports.strictObject({ text: external_exports.string().min(1).max(80), matchType: external_exports.enum(["EXACT", "PHRASE", "BROAD"]) }), cpcBidMicros: micros.optional() });
|
|
57689
|
-
var GoogleCriterionSchema = GoogleCriterionInputSchema.extend({ resourceName: resource("adGroupCriteria"), criterionId:
|
|
57718
|
+
var GoogleCriterionSchema = GoogleCriterionInputSchema.extend({ resourceName: resource("adGroupCriteria"), criterionId: id2, type: external_exports.literal("KEYWORD") });
|
|
57690
57719
|
var date5 = external_exports.string().regex(/^\d{4}-\d{2}-\d{2}$/).refine((v) => {
|
|
57691
57720
|
const d = /* @__PURE__ */ new Date(`${v}T00:00:00Z`);
|
|
57692
57721
|
return Number.isFinite(d.getTime()) && d.toISOString().slice(0, 10) === v;
|
|
@@ -58163,39 +58192,39 @@ var GitHubIssueCheckSchema = external_exports.strictObject({
|
|
|
58163
58192
|
count_gte: external_exports.number().int().min(0).optional(),
|
|
58164
58193
|
count_lte: external_exports.number().int().min(0).optional()
|
|
58165
58194
|
}).refine((check3) => check3.count === void 0 || check3.count_gte === void 0 && check3.count_lte === void 0, "use count, or count_gte and count_lte, not both");
|
|
58166
|
-
var
|
|
58195
|
+
var id3 = external_exports.string();
|
|
58167
58196
|
var ProcessCheckSchemas = [
|
|
58168
|
-
external_exports.strictObject({ id:
|
|
58169
|
-
external_exports.strictObject({ id:
|
|
58170
|
-
external_exports.strictObject({ id:
|
|
58171
|
-
external_exports.strictObject({ id:
|
|
58172
|
-
external_exports.strictObject({ id:
|
|
58173
|
-
external_exports.strictObject({ id:
|
|
58174
|
-
external_exports.strictObject({ id:
|
|
58175
|
-
external_exports.strictObject({ id:
|
|
58197
|
+
external_exports.strictObject({ id: id3, revealed: RevealedSchema }),
|
|
58198
|
+
external_exports.strictObject({ id: id3, knows: KnowsTupleSchema.describe("[person, fact, ...more facts]: the person knows each fact, from the agent or another person") }),
|
|
58199
|
+
external_exports.strictObject({ id: id3, told: KnowsTupleSchema.describe("Alias of knows, for checks that read better") }),
|
|
58200
|
+
external_exports.strictObject({ id: id3, decided: DecidedTupleSchema }),
|
|
58201
|
+
external_exports.strictObject({ id: id3, message: MessageCheckSchema.describe("At least count_gte messages match") }),
|
|
58202
|
+
external_exports.strictObject({ id: id3, never: MessageMatchSchema.describe("No message ever matched") }),
|
|
58203
|
+
external_exports.strictObject({ id: id3, before: external_exports.array(MilestoneSchema).min(2).describe("Every milestone happened, each one before the next in simulated time") }),
|
|
58204
|
+
external_exports.strictObject({ id: id3, within: WithinSchema })
|
|
58176
58205
|
];
|
|
58177
58206
|
var PROCESS_CHECK_KINDS = ["revealed", "knows", "told", "decided", "message", "never", "before", "within"];
|
|
58178
58207
|
|
|
58179
58208
|
// packages/core/src/tools/salesforce.ts
|
|
58180
58209
|
var salesforceObjectNames = ["Account", "Contact", "Lead", "Opportunity", "Campaign", "CampaignMember"];
|
|
58181
58210
|
var text = external_exports.string().min(1).max(255);
|
|
58182
|
-
var
|
|
58211
|
+
var id4 = external_exports.string().regex(/^[A-Za-z0-9]{15}(?:[A-Za-z0-9]{3})?$/);
|
|
58183
58212
|
var date6 = external_exports.string().regex(/^\d{4}-\d{2}-\d{2}$/).refine((value3) => Number.isFinite(Date.parse(value3)) && new Date(value3).toISOString().slice(0, 10) === value3, "invalid calendar date");
|
|
58184
|
-
var base = { Id:
|
|
58213
|
+
var base = { Id: id4, CreatedDate: external_exports.iso.datetime().optional(), LastModifiedDate: external_exports.iso.datetime().optional(), External_Id__c: text.nullable().optional() };
|
|
58185
58214
|
var nullableText = text.nullable().optional();
|
|
58186
58215
|
var salesforceRecordSchemas = {
|
|
58187
58216
|
Account: external_exports.strictObject({ ...base, Name: text, Industry: nullableText, Type: external_exports.enum(["Prospect", "Customer", "Partner"]).nullable().optional(), Website: external_exports.url().nullable().optional(), Description: external_exports.string().max(32e3).nullable().optional(), BillingCountry: nullableText, NumberOfEmployees: external_exports.number().int().nonnegative().nullable().optional(), AnnualRevenue: external_exports.number().nonnegative().nullable().optional() }),
|
|
58188
|
-
Contact: external_exports.strictObject({ ...base, FirstName: nullableText, LastName: text, AccountId:
|
|
58217
|
+
Contact: external_exports.strictObject({ ...base, FirstName: nullableText, LastName: text, AccountId: id4.nullable().optional(), Email: external_exports.email().nullable().optional(), Title: nullableText, Phone: nullableText }),
|
|
58189
58218
|
Lead: external_exports.strictObject({ ...base, FirstName: nullableText, LastName: text, Company: text, Email: external_exports.email().nullable().optional(), Title: nullableText, Status: external_exports.enum(["Open - Not Contacted", "Working - Contacted", "Closed - Converted", "Closed - Not Converted"]).optional(), LeadSource: nullableText, Industry: nullableText }),
|
|
58190
|
-
Opportunity: external_exports.strictObject({ ...base, Name: text, AccountId:
|
|
58191
|
-
Campaign: external_exports.strictObject({ ...base, Name: text, Type: external_exports.enum(["Conference", "Webinar", "Advertisement", "Email", "Other"]).nullable().optional(), Status: external_exports.enum(["Planned", "In Progress", "Completed", "Aborted"]).optional(), IsActive: external_exports.boolean().optional(), StartDate: date6.nullable().optional(), EndDate: date6.nullable().optional(), BudgetedCost: external_exports.number().nonnegative().nullable().optional(), ActualCost: external_exports.number().nonnegative().nullable().optional(), Description: external_exports.string().max(32e3).nullable().optional(), ClientAccount__c:
|
|
58192
|
-
CampaignMember: external_exports.strictObject({ ...base, CampaignId:
|
|
58219
|
+
Opportunity: external_exports.strictObject({ ...base, Name: text, AccountId: id4.nullable().optional(), StageName: external_exports.enum(["Prospecting", "Qualification", "Needs Analysis", "Value Proposition", "Id. Decision Makers", "Perception Analysis", "Proposal/Price Quote", "Negotiation/Review", "Closed Won", "Closed Lost"]), CloseDate: date6, Amount: external_exports.number().nonnegative().nullable().optional(), Probability: external_exports.number().min(0).max(100).nullable().optional(), LeadSource: nullableText, Description: external_exports.string().max(32e3).nullable().optional(), CampaignId: id4.nullable().optional() }),
|
|
58220
|
+
Campaign: external_exports.strictObject({ ...base, Name: text, Type: external_exports.enum(["Conference", "Webinar", "Advertisement", "Email", "Other"]).nullable().optional(), Status: external_exports.enum(["Planned", "In Progress", "Completed", "Aborted"]).optional(), IsActive: external_exports.boolean().optional(), StartDate: date6.nullable().optional(), EndDate: date6.nullable().optional(), BudgetedCost: external_exports.number().nonnegative().nullable().optional(), ActualCost: external_exports.number().nonnegative().nullable().optional(), Description: external_exports.string().max(32e3).nullable().optional(), ClientAccount__c: id4.nullable().optional() }),
|
|
58221
|
+
CampaignMember: external_exports.strictObject({ ...base, CampaignId: id4, ContactId: id4.nullable().optional(), LeadId: id4.nullable().optional(), Status: external_exports.enum(["Sent", "Responded"]).optional() })
|
|
58193
58222
|
};
|
|
58194
58223
|
var salesforceCollections = { Account: "accounts", Contact: "contacts", Lead: "leads", Opportunity: "opportunities", Campaign: "campaigns", CampaignMember: "campaignMembers" };
|
|
58195
58224
|
var prefix = { Account: "001", Contact: "003", Lead: "00Q", Opportunity: "006", Campaign: "701", CampaignMember: "00v" };
|
|
58196
58225
|
var SalesforceSeedSchema = external_exports.strictObject({
|
|
58197
|
-
org: external_exports.strictObject({ id:
|
|
58198
|
-
access: external_exports.strictObject({ read: external_exports.boolean().default(true), write: external_exports.boolean().default(true), deniedAccountIds: external_exports.array(
|
|
58226
|
+
org: external_exports.strictObject({ id: id4.refine((value3) => value3.startsWith("00D"), "organization ID must start with 00D"), name: text, currency: external_exports.string().regex(/^[A-Z]{3}$/).default("USD"), timezone: text.default("America/Los_Angeles") }),
|
|
58227
|
+
access: external_exports.strictObject({ read: external_exports.boolean().default(true), write: external_exports.boolean().default(true), deniedAccountIds: external_exports.array(id4).max(5e3).default([]) }).default({ read: true, write: true, deniedAccountIds: [] }),
|
|
58199
58228
|
accounts: external_exports.array(salesforceRecordSchemas.Account).max(5e3).default([]),
|
|
58200
58229
|
contacts: external_exports.array(salesforceRecordSchemas.Contact).max(5e3).default([]),
|
|
58201
58230
|
leads: external_exports.array(salesforceRecordSchemas.Lead).max(5e3).default([]),
|
|
@@ -58203,13 +58232,13 @@ var SalesforceSeedSchema = external_exports.strictObject({
|
|
|
58203
58232
|
campaigns: external_exports.array(salesforceRecordSchemas.Campaign).max(5e3).default([]),
|
|
58204
58233
|
campaignMembers: external_exports.array(salesforceRecordSchemas.CampaignMember).max(5e3).default([])
|
|
58205
58234
|
}).superRefine((seed2, ctx) => {
|
|
58206
|
-
const
|
|
58235
|
+
const ids2 = /* @__PURE__ */ new Set(), byType = {};
|
|
58207
58236
|
for (const type of salesforceObjectNames) {
|
|
58208
58237
|
const collection = salesforceCollections[type], external2 = /* @__PURE__ */ new Set();
|
|
58209
58238
|
byType[type] = /* @__PURE__ */ new Set();
|
|
58210
58239
|
for (const [index, item2] of seed2[collection].entries()) {
|
|
58211
|
-
if (!item2.Id.startsWith(prefix[type]) ||
|
|
58212
|
-
|
|
58240
|
+
if (!item2.Id.startsWith(prefix[type]) || ids2.has(item2.Id)) ctx.addIssue({ code: "custom", path: [collection, index, "Id"], message: "duplicate ID or wrong object ID prefix" });
|
|
58241
|
+
ids2.add(item2.Id);
|
|
58213
58242
|
byType[type].add(item2.Id);
|
|
58214
58243
|
if (item2.External_Id__c) {
|
|
58215
58244
|
if (external2.has(item2.External_Id__c)) ctx.addIssue({ code: "custom", path: [collection, index, "External_Id__c"], message: "external ID must be unique within its object" });
|
|
@@ -58254,7 +58283,7 @@ var salesforceStarterSeed = {
|
|
|
58254
58283
|
};
|
|
58255
58284
|
|
|
58256
58285
|
// packages/core/src/tools/linkedin-ads.ts
|
|
58257
|
-
var
|
|
58286
|
+
var id5 = external_exports.number().int().positive().max(Number.MAX_SAFE_INTEGER);
|
|
58258
58287
|
var urn = external_exports.string().regex(/^urn:li:[A-Za-z][A-Za-z0-9]*:[A-Za-z0-9_-]+$/);
|
|
58259
58288
|
var accountUrn = external_exports.string().regex(/^urn:li:sponsoredAccount:\d+$/);
|
|
58260
58289
|
var campaignUrn = external_exports.string().regex(/^urn:li:sponsoredCampaign:\d+$/);
|
|
@@ -58266,9 +58295,9 @@ var status3 = external_exports.enum(["DRAFT", "ACTIVE", "PAUSED", "ARCHIVED", "C
|
|
|
58266
58295
|
var facets = external_exports.enum(["urn:li:adTargetingFacet:locations", "urn:li:adTargetingFacet:interfaceLocales", "urn:li:adTargetingFacet:employers", "urn:li:adTargetingFacet:seniorities", "urn:li:adTargetingFacet:jobFunctions"]);
|
|
58267
58296
|
var clause = external_exports.strictObject({ or: external_exports.partialRecord(facets, external_exports.array(urn).min(1)) }).refine((v) => Object.keys(v.or).length > 0, "targeting clause must not be empty");
|
|
58268
58297
|
var LinkedInTargetingSchema = external_exports.strictObject({ include: external_exports.strictObject({ and: external_exports.array(clause).min(1) }), exclude: clause.optional() });
|
|
58269
|
-
var LinkedInAccountSchema = external_exports.strictObject({ id:
|
|
58298
|
+
var LinkedInAccountSchema = external_exports.strictObject({ id: id5, name: external_exports.string().min(1).max(255), currency: external_exports.enum(["USD", "EUR", "GBP", "CAD"]), status: external_exports.enum(["ACTIVE", "DRAFT", "CANCELED"]), type: external_exports.literal("BUSINESS"), test: external_exports.boolean().default(false), reference: organizationUrn });
|
|
58270
58299
|
var LinkedInGroupInputSchema = external_exports.strictObject({ account: accountUrn, name: external_exports.string().min(1).max(100), status: status3, runSchedule: schedule, totalBudget: money2.optional() });
|
|
58271
|
-
var LinkedInGroupSchema = LinkedInGroupInputSchema.extend({ id:
|
|
58300
|
+
var LinkedInGroupSchema = LinkedInGroupInputSchema.extend({ id: id5 });
|
|
58272
58301
|
var LinkedInCampaignInputSchema = external_exports.strictObject({
|
|
58273
58302
|
account: accountUrn,
|
|
58274
58303
|
campaignGroup: groupUrn,
|
|
@@ -58287,7 +58316,7 @@ var LinkedInCampaignInputSchema = external_exports.strictObject({
|
|
|
58287
58316
|
targetingCriteria: LinkedInTargetingSchema,
|
|
58288
58317
|
audienceExpansionEnabled: external_exports.boolean().default(false)
|
|
58289
58318
|
});
|
|
58290
|
-
var LinkedInCampaignSchema = LinkedInCampaignInputSchema.extend({ id:
|
|
58319
|
+
var LinkedInCampaignSchema = LinkedInCampaignInputSchema.extend({ id: id5 });
|
|
58291
58320
|
var LinkedInCreativeInputSchema = external_exports.strictObject({ campaign: campaignUrn, name: external_exports.string().min(1).max(255).optional(), intendedStatus: status3, content: external_exports.strictObject({ reference: urn }) });
|
|
58292
58321
|
var LinkedInCreativeSchema = LinkedInCreativeInputSchema.extend({ id: external_exports.string().regex(/^urn:li:sponsoredCreative:\d+$/), review: external_exports.strictObject({ status: external_exports.enum(["PENDING", "APPROVED", "REJECTED"]) }).optional() });
|
|
58293
58322
|
var contentSchema = external_exports.strictObject({ id: external_exports.string().regex(/^urn:li:(share|ugcPost):\d+$/), account: accountUrn, author: organizationUrn, headline: external_exports.string().min(1), text: external_exports.string().min(1), landingPage: external_exports.url(), assetUrl: external_exports.url().optional() });
|
|
@@ -58303,7 +58332,7 @@ var LinkedInAdsSeedSchema = external_exports.strictObject({
|
|
|
58303
58332
|
contents: external_exports.array(contentSchema).default([]),
|
|
58304
58333
|
analytics: external_exports.array(external_exports.strictObject({ campaign: campaignUrn, date: date7, impressions: external_exports.number().int().nonnegative(), clicks: external_exports.number().int().nonnegative(), oneClickLeads: external_exports.number().int().nonnegative(), costInLocalCurrency: external_exports.string().regex(/^(?:0|[1-9]\d*)(?:\.\d{1,2})?$/) })).default([]),
|
|
58305
58334
|
targetingEntities: external_exports.array(external_exports.strictObject({ facet: facets, urn, name: external_exports.string().min(1) })).default([]),
|
|
58306
|
-
access: external_exports.strictObject({ scopes: external_exports.array(external_exports.enum(["r_ads", "rw_ads", "r_ads_reporting"])).default(["rw_ads", "r_ads_reporting"]), accounts: external_exports.array(external_exports.strictObject({ accountId:
|
|
58335
|
+
access: external_exports.strictObject({ scopes: external_exports.array(external_exports.enum(["r_ads", "rw_ads", "r_ads_reporting"])).default(["rw_ads", "r_ads_reporting"]), accounts: external_exports.array(external_exports.strictObject({ accountId: id5, role: external_exports.enum(["ACCOUNT_MANAGER", "CAMPAIGN_MANAGER", "VIEWER"]) })).default([]) }).default({ scopes: ["rw_ads", "r_ads_reporting"], accounts: [] }),
|
|
58307
58336
|
provenance: external_exports.strictObject({ dataset: external_exports.string(), synthetic: external_exports.literal(true), companyKey: external_exports.string() }).optional()
|
|
58308
58337
|
}).superRefine((s, ctx) => {
|
|
58309
58338
|
const fail = (path2, message4) => ctx.addIssue({ code: "custom", path: path2, message: message4 });
|
|
@@ -58378,7 +58407,7 @@ var linkedinAdsStarterSeed = LinkedInAdsSeedSchema.parse({
|
|
|
58378
58407
|
});
|
|
58379
58408
|
|
|
58380
58409
|
// packages/core/src/tools/ga4.ts
|
|
58381
|
-
var
|
|
58410
|
+
var id6 = external_exports.string().regex(/^[1-9]\d{0,19}$/);
|
|
58382
58411
|
var text2 = external_exports.string().min(1).max(300);
|
|
58383
58412
|
var zone = external_exports.string().max(100).refine((value3) => {
|
|
58384
58413
|
try {
|
|
@@ -58390,12 +58419,12 @@ var zone = external_exports.string().max(100).refine((value3) => {
|
|
|
58390
58419
|
}, "Expected IANA time zone");
|
|
58391
58420
|
var scopes = external_exports.enum(["https://www.googleapis.com/auth/analytics.readonly", "https://www.googleapis.com/auth/analytics"]);
|
|
58392
58421
|
var GA4SeedSchema = external_exports.strictObject({
|
|
58393
|
-
properties: external_exports.array(external_exports.strictObject({ id:
|
|
58394
|
-
principals: external_exports.array(external_exports.strictObject({ id: text2, propertyIds: external_exports.array(
|
|
58422
|
+
properties: external_exports.array(external_exports.strictObject({ id: id6, displayName: text2, timeZone: zone, currencyCode: external_exports.string().regex(/^[A-Z]{3}$/) })).min(1).max(100),
|
|
58423
|
+
principals: external_exports.array(external_exports.strictObject({ id: text2, propertyIds: external_exports.array(id6).min(1).max(100), scopes: external_exports.array(scopes).max(2) })).min(1).max(100),
|
|
58395
58424
|
actor: text2,
|
|
58396
58425
|
sessions: external_exports.array(external_exports.strictObject({
|
|
58397
58426
|
id: text2,
|
|
58398
|
-
propertyId:
|
|
58427
|
+
propertyId: id6,
|
|
58399
58428
|
date: external_exports.iso.date(),
|
|
58400
58429
|
userId: text2,
|
|
58401
58430
|
country: text2,
|
|
@@ -58424,8 +58453,8 @@ var GA4SeedSchema = external_exports.strictObject({
|
|
|
58424
58453
|
seed2.principals.forEach((p2, i) => {
|
|
58425
58454
|
if (new Set(p2.propertyIds).size !== p2.propertyIds.length) issue2(["principals", i, "propertyIds"], "duplicate property");
|
|
58426
58455
|
if (new Set(p2.scopes).size !== p2.scopes.length) issue2(["principals", i, "scopes"], "duplicate scope");
|
|
58427
|
-
p2.propertyIds.forEach((
|
|
58428
|
-
if (!properties.has(
|
|
58456
|
+
p2.propertyIds.forEach((id11, j) => {
|
|
58457
|
+
if (!properties.has(id11)) issue2(["principals", i, "propertyIds", j], "unknown property");
|
|
58429
58458
|
});
|
|
58430
58459
|
});
|
|
58431
58460
|
if (!seed2.principals.some((p2) => p2.id === seed2.actor)) issue2(["actor"], "unknown principal");
|
|
@@ -58465,20 +58494,20 @@ function ga4StarterSeed() {
|
|
|
58465
58494
|
// packages/core/src/tools/hubspot.ts
|
|
58466
58495
|
var hubspotObjectNames = ["companies", "contacts", "deals"];
|
|
58467
58496
|
var hubspotLifecycleStages = ["subscriber", "lead", "marketingqualifiedlead", "salesqualifiedlead", "opportunity", "customer", "evangelist", "other"];
|
|
58468
|
-
var
|
|
58497
|
+
var id7 = external_exports.string().regex(/^[1-9]\d{0,14}$/).refine((v) => Number.isSafeInteger(Number(v)), "ID exceeds the supported integer range");
|
|
58469
58498
|
var text3 = external_exports.string().max(255);
|
|
58470
58499
|
var longText = external_exports.string().max(1e4);
|
|
58471
58500
|
var number4 = external_exports.string().regex(/^(?:\d+(?:\.\d+)?|)$/).refine((v) => v === "" || Number.isFinite(Number(v)));
|
|
58472
58501
|
var integer2 = external_exports.string().regex(/^(?:\d+|)$/).refine((v) => v === "" || Number.isSafeInteger(Number(v)));
|
|
58473
58502
|
var timestamp = external_exports.union([external_exports.iso.datetime({ offset: true }), external_exports.string().regex(/^\d{1,15}$/).refine((v) => Number.isFinite(new Date(Number(v)).getTime())), external_exports.literal("")]);
|
|
58474
58503
|
var lifecycle = external_exports.enum([...hubspotLifecycleStages, ""]);
|
|
58475
|
-
var common2 = { external_id: text3.optional(), hubspot_owner_id: external_exports.union([
|
|
58504
|
+
var common2 = { external_id: text3.optional(), hubspot_owner_id: external_exports.union([id7, external_exports.literal("")]).optional() };
|
|
58476
58505
|
var hubspotPropertySchemas = {
|
|
58477
58506
|
companies: external_exports.strictObject({ ...common2, name: text3.optional(), domain: text3.optional(), website: external_exports.union([external_exports.url(), external_exports.literal("")]).optional(), description: longText.optional(), industry: text3.optional(), city: text3.optional(), state: text3.optional(), country: text3.optional(), phone: text3.optional(), numberofemployees: integer2.optional(), annualrevenue: number4.optional(), lifecyclestage: lifecycle.optional() }),
|
|
58478
58507
|
contacts: external_exports.strictObject({ ...common2, firstname: text3.optional(), lastname: text3.optional(), email: external_exports.union([external_exports.email(), external_exports.literal("")]).optional(), phone: text3.optional(), mobilephone: text3.optional(), company: text3.optional(), jobtitle: text3.optional(), lifecyclestage: lifecycle.optional(), hs_lead_status: external_exports.enum(["NEW", "OPEN", "IN_PROGRESS", "OPEN_DEAL", "UNQUALIFIED", "ATTEMPTED_TO_CONTACT", "CONNECTED", "BAD_TIMING", ""]).optional() }),
|
|
58479
58508
|
deals: external_exports.strictObject({ ...common2, dealname: text3.optional(), amount: number4.optional(), closedate: timestamp.optional(), pipeline: text3.optional(), dealstage: text3.optional(), description: longText.optional(), dealtype: external_exports.enum(["newbusiness", "existingbusiness", ""]).optional() })
|
|
58480
58509
|
};
|
|
58481
|
-
var record2 = (properties) => external_exports.strictObject({ id:
|
|
58510
|
+
var record2 = (properties) => external_exports.strictObject({ id: id7, properties, createdAt: external_exports.iso.datetime().optional(), updatedAt: external_exports.iso.datetime().optional(), archived: external_exports.boolean().default(false) });
|
|
58482
58511
|
var hubspotStageSchema = external_exports.strictObject({ id: text3.min(1), label: text3.min(1), displayOrder: external_exports.number().int().nonnegative(), metadata: external_exports.strictObject({ probability: external_exports.string().regex(/^(?:0(?:\.\d+)?|1(?:\.0+)?)$/), isClosed: external_exports.enum(["true", "false"]).optional() }) });
|
|
58483
58512
|
var hubspotPipelineSchema = external_exports.strictObject({ id: text3.min(1), label: text3.min(1), displayOrder: external_exports.number().int().nonnegative(), stages: external_exports.array(hubspotStageSchema).min(1).max(100), createdAt: external_exports.iso.datetime().optional(), updatedAt: external_exports.iso.datetime().optional() });
|
|
58484
58513
|
var hubspotDefaultScopes = hubspotObjectNames.flatMap((type) => [`crm.objects.${type}.read`, `crm.objects.${type}.write`, `crm.schemas.${type}.read`]);
|
|
@@ -58494,10 +58523,10 @@ var hubspotAssociationTypes = [
|
|
|
58494
58523
|
{ id: 341, name: "deal_to_company_unlabeled", from: "deals", to: "companies", reverse: 342 },
|
|
58495
58524
|
{ id: 342, name: "company_to_deal_unlabeled", from: "companies", to: "deals", reverse: 341 }
|
|
58496
58525
|
];
|
|
58497
|
-
var link = external_exports.strictObject({ type: external_exports.enum(hubspotObjectNames), id:
|
|
58526
|
+
var link = external_exports.strictObject({ type: external_exports.enum(hubspotObjectNames), id: id7 });
|
|
58498
58527
|
var HubSpotSeedSchema = external_exports.strictObject({
|
|
58499
|
-
portal: external_exports.strictObject({ id:
|
|
58500
|
-
access: external_exports.strictObject({ scopes: external_exports.array(external_exports.string().min(1)).max(50).default(hubspotDefaultScopes), deniedCompanyIds: external_exports.array(
|
|
58528
|
+
portal: external_exports.strictObject({ id: id7, name: text3.min(1) }),
|
|
58529
|
+
access: external_exports.strictObject({ scopes: external_exports.array(external_exports.string().min(1)).max(50).default(hubspotDefaultScopes), deniedCompanyIds: external_exports.array(id7).max(5e3).default([]) }).default({ scopes: hubspotDefaultScopes, deniedCompanyIds: [] }),
|
|
58501
58530
|
searchDelayMs: external_exports.number().int().min(0).max(6e4).default(2e3),
|
|
58502
58531
|
companies: external_exports.array(record2(hubspotPropertySchemas.companies)).max(5e3).default([]),
|
|
58503
58532
|
contacts: external_exports.array(record2(hubspotPropertySchemas.contacts)).max(5e3).default([]),
|
|
@@ -58508,13 +58537,13 @@ var HubSpotSeedSchema = external_exports.strictObject({
|
|
|
58508
58537
|
webhooks: external_exports.strictObject({ appId: external_exports.number().int().positive().default(4100001), subscriptions: external_exports.array(external_exports.string().regex(/^(?:company|contact|deal)\.(?:creation|propertyChange:[a-z_]+)$/, "company|contact|deal, then .creation or .propertyChange:<property>")).min(1).max(50) }).optional()
|
|
58509
58538
|
}).superRefine((seed2, ctx) => {
|
|
58510
58539
|
const issue2 = (path2, message4) => ctx.addIssue({ code: "custom", path: path2, message: message4 });
|
|
58511
|
-
const
|
|
58540
|
+
const ids2 = {};
|
|
58512
58541
|
for (const type of hubspotObjectNames) {
|
|
58513
|
-
|
|
58542
|
+
ids2[type] = /* @__PURE__ */ new Set();
|
|
58514
58543
|
const externals = /* @__PURE__ */ new Set(), emails = /* @__PURE__ */ new Set();
|
|
58515
58544
|
seed2[type].forEach((item2, index) => {
|
|
58516
|
-
if (
|
|
58517
|
-
|
|
58545
|
+
if (ids2[type].has(item2.id)) issue2([type, index, "id"], "duplicate record ID");
|
|
58546
|
+
ids2[type].add(item2.id);
|
|
58518
58547
|
const properties = item2.properties;
|
|
58519
58548
|
if (type === "companies" && !properties.name && !properties.domain) issue2([type, index, "properties"], "company requires name or domain");
|
|
58520
58549
|
if (type === "contacts" && !properties.email && !properties.firstname && !properties.lastname) issue2([type, index, "properties"], "contact requires email, firstname or lastname");
|
|
@@ -58548,7 +58577,7 @@ var HubSpotSeedSchema = external_exports.strictObject({
|
|
|
58548
58577
|
seed2.associations.forEach((association, index) => {
|
|
58549
58578
|
const type = hubspotAssociationTypes.find((t) => t.id === association.typeId && t.from === association.from.type && t.to === association.to.type);
|
|
58550
58579
|
if (!type) issue2(["associations", index, "typeId"], "unsupported association type or direction");
|
|
58551
|
-
if (!
|
|
58580
|
+
if (!ids2[association.from.type].has(association.from.id) || !ids2[association.to.type].has(association.to.id)) issue2(["associations", index], "association records must exist");
|
|
58552
58581
|
const key2 = `${association.from.type}/${association.from.id}/${association.to.type}/${association.to.id}/${association.typeId}`;
|
|
58553
58582
|
if (links.has(key2)) issue2(["associations", index], "duplicate association");
|
|
58554
58583
|
links.add(key2);
|
|
@@ -58559,7 +58588,7 @@ var HubSpotSeedSchema = external_exports.strictObject({
|
|
|
58559
58588
|
primary.set(primaryKey, company);
|
|
58560
58589
|
}
|
|
58561
58590
|
});
|
|
58562
|
-
for (const denied of seed2.access.deniedCompanyIds) if (!
|
|
58591
|
+
for (const denied of seed2.access.deniedCompanyIds) if (!ids2.companies.has(denied)) issue2(["access", "deniedCompanyIds"], "denied company must exist");
|
|
58563
58592
|
const plural2 = { company: "companies", contact: "contacts", deal: "deals" };
|
|
58564
58593
|
seed2.webhooks?.subscriptions.forEach((subscription, index) => {
|
|
58565
58594
|
const [type, property2] = subscription.split(":");
|
|
@@ -58656,8 +58685,8 @@ var GongSeedSchema = external_exports.strictObject({
|
|
|
58656
58685
|
for (const kind of ["principals", "users"]) seed2[kind].forEach((p2, i) => {
|
|
58657
58686
|
if (!accounts.has(p2.accountId)) issue2([kind, i, "accountId"], "unknown account");
|
|
58658
58687
|
if (new Set(p2.workspaceIds).size !== p2.workspaceIds.length) issue2([kind, i, "workspaceIds"], "duplicate workspace");
|
|
58659
|
-
p2.workspaceIds.forEach((
|
|
58660
|
-
if (workspaces.get(
|
|
58688
|
+
p2.workspaceIds.forEach((id11, j) => {
|
|
58689
|
+
if (workspaces.get(id11)?.accountId !== p2.accountId) issue2([kind, i, "workspaceIds", j], "workspace must belong to the same account");
|
|
58661
58690
|
});
|
|
58662
58691
|
});
|
|
58663
58692
|
if (!seed2.principals.some((p2) => p2.id === seed2.actor)) issue2(["actor"], "unknown principal");
|
|
@@ -58692,8 +58721,8 @@ var GongSeedSchema = external_exports.strictObject({
|
|
|
58692
58721
|
});
|
|
58693
58722
|
});
|
|
58694
58723
|
});
|
|
58695
|
-
seed2.principals.forEach((p2, i) => p2.allowedCallIds?.forEach((
|
|
58696
|
-
const call2 = calls.get(
|
|
58724
|
+
seed2.principals.forEach((p2, i) => p2.allowedCallIds?.forEach((id11, j) => {
|
|
58725
|
+
const call2 = calls.get(id11);
|
|
58697
58726
|
if (!call2 || workspaces.get(call2.metaData.workspaceId)?.accountId !== p2.accountId || !p2.workspaceIds.includes(call2.metaData.workspaceId)) issue2(["principals", i, "allowedCallIds", j], "allowed call must belong to an accessible workspace");
|
|
58698
58727
|
}));
|
|
58699
58728
|
});
|
|
@@ -58767,10 +58796,10 @@ var OpenMeteoSeedSchema = external_exports.strictObject({
|
|
|
58767
58796
|
limits: external_exports.strictObject({ maxForecastDays: external_exports.number().int().min(1).max(16).default(16), maxPastDays: external_exports.number().int().min(0).max(92).default(7) }).default({ maxForecastDays: 16, maxPastDays: 7 })
|
|
58768
58797
|
}).superRefine((seed2, ctx) => {
|
|
58769
58798
|
const issue2 = (path2, message4) => ctx.addIssue({ code: "custom", path: path2, message: message4 });
|
|
58770
|
-
const
|
|
58799
|
+
const ids2 = /* @__PURE__ */ new Set(), names = /* @__PURE__ */ new Set();
|
|
58771
58800
|
seed2.locations.forEach((location, i) => {
|
|
58772
|
-
if (
|
|
58773
|
-
|
|
58801
|
+
if (ids2.has(location.id)) issue2(["locations", i, "id"], "duplicate location id");
|
|
58802
|
+
ids2.add(location.id);
|
|
58774
58803
|
const key2 = `${location.name.toLowerCase()}|${location.country_code}`;
|
|
58775
58804
|
if (names.has(key2)) issue2(["locations", i, "name"], "duplicate place name in this country");
|
|
58776
58805
|
names.add(key2);
|
|
@@ -59238,7 +59267,7 @@ var GmailSeedSchema = external_exports.strictObject({
|
|
|
59238
59267
|
const key2 = box.address.toLowerCase();
|
|
59239
59268
|
if (addresses2.has(key2)) issue2(["mailboxes", i, "address"], "duplicate mailbox address");
|
|
59240
59269
|
addresses2.add(key2);
|
|
59241
|
-
const names = new Set(GMAIL_SYSTEM_LABELS.map((
|
|
59270
|
+
const names = new Set(GMAIL_SYSTEM_LABELS.map((id11) => id11.toLowerCase()));
|
|
59242
59271
|
box.labels.forEach((l, j) => {
|
|
59243
59272
|
if (names.has(l.name.toLowerCase())) issue2(["mailboxes", i, "labels", j, "name"], "label name is already used, or is a system label");
|
|
59244
59273
|
names.add(l.name.toLowerCase());
|
|
@@ -60601,13 +60630,13 @@ var SupabaseSeedSchema = external_exports.strictObject({
|
|
|
60601
60630
|
objects: external_exports.array(object3).max(5e3).default([])
|
|
60602
60631
|
}).superRefine((seed2, ctx) => {
|
|
60603
60632
|
const issue2 = (path2, message4) => ctx.addIssue({ code: "custom", path: path2, message: message4 });
|
|
60604
|
-
const emails = /* @__PURE__ */ new Set(),
|
|
60633
|
+
const emails = /* @__PURE__ */ new Set(), ids2 = /* @__PURE__ */ new Set(), paths2 = /* @__PURE__ */ new Set();
|
|
60605
60634
|
seed2.users.forEach((u, i) => {
|
|
60606
60635
|
if (emails.has(u.email)) issue2(["users", i, "email"], "duplicate email address");
|
|
60607
60636
|
emails.add(u.email);
|
|
60608
60637
|
if (u.id) {
|
|
60609
|
-
if (
|
|
60610
|
-
|
|
60638
|
+
if (ids2.has(u.id)) issue2(["users", i, "id"], "duplicate user id");
|
|
60639
|
+
ids2.add(u.id);
|
|
60611
60640
|
}
|
|
60612
60641
|
});
|
|
60613
60642
|
if (new Set(seed2.buckets.map((b) => b.id)).size !== seed2.buckets.length) issue2(["buckets"], "duplicate bucket id");
|
|
@@ -62336,9 +62365,9 @@ var LobSeedSchema = external_exports.strictObject({
|
|
|
62336
62365
|
});
|
|
62337
62366
|
const directory = /* @__PURE__ */ new Set();
|
|
62338
62367
|
seed2.directory?.forEach((entry2, i) => {
|
|
62339
|
-
const
|
|
62340
|
-
if (directory.has(
|
|
62341
|
-
directory.add(
|
|
62368
|
+
const id11 = `${entry2.line1}|${entry2.line2 ?? ""}|${entry2.zip.slice(0, 5)}`.toUpperCase();
|
|
62369
|
+
if (directory.has(id11)) issue2(["directory", i], "duplicate address");
|
|
62370
|
+
directory.add(id11);
|
|
62342
62371
|
});
|
|
62343
62372
|
const addresses2 = new Map(seed2.addresses.map((entry2) => [entry2.key, entry2]));
|
|
62344
62373
|
seed2.addresses.forEach((entry2, i) => {
|
|
@@ -62390,9 +62419,9 @@ var LobSeedSchema = external_exports.strictObject({
|
|
|
62390
62419
|
else if (!bank.verified) issue2(["checks", i, "bankAccount"], `${entry2.bankAccount} is not verified`);
|
|
62391
62420
|
if (entry2.message !== void 0 && entry2.checkBottom) issue2(["checks", i, "message"], "a check takes a message or a checkBottom, not both");
|
|
62392
62421
|
if (entry2.checkNumber !== void 0) {
|
|
62393
|
-
const
|
|
62394
|
-
if (checkNumbers.has(
|
|
62395
|
-
checkNumbers.add(
|
|
62422
|
+
const id11 = `${entry2.bankAccount}#${entry2.checkNumber}`;
|
|
62423
|
+
if (checkNumbers.has(id11)) issue2(["checks", i, "checkNumber"], "duplicate check number for this bank account");
|
|
62424
|
+
checkNumbers.add(id11);
|
|
62396
62425
|
}
|
|
62397
62426
|
});
|
|
62398
62427
|
});
|
|
@@ -63149,9 +63178,9 @@ var KalshiSeedSchema = external_exports.strictObject({
|
|
|
63149
63178
|
if (!entry2.ticker.startsWith(`${entry2.series}-`)) issue2(["events", i, "ticker"], "an event ticker starts with its series ticker and a dash");
|
|
63150
63179
|
if (entry2.mutuallyExclusive && entry2.markets.filter((item2) => item2.result === "yes").length > 1) issue2(["events", i, "markets"], "at most one market of a mutually exclusive event resolves Yes");
|
|
63151
63180
|
entry2.markets.forEach((item2, j) => {
|
|
63152
|
-
const at = ["events", i, "markets", j],
|
|
63153
|
-
if (markets.has(
|
|
63154
|
-
markets.set(
|
|
63181
|
+
const at = ["events", i, "markets", j], id11 = `${entry2.ticker}-${item2.suffix}`;
|
|
63182
|
+
if (markets.has(id11)) issue2([...at, "suffix"], "duplicate market");
|
|
63183
|
+
markets.set(id11, item2);
|
|
63155
63184
|
if (parseDuration(item2.close) <= parseDuration(item2.open)) issue2([...at, "close"], "close is not after open");
|
|
63156
63185
|
if (item2.result === void 0 !== (item2.settled === void 0)) issue2([...at, "result"], "result and settled go together");
|
|
63157
63186
|
if (item2.settled !== void 0 && parseDuration(item2.settled) < parseDuration(item2.close)) issue2([...at, "settled"], "a market settles after it closes");
|
|
@@ -63926,13 +63955,13 @@ var GoogleCalendarSeedSchema = external_exports.strictObject({
|
|
|
63926
63955
|
})).max(1e4).default([])
|
|
63927
63956
|
}).superRefine((seed2, ctx) => {
|
|
63928
63957
|
const issue2 = (path2, message4) => ctx.addIssue({ code: "custom", path: path2, message: message4 });
|
|
63929
|
-
const refs = /* @__PURE__ */ new Set(),
|
|
63958
|
+
const refs = /* @__PURE__ */ new Set(), ids2 = /* @__PURE__ */ new Set();
|
|
63930
63959
|
seed2.calendars.forEach((c, i) => {
|
|
63931
63960
|
if (refs.has(c.ref) || c.ref === "primary") issue2(["calendars", i, "ref"], `duplicate calendar ref ${c.ref}`);
|
|
63932
63961
|
refs.add(c.ref);
|
|
63933
63962
|
if (c.id) {
|
|
63934
|
-
if (
|
|
63935
|
-
|
|
63963
|
+
if (ids2.has(c.id) || c.id === seed2.owner.email) issue2(["calendars", i, "id"], "duplicate calendar id");
|
|
63964
|
+
ids2.add(c.id);
|
|
63936
63965
|
}
|
|
63937
63966
|
});
|
|
63938
63967
|
seed2.events.forEach((e, i) => {
|
|
@@ -66015,7 +66044,7 @@ function airtableStarterSeed() {
|
|
|
66015
66044
|
|
|
66016
66045
|
// packages/core/src/tools/carrier-portal.ts
|
|
66017
66046
|
var text10 = external_exports.string().trim().min(1).max(500);
|
|
66018
|
-
var
|
|
66047
|
+
var id8 = external_exports.string().regex(/^[A-Za-z0-9_-]{1,80}$/);
|
|
66019
66048
|
var day4 = external_exports.iso.date();
|
|
66020
66049
|
var CARRIER_REQUEST_TYPES = ["loss-runs", "mailing-address", "add-vehicle", "remove-vehicle", "additional-insured", "certificate"];
|
|
66021
66050
|
var CARRIER_REQUEST_STATUSES = ["Pending", "Ready", "Submitted - underwriter review", "Approved", "Declined"];
|
|
@@ -66035,7 +66064,7 @@ var CarrierRequestFields = {
|
|
|
66035
66064
|
"additional-insured": external_exports.strictObject({ name: text10, address: text10 }),
|
|
66036
66065
|
certificate: external_exports.strictObject({ holder: text10, holder_address: text10, operations: text10, additional_insured: external_exports.boolean(), waiver: external_exports.boolean() })
|
|
66037
66066
|
};
|
|
66038
|
-
var priorHeader = { reference:
|
|
66067
|
+
var priorHeader = { reference: id8, policy: id8, status: external_exports.enum(CARRIER_REQUEST_STATUSES), ready_after_ms: external_exports.number().int().nonnegative().optional() };
|
|
66039
66068
|
var priorRequest = external_exports.discriminatedUnion("type", [
|
|
66040
66069
|
external_exports.strictObject({ ...priorHeader, type: external_exports.literal("loss-runs"), fields: CarrierRequestFields["loss-runs"] }),
|
|
66041
66070
|
external_exports.strictObject({ ...priorHeader, type: external_exports.literal("mailing-address"), fields: CarrierRequestFields["mailing-address"] }),
|
|
@@ -66046,8 +66075,8 @@ var priorRequest = external_exports.discriminatedUnion("type", [
|
|
|
66046
66075
|
]);
|
|
66047
66076
|
var money5 = external_exports.number().nonnegative().max(1e9).multipleOf(0.01);
|
|
66048
66077
|
var claim2 = external_exports.strictObject({
|
|
66049
|
-
number:
|
|
66050
|
-
policy:
|
|
66078
|
+
number: id8,
|
|
66079
|
+
policy: id8,
|
|
66051
66080
|
date_of_loss: day4,
|
|
66052
66081
|
date_reported: day4,
|
|
66053
66082
|
claimant: text10,
|
|
@@ -66059,26 +66088,26 @@ var claim2 = external_exports.strictObject({
|
|
|
66059
66088
|
}).refine((c) => c.date_reported >= c.date_of_loss, { path: ["date_reported"], message: "date reported must be on or after date of loss" });
|
|
66060
66089
|
var CarrierPortalSeedSchema = external_exports.strictObject({
|
|
66061
66090
|
carrier: external_exports.strictObject({ name: text10.default("Larchmont Mutual Insurance Company"), session_timeout_minutes: external_exports.number().int().min(1).max(1440).default(15) }).default({ name: "Larchmont Mutual Insurance Company", session_timeout_minutes: 15 }),
|
|
66062
|
-
agencies: external_exports.array(external_exports.strictObject({ code:
|
|
66063
|
-
users: external_exports.array(external_exports.strictObject({ username:
|
|
66091
|
+
agencies: external_exports.array(external_exports.strictObject({ code: id8, name: text10 })).min(1).max(100),
|
|
66092
|
+
users: external_exports.array(external_exports.strictObject({ username: id8, agency_code: id8, name: text10, password: text10.optional() })).min(1).max(500),
|
|
66064
66093
|
policies: external_exports.array(external_exports.strictObject({
|
|
66065
|
-
number:
|
|
66066
|
-
agency_code:
|
|
66094
|
+
number: id8,
|
|
66095
|
+
agency_code: id8,
|
|
66067
66096
|
insured: text10,
|
|
66068
66097
|
mailing_address: text10,
|
|
66069
66098
|
term_start: day4,
|
|
66070
66099
|
term_end: day4,
|
|
66071
66100
|
status: external_exports.enum(["in force", "expired", "cancelled", "renewal pending"]),
|
|
66072
66101
|
coverages: external_exports.array(external_exports.strictObject({ name: text10, limit: text10 })).max(100).default([]),
|
|
66073
|
-
forms: external_exports.array(external_exports.strictObject({ number:
|
|
66102
|
+
forms: external_exports.array(external_exports.strictObject({ number: id8, title: text10, waiver: external_exports.boolean().default(false) })).max(100).default([]),
|
|
66074
66103
|
vehicles: external_exports.array(vehicle).max(500).default([]),
|
|
66075
66104
|
additional_insureds: external_exports.array(CarrierRequestFields["additional-insured"]).max(500).default([]),
|
|
66076
66105
|
loss_runs_delay_ms: external_exports.number().int().min(0).max(2592e6).default(0)
|
|
66077
66106
|
})).max(5e3),
|
|
66078
66107
|
claims: external_exports.array(claim2).max(2e4).default([]),
|
|
66079
|
-
documents: external_exports.array(external_exports.strictObject({ id:
|
|
66108
|
+
documents: external_exports.array(external_exports.strictObject({ id: id8, policy: id8, title: text10, type: external_exports.enum(["declarations", "endorsement", "binder"]), text: external_exports.string().min(1).max(2e4) })).max(1e4).default([]),
|
|
66080
66109
|
prior_requests: external_exports.array(priorRequest).max(5e3).default([]),
|
|
66081
|
-
messages: external_exports.array(external_exports.strictObject({ id:
|
|
66110
|
+
messages: external_exports.array(external_exports.strictObject({ id: id8, policy: id8, request: id8.optional(), from: external_exports.enum(["underwriter", "agent"]).default("underwriter"), subject: text10, body: external_exports.string().min(1).max(4e3) })).max(5e3).default([])
|
|
66082
66111
|
}).superRefine((seed2, ctx) => {
|
|
66083
66112
|
const issue2 = (path2, message4) => ctx.addIssue({ code: "custom", path: path2, message: message4 });
|
|
66084
66113
|
const unique = (items, path2) => {
|
|
@@ -66118,16 +66147,16 @@ var CarrierPortalSeedSchema = external_exports.strictObject({
|
|
|
66118
66147
|
});
|
|
66119
66148
|
});
|
|
66120
66149
|
var CarrierRequestCheckSchema = external_exports.strictObject({
|
|
66121
|
-
policy:
|
|
66150
|
+
policy: id8,
|
|
66122
66151
|
type: external_exports.enum(CARRIER_REQUEST_TYPES).optional(),
|
|
66123
66152
|
status: external_exports.enum(CARRIER_REQUEST_STATUSES).optional(),
|
|
66124
66153
|
fields: external_exports.record(external_exports.string(), external_exports.union([external_exports.string(), external_exports.number(), external_exports.boolean()])).optional(),
|
|
66125
66154
|
count_gte: external_exports.number().int().nonnegative().default(1)
|
|
66126
66155
|
});
|
|
66127
|
-
var CarrierDownloadCheckSchema = external_exports.strictObject({ policy:
|
|
66128
|
-
var CarrierMessageCheckSchema = external_exports.strictObject({ policy:
|
|
66129
|
-
var CarrierApproveArgsSchema = external_exports.strictObject({ request:
|
|
66130
|
-
var CarrierReplyArgsSchema = external_exports.strictObject({ policy:
|
|
66156
|
+
var CarrierDownloadCheckSchema = external_exports.strictObject({ policy: id8, document: id8.optional(), type: external_exports.enum(["declarations", "endorsement", "binder", "loss-runs"]).optional(), count_gte: external_exports.number().int().nonnegative().default(1) });
|
|
66157
|
+
var CarrierMessageCheckSchema = external_exports.strictObject({ policy: id8, request: id8.optional(), text_contains: text10.optional(), count_gte: external_exports.number().int().nonnegative().default(1) });
|
|
66158
|
+
var CarrierApproveArgsSchema = external_exports.strictObject({ request: id8.optional(), policy: id8.optional(), type: external_exports.enum(CARRIER_REQUEST_TYPES).optional() }).refine((a) => !!a.request || !!a.policy && !!a.type, "give request, or policy and type");
|
|
66159
|
+
var CarrierReplyArgsSchema = external_exports.strictObject({ policy: id8, request: id8.optional(), subject: text10, body: external_exports.string().min(1).max(4e3) });
|
|
66131
66160
|
var carrierPortalStarterSeed = {
|
|
66132
66161
|
agencies: [{ code: "A104", name: "Pike Street Insurance Agency" }, { code: "B208", name: "Lake Road Brokerage" }],
|
|
66133
66162
|
users: [{ username: "rachel", agency_code: "A104", name: "Rachel Brooks" }, { username: "greg", agency_code: "B208", name: "Greg Miller" }],
|
|
@@ -66254,7 +66283,7 @@ var netsuiteRecordTypes = [
|
|
|
66254
66283
|
];
|
|
66255
66284
|
var text11 = external_exports.string().min(1).max(255);
|
|
66256
66285
|
var long = external_exports.string().max(4e3);
|
|
66257
|
-
var
|
|
66286
|
+
var id9 = external_exports.number().int().positive().max(2e9);
|
|
66258
66287
|
var money6 = external_exports.number().finite().refine((value3) => Math.round(value3 * 100) === Number((value3 * 100).toFixed(6)), "at most two decimals");
|
|
66259
66288
|
var positive = money6.refine((value3) => value3 > 0, "must be more than 0");
|
|
66260
66289
|
var day5 = external_exports.string().refine(
|
|
@@ -66263,7 +66292,7 @@ var day5 = external_exports.string().refine(
|
|
|
66263
66292
|
);
|
|
66264
66293
|
var created = external_exports.union([external_exports.iso.datetime({ offset: true }), external_exports.iso.date(), external_exports.string().regex(/^-?\d+d$/)]).optional();
|
|
66265
66294
|
var external = text11.optional();
|
|
66266
|
-
var named = external_exports.union([
|
|
66295
|
+
var named = external_exports.union([id9, text11]).describe("internal ID or name");
|
|
66267
66296
|
var custom2 = external_exports.record(external_exports.string().regex(/^cust(?:entity|body|col|item)[a-z0-9_]+$/), external_exports.union([external_exports.string().max(4e3), external_exports.number(), external_exports.boolean(), external_exports.null()])).optional();
|
|
66268
66297
|
var extra = external_exports.record(external_exports.string().min(1).max(200), external_exports.json()).optional().describe("other fields by NetSuite field ID, served as given; totals and the books never read them");
|
|
66269
66298
|
var address5 = external_exports.strictObject({
|
|
@@ -66280,16 +66309,16 @@ var address5 = external_exports.strictObject({
|
|
|
66280
66309
|
defaultBilling: external_exports.boolean().default(false),
|
|
66281
66310
|
defaultShipping: external_exports.boolean().default(false)
|
|
66282
66311
|
});
|
|
66283
|
-
var segments = { department:
|
|
66284
|
-
var
|
|
66285
|
-
id:
|
|
66312
|
+
var segments = { department: id9.optional(), location: id9.optional(), class: id9.optional() };
|
|
66313
|
+
var entity2 = {
|
|
66314
|
+
id: id9,
|
|
66286
66315
|
entityId: text11.optional(),
|
|
66287
66316
|
companyName: text11,
|
|
66288
66317
|
email: external_exports.email().max(254).optional(),
|
|
66289
66318
|
phone: external_exports.string().max(32).optional(),
|
|
66290
66319
|
fax: external_exports.string().max(32).optional(),
|
|
66291
66320
|
url: external_exports.string().max(400).optional(),
|
|
66292
|
-
terms:
|
|
66321
|
+
terms: id9.optional(),
|
|
66293
66322
|
inactive: external_exports.boolean().default(false),
|
|
66294
66323
|
comments: long.optional(),
|
|
66295
66324
|
externalId: external,
|
|
@@ -66300,22 +66329,22 @@ var entity = {
|
|
|
66300
66329
|
subsidiary: named.optional()
|
|
66301
66330
|
};
|
|
66302
66331
|
var itemLine = external_exports.strictObject({
|
|
66303
|
-
item:
|
|
66332
|
+
item: id9,
|
|
66304
66333
|
quantity: external_exports.number().positive().default(1),
|
|
66305
66334
|
rate: money6.optional(),
|
|
66306
66335
|
description: long.optional(),
|
|
66307
|
-
location:
|
|
66308
|
-
department:
|
|
66309
|
-
class:
|
|
66336
|
+
location: id9.optional(),
|
|
66337
|
+
department: id9.optional(),
|
|
66338
|
+
class: id9.optional(),
|
|
66310
66339
|
closed: external_exports.boolean().default(false),
|
|
66311
66340
|
custom: custom2,
|
|
66312
66341
|
extra
|
|
66313
66342
|
});
|
|
66314
|
-
var expenseLine = external_exports.strictObject({ account:
|
|
66315
|
-
var application = external_exports.strictObject({ doc:
|
|
66343
|
+
var expenseLine = external_exports.strictObject({ account: id9, amount: positive, memo: long.optional(), ...segments, closed: external_exports.boolean().default(false), custom: custom2, extra });
|
|
66344
|
+
var application = external_exports.strictObject({ doc: id9, line: external_exports.number().int().nonnegative().optional(), amount: positive });
|
|
66316
66345
|
var tx = {
|
|
66317
|
-
id:
|
|
66318
|
-
createdBy:
|
|
66346
|
+
id: id9,
|
|
66347
|
+
createdBy: id9.optional(),
|
|
66319
66348
|
tranId: text11.optional(),
|
|
66320
66349
|
date: day5,
|
|
66321
66350
|
memo: long.optional(),
|
|
@@ -66324,13 +66353,13 @@ var tx = {
|
|
|
66324
66353
|
custom: custom2,
|
|
66325
66354
|
extra,
|
|
66326
66355
|
subsidiary: named.optional().describe("internal ID or name; else the customer's or vendor's"),
|
|
66327
|
-
currency:
|
|
66356
|
+
currency: id9.optional().describe("else the customer's or vendor's"),
|
|
66328
66357
|
exchangeRate: external_exports.number().positive().optional().describe("to the base currency; else 1")
|
|
66329
66358
|
};
|
|
66330
|
-
var shipLine = external_exports.strictObject({ item:
|
|
66359
|
+
var shipLine = external_exports.strictObject({ item: id9, quantity: external_exports.number().positive(), location: id9.optional(), extra });
|
|
66331
66360
|
var plainRecord = external_exports.strictObject({
|
|
66332
66361
|
type: external_exports.string().regex(/^[A-Za-z][A-Za-z0-9_]{0,99}$/).describe("the REST record type, e.g. customrecord_portfolio_kpi or project"),
|
|
66333
|
-
id: external_exports.union([
|
|
66362
|
+
id: external_exports.union([id9, external_exports.string().regex(/^\d{1,10}$/).transform(Number).pipe(id9)]).describe("internal ID, unique within the type"),
|
|
66334
66363
|
externalId: external,
|
|
66335
66364
|
fields: external_exports.record(external_exports.string().min(1).max(200), external_exports.json()).default({}).describe("field ID \u2192 value as given: text, number, boolean, null, { id, refName }, objects, sublists")
|
|
66336
66365
|
});
|
|
@@ -66353,9 +66382,9 @@ var NetsuiteSeedFieldsSchema = external_exports.strictObject({
|
|
|
66353
66382
|
/** New vendor bills wait for approval, and only an approved bill can be paid. */
|
|
66354
66383
|
billApproval: external_exports.boolean().default(true),
|
|
66355
66384
|
reconcile: external_exports.enum(["none", "view", "create", "edit", "full"]).default("full"),
|
|
66356
|
-
bankingAccounts: external_exports.array(
|
|
66357
|
-
bankingSubsidiaries: external_exports.array(
|
|
66358
|
-
bankingTransactions: external_exports.array(
|
|
66385
|
+
bankingAccounts: external_exports.array(id9).optional(),
|
|
66386
|
+
bankingSubsidiaries: external_exports.array(id9).optional(),
|
|
66387
|
+
bankingTransactions: external_exports.array(id9).optional(),
|
|
66359
66388
|
/** The integration's role may approve and reject vendor bills. */
|
|
66360
66389
|
approveBills: external_exports.boolean().default(true),
|
|
66361
66390
|
/** New sales orders wait for approval before they can be fulfilled or billed. */
|
|
@@ -66367,25 +66396,25 @@ var NetsuiteSeedFieldsSchema = external_exports.strictObject({
|
|
|
66367
66396
|
/** Accounting periods through this month (YYYY-MM, or -1m for the month before the scene's) are closed: no posting into them. */
|
|
66368
66397
|
closedThrough: external_exports.string().regex(/^(?:\d{4}-(?:0[1-9]|1[0-2])|-\d+m)$/).optional()
|
|
66369
66398
|
}).default({ reconcile: "full", billApproval: true, approveBills: true, salesOrderApproval: false, purchaseOrderApproval: false, returnApproval: false }),
|
|
66370
|
-
subsidiaries: external_exports.array(external_exports.strictObject({ id:
|
|
66371
|
-
currencies: external_exports.array(external_exports.strictObject({ id:
|
|
66399
|
+
subsidiaries: external_exports.array(external_exports.strictObject({ id: id9, name: text11, legalName: text11.optional(), country: external_exports.string().regex(/^[A-Z]{2}$/).default("US"), extra })).min(1).max(50).default([{ id: 1, name: "Acme", country: "US" }]),
|
|
66400
|
+
currencies: external_exports.array(external_exports.strictObject({ id: id9, name: text11, symbol: external_exports.string().regex(/^[A-Z]{3}$/), exchangeRate: external_exports.number().positive().default(1), extra })).min(1).max(50).default([{ id: 1, name: "US Dollar", symbol: "USD", exchangeRate: 1 }]),
|
|
66372
66401
|
terms: external_exports.array(external_exports.strictObject({
|
|
66373
|
-
id:
|
|
66402
|
+
id: id9,
|
|
66374
66403
|
name: text11,
|
|
66375
66404
|
days: external_exports.number().int().min(0).max(365),
|
|
66376
66405
|
discountPercent: external_exports.number().min(0).max(100).optional(),
|
|
66377
66406
|
discountDays: external_exports.number().int().min(0).max(365).optional(),
|
|
66378
66407
|
extra
|
|
66379
66408
|
})).max(50).default([{ id: 1, name: "Net 15", days: 15 }, { id: 2, name: "Net 30", days: 30 }, { id: 3, name: "Due on receipt", days: 0 }]),
|
|
66380
|
-
departments: external_exports.array(external_exports.strictObject({ id:
|
|
66381
|
-
locations: external_exports.array(external_exports.strictObject({ id:
|
|
66382
|
-
classes: external_exports.array(external_exports.strictObject({ id:
|
|
66409
|
+
departments: external_exports.array(external_exports.strictObject({ id: id9, name: text11, parent: id9.optional(), inactive: external_exports.boolean().default(false), extra })).max(500).default([]),
|
|
66410
|
+
locations: external_exports.array(external_exports.strictObject({ id: id9, name: text11, parent: id9.optional(), inactive: external_exports.boolean().default(false), address: address5.omit({ defaultBilling: true, defaultShipping: true }).optional(), extra })).max(500).default([]),
|
|
66411
|
+
classes: external_exports.array(external_exports.strictObject({ id: id9, name: text11, parent: id9.optional(), inactive: external_exports.boolean().default(false), extra })).max(500).default([]),
|
|
66383
66412
|
accounts: external_exports.array(external_exports.strictObject({
|
|
66384
|
-
id:
|
|
66413
|
+
id: id9,
|
|
66385
66414
|
number: external_exports.string().max(60).optional(),
|
|
66386
66415
|
name: text11,
|
|
66387
66416
|
type: external_exports.enum(NETSUITE_ACCOUNT_TYPES),
|
|
66388
|
-
parent:
|
|
66417
|
+
parent: id9.optional(),
|
|
66389
66418
|
description: long.optional(),
|
|
66390
66419
|
inactive: external_exports.boolean().default(false),
|
|
66391
66420
|
useMatchBankData: external_exports.boolean().default(true),
|
|
@@ -66393,23 +66422,23 @@ var NetsuiteSeedFieldsSchema = external_exports.strictObject({
|
|
|
66393
66422
|
extra
|
|
66394
66423
|
})).max(500).default([]),
|
|
66395
66424
|
/** Expense report categories and the account each one posts to. */
|
|
66396
|
-
expenseCategories: external_exports.array(external_exports.strictObject({ id:
|
|
66425
|
+
expenseCategories: external_exports.array(external_exports.strictObject({ id: id9, name: text11, account: id9, inactive: external_exports.boolean().default(false), extra })).max(200).default([]),
|
|
66397
66426
|
/** Exchange rates by date: one transaction currency against the base currency. */
|
|
66398
|
-
currencyRates: external_exports.array(external_exports.strictObject({ id:
|
|
66427
|
+
currencyRates: external_exports.array(external_exports.strictObject({ id: id9, currency: id9, rate: external_exports.number().positive(), date: day5, extra })).max(5e3).default([]),
|
|
66399
66428
|
customers: external_exports.array(external_exports.strictObject({
|
|
66400
|
-
...
|
|
66429
|
+
...entity2,
|
|
66401
66430
|
companyName: text11.optional(),
|
|
66402
66431
|
isPerson: external_exports.boolean().default(false),
|
|
66403
66432
|
firstName: text11.optional(),
|
|
66404
66433
|
lastName: text11.optional(),
|
|
66405
66434
|
creditLimit: money6.optional(),
|
|
66406
66435
|
creditHold: external_exports.enum(["AUTO", "ON", "OFF"]).default("AUTO"),
|
|
66407
|
-
salesRep:
|
|
66408
|
-
currency:
|
|
66436
|
+
salesRep: id9.optional(),
|
|
66437
|
+
currency: id9.optional()
|
|
66409
66438
|
})).max(5e3).default([]),
|
|
66410
|
-
vendors: external_exports.array(external_exports.strictObject({ ...
|
|
66439
|
+
vendors: external_exports.array(external_exports.strictObject({ ...entity2, legalName: text11.optional(), accountNumber: external_exports.string().max(99).optional(), is1099Eligible: external_exports.boolean().default(false), currency: id9.optional() })).max(5e3).default([]),
|
|
66411
66440
|
contacts: external_exports.array(external_exports.strictObject({
|
|
66412
|
-
id:
|
|
66441
|
+
id: id9,
|
|
66413
66442
|
firstName: text11,
|
|
66414
66443
|
lastName: text11.optional(),
|
|
66415
66444
|
title: text11.optional(),
|
|
@@ -66417,7 +66446,7 @@ var NetsuiteSeedFieldsSchema = external_exports.strictObject({
|
|
|
66417
66446
|
phone: external_exports.string().max(32).optional(),
|
|
66418
66447
|
dateCreated: created,
|
|
66419
66448
|
mobilePhone: external_exports.string().max(32).optional(),
|
|
66420
|
-
company:
|
|
66449
|
+
company: id9.optional(),
|
|
66421
66450
|
inactive: external_exports.boolean().default(false),
|
|
66422
66451
|
comments: long.optional(),
|
|
66423
66452
|
externalId: external,
|
|
@@ -66425,14 +66454,14 @@ var NetsuiteSeedFieldsSchema = external_exports.strictObject({
|
|
|
66425
66454
|
extra
|
|
66426
66455
|
})).max(5e3).default([]),
|
|
66427
66456
|
employees: external_exports.array(external_exports.strictObject({
|
|
66428
|
-
id:
|
|
66457
|
+
id: id9,
|
|
66429
66458
|
firstName: text11,
|
|
66430
66459
|
lastName: text11,
|
|
66431
66460
|
title: text11.optional(),
|
|
66432
66461
|
email: external_exports.email().max(254).optional(),
|
|
66433
66462
|
phone: external_exports.string().max(32).optional(),
|
|
66434
66463
|
dateCreated: created,
|
|
66435
|
-
supervisor:
|
|
66464
|
+
supervisor: id9.optional(),
|
|
66436
66465
|
...segments,
|
|
66437
66466
|
salesRep: external_exports.boolean().default(false),
|
|
66438
66467
|
hireDate: day5.optional(),
|
|
@@ -66445,105 +66474,105 @@ var NetsuiteSeedFieldsSchema = external_exports.strictObject({
|
|
|
66445
66474
|
subsidiary: named.optional()
|
|
66446
66475
|
})).max(5e3).default([]),
|
|
66447
66476
|
items: external_exports.array(external_exports.strictObject({
|
|
66448
|
-
id:
|
|
66477
|
+
id: id9,
|
|
66449
66478
|
type: external_exports.enum(NETSUITE_ITEM_TYPES).default("serviceSaleItem"),
|
|
66450
66479
|
itemId: text11,
|
|
66451
|
-
parent:
|
|
66480
|
+
parent: id9.optional(),
|
|
66452
66481
|
displayName: text11.optional(),
|
|
66453
66482
|
description: long.optional(),
|
|
66454
66483
|
purchaseDescription: long.optional(),
|
|
66455
66484
|
rate: money6.optional(),
|
|
66456
66485
|
cost: money6.optional(),
|
|
66457
|
-
incomeAccount:
|
|
66458
|
-
expenseAccount:
|
|
66459
|
-
assetAccount:
|
|
66460
|
-
cogsAccount:
|
|
66461
|
-
vendor:
|
|
66486
|
+
incomeAccount: id9.optional(),
|
|
66487
|
+
expenseAccount: id9.optional(),
|
|
66488
|
+
assetAccount: id9.optional(),
|
|
66489
|
+
cogsAccount: id9.optional(),
|
|
66490
|
+
vendor: id9.optional(),
|
|
66462
66491
|
inactive: external_exports.boolean().default(false),
|
|
66463
66492
|
externalId: external,
|
|
66464
66493
|
custom: custom2,
|
|
66465
66494
|
extra,
|
|
66466
66495
|
/** An inventory item's opening quantity by location, at a unit cost (its cost if left out). */
|
|
66467
|
-
onHand: external_exports.array(external_exports.strictObject({ location:
|
|
66496
|
+
onHand: external_exports.array(external_exports.strictObject({ location: id9, quantity: external_exports.number().min(0), unitCost: money6.optional() })).max(100).default([])
|
|
66468
66497
|
})).max(5e3).default([]),
|
|
66469
|
-
estimates: external_exports.array(external_exports.strictObject({ ...tx, customer:
|
|
66498
|
+
estimates: external_exports.array(external_exports.strictObject({ ...tx, customer: id9, terms: id9.optional(), dueDate: day5.optional(), title: text11.optional(), lines: external_exports.array(itemLine).min(1).max(500) })).max(5e3).default([]),
|
|
66470
66499
|
salesOrders: external_exports.array(external_exports.strictObject({
|
|
66471
66500
|
...tx,
|
|
66472
|
-
customer:
|
|
66473
|
-
terms:
|
|
66501
|
+
customer: id9,
|
|
66502
|
+
terms: id9.optional(),
|
|
66474
66503
|
pendingApproval: external_exports.boolean().default(false),
|
|
66475
|
-
estimate:
|
|
66476
|
-
salesRep:
|
|
66504
|
+
estimate: id9.optional(),
|
|
66505
|
+
salesRep: id9.optional(),
|
|
66477
66506
|
lines: external_exports.array(itemLine).min(1).max(500)
|
|
66478
66507
|
})).max(5e3).default([]),
|
|
66479
66508
|
/** A fulfillment ships an order's lines; shipped (the default) moves inventory and posts its cost. */
|
|
66480
|
-
itemFulfillments: external_exports.array(external_exports.strictObject({ ...tx, salesOrder:
|
|
66509
|
+
itemFulfillments: external_exports.array(external_exports.strictObject({ ...tx, salesOrder: id9, shipStatus: external_exports.enum(["picked", "packed", "shipped"]).default("shipped"), lines: external_exports.array(shipLine).min(1).max(500) })).max(5e3).default([]),
|
|
66481
66510
|
/** An invoice billed from a sales order names it in `salesOrder`; its lines bill that order's lines, by item. */
|
|
66482
|
-
invoices: external_exports.array(external_exports.strictObject({ ...tx, customer:
|
|
66483
|
-
cashSales: external_exports.array(external_exports.strictObject({ ...tx, customer:
|
|
66484
|
-
cashRefunds: external_exports.array(external_exports.strictObject({ ...tx, customer:
|
|
66485
|
-
creditMemos: external_exports.array(external_exports.strictObject({ ...tx, customer:
|
|
66511
|
+
invoices: external_exports.array(external_exports.strictObject({ ...tx, customer: id9, terms: id9.optional(), dueDate: day5.optional(), salesOrder: id9.optional(), salesRep: id9.optional(), lines: external_exports.array(itemLine).min(1).max(500) })).max(5e3).default([]),
|
|
66512
|
+
cashSales: external_exports.array(external_exports.strictObject({ ...tx, customer: id9, account: id9.optional(), lines: external_exports.array(itemLine).min(1).max(500) })).max(5e3).default([]),
|
|
66513
|
+
cashRefunds: external_exports.array(external_exports.strictObject({ ...tx, customer: id9, account: id9.optional(), cashSale: id9.optional(), lines: external_exports.array(itemLine.extend({ quantity: external_exports.number().nonnegative().default(1), amount: money6.optional() })).min(1).max(500) })).max(5e3).default([]),
|
|
66514
|
+
creditMemos: external_exports.array(external_exports.strictObject({ ...tx, customer: id9, lines: external_exports.array(itemLine).min(1).max(500), apply: external_exports.array(application).max(500).default([]) })).max(5e3).default([]),
|
|
66486
66515
|
customerPayments: external_exports.array(external_exports.strictObject({
|
|
66487
66516
|
...tx,
|
|
66488
|
-
customer:
|
|
66517
|
+
customer: id9,
|
|
66489
66518
|
amount: money6.refine((v) => v >= 0, "must be nonnegative"),
|
|
66490
|
-
arAcct:
|
|
66519
|
+
arAcct: id9.optional(),
|
|
66491
66520
|
credit: external_exports.array(application).max(500).default([]),
|
|
66492
|
-
account:
|
|
66521
|
+
account: id9.optional(),
|
|
66493
66522
|
checkNumber: external_exports.string().max(60).optional(),
|
|
66494
66523
|
apply: external_exports.array(application).max(500).default([])
|
|
66495
66524
|
})).max(5e3).default([]),
|
|
66496
|
-
customerDeposits: external_exports.array(external_exports.strictObject({ ...tx, customer:
|
|
66497
|
-
customerRefunds: external_exports.array(external_exports.strictObject({ ...tx, customer:
|
|
66525
|
+
customerDeposits: external_exports.array(external_exports.strictObject({ ...tx, customer: id9, amount: positive, account: id9.optional(), salesOrder: id9.optional() })).max(5e3).default([]),
|
|
66526
|
+
customerRefunds: external_exports.array(external_exports.strictObject({ ...tx, customer: id9, account: id9.optional(), apply: external_exports.array(application).min(1).max(500) })).max(5e3).default([]),
|
|
66498
66527
|
purchaseOrders: external_exports.array(external_exports.strictObject({
|
|
66499
66528
|
...tx,
|
|
66500
|
-
vendor:
|
|
66501
|
-
terms:
|
|
66529
|
+
vendor: id9,
|
|
66530
|
+
terms: id9.optional(),
|
|
66502
66531
|
dueDate: day5.optional(),
|
|
66503
66532
|
pendingApproval: external_exports.boolean().default(false),
|
|
66504
|
-
employee:
|
|
66533
|
+
employee: id9.optional(),
|
|
66505
66534
|
lines: external_exports.array(itemLine).max(500).default([]),
|
|
66506
66535
|
expenses: external_exports.array(expenseLine).max(500).default([])
|
|
66507
66536
|
})).max(5e3).default([]),
|
|
66508
|
-
itemReceipts: external_exports.array(external_exports.strictObject({ ...tx, purchaseOrder:
|
|
66537
|
+
itemReceipts: external_exports.array(external_exports.strictObject({ ...tx, purchaseOrder: id9, lines: external_exports.array(shipLine).min(1).max(500) })).max(5e3).default([]),
|
|
66509
66538
|
/** `tranId` on a bill is the vendor's own invoice number; a bill from a purchase order names it and bills its lines by item. */
|
|
66510
66539
|
vendorBills: external_exports.array(external_exports.strictObject({
|
|
66511
66540
|
...tx,
|
|
66512
|
-
vendor:
|
|
66513
|
-
terms:
|
|
66541
|
+
vendor: id9,
|
|
66542
|
+
terms: id9.optional(),
|
|
66514
66543
|
dueDate: day5.optional(),
|
|
66515
66544
|
approval: external_exports.enum(["pending", "approved", "rejected"]).optional(),
|
|
66516
|
-
purchaseOrder:
|
|
66545
|
+
purchaseOrder: id9.optional(),
|
|
66517
66546
|
expenses: external_exports.array(expenseLine).max(500).default([]),
|
|
66518
66547
|
lines: external_exports.array(itemLine).max(500).default([])
|
|
66519
66548
|
})).max(5e3).default([]),
|
|
66520
66549
|
vendorCredits: external_exports.array(external_exports.strictObject({
|
|
66521
66550
|
...tx,
|
|
66522
|
-
vendor:
|
|
66551
|
+
vendor: id9,
|
|
66523
66552
|
expenses: external_exports.array(expenseLine).max(500).default([]),
|
|
66524
66553
|
lines: external_exports.array(itemLine).max(500).default([]),
|
|
66525
66554
|
apply: external_exports.array(application).max(500).default([])
|
|
66526
66555
|
})).max(5e3).default([]),
|
|
66527
|
-
vendorPayments: external_exports.array(external_exports.strictObject({ ...tx, vendor:
|
|
66556
|
+
vendorPayments: external_exports.array(external_exports.strictObject({ ...tx, vendor: id9, amount: money6.refine((v) => v >= 0, "must be nonnegative"), apAcct: id9.optional(), credit: external_exports.array(application).max(500).default([]), account: id9.optional(), apply: external_exports.array(application).max(500).default([]) })).max(5e3).default([]),
|
|
66528
66557
|
journalEntries: external_exports.array(external_exports.strictObject({ ...tx, approval: external_exports.enum(["pending", "approved"]).optional(), lines: external_exports.array(external_exports.strictObject({
|
|
66529
|
-
account:
|
|
66558
|
+
account: id9,
|
|
66530
66559
|
debit: positive.optional(),
|
|
66531
66560
|
credit: positive.optional(),
|
|
66532
66561
|
memo: long.optional(),
|
|
66533
|
-
entity:
|
|
66562
|
+
entity: id9.optional(),
|
|
66534
66563
|
...segments,
|
|
66535
66564
|
extra
|
|
66536
66565
|
})).min(2).max(500) })).max(5e3).default([]),
|
|
66537
66566
|
expenseReports: external_exports.array(external_exports.strictObject({
|
|
66538
66567
|
...tx,
|
|
66539
|
-
employee:
|
|
66568
|
+
employee: id9,
|
|
66540
66569
|
status: external_exports.enum(["inProgress", "pendingSupervisor", "pendingAccounting", "approved", "rejected"]).default("pendingSupervisor"),
|
|
66541
|
-
expenses: external_exports.array(external_exports.strictObject({ category:
|
|
66570
|
+
expenses: external_exports.array(external_exports.strictObject({ category: id9, amount: positive, date: day5.optional(), memo: long.optional(), ...segments, extra })).min(1).max(500)
|
|
66542
66571
|
})).max(5e3).default([]),
|
|
66543
66572
|
bankingTransactions: external_exports.array(external_exports.strictObject({
|
|
66544
|
-
id:
|
|
66545
|
-
account:
|
|
66546
|
-
subsidiary:
|
|
66573
|
+
id: id9,
|
|
66574
|
+
account: id9,
|
|
66575
|
+
subsidiary: id9.optional(),
|
|
66547
66576
|
date: day5,
|
|
66548
66577
|
amount: money6.refine((v) => v !== 0, "must be nonzero"),
|
|
66549
66578
|
memo: long.optional(),
|
|
@@ -66551,10 +66580,10 @@ var NetsuiteSeedFieldsSchema = external_exports.strictObject({
|
|
|
66551
66580
|
extra
|
|
66552
66581
|
})).max(5e3).default([]),
|
|
66553
66582
|
bankRecSuggestions: external_exports.array(external_exports.strictObject({
|
|
66554
|
-
id:
|
|
66583
|
+
id: id9,
|
|
66555
66584
|
type: external_exports.enum(["match", "apply"]).default("match"),
|
|
66556
|
-
importedTransactions: external_exports.array(
|
|
66557
|
-
transactions: external_exports.array(external_exports.strictObject({ doc:
|
|
66585
|
+
importedTransactions: external_exports.array(id9).min(1).max(500),
|
|
66586
|
+
transactions: external_exports.array(external_exports.strictObject({ doc: id9, line: external_exports.number().int().min(0) })).max(500).default([]),
|
|
66558
66587
|
apply: external_exports.array(application).max(500).default([])
|
|
66559
66588
|
})).max(5e3).default([]),
|
|
66560
66589
|
/** Custom fields by script ID; the prefix says what they apply to (custentity_ entities, custbody_ transactions, custcol_ transaction lines, custitem_ items). */
|
|
@@ -66565,14 +66594,14 @@ var NetsuiteSeedFieldsSchema = external_exports.strictObject({
|
|
|
66565
66594
|
/** REST record types the field shows on; every type of its kind if left out. */
|
|
66566
66595
|
appliesTo: external_exports.array(external_exports.string()).max(60).optional(),
|
|
66567
66596
|
/** A select field lists either these values or records of this type. */
|
|
66568
|
-
options: external_exports.array(external_exports.strictObject({ id:
|
|
66597
|
+
options: external_exports.array(external_exports.strictObject({ id: id9, name: text11 })).max(500).optional(),
|
|
66569
66598
|
source: external_exports.string().max(60).optional(),
|
|
66570
66599
|
mandatory: external_exports.boolean().default(false)
|
|
66571
66600
|
})).max(500).default([]),
|
|
66572
66601
|
/** Saved searches as ns_listSavedSearches and ns_runSavedSearch see them: NetSuite's filter expression and columns. */
|
|
66573
66602
|
savedSearches: external_exports.array(external_exports.strictObject({
|
|
66574
66603
|
id: external_exports.string().regex(/^customsearch[a-z0-9_]*$/),
|
|
66575
|
-
internalId:
|
|
66604
|
+
internalId: id9,
|
|
66576
66605
|
title: text11,
|
|
66577
66606
|
type: external_exports.enum(["transaction", "customer", "vendor", "item", "employee", "contact", "account"]),
|
|
66578
66607
|
isPublic: external_exports.boolean().default(true),
|
|
@@ -66582,17 +66611,17 @@ var NetsuiteSeedFieldsSchema = external_exports.strictObject({
|
|
|
66582
66611
|
external_exports.strictObject({ name: external_exports.string().max(100), join: external_exports.string().regex(/^[a-zA-Z][a-zA-Z0-9]*$/).optional(), formula: external_exports.string().min(1).max(1e3).optional(), summary: external_exports.enum(["group", "count", "sum", "avg", "min", "max"]).optional(), label: text11.optional() })
|
|
66583
66612
|
])).min(1).max(100)
|
|
66584
66613
|
})).max(500).default([]),
|
|
66585
|
-
folders: external_exports.array(external_exports.strictObject({ id:
|
|
66614
|
+
folders: external_exports.array(external_exports.strictObject({ id: id9, name: text11, parent: id9.optional() })).max(1e3).default([]),
|
|
66586
66615
|
files: external_exports.array(external_exports.strictObject({
|
|
66587
|
-
id:
|
|
66616
|
+
id: id9,
|
|
66588
66617
|
name: text11,
|
|
66589
|
-
folder:
|
|
66618
|
+
folder: id9,
|
|
66590
66619
|
fileType: external_exports.string().regex(/^[A-Z0-9_]+$/).default("PDF"),
|
|
66591
66620
|
description: long.optional(),
|
|
66592
66621
|
content: external_exports.string().max(1e5).optional(),
|
|
66593
66622
|
size: external_exports.number().int().min(0).optional(),
|
|
66594
66623
|
/** Records the file is attached to. */
|
|
66595
|
-
attachedTo: external_exports.array(external_exports.strictObject({ type: external_exports.string().max(60), id:
|
|
66624
|
+
attachedTo: external_exports.array(external_exports.strictObject({ type: external_exports.string().max(60), id: id9 })).max(50).default([])
|
|
66596
66625
|
})).max(5e3).default([]),
|
|
66597
66626
|
/** Records of every other type, kept and served as given: REST (list, get, create, update, delete, eid:), SuiteQL and the metadata catalog. */
|
|
66598
66627
|
records: external_exports.array(plainRecord).max(1e5).default([]).describe("records of other types (customrecord_*, project, timeBill...), served as given")
|
|
@@ -66638,56 +66667,56 @@ function recordNamer(seed2) {
|
|
|
66638
66667
|
return void 0;
|
|
66639
66668
|
};
|
|
66640
66669
|
const currency = (path2) => {
|
|
66641
|
-
const found = record4(path2),
|
|
66642
|
-
return (
|
|
66670
|
+
const found = record4(path2), id11 = netsuiteListId(seed2.currencies, found?.row.currency) ?? netsuiteListId(seed2.currencies, found && parties.get(party2(found.row)?.id ?? -1)?.currency) ?? seed2.currencies[0]?.id;
|
|
66671
|
+
return (id11 === void 0 ? void 0 : symbols.get(id11)) ?? "USD";
|
|
66643
66672
|
};
|
|
66644
66673
|
const label5 = (path2) => {
|
|
66645
66674
|
const found = record4(path2);
|
|
66646
66675
|
if (!found) return void 0;
|
|
66647
|
-
const { list, row } = found,
|
|
66676
|
+
const { list, row } = found, id11 = row.id === void 0 ? "" : `id ${String(row.id)}`;
|
|
66648
66677
|
const name3 = row.companyName ?? (row.firstName !== void 0 ? person3(row) : void 0) ?? row.name ?? row.displayName ?? row.title;
|
|
66649
|
-
if (list === "accounts") return `${[row.number, row.name].filter(Boolean).join(" ")} (${
|
|
66650
|
-
if (list === "items") return `${String(row.itemId ?? name3 ?? singular(list))} (${
|
|
66678
|
+
if (list === "accounts") return `${[row.number, row.name].filter(Boolean).join(" ")} (${id11})`;
|
|
66679
|
+
if (list === "items") return `${String(row.itemId ?? name3 ?? singular(list))} (${id11})`;
|
|
66651
66680
|
if (["customers", "vendors", "contacts", "employees"].includes(list)) {
|
|
66652
|
-
return `${String(row.entityId ?? name3 ?? singular(list))} (${[
|
|
66681
|
+
return `${String(row.entityId ?? name3 ?? singular(list))} (${[id11, row.externalId !== void 0 && `external ID ${String(row.externalId)}`].filter(Boolean).join(", ")})`;
|
|
66653
66682
|
}
|
|
66654
66683
|
if ("date" in row || "tranId" in row) {
|
|
66655
66684
|
const who = party2(row);
|
|
66656
|
-
return `${String(row.tranId ?? row.externalId ?? singular(list).trim())} (${[
|
|
66685
|
+
return `${String(row.tranId ?? row.externalId ?? singular(list).trim())} (${[id11, who && `${who.kind ?? "entity"} ${who.id}${who.name ? ` ${who.name}` : ""}`].filter(Boolean).join(", ")})`;
|
|
66657
66686
|
}
|
|
66658
|
-
return name3 !== void 0 ||
|
|
66687
|
+
return name3 !== void 0 || id11 ? `${name3 ?? singular(list).trim()}${id11 ? ` (${id11})` : ""}` : void 0;
|
|
66659
66688
|
};
|
|
66660
66689
|
const value3 = (path2) => {
|
|
66661
66690
|
let at = seed2;
|
|
66662
66691
|
for (const part of pathParts(path2)) at = at && typeof at === "object" ? at[part] : void 0;
|
|
66663
66692
|
return typeof at === "number" || typeof at === "string" ? at : void 0;
|
|
66664
66693
|
};
|
|
66665
|
-
const
|
|
66694
|
+
const money9 = (path2, amount2) => {
|
|
66666
66695
|
const cents3 = Math.round(Math.abs(amount2) * 100), whole = Math.floor(cents3 / 100).toString().replace(/\B(?=(\d{3})+(?!\d))/g, ",");
|
|
66667
66696
|
return `${currency(path2)} ${amount2 < 0 ? "-" : ""}${whole}.${String(cents3 % 100).padStart(2, "0")}`;
|
|
66668
66697
|
};
|
|
66669
|
-
return { label: label5, value: value3, money:
|
|
66698
|
+
return { label: label5, value: value3, money: money9 };
|
|
66670
66699
|
}
|
|
66671
66700
|
function checkSeed(seed2, report) {
|
|
66672
|
-
const named2 = recordNamer(seed2), found = [],
|
|
66701
|
+
const named2 = recordNamer(seed2), found = [], money9 = named2.money;
|
|
66673
66702
|
const issue2 = (path2, message4) => {
|
|
66674
66703
|
const label5 = named2.label(path2), value3 = /^(missing|duplicate)\b/.test(message4) ? named2.value(path2) : void 0;
|
|
66675
66704
|
found.push({ path: path2, message: `${label5 ? `${label5}: ` : ""}${message4}${value3 === void 0 ? "" : ` ${value3}`}` });
|
|
66676
66705
|
};
|
|
66677
66706
|
try {
|
|
66678
|
-
books(seed2, issue2,
|
|
66707
|
+
books(seed2, issue2, money9);
|
|
66679
66708
|
} finally {
|
|
66680
66709
|
for (const problem of found.slice(0, NETSUITE_LISTED_PROBLEMS)) report(problem.path, problem.message);
|
|
66681
66710
|
if (found.length > NETSUITE_LISTED_PROBLEMS) report([], `and ${found.length - NETSUITE_LISTED_PROBLEMS} more problems`);
|
|
66682
66711
|
}
|
|
66683
66712
|
}
|
|
66684
|
-
function books(seed2, issue2,
|
|
66713
|
+
function books(seed2, issue2, money9) {
|
|
66685
66714
|
if (seed2.integration.customerCreditLimitHandlingOverride && !seed2.policy.allowCustomerCreditLimitHandlingOverride) issue2(["integration", "customerCreditLimitHandlingOverride"], "credit handling override requires policy permission");
|
|
66686
66715
|
const round2 = netsuiteRound;
|
|
66687
66716
|
const accountById = new Map(seed2.accounts.map((a) => [a.id, a])), itemById = new Map(seed2.items.map((i) => [i.id, i]));
|
|
66688
66717
|
const itemTotal = (lines2) => round2(lines2.reduce((sum, line2) => sum + round2(line2.quantity * (line2.rate ?? itemById.get(line2.item)?.rate ?? 0)), 0));
|
|
66689
66718
|
const buyTotal = (lines2) => round2(lines2.reduce((sum, line2) => sum + round2(line2.quantity * (line2.rate ?? itemById.get(line2.item)?.cost ?? itemById.get(line2.item)?.rate ?? 0)), 0));
|
|
66690
|
-
const
|
|
66719
|
+
const ids2 = (list, name3) => {
|
|
66691
66720
|
const seen = /* @__PURE__ */ new Set();
|
|
66692
66721
|
for (const [index, item2] of list.entries()) {
|
|
66693
66722
|
if (seen.has(item2.id)) issue2([name3, index, "id"], "duplicate ID");
|
|
@@ -66695,12 +66724,12 @@ function books(seed2, issue2, money8) {
|
|
|
66695
66724
|
}
|
|
66696
66725
|
return seen;
|
|
66697
66726
|
};
|
|
66698
|
-
const accounts =
|
|
66699
|
-
const subsidiaries =
|
|
66700
|
-
const departments =
|
|
66701
|
-
const categories =
|
|
66702
|
-
|
|
66703
|
-
|
|
66727
|
+
const accounts = ids2(seed2.accounts, "accounts"), terms = ids2(seed2.terms, "terms"), items = ids2(seed2.items, "items");
|
|
66728
|
+
const subsidiaries = ids2(seed2.subsidiaries, "subsidiaries"), currencies = ids2(seed2.currencies, "currencies");
|
|
66729
|
+
const departments = ids2(seed2.departments, "departments"), locations = ids2(seed2.locations, "locations"), classes = ids2(seed2.classes, "classes");
|
|
66730
|
+
const categories = ids2(seed2.expenseCategories, "expenseCategories"), folders = ids2(seed2.folders, "folders");
|
|
66731
|
+
ids2(seed2.currencyRates, "currencyRates");
|
|
66732
|
+
ids2(seed2.files, "files");
|
|
66704
66733
|
const subsidiaryOf = (value3) => netsuiteListId(seed2.subsidiaries, value3), currencyOf = (value3) => netsuiteListId(seed2.currencies, value3);
|
|
66705
66734
|
const known = (value3, path2, what) => {
|
|
66706
66735
|
if (value3 !== void 0 && (what === "subsidiary" ? subsidiaryOf : currencyOf)(value3) === void 0) issue2(path2, `missing ${what}`);
|
|
@@ -66936,10 +66965,10 @@ function books(seed2, issue2, money8) {
|
|
|
66936
66965
|
const journal = seed2.journalEntries.find((j) => j.id === a.doc);
|
|
66937
66966
|
if (journal) {
|
|
66938
66967
|
const side = ["vendorPayments", "vendorCredits"].includes(name3) ? "AcctPay" : "AcctRec";
|
|
66939
|
-
const
|
|
66940
|
-
const line2 = a.line === void 0 ? void 0 :
|
|
66968
|
+
const candidates2 = journal.lines.map((l, i2) => ({ ...l, line: i2 + 1 })).filter((l) => l.entity === owner && accountById.get(l.account)?.type === side && (side === "AcctRec" ? l.debit ?? 0 : l.credit ?? 0) > 0);
|
|
66969
|
+
const line2 = a.line === void 0 ? void 0 : candidates2.find((l) => l.line === a.line);
|
|
66941
66970
|
const key2 = `${a.doc}:${a.line === void 0 ? "auto" : line2?.line}`;
|
|
66942
|
-
if ((a.line === void 0 ? !
|
|
66971
|
+
if ((a.line === void 0 ? !candidates2.length : !line2) || seen.has(key2) || journal.approval === "pending") issue2(path2, "invalid journal application line");
|
|
66943
66972
|
else sameBooks(t.id, a.doc, path2, "journal entry", KIND[name3]);
|
|
66944
66973
|
seen.add(key2);
|
|
66945
66974
|
continue;
|
|
@@ -66984,18 +67013,18 @@ function books(seed2, issue2, money8) {
|
|
|
66984
67013
|
if (!customers.has(t.customer)) issue2(["customerRefunds", index, "customer"], "missing customer");
|
|
66985
67014
|
account3(t.account, ["customerRefunds", index, "account"], ["Bank"], "refund account");
|
|
66986
67015
|
}
|
|
66987
|
-
for (const [
|
|
66988
|
-
const name3 = seed2.invoices.some((t) => t.id ===
|
|
66989
|
-
issue2(path2, `${name3 === "invoices" ? "invoice" : "vendor bill"} is over-applied: applications total ${
|
|
67016
|
+
for (const [id11, amount2] of applied) if (round2(amount2) > (totals.get(id11) ?? 0) + 1e-9) {
|
|
67017
|
+
const name3 = seed2.invoices.some((t) => t.id === id11) ? "invoices" : "vendorBills", path2 = [name3, seed2[name3].findIndex((t) => t.id === id11)], total2 = totals.get(id11) ?? 0;
|
|
67018
|
+
issue2(path2, `${name3 === "invoices" ? "invoice" : "vendor bill"} is over-applied: applications total ${money9(path2, round2(amount2))} against a total of ${money9(path2, total2)} (over by ${money9(path2, round2(amount2 - total2))})`);
|
|
66990
67019
|
}
|
|
66991
67020
|
for (const name3 of ["creditMemos", "customerPayments", "vendorCredits", "vendorPayments"]) for (const [index, t] of seed2[name3].entries()) {
|
|
66992
67021
|
const total2 = ("amount" in t ? t.amount : totals.get(t.id) ?? 0) + ("credit" in t ? t.credit.reduce((sum, a) => sum + a.amount, 0) : 0);
|
|
66993
67022
|
const used2 = round2(spent.get(t.id) ?? 0), path2 = [name3, index, "apply"];
|
|
66994
|
-
if (used2 > total2 + 1e-9) issue2(path2, `applies more than the ${name3 === "creditMemos" ? "credit memo" : name3 === "vendorCredits" ? "bill credit" : "payment"}: ${
|
|
67023
|
+
if (used2 > total2 + 1e-9) issue2(path2, `applies more than the ${name3 === "creditMemos" ? "credit memo" : name3 === "vendorCredits" ? "bill credit" : "payment"}: ${money9(path2, used2)} against ${money9(path2, round2(total2))} (over by ${money9(path2, round2(used2 - total2))})`);
|
|
66995
67024
|
}
|
|
66996
67025
|
const open2 = [];
|
|
66997
67026
|
const ar = seed2.accounts.find((a) => a.type === "AcctRec" && !a.inactive)?.id, ap = seed2.accounts.find((a) => a.type === "AcctPay" && !a.inactive)?.id;
|
|
66998
|
-
for (const [
|
|
67027
|
+
for (const [records2, role2, acct] of [[seed2.invoices, "debt", ar], [seed2.creditMemos, "credit", ar], [seed2.vendorBills, "debt", ap], [seed2.vendorCredits, "credit", ap]]) for (const t of records2) {
|
|
66999
67028
|
if ("approval" in t && seed2.policy.billApproval && t.approval !== "approved") continue;
|
|
67000
67029
|
open2.push({ doc: t.id, line: 0, owner: "customer" in t ? t.customer : t.vendor, account: acct ?? 0, role: role2, amount: totals.get(t.id) ?? 0 });
|
|
67001
67030
|
}
|
|
@@ -67039,13 +67068,13 @@ function books(seed2, issue2, money8) {
|
|
|
67039
67068
|
seen.add(key2);
|
|
67040
67069
|
const amount2 = round2((used.get(key2) ?? 0) + a.amount);
|
|
67041
67070
|
used.set(key2, amount2);
|
|
67042
|
-
if (amount2 > item2.amount + 4e-3) issue2(path2, `application exceeds the open line amount: ${
|
|
67071
|
+
if (amount2 > item2.amount + 4e-3) issue2(path2, `application exceeds the open line amount: ${money9(path2, amount2)} applied against ${money9(path2, item2.amount)} open`);
|
|
67043
67072
|
if (role2 === "debt") gross += a.amount;
|
|
67044
67073
|
else credit += a.amount;
|
|
67045
67074
|
}
|
|
67046
67075
|
}
|
|
67047
67076
|
const cash = "amount" in t ? t.amount : totals.get(t.id) ?? 0;
|
|
67048
|
-
if (credit > gross + 4e-3 || gross > cash + credit + 4e-3 || cash === 0 && !(gross > 0 && round2(gross) === round2(credit))) issue2([name3, index], `application requires cash or matching selected credits: applies ${
|
|
67077
|
+
if (credit > gross + 4e-3 || gross > cash + credit + 4e-3 || cash === 0 && !(gross > 0 && round2(gross) === round2(credit))) issue2([name3, index], `application requires cash or matching selected credits: applies ${money9([name3, index], round2(gross))} with ${money9([name3, index], cash)} in cash and ${money9([name3, index], round2(credit))} in credits`);
|
|
67049
67078
|
}
|
|
67050
67079
|
for (const [index, t] of seed2.customerPayments.entries()) {
|
|
67051
67080
|
if (!customers.has(t.customer)) issue2(["customerPayments", index, "customer"], "missing customer");
|
|
@@ -67093,7 +67122,7 @@ function books(seed2, issue2, money8) {
|
|
|
67093
67122
|
});
|
|
67094
67123
|
const debit = t.lines.reduce((sum, l) => sum + (l.debit ?? 0), 0), credit = t.lines.reduce((sum, l) => sum + (l.credit ?? 0), 0);
|
|
67095
67124
|
const path2 = ["journalEntries", index, "lines"];
|
|
67096
|
-
if (Math.abs(debit - credit) > 5e-3) issue2(path2, `debits and credits differ: debits ${
|
|
67125
|
+
if (Math.abs(debit - credit) > 5e-3) issue2(path2, `debits and credits differ: debits ${money9(path2, round2(debit))}, credits ${money9(path2, round2(credit))} (off by ${money9(path2, round2(Math.abs(debit - credit)))})`);
|
|
67097
67126
|
}
|
|
67098
67127
|
for (const [index, t] of seed2.expenseReports.entries()) {
|
|
67099
67128
|
if (!employees.has(t.employee)) issue2(["expenseReports", index, "employee"], "missing employee");
|
|
@@ -67127,15 +67156,15 @@ function books(seed2, issue2, money8) {
|
|
|
67127
67156
|
customs(`${name3}[${index}].expenses`, t.expenses ?? [], "custcol");
|
|
67128
67157
|
}
|
|
67129
67158
|
}
|
|
67130
|
-
const imported =
|
|
67131
|
-
|
|
67159
|
+
const imported = ids2(seed2.bankingTransactions, "bankingTransactions");
|
|
67160
|
+
ids2(seed2.bankRecSuggestions, "bankRecSuggestions");
|
|
67132
67161
|
for (const [i, b] of seed2.bankingTransactions.entries()) {
|
|
67133
67162
|
account3(b.account, ["bankingTransactions", i, "account"], ["Bank", "CredCard"]);
|
|
67134
67163
|
if (b.subsidiary !== void 0 && !subsidiaries.has(b.subsidiary)) issue2(["bankingTransactions", i, "subsidiary"], "missing subsidiary");
|
|
67135
67164
|
}
|
|
67136
67165
|
for (const [i, b] of seed2.bankRecSuggestions.entries()) {
|
|
67137
67166
|
if (new Set(b.importedTransactions).size !== b.importedTransactions.length) issue2(["bankRecSuggestions", i], "duplicate imported transaction");
|
|
67138
|
-
for (const
|
|
67167
|
+
for (const id11 of b.importedTransactions) if (!imported.has(id11)) issue2(["bankRecSuggestions", i], "missing imported transaction");
|
|
67139
67168
|
for (const t of [...b.transactions, ...b.apply]) if (!txIds.has(t.doc)) issue2(["bankRecSuggestions", i], "missing transaction");
|
|
67140
67169
|
if (b.type === "match" ? !b.transactions.length || b.apply.length : !b.apply.length || b.transactions.length) issue2(["bankRecSuggestions", i], "choose matching lines or payment applications");
|
|
67141
67170
|
}
|
|
@@ -67204,10 +67233,10 @@ function netsuiteSeedList(seed2, type) {
|
|
|
67204
67233
|
function checkRecords(seed2, issue2) {
|
|
67205
67234
|
const seen = /* @__PURE__ */ new Map();
|
|
67206
67235
|
for (const [index, record4] of seed2.records.entries()) {
|
|
67207
|
-
const key2 = record4.type.toLowerCase(),
|
|
67208
|
-
if (
|
|
67209
|
-
|
|
67210
|
-
seen.set(key2,
|
|
67236
|
+
const key2 = record4.type.toLowerCase(), ids2 = seen.get(key2) ?? /* @__PURE__ */ new Set();
|
|
67237
|
+
if (ids2.has(record4.id)) issue2(["records", index, "id"], `duplicate ID ${record4.id} for ${record4.type}`);
|
|
67238
|
+
ids2.add(record4.id);
|
|
67239
|
+
seen.set(key2, ids2);
|
|
67211
67240
|
}
|
|
67212
67241
|
for (const key2 of seen.keys()) {
|
|
67213
67242
|
const modeled = netsuiteRecordTypes.find((type) => type.toLowerCase() === key2);
|
|
@@ -67281,7 +67310,7 @@ var netsuiteStarterSeed = {
|
|
|
67281
67310
|
};
|
|
67282
67311
|
var NetsuiteRecordCheckSchema = external_exports.strictObject({
|
|
67283
67312
|
type: external_exports.enum(netsuiteRecordTypes),
|
|
67284
|
-
id:
|
|
67313
|
+
id: id9.optional(),
|
|
67285
67314
|
externalId: text11.optional(),
|
|
67286
67315
|
fields: external_exports.record(external_exports.string(), external_exports.unknown()).optional(),
|
|
67287
67316
|
apply: external_exports.array(application).optional(),
|
|
@@ -67289,12 +67318,12 @@ var NetsuiteRecordCheckSchema = external_exports.strictObject({
|
|
|
67289
67318
|
}).refine((check3) => check3.id === void 0 !== (check3.externalId === void 0), { message: "name the record with id or with externalId, not both", path: ["id"] });
|
|
67290
67319
|
var NetsuiteUnchangedCheckSchema = external_exports.strictObject({
|
|
67291
67320
|
types: external_exports.array(external_exports.enum(netsuiteRecordTypes)).min(1),
|
|
67292
|
-
except: external_exports.array(external_exports.strictObject({ type: external_exports.enum(netsuiteRecordTypes), id:
|
|
67321
|
+
except: external_exports.array(external_exports.strictObject({ type: external_exports.enum(netsuiteRecordTypes), id: id9.optional(), externalId: text11.optional() }).refine((check3) => check3.id === void 0 !== (check3.externalId === void 0), { message: "name the record with id or with externalId, not both" })).optional()
|
|
67293
67322
|
});
|
|
67294
67323
|
var NetsuiteCountCheckSchema = external_exports.strictObject({ type: external_exports.enum(netsuiteRecordTypes), count: external_exports.number().int().min(0), includeSettlement: external_exports.boolean().optional() });
|
|
67295
67324
|
var NetsuitePreservedCheckSchema = external_exports.strictObject({
|
|
67296
67325
|
type: external_exports.enum(netsuiteRecordTypes),
|
|
67297
|
-
id:
|
|
67326
|
+
id: id9,
|
|
67298
67327
|
except_fields: external_exports.array(external_exports.string().regex(/^[A-Za-z_][A-Za-z0-9_]*$/, "name a top-level field")).refine(
|
|
67299
67328
|
(fields4) => new Set(fields4).size === fields4.length,
|
|
67300
67329
|
"name each field once"
|
|
@@ -67670,12 +67699,12 @@ var QuickbooksSeedSchema = external_exports.strictObject({
|
|
|
67670
67699
|
const sharedIds = /* @__PURE__ */ new Map(), sharedNames = /* @__PURE__ */ new Map();
|
|
67671
67700
|
for (const [type, rows] of Object.entries(seed2.entities)) {
|
|
67672
67701
|
const group5 = ["Customer", "Vendor", "Employee"].includes(type) ? "names" : quickbooksIdGroup(type);
|
|
67673
|
-
const
|
|
67674
|
-
sharedIds.set(group5,
|
|
67702
|
+
const ids2 = sharedIds.get(group5) ?? /* @__PURE__ */ new Set();
|
|
67703
|
+
sharedIds.set(group5, ids2);
|
|
67675
67704
|
rows?.forEach((r, i) => {
|
|
67676
67705
|
for (const issue2 of quickbooksRequiredIssues(type, r)) ctx.addIssue({ code: "custom", path: ["entities", type, i, ...issue2.path], message: issue2.detail });
|
|
67677
|
-
if (r.Id !== void 0 && (typeof r.Id !== "string" || !/^\d+$/.test(r.Id) ||
|
|
67678
|
-
if (typeof r.Id === "string")
|
|
67706
|
+
if (r.Id !== void 0 && (typeof r.Id !== "string" || !/^\d+$/.test(r.Id) || ids2.has(r.Id))) ctx.addIssue({ code: "custom", path: ["entities", type, i, "Id"], message: "Id must be a unique decimal string in its sequence." });
|
|
67707
|
+
if (typeof r.Id === "string") ids2.add(r.Id);
|
|
67679
67708
|
if (QUICKBOOKS_ENTITIES.indexOf(type) < 11) {
|
|
67680
67709
|
const field2 = ["Customer", "Vendor", "Employee"].includes(type) ? "DisplayName" : "Name";
|
|
67681
67710
|
const value3 = r[field2] ?? (field2 === "DisplayName" ? ["GivenName", "MiddleName", "FamilyName"].map((k) => r[k]).filter(Boolean).join(" ") : void 0);
|
|
@@ -67707,9 +67736,9 @@ var QuickbooksSeedSchema = external_exports.strictObject({
|
|
|
67707
67736
|
for (const [key2, v] of Object.entries(object4)) {
|
|
67708
67737
|
const type = key2 === "EntityRef" && owner === "Attachable" ? QUICKBOOKS_ENTITIES.find((t) => t.toLowerCase() === String(v?.type ?? "").toLowerCase()) : key2 === "ParentRef" ? owner : key2.includes("AccountRef") ? "Account" : targets[key2];
|
|
67709
67738
|
if (type && v && typeof v === "object" && typeof v.value === "string" && !(key2 === "TaxCodeRef" && ["TAX", "NON"].includes(v.value))) {
|
|
67710
|
-
const
|
|
67711
|
-
if (
|
|
67712
|
-
const target =
|
|
67739
|
+
const candidates2 = seed2.entities[type] ?? [];
|
|
67740
|
+
if (candidates2.every((r) => typeof r.Id === "string")) {
|
|
67741
|
+
const target = candidates2.find((r) => r.Id === v.value);
|
|
67713
67742
|
if (!target || target.Active === false) ctx.addIssue({ code: "custom", path: [...path2, key2], message: `${type} ${v.value} ${target ? "is inactive" : "does not exist"}.` });
|
|
67714
67743
|
}
|
|
67715
67744
|
}
|
|
@@ -68239,6 +68268,7 @@ var DeliveryRulesSchema = external_exports.array(DeliveryRuleSchema).max(100).su
|
|
|
68239
68268
|
});
|
|
68240
68269
|
});
|
|
68241
68270
|
var SceneSchema = external_exports.strictObject({
|
|
68271
|
+
variant: VariantBlockSchema.optional(),
|
|
68242
68272
|
id: external_exports.string().regex(/^[a-z0-9-]+$/, "must match [a-z0-9-]+ (lowercase letters, digits and hyphens)"),
|
|
68243
68273
|
title: external_exports.string(),
|
|
68244
68274
|
// Support and listing rules are semantic checks in load.ts so their messages carry hints.
|
|
@@ -68397,6 +68427,7 @@ var WorldId = external_exports.string().regex(/^[a-z0-9][a-z0-9-]*$/, "name a wo
|
|
|
68397
68427
|
var WORLD_ERROR = "name a world file by its id (e.g. acme-support), or write the world inline: tools, seed, people";
|
|
68398
68428
|
var fields3 = {
|
|
68399
68429
|
version: external_exports.literal(2),
|
|
68430
|
+
variant: VariantBlockSchema.optional(),
|
|
68400
68431
|
id: external_exports.string().regex(/^[a-z0-9-]+$/, "must match [a-z0-9-]+ (lowercase letters, digits and hyphens)"),
|
|
68401
68432
|
title: external_exports.string().min(1).max(200).optional(),
|
|
68402
68433
|
start: StartSchema,
|
|
@@ -68437,10 +68468,10 @@ var WORLD_FILE_WARN_BYTES = 16 * 1024 * 1024;
|
|
|
68437
68468
|
var WORLD_BUNDLE_FILE_MAX_BYTES = 32 * 1024 * 1024;
|
|
68438
68469
|
|
|
68439
68470
|
// packages/core/src/test-data/schema.ts
|
|
68440
|
-
var
|
|
68471
|
+
var id10 = external_exports.string().regex(/^[a-z0-9]+(?:-[a-z0-9]+)*$/);
|
|
68441
68472
|
var version3 = external_exports.string().regex(/^(0|[1-9]\d*)\.(0|[1-9]\d*)\.(0|[1-9]\d*)$/, "use an exact version, such as 1.0.0");
|
|
68442
|
-
var header = { schema_version: external_exports.literal(1), id:
|
|
68443
|
-
var VersionRefSchema = external_exports.strictObject({ id:
|
|
68473
|
+
var header = { schema_version: external_exports.literal(1), id: id10, version: version3, title: external_exports.string().min(1) };
|
|
68474
|
+
var VersionRefSchema = external_exports.strictObject({ id: id10, version: version3 });
|
|
68444
68475
|
var seed = SceneSchema.shape.seed.shape;
|
|
68445
68476
|
var slack = seed.slack.unwrap();
|
|
68446
68477
|
var github = seed.github.unwrap();
|
|
@@ -68529,7 +68560,7 @@ var InitialChangeSchema = external_exports.discriminatedUnion("op", [
|
|
|
68529
68560
|
var ScenarioDefinitionSchema = SceneSchema.omit({ seed: true, twins: true, world_rules: true }).extend({
|
|
68530
68561
|
schema_version: external_exports.literal(1),
|
|
68531
68562
|
kind: external_exports.literal("scenario"),
|
|
68532
|
-
id:
|
|
68563
|
+
id: id10,
|
|
68533
68564
|
version: version3,
|
|
68534
68565
|
checks_version: version3,
|
|
68535
68566
|
preset: VersionRefSchema,
|