@walkeros/web-destination-piano 4.1.2 → 4.2.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.
- package/CHANGELOG.md +24 -0
- package/dist/dev.js.map +1 -1
- package/dist/dev.mjs.map +1 -1
- package/dist/index.browser.js +1 -1
- package/dist/index.es5.js +1 -1
- package/dist/walkerOS.json +4 -4
- package/package.json +4 -4
package/CHANGELOG.md
ADDED
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
# @walkeros/web-destination-piano
|
|
2
|
+
|
|
3
|
+
## 4.2.0
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- 8063504: Add the Piano Analytics web destination, forwarding events to the
|
|
8
|
+
official Piano `pa` SDK via sendEvent.
|
|
9
|
+
- Updated dependencies [76d32c1]
|
|
10
|
+
- Updated dependencies [908d6f0]
|
|
11
|
+
- Updated dependencies [e8f6909]
|
|
12
|
+
- Updated dependencies [f4a9013]
|
|
13
|
+
- Updated dependencies [d65bbde]
|
|
14
|
+
- Updated dependencies [d65bbde]
|
|
15
|
+
- Updated dependencies [e8f6909]
|
|
16
|
+
- Updated dependencies [c27d3c1]
|
|
17
|
+
- Updated dependencies [654ba38]
|
|
18
|
+
- Updated dependencies [6a72a32]
|
|
19
|
+
- Updated dependencies [3eb2467]
|
|
20
|
+
- Updated dependencies [5b1a134]
|
|
21
|
+
- Updated dependencies [23d4b86]
|
|
22
|
+
- Updated dependencies [18c9469]
|
|
23
|
+
- @walkeros/core@4.2.0
|
|
24
|
+
- @walkeros/web-core@4.2.0
|
package/dist/dev.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/dev.ts","../src/schemas/index.ts","../src/schemas/settings.ts","../src/schemas/mapping.ts","../src/examples/index.ts","../src/examples/env.ts","../src/examples/step.ts"],"sourcesContent":["export * as schemas from './schemas';\nexport * as examples from './examples';\n","import { zodToSchema } from '@walkeros/core/dev';\nimport { SettingsSchema } from './settings';\nimport { MappingSchema } from './mapping';\n\nexport { SettingsSchema, type Settings } from './settings';\nexport { MappingSchema, type Mapping } from './mapping';\n\n// JSON Schema\nexport const settings = zodToSchema(SettingsSchema);\nexport const mapping = zodToSchema(MappingSchema);\n","import { z } from '@walkeros/core/dev';\n\nexport const SettingsSchema = z.object({\n site: z\n .number()\n .describe('Piano Analytics site id (numeric), from your collection settings'),\n collectDomain: z\n .string()\n .describe('Collection domain endpoint, like https://xxxxxxx.pa-cd.com'),\n options: z\n .record(z.string(), z.unknown())\n .describe('Additional Piano setConfigurations options merged on init')\n .optional(),\n});\n\nexport type Settings = z.infer<typeof SettingsSchema>;\n","import { z } from '@walkeros/core/dev';\n\n/**\n * Piano Mapping Schema\n * Piano has no event-level mapping configuration\n */\nexport const MappingSchema = z.object({});\n\n/**\n * Type inference from MappingSchema\n */\nexport type Mapping = z.infer<typeof MappingSchema>;\n","export * as env from './env';\nexport * as step from './step';\n","import type { Env, PianoAnalytics } from '../types';\n\n/**\n * Example environment configurations for the Piano destination.\n *\n * These environments provide standardized mock structures for testing and\n * development without loading the real Piano SDK. They satisfy the `Env`\n * interface directly, so no type casts are needed.\n */\n\nconst noop = () => {};\n\n/** A no-op Piano SDK whose methods are wrapped by `mockEnv` to capture calls. */\nfunction mockPa(): PianoAnalytics {\n return {\n setConfigurations: noop,\n sendEvent: noop,\n sendEvents: noop,\n };\n}\n\n/** SDK not yet present: init must tolerate a missing `pa`. */\nexport const init: Env = {\n window: {},\n};\n\n/** SDK present: used for capturing setConfigurations/sendEvent calls. */\nexport const push: Env = {\n window: {\n pa: mockPa(),\n },\n};\n\n/**\n * Simulation tracking paths\n * Specifies which function calls to track during simulation\n */\nexport const simulation = [\n 'call:window.pa.sendEvent', // Track Piano sendEvent calls\n];\n","import type { Flow } from '@walkeros/core';\nimport { getEvent } from '@walkeros/core';\n\nconst settings = {\n site: 123456789,\n collectDomain: 'https://example.pa-cd.com',\n};\n\n/**\n * Destination bootstrap.\n * init configures the Piano `pa` SDK with the site id and collection domain\n * via setConfigurations.\n */\nexport const init: Flow.StepExample = {\n title: 'Initialization',\n description:\n 'Destination bootstrap configures Piano with the site id and collection domain.',\n in: {\n settings,\n },\n out: [['pa.setConfigurations', settings]],\n};\n\nexport const pageView: Flow.StepExample = {\n title: 'Page view',\n description:\n 'A page view fires a Piano page.display event with the page name and chapter.',\n in: getEvent('page view', { timestamp: 1700000200 }),\n mapping: {\n name: 'page.display',\n data: {\n map: {\n page: 'data.title',\n page_chapter1: 'globals.pagegroup',\n },\n },\n },\n out: [\n [\n 'pa.sendEvent',\n 'page.display',\n {\n page: 'walkerOS documentation',\n page_chapter1: 'docs',\n },\n ],\n ],\n};\n\nexport const purchase: Flow.StepExample = {\n title: 'Purchase',\n description:\n 'A completed order fires a Piano transaction.confirmation event with the transaction id, revenue and currency.',\n in: getEvent('order complete', { timestamp: 1700000201 }),\n mapping: {\n name: 'transaction.confirmation',\n data: {\n map: {\n transaction_id: 'data.id',\n revenue: 'data.total',\n currency: 'data.currency',\n },\n },\n },\n out: [\n [\n 'pa.sendEvent',\n 'transaction.confirmation',\n {\n transaction_id: '0rd3r1d',\n revenue: 555,\n currency: 'EUR',\n },\n ],\n ],\n};\n\nexport const customEvent: Flow.StepExample = {\n title: 'Custom event',\n description:\n 'A generic entity action fires a custom Piano event with mapped properties.',\n in: getEvent('entity action', { timestamp: 1700000202 }),\n mapping: {\n name: 'click.action',\n data: {\n map: {\n label: 'data.string',\n value: 'data.number',\n },\n },\n },\n out: [\n [\n 'pa.sendEvent',\n 'click.action',\n {\n label: 'foo',\n value: 1,\n },\n ],\n ],\n};\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;;ACAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,IAAAA,cAA4B;;;ACA5B,iBAAkB;AAEX,IAAM,iBAAiB,aAAE,OAAO;AAAA,EACrC,MAAM,aACH,OAAO,EACP,
|
|
1
|
+
{"version":3,"sources":["../src/dev.ts","../src/schemas/index.ts","../src/schemas/settings.ts","../src/schemas/mapping.ts","../src/examples/index.ts","../src/examples/env.ts","../src/examples/step.ts"],"sourcesContent":["export * as schemas from './schemas';\nexport * as examples from './examples';\n","import { zodToSchema } from '@walkeros/core/dev';\nimport { SettingsSchema } from './settings';\nimport { MappingSchema } from './mapping';\n\nexport { SettingsSchema, type Settings } from './settings';\nexport { MappingSchema, type Mapping } from './mapping';\n\n// JSON Schema\nexport const settings = zodToSchema(SettingsSchema);\nexport const mapping = zodToSchema(MappingSchema);\n","import { z } from '@walkeros/core/dev';\n\nexport const SettingsSchema = z.object({\n site: z\n .number()\n .describe(\n 'Piano Analytics site id (numeric), from your collection settings',\n ),\n collectDomain: z\n .string()\n .describe('Collection domain endpoint, like https://xxxxxxx.pa-cd.com'),\n options: z\n .record(z.string(), z.unknown())\n .describe('Additional Piano setConfigurations options merged on init')\n .optional(),\n});\n\nexport type Settings = z.infer<typeof SettingsSchema>;\n","import { z } from '@walkeros/core/dev';\n\n/**\n * Piano Mapping Schema\n * Piano has no event-level mapping configuration\n */\nexport const MappingSchema = z.object({});\n\n/**\n * Type inference from MappingSchema\n */\nexport type Mapping = z.infer<typeof MappingSchema>;\n","export * as env from './env';\nexport * as step from './step';\n","import type { Env, PianoAnalytics } from '../types';\n\n/**\n * Example environment configurations for the Piano destination.\n *\n * These environments provide standardized mock structures for testing and\n * development without loading the real Piano SDK. They satisfy the `Env`\n * interface directly, so no type casts are needed.\n */\n\nconst noop = () => {};\n\n/** A no-op Piano SDK whose methods are wrapped by `mockEnv` to capture calls. */\nfunction mockPa(): PianoAnalytics {\n return {\n setConfigurations: noop,\n sendEvent: noop,\n sendEvents: noop,\n };\n}\n\n/** SDK not yet present: init must tolerate a missing `pa`. */\nexport const init: Env = {\n window: {},\n};\n\n/** SDK present: used for capturing setConfigurations/sendEvent calls. */\nexport const push: Env = {\n window: {\n pa: mockPa(),\n },\n};\n\n/**\n * Simulation tracking paths\n * Specifies which function calls to track during simulation\n */\nexport const simulation = [\n 'call:window.pa.sendEvent', // Track Piano sendEvent calls\n];\n","import type { Flow } from '@walkeros/core';\nimport { getEvent } from '@walkeros/core';\n\nconst settings = {\n site: 123456789,\n collectDomain: 'https://example.pa-cd.com',\n};\n\n/**\n * Destination bootstrap.\n * init configures the Piano `pa` SDK with the site id and collection domain\n * via setConfigurations.\n */\nexport const init: Flow.StepExample = {\n title: 'Initialization',\n description:\n 'Destination bootstrap configures Piano with the site id and collection domain.',\n in: {\n settings,\n },\n out: [['pa.setConfigurations', settings]],\n};\n\nexport const pageView: Flow.StepExample = {\n title: 'Page view',\n description:\n 'A page view fires a Piano page.display event with the page name and chapter.',\n in: getEvent('page view', { timestamp: 1700000200 }),\n mapping: {\n name: 'page.display',\n data: {\n map: {\n page: 'data.title',\n page_chapter1: 'globals.pagegroup',\n },\n },\n },\n out: [\n [\n 'pa.sendEvent',\n 'page.display',\n {\n page: 'walkerOS documentation',\n page_chapter1: 'docs',\n },\n ],\n ],\n};\n\nexport const purchase: Flow.StepExample = {\n title: 'Purchase',\n description:\n 'A completed order fires a Piano transaction.confirmation event with the transaction id, revenue and currency.',\n in: getEvent('order complete', { timestamp: 1700000201 }),\n mapping: {\n name: 'transaction.confirmation',\n data: {\n map: {\n transaction_id: 'data.id',\n revenue: 'data.total',\n currency: 'data.currency',\n },\n },\n },\n out: [\n [\n 'pa.sendEvent',\n 'transaction.confirmation',\n {\n transaction_id: '0rd3r1d',\n revenue: 555,\n currency: 'EUR',\n },\n ],\n ],\n};\n\nexport const customEvent: Flow.StepExample = {\n title: 'Custom event',\n description:\n 'A generic entity action fires a custom Piano event with mapped properties.',\n in: getEvent('entity action', { timestamp: 1700000202 }),\n mapping: {\n name: 'click.action',\n data: {\n map: {\n label: 'data.string',\n value: 'data.number',\n },\n },\n },\n out: [\n [\n 'pa.sendEvent',\n 'click.action',\n {\n label: 'foo',\n value: 1,\n },\n ],\n ],\n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;AAAA,EACP,aACE;AAAA,EACF,QAAI,sBAAS,aAAa,EAAE,WAAW,WAAW,CAAC;AAAA,EACnD,SAAS;AAAA,IACP,MAAM;AAAA,IACN,MAAM;AAAA,MACJ,KAAK;AAAA,QACH,MAAM;AAAA,QACN,eAAe;AAAA,MACjB;AAAA,IACF;AAAA,EACF;AAAA,EACA,KAAK;AAAA,IACH;AAAA,MACE;AAAA,MACA;AAAA,MACA;AAAA,QACE,MAAM;AAAA,QACN,eAAe;AAAA,MACjB;AAAA,IACF;AAAA,EACF;AACF;AAEO,IAAM,WAA6B;AAAA,EACxC,OAAO;AAAA,EACP,aACE;AAAA,EACF,QAAI,sBAAS,kBAAkB,EAAE,WAAW,WAAW,CAAC;AAAA,EACxD,SAAS;AAAA,IACP,MAAM;AAAA,IACN,MAAM;AAAA,MACJ,KAAK;AAAA,QACH,gBAAgB;AAAA,QAChB,SAAS;AAAA,QACT,UAAU;AAAA,MACZ;AAAA,IACF;AAAA,EACF;AAAA,EACA,KAAK;AAAA,IACH;AAAA,MACE;AAAA,MACA;AAAA,MACA;AAAA,QACE,gBAAgB;AAAA,QAChB,SAAS;AAAA,QACT,UAAU;AAAA,MACZ;AAAA,IACF;AAAA,EACF;AACF;AAEO,IAAM,cAAgC;AAAA,EAC3C,OAAO;AAAA,EACP,aACE;AAAA,EACF,QAAI,sBAAS,iBAAiB,EAAE,WAAW,WAAW,CAAC;AAAA,EACvD,SAAS;AAAA,IACP,MAAM;AAAA,IACN,MAAM;AAAA,MACJ,KAAK;AAAA,QACH,OAAO;AAAA,QACP,OAAO;AAAA,MACT;AAAA,IACF;AAAA,EACF;AAAA,EACA,KAAK;AAAA,IACH;AAAA,MACE;AAAA,MACA;AAAA,MACA;AAAA,QACE,OAAO;AAAA,QACP,OAAO;AAAA,MACT;AAAA,IACF;AAAA,EACF;AACF;","names":["import_dev","import_dev","init","settings"]}
|
package/dist/dev.mjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/schemas/index.ts","../src/schemas/settings.ts","../src/schemas/mapping.ts","../src/examples/index.ts","../src/examples/env.ts","../src/examples/step.ts"],"sourcesContent":["import { zodToSchema } from '@walkeros/core/dev';\nimport { SettingsSchema } from './settings';\nimport { MappingSchema } from './mapping';\n\nexport { SettingsSchema, type Settings } from './settings';\nexport { MappingSchema, type Mapping } from './mapping';\n\n// JSON Schema\nexport const settings = zodToSchema(SettingsSchema);\nexport const mapping = zodToSchema(MappingSchema);\n","import { z } from '@walkeros/core/dev';\n\nexport const SettingsSchema = z.object({\n site: z\n .number()\n .describe('Piano Analytics site id (numeric), from your collection settings'),\n collectDomain: z\n .string()\n .describe('Collection domain endpoint, like https://xxxxxxx.pa-cd.com'),\n options: z\n .record(z.string(), z.unknown())\n .describe('Additional Piano setConfigurations options merged on init')\n .optional(),\n});\n\nexport type Settings = z.infer<typeof SettingsSchema>;\n","import { z } from '@walkeros/core/dev';\n\n/**\n * Piano Mapping Schema\n * Piano has no event-level mapping configuration\n */\nexport const MappingSchema = z.object({});\n\n/**\n * Type inference from MappingSchema\n */\nexport type Mapping = z.infer<typeof MappingSchema>;\n","export * as env from './env';\nexport * as step from './step';\n","import type { Env, PianoAnalytics } from '../types';\n\n/**\n * Example environment configurations for the Piano destination.\n *\n * These environments provide standardized mock structures for testing and\n * development without loading the real Piano SDK. They satisfy the `Env`\n * interface directly, so no type casts are needed.\n */\n\nconst noop = () => {};\n\n/** A no-op Piano SDK whose methods are wrapped by `mockEnv` to capture calls. */\nfunction mockPa(): PianoAnalytics {\n return {\n setConfigurations: noop,\n sendEvent: noop,\n sendEvents: noop,\n };\n}\n\n/** SDK not yet present: init must tolerate a missing `pa`. */\nexport const init: Env = {\n window: {},\n};\n\n/** SDK present: used for capturing setConfigurations/sendEvent calls. */\nexport const push: Env = {\n window: {\n pa: mockPa(),\n },\n};\n\n/**\n * Simulation tracking paths\n * Specifies which function calls to track during simulation\n */\nexport const simulation = [\n 'call:window.pa.sendEvent', // Track Piano sendEvent calls\n];\n","import type { Flow } from '@walkeros/core';\nimport { getEvent } from '@walkeros/core';\n\nconst settings = {\n site: 123456789,\n collectDomain: 'https://example.pa-cd.com',\n};\n\n/**\n * Destination bootstrap.\n * init configures the Piano `pa` SDK with the site id and collection domain\n * via setConfigurations.\n */\nexport const init: Flow.StepExample = {\n title: 'Initialization',\n description:\n 'Destination bootstrap configures Piano with the site id and collection domain.',\n in: {\n settings,\n },\n out: [['pa.setConfigurations', settings]],\n};\n\nexport const pageView: Flow.StepExample = {\n title: 'Page view',\n description:\n 'A page view fires a Piano page.display event with the page name and chapter.',\n in: getEvent('page view', { timestamp: 1700000200 }),\n mapping: {\n name: 'page.display',\n data: {\n map: {\n page: 'data.title',\n page_chapter1: 'globals.pagegroup',\n },\n },\n },\n out: [\n [\n 'pa.sendEvent',\n 'page.display',\n {\n page: 'walkerOS documentation',\n page_chapter1: 'docs',\n },\n ],\n ],\n};\n\nexport const purchase: Flow.StepExample = {\n title: 'Purchase',\n description:\n 'A completed order fires a Piano transaction.confirmation event with the transaction id, revenue and currency.',\n in: getEvent('order complete', { timestamp: 1700000201 }),\n mapping: {\n name: 'transaction.confirmation',\n data: {\n map: {\n transaction_id: 'data.id',\n revenue: 'data.total',\n currency: 'data.currency',\n },\n },\n },\n out: [\n [\n 'pa.sendEvent',\n 'transaction.confirmation',\n {\n transaction_id: '0rd3r1d',\n revenue: 555,\n currency: 'EUR',\n },\n ],\n ],\n};\n\nexport const customEvent: Flow.StepExample = {\n title: 'Custom event',\n description:\n 'A generic entity action fires a custom Piano event with mapped properties.',\n in: getEvent('entity action', { timestamp: 1700000202 }),\n mapping: {\n name: 'click.action',\n data: {\n map: {\n label: 'data.string',\n value: 'data.number',\n },\n },\n },\n out: [\n [\n 'pa.sendEvent',\n 'click.action',\n {\n label: 'foo',\n value: 1,\n },\n ],\n ],\n};\n"],"mappings":";;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,SAAS,mBAAmB;;;ACA5B,SAAS,SAAS;AAEX,IAAM,iBAAiB,EAAE,OAAO;AAAA,EACrC,MAAM,EACH,OAAO,EACP,
|
|
1
|
+
{"version":3,"sources":["../src/schemas/index.ts","../src/schemas/settings.ts","../src/schemas/mapping.ts","../src/examples/index.ts","../src/examples/env.ts","../src/examples/step.ts"],"sourcesContent":["import { zodToSchema } from '@walkeros/core/dev';\nimport { SettingsSchema } from './settings';\nimport { MappingSchema } from './mapping';\n\nexport { SettingsSchema, type Settings } from './settings';\nexport { MappingSchema, type Mapping } from './mapping';\n\n// JSON Schema\nexport const settings = zodToSchema(SettingsSchema);\nexport const mapping = zodToSchema(MappingSchema);\n","import { z } from '@walkeros/core/dev';\n\nexport const SettingsSchema = z.object({\n site: z\n .number()\n .describe(\n 'Piano Analytics site id (numeric), from your collection settings',\n ),\n collectDomain: z\n .string()\n .describe('Collection domain endpoint, like https://xxxxxxx.pa-cd.com'),\n options: z\n .record(z.string(), z.unknown())\n .describe('Additional Piano setConfigurations options merged on init')\n .optional(),\n});\n\nexport type Settings = z.infer<typeof SettingsSchema>;\n","import { z } from '@walkeros/core/dev';\n\n/**\n * Piano Mapping Schema\n * Piano has no event-level mapping configuration\n */\nexport const MappingSchema = z.object({});\n\n/**\n * Type inference from MappingSchema\n */\nexport type Mapping = z.infer<typeof MappingSchema>;\n","export * as env from './env';\nexport * as step from './step';\n","import type { Env, PianoAnalytics } from '../types';\n\n/**\n * Example environment configurations for the Piano destination.\n *\n * These environments provide standardized mock structures for testing and\n * development without loading the real Piano SDK. They satisfy the `Env`\n * interface directly, so no type casts are needed.\n */\n\nconst noop = () => {};\n\n/** A no-op Piano SDK whose methods are wrapped by `mockEnv` to capture calls. */\nfunction mockPa(): PianoAnalytics {\n return {\n setConfigurations: noop,\n sendEvent: noop,\n sendEvents: noop,\n };\n}\n\n/** SDK not yet present: init must tolerate a missing `pa`. */\nexport const init: Env = {\n window: {},\n};\n\n/** SDK present: used for capturing setConfigurations/sendEvent calls. */\nexport const push: Env = {\n window: {\n pa: mockPa(),\n },\n};\n\n/**\n * Simulation tracking paths\n * Specifies which function calls to track during simulation\n */\nexport const simulation = [\n 'call:window.pa.sendEvent', // Track Piano sendEvent calls\n];\n","import type { Flow } from '@walkeros/core';\nimport { getEvent } from '@walkeros/core';\n\nconst settings = {\n site: 123456789,\n collectDomain: 'https://example.pa-cd.com',\n};\n\n/**\n * Destination bootstrap.\n * init configures the Piano `pa` SDK with the site id and collection domain\n * via setConfigurations.\n */\nexport const init: Flow.StepExample = {\n title: 'Initialization',\n description:\n 'Destination bootstrap configures Piano with the site id and collection domain.',\n in: {\n settings,\n },\n out: [['pa.setConfigurations', settings]],\n};\n\nexport const pageView: Flow.StepExample = {\n title: 'Page view',\n description:\n 'A page view fires a Piano page.display event with the page name and chapter.',\n in: getEvent('page view', { timestamp: 1700000200 }),\n mapping: {\n name: 'page.display',\n data: {\n map: {\n page: 'data.title',\n page_chapter1: 'globals.pagegroup',\n },\n },\n },\n out: [\n [\n 'pa.sendEvent',\n 'page.display',\n {\n page: 'walkerOS documentation',\n page_chapter1: 'docs',\n },\n ],\n ],\n};\n\nexport const purchase: Flow.StepExample = {\n title: 'Purchase',\n description:\n 'A completed order fires a Piano transaction.confirmation event with the transaction id, revenue and currency.',\n in: getEvent('order complete', { timestamp: 1700000201 }),\n mapping: {\n name: 'transaction.confirmation',\n data: {\n map: {\n transaction_id: 'data.id',\n revenue: 'data.total',\n currency: 'data.currency',\n },\n },\n },\n out: [\n [\n 'pa.sendEvent',\n 'transaction.confirmation',\n {\n transaction_id: '0rd3r1d',\n revenue: 555,\n currency: 'EUR',\n },\n ],\n ],\n};\n\nexport const customEvent: Flow.StepExample = {\n title: 'Custom event',\n description:\n 'A generic entity action fires a custom Piano event with mapped properties.',\n in: getEvent('entity action', { timestamp: 1700000202 }),\n mapping: {\n name: 'click.action',\n data: {\n map: {\n label: 'data.string',\n value: 'data.number',\n },\n },\n },\n out: [\n [\n 'pa.sendEvent',\n 'click.action',\n {\n label: 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aACE;AAAA,EACF,IAAI,SAAS,aAAa,EAAE,WAAW,WAAW,CAAC;AAAA,EACnD,SAAS;AAAA,IACP,MAAM;AAAA,IACN,MAAM;AAAA,MACJ,KAAK;AAAA,QACH,MAAM;AAAA,QACN,eAAe;AAAA,MACjB;AAAA,IACF;AAAA,EACF;AAAA,EACA,KAAK;AAAA,IACH;AAAA,MACE;AAAA,MACA;AAAA,MACA;AAAA,QACE,MAAM;AAAA,QACN,eAAe;AAAA,MACjB;AAAA,IACF;AAAA,EACF;AACF;AAEO,IAAM,WAA6B;AAAA,EACxC,OAAO;AAAA,EACP,aACE;AAAA,EACF,IAAI,SAAS,kBAAkB,EAAE,WAAW,WAAW,CAAC;AAAA,EACxD,SAAS;AAAA,IACP,MAAM;AAAA,IACN,MAAM;AAAA,MACJ,KAAK;AAAA,QACH,gBAAgB;AAAA,QAChB,SAAS;AAAA,QACT,UAAU;AAAA,MACZ;AAAA,IACF;AAAA,EACF;AAAA,EACA,KAAK;AAAA,IACH;AAAA,MACE;AAAA,MACA;AAAA,MACA;AAAA,QACE,gBAAgB;AAAA,QAChB,SAAS;AAAA,QACT,UAAU;AAAA,MACZ;AAAA,IACF;AAAA,EACF;AACF;AAEO,IAAM,cAAgC;AAAA,EAC3C,OAAO;AAAA,EACP,aACE;AAAA,EACF,IAAI,SAAS,iBAAiB,EAAE,WAAW,WAAW,CAAC;AAAA,EACvD,SAAS;AAAA,IACP,MAAM;AAAA,IACN,MAAM;AAAA,MACJ,KAAK;AAAA,QACH,OAAO;AAAA,QACP,OAAO;AAAA,MACT;AAAA,IACF;AAAA,EACF;AAAA,EACA,KAAK;AAAA,IACH;AAAA,MACE;AAAA,MACA;AAAA,MACA;AAAA,QACE,OAAO;AAAA,QACP,OAAO;AAAA,MACT;AAAA,IACF;AAAA,EACF;AACF;","names":["z","init","settings"]}
|
package/dist/index.browser.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";var Destination=(()=>{var t=Object.defineProperty,e=Object.getOwnPropertyDescriptor,n=Object.getOwnPropertyNames,
|
|
1
|
+
"use strict";var Destination=(()=>{var t=Object.defineProperty,e=Object.getOwnPropertyDescriptor,n=Object.getOwnPropertyNames,r=Object.prototype.hasOwnProperty,o={};((e,n)=>{for(var r in n)t(e,r,{get:n[r],enumerable:!0})})(o,{DestinationPiano:()=>y,default:()=>E,destinationPiano:()=>b});var i=Object.defineProperty,c=(t,e)=>{for(var n in e)i(t,n,{get:e[n],enumerable:!0})};function a(t,e){if("collector"===t)return"collector";if(!e)throw new Error(`stepId(${t}) requires an id`);return`${t}.${e}`}c({},{stepId:()=>a});function u(t,e){const n=t.destinations[e];if(!n)throw new Error(`Destination not found: ${e}`);return n}c({},{getDestination:()=>u});c({},{Level:()=>f});var s,f=((s=f||{})[s.ERROR=0]="ERROR",s[s.WARN=1]="WARN",s[s.INFO=2]="INFO",s[s.DEBUG=3]="DEBUG",s);function l(t,e){const n=t.transformers[e];if(!n)throw new Error(`Transformer not found: ${e}`);return n}c({},{getTransformer:()=>l});function d(t,e){const n=t.sources[e];if(!n)throw new Error(`Source not found: ${e}`);return n}c({},{getSource:()=>d});function p(t,e){const n=t.stores[e];if(!n)throw new Error(`Store not found: ${e}`);return n}async function w(t,e){return await t.get(e)}function g(t){return void 0!==t}function v(t){return"object"==typeof t&&null!==t&&!function(t){return Array.isArray(t)}(t)&&"[object Object]"===Object.prototype.toString.call(t)}c({},{getStore:()=>p,getStoreValue:()=>w});var y={},m="https://tag.aticdn.net/piano-analytics.js",b={type:"piano",config:{},init({config:t,env:e}){const n=t.settings||{};t.loadScript&&function(t=m){if("undefined"==typeof document)return;const e=document.createElement("script");e.src=t,document.head.appendChild(e)}();const r=O(e);return r&&g(n.site)&&g(n.collectDomain)&&r.setConfigurations({site:n.site,collectDomain:n.collectDomain,...v(n.options)?n.options:{}}),t},push(t,{data:e,env:n}){const r=O(n);r&&r.sendEvent(t.name,v(e)?e:{})}};function O(t){var e,n;return null!=(n=null==(e=t.window)?void 0:e.pa)?n:"undefined"!=typeof window?window.pa:void 0}var j,E=b;return j=o,((o,i,c,a)=>{if(i&&"object"==typeof i||"function"==typeof i)for(let u of n(i))r.call(o,u)||u===c||t(o,u,{get:()=>i[u],enumerable:!(a=e(i,u))||a.enumerable});return o})(t({},"__esModule",{value:!0}),j)})();
|
package/dist/index.es5.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";function
|
|
1
|
+
"use strict";function asyncGeneratorStep(t,e,n,r,o,i,u){try{var c=t[i](u),a=c.value}catch(t){return void n(t)}c.done?e(a):Promise.resolve(a).then(r,o)}function _async_to_generator(t){return function(){var e=this,n=arguments;return new Promise(function(r,o){var i=t.apply(e,n);function u(t){asyncGeneratorStep(i,r,o,u,c,"next",t)}function c(t){asyncGeneratorStep(i,r,o,u,c,"throw",t)}u(void 0)})}}function _define_property(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function _object_spread(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter(function(t){return Object.getOwnPropertyDescriptor(n,t).enumerable}))),r.forEach(function(e){_define_property(t,e,n[e])})}return t}function _type_of(t){return t&&"undefined"!=typeof Symbol&&t.constructor===Symbol?"symbol":typeof t}function _ts_generator(t,e){var n,r,o,i={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]},u=Object.create(("function"==typeof Iterator?Iterator:Object).prototype),c=Object.defineProperty;return c(u,"next",{value:a(0)}),c(u,"throw",{value:a(1)}),c(u,"return",{value:a(2)}),"function"==typeof Symbol&&c(u,Symbol.iterator,{value:function(){return this}}),u;function a(c){return function(a){return function(c){if(n)throw new TypeError("Generator is already executing.");for(;u&&(u=0,c[0]&&(i=0)),i;)try{if(n=1,r&&(o=2&c[0]?r.return:c[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,c[1])).done)return o;switch(r=0,o&&(c=[2&c[0],o.value]),c[0]){case 0:case 1:o=c;break;case 4:return i.label++,{value:c[1],done:!1};case 5:i.label++,r=c[1],c=[0];continue;case 7:c=i.ops.pop(),i.trys.pop();continue;default:if(!(o=i.trys,(o=o.length>0&&o[o.length-1])||6!==c[0]&&2!==c[0])){i=0;continue}if(3===c[0]&&(!o||c[1]>o[0]&&c[1]<o[3])){i.label=c[1];break}if(6===c[0]&&i.label<o[1]){i.label=o[1],o=c;break}if(o&&i.label<o[2]){i.label=o[2],i.ops.push(c);break}o[2]&&i.ops.pop(),i.trys.pop();continue}c=e.call(t,i)}catch(t){c=[6,t],r=0}finally{n=o=0}if(5&c[0])throw c[1];return{value:c[0]?c[1]:void 0,done:!0}}([c,a])}}}var Destination=function(){var t=function(t,e){if("collector"===t)return"collector";if(!e)throw new Error("stepId(".concat(t,") requires an id"));return"".concat(t,".").concat(e)},e=function(t,e){var n=t.destinations[e];if(!n)throw new Error("Destination not found: ".concat(e));return n},n=function(t,e){var n=t.transformers[e];if(!n)throw new Error("Transformer not found: ".concat(e));return n},r=function(t,e){var n=t.sources[e];if(!n)throw new Error("Source not found: ".concat(e));return n},o=function(t,e){var n=t.stores[e];if(!n)throw new Error("Store not found: ".concat(e));return n},i=function(t,e){return _async_to_generator(function(){return _ts_generator(this,function(n){switch(n.label){case 0:return[4,t.get(e)];case 1:return[2,n.sent()]}})})()},u=function(t){return void 0!==t},c=function(t){return"object"==(void 0===t?"undefined":_type_of(t))&&null!==t&&!function(t){return Array.isArray(t)}(t)&&"[object Object]"===Object.prototype.toString.call(t)},a=function(t){var e,n;return null!==(e=null===(n=t.window)||void 0===n?void 0:n.pa)&&void 0!==e?e:"undefined"!=typeof window?window.pa:void 0},f=Object.defineProperty,l=Object.getOwnPropertyDescriptor,s=Object.getOwnPropertyNames,p=Object.prototype.hasOwnProperty,d={};!function(t,e){for(var n in e)f(t,n,{get:e[n],enumerable:!0})}(d,{DestinationPiano:function(){return g},default:function(){return O},destinationPiano:function(){return _}});var y=Object.defineProperty,v=function(t,e){for(var n in e)y(t,n,{get:e[n],enumerable:!0})};v({},{stepId:function(){return t}});v({},{getDestination:function(){return e}});v({},{Level:function(){return w}});var b,w=((b=w||{})[b.ERROR=0]="ERROR",b[b.WARN=1]="WARN",b[b.INFO=2]="INFO",b[b.DEBUG=3]="DEBUG",b);v({},{getTransformer:function(){return n}});v({},{getSource:function(){return r}});v({},{getStore:function(){return o},getStoreValue:function(){return i}});var h,g={},m="https://tag.aticdn.net/piano-analytics.js",_={type:"piano",config:{},init:function(t){var e=t.config,n=t.env,r=e.settings||{};e.loadScript&&function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:m;if("undefined"!=typeof document){var e=document.createElement("script");e.src=t,document.head.appendChild(e)}}();var o=a(n);return o&&u(r.site)&&u(r.collectDomain)&&o.setConfigurations(_object_spread({site:r.site,collectDomain:r.collectDomain},c(r.options)?r.options:{})),e},push:function(t,e){var n=e.data,r=e.env,o=a(r);o&&o.sendEvent(t.name,c(n)?n:{})}},O=_;return h=d,function(t,e,n,r){if(e&&"object"===(void 0===e?"undefined":_type_of(e))||"function"==typeof e){var o=!0,i=!1,u=void 0;try{for(var c,a=function(){var o=c.value;p.call(t,o)||o===n||f(t,o,{get:function(){return e[o]},enumerable:!(r=l(e,o))||r.enumerable})},d=s(e)[Symbol.iterator]();!(o=(c=d.next()).done);o=!0)a()}catch(t){i=!0,u=t}finally{try{o||null==d.return||d.return()}finally{if(i)throw u}}}return t}(f({},"__esModule",{value:!0}),h)}();
|
package/dist/walkerOS.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"$meta": {
|
|
3
3
|
"package": "@walkeros/web-destination-piano",
|
|
4
|
-
"version": "4.
|
|
4
|
+
"version": "4.2.0",
|
|
5
5
|
"type": "destination",
|
|
6
6
|
"platform": [
|
|
7
7
|
"web"
|
|
@@ -112,7 +112,7 @@
|
|
|
112
112
|
"consent": {
|
|
113
113
|
"functional": true
|
|
114
114
|
},
|
|
115
|
-
"id": "
|
|
115
|
+
"id": "c898433fccc34cb3",
|
|
116
116
|
"trigger": "test",
|
|
117
117
|
"entity": "entity",
|
|
118
118
|
"action": "action",
|
|
@@ -203,7 +203,7 @@
|
|
|
203
203
|
"consent": {
|
|
204
204
|
"functional": true
|
|
205
205
|
},
|
|
206
|
-
"id": "
|
|
206
|
+
"id": "3a7b0a98a12b8cbf",
|
|
207
207
|
"trigger": "load",
|
|
208
208
|
"entity": "page",
|
|
209
209
|
"action": "view",
|
|
@@ -314,7 +314,7 @@
|
|
|
314
314
|
"consent": {
|
|
315
315
|
"functional": true
|
|
316
316
|
},
|
|
317
|
-
"id": "
|
|
317
|
+
"id": "ba7920202e1eba5e",
|
|
318
318
|
"trigger": "load",
|
|
319
319
|
"entity": "order",
|
|
320
320
|
"action": "complete",
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@walkeros/web-destination-piano",
|
|
3
3
|
"description": "Piano Analytics web destination for walkerOS",
|
|
4
|
-
"version": "4.
|
|
4
|
+
"version": "4.2.0",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"main": "./dist/index.js",
|
|
7
7
|
"module": "./dist/index.mjs",
|
|
@@ -38,11 +38,11 @@
|
|
|
38
38
|
"update": "npx npm-check-updates -u && npm update"
|
|
39
39
|
},
|
|
40
40
|
"dependencies": {
|
|
41
|
-
"@walkeros/core": "4.
|
|
42
|
-
"@walkeros/web-core": "4.
|
|
41
|
+
"@walkeros/core": "4.2.0",
|
|
42
|
+
"@walkeros/web-core": "4.2.0"
|
|
43
43
|
},
|
|
44
44
|
"devDependencies": {
|
|
45
|
-
"@walkeros/collector": "4.
|
|
45
|
+
"@walkeros/collector": "4.2.0"
|
|
46
46
|
},
|
|
47
47
|
"repository": {
|
|
48
48
|
"url": "git+https://github.com/elbwalker/walkerOS.git",
|