@zuplo/cli 7.4.3 → 7.4.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/common/settings.d.ts +1 -0
- package/dist/common/settings.d.ts.map +1 -1
- package/dist/common/settings.js +3 -0
- package/dist/common/settings.js.map +1 -1
- package/dist/deploy/classify-build-probe.d.ts +14 -0
- package/dist/deploy/classify-build-probe.d.ts.map +1 -0
- package/dist/deploy/classify-build-probe.js +35 -0
- package/dist/deploy/classify-build-probe.js.map +1 -0
- package/dist/deploy/classify-build-probe.test.d.ts +2 -0
- package/dist/deploy/classify-build-probe.test.d.ts.map +1 -0
- package/dist/deploy/classify-build-probe.test.js +51 -0
- package/dist/deploy/classify-build-probe.test.js.map +1 -0
- package/dist/deploy/handler.js +20 -5
- package/dist/deploy/handler.js.map +1 -1
- package/dist/deploy/poll-deployment.d.ts +8 -4
- package/dist/deploy/poll-deployment.d.ts.map +1 -1
- package/dist/deploy/poll-deployment.js +32 -4
- package/dist/deploy/poll-deployment.js.map +1 -1
- package/dist/deploy/poll-deployment.test.d.ts +2 -0
- package/dist/deploy/poll-deployment.test.d.ts.map +1 -0
- package/dist/deploy/poll-deployment.test.js +158 -0
- package/dist/deploy/poll-deployment.test.js.map +1 -0
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/node_modules/@posthog/core/dist/logs/index.js +1 -1
- package/node_modules/@posthog/core/dist/logs/index.mjs +1 -1
- package/node_modules/@posthog/core/dist/logs/logs-utils.d.ts +4 -13
- package/node_modules/@posthog/core/dist/logs/logs-utils.d.ts.map +1 -1
- package/node_modules/@posthog/core/dist/logs/logs-utils.js +160 -26
- package/node_modules/@posthog/core/dist/logs/logs-utils.mjs +160 -26
- package/node_modules/@posthog/core/dist/metrics/index.js +1 -1
- package/node_modules/@posthog/core/dist/metrics/index.mjs +1 -1
- package/node_modules/@posthog/core/dist/posthog-core.d.ts.map +1 -1
- package/node_modules/@posthog/core/dist/posthog-core.js +12 -7
- package/node_modules/@posthog/core/dist/posthog-core.mjs +12 -7
- package/node_modules/@posthog/core/dist/utils/index.d.ts +1 -1
- package/node_modules/@posthog/core/dist/utils/index.d.ts.map +1 -1
- package/node_modules/@posthog/core/dist/utils/index.js +14 -24
- package/node_modules/@posthog/core/dist/utils/index.mjs +2 -2
- package/node_modules/@posthog/core/dist/utils/json-utils.d.ts +15 -0
- package/node_modules/@posthog/core/dist/utils/json-utils.d.ts.map +1 -1
- package/node_modules/@posthog/core/dist/utils/json-utils.js +24 -0
- package/node_modules/@posthog/core/dist/utils/json-utils.mjs +1 -1
- package/node_modules/@posthog/core/package.json +2 -2
- package/node_modules/@posthog/core/src/logs/index.ts +1 -1
- package/node_modules/@posthog/core/src/logs/logs-utils.spec.ts +314 -9
- package/node_modules/@posthog/core/src/logs/logs-utils.ts +215 -27
- package/node_modules/@posthog/core/src/metrics/index.spec.ts +15 -1
- package/node_modules/@posthog/core/src/metrics/index.ts +1 -1
- package/node_modules/@posthog/core/src/posthog-core.ts +19 -12
- package/node_modules/@posthog/core/src/utils/index.ts +3 -1
- package/node_modules/@posthog/core/src/utils/json-utils.ts +15 -8
- package/node_modules/@posthog/types/dist/capture-log.d.ts +10 -1
- package/node_modules/@posthog/types/dist/capture-log.d.ts.map +1 -1
- package/node_modules/@posthog/types/package.json +1 -1
- package/node_modules/@posthog/types/src/capture-log.ts +8 -1
- package/node_modules/@zuplo/core/package.json +1 -1
- package/node_modules/@zuplo/graphql/package.json +1 -1
- package/node_modules/@zuplo/openapi-tools/package.json +1 -1
- package/node_modules/@zuplo/otel/package.json +1 -1
- package/node_modules/@zuplo/runtime/out/esm/{chunk-NHSMO7UN.js → chunk-4SX4HBWT.js} +72 -72
- package/node_modules/@zuplo/runtime/out/esm/chunk-4SX4HBWT.js.map +1 -0
- package/node_modules/@zuplo/runtime/out/esm/index.js +1 -1
- package/node_modules/@zuplo/runtime/out/esm/mcp-gateway/index.js +13 -13
- package/node_modules/@zuplo/runtime/out/esm/mcp-gateway/index.js.map +1 -1
- package/node_modules/@zuplo/runtime/out/types/mcp-gateway/index.d.ts +39 -2
- package/node_modules/@zuplo/runtime/package.json +1 -1
- package/package.json +11 -11
- package/node_modules/@zuplo/runtime/out/esm/chunk-NHSMO7UN.js.map +0 -1
- /package/node_modules/@zuplo/runtime/out/esm/{chunk-NHSMO7UN.js.LEGAL.txt → chunk-4SX4HBWT.js.LEGAL.txt} +0 -0
|
@@ -374,7 +374,7 @@ export class PostHogMetrics {
|
|
|
374
374
|
byMetric.set(metricKey, metric)
|
|
375
375
|
}
|
|
376
376
|
|
|
377
|
-
const attributes = toOtlpKeyValueList(state.attributes ?? {})
|
|
377
|
+
const attributes = toOtlpKeyValueList(state.attributes ?? {}, this._logger)
|
|
378
378
|
const startNano = msToUnixNano(state.windowStartMs)
|
|
379
379
|
|
|
380
380
|
if (state.type === 'count') {
|
|
@@ -53,8 +53,11 @@ interface FlagsAsyncOptions {
|
|
|
53
53
|
}
|
|
54
54
|
|
|
55
55
|
interface PendingFlagsRequest extends FlagsAsyncOptions {
|
|
56
|
-
|
|
57
|
-
|
|
56
|
+
// every caller displaced from this slot, so none is settled against a request it did not make
|
|
57
|
+
waiters: {
|
|
58
|
+
resolve: (value: PostHogFeatureFlagsResponse | undefined) => void
|
|
59
|
+
reject: (reason?: unknown) => void
|
|
60
|
+
}[]
|
|
58
61
|
}
|
|
59
62
|
|
|
60
63
|
export abstract class PostHogCore extends PostHogCoreStateless {
|
|
@@ -651,16 +654,20 @@ export abstract class PostHogCore extends PostHogCoreStateless {
|
|
|
651
654
|
return undefined
|
|
652
655
|
}
|
|
653
656
|
if (this._flagsResponsePromise) {
|
|
654
|
-
// Queue
|
|
655
|
-
//
|
|
657
|
+
// Queue rather than drop, so an identity-changing reload still reaches the server. Displaced
|
|
658
|
+
// callers are carried over rather than settled against the in-flight request: that request
|
|
659
|
+
// was issued before their context changed, so it cannot reflect it. Options are merged so
|
|
660
|
+
// the single queued request satisfies every caller behind it — one caller asking for the
|
|
661
|
+
// remote config or for $anon_distinct_id is enough for the re-issued request to carry it.
|
|
656
662
|
this._logger.info('Feature flags are being loaded already, queuing reload.')
|
|
657
|
-
|
|
658
|
-
if (this._pendingFlagsRequest) {
|
|
659
|
-
this._flagsResponsePromise.then(this._pendingFlagsRequest.resolve).catch(this._pendingFlagsRequest.reject)
|
|
660
|
-
}
|
|
661
|
-
// Return a promise that resolves when the pending request completes
|
|
663
|
+
const pending = this._pendingFlagsRequest
|
|
662
664
|
return new Promise((resolve, reject) => {
|
|
663
|
-
this._pendingFlagsRequest = {
|
|
665
|
+
this._pendingFlagsRequest = {
|
|
666
|
+
sendAnonDistinctId: sendAnonDistinctId || !!pending?.sendAnonDistinctId,
|
|
667
|
+
fetchConfig: fetchConfig || !!pending?.fetchConfig,
|
|
668
|
+
triggerOnRemoteConfig: triggerOnRemoteConfig || !!pending?.triggerOnRemoteConfig,
|
|
669
|
+
waiters: [...(pending?.waiters ?? []), { resolve, reject }],
|
|
670
|
+
}
|
|
664
671
|
})
|
|
665
672
|
}
|
|
666
673
|
return this._flagsAsync({ sendAnonDistinctId, fetchConfig, triggerOnRemoteConfig })
|
|
@@ -911,8 +918,8 @@ export abstract class PostHogCore extends PostHogCoreStateless {
|
|
|
911
918
|
fetchConfig: pendingRequest.fetchConfig,
|
|
912
919
|
triggerOnRemoteConfig: pendingRequest.triggerOnRemoteConfig,
|
|
913
920
|
})
|
|
914
|
-
.then(pendingRequest.resolve)
|
|
915
|
-
.catch(pendingRequest.reject)
|
|
921
|
+
.then((res) => pendingRequest.waiters.forEach((w) => w.resolve(res)))
|
|
922
|
+
.catch((e) => pendingRequest.waiters.forEach((w) => w.reject(e)))
|
|
916
923
|
}
|
|
917
924
|
})
|
|
918
925
|
return this._flagsResponsePromise
|
|
@@ -3,7 +3,9 @@ import { FetchLike } from '../types'
|
|
|
3
3
|
export * from './bot-detection'
|
|
4
4
|
export * from './browser-utils'
|
|
5
5
|
export * from './bucketed-rate-limiter'
|
|
6
|
-
export
|
|
6
|
+
// Named rather than `export *`: the budgets, markers and `sanitizeString` are
|
|
7
|
+
// shared with the OTLP encoder but are not public API.
|
|
8
|
+
export { toJsonSafeValue } from './json-utils'
|
|
7
9
|
export * from './number-utils'
|
|
8
10
|
export * from './string-utils'
|
|
9
11
|
export * from './type-utils'
|
|
@@ -1,10 +1,12 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
const
|
|
4
|
-
const
|
|
5
|
-
const
|
|
6
|
-
const
|
|
7
|
-
const
|
|
1
|
+
/** Traversal budgets and markers, shared with the OTLP attribute encoder. Not
|
|
2
|
+
* public API — `utils/index.ts` re-exports `toJsonSafeValue` only. */
|
|
3
|
+
export const MAX_JSON_SAFE_VALUE_DEPTH = 20
|
|
4
|
+
export const MAX_JSON_SAFE_VALUE_ITEMS = 1_000
|
|
5
|
+
export const MAX_JSON_SAFE_VALUE_NODES = 10_000
|
|
6
|
+
export const CIRCULAR_VALUE = '[Circular]'
|
|
7
|
+
export const TRUNCATED_VALUE = '[Truncated]'
|
|
8
|
+
export const UNSERIALIZABLE_VALUE = '[Unserializable]'
|
|
9
|
+
export const FUNCTION_VALUE = '[Function]'
|
|
8
10
|
|
|
9
11
|
const dateGetTime = Date.prototype.getTime
|
|
10
12
|
const dateToISOString = Date.prototype.toISOString
|
|
@@ -15,7 +17,12 @@ interface JsonSafeValueConversionState {
|
|
|
15
17
|
remainingNodes: number
|
|
16
18
|
}
|
|
17
19
|
|
|
18
|
-
|
|
20
|
+
/**
|
|
21
|
+
* Replaces unpaired surrogates with U+FFFD. A lone surrogate survives
|
|
22
|
+
* `JSON.stringify` as a `\uD800`-style escape, which strict JSON parsers
|
|
23
|
+
* reject — for OTLP that means the whole request is refused.
|
|
24
|
+
*/
|
|
25
|
+
export function sanitizeString(value: string): string {
|
|
19
26
|
let output = ''
|
|
20
27
|
for (let index = 0; index < value.length; index++) {
|
|
21
28
|
const codeUnit = value.charCodeAt(index)
|
|
@@ -66,12 +66,21 @@ export interface Logger {
|
|
|
66
66
|
}
|
|
67
67
|
export interface OtlpAnyValue {
|
|
68
68
|
stringValue?: string;
|
|
69
|
-
|
|
69
|
+
/**
|
|
70
|
+
* proto3 JSON maps int64 to a string, which is the form the SDK emits.
|
|
71
|
+
* `number` stays valid because encoded records persist in the logs queue:
|
|
72
|
+
* one written by an earlier version rehydrates in the numeric form and is
|
|
73
|
+
* re-sent unchanged. The wire format accepts both.
|
|
74
|
+
*/
|
|
75
|
+
intValue?: string | number;
|
|
70
76
|
doubleValue?: number;
|
|
71
77
|
boolValue?: boolean;
|
|
72
78
|
arrayValue?: {
|
|
73
79
|
values: OtlpAnyValue[];
|
|
74
80
|
};
|
|
81
|
+
kvlistValue?: {
|
|
82
|
+
values: OtlpKeyValue[];
|
|
83
|
+
};
|
|
75
84
|
}
|
|
76
85
|
export interface OtlpKeyValue {
|
|
77
86
|
key: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"capture-log.d.ts","sourceRoot":"","sources":["../src/capture-log.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,MAAM,MAAM,gBAAgB,GAAG,OAAO,GAAG,OAAO,GAAG,MAAM,GAAG,MAAM,GAAG,OAAO,GAAG,OAAO,CAAA;AAEtF,MAAM,MAAM,gBAAgB,GAAG,OAAO,GAAG,OAAO,GAAG,MAAM,GAAG,MAAM,GAAG,OAAO,GAAG,OAAO,CAAA;AAEtF,MAAM,WAAW,iBAAiB;IAC9B,IAAI,EAAE,gBAAgB,CAAA;IACtB,MAAM,EAAE,MAAM,CAAA;CACjB;AAED,MAAM,MAAM,iBAAiB,GAAG,MAAM,GAAG,MAAM,GAAG,OAAO,GAAG,IAAI,GAAG,SAAS,GAAG,OAAO,EAAE,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAA;AAElH,MAAM,MAAM,aAAa,GAAG,MAAM,CAAC,MAAM,EAAE,iBAAiB,CAAC,CAAA;AAE7D,MAAM,WAAW,iBAAiB;IAC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;AAED,MAAM,WAAW,eAAe;IAC5B,YAAY,EAAE,KAAK,CAAC;QAChB,QAAQ,EAAE;YAAE,UAAU,EAAE,YAAY,EAAE,CAAA;SAAE,CAAA;QACxC,SAAS,EAAE,KAAK,CAAC;YACb,KAAK,EAAE;gBAAE,IAAI,EAAE,MAAM,CAAC;gBAAC,OAAO,CAAC,EAAE,MAAM,CAAA;aAAE,CAAA;YACzC,UAAU,EAAE,aAAa,EAAE,CAAA;SAC9B,CAAC,CAAA;KACL,CAAC,CAAA;CACL"}
|
|
@@ -79,10 +79,17 @@ export interface Logger {
|
|
|
79
79
|
|
|
80
80
|
export interface OtlpAnyValue {
|
|
81
81
|
stringValue?: string
|
|
82
|
-
|
|
82
|
+
/**
|
|
83
|
+
* proto3 JSON maps int64 to a string, which is the form the SDK emits.
|
|
84
|
+
* `number` stays valid because encoded records persist in the logs queue:
|
|
85
|
+
* one written by an earlier version rehydrates in the numeric form and is
|
|
86
|
+
* re-sent unchanged. The wire format accepts both.
|
|
87
|
+
*/
|
|
88
|
+
intValue?: string | number
|
|
83
89
|
doubleValue?: number
|
|
84
90
|
boolValue?: boolean
|
|
85
91
|
arrayValue?: { values: OtlpAnyValue[] }
|
|
92
|
+
kvlistValue?: { values: OtlpKeyValue[] }
|
|
86
93
|
}
|
|
87
94
|
|
|
88
95
|
export interface OtlpKeyValue {
|