@configdirector/nextjs-sdk 1.7.0 → 1.8.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (50) hide show
  1. package/README.md +41 -0
  2. package/dist/client/index.cjs +1 -5
  3. package/dist/client/index.d.cts +52 -216
  4. package/dist/client/index.d.cts.map +1 -1
  5. package/dist/client/index.d.mts +52 -216
  6. package/dist/client/index.d.mts.map +1 -1
  7. package/dist/client/index.mjs +1 -5
  8. package/dist/client/index.mjs.map +1 -1
  9. package/dist/client/installedTestClient-CrHwnJTr.mjs +7 -0
  10. package/dist/client/installedTestClient-CrHwnJTr.mjs.map +1 -0
  11. package/dist/client/installedTestClient-LbS5fHdP.cjs +6 -0
  12. package/dist/client/testing.cjs +2 -0
  13. package/dist/client/testing.d.cts +159 -0
  14. package/dist/client/testing.d.cts.map +1 -0
  15. package/dist/client/testing.d.mts +159 -0
  16. package/dist/client/testing.d.mts.map +1 -0
  17. package/dist/client/testing.mjs +3 -0
  18. package/dist/client/testing.mjs.map +1 -0
  19. package/dist/client/types-DA2VZKNX.d.mts +220 -0
  20. package/dist/client/types-DA2VZKNX.d.mts.map +1 -0
  21. package/dist/client/types-fL7X5zwg.d.cts +220 -0
  22. package/dist/client/types-fL7X5zwg.d.cts.map +1 -0
  23. package/dist/server/DefaultConfigDirectorClient-BhyVJv6Z.mjs +6 -0
  24. package/dist/server/DefaultConfigDirectorClient-BhyVJv6Z.mjs.map +1 -0
  25. package/dist/server/DefaultConfigDirectorClient-BngKzHat.cjs +5 -0
  26. package/dist/server/{errors-B1AJJTZ-.mjs → errors-BGpFuqOO.mjs} +1 -1
  27. package/dist/server/{errors-B1AJJTZ-.mjs.map → errors-BGpFuqOO.mjs.map} +1 -1
  28. package/dist/server/index.cjs +1 -1
  29. package/dist/server/index.d.cts +14 -288
  30. package/dist/server/index.d.cts.map +1 -1
  31. package/dist/server/index.d.mts +14 -288
  32. package/dist/server/index.d.mts.map +1 -1
  33. package/dist/server/index.mjs +1 -1
  34. package/dist/server/index.mjs.map +1 -1
  35. package/dist/server/testing.cjs +1 -0
  36. package/dist/server/testing.d.cts +119 -0
  37. package/dist/server/testing.d.cts.map +1 -0
  38. package/dist/server/testing.d.mts +119 -0
  39. package/dist/server/testing.d.mts.map +1 -0
  40. package/dist/server/testing.mjs +2 -0
  41. package/dist/server/testing.mjs.map +1 -0
  42. package/dist/server/types-DnzM2ukj.d.cts +292 -0
  43. package/dist/server/types-DnzM2ukj.d.cts.map +1 -0
  44. package/dist/server/types-qIeNbtNf.d.mts +292 -0
  45. package/dist/server/types-qIeNbtNf.d.mts.map +1 -0
  46. package/package.json +37 -2
  47. package/dist/server/DefaultConfigDirectorClient-C3kQeXox.cjs +0 -5
  48. package/dist/server/DefaultConfigDirectorClient-D7A_CT1K.mjs +0 -6
  49. package/dist/server/DefaultConfigDirectorClient-D7A_CT1K.mjs.map +0 -1
  50. /package/dist/server/{errors-zhcEWVnY.cjs → errors-CCbuIqT8.cjs} +0 -0
@@ -0,0 +1,3 @@
1
+ "use client";
2
+ "use client";import{d as e,f as t,l as n,r,s as i,t as a,u as o}from"./installedTestClient-CrHwnJTr.mjs";const s=(t,n)=>{if(t.trim().length==0)throw new e(`Invalid config key. The key of a test value cannot be empty.`);return c(t,n)},c=(t,n)=>{switch(typeof n){case`boolean`:return{type:`boolean`,value:n?`true`:`false`};case`number`:return l(t,n);case`string`:return{type:`string`,value:n};case`object`:if(n!==null)return d(t,n,``),{type:`json`,value:JSON.stringify(n)}}throw new e(`Invalid test value for '${t}': ${m(n)}. Use a boolean, a number, a string, a plain object, or an array.`)},l=(t,n)=>{if(!Number.isFinite(n))throw new e(`Invalid test value for '${t}': ${m(n)} is not a finite number.`);if(Number.isInteger(n)){if(!Number.isSafeInteger(n))throw new e(`Invalid test value for '${t}': ${n} is not a safe integer, so the SDK could not read it back exactly.`);return{type:`integer`,value:String(n)}}return{type:`float`,value:u(n)}},u=e=>{let t=String(e),n=t.indexOf(`e-`);if(n<0)return t;let r=t.startsWith(`-`)?`-`:``,[i=``,a=``]=t.slice(r.length,n).split(`.`),o=Number(t.slice(n+2))-i.length;return`${r}0.${`0`.repeat(o)}${i}${a}`},d=(e,t,n)=>{if(!(t===null||typeof t==`boolean`||typeof t==`string`)){if(typeof t==`number`){if(!Number.isFinite(t))throw f(e,n,`${m(t)} is not a finite number`);return}if(Array.isArray(t)){t.forEach((t,r)=>d(e,t,`${n}[${r}]`));return}if(p(t)){for(let[r,i]of Object.entries(t))d(e,i,n?`${n}.${r}`:r);return}throw f(e,n,`${m(t)} cannot be encoded as JSON`)}},f=(t,n,r)=>new e(`Invalid test value for '${t}'${n?` at '${n}'`:``}: ${r}. JSON contents can hold booleans, finite numbers, strings, null, arrays, and plain objects.`),p=e=>{if(typeof e!=`object`||!e)return!1;let t=Object.getPrototypeOf(e);return t===Object.prototype||t===null},m=e=>{if(e===null)return`null`;if(typeof e==`function`)return`a function`;if(typeof e==`object`){var t,n;return`a ${(t=(n=e.constructor)==null?void 0:n.name)==null?`object`:t} instance`}return typeof e==`symbol`?`a symbol`:String(e)},h=(e,t,n)=>{let r=s(e,t);return{id:`test-config:${e}`,key:e,type:r.type,value:r.value,valueId:`test-value:${e}:${n}`}},g={environmentId:`test-environment`,projectId:`test-project`},_=e=>{switch(e){case`initialization`:return`initialize`;case`context update`:return`updateContext`;default:return}};var v=class{constructor(e,n){this.logger=e,this.emitter=new t,this.configs=new Map,this.recordedContexts=[],this.pendingDeliveries=[],this.armed={initialize:`nothing`,updateContext:`nothing`},this.connected=!1,this.delivering=!1,this.revision=0,this.attemptGeneration=0,this.on=(e,t)=>this.emitter.on(e,t),this.off=(e,t)=>this.emitter.off(e,t),this.store(n)}get contextUpdates(){return[...this.recordedContexts]}setValue(e,t){let r=h(e,t,++this.revision);this.configs.set(e,r),this.deliverIfConnected(n(n({},g),{},{kind:`delta`,configs:{[e]:r}}))}removeValue(e){this.configs.delete(e),this.deliverIfConnected(this.fullUpdate())}replaceValues(e){let t=this.encodeAll(e);this.configs.clear(),t.forEach((e,t)=>this.configs.set(t,e)),this.armed.initialize=`nothing`,this.armed.updateContext=`nothing`,this.deliverIfConnected(this.fullUpdate())}hold(e){this.armed[e]=`hold`}complete(e){var t;((t=this.pendingHold)==null?void 0:t.attempt)===e?this.pendingHold.complete():this.armed[e]===`hold`&&(this.armed[e]=`nothing`)}fail(e){var t;((t=this.pendingHold)==null?void 0:t.attempt)===e?this.pendingHold.fail():this.armed[e]=`failure`}connect(e,t,n){this.endAttempt();let r=_(n);if(!r)return this.connectNow();this.recordedContexts.push(e);let i=this.armed[r];switch(this.armed[r]=`nothing`,i){case`failure`:return this.failNow(n);case`hold`:return this.holdNow(r,n,t);default:return this.connectNow()}}clear(){this.emitter.clear()}close(){this.endAttempt()}dispose(){this.close(),this.clear()}endAttempt(){var e;this.attemptGeneration++,this.connected=!1,(e=this.pendingHold)==null||e.end()}connectNow(){let e=Promise.resolve(this);return this.scheduleFirstDelivery(),e}holdNow(e,t,n){return new Promise((r,i)=>{let a=setTimeout(()=>{var e;return(e=this.pendingHold)==null?void 0:e.end()},n),o=()=>{clearTimeout(a),this.pendingHold=void 0};this.pendingHold={attempt:e,end:()=>{o(),r(this)},complete:()=>{o(),r(this),this.scheduleFirstDelivery()},fail:()=>{o();let e=this.fatalError(t);this.emitter.emit(`connectionError`,e),i(e)}}})}failNow(e){let t=this.fatalError(e);return this.emitter.emit(`connectionError`,t),Promise.reject(t)}fatalError(e){return new o(`Connection failed with status: 401. Error: the test client failed this ${e}. This is an unrecoverable error, will not attempt to reconnect.`,401)}scheduleFirstDelivery(){let e=this.attemptGeneration;Promise.resolve().then(()=>{}).then(()=>{e===this.attemptGeneration&&(this.connected=!0,this.deliver(this.fullUpdate()))})}deliverIfConnected(e){this.connected&&this.deliver(e)}deliver(e){if(this.pendingDeliveries.push(e),!this.delivering){this.delivering=!0;try{let e=this.pendingDeliveries.shift();for(;e;)this.emitCaught(e),e=this.pendingDeliveries.shift()}finally{this.delivering=!1}}}emitCaught(e){try{this.emitter.emit(`configSetReceived`,e)}catch(e){this.logger.error(`[InMemoryConnection] Error dispatching a config update from the test client: `,e)}}fullUpdate(){return n(n({},g),{},{kind:`full`,configs:Object.fromEntries(this.configs)})}store(e){this.encodeAll(e).forEach((e,t)=>this.configs.set(t,e))}encodeAll(e){let t=new Map;for(let[n,r]of Object.entries(e))t.set(n,h(n,r,++this.revision));return t}};const y={updateContext:async()=>{},evaluatedConfig:()=>{},close:async()=>{}};var b=class{constructor(e,t){this.client=e,this.connection=t}setValue(e,t){this.connection.setValue(e,t)}removeValue(e){this.connection.removeValue(e)}replaceValues(e){this.connection.replaceValues(e)}holdInitialization(){this.connection.hold(`initialize`)}completeInitialization(){this.connection.complete(`initialize`)}failInitialization(){this.connection.fail(`initialize`)}holdContextUpdate(){this.connection.hold(`updateContext`)}completeContextUpdate(){this.connection.complete(`updateContext`)}failContextUpdate(){this.connection.fail(`updateContext`)}get contextUpdates(){return this.connection.contextUpdates}};const x=(e,t)=>{var n,a;let o=(n=t==null?void 0:t.logger)==null?i():n,s=new v(o,(a=t==null?void 0:t.values)==null?{}:a);return new b(new r(y,`test-client`,e,{logger:o,connection:{timeout:t==null?void 0:t.timeout}},{transport:s}),s)},S=e=>{let t=globalThis,n=t[a];return t[a]=e.client,()=>{t[a]=n}},C=e=>x({sdkName:`nextjs-sdk`,sdkVersion:`1.8.0`},e);export{o as ConfigDirectorConnectionError,e as ConfigDirectorValidationError,C as createTestClient,S as installTestClient};
3
+ //# sourceMappingURL=testing.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"testing.mjs","names":["encodeTestValue","encodeShared","createTestClient"],"sources":["../../../shared/src/testing/values.ts","../../../js-client-core/src/testing/values.ts","../../../js-client-core/src/testing/InMemoryConnection.ts","../../../js-client-core/src/testing/TestClient.ts","../../../js-client-core/src/testing/installTestClient.ts","../../src/client/testing.ts"],"sourcesContent":["import type { ConfigType } from \"../types\";\nimport { ConfigDirectorValidationError } from \"../errors\";\n\nexport type TestJsonValue = boolean | number | string | null | TestJsonValue[] | { [key: string]: TestJsonValue };\n\nexport type TestValue = boolean | number | string | TestJsonValue[] | { [key: string]: TestJsonValue };\n\nexport type TestValues = Record<string, TestValue>;\n\nexport type EncodedTestValue = { type: ConfigType; value: string };\n\nexport const encodeTestValue = (key: string, value: TestValue): EncodedTestValue => {\n if (key.trim().length == 0) {\n throw new ConfigDirectorValidationError(\"Invalid config key. The key of a test value cannot be empty.\");\n }\n return encode(key, value);\n};\n\nconst encode = (key: string, value: TestValue): EncodedTestValue => {\n switch (typeof value) {\n case \"boolean\":\n return { type: \"boolean\", value: value ? \"true\" : \"false\" };\n case \"number\":\n return encodeNumber(key, value);\n case \"string\":\n return { type: \"string\", value };\n case \"object\":\n if (value !== null) {\n assertJsonContents(key, value, \"\");\n return { type: \"json\", value: JSON.stringify(value) };\n }\n }\n throw new ConfigDirectorValidationError(\n `Invalid test value for '${key}': ${describe(value)}. Use a boolean, a number, a string, a plain object, or an array.`,\n );\n};\n\nconst encodeNumber = (key: string, value: number): EncodedTestValue => {\n if (!Number.isFinite(value)) {\n throw new ConfigDirectorValidationError(`Invalid test value for '${key}': ${describe(value)} is not a finite number.`);\n }\n if (Number.isInteger(value)) {\n if (!Number.isSafeInteger(value)) {\n throw new ConfigDirectorValidationError(\n `Invalid test value for '${key}': ${value} is not a safe integer, so the SDK could not read it back exactly.`,\n );\n }\n return { type: \"integer\", value: String(value) };\n }\n return { type: \"float\", value: toPlainDecimal(value) };\n};\n\nconst toPlainDecimal = (value: number): string => {\n const text = String(value);\n const exponentIndex = text.indexOf(\"e-\");\n if (exponentIndex < 0) {\n return text;\n }\n const sign = text.startsWith(\"-\") ? \"-\" : \"\";\n const [integerDigits = \"\", fractionDigits = \"\"] = text.slice(sign.length, exponentIndex).split(\".\");\n const leadingZeros = Number(text.slice(exponentIndex + 2)) - integerDigits.length;\n return `${sign}0.${\"0\".repeat(leadingZeros)}${integerDigits}${fractionDigits}`;\n};\n\nconst assertJsonContents = (key: string, value: unknown, path: string): void => {\n if (value === null || typeof value === \"boolean\" || typeof value === \"string\") {\n return;\n }\n if (typeof value === \"number\") {\n if (!Number.isFinite(value)) {\n throw invalidJsonContents(key, path, `${describe(value)} is not a finite number`);\n }\n return;\n }\n if (Array.isArray(value)) {\n value.forEach((item, index) => assertJsonContents(key, item, `${path}[${index}]`));\n return;\n }\n if (isPlainObject(value)) {\n for (const [property, item] of Object.entries(value)) {\n assertJsonContents(key, item, path ? `${path}.${property}` : property);\n }\n return;\n }\n throw invalidJsonContents(key, path, `${describe(value)} cannot be encoded as JSON`);\n};\n\nconst invalidJsonContents = (key: string, path: string, problem: string) =>\n new ConfigDirectorValidationError(\n `Invalid test value for '${key}'${path ? ` at '${path}'` : \"\"}: ${problem}. JSON contents can hold booleans, finite numbers, strings, null, arrays, and plain objects.`,\n );\n\nconst isPlainObject = (value: unknown): value is Record<string, unknown> => {\n if (typeof value !== \"object\" || value === null) {\n return false;\n }\n const prototype = Object.getPrototypeOf(value);\n return prototype === Object.prototype || prototype === null;\n};\n\nconst describe = (value: unknown): string => {\n if (value === null) {\n return \"null\";\n }\n if (typeof value === \"function\") {\n return \"a function\";\n }\n if (typeof value === \"object\") {\n return `a ${value.constructor?.name ?? \"object\"} instance`;\n }\n if (typeof value === \"symbol\") {\n return \"a symbol\";\n }\n return String(value);\n};\n","import type { ConfigState } from \"../types\";\nimport { encodeTestValue as encodeShared } from \"@shared/testing/values\";\nimport type { TestValue } from \"@shared/testing/values\";\n\nexport type { TestJsonValue, TestValue, TestValues } from \"@shared/testing/values\";\n\nexport const encodeTestValue = (key: string, value: TestValue, revision: number): ConfigState => {\n const encoded = encodeShared(key, value);\n return {\n id: `test-config:${key}`,\n key,\n type: encoded.type,\n value: encoded.value,\n valueId: `test-value:${key}:${revision}`,\n };\n};\n","import type {\n ClientConnectAction,\n ConfigDirectorContext,\n ConfigDirectorLogger,\n ConfigSet,\n ConfigState,\n Transport,\n TransportEvents,\n} from \"../types\";\nimport { Emitter } from \"../Emitter\";\nimport { ConfigDirectorConnectionError } from \"../errors\";\nimport { encodeTestValue, type TestValue, type TestValues } from \"./values\";\n\ntype ControlledAttempt = \"initialize\" | \"updateContext\";\n\ntype Armed = \"nothing\" | \"hold\" | \"failure\";\n\ntype PendingHold = {\n attempt: ControlledAttempt;\n end: () => void;\n complete: () => void;\n fail: () => void;\n};\n\nconst TEST_ENVIRONMENT = { environmentId: \"test-environment\", projectId: \"test-project\" };\n\nconst controlledAttemptFor = (reason: ClientConnectAction): ControlledAttempt | undefined => {\n switch (reason) {\n case \"initialization\":\n return \"initialize\";\n case \"context update\":\n return \"updateContext\";\n default:\n return undefined;\n }\n};\n\nexport class InMemoryConnection implements Transport {\n private readonly emitter = new Emitter<TransportEvents>();\n private readonly configs = new Map<string, ConfigState>();\n private readonly recordedContexts: ConfigDirectorContext[] = [];\n private readonly pendingDeliveries: ConfigSet[] = [];\n private readonly armed: Record<ControlledAttempt, Armed> = { initialize: \"nothing\", updateContext: \"nothing\" };\n private pendingHold: PendingHold | undefined;\n private connected = false;\n private delivering = false;\n private revision = 0;\n private attemptGeneration = 0;\n\n constructor(\n private readonly logger: ConfigDirectorLogger,\n values: TestValues,\n ) {\n this.store(values);\n }\n\n public get contextUpdates(): ConfigDirectorContext[] {\n return [...this.recordedContexts];\n }\n\n public setValue(key: string, value: TestValue) {\n const configState = encodeTestValue(key, value, ++this.revision);\n this.configs.set(key, configState);\n this.deliverIfConnected({ ...TEST_ENVIRONMENT, kind: \"delta\", configs: { [key]: configState } });\n }\n\n public removeValue(key: string) {\n this.configs.delete(key);\n this.deliverIfConnected(this.fullUpdate());\n }\n\n public replaceValues(values: TestValues) {\n const encoded = this.encodeAll(values);\n this.configs.clear();\n encoded.forEach((configState, key) => this.configs.set(key, configState));\n this.armed.initialize = \"nothing\";\n this.armed.updateContext = \"nothing\";\n this.deliverIfConnected(this.fullUpdate());\n }\n\n public hold(attempt: ControlledAttempt) {\n this.armed[attempt] = \"hold\";\n }\n\n public complete(attempt: ControlledAttempt) {\n if (this.pendingHold?.attempt === attempt) {\n this.pendingHold.complete();\n } else if (this.armed[attempt] === \"hold\") {\n this.armed[attempt] = \"nothing\";\n }\n }\n\n public fail(attempt: ControlledAttempt) {\n if (this.pendingHold?.attempt === attempt) {\n this.pendingHold.fail();\n } else {\n this.armed[attempt] = \"failure\";\n }\n }\n\n public connect(context: ConfigDirectorContext, timeout: number, reason: ClientConnectAction): Promise<this> {\n this.endAttempt();\n const attempt = controlledAttemptFor(reason);\n if (!attempt) {\n return this.connectNow();\n }\n this.recordedContexts.push(context);\n const armed = this.armed[attempt];\n this.armed[attempt] = \"nothing\";\n switch (armed) {\n case \"failure\":\n return this.failNow(reason);\n case \"hold\":\n return this.holdNow(attempt, reason, timeout);\n default:\n return this.connectNow();\n }\n }\n\n public on: Transport[\"on\"] = (name, handler) => this.emitter.on(name, handler);\n\n public off: Transport[\"off\"] = (name, handler) => this.emitter.off(name, handler);\n\n public clear() {\n this.emitter.clear();\n }\n\n public close() {\n this.endAttempt();\n }\n\n public dispose() {\n this.close();\n this.clear();\n }\n\n private endAttempt() {\n this.attemptGeneration++;\n this.connected = false;\n this.pendingHold?.end();\n }\n\n private connectNow(): Promise<this> {\n const connected = Promise.resolve(this);\n this.scheduleFirstDelivery();\n return connected;\n }\n\n private holdNow(attempt: ControlledAttempt, reason: ClientConnectAction, timeout: number): Promise<this> {\n return new Promise<this>((resolve, reject) => {\n const timer = setTimeout(() => this.pendingHold?.end(), timeout);\n const release = () => {\n clearTimeout(timer);\n this.pendingHold = undefined;\n };\n this.pendingHold = {\n attempt,\n end: () => {\n release();\n resolve(this);\n },\n complete: () => {\n release();\n resolve(this);\n this.scheduleFirstDelivery();\n },\n fail: () => {\n release();\n const error = this.fatalError(reason);\n this.emitter.emit(\"connectionError\", error);\n reject(error);\n },\n };\n });\n }\n\n private failNow(reason: ClientConnectAction): Promise<this> {\n const error = this.fatalError(reason);\n this.emitter.emit(\"connectionError\", error);\n return Promise.reject(error);\n }\n\n private fatalError(reason: ClientConnectAction) {\n return new ConfigDirectorConnectionError(\n `Connection failed with status: 401. Error: the test client failed this ${reason}. This is an unrecoverable error, will not attempt to reconnect.`,\n 401,\n );\n }\n\n private scheduleFirstDelivery() {\n const generation = this.attemptGeneration;\n void Promise.resolve()\n .then(() => {})\n .then(() => {\n if (generation !== this.attemptGeneration) {\n return;\n }\n this.connected = true;\n this.deliver(this.fullUpdate());\n });\n }\n\n private deliverIfConnected(configSet: ConfigSet) {\n if (this.connected) {\n this.deliver(configSet);\n }\n }\n\n private deliver(configSet: ConfigSet) {\n this.pendingDeliveries.push(configSet);\n if (this.delivering) {\n return;\n }\n this.delivering = true;\n try {\n let next = this.pendingDeliveries.shift();\n while (next) {\n this.emitCaught(next);\n next = this.pendingDeliveries.shift();\n }\n } finally {\n this.delivering = false;\n }\n }\n\n private emitCaught(configSet: ConfigSet) {\n try {\n this.emitter.emit(\"configSetReceived\", configSet);\n } catch (error) {\n this.logger.error(\"[InMemoryConnection] Error dispatching a config update from the test client: \", error);\n }\n }\n\n private fullUpdate(): ConfigSet {\n return { ...TEST_ENVIRONMENT, kind: \"full\", configs: Object.fromEntries(this.configs) };\n }\n\n private store(values: TestValues) {\n this.encodeAll(values).forEach((configState, key) => this.configs.set(key, configState));\n }\n\n private encodeAll(values: TestValues): Map<string, ConfigState> {\n const encoded = new Map<string, ConfigState>();\n for (const [key, value] of Object.entries(values)) {\n encoded.set(key, encodeTestValue(key, value, ++this.revision));\n }\n return encoded;\n }\n}\n","import { DefaultConfigDirectorClient } from \"../DefaultConfigDirectorClient\";\nimport { createDefaultLogger } from \"../logger\";\nimport type { ConfigDirectorClient, ConfigDirectorContext, ConfigDirectorLogger, IdentifyingSdkOptions } from \"../types\";\nimport type { TelemetryClient } from \"../telemetry\";\nimport { InMemoryConnection } from \"./InMemoryConnection\";\nimport type { TestValue, TestValues } from \"./values\";\n\nconst TEST_CLIENT_SDK_KEY = \"test-client\";\n\n/**\n * Options for {@link createTestClient}. Every option is optional.\n */\nexport type TestClientOptions = {\n /**\n * The config values the test client serves once its client connects, keyed by config key. The\n * config type follows from each value: a boolean, an integral number (`integer`), any other\n * number (`float`), a string, or a plain object or array (`json`).\n */\n values?: TestValues;\n /**\n * The connection timeout of the SDK client, in milliseconds. It bounds how long a held\n * `initialize` or `updateContext` waits. Defaults to the SDK's production timeout.\n */\n timeout?: number;\n /**\n * The logger the SDK client uses. Defaults to the SDK's console logger at `warn` level.\n */\n logger?: ConfigDirectorLogger;\n};\n\n/**\n * A real ConfigDirector client connected to an in-memory server that the test controls.\n *\n * The client under {@link TestClient.client} is the SDK's production client: value parsing, watchers,\n * events, and readiness behave as they do against ConfigDirector. Only the network connection and\n * telemetry are replaced, so no request is ever made and nothing is left running after the client is\n * disposed.\n */\nexport interface TestClient {\n /**\n * The SDK client to hand to the code under test. It starts uninitialized, like a production\n * client; `initialize` completes at once with the seeded values unless initialization is held.\n */\n readonly client: ConfigDirectorClient;\n\n /**\n * Stores `value` under `key` and, when the client is connected, delivers it as an update, so\n * reads, watchers, and `configsUpdated` handlers see it.\n */\n setValue(key: string, value: TestValue): void;\n\n /**\n * Removes `key` and, when the client is connected, delivers a full update without it, so reads\n * fall back to the in-code default value and watchers of `key` receive that default.\n */\n removeValue(key: string): void;\n\n /**\n * Replaces every stored value with `values`, disarms any armed hold or failure, and, when the\n * client is connected, delivers the new values as a full update.\n */\n replaceValues(values: TestValues): void;\n\n /**\n * Makes the next `initialize` wait until {@link completeInitialization} or\n * {@link failInitialization} is called, or until the client's timeout elapses.\n */\n holdInitialization(): void;\n\n /**\n * Delivers the stored values to a held `initialize`, so it completes with the client ready. When\n * a hold is armed but no `initialize` has started, it disarms the hold instead.\n */\n completeInitialization(): void;\n\n /**\n * Fails a held `initialize` with an unrecoverable connection error, or arms the next `initialize`\n * to fail. `initialize` completes promptly with the client not ready and `connectionError` fires.\n */\n failInitialization(): void;\n\n /**\n * Makes the next `updateContext` wait until {@link completeContextUpdate} or\n * {@link failContextUpdate} is called, or until the client's timeout elapses.\n */\n holdContextUpdate(): void;\n\n /**\n * Delivers the stored values to a held `updateContext`, or disarms an armed hold that no\n * `updateContext` has picked up.\n */\n completeContextUpdate(): void;\n\n /**\n * Fails a held `updateContext` with an unrecoverable connection error, or arms the next\n * `updateContext` to fail.\n */\n failContextUpdate(): void;\n\n /**\n * The context of every `initialize` and `updateContext` call, in call order. `initialize` without\n * a context records an empty context. Resumes are not recorded.\n */\n readonly contextUpdates: ConfigDirectorContext[];\n}\n\nconst noopTelemetryClient: TelemetryClient = {\n updateContext: async () => {},\n evaluatedConfig: () => {},\n close: async () => {},\n};\n\nclass InMemoryTestClient implements TestClient {\n constructor(\n public readonly client: ConfigDirectorClient,\n private readonly connection: InMemoryConnection,\n ) {}\n\n public setValue(key: string, value: TestValue) {\n this.connection.setValue(key, value);\n }\n\n public removeValue(key: string) {\n this.connection.removeValue(key);\n }\n\n public replaceValues(values: TestValues) {\n this.connection.replaceValues(values);\n }\n\n public holdInitialization() {\n this.connection.hold(\"initialize\");\n }\n\n public completeInitialization() {\n this.connection.complete(\"initialize\");\n }\n\n public failInitialization() {\n this.connection.fail(\"initialize\");\n }\n\n public holdContextUpdate() {\n this.connection.hold(\"updateContext\");\n }\n\n public completeContextUpdate() {\n this.connection.complete(\"updateContext\");\n }\n\n public failContextUpdate() {\n this.connection.fail(\"updateContext\");\n }\n\n public get contextUpdates(): ConfigDirectorContext[] {\n return this.connection.contextUpdates;\n }\n}\n\nexport const createTestClient = (sdkOptions: IdentifyingSdkOptions, options?: TestClientOptions): TestClient => {\n const logger = options?.logger ?? createDefaultLogger();\n const connection = new InMemoryConnection(logger, options?.values ?? {});\n const client = new DefaultConfigDirectorClient(\n noopTelemetryClient,\n TEST_CLIENT_SDK_KEY,\n sdkOptions,\n { logger, connection: { timeout: options?.timeout } },\n { transport: connection },\n );\n return new InMemoryTestClient(client, connection);\n};\n","import { INSTALLED_TEST_CLIENT_SLOT, type InstalledTestClientSlot } from \"../installedTestClient\";\nimport type { TestClient } from \"./TestClient\";\n\n/**\n * Makes every `ConfigDirectorProvider` mounted without a `client` prop, and every client\n * `withProvider` would build, use `testClient.client` instead of building a client, until the\n * returned function uninstalls it. Construction props such as `sdkKey` are ignored while installed;\n * `context` and `hooks` apply to the installed client as they do for a `client` prop. A provider\n * reads the installed client when it is constructed, so install before rendering.\n *\n * Installing again replaces the installed test client. Each uninstall function restores the test\n * client that was installed when it was created, so nested installs are uninstalled in reverse order.\n *\n * @param testClient The test client whose `client` providers should use\n * @returns A function that uninstalls it\n *\n * @example\n * let uninstallTestClient: () => void;\n * beforeEach(() => {\n * testClient = createTestClient({ values: { \"new-checkout\": true } });\n * uninstallTestClient = installTestClient(testClient);\n * });\n * afterEach(() => uninstallTestClient());\n */\nexport const installTestClient = (testClient: TestClient): (() => void) => {\n const slot = globalThis as InstalledTestClientSlot;\n const previous = slot[INSTALLED_TEST_CLIENT_SLOT];\n slot[INSTALLED_TEST_CLIENT_SLOT] = testClient.client;\n return () => {\n slot[INSTALLED_TEST_CLIENT_SLOT] = previous;\n };\n};\n","\"use client\";\n\nimport { createTestClient as createCoreTestClient } from \"@js-client-core/testing/index\";\nimport type { TestClient, TestClientOptions } from \"@js-client-core/testing/index\";\n\nexport { installTestClient } from \"@js-client-core/testing/index\";\nexport type { TestClient, TestClientOptions, TestValue, TestValues, TestJsonValue } from \"@js-client-core/testing/index\";\nexport { ConfigDirectorConnectionError, ConfigDirectorValidationError } from \"@shared/errors\";\n\n/**\n * Creates a {@link TestClient}: a real browser `ConfigDirectorClient` connected to an in-memory\n * server that the test controls. No network connection is opened and no telemetry is sent. Render\n * the client `ConfigDirectorProvider` with `client={testClient.client}`, or install it with\n * `installTestClient` for components that render their own provider.\n *\n * @param options {@link TestClientOptions}: the initial values, the client's timeout, and its logger\n * @returns A {@link TestClient} whose `client` is passed to the code under test\n *\n * @example\n * import { createTestClient } from \"@configdirector/nextjs-sdk/client/testing\";\n *\n * const testClient = createTestClient({ values: { \"new-checkout\": true } });\n * render(\n * <ConfigDirectorProvider client={testClient.client}>\n * <Checkout />\n * </ConfigDirectorProvider>,\n * );\n * act(() => testClient.setValue(\"new-checkout\", false));\n */\nexport const createTestClient = (options?: TestClientOptions): TestClient => {\n return createCoreTestClient({ sdkName: \"nextjs-sdk\", sdkVersion: \"__VERSION__\" }, options);\n};\n"],"mappings":";yGAWA,MAAaA,GAAmB,EAAa,IAAuC,CAClF,GAAI,EAAI,MAAM,CAAC,QAAU,EACvB,MAAM,IAAI,EAA8B,+DAA+D,CAEzG,OAAO,EAAO,EAAK,EAAM,EAGrB,GAAU,EAAa,IAAuC,CAClE,OAAQ,OAAO,EAAf,CACE,IAAK,UACH,MAAO,CAAE,KAAM,UAAW,MAAO,EAAQ,OAAS,QAAS,CAC7D,IAAK,SACH,OAAO,EAAa,EAAK,EAAM,CACjC,IAAK,SACH,MAAO,CAAE,KAAM,SAAU,QAAO,CAClC,IAAK,SACH,GAAI,IAAU,KAEZ,OADA,EAAmB,EAAK,EAAO,GAAG,CAC3B,CAAE,KAAM,OAAQ,MAAO,KAAK,UAAU,EAAM,CAAE,CAG3D,MAAM,IAAI,EACR,2BAA2B,EAAI,KAAK,EAAS,EAAM,CAAC,mEACrD,EAGG,GAAgB,EAAa,IAAoC,CACrE,GAAI,CAAC,OAAO,SAAS,EAAM,CACzB,MAAM,IAAI,EAA8B,2BAA2B,EAAI,KAAK,EAAS,EAAM,CAAC,0BAA0B,CAExH,GAAI,OAAO,UAAU,EAAM,CAAE,CAC3B,GAAI,CAAC,OAAO,cAAc,EAAM,CAC9B,MAAM,IAAI,EACR,2BAA2B,EAAI,KAAK,EAAM,oEAC3C,CAEH,MAAO,CAAE,KAAM,UAAW,MAAO,OAAO,EAAM,CAAE,CAElD,MAAO,CAAE,KAAM,QAAS,MAAO,EAAe,EAAM,CAAE,EAGlD,EAAkB,GAA0B,CAChD,IAAM,EAAO,OAAO,EAAM,CACpB,EAAgB,EAAK,QAA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G,IAAM,GAAA,EAAA,GAAA,KAAA,IAAA,GAAS,EAAS,SAAA,KAAU,GAAqB,CAA/B,EAClB,EAAa,IAAI,EAAmB,GAAA,EAAA,GAAA,KAAA,IAAA,GAAQ,EAAS,SAAA,KAAU,EAAE,CAAZ,EAAa,CAQxE,OAAO,IAAI,EAPI,IAAI,EACjB,EACA,cACA,EACA,CAAE,SAAQ,WAAY,CAAE,QAAA,GAAA,KAAA,IAAA,GAAS,EAAS,QAAS,CAAE,CACrD,CAAE,UAAW,EAAY,CAC1B,CACqC,EAAW,ECjJtC,EAAqB,GAAyC,CACzE,IAAM,EAAO,WACP,EAAW,EAAK,GAEtB,MADA,GAAK,GAA8B,EAAW,WACjC,CACX,EAAK,GAA8B,ICA1B,EAAoB,GACxB,EAAqB,CAAE,QAAS,aAAc,WAAY,QAAe,CAAE,EAAQ"}
@@ -0,0 +1,220 @@
1
+
2
+ //#region ../js-client-core/src/Emitter.d.ts
3
+ type EventType = string | symbol;
4
+ type EventsRecord = Record<EventType, any>;
5
+ type Handler<TEventsRecord extends EventsRecord, TKey extends keyof TEventsRecord> = (payload: TEventsRecord[TKey]) => void;
6
+ interface EventProvider<TEventsRecord extends EventsRecord> {
7
+ on<TName extends keyof TEventsRecord>(name: TName, handler: Handler<TEventsRecord, TName>): void;
8
+ off<TName extends keyof TEventsRecord>(name: TName, handler?: Handler<TEventsRecord, TName>): void;
9
+ clear(): void;
10
+ }
11
+ //#endregion
12
+ //#region ../shared/src/types.d.ts
13
+ declare const ConfigTypeList: readonly ["custom", "boolean", "string", "integer", "float", "enum", "url", "json"];
14
+ type ConfigType = (typeof ConfigTypeList)[number];
15
+ type ConfigEnumLikeType = {
16
+ [key: string]: string | number;
17
+ };
18
+ type ConfigValueType = string | number | boolean | object | ConfigEnumLikeType;
19
+ type ConfigState = {
20
+ id: string;
21
+ key: string;
22
+ type: ConfigType;
23
+ value: string | undefined | null;
24
+ valueId?: string | undefined | null;
25
+ };
26
+ type ConfigDirectorLoggingLevel = "debug" | "info" | "warn" | "error" | "off";
27
+ interface ConfigDirectorLogger {
28
+ debug(message: string, ...args: any): void;
29
+ info(message: string, ...args: any): void;
30
+ warn(message: string, ...args: any): void;
31
+ error(message: string, ...args: any): void;
32
+ }
33
+ type EvaluationReason = "found-match" | "config-state-missing" | "client-not-ready" | "type-mismatch" | "value-missing" | "invalid-number" | "invalid-json" | "invalid-boolean";
34
+ type ConfigEvaluation = {
35
+ key: string;
36
+ value: ConfigValueType;
37
+ valueId?: string;
38
+ isDefaultValue: boolean;
39
+ reason: EvaluationReason;
40
+ context?: ConfigDirectorContext;
41
+ };
42
+ /**
43
+ * The user's context to be sent to ConfigDirector. This context will be used for targeting
44
+ * rules evaluation.
45
+ */
46
+ type ConfigDirectorContext = {
47
+ /**
48
+ * The user's identifier. This should be a value that uniquely identifies an application
49
+ * user.
50
+ * In the case of anonymous users, you could generate a UUID or alternatively not provide
51
+ * the {@link id} and the SDK will generate a random UUID. However, keep in mind that this
52
+ * value is used for segmenting users in percentage rollouts, and changes to the {@link id}
53
+ * could result in the user being assigned to a different percentile.
54
+ */
55
+ id?: string;
56
+ /**
57
+ * The user's display name. This will be shown in the ConfigDirector dashboard and may be
58
+ * used for targeting rules.
59
+ */
60
+ name?: string;
61
+ /**
62
+ * Any arbitrary traits for the current user. They will be shown in the ConfigDirector
63
+ * dashboard and may be used for targeting rules.
64
+ */
65
+ traits?: {
66
+ [key: string]: unknown;
67
+ };
68
+ /**
69
+ * Whether or not to treat the context as anonymous during evaluation. When `true`, the
70
+ * context values will be used for targeting rules evaluation but the context will not be
71
+ * persisted and will not appear in the dashboard.
72
+ *
73
+ * @default false
74
+ */
75
+ anonymous?: boolean;
76
+ };
77
+ type ConnectionMode = "streaming" | "polling";
78
+ //#endregion
79
+ //#region ../js-client-core/src/types.d.ts
80
+ type ClientHooks = {
81
+ clientReady?: HookHandler<"clientReady"> | HookHandler<"clientReady">[];
82
+ configsUpdated?: HookHandler<"configsUpdated"> | HookHandler<"configsUpdated">[];
83
+ contextUpdated?: HookHandler<"contextUpdated"> | HookHandler<"contextUpdated">[];
84
+ configEvaluated?: HookHandler<"configEvaluated"> | HookHandler<"configEvaluated">[];
85
+ connectionError?: HookHandler<"connectionError"> | HookHandler<"connectionError">[];
86
+ };
87
+ type ClientConnectAction = "initialization" | "context update" | "network resume";
88
+ type HookHandler<TEvent extends keyof ClientEvents> = (payload: ClientEvents[TEvent]) => void;
89
+ type ClientEvents = {
90
+ configsUpdated: {
91
+ keys: string[];
92
+ removedKeys: string[];
93
+ };
94
+ clientReady: {
95
+ action: ClientConnectAction;
96
+ };
97
+ contextUpdated: {
98
+ context: ConfigDirectorContext | undefined;
99
+ };
100
+ configEvaluated: {
101
+ evaluation: ConfigEvaluation;
102
+ };
103
+ connectionError: {
104
+ error: Error;
105
+ };
106
+ };
107
+ type WatchHandler<T extends ConfigValueType> = (message: T) => void;
108
+ /**
109
+ * The ConfigDirector SDK client object.
110
+ *
111
+ * Applications should create a single instance of `ConfigDirectorClient`, and call
112
+ * {@link initialize} during application initialization.
113
+ *
114
+ * After initialization, to update the user's context, so that targeting rules are evaluated
115
+ * with the updated context, call {@link updateContext}.
116
+ */
117
+ interface ConfigDirectorClient extends EventProvider<ClientEvents> {
118
+ /**
119
+ * Initializes the connection to ConfigDirector to retrieve config evaluations. Until
120
+ * initialization is successful, all flags will return their default value provided to
121
+ * {@link watch} or {@link getValue}.
122
+ *
123
+ * If the connection fails or is interrupted with a transient error (network error,
124
+ * internal server error, etc) the client will continue to attempt to connect. However,
125
+ * if the connection fails with a persistent error, like an invalid SDK key, the client will
126
+ * not attempt to re-connect and an error will be logged to the console or the provided
127
+ * logger.
128
+ *
129
+ * @param context The current user's context to be used for evaluating targeting rules (optional).
130
+ */
131
+ initialize(context?: ConfigDirectorContext): Promise<void>;
132
+ /**
133
+ * Updates the user's context and re-evaluates all config and flag values based on the new context.
134
+ *
135
+ * @param context The current user's context to be used for evaluating targeting rules (required).
136
+ */
137
+ updateContext(context: ConfigDirectorContext): Promise<void>;
138
+ /**
139
+ * Returns the current context the client is configured with, or undefined if there is no context.
140
+ *
141
+ * Note that the value returned does not updated immediately after calling {@link updateContext}. Only
142
+ * once the underlying connection was successful or timed out, the current context is updated. This is
143
+ * because while the context update is in progress, configs are still evaluated on the previous context.
144
+ *
145
+ */
146
+ get context(): ConfigDirectorContext | undefined;
147
+ /**
148
+ * Returns whether or not the client is ready after calling {@link initialize} or {@link updateContext}
149
+ *
150
+ * The definition of ready is that the connection to the server was successful, and config state
151
+ * was received.
152
+ */
153
+ get isReady(): boolean;
154
+ /**
155
+ * Whether the client is trying to get its very first payload from the server. Upon client creation,
156
+ * it is `false`. It becomes `true` when `initialize` is called on a client that has never received a
157
+ * payload, stays `true` through timeouts and retries, and becomes `false` when the first payload
158
+ * arrives, when a fatal connection error stops the retries, or on `close`. `updateContext` and
159
+ * `resumeNetwork` never set it, and once a payload has been received it is never `true` again.
160
+ */
161
+ get isInitializing(): boolean;
162
+ /**
163
+ * Evaluates a config and returns its value based on the current context and targeting rules
164
+ *
165
+ * @returns The evaluated config value, or the `defaultValue` if the config state was unavailable
166
+ * @param configKey The config key to evaluate
167
+ * @param defaultValue The default value to be returned if the config state is unavailable. For
168
+ * example, if the client cannot connect to the server due to network conditions, or if getValue
169
+ * is called before initialization is done.
170
+ */
171
+ getValue<T extends ConfigValueType>(configKey: string, defaultValue: T): T;
172
+ /**
173
+ * Watches for changes to a a config evaluation value. Whenever the config value changes, the
174
+ * provided callback function will be called with the new value. Changes can happen due to updates
175
+ * to the config in the ConfigDirector dashboard, or if the context is updated via {@link updateContext}.
176
+ *
177
+ * @returns An 'unwatch' function that can be called to remove the subscriber
178
+ *
179
+ * @param configKey The config key to watch
180
+ * @param defaultValue The default value to be referenced if the config state is unavailable
181
+ * @param callback The callback function to be called whenever the config value is updated
182
+ */
183
+ watch<T extends ConfigValueType>(configKey: string, defaultValue: T, callback: WatchHandler<T>): () => void;
184
+ /**
185
+ * Removes a particular subscriber to the given `configKey`, or all subscribers if no callback
186
+ * is provided.
187
+ *
188
+ * @param configKey The config key to remove subscribers from
189
+ * @param callback The subscriber to be removed. If not provided, all subscribers are removed for
190
+ * the given `configKey`.
191
+ */
192
+ unwatch<T extends ConfigValueType>(configKey: string, callback?: WatchHandler<T>): void;
193
+ /**
194
+ * Removes all subscribers from all config keys
195
+ */
196
+ unwatchAll(): void;
197
+ /**
198
+ * Pauses the network connection without clearing event handlers, watch handlers, or config
199
+ * state. Intended for mobile environments where the OS may kill background connections (e.g.
200
+ * when the app is backgrounded on iOS/Android).
201
+ *
202
+ * Call {@link resumeNetwork} to re-establish the connection.
203
+ */
204
+ pauseNetwork(): void;
205
+ /**
206
+ * Resumes a connection that was paused via {@link pauseNetwork}, using the last context that
207
+ * was provided to {@link initialize} or {@link updateContext}.
208
+ */
209
+ resumeNetwork(): Promise<void>;
210
+ /**
211
+ * Disposes of the client. All connections are closed, and all event and config key subscribers
212
+ * are removed.
213
+ *
214
+ * Intended to be called when your application shuts down
215
+ */
216
+ dispose(): void;
217
+ }
218
+ //#endregion
219
+ export { ConfigDirectorLoggingLevel as a, ConnectionMode as c, ConfigDirectorLogger as i, ConfigDirectorClient as n, ConfigState as o, ConfigDirectorContext as r, ConfigValueType as s, ClientHooks as t };
220
+ //# sourceMappingURL=types-DA2VZKNX.d.mts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types-DA2VZKNX.d.mts","names":[],"sources":["../../../js-client-core/src/Emitter.ts","../../../shared/src/types.ts","../../../js-client-core/src/types.ts"],"mappings":";;KAAK,SAAA;AAAA,KACA,YAAA,GAAe,MAAA,CAAO,SAAA;AAAA,KAEtB,OAAA,uBAA8B,YAAA,qBAAiC,aAAA,KAClE,OAAA,EAAS,aAAA,CAAc,IAAA;AAAA,UAGR,aAAA,uBAAoC,YAAA;EACnD,EAAA,qBAAuB,aAAA,EAAe,IAAA,EAAM,KAAA,EAAO,OAAA,EAAS,OAAA,CAAQ,aAAA,EAAe,KAAA;EACnF,G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;IAAe,MAAA,EAAQ,mBAAA;EAAA;EACvB,cAAA;IAAkB,OAAA,EAAS,qBAAA;EAAA;EAC3B,eAAA;IAAmB,UAAA,EAAY,gBAAA;EAAA;EAC/B,eAAA;IAAmB,KAAA,EAAO,KAAA;EAAA;AAAA;AAAA,KAGhB,YAAA,WAAuB,eAAA,KAAoB,OAAA,EAAS,CAAA;;;;;ADjFhE;;;;;UC4FiB,oBAAA,SAA6B,aAAA,CAAc,YAAA;EDtF3B;;;;;;;;;;;;;ECoG/B,UAAA,CAAW,OAAA,GAAU,qBAAA,GAAwB,OAAA;ED9Fd;;;;;ECqG/B,aAAA,CAAc,OAAA,EAAS,qBAAA,GAAwB,OAAA;EDhFnC;;;;AAqBd;;;;EArBc,IC0FR,OAAA,IAAW,qBAAA;;;;AA9DjB;;;MAsEM,OAAA;EArEuC;;;;;;;EAAA,IA8EvC,cAAA;EA1E+C;;;;;;;;;EAqFnD,QAAA,WAAmB,eAAA,EAAiB,SAAA,UAAmB,YAAA,EAAc,CAAA,GAAI,CAAA;EAvFxD;;;;;;;;;;AAKnB;EA+FE,KAAA,WAAgB,eAAA,EAAiB,SAAA,UAAmB,YAAA,EAAc,CAAA,EAAG,QAAA,EAAU,YAAA,CAAa,CAAA;;;;AA7F9F;;;;;EAuGE,OAAA,WAAkB,eAAA,EAAiB,SAAA,UAAmB,QAAA,GAAW,YAAA,CAAa,CAAA;EAvGU;;;EA4GxF,UAAA;EA5GqE;;;;;AAEvE;;EAmHE,YAAA;EAjHuB;;;;EAuHvB,aAAA,IAAiB,OAAA;EApHc;;;;;;EA4H/B,OAAA;AAAA"}
@@ -0,0 +1,220 @@
1
+
2
+ //#region ../js-client-core/src/Emitter.d.ts
3
+ type EventType = string | symbol;
4
+ type EventsRecord = Record<EventType, any>;
5
+ type Handler<TEventsRecord extends EventsRecord, TKey extends keyof TEventsRecord> = (payload: TEventsRecord[TKey]) => void;
6
+ interface EventProvider<TEventsRecord extends EventsRecord> {
7
+ on<TName extends keyof TEventsRecord>(name: TName, handler: Handler<TEventsRecord, TName>): void;
8
+ off<TName extends keyof TEventsRecord>(name: TName, handler?: Handler<TEventsRecord, TName>): void;
9
+ clear(): void;
10
+ }
11
+ //#endregion
12
+ //#region ../shared/src/types.d.ts
13
+ declare const ConfigTypeList: readonly ["custom", "boolean", "string", "integer", "float", "enum", "url", "json"];
14
+ type ConfigType = (typeof ConfigTypeList)[number];
15
+ type ConfigEnumLikeType = {
16
+ [key: string]: string | number;
17
+ };
18
+ type ConfigValueType = string | number | boolean | object | ConfigEnumLikeType;
19
+ type ConfigState = {
20
+ id: string;
21
+ key: string;
22
+ type: ConfigType;
23
+ value: string | undefined | null;
24
+ valueId?: string | undefined | null;
25
+ };
26
+ type ConfigDirectorLoggingLevel = "debug" | "info" | "warn" | "error" | "off";
27
+ interface ConfigDirectorLogger {
28
+ debug(message: string, ...args: any): void;
29
+ info(message: string, ...args: any): void;
30
+ warn(message: string, ...args: any): void;
31
+ error(message: string, ...args: any): void;
32
+ }
33
+ type EvaluationReason = "found-match" | "config-state-missing" | "client-not-ready" | "type-mismatch" | "value-missing" | "invalid-number" | "invalid-json" | "invalid-boolean";
34
+ type ConfigEvaluation = {
35
+ key: string;
36
+ value: ConfigValueType;
37
+ valueId?: string;
38
+ isDefaultValue: boolean;
39
+ reason: EvaluationReason;
40
+ context?: ConfigDirectorContext;
41
+ };
42
+ /**
43
+ * The user's context to be sent to ConfigDirector. This context will be used for targeting
44
+ * rules evaluation.
45
+ */
46
+ type ConfigDirectorContext = {
47
+ /**
48
+ * The user's identifier. This should be a value that uniquely identifies an application
49
+ * user.
50
+ * In the case of anonymous users, you could generate a UUID or alternatively not provide
51
+ * the {@link id} and the SDK will generate a random UUID. However, keep in mind that this
52
+ * value is used for segmenting users in percentage rollouts, and changes to the {@link id}
53
+ * could result in the user being assigned to a different percentile.
54
+ */
55
+ id?: string;
56
+ /**
57
+ * The user's display name. This will be shown in the ConfigDirector dashboard and may be
58
+ * used for targeting rules.
59
+ */
60
+ name?: string;
61
+ /**
62
+ * Any arbitrary traits for the current user. They will be shown in the ConfigDirector
63
+ * dashboard and may be used for targeting rules.
64
+ */
65
+ traits?: {
66
+ [key: string]: unknown;
67
+ };
68
+ /**
69
+ * Whether or not to treat the context as anonymous during evaluation. When `true`, the
70
+ * context values will be used for targeting rules evaluation but the context will not be
71
+ * persisted and will not appear in the dashboard.
72
+ *
73
+ * @default false
74
+ */
75
+ anonymous?: boolean;
76
+ };
77
+ type ConnectionMode = "streaming" | "polling";
78
+ //#endregion
79
+ //#region ../js-client-core/src/types.d.ts
80
+ type ClientHooks = {
81
+ clientReady?: HookHandler<"clientReady"> | HookHandler<"clientReady">[];
82
+ configsUpdated?: HookHandler<"configsUpdated"> | HookHandler<"configsUpdated">[];
83
+ contextUpdated?: HookHandler<"contextUpdated"> | HookHandler<"contextUpdated">[];
84
+ configEvaluated?: HookHandler<"configEvaluated"> | HookHandler<"configEvaluated">[];
85
+ connectionError?: HookHandler<"connectionError"> | HookHandler<"connectionError">[];
86
+ };
87
+ type ClientConnectAction = "initialization" | "context update" | "network resume";
88
+ type HookHandler<TEvent extends keyof ClientEvents> = (payload: ClientEvents[TEvent]) => void;
89
+ type ClientEvents = {
90
+ configsUpdated: {
91
+ keys: string[];
92
+ removedKeys: string[];
93
+ };
94
+ clientReady: {
95
+ action: ClientConnectAction;
96
+ };
97
+ contextUpdated: {
98
+ context: ConfigDirectorContext | undefined;
99
+ };
100
+ configEvaluated: {
101
+ evaluation: ConfigEvaluation;
102
+ };
103
+ connectionError: {
104
+ error: Error;
105
+ };
106
+ };
107
+ type WatchHandler<T extends ConfigValueType> = (message: T) => void;
108
+ /**
109
+ * The ConfigDirector SDK client object.
110
+ *
111
+ * Applications should create a single instance of `ConfigDirectorClient`, and call
112
+ * {@link initialize} during application initialization.
113
+ *
114
+ * After initialization, to update the user's context, so that targeting rules are evaluated
115
+ * with the updated context, call {@link updateContext}.
116
+ */
117
+ interface ConfigDirectorClient extends EventProvider<ClientEvents> {
118
+ /**
119
+ * Initializes the connection to ConfigDirector to retrieve config evaluations. Until
120
+ * initialization is successful, all flags will return their default value provided to
121
+ * {@link watch} or {@link getValue}.
122
+ *
123
+ * If the connection fails or is interrupted with a transient error (network error,
124
+ * internal server error, etc) the client will continue to attempt to connect. However,
125
+ * if the connection fails with a persistent error, like an invalid SDK key, the client will
126
+ * not attempt to re-connect and an error will be logged to the console or the provided
127
+ * logger.
128
+ *
129
+ * @param context The current user's context to be used for evaluating targeting rules (optional).
130
+ */
131
+ initialize(context?: ConfigDirectorContext): Promise<void>;
132
+ /**
133
+ * Updates the user's context and re-evaluates all config and flag values based on the new context.
134
+ *
135
+ * @param context The current user's context to be used for evaluating targeting rules (required).
136
+ */
137
+ updateContext(context: ConfigDirectorContext): Promise<void>;
138
+ /**
139
+ * Returns the current context the client is configured with, or undefined if there is no context.
140
+ *
141
+ * Note that the value returned does not updated immediately after calling {@link updateContext}. Only
142
+ * once the underlying connection was successful or timed out, the current context is updated. This is
143
+ * because while the context update is in progress, configs are still evaluated on the previous context.
144
+ *
145
+ */
146
+ get context(): ConfigDirectorContext | undefined;
147
+ /**
148
+ * Returns whether or not the client is ready after calling {@link initialize} or {@link updateContext}
149
+ *
150
+ * The definition of ready is that the connection to the server was successful, and config state
151
+ * was received.
152
+ */
153
+ get isReady(): boolean;
154
+ /**
155
+ * Whether the client is trying to get its very first payload from the server. Upon client creation,
156
+ * it is `false`. It becomes `true` when `initialize` is called on a client that has never received a
157
+ * payload, stays `true` through timeouts and retries, and becomes `false` when the first payload
158
+ * arrives, when a fatal connection error stops the retries, or on `close`. `updateContext` and
159
+ * `resumeNetwork` never set it, and once a payload has been received it is never `true` again.
160
+ */
161
+ get isInitializing(): boolean;
162
+ /**
163
+ * Evaluates a config and returns its value based on the current context and targeting rules
164
+ *
165
+ * @returns The evaluated config value, or the `defaultValue` if the config state was unavailable
166
+ * @param configKey The config key to evaluate
167
+ * @param defaultValue The default value to be returned if the config state is unavailable. For
168
+ * example, if the client cannot connect to the server due to network conditions, or if getValue
169
+ * is called before initialization is done.
170
+ */
171
+ getValue<T extends ConfigValueType>(configKey: string, defaultValue: T): T;
172
+ /**
173
+ * Watches for changes to a a config evaluation value. Whenever the config value changes, the
174
+ * provided callback function will be called with the new value. Changes can happen due to updates
175
+ * to the config in the ConfigDirector dashboard, or if the context is updated via {@link updateContext}.
176
+ *
177
+ * @returns An 'unwatch' function that can be called to remove the subscriber
178
+ *
179
+ * @param configKey The config key to watch
180
+ * @param defaultValue The default value to be referenced if the config state is unavailable
181
+ * @param callback The callback function to be called whenever the config value is updated
182
+ */
183
+ watch<T extends ConfigValueType>(configKey: string, defaultValue: T, callback: WatchHandler<T>): () => void;
184
+ /**
185
+ * Removes a particular subscriber to the given `configKey`, or all subscribers if no callback
186
+ * is provided.
187
+ *
188
+ * @param configKey The config key to remove subscribers from
189
+ * @param callback The subscriber to be removed. If not provided, all subscribers are removed for
190
+ * the given `configKey`.
191
+ */
192
+ unwatch<T extends ConfigValueType>(configKey: string, callback?: WatchHandler<T>): void;
193
+ /**
194
+ * Removes all subscribers from all config keys
195
+ */
196
+ unwatchAll(): void;
197
+ /**
198
+ * Pauses the network connection without clearing event handlers, watch handlers, or config
199
+ * state. Intended for mobile environments where the OS may kill background connections (e.g.
200
+ * when the app is backgrounded on iOS/Android).
201
+ *
202
+ * Call {@link resumeNetwork} to re-establish the connection.
203
+ */
204
+ pauseNetwork(): void;
205
+ /**
206
+ * Resumes a connection that was paused via {@link pauseNetwork}, using the last context that
207
+ * was provided to {@link initialize} or {@link updateContext}.
208
+ */
209
+ resumeNetwork(): Promise<void>;
210
+ /**
211
+ * Disposes of the client. All connections are closed, and all event and config key subscribers
212
+ * are removed.
213
+ *
214
+ * Intended to be called when your application shuts down
215
+ */
216
+ dispose(): void;
217
+ }
218
+ //#endregion
219
+ export { ConfigDirectorLoggingLevel as a, ConnectionMode as c, ConfigDirectorLogger as i, ConfigDirectorClient as n, ConfigState as o, ConfigDirectorContext as r, ConfigValueType as s, ClientHooks as t };
220
+ //# sourceMappingURL=types-fL7X5zwg.d.cts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types-fL7X5zwg.d.cts","names":[],"sources":["../../../js-client-core/src/Emitter.ts","../../../shared/src/types.ts","../../../js-client-core/src/types.ts"],"mappings":";;KAAK,SAAA;AAAA,KACA,YAAA,GAAe,MAAA,CAAO,SAAA;AAAA,KAEtB,OAAA,uBAA8B,YAAA,qBAAiC,aAAA,KAClE,OAAA,EAAS,aAAA,CAAc,IAAA;AAAA,UAGR,aAAA,uBAAoC,YAAA;EACnD,EAAA,qBAAuB,aAAA,EAAe,IAAA,EAAM,KAAA,EAAO,OAAA,EAAS,OAAA,CAAQ,aAAA,EAAe,KAAA;EACnF,GAAA,qBAAwB,aAAA,EAAe,IAAA,EAAM,KAAA,EAAO,OAAA,GAAU,OAAA,CAAQ,aAAA,EAAe,KAAA;EACrF,KAAA;AAAA;;;cCVW,cAAA;AAAA,KAUD,UAAA,WAAqB,cAAA;AAAA,KAErB,kBAAA;EAAA,CAAwB,GAAA;AAAA;AAAA,KAExB,eAAA,wCAAuD,kBAAA;AAAA,KAEvD,WAAA;EACV,EAAA;EACA,GAAA;EACA,IAAA,EAAM,UAAA;EACN,KAAA;EACA,OAAA;AAAA;AAAA,KAQU,0BAAA;AAAA,UAEK,oBAAA;EACf,KAAA,CAAM,OAAA,aAAoB,IAAA;EAE1B,IAAA,CAAK,OAAA,aAAoB,IAAA;EAEzB,IAAA,CAAK,OAAA,aAAoB,IAAA;EAEzB,KAAA,CAAM,OAAA,aAAoB,IAAA;AAAA;AAAA,KAOhB,gBAAA;AAAA,KAUA,gBAAA;EACV,GAAA;EACA,KAAA,EAAO,eAAA;EACP,OAAA;EACA,cAAA;EACA,MAAA,EAAQ,gBAAA;EACR,OAAA,GAAU,qBAAA;AAAA;;;;;KAMA,qBAAA;ED1D2E;;;;;;;;ECmErF,EAAA;EDpE4C;;;;EC0E5C,IAAA;ED1EmD;;;;EC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